content
stringlengths 5
1.05M
|
|---|
local function scrape()
for line in io.lines("/proc/meminfo") do
local name, size, unit = string.match(line, "([^:]+):%s+(%d+)%s?(k?B?)")
if unit == 'kB' then
size = size * 1024
end
metric("node_memory_"..name:gsub("[):]", ""):gsub("[(]", "_").."_bytes",
"gauge", nil, size)
end
end
return { scrape = scrape }
|
-----------------------------------------------------------|
--[[
Read Me
#Maps in github
Loadout:
Lets players Swap weapons and loadouts.
Main Game:
It is the main game.
Screenshots:
This is an empty project that houses the billboard's images
#Systems
Equipment Handler:
Manages equipment/skins that the player can use and any data the creator desires. Other scripts can acces the equipment/skins stored into this.
@Adding Weapons and equipment
PurchaseCredits:
Handles purchasing credits.
Purchase:
Manages purchasing credits and the text box that appears.
Storage:
Manages Equipment that players have and transfers that to the client.
LifeTime Stats:
Stores player data over the course of their strike team career
Funnel:
Manages the player funnel of where the hangups and pauses are. d1 only.
LootBox:
Rewards players a loot crate item.
Chat:
Lets the admin have powers to control the game such as gifting skins, kicking players, flying.
Rank Manager:
Manages ranks from what min to max level and returns an image based on the scale you need such as in end screen or player list.
Loadout Equipment:
Controls Equipment that gets equipped to the player based on their storage.
Lets players swap weapons.
Player Storage:
Assigns storage to the player. Built up from Storage.
XP Systen:
Manages the player level and any information that can be gained from it such as level gained difference
LootBoxUI:
Renders the lootbox including date and time till next opening.
Player UI:
UpdateLocal:
Mimics the storage key to the client.
MenuState:
Changes state depending on what is needed on screen such as going to the lootbox.
Loadout:
Main ui that is used for changing equipment and rendering items.
#Information:
Adding Weapons and equipment:
Adding weapons/equipment and skins to the equipment handler.
Adding Weapons:
Weapon template is the basis for data storage of equipment and on there you will find:
script - ignore
Weapon - The item that will be equipped to the player.
DefaultSkin - The Skin that will be the default when equipping the player if no other skin is found. Please see adding skins.
Description - Description of the item.
ID - Independent id of item for storage and equipping. Must not clash with anothers id. *Note: Has to be 2 char long
Hoister - Where on the body is the item placed if not equipped.
RotationOffset - Used to align Equipment rotation
Scale - Scales the Equipment in the renderer
Level - makes it so the Equipment cannot be used unless the level is reached
Prestige - makes it so the Equipment cannot be used unless the Prestige is reached
Cost - Cost of Equipment
Icon - Unused. Icon for the weapon
The weapons are modifided versions of the default weapons but the default will work also.
The only real difference that will need to take note of is that the weapon art will need to be seperated and used as a skin.
You will need to Add the custom properties that are strings.
SprintStance - Animation stance
WeaponType - name of weapon (used for achievements)
Adding skins:
Skins are empty geometry with scoping scripts on them. And the scopes Geo.
Skin Template is for storing the data in the handler:
Skin - The skin object.
Level - Locks the skin to a level
ID - The skins independent id. *Note: this can match with other skin ids as long as the other skin is on a different weapon. *Note: Has to be 2 char long
Rarity - The skin rarity that will show in the loadout will affect the cost.
EventSkin - A booleon that will hide the skin in the loadout if the player doesnt have it. Used for events.
]]
-----------------------------------------------------------|
|
local _2afile_2a = "fnl/aniseed/string.fnl"
local _0_
do
local name_0_ = "conjure-macroexpand.aniseed.string"
local module_0_
do
local x_0_ = package.loaded[name_0_]
if ("table" == type(x_0_)) then
module_0_ = x_0_
else
module_0_ = {}
end
end
module_0_["aniseed/module"] = name_0_
module_0_["aniseed/locals"] = ((module_0_)["aniseed/locals"] or {})
do end (module_0_)["aniseed/local-fns"] = ((module_0_)["aniseed/local-fns"] or {})
do end (package.loaded)[name_0_] = module_0_
_0_ = module_0_
end
local autoload
local function _1_(...)
return (require("conjure-macroexpand.aniseed.autoload")).autoload(...)
end
autoload = _1_
local function _2_(...)
local ok_3f_0_, val_0_ = nil, nil
local function _2_()
return {autoload("conjure-macroexpand.aniseed.core")}
end
ok_3f_0_, val_0_ = pcall(_2_)
if ok_3f_0_ then
_0_["aniseed/local-fns"] = {autoload = {a = "conjure-macroexpand.aniseed.core"}}
return val_0_
else
return print(val_0_)
end
end
local _local_0_ = _2_(...)
local a = _local_0_[1]
local _2amodule_2a = _0_
local _2amodule_name_2a = "conjure-macroexpand.aniseed.string"
do local _ = ({nil, _0_, nil, {{}, nil, nil, nil}})[2] end
local join
do
local v_0_
do
local v_0_0
local function join0(...)
local args = {...}
local function _3_(...)
if (2 == a.count(args)) then
return args
else
return {"", a.first(args)}
end
end
local _let_0_ = _3_(...)
local sep = _let_0_[1]
local xs = _let_0_[2]
local len = a.count(xs)
local result = {}
if (len > 0) then
for i = 1, len do
local x = xs[i]
local _4_
if ("string" == type(x)) then
_4_ = x
elseif (nil == x) then
_4_ = x
else
_4_ = a["pr-str"](x)
end
if _4_ then
table.insert(result, _4_)
else
end
end
end
return table.concat(result, sep)
end
v_0_0 = join0
_0_["join"] = v_0_0
v_0_ = v_0_0
end
local t_0_ = (_0_)["aniseed/locals"]
t_0_["join"] = v_0_
join = v_0_
end
local split
do
local v_0_
do
local v_0_0
local function split0(s, pat)
local done_3f = false
local acc = {}
local index = 1
while not done_3f do
local start, _end = string.find(s, pat, index)
if ("nil" == type(start)) then
table.insert(acc, string.sub(s, index))
done_3f = true
else
table.insert(acc, string.sub(s, index, (start - 1)))
index = (_end + 1)
end
end
return acc
end
v_0_0 = split0
_0_["split"] = v_0_0
v_0_ = v_0_0
end
local t_0_ = (_0_)["aniseed/locals"]
t_0_["split"] = v_0_
split = v_0_
end
local blank_3f
do
local v_0_
do
local v_0_0
local function blank_3f0(s)
return (a["empty?"](s) or not string.find(s, "[^%s]"))
end
v_0_0 = blank_3f0
_0_["blank?"] = v_0_0
v_0_ = v_0_0
end
local t_0_ = (_0_)["aniseed/locals"]
t_0_["blank?"] = v_0_
blank_3f = v_0_
end
local triml
do
local v_0_
do
local v_0_0
local function triml0(s)
return string.gsub(s, "^%s*(.-)", "%1")
end
v_0_0 = triml0
_0_["triml"] = v_0_0
v_0_ = v_0_0
end
local t_0_ = (_0_)["aniseed/locals"]
t_0_["triml"] = v_0_
triml = v_0_
end
local trimr
do
local v_0_
do
local v_0_0
local function trimr0(s)
return string.gsub(s, "(.-)%s*$", "%1")
end
v_0_0 = trimr0
_0_["trimr"] = v_0_0
v_0_ = v_0_0
end
local t_0_ = (_0_)["aniseed/locals"]
t_0_["trimr"] = v_0_
trimr = v_0_
end
local trim
do
local v_0_
do
local v_0_0
local function trim0(s)
return string.gsub(s, "^%s*(.-)%s*$", "%1")
end
v_0_0 = trim0
_0_["trim"] = v_0_0
v_0_ = v_0_0
end
local t_0_ = (_0_)["aniseed/locals"]
t_0_["trim"] = v_0_
trim = v_0_
end
return nil
|
include("shared.lua")
local MaxHorisontal = 14
local frame = nil
local MaxWagons = 0
local MaxWagonsOnPlayer = 0
local Settings = {
Train = 1,
Adv = 1,
WagNum = 3,
Texture = "",
Lighter = 1,
PassTexture = "",
CabTexture = "",
ARS = 1,
Cran = 1,
Prom = 1,
Mask = 1,
PiterMsk = 1,
LED = 0,
BPSN = 1,
KVSnd = 1,
OldKVPos = 0,
Horn = 0,
NM = 8.2,
Battery = 0,
Switches = 1,
SwitchesR = 0,
DoorsL = 0,
DoorsR = 0,
GV = 1,
PB = 0,
Bort = 1,
MVM = 0,
Hand = 1,
Lamp = 1,
Seat = 1,
Breakers = 0,
Blok = 1,
PNM = 0,
BlokEN = 0,
}
local Types = {
"Train,WagNum,PassTexture,CabTexture,Texture,Lighter,ARS,Cran,Mask,LED,BPSN,KVSnd,Horn,NM,Battery,Switches,SwitchesR,DoorsL,DoorsR,GV,PB,Bort,MVM,Hand,Seat,Lamp,Breakers,Adv,PNM",
"Train,WagNum,PassTexture,CabTexture,Texture,Lighter,Blok,Cran,PiterMsk,LED,BPSN,KVSnd,Horn,NM,Battery,Switches,SwitchesR,DoorsL,DoorsR,GV,PB,Bort,Hand,Seat,Lamp,Breakers,Adv,PNM,BlokEN",
"Train,WagNum,PassTexture,CabTexture,Texture,NM,Battery,DoorsL,DoorsR,GV,PB,Adv",
"Train,WagNum,PassTexture,CabTexture,Texture,NM,Battery,DoorsL,DoorsR,GV,PB,Adv",
"Train,WagNum,Texture,Prom,Horn,NM,Battery,Switches,SwitchesR,DoorsL,DoorsR,GV,PB,PNM",
"Train,WagNum",
}
local function UpdateConCMD()
for k,v in pairs(Settings) do
RunConsoleCommand("train_spawner_"..k:lower(), v)
end
end
local function LoadConCMD()
for k in pairs(Settings) do
if type(Settings[k]) == "string" then
Settings[k] = GetConVarString("train_spawner_"..k:lower())
else
Settings[k] = GetConVarNumber("train_spawner_"..k:lower())
end
end
end
local Pos = 0
local VGUI = {}
local function CreateList(name,text,tbl,OnSelect)
tbl = tbl or {}
local ListLabel = vgui.Create("DLabel", frame)
ListLabel:SetPos(5 + 300*math.floor(Pos/MaxHorisontal), 24+24*(Pos%MaxHorisontal))
ListLabel:SetSize(500,28)
ListLabel:SetText(text)
local List = vgui.Create("DComboBox", frame)--
List:SetPos(130 + 300*math.floor(Pos/MaxHorisontal), 28+24*(Pos%MaxHorisontal))
List:SetWide(80)
if #tbl > 0 then
for i=1,#tbl do
List:AddChoice(tbl[i], i, Settings[name] == i)
end
else
for k,v in pairs(tbl) do
local name = k
if type(v) == "table" and v.name then name = v.name end
List:AddChoice(name, v, Settings[name] == v)
end
end
List.OnSelect = function(self,_, _, index)
Settings[name] = index
UpdateConCMD()
if OnSelect then OnSelect(List,ListLabel) end
end
table.insert(VGUI,function()
local on = Types[Settings.Train]:find(name) and tbl
List:SetVisible(on)
ListLabel:SetVisible(on)
if on then
ListLabel:SetPos(5 + 300*math.floor(Pos/MaxHorisontal),24+24*(Pos%MaxHorisontal))
List:SetPos(130 + 300*math.floor(Pos/MaxHorisontal),28+24*(Pos%MaxHorisontal))
Pos = Pos + 1
end
end)
VGUI[name] = List
if Types[Settings.Train]:find(name) and #tbl > 0 then Pos = Pos + 1 end
end
local function CreateSlider(name,decimals,min,max,text,OnSelect)
local Slider = vgui.Create("DNumSlider", frame)
Slider:SetPos(5 + 300*math.floor(Pos/MaxHorisontal), 28+24*(Pos%MaxHorisontal)-7)
Slider:SetWide(290)
Slider:SetMinMax(min, max)
Slider:SetDecimals(decimals)
Slider:SetText(text..":")
if Settings[name] > max then Settings[name] = max end
Slider:SetValue(Settings[name])
local _old = Slider.ValueChanged
function Slider:ValueChanged(...)
_old(self, ...)
Settings[name] = math.Round(self:GetValue(),decimals)
UpdateConCMD()
if OnSelect then OnSelect(Slider) end
end
table.insert(VGUI,function()
local on = Types[Settings.Train]:find(name)
Slider:SetVisible(on)
if on then
Slider:SetPos(5 + 300*math.floor(Pos/MaxHorisontal), 28+24*(Pos%MaxHorisontal)-7)
Pos = Pos + 1
end
end)
VGUI[name] = Slider
if Types[Settings.Train]:find(name) then Pos = Pos + 1 end
end
local function CreateCheckBox(name,text,OnSelect)
--if not Types[Settings.Train]:find(name) then return end
local CBLabel = vgui.Create("DLabel", frame)--
CBLabel:SetPos(5 + 300*math.floor(Pos/MaxHorisontal), 25+24*(Pos%MaxHorisontal))
CBLabel:SetText(text)
CBLabel:SetWide(130)
local CB = vgui.Create("DCheckBox", frame)
CB:SetPos(130 + 300*math.floor(Pos/MaxHorisontal), 28+24*(Pos%MaxHorisontal))
CB:SetValue(Settings[name])
function CB:OnChange()
Settings[name] = CB:GetChecked() and 1 or 0
UpdateConCMD()
if OnSelect then OnSelect(CB,CBLabel) end
end
table.insert(VGUI,function()
local on = Types[Settings.Train]:find(name)
CBLabel:SetVisible(on)
CB:SetVisible(on)
if on then
CBLabel:SetPos(5 + 300*math.floor(Pos/MaxHorisontal),25+24*(Pos%MaxHorisontal))
CB:SetPos(130 + 300*math.floor(Pos/MaxHorisontal),28+24*(Pos%MaxHorisontal))
Pos = Pos + 1
end
end)
VGUI[name] = CB
if Types[Settings.Train]:find(name) then Pos = Pos + 1 end
end
local function UpdateTrainList()
Pos = 0
if (Metrostroi.Skins["train"][Settings.Texture] or {}).typ ~= Metrostroi.TrainSpawnerConverter[Settings.Train or 1] then Settings.Texture = nil end
VGUI.Texture:Clear()
if (Metrostroi.Skins["pass"][Settings.PassTexture] or {}).typ ~= Metrostroi.TrainSpawnerConverter[Settings.Train or 1] then Settings.PassTexture = nil end
VGUI.PassTexture:Clear()
if (Metrostroi.Skins["cab"][Settings.CabTexture] or {}).typ ~= Metrostroi.TrainSpawnerConverter[Settings.Train or 1] then Settings.CabTexture = nil end
VGUI.CabTexture:Clear()
for typ,skins in pairs(Metrostroi.Skins) do
for k,v in pairs(skins) do
if type(v) ~= "table" then continue end
local id = "Texture"
if typ == "pass" then id = "PassTexture" end
if typ == "cab" then id = "CabTexture" end
if v.typ == Metrostroi.TrainSpawnerConverter[Settings.Train or 1] then
if not Settings[id] then
Settings[id] = k
end
VGUI[id]:AddChoice(v.name or k, k, k == Settings[id])
end
end
end
--[[
end
for k,v in pairs(Metrostroi.Skins["pass"] or {} ) do
if v.typ == Metrostroi.TrainSpawnerConverter[Settings.Train or 1] then
if not Settings.PassTexture then
Settings.PassTexture = k
end
VGUI.PassTexture:AddChoice(v.name or v, k, k == Settings.PassTexture)
end
end
for k,v in pairs(Metrostroi.Skins["cab"] or {} ) do
if v.typ == Metrostroi.TrainSpawnerConverter[Settings.Train or 1] then
if not Settings.CabTexture then
Settings.CabTexture = k
end
VGUI.CabTexture:AddChoice(v.name or v, k, k == Settings.CabTexture)
end
end
]]
for k,v in ipairs(VGUI) do
v()
end
frame:SetSize(275 + 275*math.floor((Pos-1)/MaxHorisontal), 58+24*math.min(MaxHorisontal,Pos))
frame:Center()
if VGUI.Close then VGUI.Close() end
if VGUI.spawn then VGUI.spawn() end
end
local function Draw()
local Texture = {}
for k,v in pairs(Metrostroi.Skins["train"] or {}) do
if v.typ == Metrostroi.TrainSpawnerConverter[Settings.Train or 1] then Texture[v.name or k] = v.name or k end
--end
end
local PassTexture = {}
for k,v in pairs(Metrostroi.Skins["pass"] or {}) do
if v.typ == Metrostroi.TrainSpawnerConverter[Settings.Train or 1] then PassTexture[v.name or k] = v.name or k end
end
local CabTexture = {}
for k,v in pairs(Metrostroi.Skins["cab"] or {}) do
if v.typ == Metrostroi.TrainSpawnerConverter[Settings.Train or 1] then CabTexture[v.name or k] = v.name or k end
end
CreateList("Train","Train("..GetGlobalInt("metrostroi_train_count").."/"..MaxWagons.."):\nMax for you:"..MaxWagonsOnPlayer,{"81-71x MVM","81-71x LVZ","E","EmA","Ezh","81-703x"},UpdateTrainList)
CreateSlider("WagNum",0,1, GetGlobalInt("metrostroi_maxwagons"),"Wagons")
CreateList("Texture","Texture",Texture)
CreateList("PassTexture","Passenger texture",PassTexture)
CreateList("CabTexture","Cabin texture",CabTexture)
CreateList("Adv","Adverts",{"Type1","Type2","Type3","No adverts"})
CreateList("Cran","Cran type",{"334","013"})
CreateSlider("NM",1,0.1,9,"Train Line Pressure")
CreateList("ARS","ARS Type",{"Standart(square lamps)","Standart(round lamps)","Kiev/St.Petersburg","Old ARS"})
CreateList("Blok","Autodrive panel",{"PUAV","PA-KSD","PA-M","PA-KSD-M"})
CreateCheckBox("BlokEN","Autodrive in English")
CreateList("Mask","Mask",{"2-2","2-2-2","1-4-1 bumper 1","1-4-1 bumper 2","1-1","Retro"})
CreateList("PiterMsk","PiterMsk",{"1-4-1","2-2 Down-2","2-2","2-2-2","1-3-1"})
CreateList("BPSN","BPSN type",{"Old high tone","Old medium tone","Normal(from St.Petersburg)","Normal(TKL)","Normal","Old tone","No sound(BPN-115)"})
CreateList("Seat","Seat type",{"Old","New"})
CreateList("Hand","Hand rail type",{"Old","New"})
CreateList("Bort","Bort",{"Horisontal","Vertical"})
CreateList("Lamp","Lamp type",{"Type1","Type2","Type3"})
CreateCheckBox("PNM","PNM Informer")
CreateCheckBox("Lighter","Lighter")
CreateCheckBox("MVM","MVM icon")
CreateCheckBox("GV","Main Switch")
CreateCheckBox("Battery","Battery")
CreateCheckBox("PB","Parking brake")
CreateCheckBox("Switches","AutoBreakers",function()
if Settings.Switches == 0 then VGUI.SwitchesR:OnChange() end
end)
CreateCheckBox("SwitchesR","Random",function(self)
if Settings.Switches == 0 and self:GetChecked() then
self:SetValue(Settings.Switches)
end
end)
CreateCheckBox("DoorsL","Left doors")
CreateCheckBox("DoorsR","Right doors")
CreateCheckBox("Prom","Interim wags")
CreateCheckBox("Breakers","Right-syde breakers")
CreateCheckBox("LED","LED")
CreateList("KVSnd","KV snd",{"Dildo","Type2","Type3"})
CreateCheckBox("OldKVPos","Old KV pos")
CreateCheckBox("Horn","Piter horn")
UpdateTrainList()
end
local function createFrame()
MaxWagons = GetGlobalInt("metrostroi_maxtrains")*GetGlobalInt("metrostroi_maxwagons")
MaxWagonsOnPlayer = GetGlobalInt("metrostroi_maxtrains_onplayer")*GetGlobalInt("metrostroi_maxwagons")
if GetConVarString("gmod_toolmode") == "train_spawner" then RunConsoleCommand("gmod_toolmode", "weld") end
if !frame or !frame:IsValid() then
Pos = 0
VGUI = {}
frame = vgui.Create("DFrame")
frame:SetDeleteOnClose(true)
frame:SetTitle("Train Spawner")
--frame:SetSize(275, 34+24*17)
frame:SetDraggable(false)
frame:SetSizable(false)
frame:MakePopup()
LoadConCMD()
Draw()
frame:SetSize(275 + 275*math.floor((Pos-1)/MaxHorisontal), 58+24*math.min(MaxHorisontal,Pos))
frame:Center()
local Close = vgui.Create("DButton", frame)
Close:SetWide(80)
Close:SetPos(5, frame:GetTall() - Close:GetTall() - 5)
Close:SetText("Close")
Close.DoClick = function()
frame:Close()
end
VGUI["Close"] = function()
if IsValid(Close) and IsValid(frame) then Close:SetPos(5, frame:GetTall() - Close:GetTall() - 5) end
end
local spawn = vgui.Create("DButton", frame)
spawn:SetWide(80)
spawn:SetPos(frame:GetWide() - Close:GetWide() - 5, frame:GetTall() - Close:GetTall() - 5)
spawn:SetText("Spawn Tool")
VGUI["spawn"] = function()
if IsValid(spawn) and IsValid(frame) then spawn:SetPos(frame:GetWide() - Close:GetWide() - 5, frame:GetTall() - Close:GetTall() - 5) end
end
spawn.DoClick = function()
local Tool = GetConVarString("gmod_toolmode")
if Tool == "train_spawner" then Tool = "weld" end
RunConsoleCommand("train_spawner_oldT", Tool)
RunConsoleCommand("train_spawner_oldW", LocalPlayer():GetActiveWeapon():GetClass())
RunConsoleCommand("gmod_tool", "train_spawner")
frame:Close()
end
end
end
net.Receive("MetrostroiTrainSpawner",createFrame)
net.Receive("MetrostroiMaxWagons", function()
MaxWagons = GetGlobalInt("metrostroi_maxtrains")*GetGlobalInt("metrostroi_maxwagons")
MaxWagonsOnPlayer = GetGlobalInt("metrostroi_maxtrains_onplayer")*GetGlobalInt("metrostroi_maxwagons")
if trainTypeT and trainTypeT:IsValid() then trainTypeT:SetText("Train("..GetGlobalInt("metrostroi_train_count").."/"..MaxWagons.."):\nMax for you:"..MaxWagonsOnPlayer) end
end
)
net.Receive("MetrostroiTrainCount", function()
if trainTypeT and trainTypeT:IsValid() then trainTypeT:SetText("Train("..GetGlobalInt("metrostroi_train_count").."/"..MaxWagons.."):\nMax for you:"..MaxWagonsOnPlayer) end
end
)
|
module("httpRuntime",package.seeeall)
-- Http Runtime Api
-- Receive Device Bound Notification
function receiveDeviceBoundNotification(fa, iotName, id, auth)
local b,c,h = fa.request{url="https://"..iotName..".azure-devices.net/devices/"..id.."/messages/deviceBound?api-version=2016-11-14",
method = "GET",
headers = {["Authorization"] = auth,
["Content-Length"] = body:len(),
["Content-Type"] = "application/json"
}
}
return b
end
-- Send Device Event
function sendDeviceEvent(fa, iotName, id, auth, body)
local b,c,h = fa.request{url="https://"..iotName..".azure-devices.net/devices/"..id.."/messages/events?api-version=2016-11-14",
method = "POST",
headers = {["Authorization"] = auth,
["Content-Length"] = body:len(),
["Content-Type"] = "application/json"
},
body = body
}
return b
end
|
require 'busted.runner'()
expose("Inheritance functionality tests #component #inheritance", function()
local classA = _G.frostmoon.components["Inherit.A"]
local classB = _G.frostmoon.components["Inherit.B"]
local a = A{} --Create a default instance of A
local b = B{} --Create a default instance of B
it("Assert that A and B class prototypes exist", function()
assert.is.truthy(classA)
assert.is.truthy(classB)
end)
it("Assert that a and b exist", function()
assert.is.truthy(a)
assert.is.truthy(b)
end)
it("Assert that the default values are initialized and correct",function ()
for k,v in pairs(classA.defaults) do
assert.is.truthy(a[k])
assert.are.equal(classA.defaults[k], a[k])
end
for k,v in pairs(classB.defaults) do
assert.is.truthy(b[k])
assert.are.equal(classB.defaults[k], b[k])
end
end)
it("Assert that the inherited functions are correct", function()
assert.are.equal(a.testA(), b.testA()) --B should inherit A's function testA
end)
it("Assert that the default initialized values are different for each class", function()
for k,v in pairs(a.defaults) do
local a_val = a.defaults[k]
local b_val = b.defaults[k]
assert.are_not.equals(a_val, b_val)
end
end)
it("A should not have any of B's functions", function ()
local x = a.testB
assert.is.falsy(x)
end)
it("B's parent should be A", function ()
assert.are.equal(b.__parent, "Inherit.A")
end)
end)
|
local class = require("extlibs.middleclass")
BayesClassifier = class('BayesClassifier')
function BayesClassifier:initialize(attrCount, classCount)
self.attrCount = attrCount
self.classCount = classCount
self.m = 2.0
self.p = 0.5
end
function BayesClassifier:classify(trainingData, testData)
local probabilities = {}
--Calculate the probability for each classification in the training data.
for classification, trainSet in pairs(trainingData) do
probabilities[classification] = 1.0
local matches = {}
for attr=1, self.attrCount, 1 do
matches[attr] = 0
for i=1, table.getn(trainSet), 1 do
if testData[attr] == trainSet[i][attr] then
matches[attr] = matches[attr] + 1
end
end
probabilities[classification] =
probabilities[classification] * ((matches[attr] + (self.m * self.p))/(self.classCount + self.m))
end
end
--Pick the best probability.
result = ""
maxProb = 0
for classification, probability in pairs(probabilities) do
if probability > maxProb then
maxProb = probability
result = classification
end
end
return result
end
|
-- Box.lua
Box = {}
Box.__index = Box
setmetatable(Box, {
__call = function (cls, ...)
local self = setmetatable({}, cls)
self:_init(...)
return self
end,
})
function Box:_init(x, y, width, height, scale, color, cam)
self.scale = scale or 5
self.x = x - self.scale
self.y = y
self.width = width*self.scale+2*self.scale
self.height = height*self.scale
self.color = color or {255, 255, 255, 255}
self.cam = cam
end
function Box:draw ()
offsetX, offsetY = 0,0
if self.cam then
offsetX, offsetY = cam:getVisibleCorners()
end
love.graphics.setColor(self.color)
self.x = self.x + offsetX
self.y = self.y + offsetY
love.graphics.rectangle("fill", -- mode
self.x,
self.y,
self.width,
self.height, 10, 10)
end
function Box:update ()
--body...
end
|
function startCycler_vote()
addCommandHandler("skipmap", cycleMap_vote, true)
cycleMap_vote()
addEventHandler("onRoundFinished", rootElement, roundCounter)
end
function cycleMap_vote()
-- This increases the server startup speed - ('voteBetweenModes' will fail with no players anyway)
if #getElementsByType("player") < 1 then
remainingRounds = get("vote_rounds")
return
end
local allModes = exports.mapmanager:getGamemodes()
local modeSelection = {}
-- get up to eight random modes with a compatible map
math.randomseed(getTickCount())
while #modeSelection < 8 do
if #allModes == 0 then
break
end
local randomIndex = math.random(1, #allModes)
local randomMode = allModes[randomIndex]
local compatibleMaps = exports.mapmanager:getMapsCompatibleWithGamemode(randomMode)
local randomMap = nil
if #compatibleMaps > 0 then
randomMap = compatibleMaps[math.random(1, #compatibleMaps)]
end
table.insert(modeSelection, {randomMode, randomMap})
table.remove(allModes, randomIndex)
end
exports.votemanager:voteBetweenModes(unpack(modeSelection))
remainingRounds = get("vote_rounds")
end
|
local _, CLM = ...
local LOG = CLM.LOG
local MODULES = CLM.MODULES
local UTILS = CLM.UTILS
local EventManager = MODULES.EventManager
local EVENT_END_AUCTION = "CLM_AUCTION_END"
local AuctionHistoryManager = {}
local CHANNELS = {
[1] = "SAY",
[2] = "EMOTE",
[3] = "PARTY",
[4] = "GUILD",
[5] = "OFFICER",
[6] = "YELL",
[7] = "RAID",
[8] = "RAID_WARNING"
}
function AuctionHistoryManager:Initialize()
LOG:Trace("AuctionHistoryManager:Initialize()")
self.db = MODULES.Database:Personal('auctionHistory', {
stack = {},
-- config
enable = true,
post_bids = true,
post_bids_channel = 5
})
EventManager:RegisterEvent(EVENT_END_AUCTION, function(_, data)
if not self:GetEnabled() then return end
table.insert(self.db.stack, 1, {
link = data.link,
id = data.id,
bids = data.bids,
time = data.time
})
if self:GetPostBids() then
local channel = CHANNELS[self:GetPostBidsChannel()] or "OFFICER"
SendChatMessage(data.link, channel)
local noBids = true
for bidder,bid in pairs(data.bids) do
noBids = false
SendChatMessage(bidder .. ": " .. tostring(bid) .. CLM.L[" DKP "], channel)
end
if noBids then
SendChatMessage(CLM.L["No bids"], channel)
end
end
CLM.GUI.AuctionHistory:Refresh(true)
end)
self.uuidCache = {}
local options = {
auction_history_header = {
type = "header",
name = CLM.L["Auctioning - History"],
order = 39
},
auction_history_store_bids = {
name = CLM.L["Store bids"],
desc = CLM.L["Store finished auction bids information."],
type = "toggle",
set = function(i, v) self:SetEnabled(v) end,
get = function(i) return self:GetEnabled() end,
-- width = "double",
order = 40
},
auction_history_post_bids = {
name = CLM.L["Post bids"],
desc = CLM.L["Toggles posting bids in selected channel after auction has ended."],
type = "toggle",
set = function(i, v) self:SetPostBids(v) end,
get = function(i) return self:GetPostBids() end,
-- width = "double",
order = 41
},
auction_history_post_bids_channel = {
name = CLM.L["Post channel"],
desc = CLM.L["Channel for posting bids."],
type = "select",
values = CHANNELS,
set = function(i, v) self:SetPostBidsChannel(v) end,
get = function(i) return self:GetPostBidsChannel() end,
-- width = "double",
order = 42
}
}
MODULES.ConfigManager:Register(CLM.CONSTANTS.CONFIGS.GROUP.GLOBAL, options)
MODULES.ConfigManager:RegisterUniversalExecutor("ah", "Auction History", self)
end
function AuctionHistoryManager:SetEnabled(value)
self.db.enable = value and true or false
end
function AuctionHistoryManager:GetEnabled()
return self.db.enable
end
function AuctionHistoryManager:SetPostBids(value)
self.db.post_bids = value and true or false
end
function AuctionHistoryManager:GetPostBids()
return self.db.post_bids
end
function AuctionHistoryManager:SetPostBidsChannel(value)
local channel = CHANNELS[value]
if channel then
self.db.post_bids_channel = value
end
end
function AuctionHistoryManager:GetPostBidsChannel()
return self.db.post_bids_channel
end
function AuctionHistoryManager:CorrelateWithLoot(time, uuid)
for _, auction in ipairs(self.db.stack) do
if auction.time == time then
if not auction.uuid then
auction.uuid = {}
end
auction.uuid[uuid] = true
end
end
end
function AuctionHistoryManager:GetByUUID(uuid)
if not uuid then return end
local info = self.uuidCache[uuid]
if not info then
for _, auction in ipairs(self.db.stack) do
if auction.uuid and auction.uuid[uuid] then
info = auction
self.uuidCache[uuid] = auction
break
end
end
end
return info
end
function AuctionHistoryManager:GetHistory()
return self.db.stack
end
function AuctionHistoryManager:Remove(id)
id = tonumber(id) or 0
if (id <= #self.db.stack) and (id >= 1) then
table.remove(self.db.stack, id)
CLM.GUI.AuctionHistory:Refresh(true)
end
end
function AuctionHistoryManager:RemoveOld(time)
time = tonumber(time) or 2678400 -- 31 days old
local cutoff = GetServerTime() - time
UTILS.OnePassRemove(self.db.stack, function(t, i, j)
return t[i].time > cutoff
end)
CLM.GUI.AuctionHistory:Refresh(true)
end
function AuctionHistoryManager:Wipe()
while(#self.db.stack > 0) do
table.remove(self.db.stack)
end
CLM.GUI.AuctionHistory:Refresh(true)
end
MODULES.AuctionHistoryManager = AuctionHistoryManager
|
-- rGroupFinder: core
-- zork, 2018
-----------------------------
-- Local Variables
-----------------------------
local A, L = ...
L.addonName = A
-----------------------------
-- Config
-----------------------------
local wordQuestsOnly = false
-----------------------------
-- Functions
-----------------------------
local function AddGroupFinderButton(block, questID)
if IsQuestComplete(questID) then return end
if wordQuestsOnly and not QuestUtils_IsQuestWorldQuest(questID) then return end
if block.groupFinderButton and block.hasGroupFinderButton then return end
if not block.hasGroupFinderButton then
block.hasGroupFinderButton = true
end
if not block.groupFinderButton then
block.groupFinderButton = QuestObjectiveFindGroup_AcquireButton(block, questID);
QuestObjectiveSetupBlockButton_AddRightButton(block, block.groupFinderButton, block.module.buttonOffsets.groupFinder);
end
end
-----------------------------
-- Hook
-----------------------------
hooksecurefunc("QuestObjectiveSetupBlockButton_FindGroup", AddGroupFinderButton)
|
-- vim: ts=2 sw=2 sts=2 et :
-- testing table routines
-- (c) 2021 Tim Menzies (timm@ieee.org) unlicense.org
package.path = '../src/?.lua;' .. package.path
local Tbl, Lib = require("tbl"), require("lib")
local o,oo = Lib.o,Lib.oo
local function r(z) return Lib.round(z,3) end
local function _t1()
local t=Tbl()
for row in Lib.csv("data/auto93.csv") do t:add(row) end
local the=Lib.the()
-- print(#t.cols)
-- print(#t.x)
-- print(#t.y)
-- for _,col in pairs(t.x) do Lib.o(col); print(""); end
assert(8==#t.cols,"length of lst")
return t,the
end
local r2=function(z) return z end
local function _t2()
local t,the = _t1()
for n,row in pairs(t.rows) do
local l=t:neighbors(row,the)
o(l[1][1])
end
end
local function _t3()
local t,the = _t1()
for n,row in pairs(t.rows) do
local l=t:neighbors(row,the)
print("")
print(oo(row.cells))
print(oo(l[2][2].cells), r(l[2][1]), " <== near")
print(oo(l[#l][2].cells),r(l[#l][1])," <== far")
end
end
_t3()
Lib.rogues()
|
-- bar.lua
|
local API_NPC = require(script:GetCustomProperty("API_NPC"))
local API_D = require(script:GetCustomProperty("APIDamage"))
local API_P = require(script:GetCustomProperty("APIProjectile"))
local API_K = require(script:GetCustomProperty("APIKnockback"))
local API_SE = require(script:GetCustomProperty("APIStatusEffects"))
local API_RE = require(script:GetCustomProperty("APIReliableEvents"))
local DRAGON_PATHS = script:GetCustomProperty("DragonPaths"):WaitForObject()
local GRID_CORNERS = script:GetCustomProperty("GridCorners"):WaitForObject()
local ROCK_TEMPLATE = script:GetCustomProperty("RockTemplate")
local RANGE = 0.0
local COOLDOWN = 25.0 -- This must be higher than DRAGON_ANGLE_LIMIT / DRAGON_SPEED because this isn't written to handle two dragons
local DRAGON_ANGLE_LIMIT = 45.0
local DRAGON_SPEED = 4.0 -- Degrees/second
local DAMAGE = 70.0
local ROCK_SPEED = 2000.0
local IMPACT_RADIUS = 500.0
local GRID_SIZE = Vector2.New(3, 4) -- Because of helper position, valid spots go all the way down to 0 here
local gridOrigin = GRID_CORNERS:FindChildByName("Origin"):GetWorldPosition()
local gridStepX = (GRID_CORNERS:FindChildByName("X"):GetWorldPosition() - gridOrigin) / GRID_SIZE.x
local gridStepY = (GRID_CORNERS:FindChildByName("Y"):GetWorldPosition() - gridOrigin) / GRID_SIZE.y
_G.boss3Rocks = {} -- int -> CoreObject
local currentTask = nil -- Not using a table because we don't always have the npc, and it really shouldn't matter
function GetPriority(npc, taskHistory)
return 2.0
end
function OnTaskStart(npc, threatTable)
function GetRocksIndex(coordinate)
-- We add 5 because we go a bit off the ends of this.
return coordinate.x + coordinate.y * (GRID_SIZE.x + 5)
end
local stream = RandomStream.New()
API_RE.BroadcastToAllPlayers("CD", stream:GetInitialSeed())
currentTask = Task.Spawn(function()
local targetCoordinate = nil
while not targetCoordinate or _G.boss3Rocks[GetRocksIndex(targetCoordinate)] do
targetCoordinate = Vector2.New(stream:GetInteger(0, GRID_SIZE.x), stream:GetInteger(0, GRID_SIZE.y))
end
local targetPosition = gridOrigin + targetCoordinate.x * gridStepX + targetCoordinate.y * gridStepY
-- These are actually just the peaks. We do an arc of a circle.
local pathGroups = DRAGON_PATHS:GetChildren()
local pathPeak = pathGroups[stream:GetInteger(1, #pathGroups)]
-- Dragon always throws the rock at 0.0 degrees
local impactDelay = DRAGON_ANGLE_LIMIT / DRAGON_SPEED + API_P.GetTravelTime(pathPeak, targetPosition, ROCK_SPEED)
Task.Wait(impactDelay)
API_D.ApplyAreaDamage(npc, targetPosition, IMPACT_RADIUS, DAMAGE, false, API_D.TAG_AOE)
API_K.AreaKnockAway(targetPosition, IMPACT_RADIUS, 110.0)
for _, hitNpc in pairs(API_NPC.GetAwakeNPCsInSphere(targetPosition, IMPACT_RADIUS)) do
API_SE.ApplyStatusEffect(npc, hitNpc, API_SE.STATUS_EFFECT_DEFINITIONS["Crushed"].id)
end
local rockRotation = Rotation.New(0.0, -90.0, math.random() * 360.0)
_G.boss3Rocks[GetRocksIndex(targetCoordinate)] = World.SpawnAsset(ROCK_TEMPLATE, {position = targetPosition, rotation = rockRotation})
end)
return 0.5
end
function OnTaskEnd(npc, interrupted)
end
function ResetRocks()
if currentTask then
currentTask:Cancel()
currentTask = nil
end
for _, rock in pairs(_G.boss3Rocks) do
rock:Destroy()
end
_G.boss3Rocks = {}
end
API_RE.Connect("Boss3Reset", ResetRocks) -- This is kind of a hack, in that it will break if we give this task to another NPC
API_RE.Connect("Boss3Died", ResetRocks)
API_NPC.RegisterTaskServer("boss3_call_dragon", RANGE, COOLDOWN, GetPriority, OnTaskStart, OnTaskEnd)
|
-----------------------------------
-- Area: Metalworks
-- NPC: Ayame
-- Involved in Missions
-- Starts and Finishes Quest: True Strength
-- !pos 133 -19 34 237
-----------------------------------
require("scripts/globals/status")
require("scripts/globals/settings")
require("scripts/globals/titles")
require("scripts/globals/keyitems")
require("scripts/globals/missions")
require("scripts/globals/quests")
local ID = require("scripts/zones/Metalworks/IDs")
-----------------------------------
function onTrade(player, npc, trade)
if (player:getQuestStatus(BASTOK, tpz.quest.id.bastok.TRUE_STRENGTH) == QUEST_ACCEPTED) then
if (trade:hasItemQty(1100, 1) and trade:getItemCount() == 1) then -- Trade Xalmo Feather
player:startEvent(749) -- Finish Quest "True Strength"
end
end
end
function onTrigger(player, npc)
local trueStrength = player:getQuestStatus(BASTOK, tpz.quest.id.bastok.TRUE_STRENGTH)
local WildcatBastok = player:getCharVar("WildcatBastok")
local FadedPromises = player:getQuestStatus(BASTOK, tpz.quest.id.bastok.FADED_PROMISES)
if (player:getQuestStatus(BASTOK, tpz.quest.id.bastok.LURE_OF_THE_WILDCAT) == QUEST_ACCEPTED and player:getMaskBit(WildcatBastok, 9) == false) then
player:startEvent(935)
elseif (player:getCurrentMission(BASTOK) == tpz.mission.id.bastok.THE_CRYSTAL_LINE and player:hasKeyItem(tpz.ki.C_L_REPORTS)) then
player:startEvent(712)
elseif (trueStrength == QUEST_AVAILABLE and player:getMainJob() == tpz.job.MNK and player:getMainLvl() >= 50) then
player:startEvent(748) -- Start Quest "True Strength"
elseif (player:getCharVar("FadedPromises") == 1) then
player:startEvent(803)
elseif (player:getCharVar("FadedPromises") == 3) then
player:startEvent(804)
else
player:startEvent(701) -- Standard dialog
end
end
function onEventUpdate(player, csid, option)
end
function onEventFinish(player, csid, option)
if (csid == 712) then
finishMissionTimeline(player, 1, csid, option)
elseif (csid == 748) then
player:addQuest(BASTOK, tpz.quest.id.bastok.TRUE_STRENGTH)
elseif (csid == 749) then
if (player:getFreeSlotsCount() == 0) then
player:messageSpecial(ID.text.ITEM_CANNOT_BE_OBTAINED, 14215) -- Temple Hose
else
player:tradeComplete()
player:addTitle(tpz.title.PARAGON_OF_MONK_EXCELLENCE)
player:addItem(14215)
player:messageSpecial(ID.text.ITEM_OBTAINED, 14215) -- Temple Hose
player:addFame(BASTOK, 60)
player:completeQuest(BASTOK, tpz.quest.id.bastok.TRUE_STRENGTH)
end
elseif (csid == 935) then
player:setMaskBit(player:getCharVar("WildcatBastok"), "WildcatBastok", 9, true)
elseif (csid == 803 and option == 1) then
player:setCharVar("FadedPromises", 2)
elseif (csid == 804) then
player:setCharVar("FadedPromises", 4)
end
end
|
local AntClass = require(OOPLibrary.AntClass)
local Repr = require("Repr")
local TableLibrary = AntClass("TableLibrary")
function TableLibrary.Clone(ToClone)
local NewTab = {}
for i,v in pairs(ToClone) do
if typeof(v) == "table" then
NewTab[i] = TableLibrary.Clone(v)
else
NewTab[i] = v
end
end
setmetatable(NewTab, getmetatable(ToClone))
return NewTab
end
function TableLibrary.GetElementCount(tab)
local count = 0
for i,v in pairs(tab) do
count = count + 1
end
return count
end
function TableLibrary.Paste(ToPasteInto, ToPaste, Dictionary)
for i,v in pairs(ToPaste) do
if Dictionary then
ToPasteInto[i] = v
else
table.insert(ToPasteInto, v)
end
end
end
function TableLibrary.Find(Tab, Value)
for i,v in pairs(Tab) do
if v == Value then
return true, i
end
end
end
function TableLibrary.PrintOut(Tab)
print(Repr(Tab))
end
--[[
As this library is a class we can not only use it standardly, but also have classes or objects inherit these methods for quick access.
Constructor functions arent a must as shown by the example.
--]]
|
do
local t = {}
function t:conj(...)
local n = select('#', ...)
local args = {...}
for i = 1, n do
self[args[i]] = true
end
end
t['remove!'] = function(self, x)
local r = self[x]
self[x] = nil
return r
end
t['contains?'] = function(self, x)
return self[x] or false
end
local mt = {
__class = 'Set',
__index = t
}
function Set(...)
local o = {}
setmetatable(o, mt)
o:conj(...)
return o
end
end
|
-- This file is automatically generated, do not edit!
-- Path of Building
--
-- Active Dexterity skill gems
-- Skill data (c) Grinding Gear Games
--
local skills, mod, flag, skill = ...
skills["AnimateWeapon"] = {
name = "Animate Weapon",
gemTags = {
dexterity = true,
active_skill = true,
duration = true,
minion = true,
spell = true,
},
gemTagString = "Duration, Minion, Spell",
gemStr = 0,
gemDex = 60,
gemInt = 40,
color = 2,
description = "Animates a melee weapon to fight by your side. You cannot animate unidentified weapons.",
skillTypes = { [36] = true, [12] = true, [9] = true, [21] = true, [2] = true, [18] = true, [49] = true, },
minionSkillTypes = { [1] = true, [24] = true, [25] = true, [28] = true, [54] = true, [68] = true, [56] = true, },
minionHasItemSet = true,
minionUses = {
["Weapon 1"] = true,
},
minionList = {
"AnimatedWeapon",
},
baseFlags = {
spell = true,
minion = true,
duration = true,
},
baseMods = {
skill("castTime", 0.8),
--"emerge_speed_+%" = 0
skill("duration", 37.5), --"base_skill_effect_duration" = 37500
--"number_of_animated_weapons_allowed" = 50
},
qualityMods = {
mod("MinionModifier", "LIST", { mod = mod("MovementSpeed", "INC", 2) }), --"base_movement_velocity_+%" = 2
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = skill("manaCost", nil),
--[3] = "animate_item_maximum_level_requirement"
[4] = mod("MinionModifier", "LIST", { mod = mod("Damage", "MORE", nil) }), --"active_skill_damage_+%_final"
[5] = mod("MinionModifier", "LIST", { mod = mod("Speed", "INC", nil, ModFlag.Attack) }), --"attack_speed_+%"
[6] = mod("MinionModifier", "LIST", { mod = mod("PhysicalMin", "BASE", nil, 0, KeywordFlag.Attack) }), --"attack_minimum_added_physical_damage"
[7] = mod("MinionModifier", "LIST", { mod = mod("PhysicalMax", "BASE", nil, 0, KeywordFlag.Attack) }), --"attack_maximum_added_physical_damage"
},
levels = {
[1] = { 4, 9, 9, 0, 0, 4, 6, },
[2] = { 6, 10, 11, 8, 2, 5, 8, },
[3] = { 9, 11, 14, 16, 4, 7, 10, },
[4] = { 12, 12, 18, 24, 6, 8, 12, },
[5] = { 16, 14, 22, 32, 8, 10, 15, },
[6] = { 20, 15, 26, 40, 10, 12, 18, },
[7] = { 24, 16, 31, 48, 12, 14, 21, },
[8] = { 28, 18, 35, 56, 14, 17, 25, },
[9] = { 32, 20, 40, 64, 16, 19, 29, },
[10] = { 36, 22, 44, 72, 18, 22, 34, },
[11] = { 40, 25, 49, 80, 20, 24, 37, },
[12] = { 44, 26, 53, 88, 22, 26, 39, },
[13] = { 48, 27, 58, 96, 24, 28, 41, },
[14] = { 52, 29, 62, 104, 26, 29, 44, },
[15] = { 55, 30, 66, 112, 28, 31, 46, },
[16] = { 58, 31, 70, 120, 30, 32, 49, },
[17] = { 61, 33, 74, 128, 32, 34, 51, },
[18] = { 64, 34, 78, 136, 34, 36, 53, },
[19] = { 67, 34, 82, 144, 36, 37, 55, },
[20] = { 70, 36, 100, 152, 38, 38, 56, },
[21] = { 72, 37, 100, 160, 40, 39, 58, },
[22] = { 74, 38, 100, 168, 42, 40, 60, },
[23] = { 76, 38, 100, 176, 44, 41, 61, },
[24] = { 78, 39, 100, 184, 46, 42, 63, },
[25] = { 80, 40, 100, 192, 48, 43, 64, },
[26] = { 82, 41, 100, 200, 50, 44, 66, },
[27] = { 84, 42, 100, 208, 52, 45, 67, },
[28] = { 86, 42, 100, 216, 54, 46, 69, },
[29] = { 88, 44, 100, 224, 56, 47, 71, },
[30] = { 90, 45, 100, 232, 58, 48, 72, },
},
}
skills["ArcticArmour"] = {
name = "Arctic Armour",
gemTags = {
dexterity = true,
active_skill = true,
spell = true,
duration = true,
cold = true,
},
gemTagString = "Spell, Duration, Cold",
gemStr = 0,
gemDex = 60,
gemInt = 40,
color = 2,
description = "Conjures an icy barrier that chills enemies when they hit you. You drop chilled ground while moving, and take less Fire and Physical damage while stationary.",
skillTypes = { [2] = true, [5] = true, [18] = true, [12] = true, [15] = true, [27] = true, [34] = true, [16] = true, [20] = true, },
baseFlags = {
spell = true,
duration = true,
cold = true,
},
baseMods = {
skill("castTime", 0.5),
skill("manaCost", 25),
skill("cooldown", 0.5),
--"arctic_armour_chill_when_hit_duration" = 500
},
qualityMods = {
mod("Duration", "INC", 1), --"skill_effect_duration_+%" = 1
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = mod("PhysicalDamageTakenWhenHit", "MORE", nil, 0, 0, { type = "Condition", var = "Stationary" }, { type = "GlobalEffect", effectType = "Buff" }), --"new_arctic_armour_physical_damage_taken_when_hit_+%_final"
[3] = mod("FireDamageTakenWhenHit", "MORE", nil, 0, 0, { type = "Condition", var = "Stationary" }, { type = "GlobalEffect", effectType = "Buff" }), --"new_arctic_armour_fire_damage_taken_when_hit_+%_final"
[4] = skill("duration", nil), --"base_skill_effect_duration"
},
levels = {
[1] = { 16, -8, -8, 2.5, },
[2] = { 20, -8, -8, 2.6, },
[3] = { 24, -9, -8, 2.7, },
[4] = { 28, -9, -8, 2.8, },
[5] = { 31, -9, -9, 2.9, },
[6] = { 34, -9, -9, 3, },
[7] = { 37, -10, -9, 3.1, },
[8] = { 40, -10, -9, 3.2, },
[9] = { 43, -10, -10, 3.3, },
[10] = { 46, -10, -10, 3.4, },
[11] = { 49, -11, -10, 3.5, },
[12] = { 52, -11, -10, 3.6, },
[13] = { 55, -11, -11, 3.7, },
[14] = { 58, -11, -11, 3.8, },
[15] = { 60, -12, -11, 3.9, },
[16] = { 62, -12, -11, 4, },
[17] = { 64, -12, -12, 4.1, },
[18] = { 66, -12, -12, 4.2, },
[19] = { 68, -13, -12, 4.3, },
[20] = { 70, -13, -12, 4.4, },
[21] = { 72, -13, -13, 4.5, },
[22] = { 74, -13, -13, 4.6, },
[23] = { 76, -14, -13, 4.7, },
[24] = { 78, -14, -13, 4.8, },
[25] = { 80, -14, -14, 4.9, },
[26] = { 82, -14, -14, 5, },
[27] = { 84, -15, -14, 5.1, },
[28] = { 86, -15, -14, 5.2, },
[29] = { 88, -15, -15, 5.3, },
[30] = { 90, -15, -15, 5.4, },
},
}
skills["Barrage"] = {
name = "Barrage",
gemTags = {
dexterity = true,
active_skill = true,
attack = true,
bow = true,
},
gemTagString = "Attack, Bow",
gemStr = 0,
gemDex = 100,
gemInt = 0,
color = 2,
description = "After a short preparation time, you attack repeatedly with a ranged weapon. These attacks have a small randomised spread. Only works with Bows and Wands.",
skillTypes = { [1] = true, [48] = true, [69] = true, [3] = true, [68] = true, [22] = true, [17] = true, [19] = true, },
weaponTypes = {
["Wand"] = true,
["Bow"] = true,
},
parts = {
{
name = "1 Projectile",
},
{
name = "All Projectiles",
},
},
setupFunc = function(actor, output)
if actor.mainSkill.skillPart == 2 then
actor.mainSkill.skillData.dpsMultiplier = output.ProjectileCount
end
end,
baseFlags = {
attack = true,
projectile = true,
},
baseMods = {
skill("castTime", 1),
mod("ProjectileCount", "BASE", 3), --"number_of_additional_projectiles" = 3
--"skill_can_fire_arrows" = ?
--"skill_can_fire_wand_projectiles" = ?
},
qualityMods = {
mod("Damage", "INC", 0.5, ModFlag.Projectile), --"projectile_damage_+%" = 0.5
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = skill("manaCost", nil),
[3] = skill("damageEffectiveness", nil),
[4] = skill("baseMultiplier", nil),
},
levels = {
[1] = { 12, 7, 0.5, 0.5, },
[2] = { 15, 7, 0.51, 0.506, },
[3] = { 19, 7, 0.51, 0.512, },
[4] = { 23, 8, 0.52, 0.518, },
[5] = { 27, 8, 0.52, 0.524, },
[6] = { 31, 8, 0.53, 0.53, },
[7] = { 35, 8, 0.54, 0.536, },
[8] = { 38, 8, 0.54, 0.542, },
[9] = { 41, 9, 0.55, 0.548, },
[10] = { 44, 9, 0.55, 0.554, },
[11] = { 47, 9, 0.56, 0.56, },
[12] = { 50, 9, 0.57, 0.566, },
[13] = { 53, 9, 0.57, 0.572, },
[14] = { 56, 10, 0.58, 0.578, },
[15] = { 59, 10, 0.58, 0.584, },
[16] = { 62, 10, 0.59, 0.59, },
[17] = { 64, 10, 0.6, 0.596, },
[18] = { 66, 10, 0.6, 0.602, },
[19] = { 68, 11, 0.61, 0.608, },
[20] = { 70, 11, 0.61, 0.614, },
[21] = { 72, 11, 0.62, 0.62, },
[22] = { 74, 11, 0.63, 0.626, },
[23] = { 76, 11, 0.63, 0.632, },
[24] = { 78, 11, 0.64, 0.638, },
[25] = { 80, 11, 0.64, 0.644, },
[26] = { 82, 12, 0.65, 0.65, },
[27] = { 84, 12, 0.66, 0.656, },
[28] = { 86, 12, 0.66, 0.662, },
[29] = { 88, 12, 0.67, 0.668, },
[30] = { 90, 12, 0.67, 0.674, },
},
}
skills["BearTrap"] = {
name = "Bear Trap",
gemTags = {
trap = true,
dexterity = true,
active_skill = true,
spell = true,
duration = true,
},
gemTagString = "Trap, Spell, Duration",
gemStr = 0,
gemDex = 100,
gemInt = 0,
color = 2,
description = "Throws a trap that damages and immobilises a single enemy.",
skillTypes = { [2] = true, [12] = true, [19] = true, [37] = true, [10] = true, },
baseFlags = {
cast = true,
trap = true,
duration = true,
},
baseMods = {
skill("castTime", 1),
skill("damageEffectiveness", 2),
skill("CritChance", 5),
skill("cooldown", 3),
--"is_trap" = 1
--"base_trap_duration" = 8000
--"trap_override_pvp_scaling_time_ms" = 750
--"base_skill_is_trapped" = ?
--"display_skill_deals_secondary_damage" = ?
skill("showAverage", true), --"base_skill_show_average_damage_instead_of_dps" = ?
--"no_movement_speed" = ?
--"traps_do_not_explode_on_timeout" = ?
},
qualityMods = {
mod("PhysicalDamage", "INC", 1), --"physical_damage_+%" = 1
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = skill("manaCost", nil),
[3] = skill("PhysicalMin", nil), --"secondary_minimum_base_physical_damage"
[4] = skill("PhysicalMax", nil), --"secondary_maximum_base_physical_damage"
},
levels = {
[1] = { 4, 11, 16, 22, },
[2] = { 6, 13, 20, 28, },
[3] = { 9, 15, 27, 38, },
[4] = { 12, 17, 35, 49, },
[5] = { 16, 20, 49, 69, },
[6] = { 20, 22, 67, 94, },
[7] = { 24, 24, 90, 126, },
[8] = { 28, 26, 119, 167, },
[9] = { 32, 28, 156, 218, },
[10] = { 36, 32, 202, 282, },
[11] = { 40, 35, 259, 363, },
[12] = { 44, 38, 331, 463, },
[13] = { 48, 39, 420, 587, },
[14] = { 52, 41, 530, 742, },
[15] = { 55, 42, 630, 881, },
[16] = { 58, 43, 746, 1045, },
[17] = { 61, 44, 883, 1236, },
[18] = { 64, 45, 1043, 1460, },
[19] = { 67, 46, 1230, 1721, },
[20] = { 70, 46, 1447, 2026, },
[21] = { 72, 47, 1613, 2258, },
[22] = { 74, 48, 1795, 2514, },
[23] = { 76, 49, 1998, 2797, },
[24] = { 78, 50, 2222, 3111, },
[25] = { 80, 50, 2470, 3458, },
[26] = { 82, 51, 2744, 3842, },
[27] = { 84, 52, 3047, 4266, },
[28] = { 86, 53, 3382, 4735, },
[29] = { 88, 54, 3753, 5254, },
[30] = { 90, 54, 4162, 5826, },
},
}
skills["ChargedAttack"] = {
name = "Blade Flurry",
gemTags = {
dexterity = true,
active_skill = true,
attack = true,
area = true,
channelling = true,
melee = true,
},
gemTagString = "Attack, AoE, Channelling, Melee",
gemStr = 0,
gemDex = 60,
gemInt = 40,
color = 2,
description = "Repeatedly strike at enemies in a circle in front of you while channelling, dealing damage to and around the struck enemy. The damage is continually boosted while channelling. You unleash an additional strike for each stage reached once the channelling ends. Requires a Dagger, Claw or One-Handed Sword.",
skillTypes = { [1] = true, [11] = true, [58] = true, [24] = true, },
weaponTypes = {
["Thrusting One Handed Sword"] = true,
["One Handed Sword"] = true,
["Dagger"] = true,
["Claw"] = true,
},
parts = {
{
name = "1 Stage",
},
{
name = "6 Stages",
},
{
name = "Release at 6 Stages",
},
},
baseFlags = {
attack = true,
melee = true,
area = true,
},
baseMods = {
skill("castTime", 1),
skill("manaCost", 4),
mod("Speed", "MORE", 60, ModFlag.Attack), --"active_skill_attack_speed_+%_final" = 60
--"charged_attack_damage_per_stack_+%_final" = 20
--"is_area_damage" = ?
--"base_skill_show_average_damage_instead_of_dps" = ?
--"skill_can_add_multiple_charges_per_action" = ?
skill("radius", 14),
mod("Damage", "MORE", 120, 0, bit.bor(KeywordFlag.Hit, KeywordFlag.Ailment), { type = "SkillPart", skillPart = 2 }),
skill("dpsMultiplier", 3, { type = "SkillPart", skillPart = 3 }),
},
qualityMods = {
mod("Speed", "INC", 0.5, ModFlag.Attack, 0, nil), --"attack_speed_+%" = 0.5
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = skill("damageEffectiveness", nil),
[3] = skill("baseMultiplier", nil),
},
levels = {
[1] = { 28, 0.45, 0.45, },
[2] = { 31, 0.46, 0.456, },
[3] = { 34, 0.46, 0.462, },
[4] = { 37, 0.47, 0.468, },
[5] = { 40, 0.47, 0.474, },
[6] = { 42, 0.48, 0.48, },
[7] = { 44, 0.49, 0.486, },
[8] = { 46, 0.49, 0.492, },
[9] = { 48, 0.5, 0.498, },
[10] = { 50, 0.5, 0.504, },
[11] = { 52, 0.51, 0.51, },
[12] = { 54, 0.52, 0.516, },
[13] = { 56, 0.52, 0.522, },
[14] = { 58, 0.53, 0.528, },
[15] = { 60, 0.53, 0.534, },
[16] = { 62, 0.54, 0.54, },
[17] = { 64, 0.55, 0.546, },
[18] = { 66, 0.55, 0.552, },
[19] = { 68, 0.56, 0.558, },
[20] = { 70, 0.56, 0.564, },
[21] = { 72, 0.57, 0.57, },
[22] = { 74, 0.58, 0.576, },
[23] = { 76, 0.58, 0.582, },
[24] = { 78, 0.59, 0.588, },
[25] = { 80, 0.59, 0.594, },
[26] = { 82, 0.6, 0.6, },
[27] = { 84, 0.61, 0.606, },
[28] = { 86, 0.61, 0.612, },
[29] = { 88, 0.62, 0.618, },
[30] = { 90, 0.62, 0.624, },
},
}
skills["BladeVortex"] = {
name = "Blade Vortex",
gemTags = {
dexterity = true,
active_skill = true,
spell = true,
area = true,
duration = true,
},
gemTagString = "Spell, AoE, Duration",
gemStr = 0,
gemDex = 100,
gemInt = 0,
color = 2,
description = "This spell creates ethereal blades which orbit in an area around you, dealing damage every 0.6 seconds to all enemies in their radius. As more blades are added, the damage becomes greater and more frequent.",
skillTypes = { [2] = true, [10] = true, [11] = true, [12] = true, [18] = true, [26] = true, [36] = true, [27] = true, },
parts = {
{
name = "0 Blades",
},
{
name = "5 Blades",
},
{
name = "10 Blades",
}
},
baseFlags = {
spell = true,
area = true,
duration = true,
},
baseMods = {
skill("castTime", 0.5),
skill("damageEffectiveness", 0.3),
skill("CritChance", 6),
skill("duration", 5), --"base_skill_effect_duration" = 5000
--"maximum_number_of_spinning_blades" = 10
--"blade_vortex_hit_rate_+%_per_blade" = 35
mod("Damage", "MORE", 35, 0, KeywordFlag.Hit, { type = "Multiplier", var = "BladeVortexBlade" }), --"blade_vortex_damage_+%_per_blade_final" = 30
--"is_area_damage" = ?
--"skill_can_add_multiple_charges_per_action" = ?
--"action_ignores_crit_tracking" = ?
--"base_skill_show_average_damage_instead_of_dps" = ?
skill("radius", 15),
mod("Multiplier:BladeVortexBlade", "BASE", 5, 0, 0, { type = "SkillPart", skillPart = 2 }),
mod("Multiplier:BladeVortexBlade", "BASE", 10, 0, 0, { type = "SkillPart", skillPart = 3 }),
mod("CritChance", "INC", 50, 0, 0, { type = "SkillPart", skillPart = 2}),
mod("CritChance", "INC", 100, 0, 0, { type = "SkillPart", skillPart = 3}),
skill("hitTimeOverride", 0.6, { type = "SkillPart", skillPart = 1 }),
skill("hitTimeOverride", 0.218, { type = "SkillPart", skillPart = 2 }),
skill("hitTimeOverride", 0.133, { type = "SkillPart", skillPart = 3 }),
},
qualityMods = {
mod("AreaOfEffect", "INC", 0.5), --"base_skill_area_of_effect_+%" = 0.5
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = skill("manaCost", nil),
[3] = skill("PhysicalMin", nil), --"spell_minimum_base_physical_damage"
[4] = skill("PhysicalMax", nil), --"spell_maximum_base_physical_damage"
[5] = skill("radiusExtra", nil), --"active_skill_base_radius_+"
},
levels = {
[1] = { 12, 6, 7, 10, 0, },
[2] = { 15, 7, 8, 12, 0, },
[3] = { 19, 8, 11, 16, 0, },
[4] = { 23, 9, 14, 20, 0, },
[5] = { 27, 10, 17, 25, 1, },
[6] = { 31, 11, 21, 32, 1, },
[7] = { 35, 12, 26, 39, 1, },
[8] = { 38, 13, 30, 45, 1, },
[9] = { 41, 13, 35, 52, 1, },
[10] = { 44, 14, 40, 60, 2, },
[11] = { 47, 14, 46, 69, 2, },
[12] = { 50, 15, 53, 79, 2, },
[13] = { 53, 16, 60, 90, 2, },
[14] = { 56, 16, 68, 103, 2, },
[15] = { 59, 17, 78, 117, 3, },
[16] = { 62, 18, 88, 133, 3, },
[17] = { 64, 18, 96, 144, 3, },
[18] = { 66, 19, 104, 157, 3, },
[19] = { 68, 19, 113, 170, 3, },
[20] = { 70, 19, 123, 185, 4, },
[21] = { 72, 20, 133, 200, 4, },
[22] = { 74, 21, 145, 217, 4, },
[23] = { 76, 21, 157, 235, 4, },
[24] = { 78, 21, 170, 254, 4, },
[25] = { 80, 22, 183, 275, 5, },
[26] = { 82, 23, 198, 298, 5, },
[27] = { 84, 23, 214, 322, 5, },
[28] = { 86, 23, 232, 347, 5, },
[29] = { 88, 24, 250, 375, 5, },
[30] = { 90, 24, 270, 405, 6, },
},
}
skills["Bladefall"] = {
name = "Bladefall",
gemTags = {
dexterity = true,
active_skill = true,
spell = true,
area = true,
},
gemTagString = "Spell, AoE",
gemStr = 0,
gemDex = 100,
gemInt = 0,
color = 2,
description = "Ethereal weapons rain from the sky, dealing damage to enemies in a sequence of five volleys, each wider but less damaging than the last. Enemies can be hit multiple times where these overlap.",
skillTypes = { [2] = true, [11] = true, [17] = true, [19] = true, [18] = true, [10] = true, [36] = true, [26] = true, [67] = true, },
baseFlags = {
spell = true,
area = true,
},
baseMods = {
skill("castTime", 0.8),
skill("damageEffectiveness", 0.9),
skill("CritChance", 5),
--"bladefall_damage_per_stage_+%_final" = -6
mod("AreaOfEffect", "INC", 0), --"base_skill_area_of_effect_+%" = 0
--"is_area_damage" = ?
},
qualityMods = {
mod("AreaOfEffect", "INC", 0.5), --"base_skill_area_of_effect_+%" = 0.5
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = skill("manaCost", nil),
[3] = skill("PhysicalMin", nil), --"spell_minimum_base_physical_damage"
[4] = skill("PhysicalMax", nil), --"spell_maximum_base_physical_damage"
},
levels = {
[1] = { 28, 13, 44, 65, },
[2] = { 31, 14, 52, 78, },
[3] = { 34, 15, 62, 93, },
[4] = { 37, 16, 73, 110, },
[5] = { 40, 17, 86, 129, },
[6] = { 42, 18, 96, 144, },
[7] = { 44, 18, 107, 160, },
[8] = { 46, 19, 118, 177, },
[9] = { 48, 19, 131, 197, },
[10] = { 50, 20, 145, 218, },
[11] = { 52, 21, 160, 241, },
[12] = { 54, 21, 177, 266, },
[13] = { 56, 22, 195, 293, },
[14] = { 58, 22, 215, 323, },
[15] = { 60, 23, 237, 356, },
[16] = { 62, 24, 261, 392, },
[17] = { 64, 24, 287, 431, },
[18] = { 66, 25, 315, 473, },
[19] = { 68, 25, 346, 519, },
[20] = { 70, 26, 380, 570, },
[21] = { 72, 27, 417, 625, },
[22] = { 74, 27, 457, 685, },
[23] = { 76, 28, 500, 750, },
[24] = { 78, 28, 548, 821, },
[25] = { 80, 29, 599, 899, },
[26] = { 82, 30, 655, 983, },
[27] = { 84, 30, 716, 1074, },
[28] = { 86, 31, 782, 1174, },
[29] = { 88, 31, 854, 1282, },
[30] = { 90, 32, 933, 1399, },
},
}
skills["BlastRain"] = {
name = "Blast Rain",
gemTags = {
fire = true,
dexterity = true,
active_skill = true,
attack = true,
area = true,
bow = true,
},
gemTagString = "Fire, Attack, AoE, Bow",
gemStr = 0,
gemDex = 100,
gemInt = 0,
color = 2,
description = "Fires an arrow up in the air, which splits and rains down in a series of explosions over an area. The explosions will always overlap on the targeted area.",
skillTypes = { [1] = true, [11] = true, [14] = true, [22] = true, [17] = true, [19] = true, [33] = true, [48] = true, [69] = true, [57] = true, },
weaponTypes = {
["Bow"] = true,
},
parts = {
{
name = "1 explosion",
},
{
name = "4 explosions",
},
},
baseFlags = {
attack = true,
projectile = true,
area = true,
fire = true,
},
baseMods = {
skill("castTime", 1),
mod("SkillPhysicalDamageConvertToFire", "BASE", 50), --"skill_physical_damage_%_to_convert_to_fire" = 50
mod("AreaOfEffect", "INC", 0), --"base_skill_area_of_effect_+%" = 0
--"blast_rain_number_of_blasts" = 4
--"blast_rain_arrow_delay_ms" = 80
--"base_is_projectile" = ?
--"is_area_damage" = ?
skill("radius", 24),
skill("dpsMultiplier", 4, { type = "SkillPart", skillPart = 2 }),
},
qualityMods = {
mod("AreaOfEffect", "INC", 0.5), --"base_skill_area_of_effect_+%" = 0.5
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = skill("manaCost", nil),
[3] = skill("damageEffectiveness", nil),
[4] = skill("baseMultiplier", nil),
},
levels = {
[1] = { 28, 8, 0.4, 0.4, },
[2] = { 31, 8, 0.4, 0.404, },
[3] = { 34, 8, 0.41, 0.408, },
[4] = { 37, 8, 0.41, 0.412, },
[5] = { 40, 9, 0.42, 0.416, },
[6] = { 42, 9, 0.42, 0.42, },
[7] = { 44, 9, 0.42, 0.424, },
[8] = { 46, 9, 0.43, 0.428, },
[9] = { 48, 9, 0.43, 0.432, },
[10] = { 50, 9, 0.44, 0.436, },
[11] = { 52, 9, 0.44, 0.44, },
[12] = { 54, 10, 0.44, 0.444, },
[13] = { 56, 10, 0.45, 0.448, },
[14] = { 58, 10, 0.45, 0.452, },
[15] = { 60, 10, 0.46, 0.456, },
[16] = { 62, 10, 0.46, 0.46, },
[17] = { 64, 10, 0.46, 0.464, },
[18] = { 66, 10, 0.47, 0.468, },
[19] = { 68, 10, 0.47, 0.472, },
[20] = { 70, 10, 0.48, 0.476, },
[21] = { 72, 10, 0.48, 0.48, },
[22] = { 74, 10, 0.48, 0.484, },
[23] = { 76, 11, 0.49, 0.488, },
[24] = { 78, 11, 0.49, 0.492, },
[25] = { 80, 11, 0.5, 0.496, },
[26] = { 82, 11, 0.5, 0.5, },
[27] = { 84, 11, 0.5, 0.504, },
[28] = { 86, 12, 0.51, 0.508, },
[29] = { 88, 12, 0.51, 0.512, },
[30] = { 90, 12, 0.52, 0.516, },
},
}
skills["BlinkArrow"] = {
name = "Blink Arrow",
gemTags = {
dexterity = true,
active_skill = true,
attack = true,
minion = true,
duration = true,
movement = true,
bow = true,
},
gemTagString = "Attack, Minion, Duration, Movement, Bow",
gemStr = 0,
gemDex = 100,
gemInt = 0,
color = 2,
description = "Fires an arrow at the target destination. When the arrow lands, you are teleported to it and a clone is summoned at your old location. The clone is a minion that uses your bow and quiver.",
skillTypes = { [14] = true, [1] = true, [9] = true, [48] = true, [21] = true, [12] = true, [22] = true, [17] = true, [19] = true, [38] = true, },
minionSkillTypes = { [1] = true, [3] = true, [48] = true, },
weaponTypes = {
["Bow"] = true,
},
minionList = {
"Clone",
},
baseFlags = {
attack = true,
projectile = true,
minion = true,
movement = true,
duration = true,
},
baseMods = {
skill("castTime", 1),
skill("cooldown", 3),
skill("duration", 3), --"base_skill_effect_duration" = 3000
--"number_of_monsters_to_summon" = 1
mod("MinionModifier", "LIST", { mod = mod("Damage", "MORE", 75) }), --"active_skill_minion_damage_+%_final" = 75
--"display_minion_monster_type" = 4
--"base_is_projectile" = ?
skill("minionUseBowAndQuiver", true),
},
qualityMods = {
--"base_arrow_speed_+%" = 1.5
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = skill("manaCost", nil),
[3] = mod("MinionModifier", "LIST", { mod = mod("Damage", "INC", nil) }), --"minion_damage_+%"
[4] = mod("MinionModifier", "LIST", { mod = mod("Life", "INC", nil) }), --"minion_maximum_life_+%"
[5] = skill("minionLevel", nil), --"display_minion_monster_level"
},
levels = {
[1] = { 10, 14, 0, 0, 24, },
[2] = { 13, 14, 6, 3, 27, },
[3] = { 17, 15, 12, 6, 30, },
[4] = { 21, 15, 18, 9, 33, },
[5] = { 25, 15, 24, 12, 35, },
[6] = { 29, 16, 30, 15, 38, },
[7] = { 33, 16, 36, 18, 40, },
[8] = { 36, 16, 42, 21, 43, },
[9] = { 39, 16, 48, 24, 46, },
[10] = { 42, 17, 54, 27, 48, },
[11] = { 45, 17, 60, 30, 50, },
[12] = { 48, 17, 66, 33, 52, },
[13] = { 51, 17, 72, 36, 54, },
[14] = { 54, 18, 78, 39, 56, },
[15] = { 57, 18, 84, 42, 58, },
[16] = { 60, 18, 90, 45, 60, },
[17] = { 63, 19, 96, 48, 62, },
[18] = { 66, 19, 102, 51, 64, },
[19] = { 68, 20, 108, 54, 66, },
[20] = { 70, 20, 114, 57, 68, },
[21] = { 72, 21, 120, 60, 70, },
[22] = { 74, 21, 126, 63, 72, },
[23] = { 76, 22, 132, 66, 74, },
[24] = { 78, 22, 138, 69, 76, },
[25] = { 80, 22, 144, 72, 78, },
[26] = { 82, 23, 150, 75, 80, },
[27] = { 84, 23, 156, 78, 82, },
[28] = { 86, 23, 162, 81, 84, },
[29] = { 88, 23, 168, 84, 86, },
[30] = { 90, 24, 174, 87, 88, },
},
}
skills["BloodRage"] = {
name = "Blood Rage",
gemTags = {
dexterity = true,
active_skill = true,
spell = true,
duration = true,
},
gemTagString = "Spell, Duration",
gemStr = 0,
gemDex = 100,
gemInt = 0,
color = 2,
description = "Adds a buff that deals Physical Damage over time, while increasing Attack Speed and Life Leech. Killing an enemy while this buff is active refreshes the buff duration, and can grant a Frenzy Charge.",
skillTypes = { [2] = true, [5] = true, [12] = true, [18] = true, [36] = true, },
baseFlags = {
spell = true,
duration = true,
},
baseMods = {
skill("castTime", 0.25),
skill("cooldown", 1),
mod("PhysicalDamageLifeLeech", "BASE", 1.2, ModFlag.Attack, 0, { type = "GlobalEffect", effectType = "Buff" }), --"life_leech_from_physical_attack_damage_permyriad" = 120
mod("PhysicalDegen", "BASE", 0.04, 0, 0, { type = "PerStat", stat = "Life", div = 1}, { type = "GlobalEffect", effectType = "Buff" }), --"base_physical_damage_%_of_maximum_life_to_deal_per_minute" = 240
mod("PhysicalDegen", "BASE", 0.04, 0, 0, { type = "PerStat", stat = "EnergyShield", div = 1}, { type = "GlobalEffect", effectType = "Buff" }), --"base_physical_damage_%_of_maximum_energy_shield_to_deal_per_minute" = 240
--"add_frenzy_charge_on_kill_%_chance" = 25
skill("thisIsNotABuff", true),
},
qualityMods = {
mod("Speed", "INC", 0.25, ModFlag.Attack, 0, { type = "GlobalEffect", effectType = "Buff" }), --"attack_speed_+%" = 0.25
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = skill("manaCost", nil),
[3] = mod("Speed", "INC", nil, ModFlag.Attack, 0, { type = "GlobalEffect", effectType = "Buff" }), --"attack_speed_+%"
[4] = skill("duration", nil), --"base_skill_effect_duration"
--[5] = "skill_level"
},
levels = {
[1] = { 16, 17, 5, 7, 1, },
[2] = { 20, 17, 6, 7.2, 2, },
[3] = { 24, 17, 6, 7.4, 3, },
[4] = { 28, 18, 7, 7.6, 4, },
[5] = { 31, 18, 7, 7.8, 5, },
[6] = { 34, 18, 8, 8, 6, },
[7] = { 37, 18, 8, 8.2, 7, },
[8] = { 40, 19, 9, 8.4, 8, },
[9] = { 43, 19, 9, 8.6, 9, },
[10] = { 46, 19, 10, 8.8, 10, },
[11] = { 49, 20, 10, 9, 11, },
[12] = { 52, 20, 11, 9.2, 12, },
[13] = { 55, 20, 11, 9.4, 13, },
[14] = { 58, 20, 12, 9.6, 14, },
[15] = { 60, 20, 12, 9.8, 15, },
[16] = { 62, 21, 13, 10, 16, },
[17] = { 64, 21, 13, 10.2, 17, },
[18] = { 66, 21, 14, 10.4, 18, },
[19] = { 68, 21, 14, 10.6, 19, },
[20] = { 70, 21, 15, 10.8, 20, },
[21] = { 72, 22, 15, 11, 21, },
[22] = { 74, 22, 16, 11.2, 22, },
[23] = { 76, 22, 16, 11.4, 23, },
[24] = { 78, 22, 17, 11.6, 24, },
[25] = { 80, 22, 17, 11.8, 25, },
[26] = { 82, 23, 18, 12, 26, },
[27] = { 84, 23, 18, 12.2, 27, },
[28] = { 86, 23, 19, 12.4, 28, },
[29] = { 88, 23, 19, 12.6, 29, },
[30] = { 90, 23, 20, 12.8, 30, },
},
}
skills["BurningArrow"] = {
name = "Burning Arrow",
gemTags = {
dexterity = true,
active_skill = true,
attack = true,
fire = true,
bow = true,
},
gemTagString = "Attack, Fire, Bow",
gemStr = 0,
gemDex = 100,
gemInt = 0,
color = 2,
description = "Fires an arrow that deals fire damage to its target and has an increased chance of igniting it.",
skillTypes = { [1] = true, [48] = true, [69] = true, [3] = true, [68] = true, [22] = true, [17] = true, [19] = true, [33] = true, [53] = true, [55] = true, },
weaponTypes = {
["Bow"] = true,
},
baseFlags = {
attack = true,
projectile = true,
fire = true,
},
baseMods = {
skill("castTime", 1),
mod("EnemyIgniteChance", "BASE", 49), --"base_chance_to_ignite_%" = 20
mod("SkillPhysicalDamageConvertToFire", "BASE", 50), --"skill_physical_damage_%_to_convert_to_fire" = 50
--"skill_can_fire_arrows" = ?,
mod("Damage", "MORE", 68, 0, KeywordFlag.Ignite), --"support_ignite_prolif_ignite_damage_+%_final"
},
qualityMods = {
mod("EnemyIgniteDuration", "INC", 3), --"ignite_duration_+%" = 3
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = skill("manaCost", nil),
[3] = skill("damageEffectiveness", nil),
[4] = skill("baseMultiplier", nil),
[5] = mod("FireDamage", "INC", nil, ModFlag.Dot), --"burn_damage_+%"
--[6] = "ignite_triggered_ground_fire_base_damage_per_minute"
},
levels = {
[1] = { 1, 5, 1.5, 1.5, 10, 180, },
[2] = { 2, 5, 1.52, 1.518, 11, 206, },
[3] = { 4, 5, 1.54, 1.536, 12, 266, },
[4] = { 7, 5, 1.55, 1.554, 13, 375, },
[5] = { 11, 5, 1.57, 1.572, 14, 565, },
[6] = { 16, 6, 1.59, 1.59, 15, 894, },
[7] = { 20, 6, 1.61, 1.608, 16, 1255, },
[8] = { 24, 6, 1.63, 1.626, 17, 1731, },
[9] = { 28, 6, 1.64, 1.644, 18, 2353, },
[10] = { 32, 6, 1.66, 1.662, 19, 3163, },
[11] = { 36, 7, 1.68, 1.68, 20, 4212, },
[12] = { 40, 7, 1.7, 1.698, 21, 5567, },
[13] = { 44, 7, 1.72, 1.716, 22, 7310, },
[14] = { 48, 7, 1.73, 1.734, 23, 9547, },
[15] = { 52, 7, 1.75, 1.752, 24, 12407, },
[16] = { 56, 8, 1.77, 1.77, 25, 16058, },
[17] = { 60, 8, 1.79, 1.788, 26, 20705, },
[18] = { 64, 8, 1.81, 1.806, 27, 26610, },
[19] = { 67, 8, 1.82, 1.824, 28, 32056, },
[20] = { 70, 8, 1.84, 1.842, 29, 38559, },
[21] = { 72, 9, 1.86, 1.86, 30, 43577, },
[22] = { 74, 9, 1.88, 1.878, 31, 49219, },
[23] = { 76, 9, 1.9, 1.896, 32, 55559, },
[24] = { 78, 9, 1.91, 1.914, 33, 62682, },
[25] = { 80, 9, 1.93, 1.932, 34, 70681, },
[26] = { 82, 10, 1.95, 1.95, 35, 79662, },
[27] = { 84, 10, 1.97, 1.968, 36, 89741, },
[28] = { 86, 10, 1.99, 1.986, 37, 101049, },
[29] = { 88, 10, 2, 2.004, 38, 113733, },
[30] = { 90, 10, 2.02, 2.022, 39, 127955, },
},
}
skills["VaalBurningArrow"] = {
name = "Vaal Burning Arrow",
gemTags = {
dexterity = true,
active_skill = true,
vaal = true,
attack = true,
area = true,
fire = true,
bow = true,
},
gemTagString = "Vaal, Attack, AoE, Fire, Bow",
gemStr = 0,
gemDex = 100,
gemInt = 0,
color = 2,
description = "Fires an arrow that explodes, dealing fire damage to its target and other nearby enemies, with an increased chance of igniting them.",
skillTypes = { [1] = true, [48] = true, [3] = true, [68] = true, [22] = true, [17] = true, [19] = true, [11] = true, [43] = true, [33] = true, [55] = true, },
weaponTypes = {
["Bow"] = true,
},
baseFlags = {
attack = true,
projectile = true,
area = true,
fire = true,
vaal = true,
},
baseMods = {
skill("castTime", 1),
mod("EnemyIgniteChance", "BASE", 20), --"base_chance_to_ignite_%" = 20
mod("SkillPhysicalDamageConvertToFire", "BASE", 50), --"skill_physical_damage_%_to_convert_to_fire" = 50
--"vaal_burning_arrow_explode_on_hit" = ?
skill("cannotBeEvaded", true), --"global_always_hit" = ?
--"skill_can_fire_arrows" = ?
},
qualityMods = {
mod("EnemyIgniteDuration", "INC", 3), --"ignite_duration_+%" = 3
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = skill("damageEffectiveness", nil),
[3] = skill("baseMultiplier", nil),
[4] = mod("FireDamage", "INC", nil, ModFlag.Dot), --"burn_damage_+%"
--[5] = "ignite_triggered_ground_fire_base_damage_per_minute"
},
levels = {
[1] = { 1, 1.6, 1.6, 10, 192, },
[2] = { 2, 1.62, 1.62, 11, 220, },
[3] = { 4, 1.64, 1.64, 12, 284, },
[4] = { 7, 1.66, 1.66, 13, 401, },
[5] = { 11, 1.68, 1.68, 14, 603, },
[6] = { 16, 1.7, 1.7, 15, 955, },
[7] = { 20, 1.72, 1.72, 16, 1341, },
[8] = { 24, 1.74, 1.74, 17, 1848, },
[9] = { 28, 1.76, 1.76, 18, 2513, },
[10] = { 32, 1.78, 1.78, 19, 3378, },
[11] = { 36, 1.8, 1.8, 20, 4498, },
[12] = { 40, 1.82, 1.82, 21, 5946, },
[13] = { 44, 1.84, 1.84, 22, 7808, },
[14] = { 48, 1.86, 1.86, 23, 10196, },
[15] = { 52, 1.88, 1.88, 24, 13251, },
[16] = { 56, 1.9, 1.9, 25, 17150, },
[17] = { 60, 1.92, 1.92, 26, 22113, },
[18] = { 64, 1.94, 1.94, 27, 28419, },
[19] = { 67, 1.96, 1.96, 28, 34236, },
[20] = { 70, 1.98, 1.98, 29, 41181, },
[21] = { 72, 2, 2, 30, 46540, },
[22] = { 74, 2.02, 2.02, 31, 52566, },
[23] = { 76, 2.04, 2.04, 32, 59337, },
[24] = { 78, 2.06, 2.06, 33, 66944, },
[25] = { 80, 2.08, 2.08, 34, 75487, },
[26] = { 82, 2.1, 2.1, 35, 85079, },
[27] = { 84, 2.12, 2.12, 36, 95843, },
[28] = { 86, 2.14, 2.14, 37, 107921, },
[29] = { 88, 2.16, 2.16, 38, 121467, },
[30] = { 90, 2.18, 2.18, 39, 136656, },
},
}
skills["PoisonArrow"] = {
name = "Caustic Arrow",
gemTags = {
dexterity = true,
active_skill = true,
attack = true,
area = true,
duration = true,
chaos = true,
bow = true,
},
gemTagString = "Attack, AoE, Duration, Chaos, Bow",
gemStr = 0,
gemDex = 100,
gemInt = 0,
color = 2,
description = "Fires an arrow which deals additional chaos damage to enemies it hits, and creates a caustic cloud. Enemies in the cloud take chaos damage over time.",
skillTypes = { [1] = true, [48] = true, [69] = true, [3] = true, [68] = true, [11] = true, [12] = true, [17] = true, [19] = true, [22] = true, [40] = true, [50] = true, },
weaponTypes = {
["Bow"] = true,
},
baseFlags = {
attack = true,
projectile = true,
duration = true,
chaos = true,
},
baseMods = {
skill("castTime", 1),
--"skill_can_fire_arrows" = ?
skill("dotIsProjectile", true), --"projectile_damage_modifiers_apply_to_skill_dot" = ?
skill("radius", 20),
skill("dotIsArea", true),
},
qualityMods = {
mod("AreaOfEffect", "INC", 0.5), --"base_skill_area_of_effect_+%" = 0.5
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = skill("manaCost", nil),
[3] = skill("duration", nil), --"base_skill_effect_duration"
[4] = skill("ChaosDot", nil), --"base_chaos_damage_to_deal_per_minute"
[5] = mod("PhysicalDamageGainAsChaos", "BASE", nil, 0, 0, nil), --"physical_damage_%_to_add_as_chaos"
[6] = skill("radiusExtra", nil), --"active_skill_base_radius_+"
},
levels = {
[1] = { 4, 8, 2.8, 5.2833333333333, 30, 0, },
[2] = { 6, 8, 2.9, 6.6666666666667, 31, 0, },
[3] = { 9, 8, 3, 9.1833333333333, 32, 0, },
[4] = { 12, 9, 3.1, 12.333333333333, 33, 0, },
[5] = { 16, 9, 3.2, 17.733333333333, 34, 1, },
[6] = { 20, 9, 3.3, 24.9, 35, 1, },
[7] = { 24, 10, 3.4, 34.333333333333, 36, 1, },
[8] = { 28, 10, 3.5, 46.683333333333, 37, 1, },
[9] = { 32, 10, 3.6, 62.75, 38, 1, },
[10] = { 36, 11, 3.7, 83.566666666667, 39, 2, },
[11] = { 40, 11, 3.9, 110.45, 40, 2, },
[12] = { 44, 12, 4, 145.03333333333, 41, 2, },
[13] = { 48, 12, 4.1, 189.4, 42, 2, },
[14] = { 52, 13, 4.2, 246.16666666667, 43, 2, },
[15] = { 55, 13, 4.3, 298.8, 44, 3, },
[16] = { 58, 14, 4.4, 361.91666666667, 45, 3, },
[17] = { 61, 14, 4.5, 437.5, 46, 3, },
[18] = { 64, 15, 4.6, 527.93333333333, 47, 3, },
[19] = { 67, 15, 4.7, 636, 48, 3, },
[20] = { 70, 16, 4.8, 765.01666666667, 49, 4, },
[21] = { 72, 16, 5, 847.28333333333, 50, 4, },
[22] = { 74, 17, 5.1, 937.43333333333, 51, 4, },
[23] = { 76, 17, 5.2, 1036.15, 52, 4, },
[24] = { 78, 18, 5.3, 1144.1166666667, 53, 4, },
[25] = { 80, 18, 5.4, 1262.0833333333, 54, 5, },
[26] = { 82, 19, 5.5, 1390.8333333333, 55, 5, },
[27] = { 84, 19, 5.6, 1531.2, 56, 5, },
[28] = { 86, 20, 5.7, 1684.05, 57, 5, },
[29] = { 88, 20, 5.8, 1850.3, 58, 5, },
[30] = { 90, 21, 5.9, 2030.9, 59, 6, },
},
}
skills["ChargedDash"] = {
name = "Charged Dash",
gemTags = {
dexterity = true,
active_skill = true,
movement = true,
area = true,
channelling = true,
attack = true,
lightning = true,
melee = true,
},
gemTagString = "Movement, AoE, Channelling, Attack, Lightning, Melee",
gemStr = 0,
gemDex = 100,
gemInt = 0,
color = 2,
description = "Channel to project a mirage forward in the direction you're facing, based on your movement speed. Release to teleport to the mirage dealing area of effect damage multiple times along the way. Travelling further applies a bonus to the damage as well as dealing damage in larger areas. Faster attack speed and lower movement speed will both cause damage to be dealt more frequently along the path.",
skillTypes = { [38] = true, [11] = true, [10] = true, [58] = true, [1] = true, [24] = true, [35] = true, },
weaponTypes = {
["One Handed Mace"] = true,
["Sceptre"] = true,
["Thrusting One Handed Sword"] = true,
["Two Handed Sword"] = true,
["Dagger"] = true,
["Staff"] = true,
["Two Handed Axe"] = true,
["Two Handed Mace"] = true,
["One Handed Axe"] = true,
["Claw"] = true,
["One Handed Sword"] = true,
},
baseFlags = {
attack = true,
melee = true,
area = true,
},
baseMods = {
skill("castTime", 1),
skill("manaCost", 4),
mod("Speed", "MORE", 40, ModFlag.Attack), --"active_skill_attack_speed_+%_final" = 40
mod("SkillPhysicalDamageConvertToLightning", "BASE", 50), --"skill_physical_damage_%_to_convert_to_lightning" = 50
mod("Damage", "MORE", 100, 0, bit.bor(KeywordFlag.Hit, KeywordFlag.Ailment), { type = "Multiplier", var = "ChargedDashDistance" }), --"charged_dash_damage_+%_maximum" = 100
--"is_area_damage" = ?
--"base_skill_show_average_damage_instead_of_dps" = ?
},
qualityMods = {
mod("Speed", "INC", 0.5, ModFlag.Attack, 0, nil), --"attack_speed_+%" = 0.5
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = skill("damageEffectiveness", nil),
[3] = skill("baseMultiplier", nil),
},
levels = {
[1] = { 28, 0.9, 0.9, },
[2] = { 31, 0.91, 0.91, },
[3] = { 34, 0.92, 0.92, },
[4] = { 37, 0.93, 0.93, },
[5] = { 40, 0.94, 0.94, },
[6] = { 42, 0.95, 0.95, },
[7] = { 44, 0.96, 0.96, },
[8] = { 46, 0.97, 0.97, },
[9] = { 48, 0.98, 0.98, },
[10] = { 50, 0.99, 0.99, },
[11] = { 52, nil, nil, },
[12] = { 54, 1.01, 1.01, },
[13] = { 56, 1.02, 1.02, },
[14] = { 58, 1.03, 1.03, },
[15] = { 60, 1.04, 1.04, },
[16] = { 62, 1.05, 1.05, },
[17] = { 64, 1.06, 1.06, },
[18] = { 66, 1.07, 1.07, },
[19] = { 68, 1.08, 1.08, },
[20] = { 70, 1.09, 1.09, },
[21] = { 72, 1.1, 1.1, },
[22] = { 74, 1.11, 1.11, },
[23] = { 76, 1.12, 1.12, },
[24] = { 78, 1.13, 1.13, },
[25] = { 80, 1.14, 1.14, },
[26] = { 82, 1.15, 1.15, },
[27] = { 84, 1.16, 1.16, },
[28] = { 86, 1.17, 1.17, },
[29] = { 88, 1.18, 1.18, },
[30] = { 90, 1.19, 1.19, },
},
}
skills["CorpseEruption"] = {
name = "Cremation",
gemTags = {
projectile = true,
dexterity = true,
active_skill = true,
spell = true,
area = true,
fire = true,
duration = true,
},
gemTagString = "Projectile, Spell, AoE, Fire, Duration",
gemStr = 0,
gemDex = 60,
gemInt = 40,
color = 2,
description = "A targeted corpse explodes, dealing area damage and turning into a volcanic geyser, which will repeatedly unleash projectiles sequentially over the surrounding area for a duration. The explosion of the corpse is not affected by modifiers to spell damage, and cannot be reflected.",
skillTypes = { [2] = true, [11] = true, [33] = true, [12] = true, [3] = true, [26] = true, [17] = true, [18] = true, [19] = true, [36] = true, [10] = true, [67] = true, [3] = true, },
parts = {
{
name = "Spell",
spell = true,
cast = false,
},
{
name = "Corpse Explosion",
spell = false,
cast = true,
},
},
baseFlags = {
spell = true,
projectile = true,
fire = true,
area = true,
},
baseMods = {
skill("castTime", 0.6),
skill("damageEffectiveness", 0.8),
skill("CritChance", 5),
skill("duration", 8), --"base_skill_effect_duration" = 8000
--"corpse_erruption_base_maximum_number_of_geyers" = 3
skill("corpseExplosionLifeMultiplier", 0.04), --"corpse_explosion_monster_life_%" = 4
mod("ProjectileCount", "BASE", 3), --"number_of_additional_projectiles" = 3
--"is_area_damage" = ?
--"show_number_of_projectiles" = ?
skill("showAverage", true), --"base_skill_show_average_damage_instead_of_dps" = ?
--"base_is_projectile" = ?
skill("explodeCorpse", true, { type = "SkillPart", skillPart = 2 }),
},
qualityMods = {
mod("FireDamage", "INC", 1), --"fire_damage_+%" = 1
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = skill("manaCost", nil),
[3] = skill("FireMin", nil), --"spell_minimum_base_fire_damage"
[4] = skill("FireMax", nil), --"spell_maximum_base_fire_damage"
},
levels = {
[1] = { 28, 14, 40, 60, },
[2] = { 31, 15, 48, 71, },
[3] = { 34, 16, 57, 85, },
[4] = { 37, 17, 67, 101, },
[5] = { 40, 18, 79, 119, },
[6] = { 42, 19, 88, 133, },
[7] = { 44, 20, 98, 147, },
[8] = { 46, 21, 109, 164, },
[9] = { 48, 22, 121, 182, },
[10] = { 50, 23, 134, 201, },
[11] = { 52, 24, 149, 223, },
[12] = { 54, 25, 164, 247, },
[13] = { 56, 25, 182, 272, },
[14] = { 58, 25, 201, 301, },
[15] = { 60, 26, 221, 332, },
[16] = { 62, 26, 244, 365, },
[17] = { 64, 26, 268, 402, },
[18] = { 66, 26, 295, 443, },
[19] = { 68, 27, 325, 487, },
[20] = { 70, 27, 357, 535, },
[21] = { 72, 28, 392, 587, },
[22] = { 74, 28, 430, 645, },
[23] = { 76, 29, 471, 707, },
[24] = { 78, 29, 517, 775, },
[25] = { 80, 30, 566, 849, },
[26] = { 82, 30, 620, 930, },
[27] = { 84, 30, 679, 1018, },
[28] = { 86, 30, 742, 1114, },
[29] = { 88, 31, 812, 1218, },
[30] = { 90, 31, 887, 1331, },
},
}
skills["Cyclone"] = {
name = "Cyclone",
gemTags = {
dexterity = true,
active_skill = true,
attack = true,
area = true,
movement = true,
melee = true,
},
gemTagString = "Attack, AoE, Movement, Melee",
gemStr = 40,
gemDex = 60,
gemInt = 0,
color = 2,
description = "Damage enemies around you, then perform a spinning series of attacks as you travel to a target location. Cannot be supported by Multistrike or Ruthless.",
skillTypes = { [1] = true, [11] = true, [24] = true, [38] = true, [65] = true, },
weaponTypes = {
["None"] = true,
["One Handed Mace"] = true,
["Sceptre"] = true,
["Thrusting One Handed Sword"] = true,
["Two Handed Sword"] = true,
["Dagger"] = true,
["Staff"] = true,
["Two Handed Axe"] = true,
["Two Handed Mace"] = true,
["One Handed Axe"] = true,
["Claw"] = true,
["One Handed Sword"] = true,
},
baseFlags = {
attack = true,
melee = true,
area = true,
movement = true,
},
baseMods = {
skill("castTime", 1),
skill("manaCost", 12),
mod("Speed", "MORE", 50, ModFlag.Attack), --"active_skill_attack_speed_+%_final" = 50
mod("MovementSpeed", "MORE", -30), --"cyclone_movement_speed_+%_final" = -30
--"base_skill_number_of_additional_hits" = 1
--"cyclone_first_hit_damage_+%_final" = -50
--"is_area_damage" = ?
skill("dpsMultiplier", 2),
skill("radiusIsWeaponRange", true),
},
qualityMods = {
mod("AreaOfEffect", "INC", 0.5), --"base_skill_area_of_effect_+%" = 0.5
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = skill("damageEffectiveness", nil),
[3] = skill("baseMultiplier", nil),
[4] = { mod("MeleeWeaponRange", "BASE", nil), mod("UnarmedRange", "BASE", nil) }, --"melee_range_+"
},
levels = {
[1] = { 28, 0.45, 0.45, 0, },
[2] = { 31, 0.46, 0.456, 0, },
[3] = { 34, 0.46, 0.462, 0, },
[4] = { 37, 0.47, 0.468, 0, },
[5] = { 40, 0.47, 0.474, 0, },
[6] = { 42, 0.48, 0.48, 1, },
[7] = { 44, 0.49, 0.486, 1, },
[8] = { 46, 0.49, 0.492, 1, },
[9] = { 48, 0.5, 0.498, 1, },
[10] = { 50, 0.5, 0.504, 1, },
[11] = { 52, 0.51, 0.51, 2, },
[12] = { 54, 0.52, 0.516, 2, },
[13] = { 56, 0.52, 0.522, 2, },
[14] = { 58, 0.53, 0.528, 2, },
[15] = { 60, 0.53, 0.534, 2, },
[16] = { 62, 0.54, 0.54, 3, },
[17] = { 64, 0.55, 0.546, 3, },
[18] = { 66, 0.55, 0.552, 3, },
[19] = { 68, 0.56, 0.558, 3, },
[20] = { 70, 0.56, 0.564, 3, },
[21] = { 72, 0.57, 0.57, 4, },
[22] = { 74, 0.58, 0.576, 4, },
[23] = { 76, 0.58, 0.582, 4, },
[24] = { 78, 0.59, 0.588, 4, },
[25] = { 80, 0.59, 0.594, 4, },
[26] = { 82, 0.6, 0.6, 5, },
[27] = { 84, 0.61, 0.606, 5, },
[28] = { 86, 0.61, 0.612, 5, },
[29] = { 88, 0.62, 0.618, 5, },
[30] = { 90, 0.62, 0.624, 5, },
},
}
skills["VaalCyclone"] = {
name = "Vaal Cyclone",
gemTags = {
dexterity = true,
active_skill = true,
vaal = true,
attack = true,
area = true,
duration = true,
melee = true,
},
gemTagString = "Vaal, Attack, AoE, Duration, Melee",
gemStr = 40,
gemDex = 60,
gemInt = 0,
color = 2,
description = "Spin and attack in place, damaging nearby enemies and pulling others towards you. Cannot be supported by Ruthless.",
skillTypes = { [1] = true, [11] = true, [24] = true, [12] = true, [43] = true, [65] = true, },
weaponTypes = {
["None"] = true,
["One Handed Mace"] = true,
["Sceptre"] = true,
["Thrusting One Handed Sword"] = true,
["Two Handed Sword"] = true,
["Dagger"] = true,
["Staff"] = true,
["Two Handed Axe"] = true,
["Two Handed Mace"] = true,
["One Handed Axe"] = true,
["Claw"] = true,
["One Handed Sword"] = true,
},
baseFlags = {
attack = true,
melee = true,
area = true,
duration = true,
vaal = true,
},
baseMods = {
skill("castTime", 1),
mod("Speed", "MORE", 100, ModFlag.Attack), --"active_skill_attack_speed_+%_final" = 100
skill("duration", 5), --"base_skill_effect_duration" = 5000
--"base_skill_number_of_additional_hits" = 1
mod("AreaOfEffect", "INC", 50), --"base_skill_area_of_effect_+%" = 50
--"is_area_damage" = ?
skill("cannotBeEvaded", true), --"global_always_hit" = ?
},
qualityMods = {
mod("AreaOfEffect", "INC", 0.5), --"base_skill_area_of_effect_+%" = 0.5
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = skill("damageEffectiveness", nil),
[3] = skill("baseMultiplier", nil),
[4] = { mod("MeleeWeaponRange", "BASE", nil), mod("UnarmedRange", "BASE", nil) }, --"melee_range_+"
},
levels = {
[1] = { 28, 0.5, 0.5, 0, },
[2] = { 31, 0.51, 0.506, 0, },
[3] = { 34, 0.51, 0.512, 0, },
[4] = { 37, 0.52, 0.518, 0, },
[5] = { 40, 0.52, 0.524, 0, },
[6] = { 42, 0.53, 0.53, 1, },
[7] = { 44, 0.54, 0.536, 1, },
[8] = { 46, 0.54, 0.542, 1, },
[9] = { 48, 0.55, 0.548, 1, },
[10] = { 50, 0.55, 0.554, 1, },
[11] = { 52, 0.56, 0.56, 2, },
[12] = { 54, 0.57, 0.566, 2, },
[13] = { 56, 0.57, 0.572, 2, },
[14] = { 58, 0.58, 0.578, 2, },
[15] = { 60, 0.58, 0.584, 2, },
[16] = { 62, 0.59, 0.59, 3, },
[17] = { 64, 0.6, 0.596, 3, },
[18] = { 66, 0.6, 0.602, 3, },
[19] = { 68, 0.61, 0.608, 3, },
[20] = { 70, 0.61, 0.614, 3, },
[21] = { 72, 0.62, 0.62, 4, },
[22] = { 74, 0.63, 0.626, 4, },
[23] = { 76, 0.63, 0.632, 4, },
[24] = { 78, 0.64, 0.638, 4, },
[25] = { 80, 0.64, 0.644, 4, },
[26] = { 82, 0.65, 0.65, 5, },
[27] = { 84, 0.66, 0.656, 5, },
[28] = { 86, 0.66, 0.662, 5, },
[29] = { 88, 0.67, 0.668, 5, },
[30] = { 90, 0.67, 0.674, 5, },
},
}
skills["Desecrate"] = {
name = "Desecrate",
gemTags = {
dexterity = true,
active_skill = true,
spell = true,
area = true,
duration = true,
chaos = true,
},
gemTagString = "Spell, AoE, Duration, Chaos",
gemStr = 0,
gemDex = 60,
gemInt = 40,
color = 2,
description = "Desecrates the ground, summoning corpses and dealing chaos damage to all enemies in the area. The corpses will be chosen from the monsters in the current area and any Spectres that have existed in this instance.",
skillTypes = { [2] = true, [11] = true, [12] = true, [17] = true, [18] = true, [19] = true, [36] = true, [40] = true, [26] = true, [50] = true, [67] = true, },
baseFlags = {
spell = true,
area = true,
duration = true,
chaos = true,
},
baseMods = {
skill("castTime", 0.8),
skill("cooldown", 3),
skill("duration", 5), --"base_skill_effect_duration" = 5000
--"desecrate_number_of_corpses_to_create" = 5
--"desecrate_maximum_number_of_corpses" = 15
--"is_area_damage" = ?
skill("dotIsArea", true),
},
qualityMods = {
mod("Speed", "INC", 1, ModFlag.Cast), --"base_cast_speed_+%" = 1
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = skill("manaCost", nil),
[3] = skill("ChaosDot", nil), --"base_chaos_damage_to_deal_per_minute"
--[4] = "desecrate_corpse_level"
},
levels = {
[1] = { 16, 8, 8.1666666666667, 20, },
[2] = { 20, 8, 11.316666666667, 24, },
[3] = { 24, 9, 15.383333333333, 28, },
[4] = { 28, 9, 20.633333333333, 32, },
[5] = { 31, 10, 25.533333333333, 35, },
[6] = { 34, 11, 31.416666666667, 38, },
[7] = { 37, 12, 38.466666666667, 41, },
[8] = { 40, 12, 46.916666666667, 44, },
[9] = { 43, 13, 57.016666666667, 47, },
[10] = { 46, 14, 69.05, 50, },
[11] = { 49, 15, 83.4, 53, },
[12] = { 52, 16, 100.46666666667, 56, },
[13] = { 55, 17, 120.73333333333, 59, },
[14] = { 58, 18, 144.76666666667, 62, },
[15] = { 60, 18, 163.23333333333, 65, },
[16] = { 62, 18, 183.88333333333, 69, },
[17] = { 64, 19, 207, 73, },
[18] = { 66, 19, 232.83333333333, 77, },
[19] = { 68, 20, 261.71666666667, 81, },
[20] = { 70, 20, 294, 100, },
[21] = { 72, 21, 330.05, 100, },
[22] = { 74, 22, 370.3, 100, },
[23] = { 76, 22, 415.21666666667, 100, },
[24] = { 78, 22, 465.33333333333, 100, },
[25] = { 80, 23, 521.21666666667, 100, },
[26] = { 82, 23, 583.53333333333, 100, },
[27] = { 84, 24, 652.98333333333, 100, },
[28] = { 86, 25, 730.38333333333, 100, },
[29] = { 88, 25, 816.58333333333, 100, },
[30] = { 90, 26, 912.58333333333, 100, },
},
}
skills["DetonateDead"] = {
name = "Detonate Dead",
gemTags = {
dexterity = true,
active_skill = true,
spell = true,
area = true,
fire = true,
},
gemTagString = "Spell, AoE, Fire",
gemStr = 0,
gemDex = 60,
gemInt = 40,
color = 2,
description = "Targets a corpse, and deals spell damage to enemies around the corpse, as well as causing the corpse to explode, dealing fire damage. The explosion is not affected by modifiers to spell damage and cannot be reflected.",
skillTypes = { [2] = true, [10] = true, [11] = true, [17] = true, [18] = true, [19] = true, [26] = true, [36] = true, [33] = true, [67] = true, },
parts = {
{
name = "Spell",
spell = true,
cast = false,
},
{
name = "Corpse Explosion",
spell = false,
cast = true,
},
},
baseFlags = {
spell = true,
area = true,
fire = true,
},
baseMods = {
skill("castTime", 0.6),
skill("CritChance", 6),
skill("corpseExplosionLifeMultiplier", 0.06), --"corpse_explosion_monster_life_%" = 6
--"is_area_damage" = ?
skill("radius", 22),
skill("explodeCorpse", true, { type = "SkillPart", skillPart = 2 }),
},
qualityMods = {
mod("Speed", "INC", 0.5, ModFlag.Cast), --"base_cast_speed_+%" = 0.5
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = skill("manaCost", nil),
[3] = skill("FireMin", nil), --"spell_minimum_base_fire_damage"
[4] = skill("FireMax", nil), --"spell_maximum_base_fire_damage"
[5] = skill("radiusExtra", nil), --"active_skill_base_radius_+"
},
levels = {
[1] = { 4, 7, 10, 14, 0, },
[2] = { 6, 8, 14, 21, 0, },
[3] = { 9, 9, 21, 28, 0, },
[4] = { 12, 10, 24, 37, 0, },
[5] = { 16, 11, 34, 51, 1, },
[6] = { 20, 12, 45, 68, 1, },
[7] = { 24, 14, 60, 90, 1, },
[8] = { 28, 15, 78, 117, 1, },
[9] = { 32, 17, 101, 151, 1, },
[10] = { 36, 19, 129, 193, 2, },
[11] = { 40, 21, 163, 245, 2, },
[12] = { 44, 22, 205, 308, 2, },
[13] = { 48, 23, 257, 385, 2, },
[14] = { 52, 24, 320, 480, 2, },
[15] = { 55, 25, 377, 565, 3, },
[16] = { 58, 26, 442, 663, 3, },
[17] = { 61, 27, 518, 776, 3, },
[18] = { 64, 28, 605, 908, 3, },
[19] = { 67, 29, 706, 1060, 3, },
[20] = { 70, 30, 823, 1235, 4, },
[21] = { 72, 31, 911, 1367, 4, },
[22] = { 74, 32, 1008, 1511, 4, },
[23] = { 76, 33, 1114, 1670, 4, },
[24] = { 78, 34, 1230, 1845, 4, },
[25] = { 80, 34, 1358, 2037, 5, },
[26] = { 82, 35, 1499, 2249, 5, },
[27] = { 84, 36, 1653, 2480, 5, },
[28] = { 86, 37, 1823, 2735, 5, },
[29] = { 88, 38, 2009, 3014, 5, },
[30] = { 90, 38, 2213, 3320, 6, },
},
}
skills["VaalDetonateDead"] = {
name = "Vaal Detonate Dead",
gemTags = {
dexterity = true,
active_skill = true,
vaal = true,
spell = true,
area = true,
fire = true,
},
gemTagString = "Vaal, Spell, AoE, Fire",
gemStr = 0,
gemDex = 60,
gemInt = 40,
color = 2,
description = "Explodes an unused corpse, dealing fire damage to nearby enemies. Nearby corpses will also explode in a chain reaction. The explosions are not affected by modifiers to spell damage.",
skillTypes = { [2] = true, [10] = true, [11] = true, [17] = true, [18] = true, [19] = true, [43] = true, [33] = true, },
baseFlags = {
cast = true,
area = true,
fire = true,
},
baseMods = {
skill("castTime", 0.6),
skill("CritChance", 5),
skill("corpseExplosionLifeMultiplier", 0.08), --"corpse_explosion_monster_life_%" = 8
--"is_area_damage" = 1
--"display_skill_deals_secondary_damage" = ?
--"detonate_dead_chain_explode" = ?
--"damage_cannot_be_reflected" = ?
skill("explodeCorpse", true),
},
qualityMods = {
mod("Speed", "INC", 1, ModFlag.Cast), --"base_cast_speed_+%" = 1
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = skill("FireMin", nil), --"secondary_minimum_base_fire_damage"
[3] = skill("FireMax", nil), --"secondary_maximum_base_fire_damage"
},
levels = {
[1] = { 4, 3, 5, },
[2] = { 6, 5, 7, },
[3] = { 9, 7, 10, },
[4] = { 12, 8, 12, },
[5] = { 16, 11, 17, },
[6] = { 20, 15, 23, },
[7] = { 24, 20, 30, },
[8] = { 28, 26, 39, },
[9] = { 32, 33, 50, },
[10] = { 36, 42, 63, },
[11] = { 40, 53, 79, },
[12] = { 44, 66, 99, },
[13] = { 48, 82, 122, },
[14] = { 52, 101, 151, },
[15] = { 55, 118, 177, },
[16] = { 58, 138, 207, },
[17] = { 61, 160, 241, },
[18] = { 64, 186, 280, },
[19] = { 67, 216, 325, },
[20] = { 70, 251, 376, },
[21] = { 72, 276, 415, },
[22] = { 74, 304, 457, },
[23] = { 76, 335, 503, },
[24] = { 78, 369, 553, },
[25] = { 80, 406, 609, },
[26] = { 82, 446, 669, },
[27] = { 84, 490, 735, },
[28] = { 86, 538, 807, },
[29] = { 88, 591, 886, },
[30] = { 90, 649, 973, },
},
}
skills["DoubleStrike"] = {
name = "Double Strike",
gemTags = {
dexterity = true,
active_skill = true,
attack = true,
melee = true,
},
gemTagString = "Attack, Melee",
gemStr = 0,
gemDex = 100,
gemInt = 0,
color = 2,
description = "Performs two fast attacks on target enemy with your main hand melee weapon.",
skillTypes = { [1] = true, [7] = true, [25] = true, [28] = true, [24] = true, },
weaponTypes = {
["One Handed Mace"] = true,
["Sceptre"] = true,
["Thrusting One Handed Sword"] = true,
["Two Handed Sword"] = true,
["Dagger"] = true,
["Staff"] = true,
["Two Handed Axe"] = true,
["Two Handed Mace"] = true,
["One Handed Axe"] = true,
["Claw"] = true,
["One Handed Sword"] = true,
},
baseFlags = {
attack = true,
melee = true,
},
baseMods = {
skill("castTime", 1),
skill("manaCost", 5),
--"base_skill_number_of_additional_hits" = 1
skill("dpsMultiplier", 2),
},
qualityMods = {
mod("Speed", "INC", 0.5, ModFlag.Attack, 0, nil), --"attack_speed_+%" = 0.5
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = skill("damageEffectiveness", nil),
[3] = skill("baseMultiplier", nil),
},
levels = {
[1] = { 1, 0.7, 0.7, },
[2] = { 2, 0.71, 0.714, },
[3] = { 4, 0.73, 0.728, },
[4] = { 7, 0.74, 0.742, },
[5] = { 11, 0.76, 0.756, },
[6] = { 16, 0.77, 0.77, },
[7] = { 20, 0.78, 0.784, },
[8] = { 24, 0.8, 0.798, },
[9] = { 28, 0.81, 0.812, },
[10] = { 32, 0.83, 0.826, },
[11] = { 36, 0.84, 0.84, },
[12] = { 40, 0.85, 0.854, },
[13] = { 44, 0.87, 0.868, },
[14] = { 48, 0.88, 0.882, },
[15] = { 52, 0.9, 0.896, },
[16] = { 56, 0.91, 0.91, },
[17] = { 60, 0.92, 0.924, },
[18] = { 64, 0.94, 0.938, },
[19] = { 67, 0.95, 0.952, },
[20] = { 70, 0.97, 0.966, },
[21] = { 72, 0.98, 0.98, },
[22] = { 74, 0.99, 0.994, },
[23] = { 76, 1.01, 1.008, },
[24] = { 78, 1.02, 1.022, },
[25] = { 80, 1.04, 1.036, },
[26] = { 82, 1.05, 1.05, },
[27] = { 84, 1.06, 1.064, },
[28] = { 86, 1.08, 1.078, },
[29] = { 88, 1.09, 1.092, },
[30] = { 90, 1.11, 1.106, },
},
}
skills["VaalDoubleStrike"] = {
name = "Vaal Double Strike",
gemTags = {
dexterity = true,
active_skill = true,
vaal = true,
attack = true,
melee = true,
duration = true,
},
gemTagString = "Vaal, Attack, Melee, Duration",
gemStr = 0,
gemDex = 100,
gemInt = 0,
color = 2,
description = "Performs two fast attacks on target enemy with your main hand melee weapon, and summons your double for a duration to continuously attack monsters in this fashion.",
skillTypes = { [1] = true, [7] = true, [25] = true, [24] = true, [12] = true, [43] = true, },
weaponTypes = {
["One Handed Mace"] = true,
["Sceptre"] = true,
["Thrusting One Handed Sword"] = true,
["Two Handed Sword"] = true,
["Dagger"] = true,
["Staff"] = true,
["Two Handed Axe"] = true,
["Two Handed Mace"] = true,
["One Handed Axe"] = true,
["Claw"] = true,
["One Handed Sword"] = true,
},
baseFlags = {
attack = true,
melee = true,
duration = true,
vaal = true,
},
baseMods = {
skill("castTime", 1),
--"base_skill_number_of_additional_hits" = 1
--"number_of_monsters_to_summon" = 1
},
qualityMods = {
mod("Speed", "INC", 0.5, ModFlag.Attack, 0, nil), --"attack_speed_+%" = 0.5
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = skill("damageEffectiveness", nil),
[3] = skill("baseMultiplier", nil),
[4] = skill("duration", nil), --"base_skill_effect_duration"
},
levels = {
[1] = { 1, 0.7, 0.7, 3.6, },
[2] = { 2, 0.71, 0.708, 3.7, },
[3] = { 4, 0.72, 0.716, 3.8, },
[4] = { 7, 0.72, 0.724, 3.9, },
[5] = { 11, 0.73, 0.732, 4, },
[6] = { 16, 0.74, 0.74, 4.1, },
[7] = { 20, 0.75, 0.748, 4.2, },
[8] = { 24, 0.76, 0.756, 4.3, },
[9] = { 28, 0.76, 0.764, 4.4, },
[10] = { 32, 0.77, 0.772, 4.5, },
[11] = { 36, 0.78, 0.78, 4.6, },
[12] = { 40, 0.79, 0.788, 4.7, },
[13] = { 44, 0.8, 0.796, 4.8, },
[14] = { 48, 0.8, 0.804, 4.9, },
[15] = { 52, 0.81, 0.812, 5, },
[16] = { 56, 0.82, 0.82, 5.1, },
[17] = { 60, 0.83, 0.828, 5.2, },
[18] = { 64, 0.84, 0.836, 5.3, },
[19] = { 67, 0.84, 0.844, 5.4, },
[20] = { 70, 0.85, 0.852, 5.5, },
[21] = { 72, 0.86, 0.86, 5.6, },
[22] = { 74, 0.87, 0.868, 5.7, },
[23] = { 76, 0.88, 0.876, 5.8, },
[24] = { 78, 0.88, 0.884, 5.9, },
[25] = { 80, 0.89, 0.892, 6, },
[26] = { 82, 0.9, 0.9, 6.1, },
[27] = { 84, 0.91, 0.908, 6.2, },
[28] = { 86, 0.92, 0.916, 6.3, },
[29] = { 88, 0.92, 0.924, 6.4, },
[30] = { 90, 0.93, 0.932, 6.5, },
},
}
skills["DualStrike"] = {
name = "Dual Strike",
gemTags = {
dexterity = true,
active_skill = true,
attack = true,
melee = true,
},
gemTagString = "Attack, Melee",
gemStr = 40,
gemDex = 60,
gemInt = 0,
color = 2,
description = "Attacks with both weapons, dealing the damage of both in one strike. Dual wield only. Does not work with wands.",
skillTypes = { [1] = true, [4] = true, [25] = true, [28] = true, [24] = true, [53] = true, },
weaponTypes = {
["Two Handed Axe"] = true,
["Claw"] = true,
["One Handed Mace"] = true,
["Sceptre"] = true,
["Thrusting One Handed Sword"] = true,
["One Handed Axe"] = true,
["Dagger"] = true,
["One Handed Sword"] = true,
},
baseFlags = {
attack = true,
melee = true,
},
baseMods = {
skill("castTime", 1),
skill("manaCost", 5),
skill("doubleHitsWhenDualWielding", true), --"skill_double_hits_when_dual_wielding" = ?
},
qualityMods = {
mod("Speed", "INC", 0.5, ModFlag.Attack, 0, nil), --"attack_speed_+%" = 0.5
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = skill("damageEffectiveness", nil),
[3] = skill("baseMultiplier", nil),
},
levels = {
[1] = { 1, 0.85, 0.85, },
[2] = { 2, 0.86, 0.86, },
[3] = { 4, 0.87, 0.87, },
[4] = { 7, 0.88, 0.88, },
[5] = { 11, 0.89, 0.89, },
[6] = { 16, 0.9, 0.9, },
[7] = { 20, 0.91, 0.91, },
[8] = { 24, 0.92, 0.92, },
[9] = { 28, 0.93, 0.93, },
[10] = { 32, 0.94, 0.94, },
[11] = { 36, 0.95, 0.95, },
[12] = { 40, 0.96, 0.96, },
[13] = { 44, 0.97, 0.97, },
[14] = { 48, 0.98, 0.98, },
[15] = { 52, 0.99, 0.99, },
[16] = { 56, nil, nil, },
[17] = { 60, 1.01, 1.01, },
[18] = { 64, 1.02, 1.02, },
[19] = { 67, 1.03, 1.03, },
[20] = { 70, 1.04, 1.04, },
[21] = { 72, 1.05, 1.05, },
[22] = { 74, 1.06, 1.06, },
[23] = { 76, 1.07, 1.07, },
[24] = { 78, 1.08, 1.08, },
[25] = { 80, 1.09, 1.09, },
[26] = { 82, 1.1, 1.1, },
[27] = { 84, 1.11, 1.11, },
[28] = { 86, 1.12, 1.12, },
[29] = { 88, 1.13, 1.13, },
[30] = { 90, 1.14, 1.14, },
},
}
skills["ElementalHit"] = {
name = "Elemental Hit",
gemTags = {
dexterity = true,
active_skill = true,
attack = true,
melee = true,
fire = true,
cold = true,
lightning = true,
bow = true,
},
gemTagString = "Attack, Melee, Fire, Cold, Lightning, Bow",
gemStr = 0,
gemDex = 100,
gemInt = 0,
color = 2,
description = "A standard attack (with any weapon) that adds damage of a random element.",
skillTypes = { [1] = true, [3] = true, [68] = true, [22] = true, [17] = true, [19] = true, [25] = true, [28] = true, [24] = true, [33] = true, [34] = true, [35] = true, [48] = true, [69] = true, },
parts = {
{
name = "Added fire",
},
{
name = "Added cold",
},
{
name = "Added lightning",
},
},
baseFlags = {
attack = true,
melee = true,
projectile = true,
cold = true,
fire = true,
lightning = true,
},
baseMods = {
skill("castTime", 1),
{ mod("EnemyFreezeChance", "BASE", 10), mod("EnemyShockChance", "BASE", 10), mod("EnemyIgniteChance", "BASE", 10) }, --"chance_to_freeze_shock_ignite_%" = 10
--"skill_can_fire_arrows" = ?
--"skill_can_fire_wand_projectiles" = ?
},
qualityMods = {
mod("ElementalDamage", "INC", 1), --"elemental_damage_+%" = 1
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = skill("manaCost", nil),
[3] = mod("FireMin", "BASE", nil, 0, KeywordFlag.Attack, { type = "SkillPart", skillPart = 1 }), --"attack_minimum_base_fire_damage_for_elemental_hit"
[4] = mod("FireMax", "BASE", nil, 0, KeywordFlag.Attack, { type = "SkillPart", skillPart = 1 }), --"attack_maximum_base_fire_damage_for_elemental_hit"
[5] = mod("ColdMin", "BASE", nil, 0, KeywordFlag.Attack, { type = "SkillPart", skillPart = 2 }), --"attack_minimum_base_cold_damage_for_elemental_hit"
[6] = mod("ColdMax", "BASE", nil, 0, KeywordFlag.Attack, { type = "SkillPart", skillPart = 2 }), --"attack_maximum_base_cold_damage_for_elemental_hit"
[7] = mod("LightningMin", "BASE", nil, 0, KeywordFlag.Attack, { type = "SkillPart", skillPart = 3 }), --"attack_minimum_base_lightning_damage_for_elemental_hit"
[8] = mod("LightningMax", "BASE", nil, 0, KeywordFlag.Attack, { type = "SkillPart", skillPart = 3 }), --"attack_maximum_base_lightning_damage_for_elemental_hit"
},
levels = {
[1] = { 1, 6, 4, 8, 3, 6, 1, 13, },
[2] = { 2, 6, 5, 9, 4, 7, 1, 14, },
[3] = { 4, 6, 6, 11, 5, 9, 1, 17, },
[4] = { 7, 7, 7, 14, 6, 11, 1, 23, },
[5] = { 11, 7, 10, 19, 8, 16, 2, 31, },
[6] = { 16, 7, 14, 27, 12, 22, 2, 44, },
[7] = { 20, 8, 18, 34, 15, 28, 3, 56, },
[8] = { 24, 8, 23, 43, 19, 35, 4, 70, },
[9] = { 28, 8, 28, 53, 23, 43, 5, 87, },
[10] = { 32, 9, 35, 64, 28, 53, 6, 106, },
[11] = { 36, 9, 42, 78, 34, 64, 7, 128, },
[12] = { 40, 9, 50, 93, 41, 76, 8, 153, },
[13] = { 44, 10, 60, 111, 49, 91, 10, 183, },
[14] = { 48, 10, 71, 132, 58, 108, 11, 217, },
[15] = { 52, 10, 84, 156, 69, 127, 13, 256, },
[16] = { 56, 11, 99, 183, 81, 150, 16, 301, },
[17] = { 60, 11, 115, 214, 94, 175, 19, 352, },
[18] = { 64, 11, 135, 250, 110, 205, 22, 411, },
[19] = { 67, 11, 151, 280, 123, 229, 24, 461, },
[20] = { 70, 12, 169, 314, 138, 257, 27, 516, },
[21] = { 72, 12, 182, 338, 149, 276, 29, 555, },
[22] = { 74, 12, 196, 364, 160, 297, 31, 598, },
[23] = { 76, 12, 211, 391, 172, 320, 34, 643, },
[24] = { 78, 13, 226, 420, 185, 344, 36, 691, },
[25] = { 80, 13, 243, 452, 199, 370, 39, 743, },
[26] = { 82, 13, 261, 485, 214, 397, 42, 798, },
[27] = { 84, 13, 281, 521, 230, 426, 45, 857, },
[28] = { 86, 14, 301, 559, 246, 457, 48, 919, },
[29] = { 88, 14, 323, 600, 264, 491, 52, 986, },
[30] = { 90, 14, 346, 643, 283, 526, 56, 1057, },
},
}
skills["EtherealKnives"] = {
name = "Ethereal Knives",
gemTags = {
projectile = true,
dexterity = true,
active_skill = true,
spell = true,
},
gemTagString = "Projectile, Spell",
gemStr = 0,
gemDex = 60,
gemInt = 40,
color = 2,
description = "Fires an arc of knives in front of the caster which deals physical damage.",
skillTypes = { [2] = true, [10] = true, [3] = true, [68] = true, [18] = true, [17] = true, [19] = true, [26] = true, [36] = true, },
baseFlags = {
spell = true,
projectile = true,
},
baseMods = {
skill("castTime", 0.6),
skill("CritChance", 6),
mod("ProjectileCount", "BASE", 9), --"number_of_additional_projectiles" = 9
--"base_is_projectile" = ?
},
qualityMods = {
mod("ProjectileSpeed", "INC", 1), --"base_projectile_speed_+%" = 1
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = skill("manaCost", nil),
[3] = skill("PhysicalMin", nil), --"spell_minimum_base_physical_damage"
[4] = skill("PhysicalMax", nil), --"spell_maximum_base_physical_damage"
[5] = mod("ProjectileSpeed", "INC", nil), --"base_projectile_speed_+%"
},
levels = {
[1] = { 1, 5, 4, 6, 0, },
[2] = { 2, 6, 5, 7, 1, },
[3] = { 4, 7, 6, 9, 2, },
[4] = { 7, 8, 8, 12, 3, },
[5] = { 11, 9, 12, 18, 4, },
[6] = { 16, 10, 18, 27, 5, },
[7] = { 20, 11, 24, 37, 6, },
[8] = { 24, 12, 32, 49, 7, },
[9] = { 28, 13, 42, 64, 8, },
[10] = { 32, 14, 55, 82, 9, },
[11] = { 36, 16, 70, 105, 10, },
[12] = { 40, 17, 89, 134, 11, },
[13] = { 44, 18, 112, 169, 12, },
[14] = { 48, 18, 141, 212, 13, },
[15] = { 52, 19, 176, 265, 14, },
[16] = { 56, 20, 219, 329, 15, },
[17] = { 60, 21, 272, 408, 16, },
[18] = { 64, 22, 336, 504, 17, },
[19] = { 67, 22, 393, 590, 18, },
[20] = { 70, 23, 459, 688, 19, },
[21] = { 72, 24, 509, 763, 20, },
[22] = { 74, 24, 563, 845, 21, },
[23] = { 76, 25, 623, 935, 22, },
[24] = { 78, 25, 690, 1034, 23, },
[25] = { 80, 26, 762, 1144, 24, },
[26] = { 82, 26, 842, 1264, 25, },
[27] = { 84, 27, 931, 1396, 26, },
[28] = { 86, 27, 1027, 1541, 27, },
[29] = { 88, 28, 1134, 1701, 28, },
[30] = { 90, 29, 1251, 1876, 29, },
},
}
skills["ExplosiveArrow"] = {
name = "Explosive Arrow",
gemTags = {
fire = true,
dexterity = true,
active_skill = true,
attack = true,
area = true,
duration = true,
bow = true,
},
gemTagString = "Fire, Attack, AoE, Duration, Bow",
gemStr = 0,
gemDex = 100,
gemInt = 0,
color = 2,
description = "Fires an arrow which acts as a short duration fuse. Applying additional arrows to an enemy extends the duration. When the target dies or the fuses expire, the arrows explode, dealing fire AoE damage to nearby enemies. The AoE radius is proportional to the number of arrows upon death.",
skillTypes = { [1] = true, [48] = true, [69] = true, [3] = true, [68] = true, [10] = true, [11] = true, [12] = true, [22] = true, [17] = true, [19] = true, [33] = true, },
weaponTypes = {
["Bow"] = true,
},
parts = {
{
name = "Explosion (1 fuse)",
attack = false,
area = true,
cast = true,
},
{
name = "Explosion (5 fuses)",
attack = false,
area = true,
cast = true,
},
{
name = "Arrow",
attack = true,
area = false,
cast = false,
},
},
baseFlags = {
attack = true,
projectile = true,
area = true,
duration = true,
fire = true,
},
baseMods = {
skill("castTime", 1),
skill("CritChance", 6),
skill("duration", 1), --"base_skill_effect_duration" = 1000
skill("radiusExtra", 2, { type = "Multiplier", var = "ExplosiveArrowFuse" }), --"fuse_arrow_explosion_radius_+_per_fuse_arrow_orb" = 2
--"active_skill_attack_damage_+%_final" = 0
--"skill_can_fire_arrows" = 1
--"base_is_projectile" = 1
skill("radius", 15),
skill("showAverage", true, { type = "SkillPart", skillPart = 1 }),
skill("showAverage", true, { type = "SkillPart", skillPart = 2 }),
mod("Multiplier:ExplosiveArrowFuse", "BASE", 1, 0, 0, { type = "SkillPart", skillPart = 1 }),
mod("Multiplier:ExplosiveArrowFuse", "BASE", 5, 0, 0, { type = "SkillPart", skillPart = 2 }),
},
qualityMods = {
mod("EnemyIgniteChance", "BASE", 1), --"base_chance_to_ignite_%" = 1
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = skill("manaCost", nil),
[3] = skill("FireMin", nil, { type = "Multiplier", var = "ExplosiveArrowFuse" }), --"minimum_fire_damage_per_fuse_arrow_orb"
[4] = skill("FireMax", nil, { type = "Multiplier", var = "ExplosiveArrowFuse" }), --"maximum_fire_damage_per_fuse_arrow_orb"
},
levels = {
[1] = { 28, 18, 44, 66, },
[2] = { 31, 19, 54, 81, },
[3] = { 34, 20, 66, 99, },
[4] = { 37, 21, 80, 121, },
[5] = { 40, 21, 98, 146, },
[6] = { 42, 22, 111, 166, },
[7] = { 44, 22, 126, 189, },
[8] = { 46, 23, 142, 214, },
[9] = { 48, 23, 161, 242, },
[10] = { 50, 24, 182, 273, },
[11] = { 52, 24, 205, 308, },
[12] = { 54, 24, 232, 347, },
[13] = { 56, 26, 261, 391, },
[14] = { 58, 26, 293, 440, },
[15] = { 60, 26, 330, 495, },
[16] = { 62, 26, 371, 556, },
[17] = { 64, 26, 416, 624, },
[18] = { 66, 27, 467, 700, },
[19] = { 68, 27, 523, 785, },
[20] = { 70, 27, 586, 879, },
[21] = { 72, 28, 656, 984, },
[22] = { 74, 28, 734, 1100, },
[23] = { 76, 29, 820, 1230, },
[24] = { 78, 29, 917, 1375, },
[25] = { 80, 30, 1024, 1536, },
[26] = { 82, 30, 1143, 1714, },
[27] = { 84, 30, 1275, 1913, },
[28] = { 86, 30, 1422, 2134, },
[29] = { 88, 31, 1586, 2379, },
[30] = { 90, 31, 1767, 2651, },
},
}
skills["FireTrap"] = {
name = "Fire Trap",
gemTags = {
trap = true,
dexterity = true,
active_skill = true,
spell = true,
duration = true,
area = true,
fire = true,
},
gemTagString = "Trap, Spell, Duration, AoE, Fire",
gemStr = 0,
gemDex = 60,
gemInt = 40,
color = 2,
description = "Throws a trap that explodes when triggered, dealing fire damage to surrounding enemies and leaving an area of burning ground that damages enemies who walk through it.",
skillTypes = { [2] = true, [12] = true, [10] = true, [19] = true, [11] = true, [29] = true, [37] = true, [40] = true, [33] = true, },
baseFlags = {
spell = true,
trap = true,
area = true,
duration = true,
fire = true,
},
baseMods = {
skill("castTime", 1),
skill("CritChance", 6),
skill("cooldown", 3),
--"is_trap" = 1
--"base_trap_duration" = 4000
skill("duration", 8), --"base_skill_effect_duration" = 8000
--"is_area_damage" = ?
--"base_skill_is_trapped" = ?
skill("showAverage", true), --"base_skill_show_average_damage_instead_of_dps" = ?
skill("dotIsArea", true),
skill("radius", 15),
},
qualityMods = {
mod("FireDamage", "INC", 1.5, ModFlag.Dot), --"burn_damage_+%" = 1.5
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = skill("manaCost", nil),
[3] = skill("FireMin", nil), --"spell_minimum_base_fire_damage"
[4] = skill("FireMax", nil), --"spell_maximum_base_fire_damage"
[5] = skill("FireDot", nil), --"base_fire_damage_to_deal_per_minute"
[6] = skill("radiusExtra", nil), --"active_skill_base_radius_+"
},
levels = {
[1] = { 1, 7, 2, 4, 3.6166666666667, 0, },
[2] = { 2, 8, 3, 5, 4.15, 0, },
[3] = { 4, 9, 4, 6, 5.3166666666667, 1, },
[4] = { 7, 10, 6, 8, 7.4333333333333, 1, },
[5] = { 11, 11, 8, 12, 11.1, 1, },
[6] = { 16, 12, 13, 19, 17.4, 2, },
[7] = { 20, 13, 18, 27, 24.233333333333, 2, },
[8] = { 24, 14, 25, 37, 33.116666666667, 2, },
[9] = { 28, 14, 34, 50, 44.633333333333, 3, },
[10] = { 32, 16, 45, 67, 59.483333333333, 3, },
[11] = { 36, 17, 59, 89, 78.633333333333, 3, },
[12] = { 40, 18, 78, 117, 103.25, 4, },
[13] = { 44, 19, 101, 152, 134.93333333333, 4, },
[14] = { 48, 20, 132, 197, 175.51666666667, 4, },
[15] = { 52, 21, 170, 255, 227.58333333333, 5, },
[16] = { 56, 22, 219, 328, 293.85, 5, },
[17] = { 60, 22, 280, 420, 378, 5, },
[18] = { 64, 23, 358, 536, 484.65, 6, },
[19] = { 67, 24, 429, 643, 583.4, 6, },
[20] = { 70, 24, 513, 770, 701.2, 6, },
[21] = { 72, 25, 578, 867, 789.88333333333, 7, },
[22] = { 74, 26, 651, 976, 888.35, 7, },
[23] = { 76, 26, 732, 1098, 998.51666666667, 7, },
[24] = { 78, 27, 823, 1235, 1121.75, 8, },
[25] = { 80, 27, 925, 1388, 1259.5166666667, 8, },
[26] = { 82, 28, 1040, 1559, 1413.5166666667, 8, },
[27] = { 84, 29, 1167, 1751, 1585.5833333333, 9, },
[28] = { 86, 30, 1310, 1965, 1777.8, 9, },
[29] = { 88, 30, 1470, 2205, 1992.4333333333, 9, },
[30] = { 90, 30, 1648, 2472, 2232.05, 10, },
},
}
skills["FlickerStrike"] = {
name = "Flicker Strike",
gemTags = {
dexterity = true,
active_skill = true,
attack = true,
melee = true,
movement = true,
},
gemTagString = "Attack, Melee, Movement",
gemStr = 0,
gemDex = 100,
gemInt = 0,
color = 2,
description = "Teleports the character to a nearby monster and attacks it with a melee weapon. If no specific monster is chosen, one is picked at random. The cooldown can be bypassed by expending a Frenzy Charge.",
skillTypes = { [1] = true, [24] = true, [25] = true, [28] = true, [38] = true, },
weaponTypes = {
["One Handed Mace"] = true,
["Sceptre"] = true,
["Thrusting One Handed Sword"] = true,
["Two Handed Sword"] = true,
["Dagger"] = true,
["Staff"] = true,
["Two Handed Axe"] = true,
["Two Handed Mace"] = true,
["One Handed Axe"] = true,
["Claw"] = true,
["One Handed Sword"] = true,
},
baseFlags = {
attack = true,
melee = true,
movement = true,
},
baseMods = {
skill("castTime", 1),
skill("manaCost", 10),
skill("cooldown", 2),
mod("Speed", "MORE", 20, ModFlag.Attack), --"flicker_strike_more_attack_speed_+%_final" = 20
mod("Speed", "INC", 10, ModFlag.Attack, 0, { type = "Multiplier", var = "FrenzyCharge" }), --"base_attack_speed_+%_per_frenzy_charge" = 10
--"ignores_proximity_shield" = ?
--"base_skill_show_average_damage_instead_of_dps" = ?
},
qualityMods = {
mod("Damage", "INC", 1, 0, 0, nil), --"damage_+%" = 1
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = skill("damageEffectiveness", nil),
[3] = skill("baseMultiplier", nil),
},
levels = {
[1] = { 10, 1.3, 1.3, },
[2] = { 13, 1.32, 1.316, },
[3] = { 17, 1.33, 1.332, },
[4] = { 21, 1.35, 1.348, },
[5] = { 25, 1.36, 1.364, },
[6] = { 29, 1.38, 1.38, },
[7] = { 33, 1.4, 1.396, },
[8] = { 36, 1.41, 1.412, },
[9] = { 39, 1.43, 1.428, },
[10] = { 42, 1.44, 1.444, },
[11] = { 45, 1.46, 1.46, },
[12] = { 48, 1.48, 1.476, },
[13] = { 51, 1.49, 1.492, },
[14] = { 54, 1.51, 1.508, },
[15] = { 57, 1.52, 1.524, },
[16] = { 60, 1.54, 1.54, },
[17] = { 63, 1.56, 1.556, },
[18] = { 66, 1.57, 1.572, },
[19] = { 68, 1.59, 1.588, },
[20] = { 70, 1.6, 1.604, },
[21] = { 72, 1.62, 1.62, },
[22] = { 74, 1.64, 1.636, },
[23] = { 76, 1.65, 1.652, },
[24] = { 78, 1.67, 1.668, },
[25] = { 80, 1.68, 1.684, },
[26] = { 82, 1.7, 1.7, },
[27] = { 84, 1.72, 1.716, },
[28] = { 86, 1.73, 1.732, },
[29] = { 88, 1.75, 1.748, },
[30] = { 90, 1.76, 1.764, },
},
}
skills["FreezeMine"] = {
name = "Freeze Mine",
gemTags = {
mine = true,
dexterity = true,
active_skill = true,
spell = true,
area = true,
duration = true,
cold = true,
},
gemTagString = "Mine, Spell, AoE, Duration, Cold",
gemStr = 0,
gemDex = 60,
gemInt = 40,
color = 2,
description = "Lays a remote mine that you can detonate to freeze all enemies in the area.",
skillTypes = { [2] = true, [10] = true, [11] = true, [12] = true, [41] = true, [34] = true, },
baseFlags = {
spell = true,
mine = true,
area = true,
cold = true,
},
baseMods = {
skill("castTime", 0.5),
skill("damageEffectiveness", 0.5),
--"freeze_mine_cold_resistance_+_while_frozen" = -15
--"base_mine_duration" = 16000
--"base_skill_is_mined" = ?
skill("showAverage", true), --"base_skill_show_average_damage_instead_of_dps" = ?
--"is_remote_mine" = ?
--"always_freeze" = ?
--"is_area_damage" = ?
},
qualityMods = {
mod("AreaOfEffect", "INC", 0.5), --"base_skill_area_of_effect_+%" = 0.5
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = skill("manaCost", nil),
[3] = skill("ColdMin", nil), --"spell_minimum_base_cold_damage"
[4] = skill("ColdMax", nil), --"spell_maximum_base_cold_damage"
--[5] = "freeze_as_though_dealt_damage_+%"
},
levels = {
[1] = { 10, 6, 7, 10, 200, },
[2] = { 13, 8, 9, 13, 210, },
[3] = { 17, 10, 12, 17, 220, },
[4] = { 21, 10, 15, 23, 230, },
[5] = { 25, 11, 19, 29, 240, },
[6] = { 29, 12, 24, 37, 250, },
[7] = { 33, 13, 30, 46, 260, },
[8] = { 36, 14, 36, 54, 270, },
[9] = { 39, 14, 42, 63, 280, },
[10] = { 42, 16, 49, 73, 290, },
[11] = { 45, 18, 57, 85, 300, },
[12] = { 48, 18, 66, 99, 310, },
[13] = { 51, 19, 76, 114, 320, },
[14] = { 54, 20, 88, 131, 330, },
[15] = { 57, 21, 101, 151, 340, },
[16] = { 60, 21, 116, 173, 350, },
[17] = { 63, 21, 132, 199, 360, },
[18] = { 66, 21, 151, 227, 370, },
[19] = { 68, 22, 165, 248, 380, },
[20] = { 70, 22, 181, 271, 390, },
[21] = { 72, 22, 197, 296, 400, },
[22] = { 74, 22, 215, 322, 410, },
[23] = { 76, 23, 234, 351, 420, },
[24] = { 78, 23, 255, 383, 430, },
[25] = { 80, 24, 278, 417, 440, },
[26] = { 82, 24, 302, 454, 450, },
[27] = { 84, 24, 329, 493, 460, },
[28] = { 86, 24, 358, 536, 470, },
[29] = { 88, 25, 389, 583, 480, },
[30] = { 90, 25, 422, 633, 490, },
},
}
skills["Frenzy"] = {
name = "Frenzy",
gemTags = {
dexterity = true,
active_skill = true,
attack = true,
melee = true,
bow = true,
},
gemTagString = "Attack, Melee, Bow",
gemStr = 0,
gemDex = 100,
gemInt = 0,
color = 2,
description = "Performs an attack that gives the character a frenzy charge if it hits. Frenzy charges increase your attack speed.",
skillTypes = { [1] = true, [48] = true, [69] = true, [3] = true, [68] = true, [22] = true, [17] = true, [19] = true, [25] = true, [28] = true, [24] = true, },
baseFlags = {
attack = true,
melee = true,
projectile = true,
},
baseMods = {
skill("castTime", 1),
skill("manaCost", 10),
mod("PhysicalDamage", "INC", 5, 0, 0, { type = "Multiplier", var = "FrenzyCharge" }), --"physical_damage_+%_per_frenzy_charge" = 5
mod("Speed", "INC", 5, ModFlag.Attack, 0, { type = "Multiplier", var = "FrenzyCharge" }), --"base_attack_speed_+%_per_frenzy_charge" = 5
--"skill_can_fire_arrows" = ?
--"skill_can_fire_wand_projectiles" = ?
},
qualityMods = {
mod("Speed", "INC", 0.5, ModFlag.Attack, 0, nil), --"attack_speed_+%" = 0.5
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = skill("damageEffectiveness", nil),
[3] = skill("baseMultiplier", nil),
},
levels = {
[1] = { 16, 1.1, 1.1, },
[2] = { 20, 1.11, 1.114, },
[3] = { 24, 1.13, 1.128, },
[4] = { 28, 1.14, 1.142, },
[5] = { 31, 1.16, 1.156, },
[6] = { 34, 1.17, 1.17, },
[7] = { 37, 1.18, 1.184, },
[8] = { 40, 1.2, 1.198, },
[9] = { 43, 1.21, 1.212, },
[10] = { 46, 1.23, 1.226, },
[11] = { 49, 1.24, 1.24, },
[12] = { 52, 1.25, 1.254, },
[13] = { 55, 1.27, 1.268, },
[14] = { 58, 1.28, 1.282, },
[15] = { 60, 1.3, 1.296, },
[16] = { 62, 1.31, 1.31, },
[17] = { 64, 1.32, 1.324, },
[18] = { 66, 1.34, 1.338, },
[19] = { 68, 1.35, 1.352, },
[20] = { 70, 1.37, 1.366, },
[21] = { 72, 1.38, 1.38, },
[22] = { 74, 1.39, 1.394, },
[23] = { 76, 1.41, 1.408, },
[24] = { 78, 1.42, 1.422, },
[25] = { 80, 1.44, 1.436, },
[26] = { 82, 1.45, 1.45, },
[27] = { 84, 1.46, 1.464, },
[28] = { 86, 1.48, 1.478, },
[29] = { 88, 1.49, 1.492, },
[30] = { 90, 1.51, 1.506, },
},
}
skills["FrostBlades"] = {
name = "Frost Blades",
gemTags = {
projectile = true,
dexterity = true,
active_skill = true,
attack = true,
melee = true,
cold = true,
},
gemTagString = "Projectile, Attack, Melee, Cold",
gemStr = 0,
gemDex = 100,
gemInt = 0,
color = 2,
description = "Attack an enemy with increased range, releasing icy blades from the targeted enemy which fly at other enemies. Requires a Melee Weapon.",
skillTypes = { [1] = true, [3] = true, [25] = true, [28] = true, [24] = true, [34] = true, [48] = true, },
weaponTypes = {
["One Handed Mace"] = true,
["Sceptre"] = true,
["Thrusting One Handed Sword"] = true,
["Two Handed Sword"] = true,
["Dagger"] = true,
["Staff"] = true,
["Two Handed Axe"] = true,
["Two Handed Mace"] = true,
["One Handed Axe"] = true,
["Claw"] = true,
["One Handed Sword"] = true,
},
parts = {
{
name = "Melee hit",
melee = true,
projectile = false,
},
{
name = "Icy blades",
melee = false,
projectile = true,
},
},
baseFlags = {
attack = true,
melee = true,
projectile = true,
cold = true,
},
baseMods = {
skill("castTime", 1),
skill("manaCost", 6),
mod("SkillPhysicalDamageConvertToCold", "BASE", 60), --"skill_physical_damage_%_to_convert_to_cold" = 60
--"total_projectile_spread_angle_override" = 110
--"show_number_of_projectiles" = ?
},
qualityMods = {
mod("Damage", "INC", 1, ModFlag.Projectile), --"projectile_damage_+%" = 1
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = mod("ProjectileCount", "BASE", nil), --"number_of_additional_projectiles"
[3] = mod("MeleeWeaponRange", "BASE", nil), --"melee_weapon_range_+"
[4] = mod("ProjectileSpeed", "INC", nil), --"base_projectile_speed_+%"
[5] = skill("damageEffectiveness", nil),
[6] = skill("baseMultiplier", nil),
},
levels = {
[1] = { 1, 4, 18, 0, nil, nil, },
[2] = { 2, 4, 18, 1, 1.02, 1.022, },
[3] = { 4, 4, 18, 2, 1.04, 1.044, },
[4] = { 7, 4, 18, 3, 1.07, 1.066, },
[5] = { 11, 4, 18, 4, 1.09, 1.088, },
[6] = { 16, 5, 19, 5, 1.11, 1.11, },
[7] = { 20, 5, 19, 6, 1.13, 1.132, },
[8] = { 24, 5, 19, 7, 1.15, 1.154, },
[9] = { 28, 5, 19, 8, 1.18, 1.176, },
[10] = { 32, 5, 19, 9, 1.2, 1.198, },
[11] = { 36, 6, 20, 10, 1.22, 1.22, },
[12] = { 40, 6, 20, 11, 1.24, 1.242, },
[13] = { 44, 6, 20, 12, 1.26, 1.264, },
[14] = { 48, 6, 20, 13, 1.29, 1.286, },
[15] = { 52, 6, 20, 14, 1.31, 1.308, },
[16] = { 56, 7, 21, 15, 1.33, 1.33, },
[17] = { 60, 7, 21, 16, 1.35, 1.352, },
[18] = { 64, 7, 21, 17, 1.37, 1.374, },
[19] = { 67, 7, 21, 18, 1.4, 1.396, },
[20] = { 70, 7, 21, 19, 1.42, 1.418, },
[21] = { 72, 8, 22, 20, 1.44, 1.44, },
[22] = { 74, 8, 22, 21, 1.46, 1.462, },
[23] = { 76, 8, 22, 22, 1.48, 1.484, },
[24] = { 78, 8, 22, 23, 1.51, 1.506, },
[25] = { 80, 8, 22, 24, 1.53, 1.528, },
[26] = { 82, 9, 23, 25, 1.55, 1.55, },
[27] = { 84, 9, 23, 26, 1.57, 1.572, },
[28] = { 86, 9, 23, 27, 1.59, 1.594, },
[29] = { 88, 9, 23, 28, 1.62, 1.616, },
[30] = { 90, 9, 23, 29, 1.64, 1.638, },
},
}
skills["Grace"] = {
name = "Grace",
gemTags = {
aura = true,
dexterity = true,
active_skill = true,
spell = true,
area = true,
},
gemTagString = "Aura, Spell, AoE",
gemStr = 0,
gemDex = 100,
gemInt = 0,
color = 2,
description = "Casts an aura that grants evasion to you and your allies.",
skillTypes = { [2] = true, [11] = true, [5] = true, [15] = true, [27] = true, [16] = true, [18] = true, [44] = true, },
baseFlags = {
spell = true,
aura = true,
area = true,
},
baseMods = {
skill("castTime", 1.2),
skill("manaCost", 50),
skill("cooldown", 1.2),
--"base_deal_no_damage" = ?
skill("radius", 36),
},
qualityMods = {
mod("AreaOfEffect", "INC", 1), --"base_skill_area_of_effect_+%" = 1
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = mod("Evasion", "BASE", nil, 0, 0, { type = "GlobalEffect", effectType = "Aura" }), --"base_evasion_rating"
[3] = skill("radiusExtra", nil), --"active_skill_base_radius_+"
},
levels = {
[1] = { 24, 227, 0, },
[2] = { 27, 271, 1, },
[3] = { 30, 322, 2, },
[4] = { 33, 379, 3, },
[5] = { 36, 444, 4, },
[6] = { 39, 528, 5, },
[7] = { 42, 621, 6, },
[8] = { 45, 722, 7, },
[9] = { 48, 845, 8, },
[10] = { 50, 940, 9, },
[11] = { 52, 1043, 10, },
[12] = { 54, 1155, 11, },
[13] = { 56, 1283, 12, },
[14] = { 58, 1413, 13, },
[15] = { 60, 1567, 14, },
[16] = { 62, 1732, 15, },
[17] = { 64, 1914, 16, },
[18] = { 66, 2115, 17, },
[19] = { 68, 2335, 18, },
[20] = { 70, 2575, 19, },
[21] = { 72, 2700, 20, },
[22] = { 74, 2835, 21, },
[23] = { 76, 2979, 22, },
[24] = { 78, 3124, 23, },
[25] = { 80, 3279, 24, },
[26] = { 82, 3444, 25, },
[27] = { 84, 3611, 26, },
[28] = { 86, 3795, 27, },
[29] = { 88, 3982, 28, },
[30] = { 90, 4179, 29, },
},
}
skills["VaalGrace"] = {
name = "Vaal Grace",
gemTags = {
aura = true,
dexterity = true,
active_skill = true,
vaal = true,
spell = true,
area = true,
duration = true,
},
gemTagString = "Aura, Vaal, Spell, AoE, Duration",
gemStr = 0,
gemDex = 100,
gemInt = 0,
color = 2,
description = "Casts a temporary aura that grants you and your allies the ability to dodge attacks and spells.",
skillTypes = { [2] = true, [5] = true, [11] = true, [18] = true, [27] = true, [12] = true, [43] = true, [44] = true, },
baseFlags = {
spell = true,
aura = true,
area = true,
duration = true,
vaal = true,
},
baseMods = {
skill("castTime", 0.6),
skill("duration", 6), --"base_skill_effect_duration" = 6000
--"base_deal_no_damage" = ?
skill("radius", 36),
},
qualityMods = {
mod("AreaOfEffect", "INC", 1), --"base_skill_area_of_effect_+%" = 1
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = mod("AttackDodgeChance", "BASE", nil, 0, 0, { type = "GlobalEffect", effectType = "Aura" }), --"base_chance_to_dodge_%"
[3] = mod("SpellDodgeChance", "BASE", nil, 0, 0, { type = "GlobalEffect", effectType = "Aura" }), --"base_chance_to_dodge_spells_%"
[4] = skill("radiusExtra", nil), --"active_skill_base_radius_+"
},
levels = {
[1] = { 24, 24, 24, 0, },
[2] = { 27, 25, 25, 1, },
[3] = { 30, 25, 25, 2, },
[4] = { 33, 26, 26, 3, },
[5] = { 36, 26, 26, 4, },
[6] = { 39, 27, 27, 5, },
[7] = { 42, 27, 27, 6, },
[8] = { 45, 28, 28, 7, },
[9] = { 48, 28, 28, 8, },
[10] = { 50, 29, 29, 9, },
[11] = { 52, 29, 29, 10, },
[12] = { 54, 30, 30, 11, },
[13] = { 56, 30, 30, 12, },
[14] = { 58, 31, 31, 13, },
[15] = { 60, 31, 31, 14, },
[16] = { 62, 32, 32, 15, },
[17] = { 64, 32, 32, 16, },
[18] = { 66, 33, 33, 17, },
[19] = { 68, 33, 33, 18, },
[20] = { 70, 34, 34, 19, },
[21] = { 72, 34, 34, 20, },
[22] = { 74, 35, 35, 21, },
[23] = { 76, 35, 35, 22, },
[24] = { 78, 36, 36, 23, },
[25] = { 80, 36, 36, 24, },
[26] = { 82, 37, 37, 25, },
[27] = { 84, 37, 37, 26, },
[28] = { 86, 38, 38, 27, },
[29] = { 88, 38, 38, 28, },
[30] = { 90, 39, 39, 29, },
},
}
skills["Haste"] = {
name = "Haste",
gemTags = {
aura = true,
dexterity = true,
active_skill = true,
spell = true,
area = true,
},
gemTagString = "Aura, Spell, AoE",
gemStr = 0,
gemDex = 100,
gemInt = 0,
color = 2,
description = "Casts an aura that increases the movement speed, attack speed and cast speed of you and your allies.",
skillTypes = { [2] = true, [11] = true, [5] = true, [15] = true, [27] = true, [16] = true, [18] = true, [44] = true, },
baseFlags = {
spell = true,
aura = true,
area = true,
},
baseMods = {
skill("castTime", 1.2),
skill("manaCost", 50),
skill("cooldown", 1.2),
--"base_deal_no_damage" = ?
skill("radius", 36),
},
qualityMods = {
mod("AreaOfEffect", "INC", 1), --"base_skill_area_of_effect_+%" = 1
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = mod("Speed", "INC", nil, ModFlag.Attack, 0, { type = "GlobalEffect", effectType = "Aura" }), --"attack_speed_+%"
[3] = mod("Speed", "INC", nil, ModFlag.Cast, 0, { type = "GlobalEffect", effectType = "Aura" }), --"cast_speed_+%_granted_from_skill"
[4] = mod("MovementSpeed", "INC", nil, 0, 0, { type = "GlobalEffect", effectType = "Aura" }), --"base_movement_velocity_+%"
[5] = skill("radiusExtra", nil), --"active_skill_base_radius_+"
},
levels = {
[1] = { 24, 9, 9, 4, 0, },
[2] = { 27, 10, 9, 4, 1, },
[3] = { 30, 10, 10, 4, 2, },
[4] = { 33, 10, 10, 5, 3, },
[5] = { 36, 11, 10, 5, 4, },
[6] = { 39, 11, 11, 5, 5, },
[7] = { 42, 11, 11, 6, 6, },
[8] = { 45, 12, 11, 6, 7, },
[9] = { 48, 12, 12, 6, 8, },
[10] = { 50, 12, 12, 7, 9, },
[11] = { 52, 13, 12, 7, 10, },
[12] = { 54, 13, 13, 7, 11, },
[13] = { 56, 13, 13, 8, 12, },
[14] = { 58, 14, 13, 8, 13, },
[15] = { 60, 14, 14, 8, 14, },
[16] = { 62, 15, 14, 8, 15, },
[17] = { 64, 15, 15, 8, 16, },
[18] = { 66, 16, 15, 8, 17, },
[19] = { 68, 16, 16, 8, 18, },
[20] = { 70, 16, 16, 9, 19, },
[21] = { 72, 17, 16, 9, 20, },
[22] = { 74, 17, 17, 9, 21, },
[23] = { 76, 17, 17, 10, 22, },
[24] = { 78, 18, 17, 10, 23, },
[25] = { 80, 18, 18, 10, 24, },
[26] = { 82, 18, 18, 11, 25, },
[27] = { 84, 19, 18, 11, 26, },
[28] = { 86, 19, 19, 11, 27, },
[29] = { 88, 19, 19, 12, 28, },
[30] = { 90, 20, 19, 12, 29, },
},
}
skills["VaalHaste"] = {
name = "Vaal Haste",
gemTags = {
aura = true,
dexterity = true,
active_skill = true,
vaal = true,
spell = true,
area = true,
duration = true,
},
gemTagString = "Aura, Vaal, Spell, AoE, Duration",
gemStr = 0,
gemDex = 100,
gemInt = 0,
color = 2,
description = "Casts a temporary aura that increases the movement speed, attack speed and cast speed of you and your allies.",
skillTypes = { [2] = true, [5] = true, [11] = true, [18] = true, [27] = true, [12] = true, [43] = true, [44] = true, },
baseFlags = {
spell = true,
aura = true,
area = true,
duration = true,
vaal = true,
},
baseMods = {
skill("castTime", 0.6),
skill("duration", 4), --"base_skill_effect_duration" = 4000
--"base_deal_no_damage" = ?
skill("radius", 36),
},
qualityMods = {
mod("AreaOfEffect", "INC", 1), --"base_skill_area_of_effect_+%" = 1
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = mod("Speed", "INC", nil, ModFlag.Attack, 0, { type = "GlobalEffect", effectType = "Aura" }), --"attack_speed_+%"
[3] = mod("Speed", "INC", nil, ModFlag.Cast, 0, { type = "GlobalEffect", effectType = "Aura" }), --"cast_speed_+%_granted_from_skill"
[4] = mod("MovementSpeed", "INC", nil, 0, 0, { type = "GlobalEffect", effectType = "Aura" }), --"base_movement_velocity_+%"
[5] = skill("radiusExtra", nil), --"active_skill_base_radius_+"
},
levels = {
[1] = { 24, 25, 24, 10, 0, },
[2] = { 27, 25, 25, 10, 1, },
[3] = { 30, 25, 25, 10, 2, },
[4] = { 33, 26, 25, 10, 3, },
[5] = { 36, 26, 26, 10, 4, },
[6] = { 39, 26, 26, 11, 5, },
[7] = { 42, 27, 26, 11, 6, },
[8] = { 45, 27, 27, 11, 7, },
[9] = { 48, 27, 27, 11, 8, },
[10] = { 50, 28, 27, 11, 9, },
[11] = { 52, 28, 28, 12, 10, },
[12] = { 54, 28, 28, 12, 11, },
[13] = { 56, 29, 28, 12, 12, },
[14] = { 58, 29, 29, 12, 13, },
[15] = { 60, 29, 29, 12, 14, },
[16] = { 62, 30, 29, 13, 15, },
[17] = { 64, 30, 30, 13, 16, },
[18] = { 66, 30, 30, 13, 17, },
[19] = { 68, 31, 30, 13, 18, },
[20] = { 70, 31, 31, 13, 19, },
[21] = { 72, 31, 31, 14, 20, },
[22] = { 74, 32, 31, 14, 21, },
[23] = { 76, 32, 32, 14, 22, },
[24] = { 78, 32, 32, 14, 23, },
[25] = { 80, 33, 32, 14, 24, },
[26] = { 82, 33, 33, 15, 25, },
[27] = { 84, 33, 33, 15, 26, },
[28] = { 86, 34, 33, 15, 27, },
[29] = { 88, 34, 34, 15, 28, },
[30] = { 90, 34, 34, 15, 29, },
},
}
skills["Hatred"] = {
name = "Hatred",
gemTags = {
aura = true,
dexterity = true,
active_skill = true,
spell = true,
area = true,
cold = true,
},
gemTagString = "Aura, Spell, AoE, Cold",
gemStr = 0,
gemDex = 60,
gemInt = 40,
color = 2,
description = "Casts an aura that increases the cold damage of you and your allies.",
skillTypes = { [2] = true, [11] = true, [5] = true, [15] = true, [27] = true, [16] = true, [18] = true, [44] = true, [34] = true, },
baseFlags = {
spell = true,
aura = true,
area = true,
cold = true,
},
baseMods = {
skill("castTime", 1.2),
skill("manaCost", 50),
skill("cooldown", 1.2),
--"base_deal_no_damage" = ?
skill("radius", 36),
},
qualityMods = {
mod("AreaOfEffect", "INC", 1), --"base_skill_area_of_effect_+%" = 1
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = mod("PhysicalDamageGainAsCold", "BASE", nil, 0, 0, { type = "GlobalEffect", effectType = "Aura" }), --"physical_damage_%_to_add_as_cold"
[3] = skill("radiusExtra", nil), --"active_skill_base_radius_+"
},
levels = {
[1] = { 24, 26, 0, },
[2] = { 27, 26, 1, },
[3] = { 30, 27, 2, },
[4] = { 33, 27, 3, },
[5] = { 36, 28, 4, },
[6] = { 39, 28, 5, },
[7] = { 42, 29, 6, },
[8] = { 45, 29, 7, },
[9] = { 48, 30, 8, },
[10] = { 50, 30, 9, },
[11] = { 52, 31, 10, },
[12] = { 54, 31, 11, },
[13] = { 56, 32, 12, },
[14] = { 58, 32, 13, },
[15] = { 60, 33, 14, },
[16] = { 62, 34, 15, },
[17] = { 64, 34, 16, },
[18] = { 66, 35, 17, },
[19] = { 68, 35, 18, },
[20] = { 70, 36, 19, },
[21] = { 72, 36, 20, },
[22] = { 74, 37, 21, },
[23] = { 76, 37, 22, },
[24] = { 78, 38, 23, },
[25] = { 80, 38, 24, },
[26] = { 82, 39, 25, },
[27] = { 84, 39, 26, },
[28] = { 86, 40, 27, },
[29] = { 88, 40, 28, },
[30] = { 90, 41, 29, },
},
}
skills["HeraldOfIce"] = {
name = "Herald of Ice",
gemTags = {
dexterity = true,
active_skill = true,
spell = true,
area = true,
cold = true,
herald = true,
},
gemTagString = "Spell, AoE, Cold, Herald",
gemStr = 0,
gemDex = 60,
gemInt = 40,
color = 2,
description = "Channel ice through your hands, adding cold damage to spells and attacks. If you shatter an enemy, they explode and deal AoE cold damage to enemies near them. The AoE cold damage inflicted by this skill is not affected by modifiers to spell damage.",
skillTypes = { [2] = true, [5] = true, [15] = true, [16] = true, [10] = true, [11] = true, [34] = true, [27] = true, [63] = true, },
baseFlags = {
cast = true,
area = true,
cold = true,
},
baseMods = {
skill("castTime", 1),
skill("manaCost", 25),
skill("damageEffectiveness", 0.8),
skill("cooldown", 1),
--"is_area_damage" = ?
skill("showAverage", true), --"base_skill_show_average_damage_instead_of_dps" = ?
--"display_skill_deals_secondary_damage" = ?
--"damage_cannot_be_reflected" = ?
--"skill_can_add_multiple_charges_per_action" = ?
},
qualityMods = {
mod("ColdDamage", "INC", 0.75, 0, 0, { type = "GlobalEffect", effectType = "Buff" }), --"herald_of_ice_cold_damage_+%" = 0.75
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = mod("ColdMin", "BASE", nil, 0, KeywordFlag.Spell, { type = "GlobalEffect", effectType = "Buff" }), --"spell_minimum_added_cold_damage"
[3] = mod("ColdMax", "BASE", nil, 0, KeywordFlag.Spell, { type = "GlobalEffect", effectType = "Buff" }), --"spell_maximum_added_cold_damage"
[4] = mod("ColdMin", "BASE", nil, 0, KeywordFlag.Attack, { type = "GlobalEffect", effectType = "Buff" }), --"attack_minimum_added_cold_damage"
[5] = mod("ColdMax", "BASE", nil, 0, KeywordFlag.Attack, { type = "GlobalEffect", effectType = "Buff" }), --"attack_maximum_added_cold_damage"
[6] = skill("ColdMin", nil), --"secondary_minimum_base_cold_damage"
[7] = skill("ColdMax", nil), --"secondary_maximum_base_cold_damage"
},
levels = {
[1] = { 16, 4, 5, 4, 5, 18, 26, },
[2] = { 20, 5, 7, 5, 7, 23, 35, },
[3] = { 24, 6, 8, 6, 8, 30, 45, },
[4] = { 28, 7, 10, 7, 10, 38, 57, },
[5] = { 31, 8, 12, 8, 12, 45, 67, },
[6] = { 34, 9, 14, 9, 14, 53, 80, },
[7] = { 37, 10, 16, 10, 16, 62, 94, },
[8] = { 40, 12, 18, 12, 18, 73, 110, },
[9] = { 43, 13, 20, 13, 20, 85, 128, },
[10] = { 46, 15, 23, 15, 23, 99, 149, },
[11] = { 49, 17, 26, 17, 26, 115, 173, },
[12] = { 52, 19, 29, 19, 29, 134, 200, },
[13] = { 55, 22, 33, 22, 33, 154, 232, },
[14] = { 58, 24, 37, 24, 37, 178, 267, },
[15] = { 60, 26, 39, 26, 39, 195, 293, },
[16] = { 62, 28, 42, 28, 42, 214, 321, },
[17] = { 64, 30, 46, 30, 46, 235, 352, },
[18] = { 66, 33, 49, 33, 49, 257, 386, },
[19] = { 68, 35, 53, 35, 53, 282, 422, },
[20] = { 70, 38, 56, 38, 56, 308, 462, },
[21] = { 72, 40, 61, 40, 61, 337, 505, },
[22] = { 74, 43, 65, 43, 65, 368, 552, },
[23] = { 76, 46, 70, 46, 70, 402, 603, },
[24] = { 78, 50, 75, 50, 75, 438, 658, },
[25] = { 80, 53, 80, 53, 80, 478, 717, },
[26] = { 82, 57, 85, 57, 85, 521, 782, },
[27] = { 84, 61, 91, 61, 91, 568, 852, },
[28] = { 86, 65, 98, 65, 98, 619, 928, },
[29] = { 88, 69, 104, 69, 104, 674, 1010, },
[30] = { 90, 74, 111, 74, 111, 733, 1100, },
},
}
skills["IceShot"] = {
name = "Ice Shot",
gemTags = {
dexterity = true,
active_skill = true,
attack = true,
area = true,
duration = true,
cold = true,
bow = true,
},
gemTagString = "Attack, AoE, Duration, Cold, Bow",
gemStr = 0,
gemDex = 100,
gemInt = 0,
color = 2,
description = "Fires an arrow that converts some physical damage to cold on its target and converts all physical damage to cold in a cone behind that target. Creates a patch of ground ice under the target.",
skillTypes = { [1] = true, [48] = true, [69] = true, [3] = true, [68] = true, [11] = true, [12] = true, [22] = true, [17] = true, [19] = true, [34] = true, },
weaponTypes = {
["Bow"] = true,
},
parts = {
{
name = "Arrow",
area = false,
},
{
name = "Cone",
area = true,
},
},
baseFlags = {
attack = true,
projectile = true,
area = true,
duration = true,
cold = true,
},
baseMods = {
skill("castTime", 1),
mod("SkillPhysicalDamageConvertToCold", "BASE", 60), --"skill_physical_damage_%_to_convert_to_cold" = 60
skill("duration", 1.5), --"base_skill_effect_duration" = 1500
--"skill_can_fire_arrows" = ?
mod("SkillPhysicalDamageConvertToCold", "BASE", 40, 0, 0, { type = "SkillPart", skillPart = 2 }),
skill("radius", 23),
},
qualityMods = {
mod("ColdDamage", "INC", 1), --"cold_damage_+%" = 1
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = skill("manaCost", nil),
[3] = skill("damageEffectiveness", nil),
[4] = skill("baseMultiplier", nil),
},
levels = {
[1] = { 1, 6, 1.2, 1.2, },
[2] = { 2, 6, 1.21, 1.214, },
[3] = { 4, 6, 1.23, 1.228, },
[4] = { 7, 7, 1.24, 1.242, },
[5] = { 11, 7, 1.26, 1.256, },
[6] = { 16, 7, 1.27, 1.27, },
[7] = { 20, 7, 1.28, 1.284, },
[8] = { 24, 8, 1.3, 1.298, },
[9] = { 28, 8, 1.31, 1.312, },
[10] = { 32, 8, 1.33, 1.326, },
[11] = { 36, 8, 1.34, 1.34, },
[12] = { 40, 8, 1.35, 1.354, },
[13] = { 44, 9, 1.37, 1.368, },
[14] = { 48, 9, 1.38, 1.382, },
[15] = { 52, 9, 1.4, 1.396, },
[16] = { 56, 9, 1.41, 1.41, },
[17] = { 60, 9, 1.42, 1.424, },
[18] = { 64, 10, 1.44, 1.438, },
[19] = { 67, 10, 1.45, 1.452, },
[20] = { 70, 10, 1.47, 1.466, },
[21] = { 72, 10, 1.48, 1.48, },
[22] = { 74, 10, 1.49, 1.494, },
[23] = { 76, 11, 1.51, 1.508, },
[24] = { 78, 11, 1.52, 1.522, },
[25] = { 80, 11, 1.54, 1.536, },
[26] = { 82, 11, 1.55, 1.55, },
[27] = { 84, 11, 1.56, 1.564, },
[28] = { 86, 12, 1.58, 1.578, },
[29] = { 88, 12, 1.59, 1.592, },
[30] = { 90, 12, 1.61, 1.606, },
},
}
skills["IceTrap"] = {
name = "Ice Trap",
gemTags = {
trap = true,
dexterity = true,
active_skill = true,
spell = true,
area = true,
cold = true,
duration = true,
},
gemTagString = "Trap, Spell, AoE, Cold, Duration",
gemStr = 0,
gemDex = 60,
gemInt = 40,
color = 2,
description = "Throws a trap that creates a series of icy runic explosions when triggered, dealing cold damage to all enemies caught in the blasts.",
skillTypes = { [2] = true, [10] = true, [19] = true, [11] = true, [37] = true, [34] = true, [12] = true, },
baseFlags = {
spell = true,
trap = true,
area = true,
cold = true,
},
baseMods = {
skill("castTime", 1),
skill("damageEffectiveness", 1.1),
skill("CritChance", 5),
skill("cooldown", 2),
--"base_trap_duration" = 4000
--"is_area_damage" = ?
--"base_skill_is_trapped" = ?
skill("showAverage", true), --"base_skill_show_average_damage_instead_of_dps" = ?
--"is_trap" = ?
},
qualityMods = {
mod("AreaOfEffect", "INC", 0.5), --"base_skill_area_of_effect_+%" = 0.5
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = skill("manaCost", nil),
[3] = skill("ColdMin", nil), --"spell_minimum_base_cold_damage"
[4] = skill("ColdMax", nil), --"spell_maximum_base_cold_damage"
},
levels = {
[1] = { 28, 13, 60, 90, },
[2] = { 31, 14, 72, 108, },
[3] = { 34, 15, 85, 128, },
[4] = { 37, 15, 101, 151, },
[5] = { 40, 16, 119, 178, },
[6] = { 42, 17, 132, 198, },
[7] = { 44, 17, 147, 220, },
[8] = { 46, 18, 163, 244, },
[9] = { 48, 19, 180, 270, },
[10] = { 50, 19, 199, 299, },
[11] = { 52, 20, 220, 330, },
[12] = { 54, 20, 243, 364, },
[13] = { 56, 21, 268, 402, },
[14] = { 58, 21, 295, 442, },
[15] = { 60, 22, 325, 487, },
[16] = { 62, 23, 357, 536, },
[17] = { 64, 23, 392, 589, },
[18] = { 66, 24, 431, 646, },
[19] = { 68, 24, 473, 709, },
[20] = { 70, 25, 519, 778, },
[21] = { 72, 26, 568, 853, },
[22] = { 74, 26, 623, 934, },
[23] = { 76, 27, 681, 1022, },
[24] = { 78, 27, 746, 1118, },
[25] = { 80, 28, 815, 1223, },
[26] = { 82, 28, 891, 1337, },
[27] = { 84, 29, 973, 1460, },
[28] = { 86, 30, 1063, 1595, },
[29] = { 88, 30, 1160, 1740, },
[30] = { 90, 31, 1266, 1899, },
},
}
skills["DoubleSlash"] = {
name = "Lacerate",
gemTags = {
dexterity = true,
active_skill = true,
attack = true,
area = true,
melee = true,
},
gemTagString = "Attack, AoE, Melee",
gemStr = 40,
gemDex = 60,
gemInt = 0,
color = 2,
description = "Slashes twice, releasing waves of force that damage enemies they hit. Enemies in the middle of the slashes can be hit by both. If you are dual wielding, you attack with your Main Hand, then your Off Hand. Can be used with Axes and Swords.",
skillTypes = { [1] = true, [11] = true, [28] = true, [24] = true, },
weaponTypes = {
["Two Handed Axe"] = true,
["Thrusting One Handed Sword"] = true,
["Two Handed Sword"] = true,
["One Handed Axe"] = true,
["One Handed Sword"] = true,
},
parts = {
{
name = "One slash",
},
{
name = "Both slashes",
},
},
baseFlags = {
attack = true,
melee = true,
area = true,
},
baseMods = {
skill("castTime", 1),
skill("manaCost", 8),
mod("Speed", "MORE", -25, ModFlag.Attack), --"active_skill_attack_speed_+%_final" = -25
--"is_area_damage" = ?
skill("radius", 38),
skill("dpsMultiplier", 2, { type = "SkillPart", skillPart = 2 }),
},
qualityMods = {
mod("AreaOfEffect", "INC", 0.5), --"base_skill_area_of_effect_+%" = 0.5
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = skill("damageEffectiveness", nil),
[3] = skill("baseMultiplier", nil),
[4] = skill("radiusExtra", nil), --"active_skill_base_radius_+"
},
levels = {
[1] = { 12, 0.95, 0.95, 0, },
[2] = { 15, 0.96, 0.962, 0, },
[3] = { 19, 0.97, 0.974, 0, },
[4] = { 23, 0.99, 0.986, 1, },
[5] = { 27, nil, 0.998, 1, },
[6] = { 31, 1.01, 1.01, 1, },
[7] = { 35, 1.02, 1.022, 1, },
[8] = { 38, 1.03, 1.034, 2, },
[9] = { 41, 1.05, 1.046, 2, },
[10] = { 44, 1.06, 1.058, 2, },
[11] = { 47, 1.07, 1.07, 2, },
[12] = { 50, 1.08, 1.082, 3, },
[13] = { 53, 1.09, 1.094, 3, },
[14] = { 56, 1.11, 1.106, 3, },
[15] = { 59, 1.12, 1.118, 3, },
[16] = { 62, 1.13, 1.13, 4, },
[17] = { 64, 1.14, 1.142, 4, },
[18] = { 66, 1.15, 1.154, 4, },
[19] = { 68, 1.17, 1.166, 4, },
[20] = { 70, 1.18, 1.178, 5, },
[21] = { 72, 1.19, 1.19, 5, },
[22] = { 74, 1.2, 1.202, 5, },
[23] = { 76, 1.21, 1.214, 5, },
[24] = { 78, 1.23, 1.226, 6, },
[25] = { 80, 1.24, 1.238, 6, },
[26] = { 82, 1.25, 1.25, 6, },
[27] = { 84, 1.26, 1.262, 6, },
[28] = { 86, 1.27, 1.274, 7, },
[29] = { 88, 1.29, 1.286, 7, },
[30] = { 90, 1.3, 1.298, 7, },
},
}
skills["LightningArrow"] = {
name = "Lightning Arrow",
gemTags = {
dexterity = true,
active_skill = true,
attack = true,
area = true,
lightning = true,
bow = true,
},
gemTagString = "Attack, AoE, Lightning, Bow",
gemStr = 0,
gemDex = 100,
gemInt = 0,
color = 2,
description = "Fires a charged arrow at the target, causing them to be struck by a bolt of lightning which damages nearby enemies.",
skillTypes = { [1] = true, [48] = true, [69] = true, [11] = true, [3] = true, [68] = true, [22] = true, [17] = true, [19] = true, [35] = true, },
weaponTypes = {
["Bow"] = true,
},
baseFlags = {
attack = true,
projectile = true,
lightning = true,
},
baseMods = {
skill("castTime", 1),
mod("SkillPhysicalDamageConvertToLightning", "BASE", 50), --"skill_physical_damage_%_to_convert_to_lightning" = 50
--"lightning_arrow_maximum_number_of_extra_targets" = 3
--"skill_can_fire_arrows" = ?
},
qualityMods = {
mod("EnemyShockChance", "BASE", 0.5), --"base_chance_to_shock_%" = 0.5
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = skill("manaCost", nil),
[3] = skill("damageEffectiveness", nil),
[4] = skill("baseMultiplier", nil),
},
levels = {
[1] = { 12, 7, nil, nil, },
[2] = { 15, 7, 1.01, 1.01, },
[3] = { 19, 7, 1.02, 1.02, },
[4] = { 23, 8, 1.03, 1.03, },
[5] = { 27, 8, 1.04, 1.04, },
[6] = { 31, 8, 1.05, 1.05, },
[7] = { 35, 8, 1.06, 1.06, },
[8] = { 38, 8, 1.07, 1.07, },
[9] = { 41, 9, 1.08, 1.08, },
[10] = { 44, 9, 1.09, 1.09, },
[11] = { 47, 9, 1.1, 1.1, },
[12] = { 50, 9, 1.11, 1.11, },
[13] = { 53, 9, 1.12, 1.12, },
[14] = { 56, 10, 1.13, 1.13, },
[15] = { 59, 10, 1.14, 1.14, },
[16] = { 62, 10, 1.15, 1.15, },
[17] = { 64, 10, 1.16, 1.16, },
[18] = { 66, 10, 1.17, 1.17, },
[19] = { 68, 11, 1.18, 1.18, },
[20] = { 70, 11, 1.19, 1.19, },
[21] = { 72, 11, 1.2, 1.2, },
[22] = { 74, 11, 1.21, 1.21, },
[23] = { 76, 11, 1.22, 1.22, },
[24] = { 78, 11, 1.23, 1.23, },
[25] = { 80, 11, 1.24, 1.24, },
[26] = { 82, 12, 1.25, 1.25, },
[27] = { 84, 12, 1.26, 1.26, },
[28] = { 86, 12, 1.27, 1.27, },
[29] = { 88, 12, 1.28, 1.28, },
[30] = { 90, 12, 1.29, 1.29, },
},
}
skills["LightningStrike"] = {
name = "Lightning Strike",
gemTags = {
projectile = true,
dexterity = true,
active_skill = true,
attack = true,
melee = true,
lightning = true,
},
gemTagString = "Projectile, Attack, Melee, Lightning",
gemStr = 0,
gemDex = 60,
gemInt = 40,
color = 2,
description = "Infuses your melee weapon with electrical energies as you swing. In addition to converting some of your physical damage to lightning damage, the stored energy is released from the weapon as projectiles as you strike, flying out behind your target to hit farther-away enemies. The projectiles cannot miss if the melee attack hit its target.",
skillTypes = { [1] = true, [48] = true, [3] = true, [25] = true, [28] = true, [24] = true, [35] = true, },
weaponTypes = {
["One Handed Mace"] = true,
["Sceptre"] = true,
["Thrusting One Handed Sword"] = true,
["Two Handed Sword"] = true,
["Dagger"] = true,
["Staff"] = true,
["Two Handed Axe"] = true,
["Two Handed Mace"] = true,
["One Handed Axe"] = true,
["Claw"] = true,
["One Handed Sword"] = true,
},
parts = {
{
name = "Melee hit",
melee = true,
projectile = false,
},
{
name = "Projectiles",
melee = false,
projectile = true,
},
},
baseFlags = {
attack = true,
melee = true,
projectile = true,
lightning = true,
},
baseMods = {
skill("castTime", 1),
skill("manaCost", 6),
mod("SkillPhysicalDamageConvertToLightning", "BASE", 50), --"skill_physical_damage_%_to_convert_to_lightning" = 50
mod("Damage", "MORE", -25, ModFlag.Projectile), --"active_skill_projectile_damage_+%_final" = -25
--"total_projectile_spread_angle_override" = 70
mod("Damage", "MORE", -25, ModFlag.Dot, 0, { type = "SkillPart", skillPart = 2 }), --"active_skill_damage_over_time_from_projectile_hits_+%_final" = -25
--"show_number_of_projectiles" = ?
},
qualityMods = {
mod("LightningDamage", "INC", 1), --"lightning_damage_+%" = 1
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = skill("damageEffectiveness", nil),
[3] = skill("baseMultiplier", nil),
[4] = mod("ProjectileCount", "BASE", nil), --"number_of_additional_projectiles"
},
levels = {
[1] = { 12, 1.3, 1.3, 4, },
[2] = { 15, 1.32, 1.324, 4, },
[3] = { 19, 1.35, 1.348, 4, },
[4] = { 23, 1.37, 1.372, 4, },
[5] = { 27, 1.4, 1.396, 4, },
[6] = { 31, 1.42, 1.42, 5, },
[7] = { 35, 1.44, 1.444, 5, },
[8] = { 38, 1.47, 1.468, 5, },
[9] = { 41, 1.49, 1.492, 5, },
[10] = { 44, 1.52, 1.516, 5, },
[11] = { 47, 1.54, 1.54, 6, },
[12] = { 50, 1.56, 1.564, 6, },
[13] = { 53, 1.59, 1.588, 6, },
[14] = { 56, 1.61, 1.612, 6, },
[15] = { 59, 1.64, 1.636, 6, },
[16] = { 62, 1.66, 1.66, 7, },
[17] = { 64, 1.68, 1.684, 7, },
[18] = { 66, 1.71, 1.708, 7, },
[19] = { 68, 1.73, 1.732, 7, },
[20] = { 70, 1.76, 1.756, 7, },
[21] = { 72, 1.78, 1.78, 8, },
[22] = { 74, 1.8, 1.804, 8, },
[23] = { 76, 1.83, 1.828, 8, },
[24] = { 78, 1.85, 1.852, 8, },
[25] = { 80, 1.88, 1.876, 8, },
[26] = { 82, 1.9, 1.9, 9, },
[27] = { 84, 1.92, 1.924, 9, },
[28] = { 86, 1.95, 1.948, 9, },
[29] = { 88, 1.97, 1.972, 9, },
[30] = { 90, 2, 1.996, 9, },
},
}
skills["VaalLightningStrike"] = {
name = "Vaal Lightning Strike",
gemTags = {
dexterity = true,
active_skill = true,
vaal = true,
attack = true,
melee = true,
duration = true,
lightning = true,
},
gemTagString = "Vaal, Attack, Melee, Duration, Lightning",
gemStr = 0,
gemDex = 60,
gemInt = 40,
color = 2,
description = "Infuses your melee weapon with electrical energies as you swing. In addition to converting some of your physical damage to lightning damage, the stored energy is forced into the enemy as you strike, electrically charging them for a duration, during which lightning will arc between them and other nearby enemies, dealing damage. This occurs even if the attack is dodged.",
skillTypes = { [1] = true, [25] = true, [24] = true, [12] = true, [43] = true, [35] = true, },
weaponTypes = {
["One Handed Mace"] = true,
["Sceptre"] = true,
["Thrusting One Handed Sword"] = true,
["Two Handed Sword"] = true,
["Dagger"] = true,
["Staff"] = true,
["Two Handed Axe"] = true,
["Two Handed Mace"] = true,
["One Handed Axe"] = true,
["Claw"] = true,
["One Handed Sword"] = true,
},
parts = {
{
name = "Strike",
},
{
name = "Beams",
},
},
baseFlags = {
attack = true,
melee = true,
duration = true,
lightning = true,
vaal = true,
},
baseMods = {
skill("castTime", 1),
mod("SkillPhysicalDamageConvertToLightning", "BASE", 50), --"skill_physical_damage_%_to_convert_to_lightning" = 50
mod("Damage", "MORE", -50, 0, 0, { type = "SkillPart", skillPart = 2 }), --"vaal_lightning_strike_beam_damage_+%_final" = -50
skill("cannotBeEvaded", true), --"global_always_hit" = ?
},
qualityMods = {
mod("Duration", "INC", 1), --"skill_effect_duration_+%" = 1
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = skill("duration", nil), --"base_skill_effect_duration"
[3] = skill("damageEffectiveness", nil),
[4] = skill("baseMultiplier", nil),
},
levels = {
[1] = { 12, 5, nil, nil, },
[2] = { 15, 5.2, 1.01, 1.012, },
[3] = { 19, 5.4, 1.02, 1.024, },
[4] = { 23, 5.6, 1.04, 1.036, },
[5] = { 27, 5.8, 1.05, 1.048, },
[6] = { 31, 6, 1.06, 1.06, },
[7] = { 35, 6.2, 1.07, 1.072, },
[8] = { 38, 6.4, 1.08, 1.084, },
[9] = { 41, 6.6, 1.1, 1.096, },
[10] = { 44, 6.8, 1.11, 1.108, },
[11] = { 47, 7, 1.12, 1.12, },
[12] = { 50, 7.2, 1.13, 1.132, },
[13] = { 53, 7.4, 1.14, 1.144, },
[14] = { 56, 7.6, 1.16, 1.156, },
[15] = { 59, 7.8, 1.17, 1.168, },
[16] = { 62, 8, 1.18, 1.18, },
[17] = { 64, 8.2, 1.19, 1.192, },
[18] = { 66, 8.4, 1.2, 1.204, },
[19] = { 68, 8.6, 1.22, 1.216, },
[20] = { 70, 8.8, 1.23, 1.228, },
[21] = { 72, 9, 1.24, 1.24, },
[22] = { 74, 9.2, 1.25, 1.252, },
[23] = { 76, 9.4, 1.26, 1.264, },
[24] = { 78, 9.6, 1.28, 1.276, },
[25] = { 80, 9.8, 1.29, 1.288, },
[26] = { 82, 10, 1.3, 1.3, },
[27] = { 84, 10.2, 1.31, 1.312, },
[28] = { 86, 10.4, 1.32, 1.324, },
[29] = { 88, 10.6, 1.34, 1.336, },
[30] = { 90, 10.8, 1.35, 1.348, },
},
}
skills["MirrorArrow"] = {
name = "Mirror Arrow",
gemTags = {
dexterity = true,
active_skill = true,
attack = true,
minion = true,
duration = true,
bow = true,
},
gemTagString = "Attack, Minion, Duration, Bow",
gemStr = 0,
gemDex = 100,
gemInt = 0,
color = 2,
description = "Fires an arrow at the target destination. When the arrow lands, a clone is summoned. The clone is a minion that uses your bow and quiver.",
skillTypes = { [14] = true, [1] = true, [9] = true, [48] = true, [69] = true, [21] = true, [12] = true, [22] = true, [17] = true, [19] = true, },
minionSkillTypes = { [1] = true, [3] = true, [48] = true, },
weaponTypes = {
["Bow"] = true,
},
minionList = {
"Clone",
},
baseFlags = {
attack = true,
projectile = true,
minion = true,
movement = true,
duration = true,
},
baseMods = {
skill("castTime", 1),
skill("cooldown", 3),
skill("duration", 3), --"base_skill_effect_duration" = 3000
--"number_of_monsters_to_summon" = 1
mod("MinionModifier", "LIST", { mod = mod("Damage", "MORE", 75) }), --"active_skill_minion_damage_+%_final" = 75
--"display_minion_monster_type" = 4
--"base_is_projectile" = ?
skill("minionUseBowAndQuiver", true),
},
qualityMods = {
--"base_arrow_speed_+%" = 1.5
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = skill("manaCost", nil),
[3] = mod("MinionModifier", "LIST", { mod = mod("Damage", "INC", nil) }), --"minion_damage_+%"
[4] = mod("MinionModifier", "LIST", { mod = mod("Life", "INC", nil) }), --"minion_maximum_life_+%"
[5] = skill("minionLevel", nil), --"display_minion_monster_level"
},
levels = {
[1] = { 10, 14, 0, 0, 24, },
[2] = { 13, 14, 6, 3, 27, },
[3] = { 17, 15, 12, 6, 30, },
[4] = { 21, 15, 18, 9, 33, },
[5] = { 25, 15, 24, 12, 35, },
[6] = { 29, 16, 30, 15, 38, },
[7] = { 33, 16, 36, 18, 40, },
[8] = { 36, 16, 42, 21, 43, },
[9] = { 39, 16, 48, 24, 46, },
[10] = { 42, 17, 54, 27, 48, },
[11] = { 45, 17, 60, 30, 50, },
[12] = { 48, 17, 66, 33, 52, },
[13] = { 51, 17, 72, 36, 54, },
[14] = { 54, 18, 78, 39, 56, },
[15] = { 57, 18, 84, 42, 58, },
[16] = { 60, 18, 90, 45, 60, },
[17] = { 63, 19, 96, 48, 62, },
[18] = { 66, 19, 102, 51, 64, },
[19] = { 68, 20, 108, 54, 66, },
[20] = { 70, 20, 114, 57, 68, },
[21] = { 72, 21, 120, 60, 70, },
[22] = { 74, 21, 126, 63, 72, },
[23] = { 76, 22, 132, 66, 74, },
[24] = { 78, 22, 138, 69, 76, },
[25] = { 80, 22, 144, 72, 78, },
[26] = { 82, 23, 150, 75, 80, },
[27] = { 84, 23, 156, 78, 82, },
[28] = { 86, 23, 162, 81, 84, },
[29] = { 88, 23, 168, 84, 86, },
[30] = { 90, 24, 174, 87, 88, },
},
}
skills["NewPhaseRun"] = {
name = "Phase Run",
gemTags = {
dexterity = true,
active_skill = true,
spell = true,
duration = true,
movement = true,
},
gemTagString = "Spell, Duration, Movement",
gemStr = 0,
gemDex = 100,
gemInt = 0,
color = 2,
description = "Gain a buff that makes you faster, harder to detect, and grants Phasing, letting you pass through enemies. Performing any skill replaces this buff with one that boosts melee damage of skills you use yourself (it will not apply to your melee skills used by totems). Consumes Frenzy Charges to increase duration.",
skillTypes = { [2] = true, [5] = true, [12] = true, [36] = true, [38] = true, },
baseFlags = {
spell = true,
duration = true,
movement = true,
},
baseMods = {
skill("castTime", 0.5),
skill("cooldown", 4),
--"enemy_aggro_radius_+%" = -80
skill("duration", 1.8), --"base_skill_effect_duration" = 1800
skill("durationSecondary", 0.2), --"base_secondary_skill_effect_duration" = 200
mod("Duration", "INC", 100, 0, 0, { type = "Multiplier", var = "FrenzyCharge" }), --"skill_effect_duration_+%_per_frenzy_charge" = 100
--"phase_through_objects" = ?
},
qualityMods = {
mod("MovementSpeed", "INC", 0.5, 0, 0, { type = "GlobalEffect", effectType = "Buff" }), --"base_movement_velocity_+%" = 0.5
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = skill("manaCost", nil),
[3] = mod("MovementSpeed", "INC", nil, 0, 0, { type = "GlobalEffect", effectType = "Buff" }), --"base_movement_velocity_+%"
[4] = mod("PhysicalDamage", "MORE", nil, ModFlag.Melee, 0, { type = "SkillType", skillType = SkillType.Totem, neg = true }, { type = "GlobalEffect", effectType = "Buff" }), --"phase_run_melee_physical_damage_+%_final"
},
levels = {
[1] = { 34, 11, 30, 20, },
[2] = { 36, 11, 30, 21, },
[3] = { 38, 11, 31, 21, },
[4] = { 40, 11, 31, 22, },
[5] = { 42, 11, 32, 22, },
[6] = { 44, 12, 32, 23, },
[7] = { 46, 12, 33, 23, },
[8] = { 48, 12, 33, 24, },
[9] = { 50, 12, 34, 24, },
[10] = { 52, 12, 34, 25, },
[11] = { 54, 12, 35, 25, },
[12] = { 56, 12, 35, 26, },
[13] = { 58, 13, 36, 26, },
[14] = { 60, 13, 36, 27, },
[15] = { 62, 13, 37, 27, },
[16] = { 64, 13, 37, 28, },
[17] = { 66, 13, 38, 28, },
[18] = { 68, 13, 38, 29, },
[19] = { 69, 14, 39, 29, },
[20] = { 70, 14, 39, 30, },
[21] = { 72, 14, 40, 30, },
[22] = { 74, 14, 40, 31, },
[23] = { 76, 14, 41, 31, },
[24] = { 78, 14, 41, 32, },
[25] = { 80, 14, 42, 32, },
[26] = { 82, 14, 42, 33, },
[27] = { 84, 14, 43, 33, },
[28] = { 86, 14, 43, 34, },
[29] = { 88, 14, 44, 34, },
[30] = { 90, 14, 44, 35, },
},
}
skills["PoachersMark"] = {
name = "Poacher's Mark",
gemTags = {
curse = true,
dexterity = true,
active_skill = true,
spell = true,
area = true,
duration = true,
},
gemTagString = "Curse, Spell, AoE, Duration",
gemStr = 0,
gemDex = 100,
gemInt = 0,
color = 2,
description = "Curses all targets in an area, making them less evasive. Hitting the cursed targets will grant life and mana, and killing them will result in more flask charges and a chance to gain a frenzy charge.",
skillTypes = { [2] = true, [11] = true, [12] = true, [17] = true, [18] = true, [19] = true, [26] = true, [32] = true, [36] = true, [67] = true, },
baseFlags = {
spell = true,
curse = true,
area = true,
duration = true,
},
baseMods = {
skill("castTime", 0.5),
--"monster_slain_flask_charges_granted_+%" = 100
--"base_deal_no_damage" = ?
skill("debuff", true),
skill("radius", 22),
},
qualityMods = {
--"chance_to_grant_frenzy_charge_on_death_%" = 0.5
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = skill("manaCost", nil),
[3] = skill("duration", nil), --"base_skill_effect_duration"
[4] = skill("radiusExtra", nil), --"active_skill_base_radius_+"
[5] = mod("Evasion", "MORE", nil, 0, 0, { type = "GlobalEffect", effectType = "Curse" }), --"evasion_rating_+%_final_from_poachers_mark"
[6] = mod("SelfLifeOnHit", "BASE", nil, ModFlag.Attack, 0, { type = "GlobalEffect", effectType = "Curse" }), --"life_granted_when_hit_by_attacks"
[7] = mod("SelfManaOnHit", "BASE", nil, ModFlag.Attack, 0, { type = "GlobalEffect", effectType = "Curse" }), --"mana_granted_when_hit_by_attacks"
--[8] = "chance_to_grant_frenzy_charge_on_death_%"
},
levels = {
[1] = { 24, 24, 6, 0, -30, 5, 5, 21, },
[2] = { 27, 26, 6.2, 1, -31, 6, 6, 21, },
[3] = { 30, 27, 6.4, 1, -32, 7, 6, 22, },
[4] = { 33, 29, 6.6, 2, -33, 8, 6, 22, },
[5] = { 36, 30, 6.8, 2, -34, 9, 7, 23, },
[6] = { 39, 32, 7, 3, -35, 10, 7, 23, },
[7] = { 42, 34, 7.2, 3, -36, 11, 7, 24, },
[8] = { 45, 35, 7.4, 4, -37, 12, 8, 24, },
[9] = { 48, 37, 7.6, 4, -38, 13, 8, 25, },
[10] = { 50, 38, 7.8, 5, -39, 14, 8, 25, },
[11] = { 52, 39, 8, 5, -40, 15, 9, 26, },
[12] = { 54, 40, 8.2, 6, -41, 16, 9, 26, },
[13] = { 56, 42, 8.4, 6, -42, 17, 9, 27, },
[14] = { 58, 43, 8.6, 7, -43, 18, 10, 27, },
[15] = { 60, 44, 8.8, 7, -44, 19, 10, 28, },
[16] = { 62, 45, 9, 8, -45, 20, 10, 28, },
[17] = { 64, 46, 9.2, 8, -46, 21, 11, 29, },
[18] = { 66, 47, 9.4, 9, -47, 22, 11, 29, },
[19] = { 68, 48, 9.6, 9, -48, 23, 11, 30, },
[20] = { 70, 50, 9.8, 10, -49, 24, 12, 30, },
[21] = { 72, 51, 10, 10, -50, 25, 12, 31, },
[22] = { 74, 52, 10.2, 11, -51, 26, 12, 31, },
[23] = { 76, 53, 10.4, 11, -52, 27, 13, 32, },
[24] = { 78, 54, 10.6, 12, -53, 28, 13, 32, },
[25] = { 80, 56, 10.8, 12, -54, 29, 13, 33, },
[26] = { 82, 57, 11, 13, -55, 30, 14, 33, },
[27] = { 84, 58, 11.2, 13, -56, 31, 14, 34, },
[28] = { 86, 59, 11.4, 14, -57, 32, 14, 34, },
[29] = { 88, 60, 11.6, 14, -58, 33, 15, 35, },
[30] = { 90, 61, 11.8, 15, -59, 34, 15, 35, },
},
}
skills["ProjectileWeakness"] = {
name = "Projectile Weakness",
gemTags = {
curse = true,
dexterity = true,
active_skill = true,
spell = true,
area = true,
duration = true,
},
gemTagString = "Curse, Spell, AoE, Duration",
gemStr = 0,
gemDex = 100,
gemInt = 0,
color = 2,
description = "Curses all targets in an area, making them easier to pierce and to knock back, and increasing the damage they take from projectiles.",
skillTypes = { [2] = true, [11] = true, [12] = true, [17] = true, [18] = true, [19] = true, [26] = true, [32] = true, [36] = true, [67] = true, },
baseFlags = {
spell = true,
curse = true,
area = true,
duration = true,
},
baseMods = {
skill("castTime", 0.5),
flag("AlwaysPierceSelf", { type = "GlobalEffect", effectType = "Curse" }), --"projectiles_always_pierce_you" = 1
--"chance_to_be_knocked_back_%" = 25
--"base_deal_no_damage" = ?
skill("debuff", true),
skill("radius", 22),
},
qualityMods = {
mod("ProjectileDamageTaken", "INC", 0.5, 0, 0, { type = "GlobalEffect", effectType = "Curse" }), --"projectile_damage_taken_+%" = 0.5
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = skill("manaCost", nil),
[3] = skill("duration", nil), --"base_skill_effect_duration"
[4] = skill("radiusExtra", nil), --"active_skill_base_radius_+"
[5] = mod("ProjectileDamageTaken", "INC", nil, 0, 0, { type = "GlobalEffect", effectType = "Curse" }), --"projectile_damage_taken_+%"
},
levels = {
[1] = { 24, 24, 9, 0, 25, },
[2] = { 27, 26, 9.1, 1, 26, },
[3] = { 30, 27, 9.2, 1, 27, },
[4] = { 33, 29, 9.3, 2, 28, },
[5] = { 36, 30, 9.4, 2, 29, },
[6] = { 39, 32, 9.5, 3, 30, },
[7] = { 42, 34, 9.6, 3, 31, },
[8] = { 45, 35, 9.7, 4, 32, },
[9] = { 48, 37, 9.8, 4, 33, },
[10] = { 50, 38, 9.9, 5, 34, },
[11] = { 52, 39, 10, 5, 35, },
[12] = { 54, 40, 10.1, 6, 36, },
[13] = { 56, 42, 10.2, 6, 37, },
[14] = { 58, 43, 10.3, 7, 38, },
[15] = { 60, 44, 10.4, 7, 39, },
[16] = { 62, 45, 10.5, 8, 40, },
[17] = { 64, 46, 10.6, 8, 41, },
[18] = { 66, 47, 10.7, 9, 42, },
[19] = { 68, 48, 10.8, 9, 43, },
[20] = { 70, 50, 10.9, 10, 44, },
[21] = { 72, 51, 11, 10, 45, },
[22] = { 74, 52, 11.1, 11, 46, },
[23] = { 76, 53, 11.2, 11, 47, },
[24] = { 78, 54, 11.3, 12, 48, },
[25] = { 80, 56, 11.4, 12, 49, },
[26] = { 82, 57, 11.5, 13, 50, },
[27] = { 84, 58, 11.6, 13, 51, },
[28] = { 86, 59, 11.7, 14, 52, },
[29] = { 88, 60, 11.8, 14, 53, },
[30] = { 90, 61, 11.9, 15, 54, },
},
}
skills["Puncture"] = {
name = "Puncture",
gemTags = {
dexterity = true,
active_skill = true,
attack = true,
duration = true,
melee = true,
bow = true,
},
gemTagString = "Attack, Duration, Melee, Bow",
gemStr = 0,
gemDex = 60,
gemInt = 40,
color = 2,
description = "Punctures the target, causing a bleeding debuff, which will be affected by modifiers to skill duration. Puncture works with bows, daggers, claws or swords.",
skillTypes = { [1] = true, [48] = true, [69] = true, [3] = true, [68] = true, [12] = true, [17] = true, [19] = true, [22] = true, [25] = true, [28] = true, [24] = true, [40] = true, },
weaponTypes = {
["Bow"] = true,
["Claw"] = true,
["Thrusting One Handed Sword"] = true,
["Two Handed Sword"] = true,
["Dagger"] = true,
["One Handed Sword"] = true,
},
baseFlags = {
attack = true,
melee = true,
projectile = true,
duration = true,
},
baseMods = {
skill("castTime", 1),
skill("manaCost", 6),
skill("duration", 8), --"base_skill_effect_duration" = 8000
--"skill_can_fire_arrows" = ?
mod("BleedChance", "BASE", 100), --"global_bleed_on_hit" = ?
skill("bleedDurationIsSkillDuration", true), --"bleed_duration_is_skill_duration" = ?
skill("bleedIsSkillEffect", true),
},
qualityMods = {
mod("Duration", "INC", 1), --"skill_effect_duration_+%" = 1
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = skill("damageEffectiveness", nil),
[3] = skill("baseMultiplier", nil),
},
levels = {
[1] = { 4, nil, nil, },
[2] = { 6, 1.01, 1.012, },
[3] = { 9, 1.02, 1.024, },
[4] = { 12, 1.04, 1.036, },
[5] = { 16, 1.05, 1.048, },
[6] = { 20, 1.06, 1.06, },
[7] = { 24, 1.07, 1.072, },
[8] = { 28, 1.08, 1.084, },
[9] = { 32, 1.1, 1.096, },
[10] = { 36, 1.11, 1.108, },
[11] = { 40, 1.12, 1.12, },
[12] = { 44, 1.13, 1.132, },
[13] = { 48, 1.14, 1.144, },
[14] = { 52, 1.16, 1.156, },
[15] = { 55, 1.17, 1.168, },
[16] = { 58, 1.18, 1.18, },
[17] = { 61, 1.19, 1.192, },
[18] = { 64, 1.2, 1.204, },
[19] = { 67, 1.22, 1.216, },
[20] = { 70, 1.23, 1.228, },
[21] = { 72, 1.24, 1.24, },
[22] = { 74, 1.25, 1.252, },
[23] = { 76, 1.26, 1.264, },
[24] = { 78, 1.28, 1.276, },
[25] = { 80, 1.29, 1.288, },
[26] = { 82, 1.3, 1.3, },
[27] = { 84, 1.31, 1.312, },
[28] = { 86, 1.32, 1.324, },
[29] = { 88, 1.34, 1.336, },
[30] = { 90, 1.35, 1.348, },
},
}
skills["ColdResistAura"] = {
name = "Purity of Ice",
gemTags = {
aura = true,
dexterity = true,
active_skill = true,
spell = true,
area = true,
cold = true,
},
gemTagString = "Aura, Spell, AoE, Cold",
gemStr = 0,
gemDex = 60,
gemInt = 40,
color = 2,
description = "Casts an aura that grants cold resistance to you and your allies.",
skillTypes = { [2] = true, [11] = true, [5] = true, [15] = true, [27] = true, [16] = true, [18] = true, [44] = true, [34] = true, },
baseFlags = {
spell = true,
aura = true,
area = true,
cold = true,
},
baseMods = {
skill("castTime", 1.2),
skill("manaCost", 35),
skill("cooldown", 1.2),
--"base_deal_no_damage" = ?
skill("radius", 36),
},
qualityMods = {
mod("AreaOfEffect", "INC", 1), --"base_skill_area_of_effect_+%" = 1
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = mod("ColdResist", "BASE", nil, 0, 0, { type = "GlobalEffect", effectType = "Aura" }), --"base_cold_damage_resistance_%"
[3] = mod("ColdResistMax", "BASE", nil, 0, 0, { type = "GlobalEffect", effectType = "Aura" }), --"base_maximum_cold_damage_resistance_%"
[4] = skill("radiusExtra", nil), --"active_skill_base_radius_+"
},
levels = {
[1] = { 24, 22, 0, 0, },
[2] = { 27, 23, 0, 1, },
[3] = { 30, 24, 0, 2, },
[4] = { 33, 25, 0, 3, },
[5] = { 36, 26, 1, 4, },
[6] = { 39, 27, 1, 5, },
[7] = { 42, 28, 1, 6, },
[8] = { 45, 29, 1, 7, },
[9] = { 48, 30, 1, 8, },
[10] = { 50, 31, 1, 9, },
[11] = { 52, 32, 2, 10, },
[12] = { 54, 33, 2, 11, },
[13] = { 56, 34, 2, 12, },
[14] = { 58, 35, 2, 13, },
[15] = { 60, 36, 2, 14, },
[16] = { 62, 37, 2, 15, },
[17] = { 64, 38, 3, 16, },
[18] = { 66, 39, 3, 17, },
[19] = { 68, 40, 3, 18, },
[20] = { 70, 41, 4, 19, },
[21] = { 72, 42, 4, 20, },
[22] = { 74, 43, 4, 21, },
[23] = { 76, 44, 5, 22, },
[24] = { 78, 45, 5, 23, },
[25] = { 80, 46, 5, 24, },
[26] = { 82, 47, 5, 25, },
[27] = { 84, 48, 5, 26, },
[28] = { 86, 49, 5, 27, },
[29] = { 88, 50, 5, 28, },
[30] = { 90, 51, 5, 29, },
},
}
skills["RainOfArrows"] = {
name = "Rain of Arrows",
gemTags = {
dexterity = true,
active_skill = true,
attack = true,
area = true,
bow = true,
},
gemTagString = "Attack, AoE, Bow",
gemStr = 0,
gemDex = 100,
gemInt = 0,
color = 2,
description = "Fires a large number of arrows into the air, to land at the target after a short delay.",
skillTypes = { [1] = true, [48] = true, [69] = true, [11] = true, [14] = true, [22] = true, [17] = true, [19] = true, },
weaponTypes = {
["Bow"] = true,
},
baseFlags = {
attack = true,
projectile = true,
area = true,
},
baseMods = {
skill("castTime", 1),
--"base_is_projectile" = ?
--"is_area_damage" = ?
skill("radius", 24),
},
qualityMods = {
mod("AreaOfEffect", "INC", 0.5), --"base_skill_area_of_effect_+%" = 0.5
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = skill("manaCost", nil),
[3] = skill("damageEffectiveness", nil),
[4] = skill("baseMultiplier", nil),
[5] = skill("radiusExtra", nil), --"active_skill_base_radius_+"
},
levels = {
[1] = { 12, 7, 1.1, 1.1, 0, },
[2] = { 15, 7, 1.11, 1.11, 0, },
[3] = { 19, 7, 1.12, 1.12, 0, },
[4] = { 23, 8, 1.13, 1.13, 0, },
[5] = { 27, 8, 1.14, 1.14, 1, },
[6] = { 31, 8, 1.15, 1.15, 1, },
[7] = { 35, 8, 1.16, 1.16, 1, },
[8] = { 38, 8, 1.17, 1.17, 1, },
[9] = { 41, 9, 1.18, 1.18, 1, },
[10] = { 44, 9, 1.19, 1.19, 2, },
[11] = { 47, 9, 1.2, 1.2, 2, },
[12] = { 50, 9, 1.21, 1.21, 2, },
[13] = { 53, 9, 1.22, 1.22, 2, },
[14] = { 56, 10, 1.23, 1.23, 2, },
[15] = { 59, 10, 1.24, 1.24, 3, },
[16] = { 62, 10, 1.25, 1.25, 3, },
[17] = { 64, 10, 1.26, 1.26, 3, },
[18] = { 66, 10, 1.27, 1.27, 3, },
[19] = { 68, 11, 1.28, 1.28, 3, },
[20] = { 70, 11, 1.29, 1.29, 4, },
[21] = { 72, 11, 1.3, 1.3, 4, },
[22] = { 74, 11, 1.31, 1.31, 4, },
[23] = { 76, 11, 1.32, 1.32, 4, },
[24] = { 78, 11, 1.33, 1.33, 4, },
[25] = { 80, 11, 1.34, 1.34, 5, },
[26] = { 82, 12, 1.35, 1.35, 5, },
[27] = { 84, 12, 1.36, 1.36, 5, },
[28] = { 86, 12, 1.37, 1.37, 5, },
[29] = { 88, 12, 1.38, 1.38, 5, },
[30] = { 90, 12, 1.39, 1.39, 6, },
},
}
skills["VaalRainOfArrows"] = {
name = "Vaal Rain of Arrows",
gemTags = {
dexterity = true,
active_skill = true,
vaal = true,
attack = true,
area = true,
duration = true,
bow = true,
},
gemTagString = "Vaal, Attack, AoE, Duration, Bow",
gemStr = 0,
gemDex = 100,
gemInt = 0,
color = 2,
description = "Fires a large number of arrows into the air, to land at the target after a short delay. Enemies hit by the arrows are pinned in place, unable to move for a time.",
skillTypes = { [1] = true, [48] = true, [11] = true, [14] = true, [22] = true, [17] = true, [19] = true, [12] = true, [43] = true, },
weaponTypes = {
["Bow"] = true,
},
baseFlags = {
attack = true,
projectile = true,
area = true,
duration = true,
vaal = true,
},
baseMods = {
skill("castTime", 1),
--"base_is_projectile" = ?
--"is_area_damage" = ?
--"rain_of_arrows_pin" = ?
skill("cannotBeEvaded", true), --"global_always_hit" = ?
--"no_movement_speed" = ?
},
qualityMods = {
mod("AreaOfEffect", "INC", 0.5), --"base_skill_area_of_effect_+%" = 0.5
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = skill("damageEffectiveness", nil),
[3] = skill("baseMultiplier", nil),
[4] = skill("duration", nil), --"base_skill_effect_duration"
[5] = skill("radiusExtra", nil), --"active_skill_base_radius_+"
},
levels = {
[1] = { 12, 1.4, 1.4, 3.4, 0, },
[2] = { 15, 1.42, 1.415, 3.45, 0, },
[3] = { 19, 1.43, 1.43, 3.5, 0, },
[4] = { 23, 1.45, 1.445, 3.55, 0, },
[5] = { 27, 1.46, 1.46, 3.6, 1, },
[6] = { 31, 1.48, 1.475, 3.65, 1, },
[7] = { 35, 1.49, 1.49, 3.7, 1, },
[8] = { 38, 1.51, 1.505, 3.75, 1, },
[9] = { 41, 1.52, 1.52, 3.8, 1, },
[10] = { 44, 1.54, 1.535, 3.85, 2, },
[11] = { 47, 1.55, 1.55, 3.9, 2, },
[12] = { 50, 1.57, 1.565, 3.95, 2, },
[13] = { 53, 1.58, 1.58, 4, 2, },
[14] = { 56, 1.6, 1.595, 4.05, 2, },
[15] = { 59, 1.61, 1.61, 4.1, 3, },
[16] = { 62, 1.63, 1.625, 4.15, 3, },
[17] = { 64, 1.64, 1.64, 4.2, 3, },
[18] = { 66, 1.66, 1.655, 4.25, 3, },
[19] = { 68, 1.67, 1.67, 4.3, 3, },
[20] = { 70, 1.69, 1.685, 4.35, 4, },
[21] = { 72, 1.7, 1.7, 4.4, 4, },
[22] = { 74, 1.72, 1.715, 4.45, 4, },
[23] = { 76, 1.73, 1.73, 4.5, 4, },
[24] = { 78, 1.75, 1.745, 4.55, 4, },
[25] = { 80, 1.76, 1.76, 4.6, 5, },
[26] = { 82, 1.78, 1.775, 4.65, 5, },
[27] = { 84, 1.79, 1.79, 4.7, 5, },
[28] = { 86, 1.81, 1.805, 4.75, 5, },
[29] = { 88, 1.82, 1.82, 4.8, 5, },
[30] = { 90, 1.84, 1.835, 4.85, 6, },
},
}
skills["Reave"] = {
name = "Reave",
gemTags = {
dexterity = true,
active_skill = true,
attack = true,
area = true,
melee = true,
},
gemTagString = "Attack, AoE, Melee",
gemStr = 0,
gemDex = 60,
gemInt = 40,
color = 2,
description = "Attacks a small area in front of you. Each Reave that hits an enemy increases the area of effect. The area is reset after a short period without hitting anything. Only works with Daggers, Claws, and One-Handed Swords.",
skillTypes = { [1] = true, [11] = true, [28] = true, [24] = true, },
weaponTypes = {
["Thrusting One Handed Sword"] = true,
["One Handed Sword"] = true,
["Dagger"] = true,
["Claw"] = true,
},
parts = {
{
name = "No stages",
},
{
name = "4 stages",
},
{
name = "8 stages",
},
},
baseFlags = {
attack = true,
melee = true,
area = true,
},
baseMods = {
skill("castTime", 1),
skill("manaCost", 6),
mod("AreaOfEffect", "MORE", 50, 0, 0, { type = "Multiplier", var = "ReaveStage" }), --"reave_area_of_effect_+%_final_per_stage" = 50
--"is_area_damage" = ?
skill("radius", 20),
mod("Multiplier:ReaveStage", "BASE", 4, 0, 0, { type = "SkillPart", skillPart = 2 }),
mod("Multiplier:ReaveStage", "BASE", 8, 0, 0, { type = "SkillPart", skillPart = 3 }),
},
qualityMods = {
mod("Speed", "INC", 0.5, ModFlag.Attack, 0, nil), --"attack_speed_+%" = 0.5
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = skill("radiusExtra", nil), --"active_skill_base_radius_+"
[3] = skill("damageEffectiveness", nil),
[4] = skill("baseMultiplier", nil),
},
levels = {
[1] = { 12, 0, nil, nil, },
[2] = { 15, 0, 1.02, 1.02, },
[3] = { 19, 0, 1.04, 1.04, },
[4] = { 23, 0, 1.06, 1.06, },
[5] = { 27, 1, 1.08, 1.08, },
[6] = { 31, 1, 1.1, 1.1, },
[7] = { 35, 1, 1.12, 1.12, },
[8] = { 38, 1, 1.14, 1.14, },
[9] = { 41, 1, 1.16, 1.16, },
[10] = { 44, 2, 1.18, 1.18, },
[11] = { 47, 2, 1.2, 1.2, },
[12] = { 50, 2, 1.22, 1.22, },
[13] = { 53, 2, 1.24, 1.24, },
[14] = { 56, 2, 1.26, 1.26, },
[15] = { 59, 3, 1.28, 1.28, },
[16] = { 62, 3, 1.3, 1.3, },
[17] = { 64, 3, 1.32, 1.32, },
[18] = { 66, 3, 1.34, 1.34, },
[19] = { 68, 3, 1.36, 1.36, },
[20] = { 70, 4, 1.38, 1.38, },
[21] = { 72, 4, 1.4, 1.4, },
[22] = { 74, 4, 1.42, 1.42, },
[23] = { 76, 4, 1.44, 1.44, },
[24] = { 78, 4, 1.46, 1.46, },
[25] = { 80, 5, 1.48, 1.48, },
[26] = { 82, 5, 1.5, 1.5, },
[27] = { 84, 5, 1.52, 1.52, },
[28] = { 86, 5, 1.54, 1.54, },
[29] = { 88, 5, 1.56, 1.56, },
[30] = { 90, 6, 1.58, 1.58, },
},
}
skills["VaalReave"] = {
name = "Vaal Reave",
gemTags = {
dexterity = true,
active_skill = true,
vaal = true,
attack = true,
area = true,
melee = true,
},
gemTagString = "Vaal, Attack, AoE, Melee",
gemStr = 0,
gemDex = 60,
gemInt = 40,
color = 2,
description = "Repeatedly attacks a large area in different directions. Each Vaal Reave that hits an enemy increases the area of effect. The area is reset after a short period without hitting anything. Only works with Daggers, Claws, and One-Handed Swords.",
skillTypes = { [1] = true, [11] = true, [24] = true, [43] = true, },
weaponTypes = {
["Thrusting One Handed Sword"] = true,
["One Handed Sword"] = true,
["Dagger"] = true,
["Claw"] = true,
},
parts = {
{
name = "No stages",
},
{
name = "4 stages",
},
{
name = "8 stages",
},
},
baseFlags = {
attack = true,
melee = true,
area = true,
vaal = true,
},
baseMods = {
skill("castTime", 1),
mod("AreaOfEffect", "MORE", 50, 0, 0, { type = "Multiplier", var = "ReaveStage" }), --"reave_area_of_effect_+%_final_per_stage" = 50
--"reave_rotation_on_repeat" = 135
--"reave_additional_max_stacks" = 4
--"base_attack_repeat_count" = 7
mod("Speed", "MORE", 150, ModFlag.Attack), --"active_skill_attack_speed_+%_final" = 150
--"reave_additional_starting_stacks" = 4
--"is_area_damage" = ?
skill("cannotBeEvaded", true), --"global_always_hit" = ?
skill("radius", 12),
mod("Multiplier:ReaveStage", "BASE", 4, 0, 0, { type = "SkillPart", skillPart = 2 }),
mod("Multiplier:ReaveStage", "BASE", 8, 0, 0, { type = "SkillPart", skillPart = 3 }),
},
qualityMods = {
mod("Speed", "INC", 0.5, ModFlag.Attack, 0, nil), --"attack_speed_+%" = 0.5
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = skill("radiusExtra", nil), --"active_skill_base_radius_+"
[3] = skill("damageEffectiveness", nil),
[4] = skill("baseMultiplier", nil),
},
levels = {
[1] = { 12, 0, nil, nil, },
[2] = { 15, 0, 1.01, 1.012, },
[3] = { 19, 0, 1.02, 1.024, },
[4] = { 23, 0, 1.04, 1.036, },
[5] = { 27, 1, 1.05, 1.048, },
[6] = { 31, 1, 1.06, 1.06, },
[7] = { 35, 1, 1.07, 1.072, },
[8] = { 38, 1, 1.08, 1.084, },
[9] = { 41, 1, 1.1, 1.096, },
[10] = { 44, 2, 1.11, 1.108, },
[11] = { 47, 2, 1.12, 1.12, },
[12] = { 50, 2, 1.13, 1.132, },
[13] = { 53, 2, 1.14, 1.144, },
[14] = { 56, 2, 1.16, 1.156, },
[15] = { 59, 3, 1.17, 1.168, },
[16] = { 62, 3, 1.18, 1.18, },
[17] = { 64, 3, 1.19, 1.192, },
[18] = { 66, 3, 1.2, 1.204, },
[19] = { 68, 3, 1.22, 1.216, },
[20] = { 70, 4, 1.23, 1.228, },
[21] = { 72, 4, 1.24, 1.24, },
[22] = { 74, 4, 1.25, 1.252, },
[23] = { 76, 4, 1.26, 1.264, },
[24] = { 78, 4, 1.28, 1.276, },
[25] = { 80, 5, 1.29, 1.288, },
[26] = { 82, 5, 1.3, 1.3, },
[27] = { 84, 5, 1.31, 1.312, },
[28] = { 86, 5, 1.32, 1.324, },
[29] = { 88, 5, 1.34, 1.336, },
[30] = { 90, 6, 1.35, 1.348, },
},
}
skills["Riposte"] = {
name = "Riposte",
gemTags = {
trigger = true,
dexterity = true,
active_skill = true,
attack = true,
melee = true,
},
gemTagString = "Trigger, Attack, Melee",
gemStr = 0,
gemDex = 100,
gemInt = 0,
color = 2,
description = "Perform a deadly counter-attack when you block. Uses both weapons while you're dual wielding.",
skillTypes = { [1] = true, [24] = true, [25] = true, [47] = true, [57] = true, },
weaponTypes = {
["None"] = true,
["One Handed Mace"] = true,
["Sceptre"] = true,
["Thrusting One Handed Sword"] = true,
["Two Handed Sword"] = true,
["Dagger"] = true,
["Staff"] = true,
["Two Handed Axe"] = true,
["Two Handed Mace"] = true,
["One Handed Axe"] = true,
["Claw"] = true,
["One Handed Sword"] = true,
},
baseFlags = {
attack = true,
melee = true,
},
baseMods = {
skill("castTime", 1),
skill("cooldown", 0.8),
--"melee_counterattack_trigger_on_block_%" = 100
--"attack_unusable_if_triggerable" = ?
skill("showAverage", true), --"base_skill_show_average_damage_instead_of_dps" = ?
skill("doubleHitsWhenDualWielding", true), --"skill_double_hits_when_dual_wielding" = ?
},
qualityMods = {
mod("Damage", "INC", 1, 0, 0, nil), --"damage_+%" = 1
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = skill("damageEffectiveness", nil),
[3] = skill("baseMultiplier", nil),
},
levels = {
[1] = { 4, nil, nil, },
[2] = { 6, 1.02, 1.02, },
[3] = { 9, 1.04, 1.04, },
[4] = { 12, 1.06, 1.06, },
[5] = { 16, 1.08, 1.08, },
[6] = { 20, 1.1, 1.1, },
[7] = { 24, 1.12, 1.12, },
[8] = { 28, 1.14, 1.14, },
[9] = { 32, 1.16, 1.16, },
[10] = { 36, 1.18, 1.18, },
[11] = { 40, 1.2, 1.2, },
[12] = { 44, 1.22, 1.22, },
[13] = { 48, 1.24, 1.24, },
[14] = { 52, 1.26, 1.26, },
[15] = { 55, 1.28, 1.28, },
[16] = { 58, 1.3, 1.3, },
[17] = { 61, 1.32, 1.32, },
[18] = { 64, 1.34, 1.34, },
[19] = { 67, 1.36, 1.36, },
[20] = { 70, 1.38, 1.38, },
[21] = { 72, 1.4, 1.4, },
[22] = { 74, 1.42, 1.42, },
[23] = { 76, 1.44, 1.44, },
[24] = { 78, 1.46, 1.46, },
[25] = { 80, 1.48, 1.48, },
[26] = { 82, 1.5, 1.5, },
[27] = { 84, 1.52, 1.52, },
[28] = { 86, 1.54, 1.54, },
[29] = { 88, 1.56, 1.56, },
[30] = { 90, 1.58, 1.58, },
},
}
skills["ShrapnelShot"] = {
name = "Shrapnel Shot",
gemTags = {
lightning = true,
dexterity = true,
active_skill = true,
attack = true,
area = true,
bow = true,
},
gemTagString = "Lightning, Attack, AoE, Bow",
gemStr = 0,
gemDex = 100,
gemInt = 0,
color = 2,
description = "Fires an arrow that pierces through enemies. Arrows are fired with such force that they create a burst of lightning, damaging all enemies in a cone in front of the archer.",
skillTypes = { [1] = true, [3] = true, [68] = true, [11] = true, [22] = true, [17] = true, [19] = true, [35] = true, [48] = true, [69] = true, },
weaponTypes = {
["Bow"] = true,
},
parts = {
{
name = "Arrow",
area = false,
},
{
name = "Cone",
area = true,
},
},
baseFlags = {
attack = true,
projectile = true,
area = true,
lightning = true,
},
baseMods = {
skill("castTime", 1),
mod("SkillPhysicalDamageConvertToLightning", "BASE", 50), --"skill_physical_damage_%_to_convert_to_lightning" = 50
--"base_is_projectile" = ?
--"skill_can_fire_arrows" = ?
},
qualityMods = {
mod("AreaOfEffect", "INC", 0.5), --"base_skill_area_of_effect_+%" = 0.5
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = skill("manaCost", nil),
[3] = skill("damageEffectiveness", nil),
[4] = skill("baseMultiplier", nil),
[5] = skill("radiusExtra", nil), --"active_skill_base_radius_+"
[6] = mod("PierceCount", "BASE", nil, ModFlag.Attack), --"arrow_base_number_of_targets_to_pierce"
},
levels = {
[1] = { 1, 6, 0.8, 0.8, 0, 4, },
[2] = { 2, 6, 0.81, 0.81, 0, 4, },
[3] = { 4, 6, 0.82, 0.82, 0, 4, },
[4] = { 7, 7, 0.83, 0.83, 1, 4, },
[5] = { 11, 7, 0.84, 0.84, 1, 4, },
[6] = { 16, 7, 0.85, 0.85, 1, 5, },
[7] = { 20, 7, 0.86, 0.86, 1, 5, },
[8] = { 24, 8, 0.87, 0.87, 2, 5, },
[9] = { 28, 8, 0.88, 0.88, 2, 5, },
[10] = { 32, 8, 0.89, 0.89, 2, 5, },
[11] = { 36, 8, 0.9, 0.9, 2, 6, },
[12] = { 40, 8, 0.91, 0.91, 3, 6, },
[13] = { 44, 9, 0.92, 0.92, 3, 6, },
[14] = { 48, 9, 0.93, 0.93, 3, 6, },
[15] = { 52, 9, 0.94, 0.94, 3, 6, },
[16] = { 56, 9, 0.95, 0.95, 4, 7, },
[17] = { 60, 9, 0.96, 0.96, 4, 7, },
[18] = { 64, 10, 0.97, 0.97, 4, 7, },
[19] = { 67, 10, 0.98, 0.98, 4, 7, },
[20] = { 70, 10, 0.99, 0.99, 5, 7, },
[21] = { 72, 10, nil, nil, 5, 8, },
[22] = { 74, 10, 1.01, 1.01, 5, 8, },
[23] = { 76, 11, 1.02, 1.02, 5, 8, },
[24] = { 78, 11, 1.03, 1.03, 6, 8, },
[25] = { 80, 11, 1.04, 1.04, 6, 8, },
[26] = { 82, 11, 1.05, 1.05, 6, 9, },
[27] = { 84, 11, 1.06, 1.06, 6, 9, },
[28] = { 86, 12, 1.07, 1.07, 7, 9, },
[29] = { 88, 12, 1.08, 1.08, 7, 9, },
[30] = { 90, 12, 1.09, 1.09, 7, 9, },
},
}
skills["SiegeBallista"] = {
name = "Siege Ballista",
gemTags = {
totem = true,
dexterity = true,
active_skill = true,
attack = true,
duration = true,
bow = true,
},
gemTagString = "Totem, Attack, Duration, Bow",
gemStr = 0,
gemDex = 100,
gemInt = 0,
color = 2,
description = "Summons a totem that attacks with piercing arrows. It attacks slowly, but deals increased damage.",
skillTypes = { [1] = true, [3] = true, [68] = true, [48] = true, [17] = true, [19] = true, [30] = true, [12] = true, },
weaponTypes = {
["Bow"] = true,
},
skillTotemId = 12,
baseFlags = {
attack = true,
projectile = true,
totem = true,
duration = true,
},
baseMods = {
skill("castTime", 1),
mod("Speed", "MORE", -50, ModFlag.Attack), --"active_skill_attack_speed_+%_final" = -50
--"base_totem_range" = 80
--"base_totem_duration" = 8000
--"base_is_projectile" = ?
--"base_skill_is_totemified" = ?
--"is_totem" = ?
--"skill_can_fire_arrows" = ?
},
qualityMods = {
mod("TotemPlacementSpeed", "INC", 1), --"summon_totem_cast_speed_+%" = 1
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = skill("manaCost", nil),
[3] = skill("damageEffectiveness", nil),
[4] = skill("baseMultiplier", nil),
[5] = skill("totemLevel", nil), --"base_active_skill_totem_level"
[6] = mod("PierceCount", "BASE", nil, ModFlag.Attack), --"arrow_base_number_of_targets_to_pierce"
},
levels = {
[1] = { 4, 8, 1.4, 1.4, 4, 6, },
[2] = { 6, 8, 1.42, 1.416, 6, 6, },
[3] = { 9, 8, 1.43, 1.432, 9, 6, },
[4] = { 12, 9, 1.45, 1.448, 12, 6, },
[5] = { 16, 9, 1.46, 1.464, 16, 6, },
[6] = { 20, 9, 1.48, 1.48, 20, 7, },
[7] = { 24, 9, 1.5, 1.496, 24, 7, },
[8] = { 28, 9, 1.51, 1.512, 28, 7, },
[9] = { 32, 9, 1.53, 1.528, 32, 7, },
[10] = { 36, 10, 1.54, 1.544, 36, 7, },
[11] = { 40, 10, 1.56, 1.56, 40, 8, },
[12] = { 44, 10, 1.58, 1.576, 44, 8, },
[13] = { 48, 10, 1.59, 1.592, 48, 8, },
[14] = { 52, 10, 1.61, 1.608, 52, 8, },
[15] = { 55, 11, 1.62, 1.624, 55, 8, },
[16] = { 58, 11, 1.64, 1.64, 58, 9, },
[17] = { 61, 12, 1.66, 1.656, 61, 9, },
[18] = { 64, 12, 1.67, 1.672, 64, 9, },
[19] = { 67, 12, 1.69, 1.688, 67, 9, },
[20] = { 70, 13, 1.7, 1.704, 70, 9, },
[21] = { 72, 13, 1.72, 1.72, 72, 10, },
[22] = { 74, 13, 1.74, 1.736, 74, 10, },
[23] = { 76, 14, 1.75, 1.752, 76, 10, },
[24] = { 78, 14, 1.77, 1.768, 78, 10, },
[25] = { 80, 14, 1.78, 1.784, 80, 10, },
[26] = { 82, 14, 1.8, 1.8, 82, 11, },
[27] = { 84, 14, 1.82, 1.816, 84, 11, },
[28] = { 86, 14, 1.83, 1.832, 86, 11, },
[29] = { 88, 15, 1.85, 1.848, 88, 11, },
[30] = { 90, 15, 1.86, 1.864, 90, 11, },
},
}
skills["SmokeMine"] = {
name = "Smoke Mine",
gemTags = {
mine = true,
dexterity = true,
active_skill = true,
spell = true,
area = true,
duration = true,
movement = true,
},
gemTagString = "Mine, Spell, AoE, Duration, Movement",
gemStr = 0,
gemDex = 60,
gemInt = 40,
color = 2,
description = "Places a mine that will teleport you to it when detonated. It covers both your escape and arrival with a cloud of smoke that blinds enemies, and gives you a temporary buff to movement speed.",
skillTypes = { [2] = true, [11] = true, [12] = true, [38] = true, [41] = true, },
baseFlags = {
spell = true,
mine = true,
area = true,
duration = true,
movement = true,
buff = true,
},
baseMods = {
skill("castTime", 0.5),
--"base_mine_duration" = 16000
mod("MovementSpeed", "INC", 30, 0, 0, { type = "GlobalEffect", effectType = "Buff" }), --"base_movement_velocity_+%" = 30
--"is_remote_mine" = ?
--"base_skill_is_mined" = ?
--"base_deal_no_damage" = ?
},
qualityMods = {
mod("AreaOfEffect", "INC", 1), --"base_skill_area_of_effect_+%" = 1
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = skill("manaCost", nil),
[3] = skill("duration", nil), --"base_skill_effect_duration"
},
levels = {
[1] = { 10, 6, 4, },
[2] = { 13, 6, 4.1, },
[3] = { 17, 7, 4.2, },
[4] = { 21, 7, 4.3, },
[5] = { 25, 8, 4.4, },
[6] = { 29, 8, 4.5, },
[7] = { 33, 9, 4.6, },
[8] = { 36, 9, 4.7, },
[9] = { 39, 9, 4.8, },
[10] = { 42, 10, 4.9, },
[11] = { 45, 10, 5, },
[12] = { 48, 10, 5.1, },
[13] = { 51, 10, 5.2, },
[14] = { 54, 11, 5.3, },
[15] = { 57, 11, 5.4, },
[16] = { 60, 11, 5.5, },
[17] = { 63, 12, 5.6, },
[18] = { 66, 12, 5.7, },
[19] = { 68, 12, 5.8, },
[20] = { 70, 13, 5.9, },
[21] = { 72, 13, 6, },
[22] = { 74, 13, 6.1, },
[23] = { 76, 14, 6.2, },
[24] = { 78, 14, 6.3, },
[25] = { 80, 14, 6.4, },
[26] = { 82, 14, 6.5, },
[27] = { 84, 14, 6.6, },
[28] = { 86, 14, 6.7, },
[29] = { 88, 15, 6.8, },
[30] = { 90, 15, 6.9, },
},
}
skills["ThrownShield"] = {
name = "Spectral Shield Throw",
gemTags = {
projectile = true,
dexterity = true,
active_skill = true,
attack = true,
},
gemTagString = "Projectile, Attack",
gemStr = 40,
gemDex = 60,
gemInt = 0,
color = 2,
description = "Throws a spectral copy of your shield as a projectile which cannot pierce, and deals off-hand damage augmented by the defences of the shield. When it collides with something it will shatter, launching a number of smaller shards as projectiles in all directions. Modifiers that cause additional projectiles to be fired will add more shards, not more copies of the shield.",
skillTypes = { [1] = true, [48] = true, [3] = true, [68] = true, [71] = true, },
parts = {
{
name = "Shield",
},
{
name = "Shards",
},
},
baseFlags = {
attack = true,
projectile = true,
shieldAttack = true,
},
baseMods = {
skill("castTime", 1),
mod("PhysicalMin", "BASE", 2, 0, 0, { type = "Condition", var = "OffHandAttack" }, { type = "PerStat", statList = { "ArmourOnWeapon 2", "EvasionOnWeapon 2" }, div = 15 }), --"off_hand_minimum_added_physical_damage_per_15_shield_armour_and_evasion_rating" = 2
mod("PhysicalMax", "BASE", 3, 0, 0, { type = "Condition", var = "OffHandAttack" }, { type = "PerStat", statList = { "ArmourOnWeapon 2", "EvasionOnWeapon 2" }, div = 15 }), --"off_hand_maximum_added_physical_damage_per_15_shield_armour_and_evasion_rating" = 3
mod("ProjectileCount", "BASE", 8), --"number_of_additional_projectiles" = 8
mod("Damage", "MORE", -25, 0, 0, { type = "SkillPart", skillPart = 2 }), --"thrown_shield_secondary_projectile_damage_+%_final" = -25
mod("CritChance", "BASE", 0.1, 0, 0, { type = "PerStat", stat = "EnergyShieldOnWeapon 2", div = 10 }), --"additional_critical_strike_chance_per_10_shield_maximum_energy_shield_permyriad" = 10
--"base_is_projectile" = ?
--"thrown_shield_projectile_fire_random_directions" = ?
skill("setOffHandBaseCritChance", 5), --"override_off_hand_base_critical_strike_chance_to_5%" = ?
},
qualityMods = {
mod("Damage", "INC", 1, ModFlag.Projectile), --"projectile_damage_+%" = 1
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = skill("manaCost", nil),
[3] = skill("setOffHandPhysicalMin", nil), --"off_hand_local_minimum_added_physical_damage"
[4] = skill("setOffHandPhysicalMax", nil), --"off_hand_local_maximum_added_physical_damage"
[5] = skill("setOffHandAttackTime", nil), --"off_hand_base_weapon_attack_duration_ms"
},
levels = {
[1] = { 12, 7, 13, 19, 700, },
[2] = { 15, 7, 16, 23, 700, },
[3] = { 19, 7, 19, 29, 690, },
[4] = { 23, 7, 24, 36, 690, },
[5] = { 27, 7, 29, 43, 680, },
[6] = { 31, 7, 34, 51, 680, },
[7] = { 35, 8, 40, 60, 670, },
[8] = { 38, 8, 45, 67, 670, },
[9] = { 41, 8, 50, 76, 660, },
[10] = { 44, 8, 56, 84, 660, },
[11] = { 47, 8, 63, 94, 650, },
[12] = { 50, 8, 70, 104, 650, },
[13] = { 53, 9, 77, 115, 640, },
[14] = { 56, 9, 85, 128, 640, },
[15] = { 59, 9, 94, 141, 630, },
[16] = { 62, 9, 103, 155, 630, },
[17] = { 64, 9, 110, 165, 620, },
[18] = { 66, 9, 117, 175, 620, },
[19] = { 68, 10, 124, 186, 610, },
[20] = { 70, 10, 132, 198, 610, },
[21] = { 72, 10, 140, 210, 610, },
[22] = { 74, 10, 149, 223, 600, },
[23] = { 76, 10, 158, 237, 600, },
[24] = { 78, 10, 167, 251, 590, },
[25] = { 80, 11, 177, 266, 590, },
[26] = { 82, 11, 188, 282, 580, },
[27] = { 84, 11, 199, 298, 580, },
[28] = { 86, 11, 210, 315, 580, },
[29] = { 88, 11, 222, 334, 570, },
[30] = { 90, 11, 235, 353, 570, },
},
}
skills["ThrownWeapon"] = {
name = "Spectral Throw",
gemTags = {
projectile = true,
dexterity = true,
active_skill = true,
attack = true,
},
gemTagString = "Projectile, Attack",
gemStr = 40,
gemDex = 60,
gemInt = 0,
color = 2,
description = "Throws a spectral copy of your melee weapon. It flies out and then returns to you, in a spinning attack that strikes enemies in its path.",
skillTypes = { [1] = true, [48] = true, [3] = true, [68] = true, },
weaponTypes = {
["One Handed Mace"] = true,
["Sceptre"] = true,
["Thrusting One Handed Sword"] = true,
["Two Handed Sword"] = true,
["Dagger"] = true,
["Staff"] = true,
["Two Handed Axe"] = true,
["Two Handed Mace"] = true,
["One Handed Axe"] = true,
["Claw"] = true,
["One Handed Sword"] = true,
},
baseFlags = {
attack = true,
projectile = true,
},
baseMods = {
skill("castTime", 1),
--"base_is_projectile" = ?
mod("PierceChance", "BASE", 100),
},
qualityMods = {
mod("Speed", "INC", 0.5, ModFlag.Attack, 0, nil), --"attack_speed_+%" = 0.5
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = skill("manaCost", nil),
[3] = skill("damageEffectiveness", nil),
[4] = skill("baseMultiplier", nil),
},
levels = {
[1] = { 1, 7, 0.54, 0.54, },
[2] = { 2, 7, 0.56, 0.56, },
[3] = { 4, 7, 0.58, 0.579, },
[4] = { 7, 7, 0.6, 0.598, },
[5] = { 11, 7, 0.62, 0.617, },
[6] = { 16, 7, 0.64, 0.636, },
[7] = { 20, 7, 0.66, 0.656, },
[8] = { 24, 7, 0.67, 0.675, },
[9] = { 28, 7, 0.69, 0.694, },
[10] = { 32, 7, 0.71, 0.713, },
[11] = { 36, 8, 0.73, 0.732, },
[12] = { 40, 8, 0.75, 0.752, },
[13] = { 44, 8, 0.77, 0.771, },
[14] = { 48, 8, 0.79, 0.79, },
[15] = { 52, 8, 0.81, 0.809, },
[16] = { 56, 9, 0.83, 0.828, },
[17] = { 60, 9, 0.85, 0.848, },
[18] = { 64, 9, 0.87, 0.867, },
[19] = { 67, 9, 0.89, 0.886, },
[20] = { 70, 9, 0.9, 0.905, },
[21] = { 72, 10, 0.92, 0.924, },
[22] = { 74, 10, 0.94, 0.944, },
[23] = { 76, 10, 0.96, 0.963, },
[24] = { 78, 10, 0.98, 0.982, },
[25] = { 80, 10, nil, nil, },
[26] = { 82, 10, 1.02, 1.02, },
[27] = { 84, 10, 1.04, 1.039, },
[28] = { 86, 10, 1.06, 1.058, },
[29] = { 88, 10, 1.08, 1.077, },
[30] = { 90, 10, 1.1, 1.096, },
},
}
skills["VaalThrownWeapon"] = {
name = "Vaal Spectral Throw",
gemTags = {
projectile = true,
dexterity = true,
active_skill = true,
vaal = true,
attack = true,
},
gemTagString = "Projectile, Vaal, Attack",
gemStr = 40,
gemDex = 60,
gemInt = 0,
color = 2,
description = "Throws a spectral copy of your melee weapon. It spirals out in a spinning attack that strikes enemies in its path.",
skillTypes = { [1] = true, [48] = true, [3] = true, [68] = true, [43] = true, },
weaponTypes = {
["One Handed Mace"] = true,
["Sceptre"] = true,
["Thrusting One Handed Sword"] = true,
["Two Handed Sword"] = true,
["Dagger"] = true,
["Staff"] = true,
["Two Handed Axe"] = true,
["Two Handed Mace"] = true,
["One Handed Axe"] = true,
["Claw"] = true,
["One Handed Sword"] = true,
},
baseFlags = {
attack = true,
projectile = true,
vaal = true,
},
baseMods = {
skill("castTime", 1),
--"projectiles_nova" = ?
--"base_is_projectile" = ?
skill("cannotBeEvaded", true), --"global_always_hit" = ?
--"projectiles_not_offset" = ?
},
qualityMods = {
mod("Speed", "INC", 0.5, ModFlag.Attack, 0, nil), --"attack_speed_+%" = 0.5
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = skill("damageEffectiveness", nil),
[3] = skill("baseMultiplier", nil),
},
levels = {
[1] = { 1, 0.7, 0.7, },
[2] = { 2, 0.72, 0.718, },
[3] = { 4, 0.74, 0.736, },
[4] = { 7, 0.75, 0.754, },
[5] = { 11, 0.77, 0.772, },
[6] = { 16, 0.79, 0.79, },
[7] = { 20, 0.81, 0.808, },
[8] = { 24, 0.83, 0.826, },
[9] = { 28, 0.84, 0.844, },
[10] = { 32, 0.86, 0.862, },
[11] = { 36, 0.88, 0.88, },
[12] = { 40, 0.9, 0.898, },
[13] = { 44, 0.92, 0.916, },
[14] = { 48, 0.93, 0.934, },
[15] = { 52, 0.95, 0.952, },
[16] = { 56, 0.97, 0.97, },
[17] = { 60, 0.99, 0.988, },
[18] = { 64, 1.01, 1.006, },
[19] = { 67, 1.02, 1.024, },
[20] = { 70, 1.04, 1.042, },
[21] = { 72, 1.06, 1.06, },
[22] = { 74, 1.08, 1.078, },
[23] = { 76, 1.1, 1.096, },
[24] = { 78, 1.11, 1.114, },
[25] = { 80, 1.13, 1.132, },
[26] = { 82, 1.15, 1.15, },
[27] = { 84, 1.17, 1.168, },
[28] = { 86, 1.19, 1.186, },
[29] = { 88, 1.2, 1.204, },
[30] = { 90, 1.22, 1.222, },
},
}
skills["SplitArrow"] = {
name = "Split Arrow",
gemTags = {
dexterity = true,
active_skill = true,
attack = true,
bow = true,
},
gemTagString = "Attack, Bow",
gemStr = 0,
gemDex = 100,
gemInt = 0,
color = 2,
description = "Fires multiple arrows at different targets.",
skillTypes = { [1] = true, [48] = true, [69] = true, [3] = true, [68] = true, [22] = true, [17] = true, [19] = true, },
weaponTypes = {
["Bow"] = true,
},
baseFlags = {
attack = true,
projectile = true,
},
baseMods = {
skill("castTime", 1),
--"skill_can_fire_arrows" = ?
},
qualityMods = {
mod("Speed", "INC", 0.5, ModFlag.Attack, 0, nil), --"attack_speed_+%" = 0.5
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = skill("manaCost", nil),
[3] = skill("damageEffectiveness", nil),
[4] = skill("baseMultiplier", nil),
[5] = mod("ProjectileCount", "BASE", nil), --"base_number_of_additional_arrows"
},
levels = {
[1] = { 1, 6, 0.9, 0.9, 4, },
[2] = { 2, 6, 0.91, 0.91, 4, },
[3] = { 4, 6, 0.92, 0.92, 4, },
[4] = { 7, 7, 0.93, 0.93, 4, },
[5] = { 11, 7, 0.94, 0.94, 4, },
[6] = { 16, 7, 0.95, 0.95, 4, },
[7] = { 20, 7, 0.96, 0.96, 4, },
[8] = { 24, 8, 0.97, 0.97, 5, },
[9] = { 28, 8, 0.98, 0.98, 5, },
[10] = { 32, 8, 0.99, 0.99, 5, },
[11] = { 36, 8, nil, nil, 5, },
[12] = { 40, 8, 1.01, 1.01, 5, },
[13] = { 44, 9, 1.02, 1.02, 5, },
[14] = { 48, 9, 1.03, 1.03, 5, },
[15] = { 52, 9, 1.04, 1.04, 6, },
[16] = { 56, 9, 1.05, 1.05, 6, },
[17] = { 60, 9, 1.06, 1.06, 6, },
[18] = { 64, 10, 1.07, 1.07, 6, },
[19] = { 67, 10, 1.08, 1.08, 6, },
[20] = { 70, 10, 1.09, 1.09, 6, },
[21] = { 72, 10, 1.1, 1.1, 6, },
[22] = { 74, 10, 1.11, 1.11, 7, },
[23] = { 76, 11, 1.12, 1.12, 7, },
[24] = { 78, 11, 1.13, 1.13, 7, },
[25] = { 80, 11, 1.14, 1.14, 7, },
[26] = { 82, 11, 1.15, 1.15, 7, },
[27] = { 84, 11, 1.16, 1.16, 7, },
[28] = { 86, 12, 1.17, 1.17, 7, },
[29] = { 88, 12, 1.18, 1.18, 8, },
[30] = { 90, 12, 1.19, 1.19, 8, },
},
}
skills["SummonIceGolem"] = {
name = "Summon Ice Golem",
gemTags = {
dexterity = true,
active_skill = true,
cold = true,
minion = true,
spell = true,
golem = true,
},
gemTagString = "Cold, Minion, Spell, Golem",
gemStr = 0,
gemDex = 60,
gemInt = 40,
color = 2,
description = "Summons an Ice Golem that grants you increased Critical Strike Chance and Accuracy. The Ice Golem can use an icy barrage spell and a chilling spinning dash in addition to its melee attack.",
skillTypes = { [36] = true, [34] = true, [19] = true, [9] = true, [21] = true, [26] = true, [2] = true, [18] = true, [17] = true, [49] = true, [60] = true, [62] = true, },
minionSkillTypes = { [1] = true, [24] = true, [25] = true, [3] = true, [68] = true, [2] = true, [10] = true, [38] = true, [28] = true, },
minionList = {
"SummonedIceGolem",
},
baseFlags = {
spell = true,
minion = true,
golem = true,
cold = true,
},
baseMods = {
skill("castTime", 1),
skill("cooldown", 6),
mod("ActiveGolemLimit", "BASE", 1), --"base_number_of_golems_allowed" = 1
--"display_minion_monster_type" = 6
skill("allowTotemBuff", true),
flag("Condition:HaveColdGolem", { type = "GlobalEffect", effectType = "Buff" }),
},
qualityMods = {
mod("MinionModifier", "LIST", { mod = mod("Life", "INC", 1) }), --"minion_maximum_life_+%" = 1
mod("MinionModifier", "LIST", { mod = mod("Damage", "INC", 1) }), --"minion_damage_+%" = 1
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = skill("manaCost", nil),
--[3] = "base_actor_scale_+%"
[4] = mod("CritChance", "INC", nil, 0, 0, { type = "GlobalEffect", effectType = "Buff" }), --"ice_golem_grants_critical_strike_chance_+%"
[5] = mod("Accuracy", "INC", nil, 0, 0, { type = "GlobalEffect", effectType = "Buff" }), --"ice_golem_grants_accuracy_+%"
[6] = mod("MinionModifier", "LIST", { mod = mod("Life", "INC", nil) }), --"minion_maximum_life_+%"
[7] = skill("minionLevel", nil), --"display_minion_monster_level"
},
levels = {
[1] = { 34, 30, 0, 20, 20, 30, 34, },
[2] = { 36, 32, 1, 21, 21, 32, 36, },
[3] = { 38, 34, 1, 21, 21, 34, 38, },
[4] = { 40, 36, 2, 22, 22, 36, 40, },
[5] = { 42, 38, 2, 22, 22, 38, 42, },
[6] = { 44, 40, 3, 23, 23, 40, 44, },
[7] = { 46, 42, 3, 23, 23, 42, 46, },
[8] = { 48, 44, 4, 24, 24, 44, 48, },
[9] = { 50, 44, 4, 24, 24, 46, 50, },
[10] = { 52, 46, 5, 25, 25, 48, 52, },
[11] = { 54, 48, 5, 25, 25, 50, 54, },
[12] = { 56, 48, 6, 26, 26, 52, 56, },
[13] = { 58, 50, 6, 26, 26, 54, 58, },
[14] = { 60, 50, 7, 27, 27, 56, 60, },
[15] = { 62, 52, 7, 27, 27, 58, 62, },
[16] = { 64, 52, 8, 28, 28, 60, 64, },
[17] = { 66, 52, 8, 28, 28, 62, 66, },
[18] = { 68, 52, 9, 29, 29, 64, 68, },
[19] = { 69, 54, 9, 29, 29, 66, 69, },
[20] = { 70, 54, 10, 30, 30, 68, 70, },
[21] = { 72, 56, 10, 30, 30, 70, 72, },
[22] = { 74, 56, 11, 31, 31, 72, 74, },
[23] = { 76, 58, 11, 31, 31, 74, 76, },
[24] = { 78, 58, 12, 32, 32, 76, 78, },
[25] = { 80, 60, 12, 32, 32, 78, 80, },
[26] = { 82, 60, 13, 33, 33, 80, 82, },
[27] = { 84, 60, 13, 33, 33, 82, 84, },
[28] = { 86, 60, 14, 34, 34, 84, 86, },
[29] = { 88, 62, 14, 34, 34, 86, 88, },
[30] = { 90, 62, 15, 35, 35, 88, 90, },
},
}
skills["TemporalChains"] = {
name = "Temporal Chains",
gemTags = {
curse = true,
dexterity = true,
active_skill = true,
spell = true,
area = true,
duration = true,
},
gemTagString = "Curse, Spell, AoE, Duration",
gemStr = 0,
gemDex = 60,
gemInt = 40,
color = 2,
description = "Curses all targets in an area, Slowing them, and making effects on them expire more slowly.",
skillTypes = { [2] = true, [11] = true, [12] = true, [17] = true, [18] = true, [19] = true, [26] = true, [32] = true, [36] = true, [67] = true, },
baseFlags = {
spell = true,
curse = true,
area = true,
duration = true,
},
baseMods = {
skill("castTime", 0.5),
mod("BuffExpireFaster", "MORE", -40, 0, 0, { type = "GlobalEffect", effectType = "Curse" }), --"buff_time_passed_-%" = 40
mod("CurseEffectAgainstPlayer", "INC", -40), --"curse_effect_+%_vs_players" = -40
--"base_deal_no_damage" = ?
skill("debuff", true),
skill("radius", 22),
},
qualityMods = {
mod("TemporalChainsActionSpeed", "INC", -0.5, 0, 0, { type = "GlobalEffect", effectType = "Curse" }), --"temporal_chains_action_speed_+%_final" = -0.5
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = skill("manaCost", nil),
[3] = skill("duration", nil), --"base_skill_effect_duration"
[4] = skill("radiusExtra", nil), --"active_skill_base_radius_+"
[5] = mod("TemporalChainsActionSpeed", "INC", nil, 0, 0, { type = "GlobalEffect", effectType = "Curse" }), --"temporal_chains_action_speed_+%_final"
},
levels = {
[1] = { 24, 24, 5, 0, -20, },
[2] = { 27, 26, 5.05, 1, -20, },
[3] = { 30, 27, 5.1, 1, -21, },
[4] = { 33, 29, 5.15, 1, -21, },
[5] = { 36, 30, 5.2, 2, -22, },
[6] = { 39, 32, 5.25, 2, -22, },
[7] = { 42, 34, 5.3, 2, -23, },
[8] = { 45, 35, 5.35, 3, -23, },
[9] = { 48, 37, 5.4, 3, -24, },
[10] = { 50, 38, 5.45, 3, -24, },
[11] = { 52, 39, 5.5, 4, -25, },
[12] = { 54, 40, 5.55, 4, -25, },
[13] = { 56, 42, 5.6, 4, -26, },
[14] = { 58, 43, 5.65, 5, -26, },
[15] = { 60, 44, 5.7, 5, -27, },
[16] = { 62, 45, 5.75, 5, -27, },
[17] = { 64, 46, 5.8, 6, -28, },
[18] = { 66, 47, 5.85, 6, -28, },
[19] = { 68, 48, 5.9, 6, -29, },
[20] = { 70, 50, 5.95, 7, -29, },
[21] = { 72, 51, 6, 7, -30, },
[22] = { 74, 52, 6.05, 7, -30, },
[23] = { 76, 53, 6.1, 8, -31, },
[24] = { 78, 54, 6.15, 8, -31, },
[25] = { 80, 56, 6.2, 8, -32, },
[26] = { 82, 57, 6.25, 9, -32, },
[27] = { 84, 58, 6.3, 9, -33, },
[28] = { 86, 59, 6.35, 9, -33, },
[29] = { 88, 60, 6.4, 10, -34, },
[30] = { 90, 61, 6.45, 10, -34, },
},
}
skills["TornadoShot"] = {
name = "Tornado Shot",
gemTags = {
dexterity = true,
active_skill = true,
attack = true,
bow = true,
},
gemTagString = "Attack, Bow",
gemStr = 0,
gemDex = 100,
gemInt = 0,
color = 2,
description = "Fires a piercing shot that travels until it reaches the targeted location. It will then fire projectiles out in all directions from that point.",
skillTypes = { [1] = true, [3] = true, [68] = true, [17] = true, [19] = true, [22] = true, [48] = true, [69] = true, },
weaponTypes = {
["Bow"] = true,
},
baseFlags = {
attack = true,
projectile = true,
},
baseMods = {
skill("castTime", 1),
--"tornado_shot_num_of_secondary_projectiles" = 3
--"base_is_projectile" = ?
--"skill_can_fire_arrows" = ?
},
qualityMods = {
mod("Damage", "INC", 1, ModFlag.Projectile), --"projectile_damage_+%" = 1
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = skill("manaCost", nil),
[3] = skill("damageEffectiveness", nil),
[4] = skill("baseMultiplier", nil),
},
levels = {
[1] = { 28, 8, 0.9, 0.9, },
[2] = { 31, 8, 0.91, 0.91, },
[3] = { 34, 8, 0.92, 0.92, },
[4] = { 37, 8, 0.93, 0.93, },
[5] = { 40, 9, 0.94, 0.94, },
[6] = { 42, 9, 0.95, 0.95, },
[7] = { 44, 9, 0.96, 0.96, },
[8] = { 46, 9, 0.97, 0.97, },
[9] = { 48, 9, 0.98, 0.98, },
[10] = { 50, 9, 0.99, 0.99, },
[11] = { 52, 9, nil, nil, },
[12] = { 54, 10, 1.01, 1.01, },
[13] = { 56, 10, 1.02, 1.02, },
[14] = { 58, 10, 1.03, 1.03, },
[15] = { 60, 10, 1.04, 1.04, },
[16] = { 62, 10, 1.05, 1.05, },
[17] = { 64, 10, 1.06, 1.06, },
[18] = { 66, 10, 1.07, 1.07, },
[19] = { 68, 10, 1.08, 1.08, },
[20] = { 70, 10, 1.09, 1.09, },
[21] = { 72, 10, 1.1, 1.1, },
[22] = { 74, 10, 1.11, 1.11, },
[23] = { 76, 11, 1.12, 1.12, },
[24] = { 78, 11, 1.13, 1.13, },
[25] = { 80, 11, 1.14, 1.14, },
[26] = { 82, 11, 1.15, 1.15, },
[27] = { 84, 11, 1.16, 1.16, },
[28] = { 86, 12, 1.17, 1.17, },
[29] = { 88, 12, 1.18, 1.18, },
[30] = { 90, 12, 1.19, 1.19, },
},
}
skills["BoneLance"] = {
name = "Unearth",
gemTags = {
projectile = true,
dexterity = true,
active_skill = true,
spell = true,
},
gemTagString = "Projectile, Spell",
gemStr = 0,
gemDex = 60,
gemInt = 40,
color = 2,
description = "Fires a projectile that will pierce through enemies to impact the ground at the targeted location, creating a Bone Archer corpse where it lands.",
skillTypes = { [2] = true, [3] = true, [68] = true, [18] = true, [19] = true, [17] = true, [36] = true, [10] = true, [26] = true, },
baseFlags = {
spell = true,
projectile = true,
},
baseMods = {
skill("castTime", 0.6),
skill("damageEffectiveness", 1.2),
skill("CritChance", 6),
--"desecrate_maximum_number_of_corpses" = 10
--"base_is_projectile" = ?
flag("PierceAllTargets"), --"always_pierce" = ?
},
qualityMods = {
mod("Speed", "INC", 0.5, ModFlag.Cast), --"base_cast_speed_+%" = 0.5
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = skill("manaCost", nil),
[3] = skill("PhysicalMin", nil), --"spell_minimum_base_physical_damage"
[4] = skill("PhysicalMax", nil), --"spell_maximum_base_physical_damage"
--[5] = "unearth_base_corpse_level"
},
levels = {
[1] = { 10, 8, 13, 19, 12, },
[2] = { 13, 8, 17, 25, 15, },
[3] = { 17, 9, 23, 35, 19, },
[4] = { 21, 10, 31, 46, 24, },
[5] = { 25, 11, 41, 61, 28, },
[6] = { 29, 11, 53, 80, 32, },
[7] = { 33, 12, 69, 103, 37, },
[8] = { 36, 13, 82, 124, 40, },
[9] = { 39, 14, 99, 148, 43, },
[10] = { 42, 15, 118, 177, 47, },
[11] = { 45, 16, 140, 210, 50, },
[12] = { 48, 17, 166, 249, 53, },
[13] = { 51, 18, 196, 295, 57, },
[14] = { 54, 19, 232, 347, 60, },
[15] = { 57, 20, 272, 409, 64, },
[16] = { 60, 20, 320, 480, 67, },
[17] = { 63, 21, 375, 563, 71, },
[18] = { 66, 22, 439, 658, 74, },
[19] = { 68, 23, 487, 731, 77, },
[20] = { 70, 23, 540, 810, 80, },
[21] = { 72, 23, 598, 898, 81, },
[22] = { 74, 24, 663, 994, 82, },
[23] = { 76, 25, 733, 1100, 83, },
[24] = { 78, 26, 811, 1217, 84, },
[25] = { 80, 26, 897, 1345, 85, },
[26] = { 82, 26, 991, 1487, 86, },
[27] = { 84, 27, 1095, 1642, 87, },
[28] = { 86, 28, 1209, 1813, 88, },
[29] = { 88, 29, 1334, 2001, 89, },
[30] = { 90, 29, 1471, 2207, 90, },
},
}
skills["ViperStrike"] = {
name = "Viper Strike",
gemTags = {
dexterity = true,
active_skill = true,
attack = true,
duration = true,
melee = true,
chaos = true,
},
gemTagString = "Attack, Duration, Melee, Chaos",
gemStr = 0,
gemDex = 100,
gemInt = 0,
color = 2,
description = "Hits the enemy, adding some of your physical damage as chaos damage and applying poison. Requires a claw, dagger or sword.",
skillTypes = { [1] = true, [12] = true, [28] = true, [24] = true, [25] = true, [40] = true, [50] = true, },
weaponTypes = {
["Claw"] = true,
["Thrusting One Handed Sword"] = true,
["Two Handed Sword"] = true,
["Dagger"] = true,
["One Handed Sword"] = true,
},
baseFlags = {
attack = true,
melee = true,
duration = true,
chaos = true,
},
baseMods = {
skill("castTime", 1),
skill("manaCost", 5),
mod("SkillPhysicalDamageConvertToChaos", "BASE", 25), --"skill_physical_damage_%_to_convert_to_chaos" = 25
mod("PoisonChance", "BASE", 60), --"base_chance_to_poison_on_hit_%" = 60
skill("duration", 4), --"base_skill_effect_duration" = 4000
skill("poisonDurationIsSkillDuration", true), --"poison_duration_is_skill_duration" = ?
skill("poisonIsSkillEffect", true),
},
qualityMods = {
mod("Speed", "INC", 0.5, ModFlag.Attack, 0, nil), --"attack_speed_+%" = 0.5
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = skill("damageEffectiveness", nil),
[3] = skill("baseMultiplier", nil),
},
levels = {
[1] = { 1, 1.15, 1.15, },
[2] = { 2, 1.16, 1.164, },
[3] = { 4, 1.18, 1.178, },
[4] = { 7, 1.19, 1.192, },
[5] = { 11, 1.21, 1.206, },
[6] = { 16, 1.22, 1.22, },
[7] = { 20, 1.23, 1.234, },
[8] = { 24, 1.25, 1.248, },
[9] = { 28, 1.26, 1.262, },
[10] = { 32, 1.28, 1.276, },
[11] = { 36, 1.29, 1.29, },
[12] = { 40, 1.3, 1.304, },
[13] = { 44, 1.32, 1.318, },
[14] = { 48, 1.33, 1.332, },
[15] = { 52, 1.35, 1.346, },
[16] = { 56, 1.36, 1.36, },
[17] = { 60, 1.37, 1.374, },
[18] = { 64, 1.39, 1.388, },
[19] = { 67, 1.4, 1.402, },
[20] = { 70, 1.42, 1.416, },
[21] = { 72, 1.43, 1.43, },
[22] = { 74, 1.44, 1.444, },
[23] = { 76, 1.46, 1.458, },
[24] = { 78, 1.47, 1.472, },
[25] = { 80, 1.49, 1.486, },
[26] = { 82, 1.5, 1.5, },
[27] = { 84, 1.51, 1.514, },
[28] = { 86, 1.53, 1.528, },
[29] = { 88, 1.54, 1.542, },
[30] = { 90, 1.56, 1.556, },
},
}
skills["VolatileDead"] = {
name = "Volatile Dead",
gemTags = {
dexterity = true,
active_skill = true,
spell = true,
area = true,
fire = true,
},
gemTagString = "Spell, AoE, Fire",
gemStr = 0,
gemDex = 60,
gemInt = 40,
color = 2,
description = "Corpses near the targeted location explode, dealing damage in a small area and creating an orb which moves towards nearby enemies before dealing spell damage in a larger area. The explosion of the corpse is not affected by modifiers to spell damage, and cannot be reflected.",
skillTypes = { [2] = true, [10] = true, [11] = true, [17] = true, [18] = true, [19] = true, [26] = true, [36] = true, [33] = true, [67] = true, },
parts = {
{
name = "Spell",
spell = true,
cast = false,
},
{
name = "Corpse Explosion",
spell = false,
cast = true,
},
},
baseFlags = {
spell = true,
area = true,
fire = true,
},
baseMods = {
skill("castTime", 0.8),
skill("damageEffectiveness", 1.2),
skill("CritChance", 5),
--"volatile_dead_base_number_of_corpses_to_consume" = 3
skill("corpseExplosionLifeMultiplier", 0.03), --"corpse_explosion_monster_life_%" = 3
--"is_area_damage" = ?
skill("showAverage", true), --"base_skill_show_average_damage_instead_of_dps" = ?
skill("explodeCorpse", true, { type = "SkillPart", skillPart = 2 }),
},
qualityMods = {
mod("AreaOfEffect", "INC", 0.5), --"base_skill_area_of_effect_+%" = 0.5
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = skill("manaCost", nil),
[3] = skill("FireMin", nil), --"spell_minimum_base_fire_damage"
[4] = skill("FireMax", nil), --"spell_maximum_base_fire_damage"
},
levels = {
[1] = { 12, 10, 20, 30, },
[2] = { 15, 11, 25, 38, },
[3] = { 19, 13, 33, 50, },
[4] = { 23, 14, 44, 65, },
[5] = { 27, 16, 56, 84, },
[6] = { 31, 17, 71, 107, },
[7] = { 35, 19, 90, 135, },
[8] = { 38, 20, 107, 160, },
[9] = { 41, 21, 126, 188, },
[10] = { 44, 22, 147, 221, },
[11] = { 47, 23, 173, 259, },
[12] = { 50, 24, 201, 302, },
[13] = { 53, 25, 235, 352, },
[14] = { 56, 26, 272, 409, },
[15] = { 59, 27, 316, 474, },
[16] = { 62, 28, 365, 548, },
[17] = { 64, 29, 402, 604, },
[18] = { 66, 30, 443, 664, },
[19] = { 68, 30, 487, 730, },
[20] = { 70, 31, 535, 802, },
[21] = { 72, 32, 587, 881, },
[22] = { 74, 33, 645, 967, },
[23] = { 76, 34, 707, 1060, },
[24] = { 78, 34, 775, 1163, },
[25] = { 80, 34, 849, 1274, },
[26] = { 82, 34, 930, 1395, },
[27] = { 84, 35, 1018, 1527, },
[28] = { 86, 35, 1114, 1670, },
[29] = { 88, 35, 1218, 1827, },
[30] = { 90, 35, 1331, 1997, },
},
}
skills["WhirlingBlades"] = {
name = "Whirling Blades",
gemTags = {
dexterity = true,
active_skill = true,
attack = true,
movement = true,
melee = true,
},
gemTagString = "Attack, Movement, Melee",
gemStr = 0,
gemDex = 60,
gemInt = 40,
color = 2,
description = "Dive through enemies, dealing weapon damage. Only works with daggers, claws and one handed swords. Cannot be supported by Multistrike.",
skillTypes = { [1] = true, [24] = true, [38] = true, },
weaponTypes = {
["Thrusting One Handed Sword"] = true,
["Claw"] = true,
["Dagger"] = true,
["One Handed Sword"] = true,
},
baseFlags = {
attack = true,
melee = true,
movement = true,
},
baseMods = {
skill("castTime", 2.6),
skill("manaCost", 15),
--"ignores_proximity_shield" = ?
skill("showAverage", true), --"base_skill_show_average_damage_instead_of_dps" = ?
skill("castTimeOverridesAttackTime", true), --"cast_time_overrides_attack_duration" = ?
},
qualityMods = {
mod("Speed", "INC", 0.5, ModFlag.Attack, 0, nil), --"attack_speed_+%" = 0.5
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = skill("damageEffectiveness", nil),
[3] = skill("baseMultiplier", nil),
},
levels = {
[1] = { 10, 0.8, 0.8, },
[2] = { 13, 0.81, 0.81, },
[3] = { 17, 0.82, 0.82, },
[4] = { 21, 0.83, 0.83, },
[5] = { 25, 0.84, 0.84, },
[6] = { 29, 0.85, 0.85, },
[7] = { 33, 0.86, 0.86, },
[8] = { 36, 0.87, 0.87, },
[9] = { 39, 0.88, 0.88, },
[10] = { 42, 0.89, 0.89, },
[11] = { 45, 0.9, 0.9, },
[12] = { 48, 0.91, 0.91, },
[13] = { 51, 0.92, 0.92, },
[14] = { 54, 0.93, 0.93, },
[15] = { 57, 0.94, 0.94, },
[16] = { 60, 0.95, 0.95, },
[17] = { 63, 0.96, 0.96, },
[18] = { 66, 0.97, 0.97, },
[19] = { 68, 0.98, 0.98, },
[20] = { 70, 0.99, 0.99, },
[21] = { 72, nil, nil, },
[22] = { 74, 1.01, 1.01, },
[23] = { 76, 1.02, 1.02, },
[24] = { 78, 1.03, 1.03, },
[25] = { 80, 1.04, 1.04, },
[26] = { 82, 1.05, 1.05, },
[27] = { 84, 1.06, 1.06, },
[28] = { 86, 1.07, 1.07, },
[29] = { 88, 1.08, 1.08, },
[30] = { 90, 1.09, 1.09, },
},
}
skills["WildStrike"] = {
name = "Wild Strike",
gemTags = {
projectile = true,
dexterity = true,
active_skill = true,
attack = true,
melee = true,
lightning = true,
cold = true,
fire = true,
area = true,
chaining = true,
},
gemTagString = "Projectile, Attack, Melee, Lightning, Cold, Fire, AoE, Chaining",
gemStr = 40,
gemDex = 60,
gemInt = 0,
color = 2,
description = "Your melee weapon strikes an enemy, converting physical damage to a random element. Then, depending on the element chosen, it releases a fiery explosion, an arcing bolt of lightning, or an icy wave.",
skillTypes = { [1] = true, [25] = true, [28] = true, [24] = true, [35] = true, [34] = true, [33] = true, [3] = true, [11] = true, [23] = true, [48] = true, },
weaponTypes = {
["One Handed Mace"] = true,
["Sceptre"] = true,
["Thrusting One Handed Sword"] = true,
["Two Handed Sword"] = true,
["Dagger"] = true,
["Staff"] = true,
["Two Handed Axe"] = true,
["Two Handed Mace"] = true,
["One Handed Axe"] = true,
["Claw"] = true,
["One Handed Sword"] = true,
},
parts = {
{
name = "Fire hit",
melee = true,
projectile = false,
chaining = false,
area = false,
},
{
name = "Fire explosion",
melee = false,
projectile = false,
chaining = false,
area = true,
},
{
name = "Lightning hit",
melee = true,
projectile = false,
chaining = false,
area = false,
},
{
name = "Lightning bolt",
melee = false,
projectile = false,
chaining = true,
area = false,
},
{
name = "Cold hit",
melee = true,
projectile = false,
chaining = false,
area = false,
},
{
name = "Icy wave",
melee = false,
projectile = true,
chaining = false,
area = false,
},
},
baseFlags = {
attack = true,
melee = true,
projectile = true,
chaining = true,
area = true,
lightning = true,
cold = true,
fire = true,
},
baseMods = {
skill("castTime", 1),
skill("manaCost", 6),
--"elemental_strike_physical_damage_%_to_convert" = 100
--"fixed_projectile_spread" = 70
mod("ProjectileCount", "BASE", 2), --"number_of_additional_projectiles" = 2
--"show_number_of_projectiles" = ?
flag("PierceAllTargets"), --"always_pierce" = ?
mod("PhysicalDamageConvertToFire", "BASE", 100, 0, 0, { type = "SkillPart", skillPart = 1 }),
mod("PhysicalDamageConvertToFire", "BASE", 100, 0, 0, { type = "SkillPart", skillPart = 2 }),
mod("PhysicalDamageConvertToLightning", "BASE", 100, 0, 0, { type = "SkillPart", skillPart = 3 }),
mod("PhysicalDamageConvertToLightning", "BASE", 100, 0, 0, { type = "SkillPart", skillPart = 4 }),
mod("PhysicalDamageConvertToCold", "BASE", 100, 0, 0, { type = "SkillPart", skillPart = 5 }),
mod("PhysicalDamageConvertToCold", "BASE", 100, 0, 0, { type = "SkillPart", skillPart = 6 }),
},
qualityMods = {
mod("ElementalDamage", "INC", 1), --"elemental_damage_+%" = 1
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = skill("damageEffectiveness", nil),
[3] = skill("baseMultiplier", nil),
[4] = mod("ChainCountMax", "BASE", nil), --"number_of_additional_projectiles_in_chain"
[5] = mod("AreaOfEffect", "INC", nil), --"base_skill_area_of_effect_+%"
},
levels = {
[1] = { 28, 1.3, 1.3, 4, 0, },
[2] = { 31, 1.32, 1.324, 4, 1, },
[3] = { 34, 1.35, 1.348, 4, 2, },
[4] = { 37, 1.37, 1.372, 4, 3, },
[5] = { 40, 1.4, 1.396, 4, 4, },
[6] = { 42, 1.42, 1.42, 4, 5, },
[7] = { 44, 1.44, 1.444, 5, 6, },
[8] = { 46, 1.47, 1.468, 5, 7, },
[9] = { 48, 1.49, 1.492, 5, 8, },
[10] = { 50, 1.52, 1.516, 5, 9, },
[11] = { 52, 1.54, 1.54, 5, 10, },
[12] = { 54, 1.56, 1.564, 5, 11, },
[13] = { 56, 1.59, 1.588, 6, 12, },
[14] = { 58, 1.61, 1.612, 6, 13, },
[15] = { 60, 1.64, 1.636, 6, 14, },
[16] = { 62, 1.66, 1.66, 6, 15, },
[17] = { 64, 1.68, 1.684, 6, 16, },
[18] = { 66, 1.71, 1.708, 6, 17, },
[19] = { 68, 1.73, 1.732, 7, 18, },
[20] = { 70, 1.76, 1.756, 7, 19, },
[21] = { 72, 1.78, 1.78, 7, 20, },
[22] = { 74, 1.8, 1.804, 7, 21, },
[23] = { 76, 1.83, 1.828, 7, 22, },
[24] = { 78, 1.85, 1.852, 7, 23, },
[25] = { 80, 1.88, 1.876, 8, 24, },
[26] = { 82, 1.9, 1.9, 8, 25, },
[27] = { 84, 1.92, 1.924, 8, 26, },
[28] = { 86, 1.95, 1.948, 8, 27, },
[29] = { 88, 1.97, 1.972, 8, 28, },
[30] = { 90, 2, 1.996, 8, 29, },
},
}
skills["ExplosiveTrap"] = {
name = "Explosive Trap",
gemTags = {
trap = true,
dexterity = true,
active_skill = true,
spell = true,
area = true,
fire = true,
duration = true,
},
gemTagString = "Trap, Spell, AoE, Fire",
gemStr = 0,
gemDex = 98,
gemInt = 68,
color = 2,
description = "Throws a trap that creates a large explosion when triggered, dealing spell damage in an area. A number of smaller explosions occur around this area in quick succession after the first.",
skillTypes = { [2] = true, [10] = true, [19] = true, [11] = true, [37] = true, [33] = true, [12] = true, },
baseFlags = {
trap = true,
area = true,
fire = true,
spell = true,
},
parts = {
{
name = "Main blast",
},
{
name = "Main blast + 7 smaller",
},
},
baseMods = {
skill("castTime", 1),
skill("damageEffectiveness", .5),
skill("CritChance", 6),
mod("SkillPhysicalDamageConvertToFire", "BASE", 50),
mod("Damage", "MORE", 700, 0, bit.bor(KeywordFlag.Hit), { type = "SkillPart", skillPart = 2 }),
skill("showAverage", true),
--"no_movement_speed" = ?
--"traps_do_not_explode_on_timeout" = ?
},
qualityMods = {
mod("AreaOfEffect", "INC", .5),
},
levelMods = {
[1] = skill("levelRequirement", nil),
[2] = skill("manaCost", nil),
[3] = skill("PhysicalMin", nil), --"secondary_minimum_base_physical_damage"
[4] = skill("PhysicalMax", nil), --"secondary_maximum_base_physical_damage"
},
levels = {
[1] = { 70, 20, 217, 325, },
[2] = { 70, 20, 217, 325, },
[3] = { 70, 20, 217, 325, },
[4] = { 70, 20, 217, 325, },
[5] = { 70, 20, 217, 325, },
[6] = { 70, 20, 217, 325, },
[7] = { 70, 20, 217, 325, },
[8] = { 70, 20, 217, 325, },
[9] = { 70, 20, 217, 325, },
[10] = { 70, 20, 217, 325, },
[11] = { 70, 20, 217, 325, },
[12] = { 70, 20, 217, 325, },
[13] = { 70, 20, 217, 325, },
[14] = { 70, 20, 217, 325, },
[15] = { 70, 20, 217, 325, },
[16] = { 70, 20, 217, 325, },
[17] = { 70, 20, 217, 325, },
[18] = { 70, 20, 217, 325, },
[19] = { 70, 20, 217, 325, },
[20] = { 70, 20, 217, 325, },
[21] = { 70, 20, 217, 325, },
[22] = { 70, 20, 217, 325, },
[23] = { 70, 20, 217, 325, },
[24] = { 70, 20, 217, 325, },
[25] = { 70, 20, 217, 325, },
[26] = { 70, 20, 217, 325, },
[27] = { 70, 20, 217, 325, },
[28] = { 70, 20, 217, 325, },
[29] = { 70, 20, 217, 325, },
[30] = { 70, 20, 217, 325, },
},
}
|
Ryan.Entity = {
Type = {
All,
Ped,
Vehicle
},
GetAllNearby = function(coords, range, types)
types = types or Ryan.Entity.Type.All
local player_ped = Ryan.Player.GetPed()
local player_vehicle = PED.GET_VEHICLE_PED_IS_IN(player_ped)
local nearby_entities = {}
if types == Ryan.Entity.Type.Peds or types == Ryan.Entity.Type.All then
for _, ped in pairs(entities.get_all_peds_as_handles()) do
if ped ~= player_ped then
local ped_coords = ENTITY.GET_ENTITY_COORDS(ped)
if Ryan.Vector.Distance(coords, ped_coords) <= range then
table.insert(nearby_entities, ped)
end
end
end
end
if types == Ryan.Entity.Type.Vehicles or types == Ryan.Entity.Type.All then
for _, vehicle in pairs(entities.get_all_vehicles_as_handles()) do
if vehicle ~= player_vehicle then
local vehicle_coords = ENTITY.GET_ENTITY_COORDS(vehicle)
if Ryan.Vector.Distance(coords, vehicle_coords) <= range then
table.insert(nearby_entities, vehicle)
end
end
end
end
return nearby_entities
end,
RequestControl = function(entity)
if not NETWORK.NETWORK_HAS_CONTROL_OF_ENTITY(entity) then
local network_id = NETWORK.NETWORK_GET_NETWORK_ID_FROM_ENTITY(entity)
NETWORK.SET_NETWORK_ID_CAN_MIGRATE(network_id, true)
NETWORK.NETWORK_REQUEST_CONTROL_OF_ENTITY(entity)
end
return NETWORK.NETWORK_HAS_CONTROL_OF_ENTITY(entity)
end,
RequestControlLoop = function(entity)
local tick = 0
while not NETWORK.NETWORK_HAS_CONTROL_OF_ENTITY(entity) and tick < 25 do
util.yield()
NETWORK.NETWORK_REQUEST_CONTROL_OF_ENTITY(entity)
tick = tick + 1
end
if NETWORK.NETWORK_IS_SESSION_STARTED() then
local network_id = NETWORK.NETWORK_GET_NETWORK_ID_FROM_ENTITY(entity)
NETWORK.NETWORK_REQUEST_CONTROL_OF_ENTITY(entity)
NETWORK.SET_NETWORK_ID_CAN_MIGRATE(network_id, true)
end
end,
FaceEntity = function(entity_1, entity_2, use_pitch)
local coords_1 = ENTITY.GET_ENTITY_COORDS(ent1, false)
local coords_2 = ENTITY.GET_ENTITY_COORDS(ent2, false)
local difference = Ryan.Vector.Subtract(coords_2, coords_1)
local rotation = Ryan.Vector.DirectionToRotation(difference)
if not use_pitch then
ENTITY.SET_ENTITY_HEADING(entity_1, rotation.z)
else
ENTITY.SET_ENTITY_ROTATION(entity_1, rotation.x, rotation.y, rotation.z)
end
end,
GetOffsetAtDistance = function(entity, distance)
local coords = ENTITY.GET_ENTITY_COORDS(entity, 0)
local theta = (math.random() + math.random(0, 1)) * math.pi
return {
x = coords.x + distance * math.cos(theta),
y = coords.y + distance * math.sin(theta),
z = coords.z
}
end,
DrawESP = function(entity, esp_color)
local color = {r = math.floor(esp_color.r * 255), g = math.floor(esp_color.g * 255), b = math.floor(esp_color.b * 255)}
local minimum = v3.new()
local maximum = v3.new()
if ENTITY.DOES_ENTITY_EXIST(entity) then
MISC.GET_MODEL_DIMENSIONS(ENTITY.GET_ENTITY_MODEL(entity), minimum, maximum)
local width = 2 * v3.getX(maximum)
local length = 2 * v3.getY(maximum)
local depth = 2 * v3.getZ(maximum)
local offset1 = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(entity, -width / 2, length / 2, depth / 2)
local offset4 = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(entity, width / 2, length / 2, depth / 2)
local offset5 = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(entity, -width / 2, length / 2, -depth / 2)
local offset7 = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(entity, width / 2, length / 2, -depth / 2)
local offset2 = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(entity, -width / 2, -length / 2, depth / 2)
local offset3 = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(entity, width / 2, -length / 2, depth / 2)
local offset6 = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(entity, -width / 2, -length / 2, -depth / 2)
local offset8 = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(entity, width / 2, -length / 2, -depth / 2)
GRAPHICS.DRAW_LINE(offset1.x, offset1.y, offset1.z, offset4.x, offset4.y, offset4.z, color.r, color.g, color.b, 255)
GRAPHICS.DRAW_LINE(offset1.x, offset1.y, offset1.z, offset2.x, offset2.y, offset2.z, color.r, color.g, color.b, 255)
GRAPHICS.DRAW_LINE(offset1.x, offset1.y, offset1.z, offset5.x, offset5.y, offset5.z, color.r, color.g, color.b, 255)
GRAPHICS.DRAW_LINE(offset2.x, offset2.y, offset2.z, offset3.x, offset3.y, offset3.z, color.r, color.g, color.b, 255)
GRAPHICS.DRAW_LINE(offset3.x, offset3.y, offset3.z, offset8.x, offset8.y, offset8.z, color.r, color.g, color.b, 255)
GRAPHICS.DRAW_LINE(offset4.x, offset4.y, offset4.z, offset7.x, offset7.y, offset7.z, color.r, color.g, color.b, 255)
GRAPHICS.DRAW_LINE(offset4.x, offset4.y, offset4.z, offset3.x, offset3.y, offset3.z, color.r, color.g, color.b, 255)
GRAPHICS.DRAW_LINE(offset5.x, offset5.y, offset5.z, offset7.x, offset7.y, offset7.z, color.r, color.g, color.b, 255)
GRAPHICS.DRAW_LINE(offset6.x, offset6.y, offset6.z, offset2.x, offset2.y, offset2.z, color.r, color.g, color.b, 255)
GRAPHICS.DRAW_LINE(offset6.x, offset6.y, offset6.z, offset8.x, offset8.y, offset8.z, color.r, color.g, color.b, 255)
GRAPHICS.DRAW_LINE(offset5.x, offset5.y, offset5.z, offset6.x, offset6.y, offset6.z, color.r, color.g, color.b, 255)
GRAPHICS.DRAW_LINE(offset7.x, offset7.y, offset7.z, offset8.x, offset8.y, offset8.z, color.r, color.g, color.b, 255)
end
v3.free(minimum)
v3.free(maximum)
end,
Spotlights = {},
AddSpotlight = function(entity, offset, intensity)
if ENTITY.IS_ENTITY_A_VEHICLE(entity) then
for i = 1, #Ryan.Globals.Haulers do
if VEHICLE.IS_VEHICLE_MODEL(entity, Ryan.Globals.Haulers[i]) then
local trailer_ptr = memory.alloc_int()
VEHICLE.GET_VEHICLE_TRAILER_VEHICLE(entity, trailer_ptr)
local trailer = memory.read_int(trailer_ptr); memory.free(trailer_ptr)
if trailer ~= 0 then
Ryan.Entity.AddSpotlight(trailer, offset, intensity)
return
else
break
end
end
end
end
local coords = ENTITY.GET_ENTITY_COORDS(entity)
local model = ENTITY.GET_ENTITY_MODEL(entity)
local minimum_ptr, maximum_ptr = memory.alloc(), memory.alloc()
MISC.GET_MODEL_DIMENSIONS(model, minimum_ptr, maximum_ptr)
local minimum = memory.read_vector3(minimum_ptr); memory.free(minimum_ptr)
local maximum = memory.read_vector3(maximum_ptr); memory.free(maximum_ptr)
local wall_light = util.joaat("prop_wall_light_15a")
if Ryan.Entity.Spotlights[entity] ~= nil then
Ryan.Entity.DetachAll(entity)
end
for i = 1, intensity do
Ryan.Entity.Spotlights[entity] = true
local offsets = {
{x = 0.0, y = 0.0, z = (maximum.z * offset - 0.5)},
{x = 0.0, y = 0.0, z = (-maximum.z * offset - 0.5)},
{x = 0.0, y = (maximum.y * offset * 0.66), z = -0.5},
{x = 0.0, y = (-maximum.y * offset * 0.66), z = -0.5},
{x = (maximum.x * offset), y = 0.0, z = -0.5},
{x = (-maximum.x * offset), y = 0.0, z = -0.5}
}
for i = 1, #offsets do
local light = entities.create_object(wall_light, {x = coords.x + offsets[i].x, y = coords.y + offsets[i].y, z = coords.z + offsets[i].z})
local rotation = Ryan.Vector.DirectionToRotation(Ryan.Vector.Normalize(Ryan.Vector.Subtract(ENTITY.GET_ENTITY_COORDS(light), ENTITY.GET_ENTITY_COORDS(entity))))
ENTITY.ATTACH_ENTITY_TO_ENTITY(light, entity, 0, offsets[i].x, offsets[i].y, offsets[i].z, rotation.x, rotation.y, rotation.z, false, false, false, false, 0, true)
end
end
end,
DetachAll = function(entity)
local objects = entities.get_all_objects_as_handles()
for _, object in pairs(objects) do
if ENTITY.IS_ENTITY_ATTACHED_TO_ENTITY(object, entity) then
Ryan.Entity.RequestControlLoop(object)
ENTITY.DETACH_ENTITY(object, false, false)
util.yield()
entities.delete_by_handle(object)
end
end
end
}
|
require 'optim'
require 'rnn'
require 'hdf5'
require 'xlua'
require 'nngraph'
cjson = require 'cjson'
utils = require 'misc.utils'
dofile("misc/optim_updates.lua")
dofile("misc/vocab.lua")
torch.setdefaulttensortype('torch.FloatTensor')
torch.manualSeed(123)
quesLen = 7
batchSize = 256
epochs = 30
use_cuda = true
deviceId = 1
rounds = 8
if use_cuda then
require 'cunn'
require 'cutorch'
print("Using GPU:"..deviceId)
cutorch.setDevice(deviceId)
cutorch.setHeapTracking(true)
cutorch.manualSeed(123)
end
running_average = 0
running_average_z = 0
long_qa = 0
trainSize = 0
for line in io.lines('data/train.json') do
local example = cjson.decode(line)
trainSize = trainSize + 1
gridSize = #example['gridImg']
end
bgcolors = torch.FloatTensor(trainSize, gridSize^2):fill(0)
styles = torch.FloatTensor(trainSize, gridSize^2):fill(0)
colors = torch.FloatTensor(trainSize, gridSize^2):fill(0)
numbers = torch.FloatTensor(trainSize, gridSize^2):fill(0)
labels = torch.FloatTensor(trainSize):fill(0)
qas = torch.FloatTensor(trainSize, (quesLen+1)*rounds):fill(0)
local i = 1
for line in io.lines('data/train.json') do
local example = cjson.decode(line)
labels[i] = example['target'][1]*gridSize+example['target'][2]+1
for x = 1, gridSize do
for y = 1, gridSize do
cell = example['gridImg'][x][y]
bgcolors[i][(x-1)*gridSize+y] = bgcolorstoi[cell['bgcolor']]
styles[i][(x-1)*gridSize+y] = stylestoi[cell['style']]
colors[i][(x-1)*gridSize+y] = colorstoi[cell['color']]
numbers[i][(x-1)*gridSize+y] = cell['number']+1
end
end
qa_s = {}
for q = 1, #example['qa'] do
if q < (rounds+1) then
local qa = string.split(example['qa'][q]['question']," +")
table.insert(qa, example['qa'][q]['answer'])
for w = 1, #qa do
qa_s[#qa_s+1] = qa[w]
end
local len = #qa_s
for w = 1, len do
qas[i][(quesLen+1)*rounds-len+w] = wtoi[qa_s[w]]
end
else
long_qa = long_qa + 1
break
end
end
i = i + 1
end
print('trainSize', trainSize, 'gridSize', gridSize)
inputs = {}
outputs = {}
table.insert(inputs, nn.Identity()()) -- dial
table.insert(inputs, nn.Identity()()) -- bgcolor
table.insert(inputs, nn.Identity()()) -- style
table.insert(inputs, nn.Identity()()) -- color
table.insert(inputs, nn.Identity()()) -- number
dial = inputs[1]
bgcolor = inputs[2]
style = inputs[3]
color = inputs[4]
number = inputs[5]
lookup_bgcolor = 5
lookup_style = 2
lookup_color = 5
lookup_number = 10
hiddenSize = 64
rnn = nn.SeqLSTM(hiddenSize, hiddenSize)
rnn.maskzero = true
model_dial =
dial
- nn.Transpose({1,2})
- nn.LookupTableMaskZero(#itow, hiddenSize)
- rnn
- nn.Select(1, -1)
- nn.Replicate(gridSize^2, 2)
mlp_bgcolor = nn.Sequential()
mlp_bgcolor:add(nn.LookupTableMaskZero(lookup_bgcolor, hiddenSize/4))
mlp_bgcolor:add(nn.ReLU())
mlp_bgcolor:add(nn.View(-1,hiddenSize/4))
mlp_bgcolor:add(nn.Linear(hiddenSize/4, hiddenSize/4))
mlp_bgcolor:add(nn.ReLU())
mlp_bgcolor:add(nn.Reshape(1, hiddenSize/4), true)
model_mlp_bgcolor =
bgcolor
- nn.Contiguous()
- nn.View(-1, gridSize^2, 1)
- nn.SplitTable(1, 2)
- nn.MapTable(mlp_bgcolor)
- nn.JoinTable(1, 2)
mlp_style = nn.Sequential()
mlp_style:add(nn.LookupTableMaskZero(lookup_style, hiddenSize/4))
mlp_style:add(nn.ReLU())
mlp_style:add(nn.View(-1,hiddenSize/4))
mlp_style:add(nn.Linear(hiddenSize/4, hiddenSize/4))
mlp_style:add(nn.ReLU())
mlp_style:add(nn.Reshape(1, hiddenSize/4), true)
model_mlp_style =
style
- nn.Contiguous()
- nn.View(-1, gridSize^2, 1)
- nn.SplitTable(1, 2)
- nn.MapTable(mlp_style)
- nn.JoinTable(1, 2)
mlp_color = nn.Sequential()
mlp_color:add(nn.LookupTableMaskZero(lookup_color, hiddenSize/4))
mlp_color:add(nn.ReLU())
mlp_color:add(nn.View(-1,hiddenSize/4))
mlp_color:add(nn.Linear(hiddenSize/4, hiddenSize/4))
mlp_color:add(nn.ReLU())
mlp_color:add(nn.Reshape(1, hiddenSize/4), true)
model_mlp_color =
color
- nn.Contiguous()
- nn.View(-1, gridSize^2, 1)
- nn.SplitTable(1, 2)
- nn.MapTable(mlp_color)
- nn.JoinTable(1, 2)
mlp_number = nn.Sequential()
mlp_number:add(nn.LookupTableMaskZero(lookup_number, hiddenSize/4))
mlp_number:add(nn.ReLU())
mlp_number:add(nn.View(-1,hiddenSize/4))
mlp_number:add(nn.Linear(hiddenSize/4, hiddenSize/4))
mlp_number:add(nn.ReLU())
mlp_number:add(nn.Reshape(1, hiddenSize/4), true)
model_mlp_number =
number
- nn.Contiguous()
- nn.View(-1, gridSize^2, 1)
- nn.SplitTable(1, 2)
- nn.MapTable(mlp_number)
- nn.JoinTable(1, 2)
mlp = nn.Sequential()
mlp:add(nn.Linear(hiddenSize, hiddenSize))
mlp:add(nn.ReLU())
mlp:add(nn.Linear(hiddenSize, hiddenSize))
mlp:add(nn.ReLU())
split_mlp = nn.Sequential()
split_mlp:add(nn.Reshape(2, hiddenSize), true)
split_mlp:add(nn.SplitTable(1,2))
split_mlp:add(nn.ParallelTable():add(nn.Identity()):add(mlp))
split_mlp:add(nn.JoinTable(2))
split_mlp:add(nn.Reshape(1, hiddenSize*2), true)
dot = nn.Sequential()
dot:add(nn.Reshape(2, hiddenSize))
dot:add(nn.SplitTable(1,2))
dot:add(nn.DotProduct())
dot:add(nn.View(-1, 1))
model_main =
{ model_dial, model_mlp_bgcolor, model_mlp_style, model_mlp_color, model_mlp_number }
- nn.JoinTable(3)
- nn.SplitTable(1,2)
- nn.MapTable(split_mlp)
- nn.JoinTable(2)
- nn.SplitTable(1,2)
- nn.MapTable(dot)
- nn.JoinTable(2)
- nn.LogSoftMax()
table.insert(outputs, model_main)
model = nn.gModule(inputs, outputs)
criterion = nn.ClassNLLCriterion()
if use_cuda then model:cuda() criterion:cuda() end
confusion = optim.ConfusionMatrix(gridSize^2)
state = {}
state.learningRate = 0.01
running_average = 0
model_path = 'guesser '..os.date("%c") .. '.t7'
for i = 1, epochs do
confusion:zero()
for t = 1, torch.floor(trainSize/batchSize)*batchSize, batchSize do
xlua.progress(torch.floor(t/batchSize)+1, torch.floor(trainSize/batchSize))
model:training()
local input = { qas[{{t, t+batchSize-1}}], bgcolors[{{t, t+batchSize-1}}], styles[{{t, t+batchSize-1}}],
colors[{{t, t+batchSize-1}}], numbers[{{t, t+batchSize-1}}] }
local label = labels[{{t, t+batchSize-1}}]
if use_cuda then nn.utils.recursiveType(input, 'torch.CudaTensor') label:cuda() end
local output = model:forward(input)
local loss = criterion:forward(output, label)
local gradOut = criterion:backward(output, label)
model:backward(input, gradOut)
modelW, modeldW = model:getParameters()
modeldW:clamp(-5, 5)
adam(modelW, modeldW, state)
model:zeroGradParameters()
confusion:batchAdd(output, label)
confusion:updateValids()
running_average = confusion.totalValid
end
torch.save(model_path, model:clearState())
print(confusion.totalValid)
end
|
module 'character'
--------------------------------------------------------------------
CLASS: EventAlign ( CharacterActionEvent )
:MODEL{
Field 'name' :string()
}
function EventAlign:toString()
return self.name or '<nil>'
end
function EventAlign:start( target, pos )
local nextAlign = self:findNextEvent()
if not nextAlign then return end
local pos1 = nextAlign
local throttle = 1 --calc
target:setThrottle( throttle )
end
function EventAlign:isResizable()
return false
end
--------------------------------------------------------------------
CLASS: TrackAlign ( CharacterActionTrack )
:MODEL{}
function TrackAlign:__init()
self.name = 'align'
end
function TrackAlign:getType()
return 'align'
end
function TrackAlign:createEvent()
return EventAlign()
end
function TrackAlign:hasKeyFrames()
return true
end
function TrackAlign:findEvent( name )
for i, ev in ipairs( self.events ) do
if ev.name == name then return ev end
end
return nil
end
function TrackAlign:findEvents( name )
local res = {}
for i, ev in ipairs( self.events ) do
if ev.name == name then table.insert( res, ev ) end
end
return unpack( res )
end
--------------------------------------------------------------------
registerCharacterActionTrackType( 'Align', TrackAlign )
|
local Sprite = Drawable:new()
function Sprite:new(x, y, width, height, image)
local sprite = Drawable:new()
setmetatable(sprite, self)
self.__index = self
sprite.quad = Graphics.newQuad(x, y, width, height, image:getDimensions())
sprite.image = image
return sprite
end
function Sprite:draw(x, y, width, height)
Renderer.drawSprite(self, Colors.RED, x, y, width, height)
end
return Sprite
|
local Spell = { }
Spell.LearnTime = 120
Spell.Description = [[
Transforms combine turret
prop into a NPC that fights
on your side against players
and bad NPCs.
Also can make combine turret
NPC fight on your side.
]]
Spell.FlyEffect = "hpw_blue_main"
Spell.ImpactEffect = "hpw_blue_impact"
Spell.ApplyDelay = 0.5
Spell.AccuracyDecreaseVal = 0.1
Spell.Category = HpwRewrite.CategoryNames.Special
Spell.ForceAnim = { ACT_VM_PRIMARYATTACK_5 }
Spell.SpriteColor = Color(0, 0, 255)
Spell.NodeOffset = Vector(-216, -551, 0)
function Spell:Draw(spell)
self:DrawGlow(spell, nil, 32)
end
function Spell:OnSpellSpawned(wand, spell)
wand:PlayCastSound()
end
function Spell:OnFire(wand)
return true
end
local EnemyNames = {
npc_antlion = true, npc_antlionguard = true, npc_antlionguardian = true, npc_barnacle = true,
npc_breen = true, npc_clawscanner = true, npc_combine_s = true, npc_cscanner = true, npc_fastzombie = true,
npc_fastzombie_torso = true, npc_headcrab = true, npc_headcrab_fast = true, npc_headcrab_poison = true,
npc_hunter = true, npc_metropolice = true, npc_manhack = true, npc_poisonzombie = true,
npc_strider = true, npc_stalker = true, npc_zombie = true, npc_zombie_torso = true, npc_zombine = true
}
local FriendlyNames = {
npc_alyx = true, npc_barney = true, npc_citizen = true, npc_dog = true, npc_eli = true,
npc_fisherman = true, npc_gman = true, npc_kleiner = true, npc_magnusson = true,
npc_monk = true, npc_mossman = true, npc_odessa = true, npc_vortigaunt = true
}
local mdl = "models/combine_turrets/floor_turret.mdl"
function Spell:AfterCollide(spell, data)
local ent = data.HitEntity
if IsValid(ent) then
if ent:GetClass() == "prop_physics" and ent:GetModel() == mdl then
local pos = ent:GetPos()
local ang = ent:GetAngles()
local color = ent:GetColor()
local skin = ent:GetSkin()
local npc = ents.Create("npc_turret_floor")
undo.ReplaceEntity(ent, npc)
cleanup.ReplaceEntity(ent, npc)
ent:Remove()
npc:SetPos(pos)
npc:SetAngles(ang)
npc:SetColor(color)
npc:SetSkin(skin)
npc:Spawn()
for k, v in pairs(EnemyNames) do npc:AddRelationship(k .. " D_HT 99") end
for k, v in pairs(FriendlyNames) do npc:AddRelationship(k .. " D_LI 99") end
npc:AddEntityRelationship(self.Owner, D_LI, 9999)
npc:EmitSound("npc/turret_floor/active.wav", 70)
elseif ent:GetClass() == "npc_turret_floor" then
for k, v in pairs(EnemyNames) do ent:AddRelationship(k .. " D_HT 99") end
for k, v in pairs(FriendlyNames) do ent:AddRelationship(k .. " D_LI 99") end
ent:AddEntityRelationship(self.Owner, D_LI, 9999)
ent:EmitSound("npc/turret_floor/active.wav", 70)
end
end
end
HpwRewrite:AddSpell("Locomotor Turret", Spell)
|
-----------------------------------------------------------------------------
-- Little program to download files from URLs
-- LuaSocket sample files
-- Author: Diego Nehab
-- RCS ID: $Id: get.lua,v 1.25 2007/03/12 04:08:40 diego Exp $
-----------------------------------------------------------------------------
local socket = require("socket")
local http = require("socket.http")
local ftp = require("socket.ftp")
local url = require("socket.url")
local ltn12 = require("ltn12")
-- formats a number of seconds into human readable form
function nicetime(s)
local l = "s"
if s > 60 then
s = s / 60
l = "m"
if s > 60 then
s = s / 60
l = "h"
if s > 24 then
s = s / 24
l = "d" -- hmmm
end
end
end
if l == "s" then return string.format("%5.0f%s", s, l)
else return string.format("%5.2f%s", s, l) end
end
-- formats a number of bytes into human readable form
function nicesize(b)
local l = "B"
if b > 1024 then
b = b / 1024
l = "KB"
if b > 1024 then
b = b / 1024
l = "MB"
if b > 1024 then
b = b / 1024
l = "GB" -- hmmm
end
end
end
return string.format("%7.2f%2s", b, l)
end
-- returns a string with the current state of the download
local remaining_s = "%s received, %s/s throughput, %2.0f%% done, %s remaining"
local elapsed_s = "%s received, %s/s throughput, %s elapsed "
function gauge(got, delta, size)
local rate = got / delta
if size and size >= 1 then
return string.format(remaining_s, nicesize(got), nicesize(rate),
100*got/size, nicetime((size-got)/rate))
else
return string.format(elapsed_s, nicesize(got),
nicesize(rate), nicetime(delta))
end
end
-- creates a new instance of a receive_cb that saves to disk
-- kind of copied from luasocket's manual callback examples
function stats(size)
local start = socket.gettime()
local last = start
local got = 0
return function(chunk)
-- elapsed time since start
local current = socket.gettime()
if chunk then
-- total bytes received
got = got + string.len(chunk)
-- not enough time for estimate
if current - last > 1 then
io.stderr:write("\r", gauge(got, current - start, size))
io.stderr:flush()
last = current
end
else
-- close up
io.stderr:write("\r", gauge(got, current - start), "\n")
end
return chunk
end
end
-- determines the size of a http file
function gethttpsize(u)
local r, c, h = http.request {method = "HEAD", url = u}
if c == 200 then
return tonumber(h["content-length"])
end
end
-- downloads a file using the http protocol
function getbyhttp(u, file)
local save = ltn12.sink.file(file or io.stdout)
-- only print feedback if output is not stdout
if file then save = ltn12.sink.chain(stats(gethttpsize(u)), save) end
local r, c, h, s = http.request {url = u, sink = save }
if c ~= 200 then io.stderr:write(s or c, "\n") end
end
-- downloads a file using the ftp protocol
function getbyftp(u, file)
local save = ltn12.sink.file(file or io.stdout)
-- only print feedback if output is not stdout
-- and we don't know how big the file is
if file then save = ltn12.sink.chain(stats(), save) end
local gett = url.parse(u)
gett.sink = save
gett.type = "i"
local ret, err = ftp.get(gett)
if err then print(err) end
end
-- determines the scheme
function getscheme(u)
-- this is an heuristic to solve a common invalid url poblem
if not string.find(u, "//") then u = "//" .. u end
local parsed = url.parse(u, {scheme = "http"})
return parsed.scheme
end
-- gets a file either by http or ftp, saving as <name>
function get(u, name)
local fout = name and io.open(name, "wb")
local scheme = getscheme(u)
if scheme == "ftp" then getbyftp(u, fout)
elseif scheme == "http" then getbyhttp(u, fout)
else print("unknown scheme" .. scheme) end
end
-- main program
arg = arg or {}
if table.getn(arg) < 1 then
io.write("Usage:\n lua get.lua <remote-url> [<local-file>]\n")
os.exit(1)
else get(arg[1], arg[2]) end
|
object_static_halloween_item_burning_man = object_static_halloween_shared_item_burning_man:new {
}
ObjectTemplates:addTemplate(object_static_halloween_item_burning_man, "object/static/halloween/item_burning_man.iff")
|
local E, L, V, P, G = unpack(select(2, ...)); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local DT = E:GetModule('DataTexts')
--Cache global variables
--Lua functions
local select, ipairs = select, ipairs
local format = string.format
local tsort = table.sort
--WoW API / Variables
local C_Garrison_GetCompleteTalent = C_Garrison.GetCompleteTalent
local C_Garrison_GetFollowerShipments = C_Garrison.GetFollowerShipments
local C_Garrison_GetInProgressMissions = C_Garrison.GetInProgressMissions
local C_Garrison_GetLandingPageShipmentInfoByContainerID = C_Garrison.GetLandingPageShipmentInfoByContainerID
local C_Garrison_GetLooseShipments = C_Garrison.GetLooseShipments
local C_Garrison_GetTalentTreeIDsByClassID = C_Garrison.GetTalentTreeIDsByClassID
local C_Garrison_GetTalentTreeInfoForID = C_Garrison.GetTalentTreeInfoForID
local C_Garrison_HasGarrison = C_Garrison.HasGarrison
local C_Garrison_RequestLandingPageShipmentInfo = C_Garrison.RequestLandingPageShipmentInfo
local GetCurrencyInfo = GetCurrencyInfo
local GetMouseFocus = GetMouseFocus
local HideUIPanel = HideUIPanel
local ShowGarrisonLandingPage = ShowGarrisonLandingPage
local CAPACITANCE_WORK_ORDERS = CAPACITANCE_WORK_ORDERS
local COMPLETE = COMPLETE
local FOLLOWERLIST_LABEL_TROOPS = FOLLOWERLIST_LABEL_TROOPS
local GARRISON_LANDING_SHIPMENT_COUNT = GARRISON_LANDING_SHIPMENT_COUNT
local GARRISON_TALENT_ORDER_ADVANCEMENT = GARRISON_TALENT_ORDER_ADVANCEMENT
local LE_FOLLOWER_TYPE_GARRISON_7_0 = LE_FOLLOWER_TYPE_GARRISON_7_0
local LE_GARRISON_TYPE_7_0 = LE_GARRISON_TYPE_7_0
local ORDER_HALL_MISSIONS = ORDER_HALL_MISSIONS
--Global variables that we don't cache, list them here for mikk's FindGlobals script
-- GLOBALS: GarrisonLandingPage
local GARRISON_CURRENCY = 1220
local GARRISON_ICON = format("|T%s:16:16:0:0:64:64:4:60:4:60|t", select(3, GetCurrencyInfo(GARRISON_CURRENCY)))
local function sortFunction(a, b)
return a.missionEndTime < b.missionEndTime
end
local function OnEnter(self, _, noUpdate)
DT:SetupTooltip(self)
if(not noUpdate) then
DT.tooltip:Hide()
C_Garrison_RequestLandingPageShipmentInfo();
return
end
local firstLine = true
--Missions
local inProgressMissions = C_Garrison_GetInProgressMissions(LE_FOLLOWER_TYPE_GARRISON_7_0)
local numMissions = (inProgressMissions and #inProgressMissions or 0)
if(numMissions > 0) then
tsort(inProgressMissions, sortFunction) --Sort by time left, lowest first
DT.tooltip:AddLine(ORDER_HALL_MISSIONS) -- "Class Hall Missions"
firstLine = false
for i=1, numMissions do
local mission = inProgressMissions[i]
local timeLeft = mission.timeLeft:match("%d")
local r, g, b = 1, 1, 1
if(mission.isRare) then
r, g, b = 0.09, 0.51, 0.81
end
if(timeLeft and timeLeft == "0") then
DT.tooltip:AddDoubleLine(mission.name, COMPLETE, r, g, b, 0, 1, 0)
else
DT.tooltip:AddDoubleLine(mission.name, mission.timeLeft, r, g, b)
end
end
end
-- Troop Work Orders
local followerShipments = C_Garrison_GetFollowerShipments(LE_GARRISON_TYPE_7_0)
local hasFollowers = false
if (followerShipments) then
for i = 1, #followerShipments do
local name, _, _, shipmentsReady, shipmentsTotal = C_Garrison_GetLandingPageShipmentInfoByContainerID(followerShipments[i])
if ( name and shipmentsReady and shipmentsTotal ) then
if(hasFollowers == false) then
if not firstLine then
DT.tooltip:AddLine(" ")
end
firstLine = false
DT.tooltip:AddLine(FOLLOWERLIST_LABEL_TROOPS) -- "Troops"
hasFollowers = true
end
DT.tooltip:AddDoubleLine(name, format(GARRISON_LANDING_SHIPMENT_COUNT, shipmentsReady, shipmentsTotal), 1, 1, 1)
end
end
end
-- "Loose Work Orders" (i.e. research, equipment)
local looseShipments = C_Garrison_GetLooseShipments(LE_GARRISON_TYPE_7_0)
local hasLoose = false
if (looseShipments) then
for i = 1, #looseShipments do
local name, _, _, shipmentsReady, shipmentsTotal = C_Garrison_GetLandingPageShipmentInfoByContainerID(looseShipments[i])
if ( name and shipmentsReady and shipmentsTotal ) then
if(hasLoose == false) then
if not firstLine then
DT.tooltip:AddLine(" ")
end
firstLine = false
DT.tooltip:AddLine(CAPACITANCE_WORK_ORDERS) -- "Work Orders"
hasLoose = true
end
DT.tooltip:AddDoubleLine(name, format(GARRISON_LANDING_SHIPMENT_COUNT, shipmentsReady, shipmentsTotal), 1, 1, 1)
end
end
end
-- Talents
local talentTreeIDs = C_Garrison_GetTalentTreeIDsByClassID(LE_GARRISON_TYPE_7_0, E.myClassID);
local hasTalent = false
if (talentTreeIDs) then
-- this is a talent that has completed, but has not been seen in the talent UI yet.
local completeTalentID = C_Garrison_GetCompleteTalent(LE_GARRISON_TYPE_7_0);
for _, treeID in ipairs(talentTreeIDs) do
local _, _, tree = C_Garrison_GetTalentTreeInfoForID(treeID);
for _, talent in ipairs(tree) do
local showTalent = false;
if (talent.isBeingResearched) then
showTalent = true;
end
if (talent.id == completeTalentID) then
showTalent = true;
end
if (showTalent) then
if not firstLine then
DT.tooltip:AddLine(" ")
end
firstLine = false
DT.tooltip:AddLine(GARRISON_TALENT_ORDER_ADVANCEMENT); -- "Order Advancement"
DT.tooltip:AddDoubleLine(talent.name, format(GARRISON_LANDING_SHIPMENT_COUNT, talent.isBeingResearched and 0 or 1, 1), 1, 1, 1);
hasTalent = true
end
end
end
end
if(numMissions > 0 or hasFollowers or hasLoose or hasTalent) then
DT.tooltip:Show()
else
DT.tooltip:Hide()
end
end
local function OnClick()
if not (C_Garrison_HasGarrison(LE_GARRISON_TYPE_7_0)) then
return;
end
local isShown = GarrisonLandingPage and GarrisonLandingPage:IsShown();
if (not isShown) then
ShowGarrisonLandingPage(LE_GARRISON_TYPE_7_0);
elseif (GarrisonLandingPage) then
local currentGarrType = GarrisonLandingPage.garrTypeID;
HideUIPanel(GarrisonLandingPage);
if (currentGarrType ~= LE_GARRISON_TYPE_7_0) then
ShowGarrisonLandingPage(LE_GARRISON_TYPE_7_0);
end
end
end
local function OnEvent(self, event)
if(event == "GARRISON_LANDINGPAGE_SHIPMENTS" or event == "GARRISON_TALENT_UPDATE" or event == "GARRISON_TALENT_COMPLETE") then
if(GetMouseFocus() == self) then
OnEnter(self, nil, true)
end
return
end
local _, numGarrisonResources = GetCurrencyInfo(GARRISON_CURRENCY)
self.text:SetFormattedText("%s %s", GARRISON_ICON, numGarrisonResources)
end
DT:RegisterDatatext('Orderhall', {"PLAYER_ENTERING_WORLD", "CURRENCY_DISPLAY_UPDATE", "GARRISON_LANDINGPAGE_SHIPMENTS", "GARRISON_TALENT_UPDATE", "GARRISON_TALENT_COMPLETE"}, OnEvent, nil, OnClick, OnEnter)
|
-- Madonox
-- ID: 7642306654
-- RPM automatic updating files, normally used to push critical updates.
local RPMAutoContent = {}
function RPMAutoContent:Get(filename)
if script.PackagedFiles:FindFirstChild(filename) then
return script.PackagedFiles[filename]
end
end
return RPMAutoContent
|
-- Enable /chatbell command & Save players settings on disk
local settings_file = minetest.get_worldpath() .. "/chatbell"
-- Enable/Disable Sound Command
minetest.register_chatcommand("chatbell", {
description = "Plays a sound when your name is quoted in chat (spam protection of ".. chatbell.spam_time .."s)",
func = function(name, param)
chatbell.player_settings[name].enabled = not chatbell.player_settings[name].enabled
save_settings()
return true, "Chat bell is " .. (chatbell.player_settings[name].enabled and "enabled" or "disabled") .. "."
end
})
local function load_settings()
local input, err = io.open(settings_file, "r")
if not input then
return minetest.log("info", "Could not load chatbell config file: " .. err)
end
local cur_time = minetest.get_us_time()
for name, active in input:read("*a"):gmatch("([%w_-]+)%s(%S+)[\r\n]") do
chatbell.player_settings[name] = {enabled = (active == "true"), time = cur_time}
end
input:close()
end
load_settings()
function save_settings()
local data = {}
local output, err = io.open(settings_file, "w")
if output then
for player_name, entry in pairs(chatbell.player_settings) do
table.insert(data, string.format("%s %s\n", player_name, tostring(entry.enabled)))
end
output:write(table.concat(data))
io.close(output)
return true
end
minetest.log("action", "Unable to write to chatbell config file: " .. err)
return false
end
|
Channel = {}
Channel.__index = Channel
--[[ Functions: Channel ]]--
function Channel:Create(id)
local channel = setmetatable({
id = id,
clients = {},
talking = {},
}, Channel)
Voip.channels[id] = channel
return channel
end
function Channel:Destroy()
Voip.channels[self.id] = nil
end
function Channel:AddPlayer(source, _type)
-- Check already in channel.
if self.clients[tostring(source)] then
return false
end
-- Inform other clients.
self:SendPayload("voip:addToChannel", self.id, source)
-- Trigger events.
TriggerEvent("voip:addToChannel", source, self.id, _type)
TriggerClientEvent("voip:addToChannel", source, self.id, self.clients, self.talking)
-- Cache client.
self.clients[tostring(source)] = _type or true
-- Success.
return true
end
function Channel:RemovePlayer(source)
-- Check already in channel.
if not self.clients[tostring(source)] then
return false
end
-- Cache client.
self.clients[tostring(source)] = nil
-- Inform other clients.
self:SendPayload("voip:removeFromChannel", self.id, source)
-- Trigger events.
TriggerEvent("voip:removeFromChannel", source, self.id)
TriggerClientEvent("voip:removeFromChannel", source, self.id)
-- Cleanup channel.
local next = next
if next(self.clients) == nil then
self:Destroy()
end
-- Success.
return true
end
function Channel:SendPayload(eventName, ...)
for _client, _ in pairs(self.clients) do
TriggerClientEvent(eventName, _client, ...)
end
end
function Channel:SetTalking(source, value)
if self.talking[tostring(source)] == value then return end
self.talking[tostring(source)] = value or nil
self:SendPayload("voip:setTalking", self.id, source, value)
end
|
local LuaNEAT = require"LuaNEAT"
local xor = {}
-- initializing LuaNEAT
local pool_size = 100
local inputs = 2 -- number of inputs
local outputs = 1 -- number of outputs
local pool = LuaNEAT.newPool(pool_size, inputs, outputs)
-- how many seconds until the next generation
local wait = 0--.25
local counter = 0
-- stop the simulation when the best net error is below %accuracy%
local stop=false
local accuracy=1e-6
-- the neural networks we will get from the pool
local neural_nets = {}
-- for drawing the stats
local margin = 50
local stats_height = 200
-- for each table in the training_set,
-- [1] and [2] are the inputs and
-- [3] the output ([1] xor [2])
local training_set = {
{0, 0, 0},
{0, 1, 1},
{1, 0, 1},
{1, 1, 0}
}
local function map(value, x0, x1, y1, y2)
return (value-x0)/(x1-x0)*(y2-y1) + y1
end
function xor.load()
-- initializing the pool
pool:initialize()
-- getting the first nets from the pool
neural_nets = pool:getNeuralNetworks()
end
function xor.update(dt)
if stop then return end
if counter == 0 then
-- evaluating the neural nets
for n=1, #neural_nets do
local sum=0
for t=1, #training_set do
local input1, input2 = training_set[t][1], training_set[t][2]
local outputs = neural_nets[n]:forward("snapshot", input1, input2)
local err = (outputs[1] - training_set[t][3])^2
sum = sum + err
end
neural_nets[n]:setFitness(1-sum/4)
end
end
if counter > wait then
counter = 0
-- next generation
pool:nextGeneration()
-- getting the new neural nets
neural_nets = pool:getNeuralNetworks()
else
counter = counter + dt
end
end
function xor.draw()
local w, h = love.graphics.getDimensions()
-- drawing top fit graph
local top_info = pool.statistics:getTopFitnessPoints()
local top_points = {}
local avg_info = pool.statistics:getAverageFitnessPoints()
local avg_points = {}
for n=1,#top_info do
table.insert(top_points, map(n, 1, #top_info, margin, w-margin))
table.insert(top_points, map(top_info[n], 0, 1, margin+stats_height, margin))
end
if #top_info > 1 then
love.graphics.setColor(0,1,0,1)
love.graphics.line(top_points)
end
-- drawing avg fit graph
for n=1,#avg_info do
table.insert(avg_points, map(n, 1, #avg_info, margin, w-margin))
table.insert(avg_points, map(avg_info[n], 0, 1, margin+stats_height, margin))
end
if #avg_info > 1 then
love.graphics.setColor(0,0,1,1)
--love.graphics.line(avg_points)
end
-- graphs rectangles
love.graphics.setColor(0,1,0,1)
love.graphics.rectangle("line", margin, margin, w-margin*2, stats_height)
love.graphics.setColor(1,1,1,1)
love.graphics.print("Stats from the last ".. pool:getGeneration() .. " generations", margin, 30)
-- bottom left and right rectangles
love.graphics.setColor(0,1,0,1)
love.graphics.rectangle("line", margin, margin*2+stats_height, w/2-margin-margin/2, h-margin*3-stats_height)
love.graphics.rectangle("line", margin*2+w/2-margin-margin/2, margin*2+stats_height, w/2-margin-margin/2, h-margin*3-stats_height)
-- drawing the best neural net
local net = pool:getBestPerformer()
local width = w/2-margin-margin/2
local height = h-margin*3-stats_height
net:draw(margin, margin*2+stats_height + 25, width, height - 50) -- x, y, width, height
-- printing some stats
local info_x = margin*2+w/2-margin-margin/2 + 10
local info_y = margin*2+stats_height + 10
-- getting the outputs from the best net
local results = {}
local total_error=0
for t=1,#training_set do
results[t] = net:forward("snapshot", training_set[t][1], training_set[t][2])[1]
local err = (results[t] - training_set[t][3])^2
total_error = total_error + err
end
if total_error < accuracy then
if not stop then
LuaNEAT.save(pool, "xor")
end
stop=true
end
local worst_fit = math.huge
local count=0
for s=1,#pool.species do
for g=1,#pool.species[s].genomes do
if pool.species[s].genomes[g].fitness < worst_fit then
worst_fit = pool.species[s].genomes[g].fitness
end
count=count+1
end
end
love.graphics.setColor(1,1,1,1)
love.graphics.print(
"Generation ".. pool:getGeneration() .."\n" ..
pool:getSpeciesAmount() .. " species" .. "\n" ..
"Top fitness: ".. net:getFitness() .. "\n\n" ..
"Worst fitness: ".. worst_fit.. "\n#Genomes:".. count .. "\n\n" ..
"Best network:" .. "\n" ..
training_set[1][1] .. " xor ".. training_set[1][2] .. " = ".. string.format("%.2f", results[1]) .. "\n" ..
training_set[2][1] .. " xor ".. training_set[2][2] .. " = ".. string.format("%.2f", results[2]) .. "\n" ..
training_set[3][1] .. " xor ".. training_set[3][2] .. " = ".. string.format("%.2f", results[3]) .. "\n" ..
training_set[4][1] .. " xor ".. training_set[4][2] .. " = ".. string.format("%.2f", results[4]) .. "\n" ..
"Error is ".. total_error,
info_x, info_y
)
end
return xor
|
local _
_ = function()
local joop = 2302
return function(hi)
local d = 100
hi = 1021
local a, b, c
a, b, c, d = 1, 2, 3, 4
local hello
hello[232], (5 + 5)[121], hello, x[99] = 100, 200, 300
joop = 12
end
end
local joop = 2345
local a, b
if hello then
a, b = "hello"
else
a, b = "nothing", "yeah"
end
if hello then
if yeah then
a, b = "one", "two"
else
a, b = "mmhh"
end
else
print("the other")
a, b = "nothing", "yeah"
end
|
return {'sax','saxofonist','saxofoniste','saxofoon','saxofoonkwartet','saxofoonspel','saxhoorn','saxen','saxofonen','saxofonisten','saxofoons','saxofoontje','saxofoontjes','saxhoorns'}
|
local _NAME = "LibProtectedCall"
local _VERSION = "1.0.0"
local _LICENSE = [[
MIT License
Copyright (c) 2020 Jayrgo
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
]]
assert(LibMan1, format("%s requires LibMan-1.x.x.", _NAME))
assert(LibMan1:Exists("LibEvent", 1), format("%s requires LibEvent-1.x.x.", _NAME))
local LibProtectedCall --[[ , oldVersion ]] = LibMan1:New(_NAME, _VERSION, "_LICENSE", _LICENSE)
if not LibProtectedCall then return end
local tnew, tdel
do -- tnew, tdel
local cache = setmetatable({}, {__mode = "k"})
local next = next
local select = select
---@vararg any
---@return table
function tnew(...)
local t = next(cache)
if t then
cache[t] = nil
local n = select("#", ...)
for i = 1, n do t[i] = select(i, ...) end
return t
end
return {...}
end
local wipe = wipe
---@param t table
function tdel(t) cache[wipe(t)] = true end
end
local packargs
do -- pack2
local select = select
---@vararg any
---@return table
function packargs(...) return {n = select("#", ...), ...} end
end
local unpackargs
do -- pack2
local unpack = unpack
---@param t table
---@return any
function unpackargs(t) return unpack(t, 1, t.n) end
end
local getKey
do -- getKey
local strhash
do -- strhash
local fmod = math.fmod
local strbyte = strbyte
local strlen = strlen
---@param str string
---@return string
function strhash(str)
-- Source: https://wow.gamepedia.com/StringHash
local counter = 1
local len = strlen(str)
for i = 1, len, 3 do
counter = fmod(counter * 8161, 4294967279) + -- 2^32 - 17: Prime!
(strbyte(str, i) * 16776193) + ((strbyte(str, i + 1) or (len - i + 256)) * 8372226) +
((strbyte(str, i + 2) or (len - i + 256)) * 3932164)
end
return fmod(counter, 4294967291) -- 2^32 - 5: Prime (and different from the prime in the loop)
end
end
local getstring
do -- getstring
local tostring = tostring
local prefixes = setmetatable({}, {
__index = function(t, k)
local v = tostring(function() end) .. "%s"
t[k] = v
return v
end,
})
local format = format
local type = type
---@param arg any
---@return string
function getstring(arg) return format(prefixes[type(arg)], tostring(arg)) end
end
local select = select
local tconcat = table.concat
---@vararg any
---@return string
function getKey(...)
local keys = tnew()
for i = 1, select("#", ...) do keys[i] = getstring(select(i, ...)) end
local key = strhash(tconcat(keys))
tdel(keys)
return key
end
end
LibProtectedCall.registry = LibProtectedCall.registry or {}
local registry = LibProtectedCall.registry
LibProtectedCall.funcs = LibProtectedCall.funcs or {}
local funcs = LibProtectedCall.funcs
local LibEvent = LibMan1:Get("LibEvent")
local wipe = wipe
local function PLAYER_REGEN_ENABLED()
LibEvent:Unregister("PLAYER_REGEN_ENABLED", PLAYER_REGEN_ENABLED)
for i = 1, #registry do funcs[registry[i]]() end
wipe(funcs)
wipe(registry)
end
local safecall = LibProtectedCall.safecall
local xsafecall = LibProtectedCall.xsafecall
local select = select
---@param x boolean
---@param func function
---@vararg any
---@return function
local function getRegFunc(x, func, ...)
local safecall = x and xsafecall or safecall -- luacheck: ignore 431
if select("#", ...) == 0 then
return function() safecall(func) end
else
local args = packargs(...)
return function() safecall(func, unpackargs(args)) end
end
end
local error = error
local format = format
local tostring = tostring
local type = type
local InCombatLockdown = InCombatLockdown
---@param x boolean
---@param func function
---@vararg any
local function Call(x, func, ...)
if type(func) ~= "function" then
error(format("Usage: %s:%sCall(func[, ...]): 'func' - function expected got %s", tostring(LibProtectedCall),
x and "x" or "", type(func)), 3)
end
if InCombatLockdown() then
local regKey = getKey(func, ...)
funcs[regKey] = getRegFunc(x, func, ...)
registry[#registry + 1] = regKey
LibEvent:Register("PLAYER_REGEN_ENABLED", PLAYER_REGEN_ENABLED)
else
if x then
xsafecall(func, ...)
else
safecall(func, ...)
end
end
end
---@param func function
---@vararg any
function LibProtectedCall:Call(func, ...) Call(false, func, ...) end
---@param func function
---@vararg any
function LibProtectedCall:xCall(func, ...) Call(true, func, ...) end
local tDeleteItem = tDeleteItem
---@param x boolean
---@param func function
---@vararg any
local function CallOnce(x, func, ...)
if type(func) ~= "function" then
error(
format("Usage: %s:%sCallOnce(func[, ...]): 'func' - function expected got %s", tostring(LibProtectedCall),
x and "x" or "", type(func)), 3)
end
if InCombatLockdown() then
local regKey = getKey(func, ...)
if funcs[regKey] then
tDeleteItem(registry, regKey)
else
funcs[regKey] = getRegFunc(x, func, ...)
end
registry[#registry + 1] = regKey
LibEvent:Register("PLAYER_REGEN_ENABLED", PLAYER_REGEN_ENABLED)
else
if x then
xsafecall(func, ...)
else
safecall(func, ...)
end
end
end
---@param func function
---@vararg any
function LibProtectedCall:CallOnce(func, ...) CallOnce(false, func, ...) end
---@param func function
---@vararg any
function LibProtectedCall:xCallOnce(func, ...) CallOnce(true, func, ...) end
---@param x boolean
---@param func function
---@return function
local function Create(x, func)
if type(func) ~= "function" then
error(format("Usage: %s:%sCreate(func): 'func' - function expected got %s", tostring(LibProtectedCall),
x and "x" or "", type(func)), 3)
end
return function(...) Call(x, func, ...) end
end
---@param func function
---@return function
function LibProtectedCall:Create(func) return Create(false, func) end
---@param func function
---@return function
function LibProtectedCall:xCreate(func) return Create(true, func) end
local function CreateOnce(x, func)
if type(func) ~= "function" then
error(format("Usage: %s:%sCreateOnce(func): 'func' - function expected got %s", tostring(LibProtectedCall),
x and "x" or "", type(func)), 3)
end
return function(...) CallOnce(x, func, ...) end
end
---@param func function
---@return function
function LibProtectedCall:CreateOnce(func) return CreateOnce(false, func) end
---@param func function
---@return function
function LibProtectedCall:xCreateOnce(func) return CreateOnce(true, func) end
---@param x boolean
---@param tbl table
---@param key any
local function Protect(x, tbl, key)
if type(tbl) ~= "table" then
error(format("Usage: %s:%sProtect(tbl, key): 'tbl' - table expected got %s", tostring(LibProtectedCall),
x and "x" or "", type(tbl)), 3)
end
if type(key) == "nil" then
error(format("Usage: %s:%sProtect(tbl, key): 'key' - can't be nil", tostring(LibProtectedCall)),
x and "x" or "", 3)
end
tbl[key] = Create(x, tbl[key])
end
---@param tbl table
---@param key any
function LibProtectedCall:Protect(tbl, key) Protect(false, tbl, key) end
---@param tbl table
---@param key any
function LibProtectedCall:xProtect(tbl, key) Protect(true, tbl, key) end
---@param x boolean
---@param tbl table
---@param key any
local function ProtectOnce(x, tbl, key)
if type(tbl) ~= "table" then
error(format("Usage: %s:%sProtectOnce(tbl, key): 'tbl' - table expected got %s", tostring(LibProtectedCall),
x and "x" or "", type(tbl)), 3)
end
if type(key) == "nil" then
error(format("Usage: %s:%sProtectOnce(tbl, key): 'key' - can't be nil", tostring(LibProtectedCall)),
x and "x" or "", 3)
end
tbl[key] = CreateOnce(x, tbl[key])
end
---@param tbl table
---@param key any
function LibProtectedCall:ProtectOnce(tbl, key) ProtectOnce(false, tbl, key) end
---@param tbl table
---@param key any
function LibProtectedCall:xProtectOnce(tbl, key) ProtectOnce(true, tbl, key) end
|
local string = string
local tconcat = table.concat
local tinsert = table.insert
local lpeg = require "lpeg"
local function escape_identifier(ident)
local v = {'"', tostring(ident):gsub('"', '""'), '"'}
return tconcat(v)
end
local function default_escape_literal(val)
local t = type(val)
if "number" == t then
return tostring(val)
elseif "string" == t then
local v = {"'", tostring((val:gsub("'", "''"))), "'"}
return tconcat(v)
elseif "boolean" == t then
return val and "TRUE" or "FALSE"
end
return error("don't know how to escape value: " .. tostring(val))
end
local util = {}
function util.encode_int(n, bytes)
if bytes == nil then
bytes = 4
end
if 4 == bytes then
return string.pack(">i4", n)
else
return error("don't know how to encode " .. tostring(bytes) .. " byte(s)")
end
end
function util.decode_int(str, bytes)
if bytes == nil then
bytes = #str
end
if 4 == bytes then
return string.unpack(">i4", str)
elseif 2 == bytes then
return string.unpack(">i2", str)
else
return error("don't know how to decode " .. tostring(bytes) .. " byte(s)")
end
end
function util.decode_bytea(str)
if str:sub(1, 2) == '\\x' then
return str:sub(3):gsub('..', function(hex)
return string.char(tonumber(hex, 16))
end)
else
return str:gsub('\\(%d%d%d)', function(oct)
return string.char(tonumber(oct, 8))
end)
end
end
function util.encode_bytea(str)
return string.format("E'\\\\x%s'", str:gsub('.', function(byte)
return string.format('%02x', string.byte(byte))
end))
end
function util.__flatten(t, buffer)
local ttype = type(t)
if "string" == ttype then
buffer[#buffer + 1] = t
elseif "table" == ttype then
for i = 1, #t do
local thing = t[i]
util.__flatten(thing, buffer)
end
end
end
function util.flatten(t)
local buffer = { }
util.__flatten(t, buffer)
return tconcat(buffer)
end
function util.cal_len(thing, t)
if t == nil then
t = type(thing)
end
if "string" == t then
return #thing
elseif "table" == t then
local l = 0
for i = 1, #thing do
local inner = thing[i]
local inner_t = type(inner)
if inner_t == "string" then
l = l + #inner
else
l = l + util.cal_len(inner, inner_t)
end
end
return l
else
return error("don't know how to calculate length of " .. tostring(t))
end
end
function util.flip(t)
local keys = {}
for k,v in pairs(t) do
tinsert(keys, k)
end
for i=1, #keys do
local k = keys[i]
t[t[k]] = k
end
return t
end
local function decode_error_whitespace()
return error("got unexpected whitespace")
end
local decode_array
do
local P, R, S, V, Ct, C, Cs = lpeg.P, lpeg.R, lpeg.S, lpeg.V, lpeg.Ct, lpeg.C, lpeg.Cs
local define = {
"array",
array = Ct(V("open") * (V("value") * (P(",") * V("value")) ^ 0) ^ -1 * V("close")),
value = V("invalid_char") + V("string") + V("array") + V("literal"),
string = P('"') * Cs((P([[\\]]) / [[\]] + P([[\"]]) / [["]] + (P(1) - P('"'))) ^ 0) * P('"'),
literal = C((P(1) - S("},")) ^ 1),
invalid_char = S(" \t\r\n") / decode_error_whitespace,
open = P("{"),
delim = P(","),
close = P("}")
}
local g = P(define)
local convert_values
convert_values = function(array, fn)
for idx, v in ipairs(array) do
if type(v) == "table" then
convert_values(v, fn)
else
array[idx] = fn(v)
end
end
return array
end
decode_array = function(str, convert_fn)
local out = (assert(g:match(str), "failed to parse postgresql array"))
if convert_fn then
return convert_values(out, convert_fn)
else
return out
end
end
end
util.decode_array = decode_array
local encode_array
do
local append_buffer
append_buffer = function(escape_literal, buffer, values)
for i = 1, #values do
local item = values[i]
if type(item) == "table" and not getmetatable(item) then
tinsert(buffer, "[")
append_buffer(escape_literal, buffer, item)
buffer[#buffer] = "]"
tinsert(buffer, ",")
else
tinsert(buffer, escape_literal(item))
tinsert(buffer, ",")
end
end
return buffer
end
encode_array = function(tbl, escape_literal)
escape_literal = escape_literal or default_escape_literal
local buffer = append_buffer(escape_literal, {
"ARRAY["
}, tbl)
buffer[#buffer] = "]"
return tconcat(buffer)
end
end
local decode_hstore
do
local P, R, S, V, Ct, C, Cs, Cg, Cf = lpeg.P, lpeg.R, lpeg.S, lpeg.V, lpeg.Ct, lpeg.C, lpeg.Cs, lpeg.Cg, lpeg.Cf
local define = {
"hstore",
hstore = Cf(Ct("") * (V("pair") * (V("delim") * V("pair")) ^ 0) ^ -1, rawset) * -1,
pair = Cg(V("value") * "=>" * (V("value") + V("null"))),
value = V("invalid_char") + V("string"),
string = P('"') * Cs((P([[\\]]) / [[\]] + P([[\"]]) / [["]] + (P(1) - P('"'))) ^ 0) * P('"'),
null = C('NULL'),
invalid_char = S(" \t\r\n") / decode_error_whitespace,
delim = P(", ")
}
local g = P(define)
decode_hstore = function(str, convert_fn)
local out = (assert(g:match(str), "failed to parse postgresql hstore"))
return out
end
end
local encode_hstore
do
encode_hstore = function(tbl, escape_literal)
if not (escape_literal) then
escape_literal = default_escape_literal
end
local buffer = { }
for k, v in pairs(tbl) do
tinsert(buffer, tconcat({'"', k ,'"=>"', v , '"'}))
end
return escape_literal(tconcat(buffer, ", "))
end
end
util.encode_array = encode_array
util.decode_array = decode_array
util.encode_hstore = encode_hstore
util.decode_hstore = decode_hstore
util.escape_literal = default_escape_literal
util.escape_identifier = escape_identifier
return util
|
-- See Copyright Notice in core\LICENSE.txt
require("utils")
local file = io.open(".."..directory_delimiter..".."..directory_delimiter.."projects"..directory_delimiter..project.name..directory_delimiter.."compile.error.log", "r")
if (not file) then
os.exit()
end
local problems={}
problems.errors={}
problems.warnings={}
local error_data = file:read("*a")
file:close()
error_data=explode("\n",error_data)
for line,errorline in pairs(error_data) do
-- D:\svn.db.net\trunk\pwn\core\pawno\include\dutils.inc(37) : warning 219: local variable "i" shadows a variable at a preceding level
etype = "warning"
efilename, eline, eid, emsg = string.match(errorline, [[^([%w%\: %_%.]+)%((%d+)%) : warning (%d+): (.*)$]])
if (efilename==nil) then
etype = "error"
efilename, eline, eid, emsg = string.match(errorline, [[^([%w%\: %_%.]+)%((%d+)%) : fatal error (%d+): (.*)]])
if (efilename==nil) then
efilename, eline, eid, emsg = string.match(errorline, [[^([%w%\: %_%.]+)%((%d+)%) : error (%d+): (.*)]])
end
end
if (efilename) then
local current={}
current.filename=str_replace(".."..directory_delimiter..".."..directory_delimiter..".."..directory_delimiter..".."..directory_delimiter.."","",efilename)
current.line=eline
current.id=eid
current.msg=emsg
if (string.find(" symbol is never used: \"DmoduleInitLang\"",current.msg)) then
onError("DmoduleInitLang() is not called by OnGameModeInit in sampcore module.",current.filename,current.line)
end
if (string.find(current.msg,"undefined symbol \"_")) then
-- Callback is not definied in exports.txt, but called in the module
local parts = explode("undefined symbol \"_",current.msg)
onError("The event "..str_replace("\"","",parts[2]).." is fired, but not defined as export.",str_replace(".dmodule.inc",".exports.txt",current.filename),"-")
end
if (string.find(current.msg,"undefined symbol \"T_")) then
-- Callback is not definied in exports.txt, but called in the module
local parts = explode("undefined symbol \"T_",current.msg)
onError("gettext: Using undefined translation key "..str_replace("\"","",parts[2])..".",current.filename,current.line)
end
if (not string.find(current.msg,"symbol is never used: \"_")) then
if ((string.find(current.msg,"symbol is never used: \"") and (string.find(current.msg,"_Read") or string.find(current.msg,"_Write")))) then
-- Ok a _ReadValues event isn't readed, because it isn't set - we ignore that.
else
if (etype=="warning") then
table.insert(problems.warnings,current)
else
table.insert(problems.errors,current)
end
end
end
end
end
if (table.getn(problems.errors)==0 and table.getn(problems.warnings)==0 ) then
os.execute(del_cmd_pre..".."..directory_delimiter..".."..directory_delimiter.."projects"..directory_delimiter..project.name..directory_delimiter.."compile.error.log",true)
os.exit()
end
print("")
print(" Compiling issues:")
print("")
local showitems={}
if (table.getn(problems.errors)>0) then
print(" Warnings: "..table.getn(problems.warnings).." (hidden until errors are solved)")
print(" Errors: "..table.getn(problems.errors).." (fix first error first and recompile)")
showitems=problems.errors
else
if (table.getn(problems.warnings)>0) then
print(" Warnings: "..table.getn(problems.warnings).." (fix first warning first and recompile)")
showitems=problems.warnings
end
end
for no, item in pairs(showitems) do
local fileinfo=explode(directory_delimiter.."",item.filename)
print(" "..fileinfo[table.getn(fileinfo)]..":"..item.line.." "..item.msg)
if (fileinfo[table.getn(fileinfo)]~=item.filename) then
fileinfo[table.getn(fileinfo)]=nil
print(" ("..str_replace(arg[1]..directory_delimiter.."build"..directory_delimiter.."gamemodes"..directory_delimiter..".."..directory_delimiter..".."..directory_delimiter..".."..directory_delimiter..".."..directory_delimiter.."","",table.concat(fileinfo,""..directory_delimiter..""))..")")
end
end
|
--[[ Author: Firetoad
Date: 08.07.2016 ]]
function HasteBoots( keys )
local caster = keys.caster
local ability = keys.ability
local ability_level = ability:GetLevel() - 1
local modifier_ms = keys.modifier_ms
local sound_haste = keys.sound_haste
local particle_haste = keys.particle_haste
-- Parameters
local phase_duration = ability:GetLevelSpecialValueFor("phase_duration", ability_level)
-- Play sound locally
EmitSoundOnClient(sound_haste, PlayerResource:GetPlayer(caster:GetPlayerID()))
-- Play particle
local haste_pfx = ParticleManager:CreateParticle(particle_haste, PATTACH_ABSORIGIN_FOLLOW, caster)
ParticleManager:SetParticleControl(haste_pfx, 0, caster:GetAbsOrigin())
ParticleManager:ReleaseParticleIndex(haste_pfx)
-- Apply bonus move speed
ability:ApplyDataDrivenModifier(caster, caster, modifier_ms, {})
-- Increase move speed limit
-- caster:AddNewModifier(caster, ability, "modifier_imba_haste_boots_speed_break", {duration = phase_duration})
end
function TranquilsThink( keys )
local caster = keys.caster
local ability = keys.ability
local ability_level = ability:GetLevel() - 1
local modifier_move = keys.modifier_move
local modifier_stacks = keys.modifier_stacks
-- If on cooldown, do nothing
if not ability:IsCooldownReady() then
return nil
end
-- Parameters
local base_move_speed = ability:GetLevelSpecialValueFor("base_move_speed", ability_level)
local move_speed_per_sec = ability:GetLevelSpecialValueFor("move_speed_per_sec", ability_level)
local max_stacks = ability:GetLevelSpecialValueFor("max_stacks", ability_level)
-- Fetch current amount of stacks
local current_stacks = caster:GetModifierStackCount(modifier_stacks, caster)
-- If below maximum stacks, add one more
if current_stacks < max_stacks then
AddStacks(ability, caster, caster, modifier_stacks, 1, true)
current_stacks = current_stacks + 1
end
-- Update movement speed
ability:ApplyDataDrivenModifier(caster, caster, modifier_move, {})
caster:SetModifierStackCount(modifier_move, caster, base_move_speed + move_speed_per_sec * current_stacks)
end
function TranquilsBreak( keys )
local caster = keys.caster
local ability = keys.ability
local modifier_move = keys.modifier_move
local modifier_stacks = keys.modifier_stacks
-- Put the ability on cooldown
if ability then
ability:StartCooldown(ability:GetCooldown(0) * (1 - caster:GetCooldownReduction() * 0.01))
end
-- Remove all existing stacks
caster:RemoveModifierByName(modifier_move)
caster:RemoveModifierByName(modifier_stacks)
end
function TranquilsAllyThink( keys )
local caster = keys.caster
local ability = keys.ability
local target = keys.target
local modifier_bearer = keys.modifier_bearer
local modifier_stacks = keys.modifier_stacks
-- If this unit is a tranquils bearer, do nothing
if target:HasModifier(modifier_bearer) then
return nil
end
-- Parameters
local radius = ability:GetSpecialValueFor("radius")
local highest_stacks = 0
-- Search for the aura bearer with the highest amount of stacks nearby
local nearby_allies = FindUnitsInRadius(target:GetTeamNumber(), target:GetAbsOrigin(), nil, radius, DOTA_UNIT_TARGET_TEAM_FRIENDLY, DOTA_UNIT_TARGET_HERO, DOTA_UNIT_TARGET_FLAG_NONE, FIND_ANY_ORDER, false)
for _,ally in pairs(nearby_allies) do
-- If this ally is an aura bearer, fetch its stacks
if ally:HasModifier(modifier_bearer) and ally:HasModifier(modifier_stacks) then
highest_stacks = math.max(highest_stacks, ally:GetModifierStackCount(modifier_stacks, nil))
end
end
-- If there are more than zero stacks, apply and update them
if highest_stacks > 0 then
ability:ApplyDataDrivenModifier(caster, target, modifier_stacks, {})
target:SetModifierStackCount(modifier_stacks, caster, highest_stacks)
-- Else, remove them
else
target:RemoveModifierByName(modifier_stacks)
end
end
function TranquilsAllyEnd( keys )
local target = keys.target
local modifier_stacks = keys.modifier_stacks
-- Remove all existing stacks of the aura
target:RemoveModifierByName(modifier_stacks)
end
|
--[[
Lua Stream API 1.0.0
Created 2016 by Michael Karneim.
For detailed documentation on the Lua Stream API please see <http://github.com/mkarneim/lua-stream-api>.
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
For more information, please refer to <http://unlicense.org>
This function returns a sequential stream with the provided input as its source.
The input parameter must be nil or one of type table, boolean, number, string, or function.
* If input is of type table, then the the new stream is created from the elements of the table,
assuming that the table is an array indexed with consecutive numbers from 1 to n, containing
no nil values.
* If input is a single value of type boolean, number, or string, then the new stream contains
just this value as its only element.
* If input if of type function, then the new stream is created with this function as its
iterator function, which must be a parameterless function that produces the "next" element on
each call.
* If input is nil (or not provided at all), then the new stream is empty.
--]]
function stream(input)
-- The following _* functions are internal functions that implement the stream's behaviour based
-- on iterator functions.
-- The documentation of these functions is obmitted since it can be easiy deduced from the
-- documentation of the corresponding stream function at the end of this file.
local function _iterator(input)
if input == nil then
error("input must be of type table, but was nil")
elseif type(input)~="table" then
error("input must be of type table, but was a "..type(input)..": "..input)
end
local len = #input
local i = 0
local result = function()
i = i + 1
if i > len then
return nil
else
return input[i]
end
end
return result
end
local function _next(iter)
return iter()
end
local function _concat(itarr)
local len = #itarr
local i = 1
local it = itarr[i]
local result = function()
if i > len then
return nil
else
while true do
local e = it()
if e ~= nil then
return e
else
i = i + 1
if i > len then
return nil
else
it = itarr[i]
end
end
end
end
end
return result
end
local function _peek(iter,c)
if c == nil then
error("c must be of type function, but was nil")
end
if type(c)~="function" then
error("c must be of type function, but was a "..type(c))
end
local result = function()
local e = iter()
if e ~= nil then
c(e)
end
return e
end
return result
end
local function _filter(iter,p)
if p == nil then
error("p must be of type function, but was nil")
end
if type(p)~="function" then
error("p must be of type function, but was a "..type(p))
end
local result = function()
local e = iter()
while e ~= nil do
if p(e) then
return e
else
e = iter()
end
end
return nil
end
return result
end
local function _pack(iter,n)
return function()
local result = nil
for i=1,n do
local e = iter()
if e == nil then
return result
else
if result == nil then
result = {}
end
table.insert(result,e)
end
end
return result
end
end
local function _map(iter,f)
if f == nil then
error("f must be of type function, but was nil")
end
if type(f)~="function" then
error("f must be of type function, but was a "..type(f))
end
local result = function()
local e = iter()
if e ~= nil then
return f(e)
else
return nil
end
end
return result
end
local function _flatmap(iter,f)
if f == nil then
error("f must be of type function, but was nil")
end
if type(f)~="function" then
error("f must be of type function, but was a "..type(f))
end
local it = nil
local result = function()
while true do
if it == nil then
local e = iter()
if e == nil then
return nil
else
it = _iterator(f(e))
end
else
local e = it()
if e ~= nil then
return e
else
it = nil
end
end
end
end
return result
end
local function _flatten(iter)
return _flatmap(iter, function(e) return e end)
end
local function _distinct(iter)
local processed = {}
local result = function()
local e = iter()
while e ~= nil do
if processed[e]==nil then
processed[e]=true
return e
else
e = iter()
end
end
return nil
end
return result
end
local function _limit(iter,max)
local count = 0
local result = function()
count = count + 1
if count > max then
return nil
else
return iter()
end
end
return result
end
local function _skip(iter,num)
local i = 0
while i<num do
i = i + 1
local e = iter()
if e == nil then
break
end
end
return iter
end
local function _last(iter)
local result = nil
for e in iter do
result = e
end
return result
end
local function _foreach(iter,c)
if c == nil then
error("c must be of type function, but was nil")
end
if type(c)~="function" then
error("c must be of type function, but was a "..type(c))
end
for e in iter do
c(e)
end
end
local function _toarray(iter)
local result = {}
local i = 0
for e in iter do
i = i + 1
result[i] = e
end
return result
end
local function _shuffle(iter)
local result = _toarray(iter)
local rand = math.random
local iterations = #result
local j
for i = iterations, 2, -1 do
j = rand(i)
result[i], result[j] = result[j], result[i]
end
return _iterator(result)
end
local function _group(iter,f)
if f == nil then
error("f must be of type function, but was nil")
end
if type(f)~="function" then
error("f must be of type function, but was a "..type(f))
end
local result = {}
for e in iter do
local key = f(e)
local values = result[key]
if values == nil then
values = {}
result[key] = values
end
values[#values+1] = e
end
return result
end
local function _split(iter,f)
if f == nil then
error("f must be of type function, but was nil")
end
if type(f)~="function" then
error("f must be of type function, but was a "..type(f))
end
local a1 = {}
local a2 = {}
local function pull(match,amatch,anomatch)
return function()
if amatch[1] ~= nil then
return table.remove(amatch,1)
else
local e = iter()
while e ~= nil do
if f(e) == match then
return e
else
table.insert(anomatch,e)
e = iter()
end
end
return nil
end
end
end
local it1 = pull(true,a1,a2)
local it2 = pull(false,a2,a1)
return stream(it1), stream(it2)
end
local function _merge(itarr)
local idx = 1
return function()
local len = #itarr
if len == 0 then
return nil
end
for i=1,len do
if idx > len then
idx = 1
end
local it = itarr[idx]
local e = it()
if e ~= nil then
idx = idx + 1
return e
else
table.remove(itarr, idx)
len = #itarr
end
end
local nilcount = 0
local result = {}
for i,it in ipairs(itarr) do
local e = it()
if e == nil then
nilcount = nilcount + 1
else
result[i-nilcount] = e
end
end
if nilcount >= #itarr then
return nil
else
return result
end
end
end
local function _reduce(iter,init,op)
if op == nil then
error("op must be of type function, but was nil")
end
if type(op)~="function" then
error("op must be of type function, but was a "..type(op))
end
local result = init
for e in iter do
result = op(result,e)
end
return result
end
local function _reverse(iter)
local result = _toarray(iter)
local len = #result
for i=1, len/2 do
result[i], result[len-i+1] = result[len-i+1], result[i]
end
return _iterator(result)
end
local function _sort(iter,comp)
local result = _toarray(iter)
table.sort(result,comp)
return _iterator(result)
end
local function _count(iter)
local result = 0
for e in iter do
result = result + 1
end
return result
end
local function _max(iter,comp)
local result = nil
for e in iter do
if result == nil or (comp ~= nil and comp(result,e)) or result < e then
result = e
end
end
return result
end
local function _min(iter,comp)
local result = nil
for e in iter do
if result == nil or (comp ~= nil and comp(e,result)) or e < result then
result = e
end
end
return result
end
local function _sum(iter)
local result = 0
for e in iter do
result = result + e
end
return result
end
local function _avg(iter)
local sum = 0
local count = 0;
for e in iter do
count = count + 1
sum = sum + e
end
if count == 0 then
return nil
else
return sum/count
end
end
local function _allmatch(iter,p)
if p == nil then
error("p must be of type function, but was nil")
end
if type(p)~="function" then
error("p must be of type function, but was a "..type(p))
end
for e in iter do
if not p(e) then
return false
end
end
return true
end
local function _anymatch(iter,p)
if p == nil then
error("p must be of type function, but was nil")
end
if type(p)~="function" then
error("p must be of type function, but was a "..type(p))
end
for e in iter do
if p(e) then
return true
end
end
return false
end
local function _nonematch(iter,p)
return not _anymatch(iter,p)
end
-- Returns a new stream created form the given interator function.
local function _stream(iter)
local result = {
-- Returns the iterator function for the elements of this stream.
iter = function()
return iter
end,
-- Returns the next (aka first) element of this stream, or nil if the stream is empty.
next = function()
return _next(iter)
end,
-- Returns a lazily concatenated stream whose elements are all the elements of this stream
-- followed by all the elements of the streams provided by the varargs parameter.
concat = function(...)
local streams = {iter}
for i,s in ipairs({...}) do
streams[i+1] = s.iter()
end
return stream(_concat(streams))
end,
-- Returns a stream consisting of the elements of this stream, additionally performing
-- the provided action on each element as elements are consumed from the resulting stream.
peek = function(c)
return stream(_peek(iter,c))
end,
-- Returns a stream consisting of the elements of this stream that match the given predicate.
filter = function(p)
return stream(_filter(iter,p))
end,
-- Returns a stream consisting of chunks, made of n adjacent elements of the original stream.
pack = function(n)
return stream(_pack(iter,n))
end,
-- Returns a stream consisting of the results of applying the given function
-- to the elements of this stream.
map = function(f)
return stream(_map(iter,f))
end,
-- Returns a stream consisting of the flattened results
-- produced by applying the provided mapping function on each element.
flatmap = function(f)
return stream(_flatmap(iter,f))
end,
-- Returns a stream consisting of the flattened elements.
flatten = function()
return stream(_flatten(iter))
end,
-- Returns a stream consisting of the elements of this stream,
-- truncated to be no longer than maxsize in length.
limit = function(maxsize)
return stream(_limit(iter,maxsize))
end,
-- Returns a stream consisting of the remaining elements of this stream
-- after discarding the first n elements of the stream. If this stream contains
-- fewer than n elements then an empty stream will be returned.
skip = function(n)
return stream(_skip(iter,n))
end,
-- Returns the last element of this stream.
last = function()
return _last(iter)
end,
-- Performs the given action for each element of this stream.
foreach = function(c)
_foreach(iter,c)
end,
-- Returns an array containing the elements of this stream.
toarray = function()
return _toarray(iter)
end,
-- Returns a stream consisting of the elements of this stream, ordered randomly.
-- Call math.randomseed( os.time() ) first to get nice random orders.
shuffle = function()
return stream(_shuffle(iter))
end,
-- Returns a table which is grouping the elements of this stream by keys provided from
-- the specified classification function.
group = function(f)
return _group(iter,f)
end,
-- Returns two streams consisting of the elements of this stream
-- separated by the given predicate.
split = function(f)
return _split(iter,f)
end,
-- Returns a lazily merged stream whose elements are all the elements of this stream
-- and of the streams provided by the varargs parameter. The elements are taken from all
-- streams round-robin.
merge = function(...)
local itarr = {iter}
for i,s in ipairs({...}) do
itarr[i+1] = s.iter()
end
return stream(_merge(itarr))
end,
-- Returns the result of the given collector that is supplied
-- with an iterator for the elements of this stream.
collect = function(c)
return c(iter)
end,
-- Performs a reduction on the elements of this stream, using the provided initial value
-- and the associative accumulation function, and returns the reduced value.
reduce = function(init,op)
return _reduce(iter,init,op)
end,
-- Returns a stream consisting of the elements of this stream in reversed order.
reverse = function()
return stream(_reverse(iter))
end,
-- Returns a stream consisting of the elements of this stream, sorted according to the
-- provided comparator.
-- See table.sort for details on the comp parameter.
-- If comp is not given, then the standard Lua operator < is used.
sort = function(comp)
return stream(_sort(iter,comp))
end,
-- Returns a stream consisting of the distinct elements
-- (according to the standard Lua operator ==) of this stream.
distinct = function()
return stream(_distinct(iter))
end,
-- Returns the count of elements in this stream.
count = function()
return _count(iter)
end,
-- Returns the maximum element of this stream according to the provided comparator,
-- or nil if this stream is empty.
-- See table.sort for details on the comp parameter.
-- If comp is not given, then the standard Lua operator < is used.
max = function(comp)
return _max(iter,comp)
end,
-- Returns the minimum element of this stream according to the provided comparator,
-- or nil if this stream is empty.
-- See table.sort for details on the comp parameter.
-- If comp is not given, then the standard Lua operator < is used.
min = function(comp)
return _min(iter,comp)
end,
-- Returns the sum of elements in this stream.
sum = function()
return _sum(iter)
end,
-- Returns the arithmetic mean of elements of this stream, or nil if this stream is empty.
avg = function()
return _avg(iter)
end,
-- Returns whether all elements of this stream match the provided predicate.
-- If the stream is empty then true is returned and the predicate is not evaluated.
allmatch = function(p)
return _allmatch(iter,p)
end,
-- Returns whether any elements of this stream match the provided predicate.
-- If the stream is empty then false is returned and the predicate is not evaluated.
anymatch = function(p)
return _anymatch(iter,p)
end,
-- Returns whether no elements of this stream match the provided predicate.
-- If the stream is empty then true is returned and the predicate is not evaluated.
nonematch = function(p)
return _nonematch(iter,p)
end
}
return result
end
-- create an appropriate stream depending on the input type
if input==nil then
return _stream(_iterator({}))
elseif type(input)=="table" then
return _stream(_iterator(input))
elseif type(input)=="boolean" or type(input)=="number" or type(input)=="string" then
return _stream(_iterator({input}))
elseif type(input)=="function" then
return _stream(input)
else
error("input must be nil or of type table, boolean, number, string, or function, but was a "..type(input))
end
end
|
rpc_dispatch={}
function dispatch_rpc()
if peek(0x5f80)==0 then
local type=peek(0x5f81)
local len=peek(0x5f82)
local args={}
for i=1,len do
args[i]=peek(0x5f82+i)
end
debug_str="dispatch type "..tostr(type).." len "..tostr(len).." args "..tostr(#args)
if rpc_dispatch[type]!=nil then
local vals=rpc_dispatch[type](args)
if vals!=nil then
poke(0x5f81,#vals)
for i,v in pairs(vals) do
poke(0x5f81+i,v)
end
end
poke(0x5f80,2)
end
end
end
hello_world_args={0,0,0}
function rpc_hello_world(args)
for i,v in pairs(args) do
hello_world_args[i]=v
end
return {5,6,7}
end
rpc_dispatch[0]=rpc_hello_world
|
-- ----------------------------------------------
-- Copyright (c) 2019, CounterFlow AI, Inc. All Rights Reserved.
-- author: Collins Huff <ch@counterflowai.com>
--
-- Use of this source code is governed by a BSD-style
-- license that can be found in the LICENSE.txt file.
-- ----------------------------------------------
-- ----------------------------------------------
-- Common Utility Functions
-- ----------------------------------------------
--
-- https://gist.github.com/ripter/4270799
-- Print contents of `tbl`, with indentation.
-- `indent` sets the initial level of indentation.
function tprint (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)
tprint(v, indent+1)
elseif type(v) == 'boolean' then
print(formatting .. tostring(v))
else
print(formatting .. v)
end
end
end
function check_fields(eve, field_values)
local result = false
for k,v in pairs(field_values) do
if type(k) == 'number' then
result = check_field(eve, v)
if not result then return false end
else
result = check_field(eve, k, v)
if not result then return false end
end
end
return true
end
function check_field(eve, field, value)
local cur_table = eve
for f in string.gmatch(field, "[^%.]+") do
if f ~= nil and f ~= '' then
cur_table = cur_table[f]
end
if not cur_table then return false end
end
local value_in_table = cur_table
if not value then
return true
elseif type(value) == 'table' then
local found = false
for _,possible_value in ipairs(value) do
if value_in_table == possible_value then
found = true
break
end
end
return found
else
return (value == value_in_table)
end
end
|
dofile("common.inc");
function doit()
askForWindow("Shows currently hovered mouse position and RGB color values. Press shift over ATITD window to continue.");
while true do
srReadScreen();
local pos = getMousePos();
local pixelsRaw = srReadPixel(pos[0], pos[1]);
local pixels = pixelDiffs(pos[0], pos[1], 0);
local status = "Pos: " .. pos[0] .. ", " .. pos[1] .. "\n";
status = status .. "RGB: " .. table.concat(pixels, ", ") .. "\nHEX: 0x" .. decToHex(pixels[1]) .. decToHex(pixels[2]) .. decToHex(pixels[3]) .. "FF\nPixelRaw: " .. pixelsRaw .. "\n\n";
extraInfo = "Tap Ctrl to Save Values to ATITD10/info_logs.txt"
lsDrawRect(10, 260, 80, 200, 0, pixelsRaw);
statusScreen(status .. extraInfo, nil, nil, 0.7);
if lsControlHeld() then
WriteLog(status);
end
while lsControlHeld() do
extraInfo = "Saved to Log File\nRelease Ctrl Key";
statusScreen(status .. extraInfo, nil, nil, 0.7);
lsSleep(10);
end
end
lsSleep(10);
end
function WriteLog(Text)
FileGlass = io.open("info_logs.txt","a+");
FileGlass:write(Text);
FileGlass:close();
end
function decToHex(IN)
local B,K,OUT,I,D=16,"0123456789ABCDEF","",0
while IN>0 do
I=I+1
IN,D=math.floor(IN/B),math.fmod(IN,B)+1
OUT=string.sub(K,D,D)..OUT
end
return OUT
end
|
return {
-- Language
language = "en_gb",
-- Window persistence
persistWindowSize = true,
persistWindowPosition = true,
persistWindowFullscreen = true,
}
|
local firstSpawn = true
AddEventHandler("playerSpawned", function(spawn)
if firstSpawn == true then
TriggerServerEvent('five_roleplay_core:spawn')
firstSpawn = false
end
end)
RegisterNetEvent('five_roleplay_core:initializeinfo')
AddEventHandler('five_roleplay_core:initializeinfo', function(money,dirtymoney,bankbalance)
SendNUIMessage({
initialise = true,
money = money,
dirtymoney = dirtymoney,
bankbalanceinfo = bankbalance
})
end)
RegisterNetEvent('five_roleplay_core:bankbalance')
AddEventHandler('five_roleplay_core:bankbalance', function(rslt)
SendNUIMessage({
bankbalanceinfo = rslt
})
end)
RegisterNetEvent('five_roleplay_core:dirtymoney')
AddEventHandler('five_roleplay_core:dirtymoney', function(rslt)
SendNUIMessage({
dirtymoneyinfo = rlst
})
end)
RegisterNetEvent('five_roleplay_core:money')
AddEventHandler('five_roleplay_core:money', function(rslt)
SendNUIMessage({
moneyinfo = rslt
})
end)
RegisterNetEvent('five_roleplay_core:rmvMoney')
AddEventHandler('five_roleplay_core:rmvMoney', function(rslt)
SendNUIMessage({
rmvMoney = rslt
})
end)
RegisterNetEvent('five_roleplay_core:addMoney')
AddEventHandler('five_roleplay_core:addMoney', function(rslt)
SendNUIMessage({
addMoney = rslt
})
end)
RegisterNetEvent('five_roleplay_core:rmvBank')
AddEventHandler('five_roleplay_core:rmvBank', function(rslt)
SendNUIMessage({
rmvBank = rslt
})
end)
RegisterNetEvent('five_roleplay_core:addBank')
AddEventHandler('five_roleplay_core:addBank', function(rslt)
SendNUIMessage({
addBank = rslt
})
end)
RegisterNetEvent('five_roleplay_core:removeMoneyForBank')
AddEventHandler('five_roleplay_core:removeMoneyForBank', function(rslt)
SendNUIMessage({
rmvMoneyForBank = rslt
})
end)
RegisterNetEvent('five_roleplay_core:removeBankForMoney')
AddEventHandler('five_roleplay_core:removeBankForMoney', function(rslt)
SendNUIMessage({
rmvBankForMoney = rslt
})
end)
RegisterNetEvent('five_roleplay_core:addDirtyMoney')
AddEventHandler('five_roleplay_core:addDirtyMoney', function(rslt)
SendNUIMessage({
addDirtyMoney = rslt
})
end)
RegisterNetEvent('five_roleplay_core:rmvDirtyMoney')
AddEventHandler('five_roleplay_core:rmvDirtyMoney', function(rslt)
SendNUIMessage({
rmvDirtyMoney = rslt
})
end)
RegisterNetEvent('five_roleplay_core:setDirtyMoney')
AddEventHandler('five_roleplay_core:rmvDirtyMoney', function(rslt)
SendNUIMessage({
dirtymoneyinfo = rslt
})
end)
|
-- FILE: mapEditorScriptingExtension_s.lua
-- PURPOSE: Prevent the map editor feature set being limited by what MTA can load from a map file by adding a script file to maps
-- VERSION: RemoveWorldObjects (v1) AutoLOD (v1)
local usedLODModels = {}
function onResourceStartOrStop ( )
for _, object in ipairs ( getElementsByType ( "removeWorldObject", source ) ) do
local model = getElementData ( object, "model" )
local lodModel = tonumber(getElementData ( object, "lodModel" ))
if lodModel then
local posX = getElementData ( object, "posX" )
local posY = getElementData ( object, "posY" )
local posZ = getElementData ( object, "posZ" )
local interior = getElementData ( object, "interior" )
local radius = getElementData ( object, "radius" )
if ( eventName == "onResourceStart" ) then
removeWorldModel ( model, radius, posX, posY, posZ, interior )
removeWorldModel ( lodModel, radius, posX, posY, posZ, interior )
else
restoreWorldModel ( model, radius, posX, posY, posZ, interior )
restoreWorldModel ( lodModel, radius, posX, posY, posZ, interior )
end
end
end
if (eventName == "onResourceStart" and get(getResourceName(getThisResource())..".useLODs")) then
for i, object in ipairs(getElementsByType("object", source)) do
local objID = getElementModel(object)
local lodModel = LOD_MAP[objID]
if (lodModel) then
local x,y,z = getElementPosition(object)
local rx,ry,rz = getElementRotation(object)
local lodObj = createObject(lodModel,x,y,z,rx,ry,rz,true)
setElementInterior(lodObj, getElementInterior(object) )
setElementDimension(lodObj, getElementDimension(object) )
setElementCollisionsEnabled(lodObj, false)
setElementParent(lodObj, object)
setLowLODElement(object, lodObj)
table.insert(usedLODModels, lodModel)
end
end
end
end
addEventHandler ( "onResourceStart", resourceRoot, onResourceStartOrStop )
addEventHandler ( "onResourceStop", resourceRoot, onResourceStartOrStop )
function receiveLODsClientRequest()
triggerClientEvent(client, "setLODsClient", resourceRoot, usedLODModels)
end
addEvent("requestLODsClient", true)
addEventHandler("requestLODsClient", resourceRoot, receiveLODsClientRequest)
-- MTA LOD Table [object] = [lodmodel]
LOD_MAP = { [17697] = 17768;
[8476] = 8905; [9476] = 9263; [4339] = 4472; [8654] = 8751; [7465] = 7795; [8465] = 8744; [11114] = 11052; [13872] = 13884; [6999] = 7120;
[7999] = 8098; [6959] = 7343; [9733] = 9644; [10927] = 11356; [10759] = 10804; [8445] = 8478; [7445] = 7761; [10928] = 11065; [9266] = 9475; [13676] = 13870;
[8554] = 8804; [5745] = 5827; [10855] = 11187; [4813] = 4903; [8439] = 8910; [7439] = 7757; [7043] = 7059; [8043] = 8111; [9043] = 9134; [10384] = 10548;
[9745] = 9873; [4833] = 4943; [6979] = 7006; [13692] = 13766; [7454] = 7784; [8454] = 8599; [11132] = 11208; [10843] = 10892; [8513] = 8820; [13732] = 13770;
[9139] = 9145; [10903] = 10907; [5759] = 5917; [8343] = 8363; [10948] = 11021; [4303] = 4437; [9215] = 9460; [8533] = 8817; [17671] = 17788; [9303] = 9372;
[4533] = 4532; [8625] = 8794; [4244] = 4379; [9613] = 9875; [13739] = 13772; [5145] = 5235; [10793] = 11330; [9899] = 9635; [4315] = 4449; [7315] = 7316;
[6315] = 6424; [9315] = 9375; [10833] = 10896; [4243] = 4378; [7633] = 7764; [8633] = 8802; [8244] = 8024; [13715] = 13782; [8525] = 8902; [5166] = 5336;
[4344] = 4477; [10823] = 11248; [4335] = 4468; [10559] = 10724; [9065] = 9068; [5123] = 5213; [9705] = 9772; [5028] = 5029; [9028] = 9179; [10763] = 10884;
[7045] = 7063; [8045] = 8011; [4165] = 4166; [8512] = 8759; [8344] = 8364; [8543] = 8604; [9039] = 9040; [6879] = 6891; [4879] = 4921; [4345] = 4478;
[9223] = 9406; [10939] = 11370; [8868] = 9085; [10758] = 10923; [4868] = 5045; [9345] = 9377; [11255] = 11262; [8212] = 8220; [6065] = 6082; [7443] = 7859;
[8443] = 8914; [13672] = 13832; [13741] = 13765; [10870] = 11204; [4366] = 4496; [4245] = 4380; [9579] = 9626; [8611] = 8917; [8245] = 8025; [10861] = 11169;
[10352] = 10715; [4365] = 4529; [9743] = 9872; [9066] = 9067; [13784] = 13836; [5679] = 5680; [11254] = 11268; [9235] = 9450; [5805] = 5912; [9711] = 9774;
[13752] = 13876; [8627] = 8968; [11120] = 11196; [9026] = 9178; [9232] = 9359; [10018] = 10170; [10601] = 10730; [10795] = 11329; [7368] = 7376; [8368] = 8367;
[10983] = 11143; [10752] = 11355; [13726] = 13786; [13730] = 13844; [13801] = 13880; [7320] = 7322; [4320] = 4454; [5021] = 5022; [9021] = 9181; [4286] = 4420;
[5109] = 5193; [8468] = 8972; [4299] = 4433; [9286] = 9464; [9299] = 9374; [8501] = 9075; [10817] = 10877; [6501] = 6504; [10959] = 10963; [10905] = 10908;
[7420] = 7812; [8420] = 9063; [7321] = 7323; [4321] = 4455; [11299] = 11298; [4847] = 4933; [10492] = 10729; [4295] = 4429; [11332] = 11333; [9928] = 10002;
[9001] = 9010; [5034] = 5035; [8034] = 8126; [17524] = 17730; [6488] = 6492; [8520] = 8829; [9488] = 9780; [10932] = 11217; [7947] = 7948; [11130] = 11207;
[4268] = 4402; [7099] = 7112; [7459] = 7789; [8459] = 8767; [11337] = 11358; [4267] = 4401; [11256] = 11264; [9267] = 9477; [13707] = 13839; [8588] = 8786;
[11098] = 11177; [7559] = 7743; [10753] = 11206; [10867] = 11185; [4367] = 4497; [7367] = 7372; [8288] = 8289; [11303] = 11304; [17606] = 17718; [10941] = 11167;
[13795] = 13796; [4828] = 4942; [4259] = 4393; [11006] = 11151; [7101] = 7142; [9006] = 9015; [17535] = 17970; [7388] = 7285; [7539] = 7959; [8539] = 8790;
[13820] = 13822; [6913] = 7178; [9487] = 9640; [11126] = 11212; [11125] = 10802; [6888] = 7138; [10864] = 11407; [5859] = 5903; [8587] = 8788; [9587] = 9621;
[8628] = 8799; [11121] = 11068; [11138] = 11198; [8859] = 8861; [9616] = 9887; [8616] = 8974; [13718] = 13888; [7992] = 8022; [13826] = 13830; [9137] = 9143;
[4822] = 4980; [8137] = 8197; [5137] = 5195; [6948] = 7005; [5472] = 5564; [8377] = 8021; [7636] = 7724; [10966] = 11050; [8472] = 8912; [9690] = 9686;
[9919] = 9937; [13810] = 13812; [7417] = 7726; [4294] = 4428; [4851] = 4902; [10489] = 10602; [9256] = 9393; [5871] = 5970; [13736] = 13778; [8256] = 8257;
[4831] = 4950; [9597] = 9844; [4256] = 4390; [7536] = 7821; [6951] = 7002; [6991] = 7176; [10936] = 11158; [7991] = 8088; [3992] = 4037; [4991] = 5012;
[3991] = 4043; [5752] = 5833; [13678] = 13853; [9571] = 9650; [13716] = 13833; [7730] = 7780; [5748] = 5907; [9730] = 9792; [17686] = 17914; [7604] = 7808;
[13733] = 13780; [13682] = 13868; [9836] = 9841; [9490] = 9809; [8490] = 8703; [8217] = 8223; [9719] = 9779; [9217] = 9449; [6217] = 6086; [10766] = 10880;
[9716] = 9773; [5504] = 5548; [4363] = 4494; [9037] = 9038; [8037] = 8103; [10904] = 10906; [8677] = 8752; [10408] = 10689; [9351] = 9421; [13813] = 13815;
[13717] = 13785; [8351] = 8347; [7557] = 7816; [7602] = 7810; [7317] = 7318; [4351] = 4483; [6952] = 7003; [4317] = 4451; [7263] = 7279; [13680] = 13869;
[8352] = 8359; [4263] = 4397; [10930] = 11054; [4331] = 4465; [4872] = 4924; [8521] = 8830; [9216] = 9457; [11351] = 11222; [11288] = 10895; [6324] = 6380;
[4897] = 4905; [6897] = 6902; [8451] = 8973; [7451] = 7815; [4884] = 5054; [6884] = 6896; [6236] = 6240; [9236] = 9402; [4324] = 4458; [9304] = 9376;
[13723] = 13819; [7470] = 7799; [8630] = 8798; [7452] = 7794; [8452] = 8606; [8421] = 8692; [7421] = 7809; [8380] = 8381; [10940] = 11191; [13742] = 13764;
[11363] = 11398; [7591] = 7830; [9224] = 9394; [9551] = 9883; [9083] = 9084; [7997] = 8362; [4352] = 4484; [17597] = 17837; [10362] = 10325; [11113] = 11197;
[5117] = 5194; [9136] = 9142; [9330] = 9432; [4330] = 4464; [9552] = 9884; [8552] = 8763; [8531] = 8775; [7337] = 7338; [4664] = 4665; [9337] = 9433;
[5156] = 5162; [4156] = 4157; [4337] = 4470; [10363] = 10326; [7651] = 7699; [4890] = 4946; [8857] = 8862; [9617] = 9888; [17683] = 17720; [9492] = 9794;
[13882] = 13842; [9652] = 9799; [8631] = 8800; [7631] = 7744; [13713] = 13843; [8056] = 8028; [4316] = 4375; [4296] = 4430; [10769] = 10894; [13691] = 13745;
[9316] = 9428; [11104] = 11341; [7990] = 8015; [4283] = 4417; [10751] = 10798; [10934] = 11219; [4990] = 5010; [4336] = 4469; [9957] = 9972; [10151] = 10161;
[6301] = 6500; [4301] = 4435; [4371] = 4501; [8148] = 8273; [5148] = 5359; [4242] = 4377; [7242] = 7140; [9022] = 9182; [9242] = 9401; [4282] = 4416;
[7464] = 7782; [8040] = 8104; [7371] = 7373; [8464] = 9157; [5119] = 5245; [7450] = 7814; [8450] = 8479; [10969] = 11166; [17677] = 17908; [7484] = 7773;
[11107] = 11108; [9484] = 9869; [10407] = 10688; [8091] = 8101; [13709] = 13835; [7248] = 7256; [8382] = 8384; [4585] = 4626; [4248] = 4383; [6122] = 6182;
[11342] = 11344; [7963] = 7964; [4332] = 4466; [10418] = 10727; [9071] = 9073; [10819] = 10881; [7071] = 7183; [8071] = 8106; [4262] = 4396; [10294] = 10299;
[4550] = 4561; [11287] = 11286; [5151] = 5241; [9585] = 9619; [6188] = 6190; [5188] = 5240; [13690] = 13773; [9219] = 9452; [8219] = 8222; [4843] = 4931;
[4131] = 4132; [4885] = 5053; [7042] = 7066; [4260] = 4394; [7863] = 7876; [8240] = 8241; [10017] = 9989; [10945] = 11016; [8586] = 8789; [4863] = 4934;
[10562] = 10598; [6280] = 6437; [4291] = 4425; [7251] = 7259; [7432] = 7738; [13751] = 13781; [9260] = 9380; [4297] = 4431; [9291] = 9447; [7048] = 7107;
[9248] = 9408; [11077] = 11058; [4271] = 4405; [10087] = 10168; [4322] = 4456; [5160] = 5335; [9231] = 9363; [9140] = 9146; [4168] = 4169; [8446] = 8605;
[9486] = 9641; [10351] = 10719; [8486] = 8749; [4280] = 4414; [8350] = 8358; [8532] = 8771; [4240] = 4450; [4350] = 4482; [9683] = 9866; [7984] = 8124;
[6984] = 7282; [10957] = 11378; [11229] = 11216; [8391] = 8696; [10066] = 10090; [4845] = 4914; [11115] = 11171; [7548] = 7774; [11367] = 11368; [7864] = 7875;
[6864] = 6870; [7865] = 7874; [13677] = 13867; [13710] = 13840; [8610] = 8918; [7632] = 7745; [8632] = 8801; [8850] = 8965; [8519] = 8897; [8983] = 9018;
[8845] = 8848; [6983] = 7283; [7983] = 8107; [6916] = 7225; [9954] = 10106; [8079] = 8110; [4563] = 4566; [11012] = 11270; [5115] = 5252; [5002] = 4939;
[9115] = 9161; [10638] = 10640; [4883] = 4929; [10491] = 10725; [6883] = 7114; [7854] = 7853; [17685] = 17742; [4854] = 5050; [4348] = 4480; [10971] = 11064;
[9946] = 10257; [4810] = 4915; [4832] = 4948; [7463] = 7793; [7057] = 7126; [4319] = 4453; [7383] = 7384; [8383] = 8385; [4852] = 4918; [7485] = 7776;
[11345] = 11346; [7852] = 7851; [11080] = 11178; [4846] = 4953; [7448] = 7817; [10938] = 11144; [13757] = 13881; [11137] = 11203; [7965] = 7966; [5003] = 4956;
[10694] = 10728; [9584] = 9620; [8584] = 8732; [7584] = 7716; [9348] = 9429; [8824] = 8903; [8003] = 8092; [10028] = 9967; [7475] = 7804; [11252] = 11267;
[8475] = 8915; [8678] = 8777; [4835] = 4941; [4349] = 4481; [11135] = 11200; [11111] = 11175; [10955] = 11397; [8523] = 8900; [10386] = 10731; [13673] = 13850;
[7444] = 7873; [8444] = 8908; [9735] = 9802; [7969] = 7970; [10840] = 10912; [7449] = 7813; [8449] = 8907; [4869] = 4954; [8466] = 8745; [6869] = 6995;
[5744] = 5826; [9744] = 9871; [10943] = 11142; [4275] = 4409; [9174] = 8831; [13693] = 13774; [7174] = 7366; [10083] = 10169; [6878] = 6890; [17607] = 17810;
[9723] = 9781; [8149] = 8274; [13738] = 13771; [9858] = 9811; [8858] = 8864; [7433] = 7740; [11083] = 11153; [4249] = 4384; [4535] = 4536; [9901] = 9963;
[11134] = 11278; [7249] = 7257; [10405] = 10687; [5801] = 5828; [4666] = 4667; [7544] = 7752; [8544] = 8739; [11117] = 11069; [8422] = 8693; [11116] = 11053;
[9601] = 9807; [6989] = 6906; [4374] = 4503; [9225] = 9409; [5313] = 5316; [4313] = 4447; [9313] = 9396; [8313] = 8316; [4302] = 4436; [6054] = 6177;
[7054] = 7339; [8054] = 8018; [9721] = 9638; [6233] = 6242; [4233] = 4234; [8433] = 8736; [7603] = 7807; [10917] = 10918; [3689] = 3690; [4325] = 4459;
[9715] = 9776; [10942] = 11168; [8154] = 8279; [9689] = 9687; [8049] = 8026; [11127] = 11180; [5333] = 5334; [4333] = 4467; [9205] = 9358; [8133] = 8144;
[13756] = 13879; [10354] = 10332; [6502] = 6506; [11343] = 11357; [9615] = 9658; [7254] = 7262; [10359] = 10692; [9276] = 9453; [4305] = 4439; [4254] = 4388;
[5033] = 5055; [11123] = 11192; [10929] = 11055; [9233] = 9356; [10767] = 10879; [3489] = 3490; [11118] = 11194; [4274] = 4408; [6213] = 6206; [8213] = 8224;
[9213] = 9455; [9489] = 9782; [8489] = 8700; [8515] = 8754; [4354] = 4486; [5176] = 5237; [9703] = 9785; [7967] = 7968; [9004] = 9013; [7950] = 7949;
[7945] = 7946; [8004] = 8161; [5004] = 5008; [7938] = 7937; [7889] = 7890; [10365] = 10328; [7882] = 7883; [7324] = 7325; [7880] = 7887; [7868] = 7870;
[7867] = 7871; [7866] = 7872; [7849] = 7850; [7011] = 7121; [10852] = 11186; [7755] = 7856; [7731] = 7781; [7729] = 7779; [7661] = 7723; [7660] = 7721;
[7650] = 7700; [11283] = 11361; [7635] = 7725; [9210] = 9465; [8210] = 8272; [7634] = 7775; [7630] = 7722; [7629] = 7777; [7616] = 7728; [4310] = 4444;
[7605] = 7739; [7601] = 7811; [7600] = 7806; [7593] = 7831; [7592] = 7828; [7585] = 7594; [13825] = 13829; [7579] = 7825; [7558] = 7742; [7555] = 7668;
[7553] = 7824; [4289] = 4423; [7552] = 7749; [7551] = 7750; [9289] = 9454; [7550] = 7751; [4288] = 4422; [7547] = 7748; [7546] = 7732; [7545] = 7747;
[17675] = 17811; [7537] = 7822; [13684] = 13776; [7486] = 7869; [10859] = 10803; [7483] = 7772; [8517] = 8898; [7482] = 7771; [7481] = 7770; [7480] = 7769;
[7479] = 7768; [8039] = 8100; [8172] = 8094; [7476] = 7765; [7474] = 7803; [4247] = 4382; [7472] = 7801; [7471] = 7800; [8128] = 8129; [7468] = 7888;
[6957] = 7293; [7466] = 7796; [5314] = 5315; [9064] = 9069; [7460] = 7790; [8002] = 8142; [13702] = 13885; [11258] = 11265; [9211] = 9466; [7457] = 7787;
[9722] = 9783; [7455] = 7785; [7453] = 7783; [9036] = 9147; [8036] = 8102; [10413] = 10330; [7447] = 7763; [7446] = 7762; [7442] = 7760; [7441] = 7759;
[7440] = 7758; [7438] = 7756; [7437] = 7754; [7436] = 7858; [7435] = 7746; [10958] = 11201; [7431] = 7737; [10935] = 11220; [7430] = 7736; [7429] = 7735;
[7428] = 7734; [9246] = 9403; [7424] = 7702; [7422] = 7805; [7419] = 7487; [11105] = 11213; [7416] = 7727; [8378] = 8379; [9057] = 9061; [8356] = 8105;
[6974] = 7113; [6915] = 7181; [8354] = 8348; [8353] = 8365; [11097] = 11157; [8333] = 8280; [8315] = 8318; [11230] = 11276; [8314] = 8317; [8311] = 8312;
[5795] = 5921; [13821] = 13849; [7051] = 7060; [8510] = 8760; [8305] = 8304; [8469] = 8747; [11073] = 11172; [8300] = 8301; [10815] = 11373; [8283] = 8284;
[8480] = 8690; [6900] = 6901; [8263] = 8267; [4278] = 4412; [8262] = 8270; [8260] = 8261; [9553] = 9845; [4285] = 4419; [5749] = 5918; [8254] = 8113;
[11364] = 11141; [8498] = 8705; [8246] = 8031; [10967] = 11066; [8236] = 8238; [8232] = 8233; [8228] = 8234; [4292] = 4426; [11071] = 11173; [8216] = 8227;
[10792] = 11218; [4258] = 4392; [8215] = 8226; [17673] = 17787; [4369] = 4499; [6871] = 7122; [9234] = 9397; [8202] = 8203; [10403] = 10690; [8201] = 8239;
[10865] = 11325; [6917] = 7180; [8200] = 8205; [8199] = 8204; [9000] = 9009; [10794] = 11331; [8186] = 8191; [7477] = 7766; [8477] = 8602; [13720] = 13837;
[4849] = 5018; [8171] = 8361; [7998] = 8095; [8165] = 8266; [8155] = 8276; [11095] = 11350; [9056] = 9060; [8152] = 8278; [8151] = 8268; [8150] = 8275;
[8147] = 8271; [4357] = 4488; [4358] = 4489; [8136] = 8138; [8135] = 8140; [8357] = 8360; [7469] = 7798; [11075] = 11062; [8080] = 8096; [8072] = 8143;
[11088] = 11282; [8070] = 8141; [10946] = 11403; [13887] = 13788; [8052] = 8017; [8051] = 8032; [4266] = 4400; [8048] = 8020; [4328] = 4462; [8046] = 8019;
[7478] = 7767; [8577] = 8743; [7549] = 7753; [10863] = 10922; [8035] = 8112; [6094] = 6144; [9094] = 9096; [11072] = 11061; [11260] = 11266; [11335] = 11109;
[6130] = 6255; [8010] = 8090; [8009] = 8030; [8008] = 8296; [4304] = 4438; [8006] = 8211; [8005] = 8097; [8458] = 8598; [7458] = 7788; [8001] = 8093;
[8585] = 8733; [7996] = 8099; [7995] = 8029; [9732] = 9791; [17676] = 17727; [7989] = 8014; [7988] = 8089; [7987] = 8109; [7985] = 8258; [7978] = 8108;
[10860] = 10805; [7370] = 7374; [7369] = 7375; [7364] = 7365; [7362] = 7363; [9578] = 9627; [8398] = 8778; [10364] = 10327; [7359] = 7360; [7357] = 7358;
[11122] = 11193; [6981] = 7281; [9302] = 9371; [7347] = 7346; [7336] = 7119; [7335] = 7341; [4276] = 4410; [7327] = 7328; [9062] = 8773; [7881] = 7855;
[6881] = 6892; [4269] = 4403; [6899] = 6904; [7098] = 7152; [7253] = 7261; [9710] = 9806; [8448] = 8906; [11128] = 11349; [7203] = 6895; [10230] = 10141;
[9173] = 8750; [4840] = 4911; [13818] = 13886; [7240] = 7241; [7220] = 7182; [7218] = 7136; [7217] = 7130; [9929] = 10251; [8609] = 8919; [10854] = 11188;
[7247] = 7255; [4364] = 4495; [7192] = 7194; [7191] = 7195; [8634] = 8967; [4346] = 4531; [4293] = 4427; [7100] = 7143; [11003] = 11057; [13683] = 13859;
[9725] = 9646; [9949] = 9964; [4253] = 4530; [9708] = 9810; [7056] = 7125; [7055] = 7116; [7053] = 7067; [4306] = 4440; [4841] = 4959; [8461] = 8766;
[9306] = 9398; [8306] = 8307; [8629] = 8796; [7049] = 7108; [6880] = 7106; [9254] = 9364; [7044] = 7168; [10926] = 11165; [10937] = 11067; [7036] = 7137;
[7022] = 7193; [4355] = 4534; [5355] = 5356; [7013] = 7348; [6990] = 7008; [8612] = 8779; [4246] = 4381; [5347] = 5348; [6988] = 6992; [9726] = 9867;
[9900] = 9936; [6982] = 7284; [7355] = 7356; [8355] = 8349; [6971] = 7174; [8860] = 8863; [7467] = 7797; [6956] = 7110; [7427] = 7733; [6950] = 7001;
[9002] = 9011; [9206] = 9467; [6945] = 7109; [8467] = 8753; [4834] = 4922; [9264] = 9474; [13689] = 13856; [8460] = 8756; [17944] = 17945; [6912] = 7177;
[8264] = 8265; [7264] = 7278; [5882] = 5884; [6882] = 6894; [6898] = 6903; [10965] = 11051; [6886] = 6911; [6885] = 7007; [6887] = 6893; [4842] = 4932;
[8053] = 8016; [8626] = 8797; [17678] = 17707; [11100] = 11183; [8255] = 8159; [7047] = 7061; [8047] = 8013; [9255] = 9392; [10849] = 10853; [5143] = 5242;
[8672] = 8768; [9117] = 9148; [4284] = 4418; [4862] = 4935; [6877] = 6889; [6876] = 7135; [10454] = 10732; [10818] = 10876; [9214] = 9463; [8214] = 8225;
[6867] = 6939; [4340] = 4473; [9709] = 9805; [13703] = 13857; [10871] = 10902; [11302] = 11309; [4264] = 4398; [9261] = 9400; [4314] = 4448; [5147] = 5263;
[6863] = 6927; [9119] = 9155; [13823] = 13827; [9284] = 9469; [7353] = 7354; [13737] = 13767; [5353] = 5354; [8542] = 8785; [5995] = 5997; [4353] = 4485;
[4341] = 4474; [9116] = 9156; [10961] = 10964; [9265] = 9473; [7514] = 7680; [8514] = 8776; [17582] = 17745; [6227] = 6244; [8440] = 8920; [13711] = 13883;
[5758] = 5915; [13814] = 13787; [10768] = 10882; [7064] = 7068; [10933] = 11216; [8562] = 8784; [9135] = 9141; [11106] = 11336; [8932] = 8933; [8411] = 8413;
[17594] = 17759; [8209] = 8269; [11005] = 11161; [10821] = 11250; [13816] = 13877; [9581] = 9629; [17670] = 17786; [6234] = 6241; [13824] = 13828; [9095] = 9097;
[8055] = 8027; [4360] = 4491; [4343] = 4476; [10848] = 11190; [10777] = 11375; [4312] = 4446; [9082] = 8949; [10778] = 11227; [9727] = 9789; [9076] = 9077;
[9072] = 8694; [8485] = 8699; [7580] = 7778; [9706] = 9803; [9580] = 9628; [10305] = 10304; [7461] = 7791; [4540] = 4541; [5747] = 5908; [4326] = 4460;
[4361] = 4492; [4342] = 4475; [10822] = 11251; [9243] = 9378; [7326] = 7329; [9249] = 9451; [8134] = 8139; [8153] = 8277; [13706] = 13838; [10956] = 11377;
[9342] = 9471; [3755] = 3756; [9042] = 9158; [8342] = 8366; [13719] = 13841; [4362] = 4493; [4827] = 4960; [9090] = 9091; [9714] = 9775; [4287] = 4421;
[10301] = 10302; [17684] = 17721; [9024] = 9183; [9023] = 9180; [5807] = 5910; [8522] = 8899; [4298] = 4432; [4373] = 4537; [4020] = 4061; [5105] = 5246;
[9908] = 9970; [8447] = 8601; [13871] = 13873; [8655] = 8762; [7186] = 7185; [9712] = 9800; [11124] = 11189; [9226] = 9470; [7434] = 7741; [11131] = 10800;
[8482] = 8691; [3814] = 3815; [9287] = 9461; [9003] = 9012; [8442] = 8909; [10353] = 10331; [6949] = 7000; [8198] = 8298; [9120] = 9160; [8882] = 8924;
[9212] = 9456; [8867] = 8950; [4334] = 4528; [9614] = 9662; [9570] = 9796; [4323] = 4457; [9251] = 9355; [4829] = 4951; [4273] = 4407; [7462] = 7792;
[8710] = 8711; [11094] = 11152; [4309] = 4443; [7046] = 7062; [8511] = 8761; [5046] = 5047; [8671] = 8769; [8664] = 8755; [5276] = 5284; [8547] = 8742;
[8663] = 8704; [7334] = 7340; [9582] = 9755; [10816] = 10878; [5134] = 5321; [4809] = 4904; [10834] = 10899; [8637] = 8772; [8050] = 8012; [9290] = 9448;
[8462] = 8757; [7050] = 7065; [6290] = 6505; [10862] = 11159; [8290] = 8291; [10451] = 10726; [10931] = 11221; [8624] = 8793; [10295] = 10298; [8622] = 8780;
[9493] = 9636; [4265] = 4399; [9530] = 9843; [7069] = 7070; [8000] = 8164; [8455] = 8894; [17674] = 17800; [8583] = 8731; [8582] = 8730; [11084] = 11170;
[8564] = 8803; [4368] = 4498; [8561] = 8783; [5112] = 5255; [4129] = 4130; [8555] = 8709; [8553] = 8764; [11074] = 11056; [4261] = 4395; [4327] = 4461;
[8541] = 8787; [8394] = 8823; [6873] = 6918; [8540] = 8791; [9222] = 9360; [8033] = 8346; [8524] = 8901; [9138] = 9144; [4281] = 4415; [5746] = 5830;
[10962] = 11338; [5860] = 5920; [10820] = 11249; [7041] = 7058; [8499] = 8929; [8497] = 8748; [4279] = 4413; [9070] = 9074; [17672] = 17789; [10866] = 11184;
[8281] = 8282; [9118] = 9149; [8474] = 8916; [8471] = 8600; [8470] = 8746; [5118] = 5209; [8463] = 8765; [10960] = 11415; [4230] = 4229; [7052] = 7129;
[6914] = 7179; [8453] = 8603; [8457] = 8904; [7250] = 7258; [9301] = 9373; [9250] = 9354; [10036] = 10272; [8441] = 8895; [9600] = 9643; [9262] = 9472;
[9285] = 9462; [9025] = 9177; [10954] = 11049; [10409] = 10495; [9591] = 9784; [10851] = 10909; [4250] = 4385; [5250] = 5251; [8392] = 8698; [10027] = 9939;
[4257] = 4391; [13735] = 13779; [13845] = 13847; [5038] = 5039; [8393] = 8697; [8396] = 8708; [8038] = 8125; [4370] = 4500; [13708] = 13834; [8390] = 8695;
[9288] = 9458; [10869] = 11181; [9747] = 9651; [13740] = 13750; [9736] = 9637; [7994] = 8297; [9150] = 9151; [5994] = 5996; [9731] = 9790; [9338] = 9399;
[11139] = 11160; [10300] = 10303; [13674] = 13848; [10756] = 10924; [13789] = 13851; [9724] = 9788; [4241] = 4376; [7456] = 7786; [4338] = 4471; [9269] = 9478;
[4870] = 4944; [9300] = 9370; [8456] = 8758; [11112] = 11063; [11129] = 11348; [10857] = 11205; [7993] = 8023; [5270] = 5281; [4252] = 4387; [9208] = 9446;
[4300] = 4434; [9005] = 9014; [4318] = 4452; [9252] = 9357; [4307] = 4441; [7252] = 7260; [11297] = 11300; [9602] = 9648; [10755] = 10883; [4359] = 4490;
[9696] = 9695; [10850] = 10919; [13698] = 13763; [13675] = 13852; [11136] = 11202; [5296] = 5307; [4875] = 4916; [8438] = 8770; [9693] = 9691; [9685] = 9684;
[9609] = 9877; [5146] = 5236; [4277] = 4411; [4653] = 4655; [9207] = 9468; [11306] = 11310; [9653] = 9654; [4308] = 4442; [9593] = 9813; [5754] = 5909;
[8844] = 8847; [8308] = 8309; [13704] = 13846; [11253] = 11263; [4844] = 4957; [8189] = 8193; [10771] = 10901; [4207] = 4036; [9729] = 9787; [10296] = 10297;
[4838] = 4940; [9491] = 9645; [4356] = 4487; [8473] = 8913; [7473] = 7802; [11365] = 11366; [11362] = 11399; [4538] = 4539; [9720] = 9639; [11010] = 11048;
[5767] = 5964; [8538] = 8792; [11326] = 11328; [11308] = 11307; [4866] = 4937; [6953] = 7004; [6866] = 7139; [5866] = 5880; [6507] = 6512; [5757] = 5914;
[4255] = 4389; [11133] = 11210; [5802] = 5832; [11119] = 11195; [10385] = 10721; [9008] = 9017; [4107] = 4035; [5107] = 5365; [5106] = 5264; [8518] = 8896;
[5862] = 5923; [9694] = 9692; [11096] = 11211; [11079] = 11059; [4820] = 4952; [11078] = 11070; [13700] = 13775; [10788] = 11369; [11076] = 11176; [5756] = 5913;
[9209] = 9459; [10970] = 11174; [8638] = 8911; [9027] = 9176; [4272] = 4406; [5796] = 5922; [9007] = 9016; [8007] = 8295; [9907] = 9935; [4311] = 4445;
[9218] = 9445; [6048] = 6131; [5108] = 5211; [5861] = 5899; [4329] = 4463; [6292] = 6503; [10858] = 11179; [8218] = 8221; [13686] = 13769; [4867] = 4938;
[3816] = 3817; [5009] = 4955; [10868] = 11182; [13688] = 13854; [9529] = 9531; [8529] = 8774; [5797] = 5925; [10404] = 10577; [10791] = 10801; [10790] = 11209;
[4290] = 4424; [4251] = 4386; [5167] = 5159; [13809] = 13811; [10750] = 10799; [4270] = 4404; [10453] = 10733; [4372] = 4502; [9707] = 9804; [5753] = 5834;
[10387] = 10329; [6229] = 6246; [5707] = 5905; [13685] = 13858; [5297] = 5320; [4163] = 4164; [10968] = 11199; [13734] = 13768; [3707] = 3708; [6189] = 6191;
[9718] = 9778; [4865] = 4936; [9608] = 9657; [6944] = 7111;
}
|
local local0 = 0.3
local local1 = 0.3 - local0
local local2 = 0.3 - local0
local local3 = 0.3 - local0
local local4 = 0.3 - local0
local local5 = 4.7 - local0
local local6 = 0.3 - local0
local local7 = 4.6 - local0
local local8 = 0.3 - local0
local local9 = 0.3 - local0
local local10 = 0.3 - local0
local local11 = 0.3 - local0
local local12 = 0.3 - local0
local local13 = 4.1 - local0
local local14 = 0.3 - local0
local local15 = 2.8 - local0
local local16 = 0.3 - local0
local local17 = 0.3 - local0
local local18 = 0.3 - local0
local local19 = 0.3 - local0
local local20 = 0.3 - local0
local local21 = 5.2 - local0
local local22 = 0.3 - local0
local local23 = 5.1 - local0
local local24 = 0.3 - local0
local local25 = 6.3 - local0
local local26 = 0.3 - local0
local local27 = 4.2 - local0
local local28 = 0.3 - local0
local local29 = 5.5 - local0
local local30 = 0.3 - local0
local local31 = 0.3 - local0
local local32 = 5 - local0
local local33 = 0.3 - local0
local local34 = 0.3 - local0
local local35 = 0.3 - local0
local local36 = 5.6 - local0
local local37 = 0.3 - local0
local local38 = 0.3 - local0
local local39 = 3 - local0
local local40 = 0.3 - local0
local local41 = 3.3 - local0
local local42 = 0.3 - local0
local local43 = 0.3 - local0
local local44 = 0.3 - local0
local local45 = 15.5 - local0
local local46 = 0.3 - local0
local local47 = 0.3 - local0
local local48 = 5.4 - local0
local local49 = 0.3 - local0
local local50 = 7.8 - local0
local local51 = 0.3 - local0
local local52 = 5.6 - local0
local local53 = 0.3 - local0
local local54 = 8.8 - local0
local local55 = 0.3 - local0
local local56 = 5.3 - local0
local local57 = 0.3 - local0
local local58 = 0.3 - local0
local local59 = 4.8 - local0
local local60 = 0.3 - local0
local local61 = 0.3 - local0
local local62 = 0.3 - local0
local local63 = 0.3 - local0
local local64 = 0.3 - local0
local local65 = 0.3 - local0
local local66 = 0.3 - local0
local local67 = 0.3 - local0
local local68 = 0.3 - local0
local local69 = 0.3 - local0
local local70 = 0.3 - local0
local local71 = 15.5 - local0
local local72 = 0.3 - local0
local local73 = 9.2 - local0
local local74 = 0.3 - local0
local local75 = 20.5 - local0
local local76 = 0.3 - local0
local local77 = 0.3 - local0
local local78 = 12.2 - local0
function OnIf_452000(arg0, arg1, arg2)
if arg2 == 0 then
WomanHumter452000_ActAfter_RealTime(arg0, arg1)
end
return
end
function WomanHumter452000Battle_Activate(arg0, arg1)
local local0 = {}
local local1 = {}
local local2 = {}
Common_Clear_Param(local0, local1, local2)
local local3 = arg0:GetHpRate(TARGET_SELF)
local local4 = arg0:GetDist(TARGET_ENE_0)
local local5 = arg0:GetRandam_Int(1, 100)
local local6 = arg0:GetEventRequest(0)
local local7 = arg0:GetEventRequest(1)
local local8 = arg0:GetNumber(0)
arg0:AddObserveSpecialEffect(TARGET_SELF, AI_SPEFFOBSERVE_SpEffId, 5025)
arg0:AddObserveSpecialEffect(TARGET_SELF, AI_SPEFFOBSERVE_SpEffId, 5026)
arg0:AddObserveSpecialEffect(TARGET_SELF, AI_SPEFFOBSERVE_SpEffId, 5027)
arg0:DeleteObserveSpecialEffect(TARGET_ENE_0, AI_SPEFFOBSERVE_SpEffId, 52)
if arg0:GetNumber(2) == 0 then
arg0:SetTimer(0, 35)
arg0:SetNumber(2, 1)
end
if not arg0:HasSpecialEffectId(TARGET_SELF, 5402) and not arg0:HasSpecialEffectId(TARGET_SELF, 5403) and local3 <= 0.6 then
local0[30] = 100
elseif not arg0:HasSpecialEffectId(TARGET_SELF, 5403) and local3 <= 0.3 then
local0[23] = 100
elseif arg0:IsInsideTarget(TARGET_ENE_0, AI_DIR_TYPE_B, 120) then
local0[25] = 100
elseif arg0:HasSpecialEffectId(TARGET_SELF, 5400) then
if 12 <= local4 then
local0[1] = 0
local0[2] = 0
local0[3] = 40
local0[4] = 0
local0[5] = 0
local0[6] = 40
local0[7] = 20
local0[20] = 50
elseif 9 <= local4 then
local0[1] = 0
local0[2] = 0
local0[3] = 35
local0[4] = 0
local0[5] = 30
local0[6] = 20
local0[7] = 15
local0[20] = 50
elseif 6 <= local4 then
local0[1] = 30
local0[2] = 10
local0[3] = 0
local0[4] = 30
local0[5] = 20
local0[6] = 0
local0[7] = 10
local0[20] = 50
elseif 3 <= local4 then
local0[1] = 30
local0[2] = 25
local0[3] = 0
local0[4] = 20
local0[5] = 10
local0[6] = 0
local0[7] = 15
local0[20] = 50
else
local0[1] = 30
local0[2] = 40
local0[3] = 0
local0[4] = 10
local0[5] = 20
local0[6] = 0
local0[7] = 0
local0[20] = 50
end
elseif arg0:HasSpecialEffectId(TARGET_SELF, 5401) then
if 15 <= local4 then
local0[10] = 10
local0[11] = 5
local0[12] = 5
local0[13] = 5
local0[14] = 5
local0[15] = 5
local0[16] = 5
local0[17] = 35
local0[18] = 2
local0[24] = 23
local0[20] = 50
elseif 12 <= local4 then
local0[10] = 10
local0[11] = 10
local0[12] = 5
local0[13] = 5
local0[14] = 5
local0[15] = 5
local0[16] = 15
local0[17] = 30
local0[18] = 0
local0[24] = 15
local0[20] = 50
elseif 9 <= local4 then
local0[10] = 25
local0[11] = 15
local0[12] = 10
local0[13] = 0
local0[14] = 0
local0[15] = 0
local0[16] = 10
local0[17] = 15
local0[18] = 5
local0[24] = 20
local0[20] = 50
elseif 6 <= local4 then
local0[10] = 25
local0[11] = 20
local0[12] = 10
local0[13] = 5
local0[14] = 5
local0[15] = 10
local0[16] = 5
local0[17] = 0
local0[18] = 5
local0[24] = 15
local0[20] = 50
elseif 3 <= local4 then
local0[10] = 20
local0[11] = 10
local0[12] = 15
local0[13] = 15
local0[14] = 10
local0[15] = 10
local0[16] = 10
local0[17] = 0
local0[18] = 0
local0[24] = 10
local0[20] = 50
else
local0[10] = 10
local0[11] = 15
local0[12] = 15
local0[13] = 15
local0[14] = 10
local0[15] = 10
local0[16] = 10
local0[17] = 0
local0[18] = 0
local0[24] = 0
local0[20] = 50
end
elseif arg0:HasSpecialEffectId(TARGET_SELF, 5402) then
if 15 <= local4 then
local0[10] = 10
local0[11] = 5
local0[12] = 5
local0[13] = 5
local0[14] = 5
local0[15] = 5
local0[16] = 5
local0[17] = 35
local0[18] = 5
local0[19] = 0
local0[24] = 10
local0[26] = 0
local0[27] = 0
local0[28] = 7
local0[29] = 3
elseif 12 <= local4 then
local0[10] = 8
local0[11] = 7
local0[12] = 5
local0[13] = 5
local0[14] = 5
local0[15] = 5
local0[16] = 10
local0[17] = 15
local0[18] = 0
local0[19] = 20
local0[24] = 10
local0[26] = 0
local0[27] = 0
local0[28] = 5
local0[29] = 5
elseif 9 <= local4 then
local0[10] = 20
local0[11] = 15
local0[12] = 10
local0[13] = 0
local0[14] = 0
local0[15] = 0
local0[16] = 5
local0[17] = 10
local0[18] = 5
local0[19] = 15
local0[24] = 0
local0[26] = 0
local0[27] = 0
local0[28] = 10
local0[29] = 10
elseif 6 <= local4 then
local0[10] = 18
local0[11] = 14
local0[12] = 8
local0[13] = 5
local0[14] = 4
local0[15] = 4
local0[16] = 4
local0[17] = 0
local0[18] = 4
local0[19] = 4
local0[24] = 15
local0[26] = 0
local0[27] = 5
local0[28] = 5
local0[29] = 10
elseif 3 <= local4 then
local0[10] = 15
local0[11] = 10
local0[12] = 15
local0[13] = 15
local0[14] = 5
local0[15] = 5
local0[16] = 0
local0[17] = 0
local0[18] = 0
local0[19] = 0
local0[24] = 10
local0[26] = 10
local0[27] = 5
local0[28] = 5
local0[29] = 5
else
local0[10] = 10
local0[11] = 15
local0[12] = 10
local0[13] = 15
local0[14] = 10
local0[15] = 10
local0[16] = 5
local0[17] = 0
local0[18] = 0
local0[19] = 0
local0[24] = 0
local0[26] = 5
local0[27] = 10
local0[28] = 5
local0[29] = 5
end
elseif 15 <= local4 then
local0[10] = 10
local0[11] = 5
local0[12] = 5
local0[13] = 5
local0[14] = 5
local0[15] = 5
local0[16] = 5
local0[17] = 35
local0[18] = 5
local0[19] = 0
local0[22] = 0
local0[24] = 0
local0[26] = 0
local0[27] = 2
local0[28] = 5
local0[29] = 10
local0[31] = 3
elseif 12 <= local4 then
local0[10] = 8
local0[11] = 7
local0[12] = 5
local0[13] = 5
local0[14] = 5
local0[15] = 5
local0[16] = 5
local0[17] = 15
local0[18] = 0
local0[19] = 20
local0[22] = 0
local0[24] = 10
local0[26] = 0
local0[27] = 0
local0[28] = 3
local0[29] = 7
local0[31] = 5
elseif 9 <= local4 then
local0[10] = 10
local0[11] = 5
local0[12] = 10
local0[13] = 0
local0[14] = 0
local0[15] = 0
local0[16] = 5
local0[17] = 10
local0[18] = 5
local0[19] = 15
local0[22] = 10
local0[24] = 0
local0[26] = 0
local0[27] = 10
local0[28] = 10
local0[29] = 10
local0[31] = 0
elseif 6 <= local4 then
local0[10] = 16
local0[11] = 12
local0[12] = 6
local0[13] = 5
local0[14] = 3
local0[15] = 4
local0[16] = 4
local0[17] = 0
local0[18] = 3
local0[19] = 4
local0[22] = 8
local0[24] = 15
local0[26] = 0
local0[27] = 5
local0[28] = 5
local0[29] = 5
local0[31] = 5
elseif 3 <= local4 then
local0[10] = 10
local0[11] = 10
local0[12] = 10
local0[13] = 10
local0[14] = 5
local0[15] = 5
local0[16] = 0
local0[17] = 0
local0[18] = 0
local0[19] = 0
local0[22] = 0
local0[24] = 8
local0[26] = 7
local0[27] = 10
local0[28] = 5
local0[29] = 5
local0[31] = 15
else
local0[10] = 10
local0[11] = 15
local0[12] = 10
local0[13] = 15
local0[14] = 10
local0[15] = 10
local0[16] = 5
local0[17] = 0
local0[18] = 0
local0[19] = 0
local0[22] = 0
local0[24] = 0
local0[26] = 5
local0[27] = 5
local0[28] = 5
local0[29] = 5
local0[31] = 5
end
if local8 == 1 and 0 < local0[1] then
local0[1] = 1
end
if local8 == 2 and 0 < local0[2] then
local0[2] = 1
end
if local8 == 3 and 0 < local0[3] then
local0[3] = 1
end
if local8 == 4 and 0 < local0[4] then
local0[4] = 1
end
if local8 == 5 and 0 < local0[5] then
local0[5] = 1
end
if local8 == 6 and 0 < local0[6] then
local0[6] = 1
end
if local8 == 7 and 0 < local0[7] then
local0[7] = 1
end
if local8 == 10 and 0 < local0[10] then
local0[10] = 1
end
if local8 == 11 and 0 < local0[11] then
local0[11] = 1
end
if local8 == 12 and 0 < local0[12] then
local0[12] = 1
end
if local8 == 13 and 0 < local0[13] then
local0[13] = 1
end
if local8 == 14 and 0 < local0[14] then
local0[14] = 1
end
if local8 == 15 and 0 < local0[15] then
local0[15] = 1
end
if local8 == 16 and 0 < local0[16] then
local0[16] = 1
end
if local8 == 17 and 0 < local0[17] then
local0[17] = 1
end
if local8 == 18 and 0 < local0[18] then
local0[18] = 1
end
if local8 == 19 and 0 < local0[19] then
local0[19] = 1
end
if local8 == 21 and 0 < local0[21] then
local0[21] = 1
end
if local8 == 22 and 0 < local0[22] then
local0[22] = 1
end
if local8 == 24 and 0 < local0[24] then
local0[24] = 1
end
if local8 == 26 and 0 < local0[26] then
local0[26] = 1
end
if local8 == 27 and 0 < local0[27] then
local0[27] = 1
end
if local8 == 28 and 0 < local0[28] then
local0[28] = 1
end
if local8 == 29 and 0 < local0[29] then
local0[29] = 1
end
if local8 == 31 and 0 < local0[31] then
local0[31] = 1
end
if arg0:IsFinishTimer(0) == false then
local0[20] = 0
end
local1[1] = REGIST_FUNC(arg0, arg1, WomanHumter452000_Act01)
local1[2] = REGIST_FUNC(arg0, arg1, WomanHumter452000_Act02)
local1[3] = REGIST_FUNC(arg0, arg1, WomanHumter452000_Act03)
local1[4] = REGIST_FUNC(arg0, arg1, WomanHumter452000_Act04)
local1[5] = REGIST_FUNC(arg0, arg1, WomanHumter452000_Act05)
local1[6] = REGIST_FUNC(arg0, arg1, WomanHumter452000_Act06)
local1[7] = REGIST_FUNC(arg0, arg1, WomanHumter452000_Act07)
local1[10] = REGIST_FUNC(arg0, arg1, WomanHumter452000_Act10)
local1[11] = REGIST_FUNC(arg0, arg1, WomanHumter452000_Act11)
local1[12] = REGIST_FUNC(arg0, arg1, WomanHumter452000_Act12)
local1[13] = REGIST_FUNC(arg0, arg1, WomanHumter452000_Act13)
local1[14] = REGIST_FUNC(arg0, arg1, WomanHumter452000_Act14)
local1[15] = REGIST_FUNC(arg0, arg1, WomanHumter452000_Act15)
local1[16] = REGIST_FUNC(arg0, arg1, WomanHumter452000_Act16)
local1[17] = REGIST_FUNC(arg0, arg1, WomanHumter452000_Act17)
local1[18] = REGIST_FUNC(arg0, arg1, WomanHumter452000_Act18)
local1[19] = REGIST_FUNC(arg0, arg1, WomanHumter452000_Act19)
local1[20] = REGIST_FUNC(arg0, arg1, WomanHumter452000_Act20)
local1[21] = REGIST_FUNC(arg0, arg1, WomanHumter452000_Act21)
local1[22] = REGIST_FUNC(arg0, arg1, WomanHumter452000_Act22)
local1[23] = REGIST_FUNC(arg0, arg1, WomanHumter452000_Act23)
local1[24] = REGIST_FUNC(arg0, arg1, WomanHumter452000_Act24)
local1[25] = REGIST_FUNC(arg0, arg1, WomanHumter452000_Act25)
local1[26] = REGIST_FUNC(arg0, arg1, WomanHumter452000_Act26)
local1[27] = REGIST_FUNC(arg0, arg1, WomanHumter452000_Act27)
local1[28] = REGIST_FUNC(arg0, arg1, WomanHumter452000_Act28)
local1[29] = REGIST_FUNC(arg0, arg1, WomanHumter452000_Act29)
local1[30] = REGIST_FUNC(arg0, arg1, WomanHumter452000_Act30)
local1[31] = REGIST_FUNC(arg0, arg1, WomanHumter452000_Act31)
Common_Battle_Activate(arg0, arg1, local0, local1, REGIST_FUNC(arg0, arg1, WomanHumter452000_ActAfter_AdjustSpace), local2)
return
end
local0 = 6 - local0
function WomanHumter452000_Act01(arg0, arg1, arg2)
Approach_Act(arg0, arg1, UPVAL0, 999, 0, 2)
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3000, TARGET_ENE_0, UPVAL0 + 10, 0, 0)
arg0:SetNumber(0, 1)
GetWellSpace_Odds = 0
return GetWellSpace_Odds
end
local0 = 4.7 - local0
function WomanHumter452000_Act02(arg0, arg1, arg2)
Approach_Act(arg0, arg1, UPVAL0, 999, 0, 2)
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3005, TARGET_ENE_0, UPVAL0 + 0.5, 0, -1)
arg0:SetNumber(0, 2)
GetWellSpace_Odds = 0
return GetWellSpace_Odds
end
local0 = 12.7 - local0
function WomanHumter452000_Act03(arg0, arg1, arg2)
Approach_Act(arg0, arg1, UPVAL0, 999, 0, 2)
arg1:AddSubGoal(GOAL_COMMON_AttackTunableSpin, 10, 3007, TARGET_ENE_0, UPVAL0 + 0.5, 0, -1)
arg0:SetNumber(0, 3)
GetWellSpace_Odds = 0
return GetWellSpace_Odds
end
local0 = 4.9 - local0
function WomanHumter452000_Act04(arg0, arg1, arg2)
local local0 = UPVAL0 + 0.5
Approach_Act(arg0, arg1, UPVAL0, 999, 0, 2)
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3008, TARGET_ENE_0, local0, 0, -1)
arg1:AddSubGoal(GOAL_COMMON_ComboFinal, 10, 3009, TARGET_ENE_0, local0, 0)
arg0:SetNumber(0, 4)
GetWellSpace_Odds = 30
return GetWellSpace_Odds
end
local0 = 15.5 - local0
function WomanHumter452000_Act05(arg0, arg1, arg2)
local local0 = arg0:GetRandam_Int(1, 100)
local local1 = arg0:IsExistMeshOnLine(TARGET_SELF, AI_DIR_TYPE_L, 0)
local local2 = arg0:IsExistMeshOnLine(TARGET_SELF, AI_DIR_TYPE_R, 0)
local local3 = arg0:IsExistMeshOnLine(TARGET_SELF, AI_DIR_TYPE_F, 0)
local local4 = 700
if 5 <= arg0:GetDist(TARGET_ENE_0) then
if local1 == false and local2 == false then
local4 = 701
elseif local2 == true and local1 == true then
if local0 <= 50 then
local4 = 702
else
local4 = 703
end
elseif local2 == false then
local4 = 702
else
local4 = 703
end
elseif arg0:IsExistMeshOnLine(TARGET_SELF, AI_DIR_TYPE_B, 0) == false then
if local1 == true and local2 == true then
if local0 <= 50 then
local4 = 702
else
local4 = 703
end
elseif local2 == false then
local4 = 702
else
local4 = 703
end
else
local4 = 701
end
if local0 <= 40 then
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 1.5, local4, TARGET_ENE_0, 0, AI_DIR_TYPE_B, 0)
else
Approach_Act(arg0, arg1, UPVAL0, 999, 0, 2)
end
arg1:AddSubGoal(GOAL_COMMON_AttackTunableSpin, 10, 3012, TARGET_ENE_0, UPVAL0 + 0.5, 0, -1)
GetWellSpace_Odds = 0
return GetWellSpace_Odds
end
local0 = 19.5 - local0
function WomanHumter452000_Act06(arg0, arg1, arg2)
Approach_Act(arg0, arg1, UPVAL0, 999, 0, 2)
arg1:AddSubGoal(GOAL_COMMON_AttackTunableSpin, 10, 3013, TARGET_ENE_0, UPVAL0 + 0.5, 0, -1)
arg0:SetNumber(0, 6)
GetWellSpace_Odds = 100
return GetWellSpace_Odds
end
local0 = 3.6 - local0
local0 = 3.6 - local0
local0 = local7
function WomanHumter452000_Act07(arg0, arg1, arg2)
local local0 = arg0:GetDist(TARGET_ENE_0)
Approach_Act(arg0, arg1, UPVAL0 + 8.5, 999, 0, 2)
if arg0:GetRandam_Int(1, 100) <= 50 then
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 1.5, 700, TARGET_ENE_0, 0, AI_DIR_TYPE_F, 0)
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3002, TARGET_ENE_0, UPVAL0 + 0.5, 0, -1)
arg1:AddSubGoal(GOAL_COMMON_ComboFinal, 10, 3004, TARGET_ENE_0, UPVAL2 + 0.5, 0)
else
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 1.5, 700, TARGET_ENE_0, 0, AI_DIR_TYPE_F, 0)
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3001, TARGET_ENE_0, UPVAL1 + 0.5, 0, -1)
end
arg0:SetNumber(0, 7)
GetWellSpace_Odds = 0
return GetWellSpace_Odds
end
local0 = 5.4 - local0
local0 = local48
local0 = local50
local0 = local54
local0 = local56
local0 = local45
local0 = 6 - local0
local0 = local21
local0 = local23
local0 = local27
local0 = local29
function WomanHumter452000_Act10(arg0, arg1, arg2)
local local0 = arg0:GetRandam_Int(1, 100)
local local1 = UPVAL0 + 0.5
local local2 = UPVAL1 + 0.5
local local3 = UPVAL2 + 0.5
local local4 = UPVAL3 + 0.5
local local5 = UPVAL4 + 0.5
local local6 = UPVAL5 + 0.5
local local7 = 45
local local8 = UPVAL0
if arg0:HasSpecialEffectId(TARGET_SELF, 5401) then
local1 = UPVAL6 + 0.5
local2 = UPVAL7 + 0.5
local3 = UPVAL8 + 0.5
local4 = UPVAL9 + 0.5
local5 = UPVAL10 + 0.5
local8 = UPVAL6
end
Approach_Act(arg0, arg1, local8, 999, 0, 2)
if arg0:HasSpecialEffectId(TARGET_SELF, 5401) then
if local0 <= 5 then
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3000, TARGET_ENE_0, local1, 0, local7)
arg1:AddSubGoal(GOAL_COMMON_ComboFinal, 10, 3001, TARGET_ENE_0, local2, 0)
elseif local0 <= 15 then
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3000, TARGET_ENE_0, local1, 0, local7)
arg1:AddSubGoal(GOAL_COMMON_ComboRepeat, 10, 3001, TARGET_ENE_0, local2, 0)
arg1:AddSubGoal(GOAL_COMMON_ComboFinal, 10, 3005, TARGET_ENE_0, local5, 0)
elseif local0 <= 30 then
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3000, TARGET_ENE_0, local1, 0, local7)
arg1:AddSubGoal(GOAL_COMMON_ComboRepeat, 10, 3001, TARGET_ENE_0, local2, 0)
arg1:AddSubGoal(GOAL_COMMON_ComboFinal, 10, 3004, TARGET_ENE_0, local4, 0)
elseif local0 <= 40 then
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3000, TARGET_ENE_0, local1, 0, local7)
arg1:AddSubGoal(GOAL_COMMON_ComboRepeat, 10, 3001, TARGET_ENE_0, local2, 0)
arg1:AddSubGoal(GOAL_COMMON_ComboRepeat, 10, 3004, TARGET_ENE_0, local4, 0)
arg1:AddSubGoal(GOAL_COMMON_ComboFinal, 10, 3022, TARGET_ENE_0, local6, 0)
elseif local0 <= 55 then
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3000, TARGET_ENE_0, local1, 0, local7)
arg1:AddSubGoal(GOAL_COMMON_ComboFinal, 10, 3002, TARGET_ENE_0, local3, 0)
elseif local0 <= 65 then
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3000, TARGET_ENE_0, local1, 0, local7)
arg1:AddSubGoal(GOAL_COMMON_ComboRepeat, 10, 3002, TARGET_ENE_0, local3, 0)
arg1:AddSubGoal(GOAL_COMMON_ComboFinal, 10, 3005, TARGET_ENE_0, local5, 0)
elseif local0 <= 80 then
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3000, TARGET_ENE_0, local1, 0, local7)
arg1:AddSubGoal(GOAL_COMMON_ComboRepeat, 10, 3002, TARGET_ENE_0, local3, 0)
arg1:AddSubGoal(GOAL_COMMON_ComboFinal, 10, 3004, TARGET_ENE_0, local4, 0)
elseif local0 <= 90 then
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3000, TARGET_ENE_0, local1, 0, local7)
arg1:AddSubGoal(GOAL_COMMON_ComboRepeat, 10, 3002, TARGET_ENE_0, local3, 0)
arg1:AddSubGoal(GOAL_COMMON_ComboRepeat, 10, 3004, TARGET_ENE_0, local4, 0)
arg1:AddSubGoal(GOAL_COMMON_ComboFinal, 10, 3022, TARGET_ENE_0, local6, 0)
else
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3000, TARGET_ENE_0, local1, 0, local7)
arg1:AddSubGoal(GOAL_COMMON_ComboFinal, 10, 3022, TARGET_ENE_0, local6, 0)
end
elseif local0 <= 5 then
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3000, TARGET_ENE_0, local1, 0, local7)
elseif local0 <= 15 then
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3000, TARGET_ENE_0, local1, 0, local7)
arg1:AddSubGoal(GOAL_COMMON_ComboRepeat, 10, 3001, TARGET_ENE_0, local2, 0)
arg1:AddSubGoal(GOAL_COMMON_ComboFinal, 10, 3005, TARGET_ENE_0, local5, 0)
elseif local0 <= 30 then
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3000, TARGET_ENE_0, local1, 0, local7)
arg1:AddSubGoal(GOAL_COMMON_ComboRepeat, 10, 3001, TARGET_ENE_0, local2, 0)
arg1:AddSubGoal(GOAL_COMMON_ComboFinal, 10, 3004, TARGET_ENE_0, local4, 0)
elseif local0 <= 50 then
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3000, TARGET_ENE_0, local1, 0, local7)
arg1:AddSubGoal(GOAL_COMMON_ComboFinal, 10, 3001, TARGET_ENE_0, local2, 0)
elseif local0 <= 60 then
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3000, TARGET_ENE_0, local1, 0, local7)
arg1:AddSubGoal(GOAL_COMMON_ComboFinal, 10, 3002, TARGET_ENE_0, local3, 0)
elseif local0 <= 80 then
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3000, TARGET_ENE_0, local1, 0, local7)
arg1:AddSubGoal(GOAL_COMMON_ComboRepeat, 10, 3002, TARGET_ENE_0, local3, 0)
arg1:AddSubGoal(GOAL_COMMON_ComboFinal, 10, 3005, TARGET_ENE_0, local5, 0)
else
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3000, TARGET_ENE_0, local1, 0, local7)
arg1:AddSubGoal(GOAL_COMMON_ComboRepeat, 10, 3002, TARGET_ENE_0, local3, 0)
arg1:AddSubGoal(GOAL_COMMON_ComboFinal, 10, 3004, TARGET_ENE_0, local4, 0)
end
GetWellSpace_Odds = 15
return GetWellSpace_Odds
end
local0 = local48
local0 = local54
local0 = local56
local0 = local45
local0 = local21
local0 = local27
local0 = local29
function WomanHumter452000_Act11(arg0, arg1, arg2)
local local0 = arg0:GetRandam_Int(1, 100)
local local1 = UPVAL0 + 0.5
local local2 = UPVAL1 + 0.5
local local3 = UPVAL2 + 0.5
local local4 = 45
local local5 = UPVAL0
if arg0:HasSpecialEffectId(TARGET_SELF, 5401) then
local1 = UPVAL4 + 0.5
local2 = UPVAL5 + 0.5
local3 = UPVAL6 + 0.5
local5 = UPVAL4
end
Approach_Act(arg0, arg1, local5, 999, 0, 2)
if arg0:HasSpecialEffectId(TARGET_SELF, 5401) then
if local0 <= 10 then
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3001, TARGET_ENE_0, local1, 0, local4)
elseif local0 <= 40 then
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3001, TARGET_ENE_0, local1, 0, local4)
arg1:AddSubGoal(GOAL_COMMON_ComboFinal, 10, 3005, TARGET_ENE_0, local3, 0)
elseif local0 <= 70 then
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3001, TARGET_ENE_0, local1, 0, local4)
arg1:AddSubGoal(GOAL_COMMON_ComboFinal, 10, 3004, TARGET_ENE_0, local2, 0)
else
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3001, TARGET_ENE_0, local1, 0, local4)
arg1:AddSubGoal(GOAL_COMMON_ComboRepeat, 10, 3004, TARGET_ENE_0, local2, 0)
arg1:AddSubGoal(GOAL_COMMON_ComboFinal, 10, 3022, TARGET_ENE_0, UPVAL3 + 0.5, 0)
end
elseif local0 <= 15 then
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3001, TARGET_ENE_0, local1, 0, local4)
elseif local0 <= 60 then
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3001, TARGET_ENE_0, local1, 0, local4)
arg1:AddSubGoal(GOAL_COMMON_ComboFinal, 10, 3005, TARGET_ENE_0, local3, 0)
else
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3001, TARGET_ENE_0, local1, 0, local4)
arg1:AddSubGoal(GOAL_COMMON_ComboFinal, 10, 3004, TARGET_ENE_0, local2, 0)
end
GetWellSpace_Odds = 15
return GetWellSpace_Odds
end
local0 = local50
local0 = local54
local0 = local56
local0 = local45
local0 = local23
local0 = local27
local0 = local29
function WomanHumter452000_Act12(arg0, arg1, arg2)
local local0 = arg0:GetRandam_Int(1, 100)
local local1 = UPVAL0 + 0.5
local local2 = UPVAL1 + 0.5
local local3 = UPVAL2 + 0.5
local local4 = 45
local local5 = UPVAL0
if arg0:HasSpecialEffectId(TARGET_SELF, 5401) then
local1 = UPVAL4 + 0.5
local2 = UPVAL5 + 0.5
local3 = UPVAL6 + 0.5
local5 = UPVAL4
end
Approach_Act(arg0, arg1, local5, 999, 0, 2)
if arg0:HasSpecialEffectId(TARGET_SELF, 5401) then
if local0 <= 20 then
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3002, TARGET_ENE_0, local1, 0, local4)
elseif local0 <= 60 then
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3002, TARGET_ENE_0, local1, 0, local4)
arg1:AddSubGoal(GOAL_COMMON_ComboFinal, 10, 3005, TARGET_ENE_0, local3, 0)
elseif local0 <= 80 then
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3002, TARGET_ENE_0, local1, 0, local4)
arg1:AddSubGoal(GOAL_COMMON_ComboFinal, 10, 3004, TARGET_ENE_0, local2, 0)
else
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3002, TARGET_ENE_0, local1, 0, local4)
arg1:AddSubGoal(GOAL_COMMON_ComboRepeat, 10, 3004, TARGET_ENE_0, local2, 0)
arg1:AddSubGoal(GOAL_COMMON_ComboFinal, 10, 3022, TARGET_ENE_0, UPVAL3 + 0.5, 0)
end
elseif local0 <= 20 then
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3002, TARGET_ENE_0, local1, 0, local4)
elseif local0 <= 60 then
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3002, TARGET_ENE_0, local1, 0, local4)
arg1:AddSubGoal(GOAL_COMMON_ComboFinal, 10, 3005, TARGET_ENE_0, local3, 0)
else
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3002, TARGET_ENE_0, local1, 0, local4)
arg1:AddSubGoal(GOAL_COMMON_ComboFinal, 10, 3004, TARGET_ENE_0, local2, 0)
end
GetWellSpace_Odds = 15
return GetWellSpace_Odds
end
local0 = local52
local0 = local25
function WomanHumter452000_Act13(arg0, arg1, arg2)
local local0 = UPVAL0 + 0.5
local local1 = UPVAL0 - 0.5
if arg0:HasSpecialEffectId(TARGET_SELF, 5401) then
local0 = UPVAL1 + 0.5
local1 = UPVAL1 - 0.5
end
Approach_Act(arg0, arg1, local1, 999, 0, 2)
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 3, 3003, TARGET_ENE_0, local0, 0, -1)
GetWellSpace_Odds = 0
return GetWellSpace_Odds
end
local0 = local54
local0 = local50
local0 = local45
local0 = local27
local0 = local23
function WomanHumter452000_Act14(arg0, arg1, arg2)
local local0 = arg0:GetRandam_Int(1, 100)
local local1 = arg0:GetRandam_Int(1, 100)
local local2 = UPVAL0 + 0.5
local local3 = UPVAL1 + 0.5
local local4 = 45
local local5 = UPVAL0
if arg0:HasSpecialEffectId(TARGET_SELF, 5401) then
local2 = UPVAL3 + 0.5
local3 = UPVAL4 + 0.5
local5 = UPVAL3
end
Approach_Act(arg0, arg1, local5, 999, 0, 2)
if arg0:HasSpecialEffectId(TARGET_SELF, 5401) then
if local0 <= 45 then
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3004, TARGET_ENE_0, local2, 0, local4)
elseif local0 <= 85 then
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3004, TARGET_ENE_0, local2, 0, local4)
arg1:AddSubGoal(GOAL_COMMON_ComboFinal, 10, 3002, TARGET_ENE_0, local3, 0)
else
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3004, TARGET_ENE_0, local2, 0, local4)
arg1:AddSubGoal(GOAL_COMMON_ComboFinal, 10, 3022, TARGET_ENE_0, UPVAL2 + 0.5, 0)
end
elseif local0 <= 65 then
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3004, TARGET_ENE_0, local2, 0, local4)
arg1:AddSubGoal(GOAL_COMMON_ComboFinal, 10, 3002, TARGET_ENE_0, local3, 0)
else
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3004, TARGET_ENE_0, local2, 0, local4)
end
arg0:SetNumber(0, 14)
GetWellSpace_Odds = 0
return GetWellSpace_Odds
end
local0 = local56
local0 = local29
function WomanHumter452000_Act15(arg0, arg1, arg2)
local local0 = UPVAL0 + 0.5
local local1 = UPVAL0
if arg0:HasSpecialEffectId(TARGET_SELF, 5401) then
local0 = UPVAL1 + 0.5
local1 = UPVAL1
end
Approach_Act(arg0, arg1, local1, 999, 0, 2)
arg1:AddSubGoal(GOAL_COMMON_AttackTunableSpin, 10, 3005, TARGET_ENE_0, local0, 0, 45)
arg0:SetNumber(0, 15)
GetWellSpace_Odds = 15
return GetWellSpace_Odds
end
local0 = 4.4 - local0
local0 = 6 - local0
function WomanHumter452000_Act16(arg0, arg1, arg2)
local local0 = UPVAL0 + 0.5
local local1 = UPVAL0
if arg0:HasSpecialEffectId(TARGET_SELF, 5401) then
local0 = UPVAL1 + 0.5
local1 = UPVAL1
end
Approach_Act(arg0, arg1, local1, 999, 0, 2)
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3006, TARGET_ENE_0, local0, 0, 45)
arg1:AddSubGoal(GOAL_COMMON_ComboFinal, 10, 3007, TARGET_ENE_0, local0, 0)
arg0:SetNumber(0, 16)
GetWellSpace_Odds = 15
return GetWellSpace_Odds
end
local0 = 12.3 - local0
local0 = 11.3 - local0
function WomanHumter452000_Act17(arg0, arg1, arg2)
local local0 = UPVAL0 + 0.5
local local1 = UPVAL0
if arg0:HasSpecialEffectId(TARGET_SELF, 5401) then
local0 = UPVAL1 + 0.5
local1 = UPVAL1
end
Approach_Act(arg0, arg1, local1, 999, 0, 2)
arg1:AddSubGoal(GOAL_COMMON_AttackTunableSpin, 10, 3008, TARGET_ENE_0, local0, 0, -1)
arg0:SetNumber(0, 17)
GetWellSpace_Odds = 0
return GetWellSpace_Odds
end
local0 = 8.9 - local0
local0 = 7.6 - local0
function WomanHumter452000_Act18(arg0, arg1, arg2)
local local0 = UPVAL0 + 0.5
local local1 = UPVAL0
if arg0:HasSpecialEffectId(TARGET_SELF, 5401) then
local0 = UPVAL1 + 0.5
local1 = UPVAL1
end
Approach_Act(arg0, arg1, local1, 999, 0, 2)
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3009, TARGET_ENE_0, local0, 0, 45)
arg1:AddSubGoal(GOAL_COMMON_ComboFinal, 10, 3010, TARGET_ENE_0, local0, 0)
arg0:SetNumber(0, 18)
GetWellSpace_Odds = 15
return GetWellSpace_Odds
end
local0 = 13.6 - local0
local0 = 13.6 - local0
function WomanHumter452000_Act19(arg0, arg1, arg2)
local local0 = arg0:GetDist(TARGET_ENE_0)
local local1 = arg0:GetRandam_Int(1, 100)
local local2 = UPVAL0 + 0.5
local local3 = UPVAL0
if arg0:HasSpecialEffectId(TARGET_SELF, 5401) then
local2 = UPVAL1 + 0.5
local3 = UPVAL1
end
if 14 <= local0 then
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 1, 700, TARGET_ENE_0, 0, AI_DIR_TYPE_F, 0)
elseif local0 <= 6 then
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 1, 701, TARGET_ENE_0, 0, AI_DIR_TYPE_B, 0)
else
Approach_Act(arg0, arg1, local3, 999, 0, 2)
end
arg1:AddSubGoal(GOAL_COMMON_AttackTunableSpin, 10, 3011, TARGET_ENE_0, local2, 0, -1)
arg0:SetNumber(0, 19)
GetWellSpace_Odds = 0
return GetWellSpace_Odds
end
local0 = 4.5 - local0
local0 = 4.1 - local0
function WomanHumter452000_Act20(arg0, arg1, arg2)
local local0 = UPVAL0 + 0.5
local local1 = UPVAL0
if arg0:HasSpecialEffectId(TARGET_SELF, 5400) then
local0 = UPVAL1 + 0.5
local1 = UPVAL1
end
if arg0:GetDist(TARGET_ENE_0) <= local0 then
Approach_Act(arg0, arg1, local1, 999, 0, 2)
arg1:AddSubGoal(GOAL_COMMON_AttackTunableSpin, 10, 3021, TARGET_ENE_0, local0, 0, -1)
else
arg1:AddSubGoal(GOAL_COMMON_AttackTunableSpin, 10, 3020, TARGET_ENE_0, DIST_None, 0, -1)
end
arg0:SetTimer(0, 35)
GetWellSpace_Odds = 0
return GetWellSpace_Odds
end
local0 = 12.6 - local0
function WomanHumter452000_Act21(arg0, arg1, arg2)
Approach_Act(arg0, arg1, UPVAL0, UPVAL0 + 0.5, 0, 2)
arg1:AddSubGoal(GOAL_COMMON_AttackTunableSpin, 10, 3012, TARGET_ENE_0, UPVAL0 + 0.5, 0, -1)
arg0:SetNumber(0, 21)
GetWellSpace_Odds = 15
return GetWellSpace_Odds
end
local0 = 8.7 - local0
function WomanHumter452000_Act22(arg0, arg1, arg2)
Approach_Act(arg0, arg1, UPVAL0 + 1, 999, 0, 2)
arg1:AddSubGoal(GOAL_COMMON_AttackTunableSpin, 10, 3013, TARGET_ENE_0, UPVAL0 + 1, 0, -1)
arg0:SetNumber(0, 22)
GetWellSpace_Odds = 15
return GetWellSpace_Odds
end
function WomanHumter452000_Act23(arg0, arg1, arg2)
if arg0:GetNumber(1) == 1 then
arg0:AddObserveSpecialEffect(TARGET_SELF, AI_SPEFFOBSERVE_SpEffId, 5403)
end
arg1:AddSubGoal(GOAL_COMMON_AttackTunableSpin, 10, 3016, TARGET_ENE_0, DIST_None, 0, -1)
arg0:SetNumber(0, 23)
GetWellSpace_Odds = 15
return GetWellSpace_Odds
end
local0 = local52
local0 = local54
local0 = 6.6 - local0
local0 = local25
function WomanHumter452000_Act24(arg0, arg1, arg2)
local local0 = arg0:GetDist(TARGET_ENE_0)
local local1 = arg0:GetRandam_Int(1, 100)
local local2 = UPVAL0 + 1
local local3 = UPVAL1 + 1
local local4 = UPVAL2 + 1
local local5 = UPVAL0 + 8.5
if arg0:HasSpecialEffectId(TARGET_SELF, 5401) then
local2 = UPVAL3 + 1
local5 = UPVAL3
end
Approach_Act(arg0, arg1, local5, 999, 0, 2)
if 8 <= local0 then
if local1 <= 30 then
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 1.5, 700, TARGET_ENE_0, 0, AI_DIR_TYPE_F, 0)
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3003, TARGET_ENE_0, local2, 0, -1)
elseif local1 <= 55 then
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 1.5, 700, TARGET_ENE_0, 0, AI_DIR_TYPE_F, 0)
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3004, TARGET_ENE_0, local3, 0, -1)
else
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 1.5, 700, TARGET_ENE_0, 0, AI_DIR_TYPE_F, 0)
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3010, TARGET_ENE_0, local4, 0, -1)
end
elseif 5 <= local0 then
if local1 <= 15 then
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 1.5, 702, TARGET_ENE_0, 0, AI_DIR_TYPE_L, 0)
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 1.5, 700, TARGET_ENE_0, 0, AI_DIR_TYPE_F, 0)
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3003, TARGET_ENE_0, local2, 0, -1)
elseif local1 <= 30 then
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 1.5, 703, TARGET_ENE_0, 0, AI_DIR_TYPE_R, 0)
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 1.5, 700, TARGET_ENE_0, 0, AI_DIR_TYPE_F, 0)
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3003, TARGET_ENE_0, local2, 0, -1)
elseif local1 <= 43 then
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 1.5, 702, TARGET_ENE_0, 0, AI_DIR_TYPE_L, 0)
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 1.5, 700, TARGET_ENE_0, 0, AI_DIR_TYPE_F, 0)
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3004, TARGET_ENE_0, local3, 0, -1)
elseif local1 <= 56 then
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 1.5, 703, TARGET_ENE_0, 0, AI_DIR_TYPE_R, 0)
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 1.5, 700, TARGET_ENE_0, 0, AI_DIR_TYPE_F, 0)
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3004, TARGET_ENE_0, local3, 0, -1)
elseif local1 <= 78 then
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 1.5, 702, TARGET_ENE_0, 0, AI_DIR_TYPE_L, 0)
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 1.5, 700, TARGET_ENE_0, 0, AI_DIR_TYPE_F, 0)
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3010, TARGET_ENE_0, local4, 0, -1)
else
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 1.5, 703, TARGET_ENE_0, 0, AI_DIR_TYPE_R, 0)
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 1.5, 700, TARGET_ENE_0, 0, AI_DIR_TYPE_F, 0)
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3010, TARGET_ENE_0, local4, 0, -1)
end
else
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3003, TARGET_ENE_0, local2, 0, -1)
end
arg0:SetNumber(0, 24)
GetWellSpace_Odds = 0
return GetWellSpace_Odds
end
function WomanHumter452000_Act25(arg0, arg1, arg2)
local local0 = arg0:GetDist(TARGET_ENE_0)
if arg0:HasSpecialEffectId(TARGET_SELF, 5400) then
if local0 <= 3 then
if arg0:IsInsideTarget(TARGET_ENE_0, AI_DIR_TYPE_B, 90) then
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 0.5, 701, TARGET_ENE_0, 0, AI_DIR_TYPE_B, 0)
elseif arg0:GetRandam_Int(1, 100) <= 30 then
WomanHumter452000_Act05(arg0, arg1, arg2)
elseif arg0:IsInsideTarget(TARGET_ENE_0, AI_DIR_TYPE_R, 180) then
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 1.5, 702, TARGET_ENE_0, 0, AI_DIR_TYPE_L, 0)
else
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 1.5, 703, TARGET_ENE_0, 0, AI_DIR_TYPE_R, 0)
end
elseif local0 <= 5 then
if arg0:IsInsideTarget(TARGET_ENE_0, AI_DIR_TYPE_R, 180) then
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 1.5, 702, TARGET_ENE_0, 0, AI_DIR_TYPE_L, 0)
else
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 1.5, 703, TARGET_ENE_0, 0, AI_DIR_TYPE_R, 0)
end
else
arg1:AddSubGoal(GOAL_COMMON_Turn, 3, TARGET_ENE_0, 15, 0, 0)
end
elseif arg0:HasSpecialEffectId(TARGET_SELF, 5401) then
if local0 <= 4 then
if arg0:IsInsideTarget(TARGET_ENE_0, AI_DIR_TYPE_R, 180) then
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 1.5, 702, TARGET_ENE_0, 0, AI_DIR_TYPE_L, 0)
else
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 1.5, 703, TARGET_ENE_0, 0, AI_DIR_TYPE_R, 0)
end
else
arg1:AddSubGoal(GOAL_COMMON_Turn, 3, TARGET_ENE_0, 15, 0, 0)
end
elseif local0 <= 4 then
if arg0:IsInsideTarget(TARGET_ENE_0, AI_DIR_TYPE_R, 180) then
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 1.5, 702, TARGET_ENE_0, 0, AI_DIR_TYPE_L, 0)
else
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 1.5, 703, TARGET_ENE_0, 0, AI_DIR_TYPE_R, 0)
end
else
arg1:AddSubGoal(GOAL_COMMON_Turn, 3, TARGET_ENE_0, 15, 0, 0)
end
GetWellSpace_Odds = 0
return GetWellSpace_Odds
end
local0 = 3.6 - local0
local0 = 4.2 - local0
function WomanHumter452000_Act26(arg0, arg1, arg2)
local local0 = arg0:GetRandam_Int(1, 100)
Approach_Act(arg0, arg1, UPVAL0, 999, 0, 2)
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3017, TARGET_ENE_0, UPVAL0 + 1, 0, 90)
arg1:AddSubGoal(GOAL_COMMON_ComboFinal, 10, 3018, TARGET_ENE_0, UPVAL1 + 1, 0)
arg0:SetNumber(0, 26)
GetWellSpace_Odds = 15
return GetWellSpace_Odds
end
local0 = local73
function WomanHumter452000_Act27(arg0, arg1, arg2)
if arg0:GetDist(TARGET_ENE_0) <= 4 then
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 1.5, 701, TARGET_ENE_0, 0, AI_DIR_TYPE_B, 0)
end
Approach_Act(arg0, arg1, UPVAL0, 999, 0, 2)
arg1:AddSubGoal(GOAL_COMMON_AttackTunableSpin, 10, 3023, TARGET_ENE_0, UPVAL0 + 1, 0, -1)
arg0:SetNumber(0, 27)
GetWellSpace_Odds = 0
return GetWellSpace_Odds
end
local0 = local75
local0 = 13.9 - local0
function WomanHumter452000_Act28(arg0, arg1, arg2)
local local0 = UPVAL0 + 1
local local1 = UPVAL0
local local2 = 999
local local3 = 0
if arg0:GetDist(TARGET_ENE_0) <= 4 then
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 1.5, 701, TARGET_ENE_0, 0, AI_DIR_TYPE_B, 0)
end
if arg0:GetRandam_Int(1, 100) <= 40 then
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3024, TARGET_ENE_0, local0, 0, -1)
arg1:AddSubGoal(GOAL_COMMON_ComboFinal, 10, 3025, TARGET_ENE_0, UPVAL1 + 1, 0)
else
arg1:AddSubGoal(GOAL_COMMON_AttackTunableSpin, 10, 3024, TARGET_ENE_0, local0, 0, -1)
end
arg0:SetNumber(0, 28)
GetWellSpace_Odds = 0
return GetWellSpace_Odds
end
local0 = local78
function WomanHumter452000_Act29(arg0, arg1, arg2)
local local0 = UPVAL0
local local1 = 999
local local2 = 0
if arg0:GetDist(TARGET_ENE_0) <= 4 then
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 1.5, 701, TARGET_ENE_0, 0, AI_DIR_TYPE_B, 0)
end
arg1:AddSubGoal(GOAL_COMMON_AttackTunableSpin, 10, 3026, TARGET_ENE_0, UPVAL0 + 1, 0, -1)
arg0:SetNumber(0, 29)
GetWellSpace_Odds = 0
return GetWellSpace_Odds
end
function WomanHumter452000_Act30(arg0, arg1, arg2)
arg0:AddObserveSpecialEffect(TARGET_SELF, AI_SPEFFOBSERVE_SpEffId, 5402)
if arg0:GetDist(TARGET_ENE_0) <= 10 then
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 1.5, 701, TARGET_ENE_0, 0, AI_DIR_TYPE_B, 0)
end
arg1:AddSubGoal(GOAL_COMMON_AttackTunableSpin, 10, 3030, TARGET_ENE_0, DIST_None, 0, -1)
GetWellSpace_Odds = 0
return GetWellSpace_Odds
end
local0 = 8.9 - local0
local0 = 7.7 - local0
function WomanHumter452000_Act31(arg0, arg1, arg2)
local local0 = UPVAL0 + 1
local local1 = UPVAL0 - 0.5
if arg0:HasSpecialEffectId(TARGET_SELF, 5401) then
local0 = UPVAL1 + 1
local1 = UPVAL1 - 0.5
end
if arg0:HasSpecialEffectId(TARGET_SELF, 5403) then
arg0:AddObserveSpecialEffect(TARGET_ENE_0, AI_SPEFFOBSERVE_SpEffId, 52)
end
Approach_Act(arg0, arg1, local1, 999, 0, 2)
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 3, 3019, TARGET_ENE_0, local0, 0, -1)
arg0:SetNumber(0, 31)
GetWellSpace_Odds = 0
return GetWellSpace_Odds
end
function WomanHumter452000_ActAfter_AdjustSpace(arg0, arg1, arg2)
arg1:AddSubGoal(GOAL_COMMON_If, 10, 0)
return
end
function WomanHumter452000_ActAfter_RealTime(arg0, arg1)
local local0 = arg0:GetDist(TARGET_ENE_0)
local local1 = arg0:GetRandam_Int(1, 100)
local local2 = arg0:GetRandam_Int(1, 100)
local local3 = arg0:GetRandam_Int(0, 1)
local local4 = arg0:GetRandam_Float(1.5, 2.5)
local local5 = arg0:GetRandam_Float(1.5, 2.5)
local local6 = 0
local local7 = arg0:IsExistMeshOnLine(TARGET_SELF, AI_DIR_TYPE_B, 0)
local local8 = arg0:IsExistMeshOnLine(TARGET_SELF, AI_DIR_TYPE_L, 0)
local local9 = arg0:IsExistMeshOnLine(TARGET_SELF, AI_DIR_TYPE_R, 0)
if arg0:HasSpecialEffectId(TARGET_SELF, 5400) then
if local1 <= 30 and local8 == true then
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 1.5, 702, TARGET_ENE_0, 0, AI_DIR_TYPE_L, 0)
elseif local1 <= 60 and local9 == true then
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 1.5, 703, TARGET_ENE_0, 0, AI_DIR_TYPE_R, 0)
else
arg0:Replaning()
end
elseif arg0:HasSpecialEffectId(TARGET_SELF, 5401) then
if local1 <= 40 and local7 == true then
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 0.5, 701, TARGET_ENE_0, 0, AI_DIR_TYPE_B, 0)
else
arg0:Replaning()
end
elseif local0 <= 3 then
if arg0:IsInsideTarget(TARGET_ENE_0, AI_DIR_TYPE_R, 180) and local8 == true then
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 1.5, 702, TARGET_ENE_0, 0, AI_DIR_TYPE_L, 0)
elseif local9 == true then
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 1.5, 703, TARGET_ENE_0, 0, AI_DIR_TYPE_R, 0)
end
if local7 == true then
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 0.5, 701, TARGET_ENE_0, 0, AI_DIR_TYPE_B, 0)
end
elseif local0 <= 6 and local7 == true then
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 1.5, 701, TARGET_ENE_0, 0, AI_DIR_TYPE_B, 0)
else
arg0:Replaning()
end
return
end
function WomanHumter452000Battle_Update(arg0, arg1)
return GOAL_RESULT_Continue
end
function WomanHumter452000Battle_Terminate(arg0, arg1)
return
end
local0 = local73
local0 = local78
local0 = local75
local0 = local7
local0 = 1.8 - local0
local0 = 4 - local0
function WomanHumter452000Battle_Interupt(arg0, arg1)
if arg0:IsLadderAct(TARGET_SELF) then
return false
end
local local0 = arg0:GetRandam_Int(1, 100)
local local1 = arg0:GetRandam_Int(1, 100)
local local2 = arg0:GetRandam_Int(1, 100)
local local3 = 20
local local4 = arg0:GetRandam_Int(0, 1)
if arg0:IsInterupt(INTERUPT_Damaged) then
if arg0:HasSpecialEffectId(TARGET_SELF, 5403) then
local3 = local3 + 20
end
if arg0:HasSpecialEffectId(TARGET_SELF, 5402) then
local3 = local3 + 10
end
if arg0:GetDist(TARGET_ENE_0) < 3 and local0 <= local3 then
if arg0:HasSpecialEffectId(TARGET_SELF, 5403) then
if local0 <= 20 then
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 0.5, 701, TARGET_ENE_0, 0, AI_DIR_TYPE_B, 0)
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3013, TARGET_ENE_0, DIST_None, 0, 360)
elseif local0 <= 35 then
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 0.5, 701, TARGET_ENE_0, 0, AI_DIR_TYPE_B, 0)
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3008, TARGET_ENE_0, DIST_None, 0, 360)
elseif local0 <= 40 then
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 0.5, 701, TARGET_ENE_0, 0, AI_DIR_TYPE_B, 0)
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3023, TARGET_ENE_0, DIST_None, 0, 360)
elseif local0 <= 45 then
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 0.5, 701, TARGET_ENE_0, 0, AI_DIR_TYPE_B, 0)
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3024, TARGET_ENE_0, DIST_None, 0, 360)
elseif local0 <= 55 then
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 0.5, 701, TARGET_ENE_0, 0, AI_DIR_TYPE_B, 0)
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3026, TARGET_ENE_0, DIST_None, 0, 360)
elseif local0 <= 64 then
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 0.5, 702, TARGET_ENE_0, 0, AI_DIR_TYPE_L, 0)
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3003, TARGET_ENE_0, DIST_None, 0, 360)
elseif local0 <= 72 then
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 0.5, 703, TARGET_ENE_0, 0, AI_DIR_TYPE_R, 0)
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3003, TARGET_ENE_0, DIST_None, 0, 360)
elseif local0 <= 77 then
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 0.5, 702, TARGET_ENE_0, 0, AI_DIR_TYPE_L, 0)
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3010, TARGET_ENE_0, DIST_None, 0, 360)
elseif local0 <= 85 then
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 0.5, 703, TARGET_ENE_0, 0, AI_DIR_TYPE_R, 0)
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3010, TARGET_ENE_0, DIST_None, 0, 360)
else
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3004, TARGET_ENE_0, DIST_None, 0, 360)
end
elseif arg0:HasSpecialEffectId(TARGET_SELF, 5402) then
if local0 <= 15 then
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 0.5, 701, TARGET_ENE_0, 0, AI_DIR_TYPE_B, 0)
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3008, TARGET_ENE_0, DIST_None, 0, 360)
elseif local0 <= 20 then
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 0.5, 701, TARGET_ENE_0, 0, AI_DIR_TYPE_B, 0)
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3023, TARGET_ENE_0, DIST_None, 0, 360)
elseif local0 <= 25 then
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 0.5, 701, TARGET_ENE_0, 0, AI_DIR_TYPE_B, 0)
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3024, TARGET_ENE_0, DIST_None, 0, 360)
elseif local0 <= 30 then
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 0.5, 701, TARGET_ENE_0, 0, AI_DIR_TYPE_B, 0)
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3026, TARGET_ENE_0, DIST_None, 0, 360)
elseif local0 <= 50 then
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 0.5, 702, TARGET_ENE_0, 0, AI_DIR_TYPE_L, 0)
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3003, TARGET_ENE_0, DIST_None, 0, 360)
elseif local0 <= 60 then
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 0.5, 703, TARGET_ENE_0, 0, AI_DIR_TYPE_R, 0)
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3003, TARGET_ENE_0, DIST_None, 0, 360)
elseif local0 <= 70 then
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 0.5, 702, TARGET_ENE_0, 0, AI_DIR_TYPE_L, 0)
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3010, TARGET_ENE_0, DIST_None, 0, 360)
elseif local0 <= 80 then
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 0.5, 703, TARGET_ENE_0, 0, AI_DIR_TYPE_L, 0)
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3010, TARGET_ENE_0, DIST_None, 0, 360)
else
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3004, TARGET_ENE_0, DIST_None, 0, 360)
end
elseif arg0:HasSpecialEffectId(TARGET_SELF, 5401) then
if local0 <= 10 then
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 0.5, 701, TARGET_ENE_0, 0, AI_DIR_TYPE_B, 0)
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3022, TARGET_ENE_0, DIST_None, 0, 360)
elseif local0 <= 25 then
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 0.5, 701, TARGET_ENE_0, 0, AI_DIR_TYPE_B, 0)
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3008, TARGET_ENE_0, DIST_None, 0, 360)
elseif local0 <= 30 then
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 0.5, 702, TARGET_ENE_0, 0, AI_DIR_TYPE_L, 0)
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3003, TARGET_ENE_0, DIST_None, 0, 360)
elseif local0 <= 35 then
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 0.5, 703, TARGET_ENE_0, 0, AI_DIR_TYPE_R, 0)
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3003, TARGET_ENE_0, DIST_None, 0, 360)
elseif local0 <= 47 then
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 0.5, 702, TARGET_ENE_0, 0, AI_DIR_TYPE_L, 0)
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3010, TARGET_ENE_0, DIST_None, 0, 360)
elseif local0 <= 60 then
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 0.5, 703, TARGET_ENE_0, 0, AI_DIR_TYPE_R, 0)
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3010, TARGET_ENE_0, DIST_None, 0, 360)
elseif local0 <= 70 then
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 0.5, 702, TARGET_ENE_0, 0, AI_DIR_TYPE_L, 0)
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3022, TARGET_ENE_0, DIST_None, 0, 360)
elseif local0 <= 80 then
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 0.5, 703, TARGET_ENE_0, 0, AI_DIR_TYPE_R, 0)
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3022, TARGET_ENE_0, DIST_None, 0, 360)
else
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3004, TARGET_ENE_0, DIST_None, 0, 360)
end
elseif local0 <= 15 then
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 0.5, 701, TARGET_ENE_0, 0, AI_DIR_TYPE_B, 0)
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3012, TARGET_ENE_0, DIST_None, 0, 360)
elseif local0 <= 30 then
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 0.5, 701, TARGET_ENE_0, 0, AI_DIR_TYPE_B, 0)
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3007, TARGET_ENE_0, DIST_None, 0, 360)
elseif local0 <= 35 then
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 0.5, 702, TARGET_ENE_0, 0, AI_DIR_TYPE_L, 0)
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3001, TARGET_ENE_0, DIST_None, 0, 360)
elseif local0 <= 40 then
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 0.5, 703, TARGET_ENE_0, 0, AI_DIR_TYPE_R, 0)
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3001, TARGET_ENE_0, DIST_None, 0, 360)
elseif local0 <= 47 then
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 0.5, 702, TARGET_ENE_0, 0, AI_DIR_TYPE_L, 0)
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3003, TARGET_ENE_0, DIST_None, 0, 360)
elseif local0 <= 55 then
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 0.5, 703, TARGET_ENE_0, 0, AI_DIR_TYPE_R, 0)
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3003, TARGET_ENE_0, DIST_None, 0, 360)
elseif local0 <= 62 then
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 0.5, 702, TARGET_ENE_0, 0, AI_DIR_TYPE_L, 0)
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3012, TARGET_ENE_0, DIST_None, 0, 360)
elseif local0 <= 70 then
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 0.5, 703, TARGET_ENE_0, 0, AI_DIR_TYPE_R, 0)
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3012, TARGET_ENE_0, DIST_None, 0, 360)
elseif local0 <= 75 then
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 0.5, 702, TARGET_ENE_0, 0, AI_DIR_TYPE_L, 0)
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3013, TARGET_ENE_0, DIST_None, 0, 360)
elseif local0 <= 80 then
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 0.5, 703, TARGET_ENE_0, 0, AI_DIR_TYPE_R, 0)
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3013, TARGET_ENE_0, DIST_None, 0, 360)
else
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3004, TARGET_ENE_0, DIST_None, 0, 360)
end
return true
end
end
local local5 = arg0:GetRandam_Int(1, 100)
local local6 = arg0:GetDist(TARGET_ENE_0)
local local7 = arg0:GetRandam_Int(0, 1)
local local8 = Shoot_2dist(arg0, arg1, 5, 20, 30, 55)
if local8 == 1 or local8 == 2 then
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 2, 702 + local7, TARGET_ENE_0, 0, AI_DIR_TYPE_L + local7, 0)
return true
end
local local9 = arg0:GetRandam_Int(1, 100)
local local10 = arg0:GetDist(TARGET_ENE_0)
if arg0:IsInterupt(INTERUPT_FLAG_ActivateSpecialEffect) and (not not arg0:IsActivateSpecialEffect(TARGET_ENE_0, AI_SPEFFOBSERVE_SpEffId, 8) or arg0:IsActivateSpecialEffect(TARGET_ENE_0, AI_SPEFFOBSERVE_SpEffId, 9)) then
arg1:ClearSubGoal()
if local9 <= 50 and local10 <= 5 then
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 0.5, 701, TARGET_ENE_0, 0, AI_DIR_TYPE_B, 0)
arg1:AddSubGoal(GOAL_COMMON_AttackTunableSpin, 2.1, 3023, TARGET_ENE_0, DIST_None, 0, 0)
elseif local9 <= 50 and local10 <= UPVAL0 then
arg1:AddSubGoal(GOAL_COMMON_AttackTunableSpin, 2.1, 3023, TARGET_ENE_0, DIST_None, 0, 0)
elseif local9 <= 50 and local10 <= UPVAL1 then
arg1:AddSubGoal(GOAL_COMMON_AttackTunableSpin, 2.1, 3024, TARGET_ENE_0, DIST_None, 0, 0)
elseif local9 <= 50 and local10 <= UPVAL2 then
arg1:AddSubGoal(GOAL_COMMON_AttackTunableSpin, 2.1, 3026, TARGET_ENE_0, DIST_None, 0, 0)
else
return false
end
arg0:DeleteObserveSpecialEffect(TARGET_ENE_0, AI_SPEFFOBSERVE_SpEffId, 8)
arg0:DeleteObserveSpecialEffect(TARGET_ENE_0, AI_SPEFFOBSERVE_SpEffId, 9)
return true
elseif arg0:IsInterupt(INTERUPT_FLAG_ActivateSpecialEffect) then
local local11 = UPVAL3 + 0.5
local local12 = 10
if arg0:IsActivateSpecialEffect(TARGET_SELF, AI_SPEFFOBSERVE_SpEffId, 5025) then
if not not arg0:IsInsideTargetEx(TARGET_SELF, TARGET_ENE_0, AI_DIR_TYPE_B, 270, 4) or local9 <= 30 then
arg1:AddSubGoal(GOAL_COMMON_ComboRepeat, 10, 3001, TARGET_ENE_0, local11, 0)
else
arg1:AddSubGoal(GOAL_COMMON_ComboRepeat, 10, 3002, TARGET_ENE_0, local11, 0)
end
return true
elseif arg0:IsActivateSpecialEffect(TARGET_SELF, AI_SPEFFOBSERVE_SpEffId, 5026) then
if 2.5 <= local10 or arg0:GetRandam_Int(1, 100) <= 30 then
arg1:AddSubGoal(GOAL_COMMON_ComboFinal, 10, 3004, TARGET_ENE_0, local12, 0)
else
arg1:AddSubGoal(GOAL_COMMON_ComboRepeat, 10, 3003, TARGET_ENE_0, UPVAL4 + 0.5, 0)
arg1:AddSubGoal(GOAL_COMMON_ComboFinal, 10, 3006, TARGET_ENE_0, local12, 0)
end
arg1:AddSubGoal(GOAL_COMMON_If, 10, 0)
return true
elseif arg0:IsActivateSpecialEffect(TARGET_SELF, AI_SPEFFOBSERVE_SpEffId, 5027) then
if not not arg0:IsInsideTargetEx(TARGET_SELF, TARGET_ENE_0, AI_DIR_TYPE_F, 90, 2.3) or arg0:IsInsideTargetEx(TARGET_SELF, TARGET_ENE_0, AI_DIR_TYPE_L, 90, 3.5) then
arg1:AddSubGoal(GOAL_COMMON_ComboFinal, 10, 3006, TARGET_ENE_0, local12, 0)
arg1:AddSubGoal(GOAL_COMMON_If, 10, 0)
return true
else
return false
end
elseif arg0:IsActivateSpecialEffect(TARGET_SELF, AI_SPEFFOBSERVE_SpEffId, 5402) then
arg0:SetNumber(1, 1)
arg0:DeleteObserveSpecialEffect(TARGET_SELF, AI_SPEFFOBSERVE_SpEffId, 5402)
return true
elseif arg0:IsActivateSpecialEffect(TARGET_SELF, AI_SPEFFOBSERVE_SpEffId, 5403) then
arg0:SetNumber(1, 2)
arg0:DeleteObserveSpecialEffect(TARGET_SELF, AI_SPEFFOBSERVE_SpEffId, 5403)
return true
elseif arg0:IsActivateSpecialEffect(TARGET_ENE_0, AI_SPEFFOBSERVE_SpEffId, 52) then
arg1:ClearSubGoal()
if local10 <= UPVAL5 then
arg1:AddSubGoal(GOAL_COMMON_ComboFinal, 10, 3015, TARGET_ENE_0, DIST_None, 0)
else
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 2, 700, TARGET_ENE_0, 0, AI_DIR_TYPE_F, 0)
arg1:AddSubGoal(GOAL_COMMON_ComboFinal, 10, 3015, TARGET_ENE_0, DIST_None, 0)
end
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 1.5, 701, TARGET_ENE_0, 0, AI_DIR_TYPE_B, 0)
arg0:DeleteObserveSpecialEffect(TARGET_ENE_0, AI_SPEFFOBSERVE_SpEffId, 52)
return true
end
end
return false
end
return
|
local config = require("lspinstall/util").extract_config "dockerls"
local npm = require "lspinstall/helpers".npm
local package_name = "dockerfile-language-server"
config.default_config.cmd[1] = npm.bin_path(package_name)
return vim.tbl_extend("error", config, {
install_script = npm.install_script(package_name),
})
|
vim.bo.shiftwidth = 2
vim.bo.expandtab = true
|
require "Window"
require "Apollo"
require "ApolloCursor"
require "GameLib"
require "Item"
local KuronaSalvage = {}
local kidBackpack = 0
local karEvalColors =
{
[Item.CodeEnumItemQuality.Inferior] = "ItemQuality_Inferior",
[Item.CodeEnumItemQuality.Average] = "ItemQuality_Average",
[Item.CodeEnumItemQuality.Good] = "ItemQuality_Good",
[Item.CodeEnumItemQuality.Excellent] = "ItemQuality_Excellent",
[Item.CodeEnumItemQuality.Superb] = "ItemQuality_Superb",
[Item.CodeEnumItemQuality.Legendary] = "ItemQuality_Legendary",
[Item.CodeEnumItemQuality.Artifact] = "ItemQuality_Artifact",
}
function KuronaSalvage:new(o)
o = o or {}
setmetatable(o, self)
self.__index = self
return o
end
function KuronaSalvage:OnLoad()
self.xmlDoc = XmlDoc.CreateFromFile("KuronaSalvage.xml")
self.xmlDoc:RegisterCallback("OnDocumentReady", self)
end
function KuronaSalvage:OnDocumentReady()
if self.xmlDoc == nil then
return
end
Apollo.RegisterEventHandler("RequestSalvageAll", "OnSalvageAll", self) -- using this for bag changes
Apollo.RegisterSlashCommand("salvageall", "OnSalvageAll", self)
Apollo.RegisterSlashCommand("ksalvage", "OnConsole", self)
self.wndMain = Apollo.LoadForm(self.xmlDoc, "KuronaSalvageForm", nil, self)
self.wndItemDisplay = self.wndMain:FindChild("ItemDisplayWindow")
if self.locSavedWindowLoc then
self.wndMain:MoveToLocation(self.locSavedWindowLoc)
end
self.tContents = self.wndMain:FindChild("HiddenBagWindow")
self.arItemList = nil
self.nItemIndex = nil
self.wndMain:Show(false, true)
if self.IgnoreList == nil then
self.IgnoreList = {}
end
Apollo.RegisterEventHandler("WindowManagementReady", "OnWindowManagementReady", self)
self:OnWindowManagementReady()
end
function KuronaSalvage:OnWindowManagementReady()
Event_FireGenericEvent("WindowManagementRegister", {strName = "KuronaSalvage"})
Event_FireGenericEvent("WindowManagementAdd", {wnd = self.wndMain, strName = "KuronaSalvage"})
end
--------------------//-----------------------------
function KuronaSalvage:OnConsole(cmd,strArg)
if strArg == "reset" then
self.IgnoreList = {}
Print("Ignore list cleared")
elseif strArg ~="" then
Print("Type:")
Print(" /ksalvage reset :to clear ignore list")
else
self:OnSalvageAll()
end
self:RedrawKBags()
end
function KuronaSalvage:OnSalvageAll()
local improvedSalvage = Apollo.GetAddon("ImprovedSalvage")
if improvedSalvage then
improvedSalvage.wndMain:Show(false)
end
self.arItemList = {}
self.nItemIndex = 1
self.KuronaBags = Apollo.GetAddon("KuronaBags")
local preventSalvage = self.KuronaBags.PreventSalvageList
local tInvItems = GameLib.GetPlayerUnit():GetInventoryItems()
for idx, tItem in ipairs(tInvItems) do
if tItem and tItem.itemInBag and tItem.itemInBag:CanSalvage() and not(self.IgnoreList[tItem.itemInBag:GetItemId()] or preventSalvage[tItem.itemInBag:GetItemId()]) then
if not preventSalvage[tItem.itemInBag:GetItemId()] then
table.insert(self.arItemList, tItem.itemInBag)
end
end
end
self:RedrawAll()
end
function KuronaSalvage:OnSalvageListItemCheck(wndHandler, wndControl)
if not wndHandler or not wndHandler:GetData() then
return
end
self.nItemIndex = wndHandler:GetData().nIdx
wndHandler:GetChildren()[1]:Show(true)
local itemCurr = self.arItemList[self.nItemIndex]
self.wndMain:SetData(itemCurr)
self.wndMain:FindChild("SalvageBtn"):SetActionData(GameLib.CodeEnumConfirmButtonType.SalvageItem, itemCurr:GetInventoryId())
end
function KuronaSalvage:OnSalvageListItemUncheck( wndHandler, wndControl, eMouseButton )
wndHandler:GetChildren()[1]:Show(false)
end
function KuronaSalvage:OnSalvageListItemGenerateTooltip(wndControl, wndHandler) -- wndHandler is VendorListItemIcon
if wndHandler ~= wndControl then
return
end
wndControl:SetTooltipDoc(nil)
local tListItem = wndHandler:GetData().tItem
local tPrimaryTooltipOpts = {}
tPrimaryTooltipOpts.bPrimary = true
tPrimaryTooltipOpts.itemModData = tListItem.itemModData
tPrimaryTooltipOpts.strMaker = tListItem.strMaker
tPrimaryTooltipOpts.arGlyphIds = tListItem.arGlyphIds
tPrimaryTooltipOpts.tGlyphData = tListItem.itemGlyphData
tPrimaryTooltipOpts.itemCompare = tListItem:GetEquippedItemForItemType()
if Tooltip ~= nil and Tooltip.GetSpellTooltipForm ~= nil then
Tooltip.GetItemTooltipForm(self, wndControl, tListItem, tPrimaryTooltipOpts, tListItem.nStackSize)
end
end
function KuronaSalvage:RedrawAll()
--[[
self.KuronaBags = Apollo.GetAddon("KuronaBags")
local preventSalvage = self.KuronaBags.PreventSalvageList
for i = #self.arItemList, 1, -1 do
local item = self.arItemList[i]
if item and preventSalvage[item:GetItemId()] then
table.remove(self.arItemList, i)
end
end
]]
local itemCurr = self.arItemList[self.nItemIndex]
if itemCurr ~= nil then
local wndParent = self.wndMain:FindChild("MainScroll")
local nScrollPos = wndParent:GetVScrollPos()
wndParent:DestroyChildren()
for idx, tItem in ipairs(self.arItemList) do
local wndCurr = Apollo.LoadForm(self.xmlDoc, "SalvageListItem", wndParent, self)
wndCurr:FindChild("SalvageListItemBtn"):SetData({nIdx = idx, tItem=tItem})
wndCurr:FindChild("SalvageListItemBtn"):SetCheck(idx == self.nItemIndex)
wndCurr:FindChild("SalvageListItemTitle"):SetTextColor(karEvalColors[tItem:GetItemQuality()])
wndCurr:FindChild("SalvageListItemTitle"):SetText(tItem:GetName())
local bTextColorRed = self:HelperPrereqFailed(tItem)
wndCurr:FindChild("SalvageListItemType"):SetTextColor(bTextColorRed and "xkcdReddish" or "UI_TextHoloBodyCyan")
wndCurr:FindChild("SalvageListItemType"):SetText(tItem:GetItemTypeName())
wndCurr:FindChild("SalvageListItemCantUse"):Show(bTextColorRed)
wndCurr:FindChild("SalvageListItemIcon"):GetWindowSubclass():SetItem(tItem)
end
wndParent:ArrangeChildrenVert(0)
wndParent:SetVScrollPos(nScrollPos)
wndParent:GetChildren()[self.nItemIndex]:GetChildren()[1]:GetChildren()[1]:Show(true)
self.wndMain:SetData(itemCurr)
self.wndMain:FindChild("SalvageBtn"):SetActionData(GameLib.CodeEnumConfirmButtonType.SalvageItem, itemCurr:GetInventoryId())
self.wndMain:Show(true)
self.wndMain:ToFront()
else
self.wndMain:Show(false)
self:RedrawKBags()
end
end
function KuronaSalvage:HelperPrereqFailed(tCurrItem)
return tCurrItem and tCurrItem:IsEquippable() and not tCurrItem:CanEquip()
end
function KuronaSalvage:OnSalvageCurr()
if self.nItemIndex == #self.arItemList then
table.remove(self.arItemList, self.nItemIndex )
self.nItemIndex = self.nItemIndex - 1
else
table.remove(self.arItemList, self.nItemIndex )
end
self:RedrawAll()
end
function KuronaSalvage:OnCloseBtn()
self.arItemList = {}
self.wndMain:SetData(nil)
self.wndMain:Show(false)
self:RedrawKBags()
end
function KuronaSalvage:RedrawKBags()
local kbags = Apollo.GetAddon("KuronaBags")
if kbags then
kbags:Redraw()
end
end
----------------globals----------------------------
---------------------------------------------------------------------------------------------------
-- SalvageListItem Functions
---------------------------------------------------------------------------------------------------
function KuronaSalvage:AddToIgnore( wndHandler, wndControl, eMouseButton )
local item = wndHandler:GetParent():GetData().tItem
self.IgnoreList[item:GetItemId()] = true
local preventSalvage = self.IgnoreList
for i = #self.arItemList, 1, -1 do
local item = self.arItemList[i]
if item and self.IgnoreList[item:GetItemId()] then
table.remove(self.arItemList, i)
end
end
wndHandler:GetParent():GetParent():Destroy()
self:RedrawAll()
end
---------------------------------------------------------------------------------------------------
-- KuronaSalvageForm Functions
---------------------------------------------------------------------------------------------------
function KuronaSalvage:ClearIgnoreList( wndHandler, wndControl, eMouseButton )
self.IgnoreList = {}
self:RedrawAll()
self:OnSalvageAll()
end
local ImprovedSalvage_Singleton = KuronaSalvage:new()
Apollo.RegisterAddon(ImprovedSalvage_Singleton)
function KuronaSalvage:OnSave(eLevel,backup)
if eLevel ~= GameLib.CodeEnumAddonSaveLevel.Character then return end
local tsave = {}
tsave.IgnoreList = self.IgnoreList
return tsave
end
function KuronaSalvage:OnRestore(eLevel, saveData)
if eLevel ~= GameLib.CodeEnumAddonSaveLevel.Character then return end
self.IgnoreList = saveData.IgnoreList
end
|
object_static_worldbuilding_structures_mun_nboo_block_building_64x32_destroyed_01 = object_static_worldbuilding_structures_shared_mun_nboo_block_building_64x32_destroyed_01:new {
}
ObjectTemplates:addTemplate(object_static_worldbuilding_structures_mun_nboo_block_building_64x32_destroyed_01, "object/static/worldbuilding/structures/mun_nboo_block_building_64x32_destroyed_01.iff")
|
local cc = data.raw["constant-combinator"]["constant-combinator"]
cc.item_slot_count = math.max(36, cc.item_slot_count)
local enableDataItems = {
"ammo",
"armor",
"gun",
"item",
"capsule",
"repair-tool",
"mining-tool",
"item-with-entity-data",
"rail-planner",
"tool",
"blueprint",
"deconstruction-item",
"blueprint-book",
"selection-tool",
"item-with-tags",
"item-with-label",
"item-with-inventory",
"module"
}
local items = {}
local entities = {}
for _, list in ipairs(enableDataItems) do
if data.raw[list] ~= nil then
for name, item in pairs(data.raw[list]) do
local icon = item.icon
local icon_size = item.icon_size
-- can't handle barrels and tints yet
if string.sub(item.name, -string.len("-barrel")) == "-barrel" then
icon = "__base__/graphics/icons/fluid/barreling/empty-barrel.png"
icon_size = 32
end
if type(icon) == "string" and type(icon_size) == "number" then
items[#items+1] = {
type = "item",
name = "logicarts-item-"..name,
icon = "__logicarts2__/graphics/sticker-icon.png",
icon_size = 32,
flags = {"hidden"},
order = "logicarts-z",
stack_size = 1,
}
entities[#entities+1] = {
type = "simple-entity-with-force",
name = "logicarts-item-"..name,
flags = {
"player-creation",
"not-rotatable",
"not-flammable",
"not-blueprintable",
"placeable-off-grid",
},
selectable_in_game = false,
build_sound = nil,
mined_sound = nil,
created_smoke = nil,
minable = nil,
collision_mask = {"layer-14"},
collision_box = {{-0.4,-0.4},{0.4,0.4}},
selection_box = {{-0.25,-0.25},{0.25,0.25}},
icon = "__logicarts2__/graphics/sticker-icon.png",
icon_size = 32,
picture = {
filename = icon,
width = icon_size,
height = icon_size,
scale = (32/icon_size)*0.3,
priority = "low",
},
render_layer = "higher-object-above",
tile_width = 1,
tile_height = 1,
}
end
end
end
end
data:extend(items)
data:extend(entities)
|
local local0 = 0.4
local local1 = 0 - local0
local local2 = 0 - local0
local local3 = 0 - local0
local local4 = 0 - local0
function OnIf_101010(arg0, arg1, arg2)
if arg2 == 0 then
Sniper_Priest101010_ActAfter_RealTime(arg0, arg1)
end
return
end
function Sniper_Priest101010Battle_Activate(arg0, arg1)
local local0 = {}
local local1 = {}
local local2 = {}
Common_Clear_Param(local0, local1, local2)
if arg0:GetEventRequest() == 100 then
local0[4] = 100
elseif arg0:GetRandam_Int(1, 100) <= 50 and arg0:IsInsideTarget(TARGET_ENE_0, AI_DIR_TYPE_B, 90) then
local0[20] = 100
elseif 6 <= arg0:GetDist(TARGET_ENE_0) then
local0[1] = 50
local0[2] = 50
local0[3] = 0
else
local0[1] = 33
local0[2] = 33
local0[3] = 34
end
local1[1] = REGIST_FUNC(arg0, arg1, Sniper_Priest101010_Act01)
local1[2] = REGIST_FUNC(arg0, arg1, Sniper_Priest101010_Act02)
local1[3] = REGIST_FUNC(arg0, arg1, Sniper_Priest101010_Act03)
local1[4] = REGIST_FUNC(arg0, arg1, Sniper_Priest101010_Act04)
local1[20] = REGIST_FUNC(arg0, arg1, Sniper_Priest101010_Act20)
Common_Battle_Activate(arg0, arg1, local0, local1, REGIST_FUNC(arg0, arg1, Sniper_Priest101010_ActAfter_AdjustSpace), local2)
return
end
local0 = 50.4 - local0
function Sniper_Priest101010_Act01(arg0, arg1, arg2)
local local0 = arg0:GetDist(TARGET_ENE_0)
local local1 = arg0:GetRandam_Int(1, 100)
local local2 = UPVAL0 + 0
local local3 = UPVAL0 + 2
local local4 = 0
local local5 = UPVAL0 + 1
arg1:AddSubGoal(GOAL_COMMON_AttackTunableSpin, 10, 3007, TARGET_ENE_0, DIST_None, 0, 180)
GetWellSpace_Odds = 50
return GetWellSpace_Odds
end
local0 = 50.4 - local0
function Sniper_Priest101010_Act02(arg0, arg1, arg2)
local local0 = arg0:GetDist(TARGET_ENE_0)
local local1 = arg0:GetRandam_Int(1, 100)
local local2 = UPVAL0
local local3 = UPVAL0 + 5
local local4 = 0
local local5 = UPVAL0
arg1:AddSubGoal(GOAL_COMMON_AttackTunableSpin, 10, 3008, TARGET_ENE_0, DIST_None, 0, 180)
GetWellSpace_Odds = 50
return GetWellSpace_Odds
end
local0 = 2.4 - local0
function Sniper_Priest101010_Act03(arg0, arg1, arg2)
local local0 = arg0:GetDist(TARGET_ENE_0)
local local1 = UPVAL0 + 0
local local2 = UPVAL0 + 2
local local3 = 0
local local4 = UPVAL0
if arg0:GetRandam_Int(1, 100) <= 30 then
arg1:AddSubGoal(GOAL_COMMON_AttackTunableSpin, 10, 3002, TARGET_ENE_0, local4, 1, 90)
else
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3002, TARGET_ENE_0, local4, 1, 90)
arg1:AddSubGoal(GOAL_COMMON_ComboFinal, 10, 3005, TARGET_ENE_0, local4, 0)
end
GetWellSpace_Odds = 0
return GetWellSpace_Odds
end
function Sniper_Priest101010_Act04(arg0, arg1, arg2)
arg1:AddSubGoal(GOAL_COMMON_AttackTunableSpin, 10, 3006, TARGET_EVENT, Dist_None, 0, 90, 0, 0)
arg0:SetNumber(0, 1)
GetWellSpace_Odds = 0
return GetWellSpace_Odds
end
function Sniper_Priest101010_Act20(arg0, arg1, arg2)
if arg0:IsInsideTarget(TARGET_ENE_0, AI_DIR_TYPE_R, 180) then
arg1:AddSubGoal(GOAL_COMMON_AttackTunableSpin, 10, 3010, TARGET_ENE_0, DIST_None, 0, 90)
else
arg1:AddSubGoal(GOAL_COMMON_AttackTunableSpin, 10, 3009, TARGET_ENE_0, DIST_None, 0, 90)
end
GetWellSpace_Odds = 0
return GetWellSpace_Odds
end
function Sniper_Priest101010_ActAfter_RealTime(arg0, arg1)
arg1:AddSubGoal(GOAL_COMMON_Wait, arg0:GetRandam_Int(1.5, 2.5), TARGET_NONE, 0, 0, 0)
return
end
function Sniper_Priest101010_ActAfter_AdjustSpace(arg0, arg1, arg2)
arg1:AddSubGoal(GOAL_COMMON_If, 10, 0)
return
end
function Sniper_Priest101010Battle_Update(arg0, arg1)
return GOAL_RESULT_Continue
end
function Sniper_Priest101010Battle_Terminate(arg0, arg1)
return
end
local0 = 50.4 - local0
function Sniper_Priest101010Battle_Interupt(arg0, arg1)
local local0 = arg0:GetRandam_Int(1, 100)
local local1 = arg0:GetRandam_Int(1, 100)
local local2 = arg0:GetRandam_Int(1, 100)
local local3 = arg0:GetDist(TARGET_ENE_0)
local local4 = Shoot_2dist(arg0, arg1, 10, 20, 0, 50)
if local4 == 1 then
arg1:AddSubGoal(GOAL_COMMON_SpinStep, 10, 702, TARGET_ENE_0, 0, AI_DIR_TYPE_L, 5)
elseif local4 == 2 then
arg1:ClearSubGoal()
arg1:AddSubGoal(GOAL_COMMON_AttackTunableSpin, 10, 3000, TARGET_ENE_0, UPVAL0 + 1, 0, 90, 10, 10)
return true
end
return false
end
return
|
require'nvim-treesitter.configs'.setup {
highlight = {
enable = true,
custom_captures = {
-- Highlight the @foo.bar capture group with the "Identifier" highlight group.
--["foo.bar"] = "Identifier",
},
},
context_commentstring = {
enable = true,
enable_autocmd = false,
config = {
vim = '" %s'
}
},
rainbow = {
enable = true,
extended_mode = true, -- Also highlight non-bracket delimiters like html tags, boolean or table: lang -> boolean
max_file_lines = nil, -- Do not enable for files with more than n lines, int
-- colors = {}, -- table of hex strings
-- termcolors = {} -- table of colour name strings
}
}
|
local awful = require("awful")
local table = require("gears.table")
local wibox = require("wibox")
local beautiful = require("beautiful")
local font = require("utils.font")
local helper = require("utils.helper")
local icons = require("config.icons")
beautiful.tasklist_font = M.f.subtile_2
local tasklist_root = class()
function tasklist_root:init(args)
self.template = self:select_template()
self.buttons = self:make_buttons()
end
function tasklist_root:select_template()
return self:template_text() -- default
end
function tasklist_root:make_buttons()
local button = table.join(
awful.button({}, 1, function(c)
if c == client.focus then
c.minimized = true
else
c:emit_signal(
"request::activate",
"tasklist",
{ raise = true }
)
end
end),
awful.button({}, 3, function()
awful.menu.client_list({ theme = { width = 250 } })
end),
awful.button({}, 4, function()
awful.client.focus.byidx(1)
end),
awful.button({}, 5, function()
awful.client.focus.byidx(-1)
end)
)
return button
end
local function update_icon(item, c)
if c.class == "Firefox" or c.class == "Brave-browser" then
item.text = icons.app["web"]
elseif c.name == "neomutt" then
item.text = icons.app["neomutt"]
elseif c.name == "weechat" then
item.text = icons.app["weechat"]
elseif c.name:match("ncmpcpp") then
item.text = icons.app["ncmpcpp"]
elseif c.name == "vifm" then
item.text = icons.app["vifm"]
elseif c.class == "feh" then
item.text = icons.app["feh"]
elseif c.class == "mpv" then
item.text = icons.app["mpv"]
elseif c.name:match("paranoid") then
item.text = icons.app["paranoid"]
elseif c.name:match("spior") then
item.text = icons.app["spior"]
elseif c.name == "cava" then
item.text = icons.app["cava"]
elseif c.name:match("VIM") then
item.text = icons.app["vim"]
elseif c.class:match("VirtualBox") then
item.text = icons.app["virtualbox"]
elseif c.class == "Zathura" then
item.text = icons.app["zathura"]
elseif c.class == "Lutris" then
item.text = icons.app["lutris"]
elseif c.class:match("xst") then
item.text = icons.app["xst"]
else
item.text = icons.app["default"]
end
end
local function update_fg(item, c)
if client.focus == c then
item.fg = M.x.on_background .. "E6" -- 90%
elseif client.unfocus == c then
item.fg = M.x.on_background .. "B3" -- 70%
elseif client.minimized == c then
item.fg = M.x.on_background .. "80" -- 50%
elseif client.urgent == c then
item.fg = M.x.on_error .. "FF"
else
item.fg = M.x.on_background .. "80" -- 50%
end
end
local function update_bg(item, c)
if client.focus == c then
item.bg = M.x.on_background .. "0D" -- 5%
elseif client.unfocus == c then
item.bg = M.x.on_background .. "0D" -- 5%
elseif client.minimized == c then
item.bg = M.x.error .. "0A" -- 4%
elseif client.urgent == c then
item.bg = M.x.error .. "FF"
else
item.bg = M.x.on_background .. "00" -- 0%
end
end
function tasklist_root:template_text()
local t = {
{
{
{
{
{
id = 'text_icon',
font = M.f.icon,
widget = wibox.widget.textbox
},
id = "mat_fg",
widget = wibox.container.background
},
--{
-- id = 'text_role',
-- widget = wibox.widget.textbox,
--},
spacing = dpi(8),
layout = wibox.layout.fixed.horizontal,
},
left = dpi(8), right = dpi(8),
--top = dpi(2), bottom = dpi(2), -- one line only !
widget = wibox.container.margin
},
id = 'mat_background',
shape = helper.rrect(16),
widget = wibox.container.background,
},
--id = 'background_role',
widget = wibox.container.background,
create_callback = function(self, c, index, objects)
local icon = self:get_children_by_id('text_icon')[1]
update_icon(icon, c)
local bg = self:get_children_by_id('mat_background')[1]
update_bg(bg, c)
local fg = self:get_children_by_id('mat_fg')[1]
update_fg(fg, c)
end,
update_callback = function(self, c, index, objects)
local icon = self:get_children_by_id('text_icon')[1]
update_icon(icon, c)
local bg = self:get_children_by_id('mat_background')[1]
update_bg(bg, c)
local fg = self:get_children_by_id('mat_fg')[1]
update_fg(fg, c)
end,
}
return t
end
local tasklist_widget = class(tasklist_root)
function tasklist_widget:init(s, args)
tasklist_root.init(self, args)
local w = awful.widget.tasklist {
screen = s,
filter = awful.widget.tasklist.filter.currenttags,
--filter = awful.widget.tasklist.filter.minimizedcurrenttags, -- TODO: no work for now? try with the 4.4
buttons = self.buttons,
widget_template = self.template,
layout = {
layout = wibox.layout.fixed.horizontal
}
}
return w
end
return tasklist_widget
|
-- chatmaid -- hide and clean up unwanted Firefall chat messages.
-- Copyright (c) 2013-14 Thomas Aglassinger
-- See also: <https://github.com/roskakori/chatmaid>.
--
-- Permission is hereby granted, free of charge, to any person obtaining a
-- copy of this software and associated documentation files (the "Software"),
-- to deal in the Software without restriction, including without limitation
-- the rights to use, copy, modify, merge, publish, distribute, sublicense,
-- and/or sell copies of the Software, and to permit persons to whom the
-- Software is furnished to do so, subject to the following conditions:
--
-- The above copyright notice and this permission notice shall be included in
-- all copies or substantial portions of the Software.
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-- THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-- DEALINGS IN THE SOFTWARE.
-- TODO: How to deal with screaming in all upper case?
--
-- "hide" hides such messages, "cleanup" makes them easier to read by changing
-- them to all lower case.
local handleScreaming = "cleanup"
local function Set (list)
-- Set datatype as described in http://www.lua.org/pil/11.5.html.
local result = {}
for _, l in ipairs(list) do result[l] = true end
return result
end
-- Types that repr() can show directly using tostring().
local _TOSTRINGABLE_TYPES = Set{"nil", "number" }
-- A string describing item (somewhat similar to Python's repr()).
function repr(item)
local result
local itemType = type(item)
if _TOSTRINGABLE_TYPES[itemType] then
result = tostring(item)
elseif itemType == "string" then
result = '"'
for i = 1, item:len() do
local c = item:sub(i, i)
local code = c:byte(1)
-- TODO: Remove: print(" "..code)
if c == "\"" then
c = "\\\""
elseif c == "\\" then
c = "\\\\"
elseif c == "\n" then
c = "\\n"
elseif c == "\r" then
c = "\\r"
elseif c == "\t" then
c = "\\t"
elseif (code < 32) or (code > 127) then
c = string.format("\\x%02x", code)
end
result = result..c
end
result = result..'"'
else
result = "<type:"..type(item)..">"
end
return result
end
-- Similar to s but without leading and trailing white space
-- as described in http://lua-users.org/wiki/StringTrim.
function trimmed(s)
return s:match('^()%s*$') and '' or s:match('^%s*(.*%S)')
end
-- Bitwise and operator for 8 bit. Lua 5.1 does not yet support bit32.band().
function bit8and(a, b)
local result = 0
for i = 0, 7 do
if (a % 2) + (b % 2) == 2 then
result = result + 2 ^ i
end
a = math.floor(a / 2)
b = math.floor(b / 2)
end
return result
end
local VALID_SINGLE_CHARACTERS = Set{
"k", -- ok
"n", -- no
"r", -- ready
"y", -- yes
"?", -- confused
}
-- Common non english words using only basic latin alphabet for
-- hideCommonNonEnglish.
--
-- These words must not be "proper" English words too.
-- For example, the German "hat" (meaning "has") or "war" (meaning "was")
-- would be invalid because there is also an English word with the same
-- letters but a different meaning.
--
-- The languages on this list are derived from intuitively watching the zone
-- chat on eu-west servers and only includes languages that show up on a
-- regular base.
local COMMON_NON_ENGLISH_WORDS = Set{
-- French; see also: http://french.about.com/od/vocabulary/ss/mostcommonwords.htm.
"alors",
"avoir",
"faire",
"merci",
"moi",
"nous",
"oui",
"pour",
"que",
"sans",
"tout",
"voir",
"vous",
-- German, see also: http://german.about.com/library/blwfreq_t50.htm.
"aber",
"auch",
"dann",
"dein",
"deine",
"deiner",
"du",
"durch",
"ein",
"eine",
"einer",
"ich",
"ist",
"kann",
"kannst",
"mein",
"meine",
"meiner",
"musst",
"nicht",
"noch",
"sein",
"sind",
"und",
"wer",
"werden",
"wie",
"wird",
"wo",
}
-- Unicodes for to detect certain languages.
-- See also: http://en.wikipedia.org/wiki/ISO_basic_Latin_alphabet.
local GERMAN_UNICODES = Set{
196, -- Ä
214, -- Ö
220, -- Ü
223, -- ß
228, -- ä
246, -- ö
252, -- ü
}
local FRENCH_UNICODES = Set{
156, -- œ
224, -- à
226, -- â
230, -- æ
231, -- ç
232, -- è
233, -- é
234, -- ê
235, -- ë
238, -- î
239, -- ï
244, -- ô
249, -- ù
251, -- û
-- 252, -- ü: excluded because it is used to detect German.
255, -- ÿ
}
-- List of words to be considered thanks.
local THANKS = Set{
"danke", -- German
"merci", -- French
"thank you",
"thanks",
"thx",
"thx u",
"thx you",
"tnx",
"txh", -- common typo
"ty",
}
-- List of (integer) unicodes for characters found in UTF-8 encoded utf8text.
local function unicodes(utf8text)
-- TODO: Convert this to an iterator.
local result = {}
local resultIndex = 1
local utf8textIndex = 1
while utf8textIndex <= utf8text:len() do
local code = utf8text:byte(utf8textIndex)
-- TODO: Remove: print(resultIndex..";"..utf8textIndex..":"..code)
if code >= 0xc0 then -- 110xxxxx
if code >= 0xfc then -- 1111110x
code = bit8and(code, 0x01)
elseif code >= 0xf8 then -- 111110xx
code = bit8and(code, 0x03)
elseif code >= 0xf0 then -- 11110xxx
code = bit8and(code, 0x07)
elseif code >= 0xe0 then -- 1110xxxx
code = bit8and(code, 0x0f)
else -- 110xxxxx
code = bit8and(code, 0x1f)
end
utf8textIndex = utf8textIndex + 1
while (utf8textIndex <= utf8text:len()) and (utf8text:byte(utf8textIndex) >= 0x80) and (utf8text:byte(utf8textIndex) < 0xc0) do -- 10000000 resp. 110xxxxx
-- TODO: Remove: print(" "..code.."*64 + "..bit8and(utf8text:byte(utf8textIndex), 0x3f).." ("..utf8text:byte(utf8textIndex)..")")
code = (code * 64) + bit8and(utf8text:byte(utf8textIndex), 0x3f) -- 00111111
-- TODO: Remove: print(" --> "..code)
utf8textIndex = utf8textIndex + 1
end
end
result[resultIndex] = code
utf8textIndex = utf8textIndex + 1
resultIndex = resultIndex + 1
end
return result
end
local function isAscii(code)
-- True if code indicates an ASCII character
return (code <= 0x7f)
end
local function isCyrillic(code)
-- True if code indicates a unicode for a Cyrillic letter.
return (code >= 0x0400) and (code <= 0x4ff)
end
local function isUpper(text)
-- True if text is all upper case.
--
-- FIXME: Add support for non ASCII letters.
return text == text:upper()
end
local function isLetter(c)
-- True if the first character of text is an ASCII letter or some non ASCII character.
return (c >= "a" and c <= "z") or (c >= "A" and c <= "Z") or (c:byte(1) >= 0x80)
end
local function boolText(value)
return value and "true" or "false"
end
function arrayText(items)
local result = "{"
local atFirstItem = true
for _, item in ipairs(items) do
if atFirstItem then
atFirstItem = false
else
result = result..", "
end
-- TODO: Quote only strings.
-- TODO: Apply escapes on strings.
-- TODO: Use boolText() on boolean items.
result = result..'"'..item..'"'
end
result = result.."}"
return result
end
function arraySlice(items, firstIndex, lastIndex)
assert(items ~= nil)
assert(firstIndex ~= nil)
assert(firstIndex >= 1)
if lastIndex == nil then
lastIndex = #items
else
assert(lastIndex >= firstIndex)
end
local result = {}
for index = firstIndex, lastIndex do
result[index - firstIndex + 1] = items[index]
end
return result;
end
function words(text)
local result = {}
local resultIndex = 1
for part in text:gmatch("[^%s]+") do
local word = part:sub(1,1)
local isLetterWord = isLetter(word)
local partIndex = 2
while partIndex <= #part do
local charToExamine = part:sub(partIndex, partIndex)
local charToExamineIsLetter = isLetter(charToExamine)
-- TODO: Remove: print("ilw="..boolText(isLetterWord)..", c="..charToExamine..", cil="..boolText(charToExamineIsLetter)..", word="..word)
if isLetterWord == charToExamineIsLetter then
word = word..charToExamine
else
result[resultIndex] = word
resultIndex = resultIndex + 1
word = charToExamine
isLetterWord = charToExamineIsLetter
end
partIndex = partIndex + 1
end
result[resultIndex] = word
resultIndex = resultIndex + 1
end
return result
end
function letteredWords(words)
local result = {}
local resultIndex = 1
for _, word in ipairs(words) do
if isLetter(word:sub(1,1)) then
result[resultIndex] = word
resultIndex = resultIndex + 1
end
end
return result
end
-- Similar to text but without leading, trailing and redundant whitespace.
function cleanedWhitespace(text)
-- Reduce multiple while space to single blank.
local result = text:gsub("%s+", " ")
-- Remove leading and trailing space.
result = trimmed(result)
return result
end
-- Similar to text but without redundant exclamation and question marks.
function cleanedPunctuation(text)
-- Reduce multiple exclamation and question marks to a single one.
return text:gsub("!+", "!"):gsub("?+", "?")
end
function GuessedLanguage(utf8text)
-- A (cursory) guess for the language in which utf8text is written.
local result
local codes = unicodes(utf8text)
local codeIndex = 1
while (codeIndex <= #codes) and (result == nil) do
local code = codes[codeIndex]
if isCyrillic(code) then
result = "ru"
elseif FRENCH_UNICODES[code] ~= nil then
result = "fr"
elseif GERMAN_UNICODES[code] ~= nil then
result = "de"
elseif code >= 128 then
-- Unknown, non english language.
result = "xx"
else
codeIndex = codeIndex + 1
end
end
if result == nil then
result = "en"
end
return result
end
-- A tuple containing the message and actions performed on it based on the
-- channel, utf8text of the original message and message. If the message
-- should be hidden, it is nil. If no actions have been performed, they are
-- nil.
--
-- Settings are a table where the following keys can be set:
--
-- * TODO: cleanupWhitespace - remove leading, trailing and redundant whitespace?
-- For example, " hello world " becomes "hello world"
-- * TODO: cleanMultiplePunctuation - reduce multiple exclamation and question
-- marks to a single one? For example "no!!!" becomes "no!"
-- * hideCommonFrench: hide messages using common French words
-- * hideCommonGerman: hide messages using common German words
-- * hideCyrillic: hide messages using Cyrillic alphabet
-- * hideFrench: hide messages using French alphabet
-- * hideGeDuNo: hide messages using German, Dutch or Nordic alphabet
-- * hideNonAscii: hide messages using non ASCII characters
-- * hideSingleCharacters: hide single characters
-- * hideThanks: hide "thank you" messages
function sanitized(channel, utf8text, settings)
assert(channel ~= nil)
assert(utf8text ~= nil)
assert(settings ~= nil)
local actions = ""
local cleanedText = utf8text
local isPublicChannel = (channel == "zone") or (channel == "local")
-- Remove leading and trailing whitespace.
local previousText = cleanedText
cleanedText = cleanedWhitespace(cleanedText)
if cleanedText:len() == 0 then
return nil, "hide empty"
elseif cleanedText ~= previousText then
actions = actions.."; cleanup whitespace"
end
previousText = cleanedText
cleanedText = cleanedPunctuation(cleanedText)
if cleanedText ~= previousText then
actions = actions.."; cleanup punctuation"
end
-- Hide single characters.
if settings.hideSingleCharacters then
local isSingleCharacter = (cleanedText:len() == 1)
local isDigit = (cleanedText >= "0") and (cleanedText <= "9")
if isSingleCharacter and not isDigit and (VALID_SINGLE_CHARACTERS[cleanedText] == nil) then
return nil, "hide single character"
end
end
-- Hide undesired alphabets.
if isPublicChannel then
local language = GuessedLanguage(cleanedText)
if settings.hideCyrillic and (language == "ru") then
return nil, "hide cyrillic"
elseif settings.hideFrench and (language == "fr") then
return nil, "hide french"
elseif settings.hideGeDuNo and (language == "de") then
return nil, "hide german/dutch/nordic"
elseif settings.hideNonAscii and (language ~= "en") then
return nil, "hide non ascii"
end
end
-- Hide messages with common non English words.
if isPublicChannel and settings.hideCommonNonEnglish then
local cleanedWords = letteredWords(words(cleanedText))
for _, word in ipairs(cleanedWords) do
if COMMON_NON_ENGLISH_WORDS[word] then
return nil, "hide common non english"
end
end
end
if (channel == "zone") and settings.hideThanks and (THANKS[cleanedText] ~= nil) then
return nil, "hide thanks"
end
-- Apart from possible cleanups, the message was just fine.
if actions == "" then
actions = nil
else
-- Remove leading "; " from actions
assert(actions:sub(1,2) == "; ", "actions="..actions)
actions = actions:sub(3)
end
return cleanedText, actions
end
|
--[[
-- prototype code (desired outcome)
TDUI.Label = TDUI.Panel {
text = ""
font = RegisterFont("font/consolas.ttf"),
fontSize = 24,
Draw = function(self, w, h)
UiFont(self.font, self.fontSize)
UiAlign("left top")
UiText(self.text)
-- This example doesn't account for:
-- * custom alignment
-- * wrapping on width
-- * Layout calculation
end,
}
local window = TDUI.Frame {
title = "Test Window",
width = "80%h",
height = "80%h",
resizeable = true,
padding = 10,
TDUI.Label {
text = "Something"
}
}
]]
local function createchild(self, def)
setmetatable(def, {
__index = self,
__call = createchild,
})
def:__PerformRegister()
return def
end
TDUI = setmetatable({}, {
__newindex = function(self, k, v)
rawset(self, k, v) -- Is extra processing necessary?
end,
__call = function(self, def, parent) return createchild(parent, def) end,
})
local function parseFour(data)
local dtype = type(data)
if dtype == "number" then
return {data, data, data, data}
elseif dtype == "string" then
local tmp = {}
for match in data:gmatch("[^ ]+") do
tmp[#tmp + 1] = match
end
data = tmp
dtype = "table"
end
if dtype == "table" then
if #data == 0 then return {0,0,0,0} end
if #data == 1 then return {data[1], data[1], data[1], data[1]} end
if #data < 4 then return {data[1], data[2], data[1], data[2]} end
return data
end
return {0,0,0,0}
end
local function parsePos(data, w, h, def)
if type(data) == "number" then return data end
if type(data) ~= "string" then return 0 end
local n, prc, mod = data:match("^(-?%d+)(%%?)([wh]?)$")
if mod == "w" then
return w * tonumber(n) / 100
elseif mod == "h" then
return h * tonumber(n) / 100
elseif prc == "%" then
return def * tonumber(n) / 100
end
return tonumber(n)
end
local function parseAlign(data)
local alignx, aligny = 1, 1
for str in data:gmatch("[^ ]+") do
if str == "left" then alignx = 1 break end
if str == "center" then alignx = 0 break end
if str == "right" then alignx = -1 break end
if str == "top" then aligny = 1 break end
if str == "middle" then aligny = 0 break end
if str == "bottom" then aligny = -1 break end
end
return alignx, aligny
end
-- Base Panel,
TDUI.Panel = TDUI {
__alignx = 1, __aligny = 1,
__realx = 0, __realy = 0,
__realw = 0, __realh = 0,
margin = 0, padding = 0,
align = "left top",
clip = false,
layout = TDUI.Layout,
oninit = function(self) end,
ondraw = function(self, w, h)
--UiColor(1, 1, 1)
--UiTranslate(-40, -40)
--UiImageBox("common/box-solid-shadow-50.png", w+80, h+81, 50, 50)
--UiTranslate(40, 40)
--UiColor(1, 0, 0, 0.2)
--UiRect(w, h)
end,
__Draw = function(self)
if not rawget(self, "__validated") then
self:InvalidateLayout(true)
end
local w, h = self:GetComputedSize()
self:ondraw(w, h)
if self.clip then UiPush() UiWindow(w, h, true) end
local x, y = 0, 0
for i = 1, #self do
local child = self[i]
local dfx, dfy = child:GetComputedPos()
UiTranslate(dfx - x, dfy - y)
child:__Draw()
x, y = dfx, dfy
end
UiTranslate(-x, -y)
if self.clip then UiPop() end
end,
__PerformRegister = function(self)
self.margin = parseFour(self.margin)
self.padding = parseFour(self.padding)
self.__alignx, self.__aligny = parseAlign(self.align)
self:oninit()
end,
onlayout = function(self, data, pw, ph, ew, eh)
-- onlayout must do 2 things:
-- 1. Position its children within the available space
-- 2. Compute its own size for the layout of its parent
-- TODO: Optimize for static sizes and unchanged bounds
local selflayout = self.layout
if selflayout then
local f = selflayout.onlayout
if f and f ~= self.onlayout then
return f(self, selflayout, pw, ph, ew, eh)
end
end
warning("Unable to compute layout")
self.__validated = true
self:ComputeSize(pw, ph)
for i = 1, #self do
local child = self[i]
child:ComputePosition(0, 0, self.__realw, self.__realh)
child:onlayout(child, self.__realw, self.__realh, self.__realw, self.__realh)
end
return self.__realw, self.__realh
--[[self.__realx = self.x and parsePos(self.x, pw, ph, pw) or 0
self.__realy = self.y and parsePos(self.y, pw, ph, ph) or 0
self.__realw = self.width and parsePos(self.width, pw, ph, pw) or 256
self.__realh = self.height and parsePos(self.height, pw, ph, ph) or 256
self.__validated = true
for i = 1, #self do
local child = self[i]
child:__PerformLayout(self.__realw, self.__realh)
end]]
end,
ComputePosition = function(self, dx, dy, pw, ph)
local x = self.x and parsePos(self.x, pw, ph, pw) or 0
if self.__alignx == 1 then
self.__realx = x + self.margin[4] + dx
elseif self.__alignx == 0 then
self.__realx = x + (pw - self.__realw) / 2 + dx
elseif self.__alignx == -1 then
self.__realx = x + pw - self.margin[2] - self.__realw + dx
end
local y = self.y and parsePos(self.y, pw, ph, ph) or 0
if self.__aligny == 1 then
self.__realy = y + self.margin[1] + dy
elseif self.__aligny == 0 then
self.__realy = y + (ph - self.__realh) / 2 + dy
elseif self.__aligny == -1 then
self.__realy = y + ph - self.margin[3] - self.__realh + dy
end
return self.__realx, self.__realy
end,
ComputeSize = function(self, pw, ph)
self.__realw = (self.width and parsePos(self.width, pw, ph, pw) or 0)
self.__realh = (self.height and parsePos(self.height, pw, ph, ph) or 0)
return self.__realw - self.padding[4] - self.padding[2], self.__realh - self.padding[1] - self.padding[3]
end,
InvalidateLayout = function(self, immediate)
if immediate then
local cw, ch = self:GetComputedSize()
local pw, ph = self:GetParentSize()
self:onlayout(self, pw, ph, self.__prevew or pw, self.__preveh or ph)
local nw, nh = self:GetComputedSize()
if nw ~= cw or nh ~= ch then
self:InvalidateParentLayout(true)
end
else
self.__validated = false
end
end,
InvalidateParentLayout = function(self, immediate)
local parent = self:GetParent()
if parent then
return parent:InvalidateLayout(immediate)
else
local pw, ph = UiWidth(), UiHeight()
self:InvalidateLayout(immediate)
self.__realx = self.x and parsePos(self.x, pw, ph, pw) or 0
self.__realy = self.y and parsePos(self.y, pw, ph, ph) or 0
end
end,
SetParent = function(self, parent)
local prev = self:GetParent()
if prev then
for i = 1, #prev do
if prev[i] == self then
table.remove(prev, i)
prev:InvalidateLayout()
break
end
end
end
if parent then
parent[#parent + 1] = self
rawset(self, "__parent", parent)
parent:InvalidateLayout()
end
end,
GetParent = function(self)
return rawget(self, "__parent")
end,
GetComputedPos = function(self)
return self.__realx, self.__realy
end,
GetComputedSize = function(self)
return self.__realw, self.__realh
end,
SetSize = function(self, w, h) self.width, self.height = w, h self:InvalidateLayout() end,
SetWidth = function(self, w) self.width = w self:InvalidateLayout() end,
SetHeight = function(self, h) self.height = h self:InvalidateLayout() end,
SetPos = function(self, x, y) self.x, self.y = x, y self:InvalidateLayout() end,
SetX = function(self, x) self.x = x self:InvalidateLayout() end,
SetY = function(self, y) self.y = y self:InvalidateLayout() end,
SetMargin = function(self, top, right, bottom, left)
if right then top = {top, right, bottom, left} end
self.margin = parseFour(top)
self:InvalidateLayout()
end,
SetPadding = function(self, top, right, bottom, left)
if right then top = {top, right, bottom, left} end
self.padding = parseFour(top)
self:InvalidateLayout()
end,
GetParentSize = function(self)
local parent = self:GetParent()
if parent then
return parent:GetComputedSize()
else
return UiWidth(), UiHeight()
end
end,
}
TDUI.Layout = TDUI.Panel {
onlayout = function(self, data, pw, ph, ew, eh)
self.__validated = true
self.__prevew, self.__preveh = ew, eh
local nw, nh = self:ComputeSize(pw, ph)
local p1, p2, p3, p4 = self.padding[1], self.padding[2], self.padding[3], self.padding[4]
for i = 1, #self do
local child = self[i]
child:onlayout(child, nw, nh, ew, eh)
child:ComputePosition(p4, p1, nw, nh)
end
return self.__realw + self.margin[4] + self.margin[2], self.__realh + self.margin[1] + self.margin[3]
end
}
TDUI.Panel.layout = TDUI.Layout
local ScreenPanel = TDUI.Panel {
x = 0, y = 0,
width = 0, height = 0
}
function TDUI.Panel:Popup(parent)
self:SetParent(parent or ScreenPanel)
end
function TDUI.Panel:Close()
self:SetParent()
end
hook.add("base.draw", "api.tdui.ScreenPanel", function()
if ScreenPanel.width == 0 then
ScreenPanel:SetSize(UiWidth(), UiHeight())
end
UiPush()
softassert(pcall(ScreenPanel.__Draw, ScreenPanel))
UiPop()
end)
include("panels/layout.lua")
|
---[[[ bitwise operators between Lua 5.1 (require LuaBitOp), 5.2 and 5.3
local _lshift,
_rshift,
_bnot,
_band,
_bor,
_bxor;
if _VERSION == "Lua 5.1" then
luabitop = require ("bit")
_lshift = luabitop.lshift
_rshift = luabitop.rshift
_bnot = luabitop.bnot
_band = luabitop.band
_bor = luabitop.bor
_bxor = luabitop.bxor
elseif _VERSION == 'Lua 5.2' then
_lshift = bit32.lshift
_rshift = bit32.rshift
_bnot = bit32.bnot
_band = bit32.band
_bor = bit32.bor
_bxor = bit32.bxor
else
_lshift = load('return function(x, y) return x << y end')()
_rshift = load('return function(x, y) return x >> y end')()
_bnot = load('return function(x) return ~x end')()
_band = load('return function(x, y) return x & y end')()
_bor = load('return function(x, y) return x | y end')()
_bxor = load('return function(x, y) return x ~ y end')()
end
local function bitop_chain(v)
return {
value = v,
lshift = function(self, v) self.value = _lshift(self.value, v); return self end,
rshift = function(self, v) self.value = _rshift(self.value, v); return self end,
bnot = function(self, v) self.value = _bnot(self.value, v); return self end,
band = function(self, v) self.value = _band(self.value, v); return self end,
bor = function(self, v) self.value = _bor(self.value, v); return self end,
bxor = function(self, v) self.value = _bxor(self.value, v); return self end,
result = function(self) return self.value end
}
end
---]]]
local bin = function(s)
return tonumber(s, 2)
end
local LEFTMOSTBIT = bitop_chain(0) -- 0000 [..] 0000
:bnot() -- 1111 [..] 1111
:rshift(1) -- 0111 [..] 1111
:bnot() -- 1000 [..] 0000
:result()
describe("#bitset_array library", function()
local bitset_array = require ("rotor.bitset_array")
describe("bitset array data", function ()
it(
"the data of a bitset array is a table of n (integer) numbers",
function ()
assert.are.same(bitset_array.new(), {0})
assert.are.same(bitset_array.new(2), {0, 0})
assert.are.same(bitset_array.new(3), {0, 0, 0})
local mtype = math.type
if mtype then
local bitset = bitset_array.new(3)
assert.are.same(
mtype(bitset[1]),
mtype(bitset[2]),
mtype(bitset[3]),
'integer'
)
end
end
)
end)
describe("'copy' function", function ()
local bitset = bitset_array.new(3)
local bitset_copy = bitset_array.copy(bitset)
it("creates a new table", function ()
assert.are_not.equal(bitset, bitset_copy)
end)
it("have the same values", function ()
assert.are.same(bitset, bitset_copy)
local another_bitset = bitset_array.new(2)
another_bitset[2] = 0x2
bitset_copy = bitset_array.copy(another_bitset)
assert.are.same(another_bitset, bitset_copy, {0, 0x2})
end)
it("can be used as a method", function ()
local _bitset_copy = bitset:copy()
local _another_bitset_copy = _bitset_copy:copy()
assert.are.same(bitset, _bitset_copy, _another_bitset_copy)
end)
end)
describe("'equals' function", function ()
it("returns true if the bitset arrays have same values", function ()
local bitset = bitset_array.new(3)
local equals_bitset = bitset:copy()
local different_bitset = bitset_array.new(2)
assert.are.same(bitset, equals_bitset)
assert.are_not.same(bitset, different_bitset)
assert.is_true(bitset_array.equals(bitset, equals_bitset))
assert.is_false(bitset_array.equals(bitset, different_bitset))
end)
it("can be used as a method", function ()
local bitset = bitset_array.new(3)
local equals_bitset = bitset:copy()
local different_bitset = bitset_array.new(2)
assert.are.same(bitset, equals_bitset)
assert.are_not.same(bitset, different_bitset)
assert.is_true(bitset:equals(equals_bitset))
assert.is_false(bitset:equals(different_bitset))
end)
end)
describe('bitwise operation', function ()
local bitset = bitset_array.new(3)
local another_bitset = bitset_array.new(2)
local expected_result = bitset_array.new(3)
bitset[1] = 0x1 -- 0000 0000 0001
bitset[2] = 0x32 -- 0000 0011 0010
bitset[3] = 0xa43 -- 1010 0100 0011
another_bitset[1] = 0x11 -- 0000 0001 0001
another_bitset[2] = 0xb78 -- 1011 0111 1000
local function run_func_with_bitset_array(op_name, other_value)
local bitset_before = bitset_array.copy(bitset)
local another_bitset_before = bitset_array.copy(other_value)
local result = bitset_array[op_name](bitset, other_value)
return result, bitset_before, another_bitset_before
end
local function run_func_with_value(op_name, other_value)
local bitset_before = bitset_array.copy(bitset)
local result = bitset_array[op_name](bitset, other_value)
return result, bitset_before
end
local function run_method_with_bitset_array(op_name, other_value)
local bitset_before = bitset_array.copy(bitset)
local another_bitset_before = bitset_array.copy(other_value)
local result = bitset[op_name](bitset, other_value)
return result, bitset_before, another_bitset_before
end
local function run_method_with_value(op_name, other_value)
local bitset_before = bitset_array.copy(bitset)
local result = bitset[op_name](bitset, other_value)
return result, bitset_before
end
local function test_bitwise_func(op_name, other_value, other_is_bitset)
local r1, r2, r3 = (
other_is_bitset
and run_func_with_bitset_array
or run_func_with_value
) (op_name, other_value)
return r1, r2, r3
end
local function test_bitwise_method(op_name, other_value, other_is_bitset)
local r1, r2, r3 = (
other_is_bitset
and run_method_with_bitset_array
or run_method_with_value
) (op_name, other_value)
return r1, r2, r3
end
local function test_func_and_method(op_name, other_value, other_is_bitset)
local result, bitset_before, another_bitset_before =
test_bitwise_func(op_name, other_value, other_is_bitset)
it("returns a new bit array with the result", function ()
assert.are_not.equals(bitset, another_bitset, result)
assert.are.same(expected_result, result)
end)
it("Don't change original values", function ()
assert.are.same(bitset, bitset_before)
if other_is_bitset then
assert.are.same(another_bitset, another_bitset_before)
end
end)
result, bitset_before, another_bitset_before =
test_bitwise_method(op_name, other_value, other_is_bitset)
it("can be used as a method", function ()
assert.are_not.equals(bitset, other_value, result)
assert.are.same(expected_result, result)
end)
end
describe("'band' function", function ()
expected_result[1] = _band(bitset[1], another_bitset[1])
expected_result[2] = _band(bitset[2], another_bitset[2])
expected_result[3] = _band(bitset[3], 1)
test_func_and_method('band', another_bitset, true)
end)
describe("'bor' function", function ()
expected_result[1] = _bor(bitset[1], another_bitset[1])
expected_result[2] = _bor(bitset[2], another_bitset[2])
expected_result[3] = _bor(bitset[3], 0)
test_func_and_method('bor', another_bitset, true)
end)
describe("'bxor' function", function ()
expected_result[1] = _bxor(bitset[1], another_bitset[1])
expected_result[2] = _bxor(bitset[2], another_bitset[2])
expected_result[3] = _bxor(bitset[3], 0)
test_func_and_method('bxor', another_bitset, true)
end)
describe("'lshift' function", function ()
-- bitset[1]:
-- 1111 0000 [..] 0000 0000 0000 0001
bitset[1] = bitop_chain(0x1)
:bor(LEFTMOSTBIT)
:bor(_rshift(LEFTMOSTBIT, 1))
:bor(_rshift(LEFTMOSTBIT, 2))
:bor(_rshift(LEFTMOSTBIT, 3))
:result()
-- bitset[2]:
-- 1110 0000 [..] 0000 0000 0011 0010
bitset[2] = bitop_chain(0x32)
:bor(LEFTMOSTBIT)
:bor(_rshift(LEFTMOSTBIT, 1))
:bor(_rshift(LEFTMOSTBIT, 2))
:result()
-- bitset[3]:
-- 0000 0000 0000 0000 1010 0100 0011
describe("can shift", function()
-- expected result for 1 step
-- 1110 0000 [..] 0000 0000 0000 0010
-- 1100 0000 [..] 0000 0000 0110 0101
-- 0000 0000 [..] 0001 0100 1000 0111
describe("1 step", function()
expected_result[1] = bitop_chain(0x2)
:bor(LEFTMOSTBIT)
:bor(_rshift(LEFTMOSTBIT, 1))
:bor(_rshift(LEFTMOSTBIT, 2))
:result()
expected_result[2] = bitop_chain(bin"1100101")
:bor(LEFTMOSTBIT)
:bor(_rshift(LEFTMOSTBIT, 1))
:result()
expected_result[3] = bin"1010010000111"
test_func_and_method('lshift', 1)
end)
-- expected result for 2 steps
-- 1100 0000 [..] 0000 0000 0000 0100
-- 1000 0000 [..] 0000 0000 1100 1011
-- 0000 0000 [..] 0010 1001 0000 1111
describe("2 steps", function()
expected_result[1] = bitop_chain(bin"100")
:bor(LEFTMOSTBIT)
:bor(_rshift(LEFTMOSTBIT, 1))
:result()
expected_result[2] = _bor(bin"11001011", LEFTMOSTBIT)
expected_result[3] = bin"10100100001111"
test_func_and_method('lshift', 2)
end)
-- expected result for 3 steps
-- 1000 0000 [..] 0000 0000 0000 1000
-- 0000 0000 [..] 0000 0001 1001 0111
-- 0000 0000 [..] 0101 0010 0001 1111
describe("3 steps", function()
expected_result[1] = _bor(bin"1000", LEFTMOSTBIT)
expected_result[2] = bin"110010111"
expected_result[3] = bin"101001000011111"
test_func_and_method('lshift', 3)
end)
-- expected result for 4 steps
-- 0000 0000 [..] 0000 0000 0001 0000
-- 0000 0000 [..] 0000 0011 0010 1111
-- 0000 0000 [..] 1010 0100 0011 1110
describe("4 steps", function()
expected_result[1] = bin"10000"
expected_result[2] = bin"1100101111"
expected_result[3] = bin"1010010000111110"
test_func_and_method('lshift', 4)
end)
end)
end)
describe("'rshift' function", function ()
-- bitset[1]:
-- 1000 0000 [..] 0000 0000 0000 0001
bitset[1] = _bor(0x1, LEFTMOSTBIT)
-- bitset[2]:
-- 1000 0000 [..] 0000 0000 0011 0010
bitset[2] = _bor(0x32, LEFTMOSTBIT)
-- bitset[3]:
-- 0000 0000 0000 0000 1010 0100 0011
describe("can shift", function()
-- expected result for 1 step
-- 0100 0000 [..] 0000 0000 0000 0000
-- 1100 0000 [..] 0000 0000 0001 1001
-- 0000 0000 0000 0000 0101 0010 0001
describe("1 step", function()
expected_result[1] = _bor(0, _rshift(LEFTMOSTBIT, 1))
expected_result[2] = bitop_chain(bin"11001")
:bor(LEFTMOSTBIT)
:bor(_rshift(LEFTMOSTBIT, 1))
:result()
expected_result[3] = bin"10100100001"
test_func_and_method('rshift', 1)
end)
-- expected result for 2 steps
-- 1010 0000 [..] 0000 0000 0000 0000
-- 1110 0000 [..] 0000 0000 0000 1100
-- 0000 0000 0000 0000 0010 1001 0000
describe("2 steps", function()
expected_result[1] = bitop_chain(0)
:bor(LEFTMOSTBIT)
:bor(_rshift(LEFTMOSTBIT, 2))
:result()
expected_result[2] = bitop_chain(bin"1100")
:bor(LEFTMOSTBIT)
:bor(_rshift(LEFTMOSTBIT, 1))
:bor(_rshift(LEFTMOSTBIT, 2))
:result()
expected_result[3] = bin"1010010000"
test_func_and_method('rshift', 2)
end)
-- expected result for 3 steps
-- 0101 0000 [..] 0000 0000 0000 0000
-- 0111 0000 [..] 0000 0000 0000 0110
-- 0000 0000 0000 0000 0001 0100 1000
describe("3 steps", function()
expected_result[1] = bitop_chain(0)
:bor(_rshift(LEFTMOSTBIT, 1))
:bor(_rshift(LEFTMOSTBIT, 3))
:result()
expected_result[2] = bitop_chain(bin"110")
:bor(_rshift(LEFTMOSTBIT, 1))
:bor(_rshift(LEFTMOSTBIT, 2))
:bor(_rshift(LEFTMOSTBIT, 3))
:result()
expected_result[3] = bin"101001000"
test_func_and_method('rshift', 3)
end)
-- expected result for 4 steps
-- 0010 1000 [..] 0000 0000 0000 0000
-- 0011 1000 [..] 0000 0000 0000 0011
-- 0000 0000 0000 0000 0000 1010 0100
describe("4 steps", function()
expected_result[1] = bitop_chain(0)
:bor(_rshift(LEFTMOSTBIT, 2))
:bor(_rshift(LEFTMOSTBIT, 4))
:result()
expected_result[2] = bitop_chain(bin"11")
:bor(_rshift(LEFTMOSTBIT, 2))
:bor(_rshift(LEFTMOSTBIT, 3))
:bor(_rshift(LEFTMOSTBIT, 4))
:result()
expected_result[3] = bin"10100100"
test_func_and_method('rshift', 4)
end)
end)
end)
describe("'bnot' function", function ()
expected_result[1] = _bnot(bitset[1])
expected_result[2] = _bnot(bitset[2])
expected_result[3] = _bnot(bitset[3])
test_func_and_method('bnot')
end)
end)
end)
|
-- Reactor- and Turbine control by Asher9 --
-- Version 2.6 --
-- Start program --
--========== Global variables for all program parts ==========
--All options
optionList = {}
version = 0
rodLevel = 0
backgroundColor = 0
textColor = 0
reactorOffAt = 0
reactorOnAt = 0
mainMenu = ""
lang = ""
overallMode = ""
program = ""
turbineTargetSpeed = 0
targetSteam = 0
turbineOnOff = ""
--Peripherals
mon = "" --Monitor
r = "" --Reactor
v = "" --Energy Storage
t = {} --Turbines
--Total count of all turbines
amountTurbines = 0
--TouchpointLocation (same as the monitor)
touchpointLocation = {}
--========== Global functions for all program parts ==========
--===== Functions for loading and saving the options =====
--Loads the options.txt file and adds values to the global variables
function loadOptionFile()
--Loads the file
local file = fs.open("/reactor-turbine-program/config/options.txt","r")
local list = file.readAll()
file.close()
--Insert Elements and assign values
optionList = textutils.unserialise(list)
--Assign values to variables
version = optionList["version"]
rodLevel = optionList["rodLevel"]
backgroundColor = tonumber(optionList["backgroundColor"])
textColor = tonumber(optionList["textColor"])
reactorOffAt = optionList["reactorOffAt"]
reactorOnAt = optionList["reactorOnAt"]
mainMenu = optionList["mainMenu"]
lang = optionList["lang"]
overallMode = optionList["overallMode"]
program = optionList["program"]
turbineTargetSpeed = optionList["turbineTargetSpeed"]
targetSteam = optionList["targetSteam"]
turbineOnOff = optionList["turbineOnOff"]
end
--Refreshes the options list
function refreshOptionList()
optionList["version"] = version
optionList["rodLevel"] = rodLevel
optionList["backgroundColor"] = backgroundColor
optionList["textColor"] = textColor
optionList["reactorOffAt"] = reactorOffAt
optionList["reactorOnAt"] = reactorOnAt
optionList["mainMenu"] = mainMenu
optionList["lang"] = lang
optionList["overallMode"] = overallMode
optionList["program"] = program
optionList["turbineTargetSpeed"] = turbineTargetSpeed
optionList["targetSteam"] = targetSteam
optionList["turbineOnOff"] = turbineOnOff
end
--Saves all data basck to the options.txt file
function saveOptionFile()
--Refresh option list
refreshOptionList()
--Serialise the table
local list = textutils.serialise(optionList)
--Save optionList to the config file
local file = fs.open("/reactor-turbine-program/config/options.txt","w")
file.writeLine(list)
file.close()
print("Saved.")
end
--===== Automatic update detection =====
--Check for updates
function checkUpdates()
--Check current branch (release or beta)
local currBranch = ""
local tmpString = string.sub(version,5,5)
if tmpString == "" or tmpString == nil or tmpString == "r" then
currBranch = "master"
elseif tmpString == "b" then
currBranch = "beta"
end
--Get Remote version file
downloadFile("https://raw.githubusercontent.com/Asher9/Asher9-s-Programms/"..currBranch.."/TurbineControl/turbineControl_v2/src/",currBranch..".ver")
--Compare local and remote version
local file = fs.open(currBranch..".ver","r")
local remoteVer = file.readLine()
file.close()
print("remoteVer: "..remoteVer)
print("localVer: "..version)
print("Update? -> "..tostring(remoteVer > version))
--Update if available
if remoteVer > version then
print("Update...")
sleep(2)
doUpdate(remoteVer,currBranch)
end
--Remove remote version file
shell.run("rm "..currBranch..".ver")
end
function doUpdate(toVer,branch)
--Set the monitor up
local x,y = mon.getSize()
mon.setBackgroundColor(colors.black)
mon.clear()
local x1 = x/2-15
local y1 = y/2-4
local x2 = x/2
local y2 = y/2
--Draw Box
mon.setBackgroundColor(colors.gray)
mon.setTextColor(colors.gray)
mon.setCursorPos(x1,y1)
for i=1,8 do
mon.setCursorPos(x1,y1+i-1)
mon.write(" ") --30 chars
end
--Print update message
mon.setTextColor(colors.white)
if lang == "de" then
mon.setCursorPos(x2-9,y1+1)
mon.write("Update verfügbar!") --18 chars
mon.setCursorPos(x2-(math.ceil(string.len(toVer)/2)),y1+3)
mon.write(toVer)
mon.setCursorPos(x2-8,y1+5)
mon.write("Zum installieren") --16 chars
mon.setCursorPos(x2-12,y1+6)
mon.write("in den Computer schauen") --23 chars
elseif lang == "en" then
mon.setCursorPos(x2-9,y1+1)
mon.write("Update available!") --17 chars
mon.setCursorPos(x2-(math.ceil(string.len(toVer)/2)),y1+3)
mon.write(toVer)
mon.setCursorPos(x2-8,y1+5)
mon.write("To install look") --15 chars
mon.setCursorPos(x2-12,y1+6)
mon.write("at the computer terminal") --24 chars
end
--Print install instructions to the terminal
term.clear()
term.setCursorPos(1,1)
local tx,ty = term.getSize()
if lang == "de" then
print("Soll das Update installiert werden (j/n)?")
term.write("Eingabe: ")
elseif lang == "en" then
print("Do you want to install the update (y/n)?")
term.write("Input: ")
end
--Run Counter for installation skipping
local count = 10
local out = false
term.setCursorPos(tx/2-5,ty)
term.write(" -- 10 -- ")
while true do
local timer1 = os.startTimer(1)
while true do
local event, p1 = os.pullEvent()
if event == "key" then
if p1 == 36 or p1 == 21 then
shell.run("/reactor-turbine-program/install/installer.lua update "..branch)
out = true
break
end
elseif event == "timer" and p1 == timer1 then
count = count - 1
term.setCursorPos(tx/2-5,ty)
term.write(" -- 0"..count.." -- ")
break
end
end
if out then break end
if count == 0 then
term.clear()
term.setCursorPos(1,1)
break
end
end
end
--Download Files (For Remote version file)
function downloadFile(relUrl,path)
local gotUrl = http.get(relUrl..path)
if gotUrl == nil then
term.clear()
error("File not found! Please check!\nFailed at "..relUrl..path)
else
url = gotUrl.readAll()
end
local file = fs.open(path,"w")
file.write(url)
file.close()
end
--===== Initialization of all peripherals =====
function initPeripherals()
--Get all peripherals
local peripheralList = peripheral.getNames()
for i = 1, #peripheralList do
--Turbines
if peripheral.getType(peripheralList[i]) == "BigReactors-Turbine" then
t[amountTurbines] = peripheral.wrap(peripheralList[i])
amountTurbines = amountTurbines + 1
--Reactor
elseif peripheral.getType(peripheralList[i]) == "BigReactors-Reactor" then
r = peripheral.wrap(peripheralList[i])
--Monitor & Touchpoint
elseif peripheral.getType(peripheralList[i]) == "monitor" then
mon = peripheral.wrap(peripheralList[i])
touchpointLocation = peripheralList[i]
--Capacitorbank / Energycell / Energy Core
else
local tmp = peripheral.wrap(peripheralList[i])
local stat,err = pcall(function() tmp.getEnergyStored() end)
if stat then
v = tmp
end
end
end
--Check for errors
term.clear()
term.setCursorPos(1,1)
--No Monitor
if mon == "" then
if lang == "de" then
error("Monitor nicht gefunden!\nBitte prüfen und den Computer neu starten (Strg+R gedrückt halten)")
elseif lang == "en" then
error("Monitor not found!\nPlease check and reboot the computer (Press and hold Ctrl+R)")
end
end
--Monitor clear
mon.setBackgroundColor(colors.black)
mon.setTextColor(colors.red)
mon.clear()
mon.setCursorPos(1,1)
--Monitor too small
local monX,monY = mon.getSize()
if monX < 71 or monY < 26 then
if lang == "de" then
mon.write("Monitor zu klein.\nBitte min. 7 breit und 4 hoch bauen und den Computer neu starten\n(Strg+R gedrückt halten)")
error("Monitor zu klein.\nBitte min. 7 breit und 4 hoch bauen und den Computer neu starten\n(Strg+R gedrückt halten)")
elseif lang == "en" then
mon.write("Monitor too small\n Must be at least 7 in length and 4 in height.\nPlease check and reboot the computer (Press and hold Ctrl+R)")
error("Monitor too small.\nMust be at least 7 in length and 4 in height.\nPlease check and reboot the computer (Press and hold Ctrl+R)")
end
end
amountTurbines = amountTurbines - 1
end
--===== Shutdown and restart the computer =====
function restart()
saveOptionFile()
mon.clear()
mon.setCursorPos(38,8)
mon.write("Rebooting...")
os.reboot()
end
--=========== Run the program ==========
--Load the option file and initialize the peripherals
loadOptionFile()
initPeripherals()
checkUpdates()
--Run program or main menu, based on the settings
if mainMenu then
shell.run("/reactor-turbine-program/start/menu.lua")
shell.completeProgram("/reactor-turbine-program/start/start.lua")
else
if program == "turbine" then
shell.run("/reactor-turbine-program/program/turbineControl.lua")
elseif program == "reactor" then
shell.run("/reactor-turbine-program/program/reactorControl.lua")
end
shell.completeProgram("/reactor-turbine-program/start/start.lua")
end
--========== END OF THE START.LUA FILE ==========
|
local cipher = require 'security.crypto.cipher'
local digest = require 'security.crypto.digest'
local ticket = require 'security.crypto.ticket'
local http = require 'http'
local web = require 'web'
local config = require 'config'
local _ = require 'shared.utils'
local options = {
urls = _.load_urls {'membership', 'posts', 'public'},
cache = config.cache,
ticket = ticket.new {
--digest = digest.new('sha256'),
digest = digest.hmac('ripemd160', 'L6hc@wmA4xWCg6!NrTAGPd'),
cipher = cipher.new {
cipher = 'aes256',
key = 'Zef=Rb5tuaYhFKYtt5bBDa_!cyEp2zM4',
iv = 'SGs67LE6F!r3v3-7'
},
},
auth_cookie = {
name = '_a'
},
principal = require 'security.principal',
cors = http.cors.new {
allowed_origins = {'*'}, --{'http://web.local:8080'},
allow_credentials = true,
allowed_methods = {'GET', 'HEAD', 'POST'},
allowed_headers = {'content-type', 'x-requested-with'},
exposed_headers = {'cache-control', 'etag'},
max_age = 180
}
}
local function new()
options.auth_cookie.path = options.root_path or '/'
local middlewares = {
http.middleware.cors,
http.middleware.caching,
web.middleware.routing
}
return web.app(middlewares, options)
end
return {options = options, new = new}
|
-- lfs_panels.lua
local M = require "lfs_message"
local Common = require "lfs_common"
local sd = require "far2.simpledialog"
local Sett = require "far2.settings"
local field = Sett.field
local Excl_Key = "sExcludeDirs"
local F = far.Flags
local dirsep = package.config:sub(1,1)
local TmpPanelDefaults = {
ColT = "NR,S",
ColW = "0,8",
StatT = "NR,SC,D,T",
StatW = "0,8,0,5",
Full = false,
Macro = "CtrlF12 $Rep(12) Down $End +"
}
local KEY_INS = F.KEY_INS
local KEY_NUMPAD0 = F.KEY_NUMPAD0
local KEY_SPACE = F.KEY_SPACE
-- search area
local saFromCurrFolder, saOnlyCurrFolder, saSelectedItems, saRootFolder, saPathFolders = 1,2,3,4,5
local saCOUNT = 5
local function ConfigDialog (aHistory)
local aData = field(aHistory, "TmpPanel")
local WIDTH = 78
local DC = math.floor(WIDTH/2-1)
local Items = {
width = WIDTH;
help = "SearchResultsPanel";
{ tp="dbox"; text=M.MConfigTitleTmpPanel; },
{ tp="text"; text=M.MColumnTypes; },
{ tp="edit"; name="ColT"; x2=DC-2; },
{ tp="text"; text=M.MColumnWidths; },
{ tp="edit"; name="ColW"; x2=DC-2; },
{ tp="text"; text=M.MStatusColumnTypes; x1=DC; ystep=-3; },
{ tp="edit"; name="StatT"; x1=DC; },
{ tp="text"; text=M.MStatusColumnWidths; x1=DC; },
{ tp="edit"; name="StatW"; x1=DC; },
{ tp="text"; text=M.MTmpPanelMacro; },
{ tp="edit"; name="Macro"; x2=DC-2; },
{ tp="chbox"; name="Full"; text=M.MFullScreenPanel; },
{ tp="sep"; },
{ tp="butt"; centergroup=1; text=M.MOk; default=1; },
{ tp="butt"; centergroup=1; text=M.MCancel; cancel=1; },
{ tp="butt"; centergroup=1; text=M.MBtnDefaults; btnnoclose=1; name="reset"; },
}
local Pos = sd.Indexes(Items)
Items[Pos.reset].action = function(hDlg,Par1,Par2)
for i,v in ipairs(Items) do
if v.name then
local val = TmpPanelDefaults[v.name]
if val ~= nil then
if v.tp == "edit" then hDlg:SetText(i, val)
elseif v.tp == "chbox" then hDlg:SetCheck(i, val)
end
end
end
end
end
sd.LoadData (aData, Items)
local out = sd.Run(Items)
if out then
sd.SaveData (out, aData)
return true
end
end
local function DirFilterDialog (aData)
local Items = {
guid = "92E8DEC3-ACE2-4E1F-B6A5-AF447EDE21B8";
help = "DirFilter";
width = 76;
--help = "SearchResultsPanel";
{ tp="dbox"; text=M.MDirFilterTitle; },
{ tp="text"; text=M.MExcludeDirsLabel; },
{ tp="edit"; name=Excl_Key; hist="LFS_Excl_Dirs"},
{ tp="sep"; },
{ tp="butt"; text=M.MOk; default=1; centergroup=1; },
{ tp="butt"; text=M.MCancel; cancel=1; centergroup=1; },
}
sd.LoadData(aData, Items)
local out = sd.Run(Items)
if out then
local s = out[Excl_Key]:match("^%s*(.-)%s*$")
out[Excl_Key] = (s ~= "") and s -- false is OK, nil is not as it does not erase the existing value
sd.SaveData(out, aData)
return true
end
end
local function GetCodePages (aData)
local Selected = aData.SelectedCodePages or {}
local delim = ("").char(9474)
local function makeline(codepage, name)
return ("%5d %s %s"):format(codepage, delim, name)
end
local function split_cpname (cpname)
local cp, text = cpname:match("^(%d+)%s+%((.+)%)$")
if cp then return tonumber(cp), text end
end
local items = {
SelectIndex = 1,
{ Text = M.MAllCodePages },
---------------------------------------------------------------------------
{ Text = M.MSystemCodePages, Flags = F.LIF_SEPARATOR },
{ CodePage = win.GetOEMCP() },
{ CodePage = win.GetACP() },
---------------------------------------------------------------------------
{ Text = M.MUnicodeCodePages, Flags = F.LIF_SEPARATOR },
{ CodePage = 1200, Text = makeline(1200, "UTF-16 (Little endian)") },
{ CodePage = 1201, Text = makeline(1201, "UTF-16 (Big endian)") },
{ CodePage = 65000 },
{ CodePage = 65001 },
---------------------------------------------------------------------------
{ Text = M.MOtherCodePages, Flags = F.LIF_SEPARATOR },
}
-- Fill predefined code pages
local used = {}
for _,v in ipairs(items) do
if v.CodePage then
used[v.CodePage] = true
local info = win.GetCPInfo(v.CodePage)
if info then
local num, name = split_cpname(info.CodePageName)
v.Text = num and makeline(num,name) or makeline(v.CodePage,info.CodePageName)
end
if Selected[v.CodePage] then v.Flags = bit.bor(v.Flags or 0, F.LIF_CHECKED) end
if v.CodePage == aData.iCodePage then
v.Flags = bit.bor(v.Flags or 0, F.LIF_SELECTED)
items.SelectIndex = nil
end
end
end
-- Add code pages found in the system
local pages = assert(win.EnumSystemCodePages())
for i,v in ipairs(pages) do pages[i]=tonumber(v) end
table.sort(pages)
for _,v in ipairs(pages) do
if not used[v] then
local info = win.GetCPInfo(v)
if info and info.MaxCharSize == 1 then
local num, name = split_cpname(info.CodePageName)
local item = { CodePage=v }
item.Text = num and makeline(num,name) or makeline(v,info.CodePageName)
items[#items+1] = item
if Selected[v] then
item.Flags = bit.bor(item.Flags or 0, F.LIF_CHECKED)
end
if item.CodePage == aData.iCodePage then
item.Flags = bit.bor(item.Flags or 0, F.LIF_SELECTED)
items.SelectIndex = nil
end
end
end
end
return items
end
local function GetSearchAreas(aData)
local Info = panel.GetPanelInfo(1)
local RootFolderItem = {}
if Info.PanelType == F.PTYPE_FILEPANEL and not Info.Plugin then
RootFolderItem.Text = M.MSaRootFolder .. panel.GetPanelDirectory(1):match("/[^/]*")
else
RootFolderItem.Text = M.MSaRootFolder
RootFolderItem.Flags = F.LIF_GRAYED
end
local T = {
[saFromCurrFolder] = { Text = M.MSaFromCurrFolder },
[saOnlyCurrFolder] = { Text = M.MSaOnlyCurrFolder },
[saSelectedItems] = { Text = M.MSaSelectedItems },
[saRootFolder] = RootFolderItem,
[saPathFolders] = { Text = M.MSaPathFolders },
}
local idx = aData.iSearchArea or 1
if (idx < 1) or (idx > #T) or (T[idx].Flags == F.LIF_GRAYED) then
idx = 1
end
T.SelectIndex = idx
return T
end
local searchGuid = "3CD8A0BB-8583-4769-BBBC-5B6667D13EF9"
local replaceGuid = "F7118D4A-FBC3-482E-A462-0167DF7CC346"
local grepGuid = "74D7F486-487D-40D0-9B25-B2BB06171D86"
local function PanelDialog (aOp, aData, aScriptCall)
local insert = table.insert
local Items = {
width = 76;
help = "OperInPanels";
guid = aOp=="search" and searchGuid or aOp=="replace" and replaceGuid or grepGuid;
}
local Frame = Common.CreateSRFrame(Items, aData, false)
------------------------------------------------------------------------------
insert(Items, { tp="dbox"; text=M.MTitlePanels; })
insert(Items, { tp="text"; text=M.MFileMask; })
insert(Items, { tp="edit"; name="sFileMask"; hist="Masks"; uselasthistory=1; })
------------------------------------------------------------------------------
Frame:InsertInDialog(true, aOp)
------------------------------------------------------------------------------
local X2 = 40 + M.MDlgUseFileFilter:gsub("&",""):len() + 5
insert(Items, { tp="sep"; })
insert(Items, { tp="text"; text=M.MCodePages; })
insert(Items, { tp="combobox"; name="cmbCodePage"; list=GetCodePages(aData); dropdownlist=1; noauto=1; })
insert(Items, { tp="text"; text=M.MSearchArea; })
insert(Items, { tp="combobox"; name="cmbSearchArea"; list=GetSearchAreas(aData); x2=36; dropdownlist=1; noauto=1; })
insert(Items, { tp="chbox"; name="bSearchFolders"; text=M.MSearchFolders; ystep=-1; x1=40; })
insert(Items, { tp="chbox"; name="bSearchSymLinks"; text=M.MSearchSymLinks; x1=40; })
insert(Items, { tp="chbox"; name="bUseFileFilter"; text=M.MDlgUseFileFilter; x1=40; })
insert(Items, { tp="butt"; name="btnFileFilter"; text=M.MDlgBtnFileFilter; x1=X2; y1=""; btnnoclose=1; })
insert(Items, { tp="sep"; })
insert(Items, { tp="butt"; centergroup=1; text=M.MOk; default=1; name="btnOk"; })
insert(Items, { tp="butt"; centergroup=1; text=M.MCancel; cancel=1; })
insert(Items, { tp="butt"; centergroup=1; text=M.MBtnDirFilter; name="btnConfig"; }) --TODO
------------------------------------------------------------------------------
local Pos,Elem = sd.Indexes(Items)
local function SetBtnFilterText(hDlg)
hDlg:SetText(Pos.btnConfig, M.MBtnDirFilter..(aData[Excl_Key] and "*" or ""))
end
function Items.proc (hDlg, msg, param1, param2)
if msg == F.DN_INITDIALOG then
SetBtnFilterText(hDlg)
hDlg:SetComboboxEvent(Pos.cmbCodePage, F.CBET_KEY)
local t = {}
for i,v in ipairs(Elem.cmbCodePage.list) do
if v.CodePage then
t.Index, t.Data = i, v.CodePage
hDlg:ListSetData(Pos.cmbCodePage, t)
end
end
hDlg:SetText (Pos.sFileMask, aData.sFileMask or "")
hDlg:SetCheck (Pos.bSearchFolders, aData.bSearchFolders)
hDlg:SetCheck (Pos.bSearchSymLinks, aData.bSearchSymLinks)
hDlg:SetCheck (Pos.bUseFileFilter, aData.bUseFileFilter)
hDlg:Enable (Pos.btnFileFilter, aData.bUseFileFilter)
elseif msg == F.DN_BTNCLICK then
if param1 == Pos.bUseFileFilter then
hDlg:Enable(Pos.btnFileFilter, hDlg:GetCheck(Pos.bUseFileFilter))
elseif param1 == Pos.btnFileFilter then
local filter = far.CreateFileFilter(1, "FFT_FINDFILE")
if filter and filter:OpenFiltersMenu() then aData.FileFilter = filter end
end
elseif msg == F.DN_KEY then
if param1 == Pos.cmbCodePage then
if param2==KEY_INS or param2==KEY_NUMPAD0 or param2==KEY_SPACE then
local pos = hDlg:ListGetCurPos(param1)
if pos.SelectPos ~= 1 then -- if not "All code pages"
local item = hDlg:ListGetItem(param1, pos.SelectPos)
item.Flags = bit.bxor(item.Flags, F.LIF_CHECKED)
item.Index = pos.SelectPos
hDlg:ListUpdate(param1, item)
end
end
end
elseif msg == F.DN_CLOSE then
if Pos.btnConfig and param1 == Pos.btnConfig then
hDlg:ShowDialog(0)
--ConfigDialog(aHistory) --TODO
if DirFilterDialog(aData) then
SetBtnFilterText(hDlg)
end
hDlg:ShowDialog(1)
hDlg:SetFocus(Pos.btnOk)
return 0
elseif param1 == Pos.btnOk then
if not hDlg:GetText(Pos.sFileMask):find("%S") then
far.Message(M.MInvalidFileMask, M.MError, ";Ok", "w")
return 0
end
------------------------------------------------------------------------
local pos = hDlg:ListGetCurPos(Pos.cmbCodePage)
aData.iCodePage = Elem.cmbCodePage.list[pos.SelectPos].CodePage
------------------------------------------------------------------------
pos = hDlg:ListGetCurPos(Pos.cmbSearchArea)
aData.iSearchArea = pos.SelectPos
------------------------------------------------------------------------
aData.sFileMask = hDlg:GetText(Pos.sFileMask)
aData.bSearchFolders = hDlg:GetCheck(Pos.bSearchFolders)
aData.bSearchSymLinks = hDlg:GetCheck(Pos.bSearchSymLinks)
aData.bUseFileFilter = hDlg:GetCheck(Pos.bUseFileFilter)
end
--------------------------------------------------------------------------
-- store selected code pages no matter what user pressed: OK or Esc.
aData.SelectedCodePages = {}
local info = hDlg:ListInfo(Pos.cmbCodePage)
for i=1,info.ItemsNumber do
local item = hDlg:ListGetItem(Pos.cmbCodePage, i)
if 0 ~= bit.band(item.Flags, F.LIF_CHECKED) then
local t = hDlg:ListGetData(Pos.cmbCodePage, i)
if t then aData.SelectedCodePages[t] = true end
end
end
--------------------------------------------------------------------------
end
return Frame:DlgProc(hDlg, msg, param1, param2)
end
local dataTP = field(_Plugin.History, "TmpPanel")
for k,v in pairs(TmpPanelDefaults) do
if dataTP[k] == nil then dataTP[k] = v end
end
sd.LoadData(aData, Items)
Frame:OnDataLoaded(aData, false)
return sd.Run(Items) and Frame.close_params
end
local function MakeItemList (panelInfo, area)
local realNames = (bit.band(panelInfo.Flags, F.PFLAGS_REALNAMES) ~= 0)
local panelDir = panel.GetPanelDirectory(1) or ""
local itemList, flags = {}, F.FRS_RECUR
if area == saFromCurrFolder or area == saOnlyCurrFolder then
if realNames then
if panelInfo.Plugin then
for i=1, panelInfo.ItemsNumber do
local item = panel.GetPanelItem(1, i)
local name = item.FileName
if name ~= ".." and name ~= "." then itemList[#itemList+1] = name end
end
else
itemList[1] = panelDir
end
if area == saOnlyCurrFolder then
flags = 0
end
end
elseif area == saSelectedItems then
if realNames then
local curdir_slash = panelInfo.Plugin and "" or panelDir:gsub(dirsep.."?$", dirsep, 1)
for i=1, panelInfo.SelectedItemsNumber do
local item = panel.GetSelectedPanelItem(1, i)
itemList[#itemList+1] = curdir_slash .. item.FileName
end
end
elseif area == saRootFolder then
itemList[1] = panelDir:match("/[^/]*")
elseif area == saPathFolders then
flags = 0
local path = win.GetEnv("PATH")
if path then path:gsub("[^:]+", function(c) itemList[#itemList+1]=c end) end
end
return itemList, flags
end
local function PressEnter()
local ver = far.LuafarVersion(true)
if ver <= 2 then
far.AdvControl(F.ACTL_POSTKEYSEQUENCE, {13}) -- KEY_ENTER
else
far.MacroPost("Keys('Enter')")
end
end
local function SearchFromPanel (aData, aWithDialog, aScriptCall)
local tParams
if aWithDialog then
tParams = PanelDialog("search", aData, aScriptCall)
else
tParams = Common.ProcessDialogData(aData, false, false, true)
end
if not tParams then return end
----------------------------------------------------------------------------
-- take care of the future "repeat" operations in the Editor
aData.sLastOp = "search"
aData.bSearchBack = false
----------------------------------------------------------------------------
local WID = 60
local W1 = 3
local W2 = WID - W1 - 3
local TITLE = M.MTitleSearching
local Regex = tParams.Regex
local Find = Regex.find
local BLOCKLEN, OVERLAP = 32*1024, -1024
----------------------------------------------------------------------------
local codePages
local storedPages = aData.SelectedCodePages
if aData.iCodePage then
codePages = { aData.iCodePage }
elseif storedPages and next(storedPages) then
codePages = {}
for k in pairs(storedPages) do table.insert(codePages, k) end
else
codePages = { win.GetOEMCP(), win.GetACP(), 1200, 1201, 65000, 65001 }
end
----------------------------------------------------------------------------
local panelInfo = panel.GetPanelInfo(1)
local area = aData.iSearchArea or 1
if area < 1 or area > saCOUNT then area = 1 end
local bRecurse, bSymLinks
local itemList, flags = MakeItemList(panelInfo, area)
if aData.bSearchSymLinks then
bSymLinks = true
end
if bit.band(flags, F.FRS_RECUR) ~= 0 then
bRecurse = true
end
-----------------------------------------------------------------------------
local userbreak
local function ConfirmEsc()
if 1 == far.Message(M.MConfirmCancel, M.MInterrupted, ";YesNo", "w") then
userbreak = true; return true
end
end
local function ConfirmEsc2()
local r = far.Message(M.MConfirmCancel, M.MInterrupted, M.MButtonsCancelOnFile, "w")
if r==1 then userbreak = true end
return r==1 or r==2
end
local tOut, cnt, nShow = {}, 0, 0
far.Message((" "):rep(WID).."\n"..M.MFilesFound.."0", TITLE, "")
local function ShowProgress(fullname)
local len = fullname:len()
local s = len<=WID and fullname..(" "):rep(WID-len) or
fullname:sub(1,W1).. "..." .. fullname:sub(-W2)
far.Message(s.."\n"..M.MFilesFound..cnt, TITLE, "")
end
local function ProcessFile(fdata, fullname, file_filter, mask_incl, mask_excl, mask_dirs)
---------------------------------------------------------------------------
if win.ExtractKey()=="ESCAPE" and ConfirmEsc() then return true end
---------------------------------------------------------------------------
if file_filter and not file_filter:IsFileInFilter(fdata) then return end
---------------------------------------------------------------------------
nShow = nShow + 1
if nShow % 32 == 0 then ShowProgress(fullname) end
---------------------------------------------------------------------------
local mask_ok = far.ProcessName(F.PN_CMPNAMELIST, mask_incl, fdata.FileName, F.PN_SKIPPATH) and
not (mask_excl and far.ProcessName(F.PN_CMPNAMELIST, mask_excl, fdata.FileName, F.PN_SKIPPATH))
---------------------------------------------------------------------------
if fdata.FileAttributes:find("d") then
if mask_ok and aData.bSearchFolders and aData.sSearchPat == "" then
cnt = cnt+1
tOut[cnt] = fullname
end
---------------------------------------------------------------------------
if mask_dirs and far.ProcessName(F.PN_CMPNAMELIST, mask_dirs, fullname, F.PN_SKIPPATH) then
return
end
---------------------------------------------------------------------------
if bRecurse then
if bSymLinks or not fdata.FileAttributes:find("e") then
return far.RecursiveSearch(fullname, "*", ProcessFile, 0, file_filter, mask_incl, mask_excl, mask_dirs)
end
end
return
end
---------------------------------------------------------------------------
if not mask_ok then return end
---------------------------------------------------------------------------
if aData.sSearchPat == "" then
cnt = cnt+1
tOut[cnt] = fullname
return
end
---------------------------------------------------------------------------
local fp = io.open(fullname, "rb")
if not fp then return end
---------------------------------------------------------------------------
local found, stop
local tPlus, uMinus, uUsual
if tParams.tMultiPatterns then
local t = tParams.tMultiPatterns
uMinus, uUsual = t.Minus, t.Usual -- copy; do not modify the original table fields!
tPlus = {}; for k,v in pairs(t.Plus) do tPlus[k]=v end -- copy; do not use the original table directly!
end
ShowProgress(fullname)
local str = ""
repeat
if win.ExtractKey() == "ESCAPE" and ConfirmEsc2() then
fp:close(); return userbreak
end
if #str == BLOCKLEN then fp:seek("cur", OVERLAP) end
str = fp:read(BLOCKLEN)
if not str then break end
for _, cp in ipairs(codePages) do
local s
if cp == 1200 or cp == 65001 then s = str
elseif cp == 1201 then s = string.gsub(str, "(.)(.)", "%2%1")
else s = win.MultiByteToWideChar(str, cp)--, cp==65000 and "" or "e")
end
if s and cp ~= 65001 then s = win.Utf16ToUtf8(s) end
if s then
---- local ok, start = pcall(Find, Regex, s)
---- if ok and start then found = true break end
if tPlus == nil then
local ok, start = pcall(Find, Regex, s)
if ok and start then found = true; break; end
else
if uMinus and Find(uMinus, s) then
stop=true; break
end
for pattern in pairs(tPlus) do
if Find(pattern, s) then tPlus[pattern]=nil end
end
if uUsual and Find(uUsual, s) then
uUsual = nil
end
if not (next(tPlus) or uMinus or uUsual) then
found=true; break
end
end
end
end
until found or stop
if tPlus then
found = found or not (stop or next(tPlus) or uUsual)
end
if not found ~= not tParams.bInverseSearch then
cnt = cnt+1
tOut[cnt] = fullname
end
fp:close()
end
local FileFilter = tParams.FileFilter
if FileFilter then FileFilter:StartingToFilter() end
for _, item in ipairs(itemList) do
local fdata = win.GetFileInfo(item)
-- note: fdata can be nil for root directories
local isFile = fdata and not fdata.FileAttributes:find("d")
---------------------------------------------------------------------------
if isFile or ((area==saFromCurrFolder or area==saOnlyCurrFolder) and panelInfo.Plugin) then
ProcessFile(fdata, item, FileFilter, "*")
end
if not isFile and not (area == saOnlyCurrFolder and panelInfo.Plugin) then
local mask_incl, mask_excl = aData.sFileMask:match("(.-)|(.*)")
if mask_incl then
if mask_incl=="" then mask_incl = "*" end
if mask_excl=="" then mask_excl = nil end
else
mask_incl = aData.sFileMask
end
far.RecursiveSearch(item, "*", ProcessFile, 0, FileFilter, mask_incl, mask_excl, aData[Excl_Key])
end
---------------------------------------------------------------------------
if userbreak then break end
end
if cnt > 0 then
local fname = "/tmp/lfsearch.found.files"
local fpOut = assert(io.open(fname, "wb"))
for _, fullname in ipairs(tOut) do
fpOut:write(fullname, "\n")
end
fpOut:close()
-- run temporary panel from the command line
---- local tp_settings = GetTmpPanelSettings()
local prefix = --[[tp_settings.Prefix or]] "tmp"
local cmd = ("%s: -menu %s"):format(prefix, fname)
panel.SetCmdLine (cmd)
PressEnter()
far.Timer(1000,
function(h)
h:Close()
win.DeleteFile(fname)
end)
else
actl.RedrawAll()
if userbreak or 1==far.Message(M.MNoFilesFound,M.MMenuTitle,M.MButtonsNewSearch) then
return SearchFromPanel(aData, true)
end
end
return true
end
return {
SearchFromPanel = SearchFromPanel;
}
|
local Vec = _Require_relative( ... , 'lib.DeWallua.vector-light', 1)
local Cache = _Require_relative(..., 'classes.Cache',1)
local MTV = _Require_relative(..., 'classes.MTV',1)
local min = math.min
local inf = math.huge
-- Get sign of number
local function sign(number)
return number > 0 and 1 or (number == 0 and 0 or -1)
end
-- Cache:
local acache = Cache()
local function test_axis(shape1, shape2, dx,dy, mtv)
local shape1_min_dot, shape1_max_dot = shape1:project(dx,dy)
local shape2_min_dot, shape2_max_dot = shape2:project(dx,dy)
-- We've now reduced it to ranges intersecting on a number line,
-- Test for bounding overlap
if not ( shape1_max_dot > shape2_min_dot and shape2_max_dot > shape1_min_dot ) then
-- Separating Axis, return
mtv:new(dx, dy, shape1, shape2, true)
-- Add to cache
acache:set({shape1, shape2}, mtv)
else
-- Find the overlap (minimum difference of bounds), which is equal to the magnitude of the MTV
local overlap = min(shape1_max_dot-shape2_min_dot, shape2_max_dot-shape1_min_dot)
if overlap*overlap < mtv:mag2() then
-- Set our MTV to the smol vector
mtv.x, mtv.y = Vec.mul(overlap, dx, dy)
end
end
return mtv
end
-- SAT
local function project(shape1, shape2)
local mtv = MTV(inf,inf)
-- Test cache
local v = acache:get({shape1, shape2})
if v then
mtv = test_axis(shape1, shape2, v.x,v.y, mtv)
if mtv.separating then
return mtv
end
end
-- Cached axis failed :(
local dx, dy
mtv:new(inf,inf)
-- loop through shape1 geometry
for i, vec in shape1:vecs(shape2) do
-- get the normal
dx, dy = Vec.normalize( vec.x, vec.y )
dx, dy = dy, -dx
mtv = test_axis(shape1,shape2,dx,dy,mtv)
if mtv.separating then
return mtv
end
end
-- Welp. We made it here. So they're colliding, I guess. Hope it's consensual :(
-- Flip it?
local ccx, ccy = shape2.centroid.x - shape1.centroid.x, shape2.centroid.y - shape1.centroid.y
local s = sign( Vec.dot(mtv.x, mtv.y, ccx, ccy) )
mtv:scale(s):setColliderShape(shape1):setCollidedShape(shape2):setSeparating(false)
return mtv
end
local function SAT(shape1, shape2)
local mtv1, mtv2
mtv1 = project(shape1, shape2)
if mtv1.separating then -- don't bother calculating mtv2
return mtv1
end
mtv2 = project(shape2, shape1)
if mtv2.separating then
return mtv2
end
-- Else, return the min
local mintv = mtv1:mag2() < mtv2:mag2() and mtv1 or mtv2
return mintv
end
return SAT
|
--- @type StdUi
local StdUi = LibStub and LibStub('StdUi', true);
if not StdUi then
return
end
local module, version = 'ProgressBar', 3;
if not StdUi:UpgradeNeeded(module, version) then return end;
----------------------------------------------------
--- ProgressBar
----------------------------------------------------
local ProgressBarMethods = {
GetPercentageValue = function(self)
local _, max = self:GetMinMaxValues();
local value = self:GetValue();
return (value/max) * 100;
end,
TextUpdate = function(self) -- min, max, value
return Round(self:GetPercentageValue()) .. '%';
end
};
local ProgressBarEvents = {
OnValueChanged = function(self, value)
local min, max = self:GetMinMaxValues();
self.text:SetText(self:TextUpdate(min, max, value));
end,
OnMinMaxChanged = function(self)
local min, max = self:GetMinMaxValues();
local value = self:GetValue();
self.text:SetText(self:TextUpdate(min, max, value));
end
}
--- @return StatusBar
function StdUi:ProgressBar(parent, width, height, vertical)
vertical = vertical or false;
local progressBar = CreateFrame('StatusBar', nil, parent);
progressBar:SetStatusBarTexture(self.config.backdrop.texture);
progressBar:SetStatusBarColor(
self.config.progressBar.color.r,
self.config.progressBar.color.g,
self.config.progressBar.color.b,
self.config.progressBar.color.a
);
self:SetObjSize(progressBar, width, height);
progressBar.texture = progressBar:GetRegions();
progressBar.texture:SetDrawLayer('BORDER', -1);
if (vertical) then
progressBar:SetOrientation('VERTICAL');
end
progressBar.text = self:Label(progressBar, '');
progressBar.text:SetJustifyH('MIDDLE');
progressBar.text:SetAllPoints();
self:ApplyBackdrop(progressBar);
for k, v in pairs(ProgressBarMethods) do
progressBar[k] = v;
end
for k, v in pairs(ProgressBarEvents) do
progressBar:SetScript(k, v);
end
return progressBar;
end
StdUi:RegisterModule(module, version);
|
--フュージョン・ゲート Maschange friend
function c33550698.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--Mask change
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(33550694,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_FZONE)
e2:SetCountLimit(1)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetTarget(c33550698.target01)
e2:SetOperation(c33550698.activate01)
c:RegisterEffect(e2)
--tokken invocation
local e02=Effect.CreateEffect(c)
e02:SetDescription(aux.Stringid(100417010,0))
e02:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_COIN)
e02:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e02:SetCode(EVENT_ATTACK_ANNOUNCE)
e02:SetCountLimit(1,33550698)
e02:SetRange(LOCATION_SZONE)
e02:SetCost(c33550698.cost2)
e02:SetCondition(c33550698.atkcon)
e02:SetTarget(c33550698.sumtg2)
e02:SetOperation(c33550698.sumop2)
c:RegisterEffect(e02)
local e09=Effect.CreateEffect(c)
e09:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e09:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e09:SetCode(EVENT_ATTACK_ANNOUNCE)
e09:SetRange(LOCATION_GRAVE)
e09:SetCountLimit(1,33550698)
e09:SetProperty(EFFECT_FLAG_CARD_TARGET)
--e2:SetCode(EVENT_FREE_CHAIN)
--e02:SetCondition(aux.exccon)
e09:SetCondition(c33550698.atkcon)
e09:SetCost(c33550698.cost2)
e09:SetTarget(c33550698.sumtg2)
e09:SetOperation(c33550698.sumop2)
c:RegisterEffect(e09)
end
function c33550698.Cardfilter(c)
local code=c:GetCode()
return code==63035435
end
function c33550698.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() and Duel.CheckLPCost(tp,1000) end
Duel.PayLPCost(tp,1000)
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
end
function c33550698.atkcon(e,tp,eg,ep,ev,re,r,rp)
return tp~=Duel.GetTurnPlayer() and Duel.GetFieldGroupCount(e:GetHandlerPlayer(),0,LOCATION_MZONE)>2
and not Duel.IsExistingMatchingCard(Card.IsType,tp,LOCATION_MZONE,0,1,nil,TYPE_MONSTER) and not Duel.IsExistingMatchingCard(c33550698.Cardfilter,tp,LOCATION_SZONE+LOCATION_GRAVE+LOCATION_FZONE+LOCATION_REMOVED,0,1,nil)
end
function c33550698.sumtg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function c33550698.sumop2(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local c=e:GetHandler()
local token=Duel.CreateToken(tp,53527838)
Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP)
end
-- Codigo functional
function c33550698.filter0(c)
return c:IsCanBeFusionMaterial() and c:IsSetCard(0x8)
end
function c33550698.filter1(c,e)
return c:IsCanBeFusionMaterial() and c:IsSetCard(0x8) and not c:IsImmuneToEffect(e)
end
function c33550698.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and c.maskchange_calling and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION+0x10,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function c33550698.target01(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and PLAYER_NONE or tp
local mg1=Duel.GetMatchingGroup(c33550698.filter0,tp,LOCATION_MZONE,0,nil)
local res=Duel.IsExistingMatchingCard(c33550698.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(c33550698.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,chkf)
end
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c33550698.activate01(e,tp,eg,ep,ev,re,r,rp)
local chkf=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and PLAYER_NONE or tp
local mg1=Duel.GetMatchingGroup(c33550698.filter1,tp,LOCATION_MZONE,0,nil,e)
local sg1=Duel.GetMatchingGroup(c33550698.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
local mg2=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(c33550698.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
tc:SetMaterial(mat1)
Duel.Remove(mat1,POS_FACEUP,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION+0x10,tp,tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2,SUMMON_TYPE_FUSION+0x10)
end
tc:CompleteProcedure()
end
end
----------
|
-----------------------------------
-- Area: Vunkerl Inlet (S) (F-5)
-- NPC: Leafy Patch
-- Involved in Quests
-- !pos -418 -33 576
-----------------------------------
local ID = require("scripts/zones/Vunkerl_Inlet_[S]/IDs");
require("scripts/globals/quests");
-----------------------------------
function onTrade(player,npc,trade)
end;
function onTrigger(player,npc)
if (player:getQuestStatus(CRYSTAL_WAR, tpz.quest.id.crystalWar.BOY_AND_THE_BEAST) == QUEST_ACCEPTED and player:getCharVar("BoyAndTheBeast") == 2) then
if (VanadielHour() < 8) then
player:startEvent(107);
elseif (VanadielHour() < 16) then
player:startEvent(107,1);
else
player:startEvent(107,2);
end
end
end;
function onEventUpdate(player,csid,option)
end
function onEventFinish(player,csid,option)
if (csid == 107) then
if (option == 1) then
player:addKeyItem(tpz.ki.VUNKERL_HERB);
player:messageSpecial(ID.text.KEYITEM_OBTAINED, tpz.ki.VUNKERL_HERB);
player:setCharVar("BoyAndTheBeast",3);
else
player:addKeyItem(tpz.ki.VUNKERL_HERB);
player:messageSpecial(ID.text.KEYITEM_OBTAINED, tpz.ki.VUNKERL_HERB);
player:setCharVar("BoyAndTheBeast",4);
end
end
end;
|
local Camera = require "lib.Camera"
local Viewport = class("Viewport")
function Viewport:initialize(level, x, y, w, h, target)
self.level = level
self.camera = Camera.new(0, 0, w, h, x, y)
self.target = target
if self.target then
self.camera:lookAt(self.target.x, self.target.y)
end
end
function Viewport:draw()
end
function Viewport:update(dt)
if self.target then
-- Horizontal
local pX = self.target.x + self.target.width/2
local pXr = pX - self.camera.x
if pXr > RIGHTSCROLLBORDER then
self.camera.x = self.camera.x + VAR("cameraScrollRate")*dt
if pX - self.camera.x < RIGHTSCROLLBORDER then
self.camera.x = pX - RIGHTSCROLLBORDER
end
elseif pXr < LEFTSCROLLBORDER then
self.camera.x = self.camera.x - VAR("cameraScrollRate")*dt
if pX - self.camera.x > LEFTSCROLLBORDER then
self.camera.x = pX - LEFTSCROLLBORDER
end
end
-- Vertical
local pY = self.target.y + self.target.height/2
local pYr = pY - self.camera.y
if pYr > DOWNSCROLLBORDER then
self.camera.y = self.camera.y + VAR("cameraScrollRate")*dt
if pY - self.camera.y < DOWNSCROLLBORDER then
self.camera.y = pY - DOWNSCROLLBORDER
end
end
-- Only scroll up in flight mode
if self.target.flying or self.camera.y < self.level:getYEnd()*16-CAMERAHEIGHT then -- ?
if pYr < UPSCROLLBORDER then
self.camera.y = self.camera.y - VAR("cameraScrollRate")*dt
if pY - self.camera.y > UPSCROLLBORDER then
self.camera.y = pY - UPSCROLLBORDER
end
end
end
-- -- And clamp it to level boundaries
self.camera.x = math.min(self.camera.x, self.level:getXEnd()*16-self.camera.w/2)
self.camera.x = math.max(self.camera.x, (self.level:getXStart()-1)*16+self.camera.w/2)
self.camera.y = math.min(self.camera.y, self.level:getYEnd()*16-self.camera.h/2)
self.camera.y = math.max(self.camera.y, (self.level:getYStart()-1)*16+self.camera.h/2)
end
end
return Viewport
|
-- Drawing with Cairo on an SDL window.
sdl = require 'sdl2'
cairo = require 'oocairo'
require 'util'
sdl.init(sdl.INIT_VIDEO)
local window = sdl.createWindow('Test Window', sdl.WINDOWPOS_CENTERED, sdl.WINDOWPOS_CENTERED, 200, 200, sdl.WINDOW_RESIZABLE)
local SDLsurface = sdl.getWindowSurface(window)
local surface = cairo.image_surface_create_for_data(SDLsurface.pixels, "rgb24", SDLsurface.w, SDLsurface.h, SDLsurface.pitch)
local cr = cairo.context_create(surface)
function paint(i)
sdl.lockSurface(SDLsurface)
cr:set_source_rgb(1, 1, 1)
cr:paint()
cr:move_to(0, 0)
cr:line_to(150+i, 100)
cr:line_to(100, 185)
cr:line_to(200, 200)
cr:line_to(30, 100+i)
cr:close_path()
cr:set_source_rgb(0.8, 0.4, 1)
cr:fill()
cr:move_to(180, 30+i)
cr:line_to(100, 20+i)
cr:line_to(80, 120+i)
cr:set_source_rgb(0.5, 0.7, 0.3)
cr:fill_preserve()
cr:set_source_rgb(0, 0, 0)
cr:set_line_width(3)
cr:stroke()
sdl.unlockSurface(SDLsurface)
sdl.updateWindowSurface(window)
end
for j = 1,1 do
for i = 0,50 do
paint(i)
util.sleep(0.05)
end
for i = 50,0,-1 do
paint(i)
util.sleep(0.05)
end
end
sdl.quit()
|
-- Areas mod by ShadowNinja
-- Based on node_ownership
-- License: LGPLv2+
areas = {}
areas.adminPrivs = {areas=true}
areas.startTime = os.clock()
areas.modpath = minetest.get_modpath("areas")
dofile(areas.modpath.."/settings.lua")
dofile(areas.modpath.."/api.lua")
dofile(areas.modpath.."/internal.lua")
dofile(areas.modpath.."/chatcommands.lua")
dofile(areas.modpath.."/pos.lua")
dofile(areas.modpath.."/interact.lua")
dofile(areas.modpath.."/legacy.lua")
dofile(areas.modpath.."/hud.lua")
areas:load()
minetest.register_privilege("areas", {
description = "Can administer areas."
})
minetest.register_privilege("areas_high_limit", {
description = "Can can more, bigger areas."
})
if not minetest.registered_privileges[areas.config.self_protection_privilege] then
minetest.register_privilege(areas.config.self_protection_privilege, {
description = "Can protect areas.",
})
end
if minetest.settings:get_bool("log_mod") then
local diffTime = os.clock() - areas.startTime
minetest.log("action", "areas loaded in "..diffTime.."s.")
end
|
local BELU , parent = torch.class('BELU','nn.ELU')
function BELU:__init()
parent.__init(self)
end
function BELU:updateOutput(input)
local s = input:size(2) / 2
input[{{}, {1,s}}]:mul(-1)
parent.updateOutput(self, input)
input[{{}, {1,s}}]:mul(-1)
s = self.output:size(2) / 2
self.output2 = self.output2 or self.output.new()
self.output2:resizeAs(self.output):copy(self.output)
self.output2[{{}, {1,s}}]:mul(-1)
return self.output2
end
function BELU:updateGradInput(input, gradOutput)
local s = input:size(2) / 2
input[{{}, {1,s}}]:mul(-1)
parent.updateGradInput(self, input, gradOutput)
input[{{}, {1,s}}]:mul(-1)
return self.gradInput
end
function BELU:__tostring__()
return torch.type(self) .. string.format('()')
end
|
function fib(m)
if m < 2 then
return m
end
return fib(m-1) + fib(m-2)
end
return fib(15);
|
-- Storage Remote
-- Config
local storage_channel = 234
local listening_channel = 123
local modem_side = "back"
-- End of Config
-- Import common function api
local common_functions = require(".storage.common_functions")
local items = {}
local item_menu_entries = {}
local cobalt = dofile("cobalt")
cobalt.ui = dofile("cobalt-ui/init.lua")
local Panel = cobalt.ui.new({w = "100%", h = "100%", backColour = colors.green})
local Input = Panel:add("input", {
w = "70%",
y = 1,
backPassiveColour = colors.green,
backActiveColour = colors.lime,
placeholder = "Search item",
wrap = "left"
})
local RefreshButton = Panel:add("button", {
w = "25%",
y = 1,
h = 1,
text = "Refresh",
wrap = "right",
marginleft = "75%",
foreColour = colors.black,
backColour = colors.purple
})
local InfoText = Panel:add("text", {text = "Info-Text", wrap = "center", margintop = "50%", backColour = colors.red})
function set_InfoText(visible, text)
if visible then
InfoText.text = text
InfoText.y = 0
else
InfoText.y = -1000
end
end
-- Cobalt events
function cobalt.draw() cobalt.ui.draw() end
function cobalt.update(dt)
cobalt.ui.update(dt)
update_panels()
end
function cobalt.mousepressed(x, y, button) cobalt.ui.mousepressed(x, y, button) end
function cobalt.mousereleased(x, y, button) cobalt.ui.mousereleased(x, y, button) end
function cobalt.keypressed(keycode, key) cobalt.ui.keypressed(keycode, key) end
function cobalt.keyreleased(keycode, key) cobalt.ui.keyreleased(keycode, key) end
-- cobalt.textinput is not called when text is removed
function cobalt.textinput(t) cobalt.ui.textinput(t) end
local modem = peripheral.wrap(modem_side)
modem.open(listening_channel)
-- Returns item names in order of them matching search term
function search_items(search_term)
local matching_item_names = {}
if (search_term == nil or search_term == "") then
for item_name, _ in pairs(items) do table.insert(matching_item_names, item_name) end
else
for item_name, _ in pairs(items) do
if string.find(item_name, search_term) ~= nil then table.insert(matching_item_names, item_name) end
end
end
return matching_item_names
end
local ItemMenuEntry = {}
function ItemMenuEntry:new(item_name, item_count)
item_count = math.min(item_count, 999)
local NewPanel = Panel:add("panel", {w = "100%", h = 1})
local TextCount = NewPanel:add("text", {text = string.format("%03d", item_count)})
local TextName = NewPanel:add("text", {text = common_functions.pretty_item_name(item_name), marginleft = 4})
local new_entry = {panel = NewPanel, text_name = TextName, text_count = TextCount}
setmetatable(new_entry, self)
self.__index = self
return new_entry
end
function ItemMenuEntry:show(y) self.panel.y = y end
function ItemMenuEntry:hide() self.panel.y = -1000 end
function ItemMenuEntry:set_color_index(index)
local scheme = index % 2
-- You can add to or modify the entry color scheme here!
if scheme == 0 then
self.panel.backColour = colors.lightBlue
self.text_name.backColour = colors.lightBlue
self.text_count.backColour = colors.cyan
elseif scheme == 1 then
self.panel.backColour = colors.yellow
self.text_name.backColour = colors.yellow
self.text_count.backColour = colors.orange
else
printError("Unknown color scheme")
end
end
function ItemMenuEntry:update_count(item_count)
item_count = math.min(item_count, 999)
self.text_count.text = string.format("%03d", item_count)
end
function update_items()
modem.transmit(storage_channel, listening_channel, "ITEMS")
_, _, _, _, items = os.pullEvent("modem_message")
-- Update count for existing entries
for item_name, count in pairs(items) do
local entry = item_menu_entries[item_name]
if entry then entry:update_count(count) end
end
end
function update_panels()
if common_functions.is_table_empty(items) then
set_InfoText(true, "No items found.")
return
end
local matching_item_names = search_items(Input.text:lower())
-- Hide all panels
for _, entry in pairs(item_menu_entries) do entry:hide() end
local no_match = common_functions.is_table_empty(matching_item_names)
set_InfoText(no_match, "No items matching search.")
if no_match then return end
for index, item_name in pairs(matching_item_names) do
local entry = item_menu_entries[item_name] or ItemMenuEntry:new(item_name, items[item_name])
entry:show(index + 1)
entry:set_color_index(index)
item_menu_entries[item_name] = entry
end
end
RefreshButton.onclick = function()
update_items()
update_panels()
end
print("Fetching initial items, if you see this the storage controller hasn't responded yet, it's probably offline.")
print("Start the volume controller and terminate this program by holding Ctrl+T, then start me again")
update_items()
update_panels()
cobalt.initLoop()
|
local warning = require "warning"
local function forwardRef(render)
if __DEV__ then
warning(type(render) == "function", "forwardRef requires a render function but was given " .. type(render))
end
return {
["$$typeof"] = "REACT_FORWARD_REF_TYPE",
render = render
}
end
return forwardRef
|
local setmetatable = setmetatable
local wibox = require("wibox")
local timer = require("obvious.lib.hooks").timer
local mem_usage = require("obvious.mem").mem_usage
local gradient_graph = require("obscure.widget.gradient_graph")
local function create(label, field)
local label = label or "MEM"
local field = field or "perc"
local data = {}
data.max = 100
data.get = function()
local result = mem_usage()
return result[field]
end
local widget = wibox.widget {
layout = wibox.layout.fixed.horizontal,
{
text = label,
widget = wibox.widget.textbox
},
gradient_graph(data)
}
return widget
end
return setmetatable({}, { __call = function(_, ...) return create(...) end })
|
--------------------------------------------------------------------------------
--- Schema node dumper
-- @module lua-nucleo.dsl.dump_nodes
-- This file is a part of lua-nucleo library
-- @copyright lua-nucleo authors (see file `COPYRIGHT` for the license)
--------------------------------------------------------------------------------
local arguments,
optional_arguments,
method_arguments,
eat_true
= import 'lua-nucleo/args.lua'
{
'arguments',
'optional_arguments',
'method_arguments',
'eat_true'
}
local walk_tagged_tree
= import 'lua-nucleo/dsl/tagged-tree.lua'
{
'walk_tagged_tree'
}
--------------------------------------------------------------------------------
-- TODO: Output should be more Lua-like!
-- #20
local dump_nodes = function(
schema,
out_filename,
tag_field,
name_field,
with_indent,
with_names
)
arguments(
"table", schema,
"string", out_filename,
-- "string", tag_field,
-- "string", name_field,
"boolean", with_indent,
"boolean", with_names
)
local out = (out_filename == "-")
and io.stdout
or assert(io.open(out_filename, "w"))
local indent_cache = setmetatable(
{ },
{
__index = function(t, k)
local v = (" "):rep(with_indent and k or 0)
t[k] = v
return v
end
}
)
local walkers =
{
down = setmetatable(
{ },
{
__index = function(t, k)
local v = function(walkers, data)
out:write(indent_cache[walkers.indent_], data[tag_field])
if with_names then
out:write(" ", tostring(data[name_field]))
end
out:write("\n")
walkers.indent_ = walkers.indent_ + 1
end
t[k] = v
return v
end
}
);
up = setmetatable(
{ },
{
__index = function(t, k)
local v = function(walkers, data)
walkers.indent_ = walkers.indent_ - 1
end
t[k] = v
return v
end
}
);
--
indent_ = 0;
}
for i = 1, #schema do
walk_tagged_tree(schema[i], walkers, tag_field)
end
if out ~= io.stdout then
out:close()
end
out = nil
end
--------------------------------------------------------------------------------
return
{
dump_nodes = dump_nodes;
}
|
--[[
This code subscribes to the twist motion of the head from vicon_listener that I wrote.
It also subscribes to the geometry/TransformStamped message from vicon bridge
The twist motion is what we pass to the neyral network to develo a real-time function approximator
Author: Olalekan Ogunmolu.
Date: October 2016
Lab Affiliation: Gans' Lab UT Dallas
]]
local opt = {
publishTransfrom = false,
publishTwist = false
}
local ros = require 'ros'
ros.init('ensenso_sub')
spinner = ros.AsyncSpinner()
spinner:start()
nodehandle = ros.NodeHandle()
poseSpec = ros.MsgSpec('ensenso/HeadPose')
controlSpec = ros.MsgSpec('geometry_msgs/Twist')
local pose_subscriber = nodehandle:subscribe("/mannequine_head/pose", poseSpec, 10, { 'udp', 'tcp' }, { tcp_nodelay = true })
local u_sub = nodehandle:subscribe("/mannequine_head/u_valves",controlSpec, 10, { 'udp', 'tcp' }, { tcp_nodelay = true })
-- subscribe to vicon_receiver topic with 10 messages back-log
-- transport_options (arguments 4 & 5) are optional - used here only for demonstration purposes
poseMsg, uMsg, inputs = {}, {}, {}
-- register a callback function that will be triggered from ros.spinOnce() when a message is available.
pose_subscriber:registerCallback(function(msg, header)
-- print('\nheadPose: \n', msg)
poseMsg.z = msg.z; poseMsg.pitch = msg.pitch; poseMsg.yaw = msg.yaw;
end)
u_sub:registerCallback(function(msg, header)
uMsg.u1 = msg.linear.x; uMsg.u2 = msg.linear.y; uMsg.u3 = msg.linear.z;
uMsg.u4 = msg.angular.x; uMsg.u5 = msg.angular.y; uMsg.u6 = msg.angular.z;
end)
if opt.publishTwist then
twist_subscriber:registerCallback(function(msg, header)
if not opt.silent then print('Head twist: \n', msg) end
end)
end
-- function table_merge(t1, t2)
-- for k,v in ipairs(t1) do
-- table.insert(inputs, v)
-- end
-- for k,v in ipairs(t1) do
-- table.insert(inputs, v)
-- end
-- return t1
-- end
while ros.ok() do
inputs = {uMsg.u1, uMsg.u2, uMsg.u3, uMsg.u4, uMsg.u5, uMsg.u6,
poseMsg.z, poseMsg.pitch, poseMsg.yaw}
print(inputs)
ros.spinOnce()
sys.sleep(0.1)
end
pose_subscriber:shutdown()
ros.shutdown()
|
local cluster = require "cluster"
local skynet = require "skynetex"
local M = skynet.module("player")
-- 离线时保存相关数据, 大部分数据都是实时保持的,所以在玩家连接坏掉之后缓存的数据都是早已经保存到数据库,这个接口
-- 只需要保持离线时间相关数据,以及清理定时器等工作
function M.logout_save_data( )
-- 移除事件的侦听
M.base_unsubscribe_events( )
-- 退出场景
M.scene_exit()
-- 清除数据
M.__init__()
end
-- 登陆时加载角色列表
function M.login_load_rolelist( )
-- 获取当前账号的角色列表
self.role_idlist_ = skynet.call(".namespace_db", "lua", "np_get_role_list", self.account_, self.server_id_)
end
-- 前端请求获取角色列表
function M.login_get_rolelist( args )
local ret = { rolelist = {} }
for _, player_id in pairs(self.role_idlist_) do
local data = {}
local dbserver = get_character_dbname(player_id)
-- 加载玩家基本信息
local info = skynet.call(dbserver, "lua", "ct_get_role_info", player_id)
data.player_id = tonumber(player_id)
data.player_name = info.name
data.level = tonumber(info.level)
data.job = tonumber(info.job)
table.insert(ret.rolelist, data)
end
return ret
end
-- 创建角色
function M.login_create_role( args )
local player_name = args.player_name
local job = args.job
local player_id = skynet.call(".namespace_db", "lua", "np_create_role", self.account_, player_name, self.server_id_)
local dbserver = get_character_dbname(player_id)
local ret = skynet.call(dbserver, "lua", "ct_create_role", self.account_, player_id, player_name, job, self.loginip_, 1)
if ret > 0 then
M.login_load_rolelist()
end
return { result = ret }
end
-- 加载角色数据
function M.login_load_playerinfo( args )
assert(self.load_flag_==false)
local player_id = assert(args.player_id)
if not self.role_idlist_[player_id] then
return { result = -1 }
end
-- 默认取第一个初始化,这个在正式游戏上可以用户选择之后再初始化
self.player_id_ = player_id
assert(self.player_id_ > 0)
self.load_flag_ = true
self.dbserver_ = get_character_dbname(self.player_id_)
-- 加载玩家基本信息
local info = skynet.call(self.dbserver_, "lua", "ct_get_role_info", self.player_id_)
self.player_name_ = info.name
self.job_ = info.job
self.vip_ = info.vip
self.diamond_ = info.diamond or 0
self.paydiamond_ = info.paydiamond or 0
self.binddiamond_ = info.binddiamond or 0
self.gold_ = info.gold or 0
self.silver_ = info.silver or 0
self.power_ = info.power or 0
self.scene_id_ = info.scene_id or 1
self.pos_y_ = info.pos_y or 1
self.pos_x_ = info.pos_x or 1
self.createtime_ = info.createtime or 0
self.createip_ = info.createip or ""
self.channel_id_ = info.channel_id or 1
self.last_logintime_ = info.logintime or 0
self.last_logouttime_ = info.logouttime or 0
self.last_loginip_ = info.loginip or ""
-- 加载属性
-- ...
-- 加载物品道具
-- ...
-- ...
-- 注册要侦听的事件
M.base_subscribe_events( )
return { result = 0 }
end
-- 客户端获取玩家数据接口
function M.login_get_player_info( )
return {
player_name = self.player_name_,
vip = tonumber(self.vip_),
diamond = tonumber(self.diamond_),
paydiamond = tonumber(self.paydiamond_),
binddiamond = tonumber(self.binddiamond_),
gold = tonumber(self.gold_),
silver = tonumber(self.silver_),
power = tonumber(self.power_),
scene_id = tonumber(self.scene_id_),
pos_y = tonumber(self.pos_y_),
pos_x = tonumber(self.pos_x_),
createtime = tonumber(self.createtime_),
}
end
|
function isPalindrome(input)
for left = 1, #input / 2 do
right = #input - left + 1
if string.sub(input, left, left) ~= string.sub(input, right, right) then
return false
end
end
return true
end
input = "amanaplanacanalpanama"
if isPalindrome(input) then
print(input .. " is a palindrome!")
else
print(input .. " is not a palindrome!")
end
|
-- Press Cmd+Q twice to quit
local quitModal = hs.hotkey.modal.new('cmd','q')
function quitModal:entered()
hs.alert.show("Press Cmd+Q again to quit", 1)
hs.timer.doAfter(1, function() quitModal:exit() end)
end
local function doQuit()
local app = hs.application.frontmostApplication()
app:kill()
end
quitModal:bind('cmd', 'q', doQuit)
quitModal:bind('', 'escape', function() quitModal:exit() end)
|
local vdom = require('vdom')
-- start_game: () => ()
return function(props)
return vdom.create_element('widget', { width = '100%', height = '100%' },
vdom.create_element(
'label',
{
halign = 'center',
bottom = 720/2 + 80,
color = '#fff',
text = 'Sample Game',
height = 24,
}
),
vdom.create_element(
'label',
{
halign = 'center',
bottom = 720/2 - 20,
color = '#fff',
text = '[NEW GAME]',
height = 24,
on_click = props.start_game,
}
)
)
end
|
local config = require 'config'
local u = require 'utilities'
local api = require 'methods'
local ltn12 = require "ltn12"
local https = require "ssl.https"
local HTTP = require('socket.http')
local URL = require('socket.url')
local plugin = {}
local function isempty(s)
return s == nil or s == ''
end
local function request(text)
local api_key = config.mashape_api_key
if isempty(api_key) then
return 'Configure your Mashape API Key'
end
local api = "https://yoda.p.mashape.com/yoda?"
text = string.gsub(text, " ", "+")
local parameters = "sentence="..(text or "")
local url = api..parameters
local headers = {
["X-Mashape-Key"] = api_key,
["Accept"] = "text/plain"
}
local respbody = {}
local body, code = https.request{
url = url,
method = "GET",
headers = headers,
sink = ltn12.sink.table(respbody),
protocol = "tlsv1"
}
if code ~= 200 then return code end
local body = table.concat(respbody)
return body
end
function plugin.onTextMessage(msg, blocks)
if blocks[1] == 'yoda' then
api.sendChatAction(msg.chat.id, "typing")
if not blocks[2] then
api.sendReply(msg, request("You have to say something to me"), true, reply_markup)
else
api.sendReply(msg, request(blocks[2]), true, reply_markup)
end
end
end
plugin.triggers = {
onTextMessage = {
config.cmd..'(yoda) (.*)$',
config.cmd..'(yoda)$'
}
}
return plugin
|
local TOCNAME, _ = ...
local BOM = BuffomatAddon ---@type BuffomatAddon
---@class BomUiMyButtonModule
local uiMyButtonModule = BuffomatModule.DeclareModule("Ui/MyButton") ---@type BomUiMyButtonModule
local ONIcon = "|TInterface\\RAIDFRAME\\ReadyCheck-Ready:0:0:0:0:64:64:4:60:4:60|t"
local OFFIcon = "|TInterface\\RAIDFRAME\\ReadyCheck-NotReady:0:0:0:0:64:64:4:60:4:60|t"
function BOM.MyButton_Update(self)
if self._privat_disabled and self._IconDisabled then
self._icon:SetTexture(self._IconDisabled, nil, nil, "LINEAR")
self._icon:SetTexCoord(unpack(self._IconDisabledCoord))
self._text:SetText("")
elseif self._privat_state and self._IconSelected then
self._icon:SetTexture(self._IconSelected, nil, nil, "LINEAR")
self._icon:SetTexCoord(unpack(self._IconSelectedCoord))
if self._privat_Text then
self._text:SetText(self._privat_Text)
end
elseif self._IconUnSelected then
self._icon:SetTexture(self._IconUnSelected, nil, nil, "LINEAR")
self._icon:SetTexCoord(unpack(self._IconUnSelectedCoord))
self._text:SetText("")
end
end
---@param self BomControl
function BOM.MyButton_SetOnClick(self, func)
self._privat_OnClick = func
end
function BOM.MyButton_OnDisable(self)
self._privat_disabled = true
BOM.MyButton_Update(self)
end
function BOM.MyButton_OnEnable(self)
self._privat_disabled = false
BOM.MyButton_Update(self)
end
---@param self BomControl
function BOM.MyButton_OnEnter(self)
if self._privat_ToolTipLink or self._privat_ToolTipText then
GameTooltip_SetDefaultAnchor(BomC_Tooltip, UIParent)
BomC_Tooltip:SetOwner(BomC_MainWindow, "ANCHOR_PRESERVE")
BomC_Tooltip:ClearLines()
if self._privat_ToolTipLink then
BomC_Tooltip:SetHyperlink(self._privat_ToolTipLink)
else
local add = ""
if (self._privat_DB and self._privat_Var) then
add = " " .. (self._privat_state and ONIcon or OFFIcon)
end
BomC_Tooltip:AddLine(self._privat_ToolTipText .. add)
end
BomC_Tooltip:Show()
end
if ((self._privat_DB and self._privat_Var) or self._privat_isSecure) and not self._privat_disabled then
self._iconHighlight:SetTexture(self._icon:GetTexture())
self._iconHighlight:SetTexCoord(self._icon:GetTexCoord())
if (self._iconHighlight:SetDesaturated(true)) then
self._iconHighlight:SetVertexColor(1, 0.75, 0.25, 0.75);
self._iconHighlight:SetBlendMode("ADD")
else
self._iconHighlight:SetColorTexture(1, 1, 1, 0.2);
end
end
end
function BOM.MyButton_OnLeave(self)
BomC_Tooltip:Hide()
self._iconHighlight:SetColorTexture(1, 1, 1, 0)
self._iconHighlight:SetVertexColor(1, 1, 1, 0);
end
---@param self BomControl
function BOM.MyButton_OnMouseUp(self, button)
if not self._privat_disabled then
if self._privat_DB and self._privat_Var then
if self._privat_Set == nil then
self._privat_DB[self._privat_Var] = not self._privat_DB[self._privat_Var]
else
if self._privat_DB[self._privat_Var] ~= self._privat_Set then
self._privat_DB[self._privat_Var] = self._privat_Set
else
self._privat_DB[self._privat_Var] = nil
end
end
self:SetState()
BOM.MyButton_OnEnter(self)
if self._privat_OnClick then
self._privat_OnClick(self, button)
end
end
end
end
function BOM.MyButton_SetText(self, text)
self._privat_Text = text
BOM.MyButton_Update(self)
end
---@param self BomControl
function BOM.MyButton_OnLoad(self, isSecure)
self._privat_state = true
self._privat_disabled = false
self.SetState = BOM.MyButton_SetState
self.SetTextures = BOM.MyButton_SetTextures
self.SetTooltipLink = BOM.MyButton_SetTooltipLink
self.SetTooltip = BOM.MyButton_SetTooltip
self.SetVariable = BOM.MyButton_SetVariable
self.SetText = BOM.MyButton_SetText
if not isSecure then
self:SetScript("OnMouseUp", BOM.MyButton_OnMouseUp)
self.SetOnClick = BOM.MyButton_SetOnClick
self.Disable = BOM.MyButton_OnDisable
self.Enable = BOM.MyButton_OnEnable
else
self:SetScript("OnDisable", BOM.MyButton_OnDisable)
self:SetScript("OnEnable", BOM.MyButton_OnEnable)
self.SetSpell = BOM.MyButton_SetSpell
self._privat_isSecure = true
end
self:SetScript("OnEnter", BOM.MyButton_OnEnter)
self:SetScript("OnLeave", BOM.MyButton_OnLeave)
end
---@param self BomControl
function BOM.MyButton_SetState(self, state)
if state == nil then
if self._privat_DB and self._privat_Var then
if self._privat_Set == nil then
self._privat_state = self._privat_DB[self._privat_Var]
else
self._privat_state = (self._privat_DB[self._privat_Var] == self._privat_Set)
end
end
else
self._privat_state = state
end
BOM.MyButton_Update(self)
end
local defaultcoord = { 0, 1, 0, 1 }
function BOM.MyButton_SetTextures(self, sel, unsel, dis, selCoord, unselCoord, disCoord)
self._IconSelected = sel
self._IconUnSelected = unsel
self._IconDisabled = dis
self._IconSelectedCoord = selCoord or defaultcoord
self._IconUnSelectedCoord = unselCoord or defaultcoord
self._IconDisabledCoord = disCoord or defaultcoord
BOM.MyButton_Update(self)
end
---@param db table<string, any> A storage table where clicking the button will modify something
---@param var string Key in the table to be modified
---@param set any Value to be written to the table if the button is clicked
---@param self BomControl
function BOM.MyButton_SetVariable(self, db, var, set)
self._privat_DB = db
self._privat_Var = var
self._privat_Set = set
self:SetState()
end
function BOM.MyButton_SetTooltipLink(self, link)
self._privat_ToolTipLink = link
self._privat_ToolTipText = nil
end
function BOM.MyButton_SetTooltip(self, text)
self._privat_ToolTipLink = nil
self._privat_ToolTipText = text
end
function BOM.MyButton_SetSpell(self, spell)
self:SetAttribute("type", "spell")
self:SetAttribute("spell", spell)
self:SetAttribute("unit", "player")
end
---Contains all MyButtons
---@type table<string, BomControl>
local bom_managed_mybuttons = {}
---Creates small clickable button in the spell tab
---@param parent table - UI parent frame
---@param sel string - texture for checked / selected
---@param unsel string - texture for unchecked / unselected
---@param dis string - texture for disabled
---@param selCoord table - texcoord for selected
---@param unselCoord table - texcoord for unselected
---@param disCoord table - texcoord for disabled
---@param unmanaged boolean - set to true to not add button to bom_managed_mybuttons
---@return BomControl
function BOM.CreateMyButton(parent, sel, unsel, dis, selCoord, unselCoord, disCoord, unmanaged)
local new_button_frame = CreateFrame("frame", nil, parent, "BomC_MyButton")
BOM.MyButton_OnLoad(new_button_frame)
new_button_frame:SetTextures(sel, unsel, dis, selCoord, unselCoord, disCoord)
if unmanaged == nil or unmanaged == false then
tinsert(bom_managed_mybuttons, new_button_frame)
end
return new_button_frame
end
---@return BomControl
function BOM.CreateMyButtonSecure(parent, sel, unsel, dis, selCoord, unselCoord, disCoord)
local new_button_frame = CreateFrame("Button", nil, parent, "BomC_MyButtonSecure")
BOM.MyButton_OnLoad(new_button_frame, true)
new_button_frame:SetTextures(sel, unsel, dis, selCoord, unselCoord, disCoord)
tinsert(bom_managed_mybuttons, new_button_frame)
return new_button_frame
end
function BOM.MyButtonUpdateAll()
for i, Frame in ipairs(bom_managed_mybuttons) do
if Frame.SetState then
Frame:SetState()
end
end
end
-- Hides all icons and clickable buttons in the spells tab
function BOM.MyButtonHideAll()
for i, Frame in ipairs(bom_managed_mybuttons) do
Frame:Hide()
end
end
|
---------------------- Crystallizer ----------------------
-- Entity --
cE = {}
cE.type = "assembling-machine"
cE.name = "Crystallizer"
cE.icon = "__Mobile_Factory_Graphics__/graphics/icones/Crystallizer.png"
cE.icon_size = 32
cE.flags = {"placeable-neutral", "placeable-player", "player-creation"}
cE.minable = {mining_time = 0.2, result = "Crystallizer"}
cE.max_health = 350
cE.dying_explosion = "medium-explosion"
cE.corpse = "medium-remnants"
cE.alert_icon_shift = util.by_pixel(-3, -12)
cE.resistances =
{
{
type = "fire",
percent = 70
}
}
cE.fluid_boxes =
{
{
production_type = "input",
pipe_picture = assembler2pipepictures(),
pipe_covers = pipecoverspictures(),
base_area = 10,
base_level = -1,
pipe_connections = {{ type="input", position = {0, -2} }},
secondary_draw_orders = { north = -1 }
},
{
production_type = "output",
pipe_picture = assembler2pipepictures(),
pipe_covers = pipecoverspictures(),
base_area = 10,
base_level = 1,
pipe_connections = {{ type="output", position = {0, 2} }},
secondary_draw_orders = { north = -1 }
},
off_when_no_fluid_recipe = true
}
cE.collision_box = {{-1.2, -1.2}, {1.2, 1.2}}
cE.selection_box = {{-1.5, -1.5}, {1.5, 1.5}}
cE.animation =
{
layers =
{
{
filename = "__Mobile_Factory_Graphics__/graphics/entity/Crystallizer.png",
priority = "high",
width = 214,
height = 218,
frame_count = 32,
line_length = 8,
shift = util.by_pixel(0, 4),
scale = 0.5
},
{
filename = "__base__/graphics/entity/assembling-machine-2/hr-assembling-machine-2-shadow.png",
priority = "high",
width = 196,
height = 163,
frame_count = 32,
line_length = 8,
draw_as_shadow = true,
shift = util.by_pixel(12, 4.75),
scale = 0.5
}
}
}
cE.open_sound = { filename = "__base__/sound/machine-open.ogg", volume = 0.85 }
cE.close_sound = { filename = "__base__/sound/machine-close.ogg", volume = 0.75 }
cE.vehicle_impact_sound = { filename = "__base__/sound/car-metal-impact.ogg", volume = 0.65 }
cE.working_sound =
{
sound =
{
{
filename = "__base__/sound/assembling-machine-t2-1.ogg",
volume = 0.8
},
{
filename = "__base__/sound/assembling-machine-t2-2.ogg",
volume = 0.8
}
},
idle_sound = { filename = "__base__/sound/idle1.ogg", volume = 0.6 },
apparent_volume = 1.5
}
cE.crafting_categories = {"DimensionalCrystallizaton"}
cE.crafting_speed = 1
cE.energy_source =
{
type = "electric",
usage_priority = "secondary-input",
emissions_per_minute = 3
}
cE.energy_usage = "800kW"
cE.module_specification =
{
module_slots = 2
}
cE.allowed_effects = {"consumption", "speed", "productivity", "pollution"}
data:extend{cE}
-- Item --
local cI = {}
cI.type = "item"
cI.name = "Crystallizer"
cI.icon = "__Mobile_Factory_Graphics__/graphics/icones/Crystallizer.png"
cI.icon_size = 32
cI.place_result = "Crystallizer"
cI.subgroup = "DimensionalStuff"
cI.order = "e"
cI.stack_size = 5
data:extend{cI}
-- Recipe --
local cR = {}
cR.type = "recipe"
cR.name = "Crystallizer"
cR.energy_required = 5
cR.enabled = false
cR.ingredients =
{
{"MachineFrame2", 8},
{"DimensionalCircuit", 35}
}
cR.result = "Crystallizer"
data:extend{cR}
-- Technologie --
local cT = {}
cT.name = "Crystallizer"
cT.type = "technology"
cT.icon = "__Mobile_Factory_Graphics__/graphics/icones/Crystallizer.png"
cT.icon_size = 32
cT.unit = {
count=1000,
time=2,
ingredients={
{"DimensionalSample", 1}
}
}
cT.prerequisites = {"DimensionalOreSmelting"}
cT.effects = {{type="unlock-recipe", recipe="Crystallizer"}}
data:extend{cT}
|
pfUI:RegisterModule("tooltip", function ()
local alpha = tonumber(C.tooltip.alpha)
CreateBackdrop(GameTooltip, nil, nil, alpha)
-- prevent tooltips from being placed offscreen
GameTooltip:SetClampedToScreen(true)
GameTooltipStatusBar:SetClampedToScreen(true)
if C.tooltip.position == "cursor" then
function _G.GameTooltip_SetDefaultAnchor(tooltip, parent)
tooltip:SetOwner(parent, "ANCHOR_CURSOR")
if C.tooltip.cursoralign ~= "native" then
-- create mouse follow frame
if not tooltip.cursor then
tooltip.cursor = CreateFrame("Frame")
tooltip.cursor:SetWidth(tonumber(C.tooltip.cursoroffset) * 2)
tooltip.cursor:SetHeight(tonumber(C.tooltip.cursoroffset) * 2)
tooltip.cursor:SetScript("OnUpdate", function()
local x, y = GetCursorPosition()
this:SetPoint("CENTER", UIParent, "BOTTOMLEFT", x, y)
if C.tooltip.cursoralign == "top" then
tooltip.cursor:SetWidth(tooltip:GetWidth())
end
end)
end
-- adjust tooltip to mouse frame
if C.tooltip.cursoralign == "top" then
tooltip:SetPoint("BOTTOMLEFT", tooltip.cursor, "TOPLEFT", 0, 0)
elseif C.tooltip.cursoralign == "left" then
tooltip:SetPoint("BOTTOMRIGHT", tooltip.cursor, "TOPLEFT", 0, 0)
elseif C.tooltip.cursoralign == "right" then
tooltip:SetPoint("BOTTOMLEFT", tooltip.cursor, "TOPRIGHT", 0, 0)
end
end
end
end
pfUI.tooltip = CreateFrame('Frame', "pfTooltip", GameTooltip)
function pfUI.tooltip:GetUnit()
pfUI.tooltip.unit = "none"
for i, unit in pairs({"mouseover", "player", "pet", "target", "party", "partypet", "raid", "raidpet"}) do
if unit == "party" or unit == "partypet" then
for i=1,4 do
if UnitExists(unit .. i) and ( UnitName(unit .. i) == GameTooltipTextLeft1:GetText() or UnitPVPName(unit .. i) == GameTooltipTextLeft1:GetText() ) then
pfUI.tooltip.unit = unit .. i
return pfUI.tooltip.unit
end
end
elseif unit == "raid" or unit == "raidpet" then
for i=1,40 do
if UnitExists(unit .. i) and ( UnitName(unit .. i) == GameTooltipTextLeft1:GetText() or UnitPVPName(unit .. i) == GameTooltipTextLeft1:GetText() ) then
pfUI.tooltip.unit = unit .. i
return pfUI.tooltip.unit
end
end
else
if UnitExists(unit) and ( UnitName(unit) == GameTooltipTextLeft1:GetText() or UnitPVPName(unit) == GameTooltipTextLeft1:GetText() ) then
pfUI.tooltip.unit = unit
return pfUI.tooltip.unit
end
end
end
return pfUI.tooltip.unit
end
pfUI.tooltip:SetAllPoints()
pfUI.tooltip:SetScript("OnShow", function()
pfUI.tooltip:Update()
if GameTooltip:GetAnchorType() == "ANCHOR_NONE" then
GameTooltip:ClearAllPoints()
if C.tooltip.position == "bottom" then
if pfUI.panel then
GameTooltip:SetPoint("BOTTOMRIGHT", pfUI.panel.right, "TOPRIGHT", 0, C.appearance.border.default*2)
else
GameTooltip:SetPoint("BOTTOMRIGHT", UIParent, "BOTTOMRIGHT", -5, 5)
end
elseif C.tooltip.position == "chat" then
local anchor = nil
if pfUI.panel and pfUI.panel.right:IsShown() then
anchor = pfUI.panel.right
end
if pfUI.chat and pfUI.chat.right:IsShown() then
anchor = pfUI.chat.right
end
if pfUI.bag and pfUI.bag.right and pfUI.bag.right:IsShown() then
anchor = pfUI.bag.right
end
if anchor then
GameTooltip:SetPoint("BOTTOMRIGHT", anchor, "TOPRIGHT", 0, C.appearance.border.default*2)
else
GameTooltip:SetPoint("BOTTOMRIGHT", UIParent, "BOTTOMRIGHT", -5, 5)
end
end
end
end)
pfUI.tooltipStatusBar = CreateFrame('Frame', nil, GameTooltipStatusBar)
pfUI.tooltipStatusBar:SetScript("OnUpdate", function()
hp = GameTooltipStatusBar:GetValue()
_, hpm = GameTooltipStatusBar:GetMinMaxValues()
if hp and hpm then
if hp >= 1000 then hp = round(hp / 1000, 1) .. "k" end
if hpm >= 1000 then hpm = round(hpm / 1000, 1) .. "k" end
if pfUI.tooltipStatusBar and pfUI.tooltipStatusBar.HP then
pfUI.tooltipStatusBar.HP:SetText(hp .. " / " .. hpm)
end
end
end)
GameTooltipStatusBar:SetHeight(6)
GameTooltipStatusBar:ClearAllPoints()
GameTooltipStatusBar:SetPoint("BOTTOMLEFT", GameTooltip, "TOPLEFT", 0, 0)
GameTooltipStatusBar:SetPoint("BOTTOMRIGHT", GameTooltip, "TOPRIGHT", 0, 0)
GameTooltipStatusBar:SetStatusBarTexture("Interface\\AddOns\\pfUI\\img\\bar")
CreateBackdrop(GameTooltipStatusBar)
GameTooltipStatusBar.SetStatusBarColor_orig = GameTooltipStatusBar.SetStatusBarColor
GameTooltipStatusBar.SetStatusBarColor = function() return end
function pfUI.tooltip:Update()
local unit = pfUI.tooltip:GetUnit()
if unit == "none" then return end
local pvpname = UnitPVPName(unit)
local name = UnitName(unit)
local target = UnitName(unit .. "target")
local _, targetClass = UnitClass(unit .. "target")
local targetReaction = UnitReaction("player",unit .. "target")
local _, class = UnitClass(unit)
local guild, rankstr, rankid = GetGuildInfo(unit)
local reaction = UnitReaction(unit, "player")
local pvptitle = gsub(pvpname or name," "..name, "", 1)
local hp = UnitHealth(unit)
local hpm = UnitHealthMax(unit)
if name then
if UnitIsPlayer(unit) and class then
local color = RAID_CLASS_COLORS[class]
GameTooltipStatusBar:SetStatusBarColor_orig(color.r, color.g, color.b)
GameTooltip:SetBackdropBorderColor(color.r, color.g, color.b)
if color.colorStr then
GameTooltipTextLeft1:SetText("|c" .. color.colorStr .. name)
end
elseif reaction then
local color = UnitReactionColor[reaction]
GameTooltipStatusBar:SetStatusBarColor_orig(color.r, color.g, color.b)
GameTooltip:SetBackdropBorderColor(color.r, color.g, color.b)
end
if pvptitle ~= name then
GameTooltip:AppendText(" |cff666666["..pvptitle.."]|r")
end
end
if guild then
local rank = ""
local lead = ""
if C.tooltip.extguild == "1" then
if rankstr then rank = " |cffaaaaaa(" .. rankstr .. ")" end
if rankid and rankid == 0 then lead = "|cffffcc00*|r" end
end
GameTooltip:AddLine("<" .. guild .. ">" .. lead .. rank, 0.3, 1, 0.5)
end
if target then
if UnitIsPlayer(unit .. "target") and targetClass then
local color = RAID_CLASS_COLORS[targetClass]
GameTooltip:AddLine(target, color.r, color.g, color.b)
elseif targetReaction then
local color = UnitReactionColor[targetReaction]
GameTooltip:AddLine(target, color.r, color.g, color.b)
end
end
if pfUI.tooltipStatusBar.HP == nil then
pfUI.tooltipStatusBar.HP = GameTooltipStatusBar:CreateFontString("Status", "DIALOG", "GameFontNormal")
pfUI.tooltipStatusBar.HP:SetPoint("TOP", 0,8)
pfUI.tooltipStatusBar.HP:SetNonSpaceWrap(false)
pfUI.tooltipStatusBar.HP:SetFontObject(GameFontWhite)
pfUI.tooltipStatusBar.HP:SetFont(pfUI.font_default, C.global.font_size + 2, "OUTLINE")
end
if hp and hpm then
if hp >= 1000 then hp = round(hp / 1000, 1) .. "k" end
if hpm >= 1000 then hpm = round(hpm / 1000, 1) .. "k" end
pfUI.tooltipStatusBar.HP:SetText(hp .. " / " .. hpm)
end
GameTooltip:Show()
end
end)
|
local entity = {}
entity["level"] = [[59]]
entity["spellDeck"] = {}
entity["spellDeck"][1] = [[Tempest Slash]]
entity["spellDeck"][2] = [[]]
entity["spellDeck"][3] = [[Power Charge]]
entity["spellDeck"][4] = [[]]
entity["spellDeck"][5] = [[Auto-Masukukaja]]
entity["spellDeck"][6] = [[]]
entity["heritage"] = {}
entity["heritage"][1] = [[Slash]]
entity["heritage"][2] = [[]]
entity["resistance"] = {}
entity["resistance"][1] = [[Null]]
entity["resistance"][2] = [[Strong]]
entity["resistance"][3] = [[Normal]]
entity["resistance"][4] = [[Normal]]
entity["resistance"][5] = [[Normal]]
entity["resistance"][6] = [[Normal]]
entity["resistance"][7] = [[Normal]]
entity["resistance"][8] = [[Null]]
entity["resistance"][9] = [[Weak]]
entity["desc"] = [[The German name of the hero in the epic poem of the Nibelungenlied. The dragon Fafnir's blood made him invincible, but a single leaf on his back resulted in a weak spot.]]
--a function: evolveName
entity["arcana"] = [[Strength]]
entity["stats"] = {}
entity["stats"][1] = [[50]]
entity["stats"][2] = [[43]]
entity["stats"][3] = [[40]]
entity["stats"][4] = [[41]]
entity["stats"][5] = [[32]]
entity["name"] = [[Siegfried]]
entity["spellLearn"] = {}
entity["spellLearn"]["High Counter"] = [[62]]
entity["spellLearn"]["2h Swd Master"] = [[66]]
entity["spellLearn"]["Arms Master"] = [[65]]
entity["spellLearn"]["Vorpal Blade"] = [[63]]
return entity
|
function chinLoadObject(fileName)
--=========================================== Create object
numObj = chiObjectQuery(0);
newSurf = chiLoadSurface(fileName);
objName = "Object_"..string.format("%4d",numObj)
chiObjectCreate(objName);
chiObjectAddSurface(objName,newSurf);
--=========================================== Initialize lua context
chiObjectQuery(2,numObj);
local this=chinObject[numObj];
this.name =objName;
this.obj1Num=numObj;
this.selectable=true;
this.selected=true;
this.matlNum = chiMaterialCreate(objName .. "_Material");
ambient = 1.0;
chiMaterialSetProperty(this.matlNum,"Diffuse",ambient,ambient,ambient,1.0);
chiObjectSetProperty(objName,"Material",objName .. "_Material");
this.obj1Tra =chiTransformCreate(objName.."_Transform");
this.obj1TTra=chiTransformCreate(objName.."_TextureTransform");
chiObjectSetProperty(objName,"Transform",objName.."_Transform");
chiObjectSetProperty(objName,"TextureTransform",objName.."_TextureTransform");
chiObjectSetProperty(objName,"ListAble",true);
--=========================================== Events function
function this.ProcessEvents(this)
if (WM_LBUTTONDOWN.occured) then
if ((WM_LBUTTONDOWN.iPar5==this.obj1Num) and (this.selectable)) then
selectionStack.Clear()
local newSel = SelectionClass.New();
newSel.type = SELECTION_TYPE_OBJECT;
newSel.index = this.obj1Num;
newSel.originFeature=this;
selectionStack.PushItem(newSel);
end
end
end
--=========================================== Selection function
function this.SelectionStackCheck(selectionItem)
if (selectionItem.type==SELECTION_TYPE_OBJECT) then
if (selectionItem.index==this.obj1Num) then
chiObjectSetProperty(selectionItem.index,"ShowBoundingBox",true);
end
end
end
--=========================================== DeSelection function
function this.DeSelectionStackCheck(selectionItem)
if (selectionItem.type==SELECTION_TYPE_OBJECT) then
if (selectionItem.index==this.obj1Num) then
chiObjectSetProperty(selectionItem.index,"ShowBoundingBox",false);
end
end
end
selectionStack.PushSelectionCallback(this.SelectionStackCheck);
selectionStack.PushDeSelectionCallback(this.DeSelectionStackCheck);
--=========================================== Register feature on events
dRegisterFeature(this);
--=========================================== Add it to the stack
simulationObjectCount=simulationObjectCount+1;
simulationObjectStack[simulationObjectCount]=this;
end
|
local EMOTE_NAMES = {
wave = false,
point = false,
dance = true,
dance1 = true,
dance2 = true,
dance3 = true,
laugh = false,
cheer = false,
}
return EMOTE_NAMES
|
demo = {}
demo.name = "Demo"
demo.range = "1"
demo.skill1 = "Creativity"
demo.skill2 = "Memory"
demo.skill3 = "Focus"
demo.defense = "Nullification"
demo.description = "This spell is a demo that exists to test the interface."
demo.effect = "None"
|
-- // NOTICE: They have a new anti cheat that is obfuscated and one that has no bytecode. In other words, I'm not bothered to bypass that.
-- // Services
local ReplicatedStorage = game:GetService("ReplicatedStorage")
-- // Vars
local WeaponManagerClient = require(ReplicatedStorage.Modules.Client.Managers.WeaponManagerClient)
-- // Hook the function that makes the connections
hookfunction(WeaponManagerClient.ConnectCharacterChecker, function() end)
-- // Hook the current connected funcs
for _, v in ipairs(getreg()) do
-- // Make sure is function
if (typeof(v) == "function") then
-- // Vars
local constants = debug.getconstants(v)
-- // Check constants
if (not is_synapse_function(v) and islclosure(v) and table.find(constants, "HipHeight") and table.find(constants, 1.9) and table.find(constants, 3.1)) then
-- // Hook
hookfunction(v, function() end)
end
end
end
|
function ReplaceChar(str, pos, r)
return str:sub(1, pos-1) .. r .. str:sub(pos+#r)
end
function NewChunk(x,z)
local chunk = NewThing(x,0,z)
chunk.voxels = {}
chunk.slices = {}
chunk.heightMap = {}
chunk.name = "chunk"
chunk.ceiling = 120
chunk.floor = 48
chunk.requests = {}
-- store a list of voxels to be updated on next modelUpdate
chunk.changes = {}
for i=1, ChunkSize do
chunk.heightMap[i] = {}
end
GenerateTerrain(chunk, x,z, StandardTerrain)
local gx,gz = (chunk.x-1)*ChunkSize + rand(0,15), (chunk.z-1)*ChunkSize + rand(0,15)
if choose{true, false} then
local caveCount1 = rand(1,3)
for i=1, caveCount1 do
NewCave(gx,rand(8,64),gz)
end
local caveCount2 = rand(1,2)
for i=1, caveCount2 do
NewCave(gx,rand(48,80),gz)
end
end
chunk.sunlight = function (self)
for i=1, ChunkSize do
for j=1, ChunkSize do
local gx,gz = (self.x-1)*ChunkSize + i-1, (self.z-1)*ChunkSize + j-1
local this = self.heightMap[i][j]
if i == 1 or this > self.heightMap[i-1][j]+1 then
NewSunlightDownAddition(gx-1,this,gz, 15)
LightingUpdate()
end
if j == 1 or this > self.heightMap[i][j-1] then
NewSunlightDownAddition(gx,this,gz-1, 15)
LightingUpdate()
end
if i == ChunkSize or this > self.heightMap[i+1][j] then
NewSunlightDownAddition(gx+1,this,gz, 15)
LightingUpdate()
end
if j == ChunkSize or this > self.heightMap[i][j+1] then
NewSunlightDownAddition(gx,this,gz+1, 15)
LightingUpdate()
end
end
end
end
-- process all requested blocks upon creation of chunk
chunk.processRequests = function (self)
for j=1, #self.requests do
local block = self.requests[j]
if not TileCollisions(self:getVoxel(block.x,block.y,block.z)) then
self:setVoxel(block.x,block.y,block.z, block.value, 15)
LightingUpdate()
end
end
end
-- populate chunk with trees and flowers
chunk.populate = function (self)
for i=1, ChunkSize do
for j=1, ChunkSize do
local height = self.heightMap[i][j]
local xx = (self.x-1)*ChunkSize + i
local zz = (self.z-1)*ChunkSize + j
if TileCollisions(self:getVoxel(i,height,j)) then
if love.math.random() < love.math.noise(xx/64,zz/64)*0.02 then
-- put a tree here
GenerateTree(self, i,height,j)
self:setVoxelRaw(i,height,j, 3,15)
elseif love.math.noise(xx/32,zz/32) > 0.9 and love.math.random() < 0.2 then
-- put a flower here
self:setVoxelRaw(i,height+1,j, 38,15)
end
end
end
end
end
chunk.initialize = function (self)
for i=1, WorldHeight/SliceHeight do
self.slices[i] = NewChunkSlice(self.x,self.y + (i-1)*SliceHeight+1,self.z, self)
end
self.changes = {}
end
-- get voxel id of the voxel in this chunk's coordinate space
chunk.getVoxel = function (self, x,y,z)
x = math.floor(x)
y = math.floor(y)
z = math.floor(z)
if x <= ChunkSize and x >= 1
and z <= ChunkSize and z >= 1
and y >= 1 and y <= WorldHeight then
return string.byte(self.voxels[x][z]:sub((y-1)*TileDataSize +1,(y-1)*TileDataSize +1)),
string.byte(self.voxels[x][z]:sub((y-1)*TileDataSize +2,(y-1)*TileDataSize +2)),
string.byte(self.voxels[x][z]:sub((y-1)*TileDataSize +3,(y-1)*TileDataSize +3))
end
return 0, 0, 0
end
chunk.getVoxelFirstData = function (self, x,y,z)
x = math.floor(x)
y = math.floor(y)
z = math.floor(z)
if x <= ChunkSize and x >= 1
and z <= ChunkSize and z >= 1
and y >= 1 and y <= WorldHeight then
return string.byte(self.voxels[x][z]:sub((y-1)*TileDataSize +2,(y-1)*TileDataSize +2))
end
return 0
end
chunk.getVoxelSecondData = function (self, x,y,z)
x = math.floor(x)
y = math.floor(y)
z = math.floor(z)
if x <= ChunkSize and x >= 1
and z <= ChunkSize and z >= 1
and y >= 1 and y <= WorldHeight then
return string.byte(self.voxels[x][z]:sub((y-1)*TileDataSize +3,(y-1)*TileDataSize +3))
end
return 0
end
chunk.setVoxelRaw = function (self, x,y,z, value,light)
if x <= ChunkSize and x >= 1
and z <= ChunkSize and z >= 1
and y >= 1 and y <= WorldHeight then
local gx,gy,gz = (self.x-1)*ChunkSize + x-1, y, (self.z-1)*ChunkSize + z-1
self.voxels[x][z] = ReplaceChar(self.voxels[x][z], (y-1)*TileDataSize +1, string.char(value))
self.changes[#self.changes+1] = {x,y,z}
end
end
-- set voxel id of the voxel in this chunk's coordinate space
chunk.setVoxel = function (self, x,y,z, value, manuallyPlaced)
if manuallyPlaced == nil then
manuallyPlaced = false
end
x = math.floor(x)
y = math.floor(y)
z = math.floor(z)
if x <= ChunkSize and x >= 1
and z <= ChunkSize and z >= 1
and y >= 1 and y <= WorldHeight then
local gx,gy,gz = (self.x-1)*ChunkSize + x-1, y, (self.z-1)*ChunkSize + z-1
self:setVoxelFirstData(x,y,z, 0)
self:setVoxelSecondData(x,y,z, 0)
local sunlight = self:getVoxelFirstData(x,y+1,z)
local sunget = self:getVoxel(x,y+1,z)
local inDirectSunlight = TileLightable(sunget) and sunlight == 15
local placingLocalSource = false
local destroyLight = false
if TileLightable(value) then
-- if removed block or put in lightable block
if inDirectSunlight then
NewSunlightDownAddition(gx,gy,gz, sunlight)
else
NewSunlightAdditionCreation(gx+1,gy,gz)
NewSunlightAdditionCreation(gx-1,gy,gz)
NewSunlightAdditionCreation(gx,gy+1,gz)
NewSunlightAdditionCreation(gx,gy-1,gz)
NewSunlightAdditionCreation(gx,gy,gz+1)
NewSunlightAdditionCreation(gx,gy,gz-1)
end
if manuallyPlaced then
local source = TileLightSource(value)
if source > 0 then
NewLocalLightAddition(gx,gy,gz, source)
placingLocalSource = true
else
NewLocalLightAdditionCreation(gx+1,gy,gz)
NewLocalLightAdditionCreation(gx-1,gy,gz)
NewLocalLightAdditionCreation(gx,gy+1,gz)
NewLocalLightAdditionCreation(gx,gy-1,gz)
NewLocalLightAdditionCreation(gx,gy,gz+1)
NewLocalLightAdditionCreation(gx,gy,gz-1)
end
end
else
-- if placed block remove sunlight beneath it
NewSunlightDownSubtraction(gx,gy-1,gz)
if TileSemiLightable(value) and inDirectSunlight and manuallyPlaced then
NewSunlightAdditionCreation(gx,gy+1,gz)
end
if not TileSemiLightable(value) or manuallyPlaced then
-- don't destroy local light if semi lightable
destroyLight = not TileSemiLightable(value)
local nget = GetVoxelFirstData(gx,gy+1,gz)
if nget < 15 then
NewSunlightSubtraction(gx,gy+1,gz, nget+1)
end
local nget = GetVoxelFirstData(gx+1,gy,gz)
if nget < 15 then
NewSunlightSubtraction(gx+1,gy,gz, nget+1)
end
local nget = GetVoxelFirstData(gx-1,gy,gz)
if nget < 15 then
NewSunlightSubtraction(gx-1,gy,gz, nget+1)
end
local nget = GetVoxelFirstData(gx,gy,gz+1)
if nget < 15 then
NewSunlightSubtraction(gx,gy,gz+1, nget+1)
end
local nget = GetVoxelFirstData(gx,gy,gz-1)
if nget < 15 then
NewSunlightSubtraction(gx,gy,gz-1, nget+1)
end
end
end
local source = TileLightSource(self:getVoxel(x,y,z))
if source > 0
and TileLightSource(value) == 0 then
NewLocalLightSubtraction(gx,gy,gz, source+1)
destroyLight = true
end
if manuallyPlaced then
if destroyLight then
local nget = GetVoxelSecondData(gx,gy+1,gz)
if nget < 15 then
NewLocalLightSubtraction(gx,gy+1,gz, nget+1)
end
local nget = GetVoxelSecondData(gx,gy-1,gz)
if nget < 15 then
NewLocalLightSubtraction(gx,gy-1,gz, nget+1)
end
local nget = GetVoxelSecondData(gx+1,gy,gz)
if nget < 15 then
NewLocalLightSubtraction(gx+1,gy,gz, nget+1)
end
local nget = GetVoxelSecondData(gx-1,gy,gz)
if nget < 15 then
NewLocalLightSubtraction(gx-1,gy,gz, nget+1)
end
local nget = GetVoxelSecondData(gx,gy,gz+1)
if nget < 15 then
NewLocalLightSubtraction(gx,gy,gz+1, nget+1)
end
local nget = GetVoxelSecondData(gx,gy,gz-1)
if nget < 15 then
NewLocalLightSubtraction(gx,gy,gz-1, nget+1)
end
end
-- fill empty local light values when placed semi lightable block
if TileSemiLightable(value) and not placingLocalSource then
NewLocalLightAdditionCreation(gx+1,gy,gz)
NewLocalLightAdditionCreation(gx-1,gy,gz)
NewLocalLightAdditionCreation(gx,gy+1,gz)
NewLocalLightAdditionCreation(gx,gy-1,gz)
NewLocalLightAdditionCreation(gx,gy,gz+1)
NewLocalLightAdditionCreation(gx,gy,gz-1)
end
end
self.voxels[x][z] = ReplaceChar(self.voxels[x][z], (y-1)*TileDataSize +1, string.char(value))
self.changes[#self.changes+1] = {x,y,z}
end
end
chunk.setVoxelData = function (self, x,y,z, value)
x = math.floor(x)
y = math.floor(y)
z = math.floor(z)
if x <= ChunkSize and x >= 1
and z <= ChunkSize and z >= 1
and y >= 1 and y <= WorldHeight then
self.voxels[x][z] = ReplaceChar(self.voxels[x][z], (y-1)*TileDataSize +2, string.char(value))
self.changes[#self.changes+1] = {x,y,z}
end
end
-- sunlight data
chunk.setVoxelFirstData = function (self, x,y,z, value)
x = math.floor(x)
y = math.floor(y)
z = math.floor(z)
if x <= ChunkSize and x >= 1
and z <= ChunkSize and z >= 1
and y >= 1 and y <= WorldHeight then
self.voxels[x][z] = ReplaceChar(self.voxels[x][z], (y-1)*TileDataSize +2, string.char(value))
self.changes[#self.changes+1] = {x,y,z}
end
end
-- local light data
chunk.setVoxelSecondData = function (self, x,y,z, value)
x = math.floor(x)
y = math.floor(y)
z = math.floor(z)
if x <= ChunkSize and x >= 1
and z <= ChunkSize and z >= 1
and y >= 1 and y <= WorldHeight then
self.voxels[x][z] = ReplaceChar(self.voxels[x][z], (y-1)*TileDataSize +3, string.char(value))
self.changes[#self.changes+1] = {x,y,z}
end
end
-- update this chunk's model slices based on what changes it has stored
chunk.updateModel = function (self)
local sliceUpdates = {}
for i=1, WorldHeight/SliceHeight do
sliceUpdates[i] = {false, false, false, false, false}
end
-- find which slices need to be updated
for i=1, #self.changes do
local index = math.floor((self.changes[i][2]-1)/SliceHeight) +1
if sliceUpdates[index] ~= nil then
sliceUpdates[index][1] = true
if math.floor((self.changes[i][2])/SliceHeight) +1 > index and sliceUpdates[index+1] ~= nil then
sliceUpdates[math.min(index+1, #sliceUpdates)][1] = true
end
if math.floor((self.changes[i][2]-2)/SliceHeight) +1 < index and sliceUpdates[index-1] ~= nil then
sliceUpdates[math.max(index-1, 1)][1] = true
end
--print(self.changes[i][1], self.changes[i][2], self.changes[i][3])
-- neg x
if self.changes[i][1] == 1 then
sliceUpdates[index][2] = true
--print("neg x")
end
-- pos x
if self.changes[i][1] == ChunkSize then
sliceUpdates[index][3] = true
--print("pos x")
end
-- neg z
if self.changes[i][3] == 1 then
sliceUpdates[index][4] = true
--print("neg z")
end
-- pos z
if self.changes[i][3] == ChunkSize then
sliceUpdates[index][5] = true
--print("pos z")
end
end
end
-- update slices that were flagged in previous step
for i=1, WorldHeight/SliceHeight do
if sliceUpdates[i][1] then
self.slices[i]:updateModel()
if sliceUpdates[i][2] then
local chunk = GetChunkRaw(self.x-1,self.z)
if chunk ~= nil then
chunk.slices[i]:updateModel()
end
end
if sliceUpdates[i][3] then
local chunk = GetChunkRaw(self.x+1,self.z)
if chunk ~= nil then
chunk.slices[i]:updateModel()
end
end
if sliceUpdates[i][4] or sliceUpdates[i][5] then
local chunk = GetChunkRaw(self.x,self.z-1)
if chunk ~= nil then
chunk.slices[i]:updateModel()
end
end
if sliceUpdates[i][4] or sliceUpdates[i][5] then
local chunk = GetChunkRaw(self.x,self.z+1)
if chunk ~= nil then
chunk.slices[i]:updateModel()
end
end
end
end
self.changes = {}
end
return chunk
end
function CanDrawFace(get, thisTransparency)
local tget = TileTransparency(get)
-- tget > 0 means can only draw faces from outside in (bc transparency of 0 is air)
-- must be different transparency to draw, except for tree leaves which have transparency of 1
return (tget ~= thisTransparency or tget == 1) and tget > 0
end
function NewChunkSlice(x,y,z, parent)
local t = NewThing(x,y,z)
t.parent = parent
t.name = "chunkslice"
local compmodel = Engine.newModel(nil, LightingTexture, {0,0,0})
compmodel.culling = true
t:assignModel(compmodel)
t.updateModel = function (self)
local model = {}
-- iterate through the voxels in this chunkslice's domain
-- if air block, see if any solid neighbors
-- then place faces down accordingly with proper texture and lighting value
for i=1, ChunkSize do
for j=self.y, self.y+SliceHeight-1 do
for k=1, ChunkSize do
local this, thisSunlight, thisLocalLight = self.parent:getVoxel(i,j,k)
-- local thisSunlight = thisData%16
-- local thisLocalLight = math.floor(thisData/16)
local thisLight = math.max(thisSunlight, thisLocalLight)
local thisTransparency = TileTransparency(this)
local scale = 1
local x,y,z = (self.x-1)*ChunkSize + i-1, 1*j*scale, (self.z-1)*ChunkSize + k-1
if thisTransparency < 3 then
-- if not checking for tget == 0, then it will render the "faces" of airblocks
-- on transparent block edges
-- simple plant model (flowers, mushrooms)
if TileModel(this) == 1 then
local otx,oty = NumberToCoord(TileTextures(this)[1], 16,16)
otx = otx + 16*thisLight
local otx2,oty2 = otx+1,oty+1
local tx,ty = otx*TileWidth/LightValues,oty*TileHeight
local tx2,ty2 = otx2*TileWidth/LightValues,oty2*TileHeight
local diagLong = 0.7071*scale*0.5 + 0.5
local diagShort = -0.7071*scale*0.5 + 0.5
model[#model+1] = {x+diagShort, y, z+diagShort, tx2,ty2}
model[#model+1] = {x+diagLong, y, z+diagLong, tx,ty2}
model[#model+1] = {x+diagShort, y+scale, z+diagShort, tx2,ty}
model[#model+1] = {x+diagLong, y, z+diagLong, tx,ty2}
model[#model+1] = {x+diagLong, y+scale, z+diagLong, tx,ty}
model[#model+1] = {x+diagShort, y+scale, z+diagShort, tx2,ty}
-- mirror
model[#model+1] = {x+diagLong, y, z+diagLong, tx2,ty2}
model[#model+1] = {x+diagShort, y, z+diagShort, tx,ty2}
model[#model+1] = {x+diagShort, y+scale, z+diagShort, tx,ty}
model[#model+1] = {x+diagLong, y+scale, z+diagLong, tx2,ty}
model[#model+1] = {x+diagLong, y, z+diagLong, tx2,ty2}
model[#model+1] = {x+diagShort, y+scale, z+diagShort, tx,ty}
model[#model+1] = {x+diagShort, y, z+diagLong, tx2,ty2}
model[#model+1] = {x+diagLong, y, z+diagShort, tx,ty2}
model[#model+1] = {x+diagShort, y+scale, z+diagLong, tx2,ty}
model[#model+1] = {x+diagLong, y, z+diagShort, tx,ty2}
model[#model+1] = {x+diagLong, y+scale, z+diagShort, tx,ty}
model[#model+1] = {x+diagShort, y+scale, z+diagLong, tx2,ty}
--mirror
model[#model+1] = {x+diagLong, y, z+diagShort, tx2,ty2}
model[#model+1] = {x+diagShort, y, z+diagLong, tx,ty2}
model[#model+1] = {x+diagShort, y+scale, z+diagLong, tx,ty}
model[#model+1] = {x+diagLong, y+scale, z+diagShort, tx2,ty}
model[#model+1] = {x+diagLong, y, z+diagShort, tx2,ty2}
model[#model+1] = {x+diagShort, y+scale, z+diagLong, tx,ty}
end
-- top
local get = self.parent:getVoxel(i,j-1,k)
if CanDrawFace(get, thisTransparency) then
local otx,oty = NumberToCoord(TileTextures(get)[math.min(2, #TileTextures(get))], 16,16)
otx = otx + 16*thisLight
local otx2,oty2 = otx+1,oty+1
local tx,ty = otx*TileWidth/LightValues,oty*TileHeight
local tx2,ty2 = otx2*TileWidth/LightValues,oty2*TileHeight
model[#model+1] = {x, y, z, tx,ty}
model[#model+1] = {x+scale, y, z, tx2,ty}
model[#model+1] = {x, y, z+scale, tx,ty2}
model[#model+1] = {x+scale, y, z, tx2,ty}
model[#model+1] = {x+scale, y, z+scale, tx2,ty2}
model[#model+1] = {x, y, z+scale, tx,ty2}
end
-- bottom
local get = self.parent:getVoxel(i,j+1,k)
if CanDrawFace(get, thisTransparency) then
local otx,oty = NumberToCoord(TileTextures(get)[math.min(3, #TileTextures(get))], 16,16)
otx = otx + 16*math.max(thisLight-3, 0)
local otx2,oty2 = otx+1,oty+1
local tx,ty = otx*TileWidth/LightValues,oty*TileHeight
local tx2,ty2 = otx2*TileWidth/LightValues,oty2*TileHeight
model[#model+1] = {x+scale, y+scale, z, tx2,ty}
model[#model+1] = {x, y+scale, z, tx,ty}
model[#model+1] = {x, y+scale, z+scale, tx,ty2}
model[#model+1] = {x+scale, y+scale, z+scale, tx2,ty2}
model[#model+1] = {x+scale, y+scale, z, tx2,ty}
model[#model+1] = {x, y+scale, z+scale, tx,ty2}
end
-- positive x
local get = self.parent:getVoxel(i-1,j,k)
if i == 1 then
local chunkGet = GetChunk(x-1,y,z)
if chunkGet ~= nil then
get = chunkGet:getVoxel(ChunkSize,j,k)
end
end
if CanDrawFace(get, thisTransparency) then
local otx,oty = NumberToCoord(TileTextures(get)[1], 16,16)
otx = otx + 16*math.max(thisLight-2, 0)
local otx2,oty2 = otx+1,oty+1
local tx,ty = otx*TileWidth/LightValues,oty*TileHeight
local tx2,ty2 = otx2*TileWidth/LightValues,oty2*TileHeight
model[#model+1] = {x, y+scale, z, tx2,ty}
model[#model+1] = {x, y, z, tx2,ty2}
model[#model+1] = {x, y, z+scale, tx,ty2}
model[#model+1] = {x, y+scale, z+scale, tx,ty}
model[#model+1] = {x, y+scale, z, tx2,ty}
model[#model+1] = {x, y, z+scale, tx,ty2}
end
-- negative x
local get = self.parent:getVoxel(i+1,j,k)
if i == ChunkSize then
local chunkGet = GetChunk(x+1,y,z)
if chunkGet ~= nil then
get = chunkGet:getVoxel(1,j,k)
end
end
if CanDrawFace(get, thisTransparency) then
local otx,oty = NumberToCoord(TileTextures(get)[1], 16,16)
otx = otx + 16*math.max(thisLight-2, 0)
local otx2,oty2 = otx+1,oty+1
local tx,ty = otx*TileWidth/LightValues,oty*TileHeight
local tx2,ty2 = otx2*TileWidth/LightValues,oty2*TileHeight
model[#model+1] = {x+scale, y, z, tx,ty2}
model[#model+1] = {x+scale, y+scale, z, tx,ty}
model[#model+1] = {x+scale, y, z+scale, tx2,ty2}
model[#model+1] = {x+scale, y+scale, z, tx,ty}
model[#model+1] = {x+scale, y+scale, z+scale, tx2,ty}
model[#model+1] = {x+scale, y, z+scale, tx2,ty2}
end
-- positive z
local get = self.parent:getVoxel(i,j,k-1)
if k == 1 then
local chunkGet = GetChunk(x,y,z-1)
if chunkGet ~= nil then
get = chunkGet:getVoxel(i,j,ChunkSize)
end
end
if CanDrawFace(get, thisTransparency) then
local otx,oty = NumberToCoord(TileTextures(get)[1], 16,16)
otx = otx + 16*math.max(thisLight-1, 0)
local otx2,oty2 = otx+1,oty+1
local tx,ty = otx*TileWidth/LightValues,oty*TileHeight
local tx2,ty2 = otx2*TileWidth/LightValues,oty2*TileHeight
model[#model+1] = {x, y, z, tx,ty2}
model[#model+1] = {x, y+scale, z, tx,ty}
model[#model+1] = {x+scale, y, z, tx2,ty2}
model[#model+1] = {x, y+scale, z, tx,ty}
model[#model+1] = {x+scale, y+scale, z, tx2,ty}
model[#model+1] = {x+scale, y, z, tx2,ty2}
end
-- negative z
local get = self.parent:getVoxel(i,j,k+1)
if k == ChunkSize then
local chunkGet = GetChunk(x,y,z+1)
if chunkGet ~= nil then
get = chunkGet:getVoxel(i,j,1)
end
end
if CanDrawFace(get, thisTransparency) then
local otx,oty = NumberToCoord(TileTextures(get)[1], 16,16)
otx = otx + 16*math.max(thisLight-1, 0)
local otx2,oty2 = otx+1,oty+1
local tx,ty = otx*TileWidth/LightValues,oty*TileHeight
local tx2,ty2 = otx2*TileWidth/LightValues,oty2*TileHeight
model[#model+1] = {x, y+scale, z+scale, tx2,ty}
model[#model+1] = {x, y, z+scale, tx2,ty2}
model[#model+1] = {x+scale, y, z+scale, tx,ty2}
model[#model+1] = {x+scale, y+scale, z+scale, tx,ty}
model[#model+1] = {x, y+scale, z+scale, tx2,ty}
model[#model+1] = {x+scale, y, z+scale, tx,ty2}
end
end
end
end
end
self.model:setVerts(model)
end
t:updateModel()
return t
end
-- used for building structures across chunk borders
-- by requesting a block to be built in a chunk that does not yet exist
function NewChunkRequest(gx,gy,gz, valueg)
-- assume structures can only cross one chunk
local lx,ly,lz = Localize(gx,gy,gz)
local chunk = GetChunk(gx,gy,gz)
if chunk ~= nil then
chunk.requests[#chunk.requests+1] = {x = lx, y = ly, z = lz, value = valueg}
end
end
|
fx_version 'bodacious'
games 'gta5'
client_script 'client.lua'
files {
"hud.html"
}
ui_page "hud.html"
|
require("animation/animBase");
require("particle/particleBubble");
local loading_pin_map = require("qnFiles/qnPlist/hall/loading_pin");
AnimUpdateProgress = class(AnimBase);
AnimUpdateProgress.lightImageIndex = 0;
AnimUpdateProgress.lightFiles = {
loading_pin_map["light1.png"],
loading_pin_map["light2.png"],
}
local stencilMask = require("libEffect/shaders/stencilMask");
AnimUpdateProgress.load = function()
if not AnimUpdateProgress.root then
AnimUpdateProgress.root = new(Node);
local progressBg = new(Image, loading_pin_map["loadingBg.png"]);
AnimUpdateProgress.root:addChild(progressBg);
AnimUpdateProgress.root:setSize( progressBg:getSize() );
AnimUpdateProgress.root:addToRoot();
AnimUpdateProgress.root:setAlign(kAlignCenter);
AnimUpdateProgress.progressMask = new(Image, loading_pin_map["loadingProgress.png"])
AnimUpdateProgress.progress = new(Image, loading_pin_map["loadingProgress.png"])
stencilMask.applyToDrawing(AnimUpdateProgress.root,AnimUpdateProgress.progress, AnimUpdateProgress.progressMask, 0.1);
AnimUpdateProgress.lightImages = new(Images, AnimUpdateProgress.lightFiles);
AnimUpdateProgress.progress:addChild(AnimUpdateProgress.lightImages);
AnimUpdateProgress.lightImages:setAlign(kAlignRight);
AnimUpdateProgress.lightImages:setPos(nil, -5);
end
end
AnimUpdateProgress.play = function(progress)
progress = progress or 0
AnimUpdateProgress.load();
if not AnimUpdateProgress.lightAnim then
AnimUpdateProgress.startLightAnim();
end
AnimUpdateProgress.__updateProgress(progress);
return AnimUpdateProgress.root;
end
AnimUpdateProgress.__updateProgress = function(progress)
local w, h = AnimUpdateProgress.root:getSize();
local offset = -w + w*progress+45;
if offset > 0 then
offset = 0;
end
AnimUpdateProgress.progress:setPos(offset);
end
AnimUpdateProgress.startLightAnim = function()
AnimUpdateProgress.stopLightAnim();
AnimUpdateProgress.lightAnim = new(AnimInt, kAnimRepeat, 0, 1, 200, -1);
AnimUpdateProgress.lightAnim:setDebugName("AnimUpdateProgress.lightAnim");
AnimUpdateProgress.lightAnim:setEvent(nil, AnimUpdateProgress.onLightAnimTimer);
end
AnimUpdateProgress.onLightAnimTimer = function()
AnimUpdateProgress.lightImageIndex = (AnimUpdateProgress.lightImageIndex+1)% (#AnimUpdateProgress.lightFiles);
AnimUpdateProgress.lightImages:setImageIndex(AnimUpdateProgress.lightImageIndex);
end
AnimUpdateProgress.stopLightAnim = function()
delete(AnimUpdateProgress.lightAnim);
AnimUpdateProgress.lightAnim = nil;
end
AnimUpdateProgress.stop = function()
AnimUpdateProgress.stopLightAnim();
end
AnimUpdateProgress.release = function()
AnimUpdateProgress.stop();
if AnimUpdateProgress.root then
local parent = AnimUpdateProgress.root:getParent();
if parent then
parent:removeChild(AnimUpdateProgress.root);
end
stencilMask.removeStencilEffect(AnimUpdateProgress.root, true)
delete(AnimUpdateProgress.root);
AnimUpdateProgress.root = nil;
end
end
|
--[[
This file was extracted by 'EsoLuaGenerator' at '2021-09-04 16:42:29' using the latest game version.
NOTE: This file should only be used as IDE support; it should NOT be distributed with addons!
****************************************************************************
CONTENTS OF THIS FILE IS COPYRIGHT ZENIMAX MEDIA INC.
****************************************************************************
]]
local ZO_GamepadKeybindStripFragment = ZO_TranslateFromBottomSceneFragment:Subclass()
function ZO_GamepadKeybindStripFragment:New(...)
return ZO_TranslateFromBottomSceneFragment.New(self, ...)
end
function ZO_GamepadKeybindStripFragment:Show()
KEYBIND_STRIP:SetStyle(KEYBIND_STRIP_GAMEPAD_STYLE)
ZO_TranslateFromBottomSceneFragment.Show(self)
end
function ZO_GamepadKeybindStripFragment:Hide()
ZO_TranslateFromBottomSceneFragment.Hide(self)
end
KEYBIND_STRIP_GAMEPAD_FRAGMENT = ZO_GamepadKeybindStripFragment:New(ZO_KeybindStripControl)
KEYBIND_STRIP_GAMEPAD_BACKDROP_FRAGMENT = ZO_FadeSceneFragment:New(ZO_KeybindStripGamepadBackground)
|
local Data = require "nvim-lsp-installer.data"
local process = require "nvim-lsp-installer.process"
local path = require "nvim-lsp-installer.path"
local Result = require "nvim-lsp-installer.core.result"
local spawn = require "nvim-lsp-installer.core.spawn"
local Optional = require "nvim-lsp-installer.core.optional"
local installer = require "nvim-lsp-installer.core.installer"
local list_copy, list_find_first = Data.list_copy, Data.list_find_first
local M = {}
---@param packages string[]
local function with_receipt(packages)
return function()
local ctx = installer.context()
ctx.receipt:with_primary_source(ctx.receipt.gem(packages[1]))
for i = 2, #packages do
ctx.receipt:with_secondary_source(ctx.receipt.gem(packages[i]))
end
end
end
---@async
---@param packages string[] @The Gem packages to install. The first item in this list will be the recipient of the server version, should the user request a specific one.
function M.packages(packages)
return function()
return M.install(packages).with_receipt()
end
end
---@async
---@param packages string[] @The Gem packages to install. The first item in this list will be the recipient of the server version, should the user request a specific one.
function M.install(packages)
local ctx = installer.context()
local pkgs = list_copy(packages or {})
ctx.requested_version:if_present(function(version)
pkgs[1] = ("%s:%s"):format(pkgs[1], version)
end)
ctx.spawn.gem {
"install",
"--no-user-install",
"--install-dir=.",
"--bindir=bin",
"--no-document",
pkgs,
}
return {
with_receipt = with_receipt(packages),
}
end
---@alias GemOutdatedPackage {name:string, current_version: string, latest_version: string}
---Parses a string input like "package (0.1.0 < 0.2.0)" into its components
---@param outdated_gem string
---@return GemOutdatedPackage
function M.parse_outdated_gem(outdated_gem)
local package_name, version_expression = outdated_gem:match "^(.+) %((.+)%)"
if not package_name or not version_expression then
-- unparseable
return nil
end
local current_version, latest_version = unpack(vim.split(version_expression, "<"))
---@type GemOutdatedPackage
local outdated_package = {
name = vim.trim(package_name),
current_version = vim.trim(current_version),
latest_version = vim.trim(latest_version),
}
return outdated_package
end
---Parses the stdout of the `gem list` command into a table<package_name, version>
---@param output string
function M.parse_gem_list_output(output)
---@type table<string, string>
local gem_versions = {}
for _, line in ipairs(vim.split(output, "\n")) do
local gem_package, version = line:match "^(%S+) %((%S+)%)$"
if gem_package and version then
gem_versions[gem_package] = version
end
end
return gem_versions
end
local function not_empty(s)
return s ~= nil and s ~= ""
end
---@async
---@param receipt InstallReceipt
---@param install_dir string
function M.check_outdated_primary_package(receipt, install_dir)
if receipt.primary_source.type ~= "gem" then
return Result.failure "Receipt does not have a primary source of type gem"
end
return spawn.gem({ "outdated", cwd = install_dir, env = process.graft_env(M.env(install_dir)) }):map_catching(
function(result)
---@type string[]
local lines = vim.split(result.stdout, "\n")
local outdated_gems = vim.tbl_map(M.parse_outdated_gem, vim.tbl_filter(not_empty, lines))
local outdated_gem = list_find_first(outdated_gems, function(gem)
return gem.name == receipt.primary_source.package and gem.current_version ~= gem.latest_version
end)
return Optional.of_nilable(outdated_gem)
:map(function(gem)
return {
name = receipt.primary_source.package,
current_version = assert(gem.current_version),
latest_version = assert(gem.latest_version),
}
end)
:or_else_throw "Primary package is not outdated."
end
)
end
---@async
---@param receipt InstallReceipt
---@param install_dir string
function M.get_installed_primary_package_version(receipt, install_dir)
return spawn.gem({
"list",
cwd = install_dir,
env = process.graft_env(M.env(install_dir)),
}):map_catching(function(result)
local gems = M.parse_gem_list_output(result.stdout)
return Optional.of_nilable(gems[receipt.primary_source.package]):or_else_throw "Failed to find gem package version."
end)
end
---@param install_dir string
function M.env(install_dir)
return {
GEM_HOME = install_dir,
GEM_PATH = install_dir,
PATH = process.extend_path { path.concat { install_dir, "bin" } },
}
end
return M
|
slot2 = "ClientUpdaterModel"
ClientUpdaterModel = class(slot1)
slot2 = "clientupdater.mvc.model.ClientUpdaterVersionVo"
require(slot1)
ClientUpdaterModel.ctor = function (slot0)
slot7 = cc.UserDefault
slot7 = true
createSetterGetter(slot2, slot0, "so", cc.UserDefault.getInstance(slot6), false)
slot5 = nil
createSetterGetter(slot2, slot0, "finishCallback")
slot6 = true
createSetterGetter(slot2, slot0, "loadingTxt", "")
slot5 = "scripts"
createSetterGetter(slot2, slot0, "scriptsFileName")
slot5 = nil
createSetterGetter(slot2, slot0, "myVersionConfigs")
slot5 = nil
createSetterGetter(slot2, slot0, "newVersionConfigs")
slot5 = nil
createSetterGetter(slot2, slot0, "myZipVersionConfigs")
slot5 = nil
createSetterGetter(slot2, slot0, "newZipVersionConfigs")
slot5 = nil
createSetterGetter(slot2, slot0, "versionConfigs2DownLoad")
slot5 = nil
createSetterGetter(slot2, slot0, "versionConfigs2Delete")
slot5 = nil
createSetterGetter(slot2, slot0, "curUpdateVersionVo")
slot5 = 0
createSetterGetter(slot2, slot0, "downloadTotalSize")
slot9 = true
createSetterGetter(slot2, slot0, "curDownloadSize", 0, true, false, false)
slot6 = true
createSetterGetter(slot2, slot0, "curShowLoadingPercent", 0)
slot9 = true
createSetterGetter(slot2, slot0, "curDownLoadIndex", 1, false, false, false)
slot6 = true
createSetterGetter(slot2, slot0, "popupMsgVo", nil)
slot0.curFileDownloadSize = 0
slot0.curDownloadedFileSize = 0
slot0.remoteRootUrl = nil
slot0.localUpdateRootUrl = nil
slot0.localVersionFileInUpdateUrl = nil
slot0.versionFileRelativePath = "res/gameres/config/version.csv"
if isCQ then
slot4 = slot0.versionFileRelativePath
slot0.versionFileRelativePath = "src/" .. cookWSJMPath(slot3)
end
slot0.gameZipFileName = "game.zip"
slot0.localUpdateGameZipUrl = nil
slot0.updateScene = nil
end
ClientUpdaterModel.getFileDownloadUrl = function (slot0, slot1)
slot6 = slot0.remoteRootUrl .. "/res"
slot11 = slot0
slot7 = slot0.remoteRootUrl .. "/" .. slot0.getScriptsFileName(slot10)
return string.gsub(slot1.path, string.gsub(slot3, slot1.path, "%$res%$"), "%$scripts%$")
end
ClientUpdaterModel.getFileSaveUrl = function (slot0, slot1)
slot6 = slot0.localUpdateRootUrl .. "/res"
slot11 = slot0
slot7 = slot0.localUpdateRootUrl .. "/" .. slot0.getScriptsFileName(slot10)
return string.gsub(slot1.path, string.gsub(slot3, slot1.path, "%$res%$"), "%$scripts%$")
end
ClientUpdaterModel.destroy = function (slot0)
slot3 = slot0
SignalAs3.clearAllSignal(slot2)
slot0._finishCallback = nil
slot0._so = nil
slot0._loadingTxt = nil
slot0._myVersionConfigs = nil
slot0._newVersionConfigs = nil
slot0._versionConfigs2DownLoad = nil
slot0._versionConfigs2Delete = nil
slot0._curUpdateVersionVo = nil
slot0._downloadTotalSize = nil
slot0.remoteRootUrl = nil
slot0.localUpdateRootUrl = nil
slot0.localVersionFileInUpdateUrl = nil
slot0.gameZipFileName = nil
slot0.localUpdateGameZipUrl = nil
end
return
|
project "qcpu-tetris"
kind "ConsoleApp"
language "C"
objdir("%{wks.location}/bin-int/" .. outputDir .. "/%{prj.name}")
targetdir("%{wks.location}/bin/" .. outputDir .. "/%{prj.name}")
defines
{
}
includedirs
{
"%{includePath.qcpu-emu}"
}
files
{
"src/**.c"
}
links
{
"QCPUEmu"
}
|
local music = nil;
local ambientMusic = "";
local isAmbient = false;
local subwayCars = {};
local airlocks = {};
local doors = {};
local timers = {};
local levers = {};
local timersDone = false;
function startMusic(name, crossfade)
local newMusic = audio:createStream(name);
newMusic.loop = true;
newMusic.isMusic = true;
if crossfade then
audio:crossfade(music, newMusic, 0.5, 0.5, 0.3);
else
if music ~= nil then
music:stop();
end
newMusic:play();
end
music = newMusic;
isAmbient = false;
end
function stopMusic(crossfade)
if music ~= nil then
if crossfade then
audio:crossfade(music, nil, 0.5, 0.5, 0.3);
else
music:stop();
end
end
music = nil;
end
function setAmbientMusic(name)
if ambientMusic ~= name then
ambientMusic = name;
isAmbient = false;
end
end
function startAmbientMusic(crossfade)
if not isAmbient then
startMusic(ambientMusic, crossfade);
isAmbient = true;
end
end
function makePlatform(platform, parts, enterFn, leaveFn, ...)
platform.deadbodyAware = true;
local function enterFunc(other, args)
if platform.objs[other.cookie] == nil then
other.activeDeadbody = true;
platform.objs[other.cookie] = { count = 1, obj = other };
if table.size(platform.objs) == 1 then
platform.lastPos = platform.pos;
platform.lastAngle = platform.angle;
platform.timer = addTimeout0(function(cookie, dt)
local pa = platform.angle;
local pp = platform.pos;
local a = pa - platform.lastAngle;
for _, v in pairs(platform.objs) do
v.obj:setPosSmoothed(pp + (v.obj.pos - platform.lastPos):rotated(a));
v.obj:setAngleSmoothed(v.obj.angle + a);
end
platform.lastPos = pp;
platform.lastAngle = pa;
end);
end
if enterFn ~= nil then
enterFn(other, unpack2(args));
end
else
platform.objs[other.cookie].count = platform.objs[other.cookie].count + 1;
end
end;
local c = CollisionSensorComponent();
platform:addComponent(c);
platform.objs = {};
platform.timer = nil;
if parts ~= nil then
for _, p in pairs(parts) do
enterFunc(p);
end
end
c.listener = createSensorListener(enterFunc, function(other, args)
platform.objs[other.cookie].count = platform.objs[other.cookie].count - 1;
if platform.objs[other.cookie].count == 0 then
platform.objs[other.cookie] = nil;
other.activeDeadbody = false;
if table.size(platform.objs) == 0 then
cancelTimeout(platform.timer);
platform.timer = nil;
end
if leaveFn ~= nil then
leaveFn(other, unpack2(args));
end
end
end, pack2(...));
end
function disablePlatform(platform)
platform:findCollisionSensorComponent():removeFromParent();
if platform.timer ~= nil then
cancelTimeout(platform.timer);
end
platform.objs = nil;
end
function makeSubwayCar(inst, pathName, enterFn, leaveFn, ...)
inst.myCar = findObject(inst.objects, "subway_car");
inst.myMover = findObject(inst.objects, "subway_car_mover");
local p = scene:getObjects(pathName)[1];
inst.myMover.roamBehavior:reset();
inst.myMover.roamBehavior.linearVelocity = 60.0;
inst.myMover.roamBehavior.linearDamping = 3.0;
inst.myMover.roamBehavior.loop = true;
inst.myMover.roamBehavior:changePath(p:findPathComponent().path, p:getTransform());
subwayCars[inst.myCar.cookie] = inst;
makePlatform(inst.myCar, nil, enterFn, leaveFn, ...);
end
function startSubwayCar(inst)
inst.myMover.roamBehavior:start();
end
function stopSubwayCar(inst)
inst.myMover.roamBehavior:reset();
inst.myMover.linearVelocity = vec2(0, 0);
inst.myMover.angularVelocity = 0;
inst.myCar.sleepingAllowed = true;
end
function makeSubwayStop(sensorName, timeout, enterFn, leaveFn, ...)
setSensorListener(sensorName, function(other, objs, args)
if objs[other.cookie] == nil then
objs[other.cookie] = { count = 1, obj = other };
if other.name == "subway_car" then
local inst = subwayCars[other.cookie];
local mover = inst.myMover;
mover.roamBehavior:damp();
if enterFn ~= nil then
enterFn(inst, unpack2(args));
end
addTimeoutOnce(timeout, function()
if leaveFn ~= nil then
leaveFn(inst, unpack2(args));
end
mover.roamBehavior.dampDistance = 0;
mover.roamBehavior.linearDamping = 1.5;
addTimeoutOnce(3.0, function()
mover.roamBehavior.linearDamping = 3.0;
end);
end);
end
else
objs[other.cookie].count = objs[other.cookie].count + 1;
end
end, function (other, objs, args)
objs[other.cookie].count = objs[other.cookie].count - 1;
if objs[other.cookie].count == 0 then
objs[other.cookie] = nil;
end
end, {}, pack2(...));
end
function openSubwayCarDoor(inst)
if inst.door ~= nil then
cancelTimeout(inst.door.cookie);
inst.door = nil;
end
local j = findJoint(inst.joints, "subway_car_door_joint");
if j:getJointTranslation() >= j.upperLimit then
j.motorSpeed = math.abs(j.motorSpeed);
return;
end
inst.door = {};
j.motorSpeed = math.abs(j.motorSpeed);
inst.door.cookie = addTimeout0(function(cookie, dt)
if (j:getJointTranslation() >= j.upperLimit) then
cancelTimeout(cookie);
inst.door = nil;
end
end);
end
function closeSubwayCarDoor(inst)
if inst.door ~= nil then
cancelTimeout(inst.door.cookie);
inst.door = nil;
end
local j = findJoint(inst.joints, "subway_car_door_joint");
if j:getJointTranslation() <= j.lowerLimit then
j.motorSpeed = -math.abs(j.motorSpeed);
return;
end
inst.door = {};
j.motorSpeed = -math.abs(j.motorSpeed);
inst.door.cookie = addTimeout0(function(cookie, dt)
if (j:getJointTranslation() <= j.lowerLimit) then
cancelTimeout(cookie);
inst.door = nil;
end
end);
end
function openAirlock(name, haveSound)
local snd = nil;
local wheel = true;
if airlocks[name] ~= nil then
snd = airlocks[name].snd;
wheel = airlocks[name].wheel;
cancelTimeout(airlocks[name].cookie);
airlocks[name] = nil;
end
local inst = scene:getInstances(name)[1];
local j = findJoint(inst.joints, "airlock_door1_joint");
local wj = findJoint(inst.joints, "airlock_wheel_joint");
if ((j:getJointTranslation() >= j.upperLimit) and (wj.jointAngle >= wj.upperLimit)) then
if snd ~= nil then
snd:stop();
end
j.motorSpeed = math.abs(j.motorSpeed);
wj.motorSpeed = math.abs(wj.motorSpeed);
return;
end
airlocks[name] = {};
if (snd == nil) and haveSound then
airlocks[name].snd = audio:createSound("door_move.ogg");
airlocks[name].snd.loop = true;
airlocks[name].snd:play();
else
airlocks[name].snd = snd;
end
airlocks[name].wheel = wheel;
wj.motorSpeed = math.abs(wj.motorSpeed);
if (not wheel) then
j.motorSpeed = math.abs(j.motorSpeed);
airlocks[name].cookie = addTimeout0(function(cookie, dt)
if (j:getJointTranslation() >= j.upperLimit) then
cancelTimeout(cookie);
if haveSound then
airlocks[name].snd:stop();
end
airlocks[name] = nil;
end
end);
else
airlocks[name].cookie = addTimeout0(function(cookie, dt)
if (wj.jointAngle >= wj.upperLimit) then
if haveSound then
airlocks[name].snd:stop();
airlocks[name].snd = audio:createSound("servo_move.ogg");
airlocks[name].snd.loop = true;
airlocks[name].snd:play();
end
airlocks[name].wheel = false;
cancelTimeout(cookie);
j.motorSpeed = math.abs(j.motorSpeed);
airlocks[name].cookie = addTimeout0(function(cookie, dt)
if (j:getJointTranslation() >= j.upperLimit) then
cancelTimeout(cookie);
if haveSound then
airlocks[name].snd:stop();
end
airlocks[name] = nil;
end
end);
end
end);
end
end
function closeAirlock(name, haveSound)
local snd = nil;
local wheel = false;
if airlocks[name] ~= nil then
snd = airlocks[name].snd;
wheel = airlocks[name].wheel;
cancelTimeout(airlocks[name].cookie);
airlocks[name] = nil;
end
local inst = scene:getInstances(name)[1];
local j = findJoint(inst.joints, "airlock_door1_joint");
local wj = findJoint(inst.joints, "airlock_wheel_joint");
if ((j:getJointTranslation() <= j.lowerLimit) and (wj.jointAngle <= wj.lowerLimit)) then
if snd ~= nil then
snd:stop();
end
j.motorSpeed = -math.abs(j.motorSpeed);
wj.motorSpeed = -math.abs(wj.motorSpeed);
return;
end
airlocks[name] = {};
if (snd == nil) and haveSound then
airlocks[name].snd = audio:createSound("servo_move.ogg");
airlocks[name].snd.loop = true;
airlocks[name].snd:play();
else
airlocks[name].snd = snd;
end
airlocks[name].wheel = wheel;
j.motorSpeed = -math.abs(j.motorSpeed);
if (wheel) then
wj.motorSpeed = -math.abs(wj.motorSpeed);
airlocks[name].cookie = addTimeout0(function(cookie, dt)
if (wj.jointAngle <= wj.lowerLimit) then
cancelTimeout(cookie);
if haveSound then
airlocks[name].snd:stop();
end
airlocks[name] = nil;
end
end);
else
airlocks[name].cookie = addTimeout0(function(cookie, dt)
if (j:getJointTranslation() <= j.lowerLimit) then
if haveSound then
airlocks[name].snd:stop();
airlocks[name].snd = audio:createSound("door_move.ogg");
airlocks[name].snd.loop = true;
airlocks[name].snd:play();
end
airlocks[name].wheel = true;
cancelTimeout(cookie);
wj.motorSpeed = -math.abs(wj.motorSpeed);
airlocks[name].cookie = addTimeout0(function(cookie, dt)
if (wj.jointAngle <= wj.lowerLimit) then
cancelTimeout(cookie);
if haveSound then
airlocks[name].snd:stop();
end
airlocks[name] = nil;
end
end);
end
end);
end
end
function makeAirlock(name, opened)
local inst = scene:getInstances(name)[1];
scene:addGearJoint(findObject(inst.objects, "airlock_door1"),
findObject(inst.objects, "airlock_door2"),
findJoint(inst.joints, "airlock_door1_joint"),
findJoint(inst.joints, "airlock_door2_joint"),
-1, false);
if opened then
openAirlock(name, false);
end
end
function makeAirlockTrigger(sensorName, name)
setSensorListener(sensorName, function(other, self)
if self.num == 0 then
openAirlock(name, true);
end
self.num = self.num + 1;
end, function (other, self)
self.num = self.num - 1;
if self.num == 0 then
closeAirlock(name, true);
end
end, { num = 0 });
end
function openDoor(name, haveSound)
local snd = nil;
if doors[name] ~= nil then
snd = doors[name].snd;
cancelTimeout(doors[name].cookie);
doors[name] = nil;
end
local inst = scene:getInstances(name)[1];
local j = findJoint(inst.joints, "door1_left_joint");
if j:getJointTranslation() >= j.upperLimit then
if snd ~= nil then
snd:stop();
end
j.motorSpeed = math.abs(j.motorSpeed);
return;
end
doors[name] = {};
if (snd == nil) and haveSound then
doors[name].snd = audio:createSound("servo_move.ogg");
doors[name].snd.loop = true;
doors[name].snd:play();
else
doors[name].snd = snd;
end
j.motorSpeed = math.abs(j.motorSpeed);
doors[name].cookie = addTimeout0(function(cookie, dt)
if (j:getJointTranslation() >= j.upperLimit) then
cancelTimeout(cookie);
if haveSound then
doors[name].snd:stop();
end
doors[name] = nil;
end
end);
end
function closeDoor(name, haveSound)
local snd = nil;
if doors[name] ~= nil then
snd = doors[name].snd;
cancelTimeout(doors[name].cookie);
doors[name] = nil;
end
local inst = scene:getInstances(name)[1];
local j = findJoint(inst.joints, "door1_left_joint");
if j:getJointTranslation() <= j.lowerLimit then
if snd ~= nil then
snd:stop();
end
j.motorSpeed = -math.abs(j.motorSpeed);
return;
end
doors[name] = {};
if (snd == nil) and haveSound then
doors[name].snd = audio:createSound("servo_move.ogg");
doors[name].snd.loop = true;
doors[name].snd:play();
else
doors[name].snd = snd;
end
j.motorSpeed = -math.abs(j.motorSpeed);
doors[name].cookie = addTimeout0(function(cookie, dt)
if (j:getJointTranslation() <= j.lowerLimit) then
cancelTimeout(cookie);
if haveSound then
doors[name].snd:stop();
end
doors[name] = nil;
end
end);
end
function makeDoor(name, opened)
local inst = scene:getInstances(name)[1];
scene:addGearJoint(findObject(inst.objects, "door1_left"),
findObject(inst.objects, "door1_right"),
findJoint(inst.joints, "door1_left_joint"),
findJoint(inst.joints, "door1_right_joint"),
-1, false);
if opened then
openDoor(name, false);
end
end
function makeDoorTrigger(sensorName, name)
setSensorListener(sensorName, function(other, self)
if self.num == 0 then
openDoor(name, true);
end
self.num = self.num + 1;
end, function (other, self)
self.num = self.num - 1;
if self.num == 0 then
closeDoor(name, true);
end
end, { num = 0 });
end
function makeStairs(name, downFn, upFn, ...)
local stairsDown = scene:getObjects(name.."_down")[1];
local stairsUp = scene:getObjects(name.."_up")[1];
local curObj = nil;
local args = pack2(...);
setSensorEnterListener(stairsDown.name, false, function(other)
if curObj ~= nil then
return;
end
curObj = other;
stainedGlass({0, 0, 0, 0}, {0, 0, 0, 1}, const.EaseLinear, 0.5, function()
if curObj:alive() then
curObj:findPlayerComponent().weapon:cancel();
curObj:findPlayerComponent().altWeapon:cancel();
curObj.pos = stairsUp.pos;
scene.respawnPoint = stairsUp:getTransform();
if upFn ~= nil then
upFn(unpack2(args));
end
end
stainedGlass({0, 0, 0, 1}, {0, 0, 0, 0}, const.EaseLinear, 0.5, function()
if curObj:alive() then
curObj.active = false;
curObj.active = true;
end
curObj = nil;
end);
end);
end);
setSensorEnterListener(stairsUp.name, false, function(other)
if curObj ~= nil then
return;
end
curObj = other;
stainedGlass({0, 0, 0, 0}, {0, 0, 0, 1}, const.EaseLinear, 0.5, function()
if curObj:alive() then
curObj:findPlayerComponent().weapon:cancel();
curObj:findPlayerComponent().altWeapon:cancel();
curObj.pos = stairsDown.pos;
scene.respawnPoint = stairsDown:getTransform();
if downFn ~= nil then
downFn(unpack2(args));
end
end
stainedGlass({0, 0, 0, 1}, {0, 0, 0, 0}, const.EaseLinear, 0.5, function()
if curObj:alive() then
curObj.active = false;
curObj.active = true;
end
curObj = nil;
end);
end);
end);
end
function fixedSpawn(name)
local spawn = scene:getObjects(name.."_warder");
for _, obj in pairs(spawn) do
addSpawnedEnemyFreezable(factory:createWarder(), obj);
end
local spawn = scene:getObjects(name.."_enforcer1");
for _, obj in pairs(spawn) do
addSpawnedEnemyFreezable(factory:createEnforcer1(), obj);
end
local spawn = scene:getObjects(name.."_enforcer2");
for _, obj in pairs(spawn) do
addSpawnedEnemyFreezable(factory:createEnforcer2(), obj);
end
local spawn = scene:getObjects(name.."_orbo");
for _, obj in pairs(spawn) do
addSpawnedEnemyFreezable(factory:createOrbo(), obj);
end
local spawn = scene:getObjects(name.."_beetle1");
for _, obj in pairs(spawn) do
addSpawnedEnemyFreezable(factory:createBeetle1(false, false), obj);
end
local spawn = scene:getObjects(name.."_beetle1_shoot");
for _, obj in pairs(spawn) do
addSpawnedEnemyFreezable(factory:createBeetle1(true, false), obj);
end
local spawn = scene:getObjects(name.."_beetle1_split");
for _, obj in pairs(spawn) do
addSpawnedEnemyFreezable(factory:createBeetle1(false, true), obj);
end
local spawn = scene:getObjects(name.."_scorp2");
for _, obj in pairs(spawn) do
addSpawnedEnemyFreezable(factory:createScorp2(), obj);
end
local spawn = scene:getObjects(name.."_centipede1");
for _, obj in pairs(spawn) do
addSpawnedEnemyFreezable(factory:createCentipede1(), obj);
end
local spawn = scene:getObjects(name.."_homer");
for _, obj in pairs(spawn) do
addSpawnedEnemyFreezable(factory:createHomer(), obj);
end
local spawn = scene:getObjects(name.."_gorger1");
for _, obj in pairs(spawn) do
addSpawnedEnemyFreezable(factory:createGorger1(), obj);
end
local spawn = scene:getObjects(name.."_s_warder");
local summonSound = true;
for i = 1, #spawn, 1 do
summon1(spawn[i], summonSound, function()
addSpawnedEnemyFreezable(factory:createWarder(), spawn[i]);
end);
summonSound = false;
end
local spawn = scene:getObjects(name.."_s_gorger1");
for i = 1, #spawn, 1 do
summon2(spawn[i], summonSound, function()
addSpawnedEnemyFreezable(factory:createGorger1(), spawn[i]);
end);
summonSound = false;
end
local spawn = scene:getObjects(name.."_s_orbo");
for i = 1, #spawn, 1 do
summon1(spawn[i], summonSound, function()
addSpawnedEnemyFreezable(factory:createOrbo(), spawn[i]);
end);
summonSound = false;
end
local spawn = scene:getObjects(name.."_s_homer");
for i = 1, #spawn, 1 do
summon1(spawn[i], summonSound, function()
addSpawnedEnemyFreezable(factory:createHomer(), spawn[i]);
end);
summonSound = false;
end
end
function openHatch(name)
local inst = scene:getInstances(name)[1];
local j = findJoint(inst.joints, "hatch1_joint");
j.motorSpeed = math.abs(j.motorSpeed);
end
function closeHatch(name)
local inst = scene:getInstances(name)[1];
local j = findJoint(inst.joints, "hatch1_joint");
j.motorSpeed = -math.abs(j.motorSpeed);
end
function makePod(inst, pathName, angleOffset, strong, enterFn, leaveFn, ...)
inst.myPod = findObject(inst.objects, "pod");
inst.myMover = findObject(inst.objects, "pod_mover");
if strong then
findJoint(inst.joints, "pod_joint").maxForce = 11000.0;
end
local p = scene:getObjects(pathName)[1];
inst.myMover.roamBehavior:reset();
inst.myMover.roamBehavior.linearVelocity = 10.0;
inst.myMover.roamBehavior.linearDamping = 3.0;
inst.myMover.roamBehavior.angleOffset = math.rad(angleOffset);
inst.myMover.roamBehavior:changePath(p:findPathComponent().path, p:getTransform());
makePlatform(inst.myPod, nil, enterFn, leaveFn, ...);
end
function startPod(inst)
inst.myMover.roamBehavior:start();
end
function disablePod(inst)
disablePlatform(inst.myPod);
end
function makePodStop(sensorName, timeout, pods, enterFn, leaveFn, ...)
setSensorListener(sensorName, function(other, objs, args)
if objs[other.cookie] == nil then
objs[other.cookie] = { count = 1, obj = other };
if other.name == "pod" then
for _, inst in pairs(pods) do
inst.myMover.roamBehavior:damp();
end
if enterFn ~= nil then
enterFn(unpack2(args));
end
addTimeoutOnce(timeout, function()
if leaveFn ~= nil then
leaveFn(unpack2(args));
end
for _, inst in pairs(pods) do
inst.myMover.roamBehavior.dampDistance = 0;
end
end);
end
else
objs[other.cookie].count = objs[other.cookie].count + 1;
end
end, function (other, objs, args)
objs[other.cookie].count = objs[other.cookie].count - 1;
if objs[other.cookie].count == 0 then
objs[other.cookie] = nil;
end
end, {}, pack2(...));
end
function makePodUsable(inst)
inst.myHatch = findObject(inst.objects, "pod_hatch");
inst.myHatchJoint = findJoint(inst.joints, "pod_hatch_joint");
inst.myHatch.gravityGunAware = true;
local lights = inst.myHatch:findLightComponent():getLights();
for _, light in pairs(lights) do
light.visible = true;
end
inst.myBlocker = findObject(inst.objects, "pod_blocker");
inst.myBlockerJoint = findJoint(inst.joints, "pod_blocker_joint");
inst.myBlocker.active = true;
end
function makeKeyDoor(doorName, phName, fn, ...)
local doorObj = scene:getObjects(doorName)[1];
local phObj = scene:getObjects(phName)[1];
local phC = phObj:findPlaceholderComponent();
phC.listener = createSensorEnterListener(false, function(other, fn, args)
if not scene.player:findPlayerComponent().inventory:have(phC.item) then
return;
end
scene.player:findPlayerComponent().inventory:take(phC.item);
phObj:removeFromParent();
doorObj:findRenderQuadComponents("key")[1].visible = true;
audio:playSound("key.ogg");
fn(unpack2(args));
end, fn, pack2(...));
end
function makeTimer(name, amount)
timers[name] = {};
timers[name].amount = amount;
timers[name].cur = amount;
timers[name].d0 = scene:getObjects("terrain0")[1]:findRenderQuadComponents(name.."_0")[1].drawable;
timers[name].d1 = scene:getObjects("terrain0")[1]:findRenderQuadComponents(name.."_1")[1].drawable;
timers[name].d0:setImage("common1/font_"..math.floor(amount / 10)..".png");
timers[name].d1:setImage("common1/font_"..math.floor(amount % 10)..".png");
timers[name].resetFlag = false;
end
function resetTimer(name)
timers[name].cur = timers[name].amount;
timers[name].resetFlag = true;
end
function setTimer(name, amount)
timers[name].cur = amount;
timers[name].d0:setImage("common1/font_"..math.floor(amount / 10)..".png");
timers[name].d1:setImage("common1/font_"..math.floor(amount % 10)..".png");
end
function stopTimers()
timersDone = true;
end
local function leverCheck(cookie, j)
if j.jointAngle < 0 then
j.motorSpeed = -math.abs(j.motorSpeed);
if (not j.myLowered) and (j.jointAngle <= j.lowerLimit) then
if j.myLowerFn ~= nil then
j.myLowerFn(unpack2(j.myArgs));
end
j.myLowered = true;
end
elseif j.jointAngle >= 0 then
j.motorSpeed = math.abs(j.motorSpeed);
if j.myLowered and (j.jointAngle >= j.upperLimit) then
if j.myUpperFn ~= nil then
j.myUpperFn(unpack2(j.myArgs));
end
j.myLowered = false;
end
end
end;
function makeLever(name, lowered, lowerFn, upperFn, ...)
local inst = scene:getInstances(name)[1];
local obj = findObject(inst.objects, "lever");
local j = findJoint(inst.joints, "lever_joint");
if lowered then
j.motorSpeed = -math.abs(j.motorSpeed);
obj.angle = obj.angle + j.lowerLimit;
else
j.motorSpeed = math.abs(j.motorSpeed);
obj.angle = obj.angle + j.upperLimit;
end
levers[name] = j;
j.motorEnabled = true;
j.myLowered = lowered;
j.myLimit = math.abs(j.lowerLimit);
j.myLowerFn = lowerFn;
j.myUpperFn = upperFn;
j.myArgs = pack2(...);
j.myTimer = addTimeout(0.3, leverCheck, j);
end
function enableLever(name)
local j = levers[name];
if (j == nil) or (j.myTimer ~= nil) then
return;
end
j:setLimits(-j.myLimit, j.myLimit);
j.motorEnabled = true;
j.myTimer = addTimeout(0.3, leverCheck, j);
end
function disableLever(name)
local j = levers[name];
if (j == nil) or (j.myTimer == nil) then
return;
end
j:setLimits(j.jointAngle, j.jointAngle);
j.motorEnabled = false;
cancelTimeout(j.myTimer);
j.myTimer = nil;
end
function makeFlickerLamps(name)
local function flickerTimeout2(self)
if self.t <= 0 then
for _, light in pairs(self.lights) do
light.visible = self.defaultOn;
end
return;
end
for _, light in pairs(self.lights) do
light.visible = not light.visible;
end
local t = 0.005 + math.random() * 0.005;
self.t = self.t - t;
addTimeoutOnce(t, flickerTimeout2, self);
end
local function flickerTimeout(self)
self.t = 0.01 + math.random() * 0.15;
flickerTimeout2(self);
addTimeoutOnce(1.0 + math.random() * 2.0, flickerTimeout, self);
end
local insts = scene:getInstances(name);
for _, inst in pairs(insts) do
local lights = findObject(inst.objects, "lamp"):findLightComponent():getLights();
addTimeoutOnce(1.0 + math.random() * 2.0, flickerTimeout, { lights = lights, t = 0, defaultOn = lights[1].visible });
end
end
function spawnBeetleProb(name, normal, shootOnly, splitOnly, shootAndSplit, offset, percent)
local spawn = scene:getObjects(name);
local probs = {normal, shootOnly, splitOnly, shootAndSplit};
local args = {{false, false}, {true, false}, {false, true}, {true, true}};
local cargs = args[1];
local res = {};
local i = 0;
local maxNum = #spawn;
if percent ~= nil then
maxNum = maxNum * percent;
end
for _, obj in pairs(spawn) do
local val = math.random();
local prob = 0;
for i = 1, 4, 1 do
prob = prob + probs[i];
if val < prob then
cargs = args[i];
break;
end
end
local enemy = factory:createBeetle1(unpack(cargs));
enemy:findBeetleComponent().spawnPowerup = false;
enemy.freezable = obj.freezable;
enemy.freezeRadius = obj.freezeRadius;
enemy.pos = obj.pos + offset;
enemy.angle = obj.angle;
scene:addObject(enemy);
table.insert(res, enemy);
i = i + 1;
if i >= maxNum then
break;
end
end
return res;
end
-- main
addTimeout(1.0, function(cookie)
if timersDone then
cancelTimeout(cookie);
return;
end
for _, timer in pairs(timers) do
if timer.resetFlag then
timer.resetFlag = false;
else
timer.cur = timer.cur - 1;
if timer.cur < 0 then
timer.cur = 0;
end
end
timer.d0:setImage("common1/font_"..math.floor(timer.cur / 10)..".png");
timer.d1:setImage("common1/font_"..math.floor(timer.cur % 10)..".png");
end
end);
scene.player:findPlayerComponent():giveWeapon(const.WeaponTypeGG);
scene.player:findPlayerComponent():giveWeapon(const.WeaponTypeBlaster);
scene.camera:findCameraComponent():zoomTo(35, const.EaseLinear, 0);
scene.lighting.ambientLight = {0.15, 0.15, 0.15, 1.0};
math.randomseed(os.time());
scene:addObject(factory:createBackground("metal5.png", 24.0, 24.0, vec2(0.8, 0.8), const.zOrderBackground));
setAmbientMusic("ambient11.ogg");
startAmbientMusic(false);
require("e1m8_part0");
require("e1m8_part1");
require("e1m8_part2");
require("e1m8_part3");
require("e1m8_part4");
if settings.developer >= 1 then
scene.respawnPoint = scene:getObjects("player_"..settings.developer)[1]:getTransform();
scene.player:setTransform(scene.respawnPoint);
scene.player:findPlayerComponent():giveWeapon(const.WeaponTypeSuperBlaster);
openAirlock("door32", false);
end
if (settings.developer >= 1) and (settings.developer <= 3) then
scene.lighting.ambientLight = {0.4, 0.4, 0.4, 1.0};
end
if (settings.developer >= 1) then
scene.player:findPlayerComponent():giveWeapon(const.WeaponTypeSuperShotgun);
scene.player:findPlayerComponent():changeAmmo(const.WeaponTypeShotgun, 80);
scene.player:findPlayerComponent():giveWeapon(const.WeaponTypeProxMine);
scene.player:findPlayerComponent():changeAmmo(const.WeaponTypeProxMine, 3);
end
if (settings.developer >= 2) and (settings.developer <= 11) then
scene.player:findPlayerComponent():giveWeapon(const.WeaponTypeRLauncher);
scene.player:findPlayerComponent():changeAmmo(const.WeaponTypeRLauncher, 35);
end
if (settings.developer == 3) then
scene:getObjects("station3_e1_cp")[1].active = false;
scene:getObjects("station3_e2_cp")[1].active = false;
scene:getObjects("station3_e3_cp")[1].active = false;
postStation3();
end
if (settings.developer >= 4) and (settings.developer <= 5) then
scene:getObjects("lantern1")[1].pos = scene.player.pos;
stairs45Up();
openAirlock("door7", false);
scene.player:findPlayerComponent():giveWeapon(const.WeaponTypeMachineGun);
scene.player:findPlayerComponent():changeAmmo(const.WeaponTypeMachineGun, 350);
end
if (settings.developer >= 6) and (settings.developer <= 7) then
stairs3Up();
openAirlock("door17", false);
end
if (settings.developer == 7) then
scene.player:findPlayerComponent():giveWeapon(const.WeaponTypeLGun);
scene.player:findPlayerComponent():changeAmmo(const.WeaponTypeLGun, 50);
end
if (settings.developer == 8) then
scene.player:findPlayerComponent().inventory:give(const.InventoryItemRedKey);
scene.player:findPlayerComponent().inventory:give(const.InventoryItemBlueKey);
end
if (settings.developer == 9) then
scene:getObjects("elevator1_cp1")[1].active = false;
addTimeoutOnce(1.5, function()
enableLever("lever1");
end);
end
if settings.developer >= 10 then
scene.lighting.ambientLight = {0.4, 0.4, 0.4, 1.0};
addTimeoutOnce(1.0, function()
stopTrains();
end);
startFinalPods();
scene.player:findPlayerComponent():giveWeapon(const.WeaponTypeLGun);
scene.player:findPlayerComponent():changeAmmo(const.WeaponTypeLGun, 100);
startMusic("ambient12.ogg", false);
end
if (settings.developer >= 10) and (settings.developer <= 11) then
scene.player:findPlayerComponent():giveWeapon(const.WeaponTypeMachineGun);
scene.player:findPlayerComponent():changeAmmo(const.WeaponTypeMachineGun, 350);
end
if settings.developer == 11 then
scene:getObjects("ride1_cp")[1].active = false;
scene:getObjects("ride2_cp")[1].active = false;
scene.player:findPlayerComponent():giveWeapon(const.WeaponTypeEShield);
scene.player:findPlayerComponent():changeAmmo(const.WeaponTypeEShield, 12);
end
if settings.developer == 12 then
scene:getObjects("ride5_cp")[1].active = false;
scene:getObjects("ride6_cp")[1].active = false;
scene.player:findPlayerComponent().inventory:give(const.InventoryItemYellowKey);
scene.player:findPlayerComponent():giveWeapon(const.WeaponTypeEShield);
scene.player:findPlayerComponent():changeAmmo(const.WeaponTypeEShield, 6);
end
|
local angleshit = 0.5;
local anglevar = 0.5;
function opponentNoteHit(id, direction, noteType, isSustainNote)
if difficulty == 2 then
if curBeat < 288 then
if curBeat > 180 then
cameraShake('cam', '0.015', '0.1')
end
end
end
end
|
local _G = require "_G"
local mysql = require "mysql"
local nmap = require "nmap"
local shortport = require "shortport"
local stdnse = require "stdnse"
local table = require "table"
description = [[
Audits MySQL database server security configuration against parts of
the CIS MySQL v1.0.2 benchmark (the engine can be used for other MySQL
audits by creating appropriate audit files).
]]
---
-- @usage
-- nmap -p 3306 --script mysql-audit --script-args "mysql-audit.username='root', \
-- mysql-audit.password='foobar',mysql-audit.filename='nselib/data/mysql-cis.audit'"
--
-- @args mysql-audit.username the username with which to connect to the database
-- @args mysql-audit.password the password with which to connect to the database
-- @args mysql-audit.filename the name of the file containing the audit rulebase
--
-- @output
-- PORT STATE SERVICE
-- 3306/tcp open mysql
-- | mysql-audit:
-- | CIS MySQL Benchmarks v1.0.2
-- | 3.1: Skip symbolic links => PASS
-- | 3.2: Logs not on system partition => PASS
-- | 3.2: Logs not on database partition => PASS
-- | 4.1: Supported version of MySQL => REVIEW
-- | Version: 5.1.54-1ubuntu4
-- | 4.4: Remove test database => PASS
-- | 4.5: Change admin account name => FAIL
-- | 4.7: Verify Secure Password Hashes => PASS
-- | 4.9: Wildcards in user hostname => FAIL
-- | The following users were found with wildcards in hostname
-- | root
-- | super
-- | super2
-- | 4.10: No blank passwords => PASS
-- | 4.11: Anonymous account => PASS
-- | 5.1: Access to mysql database => REVIEW
-- | Verify the following users that have access to the MySQL database
-- | user host
-- | root localhost
-- | root patrik-11
-- | root 127.0.0.1
-- | debian-sys-maint localhost
-- | root %
-- | super %
-- | 5.2: Do not grant FILE privileges to non Admin users => REVIEW
-- | The following users were found having the FILE privilege
-- | super
-- | super2
-- | 5.3: Do not grant PROCESS privileges to non Admin users => REVIEW
-- | The following users were found having the PROCESS privilege
-- | super
-- | 5.4: Do not grant SUPER privileges to non Admin users => REVIEW
-- | The following users were found having the SUPER privilege
-- | super
-- | 5.5: Do not grant SHUTDOWN privileges to non Admin users => REVIEW
-- | The following users were found having the SHUTDOWN privilege
-- | super
-- | 5.6: Do not grant CREATE USER privileges to non Admin users => REVIEW
-- | The following users were found having the CREATE USER privilege
-- | super
-- | 5.7: Do not grant RELOAD privileges to non Admin users => REVIEW
-- | The following users were found having the RELOAD privilege
-- | super
-- | 5.8: Do not grant GRANT privileges to non Admin users => PASS
-- | 6.2: Disable Load data local => FAIL
-- | 6.3: Disable old password hashing => PASS
-- | 6.4: Safe show database => FAIL
-- | 6.5: Secure auth => FAIL
-- | 6.6: Grant tables => FAIL
-- | 6.7: Skip merge => FAIL
-- | 6.8: Skip networking => FAIL
-- | 6.9: Safe user create => FAIL
-- | 6.10: Skip symbolic links => FAIL
-- |
-- |_ The audit was performed using the db-account: root
-- Version 0.1
-- Created 05/29/2011 - v0.1 - created by Patrik Karlsson <patrik@cqure.net>
author = "Patrik Karlsson"
license = "Same as Nmap--See http://nmap.org/book/man-legal.html"
categories = {"discovery", "safe"}
portrule = shortport.port_or_service(3306, "mysql")
local TEMPLATE_NAME, ADMIN_ACCOUNTS = "", ""
local function fail (err) return stdnse.format_output(false, err) end
local function loadAuditRulebase( filename )
local rules = {}
local env = setmetatable({
test = function(t) table.insert(rules, t) end;
}, {__index = _G})
local file, err = loadfile(filename, "t", env)
if ( not(file) ) then
return false, fail(("Failed to load rulebase:\n%s"):format(err))
end
file()
TEMPLATE_NAME = env.TEMPLATE_NAME
ADMIN_ACCOUNTS = env.ADMIN_ACCOUNTS
return true, rules
end
action = function( host, port )
local username = stdnse.get_script_args("mysql-audit.username")
local password = stdnse.get_script_args("mysql-audit.password")
local filename = stdnse.get_script_args("mysql-audit.filename")
if ( not(filename) ) then
return fail("No audit rulebase file was supplied (see mysql-audit.filename)")
end
if ( not(username) ) then
return fail("No username was supplied (see mysql-audit.username)")
end
local status, tests = loadAuditRulebase( filename )
if( not(status) ) then return tests end
local socket = nmap.new_socket()
status = socket:connect(host, port)
local response
status, response = mysql.receiveGreeting( socket )
if ( not(status) ) then return response end
status, response = mysql.loginRequest( socket, { authversion = "post41", charset = response.charset }, username, password, response.salt )
if ( not(status) ) then return fail("Failed to authenticate") end
local results = {}
for _, test in ipairs(tests) do
local queries = ( "string" == type(test.sql) ) and { test.sql } or test.sql
local rowstab = {}
for _, query in ipairs(queries) do
local row
status, row = mysql.sqlQuery( socket, query )
if ( not(status) ) then
table.insert( results, { ("%s: ERROR: Failed to execute SQL statement"):format(test.id) } )
else
table.insert(rowstab, row)
end
end
if ( #rowstab > 0 ) then
local result_part = {}
local res = test.check(rowstab)
local status, data = res.status, res.result
status = ( res.review and "REVIEW" ) or (status and "PASS" or "FAIL")
table.insert( result_part, ("%s: %s => %s"):format(test.id, test.desc, status) )
if ( data ) then
table.insert(result_part, { data } )
end
table.insert( results, result_part )
end
end
socket:close()
results.name = TEMPLATE_NAME
table.insert(results, "")
table.insert(results, {name = "Additional information", ("The audit was performed using the db-account: %s"):format(username),
("The following admin accounts were excluded from the audit: %s"):format(stdnse.strjoin(",", ADMIN_ACCOUNTS))
})
return stdnse.format_output(true, { results })
end
|
local M = {}
local date = require("taglinks.date")
--- returns the day of week (1..Monday, ..., 7..Sunday) for Dec, 31st of year
--- see https://webspace.science.uu.nl/~gent0113/calendar/isocalendar.htm
--- see https://en.wikipedia.org/wiki/ISO_week_date
M.dow_for_year = function(year)
return (
year
+ math.floor(year / 4)
- math.floor(year / 100)
+ math.floor(year / 400)
) % 7
end
M.weeks_in_year = function(year)
local d = 0
local dy = M.dow_for_year(year) == 4 -- current year ends Thursday
local dyy = M.dow_for_year(year - 1) == 3 -- previous year ends Wednesday
if dy or dyy then
d = 1
end
return 52 + d
end
M.days_in_year = function(year)
local t = os.time({ year = year, month = 12, day = 31 })
return os.date("*t", t).yday
end
M.date_from_doy = function(year, doy)
local ret = {
year = year,
month = 1,
day = doy,
}
-- january is clear immediately
if doy < 32 then
return ret
end
local dmap = {
[1] = 31,
[2] = 28, -- will be fixed further down
[3] = 31,
[4] = 30,
[5] = 31,
[6] = 30,
[7] = 31,
[8] = 31,
[9] = 30,
[10] = 31,
[11] = 30,
[12] = 31,
}
if M.days_in_year(year) == 366 then
dmap[2] = 29
end
for month, d in pairs(dmap) do
doy = doy - d
if doy < 0 then
ret.day = doy + d
ret.month = month
return ret
end
end
return ret -- unreachable if input values are sane
end
-- the algo on wikipedia seems wrong, so we opt for full-blown luadate
M.isoweek_to_date = function(year, isoweek)
local ret = date(year .. "-W" .. string.format("%02d", isoweek) .. "-1")
return {
year = ret:getyear(),
month = ret:getmonth(),
day = ret:getday(),
}
end
local function check_isoweek(year, isoweek, ydate)
print("*********** KW " .. isoweek .. " " .. year .. ": ")
-- local ret = M.weeknumber_to_date(year, isoweek)
local ret = M.isoweek_to_date(year, isoweek)
local result = ret.year == ydate.year
and ret.month == ydate.month
and ret.day == ydate.day
print(
ret.year
.. "-"
.. ret.month
.. "-"
.. ret.day
.. " == "
.. ydate.year
.. "-"
.. ydate.month
.. "-"
.. ydate.day
.. " : "
.. tostring(result)
)
end
M.run_tests = function()
print(check_isoweek(2020, 1, { year = 2019, month = 12, day = 30 })) -- 30.12.2019
print(check_isoweek(2020, 52, { year = 2020, month = 12, day = 21 })) -- 21.12.2020
print(check_isoweek(2020, 53, { year = 2020, month = 12, day = 28 })) -- 28.12.2020
print(check_isoweek(2021, 1, { year = 2021, month = 1, day = 4 })) -- 4.1.2020
print(check_isoweek(2021, 52, { year = 2021, month = 12, day = 27 })) -- 27.12.2021
print(check_isoweek(2022, 1, { year = 2022, month = 1, day = 3 })) -- 3.1.2022
end
-- M.run_tests()
return M
|
local cmd = require('bex.cmd')
cmd.normal.params = {param.raw}
cmd.normal.bang.params = {param.raw}
|
object_tangible_furniture_all_outbreak_shackled_man = object_tangible_furniture_all_shared_outbreak_shackled_man:new {
}
ObjectTemplates:addTemplate(object_tangible_furniture_all_outbreak_shackled_man, "object/tangible/furniture/all/outbreak_shackled_man.iff")
|
-- Generated By protoc-gen-lua Do not Edit
local protobuf = require "protobuf/protobuf"
module('UnlockSealFindBackData_pb')
UNLOCKSEALFINDBACKDATA = protobuf.Descriptor();
local UNLOCKSEALFINDBACKDATA_STATE_FIELD = protobuf.FieldDescriptor();
local UNLOCKSEALFINDBACKDATA_TYPE_FIELD = protobuf.FieldDescriptor();
local UNLOCKSEALFINDBACKDATA_TIME_FIELD = protobuf.FieldDescriptor();
UNLOCKSEALFINDBACKDATA_STATE_FIELD.name = "state"
UNLOCKSEALFINDBACKDATA_STATE_FIELD.full_name = ".KKSG.UnlockSealFindBackData.state"
UNLOCKSEALFINDBACKDATA_STATE_FIELD.number = 1
UNLOCKSEALFINDBACKDATA_STATE_FIELD.index = 0
UNLOCKSEALFINDBACKDATA_STATE_FIELD.label = 1
UNLOCKSEALFINDBACKDATA_STATE_FIELD.has_default_value = false
UNLOCKSEALFINDBACKDATA_STATE_FIELD.default_value = false
UNLOCKSEALFINDBACKDATA_STATE_FIELD.type = 8
UNLOCKSEALFINDBACKDATA_STATE_FIELD.cpp_type = 7
UNLOCKSEALFINDBACKDATA_TYPE_FIELD.name = "type"
UNLOCKSEALFINDBACKDATA_TYPE_FIELD.full_name = ".KKSG.UnlockSealFindBackData.type"
UNLOCKSEALFINDBACKDATA_TYPE_FIELD.number = 2
UNLOCKSEALFINDBACKDATA_TYPE_FIELD.index = 1
UNLOCKSEALFINDBACKDATA_TYPE_FIELD.label = 1
UNLOCKSEALFINDBACKDATA_TYPE_FIELD.has_default_value = false
UNLOCKSEALFINDBACKDATA_TYPE_FIELD.default_value = 0
UNLOCKSEALFINDBACKDATA_TYPE_FIELD.type = 5
UNLOCKSEALFINDBACKDATA_TYPE_FIELD.cpp_type = 1
UNLOCKSEALFINDBACKDATA_TIME_FIELD.name = "time"
UNLOCKSEALFINDBACKDATA_TIME_FIELD.full_name = ".KKSG.UnlockSealFindBackData.time"
UNLOCKSEALFINDBACKDATA_TIME_FIELD.number = 3
UNLOCKSEALFINDBACKDATA_TIME_FIELD.index = 2
UNLOCKSEALFINDBACKDATA_TIME_FIELD.label = 1
UNLOCKSEALFINDBACKDATA_TIME_FIELD.has_default_value = false
UNLOCKSEALFINDBACKDATA_TIME_FIELD.default_value = 0
UNLOCKSEALFINDBACKDATA_TIME_FIELD.type = 5
UNLOCKSEALFINDBACKDATA_TIME_FIELD.cpp_type = 1
UNLOCKSEALFINDBACKDATA.name = "UnlockSealFindBackData"
UNLOCKSEALFINDBACKDATA.full_name = ".KKSG.UnlockSealFindBackData"
UNLOCKSEALFINDBACKDATA.nested_types = {}
UNLOCKSEALFINDBACKDATA.enum_types = {}
UNLOCKSEALFINDBACKDATA.fields = {UNLOCKSEALFINDBACKDATA_STATE_FIELD, UNLOCKSEALFINDBACKDATA_TYPE_FIELD, UNLOCKSEALFINDBACKDATA_TIME_FIELD}
UNLOCKSEALFINDBACKDATA.is_extendable = false
UNLOCKSEALFINDBACKDATA.extensions = {}
UnlockSealFindBackData = protobuf.Message(UNLOCKSEALFINDBACKDATA)
|
require('lualine').setup({
sections = {
lualine_a = {
{
'mode',
fmt = function()
return ' '
end,
padding = 0,
},
},
lualine_b = {
'branch',
{
'diagnostics',
symbols = {
error = ' ',
warn = ' ',
info = ' ',
hint = ' ',
},
},
},
lualine_c = {
{
'filename',
path = 1,
symbols = {
modified = '',
readonly = '',
},
},
},
lualine_x = {
{
function()
local msg = ''
local buf_ft = vim.api.nvim_buf_get_option(0, 'filetype')
local clients = vim.lsp.get_active_clients()
if next(clients) == nil then
return msg
end
for _, client in ipairs(clients) do
local filetypes = client.config.filetypes
if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then
msg = msg .. ' ' .. client.name
end
end
return msg
end,
color = { fg = '#ffffff', gui = 'bold' },
},
},
lualine_y = {},
lualine_z = { { 'filetype', colored = true, icon_only = true } },
},
options = {
icons_enabled = false,
component_separators = {},
section_separators = {},
theme = 'catppuccin',
},
})
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.