content stringlengths 5 1.05M |
|---|
--[[
The contents of this file are subject to the Common Public Attribution
License Version 1.0 (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License at
http://ultimate-empire-at-war.com/cpal. The License is based on the Mozilla
Public License Version 1.1 but Sections 14 and 15 have been added to cover
use of software over a computer network and provide for limited attribution
for the Original Developer. In addition, Exhibit A has been modified to be
consistent with Exhibit B.
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
the specific language governing rights and limitations under the License.
The Original Code is Ultimate Empire at War.
The Original Developer is the Initial Developer. The Initial Developer of the
Original Code is the Ultimate Empire at War team. All portions of the code
written by the Ultimate Empire at War team are Copyright (c) 2012.
All Rights Reserved. ]]
-- $Id: //depot/Projects/StarWars_Expansion/Run/Data/Scripts/AI/SpaceMode/FlankPlan.lua#3 $
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- (C) Petroglyph Games, Inc.
--
--
-- ***** ** * *
-- * ** * * *
-- * * * * *
-- * * * * * * * *
-- * * *** ****** * ** **** *** * * * ***** * ***
-- * ** * * * ** * ** ** * * * * ** ** ** *
-- *** ***** * * * * * * * * ** * * * *
-- * * * * * * * * * * * * * * *
-- * * * * * * * * * * ** * * * *
-- * ** * * ** * ** * * ** * * * *
-- ** **** ** * **** ***** * ** *** * *
-- * * *
-- * * *
-- * * *
-- * * * *
-- **** * *
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- $File: //depot/Projects/StarWars_Expansion/Run/Data/Scripts/AI/SpaceMode/FlankPlan.lua $
--
-- Original Author: James Yarrow
--
-- $Author: James_Yarrow $
--
-- $Change: 45952 $
--
-- $DateTime: 2006/06/09 16:00:52 $
--
-- $Revision: #3 $
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
function Definitions()
DebugMessage("%s -- In Definitions", tostring(Script))
AllowEngagedUnits = false
MinContrastScale = 0.75
Category = "Destroy_Unit"
TaskForce = {
{
"MainForce"
,"Corvette | Frigate | Capital | Super = 2,6"
},
{
"FlankForce"
,"Fighter = 1,4"
}
}
ExecuteFlank = true
flank_block = nil
flank_dist = 1000.0
DebugMessage("%s -- Done Definitions", tostring(Script))
end
function MainForce_Thread()
DebugMessage("%s -- In MainForce_Thread.", tostring(Script))
ExecuteFlank = false
BlockOnCommand(MainForce.Produce_Force());
QuickReinforce(PlayerObject, AITarget, MainForce, FlankForce)
DebugMessage("MainForce constructed at stage area!")
MainForce.Enable_Attack_Positioning(true)
SetClassPriorities(MainForce, "Attack_Move")
BlockOnCommand(MainForce.Attack_Move(AITarget, MainForce.Get_Self_Threat_Max()))
DebugMessage("%s -- MainForce Done! Exiting Script!", tostring(Script))
ScriptExit()
end
function FlankForce_Thread()
BlockOnCommand(FlankForce.Produce_Force())
QuickReinforce(PlayerObject, AITarget, FlankForce, MainForce)
-- Parameters = target, direction ("left", "right", "front", "back"), minimum distance from target, threat tolerance
flank_block = FlankForce.Prepare_Ambush(AITarget, "back", flank_dist, 500.0)
if not flank_block then
DebugMessage("Unable to reach BACK flank, trying right.")
flank_block = FlankForce.Prepare_Ambush(AITarget, "right", flank_dist, 500.0)
end
if not flank_block then
DebugMessage("Unable to reach RIGHT flank, trying right.")
flank_block = FlankForce.Prepare_Ambush(AITarget, "left", flank_dist, 500.0)
end
if not flank_block then
DebugMessage("Unable to reach a flank. Abandonning plan.")
ScriptExit()
end
-- Try to stay in position to perform the flank
while not ExecuteFlank do
if flank_block.IsFinished() then
if TestValid(AITarget) and FlankForce.Get_Distance(AITarget) < flank_dist then
DebugMessage("%s -- Attempting to stay out of range and safe.", tostring(Script))
FlankForce.Move_To(Project_By_Unit_Range(AITarget.Get_Game_Object(), FlankForce), FlankForce.Get_Self_Threat_Max())
end
end
Sleep(5)
end
BlockOnCommand(FlankForce.Attack_Target(AITarget))
FlankForce.Enable_Attack_Positioning(false)
ScriptExit()
end
function MainForce_No_Units_Remaining()
DebugMessage("%s -- All units dead or non-buildable. Abandonning plan.", tostring(Script))
ScriptExit()
end
function MainForce_Original_Target_Destroyed()
DebugMessage("%s -- Target destroyed! Exiting Script.", tostring(Script))
ScriptExit()
end
function MainForce_Target_In_Range()
ExecuteFlank = true
MainForce.Enable_Attack_Positioning(true)
end
function FlankForce_Target_In_Range()
FlankForce.Enable_Attack_Positioning(true)
end
function FlankForce_Original_Target_Destroyed()
ScriptExit()
end
|
local drawableNinePatch = require("structs.drawable_nine_patch")
local drawableSprite = require("structs.drawable_sprite")
-- Some of this plugin is copy-pasted from MaxHelpingHand's Flag Switch Gates
-- https://github.com/max4805/MaxHelpingHand/blob/master/Loenn/entities/flagSwitchGate.lua
local dashGateBlock = {}
dashGateBlock.name = "SorbetHelper/DashGateBlock"
dashGateBlock.depth = 0
dashGateBlock.nodeLimits = {1, 1}
dashGateBlock.nodeLineRenderType = "line"
dashGateBlock.minimumSize = {16, 16}
dashGateBlock.placements = {}
local textures = {
"block", "mirror", "temple", "stars"
}
for i, texture in ipairs(textures) do
dashGateBlock.placements[i] = {
name = texture,
data = {
width = 16,
height = 16,
blockSprite = texture,
iconSprite = "SorbetHelper/gateblock/dash/icon",
inactiveColor = "F86593",
activeColor = "FFFFFF",
finishColor = "62A1F5",
shakeTime = 0.5,
moveTime = 1.8,
moveEased = true,
moveSound = "event:/game/general/touchswitch_gate_open",
finishedSound = "event:/game/general/touchswitch_gate_finish",
allowWavedash = false,
dashCornerCorrection = false,
persistent = false,
smoke = true,
linked = false,
linkTag = ""
}
}
end
dashGateBlock.fieldOrder = {"x", "y", "width", "height", "inactiveColor", "activeColor", "finishColor", "moveSound", "finishedSound", "shakeTime", "moveTime", "moveEased", "blockSprite", "iconSprite", "allowWavedash", "dashCornerCorrection", "smoke", "persistent", "linked", "linkTag"}
dashGateBlock.fieldInformation = {
inactiveColor = {
fieldType = "color"
},
activeColor = {
fieldType = "color"
},
finishColor = {
fieldType = "color"
}
}
local ninePatchOptions = {
mode = "fill",
borderMode = "repeat",
fillMode = "repeat"
}
local frameTexture = "objects/switchgate/%s"
local middleTexture = "objects/SorbetHelper/gateblock/dash/icon00"
function dashGateBlock.sprite(room, entity)
local x, y = entity.x or 0, entity.y or 0
local width, height = entity.width or 24, entity.height or 24
local blockSprite = entity.blockSprite or "block"
local frame = string.format(frameTexture, blockSprite)
local ninePatch = drawableNinePatch.fromTexture(frame, ninePatchOptions, x, y, width, height)
local middleSprite = drawableSprite.fromTexture(middleTexture, entity)
local sprites = ninePatch:getDrawableSprite()
middleSprite:addPosition(math.floor(width / 2), math.floor(height / 2))
table.insert(sprites, middleSprite)
return sprites
end
return dashGateBlock
|
local Dta = select(2, ...)
Dta.copa_ui = {}
-------------------------------
-- BUILD THE DIMENSIONTOOLS COPY/PASTE WINDOW
-------------------------------
local CopyPasteWindowSettings = {
WIDTH = 325,
HEIGHT = 260,
CLOSABLE = true,
MOVABLE = true,
POS_X = "CopyPastewindowPosX",
POS_Y = "CopyPastewindowPosY"
}
function Dta.copa_ui.buildCopyPasteWindow()
local x = Dta.settings.get("CopyPastewindowPosX")
local y = Dta.settings.get("CopyPastewindowPosY")
local newWindow = Dta.ui.Window.Create("CopyPastewindow",
Dta.ui.context,
Dta.Locale.Titles.CopyPaste,
CopyPasteWindowSettings.WIDTH,
CopyPasteWindowSettings.HEIGHT,
x,
y,
CopyPasteWindowSettings.CLOSABLE,
CopyPasteWindowSettings.MOVABLE,
Dta.copa_ui.hideCopyPastewindow,
Dta.ui.WindowMoved
)
newWindow.settings = CopyPasteWindowSettings
local CopyPastewindow = newWindow.content
CopyPastewindow.background2 = UI.CreateFrame("Texture", "CopyPasteWindowBackground2", CopyPastewindow)
CopyPastewindow.background2:SetPoint("BOTTOMCENTER", CopyPastewindow, "BOTTOMCENTER")
CopyPastewindow.background2:SetWidth(CopyPasteWindowSettings.WIDTH)
CopyPastewindow.background2:SetHeight(80)
CopyPastewindow.background2:SetAlpha(0.3)
CopyPastewindow.background2:SetTexture("Rift", "dimensions_tools_header.png.dds")
CopyPastewindow.background2:SetLayer(5)
-------------------------------
--ITEM DETAILS
-------------------------------
CopyPastewindow.copyPaste = Dta.ui.createFrame("copyPaste", CopyPastewindow, 10, 5, CopyPastewindow:GetWidth()-20, CopyPastewindow:GetHeight()-20)
CopyPastewindow.copyPaste:SetLayer(30)
--CopyPastewindow.copyPaste:SetBackgroundColor(1, 0, 0, 0.5) --Debug
CopyPastewindow.copyPaste.copyBtn = Dta.ui.createButton("copyBtn", CopyPastewindow.copyPaste, 0, 215, nil, nil, Dta.Locale.Buttons.Copy, nil, Dta.copa.copyButtonClicked)
CopyPastewindow.copyPaste.pasteBtn = Dta.ui.createButton("pasteBtn", CopyPastewindow.copyPaste, 165, 215, nil, nil, Dta.Locale.Buttons.Paste, nil, Dta.copa.pasteButtonClicked)
CopyPastewindow.copyPaste.offsetLabel1 = Dta.ui.createText("copyPasteOffsetLabel1", CopyPastewindow.copyPaste, 37, 0, Dta.Locale.Text.Offset, 11)
CopyPastewindow.copyPaste.offsetLabel2 = Dta.ui.createText("copyPasteOffsetLabel3", CopyPastewindow.copyPaste, 157, 0, Dta.Locale.Text.Offset, 11)
CopyPastewindow.copyPaste.offsetLabel3 = Dta.ui.createText("copyPasteOffsetLabel4", CopyPastewindow.copyPaste, 237, 57, Dta.Locale.Text.Offset, 11)
CopyPastewindow.copyPaste.x = Dta.ui.createCheckbox("copyPasteX", CopyPastewindow.copyPaste, 0, 15, "X", true, {1, 0, 0, 1})
CopyPastewindow.copyPaste.y = Dta.ui.createCheckbox("copyPasteY", CopyPastewindow.copyPaste, 0, 40, "Y", true, {0, 1, 0, 1})
CopyPastewindow.copyPaste.z = Dta.ui.createCheckbox("copyPasteZ", CopyPastewindow.copyPaste, 0, 65, "Z", true, {0, 1, 1, 1})
CopyPastewindow.copyPaste.pitch = Dta.ui.createCheckbox("copyPastePitch", CopyPastewindow.copyPaste, 100, 15, Dta.Locale.Text.Pitch, true, {1, 0, 0, 1})
CopyPastewindow.copyPaste.yaw = Dta.ui.createCheckbox("copyPasteYaw", CopyPastewindow.copyPaste, 100, 40, Dta.Locale.Text.Yaw, true, {0, 1, 0, 1})
CopyPastewindow.copyPaste.roll = Dta.ui.createCheckbox("copyPasteRoll", CopyPastewindow.copyPaste, 100, 65, Dta.Locale.Text.Roll, true, {0, 1, 1, 1})
CopyPastewindow.copyPaste.scale = Dta.ui.createCheckbox("copyPasteScale", CopyPastewindow.copyPaste, 220, 15, Dta.Locale.Text.Scale, true)
CopyPastewindow.copyPaste.xOffset = Dta.ui.createTextfield("copyPasteXOffset", CopyPastewindow.copyPaste, 35, 15, 50)
CopyPastewindow.copyPaste.yOffset = Dta.ui.createTextfield("copyPasteYOffset", CopyPastewindow.copyPaste, 35, 40, 50)
CopyPastewindow.copyPaste.zOffset = Dta.ui.createTextfield("copyPasteZOffset", CopyPastewindow.copyPaste, 35, 65, 50)
CopyPastewindow.copyPaste.pitchOffset = Dta.ui.createTextfield("copyPastePitchOffset", CopyPastewindow.copyPaste, 155, 15, 45)
CopyPastewindow.copyPaste.yawOffset = Dta.ui.createTextfield("copyPasteYawOffset", CopyPastewindow.copyPaste, 155, 40, 45)
CopyPastewindow.copyPaste.rollOffset = Dta.ui.createTextfield("copyPasteRollOffset", CopyPastewindow.copyPaste, 155, 65, 45)
CopyPastewindow.copyPaste.scaleOffset = Dta.ui.createTextfield("copyPasteScaleOffset", CopyPastewindow.copyPaste, 235, 40, 45)
CopyPastewindow.copyPaste.multiplyOffsets = Dta.ui.createCheckbox("copyPasteMultiplyOffsets", CopyPastewindow.copyPaste, 0, 95, Dta.Locale.Text.OffsetMultiItems, false, nil, Dta.copa.CopaOffsetChanged)
--CopyPastewindow.copyPaste.multiplyOffsets:SetVisible(true)
CopyPastewindow.copyPaste.NewItemNrLabel = Dta.ui.createText("copyPasteNewItemLabel", CopyPastewindow.copyPaste, 170, 93, Dta.Locale.Text.NrItems, 14)
CopyPastewindow.copyPaste.NewItemNrLabel:SetVisible(false)
CopyPastewindow.copyPaste.NewItemNr = Dta.ui.createTextfield("copyPasteNewItemNr", CopyPastewindow.copyPaste, 260, 95, 40)
CopyPastewindow.copyPaste.NewItemNr:SetVisible(false)
CopyPastewindow.copyPaste.flickerReduce = Dta.ui.createCheckbox("copyPasteFlickerReduce", CopyPastewindow.copyPaste, 0, 120, Dta.Locale.Text.FlickerReduce, false, nil, Dta.copa.FlickerRedChanged)
CopyPastewindow.copyPaste.flickerAmplitude = Dta.ui.createTextfield("copyPasteFlickerAmp", CopyPastewindow.copyPaste, 170, 120, 50, "0.001")
CopyPastewindow.copyPaste.flickerAmplitude:SetVisible(false)
CopyPastewindow.copyPaste.SelectionPivot = Dta.ui.createCheckbox("copyPasteSelPivot", CopyPastewindow.copyPaste, 0, 145, Dta.Locale.Text.SelectionPivot, false, nil, Dta.copa.PivotChanged)
CopyPastewindow.copyPaste.pickPivotBtn = Dta.ui.createButton("pickPivotBtn", CopyPastewindow.copyPaste, 165, 140, nil, nil, Dta.Locale.Buttons.Pick, nil, Dta.copa.pickButtonClicked)
CopyPastewindow.copyPaste.pickPivotBtn:SetVisible(false)
CopyPastewindow.copyPaste.NewItem = Dta.ui.createCheckbox("copyPasteNewItem", CopyPastewindow.copyPaste, 0, 170, Dta.Locale.Text.UseNewItems, false, nil, Dta.copa.CopaNewItemChanged)
CopyPastewindow.copyPaste.Bags = Dta.ui.createCheckbox("copyPasteBags", CopyPastewindow.copyPaste, 15, 195, Dta.Locale.Text.Bags, true, nil)
CopyPastewindow.copyPaste.Bags:SetVisible(false)
CopyPastewindow.copyPaste.Bank = Dta.ui.createCheckbox("copyPasteBank", CopyPastewindow.copyPaste, 120, 195, Dta.Locale.Text.BankBags, false, nil)
CopyPastewindow.copyPaste.Bank:SetVisible(false)
Dta.ui.AddFocusCycleElement(CopyPastewindow, CopyPastewindow.copyPaste.xOffset)
Dta.ui.AddFocusCycleElement(CopyPastewindow, CopyPastewindow.copyPaste.yOffset)
Dta.ui.AddFocusCycleElement(CopyPastewindow, CopyPastewindow.copyPaste.zOffset)
Dta.ui.AddFocusCycleElement(CopyPastewindow, CopyPastewindow.copyPaste.pitchOffset)
Dta.ui.AddFocusCycleElement(CopyPastewindow, CopyPastewindow.copyPaste.yawOffset)
Dta.ui.AddFocusCycleElement(CopyPastewindow, CopyPastewindow.copyPaste.rollOffset)
Dta.ui.AddFocusCycleElement(CopyPastewindow, CopyPastewindow.copyPaste.scaleOffset)
CopyPastewindow:EventAttach(Event.UI.Input.Key.Down.Dive, Dta.ui.FocusCycleCallback, "CoPaWindow_TabFocusCycle")
-- TODO: temp fix for new window hierarchy
newWindow.copyPaste = CopyPastewindow.copyPaste
return newWindow
end
-- Show the toolbox window
function Dta.copa_ui.showCopyPastewindow(copa_window)
copa_window:SetVisible(true)
end
-- Hide the toolbox window
function Dta.copa_ui.hideCopyPastewindow(copa_window)
copa_window:SetVisible(false)
copa_window:ClearKeyFocus()
end
Dta.RegisterTool("CoPa", Dta.copa_ui.buildCopyPasteWindow, Dta.copa_ui.showCopyPastewindow, Dta.copa_ui.hideCopyPastewindow)
|
local Log = 'https://discord.com/api/webhooks/808645189396463646/HQJ2NByd16rA58dPtZrok4nYZrBxMMAofulNKi1WFENnXQES6DuWSfuk4TG0GKLWBiyi'
RegisterServerEvent('Fuckmedaddy:log')
AddEventHandler('Fuckmedaddy:log', function(pedId)
local _source = source
local name = GetPlayerName(_source)
local targetName = GetPlayerName(pedId)
PerformHttpRequest(Log, function(err, text, headers) end, 'POST', json.encode({embeds={{title="__**Aim Logi**__",description="\nPlayer name: "..name.. "`[".._source.."]`\nIs aiming: "..targetName.." `["..pedId.."]`",color=16711680}}}), { ['Content-Type'] = 'application/json' })
end)
|
-----------------------------------
-- Area: Windurst Waters
-- NPC: Ahyeekih
-- Only sells when Windurst controls Kolshushu
-- Confirmed shop stock, August 2013
-----------------------------------
require("scripts/globals/events/harvest_festivals")
local ID = require("scripts/zones/Windurst_Waters/IDs");
require("scripts/globals/conquest");
require("scripts/globals/shop");
-----------------------------------
function onTrade(player,npc,trade)
onHalloweenTrade(player,trade,npc);
end;
function onTrigger(player,npc)
local RegionOwner = GetRegionOwner(tpz.region.KOLSHUSHU);
if (RegionOwner ~= tpz.nation.WINDURST) then
player:showText(npc,ID.text.AHYEEKIH_CLOSED_DIALOG);
else
player:showText(npc,ID.text.AHYEEKIH_OPEN_DIALOG);
local stock =
{
4503, 184, -- Buburimu Grape
1120, 1620, -- Casablanca
4359, 220, -- Dhalmel Meat
614, 72, -- Mhaura Garlic
4445, 40 -- Yagudo Cherry
}
tpz.shop.general(player, stock, WINDURST);
end
end;
function onEventUpdate(player,csid,option)
end;
function onEventFinish(player,csid,option)
end;
|
local AS = unpack(AddOnSkins)
if not AS:CheckAddOn('Ludwig') then return end
function AS:Ludwig()
hooksecurefunc(Ludwig, 'ToggleSearchFrame', function()
if LudwigFrame.isSkinned then return end
-- Main frame
AS:SkinFrame(LudwigFrame)
LudwigFrame:SetHeight(456)
LudwigFrame:SetWidth(360)
LudwigFrame:SetMovable(true)
LudwigFrame:EnableMouse(true)
LudwigFrame:RegisterForDrag('LeftButton')
LudwigFrame:SetScript('OnDragStart', LudwigFrame.StartMoving)
LudwigFrame:SetScript('OnDragStop', LudwigFrame.StopMovingOrSizing)
AS:SkinCloseButton(LudwigFrameCloseButton, true)
-- Search box
AS:SkinEditBox(LudwigFramesearch)
LudwigFramesearch:SetPoint('TOPLEFT', 58, -44)
-- iLevel boxes
AS:SkinEditBox(LudwigFrameminLevel)
local LudwigFrameHyphenText = select(7, LudwigFrame:GetRegions())
LudwigFrameHyphenText:SetPoint('LEFT', LudwigFrameminLevel, 'RIGHT', 4, 0)
AS:SkinEditBox(LudwigFramemaxLevel)
-- Reset button
local LudwigFrameResetButton = select(5, LudwigFrame:GetChildren())
AS:Desaturate(LudwigFrameResetButton)
-- Scroll frame and scroll bar
AS:SkinFrame(LudwigFrameScrollFrame, 'Default')
LudwigFrameScrollFrame:ClearAllPoints()
LudwigFrameScrollFrame:SetPoint('TOPLEFT', 20, -78)
LudwigFrameScrollFrame:SetHeight(330)
LudwigFrameScrollFrame:SetWidth(300)
AS:SkinScrollBar(LudwigFrameScrollFrameScrollBar)
-- Dropdown boxes (Needs work on dropdown lists positions)
AS:SkinDropDownBox(LudwigFrameQuality)
LudwigFrameQuality:ClearAllPoints()
LudwigFrameQuality:SetPoint('BOTTOMLEFT', 35, 4)
LudwigFrameQuality:SetWidth(90)
AS:SkinDropDownBox(LudwigFrameCategory)
LudwigFrameCategory:ClearAllPoints()
LudwigFrameCategory:SetPoint('BOTTOMLEFT', LudwigFrameQuality, 'BOTTOMRIGHT', -20, 0)
LudwigFrameCategory:SetWidth(200)
LudwigFrame.isSkinned = true
end)
end
AS:RegisterSkin('Ludwig', AS.Ludwig)
|
CONFIG_PATH = os.getenv("HOME") .. "/.config/nvim"
DATA_PATH = vim.fn.stdpath("data")
CACHE_PATH = vim.fn.stdpath("cache")
TERMINAL = vim.fn.expand("$TERMINAL")
USER = vim.fn.expand("$USER")
O = {
keys = { leader_key = "space" },
colorscheme = "nord",
line_wrap_cursor_movement = true,
transparent_window = false,
format_on_save = true,
lint_on_save = true,
vsnip_dir = os.getenv("HOME") .. "/.config/snippets",
treesitter = {
ensure_installed = {
"bash",
"css",
"dockerfile",
"html",
"go",
"lua",
"java",
"javascript",
"json",
"php",
"python",
"typescript",
"vue",
"yaml",
},
ignore_install = { "haskell" },
highlight = { enabled = true },
playground = { enabled = true },
rainbow = { enabled = false },
},
default_options = {
backup = false, -- creates a backup file
clipboard = "unnamedplus", -- allows neovim to access the system clipboard
cmdheight = 2, -- more space in the neovim command line for displaying messages
colorcolumn = "99999", -- fixes indentline for now
completeopt = { "menuone", "noselect" },
conceallevel = 0, -- so that `` is visible in markdown files
fileencoding = "utf-8", -- the encoding written to a file
foldmethod = "manual", -- folding, set to "expr" for treesitter based foloding
foldexpr = "", -- set to "nvim_treesitter#foldexpr()" for treesitter based folding
guifont = "monospace:h17", -- the font used in graphical neovim applications
hidden = true, -- required to keep multiple buffers and open multiple buffers
hlsearch = true, -- highlight all matches on previous search pattern
ignorecase = true, -- ignore case in search patterns
mouse = "a", -- allow the mouse to be used in neovim
pumheight = 10, -- pop up menu height
showmode = false, -- we don't need to see things like -- INSERT -- anymore
showtabline = 2, -- always show tabs
smartcase = true, -- smart case
smartindent = true, -- make indenting smarter again
splitbelow = true, -- force all horizontal splits to go below current window
splitright = true, -- force all vertical splits to go to the right of current window
swapfile = false, -- creates a swapfile
termguicolors = true, -- set term gui colors (most terminals support this)
timeoutlen = 100, -- time to wait for a mapped sequence to complete (in milliseconds)
title = true, -- set the title of window to the value of the titlestring
-- opt.titlestring = "%<%F%=%l/%L - nvim" -- what the title of the window will be set to
undodir = CACHE_PATH .. "/undo", -- set an undo directory
undofile = true, -- enable persisten undo
updatetime = 300, -- faster completion
writebackup = false, -- if a file is being edited by another program (or was written to file while editing with another program), it is not allowed to be edited
expandtab = true, -- convert tabs to spaces
shiftwidth = 2, -- the number of spaces inserted for each indentation
tabstop = 2, -- insert 2 spaces for a tab
cursorline = true, -- highlight the current line
number = true, -- set numbered lines
relativenumber = false, -- set relative numbered lines
numberwidth = 4, -- set number column width to 2 {default 4}
signcolumn = "yes", -- always show the sign column, otherwise it would shift the text each time
wrap = true, -- display lines as one long line
spell = false,
spelllang = "en",
scrolloff = 8, -- is one of my fav
sidescrolloff = 8,
},
lsp = {
diagnostics = {
virtual_text = { prefix = "", spacing = 0 },
signs = true,
underline = true,
},
document_highlight = true,
popup_border = "single",
default_keybinds = true,
on_attach_callback = nil,
ensure_installed = {
"bashls",
"cssls",
"dockerls",
"efm",
"html",
"gopls",
"sumneko_lua",
"jdtls",
"kotlin_language_server",
"tsserver",
"jsonls",
"intelephense",
"pyright",
"vuels",
"yamlls",
"lemminx",
"vimls"
},
},
disabled_built_ins = {
"netrw",
"netrwPlugin",
"netrwSettings",
"netrwFileHandlers",
"gzip",
"zip",
"zipPlugin",
"tar",
"tarPlugin",
"getscript",
"getscriptPlugin",
"vimball",
"vimballPlugin",
"2html_plugin",
"logipat",
"rrhelper",
"spellfile_plugin",
"matchit",
},
plugin = {
lspinstall = {},
telescope = {},
cmp = {},
autopairs = {},
treesitter = {},
formatter = {},
lint = {},
nvimtree = {},
gitsigns = {},
which_key = {},
comment = {},
rooter = {},
galaxyline = {},
bufferline = {},
dap = {},
dashboard = {},
terminal = {},
zen = {},
},
-- TODO: refactor for tree
auto_close_tree = 0,
nvim_tree_disable_netrw = 0,
database = { save_location = "~/.config/lunarvim_db", auto_execute = 1 },
-- TODO: just using mappings (leader mappings)
user_which_key = {},
user_plugins = {
-- use lv-config.lua for this not put here
},
user_autocommands = { { "FileType", "qf", "set nobuflisted" } },
formatters = { filetype = {} },
-- TODO move all of this into lang specific files, only require when using
lang = {
efm = {},
emmet = { active = false },
svelte = {},
tailwindcss = {
active = false,
filetypes = {
"html",
"css",
"scss",
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
},
},
tsserver = {
-- @usage can be 'eslint' or 'eslint_d'
linter = "",
diagnostics = {
virtual_text = { spacing = 0, prefix = "" },
signs = true,
underline = true,
},
formatter = { exe = "prettier", args = {} },
},
},
}
local function safe_require_config(module)
local present, conf = pcall(require, module)
if not present then
return
end
pcall(conf.config)
end
safe_require_config("lang.clang")
safe_require_config("lang.clojure")
safe_require_config("lang.cmake")
safe_require_config("lang.cs")
safe_require_config("lang.css")
safe_require_config("lang.dart")
safe_require_config("lang.dockerfile")
safe_require_config("lang.elixir")
safe_require_config("lang.elm")
safe_require_config("lang.go")
safe_require_config("lang.graphql")
safe_require_config("lang.html")
safe_require_config("lang.java")
safe_require_config("lang.json")
safe_require_config("lang.julia")
safe_require_config("lang.kotlin")
safe_require_config("lang.lua")
safe_require_config("lang.php")
safe_require_config("lang.python")
safe_require_config("lang.r")
safe_require_config("lang.ruby")
safe_require_config("lang.rust")
safe_require_config("lang.sh")
safe_require_config("lang.scala")
safe_require_config("lang.svelte")
safe_require_config("lang.swift")
safe_require_config("lang.terraform")
safe_require_config("lang.tex")
safe_require_config("lang.vim")
safe_require_config("lang.vue")
safe_require_config("lang.yaml")
safe_require_config("lang.zig")
safe_require_config("lang.zsh")
|
aurum.magic = {}
b.dofile("doc.lua")
b.dodir("rituals")
b.dodir("spells")
|
local gears = require("gears")
-- Theme handling library
local beautiful = require("beautiful")
-- Themes define colours, icons, and wallpapers
beautiful.init("/home/hegza/.config/awesome/themes/zenburn/theme.lua")
-- {{{ Wallpaper on all screens
if beautiful.wallpaper_space then
for s = 1, screen.count() do
gears.wallpaper.maximized(beautiful.wallpaper_space, s, true)
end
end
-- }}}
|
local fn = vim.fn
local packer_install_dir = fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim"
local plug_url_format = ""
plug_url_format = "https://github.com/%s"
local packer_repo = string.format(plug_url_format, "wbthomason/packer.nvim")
local install_cmd = string.format("10split |term git clone --depth=1 %s %s", packer_repo, packer_install_dir)
-- Auto-install packer in case it hasn't been installed.
if fn.glob(packer_install_dir) == "" then
vim.api.nvim_echo({{"Installing packer.nvim", "Type"}}, true, {})
vim.cmd(install_cmd)
vim.cmd("packadd packer.nvim")
end
vim.cmd [[packadd packer.nvim]]
local packer = require("packer")
packer.init {
display = {
open_fn = function()
return require("packer.util").float {border = "single"}
end,
prompt_border = "single"
},
git = {
clone_timeout = 600
},
auto_clean = true,
compile_on_sync = true
}
packer.startup(
function()
-- Packer can manage itself
use {
"wbthomason/packer.nvim"
}
use {
"neovim/nvim-lspconfig",
event = "BufReadPre",
config = function()
require "plugin-config.lsp"
end
}
use {
"williamboman/nvim-lsp-installer",
after = "nvim-lspconfig",
config = function()
require "plugin-config.lsp-servers"
end
}
use {
"rafamadriz/friendly-snippets",
event = "InsertEnter"
}
use {
"hrsh7th/nvim-cmp",
after = "friendly-snippets",
config = function()
require "plugin-config.nvim-cmp"
end
}
use {
"L3MON4D3/LuaSnip",
wants = "friendly-snippets",
after = "nvim-cmp",
config = function()
require "plugin-config.luasnip"
end
}
use {
"saadparwaiz1/cmp_luasnip",
after = "LuaSnip"
}
use {
"hrsh7th/cmp-nvim-lua",
after = "cmp_luasnip"
}
use {
"hrsh7th/cmp-nvim-lsp",
after = "cmp-nvim-lua"
}
use {
"hrsh7th/cmp-buffer",
after = "cmp-nvim-lsp"
}
use {
"hrsh7th/cmp-path",
after = "cmp-buffer"
}
--------------------------------------
use {
"kyazdani42/nvim-web-devicons"
}
use {
"lewis6991/gitsigns.nvim",
after = "plenary.nvim",
event = "BufRead",
config = function()
require "plugin-config.gitsigns"
end
}
use {
"folke/trouble.nvim",
event = "BufRead",
config = function()
require "plugin-config.trouble"
end,
setup = function()
require("plugin-map").trouble()
end
}
use {
"nvim-treesitter/nvim-treesitter",
run = ":TSUpdate",
config = function()
require "plugin-config.treesitter"
end
}
use {
"onsails/lspkind-nvim",
event = "InsertEnter",
config = function()
require("lspkind").init()
end
}
use {
"SmiteshP/nvim-gps",
after = "nvim-web-devicons",
config = function()
require "plugin-config.nvim-gps"
end
}
use {
"feline-nvim/feline.nvim",
after = "nvim-gps",
config = function()
require "plugin-config.feline"
end
}
use {
"nvim-lua/plenary.nvim"
}
use {
"nvim-lua/popup.nvim",
after = "plenary.nvim"
}
use {
"nvim-telescope/telescope.nvim",
config = function()
require "plugin-config.telescope"
end,
setup = function()
require("plugin-map").telescope()
end
}
use {
"kyazdani42/nvim-tree.lua",
cmd = {"NvimTreeToggle", "NvimTreeFocus"},
config = function()
require "plugin-config.nvim-tree"
end,
setup = function()
require("plugin-map").nvimtree()
end
}
use {
"lukas-reineke/indent-blankline.nvim",
config = function()
require "plugin-config.indent-blankline"
end,
event = {"BufReadPre", "BufNewFile"}
}
use {
"ray-x/lsp_signature.nvim",
after = "nvim-lspconfig",
config = function()
require("plugin-config.lsp-sign")
end
}
use {
"glepnir/dashboard-nvim",
event = "BufWinEnter",
config = function()
require "plugin-config.dashboard"
end
}
use {
"folke/which-key.nvim",
event = "BufWinEnter",
config = function()
require("which-key").setup {}
end
}
use {
"windwp/nvim-autopairs",
after = "nvim-cmp",
config = function()
require "plugin-config.autopairs"
end
}
use {
"numToStr/Comment.nvim",
event = "BufReadPre",
config = function()
require("Comment").setup()
end
}
use {
"liuchengxu/vista.vim",
event = {"BufRead", "BufNewFile"},
config = function()
require "plugin-config.vista"
end,
setup = function()
require("plugin-map").vista()
end
}
use {
"ggandor/lightspeed.nvim",
event = "BufReadPre",
config = function()
require "plugin-config.lightspeed"
end
}
use {
"ellisonleao/gruvbox.nvim",
event = "VimEnter",
config = [[vim.cmd('colorscheme gruvbox')]]
}
use {
"ray-x/go.nvim",
event = "VimEnter",
config = function()
require "plugin-config.nvim-go"
end,
requires = {
"ray-x/guihua.lua",
run = "cd lua/fzy && make"
}
}
end
)
|
module(..., package.seeall)
function onCreate(params)
view = View {
scene = scene,
}
scroller = Scroller {
parent = view,
layout = VBoxLayout {
align = {"center", "center"},
padding = {10, 10, 10, 10},
gap = {10, 10},
},
}
for i = 1, 50 do
Button {
parent = scroller,
text = "test" .. i,
}
end
end
function onDestroy()
end
|
Class = require 'lib/class'
Timer = require 'lib/timer'
Signal = require 'lib/signal'
Camera = require 'lib/camera'
require 'src/constants'
require 'src/util'
require 'src/StateMachine'
require 'src/Animation'
require 'src/Target'
require 'src/Lockpick'
require 'src/Lock'
require 'src/TensionWrench'
require 'src/ProgressBar'
-- States
require 'src/states/BaseState'
require 'src/states/StartState'
require 'src/states/PlayState'
require 'src/states/PauseState'
require 'src/states/VictoryState'
require 'src/states/GameOverState'
|
-- sourcing config files.
require("settings")
require("plugins")
require("maps")
require("theme")
require("user_settings")
|
--------------------------------------------------------------------------------
--<[ Модуль GUI ]>--------------------------------------------------------------
--------------------------------------------------------------------------------
GUI = {
screenSize = { x = 0; y = 0; };
browser = nil;
--guiBrowserElement = nil;
overlay = nil;
cursor = { x = 0; y = 0; };
_guiSize = { width = 0; height = 0; scale = 1; };
eventHandlers = {};
toolTip = nil;
guiKeyCodeToName = {}; -- Заполняется при инициализации, берет данные из ARR.guiKeyCodes
init = function()
-- Инициализация массивов "код - название" для кнопок GUI
GUI.guiKeyCodeToName = {
codeToName = ARR.guiKeyCodes;
nameToCode = {};
};
for c, n in pairs( ARR.guiKeyCodes ) do
GUI.guiKeyCodeToName.nameToCode[ n ] = c
end
-- Создание браузера и загрузка GUI
GUI.screenSize.x, GUI.screenSize.y = guiGetScreenSize()
GUI.overlay = guiCreateStaticImage( 0, 0, GUI.screenSize.x, GUI.screenSize.y, "client/data/gui/img/transparent.png", false )
--GUI.guiBrowserElement = guiCreateBrowser( 0, 0, GUI.screenSize.x, GUI.screenSize.y, true, true, false, GUI.overlay )
--GUI.browser = guiGetBrowser( GUI.guiBrowserElement )
GUI._guiSize.scale = CFG.graphics.guiScale
if ( CFG.graphics.guiScale ~= 1 ) then
GUI._guiSize.width, GUI._guiSize.height = GUI.screenSize.x / CFG.graphics.guiScale, GUI.screenSize.y / CFG.graphics.guiScale
local aspect = GUI._guiSize.width / GUI._guiSize.height
if ( GUI._guiSize.width < 960 ) then
GUI._guiSize.width = 960
GUI._guiSize.height = GUI._guiSize.width / aspect
GUI._guiSize.scale = GUI.screenSize.x / GUI._guiSize.width
end
GUI.browser = createBrowser( GUI._guiSize.width, GUI._guiSize.height, true, true )
else
GUI._guiSize.width, GUI._guiSize.height = GUI.screenSize.x, GUI.screenSize.y
GUI.browser = createBrowser( GUI.screenSize.x, GUI.screenSize.y, true, true )
end
Main.setModuleLoaded( "GUI", 0.3 )
addEventHandler( "onClientBrowserCreated", GUI.browser, function()
Main.setModuleLoaded( "GUI", 0.6 )
-- Автоматически включаем консоль, если отладка
if ( DEBUG_MODE ) then
local guiBrowserDevtoolsEnabled = true
toggleBrowserDevTools( GUI.browser, guiBrowserDevtoolsEnabled )
else
local guiBrowserDevtoolsEnabled = false
end
bindKey( "f7", "down", function()
guiBrowserDevtoolsEnabled = not guiBrowserDevtoolsEnabled
toggleBrowserDevTools( GUI.browser, guiBrowserDevtoolsEnabled )
end )
bindKey( "f9", "down", function()
guiSetVisible( GUI.overlay, not guiGetVisible( GUI.overlay ) )
end )
setBrowserAjaxHandler( GUI.browser, "client/data/gui/api.html", GUI.onBrowserEvent )
loadBrowserURL( GUI.browser, "http://mta/local/client/data/gui/index.html" )
addEventHandler( "onClientRender", root, GUI._renderBrowser )
addEventHandler( "onClientMouseMove", getRootElement(), function( x, y )
x = x / GUI._guiSize.scale
y = y / GUI._guiSize.scale
GUI.cursor.x = x
GUI.cursor.y = y
injectBrowserMouseMove( GUI.browser, x, y )
end )
addEventHandler( "onClientClick", root, function( button, state, absoluteX, absoluteY )
if ( state == "down" ) then
injectBrowserMouseDown( GUI.browser, button )
else
injectBrowserMouseUp( GUI.browser, button )
end
end )
addEventHandler( "onClientMouseWheel", getRootElement(), function( upOrDown )
injectBrowserMouseWheel( GUI.browser, 40 * upOrDown, 0 )
end )
focusBrowser( GUI.browser )
addEventHandler( "onClientBrowserDocumentReady", GUI.browser, function()
Main.setModuleLoaded( "GUI", 1 )
end )
end )
-- Если фокус убран из основного GUI, пишем в консоль
addEventHandler( "onClientGUIBlur", GUI.browser, function()
Debug.info( "Основной GUI потерял фокус, возвращаем" )
setTimer( function()
focusBrowser( GUI.browser )
end, 50, 1 )
end )
-- Вызов Lua из браузера
GUI.addBrowserEventHandler( "GUI.RunLua", function( src )
if ( DEBUG_MODE ) then
return jsonEncode( pack( loadstring( src )() ) )
end
end )
end;
-- Вызывается каждый фрейм для отрисовки основного браузера
_renderBrowser = function()
dxDrawImage( 0, 0, GUI.screenSize.x, GUI.screenSize.y, GUI.browser, 0, 0, 0, tocolor(255,255,255,255), false )
end;
-- Отправить в основной браузер Javascript
-- > functionName string - функция, которую необходимо выполнить
-- > ... mixed - аргументы функции
-- = void
sendJS = function( functionName, ... )
if ( GUI.browser == nil ) then
-- Браузер еще не загружен
outputDebugString( "Browser is not loaded yet, can't send JS. See console for passed data" )
outputConsole( dumpvar( arg ) )
return nil
end
js = functionName .. "("
local argCount = #arg
for i, v in ipairs( arg ) do
local argType = type( v )
if ( argType == "string" ) then
js = js .. "'" .. addslashes( v ) .. "'"
elseif ( argType == "boolean" ) then
if ( v ) then js = js .. "true" else js = js .. "false" end
elseif ( argType == "nil" ) then
js = js .. "undefined"
elseif ( argType == "table" ) then
js = js .. jsonEncode( v )
elseif ( argType == "number" ) then
js = js .. v
elseif ( argType == "function" ) then
js = js .. "'" .. addslashes( tostring( v ) ) .. "'"
elseif ( argType == "userdata" ) then
js = js .. "'" .. addslashes( tostring( v ) ) .. "'"
else
outputDebugString( "Unknown type: " .. type( v ) )
end
argCount = argCount - 1;
if ( argCount ~= 0 ) then
js = js .. ","
end
end
js = js .. ");"
executeBrowserJavascript( GUI.browser, js )
end;
-- Добавить обработчик события браузера (вызванного через Main.sendEvent)
-- Если обработчик возвращает не nil, остальные обработчики не вызываются (отправляется ответ в браузер)
-- > eventName string - название события, которое будет вызвано в браузере через Main.sendEvent
-- > handler function - функция, которая будет обрабатывать событие: handler( arg1, ... )
-- = void
addBrowserEventHandler = function( eventName, handler )
if ( GUI.eventHandlers[ eventName ] == nil ) then
GUI.eventHandlers[ eventName ] = {}
end
table.insert( GUI.eventHandlers[ eventName ], handler )
end;
-- Код кнопки в GUI -> название кнопки
-- > keyCode string - код кнопки из GUI
-- = string / nil keyName
keyCodeToKeyName = function( keyCode )
if not validVar( keyCode, "keyCode", "string" ) then return nil end
return GUI.guiKeyCodeToName.codeToName[ keyCode ]
end;
-- Название кнопки -> код кнопки в GUI
-- > keyName string
-- = string / nil keyCode
keyNameToKeyCode = function( keyName )
if not validVar( keyName, "keyName", "string" ) then return nil end
return GUI.guiKeyCodeToName.nameToCode[ keyName ]
end;
----------------------------------------------------------------------------
--<[ Обработчики событий ]>-------------------------------------------------
----------------------------------------------------------------------------
-- Пришло событие от браузера (обработчик ajax-запросов на http://mta/local/client/data/gui/index.html
onBrowserEvent = function( get, post )
local data = jsonDecode( urldecode( post.data ) )
local eventName = data.event
data.event = nil
local newArgs = {}
for k, v in orderedPairs( data ) do
table.insert( newArgs, v )
end
if ( GUI.eventHandlers[ eventName ] ~= nil ) then
for k, v in pairs( GUI.eventHandlers[ eventName ] ) do
local returnValue = v( unpack( newArgs ) )
if ( returnValue ~= nil ) then
return tostring( returnValue )
end
end
end
return "No response"
end;
};
addEventHandler( "onClientResourceStart", resourceRoot, GUI.init ) |
--[[---------------------------------------------------------------------------
functions
---------------------------------------------------------------------------]]
local meta = FindMetaTable("Player")
function meta:addMoney(amount)
if not amount then return false end
local total = self:getDarkRPVar("money") + math.floor(amount)
total = hook.Call("playerWalletChanged", GAMEMODE, self, amount, self:getDarkRPVar("money")) or total
self:setDarkRPVar("money", total)
if self.DarkRPUnInitialized then return end
DarkRP.storeMoney(self, total)
end
function DarkRP.payPlayer(ply1, ply2, amount)
if not IsValid(ply1) or not IsValid(ply2) then return end
ply1:addMoney(-amount)
ply2:addMoney(amount)
end
function meta:payDay()
if not IsValid(self) then return end
if not self:isArrested() then
DarkRP.retrieveSalary(self, function(amount)
amount = math.floor(amount or GAMEMODE.Config.normalsalary)
local suppress, message, hookAmount = hook.Call("playerGetSalary", GAMEMODE, self, amount)
amount = hookAmount or amount
if amount == 0 or not amount then
if not suppress then DarkRP.notify(self, 4, 4, message or DarkRP.getPhrase("payday_unemployed")) end
else
self:addMoney(amount)
if not suppress then DarkRP.notify(self, 4, 4, message or DarkRP.getPhrase("payday_message", DarkRP.formatMoney(amount))) end
end
end)
else
DarkRP.notify(self, 4, 4, DarkRP.getPhrase("payday_missed"))
end
end
function DarkRP.createMoneyBag(pos, amount)
local moneybag = ents.Create(GAMEMODE.Config.MoneyClass)
moneybag:SetPos(pos)
moneybag:Setamount(math.Min(amount, 2147483647))
moneybag:Spawn()
moneybag:Activate()
if GAMEMODE.Config.moneyRemoveTime and GAMEMODE.Config.moneyRemoveTime ~= 0 then
timer.Create("RemoveEnt" .. moneybag:EntIndex(), GAMEMODE.Config.moneyRemoveTime, 1, fn.Partial(SafeRemoveEntity, moneybag))
end
return moneybag
end
--[[---------------------------------------------------------------------------
Commands
---------------------------------------------------------------------------]]
local function GiveMoney(ply, args)
if args == "" then
DarkRP.notify(ply, 1, 4, DarkRP.getPhrase("invalid_x", "argument", ""))
return ""
end
if not tonumber(args) then
DarkRP.notify(ply, 1, 4, DarkRP.getPhrase("invalid_x", "argument", ""))
return ""
end
local trace = ply:GetEyeTrace()
if not IsValid(trace.Entity) or not trace.Entity:IsPlayer() or trace.Entity:GetPos():DistToSqr(ply:GetPos()) >= 22500 then
DarkRP.notify(ply, 1, 4, DarkRP.getPhrase("must_be_looking_at", "player"))
return ""
end
local amount = math.floor(tonumber(args))
if amount < 1 then
DarkRP.notify(ply, 1, 4, DarkRP.getPhrase("invalid_x", "argument", ">=1"))
return ""
end
if not ply:canAfford(amount) then
DarkRP.notify(ply, 1, 4, DarkRP.getPhrase("cant_afford", ""))
return ""
end
local RP = RecipientFilter()
RP:AddAllPlayers()
umsg.Start("anim_giveitem", RP)
umsg.Entity(ply)
umsg.End()
ply.anim_GivingItem = true
timer.Simple(1.2, function()
if not IsValid(ply) then
DarkRP.notify(ply, 1, 4, DarkRP.getPhrase("unable", "/give", ""))
return ""
end
if not ply:canAfford(amount) then
DarkRP.notify(ply, 1, 4, DarkRP.getPhrase("cant_afford", ""))
return ""
end
local trace2 = ply:GetEyeTrace()
if not IsValid(trace2.Entity) or not trace2.Entity:IsPlayer() or trace2.Entity:GetPos():DistToSqr(ply:GetPos()) >= 22500 then return end
DarkRP.payPlayer(ply, trace2.Entity, amount)
hook.Call("playerGaveMoney", nil, ply, trace2.Entity, amount)
DarkRP.notify(trace2.Entity, 0, 4, DarkRP.getPhrase("has_given", ply:Nick(), DarkRP.formatMoney(amount)))
DarkRP.notify(ply, 0, 4, DarkRP.getPhrase("you_gave", trace2.Entity:Nick(), DarkRP.formatMoney(amount)))
DarkRP.log(ply:Nick() .. " (" .. ply:SteamID() .. ") has given " .. DarkRP.formatMoney(amount) .. " to " .. trace2.Entity:Nick() .. " (" .. trace2.Entity:SteamID() .. ")")
end)
return ""
end
DarkRP.defineChatCommand("give", GiveMoney, 0.2)
local function DropMoney(ply, args)
if args == "" then
DarkRP.notify(ply, 1, 4, DarkRP.getPhrase("invalid_x", "argument", ""))
return ""
end
if not tonumber(args) then
DarkRP.notify(ply, 1, 4, DarkRP.getPhrase("invalid_x", "argument", ""))
return ""
end
local amount = math.floor(tonumber(args))
if amount < 1 then
DarkRP.notify(ply, 1, 4, DarkRP.getPhrase("invalid_x", "argument", ">0"))
return ""
end
if amount >= 2147483647 then
DarkRP.notify(ply, 1, 4, DarkRP.getPhrase("invalid_x", "argument", "<2,147,483,647"))
return ""
end
if not ply:canAfford(amount) then
DarkRP.notify(ply, 1, 4, DarkRP.getPhrase("cant_afford", ""))
return ""
end
ply:addMoney(-amount)
local RP = RecipientFilter()
RP:AddAllPlayers()
umsg.Start("anim_dropitem", RP)
umsg.Entity(ply)
umsg.End()
ply.anim_DroppingItem = true
timer.Simple(1, function()
if not IsValid(ply) then return end
local trace = {}
trace.start = ply:EyePos()
trace.endpos = trace.start + ply:GetAimVector() * 85
trace.filter = ply
local tr = util.TraceLine(trace)
local moneybag = DarkRP.createMoneyBag(tr.HitPos, amount)
hook.Call("playerDroppedMoney", nil, ply, amount, moneybag)
DarkRP.log(ply:Nick() .. " (" .. ply:SteamID() .. ") has dropped " .. DarkRP.formatMoney(amount))
end)
return ""
end
DarkRP.defineChatCommand("dropmoney", DropMoney, 0.3)
DarkRP.defineChatCommand("moneydrop", DropMoney, 0.3)
local function CreateCheque(ply, args)
local recipient = DarkRP.findPlayer(args[1])
local amount = tonumber(args[2]) or 0
if not recipient then
DarkRP.notify(ply, 1, 4, DarkRP.getPhrase("invalid_x", "argument", "recipient (1)"))
return ""
end
if amount <= 1 then
DarkRP.notify(ply, 1, 4, DarkRP.getPhrase("invalid_x", "argument", "amount (2)"))
return ""
end
if not ply:canAfford(amount) then
DarkRP.notify(ply, 1, 4, DarkRP.getPhrase("cant_afford", ""))
return ""
end
if IsValid(ply) and IsValid(recipient) then
ply:addMoney(-amount)
end
umsg.Start("anim_dropitem", RecipientFilter():AddAllPlayers())
umsg.Entity(ply)
umsg.End()
ply.anim_DroppingItem = true
timer.Simple(1, function()
if IsValid(ply) and IsValid(recipient) then
local trace = {}
trace.start = ply:EyePos()
trace.endpos = trace.start + ply:GetAimVector() * 85
trace.filter = ply
local tr = util.TraceLine(trace)
local Cheque = ents.Create("darkrp_cheque")
Cheque:SetPos(tr.HitPos)
Cheque:Setowning_ent(ply)
Cheque:Setrecipient(recipient)
local min_amount = math.Min(amount, 2147483647)
Cheque:Setamount(min_amount)
Cheque:Spawn()
hook.Call("playerDroppedCheque", nil, ply, recipient, min_amount, Cheque)
else
DarkRP.notify(ply, 1, 4, DarkRP.getPhrase("unable", "/cheque", ""))
end
end)
return ""
end
DarkRP.defineChatCommand("cheque", CreateCheque, 0.3)
DarkRP.defineChatCommand("check", CreateCheque, 0.3) -- for those of you who can't spell
local function ccSetMoney(ply, args)
if not tonumber(args[2]) then
DarkRP.notify(ply, 1, 4, DarkRP.getPhrase("invalid_x", DarkRP.getPhrase("arguments"), ""))
return
end
local target = DarkRP.findPlayer(args[1])
if not target then
DarkRP.notify(ply, 1, 4, DarkRP.getPhrase("could_not_find", tostring(args[1])))
return
end
local amount = math.floor(tonumber(args[2]))
amount = hook.Call("playerWalletChanged", GAMEMODE, target, amount - target:getDarkRPVar("money"), target:getDarkRPVar("money")) or amount
DarkRP.storeMoney(target, amount)
target:setDarkRPVar("money", amount)
DarkRP.notify(ply, 1, 4, DarkRP.getPhrase("you_set_x_money", target:Nick(), DarkRP.formatMoney(amount), ""))
DarkRP.notify(target, 0, 4, DarkRP.getPhrase("x_set_your_money", ply:EntIndex() == 0 and "Console" or ply:Nick(), DarkRP.formatMoney(amount), ""))
if ply:EntIndex() == 0 then
DarkRP.log("Console set " .. target:SteamName() .. "'s money to " .. DarkRP.formatMoney(amount), Color(30, 30, 30))
else
DarkRP.log(ply:Nick() .. " (" .. ply:SteamID() .. ") set " .. target:SteamName() .. "'s money to " .. DarkRP.formatMoney(amount), Color(30, 30, 30))
end
end
DarkRP.definePrivilegedChatCommand("setmoney", "DarkRP_SetMoney", ccSetMoney)
local function ccAddMoney(ply, args)
if not tonumber(args[2]) then
DarkRP.notify(ply, 1, 4, DarkRP.getPhrase("invalid_x", DarkRP.getPhrase("arguments"), ""))
return
end
local target = DarkRP.findPlayer(args[1])
if not target then
DarkRP.notify(ply, 1, 4, DarkRP.getPhrase("could_not_find", tostring(args[1])))
return
end
local amount = math.floor(tonumber(args[2]))
if target then
target:addMoney(amount)
DarkRP.notify(ply, 1, 4, DarkRP.getPhrase("you_gave", target:Nick(), DarkRP.formatMoney(amount)))
DarkRP.notify(target, 0, 4, DarkRP.getPhrase("x_set_your_money", ply:EntIndex() == 0 and "Console" or ply:Nick(), DarkRP.formatMoney(target:getDarkRPVar("money")), ""))
if ply:EntIndex() == 0 then
DarkRP.log("Console added " .. DarkRP.formatMoney(amount) .. " to " .. target:SteamName() .. "'s wallet", Color(30, 30, 30))
else
DarkRP.log(ply:Nick() .. " (" .. ply:SteamID() .. ") added " .. DarkRP.formatMoney(amount) .. " to " .. target:SteamName() .. "'s wallet", Color(30, 30, 30))
end
else
DarkRP.notify(ply, 1, 4, DarkRP.getPhrase("could_not_find", args[1]))
end
end
DarkRP.definePrivilegedChatCommand("addmoney", "DarkRP_SetMoney", ccAddMoney)
DarkRP.hookStub{
name = "playerGaveMoney",
description = "Called when a player gives another player money.",
parameters = {
{
name = "player",
description = "The player that gives the money.",
type = "Player"
},
{
name = "otherPlayer",
description = "The player that receives the money.",
type = "Player"
},
{
name = "amount",
description = "The amount of money.",
type = "number"
}
},
returns = {
},
realm = "Server"
}
DarkRP.hookStub{
name = "playerDroppedMoney",
description = "Called when a player drops some money.",
parameters = {
{
name = "player",
description = "The player who dropped the money.",
type = "Player"
},
{
name = "amount",
description = "The amount of money dropped.",
type = "number"
},
{
name = "entity",
description = "The entity of the money that was dropped.",
type = "Entity"
}
},
returns = {
},
realm = "Server"
}
DarkRP.hookStub{
name = "playerDroppedCheque",
description = "Called when a player drops a cheque.",
parameters = {
{
name = "player",
description = "The player who dropped the cheque.",
type = "Player"
},
{
name = "player",
description = "The player the cheque was written to.",
type = "Player"
},
{
name = "amount",
description = "The amount of money the cheque has.",
type = "number"
},
{
name = "entity",
description = "The entity of the cheque that was dropped.",
type = "Entity"
}
},
returns = {
},
realm = "Server"
}
|
SERVER_LIST = {}
RANK_LOOKUP = {}
function LoadExternData()
LoadServers()
LoadPlayers()
end
function LoadServers()
cPluginManager:BindCommand("/transfer", "pepsiutils.transfer", CommandTransfer, "")
cPluginManager:BindConsoleCommand("transfer", ConsoleCommandTransfer, "")
cUrlClient:Get("https://gist.githubusercontent.com/DaMatrix/8b7ff92fcc7e49c0f511a8ed207d8e92/raw/teampepsi-server-list.json",
function(a_Body, a_Data)
if (a_Body) then
local tempList = cJson:Parse(a_Body)
for id, data in pairs(tempList) do
SERVER_LIST[id] = data
SERVER_LIST["/" .. id] = data
data.id = id
local aliasesString = nil
for _, alias in pairs(data.aliases) do
if (id ~= alias) then
if (SERVER_LIST[alias] ~= nil or SERVER_LIST["/" .. alias] ~= nil) then
LOGERROR("Duplicate server alias: " .. alias)
else
SERVER_LIST[alias] = data
SERVER_LIST["/" .. alias] = data
end
--cPluginManager:BindCommand("/" .. alias, data.public and "core.help" or "core.ban", CommandChangeServer, "§7 - Warp to §l" .. data.displayname)
cPluginManager:BindCommand("/" .. alias, data.public and "core.help" or "pepsiutils.transfer." .. id, CommandChangeServer, "")
if (aliasesString == nil) then
aliasesString = "/" .. alias
else
aliasesString = aliasesString .. ", /" .. alias
end
end
end
cPluginManager:BindCommand("/" .. id, data.public and "core.help" or "pepsiutils.transfer." .. id, CommandChangeServer, "§7 - Warp to §l" .. data.displayname .. (aliasesString == nil and "" or ("§r§7 (aliases: " .. aliasesString .. ")")))
end
else
LOGERROR("Unable to fetch server list!!!")
LOGERROR(a_Data)
end
end)
end
function LoadPlayers()
cUrlClient:Get("https://gist.githubusercontent.com/DaMatrix/8b7ff92fcc7e49c0f511a8ed207d8e92/raw/teampepsi-server-players.json",
function(a_Body, a_Data)
if (a_Body) then
local tempList = cJson:Parse(a_Body)
for _, data in pairs(tempList) do
if (#data.name > 0) then
--cRankManager:RemoveRank(data.name)
cRankManager:AddRank(data.name, "", "", data.prefix)
cRankManager:SetRankVisuals(data.name, "", "", data.prefix)
cRankManager:AddGroupToRank(data.name == "Admin" and "Everything" or "Default", data.name)
for _, uuid in pairs(data.members) do
--aUUID:FromString(uuid)
--cRankManager:SetPlayerRank(uuid, cMojangAPI:GetPlayerNameFromUUID(uuid), data.name)
--cRankManager:SetPlayerRank(uuid, "jeff", data.name)
--LOG("Fetching name for " .. uuid .. "...")
--LOG(uuid .. " => " .. cMojangAPI:GetPlayerNameFromUUID(aUUID))
RANK_LOOKUP[cMojangAPI:MakeUUIDShort(uuid)] = data.name
cRoot:Get():DoWithPlayerByUUID(uuid, OnPlayerJoined)
end
end
end
else
LOGERROR("Unable to fetch server list!!!")
LOGERROR(a_Data)
end
end)
end
function CommandChangeServer(a_Split, a_Player)
local data = SERVER_LIST[a_Split[1]]
if (data == nil) then
a_Player:SendMessage("§cUnknown server: §l" .. a_Split[1])
else
BungeeTransferPlayer(a_Player, data.id, data.displayname)
end
return true
end
function CommandTransfer(a_Split, a_Player)
if (#a_Split ~= 3) then
if (a_Player == nil) then
LOGERROR("Usage: /transfer <player> <destination>")
else
a_Player:SendMessage("§cUsage: §l/transfer <player> <destination>")
end
return false
end
local data = SERVER_LIST[a_Split[3]]
if (data == nil) then
if (a_Player == nil) then
LOGERROR("Unknown server: " .. a_Split[3])
else
a_Player:SendMessage("§cUnknown server: " .. a_Split[3])
end
return false
elseif (not cRoot:Get():FindAndDoWithPlayer(a_Split[2], function(a_Player)
BungeeTransferPlayer(a_Player, data.id, data.displayname)
end)) then
if (a_Player == nil) then
LOGERROR("Unknown player: " .. a_Split[2])
else
a_Player:SendMessage("§cUnknown player: " .. a_Split[2])
end
return false
end
if (a_Player ~= nil) then
a_Player:SendMessage("§9Transferred §l" .. a_Split[2] .. "§r§9 to §l" .. a_Split[2] .. "§r§9!")
end
return true
end
function ConsoleCommandTransfer(a_Split)
return CommandTransfer(a_Split, nil)
end
|
local Draw = require("api.Draw")
local Gui = require("api.Gui")
local Chara = require("api.Chara")
local EquipmentMenu = require("api.gui.menu.EquipmentMenu")
local FeatsMenu = require("api.gui.menu.FeatsMenu")
local MaterialsMenu = require("api.gui.menu.MaterialsMenu")
local CharacterInfoMenu = require("api.gui.menu.CharacterInfoMenu")
local IInput = require("api.gui.IInput")
local IUiLayer = require("api.gui.IUiLayer")
local IconBar = require("api.gui.menu.IconBar")
local InputHandler = require("api.gui.InputHandler")
local UiTheme = require("api.gui.UiTheme")
local CharacterInfoWrapper = class.class("CharacterInfoWrapper", IUiLayer)
CharacterInfoWrapper:delegate("input", IInput)
function CharacterInfoWrapper:init(player, starting_menu)
self.x = 0
self.y = 0
self.width = Draw.get_width()
self.height = Draw.get_height()
self.player = player
self.input = InputHandler:new()
self.input:bind_keys(self:make_keymap())
self.submenu = nil
self.icon_bar = IconBar:new("inventory_icons", self:make_key_hints())
self.icon_bar:set_data {
{ icon = 9, text = "ui.menu.chara.chara" },
{ icon = 10, text = "ui.menu.chara.wear" },
{ icon = 11, text = "ui.menu.chara.feat" },
{ icon = 12, text = "ui.menu.chara.material" },
}
self.menus = {
CharacterInfoMenu,
EquipmentMenu,
FeatsMenu,
MaterialsMenu
}
if starting_menu then
self.selected_index = table.index_of(self.menus, starting_menu)
if self.selected_index == nil then
error(("Unknown chara info menu %s"):format(starting_menu))
end
else
self.selected_index = 1
end
self.menus = fun.iter(self.menus)
:map(function(klass) return klass:new(self.player) end)
:to_list()
self:switch_context()
end
function CharacterInfoWrapper:make_keymap()
return {
previous_page = function() self:previous_menu() end,
next_page = function() self:next_menu() end,
raw_ctrl_tab = function() self:previous_menu() end,
raw_tab = function() self:next_menu() end,
}
end
function CharacterInfoWrapper:make_key_hints()
return {
{
action = "ui.key_hint.action.switch_menu",
keys = { "previous_page", "next_page", "raw_tab", "raw_ctrl_tab" }
}
}
end
function CharacterInfoWrapper:next_menu()
self.selected_index = self.selected_index + 1
if self.selected_index > #self.menus then
self.selected_index = 1
end
self:switch_context()
end
function CharacterInfoWrapper:previous_menu()
self.selected_index = self.selected_index - 1
if self.selected_index < 1 then
self.selected_index = #self.menus
end
self:switch_context()
end
function CharacterInfoWrapper:switch_context()
self.submenu = self.menus[self.selected_index]
self.input:forward_to(self.submenu)
self.submenu:on_query()
self.icon_bar:select(self.selected_index)
self.submenu:relayout(self.x, self.y + 25, self.width, self.height)
end
function CharacterInfoWrapper:relayout(x, y, width, height)
self.x = x or 0
self.y = y or 0
self.width = width or Draw.get_width()
self.height = height or Draw.get_height()
self.t = UiTheme.load(self)
self.icon_bar:relayout(self.width - (44 * #self.menus + 60), 34, 44 * #self.menus + 40, 22)
self.submenu:relayout(self.x, self.y + 25, self.width, self.height)
end
function CharacterInfoWrapper:draw()
Draw.set_color(255, 255, 255)
self.submenu:draw()
self.icon_bar:draw()
end
function CharacterInfoWrapper:update()
local self_canceled = self.canceled
local result, canceled = self.submenu:update()
self.canceled = false
if self_canceled or canceled or result then
-- We have to check if the player changed equipment in the equipment menu
-- at some point, to ensure their turn gets ended.
for _, menu in ipairs(self.menus) do
if menu.on_exit_result then
local result, canceled = menu:on_exit_result()
if result or canceled then
return result, canceled
end
end
end
if canceled or self_canceled then
return nil, "canceled"
elseif result then
return result
end
end
end
function CharacterInfoWrapper:release()
self.icon_bar:release()
end
return CharacterInfoWrapper
|
--
-- ─── COMMON TYPES ───────────────────────────────────────────────────────────────
--
---@class Global
_G = _G
---Vector aliases
---@alias X_AXIS number|nil
---@alias Y_AXIS number|nil
---@alias Z_AXIS number|nil
--- vector { x-axis, y-axis }
---@class vector
---@field x X_AXIS
---@field y Y_AXIS
---@type vector
local vector
vector.x = 0
vector.y = 0
--- vector3 { x-axis, y-axis, z-axis }
---@class vector3
---@field x X_AXIS
---@field y Y_AXIS
---@field z Z_AXIS
---@type vector3
local vector3
vector3.x = 0
vector3.y = 0
vector3.z = 0
--
-- ─── CRYACTION ──────────────────────────────────────────────────────────────────
--
--- CE3 CryAction Class
---| Contains basic Engine methods
---@class CryAction
local CryAction = CryAction
---* Are we Running onClient
---@return boolean
function CryAction.IsClient() end
---* Are we Running onServer
---@return boolean
function CryAction.IsDedicatedServer() end
--
-- ─── SYSTEM ─────────────────────────────────────────────────────────────────────
--
--- CE3 System Class
---| Essential CE Methods eg Entities,CVars
---@class System
local System = System
---* Fetch an Entity using its entityId
---@param entityId entityId
---@return entity
function System.GetEntity(entityId) end
---* Fetch an Entity using its Name
---@param name string
---@return entity
function System.GetEntityByName(name) end
---* Returns the Class of an Entity by its entityId
---@param entityId entityId
---@return string
function System.GetEntityClass(entityId) end
---* Fetch All Entities
---@return table
function System.GetEntities() end
---* Fetch All Entities of a Specified Class
---@param class string
---@return table
function System.GetEntitiesByClass(class) end
--
-- ─── CRYACTION ──────────────────────────────────────────────────────────────────
--
_G["CryAction"] = {}
---* Are we Running onClient
---@return boolean
function CryAction.IsClient() end
---* Are we Running onServer
---@return boolean
function CryAction.IsDedicatedServer() end
--
-- ─── SYSTEM ─────────────────────────────────────────────────────────────────────
--
_G["System"] = {}
---* Fetch an Entity using its entityId
---@param entityId userdata
---@return entity
function System.GetEntity(entityId) end
---* Fetch an Entity using its Name
---@param name string
---@return entity
function System.GetEntityByName(name) end
---* Returns the Class of an Entity by its entityId
---@param entityId userdata
---@return string
function System.GetEntityClass(entityId) end
---* Fetch All Entities
---@return table
function System.GetEntities() end
---* Fetch All Entities of a Specified Class
---@param class string
---@return table
function System.GetEntitiesByClass(class) end
--
-- ─── SCRIPT ─────────────────────────────────────────────────────────────────────
--
_G["Script"] = {}
---* Reload a Script Folder
---@param path string
function Script.LoadScriptFolder(path) end
---* Reload a Script
---@param path string
function Script.ReloadScript(path) end
---* call a function to after specified timer
---@param milli number miliseconds, timer
---@param f function function, to run
---@return userdata timerId
function Script.SetTimer(milli,f,...) end
---* set a function to run after specified timer
---@param milli number miliseconds, timer
---@param f function function, to run
---@return userdata timerId
function Script.SetTimerForFunction(milli,f,...) end
---* Use SafeKillTimer(timerId) instead, Kill an Active timer by timerId
---@param timerId userdata
function Script.KillTimer(timerId) end
--- Base GameRules Class
_G["GameRules"] = {}
---* Send a Message to a Player.
---| msgtype can be either 0 or 4
---@param msgtype number
---@param playerId entityId
---@param message string
function GameRules:SendTextMessage(msgtype,playerId,message) end
g_gameRules = { game = GameRules } |
local base = require 'hj212.calc.db'
local siri_data = require 'db.siridb.data'
local siri_series = require 'db.siridb.series'
local data_merge = require 'siridb.data_merge'
local cjson = require 'cjson.safe'
local poll = base:subclass('siridb.poll')
function poll:initialize(hisdb, poll_id, no_db)
self._hisdb = hisdb
self._poll_id = poll_id
self._samples = {}
self._no_db = no_db
self._value_type_map = {}
self._db_map = {}
end
local function map_value_type(v_type)
if v_type == 'DOUBLE' then
return 'float'
elseif v_type == 'INTEGER' then
return 'int'
else
return 'string'
end
end
function poll:init()
if self._no_db then
return true
end
local meta = self:sample_meta()
for _, v in ipairs(meta) do
self._value_type_map['SAMPLE.'..v.name] = map_value_type(v.type)
end
self._db_map['SAMPLE'] = assert(self._hisdb:db('SAMPLE'))
meta = self:rdata_meta()
for _, v in ipairs(meta) do
self._value_type_map['RDATA.'..v.name] = map_value_type(v.type)
end
self._db_map['RDATA'] = assert(self._hisdb:db('RDATA'))
meta = self:cou_meta()
for _, v in ipairs(meta) do
self._value_type_map['MIN.'..v.name] = map_value_type(v.type)
self._value_type_map['HOUR.'..v.name] = map_value_type(v.type)
self._value_type_map['DAY.'..v.name] = map_value_type(v.type)
end
self._db_map['MIN'] = assert(self._hisdb:db('MIN'))
self._db_map['HOUR'] = assert(self._hisdb:db('HOUR'))
self._db_map['DAY'] = assert(self._hisdb:db('DAY'))
return true
end
function poll:get_value_type(cate, prop)
if prop == 'timestamp' then
return nil
end
local k = cate..'.'..prop
local vt = self._value_type_map[k]
if vt then
return vt
end
--print(self._poll_id, cate, prop)
return nil -- skipped those data
end
function poll:push_sample(data)
table.insert(self._samples, data)
if #self._samples > 3600 then
assert(nil, 'Tag Name:'..self._poll_id..'\t reach max sample data unsaving')
self._samples = {}
end
end
function poll:save_samples()
local list = self._samples
if #list == 0 then
return true
end
self._samples = {}
return self:write('SAMPLE', list, true)
end
function poll:read_samples(start_time, end_time)
return self:read('SAMPLE', start_time, end_time)
end
--[[
select * from /RDATA.a00000.*/ after 1611980819000
--]]
local read_sql = 'select * from /%s.%s.*/ between %d and %d'
local function build_read(cate, name, stime, etime)
return string.format(read_sql, cate, name, math.floor(stime * 1000), math.floor(etime * 1000) + 1)
end
function poll:read(cate, start_time, end_time)
assert(cate and start_time and end_time)
if self._no_db then
return
end
local poll_id = self._poll_id
local db = assert(self._db_map[cate], 'CATE:'..cate..' not found')
local sql = build_read(cate, poll_id, start_time, end_time)
local data, err = db:query(sql)
if not data then
--TODO: Log error
return {}
end
local dm = data_merge:new()
for name, values in pairs(data) do
local c, n, k, t = string.match(name, '^([^%.]+)%.([^%.]+)%.([^%.]+)%.(.+)$')
if not c or c ~= cate or n ~= poll_id then
goto CONTINUE
end
local vt = self:get_value_type(cate, k)
if vt and vt == t then
dm:push_kv(k, values, 0.001)
else
-- Skip vt not found values
end
::CONTINUE::
end
--[[
local cjson = require 'cjson.safe'
print(poll_id, cate, start_time, end_time)
print(cjson.encode(dm:data()))
]]--
return dm:data()
end
function poll:write(cate, data, is_array)
if self._no_db then
return true
end
local db_data = siri_data:new()
if not is_array then
data = {data}
end
local series_map = {}
for _, d in ipairs(data) do
for k, v in pairs(d) do
local val = v
local series = series_map[k]
if not series and k ~= 'timestamp' then
local vt = self:get_value_type(cate, k)
if vt then
local name = cate..'.'..self._poll_id..'.'..k..'.'..vt
--print(name, vt)
series = siri_series:new(name, vt)
series_map[k] = series
db_data:add_series(name, series)
end
end
if series then
series:push_value(val, assert(d.timestamp))
end
end
end
local db = assert(self._db_map[cate])
return db:insert(db_data)
end
return poll
|
-- API
local UTIL_API = require(script:GetCustomProperty("MetaAbilityProgressionUTIL_API"))
local _Constants_API = require(script:GetCustomProperty("Constants_API"))
local CURRENCY = _Constants_API:WaitForConstant("Currency")
local XP = _Constants_API:WaitForConstant("XP")
local viewRange = script:GetCustomProperty("ViewRange")
local spottingXP = XP.SPOTTED_ENEMY.XP_AMOUNT
local TANKS = _Constants_API:WaitForConstant("Tanks")
local spottingList = {}
local viewPointList = {}
local viewRangeList = {}
local damageOverride ={}
local spottingTask = nil
while(_G.utils == nil) do
Task.Wait()
end
-- other modified scripts to support spotting: NameplateControllerClient, Minimap
--[[
local spottingServer = script:GetCustomProperty("GAMEHELPER_SpottingServer"):WaitForObject()
function CheckSpotting(player)
for i=1, 16 do
if spottingServer:GetCustomProperty("P" .. tostring(i)) == player.id then
return true
end
end
return false
end
]]
function AddToList(player, fromDamageOverride)
if spottingList[player.id] or (damageOverride[player.id] and not fromDamageOverride) then
return false
end
spottingList[player.id] = true
print(player.name .. " added to spotted list")
for i=1, 16 do
if script:GetCustomProperty("P" .. tostring(i)) == "" then
script:SetNetworkedCustomProperty("P" .. tostring(i), player.id)
return true
end
end
end
function RemoveFromList(player)
if not spottingList[player.id] or damageOverride[player.id] then
return
end
spottingList[player.id] = nil
print(player.name .. " removed from spotted list")
for i=1, 16 do
if script:GetCustomProperty("P" .. tostring(i)) == player.id then
script:SetNetworkedCustomProperty("P" .. tostring(i), "")
end
end
end
function SetViewPoint(player)
if Object.IsValid(viewPointList[player.id]) then
--print(player.name .. " still has a valid viewpoint")
return
end
if not player.serverUserData.currentTankData or not Object.IsValid(player.serverUserData.currentTankData.hitbox) then
--print(player.name .. " has invalid server tank data")
return
end
viewPointList[player.id] = player.serverUserData.currentTankData.hitbox:FindDescendantByName("ViewPoint")
viewRangeList[player.id] = tonumber(player.serverUserData.currentTankData.viewRange) or viewRange
print(player.name .. " viewpoint set")
print(player.name .. " has a viewrange of " .. tostring(viewRangeList[player.id]) .. " units")
end
function Tick()
--local playerList = Game.GetPlayers()
local playerList = _G.utils.GetTankDrivers()
for x, p in pairs(playerList) do
SetViewPoint(p)
--local otherPlayerList = Game.GetPlayers({ignoreDead = true, ignorePlayers = p, ignoreTeams = p.team})
local otherPlayerList = _G.utils.GetTankDrivers({ignoreDead = true, ignorePlayers = p, ignoreTeams = p.team})
for x2, p2 in pairs(otherPlayerList) do
SetViewPoint(p2)
if Object.IsValid(viewPointList[p.id]) and Object.IsValid(viewPointList[p2.id]) then
--print("-")
--print((viewPointList[p.id]:GetWorldPosition() - viewPointList[p2.id]:GetWorldPosition()).size)
--print(viewRangeList[p2.id])
if (viewPointList[p.id]:GetWorldPosition() - viewPointList[p2.id]:GetWorldPosition()).size <= viewRangeList[p2.id] then
local raycastResult = World.Raycast(viewPointList[p2.id]:GetWorldPosition(), viewPointList[p.id]:GetWorldPosition(), {ignoreTeams = p.team})
if raycastResult then
--print("raycast has a result")
local possibleTank = raycastResult.other:FindAncestorByType("Vehicle")
if possibleTank then
if possibleTank.driver == p then
--print("raycast lead to correct vehicle")
local listResult = AddToList(p, false)
if p2:IsA("Player") and listResult then
-- Add XP
Events.Broadcast("PlayerSpotted", p2, spottingXP)
Events.BroadcastToPlayer(p2, "GainXP", {reason = "SPOTTED_ENEMY", amount = spottingXP})
end
else
--print("raycast did not lead to " .. p.name)
RemoveFromList(p)
end
break
end
else
--print("Raycast does not have a result, tanks are within line of sight")
local listResult = AddToList(p, false)
if p2:IsA("Player") and listResult then
-- Add XP
Events.Broadcast("PlayerSpotted", p2, spottingXP)
Events.BroadcastToPlayer(p2, "GainXP", {reason = "SPOTTED_ENEMY", amount = spottingXP})
end
break
end
end
end
--print(p.name .. " - " .. tostring(viewPointList[p.id]) .. ", " .. p2.name .. " - " .. tostring(viewPointList[p2.id]))
RemoveFromList(p)
end
end
Task.Wait(1)
end
function OnDamaged(player, damage)
damageOverride[player.id] = true
AddToList(player, true)
Task.Wait(5)
if _G.utils.IsDriverValid(player) then
damageOverride[player.id] = nil
end
end
function OnJoin(player)
player.damagedEvent:Connect(OnDamaged)
end
Game.playerJoinedEvent:Connect(OnJoin) |
module(..., package.seeall)
local pcap = require("apps.pcap.pcap")
local dpdkdev = require("apps.dpdk_device.dpdk_device")
local packet_counter = require("apps.packet_counter.packet_counter")
local log = require("log")
function run(parameters)
log:info("running example_packet_loop")
if #parameters ~= 3 then
log:warn("Usage: example_packet_loop <pcap-input> <output-dev-id> <input-dev-id>\nexiting...")
main.exit(1)
end
local infile = parameters[1]
local outdevid = tonumber(parameters[2])
local indevid = tonumber(parameters[3])
log:debug("infile %s, outdevid %d, indevid %d", infile, outdevid, indevid)
local c = config.new()
config.app(c, "replay", pcap.PcapReader, infile)
config.app(c, "playback", dpdkdev.DPDKDevice, outdevid)
config.app(c, "receive", dpdkdev.DPDKDevice, indevid)
config.app(c, "counter", packet_counter.PacketCounter)
config.link(c, "replay.output -> playback.input")
config.link(c, "receive.output -> counter.input")
engine.configure(c)
engine.main{duration = 0.1}
end
|
local metadata =
{
plugin =
{
format = "staticLibrary",
-- This is the name without the 'lib' prefix.
-- In this case, the static library is called: libSTATIC_LIB_NAME.a
staticLibs = { "FirebaseMessaging", "Protobuf" },
frameworks = {},
frameworksOptional = {}
}
},
coronaManifest = {
dependencies = {
["shared.firebase.core"] = "com.coronalabs"
}
}
return metadata
|
ys = ys or {}
slot1 = ys.Battle.BattleConfig
ys.Battle.BattleMainDamagedView = class("BattleMainDamagedView")
slot2 = class("BattleMainDamagedView")
ys.Battle.BattleMainDamagedView = slot2
slot2.__name = "BattleMainDamagedView"
slot2.Ctor = function (slot0, slot1)
slot0._go = slot1
slot0:Init()
end
slot2.Init = function (slot0)
slot0._tf = slot0._go.transform
slot0._bleedView = findTF(slot0._tf, "mainUnitDamaged")
slot0._bleedAnimation = slot0._bleedView:GetComponent(typeof(Animator))
slot0._bleedView:GetComponent(typeof(DftAniEvent)).SetEndEvent(slot1, function (slot0)
setActive(slot0._bleedView, false)
slot0._isPlaying = false
end)
setActive(slot0._bleedView, false)
slot0._isPlaying = false
end
slot2.Play = function (slot0)
if not slot0._isPlaying then
setActive(slot0._bleedView, true)
end
slot0._isPlaying = true
end
slot2.Dispose = function (slot0)
slot0._bleedView = nil
slot0._bleedAnimation = nil
slot0._tf = nil
slot0._go = nil
end
return
|
function love.conf(t)
t.title = "Hello, Punchdrunk"
t.author = "Tanner Rogalsky"
t.identity = "punchdrunk"
t.window.width = 900
t.window.height = 300
t.modules.joystick = true
t.modules.audio = true
t.modules.keyboard = true
t.modules.event = true
t.modules.image = true
t.modules.graphics = true
t.modules.timer = true
t.modules.mouse = true
t.modules.sound = true
t.modules.physics = true
end
|
-- Weak tables, defaults example
defaults = {}
-- Weakly keyed
setmetatable(defaults, {__mode = "k"})
function setDefault(t, d)
defaults[t] = d
setmetatable(t, {__index = function (t, _) return defaults[t] end})
end
ttab = {}
ttab['first'] = {a = 5, b = 10} -- bind table A
setDefault(ttab['first'], 0) -- enroll
for k,v in pairs(ttab['first']) do
print(k, v)
end
print(ttab['first'].c)
ttab['first'] = {} -- A sieces use
collectgarbage()
-- defaults is empty, A has no references
for k,v in pairs(defaults) do print(k) end |
local require = require
return function(mode)
return require(""..mode)
end |
inspect = require('inspect')
raw = [[
pid,name,country,languages,description
123,Tom,CN,zh-hans,hello hi
456,Jason,US,["en", "zh", "ja", "fr"],this is a person description
]]
function enumerate (tb)
local i = 0
return function ()
i = i + 1
if i <= #tb then return i, tb[i] end
end
end
function enumerate_line(content)
local i = 0
return function ()
i = i + 1
local pos = string.find(content, '\n')
if not pos then pos = 1 end
local line = string.sub(content, 1, pos - 1)
line = string.gsub(string.gsub(line, '^%s+', ''), '%s+$', '')
if string.len(line) > 0 and pos <= #content then
content = string.sub(content, pos + 1)
return i, line
end
end
end
tb = {}
for i, line in enumerate_line(raw) do
print(i, line)
end
print('[ OK. ]')
|
--chest code from default(Copyright (C) 2012 celeron55, Perttu Ahola <celeron55@gmail.com>)
local chest_formspec =
"size[8,9]" ..
default.gui_bg ..
default.gui_bg_img ..
default.gui_slots ..
"list[current_name;main;0,0.3;8,4;]" ..
"list[current_player;main;0,4.85;8,1;]" ..
"list[current_player;main;0,6.08;8,3;8]" ..
"listring[current_name;main]" ..
"listring[current_player;main]" ..
default.get_hotbar_bg(0,4.85)
-- Helper functions
local function drop_chest_stuff()
return function(pos, oldnode, oldmetadata, digger)
local meta = minetest.get_meta(pos)
meta:from_table(oldmetadata)
local inv = meta:get_inventory()
for i = 1, inv:get_size("main") do
local stack = inv:get_stack("main", i)
if not stack:is_empty() then
local p = {
x = pos.x + math.random(0, 5)/5 - 0.5,
y = pos.y,
z = pos.z + math.random(0, 5)/5 - 0.5}
minetest.add_item(p, stack)
end
end
end
end
--chest code Copyright (C) 2011-2012 celeron55, Perttu Ahola <celeron55@gmail.com>
minetest.register_node("scifi_nodes:crate", {
description = "Crate",
tiles = {"scifi_nodes_crate.png"},
paramtype2 = "facedir",
groups = {cracky = 1, oddly_breakable_by_hand = 2, fuel = 8},
legacy_facedir_simple = true,
is_ground_content = false,
sounds = scifi_nodes.node_sound_wood_defaults(),
after_dig_node = drop_chest_stuff(),
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("formspec", chest_formspec)
meta:set_string("infotext", "Crate")
local inv = meta:get_inventory()
inv:set_size("main", 8 * 4)
end,
on_metadata_inventory_move = function(pos, from_list, from_index,
to_list, to_index, count, player)
minetest.log("action", player:get_player_name() ..
" moves stuff in chest at " .. minetest.pos_to_string(pos))
end,
on_metadata_inventory_put = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name() ..
" moves stuff to chest at " .. minetest.pos_to_string(pos))
end,
on_metadata_inventory_take = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name() ..
" takes stuff from chest at " .. minetest.pos_to_string(pos))
end,
})
minetest.register_node("scifi_nodes:box", {
description = "Storage box",
tiles = {
"scifi_nodes_box_top.png",
"scifi_nodes_box_top.png",
"scifi_nodes_box.png",
"scifi_nodes_box.png",
"scifi_nodes_box.png",
"scifi_nodes_box.png"
},
paramtype2 = "facedir",
groups = {cracky = 1},
legacy_facedir_simple = true,
is_ground_content = false,
sounds = scifi_nodes.node_sound_metal_defaults(),
after_dig_node = drop_chest_stuff(),
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("formspec", chest_formspec)
meta:set_string("infotext", "Box")
local inv = meta:get_inventory()
inv:set_size("main", 8 * 4)
end,
on_metadata_inventory_move = function(pos, from_list, from_index,
to_list, to_index, count, player)
minetest.log("action", player:get_player_name() ..
" moves stuff in chest at " .. minetest.pos_to_string(pos))
end,
on_metadata_inventory_put = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name() ..
" moves stuff to chest at " .. minetest.pos_to_string(pos))
end,
on_metadata_inventory_take = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name() ..
" takes stuff from chest at " .. minetest.pos_to_string(pos))
end,
})
--end of chest code |
-- Test all of the special levels
local special_levels = {
"air",
"asmodeus",
"astral",
"baalz",
"bigrm-10",
"bigrm-1",
"bigrm-2",
"bigrm-3",
"bigrm-4",
"bigrm-5",
"bigrm-6",
"bigrm-7",
"bigrm-8",
"bigrm-9",
"castle",
"earth",
"fakewiz1",
"fakewiz2",
"fire",
"juiblex",
"knox",
"medusa-1",
"medusa-2",
"medusa-3",
"medusa-4",
"minefill",
"minend-1",
"minend-2",
"minend-3",
"minetn-1",
"minetn-2",
"minetn-3",
"minetn-4",
"minetn-5",
"minetn-6",
"minetn-7",
"oracle",
"orcus",
"sanctum",
"soko1-1",
"soko1-2",
"soko2-1",
"soko2-2",
"soko3-1",
"soko3-2",
"soko4-1",
"soko4-2",
"tower1",
"tower2",
"tower3",
"valley",
"water",
"wizard1",
"wizard2",
"wizard3"
}
local roles = { "Arc", "Bar", "Cav", "Hea", "Kni", "Mon", "Pri", "Ran", "Rog", "Sam", "Tou", "Val", "Wiz" }
local questlevs = { "fila", "filb", "goal", "loca", "strt" }
for _,role in ipairs(roles) do
for _,qlev in ipairs(questlevs) do
local lev = role .. "-" .. qlev
table.insert(special_levels, lev)
end
end
for _,lev in ipairs(special_levels) do
des.reset_level();
require(lev)
end
|
--[[====================================
Example.lua
Original Code by zdroid9770
Version 9
========================================]]--
-- % Complete: 90%
-- Defias Bandit
function DB_OnCombat(Unit, Event)
Unit:RegisterEvent("DB_SKck", 10000, 0)
end
function DB_SKck(pUnit, Event)
local plr = pUnit:GetMainTank()
if (plr ~= nil) then
z pUnit:FullCastSpellOnTarget(8646, plr)
end
end
function DB_OnDied(Unit, Event)
Unit:RemoveEvents()
end
function DB_OnLeaveCombat(Unit, Event)
Unit:RemoveEvents()
end
RegisterUnitEvent(116, 1, "DB_OnCombat")
RegisterUnitEvent(116, 2, "DB_OnLeaveCombat")
RegisterUnitEvent(116, 4, "DB_OnDied")
-- Defias Bodyguard
function DB_OnCombat(Unit, Event)
Unit:RegisterEvent("DB_BS", 5000, 0)
Unit:RegisterEvent("DB_Dis", 15000, 0)
end
function DB_BS(pUnit, Event)
local plr = pUnit:GetMainTank()
if (plr ~= nil) then
pUnit:FullCastSpellOnTarget(7159, plr)
end
end
function DB_Dis(pUnit, Event)
local plr = pUnit:GetMainTank()
if (plr ~= nil) then
pUnit:FullCastSpellOnTarget(6713, plr)
end
end
function DB_OnDied(Unit, Event)
Unit:RemoveEvents()
end
function DB_OnLeaveCombat(Unit, Event)
Unit:RemoveEvents()
end
RegisterUnitEvent(6866, 1, "DB_OnCombat")
RegisterUnitEvent(6866, 2, "DB_OnLeaveCombat")
RegisterUnitEvent(6866, 4, "DB_OnDied")
--[[ Defias Cutpurse
function DC_OnCombat(Unit, Event)
Unit:RegisterEvent("DB_BSi", 5000, 0)
end
function DC_BSi(pUnit, Event)
local plr = pUnit:GetMainTank()
if (plr ~= nil) then
pUnit:FullCastSpellOnTarget(7159, plr)
end
end
function DC_OnDied(Unit, Event)
Unit:RemoveEvents()
end
function DC_OnLeaveCombat(Unit, Event)
Unit:RemoveEvents()
end
RegisterUnitEvent(94, 1, "DC_OnCombat")
RegisterUnitEvent(94, 2, "DC_OnLeaveCombat")
RegisterUnitEvent(94, 4, "DC_OnDied")]]--
-- Defias Dockworker
function DD_OnCombat(Unit, Event)
Unit:RegisterEvent("DD_SK", 10000, 0)
end
function DD_SK(pUnit, Event)
local plr = pUnit:GetMainTank()
if (plr ~= nil) then
pUnit:FullCastSpellOnTarget(8646, plr)
end
end
function DD_OnDied(Unit, Event)
Unit:RemoveEvents()
end
function DD_OnLeaveCombat(Unit, Event)
Unit:RemoveEvents()
end
RegisterUnitEvent(6927, 1, "DD_OnCombat")
RegisterUnitEvent(6927, 2, "DD_OnLeaveCombat")
RegisterUnitEvent(6927, 4, "DD_OnDied")
-- Defias Rogue Wizard
function DRW_OnCombat(Unit, Event)
Unit:RegisterEvent("DRW_FBt", 3000, 0)
Unit:RegisterEvent("DRW_FA", 10000, 1)
end
function DRW_FBt(pUnit, Event)
local plr = pUnit:GetMainTank()
if (plr ~= nil) then
pUnit:FullCastSpellOnTarget(13322, plr)
end
end
function DRW_FA(Unit, Event)
Unit:CastSpell(12544)
end
function DRW_OnDied(Unit, Event)
Unit:RemoveEvents()
end
function DRW_OnLeaveCombat(Unit, Event)
Unit:RemoveEvents()
end
RegisterUnitEvent(474, 1, "DRW_OnCombat")
RegisterUnitEvent(474, 2, "DRW_OnLeaveCombat")
RegisterUnitEvent(474, 4, "DRW_OnDied")
-- Hogger
function Ho_OnCombat(Unit, Event)
Unit:CastSpell(6268)
Unit:RegisterEvent("Ho_HBt", 20000, 0)
Unit:RegisterEvent("Ho_PA", 45000, 0)
end
function Ho_HBt(pUnit, Event)
local plr = pUnit:GetMainTank()
if (plr ~= nil) then
pUnit:FullCastSpellOnTarget(13322, plr)
end
end
function Ho_PA(pUnit, Event)
local plr = pUnit:GetMainTank()
if (plr ~= nil) then
pUnit:FullCastSpellOnTarget(13322, plr)
end
end
function Ho_OnDied(Unit, Event)
Unit:RemoveEvents()
end
function HO_OnLeaveCombat(Unit, Event)
Unit:RemoveEvents()
end
RegisterUnitEvent(448, 1, "Ho_OnCombat")
RegisterUnitEvent(448, 4, "Ho_OnDied")
RegisterUnitEvent(448, 2, "HO_OnLeaveCombat")
-- Kobold Geomancer
function KG_OnCombat(Unit, Event)
Unit:RegisterEvent("KG_FBl", 3000, 0)
Unit:RegisterEvent("KG_FAA", 10000, 1)
end
function KG_FBl(pUnit, Event)
local plr = pUnit:GetMainTank()
if (plr ~= nil) then
pUnit:FullCastSpellOnTarget(20793, plr)
end
end
function KG_FAA(Unit, Event)
Unit:CastSpell(12544)
end
function KG_OnDied(Unit, Event)
Unit:RemoveEvents()
end
function KG_OnLeaveCombat(Unit, Event)
Unit:RemoveEvents()
end
RegisterUnitEvent(476, 1, "KG_OnCombat")
RegisterUnitEvent(476, 2, "KG_OnLeaveCombat")
RegisterUnitEvent(476, 4, "KG_OnDied")
-- Kobold Miner
function KM_OnCombat(Unit, Event)
Unit:RegisterEvent("KM_FBl", 45000, 0)
end
function KM_FBl(pUnit, Event)
local plr = pUnit:GetMainTank()
if (plr ~= nil) then
pUnit:FullCastSpellOnTarget(6016, plr)
end
end
function KM_OnDied(Unit, Event)
Unit:RemoveEvents()
end
function KM_OnLeaveCombat(Unit, Event)
Unit:RemoveEvents()
end
RegisterUnitEvent(40, 1, "KM_OnCombat")
RegisterUnitEvent(40, 2, "KM_OnLeaveCombat")
RegisterUnitEvent(40, 4, "KM_OnDied")
-- Morgaine the Sly
function MTS_OnCombat(Unit, Event)
Unit:RegisterEvent("MTS_Gouge", 10000, 0)
end
function MTS_Gouge(pUnit, Event)
local plr = pUnit:GetMainTank()
if (plr ~= nil) then
pUnit:FullCastSpellOnTarget(1776, plr)
end
end
function MTS_OnDied(Unit, Event)
Unit:RemoveEvents()
end
function MTS_OnLeaveCombat(Unit, Event)
Unit:RemoveEvents()
end
RegisterUnitEvent(99, 1, "MTS_OnCombat")
RegisterUnitEvent(99, 2, "MTS_OnLeaveCombat")
RegisterUnitEvent(99, 4, "MTS_OnDied")
-- Morgan the Collector
function MTC_OnCombat(Unit, Event)
Unit:RegisterEvent("MTC_Gougei", 10000, 0)
end
function MTC_Gougei(pUnit, Event)
local plr = pUnit:GetMainTank()
if (plr ~= nil) then
pUnit:FullCastSpellOnTarget(1776, plr)
end
end
function MTC_OnDied(Unit, Event)
Unit:RemoveEvents()
end
function MTC_OnLeaveCombat(Unit, Event)
Unit:RemoveEvents()
end
RegisterUnitEvent(473, 1, "MTC_OnCombat")
RegisterUnitEvent(473, 2, "MTC_OnLeaveCombat")
RegisterUnitEvent(473, 4, "MTC_OnDied")
-- Murloc Forager
function MF_OnCombat(Unit, Event)
Unit:RegisterEvent("MF_DMPn", 30000, 1)
end
function MF_DMPn(Unit, Event)
Unit:CastSpell(3368)
end
function MF_OnDied(Unit, Event)
Unit:RemoveEvents()
end
function MF_OnLeaveCombat(Unit, Event)
Unit:RemoveEvents()
end
RegisterUnitEvent(46, 1, "MF_OnCombat")
RegisterUnitEvent(46, 2, "MF_OnLeaveCombat")
RegisterUnitEvent(46, 4, "MF_OnDied")
-- Murloc Lurker
function ML_OnCombat(Unit, Event)
Unit:RegisterEvent("ML_BSu", 3000, 0)
end
function ML_BSu(pUnit, Event)
local plr = pUnit:GetMainTank()
if (plr ~= nil) then
pUnit:FullCastSpellOnTarget(7159, plr)
end
end
function ML_OnDied(Unit, Event)
Unit:RemoveEvents()
end
function ML_OnLeaveCombat(Unit, Event)
Unit:RemoveEvents()
end
RegisterUnitEvent(732, 1, "ML_OnCombat")
RegisterUnitEvent(732, 2, "ML_OnLeaveCombat")
RegisterUnitEvent(732, 4, "ML_OnDied")
-- Narg the Taskmaster
function NTT_OnCombat(Unit, Event)
Unit:RegisterEvent("NTT_DBS", 100, 1)
end
function NTT_DBS(Unit, Event)
Unit:CastSpell(9128)
end
function NTT_OnDied(Unit, Event)
Unit:RemoveEvents()
end
function NTT_OnLeaveCombat(Unit, Event)
Unit:RemoveEvents()
end
RegisterUnitEvent(79, 1, "NTT_OnCombat")
RegisterUnitEvent(79, 2, "NTT_OnLeaveCombat")
RegisterUnitEvent(79, 4, "NTT_OnDied")
-- Porcine Entourage
function PE_OnCombat(Unit, Event)
Unit:CastSpell(6268)
end
function PE_LeaveCombat(pUnit, Event)
pUnit:RemoveEvents()
end
function PE_Dead(pUnit, Event)
pUnit:RemoveEvents()
end
RegisterUnitEvent(390, 1, "PE_OnCombat")
RegisterUnitEvent(390, 2, "PE_LeaveCombat")
RegisterUnitEvent(390, 4, "PE_Dead")
-- Princess
function Princess_OnCombat(Unit, Event)
Unit:CastSpell(6268)
end
function Princess_LeaveCombat(pUnit, Event)
pUnit:RemoveEvents()
end
function Princess_Dead(pUnit, Event)
pUnit:RemoveEvents()
end
RegisterUnitEvent(330, 1, "Princess_OnCombat")
RegisterUnitEvent(330, 2, "Princess_LeaveCombat")
RegisterUnitEvent(330, 4, "Princess_Dead")
-- Riverpaw Outrunner
function RPOR_OnCombat(Unit, Event)
Unit:RegisterEvent("RPOR_Thsh", 15000, 1)
end
function RPOR_Thsh(Unit, Event)
Unit:CastSpell(3391)
end
function RPOR_OnDied(Unit, Event)
Unit:RemoveEvents()
end
function RPOR_OnLeaveCombat(Unit, Event)
Unit:RemoveEvents()
end
RegisterUnitEvent(478, 1, "RPOR_OnCombat")
RegisterUnitEvent(478, 2, "RPOR_OnLeaveCombat")
RegisterUnitEvent(478, 4, "RPOR_OnDied")
-- Rockhide Boar
function RB_OnCombat(Unit, Event)
Unit:CastSpell(6268)
end
function RB_LeaveCombat(pUnit, Event)
pUnit:RemoveEvents()
end
function RB_Dead(pUnit, Event)
pUnit:RemoveEvents()
end
RegisterUnitEvent(524, 1, "RB_OnCombat")
RegisterUnitEvent(524, 2, "RB_LeaveCombat")
RegisterUnitEvent(524, 4, "RB_Dead")
-- Rogue Black Drake
function RBD_OnCombat(Unit, Event)
Unit:RegisterEvent("RBD_FlameB", 15000, 0)
end
function RBD_FlameB(Unit, Event)
Unit:FullCastSpell(8873)
end
function RBD_OnDied(Unit, Event)
Unit:RemoveEvents()
end
function RBD_OnLeaveCombat(Unit, Event)
Unit:RemoveEvents()
end
RegisterUnitEvent(14388, 1, "RBD_OnCombat")
RegisterUnitEvent(14388, 2, "RBD_OnLeaveCombat")
RegisterUnitEvent(14388, 4, "RBD_OnDied")
-- Surena Caledon
function SC_OnCombat(Unit, Event)
Unit:RegisterEvent("SC_Fireball", 3000, 0)
Unit:RegisterEvent("SC_FrostArmor", 10000, 1)
end
function SC_FrostArmor(Unit, Event)
Unit:FullCastSpell(12544)
end
function ML_Fireball(pUnit, Event)
local plr = pUnit:GetMainTank()
if (plr ~= nil) then
pUnit:FullCastSpellOnTarget(20793, plr)
end
end
function SC_OnDied(Unit, Event)
Unit:RemoveEvents()
end
function SC_OnLeaveCombat(Unit, Event)
Unit:RemoveEvents()
end
RegisterUnitEvent(881, 1, "SC_OnCombat")
RegisterUnitEvent(881, 2, "SC_OnLeaveCombat")
RegisterUnitEvent(881, 4, "SC_OnDied")
-- ##### ## ##### ## ##### ## ##### ##
-- /##### /## ###### /### /##### /## ###### /##
-- // / / ### /# / / ### // / / ### /# / / ##
-- / / / ### / / / ### / / / ### / / / ##
-- / / ### / / ## / / ### / / /
-- ## ## ## ## ## ## ## ## ## ## ## /
-- ## ## ## ## ## ## ## ## ## ## ## /
-- ## ## ## /### ## / ## ## ## ## ##/
-- ## ## ## / ### ## / ## ## ## ## ## ###
-- ## ## ## ## ######/ ## ## ## ## ## ###
-- # ## ## ## ###### # ## ## # ## ##
-- / / ## ## / / / ##
-- /###/ / ## ## /###/ / /##/ ###
-- / ########/ ## ## / ########/ / ########
-- / #### ## ## ## / #### / ####
-- # ### # / # #
-- ## ### / ## ##
-- #####/
-- ### www.DPS-DB.com
-- Matt
MATT = {}
function MATT_onDied(Unit, event, player)
Unit:RemoveEvents()
end
function MATT_onSpawn(Unit, event, player)
Unit:RegisterEvent("MATT_Say",30000, 0)
end
function MATT_Say(Unit, event, player)
Unit:SendChatMessage(12, 7, "Dang! Fish arent biting here either! Im gonna go back to my ol' fishin' hole" )
end
-- Matt
RegisterUnitEvent(794, 18, "MATT_onSpawn")
RegisterUnitEvent(794, 4, "MATT_onDied") |
-- ~~Test~~AgileWM: a 'window manager' for testing purposes.
-- This is as modular as you can get while calling it a 'WM' - on it's own,
-- it more or less acts as the "null window manager",
-- not bothering to do anything and passing through requests as given.
local args = {...}
for k, v in ipairs(args) do
print("Module " .. k .. ":" .. v)
end
-- First things first, do the initial connection,
-- if this fails there isn't any point wasting time loading modules
local xcb = require("xcb.wrapper")
local xcbe = require("xcb.enums")
local conn = xcb.connect()
-- Firstly, event transform/default behavior stuff
local function configure_request_svh(v, m, t)
if bit.band(m, t) ~= 0 then
return v
end
end
local function pre_transform_event(ev)
if ev.type == "configure_request" then
-- A window wants to be configured,
-- let's make that happen!
local vl = {}
local evcr = ev.data
local vm = evcr.value_mask
vl.x = configure_request_svh(evcr.x, vm, xcbe.config_window.X)
vl.y = configure_request_svh(evcr.y, vm, xcbe.config_window.Y)
vl.width = configure_request_svh(evcr.width, vm, xcbe.config_window.WIDTH)
vl.height = configure_request_svh(evcr.height, vm, xcbe.config_window.HEIGHT)
vl.border_width = configure_request_svh(evcr.border_width, vm, xcbe.config_window.BORDER_WIDTH)
vl.sibling = configure_request_svh(evcr.sibling, vm, xcbe.config_window.SIBLING)
vl.stack_mode = configure_request_svh(evcr.stack_mode, vm, xcbe.config_window.STACK_MODE)
return "configure_request", {
window = evcr.window,
parent = evcr.parent,
values = vl}, ev.sendevent
end
return ev.type, ev.data, ev.sendevent
end
local function post_transform_event(evtype, evdata, evsent)
if evtype == "configure_request" then
conn:window(evdata.window):configure(evdata.values)
end
if evtype == "map_request" then
conn:window(evdata.window):map()
end
end
-- Modules work in a similar way to Minetest - they all share one environment.
-- No true sandboxing is performed, it just keeps the modules from
-- messing around with core or module instances in other screens.
-- Global environment variables (other than the normal ones) are:
-- xcb/xcbe: Libraries
-- connection: XCB Connection instance
-- submit_ev(evtype, evdata): Deliberately submit an event to the system,
-- in order to cause, ex. WM-created windows to be managed by the WM
-- Notably, event data can be of table format,
-- so long as the structure is kept consistent:
-- this should be kept under consideration when reading them.
-- screen: Screen-specific data
-- A module returns only one function,
-- the "event handler function".
-- This function receives three parameters:
-- the event type, event data, and if the event was caused by XSendEvent.
-- It can return true for the event to be stopped at that point, or false otherwise.
-- It is valid for the event data to be tampered with.
-- The event data can be cdata or a table,
-- so long as the fields are of precisely the correct format.
-- (For this format, please see the event structures involved,
-- and keep in mind resource IDs are not automatically wrapped.)
-- Some events may not actually be X window system events.
-- "init" carries no data, and is an initial bootstrap event
-- used after all modules have been instantiated.
-- "configure_request" has special handling that
-- transforms it into a value structure that can be passed
-- to configure - indeed, the default behavior without suppression
-- is to pass the (possibly transformed) configuration to configure.
-- Here's the structure (Note: 'sequence' & 'parent' do not affect the configuration.
-- Unsure why they exist. Maybe it's just an assist for the WM.
-- Notably, reparenting AFAIK *cannot be fully redirected*,
-- and there's no value_mask flag to set this as a reparenting.):
-- {sequence = <sequence>,
-- parent = <parent>,
-- window = <window>,
-- values = <configure value-set>}
local screens = {}
for screen in conn:get_setup():setup_roots() do
-- Screens are handled on a per-root basis
local env = {}
for k, v in pairs(_G) do
env[k] = v
end
env.xcb = xcb
env.xcbe = xcbe
env.connection = conn
env.screen = screen
local mdt = {}
env.submit_ev = function (evtype, evdata, evsent)
for _, v in ipairs(mdt) do
if v(evtype, evdata, evsent) then
return true
end
end
end
screens[screen.root] = env
for k, v in ipairs(args) do
local f, err = loadfile(v)
if not f then error(err) end
setfenv(f, env)
mdt[k] = f()
end
local root = conn:window(screen.root)
root:change({
event_mask =
xcbe.event_mask.STRUCTURE_NOTIFY +
xcbe.event_mask.SUBSTRUCTURE_NOTIFY +
xcbe.event_mask.SUBSTRUCTURE_REDIRECT
})
end
-- Flush the root eventmask changes...
conn:flush()
-- Get ready to distribute "init"...
-- Unsure how this should be written or if it should be moved into LJWM itself
local function try_get_field(struct, field)
local s, r = pcall(function () return struct[field] end)
if not s then return nil end
return r
end
local function determine_window_root(evtype, evdata, evsent)
-- Will either always return nil or always return something for
-- a given event type, I think?
local w = try_get_field(evdata, "window")
if not w then
return try_get_field(evdata, "root")
end
if w then
local ok, res = pcall(function ()
local c, p, r = conn:window(w):tree()
return r
end)
if ok then
return res
-- otherwise, probably errored with
-- "the window doesn't exist".
-- why is this an error again?
end
end
end
local function distribute_event(evtype, evdata, evsent)
local window_root = determine_window_root(evtype, evdata, evsent)
if window_root then
local p = screens[window_root]
if p then
if p.submit_ev(evtype, evdata, evsent) then
conn:flush()
return
end
end
else
for k, v in pairs(screens) do
if v.submit_ev(evtype, evdata, evsent) then
conn:flush()
return
end
end
end
post_transform_event(evtype, evdata, evsent)
conn:flush()
end
-- Kickstart modules, and perform root reconfiguration
for k, v in pairs(screens) do
local initdata = {
root_configure = {
event_mask =
xcbe.event_mask.STRUCTURE_NOTIFY +
xcbe.event_mask.SUBSTRUCTURE_NOTIFY +
xcbe.event_mask.SUBSTRUCTURE_REDIRECT
}
}
v.submit_ev("init", initdata, true)
conn:window(v.screen.root):change(initdata.root_configure)
conn:flush()
end
-- The main event loop.
while true do
local ev = conn:wait_for_event()
if ev then
if not ev.type then
print("Dx ", ev.raw.response_type)
else
print(ev.type)
distribute_event(pre_transform_event(ev))
end
else
error("Error.")
end
end
|
M = Game:GetService("InsertService"):LoadAsset(23456459)
M.Parent = Game.Workspace
M:MakeJoints()
M:MoveTo(Game.Workspace.acb227.Torso.Position + Vector3.new(0, 0, 0))
|
return {
{
type = "picture",
id = 0,
{ tex = 1 , src = { 226, 61, 226, 94, 254, 94, 254, 61 }, screen = { -382, -640, -382, 428, 514, 428, 514, -640} },
},
{
type = "picture",
id = 1,
{ tex = 1 , src = { 66, 97, 34, 97, 34, 128, 66, 128 }, screen = { -368, -620, -372, 388, 604, 392, 608, -616} },
},
{
type = "picture",
id = 2,
{ tex = 1 , src = { 178, 112, 144, 112, 144, 137, 178, 137 }, screen = { -388, -652, -384, 452, 416, 452, 412, -652} },
},
{
type = "picture",
id = 3,
{ tex = 1 , src = { 73, 73, 37, 73, 37, 97, 73, 97 }, screen = { -392, -656, -392, 496, 376, 496, 376, -656} },
},
{
type = "picture",
id = 4,
{ tex = 1 , src = { 36, 73, 0, 73, 0, 97, 36, 97 }, screen = { -388, -656, -388, 496, 380, 496, 380, -656} },
},
{
type = "picture",
id = 5,
{ tex = 1 , src = { 204, 122, 204, 152, 238, 152, 238, 122 }, screen = { -408, -608, -408, 352, 680, 352, 680, -608} },
},
{
type = "picture",
id = 6,
{ tex = 1 , src = { 204, 95, 204, 121, 241, 121, 241, 95 }, screen = { -450, -568, -450, 276, 734, 276, 734, -568} },
},
{
type = "picture",
id = 7,
{ tex = 1 , src = { 187, 54, 187, 79, 226, 79, 226, 54 }, screen = { -478, -556, -478, 244, 758, 244, 758, -556} },
},
{
type = "picture",
id = 8,
{ tex = 1 , src = { 193, 0, 193, 26, 233, 26, 233, 0 }, screen = { -494, -580, -494, 240, 786, 240, 786, -580} },
},
{
type = "picture",
id = 9,
{ tex = 1 , src = { 187, 26, 187, 54, 226, 54, 226, 26 }, screen = { -494, -636, -494, 248, 754, 248, 754, -636} },
},
{
type = "picture",
id = 10,
{ tex = 1 , src = { 88, 46, 88, 75, 127, 75, 127, 46 }, screen = { -486, -696, -486, 244, 762, 244, 762, -696} },
},
{
type = "picture",
id = 11,
{ tex = 1 , src = { 147, 25, 147, 56, 187, 56, 187, 25 }, screen = { -478, -748, -478, 244, 790, 244, 790, -748} },
},
{
type = "picture",
id = 12,
{ tex = 1 , src = { 166, 80, 166, 112, 203, 112, 203, 80 }, screen = { -454, -784, -454, 240, 730, 240, 730, -784} },
},
{
type = "picture",
id = 13,
{ tex = 1 , src = { 109, 92, 109, 125, 143, 125, 143, 92 }, screen = { -424, -820, -424, 224, 676, 224, 676, -820} },
},
{
type = "picture",
id = 14,
{ tex = 1 , src = { 34, 97, 0, 97, 0, 129, 34, 129 }, screen = { -400, -860, -404, 212, 604, 216, 608, -856} },
},
{
type = "picture",
id = 15,
{ tex = 1 , src = { 227, 26, 227, 60, 255, 60, 255, 26 }, screen = { -378, -892, -378, 196, 518, 196, 518, -892} },
},
{
type = "picture",
id = 16,
{ tex = 1 , src = { 108, 76, 73, 76, 73, 101, 108, 101 }, screen = { -388, -920, -388, 200, 412, 200, 412, -920} },
},
{
type = "picture",
id = 17,
{ tex = 1 , src = { 36, 48, 0, 48, 0, 72, 36, 72 }, screen = { -396, -956, -396, 196, 372, 196, 372, -956} },
},
{
type = "picture",
id = 18,
{ tex = 1 , src = { 73, 48, 37, 48, 37, 72, 73, 72 }, screen = { -384, -956, -384, 196, 384, 196, 384, -956} },
},
{
type = "animation",
id = 19,
component = {
{id = 1 },
{id = 0 },
{id = 2 },
{id = 3 },
{id = 4 },
{id = 5 },
{id = 6 },
{id = 7 },
{id = 8 },
{id = 9 },
{id = 10 },
{id = 11 },
{id = 12 },
{id = 13 },
{id = 14 },
{id = 15 },
{id = 16 },
{id = 17 },
{id = 18 },
},
{
{ 0 },
{ 0 },
{ 0 },
{ 0 },
{ 0 },
{ 0 },
{ 0 },
{ 0 },
{ 0 },
{ 0 },
{ 1 },
{ 1 },
{ 1 },
{ 1 },
{ 1 },
{ 1 },
{ 1 },
{ 1 },
{ 1 },
{ 1 },
{ 2 },
{ 2 },
{ 2 },
{ 2 },
{ 2 },
{ 2 },
{ 2 },
{ 2 },
{ 2 },
{ 2 },
{ 3 },
{ 3 },
{ 3 },
{ 3 },
{ 3 },
{ 3 },
{ 3 },
{ 3 },
{ 3 },
{ 3 },
{ 4 },
{ 4 },
{ 4 },
{ 4 },
{ 4 },
{ 4 },
{ 4 },
{ 4 },
{ 4 },
{ 4 },
{ { index = 3, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 3, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 3, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 3, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 3, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 3, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 3, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 3, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 3, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 3, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 2, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 2, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 2, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 2, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 2, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 2, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 2, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 2, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 2, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 2, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 1, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 1, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 1, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 1, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 1, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 1, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 1, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 1, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 1, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 1, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 0, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 0, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 0, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 0, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 0, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 0, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 0, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 0, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 0, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 0, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 5, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 5, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 5, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 5, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 5, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 5, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 5, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 5, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 5, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 5, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 6, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 6, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 6, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 6, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 6, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 6, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 6, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 6, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 6, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 6, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 7, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 7, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 7, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 7, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 7, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 7, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 7, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 7, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 7, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 7, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 8, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 8, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 8, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 8, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 8, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 8, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 8, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 8, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 8, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 8, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 9, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 9, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 9, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 9, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 9, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 9, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 9, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 9, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 9, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 9, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 10, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 10, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 10, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 10, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 10, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 10, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 10, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 10, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 10, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 10, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 11, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 11, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 11, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 11, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 11, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 11, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 11, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 11, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 11, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 11, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 12, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 12, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 12, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 12, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 12, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 12, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 12, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 12, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 12, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 12, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 13, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 13, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 13, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 13, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 13, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 13, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 13, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 13, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 13, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 13, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 14, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 14, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 14, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 14, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 14, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 14, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 14, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 14, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 14, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 14, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 15, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 15, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 15, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 15, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 15, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 15, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 15, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 15, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 15, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 15, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 16, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 16, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 16, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 16, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 16, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 16, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 16, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 16, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 16, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 16, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 17, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 17, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 17, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 17, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 17, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 17, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 17, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 17, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 17, mat = { -1024,0,0,1024,0,0 } } },
{ { index = 17, mat = { -1024,0,0,1024,0,0 } } },
{ 18 },
{ 18 },
{ 18 },
{ 18 },
{ 18 },
{ 18 },
{ 18 },
{ 18 },
{ 18 },
{ 18 },
{ 17 },
{ 17 },
{ 17 },
{ 17 },
{ 17 },
{ 17 },
{ 17 },
{ 17 },
{ 17 },
{ 17 },
{ 16 },
{ 16 },
{ 16 },
{ 16 },
{ 16 },
{ 16 },
{ 16 },
{ 16 },
{ 16 },
{ 16 },
{ 15 },
{ 15 },
{ 15 },
{ 15 },
{ 15 },
{ 15 },
{ 15 },
{ 15 },
{ 15 },
{ 15 },
{ 14 },
{ 14 },
{ 14 },
{ 14 },
{ 14 },
{ 14 },
{ 14 },
{ 14 },
{ 14 },
{ 14 },
{ 13 },
{ 13 },
{ 13 },
{ 13 },
{ 13 },
{ 13 },
{ 13 },
{ 13 },
{ 13 },
{ 13 },
{ 12 },
{ 12 },
{ 12 },
{ 12 },
{ 12 },
{ 12 },
{ 12 },
{ 12 },
{ 12 },
{ 12 },
{ 11 },
{ 11 },
{ 11 },
{ 11 },
{ 11 },
{ 11 },
{ 11 },
{ 11 },
{ 11 },
{ 11 },
{ 10 },
{ 10 },
{ 10 },
{ 10 },
{ 10 },
{ 10 },
{ 10 },
{ 10 },
{ 10 },
{ 10 },
{ 9 },
{ 9 },
{ 9 },
{ 9 },
{ 9 },
{ 9 },
{ 9 },
{ 9 },
{ 9 },
{ 9 },
{ 8 },
{ 8 },
{ 8 },
{ 8 },
{ 8 },
{ 8 },
{ 8 },
{ 8 },
{ 8 },
{ 8 },
{ 7 },
{ 7 },
{ 7 },
{ 7 },
{ 7 },
{ 7 },
{ 7 },
{ 7 },
{ 7 },
{ 7 },
{ 6 },
{ 6 },
{ 6 },
{ 6 },
{ 6 },
{ 6 },
{ 6 },
{ 6 },
{ 6 },
{ 6 },
{ 5 },
{ 5 },
{ 5 },
{ 5 },
{ 5 },
{ 5 },
{ 5 },
{ 5 },
{ 5 },
{ 5 },
},
},
{
type = "picture",
id = 20,
{ tex = 1 , src = { 58, 152, 31, 152, 31, 179, 58, 179 }, screen = { 16, 4, 16, 868, 864, 872, 864, 8} },
},
{
type = "picture",
id = 21,
{ tex = 1 , src = { 185, 138, 158, 138, 158, 164, 185, 164 }, screen = { 16, 8, 16, 872, 864, 868, 864, 4} },
},
{
type = "picture",
id = 22,
{ tex = 1 , src = { 92, 149, 65, 149, 65, 176, 92, 176 }, screen = { 16, 4, 16, 868, 864, 872, 864, 8} },
},
{
type = "animation",
id = 23,
component = {
{id = 20 },
{id = 22 },
{id = 21 },
},
{
{ 0 },
{ 0 },
{ 0 },
{ 0 },
{ 0 },
{ 0 },
{ 0 },
{ 0 },
{ 0 },
{ 0 },
{ 1 },
{ 1 },
{ 1 },
{ 1 },
{ 1 },
{ 1 },
{ 1 },
{ 1 },
{ 1 },
{ 1 },
{ 1 },
{ 1 },
{ 1 },
{ 1 },
{ 1 },
{ 1 },
{ 1 },
{ 1 },
{ 1 },
{ 1 },
{ 1 },
{ 1 },
{ 1 },
{ 1 },
{ 1 },
{ 1 },
{ 1 },
{ 1 },
{ 1 },
{ 1 },
{ 1 },
{ 1 },
{ 1 },
{ 1 },
{ 1 },
{ 1 },
{ 1 },
{ 1 },
{ 1 },
{ 1 },
{ 1 },
{ 1 },
{ 1 },
{ 1 },
{ 1 },
{ 1 },
{ 1 },
{ 1 },
{ 1 },
{ 1 },
{ 2 },
{ 2 },
{ 2 },
{ 2 },
{ 2 },
{ 2 },
{ 2 },
{ 2 },
{ 2 },
{ 2 },
{ 2 },
{ 2 },
{ 2 },
{ 2 },
{ 2 },
{ 2 },
{ 2 },
{ 2 },
{ 2 },
{ 2 },
{ 2 },
{ 2 },
{ 2 },
{ 2 },
{ 2 },
{ 2 },
{ 2 },
{ 2 },
{ 2 },
{ 2 },
{ 2 },
{ 2 },
{ 2 },
{ 2 },
{ 2 },
{ 2 },
{ 2 },
{ 2 },
{ 2 },
{ 2 },
},
},
{
type = "picture",
id = 24,
{ tex = 1 , src = { 0, 0, 0, 48, 88, 48, 88, 0 }, screen = { -869, -224, -869, 598, 644, 598, 644, -224} },
},
{
type = "picture",
id = 25,
{ tex = 1 , src = { 88, 0, 88, 45, 147, 45, 147, 0 }, screen = { -958, -580, -958, 860, 918, 860, 918, -580} },
},
{
type = "animation",
export = "cannon",
id = 26,
component = {
{id = 24 },
{id = 25 },
{id = 19, name = 'turret' },
},
{
{ 0,1,2 },
},
},
{
type = "picture",
id = 27,
{ tex = 1 , src = { 96, 125, 66, 125, 66, 149, 96, 149 }, screen = { -244, -604, -244, 356, 508, 360, 508, -600} },
},
{
type = "picture",
id = 28,
{ tex = 1 , src = { 96, 101, 66, 101, 66, 125, 96, 125 }, screen = { -244, -604, -244, 356, 508, 360, 508, -600} },
},
{
type = "picture",
id = 29,
{ tex = 1 , src = { 157, 138, 127, 138, 127, 161, 157, 161 }, screen = { -244, -600, -244, 360, 508, 356, 508, -604} },
},
{
type = "picture",
id = 30,
{ tex = 1 , src = { 127, 125, 97, 125, 97, 149, 127, 149 }, screen = { -240, -604, -240, 356, 512, 360, 512, -600} },
},
{
type = "picture",
id = 31,
{ tex = 1 , src = { 30, 129, 0, 129, 0, 153, 30, 153 }, screen = { -244, -604, -244, 356, 508, 360, 508, -600} },
},
{
type = "picture",
id = 32,
{ tex = 1 , src = { 64, 128, 34, 128, 34, 152, 64, 152 }, screen = { -244, -604, -244, 356, 508, 360, 508, -600} },
},
{
type = "animation",
id = 33,
component = {
{id = 29 },
{id = 30 },
{id = 31 },
{id = 32 },
{id = 27 },
{id = 28 },
},
{
{ 0 },
{ 0 },
{ 0 },
{ 0 },
{ 1 },
{ 1 },
{ 1 },
{ 1 },
{ 2 },
{ 2 },
{ 2 },
{ 2 },
{ 3 },
{ 3 },
{ 3 },
{ 3 },
{ 4 },
{ 4 },
{ 4 },
{ 4 },
{ 5 },
{ 5 },
{ 5 },
{ 5 },
},
},
{
type = "picture",
id = 34,
{ tex = 1 , src = { 0, 0, 0, 48, 88, 48, 88, 0 }, screen = { -1042, -411, -1042, 535, 700, 535, 700, -411} },
},
{
type = "picture",
id = 35,
{ tex = 1 , src = { 179, 112, 179, 137, 203, 137, 203, 112 }, screen = { -48, -540, -48, 260, 732, 260, 732, -540} },
},
{
type = "picture",
id = 36,
{ tex = 1 , src = { 128, 57, 128, 92, 166, 92, 166, 57 }, screen = { -938, -256, -938, 864, 278, 864, 278, -256} },
},
{
type = "picture",
id = 37,
{ tex = 1 , src = { 147, 0, 147, 25, 193, 25, 193, 0 }, screen = { -894, -796, -894, -8, 566, -8, 566, -796} },
},
{
type = "animation",
export = "mine",
id = 38,
component = {
{id = 34 },
{id = 35 },
{id = 33 },
{id = 36 },
{id = 37 },
{id = 23, name = 'resource' },
{id = 39, name = 'label' },
{id = 40, name = 'panel' },
},
{
{
{ index = 7, touch = 1, mat = {1024,0,0,1024,-400,-400}},
0,1,2,3,4,5,
{ index = 6, touch = 1, mat = {1024,0,0,1024,-800,800}},
},
},
},
{
type = "label",
id = 39,
font = "", color = 0xffffffff, align = 2, size = 16, width = 100, height = 20,
},
{
type = "pannel",
id = 40,
width = 100, height = 150, scissor = false,
},
}
|
-- Logger.lua
-- Implements a logger that can output log messages and filter them based on loglevel
local Logger =
{
-- The various log levels:
ERROR = 9, -- Emitting this log also prints stacktrace and terminates the entire program
WARNING = 5,
INFO = 4,
DEBUG = 3,
TRACE = 1,
}
-- If currentLogLevel is higher than message's loglevel, the message won't be output
Logger.currentLogLevel = Logger.DEBUG
-- Store the "error" function as of loading this file, so that client code may replace it without affecting us:
local error = error
--- Creates a new logger instance based on the parsed options given
function Logger:new(a_Options)
-- Check params:
assert(type(self) == "table")
assert(type(a_Options) == "table")
local res =
{
currentLogLevel = self.currentLogLevel or a_Options.logLevel or Logger.DEBUG,
}
setmetatable(res, self)
self.__index = self
return res
end
--- Common logging entrypoint, receives all log messages
function Logger:log(a_LogLevel, a_Format, ...)
-- Check params:
assert(self)
assert(type(a_Format) == "string")
-- If loglevel too high for this message, bail out:
if (a_LogLevel < self.currentLogLevel) then
return
end
-- Output the message
print(string.format(a_Format, ...))
io.stdout:flush()
end
--- Logs the message with an ERROR level and calls global "error" with the same message
-- Usually this terminates the program
function Logger:error(a_Level, a_Fmt, ...)
assert(self)
assert(type(a_Level) == "number")
assert(type(a_Fmt) == "string")
self:log(Logger.ERROR, a_Fmt, ...)
error(string.format(a_Fmt, ...), a_Level)
end
--- Logs the message with a WARNING level
function Logger:warning(...)
assert(self)
self:log(Logger.WARNING, ...)
end
--- Logs the message with an INFO level
function Logger:info(...)
assert(self)
self:log(Logger.INFO, ...)
end
--- Logs the message with a DEBUG level
function Logger:debug(...)
assert(self)
self:log(Logger.DEBUG, ...)
end
--- Logs the message with a TRACE level
function Logger:trace(...)
assert(self)
self:log(Logger.TRACE, ...)
end
return Logger
|
object_draft_schematic_furniture_furniture_murra_blanca_trophy = object_draft_schematic_furniture_shared_furniture_murra_blanca_trophy:new {
}
ObjectTemplates:addTemplate(object_draft_schematic_furniture_furniture_murra_blanca_trophy, "object/draft_schematic/furniture/furniture_murra_blanca_trophy.iff")
|
local Dta = select(2, ...)
Dta.move_ui = {}
-------------------------------
-- BUILD THE DIMENSIONTOOLS MOVEWINDOW
-------------------------------
local MoveWindowSettings = {
WIDTH = 305,
HEIGHT = 130,
CLOSABLE = true,
MOVABLE = true,
POS_X = "MovewindowPosX",
POS_Y = "MovewindowPosY"
}
function Dta.move_ui.buildMoveWindow()
local x = Dta.settings.get("MovewindowPosX")
local y = Dta.settings.get("MovewindowPosY")
local newWindow = Dta.ui.Window.Create("MoveWindow",
Dta.ui.context,
Dta.Locale.Titles.Move,
MoveWindowSettings.WIDTH,
MoveWindowSettings.HEIGHT,
x,
y,
MoveWindowSettings.CLOSABLE,
MoveWindowSettings.MOVABLE,
Dta.move_ui.hideMoveWindow,
Dta.ui.WindowMoved
)
newWindow.settings = MoveWindowSettings
local Movewindow = newWindow.content
Movewindow.background2 = UI.CreateFrame("Texture", "MoveWindowBackground2", Movewindow)
Movewindow.background2:SetPoint("BOTTOMCENTER", Movewindow, "BOTTOMCENTER")
Movewindow.background2:SetWidth(MoveWindowSettings.WIDTH)
Movewindow.background2:SetHeight(80)
Movewindow.background2:SetAlpha(0.3)
Movewindow.background2:SetTexture("Rift", "dimensions_tools_header.png.dds")
Movewindow.background2:SetLayer(5)
-------------------------------
--ITEM DETAILS
-------------------------------
Movewindow.modifyPosition = Dta.ui.createFrame("modifyPosition", Movewindow, 10, 5, Movewindow:GetWidth()-20, Movewindow:GetHeight()-20)
Movewindow.modifyPosition:SetLayer(30)
--Movewindow.modifyPosition:SetBackgroundColor(1, 0, 0, 0.5) --Debug
Movewindow.modifyPosition.xLabel = Dta.ui.createText("modifyPositionXLabel", Movewindow.modifyPosition, 0, 0, "X", 14, {1, 0, 0, 1})
Movewindow.modifyPosition.yLabel = Dta.ui.createText("modifyPositionYLabel", Movewindow.modifyPosition, 0, 25, "Y", 14, {0, 1, 0, 1})
Movewindow.modifyPosition.zLabel = Dta.ui.createText("modifyPositionZLabel", Movewindow.modifyPosition, 0, 50, "Z", 14, {0, 1, 1, 1})
Movewindow.modifyPosition.x = Dta.ui.createTextfield("modifyPositionX", Movewindow.modifyPosition, 20, 0, 105)
Movewindow.modifyPosition.y = Dta.ui.createTextfield("modifyPositionY", Movewindow.modifyPosition, 20, 25, 105)
Movewindow.modifyPosition.z = Dta.ui.createTextfield("modifyPositionZ", Movewindow.modifyPosition, 20, 50, 105)
Movewindow.modifyPosition.fetchX = Dta.ui.createReloadButton("fetchX", Movewindow.modifyPosition, 125, 0, Dta.move.fetchXButtonClicked)
Movewindow.modifyPosition.fetchY = Dta.ui.createReloadButton("fetchY", Movewindow.modifyPosition, 125, 25, Dta.move.fetchYButtonClicked)
Movewindow.modifyPosition.fetchZ = Dta.ui.createReloadButton("fetchZ", Movewindow.modifyPosition, 125, 50, Dta.move.fetchZButtonClicked)
Movewindow.modifyPosition.fetchX:EventAttach(Event.UI.Input.Mouse.Right.Click, Dta.move.fetchAllButtonClicked, "FetchAll")
Movewindow.modifyPosition.fetchY:EventAttach(Event.UI.Input.Mouse.Right.Click, Dta.move.fetchAllButtonClicked, "FetchAll")
Movewindow.modifyPosition.fetchZ:EventAttach(Event.UI.Input.Mouse.Right.Click, Dta.move.fetchAllButtonClicked, "FetchAll")
Movewindow.modifyPosition.modeAbs = Dta.ui.createCheckbox("modifyPositionModeAbs", Movewindow.modifyPosition, 160, 0, Dta.Locale.Text.Absolute, true, nil, Dta.move.modifyPositionModeAbsChanged)
Movewindow.modifyPosition.modeRel = Dta.ui.createCheckbox("modifyPositionModeRel", Movewindow.modifyPosition, 160, 40, Dta.Locale.Text.Relative, false, nil, Dta.move.modifyPositionModeRelChanged)
Movewindow.modifyPosition.moveAsGrp = Dta.ui.createCheckbox("modifyPositionMoveAsGrp", Movewindow.modifyPosition, 175, 20, Dta.Locale.Text.MoveAsGroup, false)
Movewindow.modifyPosition.moveAsGrp:SetVisible(Dta.selectionCount > 1)
Movewindow.modifyPosition.modeLocal = Dta.ui.createCheckbox("modifyPositionModeLocal", Movewindow.modifyPosition, 175, 60, Dta.Locale.Text.LocalAxes, false)
Movewindow.modifyPosition.modeLocal:CBSetEnabled(false)
Movewindow.modifyPosition.changeBtn = Dta.ui.createButton("modifyPositionBtn", Movewindow.modifyPosition, 0, 85, nil, nil, Dta.Locale.Buttons.Move, nil, Dta.move.modifyPositionButtonClicked)
Movewindow.modifyPosition.resetBtn = Dta.ui.createButton("modifyPositionResetBtn", Movewindow.modifyPosition, 150, 85, nil, nil, Dta.Locale.Buttons.Reset, nil, Dta.move.modifyPositionResetButtonClicked)
Dta.ui.AddFocusCycleElement(Movewindow, Movewindow.modifyPosition.x)
Dta.ui.AddFocusCycleElement(Movewindow, Movewindow.modifyPosition.y)
Dta.ui.AddFocusCycleElement(Movewindow, Movewindow.modifyPosition.z)
Movewindow:EventAttach(Event.UI.Input.Key.Down.Dive, Dta.ui.FocusCycleCallback, "MoveWindow_TabFocusCycle")
-- TODO: temp fix for new window hierarchy
newWindow.modifyPosition = Movewindow.modifyPosition
return newWindow -- Movewindow
end
-- Show the toolbox window
function Dta.move_ui.showMoveWindow(move_window)
move_window:SetVisible(true)
end
-- Hide the toolbox window
function Dta.move_ui.hideMoveWindow(move_window)
move_window:SetVisible(false)
move_window:ClearKeyFocus()
end
Dta.RegisterTool("Move", Dta.move_ui.buildMoveWindow, Dta.move_ui.showMoveWindow, Dta.move_ui.hideMoveWindow)
|
local runner = require("test_executive")
local console = require("console")
-- Setup --
t = icesat2.ut_atl06()
-- Unit Test --
print('\n------------------\nTest01\n------------------')
runner.check(t:lsftest(), "Failed lsftest")
print('\n------------------\nTest02\n------------------')
runner.check(t:sorttest(), "Failed sorttest")
-- Clean Up --
-- Report Results --
runner.report()
|
return function(params)
local store = module:open_store();
local api = {};
function api:get(node)
local settings, err = store:get(node);
if not settings and err then
module:log("error", "Error reading push notification storage for node '%s': %s", node, tostring(err));
return nil, false;
end
if not settings then settings = {} end
return settings, true;
end
function api:set(node, data)
local settings = api:get(node); -- load node's data
local ok, err = store:set(node, data);
if not ok then
module:log("error", "Error writing push notification storage for node '%s': %s", node, tostring(err));
return false;
end
return true;
end
function api:list()
return store:users();
end
function api:token2node(token)
for node in store:users() do
-- read data directly, we don't want to cache full copies of stale entries as api:get() would do
local settings, err = store:get(node);
if not settings and err then
module:log("error", "Error reading push notification storage for node '%s': %s", node, tostring(err));
settings = {};
end
if settings.token and settings.node and settings.token == token then return settings.node; end
end
return nil;
end
return api;
end; |
do
local Nil = { __tag = "Nil" }
local use = print
local function map(f)
local function map_sat(x)
if x.__tag ~= "Cons" then return Nil end
local tmp = x[1]
return { { _1 = f(tmp._1), _2 = map_sat(tmp._2) }, __tag = "Cons" }
end
return map_sat
end
use(map)
local function map_no_sat(f, x)
if x.__tag ~= "Cons" then return Nil end
local tmp = x[1]
map_no_sat(nil, Nil)
return { { _1 = f(tmp._1), _2 = map(f)(tmp._2) }, __tag = "Cons" }
end
local function map_no_sat0(f) return function(x) return map_no_sat(f, x) end end
use(map_no_sat0)
end
|
SWEP.Base = "weapon_maw_base"
SWEP.Slot = 4
SWEP.PrintName = "AWP"
SWEP.HoldType = "ar2"
SWEP.ViewModel = "models/weapons/v_snip_awp.mdl"
SWEP.WorldModel = "models/weapons/w_snip_awp.mdl"
SWEP.Primary.Sound = "Weapon.Fire_Awp"
SWEP.Primary.Recoil = 1
SWEP.Primary.Damage = 95
SWEP.Primary.NumShots = 1
SWEP.Primary.Delay = 1.4
SWEP.Primary.ClipSize = 10
SWEP.Primary.DefaultClip = 10
SWEP.Primary.Automatic = false
SWEP.Primary.Ammo = "XBowBolt"
SWEP.LaserBeam = true
SWEP.Zoom = 45
|
-- Minimal logging utility
local log = {_logs = {}}
function log:setName(name)
self._handleName = name
end
function log:add(message)
self._logs[#self._logs+1] = message
end
function log:clear()
self._logs = {}
self._handleName = ''
end
function log:export(fileName)
local file = fileName or self._handleName
if not file then
error('No file handle set. Use setName() or pass a fileName to export()')
end
local f= io.open(file,'w')
for k,v in ipairs(self._logs) do
f:write(v..'\n')
end
f:close()
end
return log |
local test = require("cp.test")
local log = require("hs.logger").new("t_text")
local inspect = require("hs.inspect")
local config = require("cp.config")
local text = require("cp.text")
local matcher = require("cp.text.matcher")
local TEXT_PATH = config.scriptPath .. "/tests/unicode/"
function expectError(fn, ...)
local success, result = pcall(fn, ...)
ok(not success)
return result
end
return test.suite("cp.text"):with(
test("text from string", function()
local utf8text = "a丽𐐷"
local utf16le = "a\x00".."\x3D\x4E".."\x01\xD8\x37\xDC" -- "a".."丽".."𐐷" (little-endian)
local utf16be = "\x00a".."\x4E\x3D".."\xD8\x01\xDC\x37" -- "a".."丽".."𐐷" (big-endian)
local codepoints = {97, 20029, 66615} -- "a".."丽".."𐐷" (codepoints)
local value = text.fromString(utf8text)
ok(text.is(value))
for i,cp in ipairs(value) do
ok(eq(cp, codepoints[i]))
end
ok(eq(value:encode(), utf8text))
ok(eq(value:encode(text.encoding.utf16le), utf16le))
ok(eq(value:encode(text.encoding.utf16be), utf16be))
ok(eq(tostring(value), utf8text))
end),
test("text from codepoints", function()
local utf8text = "a丽𐐷"
local utf16le = "a\x00".."\x3D\x4E".."\x01\xD8\x37\xDC" -- "a".."丽".."𐐷" (little-endian)
local utf16be = "\x00a".."\x4E\x3D".."\xD8\x01\xDC\x37" -- "a".."丽".."𐐷" (big-endian)
local codepoints = {97, 20029, 66615} -- "a".."丽".."𐐷" (codepoints)
local value = text.fromCodepoints(codepoints)
ok(text.is(value))
for i,cp in ipairs(value) do
ok(eq(cp, codepoints[i]))
end
ok(eq(value:encode(), utf8text))
ok(eq(value:encode(text.encoding.utf16le), utf16le))
ok(eq(value:encode(text.encoding.utf16be), utf16be))
ok(eq(tostring(value), utf8text))
ok(eq(text.fromCodepoints(codepoints, 2), text "丽𐐷"))
ok(eq(text.fromCodepoints(codepoints, -1), text "𐐷"))
ok(eq(text.fromCodepoints(codepoints, 2, 1), text ""))
ok(eq(text.fromCodepoints(codepoints, 4), text ""))
end),
test("read-only", function()
local value = text "a丽𐐷"
expectError(function() value[1] = 1 end)
end),
test("concatenation", function()
local utf8String = "a丽𐐷"
local direct = text "a丽𐐷"
local joined = text "a" .. text "丽𐐷"
local left = text "a" .. "丽𐐷"
local right = "a" .. text "丽𐐷"
ok(eq(direct, joined))
ok(text.is(joined))
ok(text.is(left))
ok(text.is(right))
ok(eq(direct, left))
ok(eq(direct, right))
end),
test("len", function()
local utf8String = "a丽𐐷"
local unicodeText = text "a丽𐐷"
ok(eq(utf8String:len(), 8))
ok(eq(unicodeText:len(), 3))
ok(eq(#unicodeText, 3))
ok(eq(unicodeText:encode(text.encoding.utf16le):len(), 8))
end),
test("equality", function()
ok("a丽𐐷" == "a丽𐐷", "string == string")
ok("a丽𐐷" ~= text "a丽𐐷" ,"string ~= text")
ok(text "a丽𐐷" == text "a丽𐐷", "text == text")
ok(text "a丽𐐷" ~= text "other text", "text ~= different text")
end),
test("sub", function()
local value = text("123456789")
ok(eq(value:sub(1), text "123456789"))
ok(eq(value:sub(1,1), text "1"))
ok(eq(value:sub(5), text "56789"))
ok(eq(value:sub(5,7), text "567"))
ok(eq(value:sub(-2), text "89"))
ok(eq(value:sub(-5, -3), text "567"))
ok(eq(value:sub(5,1), text ""))
end),
test("text with BOM", function()
local utf8text = "\239\187\191".."a丽𐐷" -- BOM.."a丽𐐷"
local utf16le = "\255\254".."a\x00".."\x3D\x4E".."\x01\xD8\x37\xDC" -- BOM.."a".."丽".."𐐷" (little-endian)
local utf16be = "\254\255".."\x00a".."\x4E\x3D".."\xD8\x01\xDC\x37" -- BOM.."a".."丽".."𐐷" (big-endian)
local codepoints = {97, 20029, 66615} -- "a".."丽".."𐐷" (codepoints - BOM is skipped)
ok(eq(text.fromString(utf8text).codes, codepoints))
ok(eq(text.fromString(utf16le).codes, codepoints))
ok(eq(text.fromString(utf16be).codes, codepoints))
end),
test("text from file", function()
-- loading from BOM
ok(eq(text.fromFile(TEXT_PATH.."utf8.txt"), text "ABC123"))
ok(eq(text.fromFile(TEXT_PATH.."utf16le.txt"), text "ABC123"))
ok(eq(text.fromFile(TEXT_PATH.."utf16be.txt"), text "ABC123"))
end),
test("match", function()
local grp1, grp2 = text("valid@email"):match("^([^@]+)@([^@]+)$")
ok(eq(grp1, text "valid"))
ok(eq(grp2, text "email"))
local grp1, grp2 = text("@bad"):match("^([^@]+)@([^@]+)$")
ok(eq(grp1, nil))
ok(eq(grp2, nil))
local result = text("foobar"):match("^.*$")
ok(eq(result, text "foobar"))
local result = text("foobar"):match("^%d*$")
ok(eq(result, nil))
end),
test("gmatch", function()
local v = text("banana")
local count = 0
for w in v:gmatch("an") do
ok(eq(w, text "an"))
count = count + 1
end
ok(eq(count, 2))
end),
test("gsub", function()
local x
x = text("hello world"):gsub("%w+", "%0 %0")
ok(eq(x, text "hello hello world world"))
x = text("hello world"):gsub("%w+", "%0 %0", 1)
ok(eq(x, text "hello hello world"))
x = text("hello world from Lua"):gsub("(%w+)%s*(%w+)", "%2 %1")
ok(eq(x, text "world hello Lua from"))
x = text("home = $HOME, user = $USER"):gsub("%$(%w+)", {HOME = "/home/foo", USER = "foo"})
ok(eq(x, text "home = /home/foo, user = foo"))
x = text("4+5 = $return 4+5$"):gsub("%$(.-)%$", function (s)
return load(tostring(s))()
end)
ok(eq(x, text "4+5 = 9"))
local t = {name="lua", version="5.1"}
x = text("$name-$version.tar.gz"):gsub("%$(%w+)", t)
ok(eq(x, text "lua-5.1.tar.gz"))
x = text("Is \\Escaped"):gsub('%\\(.)', '%1')
ok(eq(x, text "Is Escaped"))
x = text('Is \\"Escaped\\"'):gsub('%\\(.)', '%1')
ok(eq(x, text 'Is "Escaped"'))
x = text("Is Unescaped"):gsub('%\\(.)', '%1')
ok(eq(x, text "Is Unescaped"))
x = text("A\\U1234B"):gsub('%\\[Uu]%d%d%d%d', function(s)
return utf8.char(tonumber(s:sub(3):encode()))
end)
ok(eq(x, text "AӒB"))
end),
test("quotes matcher", function()
local keyValue = matcher('^%"(.+)%"%s*%=%s*%"(.+)%";.*$')
local key, value = keyValue:match('"key" = "value";')
ok(eq(key, text "key"))
ok(eq(value, text "value"))
key, value = keyValue:match('"key" = "\\"quoted\\"";')
ok(eq(key, text "key"))
ok(eq(value, text '\\"quoted\\"'))
local CHAR_ESCAPE = matcher('%\\(.)')
local escaped = text 'Is \\"Escaped\\"'
ok(eq(tostring(escaped), 'Is \\"Escaped\\"'))
local x = CHAR_ESCAPE:gsub(escaped, '%1')
ok(eq(tostring(x), 'Is "Escaped"'))
-- Ensure it works twice in a row
local x = CHAR_ESCAPE:gsub(escaped.." ", '%1')
ok(eq(tostring(x), 'Is "Escaped" '))
end)
) |
great_squill = Creature:new {
objectName = "@mob/creature_names:squill_great",
socialGroup = "squill",
faction = "",
level = 20,
chanceHit = 0.33,
damageMin = 200,
damageMax = 210,
baseXp = 1609,
baseHAM = 5400,
baseHAMmax = 6600,
armor = 0,
resists = {110,110,10,10,-1,-1,10,-1,-1},
meatType = "meat_carnivore",
meatAmount = 6,
hideType = "hide_leathery",
hideAmount = 6,
boneType = "bone_mammal",
boneAmount = 5,
milk = 0,
tamingChance = 0.05,
ferocity = 0,
pvpBitmask = AGGRESSIVE + ATTACKABLE + ENEMY,
creatureBitmask = PACK + STALKER,
optionsBitmask = AIENABLED,
diet = CARNIVORE,
templates = {"object/mobile/squill_hue.iff"},
controlDeviceTemplate = "object/intangible/pet/squill_hue.iff",
scale = 1.25,
lootGroups = {},
weapons = {},
conversationTemplate = "",
attacks = {
{"stunattack",""}
}
}
CreatureTemplates:addCreatureTemplate(great_squill, "great_squill")
|
local defaultconfig = {
modActive = true,
chance = 7.5,
maxCycle = 75,
useBestCont = false,
tombRaider = false,
showSpawn = false,
showReset = false,
affectScripted = false,
dangerFactor = true,
removeRecycle = false,
hotkey = true,
hotkeyOpenTable = {
keyCode = tes3.scanCode.k
},
hotkeyOpenModifier = {
keyCode = tes3.scanCode.lShift
},
}
local mwseConfig = mwse.loadConfig("ancestral_tomb_amulets", defaultconfig)
return mwseConfig;
|
--- System that updates the camera.
local class = require "lib.middleclass"
local tiny = require "lib.tiny"
local Camera = require "src.camera"
local CameraUpdateSystem = tiny.system(class("CameraUpdateSystem"))
--- Updates the camera.
function CameraUpdateSystem:update()
Camera:update()
end
return CameraUpdateSystem
|
local platform = ...
-- simple io-library tests
--
-- C version on Windows will add change \n into \r\n for text files at least
--
print(io ~= nil)
print(io.open ~= nil)
print(io.stdin ~= nil)
print(io.stdout ~= nil)
print(io.stderr ~= nil)
print('write', io.write())
print('write', io.write("This"))
print('write', io.write(" is a pen."))
print('flush', io.flush())
local f = io.open("abc.txt", "w")
print('f', type(f))
print(io.type(f))
print('write', f:write("abcdef 12345 \t\t 678910 more\aaaaaaa\bbbbthe rest"))
print('type(f)', io.type(f))
print('close', f:close())
print('type(f)', io.type(f))
print('type("f")', io.type("f"))
local g = io.open("abc.txt", "r")
local t = { g:read(3, 3, "*n", "*n", "*l", "*l", "*a") }
for i, v in ipairs(t) do
print(string.format("%q", tostring(v)), type(v))
print('----- ', i)
end
local h, s = io.open("abc.txt", "a")
print('h', io.type(h), string.sub(tostring(h), 1, 6), s)
print('write', h:write('and more and more and more text.'))
print('close', h:close())
if platform ~= 'JME' then
local j = io.open("abc.txt", "r")
print('j', io.type(j))
print('seek', j:seek("set", 3))
print('read', j:read(4), j:read(3))
print('seek', j:seek("set", 2))
print('read', j:read(4), j:read(3))
print('seek', j:seek("cur", -8))
print('read', j:read(4), j:read(3))
print('seek(cur,0)', j:seek("cur", 0))
print('seek(cur,20)', j:seek("cur", 20))
print('seek(end,-5)', j:seek("end", -5))
print('read(4)', string.format("%q", tostring(j:read(4))))
print('read(4)', string.format("%q", tostring(j:read(4))))
print('read(4)', string.format("%q", tostring(j:read(4))))
print('close', j:close())
end
-- write a few lines, including a non-terminating one
f = io.open("abc.txt", "w")
print('f', io.type(f))
print('write', f:write("line one\nline two\n\nafter blank line\nunterminated line"))
print('type(f)', io.type(f))
print('close', f:close())
-- read using io.lines()
for l in io.lines("abc.txt") do
print(string.format('%q', l))
end
io.input("abc.txt")
for l in io.lines() do
print(string.format('%q', l))
end
io.input(io.open("abc.txt", "r"))
for l in io.lines() do
print(string.format('%q', l))
end
io.input("abc.txt")
io.input(io.input())
for l in io.lines() do
print(string.format('%q', l))
end
local count = 0
io.tmpfile = function()
count = count + 1
return io.open("tmp" .. count .. ".out", "w")
end
local a = io.tmpfile()
local b = io.tmpfile()
print(io.type(a))
print(io.type(b))
print("a:write", a:write('aaaaaaa'))
print("b:write", b:write('bbbbbbb'))
print("a:setvbuf", a:setvbuf("no"))
print("a:setvbuf", a:setvbuf("full", 1024))
print("a:setvbuf", a:setvbuf("line"))
print("a:write", a:write('ccccc'))
print("b:write", b:write('ddddd'))
print("a:flush", a:flush())
print("b:flush", b:flush())
--[[
print( "a:read", a:read(7) )
print( "b:read", b:read(7) )
print( "a:seek", a:seek("cur",-4) )
print( "b:seek", b:seek("cur",-4) )
print( "a:read", ( a:read(7) ) )
print( "b:read", ( b:read(7) ) )
print( "a:seek", a:seek("cur",-8) )
print( "b:seek", b:seek("cur",-8) )
print( "a:read", ( a:read(7) ) )
print( "b:read", ( b:read(7) ) )
--]]
local pcall = function(...)
local s, e = pcall(...)
if s then return s end
return s, e:match("closed")
end
print('a:close', pcall(a.close, a))
print('a:write', pcall(a.write, a, 'eee'))
print('a:flush', pcall(a.flush, a))
print('a:read', pcall(a.read, a, 5))
print('a:lines', pcall(a.lines, a))
print('a:seek', pcall(a.seek, a, "cur", -2))
print('a:setvbuf', pcall(a.setvbuf, a, "no"))
print('a:close', pcall(a.close, a))
print('io.type(a)', pcall(io.type, a))
print('io.close()', pcall(io.close))
print('io.close(io.output())', pcall(io.close, io.output()))
io.output('abc.txt')
print('io.close()', pcall(io.close))
print('io.write', pcall(io.write, 'eee'))
print('io.flush', pcall(io.flush))
print('io.close', pcall(io.close))
io.input('abc.txt'):close()
print('io.read', pcall(io.read, 5))
print('io.lines', pcall(io.lines))
|
---
-- A module that contains all functions related to playermodels
-- @author Mineotopia
if SERVER then
AddCSLuaFile()
util.AddNetworkString("TTT2UpdatePlayerModel")
util.AddNetworkString("TTT2UpdateChangedPlayerModel")
util.AddNetworkString("TTT2ResetPlayerModels")
end
local pairs = pairs
local playerManagerAllValidModels = player_manager.AllValidModels
local playerManagerTranslateToPlayerModelName = player_manager.TranslateToPlayerModelName
local utilPrecacheModel = util.PrecacheModel
local mathRandom = math.random
local stringLower = string.lower
local tableCopy = table.Copy
local function GetPlayerSize(ply)
local bottom, top = ply:GetHull()
return top - bottom
end
---
-- @realm server
local cvCustomModels = CreateConVar("ttt2_use_custom_models", "0", {FCVAR_NOTIFY, FCVAR_ARCHIVE})
local initialModels = {
["css_phoenix"] = true,
["css_arctic"] = true,
["css_guerilla"] = true,
["css_leet"] = true
}
local initialHattableModels = {
["css_phoenix"] = true,
["css_arctic"] = true,
["monk"] = true,
["female01"] = true,
["female02"] = true,
["female03"] = true,
["female04"] = true,
["female05"] = true,
["female06"] = true,
["male01"] = true,
["male02"] = true,
["male03"] = true,
["male04"] = true,
["male05"] = true,
["male06"] = true,
["male07"] = true,
["male08"] = true,
["male09"] = true
}
-- Increase this when more values are given
-- (2 ^ bitCount) - 1 is the maximum number that can be sent
local bitCount = 2
playermodels = playermodels or {}
playermodels.sqltable = "ttt2_playermodel_pool_changes"
playermodels.savingKeys = {
selected = {typ = "bool", default = false},
hattable = {typ = "bool", default = false}
}
playermodels.fallbackModel = "models/player/phoenix.mdl"
playermodels.modelStates = playermodels.modelStates or {}
playermodels.defaultModelStates = playermodels.defaultModelStates or {}
playermodels.changedModelStates = playermodels.changedModelStates or {}
-- Enums for the states
playermodels.state = {
selected = 1,
hattable = 2
}
-- Are automatically constructed on first use
-- playermodels.stateNames = { [1] = "selected" ...}
---
-- Updates the given value state of a provided playermodel.
-- @param string name The name of the model
-- @param number valueEnum The enum of the variable to change. See `playermodels.state` for listed enums
-- @param boolean state The selection state, `true` to enable the model
-- @realm shared
function playermodels.UpdateModel(name, valueEnum, state)
if SERVER then
local valueName = playermodels.GetStringFromEnum(valueEnum)
playermodels.modelStates[name][valueName] = state
playermodels.changedModelStates[name] = playermodels.changedModelStates[name] or {}
local changedData = playermodels.changedModelStates[name]
if playermodels.defaultModelStates[name][valueName] == state then
changedData[valueName] = nil
else
changedData[valueName] = state
end
local playermodelPoolModel = orm.Make(playermodels.sqltable)
local playermodelObject = playermodelPoolModel:Find(name)
if not playermodelObject then
playermodelObject = playermodelPoolModel:New({
name = name
})
end
playermodelObject[valueName] = changedData[valueName]
if table.IsEmpty(changedData) then
playermodelObject:Delete()
playermodels.changedModelStates[name] = nil
else
playermodelObject:Save()
playermodels.changedModelStates[name] = changedData
end
playermodels.StreamModelStateToSelectedClients(true)
else -- CLIENT
net.Start("TTT2UpdatePlayerModel")
net.WriteString(name)
net.WriteUInt(valueEnum, bitCount)
net.WriteBool(state or false)
net.SendToServer()
end
end
---
-- Converts the given enum to a string and also creates a fast lookup table
-- @param number stateEnum The enum to be converted. See `playermodels.state` for listed enums
-- @return string stateName returns the name of the given enum
-- @realm shared
function playermodels.GetStringFromEnum(stateEnum)
if not playermodels.stateNames then
playermodels.stateNames = {}
for name, enum in pairs(playermodels.state) do
playermodels.stateNames[enum] = name
end
end
return playermodels.stateNames[stateEnum]
end
---
-- Returns an indexed table with all the models states that are stored
-- @note While this function is shared, the data is only available for superadmin on the
-- client, if no manual sync is triggered.
-- @return table An hashed table with all the model data stored in the database
-- @realm shared
function playermodels.GetModelStates()
return playermodels.modelStates or {}
end
---
-- Checks if a provided model is in the selection pool.
-- @note While this function is shared, the data is only available for superadmin on the
-- client, if no manual sync is triggered.
-- @param string name The name of the model
-- @return boolean Returns true, if the model is in the selection pool
-- @realm shared
function playermodels.IsSelectedModel(name)
local models = playermodels.modelStates
if not models or not models[name] then
return false
end
return models[name].selected or false
end
---
-- Checks if a provided model is hattable.
-- @note While this function is shared, the data is only available for superadmin on the
-- client, if no manual sync is triggered.
-- @param string name The name of the model
-- @return boolean Returns true, if the model is hattable
-- @realm shared
function playermodels.IsHattableModel(name)
local models = playermodels.modelStates
if not models or not models[name] then
return false
end
return models[name].hattable or false
end
---
-- Reset all selected playermodels, hattability and reinitialize the database.
-- @realm shared
function playermodels.Reset()
if SERVER then
-- in the first step the database is deleted
sql.DropTable(playermodels.sqltable)
-- then the table is reinitialized
playermodels.Initialize()
-- this data then has to be synced to the client again
playermodels.StreamModelStateToSelectedClients()
else
net.Start("TTT2ResetPlayerModels")
net.SendToServer()
end
end
if CLIENT then
local callbackCache = {}
net.ReceiveStream("TTT2StreamDefaultModelTable", function(data)
playermodels.defaultModelStates = data
playermodels.modelStates = tableCopy(data)
for _, Callback in pairs(callbackCache) do
Callback(data)
end
end)
net.ReceiveStream("TTT2StreamChangedModelTable", function(data)
local dataValue
for name, values in pairs(playermodels.defaultModelStates) do
for valueName, value in pairs(values) do
playermodels.modelStates[name] = playermodels.modelStates[name] or {}
dataValue = data[name] and data[name][valueName]
if dataValue == nil then
dataValue = value
end
playermodels.modelStates[name][valueName] = dataValue
playermodels.modelStates[name].sortName = stringLower(name)
end
end
for _, Callback in pairs(callbackCache) do
Callback(playermodels.modelStates)
end
end)
---
-- Used to add a function to the callback stack that is called when a change
-- is made on the server. The first argument of the Callback function is the
-- new data.
-- @param string name The unique callback identifier
-- @param function Callback The callback function that should be added
-- @realm client
function playermodels.OnChange(name, Callback)
callbackCache[name] = Callback
end
-- all the remaining functions are server only
return
end
---
-- Returns an indexed table with all the changed models states that are stored
-- in the database.
-- @return table A hashed table with all the model data stored in the database
-- @realm server
function playermodels.ReadChangedModelStatesSQL()
local sqlTable = orm.Make(playermodels.sqltable)
local data = sqlTable:All()
local hashableData = {}
for i = 1, #data do
local entry = data[i]
local name = entry.name
hashableData[name] = {}
for key, info in pairs(playermodels.savingKeys) do
if info.typ == "bool" then
hashableData[name][key] = tobool(entry[key])
elseif info.typ == "number" then
hashableData[name][key] = tonumber(entry[key])
else
hashableData[name][key] = entry[key]
end
end
end
return hashableData
end
---
-- Returns an indexed table with all the models that are in the selection pool.
-- @return table An indexed table with all selected player models
-- @realm server
function playermodels.GetSelectedModels()
local playerModelPoolNames = {}
for name, values in pairs(playermodels.modelStates) do
if values.selected then
playerModelPoolNames[#playerModelPoolNames + 1] = name
end
end
return playerModelPoolNames
end
---
-- Initializes the modelstates. This adds all models and sets the default models to true, if it
-- is the first init on this server.
-- @internal
-- @realm server
function playermodels.Initialize()
if not sql.CreateSqlTable(playermodels.sqltable, playermodels.savingKeys) then
return false
end
local data = playermodels.modelStates or {}
local defaultData = {}
local changedData = playermodels.ReadChangedModelStatesSQL()
for name in pairs(playerManagerAllValidModels()) do
defaultData[name] = {}
defaultData[name].selected = initialModels[name] or false
defaultData[name].hattable = initialHattableModels[name] or false
data[name] = data[name] or {}
if changedData[name] and changedData[name].selected ~= nil then
data[name].selected = changedData[name].selected
else
data[name].selected = defaultData[name].selected
end
if changedData[name] and changedData[name].hattable ~= nil then
data[name].hattable = changedData[name].hattable
else
data[name].hattable = defaultData[name].hattable
end
end
playermodels.modelStates = data
playermodels.defaultModelStates = defaultData
playermodels.changedModelStates = changedData
playermodels.InitializeHeadHitBoxes()
return true
end
---
-- Tests each model for headshot hitboxes by applying it to a testing entity and then
-- checking all its bones.
-- @note Do not use before @{GM:InitPostEntity} has been called, otherwise the server will crash!
-- @realm server
function playermodels.InitializeHeadHitBoxes()
local testingEnt = ents.Create("ttt_model_tester")
for name, model in pairs(playerManagerAllValidModels()) do
testingEnt:SetModel(model)
for i = 1, testingEnt:GetHitBoxCount(0) do
if testingEnt:GetHitBoxHitGroup(i - 1, 0) == HITGROUP_HEAD then
playermodels.modelStates[name].hasHeadHitBox = true
break
end
playermodels.modelStates[name].hasHeadHitBox = false
end
playermodels.defaultModelStates[name].hasHeadHitBox = playermodels.modelStates[name].hasHeadHitBox
end
testingEnt:Remove()
end
---
-- Streams the playermodel selection pool to clients. By default streams to all superadmin players.
-- @param bool onlyChanges if only changes should be sent, otherwise the default is sent too
-- @param[opt] table|Player plys The players that should receive the update, all superadmins if nil
-- @realm server
function playermodels.StreamModelStateToSelectedClients(onlyChanges, plys)
plys = plys or util.GetFilteredPlayers(function(ply)
return ply:IsSuperAdmin()
end)
if not onlyChanges then
net.SendStream("TTT2StreamDefaultModelTable", playermodels.defaultModelStates, plys)
end
net.SendStream("TTT2StreamChangedModelTable", playermodels.changedModelStates, plys)
end
---
-- Precaches all valid playermodels to make sure that rendering the model can be done
-- without an initial lag. This is especially important for menus where multiple
-- models are rendered.
-- @internal
-- @realm server
function playermodels.PrecacheModels()
for _, model in pairs(playerManagerAllValidModels()) do
utilPrecacheModel(model)
end
end
---
-- Selects a random playermodel from the available list of existing playermodels
-- @return Model model The selected playermodel
-- @realm server
function playermodels.GetRandomPlayerModel()
local availableModels = playermodels.GetSelectedModels()
local sizeAvailableModels = #availableModels
if cvCustomModels:GetBool() and sizeAvailableModels > 0 then
local modelPaths = playerManagerAllValidModels()
local randomModel = availableModels[mathRandom(sizeAvailableModels)]
return Model(modelPaths[randomModel])
else
return Model(playermodels.fallbackModel)
end
end
---
-- Applies a detective hat to the provided player. Doesn't check if the player's model
-- allows a hat. Use the Filter function for this.
-- @param Player ply The player that should receive the hat
-- @param[opt] function Filter The filter function that has to return true to apply a hat
-- @realm server
function playermodels.ApplyPlayerHat(ply, Filter)
if IsValid(ply.hat) or (isfunction(Filter) and not Filter(ply)) then return end
local hat = ents.Create("ttt_hat_deerstalker")
if not IsValid(hat) then return end
hat:SetPos(ply:GetPos() + Vector(0, 0, GetPlayerSize(ply).z))
hat:SetAngles(ply:GetAngles())
hat:SetParent(ply)
hat:Spawn()
ply.hat = hat
end
---
-- Removes the detective hat from the player.
-- @param Player ply The player whose hat should be removed
-- @realm server
function playermodels.RemovePlayerHat(ply)
if not IsValid(ply.hat) then return end
SafeRemoveEntity(ply.hat)
ply.hat = nil
end
---
-- Checks whether a playermodel can have a hat.
-- @param Player ply The players whose model should be checked
-- @return boolean Returns true if the player's model can have a detective hat
-- @realm server
function playermodels.PlayerCanHaveHat(ply)
return playermodels.IsHattableModel(playerManagerTranslateToPlayerModelName(ply:GetModel()))
end
net.Receive("TTT2UpdatePlayerModel", function(_, ply)
if not IsValid(ply) or not ply:IsSuperAdmin() then return end
playermodels.UpdateModel(net.ReadString(), net.ReadUInt(bitCount), net.ReadBool())
end)
net.Receive("TTT2ResetPlayerModels", function(_, ply)
if not IsValid(ply) or not ply:IsSuperAdmin() then return end
playermodels.Reset()
end)
|
function Egg:GetMaturityRate()
return kEggMaturationTime
end
function Egg:GetMatureMaxHealth()
return kMatureEggHealth
end
function Egg:GetMatureMaxArmor()
return kMatureEggArmor
end
if Server then
local function GestatePlayer(self, player, fromTechId)
player.oneHive = false
player.twoHives = false
player.threeHives = false
-- local playerHealthScalar = player:GetHealthScalar()
-- local playerArmorScalar = player:GetArmorScalar()
local newPlayer = player:Replace(Embryo.kMapName)
if not newPlayer:IsAnimated() then
newPlayer:SetDesiredCamera(1.1, { follow = true, tweening = kTweeningFunctions.easeout7 })
end
newPlayer:SetCameraDistance(kGestateCameraDistance)
-- Eliminate velocity so that we don't slide or jump as an egg
newPlayer:SetVelocity(Vector(0, 0, 0))
newPlayer:DropToFloor()
local techIds = { self:GetGestateTechId() }
-- newPlayer:SetGestationData(techIds, fromTechId, playerHealthScalar, playerArmorScalar)
newPlayer:SetGestationData(techIds, fromTechId, 1, 1)
end
ReplaceLocals(Egg.OnUse, {GestatePlayer = GestatePlayer})
end
function Egg:SpawnPlayer(player)
PROFILE("Egg:SpawnPlayer")
local queuedPlayer = player
if not queuedPlayer or self.queuedPlayerId ~= nil then
queuedPlayer = Shared.GetEntity(self.queuedPlayerId)
end
if queuedPlayer ~= nil then
local queuedPlayer = player
if not queuedPlayer then
queuedPlayer = Shared.GetEntity(self.queuedPlayerId)
end
-- Spawn player on top of egg
local spawnOrigin = Vector(self:GetOrigin())
-- Move down to the ground.
local _, normal = GetSurfaceAndNormalUnderEntity(self)
if normal.y < 1 then
spawnOrigin.y = spawnOrigin.y - (self:GetExtents().y / 2) + 1
else
spawnOrigin.y = spawnOrigin.y - (self:GetExtents().y / 2)
end
local gestationClass = self:GetClassToGestate()
-- We must clear out queuedPlayerId BEFORE calling ReplaceRespawnPlayer
-- as this will trigger OnEntityChange() which would requeue this player.
self.queuedPlayerId = nil
local team = queuedPlayer:GetTeam()
local success, player = team:ReplaceRespawnPlayer(queuedPlayer, spawnOrigin, queuedPlayer:GetAngles(), gestationClass)
player:SetCameraDistance(0)
player:SetHatched()
-- It is important that the player was spawned at the spot we specified.
assert(player:GetOrigin() == spawnOrigin)
if success then
-- self:PickUpgrades(player)
self:TriggerEffects("egg_death")
DestroyEntity(self)
return true, player
end
end
return false, nil
end |
model.packMlDlg={}
function model.packMlDlg.onClose()
if model.packMlDlg.ui then
model.packMlDlg.dlg_wasClosed=true
model.packMlDlg.closeDlg()
end
end
function model.packMlDlg.closeDlg()
if model.packMlDlg.ui then
local x,y=simUI.getPosition(model.packMlDlg.ui)
model.packMlDlg.packMLState_previousDlgPos={x,y}
simUI.destroy(model.packMlDlg.ui)
model.packMlDlg.ui=nil
end
end
function model.packMlDlg.updateState(state)
if model.packMlDlg.ui then
simUI.setStyleSheet(model.packMlDlg.ui,1,"* {background-color: #bbffbb}")
simUI.setStyleSheet(model.packMlDlg.ui,2,"* {background-color: #ffffbb}")
simUI.setStyleSheet(model.packMlDlg.ui,3,"* {background-color: #bbffbb}")
simUI.setStyleSheet(model.packMlDlg.ui,4,"* {background-color: #bbffbb}")
simUI.setStyleSheet(model.packMlDlg.ui,5,"* {background-color: #ffffbb}")
simUI.setStyleSheet(model.packMlDlg.ui,6,"* {background-color: #bbffbb}")
simUI.setStyleSheet(model.packMlDlg.ui,7,"* {background-color: #ffffbb}")
simUI.setStyleSheet(model.packMlDlg.ui,8,"* {background-color: #bbffbb}")
simUI.setStyleSheet(model.packMlDlg.ui,9,"* {background-color: #bbffbb}")
simUI.setStyleSheet(model.packMlDlg.ui,10,"* {background-color: #ffffbb}")
simUI.setStyleSheet(model.packMlDlg.ui,11,"* {background-color: #bbffbb}")
simUI.setStyleSheet(model.packMlDlg.ui,12,"* {background-color: #bbddff}")
simUI.setStyleSheet(model.packMlDlg.ui,13,"* {background-color: #bbffbb}")
simUI.setStyleSheet(model.packMlDlg.ui,14,"* {background-color: #ffffbb}")
simUI.setStyleSheet(model.packMlDlg.ui,15,"* {background-color: #bbffbb}")
simUI.setStyleSheet(model.packMlDlg.ui,16,"* {background-color: #ffffbb}")
simUI.setStyleSheet(model.packMlDlg.ui,17,"* {background-color: #bbffbb}")
state=string.lower(state)
local id=-1
if state=='aborting' then id=1 end
if state=='aborted' then id=2 end
if state=='clearing' then id=3 end
if state=='stopping' then id=4 end
if state=='stopped' then id=5 end
if state=='suspending' then id=6 end
if state=='suspended' then id=7 end
if state=='un-suspending' then id=8 end
if state=='resetting' then id=9 end
if state=='complete' then id=10 end
if state=='completing' then id=11 end
if state=='execute' then id=12 end
if state=='starting' then id=13 end
if state=='idle' then id=14 end
if state=='holding' then id=15 end
if state=='hold' then id=16 end
if state=='un-holding' then id=17 end
if id>=0 then
simUI.setStyleSheet(model.packMlDlg.ui,id,"* {background-color: #ff6600}")
end
end
end
function model.packMlDlg.createDlg()
if not model.packMlDlg.ui then
local xml =[[
<image geometry="0,0,1088,607" width="702" height="390" id="1000"/>
<button text="Aborting" geometry="591,312,79,50" enabled="false" id="1" style="* {background-color: #bbffbb}"/>
<button text="Aborted" geometry="451,312,79,50" enabled="false" id="2" style="* {background-color: #ffffbb}"/>
<button text="Clearing" geometry="311,312,79,50" enabled="false" id="3" style="* {background-color: #bbffbb}"/>
<button text="Stopping" geometry="170,312,79,50" enabled="false" id="4" style="* {background-color: #bbffbb}"/>
<button text="Stopped" geometry="29,312,79,50" enabled="false" id="5" style="* {background-color: #ffffbb}"/>
<button text="Suspending" geometry="451,187,79,50" enabled="false" id="6" style="* {background-color: #bbffbb}"/>
<button text="Suspended" geometry="311,187,79,50" enabled="false" id="7" style="* {background-color: #ffffbb}"/>
<button text="Un-Suspending" geometry="170,187,79,50" enabled="false" id="8" style="* {background-color: #bbffbb}"/>
<button text="Resetting" geometry="29,187,79,50" enabled="false" id="9" style="* {background-color: #bbffbb}"/>
<button text="Complete" geometry="591,108,79,50" enabled="false" id="10" style="* {background-color: #ffffbb}"/>
<button text="Completing" geometry="451,108,79,50" enabled="false" id="11" style="* {background-color: #bbffbb}"/>
<button text="Execute" geometry="311,108,79,50" enabled="false" id="12" style="* {background-color: #bbddff}"/>
<button text="Starting" geometry="170,108,79,50" enabled="false" id="13" style="* {background-color: #bbffbb}"/>
<button text="Idle" geometry="29,108,79,50" enabled="false" id="14" style="* {background-color: #ffffbb}"/>
<button text="Holding" geometry="451,30,79,50" enabled="false" id="15" style="* {background-color: #bbffbb}"/>
<button text="Hold" geometry="311,30,79,50" enabled="false" id="16" style="* {background-color: #ffffbb}"/>
<button text="Un-Holding" geometry="170,30,79,50" enabled="false" id="17" style="* {background-color: #bbffbb}"/>
]]
if model.packMlDlg.packMLState_previousDlgPos==nil then
model.packMlDlg.packMLState_previousDlgPos='topLeft'
end
model.packMlDlg.ui=simBWF.createCustomUi(xml,'Current PackML state',model.packMlDlg.packMLState_previousDlgPos,true,'model.packMlDlg.onClose',false,false,false,'layout="none"',{702,390})
local img=sim.loadImage(0,sim.getStringParameter(sim.stringparam_application_path).."/BlueWorkforce/resources/packML-run.png")
simUI.setImageData(model.packMlDlg.ui,1000,img,702,390)
end
end
|
--[[
Copyright 2011 Iordan Iordanov <iiordanov (AT) gmail.com>
This file is part of luci-pbx.
luci-pbx is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
luci-pbx is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with luci-pbx. If not, see <http://www.gnu.org/licenses/>.
]]--
if nixio.fs.access("/etc/init.d/asterisk") then
server = "asterisk"
elseif nixio.fs.access("/etc/init.d/freeswitch") then
server = "freeswitch"
else
server = ""
end
appname = "PBX"
modulename = "pbx-advanced"
defaultbindport = 5060
defaultrtpstart = 19850
defaultrtpend = 19900
-- Returns all the network related settings, including a constructed RTP range
function get_network_info()
externhost = m.uci:get(modulename, "advanced", "externhost")
ipaddr = m.uci:get("network", "lan", "ipaddr")
bindport = m.uci:get(modulename, "advanced", "bindport")
rtpstart = m.uci:get(modulename, "advanced", "rtpstart")
rtpend = m.uci:get(modulename, "advanced", "rtpend")
if bindport == nil then bindport = defaultbindport end
if rtpstart == nil then rtpstart = defaultrtpstart end
if rtpend == nil then rtpend = defaultrtpend end
if rtpstart == nil or rtpend == nil then
rtprange = nil
else
rtprange = rtpstart .. "-" .. rtpend
end
return bindport, rtprange, ipaddr, externhost
end
-- If not present, insert empty rules in the given config & section named PBX-SIP and PBX-RTP
function insert_empty_sip_rtp_rules(config, section)
-- Add rules named PBX-SIP and PBX-RTP if not existing
found_sip_rule = false
found_rtp_rule = false
m.uci:foreach(config, section,
function(s1)
if s1._name == 'PBX-SIP' then
found_sip_rule = true
elseif s1._name == 'PBX-RTP' then
found_rtp_rule = true
end
end)
if found_sip_rule ~= true then
newrule=m.uci:add(config, section)
m.uci:set(config, newrule, '_name', 'PBX-SIP')
end
if found_rtp_rule ~= true then
newrule=m.uci:add(config, section)
m.uci:set(config, newrule, '_name', 'PBX-RTP')
end
end
-- Delete rules in the given config & section named PBX-SIP and PBX-RTP
function delete_sip_rtp_rules(config, section)
-- Remove rules named PBX-SIP and PBX-RTP
commit = false
m.uci:foreach(config, section,
function(s1)
if s1._name == 'PBX-SIP' or s1._name == 'PBX-RTP' then
m.uci:delete(config, s1['.name'])
commit = true
end
end)
-- If something changed, then we commit the config.
if commit == true then m.uci:commit(config) end
end
-- Deletes QoS rules associated with this PBX.
function delete_qos_rules()
delete_sip_rtp_rules ("qos", "classify")
end
function insert_qos_rules()
-- Insert empty PBX-SIP and PBX-RTP rules if not present.
insert_empty_sip_rtp_rules ("qos", "classify")
-- Get the network information
bindport, rtprange, ipaddr, externhost = get_network_info()
-- Iterate through the QoS rules, and if there is no other rule with the same port
-- range at the priority service level, insert this rule.
commit = false
m.uci:foreach("qos", "classify",
function(s1)
if s1._name == 'PBX-SIP' then
if s1.ports ~= bindport or s1.target ~= "Priority" or s1.proto ~= "udp" then
m.uci:set("qos", s1['.name'], "ports", bindport)
m.uci:set("qos", s1['.name'], "proto", "udp")
m.uci:set("qos", s1['.name'], "target", "Priority")
commit = true
end
elseif s1._name == 'PBX-RTP' then
if s1.ports ~= rtprange or s1.target ~= "Priority" or s1.proto ~= "udp" then
m.uci:set("qos", s1['.name'], "ports", rtprange)
m.uci:set("qos", s1['.name'], "proto", "udp")
m.uci:set("qos", s1['.name'], "target", "Priority")
commit = true
end
end
end)
-- If something changed, then we commit the qos config.
if commit == true then m.uci:commit("qos") end
end
-- This function is a (so far) unsuccessful attempt to manipulate the firewall rules from here
-- Need to do more testing and eventually move to this mode.
function maintain_firewall_rules()
-- Get the network information
bindport, rtprange, ipaddr, externhost = get_network_info()
commit = false
-- Only if externhost is set, do we control firewall rules.
if externhost ~= nil and bindport ~= nil and rtprange ~= nil then
-- Insert empty PBX-SIP and PBX-RTP rules if not present.
insert_empty_sip_rtp_rules ("firewall", "rule")
-- Iterate through the firewall rules, and if the dest_port and dest_ip setting of the\
-- SIP and RTP rule do not match what we want configured, set all the entries in the rule\
-- appropriately.
m.uci:foreach("firewall", "rule",
function(s1)
if s1._name == 'PBX-SIP' then
if s1.dest_port ~= bindport then
m.uci:set("firewall", s1['.name'], "dest_port", bindport)
m.uci:set("firewall", s1['.name'], "src", "wan")
m.uci:set("firewall", s1['.name'], "proto", "udp")
m.uci:set("firewall", s1['.name'], "target", "ACCEPT")
commit = true
end
elseif s1._name == 'PBX-RTP' then
if s1.dest_port ~= rtprange then
m.uci:set("firewall", s1['.name'], "dest_port", rtprange)
m.uci:set("firewall", s1['.name'], "src", "wan")
m.uci:set("firewall", s1['.name'], "proto", "udp")
m.uci:set("firewall", s1['.name'], "target", "ACCEPT")
commit = true
end
end
end)
else
-- We delete the firewall rules if one or more of the necessary parameters are not set.
sip_rule_name=nil
rtp_rule_name=nil
-- First discover the configuration names of the rules.
m.uci:foreach("firewall", "rule",
function(s1)
if s1._name == 'PBX-SIP' then
sip_rule_name = s1['.name']
elseif s1._name == 'PBX-RTP' then
rtp_rule_name = s1['.name']
end
end)
-- Then, using the names, actually delete the rules.
if sip_rule_name ~= nil then
m.uci:delete("firewall", sip_rule_name)
commit = true
end
if rtp_rule_name ~= nil then
m.uci:delete("firewall", rtp_rule_name)
commit = true
end
end
-- If something changed, then we commit the firewall config.
if commit == true then m.uci:commit("firewall") end
end
m = Map (modulename, translate("Advanced Settings"),
translate("This section contains settings that do not need to be changed under \
normal circumstances. In addition, here you can configure your system \
for use with remote SIP devices, and resolve call quality issues by enabling \
the insertion of QoS rules."))
-- Recreate the voip server config, and restart necessary services after changes are commited
-- to the advanced configuration. The firewall must restart because of "Remote Usage".
function m.on_after_commit(self)
-- Make sure firewall rules are in place
maintain_firewall_rules()
-- If insertion of QoS rules is enabled
if m.uci:get(modulename, "advanced", "qos_enabled") == "yes" then
insert_qos_rules()
else
delete_qos_rules()
end
luci.sys.call("/etc/init.d/pbx-" .. server .. " restart 1\>/dev/null 2\>/dev/null")
luci.sys.call("/etc/init.d/" .. server .. " restart 1\>/dev/null 2\>/dev/null")
luci.sys.call("/etc/init.d/firewall restart 1\>/dev/null 2\>/dev/null")
end
-----------------------------------------------------------------------------
s = m:section(NamedSection, "advanced", "settings", translate("Advanced Settings"))
s.anonymous = true
s:tab("general", translate("General Settings"))
s:tab("remote_usage", translate("Remote Usage"),
translatef("You can use your SIP devices/softphones with this system from a remote location \
as well, as long as your Internet Service Provider gives you a public IP. \
You will be able to call other local users for free (e.g. other Analog Telephone Adapters (ATAs)) \
and use your VoIP providers to make calls as if you were local to the PBX. \
After configuring this tab, go back to where users are configured and see the new \
Server and Port setting you need to configure the remote SIP devices with. Please note that if this \
PBX is not running on your router/gateway, you will need to configure port forwarding (NAT) on your \
router/gateway. Please forward the ports below (SIP port and RTP range) to the IP address of the \
device running this PBX."))
s:tab("qos", translate("QoS Settings"),
translate("If you experience jittery or high latency audio during heavy downloads, you may want \
to enable QoS. QoS prioritizes traffic to and from your network for specified ports and IP \
addresses, resulting in better latency and throughput for sound in our case. If enabled below, \
a QoS rule for this service will be configured by the PBX automatically, but you must visit the \
QoS configuration page (Network->QoS) to configure other critical QoS settings like Download \
and Upload speed."))
ringtime = s:taboption("general", Value, "ringtime", translate("Number of Seconds to Ring"),
translate("Set the number of seconds to ring users upon incoming calls before hanging up \
or going to voicemail, if the voicemail is installed and enabled."))
ringtime.datatype = "port"
ringtime.default = 30
ua = s:taboption("general", Value, "useragent", translate("User Agent String"),
translate("This is the name that the VoIP server will use to identify itself when \
registering to VoIP (SIP) providers. Some providers require this to a specific \
string matching a hardware SIP device."))
ua.default = appname
h = s:taboption("remote_usage", Value, "externhost", translate("Domain/IP Address/Dynamic Domain"),
translate("You can enter your domain name, external IP address, or dynamic domain name here. \
The best thing to input is a static IP address. If your IP address is dynamic and it changes, \
your configuration will become invalid. Hence, it's recommended to set up Dynamic DNS in this case. \
and enter your Dynamic DNS hostname here. You can configure Dynamic DNS with the luci-app-ddns package."))
h.datatype = "host(0)"
p = s:taboption("remote_usage", Value, "bindport", translate("External SIP Port"),
translate("Pick a random port number between 6500 and 9500 for the service to listen on. \
Do not pick the standard 5060, because it is often subject to brute-force attacks. \
When finished, (1) click \"Save and Apply\", and (2) look in the \
\"SIP Device/Softphone Accounts\" section for updated Server and Port settings \
for your SIP Devices/Softphones."))
p.datatype = "port"
p = s:taboption("remote_usage", Value, "rtpstart", translate("RTP Port Range Start"),
translate("RTP traffic carries actual voice packets. This is the start of the port range \
that will be used for setting up RTP communication. It's usually OK to leave this \
at the default value."))
p.datatype = "port"
p.default = defaultrtpstart
p = s:taboption("remote_usage", Value, "rtpend", translate("RTP Port Range End"))
p.datatype = "port"
p.default = defaultrtpend
p = s:taboption("qos", ListValue, "qos_enabled", translate("Insert QoS Rules"))
p:value("yes", translate("Yes"))
p:value("no", translate("No"))
p.default = "yes"
return m
|
local timer = require 'script.timer'
local redis = require 'script.redis'
local util = require 'script.utility'
local KEY = require 'script.jzslm.key'
local money = require 'script.jzslm.money'
local item = require 'script.jzslm.item'
local camp = require 'script.jzslm.camp'
local cheat = require 'script.jzslm.cheat'
local log = require 'script.log'
local speedReward = {
{ 1, 100},
{ 2, 64},
{ 3, 47},
{ 10, 35},
{100, 28},
{500, 23},
{math.huge, 20},
}
local function awardBySpeed(time, date)
ngx.log(ngx.INFO, '进行排名结算!')
local red = redis.get()
local f = log(('logs\\reward\\%04d-%02d-%02d.log'):format(
date.year,
date.month,
date.day
))
-- 计算每个玩家在排行榜中的最高名次
f:write('=====排行榜一览=====\n')
local maxRank = {}
local uids = util.zrevrange(red, KEY.GROUP_SCORE, 1, -1)
for rank, uid in ipairs(uids) do
f:write(rank, '\t', uid, '\n')
local players = util.unpackList(uid)
for _, player in ipairs(players) do
if not maxRank[player] or maxRank[player] > rank then
maxRank[player] = rank
end
end
end
-- 根据每个玩家的最高名次来发送奖励
f:write('=====玩家一览=====\n')
local sortedRank = {}
for player in pairs(maxRank) do
sortedRank[#sortedRank+1] = player
end
table.sort(sortedRank, function (a, b)
return maxRank[a] < maxRank[b]
end)
for _, player in pairs(sortedRank) do
local rank = maxRank[player]
f:write(rank, '\t', player, '\n')
for level, data in ipairs(speedReward) do
if rank <= data[1] then
local selfReward = data[2]
local campReward = data[2]
local campName = camp._get(red, player)
local hasFlag = item._get(red, player, '联盟战旗') > 0
or item._get(red, player, '部落战旗') > 0
if hasFlag then
campReward = campReward * 1.1
end
if campName then
camp._addMoney(red, campName, '积分', campReward)
end
f:write('\t档位:', level)
f:write('\t个人奖励:', selfReward)
f:write('\t阵营奖励:', campReward)
f:write('\t有战旗:', tostring(hasFlag))
f:write('\t所属阵营:', tostring(campName))
f:write('\n')
money._add(red, player, '声望', selfReward)
break
end
end
end
f:write('=====阵营积分=====\n')
for _, campName in ipairs {'联盟', '部落'} do
local value = camp._getMoney(red, campName, '积分')
f:write(campName, '\t', value, '\n')
end
f:close()
end
local function awardByItem(time, date)
ngx.log(ngx.INFO, '进行战旗奖励结算!')
local red = redis.get()
local f = log(('logs\\reward-item\\%04d-%02d-%02d.log'):format(
date.year,
date.month,
date.day
))
f:write('=====战旗一览=====\n')
for _, name in ipairs {'联盟战旗', '部落战旗'} do
f:write('-----', name, '-----\n')
local key = KEY.ITEM .. name
local values = util.hgetall(red, key)
for player, value in pairs(values) do
local count = tonumber(value) or 0
if count > 0 then
f:write(player, '\n')
money._add(red, player, '声望', 5)
end
end
end
f:close()
end
local function awardByCamp(time, date)
ngx.log(ngx.INFO, '进行阵营奖励结算!')
local red = redis.get()
local f = log(('logs\\reward-camp\\%04d-%02d-%02d.log'):format(
date.year,
date.month,
date.day
))
local value1 = camp._getMoney(red, '联盟', '积分')
local value2 = camp._getMoney(red, '部落', '积分')
camp._addMoney(red, '联盟', '积分', -value1)
camp._addMoney(red, '部落', '积分', -value2)
f:write('联盟积分:', value1, '\n')
f:write('部落积分:', value2, '\n')
local reward1, reward2
if value1 == value2 then
reward1 = 75
reward2 = 75
elseif value1 < value2 then
reward2 = 150
else
reward1 = 150
end
f:write('=====开始发积分=====\n')
local values = util.hgetall(red, KEY.CAMP)
for player, campName in pairs(values) do
if campName == '联盟' and reward1 then
f:write('联盟\t', player, ':\t', reward1, '\n')
money._add(red, player, '声望', reward1)
elseif campName == '部落' and reward2 then
f:write('部落\t', player, ':\t', reward2, '\n')
money._add(red, player, '声望', reward2)
end
end
f:close()
end
local function clearSpeed(time, date)
-- wday == 1 是周日
ngx.log(ngx.INFO, '清空排行榜!')
local red = redis.get()
red:del(KEY.GROUP_SCORE)
red:del(KEY.GROUP_CLASS)
red:del(KEY.GROUP_TIME)
red:del(KEY.GROUP_LEVEL)
red:del(KEY.PLAYER_SCORE)
red:del(KEY.PLAYER_CLASS)
red:del(KEY.PLAYER_TIME)
red:del(KEY.PLAYER_LEVEL)
end
local MARK
local function test(time, date)
if MARK then
return
end
MARK = true
local rds = redis.get()
--money._add(red, 'WorldEdit', '声望', 10000)
cheat.view()
end
timer.onTick(function (time, date)
test(time, date)
if date.hour == 23
and date.min == 50
and date.sec == 00 then
awardBySpeed(time, date)
end
if date.hour == 23
and date.min == 50
and date.sec == 05 then
awardByItem(time, date)
end
-- wday == 1 是周日
if date.wday == 1
and date.hour == 23
and date.min == 50
and date.sec == 10 then
awardByCamp(time, date)
end
-- wday == 1 是周日
if date.wday == 1
and date.hour == 23
and date.min == 50
and date.sec == 15 then
clearSpeed(time, date)
end
end)
|
-----------------------------------------------------------------------
-- FILE: luaotfload-letterspace.lua
-- DESCRIPTION: part of luaotfload / letterspacing
-----------------------------------------------------------------------
local ProvidesLuaModule = {
name = "luaotfload-letterspace",
version = "3.00", --TAGVERSION
date = "2019-09-13", --TAGDATE
description = "luaotfload submodule / color",
license = "GPL v2.0",
copyright = "PRAGMA ADE / ConTeXt Development Team",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL; adapted by Philipp Gesang, Ulrike Fischer, Marcel Krüger"
}
if luatexbase and luatexbase.provides_module then
luatexbase.provides_module (ProvidesLuaModule)
end
--- This code diverged quite a bit from its origin in Context. Please
--- do *not* report bugs on the Context list.
local logreport = luaotfload.log.report
local getmetatable = getmetatable
local setmetatable = setmetatable
local tonumber = tonumber
local unpack = table.unpack
local next = next
local node, fonts = node, fonts
local nodedirect = node.direct
local getfield = nodedirect.getfield
local setfield = nodedirect.setfield
local getfont = nodedirect.getfont
local getid = nodedirect.getid
local getnext = nodedirect.getnext
local setnext = nodedirect.setnext
local getprev = nodedirect.getprev
local setprev = nodedirect.setprev
local getboth = nodedirect.getboth
local setlink = nodedirect.setlink
local getdisc = nodedirect.getdisc
local setdisc = nodedirect.setdisc
local getsubtype = nodedirect.getsubtype
local setsubtype = nodedirect.setsubtype
local getchar = nodedirect.getchar
local setchar = nodedirect.setchar
local getkern = nodedirect.getkern
local setkern = nodedirect.setkern
local getglue = nodedirect.getglue
local setglue = nodedirect.setglue
local find_node_tail = nodedirect.tail
local todirect = nodedirect.todirect
local tonode = nodedirect.tonode
local insert_node_before = nodedirect.insert_before
local free_node = nodedirect.free
local copy_node = nodedirect.copy
local new_node = nodedirect.new
local glyph_code = node.id"glyph"
local kern_code = node.id"kern"
local disc_code = node.id"disc"
local glue_code = node.id"glue"
local whatsit_code = node.id"whatsit"
local fonthashes = fonts.hashes
local identifiers = fonthashes.identifiers
local chardata = fonthashes.characters
local otffeatures = fonts.constructors.newfeatures "otf"
local function getprevreal(n)
repeat
n = getprev(n)
until not n or getid(n) ~= whatsit_code
return n
end
local function getnextreal(n)
repeat
n = getnext(n)
until not n or getid(n) ~= whatsit_code
return n
end
--[[doc--
Since the letterspacing method was derived initially from Context’s
typo-krn.lua we keep the sub-namespace “letterspace” inside the
“luaotfload” table.
--doc]]--
luaotfload.letterspace = luaotfload.letterspace or { }
local letterspace = luaotfload.letterspace
local lectured = false
letterspace.keepligature = true
letterspace.keeptogether = false
letterspace.keepwordspacing = false
---=================================================================---
--- preliminary definitions
---=================================================================---
-- We set up a layer emulating some Context internals that are needed
-- for the letterspacing callback.
-----------------------------------------------------------------------
--- node-ini
-----------------------------------------------------------------------
local kerning_code = 0
local userkern_code = 1
local userskip_code = 0
local spaceskip_code = 13
local xspaceskip_code = 14
if not chardata then
chardata = { }
table.setmetatableindex(chardata, function(t, k)
if k == true then
return chardata[currentfont()]
else
local tfmdata = font.getfont(k) or font.fonts[k]
if tfmdata then
local characters = tfmdata.characters
t[k] = characters
return characters
end
end
end)
fonthashes.characters = chardata
end
---=================================================================---
--- character kerning functionality
---=================================================================---
-- UF changed 2017-07-14
local kern_injector = function (fillup, kern)
if fillup then
local g = new_node(glue_code)
setglue(g, 0, kern, 0, 1, 0)
return g
end
local g = new_node(kern_code)
setkern(g,kern)
return g
end
-- /UF
local kernable_skip = function (n)
local st = getsubtype (n)
return st == userskip_code
or st == spaceskip_code
or st == xspaceskip_code
end
--[[doc--
Caveat lector.
This is an adaptation of the Context character kerning mechanism
that emulates XeTeX-style fontwise letterspacing. Note that in its
present state it is far inferior to the original, which is
attribute-based and ignores font-boundaries. Nevertheless, due to
popular demand the following callback has been added.
--doc]]--
local kernamounts = table.setmetatableindex(function (t, f) --- fontid -> {kern, fill}
local tfmdata = font.getfont(f) or font.fonts[f]
if tfmdata then
local fontproperties = tfmdata.properties
local fontparameters = tfmdata.parameters
if fontproperties and fontparameters then
local r
if fontproperties.kerncharacters == "max" then
r = {fontparameters.quad/4, true}
elseif fontproperties.kerncharacters then
r = {fontproperties.kerncharacters * fontparameters.quad, false}
else
r = {}
end
t[f] = r
return r
end
end
return {}
end)
local kerncharacters
kerncharacters = function (head)
local start = head
local lastfont = nil
local keeptogether = letterspace.keeptogether --- function
local keepligature = letterspace.keepligature
-- if not lectured and keepligature ~= true then
-- logreport ("both", 0, "letterspace",
-- "Breaking ligatures through letterspacing is deprecated and "
-- .. "will be removed soon. Please disable unwanted ligatures through "
-- .. "font features instead and reset luaotfload.letterspace.keepligature "
-- .. "to true to maintain compatibility with future versions of luaotfload.")
-- lectured = true
-- end
if type(keepligature) ~= "function" then
local savedligature = keepligature
keepligature = function() return savedligature end
end
local keepwordspacing = letterspace.keepwordspacing
if type(keepwordspacing) ~= "function" then
local savedwordspacing = keepwordspacing
keepwordspacing = function() return savedwordspacing end
end
local kernamounts = kernamounts
local firstkern = true
while start do
local id = getid(start)
if id == glyph_code then
--- 1) look up kern factor (slow, but cached rudimentarily)
local fontid = getfont(start)
local krn, fillup = unpack(kernamounts[fontid])
if not krn or krn == 0 then
firstkern = true
goto nextnode
elseif firstkern then
firstkern = false
if (id ~= disc_code) and (not getfield(start, "components")) then
--- not a ligature, skip node
goto nextnode
end
end
lastfont = fontid
--- 2) resolve ligatures
local c = getfield(start, "components")
if c then
if keepligature(start) then
-- keep 'm
c = nil
else
while c do
local s = start
local p, n = getboth (s)
if p then
setlink (p, c)
else
head = c
end
if n then
local tail = find_node_tail(c)
setlink (tail, n)
end
start = c
setfield(s, "components", nil)
free_node(s) --> double free with multipart components
c = getfield (start, "components")
end
end
end -- kern ligature
--- 3) apply the extra kerning
local prev = getprevreal(start)
if prev then
local pid = getid(prev)
if not pid then
-- nothing
elseif pid == glue_code and kernable_skip(prev)
and not keepwordspacing(prev, lastfont) then
local wd, stretch, shrink = getglue(prev)
if wd > 0 then
local newwd = wd + krn
local stretched = (stretch * newwd) / wd
local shrunk = (shrink * newwd) / wd
if fillup then
setglue(prev, newwd, 2 * stretched, 2 * shrunk, 1, 0)
else
setglue(prev, newwd, stretched, shrunk, 0, 0)
end
end
elseif pid == kern_code then
local prev_subtype = getsubtype(prev)
if prev_subtype == kerning_code --- context does this by means of an
or prev_subtype == userkern_code --- attribute; we may need a test
then
local pprev = getprevreal(prev)
local pprev_id = getid(pprev)
if keeptogether
and pprev_id == glyph_code
and keeptogether(pprev, start)
then
-- keep
else
setsubtype (prev, userkern_code)
local prev_kern = getkern(prev)
prev_kern = prev_kern + krn
setkern (prev, prev_kern)
end
end
elseif pid == glyph_code then
if getfont(prev) == lastfont then
local prevchar = getchar(prev)
local lastchar = getchar(start)
if keeptogether and keeptogether(prev, start) then
-- keep 'm
elseif identifiers[lastfont] then
local lastfontchars = chardata[lastfont]
if lastfontchars then
local prevchardata = lastfontchars[prevchar]
if not prevchardata then
--- font doesn’t contain the glyph
else
local kern = 0
local kerns = prevchardata.kerns
if kerns then kern = kerns[lastchar] or kern end
krn = kern + krn -- here
insert_node_before(head,start,kern_injector(fillup,krn))
end
end
end
else
insert_node_before(head,start,kern_injector(fillup,krn))
end
elseif pid == disc_code then
local disc = prev -- disc
local pre, post, replace = getdisc (disc)
local prv = getprevreal(disc)
local nxt = getnextreal(disc)
if pre and prv then -- must pair with start.prev
-- this one happens in most cases
local before = copy_node(prv)
setprev(pre, before)
setnext(before, pre)
setprev(before, nil)
pre = kerncharacters (before)
pre = getnext(pre)
setprev(pre, nil)
setfield(disc, "pre", pre)
free_node(before)
end
if post and nxt then -- must pair with start
local after = copy_node(nxt)
local tail = find_node_tail(post)
setnext(tail, after)
setprev(after, tail)
post = kerncharacters (post)
setnext(getprev(after), nil)
setfield(disc, "post", post)
free_node(after)
end
if replace and prv and nxt then -- must pair with start and start.prev
local before = copy_node(prv)
local after = copy_node(nxt)
local tail = find_node_tail(replace)
setprev(replace, before)
setnext(before, replace)
setprev(before, nil)
setnext(tail, after)
setprev(after, tail)
setnext(after, nil)
replace = kerncharacters (before)
replace = getnext(replace)
setprev(replace, nil)
setnext(getprev(after), nil)
setfield(disc, "replace", replace)
free_node(after)
free_node(before)
elseif identifiers[lastfont] then
if prv
and getid(prv) == glyph_code
and getfont(prv) == lastfont
then
local kern = 0
local prevchar = getchar(prv)
local lastchar = getchar(start)
local lastfontchars = chardata[lastfont]
if lastfontchars then
local prevchardata = lastfontchars[prevchar]
if not prevchardata then
--- font doesn’t contain the glyph
else
local kerns = prevchardata.kerns
if kerns then kern = kerns[lastchar] or kern end
end
end
krn = kern + krn -- here
end
setfield(disc, "replace", kern_injector(false, krn))
end --[[if replace and prv and nxt]]
end --[[if not pid]]
end --[[if prev]]
end --[[if id == glyph_code]]
::nextnode::
if start then
start = getnext(start)
end
end
return head
end
---=================================================================---
--- integration
---=================================================================---
--- · callback: kerncharacters
--- · enabler: enablefontkerning
--- callback wrappers
--- (node_t -> node_t) -> string -> string list -> bool
local registered_as = { } --- procname -> callbacks
local add_processor = function (processor, name, ...)
local callbacks = { ... }
for i=1, #callbacks do
luatexbase.add_to_callback(callbacks[i], processor, name)
end
registered_as[name] = callbacks --- for removal
return true
end
--- string -> bool
local remove_processor = function (name)
local callbacks = registered_as[name]
if callbacks then
for i=1, #callbacks do
luatexbase.remove_from_callback(callbacks[i], name)
end
return true
end
return false --> unregistered
end
--- When font kerning is requested, usually by defining a font with the
--- ``letterspace`` parameter, we inject a wrapper for the
--- ``kerncharacters()`` node processor in the relevant callbacks. This
--- wrapper initially converts the received head node into its “direct”
--- counterpart. Likewise, the callback result is converted back to an
--- ordinary node prior to returning. Internally, ``kerncharacters()``
--- performs all node operations on direct nodes.
--- unit -> bool
local enablefontkerning = function ( )
local handler = function (hd)
local direct_hd = todirect (hd)
logreport ("term", 5, "letterspace",
"kerncharacters() invoked with node.direct interface \z
(``%s`` -> ``%s``)", tostring (hd), tostring (direct_hd))
local direct_hd = kerncharacters (direct_hd)
if not direct_hd then --- bad
logreport ("both", 0, "letterspace",
"kerncharacters() failed to return a valid new head")
end
return tonode (direct_hd)
end
return add_processor( handler
, "luaotfload.letterspace"
, "pre_linebreak_filter"
, "hpack_filter")
end
--[[doc--
Fontwise kerning is enabled via the “kernfactor” option at font
definition time. Unlike the Context implementation which relies on
Luatex attributes, it uses a font property for passing along the
letterspacing factor of a node.
The callback is activated the first time a letterspaced font is
requested and stays active until the end of the run. Since the font
is a property of individual glyphs, every glyph in the entire
document must be checked for the kern property. This is quite
inefficient compared to Context’s attribute based approach, but Xetex
compatibility reduces our options significantly.
--doc]]--
local fontkerning_enabled = false --- callback state
--- fontobj -> float -> unit
local initializefontkerning = function (tfmdata, factor)
if factor ~= "max" then
factor = tonumber (factor) or 0
end
if factor == "max" or factor ~= 0 then
local fontproperties = tfmdata.properties
if fontproperties then
--- hopefully this field stays unused otherwise
fontproperties.kerncharacters = factor
end
if not fontkerning_enabled then
fontkerning_enabled = enablefontkerning ()
end
end
end
--- like the font colorization, fontwise kerning is hooked into the
--- feature mechanism
otffeatures.register {
name = "kernfactor",
description = "kernfactor",
initializers = {
base = initializefontkerning,
node = initializefontkerning,
}
}
--[[doc--
The “letterspace” feature is essentially identical with the above
“kernfactor” method, but scales the factor to percentages to match
Xetex’s behavior. (See the Xetex reference, page 5, section 1.2.2.)
Since Xetex doesn’t appear to have a (documented) “max” keyword, we
assume all input values are numeric.
--doc]]--
local initializecompatfontkerning = function (tfmdata, percentage)
local factor = tonumber (percentage)
if not factor then
logreport ("both", 0, "letterspace",
"Invalid argument to letterspace: %s (type %q), " ..
"was expecting percentage as Lua number instead.",
percentage, type (percentage))
return
end
return initializefontkerning (tfmdata, factor * 0.01)
end
otffeatures.register {
name = "letterspace",
description = "letterspace",
initializers = {
base = initializecompatfontkerning,
node = initializecompatfontkerning,
}
}
--[[example--
See https://bitbucket.org/phg/lua-la-tex-tests/src/tip/pln-letterspace-8-compare.tex
for an example.
--example]]--
--- vim:sw=2:ts=2:expandtab:tw=71
|
setenv("Version", myModuleFullName())
|
createObject(14577,2192.51953125,-1162.0185546875,934.91632080078,0,0,0,3,10631)
createObject(1566,2247.3994140625,-1165.2373046875,931.31005859375,0,0,89.31884765625,3,10631)
createObject(2517,2236.0727539063,-1158.7027587891,927.99438476563,0,0,0,3,10631)
createObject(2517,2235.0178222656,-1158.7053222656,927.99243164063,0,0,0,3,10631)
createObject(2517,2233.9860839844,-1158.7108154297,927.99249267578,0,0,0,3,10631)
createObject(2517,2232.953125,-1158.7199707031,927.99249267578,0,0,0,3,10631)
createObject(1808,2237.1474609375,-1162.8349609375,927.99694824219,0,0,91.307373046875,3,10631)
createObject(930,2228.1838378906,-1149.4401855469,928.46673583984,0,0,0,3,10631)
createObject(939,2219.3825683594,-1138.7717285156,930.2998046875,0,0,358.81005859375,3,10631)
createObject(942,2227.78125,-1146.4129638672,930.38946533203,0,0,90.530029296875,3,10631)
createObject(2062,2226.7021484375,-1148.2890625,929.05963134766,0,0,0,3,10631)
createObject(3632,2228.5341796875,-1155.296875,928.46502685547,0,0,0,3,10631)
createObject(3632,2228.4348144531,-1154.5678710938,928.46728515625,0,0,276.62994384766,3,10631)
createObject(3576,2203.1657714844,-1153.5434570313,929.48565673828,0,0,270.37997436523,3,10631)
createObject(944,2214.978515625,-1138.3234863281,928.87567138672,0,0,0,3,10631)
createObject(14401,2227.9855957031,-1157.7957763672,928.32891845703,0,0,269.90991210938,3,10631)
createObject(3787,2217.0529785156,-1154.8992919922,928.56524658203,0,0,359.65991210938,3,10631)
createObject(14782,2233.4443359375,-1169.560546875,929.01531982422,0,0,179.89562988281,3,10631)
createObject(14782,2227.2104492188,-1169.6414794922,929.01495361328,0,0,179.89562988281,3,10631)
createObject(2270,2226.2290039063,-1169.6199951172,928.94116210938,0,0,180.0849609375,3,10631)
createObject(2611,2231.4416503906,-1177.8134765625,929.78936767578,0,0,0,3,10631)
createObject(2737,2233.9052734375,-1177.8150634766,929.62347412109,0,0,0,3,10631)
createObject(2258,2231.3395996094,-1182.8248291016,930.08020019531,0,359.75,180.09997558594,3,10631)
createObject(2256,2233.8449707031,-1182.7983398438,930.05725097656,0,0,179.86499023438,3,10631)
createObject(2267,2236.3830566406,-1182.8079833984,930.07849121094,0,0,180.09997558594,3,10631)
createObject(2269,2238.4016113281,-1182.3477783203,929.78076171875,0,0,180.05493164063,3,10631)
createObject(2266,2239.7409667969,-1182.3371582031,929.75366210938,0,0,180.28997802734,3,10631)
createObject(2263,2241.0070800781,-1182.3298339844,929.78729248047,0,0,179.3349609375,3,10631)
createObject(1713,2233.2231445313,-1182.3192138672,928.00158691406,0,0,179.87994384766,3,10631)
createObject(1713,2237.4875488281,-1182.3260498047,927.99597167969,0,0,179.87915039063,3,10631)
createObject(1713,2240.3168945313,-1182.3173828125,927.99114990234,0,0,179.87915039063,3,10631)
createObject(2725,2234.5612792969,-1182.3941650391,928.42993164063,0,0,0,3,10631)
createObject(2339,2212.2456054688,-1172.5009765625,928.00305175781,0,0,0,3,10631)
createObject(2131,2213.2287597656,-1172.5146484375,928.00225830078,0,0,0,3,10631)
createObject(2132,2215.9978027344,-1172.5341796875,928.00225830078,0,0,0,3,10631)
createObject(2340,2218.0026855469,-1172.5115966797,928.00225830078,0,0,0,3,10631)
createObject(1594,2216.7507324219,-1176.1572265625,928.47924804688,0,0,0,3,10631)
createObject(1679,2213.1840820313,-1176.0894775391,928.46508789063,0,0,0,3,10631)
createObject(3117,2201.0776367188,-1180.2855224609,929.11730957031,0,89.840026855469,0,3,10631)
createObject(3055,2201.34375,-1146.50390625,929.22467041016,0,0,269.68688964844,3,10631)
createObject(14532,2204.5329589844,-1171.5128173828,928.97747802734,0,0,179.84997558594,3,10631)
createObject(2149,2212.2080078125,-1172.4464111328,929.20770263672,0,0,0,3,10631)
createObject(2849,2213.1286621094,-1176.0687255859,928.86145019531,0,0,0,3,10631)
createObject(2855,2234.5480957031,-1182.3842773438,928.86584472656,0,0,350.07501220703,3,10631)
createObject(2630,2227.6376953125,-1177.7808837891,928.00225830078,0,0,91.310028076172,3,10631)
createObject(2628,2227.458984375,-1175.7857666016,928.00128173828,0,0,268.68994140625,3,10631)
createObject(2627,2227.4375,-1174.0393066406,927.99890136719,0,0,270.67504882813,3,10631)
createObject(2631,2225.8041992188,-1172.0875244141,928.04565429688,0,0,0,3,10631)
createObject(2737,2202.8054199219,-1170.896484375,929.17047119141,0,0,0,3,10631)
createObject(1722,2202.6030273438,-1174.6307373047,927.99822998047,0,0,0,3,10631)
createObject(1722,2203.3486328125,-1174.626953125,927.99877929688,0,0,0,3,10631)
createObject(1722,2204.0610351563,-1174.6635742188,927.99938964844,0,0,0,3,10631)
createObject(1722,2202.5998535156,-1175.7777099609,928.0009765625,0,0,0,3,10631)
createObject(1722,2203.3525390625,-1175.7481689453,928.00073242188,0,0,0,3,10631)
createObject(1722,2204.0563964844,-1175.7751464844,928.00128173828,0,0,0,3,10631)
createObject(1722,2202.5910644531,-1176.9566650391,928.00225830078,0,0,0,3,10631)
createObject(1722,2203.3491210938,-1176.9378662109,928.00268554688,0,0,0,3,10631)
createObject(1722,2204.0646972656,-1176.9404296875,928.00317382813,0,0,0,3,10631)
createObject(1722,2202.6325683594,-1178.0172119141,928.00421142578,0,0,0,3,10631)
createObject(1722,2203.3615722656,-1177.9984130859,928.00451660156,0,0,0,3,10631)
createObject(1722,2204.0363769531,-1177.9982910156,928.00506591797,0,0,0,3,10631)
createObject(3117,2205.779296875,-1171.8881835938,929.73754882813,0,89.835205078125,0,3,10631)
createObject(3117,2205.77734375,-1173.9997558594,929.74047851563,0,89.835205078125,0,3,10631)
createObject(3117,2205.7778320313,-1176.0192871094,929.74505615234,0,89.835205078125,0,3,10631)
createObject(3117,2205.7800292969,-1178.1401367188,929.74243164063,0,89.835205078125,0,3,10631)
createObject(2297,2228.2888183594,-1188.4395751953,927.99609375,0,0,175.39495849609,3,10631)
createObject(1724,2227.091796875,-1183.3375244141,927.99597167969,0,0,1.9849853515625,3,10631)
createObject(1723,2224.4699707031,-1184.2768554688,928.00183105469,0,0,19.850006103516,3,10631)
createObject(14455,2201.2897949219,-1179.939453125,929.67401123047,0,0,269.46997070313,3,10631)
createObject(1723,2201.7810058594,-1188.2711181641,927.99591064453,0,0,89.806823730469,3,10631)
createObject(2614,1207.8416748047,-1439.1112060547,16.96671295166,0,0,270.11499023438)
createObject(3055,1220.1082763672,-1469.9572753906,14.744995117188,0,0,0)
createObject(1233,1215.3928222656,-1470.0518798828,13.947212219238,0,0,0.920654296875)
createObject(2921,1230.9881591797,-1482.2369384766,17.588455200195,0,0,0)
createObject(2886,1224.6823730469,-1470.0104980469,13.996932983398,0,0,0)
createObject(2959,1220.8509521484,-1422.4564208984,43.50154876709,0,0,90.0400390625)
createObject(982,1233.3458251953,-1463.5327148438,44.910118103027,0,0,0)
createObject(982,1233.3358154297,-1437.9517822266,44.905944824219,0,0,0)
createObject(982,1206.4752197266,-1463.5172119141,44.910118103027,0,0,0)
createObject(982,1206.4819335938,-1437.8939208984,44.910606384277,0,0,0)
createObject(983,1233.3302001953,-1425.181640625,44.910118103027,0,0,0)
createObject(983,1206.4812011719,-1425.1352539063,44.910118103027,0,0,0)
createObject(3934,1219.8524169922,-1463.4140625,43.720317840576,0,0,0)
createObject(3934,1219.8250732422,-1443.8698730469,43.720317840576,0,0,0) |
-- Copyright (C) 2018 by chrono
local function action_get()
ngx.req.discard_body()
local t = ngx.time()
ngx.say(ngx.http_time(t))
end
local function action_post()
ngx.req.read_body()
local data = ngx.req.get_body_data()
local num = tonumber(data)
if not num then
ngx.log(ngx.ERR, "no body data found")
ngx.exit(400)
end
ngx.say(ngx.http_time(num))
end
local actions = {
GET = action_get,
POST = action_post
}
local method = ngx.req.get_method()
-- run
actions[method]()
|
-- from https://en.wikipedia.org/wiki/Moore%E2%80%93Penrose_pseudoinverse
local function pseudoInverse(A)
local AT = A:transpose()
local APlus
if #A > #A[1] then
local ATA = (AT * A)():inverse()
APlus = (ATA * AT)()
else
local AAT = (A * AT)():inverse()
APlus = (AT * AAT)()
end
local APlusA = (APlus * A)()
local determinable = APlusA == require 'symmath.matrix.identity'(#APlusA)
return APlus, determinable
end
return pseudoInverse
|
local options = {
number = true, -- Show line numbers
relativenumber = true, -- Show relative numbers
swapfile = false, -- Don't use swapfile
backup = false, -- Don't create backup files
writebackup = false, -- Don't write backup
autowrite = true, -- Automatically save before :next, :make etc.
showmatch = true, -- Show matching brackets
scrolloff = 8, -- Keep lines above and below cursor
updatetime = 750, -- Improve UX with more reactive updates
wrap = false, -- Display long lines as one line
signcolumn = 'yes', -- Display an additional column (useful for linting)
wildmode = {'longest:full','full'}, -- A better menu in command mode
clipboard= {'unnamed','unnamedplus'}, -- Use the OS clipboard
tabstop = 2, -- Insert 2 spaces for a tab
softtabstop = 2, -- Insert 2 spaces for soft tab
expandtab = true, -- Use spaces instead of tabs when indenting
ignorecase = true, -- Search case insensitive...
smartcase = true, -- ... but not when search pattern contains upper case characters
undofile = true -- Enable persistent undo
}
for k, v in pairs(options) do
vim.opt[k] = v
end
|
bindingId=5,
laser={
damage=0,
power=0,
range=2767,
width=0,
color=0x007f7f7f,
},
shroud={
{size={8.66, 5}, offset={14.434, 0, 1e-16}, taper=0, count=1, tri_color1_id=1, line_color_id=2},
{size={8.66, 5}, offset={-11.546, 15, 1e-16}, taper=0, count=1, tri_color1_id=1, line_color_id=2},
{size={8.66, 5}, offset={-11.546, -15, 1e-16}, taper=0, count=1, tri_color1_id=1, line_color_id=2},
{size={8.66, 0.0001}, offset={-23.094, 0, 1e-16}, taper=50000, count=1, tri_color1_id=1, line_color_id=2},
{size={8.66, 0.0001}, offset={2.886, 15, 1e-16}, taper=50000, count=1, tri_color1_id=1, line_color_id=2},
{size={8.66, 0.0001}, offset={2.886, -15, 1e-16}, taper=50000, count=1, tri_color1_id=1, line_color_id=2},
},
turretSpeed=0,
turretLimit=0,
|
Locales['en'] = {
--=====General=====--
['ticket-machine'] = 'Ticket Machine',
['buy-ticket'] = 'Buy a ticket',
['are-you-sure-you-want-to-buy-a-ticket'] = 'Are you sure that you want to buy a ticket?',
['yes'] = 'Yes',
['no'] = 'No',
['ticket-bought'] = 'You succesfuly bought a ticket! Safe journeys!',
['ticket-purchase-failed'] = 'Ticket purchase failed',
['ticket-purchase-cancelled'] = 'Ticket purchase cancelled',
['no-money-for-ticket'] = 'Not enough money for a ticket',
['press-e'] = 'Press [E]',
['to-enter-the-train'] = 'to enter the train',
['to-travel-without-a-ticket'] = 'to travel without a ticket',
['need-a-train-ticket-to-travel'] = 'You need a train ticket to travel...',
['choose-station'] = 'Choose Station',
['are-you-sure-you-want-to-travel-without-a-ticket'] = 'Are you sure that you want to travel without a ticket?',
['ticket-fine-label'] = 'Metro: Fine for travelling without a ticket.',
['you-got-caught-by-a-ticket-inspector'] = 'You were caught by the ticket inspector',
['you-didnt-get-caught-by-a-ticket-inspector'] = "You didn't get caught by the ticket inspector",
['you-received-a-fine'] = 'you received a fine',
['sit-on-bench'] = 'sit on a bench',
['next-train-in'] = 'Next train in',
['waiting-for-train'] = 'Waiting for train to arrive...',
--======Blips=====--
['metrostation'] = 'Metrostation',
--======Stations=====--
['burton-station-label'] = 'Burton Station',
['burton-station-code'] = 'Burton',
['davis-station-label'] = 'Davis Station',
['davis-station-code'] = 'Davis',
['delperro-station-label'] = 'Del Perro Station',
['delperro-station-code'] = 'Del Perro',
['littleseoul-station-label'] = 'Little Seoul Station',
['littleseoul-station-code'] = 'Little Seoul',
['lsiaparking-station-label'] = 'Airport Parking Station',
['lsiaparking-station-code'] = 'Airport Parking',
['lsia-station-label'] = 'Airport Station',
['lsia-station-code'] = 'Airport',
['pillboxsouth-station-label'] = 'Pillbox South Station',
['pillboxsouth-station-code'] = 'Pillbox South',
['portoladrive-station-label'] = 'Portola Drive Station',
['portoladrive-station-code'] = 'Portola Drive',
['puertodelsol-station-label'] = 'Puerto Del Sol Sattion',
['puertodelsol-station-code'] = 'Puerto Del Sol',
['strawberry-station-label'] = 'Strawberry Station',
['strawberry-station-code'] = 'Strawberry',
} |
local level
local buffer
local visited
local putValue
local escape_char = {
[ "\\" .. string.byte "\a" ] = "\\".."a",
[ "\\" .. string.byte "\b" ] = "\\".."b",
[ "\\" .. string.byte "\f" ] = "\\".."f",
[ "\\" .. string.byte "\n" ] = "\\".."n",
[ "\\" .. string.byte "\r" ] = "\\".."r",
[ "\\" .. string.byte "\t" ] = "\\".."t",
[ "\\" .. string.byte "\v" ] = "\\".."v",
[ "\\" .. string.byte "\\" ] = "\\".."\\",
[ "\\" .. string.byte "\"" ] = "\\".."\"",
}
local function quoted(s)
return ("%q"):format(s):sub(2,-2):gsub("\\[1-9][0-9]?", escape_char):gsub("\\\n", "\\n")
end
local function isIdentifier(str)
return type(str) == 'string' and str:match "^[_%a][_%a%d]*$"
end
local typeOrders = {
['number'] = 1, ['boolean'] = 2, ['string'] = 3, ['table'] = 4,
['function'] = 5, ['userdata'] = 6, ['thread'] = 7, ['nil'] = 8,
}
local function sortKeys(a, b)
local ta, tb = type(a), type(b)
if ta == tb then
if ta == 'string' or ta == 'number' then
return a < b
end
return false
end
return typeOrders[ta] < typeOrders[tb]
end
local function getLength(t)
local length = 1
while rawget(t, length) ~= nil do
length = length + 1
end
return length - 1
end
local function puts(v)
buffer[#buffer+1] = v
end
local function down(f)
level = level + 1
f()
level = level - 1
end
local function tabify()
puts '\n'
puts(string.rep(' ', level))
end
local function alreadyVisited(t)
local v = visited[t]
if not v then
visited[t] = true
end
return v
end
local function putKey(k)
if isIdentifier(k) then return puts(k) end
puts "["
putValue(k)
puts "]"
end
local function putTable(t)
if alreadyVisited(t) then
puts '<table>'
return
end
local keys = {}
local length = getLength(t)
for k in next, t do
if math.type(k) ~= 'integer' or k < 1 or k > length then
keys[#keys+1] = k
end
end
table.sort(keys, sortKeys)
local mt = getmetatable(t)
puts '{'
down(function()
local first = true
for i = 1, length do
if not first then puts ',' end
puts ' '
putValue(rawget(t, i))
first = false
end
for _, k in ipairs(keys) do
if not first then puts ',' end
tabify()
putKey(k)
puts ' = '
putValue(rawget(t, k))
first = false
end
if type(mt) == 'table' then
if not first then puts ',' end
tabify()
puts '<metatable> = '
putValue(mt)
end
end)
if #keys > 0 or type(mt) == 'table' then
tabify()
elseif length > 0 then
puts ' '
end
puts '}'
end
local function putTostring(v)
puts '<'
puts(tostring(v))
puts '>'
end
local function putUserdata(u)
local mt = debug.getmetatable(u)
if mt and mt.__tostring then
puts '<userdata:'
puts(tostring(u))
puts '>'
else
putTostring(u)
end
end
local function putThread(t)
putTostring(t)
end
local function putFunction(f)
local info = debug.getinfo(f, "S")
local type = info.source:sub(1,1)
if type == "@" then
puts '<function:'
puts(info.source:sub(2))
puts '>'
elseif type == "=" then
putTostring(f)
else
puts '<function:'
if #info.source > 64 then
puts(info.source:sub(1,64))
puts '...'
else
puts(info.source)
end
puts '>'
end
end
function putValue(v)
local tv = type(v)
if tv == 'string' then
puts(quoted(v))
elseif tv == 'number' or tv == 'boolean' or tv == 'nil' then
puts(tostring(v))
elseif tv == 'table' then
putTable(v)
elseif tv == 'userdata' then
putUserdata(v)
elseif tv == 'function' then
putFunction(v)
else
assert(tv == 'thread')
putThread(v)
end
end
return function (root)
level = 0
buffer = {}
visited = {}
putValue(root)
return table.concat(buffer)
end
|
local extras = require "nvim-lsp-installer.extras.utils"
local M = {}
function M.rename_file(old, new)
local old_uri = vim.uri_from_fname(old)
local new_uri = vim.uri_from_fname(new)
extras.send_client_request("tsserver", "workspace/executeCommand", {
command = "_typescript.applyRenameFile",
arguments = {
{
sourceUri = old_uri,
targetUri = new_uri,
},
},
})
end
function M.organize_imports(bufname)
bufname = bufname or vim.api.nvim_buf_get_name(0)
extras.send_client_request("tsserver", "workspace/executeCommand", {
command = "_typescript.organizeImports",
arguments = { bufname },
})
end
return M
|
vim.o.tabstop = 2
vim.o.shiftwidth = 2
vim.o.expandtab = true
vim.o.tw = 80
vim.o.wrap = true
|
-- Generated By protoc-gen-lua Do not Edit
local protobuf = require "protobuf"
module('BceGhostMoveStop_pb', package.seeall)
local BCEGHOSTMOVESTOP = protobuf.Descriptor();
local BCEGHOSTMOVESTOP_X_FIELD = protobuf.FieldDescriptor();
local BCEGHOSTMOVESTOP_Y_FIELD = protobuf.FieldDescriptor();
BCEGHOSTMOVESTOP_X_FIELD.name = "x"
BCEGHOSTMOVESTOP_X_FIELD.full_name = ".com.xinqihd.sns.gameserver.proto.BceGhostMoveStop.x"
BCEGHOSTMOVESTOP_X_FIELD.number = 1
BCEGHOSTMOVESTOP_X_FIELD.index = 0
BCEGHOSTMOVESTOP_X_FIELD.label = 2
BCEGHOSTMOVESTOP_X_FIELD.has_default_value = false
BCEGHOSTMOVESTOP_X_FIELD.default_value = 0
BCEGHOSTMOVESTOP_X_FIELD.type = 5
BCEGHOSTMOVESTOP_X_FIELD.cpp_type = 1
BCEGHOSTMOVESTOP_Y_FIELD.name = "y"
BCEGHOSTMOVESTOP_Y_FIELD.full_name = ".com.xinqihd.sns.gameserver.proto.BceGhostMoveStop.y"
BCEGHOSTMOVESTOP_Y_FIELD.number = 2
BCEGHOSTMOVESTOP_Y_FIELD.index = 1
BCEGHOSTMOVESTOP_Y_FIELD.label = 2
BCEGHOSTMOVESTOP_Y_FIELD.has_default_value = false
BCEGHOSTMOVESTOP_Y_FIELD.default_value = 0
BCEGHOSTMOVESTOP_Y_FIELD.type = 5
BCEGHOSTMOVESTOP_Y_FIELD.cpp_type = 1
BCEGHOSTMOVESTOP.name = "BceGhostMoveStop"
BCEGHOSTMOVESTOP.full_name = ".com.xinqihd.sns.gameserver.proto.BceGhostMoveStop"
BCEGHOSTMOVESTOP.nested_types = {}
BCEGHOSTMOVESTOP.enum_types = {}
BCEGHOSTMOVESTOP.fields = {BCEGHOSTMOVESTOP_X_FIELD, BCEGHOSTMOVESTOP_Y_FIELD}
BCEGHOSTMOVESTOP.is_extendable = false
BCEGHOSTMOVESTOP.extensions = {}
BceGhostMoveStop = protobuf.Message(BCEGHOSTMOVESTOP)
_G.BCEGHOSTMOVESTOP_PB_BCEGHOSTMOVESTOP = BCEGHOSTMOVESTOP
|
--[[
Outer product between two vectors with batch processing support
--]]
local OuterProd, parent = torch.class('nn.OuterProd', 'nn.Module')
function OuterProd:__init()
parent.__init(self)
self.gradInput = {torch.Tensor(), torch.Tensor()}
end
function OuterProd:updateOutput(input)
assert(#input==2, 'only supports outer products of 2 vectors')
local a, b = table.unpack(input)
assert(a:nDimension() == 1 or a:nDimension() == 2, 'input tensors must be 1D or 2D')
if a:nDimension()==1 then
self.output:resize(a:size(1), b:size(1))
self.output:ger(a, b)
else -- mini batch processing
self.output:resize(a:size(1), a:size(2), b:size(2))
for i = 1, a:size(1) do
self.output[i]:ger(a[i], b[i])
end
end
return self.output
end
function OuterProd:updateGradInput(input, gradOutput)
local a, b = table.unpack(input)
self.gradInput[1]:resizeAs(a)
self.gradInput[2]:resizeAs(b)
if a:nDimension()==1 then
self.gradInput[1]:mv(gradOutput, b)
self.gradInput[2]:mv(gradOutput:t(), a)
else -- mini batch processing
for i = 1, gradOutput:size(1) do
self.gradInput[1][i]:mv(gradOutput[i], b[i])
self.gradInput[2][i]:mv(gradOutput[i]:t(), a[i])
end
end
return self.gradInput
end |
dofile("patterns.lua");
dofile("HTTPserver.lua");
setlights("All"); |
local openssl = premake.extensions.openssl
local opensslimpl = openssl.impl
--
-- Copy the public openssl headers to the specified location
-- creates the directory $target_dir/openssl and populates
-- it
--
openssl.copy_public_headers = function(cfg)
opensslimpl.verify_cfg(cfg)
-- create the target directory
local final_target = path.join(cfg.include_dir, "openssl") .. "/"
os.mkdir(final_target)
local libraries = opensslimpl.generate_libraries(cfg.src_dir)
local name, desc
for name, desc in pairs(libraries) do
if not opensslimpl.library_excluded(cfg, name, "crypto/") then
if desc.public_headers then
local header
for _, header in ipairs(desc.public_headers) do
os.copyfile(cfg.src_dir .. name .. "/" .. header, final_target .. header)
end
end
end
end
end
--
-- Generate the commands needed for the crypto
-- project
--
openssl.crypto_project = function(cfg)
opensslimpl.verify_cfg(cfg)
includedirs {
cfg.include_dir,
}
opensslimpl.set_defaults()
opensslimpl.generate_defines(cfg)
local libraries = opensslimpl.generate_libraries(cfg.src_dir)
local libname, desc, filename
for libname, desc in pairs(libraries) do
if not opensslimpl.library_excluded(cfg, libname, "crypto/") then
if string.sub(libname, 0, 6) == "crypto" or libname == "" then
for _, filename in ipairs(desc.source) do
files {
cfg.src_dir .. libname .. "/" .. filename
}
end
for _, filename in ipairs(desc.private_headers) do
includedirs {
path.getdirectory(cfg.src_dir .. libname .. "/" .. filename)
}
end
end
end
end
end
--
-- Generate the commands needed for the ssl project
--
openssl.ssl_project = function(cfg)
opensslimpl.verify_cfg(cfg)
includedirs {
cfg.include_dir,
}
opensslimpl.set_defaults()
opensslimpl.generate_defines(cfg)
local libraries = openssl.impl.generate_libraries(cfg.src_dir)
local libname, desc, filename
for libname, desc in pairs(libraries) do
if libname == "ssl" or libname == "crypto" or libname == "" then
if libname == "ssl" then
for _, filename in ipairs(desc.source) do
files {
cfg.src_dir .. libname .. "/" .. filename
}
end
end
for _, filename in ipairs(desc.private_headers) do
includedirs {
path.getdirectory(cfg.src_dir .. libname .. "/" .. filename)
}
end
end
end
end
|
--[[
Jamba - Jafula's Awesome Multi-Boxer Assistant
Copyright 2008 - 2018 Michael "Jafula" Miller
License: The MIT License
]]--
-- Create the addon using AceAddon-3.0 and embed some libraries.
local AJM = LibStub( "AceAddon-3.0" ):NewAddon(
"JambaQuestWatcher",
"JambaModule-1.0",
"AceConsole-3.0",
"AceEvent-3.0",
"AceHook-3.0",
"AceTimer-3.0"
)
-- Load libraries.
local JambaUtilities = LibStub:GetLibrary( "JambaUtilities-1.0" )
local JambaHelperSettings = LibStub:GetLibrary( "JambaHelperSettings-1.0" )
AJM.SharedMedia = LibStub( "LibSharedMedia-3.0" )
-- Constants and Locale for this module.
AJM.moduleName = "Jamba-QuestWatcher"
AJM.settingsDatabaseName = "JambaQuestWatcherProfileDB"
AJM.chatCommand = "jamba-quest-watcher"
local L = LibStub( "AceLocale-3.0" ):GetLocale( AJM.moduleName )
AJM.parentDisplayName = L["Quest"]
AJM.moduleDisplayName = L["Quest: Tracker"]
-- Settings - the values to store and their defaults for the settings database.
AJM.settings = {
profile = {
enableQuestWatcher = true,
watcherFramePoint = "RIGHT",
watcherFrameRelativePoint = "RIGHT",
watcherFrameXOffset = 0,
watcherFrameYOffset = 150,
watcherFrameAlpha = 1.0,
watcherFrameScale = 1.0,
borderStyle = L["Blizzard Tooltip"],
backgroundStyle = L["Blizzard Dialog Background"],
watchFontStyle = L["Arial Narrow"],
watchFontSize = 14,
hideQuestWatcherInCombat = false,
enableQuestWatcherOnMasterOnly = false,
watchFrameBackgroundColourR = 0.0,
watchFrameBackgroundColourG = 0.0,
watchFrameBackgroundColourB = 0.0,
watchFrameBackgroundColourA = 0.0,
watchFrameBorderColourR = 0.0,
watchFrameBorderColourG = 0.0,
watchFrameBorderColourB = 0.0,
watchFrameBorderColourA = 0.0,
watcherListLines = 20,
watcherFrameWidth = 340,
unlockWatcherFrame = true,
hideBlizzardWatchFrame = true,
doNotHideCompletedObjectives = true,
showCompletedObjectivesAsDone = true,
hideQuestIfAllComplete = false,
showFrame = true,
messageArea = JambaApi.DefaultMessageArea(),
sendProgressChatMessages = false,
},
}
-- Configuration.
function AJM:GetConfiguration()
local configuration = {
name = AJM.moduleDisplayName,
handler = AJM,
type = "group",
get = "JambaConfigurationGetSetting",
set = "JambaConfigurationSetSetting",
args = {
show = {
type = "input",
name = L["Show Quest Watcher"],
desc = L["Show the quest watcher window."],
usage = "/jamba-quest-watcher show",
get = false,
set = "ShowFrameCommand",
},
hide = {
type = "input",
name = L["Hide Quest Watcher"],
desc = L["Hide the quest watcher window."],
usage = "/jamba-quest-watcher hide",
get = false,
set = "HideFrameCommand",
},
push = {
type = "input",
name = L["Push Settings"],
desc = L["Push the quest settings to all characters in the team."],
usage = "/jamba-quest-watcher push",
get = false,
set = "JambaSendSettings",
},
},
}
return configuration
end
-------------------------------------------------------------------------------------------------------------
-- Command this module sends.
-------------------------------------------------------------------------------------------------------------
AJM.COMMAND_QUEST_WATCH_OBJECTIVE_UPDATE = "JQWObjUpd"
AJM.COMMAND_UPDATE_QUEST_WATCHER_LIST = "JQWLstUpd"
AJM.COMMAND_QUEST_WATCH_REMOVE_QUEST = "JQWRmveQst"
AJM.COMMAND_AUTO_QUEST_COMPLETE = "JQWAtQstCmplt"
AJM.COMMAND_REMOVE_AUTO_QUEST_COMPLETE = "JQWRmvAtQstCmplt"
AJM.COMMAND_AUTO_QUEST_OFFER = "JQWAqQstOfr"
-------------------------------------------------------------------------------------------------------------
-- Messages module sends.
-------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------
-- Addon initialization, enabling and disabling.
-------------------------------------------------------------------------------------------------------------
function AJM:DebugMessage( ... )
--AJM:Print( ... )
end
-- Initialise the module.
function AJM:OnInitialize()
AJM.currentAutoQuestPopups = {}
AJM.countAutoQuestPopUpFrames = 0
AJM.questWatcherFrameCreated = false
-- Create the settings control.
AJM:SettingsCreate()
-- Initialise the JambaModule part of this module.
AJM:JambaModuleInitialize( AJM.settingsControlWatcher.widgetSettings.frame )
-- Populate the settings.
AJM:SettingsRefresh()
-- Create the quest watcher frame.
AJM:CreateQuestWatcherFrame()
AJM:SetQuestWatcherVisibility()
-- Quest watcher.
AJM.questWatchListOfQuests = {}
AJM.questWatchCache = {}
AJM.questWatchObjectivesList = {}
end
-- Called when the addon is enabled.
function AJM:OnEnable()
-- Register for the Jamba master changed message.
AJM:RegisterMessage( JambaApi.MESSAGE_TEAM_MASTER_CHANGED, "OnMasterChanged" )
AJM:RegisterMessage( JambaApi.MESSAGE_MESSAGE_AREAS_CHANGED, "OnMessageAreasChanged" )
-- Quest events.
-- Watcher events.
AJM:RegisterEvent( "PLAYER_REGEN_ENABLED" )
AJM:RegisterEvent( "PLAYER_REGEN_DISABLED" )
AJM:RegisterEvent( "QUEST_WATCH_UPDATE" )
AJM:RegisterEvent( "QUEST_LOG_UPDATE")
AJM:RegisterEvent( "QUEST_WATCH_LIST_CHANGED", "QUEST_WATCH_UPDATE" )
-- For in the field auto quests. And Bonus Quests.
AJM:RegisterEvent("QUEST_ACCEPTED", "QUEST_WATCH_UPDATE")
AJM:RegisterEvent("QUEST_REMOVED", "RemoveQuestsNotBeingWatched")
--AJM:RegisterEvent("UNIT_QUEST_LOG_CHANGED", "JambaQuestWatchListUpdateButtonClicked")
AJM:RegisterEvent( "QUEST_AUTOCOMPLETE" )
AJM:RegisterEvent( "QUEST_COMPLETE" )
AJM:RegisterEvent( "QUEST_DETAIL" )
AJM:RegisterEvent( "SCENARIO_UPDATE" )
AJM:RegisterEvent( "SCENARIO_CRITERIA_UPDATE" )
--AJM:RegisterEvent( "SUPER_TRACKED_QUEST_CHANGED", "QUEST_WATCH_UPDATE" )
AJM:RegisterEvent( "PLAYER_ENTERING_WORLD" )
-- Quest post hooks.
AJM:SecureHook( "SelectActiveQuest" )
AJM:SecureHook( "GetQuestReward" )
AJM:SecureHook( "AddQuestWatch" )
AJM:SecureHook( "RemoveQuestWatch" )
AJM:SecureHook( "AbandonQuest" )
AJM:SecureHook( "SetAbandonQuest" )
-- Update the quest watcher for watched quests.
AJM:ScheduleTimer( "JambaQuestWatcherUpdate", 1, false )
AJM:ScheduleTimer( "JambaQuestWatcherScenarioUpdate", 1, false )
AJM:UpdateUnlockWatcherFrame()
-- To Hide After elv changes. --ebony
AJM:ScheduleTimer( "UpdateHideBlizzardWatchFrame", 2 )
-- Remvoed me somtime 7.0.4
--AJM:UpdateHideBlizzardWatchFrame()
if AJM.db.enableQuestWatcher == true then
AJM:QuestWatcherQuestListScrollRefresh()
end
end
-- Called when the addon is disabled.
function AJM:OnDisable()
-- AceHook-3.0 will tidy up the hooks for us.
end
-------------------------------------------------------------------------------------------------------------
-- Messages.
-------------------------------------------------------------------------------------------------------------
function AJM:OnMasterChanged( message, characterName )
if AJM.db.enableQuestWatcher == false then
return
end
AJM:SetQuestWatcherVisibility()
end
-------------------------------------------------------------------------------------------------------------
-- Settings Dialogs.
-------------------------------------------------------------------------------------------------------------
function AJM:SettingsCreate()
AJM.settingsControlWatcher = {}
-- Create the settings panels.
JambaHelperSettings:CreateSettings(
AJM.settingsControlWatcher,
AJM.moduleDisplayName,
AJM.parentDisplayName,
AJM.SettingsPushSettingsClick
)
-- Create the quest controls.
local bottomOfQuestWatcherOptions = AJM:SettingsCreateQuestWatcherControl( JambaHelperSettings:TopOfSettings() )
AJM.settingsControlWatcher.widgetSettings.content:SetHeight( -bottomOfQuestWatcherOptions )
-- Help
local helpTable = {}
JambaHelperSettings:CreateHelp( AJM.settingsControlWatcher, helpTable, AJM:GetConfiguration() )
end
function AJM:SettingsCreateQuestWatcherControl( top )
-- Get positions and dimensions.
local checkBoxHeight = JambaHelperSettings:GetCheckBoxHeight()
local radioBoxHeight = JambaHelperSettings:GetRadioBoxHeight()
local mediaHeight = JambaHelperSettings:GetMediaHeight()
local labelHeight = JambaHelperSettings:GetLabelHeight()
local sliderHeight = JambaHelperSettings:GetSliderHeight()
local dropdownHeight = JambaHelperSettings:GetDropdownHeight()
local labelContinueHeight = JambaHelperSettings:GetContinueLabelHeight()
local left = JambaHelperSettings:LeftOfSettings()
local headingHeight = JambaHelperSettings:HeadingHeight()
local headingWidth = JambaHelperSettings:HeadingWidth( true )
local horizontalSpacing = JambaHelperSettings:GetHorizontalSpacing()
local verticalSpacing = JambaHelperSettings:GetVerticalSpacing()
local halfWidthSlider = (headingWidth - horizontalSpacing) / 2
local indent = horizontalSpacing * 10
local indentContinueLabel = horizontalSpacing * 18
local indentSpecial = indentContinueLabel + 9
local checkBoxThirdWidth = (headingWidth - indentContinueLabel) / 3
local column1Left = left
local column2Left = left + halfWidthSlider
local column1LeftIndent = left + indentContinueLabel
local column2LeftIndent = column1LeftIndent + checkBoxThirdWidth + horizontalSpacing
local column3LeftIndent = column2LeftIndent + checkBoxThirdWidth + horizontalSpacing
local movingTop = top
-- Create a heading for quest completion.
JambaHelperSettings:CreateHeading( AJM.settingsControlWatcher, L["Quest Watcher"], movingTop, true )
movingTop = movingTop - headingHeight
-- Check box: Enable auto quest completion.
AJM.settingsControlWatcher.checkBoxEnableQuestWatcher = JambaHelperSettings:CreateCheckBox(
AJM.settingsControlWatcher,
headingWidth,
column1Left,
movingTop,
L["Enable JoT"],
AJM.SettingsToggleEnableQuestWatcher,
L["Enables Jamba Objective Tracker"]
)
-- movingTop = movingTop - checkBoxHeight
-- AJM.settingsControlWatcher.checkBoxShowFrame = JambaHelperSettings:CreateCheckBox(
-- AJM.settingsControlWatcher,
-- headingWidth,
-- left,
-- movingTop,
-- L["Show Quest Watcher"],
-- AJM.SettingsToggleShowFrame,
-- L["Show Quest Watcher"]
-- )
movingTop = movingTop - checkBoxHeight
AJM.settingsControlWatcher.checkBoxUnlockWatcherFrame = JambaHelperSettings:CreateCheckBox(
AJM.settingsControlWatcher,
headingWidth,
left,
movingTop,
L["Unlock JoT"],
AJM.SettingsToggleUnlockWatcherFrame,
L["Unlocks Jamba Objective Tracker\n Hold Alt key To Move It\n Lock to Click Through"]
)
movingTop = movingTop - checkBoxHeight
AJM.settingsControlWatcher.checkBoxHideBlizzardWatchFrame = JambaHelperSettings:CreateCheckBox(
AJM.settingsControlWatcher,
headingWidth,
left,
movingTop,
L["Hide Blizzard's Objectives Tracker"],
AJM.SettingsToggleHideBlizzardWatchFrame,
L["Hides Defualt Objective Tracker"]
)
movingTop = movingTop - checkBoxHeight
AJM.settingsControlWatcher.checkBoxEnableQuestWatcherMasterOnly = JambaHelperSettings:CreateCheckBox(
AJM.settingsControlWatcher,
headingWidth,
column1Left,
movingTop,
L["Show JoT On Master Only"],
AJM.SettingsToggleEnableQuestWatcherMasterOnly,
L["Olny show Jamba Objective Tracker On Master Character Olny"]
)
movingTop = movingTop - checkBoxHeight
AJM.settingsControlWatcher.displayOptionsCheckBoxHideQuestWatcherInCombat = JambaHelperSettings:CreateCheckBox(
AJM.settingsControlWatcher,
headingWidth,
column1Left,
movingTop,
L["Hide JoT In Combat"],
AJM.SettingsToggleHideQuestWatcherInCombat,
L["Hide Jamba Objective Tracker in Combat"]
)
movingTop = movingTop - checkBoxHeight
AJM.settingsControlWatcher.checkBoxShowCompletedObjectivesAsDone = JambaHelperSettings:CreateCheckBox(
AJM.settingsControlWatcher,
headingWidth,
left,
movingTop,
L["Show Completed objective As 'DONE'"],
AJM.SettingsShowCompletedObjectivesAsDone,
L["Show Completed Objectives/Quests As 'DONE'"]
)
movingTop = movingTop - checkBoxHeight
AJM.settingsControlWatcher.checkBoxHideQuestIfAllComplete = JambaHelperSettings:CreateCheckBox(
AJM.settingsControlWatcher,
headingWidth,
left,
movingTop,
L["Hide objectives Completed By Team"],
AJM.SettingsHideQuestIfAllComplete,
L["Hide Objectives/Quests Completed By Team"]
)
movingTop = movingTop - checkBoxHeight
AJM.settingsControlWatcher.checkBoxShowDoNotHideCompletedObjectives = JambaHelperSettings:CreateCheckBox(
AJM.settingsControlWatcher,
headingWidth,
left,
movingTop,
L["Do Not Hide An Individuals Completed Objectives"],
AJM.SettingsDoNotHideCompletedObjectives,
L["Do Not Hide An Individuals Completed Objectives"]
)
movingTop = movingTop - checkBoxHeight
AJM.settingsControlWatcher.checkBoxSendProgressChatMessages = JambaHelperSettings:CreateCheckBox(
AJM.settingsControlWatcher,
headingWidth,
left,
movingTop,
L["Send Progress Messages To Message Area"],
AJM.SettingsToggleSendProgressChatMessages,
L["Send Progress Messages To Message Area/Chat"]
)
movingTop = movingTop - checkBoxHeight
-- Message area.
AJM.settingsControlWatcher.dropdownMessageArea = JambaHelperSettings:CreateDropdown(
AJM.settingsControlWatcher,
headingWidth,
left,
movingTop,
L["Send Message Area"]
)
AJM.settingsControlWatcher.dropdownMessageArea:SetList( JambaApi.MessageAreaList() )
AJM.settingsControlWatcher.dropdownMessageArea:SetCallback( "OnValueChanged", AJM.SettingsSetMessageArea )
movingTop = movingTop - dropdownHeight
JambaHelperSettings:CreateHeading( AJM.settingsControlWatcher, L["Appearance & Layout"], movingTop, true )
movingTop = movingTop - headingHeight - verticalSpacing
AJM.settingsControlWatcher.displayOptionsQuestWatcherLinesSlider = JambaHelperSettings:CreateSlider(
AJM.settingsControlWatcher,
halfWidthSlider,
left,
movingTop,
L["Lines Of Info To Display"]
)
AJM.settingsControlWatcher.displayOptionsQuestWatcherLinesSlider:SetSliderValues( 5, 50, 1 )
AJM.settingsControlWatcher.displayOptionsQuestWatcherLinesSlider:SetCallback( "OnValueChanged", AJM.SettingsChangeWatchLines )
AJM.settingsControlWatcher.displayOptionsQuestWatcherFrameWidthSlider = JambaHelperSettings:CreateSlider(
AJM.settingsControlWatcher,
halfWidthSlider,
column2Left,
movingTop,
L["Quest Watcher Width"]
)
AJM.settingsControlWatcher.displayOptionsQuestWatcherFrameWidthSlider:SetSliderValues( 250, 600, 5 )
AJM.settingsControlWatcher.displayOptionsQuestWatcherFrameWidthSlider:SetCallback( "OnValueChanged", AJM.SettingsChangeWatchFrameWidth )
movingTop = movingTop - sliderHeight - verticalSpacing
AJM.settingsControlWatcher.displayOptionsQuestWatcherMediaBorder = JambaHelperSettings:CreateMediaBorder(
AJM.settingsControlWatcher,
halfWidthSlider,
left,
movingTop,
L["Border Style"]
)
AJM.settingsControlWatcher.displayOptionsQuestWatcherMediaBorder:SetCallback( "OnValueChanged", AJM.SettingsChangeBorderStyle )
AJM.settingsControlWatcher.questWatchBorderColourPicker = JambaHelperSettings:CreateColourPicker(
AJM.settingsControlWatcher,
halfWidthSlider,
column2Left + 15,
movingTop - 15,
L["Border Colour"]
)
AJM.settingsControlWatcher.questWatchBorderColourPicker:SetHasAlpha( true )
AJM.settingsControlWatcher.questWatchBorderColourPicker:SetCallback( "OnValueConfirmed", AJM.SettingsQuestWatchBorderColourPickerChanged )
movingTop = movingTop - mediaHeight - verticalSpacing
AJM.settingsControlWatcher.displayOptionsQuestWatcherMediaBackground = JambaHelperSettings:CreateMediaBackground(
AJM.settingsControlWatcher,
halfWidthSlider,
column1Left,
movingTop,
L["Background"]
)
AJM.settingsControlWatcher.displayOptionsQuestWatcherMediaBackground:SetCallback( "OnValueChanged", AJM.SettingsChangeBackgroundStyle )
AJM.settingsControlWatcher.questWatchBackgroundColourPicker = JambaHelperSettings:CreateColourPicker(
AJM.settingsControlWatcher,
halfWidthSlider,
column2Left + 15,
movingTop - 15,
L["Background Colour"]
)
AJM.settingsControlWatcher.questWatchBackgroundColourPicker:SetHasAlpha( true )
AJM.settingsControlWatcher.questWatchBackgroundColourPicker:SetCallback( "OnValueConfirmed", AJM.SettingsQuestWatchBackgroundColourPickerChanged )
movingTop = movingTop - mediaHeight - verticalSpacing
AJM.settingsControlWatcher.questWatchMediaFont = JambaHelperSettings:CreateMediaFont(
AJM.settingsControlWatcher,
halfWidthSlider,
left,
movingTop,
L["Font"]
)
AJM.settingsControlWatcher.questWatchMediaFont:SetCallback( "OnValueChanged", AJM.SettingsChangeFontStyle )
AJM.settingsControlWatcher.questWatchFontSize = JambaHelperSettings:CreateSlider(
AJM.settingsControlWatcher,
halfWidthSlider,
column2Left,
movingTop,
L["Font Size"]
)
AJM.settingsControlWatcher.questWatchFontSize:SetSliderValues( 8, 20 , 1 )
AJM.settingsControlWatcher.questWatchFontSize:SetCallback( "OnValueChanged", AJM.SettingsChangeFontSize )
movingTop = movingTop - mediaHeight - verticalSpacing
AJM.settingsControlWatcher.displayOptionsQuestWatcherScaleSlider = JambaHelperSettings:CreateSlider(
AJM.settingsControlWatcher,
halfWidthSlider,
column1Left,
movingTop,
L["Scale"]
)
AJM.settingsControlWatcher.displayOptionsQuestWatcherScaleSlider:SetSliderValues( 0.5, 2, 0.01 )
AJM.settingsControlWatcher.displayOptionsQuestWatcherScaleSlider:SetCallback( "OnValueChanged", AJM.SettingsChangeScale )
--movingTop = movingTop - sliderHeight - verticalSpacing
AJM.settingsControlWatcher.displayOptionsQuestWatcherTransparencySlider = JambaHelperSettings:CreateSlider(
AJM.settingsControlWatcher,
halfWidthSlider,
column2Left,
movingTop,
L["Transparency"]
)
AJM.settingsControlWatcher.displayOptionsQuestWatcherTransparencySlider:SetSliderValues( 0, 1, 0.01 )
AJM.settingsControlWatcher.displayOptionsQuestWatcherTransparencySlider:SetCallback( "OnValueChanged", AJM.SettingsChangeTransparency )
movingTop = movingTop - sliderHeight - verticalSpacing
return movingTop
end
function AJM:OnMessageAreasChanged( message )
AJM.settingsControlWatcher.dropdownMessageArea:SetList( JambaApi.MessageAreaList() )
end
-------------------------------------------------------------------------------------------------------------
-- Watcher frame.
-------------------------------------------------------------------------------------------------------------
function AJM:CanDisplayQuestWatcher()
-- Do not show is quest watcher disabled.
if AJM.db.enableQuestWatcher == false then
return false
end
-- Do not show if user has hidden frame.
if AJM.db.showFrame == false then
return false
end
-- Do not show if master only and not the master.
if AJM.db.enableQuestWatcherOnMasterOnly == true then
if JambaApi.IsCharacterTheMaster( AJM.characterName ) == false then
return false
end
end
-- Show if at least one line in the watch list.
if AJM:CountLinesInQuestWatchList() > 0 then
return true
end
-- Show if at least one auto quest popup.
if AJM:HasAtLeastOneAutoQuestPopup() == true then
return true
end
-- Nothing to show.
return false
end
function AJM:CreateQuestWatcherFrame()
-- The frame.
local frame = CreateFrame( "Frame", "JambaQuestWatcherWindowFrame", UIParent )
frame.obj = AJM
frame:SetFrameStrata( "BACKGROUND" )
frame:SetClampedToScreen( true )
frame:EnableMouse( false )
frame:SetMovable( true )
frame:RegisterForDrag( "LeftButton" )
frame:SetScript( "OnDragStart",
function( this )
if IsAltKeyDown() then
this:StartMoving()
end
end )
frame:SetScript( "OnDragStop",
function( this )
this:StopMovingOrSizing()
local point, relativeTo, relativePoint, xOffset, yOffset = this:GetPoint()
AJM.db.watcherFramePoint = point
AJM.db.watcherFrameRelativePoint = relativePoint
AJM.db.watcherFrameXOffset = xOffset
AJM.db.watcherFrameYOffset = yOffset
end )
frame:ClearAllPoints()
frame:SetPoint( AJM.db.watcherFramePoint, UIParent, AJM.db.watcherFrameRelativePoint, AJM.db.watcherFrameXOffset, AJM.db.watcherFrameYOffset )
frame:SetBackdrop( {
bgFile = "Interface\\DialogFrame\\UI-DialogBox-Background",
edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border",
tile = true, tileSize = 10, edgeSize = 10,
insets = { left = 3, right = 3, top = 3, bottom = 3 }
} )
-- Create the title for the team list frame.
local titleName = frame:CreateFontString( "JambaQuestWatcherWindowFrameTitleText", "OVERLAY", "GameFontNormal" )
titleName:SetPoint( "TOPLEFT", frame, "TOPLEFT", 7, -7 )
titleName:SetTextColor( 1.00, 1.00, 1.00 )
titleName:SetText( L["Jamba Objective Tracker"] )
frame.titleName = titleName
-- Update button.
local updateButton = CreateFrame( "Button", "JambaQuestWatcherWindowFrameButtonUpdate", frame, "UIPanelButtonGrayTemplate" )
updateButton:SetScript( "OnClick", AJM.JambaQuestWatchListUpdateButtonClicked )
updateButton:SetPoint( "TOPRIGHT", frame, "TOPRIGHT", -5, -4 )
updateButton:SetHeight( 20 )
updateButton:SetWidth( 100 )
updateButton:SetText( L["Update"] )
-- Add an area for the "in the field quest" notifications.
frame.fieldNotificationsTop = -24
frame.fieldNotifications = CreateFrame( "Frame", "JambaQuestWatcherFieldQuestFrame", frame )
frame.fieldNotifications:SetFrameStrata( "BACKGROUND" )
frame.fieldNotifications:SetClampedToScreen( true )
frame.fieldNotifications:EnableMouse( false )
frame.fieldNotifications:ClearAllPoints()
frame.fieldNotifications:SetPoint( "TOPLEFT", frame, "TOPLEFT", 0, frame.fieldNotificationsTop )
frame.fieldNotifications:Show()
-- Set transparency of the the frame (and all its children).
frame:SetAlpha( AJM.db.watcherFrameAlpha )
-- List.
local topOfList = frame.fieldNotificationsTop
local list = {}
list.listFrameName = "JambaQuestWatcherQuestListFrame"
list.parentFrame = frame
list.listTop = topOfList
list.listLeft = 2
list.listWidth = AJM.db.watcherFrameWidth
list.rowHeight = 17
list.rowsToDisplay = AJM.db.watcherListLines
list.columnsToDisplay = 2
list.columnInformation = {}
list.columnInformation[1] = {}
list.columnInformation[1].width = 80
list.columnInformation[1].alignment = "LEFT"
list.columnInformation[2] = {}
list.columnInformation[2].width = 20
list.columnInformation[2].alignment = "CENTER"
list.scrollRefreshCallback = AJM.QuestWatcherQuestListScrollRefresh
list.rowClickCallback = AJM.QuestWatcherQuestListRowClick
frame.questWatchList = list
JambaHelperSettings:CreateScrollList( frame.questWatchList )
-- Change appearance from default.
frame.questWatchList.listFrame:SetBackdropColor( 0.0, 0.0, 0.0, 0.0 )
frame.questWatchList.listFrame:SetBackdropBorderColor( 0.0, 0.0, 0.0, 0.0 )
-- Disable mouse on columns so click-through works.
for iterateDisplayRows = 1, frame.questWatchList.rowsToDisplay do
for iterateDisplayColumns = 1, frame.questWatchList.columnsToDisplay do
frame.questWatchList.rows[iterateDisplayRows].columns[iterateDisplayColumns]:EnableMouse( false )
end
end
-- Position and size constants (once list height is known).
frame.questWatchListBottom = topOfList - list.listHeight
frame.questWatchListHeight = list.listHeight
frame.questWatchHighlightRow = 1
frame.questWatchListOffset = 1
-- Set the global frame reference for this frame.
JambaQuestWatcherFrame = frame
JambaQuestWatcherFrame.autoQuestPopupsHeight = 0
AJM:SettingsUpdateBorderStyle()
AJM:SettingsUpdateFontStyle()
AJM.questWatcherFrameCreated = true
end
function AJM:SettingsUpdateBorderStyle()
local borderStyle = AJM.SharedMedia:Fetch( "border", AJM.db.borderStyle )
local backgroundStyle = AJM.SharedMedia:Fetch( "background", AJM.db.backgroundStyle )
local frame = JambaQuestWatcherFrame
frame:SetBackdrop( {
bgFile = backgroundStyle,
edgeFile = borderStyle,
tile = true, tileSize = frame:GetWidth(), edgeSize = 10,
insets = { left = 3, right = 3, top = 3, bottom = 3 }
} )
frame:SetBackdropColor( AJM.db.watchFrameBackgroundColourR, AJM.db.watchFrameBackgroundColourG, AJM.db.watchFrameBackgroundColourB, AJM.db.watchFrameBackgroundColourA )
frame:SetBackdropBorderColor( AJM.db.watchFrameBorderColourR, AJM.db.watchFrameBorderColourG, AJM.db.watchFrameBorderColourB, AJM.db.watchFrameBorderColourA )
end
function AJM:SettingsUpdateFontStyle()
local textFont = AJM.SharedMedia:Fetch( "font", AJM.db.watchFontStyle )
local textSize = AJM.db.watchFontSize
local frame = JambaQuestWatcherFrame
frame.titleName:SetFont( textFont , textSize , "OUTLINE")
end
function AJM:UpdateQuestWatcherDimensions()
local frame = JambaQuestWatcherFrame
frame:SetWidth( frame.questWatchList.listWidth + 4 )
frame:SetHeight( frame.questWatchListHeight + 40 )
-- Field notifications.
frame.fieldNotifications:SetWidth( frame.questWatchList.listWidth + 4 )
frame.fieldNotifications:SetHeight( JambaQuestWatcherFrame.autoQuestPopupsHeight )
-- List.
frame.questWatchList.listTop = frame.fieldNotificationsTop - JambaQuestWatcherFrame.autoQuestPopupsHeight
frame.questWatchList.listFrame:SetPoint( "TOPLEFT", frame.questWatchList.parentFrame, "TOPLEFT", frame.questWatchList.listLeft, frame.questWatchList.listTop )
-- Scale.
frame:SetScale( AJM.db.watcherFrameScale )
end
function AJM:SetQuestWatcherVisibility()
if AJM:CanDisplayQuestWatcher() == true then
AJM:UpdateQuestWatcherDimensions()
JambaQuestWatcherFrame:ClearAllPoints()
JambaQuestWatcherFrame:SetPoint( AJM.db.watcherFramePoint, UIParent, AJM.db.watcherFrameRelativePoint, AJM.db.watcherFrameXOffset, AJM.db.watcherFrameYOffset )
JambaQuestWatcherFrame:SetAlpha( AJM.db.watcherFrameAlpha )
JambaQuestWatcherFrame:Show()
else
JambaQuestWatcherFrame:Hide()
end
end
-------------------------------------------------------------------------------------------------------------
-- Settings functionality.
-------------------------------------------------------------------------------------------------------------
-- Settings received.
function AJM:JambaOnSettingsReceived( characterName, settings )
if characterName ~= AJM.characterName then
-- Update the settings.
AJM.db.enableQuestWatcher = settings.enableQuestWatcher
AJM.db.watcherFrameAlpha = settings.watcherFrameAlpha
AJM.db.watcherFramePoint = settings.watcherFramePoint
AJM.db.watcherFrameRelativePoint = settings.watcherFrameRelativePoint
AJM.db.watcherFrameXOffset = settings.watcherFrameXOffset
AJM.db.watcherFrameYOffset = settings.watcherFrameYOffset
AJM.db.borderStyle = settings.borderStyle
AJM.db.backgroundStyle = settings.backgroundStyle
AJM.db.watchFontStyle = settings.watchFontStyle
AJM.db.watchFontSize = settings.watchFontSize
AJM.db.hideQuestWatcherInCombat = settings.hideQuestWatcherInCombat
AJM.db.watcherFrameScale = settings.watcherFrameScale
AJM.db.enableQuestWatcherOnMasterOnly = settings.enableQuestWatcherOnMasterOnly
AJM.db.watchFrameBackgroundColourR = settings.watchFrameBackgroundColourR
AJM.db.watchFrameBackgroundColourG = settings.watchFrameBackgroundColourG
AJM.db.watchFrameBackgroundColourB = settings.watchFrameBackgroundColourB
AJM.db.watchFrameBackgroundColourA = settings.watchFrameBackgroundColourA
AJM.db.watchFrameBorderColourR = settings.watchFrameBorderColourR
AJM.db.watchFrameBorderColourG = settings.watchFrameBorderColourG
AJM.db.watchFrameBorderColourB = settings.watchFrameBorderColourB
AJM.db.watchFrameBorderColourA = settings.watchFrameBorderColourA
AJM.db.watcherListLines = settings.watcherListLines
AJM.db.watcherFrameWidth = settings.watcherFrameWidth
AJM.db.unlockWatcherFrame = settings.unlockWatcherFrame
AJM.db.hideBlizzardWatchFrame = settings.hideBlizzardWatchFrame
AJM.db.doNotHideCompletedObjectives = settings.doNotHideCompletedObjectives
AJM.db.showCompletedObjectivesAsDone = settings.showCompletedObjectivesAsDone
AJM.db.hideQuestIfAllComplete = settings.hideQuestIfAllComplete
-- AJM.db.showFrame = settings.showFrame
AJM.db.sendProgressChatMessages = settings.sendProgressChatMessages
AJM.db.messageArea = settings.messageArea
-- Refresh the settings.
AJM:SettingsRefresh()
AJM:UpdateUnlockWatcherFrame()
--AJM:UpdateHideBlizzardWatchFrame()
AJM:ScheduleTimer( "UpdateHideBlizzardWatchFrame", 2 )
-- Tell the player.
AJM:Print( L["Settings received from A."]( characterName ) )
-- Tell the team?
--AJM:JambaSendMessageToTeam( AJM.db.messageArea, L["Settings received from A."]( characterName ), false )
end
end
-------------------------------------------------------------------------------------------------------------
-- Settings Populate.
-------------------------------------------------------------------------------------------------------------
function AJM:BeforeJambaProfileChanged()
end
function AJM:OnJambaProfileChanged()
AJM:SettingsRefresh()
end
function AJM:SettingsRefresh()
-- Quest watcher options.
AJM.settingsControlWatcher.checkBoxEnableQuestWatcher:SetValue( AJM.db.enableQuestWatcher )
AJM.settingsControlWatcher.displayOptionsQuestWatcherMediaBorder:SetValue( AJM.db.borderStyle )
AJM.settingsControlWatcher.displayOptionsQuestWatcherMediaBackground:SetValue( AJM.db.backgroundStyle )
AJM.settingsControlWatcher.questWatchMediaFont:SetValue( AJM.db.watchFontStyle )
AJM.settingsControlWatcher.questWatchFontSize:SetValue( AJM.db.watchFontSize )
AJM.settingsControlWatcher.displayOptionsCheckBoxHideQuestWatcherInCombat:SetValue( AJM.db.hideQuestWatcherInCombat )
AJM.settingsControlWatcher.displayOptionsQuestWatcherTransparencySlider:SetValue( AJM.db.watcherFrameAlpha )
AJM.settingsControlWatcher.displayOptionsQuestWatcherScaleSlider:SetValue( AJM.db.watcherFrameScale )
AJM.settingsControlWatcher.checkBoxEnableQuestWatcherMasterOnly:SetValue( AJM.db.enableQuestWatcherOnMasterOnly )
AJM.settingsControlWatcher.questWatchBackgroundColourPicker:SetColor( AJM.db.watchFrameBackgroundColourR, AJM.db.watchFrameBackgroundColourG, AJM.db.watchFrameBackgroundColourB, AJM.db.watchFrameBackgroundColourA )
AJM.settingsControlWatcher.questWatchBorderColourPicker:SetColor( AJM.db.watchFrameBorderColourR, AJM.db.watchFrameBorderColourG, AJM.db.watchFrameBorderColourB, AJM.db.watchFrameBorderColourA )
AJM.settingsControlWatcher.displayOptionsQuestWatcherLinesSlider:SetValue( AJM.db.watcherListLines )
AJM.settingsControlWatcher.displayOptionsQuestWatcherFrameWidthSlider:SetValue( AJM.db.watcherFrameWidth )
AJM.settingsControlWatcher.checkBoxUnlockWatcherFrame:SetValue( AJM.db.unlockWatcherFrame )
AJM.settingsControlWatcher.checkBoxHideBlizzardWatchFrame:SetValue( AJM.db.hideBlizzardWatchFrame )
AJM.settingsControlWatcher.checkBoxShowCompletedObjectivesAsDone:SetValue( AJM.db.showCompletedObjectivesAsDone )
AJM.settingsControlWatcher.checkBoxShowDoNotHideCompletedObjectives:SetValue( AJM.db.doNotHideCompletedObjectives )
AJM.settingsControlWatcher.checkBoxHideQuestIfAllComplete:SetValue( AJM.db.hideQuestIfAllComplete )
-- AJM.settingsControlWatcher.checkBoxShowFrame:SetValue( AJM.db.showFrame )
AJM.settingsControlWatcher.dropdownMessageArea:SetValue( AJM.db.messageArea )
AJM.settingsControlWatcher.checkBoxSendProgressChatMessages:SetValue( AJM.db.sendProgressChatMessages )
-- Quest watcher state.
AJM.settingsControlWatcher.displayOptionsQuestWatcherMediaBorder:SetDisabled( not AJM.db.enableQuestWatcher )
AJM.settingsControlWatcher.displayOptionsQuestWatcherMediaBackground:SetDisabled( not AJM.db.enableQuestWatcher )
AJM.settingsControlWatcher.questWatchMediaFont:SetDisabled( not AJM.db.enableQuestWatcher )
AJM.settingsControlWatcher.questWatchFontSize:SetDisabled( not AJM.db.enableQuestWatcher )
AJM.settingsControlWatcher.displayOptionsCheckBoxHideQuestWatcherInCombat:SetDisabled( not AJM.db.enableQuestWatcher )
AJM.settingsControlWatcher.displayOptionsQuestWatcherTransparencySlider:SetDisabled( not AJM.db.enableQuestWatcher )
AJM.settingsControlWatcher.displayOptionsQuestWatcherScaleSlider:SetDisabled( not AJM.db.enableQuestWatcher )
AJM.settingsControlWatcher.checkBoxEnableQuestWatcherMasterOnly:SetDisabled( not AJM.db.enableQuestWatcher )
AJM.settingsControlWatcher.questWatchBackgroundColourPicker:SetDisabled( not AJM.db.enableQuestWatcher )
AJM.settingsControlWatcher.questWatchBorderColourPicker:SetDisabled( not AJM.db.enableQuestWatcher )
AJM.settingsControlWatcher.displayOptionsQuestWatcherLinesSlider:SetDisabled( not AJM.db.enableQuestWatcher )
AJM.settingsControlWatcher.displayOptionsQuestWatcherFrameWidthSlider:SetDisabled( not AJM.db.enableQuestWatcher )
AJM.settingsControlWatcher.checkBoxUnlockWatcherFrame:SetDisabled( not AJM.db.enableQuestWatcher )
AJM.settingsControlWatcher.checkBoxHideBlizzardWatchFrame:SetDisabled( not AJM.db.enableQuestWatcher )
AJM.settingsControlWatcher.checkBoxShowCompletedObjectivesAsDone:SetDisabled( not AJM.db.enableQuestWatcher )
AJM.settingsControlWatcher.checkBoxShowDoNotHideCompletedObjectives:SetDisabled( not AJM.db.enableQuestWatcher )
AJM.settingsControlWatcher.checkBoxHideQuestIfAllComplete:SetDisabled( not AJM.db.enableQuestWatcher )
-- AJM.settingsControlWatcher.checkBoxShowFrame:SetDisabled( not AJM.db.enableQuestWatcher )
AJM.settingsControlWatcher.dropdownMessageArea:SetDisabled( not AJM.db.enableQuestWatcher )
AJM.settingsControlWatcher.checkBoxSendProgressChatMessages:SetDisabled( not AJM.db.enableQuestWatcher )
if AJM.questWatcherFrameCreated == true then
AJM:SettingsUpdateBorderStyle()
AJM:SettingsUpdateFontStyle()
AJM:SetQuestWatcherVisibility()
end
end
function AJM:SettingsPushSettingsClick( event )
AJM:JambaSendSettings()
end
function AJM:SettingsToggleEnableQuestWatcher( event, checked )
AJM.db.enableQuestWatcher = checked
AJM:SettingsRefresh()
end
function AJM:SettingsChangeBorderStyle( event, value )
AJM.db.borderStyle = value
AJM:SettingsRefresh()
end
function AJM:SettingsChangeBackgroundStyle( event, value )
AJM.db.backgroundStyle = value
AJM:SettingsRefresh()
end
function AJM:SettingsChangeFontStyle( event, value )
AJM.db.watchFontStyle = value
AJM:SettingsRefresh()
AJM:JambaQuestWatcherUpdate( false )
end
function AJM:SettingsChangeFontSize( event, value )
AJM.db.watchFontSize = value
AJM:SettingsRefresh()
AJM:JambaQuestWatcherUpdate( false )
end
function AJM:SettingsToggleHideQuestWatcherInCombat( event, checked )
AJM.db.hideQuestWatcherInCombat = checked
AJM:SettingsRefresh()
end
function AJM:SettingsChangeTransparency( event, value )
AJM.db.watcherFrameAlpha = tonumber( value )
AJM:SettingsRefresh()
end
function AJM:SettingsChangeScale( event, value )
AJM.db.watcherFrameScale = tonumber( value )
AJM:SettingsRefresh()
end
function AJM:SettingsChangeWatchLines( event, value )
AJM.db.watcherListLines = tonumber( value )
AJM:SettingsRefresh()
end
function AJM:SettingsChangeWatchFrameWidth( event, value )
AJM.db.watcherFrameWidth = tonumber( value )
AJM:SettingsRefresh()
end
function AJM:SettingsToggleEnableQuestWatcherMasterOnly( event, checked )
AJM.db.enableQuestWatcherOnMasterOnly = checked
AJM:SettingsRefresh()
end
function AJM:SettingsQuestWatchBackgroundColourPickerChanged( event, r, g, b, a )
AJM.db.watchFrameBackgroundColourR = r
AJM.db.watchFrameBackgroundColourG = g
AJM.db.watchFrameBackgroundColourB = b
AJM.db.watchFrameBackgroundColourA = a
AJM:SettingsRefresh()
end
function AJM:SettingsQuestWatchBorderColourPickerChanged( event, r, g, b, a )
AJM.db.watchFrameBorderColourR = r
AJM.db.watchFrameBorderColourG = g
AJM.db.watchFrameBorderColourB = b
AJM.db.watchFrameBorderColourA = a
AJM:SettingsRefresh()
end
function AJM:SettingsToggleUnlockWatcherFrame( event, checked )
AJM.db.unlockWatcherFrame = checked
AJM:UpdateUnlockWatcherFrame()
AJM:SettingsRefresh()
end
function AJM:SettingsToggleSendProgressChatMessages( event, checked )
AJM.db.sendProgressChatMessages = checked
AJM:SettingsRefresh()
end
function AJM:SettingsToggleShowFrame( event, checked )
AJM.db.showFrame = checked
AJM:SettingsRefresh()
end
function AJM:ShowFrameCommand( info, parameters )
AJM.db.showFrame = true
AJM:SettingsRefresh()
end
function AJM:HideFrameCommand( info, parameters )
AJM.db.showFrame = false
AJM:SettingsRefresh()
end
function AJM:SettingsSetMessageArea( event, messageAreaValue )
AJM.db.messageArea = messageAreaValue
AJM:SettingsRefresh()
end
function AJM:SettingsToggleHideBlizzardWatchFrame( event, checked )
AJM.db.hideBlizzardWatchFrame = checked
--AJM:UpdateHideBlizzardWatchFrame()
AJM:ScheduleTimer( "UpdateHideBlizzardWatchFrame", 2 )
AJM:SettingsRefresh()
end
function AJM:SettingsShowCompletedObjectivesAsDone( event, checked )
AJM.db.showCompletedObjectivesAsDone = checked
AJM:SettingsRefresh()
end
function AJM:SettingsHideQuestIfAllComplete( event, checked )
AJM.db.hideQuestIfAllComplete = checked
AJM:SettingsRefresh()
end
function AJM:SettingsDoNotHideCompletedObjectives( event, checked )
AJM.db.doNotHideCompletedObjectives = checked
AJM:SettingsRefresh()
end
function AJM:UpdateUnlockWatcherFrame()
if AJM.db.enableQuestWatcher == false then
return
end
if AJM.db.unlockWatcherFrame == true then
JambaQuestWatcherFrame:EnableMouse( true )
else
JambaQuestWatcherFrame:EnableMouse( false )
end
end
function AJM:UpdateHideBlizzardWatchFrame()
if AJM.db.enableQuestWatcher == false then
return
end
if AJM.db.hideBlizzardWatchFrame == true then
if ObjectiveTrackerFrame:IsVisible() then
ObjectiveTrackerFrame:Hide()
end
else
ObjectiveTrackerFrame:Show()
end
end
-------------------------------------------------------------------------------------------------------------
-- QUEST WATCHING HOOKS
-------------------------------------------------------------------------------------------------------------
function AJM:SelectActiveQuest( questIndex )
AJM:DebugMessage("select active quest", questIndex)
if AJM.db.enableQuestWatcher == false then
return
end
AJM:SetActiveQuestForQuestWatcherCache( questIndex )
end
function AJM:GetQuestReward( itemChoice )
if AJM.db.enableQuestWatcher == false then
return
end
local questJustCompletedName = GetTitleText()
AJM:DebugMessage( "GetQuestReward: ", questIndex, questJustCompletedName )
local questIndex = AJM:GetQuestLogIndexByName( questJustCompletedName )
local title, level, suggestedGroup, isHeader, isCollapsed, isComplete, frequency, questID, startEvent, displayQuestID, isOnMap, hasLocalPOI, isTask, isStory = GetQuestLogTitle( questIndex )
AJM:DebugMessage( "GetQuestReward after GetQuestLogTitle: ", questIndex, questJustCompletedName, questID )
AJM:RemoveQuestFromWatchList( questID )
end
function AJM:AddQuestWatch( questIndex )
if AJM.db.enableQuestWatcher == false then
return
end
--AJM:UpdateHideBlizzardWatchFrame()
AJM:ScheduleTimer( "UpdateHideBlizzardWatchFrame", 2 )
AJM:JambaQuestWatcherUpdate( true )
AJM:JambaQuestWatcherScenarioUpdate( true )
end
function AJM:RemoveQuestWatch( questIndex )
if AJM.db.enableQuestWatcher == false then
return
end
AJM:DebugMessage( "RemoveQuestWatch", questIndex )
--AJM:UpdateHideBlizzardWatchFrame()
AJM:ScheduleTimer( "UpdateHideBlizzardWatchFrame", 2 )
local title, level, suggestedGroup, isHeader, isCollapsed, isComplete, frequency, questID, startEvent, displayQuestID, isOnMap, hasLocalPOI, isTask, isStory = GetQuestLogTitle( questIndex )
AJM:DebugMessage( "About to call RemoveQuestFromWatchList with value:", questID )
AJM:RemoveQuestFromWatchList( questID )
end
function AJM:SetAbandonQuest()
if AJM.db.enableQuestWatcher == false then
return
end
local questName = GetAbandonQuestName()
if questName ~= nil then
local questIndex = AJM:GetQuestLogIndexByName( questName )
AJM:SetActiveQuestForQuestWatcherCache( questIndex )
end
end
function AJM:AbandonQuest()
if AJM.db.enableQuestWatcher == false then
return
end
-- Wait a bit for the correct information to come through from the server...
AJM:ScheduleTimer( "AbandonQuestDelayed", 1 )
end
function AJM:QUEST_WATCH_UPDATE( event, ... )
--AJM:Print("test4")
if AJM.db.enableQuestWatcher == true then
-- Wait a bit for the correct information to come through from the server...
AJM:ScheduleTimer( "JambaQuestWatcherUpdate", 1, true )
end
end
function AJM:QUEST_LOG_UPDATE( event, ... )
--AJM:Print("test")
if AJM.db.enableQuestWatcher == true then
-- Wait a bit for the correct information to come through from the server...
AJM:ScheduleTimer( "JambaQuestWatcherUpdate", 1, true )
end
end
function AJM:SCENARIO_UPDATE( event, ... )
--AJM:Print("test2")
if AJM.db.enableQuestWatcher == true then
--AJM:JambaQuestWatchListUpdateButtonClicked()
AJM:RemoveQuestsNotBeingWatched()
AJM:ScheduleTimer( "JambaQuestWatcherScenarioUpdate", 1, true )
end
end
function AJM:SCENARIO_CRITERIA_UPDATE( event, ... )
--AJM:Print("test3")
if AJM.db.enableQuestWatcher == true then
-- Wait a bit for the correct information to come through from the server...
--AJM:ScheduleTimer( "JambaQuestWatcherUpdate", 1, false )
AJM:ScheduleTimer( "JambaQuestWatcherScenarioUpdate", 1, true )
end
end
function AJM:PLAYER_ENTERING_WORLD( event, ... )
--AJM:Print("test4")
if AJM.db.enableQuestWatcher == true then
AJM:RemoveQuestsNotBeingWatched()
AJM:ScheduleTimer( "JambaQuestWatcherScenarioUpdate", 1, false )
AJM:ScheduleTimer( "JambaQuestWatcherUpdate", 1, false )
--AJM:JambaQuestWatchListUpdateButtonClicked()
end
end
function AJM:PLAYER_REGEN_ENABLED( event, ... )
if AJM.db.enableQuestWatcher == false then
return
end
if AJM.db.hideQuestWatcherInCombat == true then
AJM:SetQuestWatcherVisibility()
end
end
function AJM:PLAYER_REGEN_DISABLED( event, ... )
if AJM.db.enableQuestWatcher == false then
return
end
if AJM.db.hideQuestWatcherInCombat == true then
JambaQuestWatcherFrame:Hide()
end
end
-------------------------------------------------------------------------------------------------------------
-- QUEST WATCHING
-------------------------------------------------------------------------------------------------------------
function AJM:AbandonQuestDelayed()
AJM:RemoveCurrentQuestFromWatcherCache()
AJM:RemoveQuestsNotBeingWatched()
end
function AJM:JambaQuestWatchListUpdateButtonClicked()
AJM:RemoveQuestsNotBeingWatched()
AJM:JambaSendCommandToTeam( AJM.COMMAND_UPDATE_QUEST_WATCHER_LIST )
end
function AJM:DoQuestWatchListUpdate( characterName )
AJM:JambaQuestWatcherUpdate( false )
AJM:JambaQuestWatcherScenarioUpdate( false )
end
function AJM:GetQuestObjectiveCompletion( text )
if text == nil then
return L["N/A"], L["N/A"]
end
local arg1, arg2 = string.match(text, "(.-%S)%s(.*)")
if arg1 and arg2 then
return arg1, arg2
else
return L["N/A"], text
end
end
function AJM:QuestWatchGetObjectiveText( questIndex, objectiveIndex )
local objectiveFullText, objectiveType, objectiveFinished = GetQuestLogLeaderBoard( objectiveIndex, questIndex )
local amountCompleted, objectiveText = AJM:GetQuestObjectiveCompletion( objectiveFullText )
return objectiveText
end
-------------------------------------------------------------------------------------------------------------
-- QUEST WATCH CACHE
-------------------------------------------------------------------------------------------------------------
function AJM:IsQuestObjectiveInCache( questID, objectiveIndex )
local key = questID..objectiveIndex
if AJM.questWatchCache[key] == nil then
return false
end
return true
end
function AJM:AddQuestObjectiveToCache( questID, objectiveIndex, amountCompleted, objectiveFinished )
local key = questID..objectiveIndex
AJM.questWatchCache[key] = {}
AJM.questWatchCache[key].questID = questID
AJM.questWatchCache[key].amountCompleted = amountCompleted
AJM.questWatchCache[key].objectiveFinished = objectiveFinished
end
function AJM:GetQuestCachedValues( questID, objectiveIndex )
local key = questID..objectiveIndex
return AJM.questWatchCache[key].amountCompleted, AJM.questWatchCache[key].objectiveFinished
end
function AJM:UpdateQuestCachedValues( questID, objectiveIndex, amountCompleted, objectiveFinished )
local key = questID..objectiveIndex
AJM.questWatchCache[key].amountCompleted = amountCompleted
AJM.questWatchCache[key].objectiveFinished = objectiveFinished
end
function AJM:QuestCacheUpdate( questID, objectiveIndex, amountCompleted, objectiveFinished )
if AJM:IsQuestObjectiveInCache( questID, objectiveIndex ) == false then
AJM:AddQuestObjectiveToCache( questID, objectiveIndex, amountCompleted, objectiveFinished )
return true
end
local cachedAmountCompleted, cachedObjectiveFinished = AJM:GetQuestCachedValues( questID, objectiveIndex )
if cachedAmountCompleted == amountCompleted and cachedObjectiveFinished == objectiveFinished then
return false
end
AJM:UpdateQuestCachedValues( questID, objectiveIndex, amountCompleted, objectiveFinished )
return true
end
function AJM:SetActiveQuestForQuestWatcherCache( questIndex )
if AJM.db.enableQuestWatcher == false then
return
end
if questIndex ~= nil then
local title, level, suggestedGroup, isHeader, isCollapsed, isComplete, frequency, questID, startEvent, displayQuestID, isOnMap, hasLocalPOI, isTask, isStory = GetQuestLogTitle( questIndex )
AJM.currentQuestForQuestWatcherID = questID
else
AJM.currentQuestForQuestWatcherID = nil
end
end
function AJM:RemoveQuestFromWatcherCache( questID )
AJM:DebugMessage( "RemoveQuestFromWatcherCache", questID )
for key, questInfo in pairs( AJM.questWatchCache ) do
if questInfo.questID == questID then
AJM.questWatchCache[key].questID = nil
AJM.questWatchCache[key].amountCompleted = nil
AJM.questWatchCache[key].objectiveFinished = nil
AJM.questWatchCache[key] = nil
AJM:JambaSendCommandToTeam( AJM.COMMAND_QUEST_WATCH_REMOVE_QUEST, questID )
end
end
end
function AJM:RemoveCurrentQuestFromWatcherCache()
if AJM.db.enableQuestWatcher == false then
return
end
AJM:DebugMessage( "RemoveCurrentQuestFromWatcherCache", AJM.currentQuestForQuestWatcherID )
if AJM.currentQuestForQuestWatcherID == nil then
return
end
AJM:RemoveQuestFromWatcherCache( AJM.currentQuestForQuestWatcherID )
end
-------------------------------------------------------------------------------------------------------------
-- AUTO QUEST COMMUNICATION
-------------------------------------------------------------------------------------------------------------
function AJM:IsCompletedAutoCompleteFieldQuest( questIndex, isComplete )
-- Send an isComplete true flag if the quest is completed and is an in the field autocomplete quest.
if isComplete and isComplete > 0 then
if GetQuestLogIsAutoComplete( questIndex ) then
isComplete = true
else
isComplete = false
end
else
isComplete = false
end
return isComplete
end
function AJM:QUEST_AUTOCOMPLETE( event, questID, ... )
-- In the field autocomplete quest event.
if AJM.db.enableQuestWatcher == false then
return
end
AJM:JambaSendCommandToTeam( AJM.COMMAND_AUTO_QUEST_COMPLETE, questID )
end
function AJM:DoAutoQuestFieldComplete( characterName, questID )
AJM:JambaAddAutoQuestPopUp( questID, "COMPLETE", characterName )
end
function AJM:QUEST_COMPLETE()
if AJM.db.enableQuestWatcher == false then
return
end
AJM:JambaSendCommandToTeam( AJM.COMMAND_REMOVE_AUTO_QUEST_COMPLETE, questID )
end
function AJM:DoRemoveAutoQuestFieldComplete( characterName, questID )
AJM:JambaRemoveAutoQuestPopUp( questID, characterName )
end
function AJM:QUEST_DETAIL()
if AJM.db.enableQuestWatcher == false then
return
end
if QuestGetAutoAccept() and QuestIsFromAreaTrigger() then
AJM:JambaSendCommandToTeam( AJM.COMMAND_AUTO_QUEST_OFFER, GetQuestID() )
end
end
function AJM:DoAutoQuestFieldOffer( characterName, questID )
AJM:JambaAddAutoQuestPopUp( questID, "OFFER", characterName )
end
-------------------------------------------------------------------------------------------------------------
-- QUEST WATCH COMMUNICATION
-------------------------------------------------------------------------------------------------------------
--Ebony test
function AJM:JambaQuestWatcherScenarioUpdate( useCache )
if AJM.db.enableQuestWatcher == false then
return
end
-- Scenario information
local isInScenario = C_Scenario.IsInScenario()
if isInScenario == true then
--local useCache = false
local scenarioName, currentStage, numStages, flags, _, _, _, xp, money = C_Scenario.GetInfo()
--AJM:Print("scenario", scenarioName, currentStage, numStages)
for StagesIndex = 1, currentStage do
--AJM:Print("Player is on Stage", currentStage)
local stageName, stageDescription, numCriteria, _, _, _, numSpells, spellInfo, weightedProgress = C_Scenario.GetStepInfo()
--AJM:Print("test match", numCriteria)
if numCriteria == 0 then
--AJM:Print("test match 0")
if (weightedProgress) then
--AJM:Print("Checking Progress", weightedProgress)
local questID = 1001
local criteriaIndex = 0
local maxProgress = 100
--Placeholder does not work on borkenshore questlines......
--local totalQuantity = 100
local completed = false
local amountCompleted = tostring(weightedProgress).."/"..(maxProgress)
local name = "Scenario:"..stageName.." "..currentStage.."/"..numStages
--AJM:Print("scenarioProgressInfo", questID, name, criteriaIndex, stageDescription , amountCompleted , totalQuantity, completed )
--if (AJM:QuestCacheUpdate( questID, criteriaIndex, amountCompleted, objectiveFinished ) == true) or (useCache == false) then
AJM:JambaSendCommandToTeam( AJM.COMMAND_QUEST_WATCH_OBJECTIVE_UPDATE, questID, name, numCriteria, stageDescription , amountCompleted , totalQuantity, completed )
--end
else
--AJM:Print("ScenarioDONE", stageDescription)
local questID = 1001
local criteriaIndex = 1
local completed = false
local amountCompleted = tostring(0).."/"..(1)
local name = "Scenario:"..stageName.." "..currentStage.."/"..numStages
--AJM:Print("scenarioProgressInfo", questID, name, criteriaIndex, stageDescription , amountCompleted , totalQuantity, completed )
if (AJM:QuestCacheUpdate( questID, criteriaIndex, amountCompleted, objectiveFinished ) == true) or (useCache == false) then
AJM:JambaSendCommandToTeam( AJM.COMMAND_QUEST_WATCH_OBJECTIVE_UPDATE, questID, name, numCriteria, stageDescription , amountCompleted , totalQuantity, completed )
end
end
else
for criteriaIndex = 1, numCriteria do
--AJM:Print("Player has", numCriteria, "Criterias", "and is checking", criteriaIndex)
local criteriaString, criteriaType, completed, quantity, totalQuantity, flags, assetID, quantityString, criteriaID, duration, elapsed = C_Scenario.GetCriteriaInfo(criteriaIndex)
--AJM:Print("test", criteriaString, criteriaType, completed, quantity, totalQuantity )
--Ebony to fix a bug with character trial quest (this might be a blizzard bug) TODO relook at somepoint in beta.
if (criteriaString) then
local questID = 1001
local amountCompleted = tostring( quantity ).."/"..( totalQuantity )
--AJM:Print("Stages", numStages)
local name = nil
if (numStages) > 1 then
local textName = "Scenario:"..stageName.." "..currentStage.."/"..numStages
newName = textName
else
local textName = "Scenario:"..stageName
newName = textName
end
local name = newName
if (AJM:QuestCacheUpdate( questID, criteriaIndex, amountCompleted, objectiveFinished ) == true) or (useCache == false) then
--AJM:Print("test", questID, name, criteriaIndex, criteriaString , amountCompleted , completed, completed)
AJM:JambaSendCommandToTeam( AJM.COMMAND_QUEST_WATCH_OBJECTIVE_UPDATE, questID, name, criteriaIndex, criteriaString , amountCompleted , completed, completed ) if AJM.db.sendProgressChatMessages == true then
-- if AJM.db.sendProgressChatMessages == true then
-- AJM:JambaSendMessageToTeam( AJM.db.messageArea, objectiveText.." "..amountCompleted, false )
-- end
end
end
end
end
end
end
-- SCENARIO_BONUS
local tblBonusSteps = C_Scenario.GetBonusSteps()
if #tblBonusSteps > 0 then
--AJM:Print("BonusTest", #tblBonusSteps )
for i = 1, #tblBonusSteps do
local bonusStepIndex = tblBonusSteps[i]
--AJM:Print("bonusIndex", bonusStepIndex)
local stageName, stageDescription, numCriteria = C_Scenario.GetStepInfo(bonusStepIndex)
--AJM:Print("bonusInfo", numCriteria, stageName, stageDescription)
for criteriaIndex = 1, numCriteria do
--AJM:Print("Player has", numCriteria, "Criterias", "and is checking", criteriaIndex)
local criteriaString, criteriaType, completed, quantity, totalQuantity, flags, assetID, quantityString, criteriaID = C_Scenario.GetCriteriaInfoByStep(bonusStepIndex, criteriaIndex)
local questID = assetID
local amountCompleted = tostring(quantity).."/"..(totalQuantity)
local name = "ScenarioBouns:"..stageName --.." "..currentStage.."/"..numStages
--AJM:Print("scenarioBouns", questID, name, criteriaIndexa, criteriaString , amountCompleted , totalQuantity, completed )
if (AJM:QuestCacheUpdate( questID, criteriaIndex, amountCompleted, objectiveFinished ) == true) or (useCache == false) then
AJM:JambaSendCommandToTeam( AJM.COMMAND_QUEST_WATCH_OBJECTIVE_UPDATE, questID, name, criteriaIndex, criteriaString , amountCompleted , completed, completed )
--if AJM.db.sendProgressChatMessages == true then
-- AJM:JambaSendMessageToTeam( AJM.db.messageArea, objectiveText.." "..amountCompleted, false )
--end
end
end
end
end
end
end
function AJM:JambaQuestWatcherUpdate( useCache )
if AJM.db.enableQuestWatcher == false then
return
end
AJM:DebugMessage( "Sending quest watch information...")
-- old wow quests system
for iterateWatchedQuests = 1, GetNumQuestWatches() do
--for iterateQuests = 1, GetNumQuestLogEntries() do
local questIndex = GetQuestIndexForWatch( iterateWatchedQuests )
AJM:DebugMessage( "GetQuestIndexForWatch: questIndex: ", questIndex )
if questIndex ~= nil then
local title, level, suggestedGroup, isHeader, isCollapsed, isComplete, frequency, questID, startEvent, displayQuestID, isOnMap, hasLocalPOI, isTask, isStory = GetQuestLogTitle( questIndex )
isComplete = AJM:IsCompletedAutoCompleteFieldQuest( questIndex, isComplete )
local numObjectives = GetNumQuestLeaderBoards( questIndex )
AJM:DebugMessage( "NumObjs:", numObjectives )
for iterateObjectives = 1, numObjectives do
local objectiveFullText, objectiveType, objectiveFinished = GetQuestLogLeaderBoard( iterateObjectives, questIndex )
AJM:DebugMessage( "ObjInfo:", objectiveFullText, objectiveType, objectiveFinished, iterateObjectives, questIndex )
local amountCompleted, objectiveText = AJM:GetQuestObjectiveCompletion( objectiveFullText )
AJM:DebugMessage( "SplitObjInfo", amountCompleted, objectiveText )
if (AJM:QuestCacheUpdate( questID, iterateObjectives, amountCompleted, objectiveFinished ) == true) or (useCache == false) then
--AJM:Print( "UPDATE:", questID, title, iterateObjectives, objectiveText, amountCompleted, objectiveFinished, isComplete )
AJM:JambaSendCommandToTeam( AJM.COMMAND_QUEST_WATCH_OBJECTIVE_UPDATE, questID, title, iterateObjectives, objectiveText, amountCompleted, objectiveFinished, isComplete )
if AJM.db.sendProgressChatMessages == true then
AJM:JambaSendMessageToTeam( AJM.db.messageArea, objectiveText.." "..amountCompleted, false )
end
end
end
end
end
-- New Bouns Quests!
for iterateWatchedQuests = 1, GetNumQuestLogEntries() do
local title, level, suggestedGroup, isHeader, isCollapsed, isComplete, frequency, questID, startEvent, displayQuestID, isOnMap, hasLocalPOI, isTask, isStory = GetQuestLogTitle( iterateWatchedQuests )
--AJM:DebugMessage( "EbonyTest101:", questID)
local isInArea, isOnMap, numObjectives = GetTaskInfo(questID);
if isInArea and isOnMap then
isComplete = AJM:IsCompletedAutoCompleteFieldQuest( questIndex, isComplete )
--AJM:Print( "EbonyTestbounsquestID:", questID, numObjectives, isComplete )
for iterateObjectives = 1, numObjectives do
local objectiveFullText, objectiveType, finished = GetQuestObjectiveInfo( questID, iterateObjectives, isComplete )
--AJM:Print("BonuesQuest", objectiveFullText, objectiveType, finished )
-- if progressbar quest that is not a quest where you kill XYZ and many things can make you do the complete the quest.
if objectiveType == "progressbar" then
--AJM:Print("hello123", )
local objectiveText = "ProgressBar"
local progress = GetQuestProgressBarPercent( questID )
local maxProgress = 100
local amountCompleted = tostring(progress).."/"..(maxProgress)
--AJM:Print("BarQuesttext", amountCompleted )
if (AJM:QuestCacheUpdate( questID, iterateObjectives, amountCompleted, objectiveFinished ) == true) or (useCache == false) then
--AJM:Print("QuestPercent", title, objectiveText, amountCompleted )
local name = tostring("Bonus:")..(title)
--send command to team
--AJM:Print("BarQuest", questID, title, iterateObjectives, objectiveText, amountCompleted, objectiveFinished, isComplete) AJM:JambaSendCommandToTeam( AJM.COMMAND_QUEST_WATCH_OBJECTIVE_UPDATE, questID, name, iterateObjectives, objectiveText, amountCompleted, objectiveFinished, isComplete )
AJM:JambaSendCommandToTeam( AJM.COMMAND_QUEST_WATCH_OBJECTIVE_UPDATE, questID, name, iterateObjectives, objectiveText, amountCompleted, objectiveFinished, isComplete )
if AJM.db.sendProgressChatMessages == true then
AJM:JambaSendMessageToTeam( AJM.db.messageArea, objectiveText.." "..amountCompleted, false )
end
end
-- for other bouns quests EG one time world pop up quests that don't have a npc.
else
local amountCompleted, objectiveText = AJM:GetQuestObjectiveCompletion( objectiveFullText )
if (AJM:QuestCacheUpdate( questID, iterateObjectives, amountCompleted, objectiveFinished ) == true) or (useCache == false) then
--AJM:Print("BonusQuest", amountCompleted, objectiveText )
--AJM:Print( "UPDATE:", "cache:", useCache, "QuestID", questID, "ObjectID", iterateObjectives )
--AJM:Print("sendingquestdata", objectiveText, amountCompleted, finished )
local name = gsub(title, "[^|]+:", "Bonus:")
-- send command to team
AJM:JambaSendCommandToTeam( AJM.COMMAND_QUEST_WATCH_OBJECTIVE_UPDATE, questID, name, iterateObjectives, objectiveText, amountCompleted, objectiveFinished, isComplete )
if AJM.db.sendProgressChatMessages == true then
AJM:JambaSendMessageToTeam( AJM.db.messageArea, objectiveText.." "..amountCompleted, false )
end
end
end
end
end
end
end
-- Gathers messages from team.
function AJM:DoQuestWatchObjectiveUpdate( characterName, questID, questName, objectiveIndex, objectiveText, amountCompleted, objectiveFinished, isComplete )
AJM:UpdateQuestWatchList( questID, questName, objectiveIndex, objectiveText, characterName, amountCompleted, objectiveFinished, isComplete )
end
function AJM:UpdateQuestWatchList( questID, questName, objectiveIndex, objectiveText, characterName, amountCompleted, objectiveFinished, isComplete )
--local characterName = (( Ambiguate( name, "none" ) ))
AJM:DebugMessage( "UpdateQuestWatchList", questID, questName, objectiveIndex, objectiveText, characterName, amountCompleted, objectiveFinished, isComplete )
local questHeaderPosition = AJM:GetQuestHeaderInWatchList( questID, questName, characterName )
local objectiveHeaderPosition = AJM:GetObjectiveHeaderInWatchList( questID, questName, objectiveIndex, objectiveText, "", questHeaderPosition )
local characterPosition = AJM:GetCharacterInWatchList( questID, objectiveIndex, characterName, amountCompleted, objectiveHeaderPosition, objectiveFinished )
local totalAmountCompleted = AJM:GetTotalCharacterAmountFromWatchList( questID, objectiveIndex )
--AJM:Print("QuestPosition", objectiveHeaderPosition, questHeaderPosition )
objectiveHeaderPosition = AJM:GetObjectiveHeaderInWatchList( questID, questName, objectiveIndex, objectiveText, totalAmountCompleted, questHeaderPosition )
-- isComplete piggybacks on the quest watch update, so we are always displaying a complete quest button (in case the QUEST_AUTOCOMPLETE event does not fire).
if isComplete == true then
AJM:DoAutoQuestFieldComplete( characterName, questID )
end
if AJM.db.hideQuestIfAllComplete == true then
AJM:CheckQuestForAllObjectivesCompleteAndHide( questID )
end
AJM:QuestWatcherQuestListScrollRefresh()
AJM:SetQuestWatcherVisibility()
end
-------------------------------------------------------------------------------------------------------------
function AJM:RemoveQuestFromWatchList( questID )
AJM:RemoveQuestFromWatcherCache( questID )
AJM:JambaSendCommandToTeam( AJM.COMMAND_QUEST_WATCH_REMOVE_QUEST, questID )
end
function AJM:DoRemoveQuestFromWatchList( characterName, questID )
-- Remove character lines for this character.
for key, questWatchInfoContainer in pairs( AJM.questWatchObjectivesList ) do
local questWatchInfo = questWatchInfoContainer.info
if questWatchInfo.questID == questID and questWatchInfo.character == characterName then
AJM:RemoveQuestWatchInfo( questWatchInfo.key )
end
end
-- See if any character lines left, if none, then remove quest completely.
local found = false
for key, questWatchInfoContainer in pairs( AJM.questWatchObjectivesList ) do
local questWatchInfo = questWatchInfoContainer.info
if questWatchInfo.questID == questID and questWatchInfo.type == "CHARACTER_AMOUNT" then
found = true
end
end
if found == false then
for key, questWatchInfoContainer in pairs( AJM.questWatchObjectivesList ) do
local questWatchInfo = questWatchInfoContainer.info
if questWatchInfo.questID == questID then
AJM:RemoveQuestWatchInfo( questWatchInfo.key )
end
end
else
-- Still some character lines left, update the total amount of objectives to reflect lost team member.
-- Find any remaining quest objective headers.
for key, questWatchInfoContainer in pairs( AJM.questWatchObjectivesList ) do
local questWatchInfo = questWatchInfoContainer.info
if questWatchInfo.questID == questID and questWatchInfo.type == "OBJECTIVE_HEADER" then
questWatchInfo.amount = AJM:GetTotalCharacterAmountFromWatchList( questID, questWatchInfo.objectiveIndex )
-- If all done auto-collapse when complete, collapse objective header.
if (questWatchInfo.amount == L["DONE"]) and (AJM.db.doNotHideCompletedObjectives == true) then
questWatchInfo.childrenAreHidden = true
end
end
if questWatchInfo.questID == questID and questWatchInfo.type == "QUEST_HEADER" then
AJM:UpdateTeamQuestCountRemoveCharacter( questWatchInfo, characterName )
if AJM.db.hideQuestIfAllComplete == true then
AJM:CheckQuestForAllObjectivesCompleteAndHide( questID )
end
end
end
end
-- Remove any auto quest buttons.
AJM:DoRemoveAutoQuestFieldComplete( characterName, questID )
AJM:QuestWatcherQuestListScrollRefresh()
AJM:SetQuestWatcherVisibility()
end
-------------------------------------------------------------------------------------------------------------
-- QUEST WATCH DISPLAY LIST LOGIC
-------------------------------------------------------------------------------------------------------------
--Ebony working here
function AJM:GetTotalCharacterAmountFromWatchList( questID, objectiveIndex )
local amount = 0
local total = 0
local countCharacters = 0
local countDones = 0
for key, questWatchInfoContainer in pairs( AJM.questWatchObjectivesList ) do
local questWatchInfo = questWatchInfoContainer.info
local position = questWatchInfoContainer.position
if questWatchInfo.questID == questID and questWatchInfo.type == "CHARACTER_AMOUNT" and questWatchInfo.objectiveIndex == objectiveIndex then
countCharacters = countCharacters + 1
local amountCompletedText = questWatchInfo.amount
if amountCompletedText == L["DONE"] then
countDones = countDones + 1
end
local arg1, arg2 = string.match(amountCompletedText, "(%d*)/(%d*)")
AJM:DebugMessage( amountCompletedText, arg1, arg2 )
if (arg1 ~= nil) and (arg2 ~= nil) then
if strtrim( arg1 ) ~= "" and strtrim( arg2 ) ~= "" then
amount = amount + tonumber( arg1 )
total = total + tonumber( arg2 )
end
end
end
end
if countCharacters == 0 then
return L["DONE"]
end
local amountOverTotal = string.format( "%s/%s", amount, total )
AJM:DebugMessage( "AMTOT:", amountOverTotal )
if amountOverTotal == "0/0" then
if countDones == countCharacters then
amountOverTotal = L["DONE"]
else
amountOverTotal = "N/A"
end
end
return amountOverTotal
end
function AJM:RemoveQuestsNotBeingWatched()
AJM:UpdateAllQuestsInWatchList()
for checkQuestID, value in pairs( AJM.questWatchListOfQuests ) do
local found = false
for iterateWatchedQuests = 1, GetNumQuestWatches() do
local questIndex = GetQuestIndexForWatch( iterateWatchedQuests )
if questIndex ~= nil then
local title, level, suggestedGroup, isHeader, isCollapsed, isComplete, frequency, questID, startEvent, displayQuestID, isOnMap, hasLocalPOI, isTask, isStory = GetQuestLogTitle( questIndex )
if checkQuestID == questID then
found = true
end
end
end
if found == false then
AJM:RemoveQuestFromWatchList( checkQuestID )
end
end
end
function AJM:UpdateAllQuestsInWatchList()
table.wipe( AJM.questWatchListOfQuests )
for key, questWatchInfoContainer in pairs( AJM.questWatchObjectivesList ) do
-- TODO- whats going on here?
AJM.questWatchListOfQuests[questWatchInfoContainer.info.questID] = true
end
end
function AJM:GetCharacterInWatchList( questID, objectiveIndex, characterName, amountCompleted, objectiveHeaderPosition, objectiveFinished )
local characterPosition = -1
local characterQuestWatchInfo
if objectiveFinished then
if AJM.db.showCompletedObjectivesAsDone == true then
amountCompleted = L["DONE"]
end
end
-- Try and find the character line.
for key, questWatchInfoContainer in pairs( AJM.questWatchObjectivesList ) do
local questWatchInfo = questWatchInfoContainer.info
local position = questWatchInfoContainer.position
if questWatchInfo.questID == questID and questWatchInfo.type == "CHARACTER_AMOUNT" and questWatchInfo.objectiveIndex == objectiveIndex and questWatchInfo.character == characterName then
-- Character line found. Update information.
questWatchInfo.amount = amountCompleted
characterQuestWatchInfo = questWatchInfo
characterPosition = position
break
end
end
-- Was not found, add character line.
if characterPosition == -1 then
-- Only if not completed or user wants to show completed.
if ((objectiveFinished == nil) or (objectiveFinished == false)) or (AJM.db.doNotHideCompletedObjectives == true) then
local questWatchInfo = AJM:CreateQuestWatchInfo( questID, "CHARACTER_AMOUNT", objectiveIndex, characterName, characterName, amountCompleted )
AJM:InsertQuestWatchInfoToListAfterPosition( questWatchInfo, objectiveHeaderPosition )
return objectiveHeaderPosition + 1
end
return -1
else
-- Character line was found. Remove it if objective finished?
if (objectiveFinished) and (AJM.db.doNotHideCompletedObjectives == false) then
AJM:RemoveQuestWatchInfo( characterQuestWatchInfo.key )
return -1
end
end
return -1
end
function AJM:GetObjectiveHeaderInWatchList( questID, questName, objectiveIndex, objectiveText, totalAmountCompleted, questHeaderPosition )
--AJM:Print("testposition", questName, "oT", objectiveText, questHeaderPosition)
if strtrim( objectiveText ) == "" then
objectiveText = questName
end
for key, questWatchInfoContainer in pairs( AJM.questWatchObjectivesList ) do
local questWatchInfo = questWatchInfoContainer.info
local position = questWatchInfoContainer.position
if questWatchInfo.questID == questID and questWatchInfo.type == "OBJECTIVE_HEADER" and questWatchInfo.objectiveIndex == objectiveIndex then
questWatchInfo.information = objectiveText
questWatchInfo.amount = totalAmountCompleted
-- If all done auto-collapse when complete, collapse objective header.
if (questWatchInfo.amount == L["DONE"]) and (AJM.db.doNotHideCompletedObjectives == true) then
questWatchInfo.childrenAreHidden = true
end
return position
end
end
local questWatchInfo = AJM:CreateQuestWatchInfo( questID, "OBJECTIVE_HEADER", objectiveIndex, "", objectiveText, totalAmountCompleted )
-- Hide the team list by default.
questWatchInfo.childrenAreHidden = true
AJM:InsertQuestWatchInfoToListAfterPosition( questWatchInfo, questHeaderPosition )
return questHeaderPosition + 1
end
function AJM:GetQuestHeaderInWatchList( questID, questName, characterName )
for key, questWatchInfoContainer in pairs( AJM.questWatchObjectivesList ) do
local questWatchInfo = questWatchInfoContainer.info
local position = questWatchInfoContainer.position
if questWatchInfo.questID == questID and questWatchInfo.type == "QUEST_HEADER" then
AJM:UpdateTeamQuestCountAddCharacter( questWatchInfo, characterName )
if AJM.db.hideQuestIfAllComplete == true then
AJM:CheckQuestForAllObjectivesCompleteAndHide( questID )
end
return position
end
end
local iconTexture = ("Interface\\ICONS\\INV_Misc_Map07")
local icon = strconcat(" |T"..iconTexture..":18|t")
local questWatchInfo = AJM:CreateQuestWatchInfo( questID, "QUEST_HEADER", -1, "", questName, icon ) --L["<Map>"] )
AJM:UpdateTeamQuestCountAddCharacter( questWatchInfo, characterName )
if AJM.db.hideQuestIfAllComplete == true then
AJM:CheckQuestForAllObjectivesCompleteAndHide( questID )
end
local newPositionAtEnd = AJM:GetQuestWatchMaximumOrder() + 1
AJM:AddQuestWatchInfoToListAtPosition( questWatchInfo, newPositionAtEnd )
return newPositionAtEnd
end
function AJM:UpdateTeamQuestCount( questWatchInfo, characterName )
local count = 0
for character, dummy in pairs( questWatchInfo.teamCharacters ) do
count = count + 1
end
questWatchInfo.questTeamCount = count
end
function AJM:UpdateTeamQuestCountAddCharacter( questWatchInfo, name )
questWatchInfo.teamCharacters[name] = true
AJM:UpdateTeamQuestCount( questWatchInfo, name )
end
function AJM:UpdateTeamQuestCountRemoveCharacter( questWatchInfo, characterName )
questWatchInfo.teamCharacters[characterName] = nil
AJM:UpdateTeamQuestCount( questWatchInfo, characterName )
end
function AJM:CheckQuestForAllObjectivesCompleteAndHide( questID )
if AJM.db.hideQuestIfAllComplete == false then
return
end
-- If all objective headers for quest say "DONE" then hide quest if hideQuestIfAllComplete option set.
local allDone = true
for key, questWatchInfoContainer in pairs( AJM.questWatchObjectivesList ) do
local questWatchInfo = questWatchInfoContainer.info
if questWatchInfo.questID == questID and questWatchInfo.type == "OBJECTIVE_HEADER" then
if questWatchInfo.amount ~= L["DONE"] then
allDone = false
end
end
end
-- Set quest header hidden or not as appropriate.
for key, questWatchInfoContainer in pairs( AJM.questWatchObjectivesList ) do
local questWatchInfo = questWatchInfoContainer.info
if questWatchInfo.questID == questID and questWatchInfo.type == "QUEST_HEADER" then
questWatchInfo.childrenAreHidden = allDone
end
end
end
-------------------------------------------------------------------------------------------------------------
-- QUEST WATCH INFO FUNCTIONS
-------------------------------------------------------------------------------------------------------------
function AJM:CreateQuestWatchInfo( questID, type, objectiveIndex, character, information, amount )
local questWatchInfo = {}
questWatchInfo.key = questID..type..objectiveIndex..character
questWatchInfo.questID = questID
questWatchInfo.type = type
questWatchInfo.objectiveIndex = objectiveIndex
questWatchInfo.character = character
questWatchInfo.information = information
questWatchInfo.amount = amount
questWatchInfo.childrenAreHidden = false
questWatchInfo.questTeamCount = 0
questWatchInfo.teamCharacters = {}
return questWatchInfo
end
function AJM:AddQuestWatchInfoToListAtPosition( questWatchInfo, position )
AJM.questWatchObjectivesList[questWatchInfo.key] = {}
AJM.questWatchObjectivesList[questWatchInfo.key].position = position
AJM.questWatchObjectivesList[questWatchInfo.key].info = questWatchInfo
end
function AJM:InsertQuestWatchInfoToListAfterPosition( questWatchInfo, position )
for key, questWatchInfoContainer in pairs( AJM.questWatchObjectivesList ) do
local questWatchInfo = questWatchInfoContainer.info
local checkPosition = questWatchInfoContainer.position
if checkPosition > position then
questWatchInfoContainer.position = checkPosition + 1
end
end
AJM:AddQuestWatchInfoToListAtPosition( questWatchInfo, position + 1 )
end
function AJM:RemoveQuestWatchInfo( key )
local removedPosition = AJM.questWatchObjectivesList[key].position
for checkKey, questWatchInfoContainer in pairs( AJM.questWatchObjectivesList ) do
local checkPosition = questWatchInfoContainer.position
if checkPosition > removedPosition then
questWatchInfoContainer.position = checkPosition - 1
end
end
AJM.questWatchObjectivesList[key].info.key = nil
AJM.questWatchObjectivesList[key].info.questID = nil
AJM.questWatchObjectivesList[key].info.type = nil
AJM.questWatchObjectivesList[key].info.objectiveIndex = nil
AJM.questWatchObjectivesList[key].info.character = nil
AJM.questWatchObjectivesList[key].info.information = nil
AJM.questWatchObjectivesList[key].info.amount = nil
AJM.questWatchObjectivesList[key].info.childrenAreHidden = nil
AJM.questWatchObjectivesList[key].info.questTeamCount = nil
table.wipe( AJM.questWatchObjectivesList[key].info.teamCharacters )
table.wipe( AJM.questWatchObjectivesList[key].info )
AJM.questWatchObjectivesList[key].info = nil
AJM.questWatchObjectivesList[key].position = nil
table.wipe( AJM.questWatchObjectivesList[key] )
AJM.questWatchObjectivesList[key] = nil
end
-- Get the largest order number from the quest watch list.
function AJM:GetQuestWatchMaximumOrder()
local largestPosition = 0
for key, questWatchInfoContainer in pairs( AJM.questWatchObjectivesList ) do
local questWatchInfo = questWatchInfoContainer.info
local position = questWatchInfoContainer.position
if position > largestPosition then
largestPosition = position
end
end
return largestPosition
end
function AJM:GetQuestWatchInfoFromKey( key )
local questWatchInfo = AJM.questWatchObjectivesList[key].info
return questWatchInfo.information, questWatchInfo.amount, questWatchInfo.type, questWatchInfo.questID, questWatchInfo.childrenAreHidden, key
end
-- Get the quest watch info at a specific position.
function AJM:GetQuestWatchInfoAtOrderPosition( position )
local information = ""
local amount = ""
local type = ""
local questID = ""
local childrenAreHidden = ""
local key = ""
local questTeamCount = ""
local objectiveIndex = ""
for keyStored, questWatchInfoContainer in pairs( AJM.questWatchObjectivesList ) do
local questWatchInfo = questWatchInfoContainer.info
local questWatchPosition = questWatchInfoContainer.position
if questWatchPosition == position then
information = questWatchInfo.information
amount = questWatchInfo.amount
type = questWatchInfo.type
questID = questWatchInfo.questID
childrenAreHidden = questWatchInfo.childrenAreHidden
key = keyStored
questTeamCount = questWatchInfo.questTeamCount
objectiveIndex = questWatchInfo.objectiveIndex
break
end
end
return information, amount, type, questID, childrenAreHidden, key, questTeamCount, objectiveIndex
end
function AJM:ToggleChildrenAreHiddenQuestWatchInfoByKey( key )
local questWatchInfo = AJM.questWatchObjectivesList[key].info
questWatchInfo.childrenAreHidden = not questWatchInfo.childrenAreHidden
end
function AJM:CountLinesInQuestWatchList()
if AJM.questWatchObjectivesList == nil then
return 1
end
local count = 1
for key, questWatchInfoContainer in pairs( AJM.questWatchObjectivesList ) do
count = count + 1
end
return count
end
-------------------------------------------------------------------------------------------------------------
-- QUEST WATCH DISPLAY LIST MECHANICS
-------------------------------------------------------------------------------------------------------------
function AJM:QuestWatcherQuestListDrawLine( frame, iterateDisplayRows, type, information, amount, childrenAreHidden, key, questTeamCount )
local toggleDisplay = ""
local padding = ""
local teamCount = ""
local textFont = AJM.SharedMedia:Fetch( "font", AJM.db.watchFontStyle )
local textSize = AJM.db.watchFontSize
if type == "CHARACTER_AMOUNT" then
padding = " "
end
if type == "OBJECTIVE_HEADER" then
padding = " "
if childrenAreHidden == true then
toggleDisplay = "+ "
else
toggleDisplay = "- "
end
end
if type == "QUEST_HEADER" then
if questTeamCount ~= 0 then
--teamCount = " ("..questTeamCount.."/"..JambaApi.GetTeamListMaximumOrder()..") "
--Ebony Only Show online character info
teamCount = " ("..questTeamCount.."/"..JambaApi.GetTeamListMaximumOrderOnline()..") "
end
end
local matchDataScenario = string.find( information, "Scenario:" )
local matchDataScenarioBouns = string.find( information, "ScenarioBouns:" )
-- Scenario
if matchDataScenario then
local name = gsub(information, "[^|]+:", "")
frame.questWatchList.rows[iterateDisplayRows].columns[1].textString:SetText( padding..toggleDisplay..name )
frame.questWatchList.rows[iterateDisplayRows].columns[2].textString:SetText( amount )
frame.questWatchList.rows[iterateDisplayRows].columns[1].textString:SetFont( textFont , textSize , "OUTLINE")
frame.questWatchList.rows[iterateDisplayRows].columns[2].textString:SetFont( textFont , textSize , "OUTLINE")
-- Turn off the mouse for these buttons.
frame.questWatchList.rows[iterateDisplayRows].columns[1]:EnableMouse( false )
frame.questWatchList.rows[iterateDisplayRows].columns[2]:EnableMouse( false )
-- Scenario Bouns
elseif matchDataScenarioBouns then
local name = gsub(information, "[^|]+:", "")
frame.questWatchList.rows[iterateDisplayRows].columns[1].textString:SetText( padding..toggleDisplay..name )
frame.questWatchList.rows[iterateDisplayRows].columns[2].textString:SetText( amount )
frame.questWatchList.rows[iterateDisplayRows].columns[1].textString:SetFont( textFont , textSize , "OUTLINE")
frame.questWatchList.rows[iterateDisplayRows].columns[2].textString:SetFont( textFont , textSize , "OUTLINE")
-- Turn off the mouse for these buttons.
frame.questWatchList.rows[iterateDisplayRows].columns[1]:EnableMouse( false )
frame.questWatchList.rows[iterateDisplayRows].columns[2]:EnableMouse( false )
else
frame.questWatchList.rows[iterateDisplayRows].columns[1].textString:SetText( padding..toggleDisplay..teamCount..information )
frame.questWatchList.rows[iterateDisplayRows].columns[2].textString:SetText( amount )
frame.questWatchList.rows[iterateDisplayRows].columns[1].textString:SetFont( textFont , textSize , "OUTLINE")
frame.questWatchList.rows[iterateDisplayRows].columns[2].textString:SetFont( textFont , textSize , "OUTLINE")
-- Turn off the mouse for these buttons.
frame.questWatchList.rows[iterateDisplayRows].columns[1]:EnableMouse( false )
frame.questWatchList.rows[iterateDisplayRows].columns[2]:EnableMouse( false )
end
--AJM:Print("test2343", type, information )
if type == "QUEST_HEADER" then
local matchData = string.find( information, "Bonus:" )
local matchDataScenario = string.find( information, "Scenario:" )
local matchDataScenarioBouns = string.find( information, "ScenarioBouns:" )
if matchData then
-- Bonus Quests
--AJM:Print("Match", information)
frame.questWatchList.rows[iterateDisplayRows].columns[1].textString:SetTextColor( 1.0, 0, 0, 1.0 )
frame.questWatchList.rows[iterateDisplayRows].columns[2].textString:SetTextColor( 1.0, 0, 0, 1.0 )
-- Turn on the mouse for these buttons.
frame.questWatchList.rows[iterateDisplayRows].columns[1]:EnableMouse( true )
frame.questWatchList.rows[iterateDisplayRows].columns[2]:EnableMouse( true )
-- Scenario Text
--AJM:Print("Match", information)
elseif matchDataScenario then
frame.questWatchList.rows[iterateDisplayRows].columns[1].textString:SetTextColor( 1.0, 0, 1.0, 1.0 )
frame.questWatchList.rows[iterateDisplayRows].columns[2].textString:SetTextColor( 1.0, 0, 1.0, 1.0 )
-- Turn on the mouse for these buttons.
frame.questWatchList.rows[iterateDisplayRows].columns[1]:EnableMouse( true )
frame.questWatchList.rows[iterateDisplayRows].columns[2]:EnableMouse( true )
--frame.questWatchList.rowHeight = 60
elseif matchDataScenarioBouns then
frame.questWatchList.rows[iterateDisplayRows].columns[1].textString:SetTextColor( 0, 0.30, 1.0, 1.0 )
frame.questWatchList.rows[iterateDisplayRows].columns[2].textString:SetTextColor( 0, 0.30, 1.0, 1.0 )
-- Turn on the mouse for these buttons.
frame.questWatchList.rows[iterateDisplayRows].columns[1]:EnableMouse( true )
frame.questWatchList.rows[iterateDisplayRows].columns[2]:EnableMouse( true )
else
frame.questWatchList.rows[iterateDisplayRows].columns[1].textString:SetTextColor( 1.0, 0.96, 0.41, 1.0 )
frame.questWatchList.rows[iterateDisplayRows].columns[2].textString:SetTextColor( 1.0, 0.96, 0.41, 1.0 )
-- Turn on the mouse for these buttons.
frame.questWatchList.rows[iterateDisplayRows].columns[1]:EnableMouse( true )
frame.questWatchList.rows[iterateDisplayRows].columns[2]:EnableMouse( true )
end
end
if type == "OBJECTIVE_HEADER" then
--AJM:Print("Match", information)
local matchData = string.find( information, "ProgressBar" )
if matchData then
--AJM:Print("Match", information)
frame.questWatchList.rows[iterateDisplayRows].columns[1].textString:SetTextColor( 1.0, 0.50, 0.50, 1.0 )
frame.questWatchList.rows[iterateDisplayRows].columns[2].textString:SetTextColor( 1.0, 0.50, 0.50, 1.0 )
-- Turn on the mouse for these buttons.
frame.questWatchList.rows[iterateDisplayRows].columns[1]:EnableMouse( true )
else
frame.questWatchList.rows[iterateDisplayRows].columns[1].textString:SetTextColor( NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b, 1.0 )
frame.questWatchList.rows[iterateDisplayRows].columns[2].textString:SetTextColor( NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b, 1.0 )
-- Turn on the mouse for these buttons.
frame.questWatchList.rows[iterateDisplayRows].columns[1]:EnableMouse( true )
end
end
frame.questWatchList.rows[iterateDisplayRows].key = key
end
function AJM:QuestWatcherQuestListScrollRefresh()
local frame = JambaQuestWatcherFrame
FauxScrollFrame_Update(
frame.questWatchList.listScrollFrame,
AJM:GetQuestWatchMaximumOrder(),
frame.questWatchList.rowsToDisplay,
frame.questWatchList.rowHeight
)
frame.questWatchListOffset = FauxScrollFrame_GetOffset( frame.questWatchList.listScrollFrame )
frame.dataRowOffset = 0
local atLeastOneRowShowing = false
for iterateDisplayRows = 1, frame.questWatchList.rowsToDisplay do
-- Reset.
frame.questWatchList.rows[iterateDisplayRows].key = ""
frame.questWatchList.rows[iterateDisplayRows].columns[1].textString:SetText( "" )
frame.questWatchList.rows[iterateDisplayRows].columns[2].textString:SetText( "" )
frame.questWatchList.rows[iterateDisplayRows].columns[1].textString:SetTextColor( 1.0, 1.0, 1.0, 1.0 )
frame.questWatchList.rows[iterateDisplayRows].columns[2].textString:SetTextColor( 1.0, 1.0, 1.0, 1.0 )
frame.questWatchList.rows[iterateDisplayRows].highlight:SetTexture( 0.0, 0.0, 0.0, 0.0 )
-- Get data.
local dataRowNumber = iterateDisplayRows + frame.questWatchListOffset + frame.dataRowOffset
local foundDataRow = false
local finishedRows = false
while (foundDataRow == false) and (finishedRows == false) do
dataRowNumber = iterateDisplayRows + frame.questWatchListOffset + frame.dataRowOffset
if dataRowNumber > AJM:GetQuestWatchMaximumOrder() then
finishedRows = true
else
local information, amount, type, questID, childrenAreHidden, key, questTeamCount, objectiveIndex = AJM:GetQuestWatchInfoAtOrderPosition( dataRowNumber )
foundDataRow = true
if type == "QUEST_HEADER" then
-- In this case, children are hidden refers to itself as well.
if childrenAreHidden == true then
foundDataRow = false
frame.dataRowOffset = frame.dataRowOffset + 1
end
end
if type == "OBJECTIVE_HEADER" then
local hideMe = false
for key, questWatchInfoContainer in pairs( AJM.questWatchObjectivesList ) do
local questWatchInfo = questWatchInfoContainer.info
if questWatchInfo.questID == questID and questWatchInfo.type == "QUEST_HEADER" then
hideMe = questWatchInfo.childrenAreHidden
break
end
end
if hideMe == true then
foundDataRow = false
frame.dataRowOffset = frame.dataRowOffset + 1
end
end
-- If this is a character_amount type, find its parent objective header and see if its children are hidden.
if type == "CHARACTER_AMOUNT" then
local hideMe = false
for key, questWatchInfoContainer in pairs( AJM.questWatchObjectivesList ) do
local questWatchInfo = questWatchInfoContainer.info
if questWatchInfo.questID == questID and questWatchInfo.type == "OBJECTIVE_HEADER" and questWatchInfo.objectiveIndex == objectiveIndex then
hideMe = questWatchInfo.childrenAreHidden
break
end
end
if hideMe == true then
foundDataRow = false
frame.dataRowOffset = frame.dataRowOffset + 1
end
end
end
end
if finishedRows == false and foundDataRow == true then
-- Put information and amount into columns.
local information, amount, type, questID, childrenAreHidden, key, questTeamCount, objectiveIndex = AJM:GetQuestWatchInfoAtOrderPosition( dataRowNumber )
AJM:QuestWatcherQuestListDrawLine( frame, iterateDisplayRows, type, information, amount, childrenAreHidden, key, questTeamCount )
atLeastOneRowShowing = true
end
end
-- Adjust the scroll frame based on hidden rows.
if atLeastOneRowShowing == true then
FauxScrollFrame_Update(
frame.questWatchList.listScrollFrame,
AJM:GetQuestWatchMaximumOrder() - frame.dataRowOffset,
frame.questWatchList.rowsToDisplay,
frame.questWatchList.rowHeight
)
end
AJM:DisplayAutoQuestPopUps()
end
function AJM:QuestWatcherQuestListRowClick( rowNumber, columnNumber )
AJM:DebugMessage( "QuestWatcherQuestListRowClick", rowNumber, columnNumber )
local frame = JambaQuestWatcherFrame
local key = frame.questWatchList.rows[rowNumber].key
if key ~= nil and key ~= "" then
local information, amount, type, questID, childrenAreHidden, keyStored = AJM:GetQuestWatchInfoFromKey( key )
AJM:DebugMessage( "GetQuestWatchInfoFromKey", information, amount, type, questID, childrenAreHidden, keyStored, key )
if type == "QUEST_HEADER" then
if columnNumber == 2 then
QuestMapFrame_OpenToQuestDetails( questID )
end
if columnNumber == 1 then
local questIndex = AJM:GetQuestLogIndexByName( information )
AJM:DebugMessage( "Open Quest:", questIndex, information )
if questIndex ~= 0 then
QuestLogPopupDetailFrame_Show( questIndex )
end
end
end
if type == "OBJECTIVE_HEADER" then
if columnNumber == 1 then
AJM:ToggleChildrenAreHiddenQuestWatchInfoByKey( key )
AJM:QuestWatcherQuestListScrollRefresh()
end
end
end
end
-------------------------------------------------------------------------------------------------------------
-- QUEST WATCH AUTO QUEST DISPLAY - MOSTLY BORROWED FROM BLIZZARD CODE
-------------------------------------------------------------------------------------------------------------
function AJM:HasAtLeastOneAutoQuestPopup()
if #AJM.currentAutoQuestPopups == 0 then
return false
end
return true
end
function AJM:JambaAddAutoQuestPopUp( questID, popUpType, characterName )
if AJM.currentAutoQuestPopups[questID] == nil then
AJM.currentAutoQuestPopups[questID] = {}
end
AJM.currentAutoQuestPopups[questID][characterName] = popUpType
end
function AJM:JambaRemoveAutoQuestPopUp( questID, characterName )
if AJM.currentAutoQuestPopups[questID] == nil then
return
end
AJM.currentAutoQuestPopups[questID][characterName] = nil
if #AJM.currentAutoQuestPopups[questID] == 0 then
table.wipe( AJM.currentAutoQuestPopups[questID] )
AJM.currentAutoQuestPopups[questID] = nil
end
end
function AJM:JambaRemoveAllAutoQuestPopUps( questID )
if AJM.currentAutoQuestPopups[questID] == nil then
return
end
table.wipe( AJM.currentAutoQuestPopups[questID] )
AJM.currentAutoQuestPopups[questID] = nil
end
function AJM:AutoQuestGetOrCreateFrame( parent, index )
if _G["JambaWatchFrameAutoQuestPopUp"..index] then
return _G["JambaWatchFrameAutoQuestPopUp"..index]
end
local frame = CreateFrame( "SCROLLFRAME", "JambaWatchFrameAutoQuestPopUp"..index, parent )
frame.index = index
frame:EnableMouse( true )
local QuestName = frame:CreateFontString( "JambaWatchFrameAutoQuestPopUpQuestName"..index, "OVERLAY", "GameFontNormal" )
QuestName:SetPoint( "TOP", frame, "TOP", 0, -12 )
QuestName:SetTextColor( 1.00, 1.00, 1.00 )
QuestName:SetText( "" )
frame.QuestName = QuestName
local TopText = frame:CreateFontString( "JambaWatchFrameAutoQuestPopUpTopText"..index, "OVERLAY", "GameFontNormal" )
TopText:SetPoint( "TOP", frame, "TOP", 0, -24 )
TopText:SetTextColor( 1.00, 1.00, 1.00 )
TopText:SetText( "" )
frame.TopText = TopText
local BottomText = frame:CreateFontString( "JambaWatchFrameAutoQuestPopUpBottomText"..index, "OVERLAY", "GameFontNormal" )
BottomText:SetPoint( "TOP", frame, "TOP", 0, -36 )
BottomText:SetTextColor( 1.00, 1.00, 1.00 )
BottomText:SetText( "BottomText" )
frame.BottomText = BottomText
AJM.countAutoQuestPopUpFrames = AJM.countAutoQuestPopUpFrames + 1
return frame
end
function AJM:DisplayAutoQuestPopUps()
local nextAnchor
local countPopUps = 0
local iterateQuestPopups = 01
JambaQuestWatcherFrame.autoQuestPopupsHeight = 0
local parentFrame = JambaQuestWatcherFrame.fieldNotifications
for questID, characterInfo in pairs( AJM.currentAutoQuestPopups ) do
local characterName, characterPopUpType, popUpType
local characterList = ""
for characterName, characterPopUpType in pairs( characterInfo ) do
--characterList = characterList..characterName.." "
characterList = characterList..( Ambiguate( characterName, "none" ) ).." "
-- TODO - hack, assuming all characters have the same sort of popup.
popUpType = characterPopUpType
end
local title, level, suggestedGroup, isHeader, isCollapsed, isComplete, frequency, questID, startEvent, displayQuestID, isOnMap, hasLocalPOI, isTask, isStory = GetQuestLogTitle( GetQuestLogIndexByID( questID ) )
if isComplete and isComplete > 0 then
isComplete = true
else
isComplete = false
end
-- If the current character does not have the quest, show the character names that do have it.
local clickToViewText = QUEST_WATCH_POPUP_CLICK_TO_VIEW
if not (title and title ~= "") then
title = characterList
clickToViewText = ""
end
local frame = AJM:AutoQuestGetOrCreateFrame( parentFrame, countPopUps + 1 )
frame:Show()
frame:ClearAllPoints()
frame:SetParent( parentFrame )
if isComplete == true and popUpType == "COMPLETE" then
frame.TopText:SetText( QUEST_WATCH_POPUP_CLICK_TO_COMPLETE )
frame.BottomText:Hide()
frame:SetHeight( 32 )
frame.type = "COMPLETED"
frame:HookScript( "OnMouseUp", function()
ShowQuestComplete( GetQuestLogIndexByID( questID ) )
AJM:JambaRemoveAllAutoQuestPopUps( questID )
AJM:DisplayAutoQuestPopUps()
AJM:SettingsUpdateBorderStyle()
AJM:SettingsUpdateFontStyle()
end )
elseif popUpType == "OFFER" then
frame.TopText:SetText( QUEST_WATCH_POPUP_QUEST_DISCOVERED )
frame.BottomText:Show()
frame.BottomText:SetText( clickToViewText )
frame:SetHeight( 48 )
frame.type = "OFFER"
frame:HookScript( "OnMouseUp", function()
AJM:JambaRemoveAllAutoQuestPopUps( questID )
AJM:DisplayAutoQuestPopUps()
AJM:SettingsUpdateBorderStyle()
AJM:SettingsUpdateFontStyle()
end )
end
frame:ClearAllPoints()
if nextAnchor ~= nil then
if iterateQuestPopups == 1 then
frame:SetPoint( "TOP", nextAnchor, "BOTTOM", 0, 0 ) -- -WATCHFRAME_TYPE_OFFSET
else
frame:SetPoint( "TOP", nextAnchor, "BOTTOM", 0, 0 )
end
else
frame:SetPoint( "TOP", parentFrame, "TOP", 0, 5 ) -- -WATCHFRAME_INITIAL_OFFSET
end
frame:SetPoint( "LEFT", parentFrame, "LEFT", -20, 0 )
frame.QuestName:SetText( title )
frame.questId = questID
--frame:UpdateScrollChildRect()
--frame:SetVerticalScroll( floor( -9 + 0.5 ) )
nextAnchor = frame
countPopUps = countPopUps + 1
JambaQuestWatcherFrame.autoQuestPopupsHeight = JambaQuestWatcherFrame.autoQuestPopupsHeight + frame:GetHeight()
end
for iterateQuestPopups = countPopUps + 1, AJM.countAutoQuestPopUpFrames do
_G["JambaWatchFrameAutoQuestPopUp"..iterateQuestPopups].questId = nil
_G["JambaWatchFrameAutoQuestPopUp"..iterateQuestPopups]:Hide()
end
AJM:UpdateQuestWatcherDimensions()
end
-------------------------------------------------------------------------------------------------------------
-- QUEST WATCH HELPERS
-------------------------------------------------------------------------------------------------------------
function AJM:GetQuestLogIndexByName( questName )
for iterateQuests = 1, GetNumQuestLogEntries() do
local title, level, suggestedGroup, isHeader, isCollapsed, isComplete, frequency, questID, startEvent, displayQuestID, isOnMap, hasLocalPOI, isTask, isStory = GetQuestLogTitle( iterateQuests )
if not isHeader then
if title == questName then
return iterateQuests
end
end
end
return 0
end
function AJM:GetQuestLogIndexByID( inQuestID )
for iterateQuests = 1, GetNumQuestLogEntries() do
local title, level, suggestedGroup, isHeader, isCollapsed, isComplete, frequency, questID, startEvent, displayQuestID, isOnMap, hasLocalPOI, isTask, isStory = GetQuestLogTitle( iterateQuests )
if not isHeader then
if questID == inQuestID then
return iterateQuests
end
end
end
return 0
end
-------------------------------------------------------------------------------------------------------------
-- COMMAND MANAGEMENT
-------------------------------------------------------------------------------------------------------------
-- A Jamba command has been recieved.
function AJM:JambaOnCommandReceived( characterName, commandName, ... )
--if characterName ~= AJM.characterName then
if commandName == AJM.COMMAND_QUEST_WATCH_OBJECTIVE_UPDATE then
AJM:DoQuestWatchObjectiveUpdate( characterName, ... )
end
if commandName == AJM.COMMAND_UPDATE_QUEST_WATCHER_LIST then
AJM:DoQuestWatchListUpdate( characterName, ... )
end
if commandName == AJM.COMMAND_QUEST_WATCH_REMOVE_QUEST then
AJM:DoRemoveQuestFromWatchList( characterName, ... )
end
if commandName == AJM.COMMAND_AUTO_QUEST_COMPLETE then
AJM:DoAutoQuestFieldComplete( characterName, ... )
end
if commandName == AJM.COMMAND_REMOVE_AUTO_QUEST_COMPLETE then
AJM:DoRemoveAutoQuestFieldComplete( characterName, ... )
end
if commandName == AJM.COMMAND_AUTO_QUEST_OFFER then
AJM:DoAutoQuestFieldOffer( characterName, ... )
end
--end
end
JambaApi.ClearAllQuests = ClearAllQuests |
local STool = {}
CatmullRomCams.SToolMethods.MapIOEditor = STool
function STool.LeftClick(self, trace)
if not self:ValidTrace(trace) then return end
local dur = self:GetClientNumber("duration") or 2
trace.Entity:SetNWFloat("Duration", (dur > 0.001) and dur or 0.001)
return true
end
function STool.RightClick(self, trace)
if not self:ValidTrace(trace) then return end
local dur = trace.Entity:GetNWFloat("Duration") or 2
self:GetOwner():ConCommand("catmullrom_camera_duration_duration " .. ((dur > 0.001) and dur or 0.001) .. "\n")
return true
end
function STool.Reload(self, trace)
if not self:ValidTrace(trace) then return end
trace.Entity.MapIOData ={}
return true
end
function STool.Think(self)
if SERVER then return end
local ply = LocalPlayer()
local trace = ply:GetEyeTrace()
if not self:ValidTrace(trace) then return end
if not trace.Entity.MapIOData then return end
local msg = "OnUser1: " .. (trace.Entity.MapIOData.User1 and "ACTIVE" or "INACTIVE") .. "\n" .. "OnUser2: " .. (trace.Entity.MapIOData.User2 and "ACTIVE" or "INACTIVE") .. "\n" .. "OnUser3: " .. (trace.Entity.MapIOData.User3 and "ACTIVE" or "INACTIVE") .. "\n" .. "OnUser4: " .. (trace.Entity.MapIOData.User4 and "ACTIVE" or "INACTIVE")
AddWorldTip(trace.Entity:EntIndex(), msg, 0.5, trace.Entity:GetPos(), trace.Entity )
end
function STool.BuildCPanel(panel)
panel:AddControl("CheckBox", {Label = "OnUser1", Command = "catmullrom_camera_map_io_user1"})
panel:AddControl("CheckBox", {Label = "OnUser2", Command = "catmullrom_camera_map_io_user2"})
panel:AddControl("CheckBox", {Label = "OnUser3", Command = "catmullrom_camera_map_io_user3"})
panel:AddControl("CheckBox", {Label = "OnUser4", Command = "catmullrom_camera_map_io_user4"})
end |
--------------------------------
-- @module ParticleData
-- @parent_module cc
--------------------------------
--
-- @function [parent=#ParticleData] release
-- @param self
-- @return ParticleData#ParticleData self (return value: cc.ParticleData)
--------------------------------
--
-- @function [parent=#ParticleData] getMaxCount
-- @param self
-- @return unsigned int#unsigned int ret (return value: unsigned int)
--------------------------------
--
-- @function [parent=#ParticleData] init
-- @param self
-- @param #int count
-- @return bool#bool ret (return value: bool)
--------------------------------
--
-- @function [parent=#ParticleData] copyParticle
-- @param self
-- @param #int p1
-- @param #int p2
-- @return ParticleData#ParticleData self (return value: cc.ParticleData)
--------------------------------
--
-- @function [parent=#ParticleData] ParticleData
-- @param self
-- @return ParticleData#ParticleData self (return value: cc.ParticleData)
return nil
|
--- Eva game module
-- Contains basic game functions
-- Like exit, reboot, open url etc
-- time_policy:
-- - local - just socket.gettime
-- - local_uptime - try to protect time with uptime
-- - server - use server time
-- @submodule eva
local log = require("eva.log")
local app = require("eva.app")
local const = require("eva.const")
local gui_extra_functions = require("gui_extra_functions.gui_extra_functions")
local time_string = require("eva.libs.time_string")
local proto = require("eva.modules.proto")
local sound = require("eva.modules.sound")
local saver = require("eva.modules.saver")
local events = require("eva.modules.events")
local device = require("eva.modules.device")
local logger = log.get_logger("eva.game")
local M = {}
-- How to update the game time. See module description
local TIME_LOCAL = "local"
local TIME_LOCAL_UPTIME = "local_uptime"
local TIME_SERVER = "server"
local function sync_time()
local settings = app.settings.game
local game_save = app[const.EVA.GAME]
if settings.time_policy == TIME_LOCAL_UPTIME then
local current_uptime = socket.gettime()
if uptime then
current_uptime = uptime.get()
end
if current_uptime < game_save.last_uptime or game_save.last_uptime == 0 then
game_save.last_diff_time = socket.gettime() - current_uptime
local prev_uptime = game_save.last_uptime
game_save.last_uptime = current_uptime
logger:debug("Sync time with uptime", {
time = game_save.last_uptime,
diff = game_save.last_diff_time,
prev_time = prev_uptime
})
end
app.game_data.current_time = current_uptime + game_save.last_diff_time
end
end
local function select_url(url_ios, url_android)
local android_id = sys.get_config("android.package") or ""
local ios_id = sys.get_config("ios.id") or ""
local is_ios = device.is_ios()
local url_source = "game"
local market_url = is_ios and url_ios or url_android
return string.format(market_url, is_ios and ios_id or android_id, url_source)
end
local function check_session()
local game = app[const.EVA.GAME]
local current_time = M.get_time()
if current_time - game.last_play_timepoint >= app.settings.game.session_time then
game.session_start_time = current_time
events.event(const.EVENT.NEW_SESSION)
end
local current_date = M.get_current_date_code()
if game.last_play_date ~= current_date then
game.last_play_date = current_date
events.event(const.EVENT.NEW_DAY)
end
end
local function on_window_event(self, event, data)
-- events.event(const.EVENT.WINDOW_EVENT, { event = event, data = data })
if event == window.WINDOW_EVENT_FOCUS_GAINED then
sync_time()
check_session()
events.event(const.EVENT.GAME_FOCUS)
end
end
--- Open store page in store application
-- @function eva.game.open_store_page
function M.open_store_page()
local market_url = select_url(const.STORE_URL.IOS_MARKET, const.STORE_URL.ANDROID_MARKET)
local success = sys.open_url(market_url)
if not success then
local direct_url = select_url(const.STORE_URL.IOS_MARKET, const.STORE_URL.ANDROID_URL)
sys.open_url(direct_url)
end
end
--- Reboot the game
-- @function eva.game.reboot
-- @tparam number delay Delay before reboot, in seconds
function M.reboot(delay, arg1, arg2)
delay = delay or 0
sound.stop_all()
timer.delay(delay, false, function()
msg.post("@system:", "reboot", { arg1 = arg1, arg2 = arg2 })
end)
end
--- Exit from the game
-- @function eva.game.exit
-- @tparam int code The exit code
function M.exit(code)
code = code or 0
msg.post("@system:", "exit", { code = code })
end
--- Check game on debug mode
-- @function eva.game.is_debug
function M.is_debug()
if app.game_data then
return app.game_data.is_debug
end
return sys.get_engine_info().is_debug
end
--- Get game time
-- @function eva.game.get_time
-- @treturn number Return game time in seconds
function M.get_time()
local settings = app.settings.game
if settings.time_policy == TIME_LOCAL then
return socket.gettime()
end
if settings.time_policy == TIME_LOCAL_UPTIME then
return app.game_data.current_time
end
logger:error("Unknown game time_policy type", { policy = settings.time_policy })
return socket.gettime()
end
--- Return unique id for local session
-- @function eva.game.get_session_uid
-- @treturn number Unique id in this game session
function M.get_session_uid()
app.game_data.last_uid = app.game_data.last_uid + 1
return app.game_data.last_uid
end
--- Return unique id for player profile
-- @function eva.game.get_uid
-- @treturn number Unique id in player profile
function M.get_uid()
app[const.EVA.GAME].game_uid = app[const.EVA.GAME].game_uid + 1
return app[const.EVA.GAME].game_uid
end
--- Get current time in string format
-- @function eva.game.get_current_time_string
-- @treturn string Time format in iso e.g. "2019-09-25T01:48:19Z"
function M.get_current_time_string(time)
return time_string.get_ISO(time or M.get_time())
end
--- Get current date in format: YYYYMMDD
-- @function ev.game.get_current_day_string
-- @treturn number Current day in format YYYYMMDD
function M.get_current_date_code(date)
date = date or os.date("*t", M.get_time())
return date.year * 10000 + date.month * 100 + date.day
end
--- Get days since first game launch
-- @function eva.game.get_days_played
-- @treturn number Days since first game launch
function M.get_days_played()
local first_time = app[const.EVA.GAME].first_start_time
local play_time = M.get_time() - first_time
return math.floor(play_time / (60 * 60 * 24))
end
--- Return true, if game launched first time
-- @function eva.game.is_first_launch
-- @treturn bool True, if game first time launch
function M.is_first_launch()
return app[const.EVA.GAME].game_start_count == 1
end
function M.on_eva_init()
math.randomseed(os.time())
math.random()
app.game_data = {
last_uid = 0,
current_time = 0,
is_debug = sys.get_engine_info().is_debug
}
if device.is_mobile() then
-- TODO: Make custom Dimming timing for specific time?
window.set_dim_mode(window.DIMMING_OFF)
end
gui_extra_functions.init()
app[const.EVA.GAME] = proto.get(const.EVA.GAME)
saver.add_save_part(const.EVA.GAME, app[const.EVA.GAME])
sync_time()
end
function M.after_eva_init()
local settings = app.settings.game
local game = app[const.EVA.GAME]
game.game_start_count = game.game_start_count + 1
table.insert(game.game_start_dates, M.get_current_time_string())
while #game.game_start_dates > settings.game_started_max_count_stats do
table.remove(game.game_start_dates, 1)
end
if game.first_start_time == 0 then
game.first_start_time = M.get_time()
end
if game.last_play_date == 0 then
game.last_play_date = M.get_current_date_code()
end
check_session()
window.set_listener(on_window_event)
end
function M.on_eva_update(dt)
app.game_data.current_time = app.game_data.current_time + dt
app[const.EVA.GAME].played_time = app[const.EVA.GAME].played_time + dt
app[const.EVA.GAME].last_play_timepoint = M.get_time()
check_session()
end
return M
|
-- cdcview.lua
class "CDCView"(QFrame)
function CDCView:__init(vid,pid)
QFrame.__init(self)
self.windowTitle = tr("CDC View")
self.btnRefresh = QPushButton(tr("Refresh"))
self.portList = QComboBox()
self.baudList = QComboBox{ minW = 80, QSerialPort.ValidBaudRate(), editable = true }
self.baudList.lineEdit.inputMask = "00000000"
self.btnOpen = QPushButton(tr("Open"))
self.btnSend = QPushButton(tr("Send"))
self.btnClear = QPushButton(tr("Clear"))
self.sendEdit = QHexEdit{ readonly = false, overwriteMode = false}
self.recvEdit = QHexEdit { readonly = true, overwriteMode = false }
self.serial = QSerialPort(self)
self.serial.flowControl = QSerialPort.FLOW_OFF
self.baudList.currentIndex = self.serial.baudRate
self.layout = QVBoxLayout{
QHBoxLayout{ self.portList, self.btnRefresh, QLabel(tr("BaudRate:")), self.baudList, self.btnOpen, strech = "1,0,0,0",},
QHBoxLayout{QLabel(tr("Send data")), self.btnSend,QLabel(), strech = "0,0,1"},
self.sendEdit,
QHBoxLayout{QLabel(tr("Recv data")), self.btnClear,QLabel(), strech = "0,0,1"},
self.recvEdit,
}
self.btnRefresh.clicked = function()
self.portList:clear()
local ports = QSerialPort.enumPort()
for i,v in ipairs(ports) do
self.portList:addItem(v.portName, v)
end
end
self.baudList.editTextChanged = function(text)
local idx = self.baudList:findText(text)
if idx > 0 and idx < QSerialPort.BAUDLAST then
self.serial:setBaudRate(idx)
else
local bd = tonumber(text)
if bd then
self.serial:setBaudRate(bd)
end
end
end
self.btnOpen.clicked = function ()
if self.serial.isOpen then
self.serial:close()
self.btnOpen.text = tr("Open")
else
i = self.portList.currentIndex
portInfo = self.portList:itemData(i)
local name = portInfo.portName
if name then
logEdit:append("open: " .. name .. " with setting: " .. self.serial.settingString)
self.serial.portName = name
res = self.serial:open()
if res then
self.btnOpen.text = tr("Close")
logEdit:append("Success ...")
else
logEdit:append("Fail: " .. self.serial.errorString)
end
end
end
end
self.btnSend.clicked = function()
local r = self.serial:write(self.sendEdit.data)
end
self.btnClear.clicked = function()
self.recvEdit:clear()
end
self.serial.readyRead = function()
local r = self.serial:readAll()
self.recvEdit:append(r)
self.recvEdit:scrollToEnd()
end
self.btnRefresh.clicked()
end |
ESX = nil
if Config.UseESX then
Citizen.CreateThread(function()
while ESX == nil do
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
Citizen.Wait(10)
end
end)
end
RegisterNetEvent("delall")
AddEventHandler("delall", function ()
if Config.alerts then
TriggerEvent('chat:addMessage', {
template = '<div style="padding: 0.5vw; margin: 0.5vw; background-color: rgba(202, 45, 45, 1); border-radius: 3px;"><i class="fas fa-car-crash"></i> {0}:<br> {1}</div>',
args = { 'CarWipe', 'A car wipe is coming in 5 minutes. If you don\'t want your car to disappear, sit in it' }
})
Citizen.Wait(60000)
TriggerEvent('chat:addMessage', {
template = '<div style="padding: 0.5vw; margin: 0.5vw; background-color: rgba(202, 45, 45, 1); border-radius: 3px;"><i class="fas fa-car-crash"></i> {0}:<br> {1}</div>',
args = { 'CarWipe', 'A car wipe is coming in 4 minutes. If you don\'t want your car to disappear, sit in it' }
})
Citizen.Wait(60000)
TriggerEvent('chat:addMessage', {
template = '<div style="padding: 0.5vw; margin: 0.5vw; background-color: rgba(202, 45, 45, 1); border-radius: 3px;"><i class="fas fa-car-crash"></i> {0}:<br> {1}</div>',
args = { 'CarWipe', 'A car wipe is coming in 3 minutes. If you don\'t want your car to disappear, sit in it' }
})
Citizen.Wait(60000)
TriggerEvent('chat:addMessage', {
template = '<div style="padding: 0.5vw; margin: 0.5vw; background-color: rgba(202, 45, 45, 1); border-radius: 3px;"><i class="fas fa-car-crash"></i> {0}:<br> {1}</div>',
args = { 'CarWipe', 'A car wipe is coming in 2 minutes. If you don\'t want your car to disappear, sit in it' }
})
Citizen.Wait(60000)
TriggerEvent('chat:addMessage', {
template = '<div style="padding: 0.5vw; margin: 0.5vw; background-color: rgba(202, 45, 45, 1); border-radius: 3px;"><i class="fas fa-car-crash"></i> {0}:<br> {1}</div>',
args = { 'CarWipe', 'A car wipe is coming in 1 minute. If you don\'t want your car to disappear, sit in it' }
})
Citizen.Wait(15000)
TriggerEvent('chat:addMessage', {
template = '<div style="padding: 0.5vw; margin: 0.5vw; background-color: rgba(202, 45, 45, 1); border-radius: 3px;"><i class="fas fa-car-crash"></i> {0}:<br> {1}</div>',
args = { 'CarWipe', 'A car wipe is coming in 45 seconds. If you don\'t want your car to disappear, sit in it' }
})
Citizen.Wait(15000)
TriggerEvent('chat:addMessage', {
template = '<div style="padding: 0.5vw; margin: 0.5vw; background-color: rgba(202, 45, 45, 1); border-radius: 3px;"><i class="fas fa-car-crash"></i> {0}:<br> {1}</div>',
args = { 'CarWipe', 'A car wipe is coming in 30 seconds. If you don\'t want your car to disappear, sit in it' }
})
Citizen.Wait(15000)
TriggerEvent('chat:addMessage', {
template = '<div style="padding: 0.5vw; margin: 0.5vw; background-color: rgba(202, 45, 45, 1); border-radius: 3px;"><i class="fas fa-car-crash"></i> {0}:<br> {1}</div>',
args = { 'CarWipe', 'A car wipe is coming in 15 seconds. If you don\'t want your car to disappear, sit in it' }
})
Citizen.Wait(5000)
TriggerEvent('chat:addMessage', {
template = '<div style="padding: 0.5vw; margin: 0.5vw; background-color: rgba(202, 45, 45, 1); border-radius: 3px;"><i class="fas fa-car-crash"></i> {0}:<br> {1}</div>',
args = { 'CarWipe', 'A car wipe is coming in 10 seconds. If you don\'t want your car to disappear, sit in it' }
})
Citizen.Wait(1000)
TriggerEvent('chat:addMessage', {
template = '<div style="padding: 0.5vw; margin: 0.5vw; background-color: rgba(202, 45, 45, 1); border-radius: 3px;"><i class="fas fa-car-crash"></i> {0}:<br> {1}</div>',
args = { 'CarWipe', 'A car wipe is coming in 9 seconds. If you don\'t want your car to disappear, sit in it' }
})
Citizen.Wait(1000)
TriggerEvent('chat:addMessage', {
template = '<div style="padding: 0.5vw; margin: 0.5vw; background-color: rgba(202, 45, 45, 1); border-radius: 3px;"><i class="fas fa-car-crash"></i> {0}:<br> {1}</div>',
args = { 'CarWipe', 'A car wipe is coming in 8 seconds. If you don\'t want your car to disappear, sit in it' }
})
Citizen.Wait(1000)
TriggerEvent('chat:addMessage', {
template = '<div style="padding: 0.5vw; margin: 0.5vw; background-color: rgba(202, 45, 45, 1); border-radius: 3px;"><i class="fas fa-car-crash"></i> {0}:<br> {1}</div>',
args = { 'CarWipe', 'A car wipe is coming in 7 seconds. If you don\'t want your car to disappear, sit in it' }
})
Citizen.Wait(1000)
TriggerEvent('chat:addMessage', {
template = '<div style="padding: 0.5vw; margin: 0.5vw; background-color: rgba(202, 45, 45, 1); border-radius: 3px;"><i class="fas fa-car-crash"></i> {0}:<br> {1}</div>',
args = { 'CarWipe', 'A car wipe is coming in 6 seconds. If you don\'t want your car to disappear, sit in it' }
})
Citizen.Wait(1000)
TriggerEvent('chat:addMessage', {
template = '<div style="padding: 0.5vw; margin: 0.5vw; background-color: rgba(202, 45, 45, 1); border-radius: 3px;"><i class="fas fa-car-crash"></i> {0}:<br> {1}</div>',
args = { 'CarWipe', 'A car wipe is coming in 5 seconds. If you don\'t want your car to disappear, sit in it' }
})
Citizen.Wait(1000)
TriggerEvent('chat:addMessage', {
template = '<div style="padding: 0.5vw; margin: 0.5vw; background-color: rgba(202, 45, 45, 1); border-radius: 3px;"><i class="fas fa-car-crash"></i> {0}:<br> {1}</div>',
args = { 'CarWipe', 'A car wipe is coming in 4 seconds. If you don\'t want your car to disappear, sit in it' }
})
Citizen.Wait(1000)
TriggerEvent('chat:addMessage', {
template = '<div style="padding: 0.5vw; margin: 0.5vw; background-color: rgba(202, 45, 45, 1); border-radius: 3px;"><i class="fas fa-car-crash"></i> {0}:<br> {1}</div>',
args = { 'CarWipe', 'A car wipe is coming in 3 seconds. If you don\'t want your car to disappear, sit in it' }
})
Citizen.Wait(1000)
TriggerEvent('chat:addMessage', {
template = '<div style="padding: 0.5vw; margin: 0.5vw; background-color: rgba(202, 45, 45, 1); border-radius: 3px;"><i class="fas fa-car-crash"></i> {0}:<br> {1}</div>',
args = { 'CarWipe', 'A car wipe is coming in 2 seconds. If you don\'t want your car to disappear, sit in it' }
})
Citizen.Wait(1000)
TriggerEvent('chat:addMessage', {
template = '<div style="padding: 0.5vw; margin: 0.5vw; background-color: rgba(202, 45, 45, 1); border-radius: 3px;"><i class="fas fa-car-crash"></i> {0}:<br> {1}</div>',
args = { 'CarWipe', 'A car wipe is coming in 1 second. If you don\'t want your car to disappear, sit in it' }
})
end
Citizen.Wait(1000)
for vehicle in EnumerateVehicles() do
if (not IsPedAPlayer(GetPedInVehicleSeat(vehicle, -1))) then
if Config.OnlyWipeBroken == true then
if GetVehicleEngineHealth(vehicle) <= 100.0 then
SetVehicleHasBeenOwnedByPlayer(vehicle, false)
SetEntityAsMissionEntity(vehicle, false, false)
DeleteVehicle(vehicle)
if Config.UseESX then
ESX.Game.DeleteVehicle(vehicle)
end
DeleteEntity(vehicle)
DeleteVehicle(vehicle)
if Config.UseESX then
ESX.Game.DeleteVehicle(vehicle)
end
DeleteEntity(vehicle)
if (DoesEntityExist(vehicle)) then
DeleteVehicle(vehicle)
if Config.UseESX then
ESX.Game.DeleteVehicle(vehicle)
end
DeleteEntity(vehicle)
DeleteVehicle(vehicle)
if Config.UseESX then
ESX.Game.DeleteVehicle(vehicle)
end
DeleteEntity(vehicle)
end
end
else
SetVehicleHasBeenOwnedByPlayer(vehicle, false)
SetEntityAsMissionEntity(vehicle, false, false)
DeleteVehicle(vehicle)
if Config.UseESX then
ESX.Game.DeleteVehicle(vehicle)
end
DeleteEntity(vehicle)
DeleteVehicle(vehicle)
if Config.UseESX then
ESX.Game.DeleteVehicle(vehicle)
end
DeleteEntity(vehicle)
if (DoesEntityExist(vehicle)) then
DeleteVehicle(vehicle)
if Config.UseESX then
ESX.Game.DeleteVehicle(vehicle)
end
DeleteEntity(vehicle)
DeleteVehicle(vehicle)
if Config.UseESX then
ESX.Game.DeleteVehicle(vehicle)
end
DeleteEntity(vehicle)
end
end
if Config.use10msdelay then
Citizen.Wait(10)
end
end
end
if Config.DoneNotify then
TriggerEvent('chat:addMessage', {
template = '<div style="padding: 0.5vw; margin: 0.5vw; background-color: rgba(202, 45, 45, 1); border-radius: 3px;"><i class="fas fa-car-crash"></i> {0}:<br> {1}</div>',
args = { 'CarWipe', 'Carwipe completed. you can leave your vehicle again (if you were in it)!' }
})
end
end)
|
#!/usr/bin/env lua
--- Tests on bundleTemplate.lua.
local lu = require("luaunit")
-- Cache global arguments value, set argument to make call to dofile run properly, then restore global context.
-- NOTE: This expects the tests/results directory to exist before being called.
local originalArguments = _G.arg
_G.arg = {"example/template.json", "tests/results/output.json"}
dofile("src/du-bundler.lua")
_G.arg = originalArguments
_G.TestBundleTemplate = {}
function _G.TestBundleTemplate.testGetUsedHandlerKeys()
local bundler = _G.BundleTemplate:new()
local json, expected, actual
-- single entry
json =
[[
{"code":"pressedCount = pressedCount + 1","filter":{"args":[],"signature":"pressed()","slotKey":"0"},"key":"1"}
]]
expected = {}
expected["1"] = true
actual = bundler.getUsedHandlerKeys(json)
lu.assertEquals(actual, expected)
-- 6 sequential entries
json =
[[
{"code":"pressedCount = pressedCount + 1","filter":{"args":[],"signature":"pressed()","slotKey":"0"},"key":"0"},
{"code":"pressedCount = pressedCount + 1","filter":{"args":[],"signature":"pressed()","slotKey":"0"},"key":"1"},
{"code":"releasedCnt = releasedCnt + 1","filter":{"args":[],"signature":"released()","slotKey":"0"},"key":"2"},
{"code":"releasedCnt = releasedCnt + 1","filter":{"args":[],"signature":"released()","slotKey":"0"},"key":"3"},
{"code":"assert","filter":{"args":[],"signature":"start()","slotKey":"-1"},"key":"4"},
{"code":"assert(slot1.getState() == 0)","filter":{"args":[],"signature":"stop()","slotKey":"-1"},"key":"5"}
]]
expected = {}
expected["0"] = true
expected["1"] = true
expected["2"] = true
expected["3"] = true
expected["4"] = true
expected["5"] = true
actual = bundler.getUsedHandlerKeys(json)
lu.assertEquals(actual, expected)
-- 5 non-sequential entries
json =
[[
{"code":"pressedCount = pressedCount + 1","filter":{"args":[],"signature":"pressed()","slotKey":"0"},"key":"0"},
{"code":"pressedCount = pressedCount + 1","filter":{"args":[],"signature":"pressed()","slotKey":"0"},"key":"1"},
{"code":"releasedCnt = releasedCnt + 1","filter":{"args":[],"signature":"released()","slotKey":"0"},"key":"2"},
{"code":"releasedCnt = releasedCnt + 1","filter":{"args":[],"signature":"released()","slotKey":"0"},"key":"3"},
{"code":"assert(slot1.getState() == 0)","filter":{"args":[],"signature":"stop()","slotKey":"-1"},"key":"5"}
]]
expected = {}
expected["0"] = true
expected["1"] = true
expected["2"] = true
expected["3"] = true
expected["5"] = true
actual = bundler.getUsedHandlerKeys(json)
lu.assertEquals(actual, expected)
end
function _G.TestBundleTemplate.testGetNextHandlerKey()
local bundler = _G.BundleTemplate:new()
local expectedKey, actualKey, expectedList
-- no entries
bundler.usedKeys = {}
expectedKey, expectedList = "0", {}
expectedList["0"] = true
actualKey = bundler:getNextHandlerKey()
lu.assertEquals(actualKey, expectedKey)
lu.assertEquals(bundler.usedKeys, expectedList)
-- conflicting entries
bundler.usedKeys = {}
bundler.usedKeys["0"] = true
expectedKey, expectedList = "1", {}
expectedList["0"] = true
expectedList["1"] = true
actualKey = bundler:getNextHandlerKey()
lu.assertEquals(actualKey, expectedKey)
lu.assertEquals(bundler.usedKeys, expectedList)
-- non-conflicting entries
bundler.usedKeys = {}
bundler.usedKeys["1"] = true
expectedKey, expectedList = "0", {}
expectedList["0"] = true
expectedList["1"] = true
actualKey = bundler:getNextHandlerKey()
lu.assertEquals(actualKey, expectedKey)
lu.assertEquals(bundler.usedKeys, expectedList)
end
function _G.TestBundleTemplate.testGetTagReplacementKey()
local bundler
local json, tag, expected, actual
tag = "key"
-- simplest possible case
bundler = _G.BundleTemplate:new()
json = [[${key}]]
expected = "0"
actual = bundler:getTagReplacement(json, tag)
lu.assertEquals(actual, expected)
-- full line
bundler = _G.BundleTemplate:new()
json = [[{"code":"code","filter":{"args":[],"signature":"pressed()","slotKey":"${slotKey:slot1}"},"key":"${key}"}]]
expected = "0"
actual = bundler:getTagReplacement(json, tag)
lu.assertEquals(actual, expected)
-- multiple lines, multiple calls
bundler = _G.BundleTemplate:new()
json =
[[
{"code":"code","filter":{"args":[],"signature":"pressed()","slotKey":"${slotKey:slot1}"},"key":"${key}"}
{"code":"code","filter":{"args":[],"signature":"pressed()","slotKey":"${slotKey:slot1}"},"key":"${key}"}
]]
expected = "0"
actual = bundler:getTagReplacement(json, tag)
lu.assertEquals(actual, expected)
json =
[[
{"code":"code","filter":{"args":[],"signature":"pressed()","slotKey":"${slotKey:slot1}"},"key":"0"}
{"code":"code","filter":{"args":[],"signature":"pressed()","slotKey":"${slotKey:slot1}"},"key":"${key}"}
]]
expected = "1"
actual = bundler:getTagReplacement(json, tag)
lu.assertEquals(actual, expected)
-- existing key on first call
bundler = _G.BundleTemplate:new()
json =
[[
{"code":"code","filter":{"args":[],"signature":"pressed()","slotKey":"${slotKey:slot1}"},"key":"0"}
{"code":"code","filter":{"args":[],"signature":"pressed()","slotKey":"${slotKey:slot1}"},"key":"${key}"}
]]
expected = "1"
actual = bundler:getTagReplacement(json, tag)
lu.assertEquals(actual, expected)
-- verify capitalization is ignored
tag = "Key"
bundler = _G.BundleTemplate:new()
json = [[${key}]]
expected = "0"
actual = bundler:getTagReplacement(json, tag)
lu.assertEquals(actual, expected)
end
function _G.TestBundleTemplate.testMapSlotValues()
local bundler = _G.BundleTemplate:new()
local json, expected, actual
-- default list, cover numbered slots and special slots
json =
[[
"8":{"name":"slot9","type":{"events":[],"methods":[]}},
"9":{"name":"slot10","type":{"events":[],"methods":[]}},
"-1":{"name":"unit","type":{"events":[],"methods":[]}},
]]
expected = {slot9 = "8", slot10 = "9", unit = "-1"}
bundler:mapSlotValues(json)
actual = bundler.slotNameNumberMap
lu.assertEquals(actual, expected)
-- customized list, cover numbered slots (including spaces and underscores) and special slots
json =
[[
"3":{"name":"al__li_alloy","type":{"events":[],"methods":[]}},
"8":{"name":"the core","type":{"events":[],"methods":[]}},
"9":{"name":"container","type":{"events":[],"methods":[]}},
"-1":{"name":"unit","type":{"events":[],"methods":[]}},
]]
expected = {al__li_alloy = "3", container = "9", unit = "-1"}
expected["the core"] = "8"
bundler:mapSlotValues(json)
actual = bundler.slotNameNumberMap
lu.assertEquals(actual, expected)
end
function _G.TestBundleTemplate.testGetTagReplacementSlot()
local bundler
local json, tag, expected, actual
-- create lookup table and verify it's used
bundler = _G.BundleTemplate:new()
tag = "slotKey:slot8"
json =
[[
"7":{"name":"slot8","type":{"events":[],"methods":[]}},
"8":{"name":"the core","type":{"events":[],"methods":[]}},
"9":{"name":"container","type":{"events":[],"methods":[]}},
"-1":{"name":"unit","type":{"events":[],"methods":[]}},
]]
expected = "7"
actual = bundler:getTagReplacement(json, tag)
lu.assertEquals(actual, expected)
-- verify uses cached slot names - can't look up again
tag = "slotkey:unit"
json = ""
expected = "-1"
actual = bundler:getTagReplacement(json, tag)
lu.assertEquals(actual, expected)
-- verify tag parser handles spaces within argument while ignoring spaces around colon
bundler = _G.BundleTemplate:new()
tag = "slotkey : the core"
json =
[[
"7":{"name":"slot8","type":{"events":[],"methods":[]}},
"8":{"name":"the core","type":{"events":[],"methods":[]}},
"9":{"name":"container","type":{"events":[],"methods":[]}},
"-1":{"name":"unit","type":{"events":[],"methods":[]}},
]]
expected = "8"
actual = bundler:getTagReplacement(json, tag)
lu.assertEquals(actual, expected)
-- useful error thrown on missing slot mapping
bundler = _G.BundleTemplate:new()
tag = "slotKey:slot8"
json = [[
"-1":{"name":"unit","type":{"events":[],"methods":[]}},
]]
lu.assertErrorMsgContains("slot8", bundler.getTagReplacement, bundler, json, tag)
end
function _G.TestBundleTemplate.testBuildArgs()
local bundler = _G.BundleTemplate:new()
local expected, actual
expected = '{"variable":"*"}'
actual = bundler.buildArgs("*")
lu.assertEquals(actual, expected)
expected = '{"value":"STOPPED"}'
actual = bundler.buildArgs("STOPPED")
lu.assertEquals(actual, expected)
expected = '{"variable":"*"},{"variable":"*"}'
actual = bundler.buildArgs("* *")
lu.assertEquals(actual, expected)
-- verify comma works for separator
expected = '{"variable":"*"},{"variable":"*"}'
actual = bundler.buildArgs("*,*")
lu.assertEquals(actual, expected)
-- verify comma + space works for separator
expected = '{"variable":"*"},{"variable":"*"}'
actual = bundler.buildArgs("*, *")
lu.assertEquals(actual, expected)
expected = '{"value":"channel"},{"variable":"*"}'
actual = bundler.buildArgs("channel *")
lu.assertEquals(actual, expected)
expected = '{"value":"channel"},{"value":"message"}'
actual = bundler.buildArgs("channel message")
lu.assertEquals(actual, expected)
end
function _G.TestBundleTemplate.testGetTagReplacementArgs()
local bundler
local json, tag, expected, actual
-- no args needed
bundler = _G.BundleTemplate:new()
tag = "args"
json = [[{"code":"code","filter":{"args":[${args}],"signature":"pressed()","slotKey":"${slotKey:s1}"},"key":"0"}]]
expected = ""
actual = bundler:getTagReplacement(json, tag)
lu.assertEquals(actual, expected)
-- single wildcard argument
bundler = _G.BundleTemplate:new()
tag = "args:*"
json = [[{"code":"code","filter":{"args":[${args:*}],"signature":"pressed()","slotKey":"${slotKey:s1}"},"key":"0"}]]
expected = '{"variable":"*"}'
actual = bundler:getTagReplacement(json, tag)
lu.assertEquals(actual, expected)
-- single value argument
bundler = _G.BundleTemplate:new()
tag = "args:variableName"
json = [[{"code":"code","filter":{"args":[${args:*}],"signature":"pressed()","slotKey":"${slotKey:s1}"},"key":"0"}]]
expected = '{"value":"variableName"}'
actual = bundler:getTagReplacement(json, tag)
lu.assertEquals(actual, expected)
-- single value argument with capitalized tag to ensure variable name isn't lowercased during parsing
bundler = _G.BundleTemplate:new()
tag = "ARGS:variableName"
json = [[{"code":"code","filter":{"args":[${args:*}],"signature":"pressed()","slotKey":"${slotKey:s1}"},"key":"0"}]]
expected = '{"value":"variableName"}'
actual = bundler:getTagReplacement(json, tag)
lu.assertEquals(actual, expected)
-- multiple arguments
bundler = _G.BundleTemplate:new()
tag = "args: channel message"
json = [[{"code":"","filter":{"args":[${args: channel message}],"signature":"pressed()","slotKey":"0"},"key":"0"}]]
expected = '{"value":"channel"},{"value":"message"}'
actual = bundler:getTagReplacement(json, tag)
lu.assertEquals(actual, expected)
-- multiple arguments, mixed types
bundler = _G.BundleTemplate:new()
tag = "args: channel *"
json = [[{"code":"code","filter":{"args":[${args: channel *}],"signature":"pressed()","slotKey":"0"},"key":"0"}]]
expected = '{"value":"channel"},{"variable":"*"}'
actual = bundler:getTagReplacement(json, tag)
lu.assertEquals(actual, expected)
end
--- Verify code is properly sanitized.
function _G.TestBundleTemplate.testSanitizeCode()
local bundler = _G.BundleTemplate:new()
local code, expected, actual
-- no change
code = "local var = 7"
expected = code
actual = bundler.sanitizeCode(code)
lu.assertEquals(actual, expected)
-- escape backslash
code = "local var = '\\'"
expected = "local var = '\\\\'"
actual = bundler.sanitizeCode(code)
lu.assertEquals(actual, expected)
-- escape quotes
code = 'local var = "string"'
expected = 'local var = \\"string\\"'
actual = bundler.sanitizeCode(code)
lu.assertEquals(actual, expected)
-- escape newline
code = [[
local var = 7
system.print(var)]]
expected = "local var = 7\\nsystem.print(var)"
actual = bundler.sanitizeCode(code)
lu.assertEquals(actual, expected)
end
--- Verify markup minifier removes characters appropriately.
function _G.TestBundleTemplate.testMinifyMarkup()
local bundler = _G.BundleTemplate:new()
local markup, expected, actual
-- trailing space before tag closing
markup = [[<line x1="0" y1="108" x2="1920" y2="108" />]]
expected = [[<line x1="0" y1="108" x2="1920" y2="108"/>]]
actual = bundler.minifyMarkup(markup)
lu.assertEquals(actual, expected)
markup = [[<g id="panel" >]]
expected = [[<g id="panel">]]
actual = bundler.minifyMarkup(markup)
lu.assertEquals(actual, expected)
-- whitespace/newlines between tags
markup = [[<line x1="0" y1="0" x2="1920" y2="0"/>
<line x1="0" y1="108" x2="1920" y2="108"/>]]
expected = [[<line x1="0" y1="0" x2="1920" y2="0"/><line x1="0" y1="108" x2="1920" y2="108"/>]]
actual = bundler.minifyMarkup(markup)
lu.assertEquals(actual, expected)
-- embedded style element
markup = [[style="font-style : normal ; fill : #bbbbbb ; "]]
expected = [[style="font-style:normal;fill:#bbbbbb;"]]
actual = bundler.minifyMarkup(markup)
lu.assertEquals(actual, expected)
-- comment
markup = [[<div><!-- comment block --></div>]]
expected = [[<div></div>]]
actual = bundler.minifyMarkup(markup)
lu.assertEquals(actual, expected)
-- comment isn't too greedy
markup = [[<div><!-- comment block -->text<!-- comment block --></div>]]
expected = [[<div>text</div>]]
actual = bundler.minifyMarkup(markup)
lu.assertEquals(actual, expected)
end
--- Verify css minifier removes characters appropriately.
function _G.TestBundleTemplate.testMinifyCss()
local bundler = _G.BundleTemplate:new()
local css, expected, actual
-- whitespace/newlines between elements
css = [[text {
text-transform:none;
font-family:helvetica;
font-weight:normal;
}]]
expected = [[text{text-transform:none;font-family:helvetica;font-weight:normal;}]]
actual = bundler.minifyCss(css)
lu.assertEquals(actual, expected)
-- whitespace around colons
css = [[text{text-transform : none;font-family : helvetica;font-weight : normal;}]]
expected = [[text{text-transform:none;font-family:helvetica;font-weight:normal;}]]
actual = bundler.minifyCss(css)
lu.assertEquals(actual, expected)
-- whitespace before brace
css = [[text {text-transform:none;font-family:helvetica;font-weight:normal;}]]
expected = [[text{text-transform:none;font-family:helvetica;font-weight:normal;}]]
actual = bundler.minifyCss(css)
lu.assertEquals(actual, expected)
-- whitespace around tags
css = [[
text {text-transform:none;}
.widgetBackground {opacity:0.1;}
]]
expected = [[text{text-transform:none;}.widgetBackground{opacity:0.1;}]]
actual = bundler.minifyCss(css)
lu.assertEquals(actual, expected)
end
function _G.TestBundleTemplate.testGetTagReplacementFile()
local bundler
local json, tag, expected, actual
-- simple file
bundler = _G.BundleTemplate:new("example/template.json")
tag = "file:slot1.pressed1.lua"
json = '{"code":"${file:slot1.pressed1.lua}","filter":{"args":[],"signature":"pressed()","slotKey":"0"},"key":"0"}'
expected =
"pressedCount = pressedCount + 1\\nassert(slot1.getState() == 1) -- toggles before calling handlers\\n" ..
"assert(pressedCount == 1) -- should only ever be called once, when the user presses the button"
actual = bundler:getTagReplacement(json, tag)
lu.assertEquals(actual, expected)
-- non-minified svg
bundler = _G.BundleTemplate:new("example/template.json")
tag = "file:image.svg"
json = '{"code":"${file:image.svg}","filter":{"args":[],"signature":"pressed()","slotKey":"0"},"key":"0"}'
expected =
'<svg xmlns=\\"http://www.w3.org/2000/svg\\" version=\\"1.1\\" viewBox=\\"0 0 3200 3200\\" >\\n' ..
' <text id=\\"label\\" y=\\"3600\\" x=\\"100\\" style=\\"font-size:800px;\\" >Text</text>\\n' .. "</svg>"
actual = bundler:getTagReplacement(json, tag)
lu.assertEquals(actual, expected)
-- minified svg
bundler = _G.BundleTemplate:new("example/template.json")
tag = "file:image.svg minify"
json = '{"code":"${file:image.svg minify}","filter":{"args":[],"signature":"pressed()","slotKey":"0"},"key":"0"}'
expected =
'<svg xmlns=\\"http://www.w3.org/2000/svg\\" version=\\"1.1\\" viewBox=\\"0 0 3200 3200\\">' ..
'<text id=\\"label\\" y=\\"3600\\" x=\\"100\\" style=\\"font-size:800px;\\">Text</text>' .. "</svg>"
actual = bundler:getTagReplacement(json, tag)
lu.assertEquals(actual, expected)
-- non-minified css
bundler = _G.BundleTemplate:new("example/template.json")
tag = "file:style.css"
json = '{"code":"${file:style.css}","filter":{"args":[],"signature":"pressed()","slotKey":"0"},"key":"0"}'
expected =
"\\ntext {\\n text-transform: none;\\n font-family: helvetica;\\n font-weight: normal;\\n}" ..
"\\n.widgetBackground {\\n opacity: 0.1;\\n fill: #222222;\\n}\\n"
actual = bundler:getTagReplacement(json, tag)
lu.assertEquals(actual, expected)
-- minified css
bundler = _G.BundleTemplate:new("example/template.json")
tag = "file:style.css minify"
json = '{"code":"${file:style.css minify}","filter":{"args":[],"signature":"pressed()","slotKey":"0"},"key":"0"}'
expected =
"text{text-transform:none;font-family:helvetica;font-weight:normal;}" ..
".widgetBackground{opacity:0.1;fill:#222222;}"
actual = bundler:getTagReplacement(json, tag)
lu.assertEquals(actual, expected)
end
function _G.TestBundleTemplate.testFindSlotName()
local bundler = _G.BundleTemplate:new()
local json, expected, actual
-- basic case: has mapping for number
expected = "slot1"
bundler.slotNumberNameMap = {}
bundler.slotNumberNameMap["0"] = "slot1"
json = [[{"code":"${slotname}","filter":{"args":[],"signature":"start()","slotKey":"0"},"key":"${key}"}]]
actual = bundler:findSlotName(json)
lu.assertEquals(actual, expected)
-- verify tag is case insensitive
expected = "slot1"
bundler.slotNumberNameMap = {}
bundler.slotNumberNameMap["0"] = "slot1"
json = [[{"code":"${slotName}","filter":{"args":[],"signature":"start()","slotKey":"0"},"key":"${key}"}]]
actual = bundler:getTagReplacement(json, "slotName")
lu.assertEquals(actual, expected)
-- basic case: has mapping for negative number
expected = "unit"
bundler.slotNumberNameMap = {}
bundler.slotNumberNameMap["-1"] = "unit"
json = [[{"code":"${slotname}","filter":{"args":[],"signature":"start()","slotKey":"-1"},"key":"${key}"}]]
actual = bundler:findSlotName(json)
lu.assertEquals(actual, expected)
-- simple case: has a slotkey tag with the name in it
expected = "slot1"
bundler.slotNumberNameMap = {}
json = [[{"code":"${slotname}","filter":{"args":[],"signature":"start()","slotKey":"${slotkey:slot1}"},"key":"0"}]]
actual = bundler:findSlotName(json)
lu.assertEquals(actual, expected)
-- has a capitalized SlotKey tag with a case-sensitive name in it
expected = "Slot1"
bundler.slotNumberNameMap = {}
json = [[{"code":"${slotname}","filter":{"args":[],"signature":"start()","slotKey":"${SlotKey:Slot1}"},"key":"0"}]]
actual = bundler:findSlotName(json)
lu.assertEquals(actual, expected)
-- has a capitalized SlotKey tag with a case-sensitive name in it with spaces
expected = "Slot1"
bundler.slotNumberNameMap = {}
json =
[[
{"code":"${slotname}","filter":{"args":[],"signature":"start()","slotKey":"${SlotKey : Slot1}"},"key":"0"}]]
actual = bundler:findSlotName(json)
lu.assertEquals(actual, expected)
-- two handlers, has a slotkey tag with the name in it
expected = "slot1"
bundler.slotNumberNameMap = {}
json =
[[
{"code":"pressedCount = pressedCount + 1","filter":{"args":[],"signature":"pressed()","slotKey":"0"},"key":"0"},
{"code":"${slotname}","filter":{"args":[],"signature":"start()","slotKey":"${slotkey:slot1}"},"key":"0"}
]]
actual = bundler:findSlotName(json)
lu.assertEquals(actual, expected)
-- slot name not found
bundler.slotNumberNameMap = {}
json = [[{"code":"${slotname}","filter":{"args":[],"signature":"start()","slotKey":"0"},"key":"${key}"}]]
-- check for slot key
lu.assertErrorMsgContains("0", bundler.findSlotName, bundler, json)
end
function _G.TestBundleTemplate.testConstructor()
local bundler, expected
-- path with filename
expected = "example/template.json"
bundler = _G.BundleTemplate:new(expected)
lu.assertEquals(bundler.template, expected)
lu.assertEquals(bundler.path, "example/")
-- path with simple filename
expected = "./template.json"
bundler = _G.BundleTemplate:new(expected)
lu.assertEquals(bundler.template, expected)
lu.assertEquals(bundler.path, "./")
-- filename without path - template in current working directory
expected = "template.json"
bundler = _G.BundleTemplate:new(expected)
lu.assertEquals(bundler.template, expected)
lu.assertEquals(bundler.path, "./")
end
--- Verify various special characters are handled in tag and replace text.
function _G.TestBundleTemplate.testReplaceTag()
local bundler = _G.BundleTemplate:new()
local json, replaceText, expectedTag, actualTag, expectedResult, actualResult
-- replace tag handling with mock that returns a specific string
bundler.getTagReplacement = function(_, _, tag)
actualTag = tag
return replaceText
end
-- % in replace text
json = "${file:test}"
expectedTag = "file:test"
replaceText = "this has a % in it"
expectedResult = replaceText
actualResult = bundler:replaceTag(json)
lu.assertEquals(actualTag, expectedTag)
lu.assertEquals(actualResult, expectedResult)
-- - in file name
json = "${file:test-stuff}"
expectedTag = "file:test-stuff"
replaceText = "code goes here"
expectedResult = replaceText
actualResult = bundler:replaceTag(json)
lu.assertEquals(actualTag, expectedTag)
lu.assertEquals(actualResult, expectedResult)
-- * in replace text
json = "${args:*}"
expectedTag = "args:*"
replaceText = '{"variable":"*"}'
expectedResult = replaceText
actualResult = bundler:replaceTag(json)
lu.assertEquals(actualTag, expectedTag)
lu.assertEquals(actualResult, expectedResult)
end
--- Verify code replacement works properly.
function _G.TestBundleTemplate.testTagCode()
local bundler = _G.BundleTemplate:new()
local json, actual, expected
-- no changes to sanitize code
json = [[${code: local test = 1}]]
expected = [[local test = 1]]
actual = bundler:replaceTag(json)
lu.assertEquals(actual, expected)
-- minimal changes: escape quotes
json = [[${code: system.print("hello world")}]]
expected = [[system.print(\"hello world\")]]
actual = bundler:replaceTag(json)
lu.assertEquals(actual, expected)
-- multi-line code
json = [[${code:
-- slot assignments
slots.databank = slot1
slots.databank2 = slot10
}]]
expected = [[-- slot assignments\nslots.databank = slot1\nslots.databank2 = slot10\n]]
actual = bundler:replaceTag(json)
lu.assertEquals(actual, expected)
-- colon in code block
json = [[${code:_G.agController:updateState()}]]
expected = [[_G.agController:updateState()]]
actual = bundler:replaceTag(json)
lu.assertEquals(actual, expected)
-- braces in code block - fails due to mismatched matching of closing }
-- json = [[{"code":"${code:local table = {}
--table[1] = "test"}","filter":{"args":[],"signature":"stop()","slotKey":"${slotKey:unit}"},"key":"${key}"}]]
-- expected = [[{"code":"local table = {}\ntable[1] = \"test\"","filter":{"args":[],"signature":"stop()","slotKey":"${slotKey:unit}"},"key":"${key}"}]]
-- actual = bundler:replaceTag(json)
-- lu.assertEquals(actual, expected)
-- brackets in code
json = [[${code:if options[id].toggleInactive then screen.deactivate() end}]]
expected = [[if options[id].toggleInactive then screen.deactivate() end]]
actual = bundler:replaceTag(json)
lu.assertEquals(actual, expected)
end
--- Verify date insertion works properly.
function _G.TestBundleTemplate.testTagDate()
local bundler = _G.BundleTemplate:new()
local json, actual, expected
-- ISO 8601 format
local expectedPattern = "%d%d%d%d%-%d%d%-%d%dT%d%d:%d%d:%d%dZ"
-- simple test
json = [[${date}]]
expected = expectedPattern
actual = bundler:replaceTag(json)
lu.assertStrMatches(actual, expected)
-- in comment line
json = [[-- Bundled: ${date}]]
expected = "%-%- Bundled: " .. expectedPattern
actual = bundler:replaceTag(json)
lu.assertStrMatches(actual, expected)
end
os.exit(lu.LuaUnit.run())
|
local lmprof = require("lmprof")
lmprof.start()
local x = 10
|
local util = require "navigator.util"
local log = util.log
local api = vim.api
local references = {}
-- returns r1 < r2 based on start of range
local function before(r1, r2)
if r1.start.line < r2.start.line then
return true
end
if r2.start.line < r1.start.line then
return false
end
if r1.start.character < r2.start.character then
return true
end
return false
end
local function handle_document_highlight(_, _, result, _, bufnr, _)
if not bufnr then
return
end
if type(result) ~= "table" then
vim.lsp.util.buf_clear_references(bufnr)
return
end
table.sort(result, function(a, b)
return before(a.range, b.range)
end)
references[bufnr] = result
end
-- modify from vim-illuminate
local function goto_adjent_reference(opt)
log(opt)
opt = vim.tbl_extend("force", {forward = true, wrap = true}, opt or {})
local bufnr = vim.api.nvim_get_current_buf()
local refs = references[bufnr]
if not refs or #refs == 0 then
return nil
end
local next = nil
local nexti = nil
local crow, ccol = unpack(vim.api.nvim_win_get_cursor(0))
local crange = {start = {line = crow - 1, character = ccol}}
for i, ref in ipairs(refs) do
local range = ref.range
if opt.forward then
if before(crange, range) and (not next or before(range, next)) then
next = range
nexti = i
end
else
if before(range, crange) and (not next or before(next, range)) then
next = range
nexti = i
end
log(nexti, next)
end
end
if not next and opt.wrap then
nexti = opt.reverse and #refs or 1
next = refs[nexti].range
end
log(next)
vim.api.nvim_win_set_cursor(0, {next.start.line + 1, next.start.character})
return next
end
-- autocmd ColorScheme *
-- \ hi default LspReferenceRead cterm=bold gui=Bold ctermbg=yellow guifg=yellow guibg=purple4 |
-- \ hi default LspReferenceText cterm=bold gui=Bold ctermbg=red guifg=SlateBlue guibg=MidnightBlue |
-- \ hi default LspReferenceWrite cterm=bold gui=Bold,Italic ctermbg=red guifg=DarkSlateBlue guibg=MistyRose
local function documentHighlight()
api.nvim_exec([[
autocmd ColorScheme * |
hi default LspReferenceRead cterm=bold gui=Bold ctermbg=yellow guifg=yellow guibg=purple4 |
hi default LspReferenceText cterm=bold gui=Bold ctermbg=red guifg=SlateBlue guibg=MidnightBlue |
hi default LspReferenceWrite cterm=bold gui=Bold,Italic ctermbg=red guifg=DarkSlateBlue guibg=MistyRose
augroup lsp_document_highlight
autocmd! * <buffer>
autocmd CursorHold <buffer> lua vim.lsp.buf.document_highlight()
autocmd CursorMoved <buffer> lua vim.lsp.buf.clear_references()
augroup END
]], false)
vim.lsp.handlers["textDocument/documentHighlight"] =
function(_, _, result, _, bufnr)
if not result then
return
end
bufnr = api.nvim_get_current_buf()
vim.lsp.util.buf_clear_references(bufnr)
vim.lsp.util.buf_highlight_references(bufnr, result)
bufnr = bufnr or 0
if type(result) ~= "table" then
vim.lsp.util.buf_clear_references(bufnr)
return
end
table.sort(result, function(a, b)
return before(a.range, b.range)
end)
references[bufnr] = result
end
end
return {
documentHighlight = documentHighlight,
goto_adjent_reference = goto_adjent_reference,
handle_document_highlight = handle_document_highlight
}
|
local _={}
_[7]={}
_[6]={tags=_[7],text="ok"}
_[5]={tags=_[7],text=" = "}
_[4]={tags=_[7],text="ok"}
_[3]={_[4],_[5],_[6]}
_[2]={"return"}
_[1]={"text",_[3]}
return {_[1],_[2]}
--[[
{ "text", { {
tags = <1>{},
text = "ok"
}, {
tags = <table 1>,
text = " = "
}, {
tags = <table 1>,
text = "ok"
} } }
{ "return" }
]]-- |
local Schema = require('schema')
local Player = Schema.define({
["name"] = "string",
["x"] = "number",
["y"] = "number",
["on_change"] = function(changes)
end,
["on_remove"] = function()
print("REMOVE!")
print(self.name .. " HAS BEEN REMOVED!")
end,
-- field order
["_order"] = {"name", "x", "y"}
})
local State = Schema.define({
["fieldString"] = "string",
["fieldNumber"] = "number",
["player"] = Player,
["arrayOfPlayers"] = { Player },
["mapOfPlayers"] = { map = Player },
-- field order
["_order"] = {"fieldString", "fieldNumber", "player", "arrayOfPlayers", "mapOfPlayers"}
})
-- -- number
-- local encoded_state = {1, 50}
-- -- string
-- local encoded_state = {0, 171, 72, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100}
-- -- empty Player
-- local encoded_state = {2, 193}
-- -- Player with properties
-- local encoded_state = {2, 0, 164, 74, 97, 107, 101, 1, 100, 2, 204, 200, 193}
-- local encoded_next_state = {}
local reflection_bytes = {0, 2, 2, 0, 1, 3, 3, 0, 0, 164, 110, 97, 109, 101, 1, 166, 115, 116, 114, 105, 110, 103, 193, 1, 0, 161, 120, 1, 166, 110, 117, 109, 98, 101, 114, 193, 2, 0, 161, 121, 1, 166, 110, 117, 109, 98, 101, 114, 193, 0, 1, 193, 1, 1, 5, 5, 0, 0, 171, 102, 105, 101, 108, 100, 83, 116, 114, 105, 110, 103, 1, 166, 115, 116, 114, 105, 110, 103, 193, 1, 0, 171, 102, 105, 101, 108, 100, 78, 117, 109, 98, 101, 114, 1, 166, 110, 117, 109, 98, 101, 114, 193, 2, 0, 166, 112, 108, 97, 121, 101, 114, 2, 1, 1, 163, 114, 101, 102, 193, 3, 0, 174, 97, 114, 114, 97, 121, 79, 102, 80, 108, 97, 121, 101, 114, 115, 2, 1, 1, 165, 97, 114, 114, 97, 121, 193, 4, 0, 172, 109, 97, 112, 79, 102, 80, 108, 97, 121, 101, 114, 115, 2, 1, 1, 163, 109, 97, 112, 193, 0, 0, 193}
local reflected = Schema.reflection_decode(reflection_bytes)
-- -- Array with three values
local encoded_state = {3, 2, 2, 0, 0, 173, 74, 97, 107, 101, 32, 66, 97, 100, 108, 97, 110, 100, 115, 193, 1, 0, 173, 83, 110, 97, 107, 101, 32, 83, 97, 110, 100, 101, 114, 115, 193}
local encoded_next_state = { 3, 2, 2, 2, 192, 0, 0, 168, 84, 97, 114, 113, 117, 105, 110, 110, 193}
-- -- Map of two
-- local encoded_state = {4, 2, 163, 111, 110, 101, 0, 173, 74, 97, 107, 101, 32, 66, 97, 100, 108, 97, 110, 100, 115, 193, 163, 116, 119, 111, 0, 173, 83, 110, 97, 107, 101, 32, 83, 97, 110, 100, 101, 114, 115, 193}
-- local encoded_next_state = {4, 1, 0, 0, 168, 84, 97, 114, 113, 117, 105, 110, 110, 193}
local state = State:new()
state:decode(encoded_state)
Schema.pprint(state)
state:decode(encoded_next_state)
Schema.pprint(state)
|
local NOW = KEYS[1]
local PACKAGE_TIMEOUT = tonumber(KEYS[2])
local the_lock = redis.call('get', 'chat:ref_lock')
if the_lock and tonumber(NOW) - tonumber(the_lock) < PACKAGE_TIMEOUT then
return nil
end
redis.call('set', 'chat:ref_lock', NOW, 'PX', PACKAGE_TIMEOUT)
return '1' |
local Job = require "plenary.job"
local Deployer = {}
function Deployer.check(self, origin)
-- check whether the origin is supported or not
local match = string.match(origin, "^https?://([^/:]+)")
if match == self.host then
error(string.format("%s is already deployed on %s", origin, self.host))
end
end
function Deployer.deploy(self, path, original)
local result, code =
Job:new(
{
command = "curl",
args = {
"--silent",
"-XPOST",
"-F",
"access_token=" .. self.token,
"-F",
"metadata_is_public=false",
"-F",
"app=markdown-image.nvim",
"-F",
"imagedata=@" .. path,
"https://upload.gyazo.com/api/upload"
}
}
):sync()
if code ~= 0 then
error(string.format("failed to upload %s (%d)", path, code))
end
return vim.fn.json_decode(vim.fn.join(result, ""))["url"]
end
function Deployer.new(token)
local obj = {
host = "i.gyazo.com", -- Gyazo teams has not supported by API yet.
token = token
}
if token == nil or token == "" then
error("empty token")
end
return setmetatable(obj, {__index = Deployer})
end
return Deployer
|
-- --------------------
-- TellMeWhen
-- Originally by Nephthys of Hyjal <lieandswell@yahoo.com>
-- Other contributions by:
-- Sweetmms of Blackrock, Oozebull of Twisting Nether, Oodyboo of Mug'thol,
-- Banjankri of Blackrock, Predeter of Proudmoore, Xenyr of Aszune
-- Currently maintained by
-- Cybeloras of Aerie Peak
-- --------------------
if not TMW then return end
local TMW = TMW
local L = TMW.L
local print = TMW.print
local SUG = TMW.SUG
local strlowerCache = TMW.strlowerCache
TMW.Classes.SharableDataType.types.group:RegisterMenuBuilder(10, function(Item_group)
local gs = Item_group.Settings
local IMPORTS, EXPORTS = Item_group:GetEditBox():GetAvailableImportExportTypes()
-- copy group position
local info = TMW.DD:CreateInfo()
info.text = L["COPYGROUP"] .. " - " .. L["COPYPOSSCALE"]
info.func = function()
TMW.DD:CloseDropDownMenus()
local destgroup = IMPORTS.group_overwrite
local destgs = destgroup:GetSettings()
-- Restore all default settings first.
-- Not a special table (["**"]), so just normally copy it.
-- Setting it nil won't recreate it like other settings tables, so re-copy from defaults.
destgs.Point = CopyTable(TMW.Group_Defaults.Point)
TMW:CopyTableInPlaceUsingDestinationMeta(gs.Point, destgs.Point, true)
destgs.Scale = gs.Scale or TMW.Group_Defaults.Scale
destgs.Level = gs.Level or TMW.Group_Defaults.Level
destgs.Strata = gs.Strata or TMW.Group_Defaults.Strata
destgroup:Setup()
end
info.notCheckable = true
info.disabled = not IMPORTS.group_overwrite
TMW.DD:AddButton(info)
end)
local Module = SUG:NewModule("frameName", SUG:GetModule("default"))
Module.noTexture = true
Module.noMin = true
Module.showColorHelp = false
Module.helpText = L["SUG_TOOLTIPTITLE_GENERIC"]
function Module:OnInitialize()
self.Table = {}
end
function Module:OnSuggest()
wipe(self.Table)
local frame = EnumerateFrames()
while frame do
local name = frame:GetName()
if name and _G[name] == frame and frame:GetPoint() and frame:GetHeight() > 0 and frame:GetWidth() > 0 then
self.Table[frame] = name
end
frame = EnumerateFrames(frame)
end
end
function Module:Table_Get()
return self.Table
end
function Module:Table_GetNormalSuggestions(suggestions, tbl)
local atBeginning = SUG.atBeginning
local strfindsug = SUG.strfindsug
local lastName = SUG.lastName
for frame, name in pairs(tbl) do
if frame.class == TMW.C.Group then
if (
-- Search by group name
strfind(strlowerCache[frame:GetGroupName()], lastName)
-- and by frame name for fun
or strfind(strlowerCache[name], lastName)
-- If the input is already a TMW group or is UIParent, list all TMW groups
or strfind(lastName, "tmw:group")
or strfind(lastName, "uiparent")
)
-- Don't suggest the current group
and TMW.CI.group ~= frame
then
suggestions[#suggestions + 1] = frame
end
elseif strfind(strlowerCache[name], lastName) then
suggestions[#suggestions + 1] = frame
else
local secure, addon = issecurevariable(name)
if secure then
addon = "Blizzard"
end
if not secure and strfindsug(strlowerCache[addon]) then
suggestions[#suggestions + 1] = frame
end
end
end
end
function Module.Sorter_ByName(a, b)
local nameA, nameB = SUG.SortTable[a], SUG.SortTable[b]
return nameA < nameB
end
function Module:Sorter_Bucket(suggestions, buckets)
local atBeginning = SUG.atBeginning
local lastName_unmodified = SUG.lastName_unmodified
for i = 1, #suggestions do
local frame = suggestions[i]
local parent = frame
local depth = 0
while parent do
depth = depth + 1
parent = parent:GetParent()
end
local name = self.Table[frame]
if strlowerCache[name] == lastName_unmodified then
-- Exact matches first
depth = -2
elseif frame.class == TMW.C.Group then
if strfind(SUG.lastName, frame:GetGUID():lower()) then
-- Exact matches first (look for the GUID in the input string, which also contains the group's name and some color escapes)
depth = -2
else
-- Other TMW groups come next.
depth = -1
end
elseif name and strfind(strlowerCache[name], atBeginning) then
-- Make starts-with matches worth slightly more
depth = depth - 1
end
tinsert(buckets[depth], frame)
end
end
function Module:Table_GetSorter()
SUG.SortTable = self:Table_Get()
return self.Sorter_ByName, self.Sorter_Bucket
end
function Module:Entry_AddToList_1(f, frame)
if frame.class == TMW.C.Group then
local group = frame
local name = group:GetGroupName()
f.insert = group:GetGUID()
f.Background:SetVertexColor(.41, .8, .94, 1)
f.tooltiptitlewrap = false
f.tooltiptitle = name
f.tooltiptext = "TellMeWhen"
f.Name:SetText(name)
else
local name = frame:GetName()
f.insert = name
f.tooltiptitlewrap = false
f.tooltiptitle = name
local secure, addon = issecurevariable(name)
if secure then
addon = "Blizzard"
end
f.tooltiptext = L["SUG_MODULE_FRAME_LIKELYADDON"]:format(addon)
f.Name:SetText(name)
end
end
local highlight = CreateFrame("Frame")
highlight:SetFrameStrata("FULLSCREEN_DIALOG")
highlight:SetScript("OnUpdate", function()
if not GameTooltip:IsVisible() then
highlight:Hide()
end
end)
local texture = highlight:CreateTexture(nil, "OVERLAY")
texture:SetAllPoints()
texture:SetColorTexture(1, 0, .66, 0.5)
function GameTooltip:TMW_SetFrameHighlight(frame)
-- Don't highlight UIParent, it gets annoying.
if frame ~= UIParent then
highlight:SetAllPoints(frame)
highlight:Show()
else
highlight:Hide()
end
end
|
object_tangible_tcg_series7_garage_display_vehicles_pod_racer_one = object_tangible_tcg_series7_garage_display_vehicles_shared_pod_racer_one:new {
}
ObjectTemplates:addTemplate(object_tangible_tcg_series7_garage_display_vehicles_pod_racer_one, "object/tangible/tcg/series7/garage_display_vehicles/pod_racer_one.iff") |
local function round(number, decimalPlaces)
decimalPlaces = decimalPlaces or 0
local placer = 10^(-decimalPlaces)
return (math.floor(number/placer + .5))*placer
end
local function multiple(number, m)
return round(number/m)*m
end
local function clamp(number, min, max)
number = (number > min) and number or min
number = (number < max) and number or max
return number
end
return {
NearestMultiple = multiple,
RoundNumber = round,
ClampNumber = clamp,
} |
--[[
]]--
function soloveh_sendRequestValidate(plr,cmd,cel)
if (not cel) then
outputChatBox("Użycie: /pojedynek <id/nick>",plr)
return
end
local target = findPlayer(plr,cel)
if (not target) then
outputChatBox("Nie znaleziono gracza o podanym id/nicku.",plr)
return
end
--if (target == plr) then
-- outputChatBox("Nie możesz wyzwać siebie na pojedynek.",plr)
-- return
--end
local x,y,z = getElementPosition(plr)
local strefa = createColSphere(x,y,z,15)
local gracze = getElementsWithinColShape(strefa,"player")
for i,v in ipairs(gracze) do
if (getElementInterior(v)==getElementInterior(plr) and getElementDimension(v)==getElementDimension(plr)) then
if (target == v) then
soloveh_sendRequest(plr,cel)
else
outputChatBox("Dany gracz musi być w pobliżu 15 metrów.",plr)
destroyElement(strefa)
return
end
end
end
destroyElement(strefa)
end
addCommandHandler("pojveh",soloveh_sendRequestValidate)
function soloveh_sendRequest(plr,cel)
local target = findPlayer(plr,cel)
if (not target) then
outputChatBox("Pojedynek nie mógł się rozpocząć - gracz jest OFFLINE.",plr,255,0,0)
return
end
if (getElementData(plr,"soloveh:deny_invite")) then
outputChatBox("Najpierw odblokuj możliwość zapraszania Ciebie do pojedynków samochodowych (/soloacc).",plr)
return
end
if (getElementData(plr,"soloveh:active")) then
outputChatBox("Najpierw ukończ aktualny pojedynek.",plr, 255,0,0)
return
end
if (getElementData(target, "soloveh:active")) then
outputChatBox("Gracz którego chcesz zaprosić, aktualnie przeprowadza pojedynek.",plr,255,0,0)
return
end
if (getElementData(target,"soloveh:active_request")) then
outputChatBox("Gracz nie odpowiedział jeszcze na poprzednie zaproszenie.",plr,255,0,0)
return
end
if (getElementData(plr,"soloveh:active_request")) then
outputChatBox("Nie odpowiedziałeś jeszcze na poprzednie zaproszenie.",plr,255,0,0)
return
end
if (getElementData(target,"blokada:kary_aj") or getElementData(plr,"blokada:kary_aj")) then
outputChatBox("Ty lub gracz którego próbujesz zaprosić posiadacie aktywną karę AdminJail.",plr,255,0,0)
return
end
if (getElementData(plr,"soloveh:active_select") or getElementData(target,"soloveh:active_select")) then
outputChatBox("Gracz nie ukończył aktualnego pojedynku.",plr,255,0,0)
return
end
local pojazd1 = getPedOccupiedVehicle(plr)
local pojazd2 = getPedOccupiedVehicle(target)
if (not pojazd1 or not pojazd2) then
outputChatBox("Gracz którego chcesz zaprosić, musi być w pojeździe jako kierowca.",plr,255,0,0)
return
end
local kier1 = getVehicleController(pojazd1)
local kier2 = getVehicleController(pojazd2)
if (not kier1 or not kier2) then
outputChatBox("Gracz którego chcesz zaprosić, musi być w pojeździe jako kierowca.",plr,255,0,0)
return
end
outputChatBox("Zaproszenie zostało wysłane.",plr)
end |
--[[
********************************************************************************
Project owner: RageQuit community
Project name: GTW-RPG
Developers: Mr_Moose
Source code: https://github.com/404rq/GTW-RPG/
Bugtracker: https://discuss.404rq.com/t/issues
Suggestions: https://discuss.404rq.com/t/development
Version: Open source
License: BSD 2-Clause
Status: Stable release
********************************************************************************
]]--
-- Globally accessible tables
local train_payment_timers = { }
local td_payment = 50
--[[ Find and return the ID of nearest station ]]--
function find_nearest_station(plr, route)
if not plr or not isElement(plr) or getElementType(plr) ~= "player" then return 1 end
local x,y,z = getElementPosition(plr)
local ID,total_dist = 1,9999
for k=1, #train_routes[route] do
local dist = getDistanceBetweenPoints3D(train_routes[route][k][1],train_routes[route][k][2],train_routes[route][k][3], x,y,z)
if dist < total_dist then
total_dist = dist
ID = k
end
end
return ID
end
--[[ Calculate the ID for next trainstation and inform the passengers ]]--
function create_new_train_station(plr, ID)
-- There must be a route at this point
if not plr or not getElementData(plr, "GTWtraindriver.currentRoute") then return end
-- Did we reach the end of the line yet? if so then restart the same route
if #train_routes[getElementData(plr, "GTWtraindriver.currentRoute")] < ID then
ID = 1;
setElementData(plr, "GTWtraindriver.currentstation", 1)
end
-- Get the coordinates of the next station from our table
local x,y,z = train_routes[getElementData(plr, "GTWtraindriver.currentRoute")][ID][1],
train_routes[getElementData(plr, "GTWtraindriver.currentRoute")][ID][2],
train_routes[getElementData(plr, "GTWtraindriver.currentRoute")][ID][3]
-- Tell the client to make a marker and a blip for the traindriver
triggerClientEvent(plr, "GTWtraindriver.createtrainstation", plr, x,y,z)
-- Get the train object and check for passengers in it
local veh = getPedOccupiedVehicle(plr)
if not veh then return end
local passengers = getVehicleOccupants(veh)
if not passengers then return end
-- Alright, we got some passengers, let's tell them where we're going
for k,pa in pairs(passengers) do
setTimer(delayed_message, 10000, 1, "Next station: "..getZoneName(x,y,z)..
" in "..getZoneName(x,y,z, true), pa, 55,200, 0)
end
-- Save the station ID
setElementData(plr, "GTWtraindriver.currentstation", ID)
end
--[[ Drivers get's a route asigned while passengers has to pay when entering the train ]]--
function on_train_enter(plr, seat, jacked)
-- Make sure the vehicle is a train
if not train_vehicles[getElementModel(source)] then return end
if getElementType(plr) ~= "player" then return end
-- Start the payment timer for passengers entering the train
if seat > 0 then
driver = getVehicleOccupant(source, 0)
if driver and getElementType(driver) == "player" and getPlayerTeam(driver) and
getPlayerTeam(driver) == getTeamFromName( "Civilians" ) and
getElementData(driver, "Occupation") == "Train Driver" then
-- Initial payment
pay_for_the_ride(driver, plr)
-- Kill the timer if it exist and make a new one
if isTimer( train_payment_timers[plr] ) then
killTimer( train_payment_timers[plr] )
end
train_payment_timers[plr] = setTimer(pay_for_the_ride, 30000, 0, driver, plr)
end
end
-- Whoever entered the train is a traindriver
if getPlayerTeam(plr) and getPlayerTeam(plr) == getTeamFromName("Civilians") and
getElementData(plr, "Occupation") == "Train Driver" and
seat == 0 and train_vehicles[getElementModel(source )] then
-- Let him choose a route to drive
triggerClientEvent(plr, "GTWtraindriver.selectRoute", plr)
end
end
addEventHandler("onVehicleEnter", root, on_train_enter)
--[[ A little hack for developers to manually change the route ID ]]--
function choose_route(plr, cmd)
if not getPedOccupiedVehicle(plr) or not train_vehicles[
getElementModel(getPedOccupiedVehicle(plr))] then return end
if getElementType(plr) ~= "player" then return end
-- Make sure it's a traindriver inside a train requesting this
if getPlayerTeam(plr) and getPlayerTeam(plr) == getTeamFromName("Civilians") and
getElementData(plr, "Occupation") == "Train Driver" and
getPedOccupiedVehicleSeat(plr) == 0 then
-- Force selection of new route
triggerClientEvent(plr, "GTWtraindriver.selectRoute", plr)
end
end
addCommandHandler("route", choose_route)
addCommandHandler("routes", choose_route)
addCommandHandler("routelist", choose_route)
addCommandHandler("routeslist", choose_route)
--[[ A new route has been selected, load it's data ]]--
function start_new_route(route)
setElementData(client, "GTWtraindriver.currentRoute", route)
if not getElementData(client, "GTWtraindriver.currentstation") then
local first_station = find_nearest_station(client, route)
create_new_train_station(client, first_station)
else
create_new_train_station(client, getElementData(client, "GTWtraindriver.currentstation"))
end
exports.GTWtopbar:dm("Drive your train to the first station to start your route", client, 0, 255, 0)
end
addEvent("GTWtraindriver.selectRouteReceive", true)
addEventHandler("GTWtraindriver.selectRouteReceive", root, start_new_route)
--[[ Handles payments in trains ]]--
function pay_for_the_ride(driver, passenger, first)
-- Make sure that both the driver and passenger are players
if not driver or not isElement(driver) or getElementType(driver) ~= "player" then return end
if not passenger or not isElement(passenger) or getElementType(passenger) ~= "player" then return end
-- Make sure the passenger is still inside the train
local veh = getPedOccupiedVehicle(driver)
if getVehicleOccupant(veh, 0) == driver and getElementData(driver, "Occupation") == "Train Driver" then
-- First payment are more expensive
if first then
takePlayerMoney(passenger, 10)
givePlayerMoney(driver, 10)
else
takePlayerMoney(passenger, 5)
givePlayerMoney(driver, 5)
end
else
-- Throw the passenger out if he can't pay for the ride any more
removePedFromVehicle ( passenger )
if isElement(train_payment_timers[passenger]) then
killTimer(train_payment_timers[passenger])
end
exports.GTWtopbar:dm( "You can't afford this train ride anymore!", passenger, 255, 0, 0 )
end
end
--[[ station the payment timer when a passenger exit the train ]]--
function vehicle_exit(plr, seat, jacked)
if isTimer(train_payment_timers[plr]) then
killTimer(train_payment_timers[plr])
end
end
addEventHandler("onVehicleExit", root, vehicle_exit)
--[[ Calculate the next station ]]--
function calculate_next_station(td_payment)
-- Make sure the player is driving a train
if not isPedInVehicle(client) then return end
if not train_vehicles[getElementModel(getPedOccupiedVehicle(client))] then return end
-- Calculate the payment minus charges for damage
local fine = math.floor(td_payment -
(td_payment*(1-(getElementHealth(getPedOccupiedVehicle(client))/1000))))
-- Increase stats by 1
local playeraccount = getPlayerAccount(client)
local train_stations = (exports.GTWcore:get_account_data(playeraccount, "GTWdata.stats.train_stations") or 0) + 1
exports.GTWcore:set_account_data(playeraccount, "GTWdata.stats.train_stations", train_stations)
-- Pay the driver
givePlayerMoney(client, (fine + math.floor(train_stations/2)) * (1 + math.floor(getElementData(client, "GTWvehicles.numberOfCars")/10 or 1)))
-- Notify about the payment reduce if the train is damaged
if math.floor(td_payment - fine) > 1 then
takePlayerMoney(client, math.floor(td_payment - fine))
exports.GTWtopbar:dm("Removed $"..tostring(math.floor(td_payment - fine)).." due to damage on your train!",
client, 255, 0, 0)
end
-- Get the next station on the list
if #train_routes[getElementData(client, "GTWtraindriver.currentRoute")] ==
tonumber(getElementData(client, "GTWtraindriver.currentstation")) then
setElementData( client, "GTWtraindriver.currentstation", 1)
else
setElementData(client, "GTWtraindriver.currentstation", tonumber(
getElementData(client, "GTWtraindriver.currentstation" ))+1)
end
-- Force the client to create markers and blips for the next station
create_new_train_station(client, tonumber(getElementData(client, "GTWtraindriver.currentstation")))
end
addEvent("GTWtraindriver.paytrainDriver", true)
addEventHandler("GTWtraindriver.paytrainDriver", resourceRoot, calculate_next_station)
--[[ A little hack for developers to manually change the route ID ]]--
function set_manual_station(plr, cmd, ID)
local is_staff = exports.GTWstaff:isStaff(plr)
if not is_staff then return end
setElementData(plr, "GTWtraindriver.currentstation", tonumber(ID) or 1)
create_new_train_station(plr, tonumber(ID) or 1)
end
addCommandHandler("settrainstation", set_manual_station)
--[[ Display a delayed message securely ]]--
function delayed_message(text, plr, r,g,b, color_coded)
if not plr or not isElement(plr) or getElementType(plr) ~= "player" then return end
if not getPlayerTeam(plr) or getPlayerTeam(plr) ~= getTeamFromName("Civilians") or
getElementData(plr, "Occupation") ~= "Train Driver" then return end
if not getPedOccupiedVehicle(plr) or not train_vehicles[getElementModel(getPedOccupiedVehicle(plr))] then return end
exports.GTWtopbar:dm(text, plr, r,g,b, color_coded)
end
|
package.path = package.path .. ";data/scripts/lib/?.lua"
include("utility")
local utility_execute = execute
function execute(sender, commandName, ...)
local player = Player(sender)
if not player or not player.craft then
return 1, "", "Eval: You're not in a ship!"
end
if not Server():hasAdminPrivileges(player) then
return 1, "", "Eval: You're not an admin!"
end
local code = table.concat({...}, ' ')
player:sendChatMessage(player.name, 0, "Eval: Executing code: "..code)
printlog(string.format("Player '%s'(%i) executes code (/eval): %s", player.name, player.index, code))
code = [[
package.path = package.path .. ";data/scripts/lib/?.lua"
package.path = package.path .. ";data/scripts/?.lua"
include("faction")
include("galaxy")
include("randomext")
include("relations")
include("utility")
local ShipUtility = include("shiputility")
local SpawnUtility = include("spawnutility")
function run(player, entity)
]]..code..[[
end
]]
local result = {utility_execute(code, player, player.craft)}
for k, v in pairs(result) do
result[k] = tostring(v)
end
result = table.concat(result, ', ')
player:sendChatMessage(player.name, 0, "Eval: Result: "..result)
printlog(string.format("Player '%s'(%i) executed code (/eval) with result: %s", player.name, player.index, result))
return 0, "", ""
end
function getDescription()
return "Executes code properly without screaming about imaginary errors, unlike /run."
end
function getHelp()
return "Executes code properly without screaming about imaginary errors, unlike /run. Usage:\n/eval x = 5; x = x + 4; return x"
end |
-- Fuchas Boot Manager
(computer or package.loaded.computer).supportsOEFI = function()
return false
end
if (...) then
os_arguments = ...
end
loadfile = function(file)
local pc,cp = computer or package.loaded.computer, component or package.loaded.component
local addr, invoke = pc.getBootAddress(), cp.invoke
local handle, reason = invoke(addr, "open", file)
assert(handle, reason)
local buffer = ""
repeat
local data, reason = invoke(addr, "read", handle, math.huge)
assert(data or not reason, reason)
buffer = buffer .. (data or "")
until not data
invoke(addr, "close", handle)
return load(buffer, "=" .. file, "bt", _G)
end
loadfile("Fuchas/Kernel/boot.lua")()
|
sendHouseMap = function(player, origin)
local worldMap = "clanban1"
local x0 = {0}
local y0 = {0}
local name = {"Test"}
local m = {0}
local x1 = {0}
local y1 = {0}
player:mapSelection(worldMap, x0, y0, name, m, x1, y1)
end
|
--* This Document is AutoGenerate by OrangeFilter, Don't Change it! *
---@meta
---
---[3.3]particle system renderer node[parent:RendererNode]
---
---@class ParticleSystemRendererNodeLegacy
ParticleSystemRendererNodeLegacy = {}
---
---[3.3]play particle system
---
--- @nodiscard
function ParticleSystemRendererNodeLegacy:play() end
---
---[3.3]pause particle system
---
--- @nodiscard
function ParticleSystemRendererNodeLegacy:pause() end
---
---[3.3]stop particle system
---
--- @nodiscard
function ParticleSystemRendererNodeLegacy:stop() end
---
---[3.3]restart particle system
---
--- @nodiscard
function ParticleSystemRendererNodeLegacy:restart() end
---
---[3.3]enable instance rendering
---
--- @nodiscard
function ParticleSystemRendererNodeLegacy:enableInstanceRenderMode() end
---
---[3.3]copy modules from source node
---
--- @param arg0 ParticleSystemRendererNodeLegacy#particlesystemrenderernodelegacy
--- @nodiscard
function ParticleSystemRendererNodeLegacy:copyModules(arg0) end
return ParticleSystemRendererNodeLegacy
|
SetItemList = {
"Hat of Adroitness",
"Necklace of Adroitness",
"Robe of Adroitness",
"Sash of Adroitness",
"Staff of Adroitness",
"Afflicted Battle Axe",
"Afflicted Choker",
"Afflicted Cuirass",
"Afflicted Gauntlets",
"Afflicted Helm",
"Afflicted Pauldrons",
"Afflicted Sabatons",
"Cuirass of Akatosh's Blessing",
"Gauntlets of Akatosh's Blessing",
"Greaves of Akatosh's Blessing",
"Helm of Akatosh's Blessing",
"Necklace of Akatosh's Blessing",
"Pauldrons of Akatosh's Blessing",
"Shield of Akatosh's Blessing",
"Bastion of the Dragon",
"Clasp of the Dragon",
"Claw of the Dragon",
"Crest of the Dragon",
"Scales of the Dragon",
"Alessia's Bulwark (Crafted Set)",
"Alessian Bracers",
"Alessian Breeches",
"Alessian Choker",
"Alessian Cuirass",
"Alessian Gauntlets",
"Alessian Gloves",
"Alessian Greaves",
"Alessian Hat",
"Alessian Helm",
"Alessian Helmet",
"Alessian Jack",
"Alessian Leg Guards",
"Alessian Necklace",
"Alessian Pendant",
"Alessian Robe",
"Breeches of Almalexia's Mercy",
"Epaulets of Almalexia's Mercy",
"Gloves of Almalexia's Mercy",
"Hat of Almalexia's Mercy",
"Locket of Almalexia's Mercy",
"Robe of Almalexia's Mercy",
"Breeches of Alteration Mastery",
"Epaulets of Alteration Mastery",
"Gloves of Alteration Mastery",
"Hat of Alteration Mastery",
"Robe of Alteration Mastery",
"Sash of Alteration Mastery",
"Auriel's Bow",
"Auriel's Ring",
"Tenth Ring of Trinimac",
"White Bow of Alinor",
"Breeches of the Apprentice",
"Gloves of the Apprentice",
"Robe of the Apprentice",
"Sash of the Apprentice",
"Shoes of the Apprentice",
"Breeches of the Arch-Mage",
"Epaulets of the Arch-Mage",
"Gloves of the Arch-Mage",
"Hat of the Arch-Mage",
"Pendant of the Arch-Mage",
"Robe of the Arch-Mage",
"Sash of the Arch-Mage",
"Belt of the Archer's Mind",
"Boots of the Archer's Mind",
"Bracers of the Archer's Mind",
"Helmet of the Archer's Mind",
"Jack of the Archer's Mind",
"Armor of the Seducer (Crafted)",
"Ashen Grip (Crafted Set)",
"Barkskin Belt",
"Barkskin Bracers",
"Barkskin Jack",
"Barkskin Leg Guards",
"Barkskin Shoulder Cops",
"Beads of Beckoning Steel",
"Cuirass of Beckoning Steel",
"Gauntlets of Beckoning Steel",
"Girdle of Beckoning Steel",
"Greaves of Beckoning Steel",
"Energizing Ring of the Advancing Yokeda",
"Greatsword of the Advancing Yokeda",
"Necklace of the Advancing Yokeda",
"Refreshing Ring of the Advancing Yokeda",
"Blood Spawn's Epaulets",
"Blood Spawn's Guise",
"Cuirass of the Brute",
"Gauntlets of the Brute",
"Greaves of the Brute",
"Helm of the Brute",
"Warhammer of the Brute",
"Covenant's Breeches",
"Covenant's Epaulets",
"Covenant's Gloves",
"Covenant's Hat",
"Covenant's Robe",
"Covenant's Sash",
"Covenant's Shoes",
"Dominion's Breeches",
"Dominion's Epaulets",
"Dominion's Gloves",
"Dominion's Hat",
"Dominion's Robe",
"Dominion's Sash",
"Dominion's Shoes",
"Pact's Breeches",
"Pact's Epaulets",
"Pact's Gloves",
"Pact's Hat",
"Pact's Robe",
"Pact's Sash",
"Pact's Shoes",
"Burning Spellweave Breeches",
"Burning Spellweave Epaulets",
"Burning Spellweave Gloves",
"Burning Spellweave Hat",
"Burning Spellweave Jerkin",
"Burning Spellweave Sash",
"Burning Spellweave Shoes",
"Cuirass of the Construct",
"Girdle of the Construct",
"Greaves of the Construct",
"Helm of the Construct",
"Pauldrons of the Construct",
"Boots of the Crusader",
"Bracers of the Crusader",
"Helmet of the Crusader",
"Jack of the Crusader",
"Leg Guards of the Crusader",
"Shield of the Crusader",
"Curse-Eating Breeches",
"Curse-Eating Epaulets",
"Curse-Eating Gloves",
"Curse-Eating Hat",
"Curse-Eating Robe",
"Curse-Eating Shoes",
"Curse-Eating Staff",
"Cuirass of Cyrodiil's Crest",
"Gauntlets of Cyrodiil's Crest",
"Girdle of Cyrodiil's Crest",
"Helm of Cyrodiil's Crest",
"Locket of Cyrodiil's Crest",
"Pauldrons of Cyrodiil's Crest",
"Sabatons of Cyrodiil's Crest",
"Darkstride Belt",
"Darkstride Boots",
"Darkstride Bracers",
"Darkstride Helmet",
"Darkstride Jack",
"Covenant's Greatsword",
"Covenant's Signet",
"Dominion's Greatsword",
"Dominion's Signet",
"Pact's Greatsword",
"Pact's Signet",
"Death's Wind (Crafted Set)",
"Hammer of the Resilient Yokeda",
"Necklace of the Resilient Yokeda",
"Ring of the Resilient Yokeda",
"Shield of the Resilient Yokeda",
"Breeches of the Desert Rose",
"Epaulets of the Desert Rose",
"Hat of the Desert Rose",
"Sandals of the Desert Rose",
"Tunic of the Desert Rose",
"Breeches of Destruction Mastery",
"Epaulets of Destruction Mastery",
"Gloves of Destruction Mastery",
"Hat of Destruction Mastery",
"Robe of Destruction Mastery",
"Sash of Destruction Mastery",
"Arsonist's Staff",
"Hromir's Ice Staff",
"Hromir's Ring",
"Levin Master's Ring",
"Ring of Bitter Mercy",
"Ring of Blue Ice",
"Ring of Embers",
"Ring of St Llothis",
"Spear of Bitter Mercy",
"Staff of Everfrost",
"Staff of Fulmination",
"Staff of St Llothis",
"Aether Blazing Staff",
"Aether Necklace of Undoing",
"Aether Ring of Empowerment",
"Aether Staff of Bitter Ice",
"Aether Staff of Enervation",
"Energizing Aether Ring",
"Armor of the First Titan",
"Battleaxe of Medrike",
"Belt of the First Titan",
"Boots of the First Titan",
"Gauntlets of the First Titan",
"Glacial Staff of Nomeg Haga",
"Greaves of the First Titan",
"Hammer of Anaxes",
"Pauldrons of the First Titan",
"Soul-Reaving Bow",
"Staff of Zymel Hriz",
"The Bestial Rampart",
"Cuirass of the Dreugh King Slayer",
"Greatsword of the Dreugh King Slayer",
"Greaves of the Dreugh King Slayer",
"Pauldrons of the Dreugh King Slayer",
"Pendant of the Dreugh King Slayer",
"Cuirass of Durok's Bane",
"Girdle of Durok's Bane",
"Greaves of Durok's Bane",
"Helm of Durok's Bane",
"Pauldrons of Durok's Bane",
"Covenant's Band",
"Covenant's Bow",
"Dominion's Band",
"Dominion's Bow",
"Pact's Band",
"Pact's Bow",
"Ebon Cuirass",
"Ebon Gauntlets",
"Ebon Girdle",
"Ebon Greaves",
"Ebon Helm",
"Ebon Pauldrons",
"Ebon Sabatons",
"Elegant Epaulets",
"Elegant Gloves",
"Elegant Hat",
"Elegant Robe",
"Elegant Sash",
"Elegant Shoes",
"Cuirass of Elf Bane",
"Gauntlets of Elf Bane",
"Girdle of Elf Bane",
"Greaves of Elf Bane",
"Helm of Elf Bane",
"Warhammer of Elf Bane",
"Embershield Cuirass",
"Embershield Gauntlets",
"Embershield Girdle",
"Embershield Greaves",
"Embershield Helm",
"Embershield Pauldron",
"Embershield Sabatons",
"The Engine Guardian's Epaulets",
"The Engine Guardian's Guise",
"The Eyes of Mara (Crafted Set)",
"Fiord's Arm Cops",
"Fiord's Guards",
"Fiord's Helmet",
"Fiord's Jack",
"Fiord's Ring",
"Cuirass of the Footman",
"Girdle of the Footman",
"Greaves of the Footman",
"Sabatons of the Footman",
"Shield of the Footman",
"Locket of the Footman",
"Memento of the Footman",
"Covenant's Loop",
"Covenant's Restoration Staff",
"Dominion's Loop",
"Dominion's Restoration Staff",
"Pact's Loop",
"Pact's Restoration Staff",
"Belt of the Hawk's Eye",
"Bracers of the Hawk's Eye",
"Cowl of the Hawk's Eye",
"Jack of the Hawk's Eye",
"Leg Guards of the Hawk's Eye",
"Ring of the Hawk's Eye",
"Shoulder Cops of the Hawk's Eye",
"Breeches of the Healer",
"Epaulets of the Healer",
"Hood of the Healer",
"Robe of the Healer",
"Shoes of the Healer",
"Aether Necklace of Mending",
"Aether Ring of Mending",
"Aether Ring of Restoration",
"Aether Staff of Mending",
"Covenant's Cuirass",
"Covenant's Gauntlets",
"Covenant's Girdle",
"Covenant's Greaves",
"Covenant's Helm",
"Covenant's Pauldron",
"Covenant's Sabatons",
"Dominion's Cuirass",
"Dominion's Gauntlets",
"Dominion's Girdle",
"Dominion's Greaves",
"Dominion's Helm",
"Dominion's Pauldron",
"Dominion's Sabatons",
"Pact's Cuirass",
"Pact's Gauntlets",
"Pact's Girdle",
"Pact's Greaves",
"Pact's Helm",
"Pact's Pauldron",
"Pact's Sabatons",
"Savior's Arm Cops",
"Savior's Belt",
"Savior's Boots",
"Savior's Bracers",
"Savior's Guards",
"Savior's Helmet",
"Savior's Jack",
"Hist Bark (Crafted Set)",
"Hunding's Rage (Crafted Set)",
"Ice Furnace Cuirass",
"Ice Furnace Gauntlets",
"Ice Furnace Greaves",
"Ice Furnace Pauldrons",
"Ice Furnace Sabatons",
"Cuirass of the Yokeda",
"Gauntlets of the Yokeda",
"Girdle of the Yokeda",
"Greaves of the Yokeda",
"Helm of the Yokeda",
"Pauldron of the Yokeda",
"Sabatons of the Yokeda",
"Amulet of Conflagration",
"Burning Amulet",
"Burning Brand",
"Flamedancer",
"Hopesfire",
"Trueflame",
"Cuirass of the Juggernaut",
"Greaves of the Juggernaut",
"Helm of the Juggernaut",
"Pauldrons of the Juggernaut",
"Shield of the Juggernaut",
"Kagrenac's Hope (Crafted Set)",
"Battle Axe of the Knightmare",
"Cuirass of the Knightmare",
"Gauntlets of the Knightmare",
"Greaves of the Knightmare",
"Helm of the Knightmare",
"Belt of Kyne's Flight",
"Bow of Kyne's Flight",
"Bracers of Kyne's Flight",
"Helmet of Kyne's Flight",
"Jack of Kyne's Flight",
"Leg Guards of Kyne's Flight",
"Ring of Kyne's Flight",
"Boots of Kyne's Kiss",
"Bracers of Kyne's Kiss",
"Helmet of Kyne's Kiss",
"Jack of Kyne's Kiss",
"Shoulder Cops of Kyne's Kiss",
"Band of Cyrodiil's Light",
"Breeches of Cyrodiil's Light",
"Epaulets of Cyrodiil's Light",
"Gloves of Cyrodiil's Light",
"Hat of Cyrodiil's Light",
"Ring of Cyrodiil's Light",
"Robe of Cyrodiil's Light",
"Lord's Cuirass",
"Lord's Gauntlets",
"Lord's Greaves",
"Lord's Helm",
"Lord's Longsword",
"Lord's Pauldrons",
"Lord's Shield",
"Breeches of the Magicka Furnace",
"Epaulets of the Magicka Furnace",
"Hat of the Magicka Furnace",
"Loop of the Magicka Furnace",
"Necklace of the Magicka Furnace",
"Ring of the Magicka Furnace",
"Robe of the Magicka Furnace",
"Magnus' (Crafted Set)",
"Maw of the Infernal's Epaulets",
"Maw of the Infernal's Hat",
"Belt of the Morag Tong",
"Bracers of the Morag Tong",
"Dagger of the Morag Tong",
"Helmet of the Morag Tong",
"Pendant of the Morag Tong",
"Breeches of Necropotence",
"Epaulets of Necropotence",
"Gloves of Necropotence",
"Hat of Necropotence",
"Robe of Necropotence",
"Sash of Necropotence",
"Shoes of Necropotence",
"Lord-Warden Helm",
"Lord-Warden Shoulders",
"Nerien'eth's Epaulets",
"Nerien'eth's Hat",
"The Night Mother (Crafted Set)",
"Bracers of the Night Mother",
"Helmet of the Night Mother",
"Jack of the Night Mother",
"Leg Guards of the Night Mother",
"Shoulder Cops of the Night Mother",
"Night's Silence (Crafted Set)",
"Bogdan the Nightflame's Epaulets",
"Bogdan the Nightflame's Guise",
"Nightshade Bracers",
"Nightshade Dagger",
"Nightshade Helmet",
"Nightshade Jack",
"Nightshade Leg Guards",
"Nightshade Necklace",
"Nightshade Shoulder Cops",
"Cuirass of Nikulas",
"Helm of Nikulas",
"Pauldrons of Nikulas",
"Sabatons of Nikulas",
"Shield of Nikulas",
"Breeches of the Noble Duelist",
"Dagger of the Noble Duelist",
"Epaulets of the Noble Duelist",
"Harness of the Noble Duelist",
"Shoes of the Noble Duelist",
"Boots of Oblivion",
"Bracers of Oblivion",
"Helmet of Oblivion",
"Jack of Oblivion",
"Leg Guards of Oblivion",
"Shoulder Cops of Oblivion",
"Oblivion's Foe (Crafted Set)",
"Orgnum's Scales (Crafted Set)",
"Ophidian Bow of Venom",
"Ophidian Necklace of Venom",
"Ophidian Ring of Energy",
"Ophidian Ring of Spirit",
"Covenant's Choker",
"Covenant's Shield",
"Covenant's Sword",
"Dominion's Choker",
"Dominion's Shield",
"Dominion's Sword",
"Pact's Choker",
"Pact's Shield",
"Pact's Sword",
"Breeches of Prayer",
"Epaulets of Prayer",
"Hat of Prayer",
"Robe of Prayer",
"Sash of Prayer",
"Prisoner's Breeches",
"Prisoner's Gloves",
"Prisoner's Sash",
"Prisoner's Shirt",
"Prisoner's Shoes",
"Ophidian Belt of Celerity",
"Ophidian Boots of Celerity",
"Ophidian Bracers of Celerity",
"Ophidian Chausses of Celerity",
"Ophidian Helm",
"Ophidian Jack",
"Ophidian Spaulders of Celerity",
"Cuirass of Rage",
"Gauntlets of Rage",
"Greaves of Rage",
"Helm of Rage",
"Sabatons of Rage",
"Belt of the Ranger",
"Boots of the Ranger",
"Bracers of the Ranger",
"Helmet of the Ranger",
"Jack of the Ranger",
"Ravaging Band",
"Ravaging Choker",
"Ravaging Cuirass",
"Ravaging Gauntlets",
"Ravaging Greatsword",
"Ravaging Greaves",
"Ravaging Ring",
"Belt of the Red Mountain",
"Helmet of the Red Mountain",
"Jack of the Red Mountain",
"Leg Guards of the Red Mountain",
"Shoulder Cops of the Red Mountain",
"Healing Staff of Thorn",
"Restoration Ring of Thorn",
"Ring of Indarys",
"Staff of Indarys",
"Auriel's Shield",
"Crusader's Mace",
"Crusader's Necklace",
"Elf-Doom Maul",
"Necklace of Sardavar",
"Shield of the Man-Bull",
"Breeches of the Onslaught",
"Epaulets of the Onslaught",
"Hood of the Onslaught",
"Robe of the Onslaught",
"Shoes of the Onslaught",
"Breeches of the Necromancer",
"Epaulets of the Necromancer",
"Gloves of the Necromancer",
"Hood of the Necromancer",
"Robe of the Necromancer",
"Breeches of Sanctuary",
"Epaulets of Sanctuary",
"Hat of Sanctuary",
"Loop of Sanctuary",
"Ring of Sanctuary",
"Robe of Sanctuary",
"Staff of Sanctuary",
"Belt of Salvation",
"Boots of Salvation",
"Bracers of Salvation",
"Helmet of Salvation",
"Jack of Salvation",
"Leg Guards of Salvation",
"Shoulder Cops of Salvation",
"Malubeth The Scourger's Epaulets",
"Malubeth The Scourger's Guise",
"Boots of the Sentry",
"Bow of the Sentry",
"Bracers of the Sentry",
"Helmet of the Sentry",
"Jack of the Sentry",
"Leg Guards of the Sentry",
"Cuirass of the Sergeant",
"Greaves of the Sergeant",
"Helm of the Sergeant",
"Pauldron of the Sergeant",
"Sabatons of the Sergeant",
"Breeches of the Shadow Dancer",
"Cowl of the Shadow Dancer",
"Gloves of the Shadow Dancer",
"Shirt of the Shadow Dancer",
"Shoes of the Shadow Dancer",
"Band of the Shadow Walker",
"Boots of the Shadow Walker",
"Leg Guards of the Shadow Walker",
"Pendant of the Shadow Walker",
"Ring of the Shadow Walker",
"Shalidor's Curse (Crafted Set)",
"Covenant's Arm Cops",
"Covenant's Belt",
"Covenant's Boots",
"Covenant's Bracers",
"Covenant's Guards",
"Covenant's Helmet",
"Covenant's Jack",
"Dominion's Arm Cops",
"Dominion's Belt",
"Dominion's Boots",
"Dominion's Bracers",
"Dominion's Guards",
"Dominion's Helmet",
"Dominion's Jack",
"Pact's Arm Cops",
"Pact's Belt",
"Pact's Boots",
"Pact's Bracers",
"Pact's Guards",
"Pact's Helmet",
"Pact's Jack",
"Bracers of the Lich",
"Crown of the Lich",
"Dylora's Staff",
"Epaulets of the Lich",
"Robe of the Lich",
"Embrace of Shadows",
"Footpads of Shadows",
"Guards of Shadows",
"Hands of Shadows",
"Mask of Shadows",
"Epaulets of the Sun",
"Hood of the Sun",
"Necklace of the Sun",
"Robe of the Sun",
"Staff of the Sun",
"Boots of the Skirmisher",
"Bracers of the Skirmisher",
"Helmet of the Skirmisher",
"Jack of the Skirmisher",
"Leg Guards of the Skirmisher",
"Shoulder Cops of the Skirmisher",
"Song of Lamae (Crafted Set)",
"Band of Soulshine",
"Cuirass of Soulshine",
"Greaves of Soulshine",
"Helm of Soulshine",
"Pauldrons of Soulshine",
"Pendant of Soulshine",
"Ring of Soulshine",
"Spawn Of Mephala's Epaulets",
"Spawn Of Mephala's Guise",
"The Spectre's Eye (Crafted Set)",
"Breeches of Stendarr",
"Epaulets of Stendarr",
"Hat of Stendarr",
"Necklace of Stendarr",
"Robe of Stendarr",
"Cuirass of the Storm Knight",
"Gauntlets of the Storm Knight",
"Greaves of the Storm Knight",
"Helm of the Storm Knight's Plate",
"Pauldrons of the Storm Knight",
"Pendant of the Storm Knight",
"Shield of the Storm Knight",
"Stygian Boots",
"Stygian Guards",
"Stygian Arm Cops",
"Stygian Belt",
"Stygian Bracers",
"Stygian Dagger",
"Stygian Helmet",
"Stygian Jack",
"Sunderflame Arm Cops",
"Sunderflame Belt",
"Sunderflame Boots",
"Sunderflame Bracers",
"Sunderflame Guards",
"Sunderflame Helmet",
"Sunderflame Jack",
"Band of Syrabane",
"Epaulets of Syrabane",
"Gloves of Syrabane",
"Ring of Syrabane",
"Robe of Syrabane",
"Thunderous Cuirass",
"Thunderous Greaves",
"Thunderous Pauldrons",
"Thunderous Pendant",
"Thunderous Sabatons",
"Torug's Pact (Crafted Set)",
"Forge Master's Ring",
"Malacath's Ring",
"The Ebon Sledge",
"Volendrung",
"Cuirass of Truth",
"Girdle of Truth",
"Greaves of Truth",
"Helm of Truth",
"Pauldrons of Truth",
"Warhammer of Truth",
"Necklace of the Two-Fanged Snake",
"Ring of the Two-Fanged Snake",
"Sword of the Two-Fanged Snake",
"Twilight's Embrace (Crafted Set)",
"Axe of the Elder Sister",
"Axe of the Younger Sister",
"Boots of the Twin Sisters",
"Bracers of the Twin Sisters",
"Helmet of the Twin Sisters",
"Jack of the Twin Sisters",
"Leg Guards of the Twin Sisters",
"Badge of the Unassailable",
"Band of the Unassailable",
"Cuirass of the Unassailable",
"Greaves of the Unassailable",
"Helm of the Unassailable",
"Ring of the Unassailable",
"Shield of the Unassailable",
"Breeches of the Undaunted Bastion",
"Epaulets of the Undaunted Bastion",
"Gloves of the Undaunted Bastion",
"Hat of the Undaunted Bastion",
"Jerkin of the Undaunted Bastion",
"Sash of the Undaunted Bastion",
"Shoes of the Undaunted Bastion",
"Arm Cops of the Undaunted Infiltrator",
"Belt of the Undaunted Infiltrator",
"Boots of the Undaunted Infiltrator",
"Bracers of the Undaunted Infiltrator",
"Guards of the Undaunted Infiltrator",
"Helmet of the Undaunted Infiltrator",
"Jack of the Undaunted Infiltrator",
"Breeches of the Undaunted Unweaver",
"Epaulets of the Undaunted Unweaver",
"Gloves of the Undaunted Unweaver",
"Hat of the Undaunted Unweaver",
"Jerkin of the Undaunted Unweaver",
"Sash of the Undaunted Unweaver",
"Shoes of the Undaunted Unweaver",
"Valkyn Skori's Hat",
"Valkyn Skoria's Epaulets",
"Vampire's Kiss (Crafted Set)",
"Covenant's Axe",
"Covenant's Beads",
"Dominion's Axe",
"Dominion's Beads",
"Pact's Axe",
"Pact's Beads",
"Cowl of the Warlock",
"Epaulets of the Warlock",
"Focus of the Warlock",
"Robes of the Warlock",
"Signet of the Warlock",
"Boots of the Viper",
"Fang of the Viper",
"Helmet of the Viper",
"Shoulder Cops of the Viper",
"Throat-Scales of the Viper",
"Belt of Cyrodiil's Ward",
"Boots of Cyrodiil's Ward",
"Bracers of Cyrodiil's Ward",
"Helmet of Cyrodiil's Ward",
"Jack of Cyrodiil's Ward",
"Leg Guards of Cyrodiil's Ward",
"Shoulder Cops of Cyrodiil's Ward",
"Arm Cops of the Air",
"Belt of the Air",
"Boots of the Air",
"Bracers of the Air",
"Guards of the Air",
"Helmet of the Air",
"Jack of the Air",
"Cuirass of the Fire",
"Gauntlets of the Fire",
"Girdle of the Fire",
"Greaves of the Fire",
"Helm of the Fire",
"Pauldron of the Fire",
"Sabatons of the Fire",
"Breeches of Martial Knowledge",
"Epaulets of Martial Knowledge",
"Gloves of Martial Knowledge",
"Hat of Martial Knowledge",
"Sash of Martial Knowledge",
"Shirt of Martial Knowledge",
"Shoes of Martial Knowledge",
"Way of the Arena (Crafted Set)",
"Werewolf Hide Band",
"Werewolf Hide Helmet",
"Werewolf Hide Jack",
"Werewolf Hide Ring",
"Werewolf Hide Shoulder Cops",
"Whitestrake's (Crafted Set)",
"The Willow's Path (Crafted Set)",
"Aether Breeches",
"Aether Epaulets",
"Aether Gloves",
"Aether Hat",
"Aether Robes",
"Aether Sash",
"Aether Shoes",
"Breeches of the Worm Cult",
"Epaulets of the Worm Cult",
"Gloves of the Worm Cult",
"Hat of the Worm Cult",
"Robe of the Worm Cult",
"Sash of the Worm Cult",
"Shoes of the Worm Cult",
"Covenant's Ice Staff",
"Covenant's Inferno Staff",
"Covenant's Lightning Staff",
"Covenant's Ring",
"Dominion's Ice Staff",
"Dominion's Inferno Staff",
"Dominion's Lightning Staff",
"Dominion's Ring",
"Pact's Ice Staff",
"Pact's Inferno Staff",
"Pact's Lightning Staff",
"Pact's Ring",
} |
--Copyright (C) 2009 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
--which carries forward this exception.
object_tangible_wearables_pants_shared_nightsister_pants_s01 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/wearables/pants/shared_nightsister_pants_s01.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/nightsister_pants_s01.sat",
arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/pants.iff",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 16777228,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@wearables_detail:nightsister_pants_s01",
gameObjectType = 16777228,
locationReservationRadius = 0,
lookAtText = "@wearables_lookat:nightsister_pants_s01",
noBuildRadius = 0,
objectName = "@wearables_name:nightsister_pants_s01",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 2233956453,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/wearables/base/shared_wearables_base.iff", "object/tangible/wearables/base/shared_base_pants.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_wearables_pants_shared_nightsister_pants_s01, "object/tangible/wearables/pants/shared_nightsister_pants_s01.iff")
object_tangible_wearables_pants_shared_nightsister_pants_s02 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/wearables/pants/shared_nightsister_pants_s02.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/nightsister_pants_s02.sat",
arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/pants.iff",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 16777228,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@wearables_detail:nightsister_pants_s02",
gameObjectType = 16777228,
locationReservationRadius = 0,
lookAtText = "@wearables_lookat:nightsister_pants_s02",
noBuildRadius = 0,
objectName = "@wearables_name:nightsister_pants_s02",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 1580257522,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/wearables/base/shared_wearables_base.iff", "object/tangible/wearables/base/shared_base_pants.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_wearables_pants_shared_nightsister_pants_s02, "object/tangible/wearables/pants/shared_nightsister_pants_s02.iff")
object_tangible_wearables_pants_shared_pants_s01 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/wearables/pants/shared_pants_s01.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/pants_s01_f.sat",
arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/pants.iff",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 16777228,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@wearables_detail:pants_s01",
gameObjectType = 16777228,
locationReservationRadius = 0,
lookAtText = "@wearables_lookat:pants_s01",
noBuildRadius = 0,
objectName = "@wearables_name:pants_s01",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 729715050,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/wearables/base/shared_wearables_base.iff", "object/tangible/wearables/base/shared_base_pants.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_wearables_pants_shared_pants_s01, "object/tangible/wearables/pants/shared_pants_s01.iff")
object_tangible_wearables_pants_shared_pants_s02 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/wearables/pants/shared_pants_s02.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/pants_s02_f.sat",
arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/pants.iff",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 16777228,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@wearables_detail:pants_s02",
gameObjectType = 16777228,
locationReservationRadius = 0,
lookAtText = "@wearables_lookat:pants_s02",
noBuildRadius = 0,
objectName = "@wearables_name:pants_s02",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 4033427965,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/wearables/base/shared_wearables_base.iff", "object/tangible/wearables/base/shared_base_pants.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_wearables_pants_shared_pants_s02, "object/tangible/wearables/pants/shared_pants_s02.iff")
object_tangible_wearables_pants_shared_pants_s04 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/wearables/pants/shared_pants_s04.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/pants_s04_f.sat",
arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/pants.iff",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 16777228,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@wearables_detail:pants_s04",
gameObjectType = 16777228,
locationReservationRadius = 0,
lookAtText = "@wearables_lookat:pants_s04",
noBuildRadius = 0,
objectName = "@wearables_name:pants_s04",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 1116173668,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/wearables/base/shared_wearables_base.iff", "object/tangible/wearables/base/shared_base_pants.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_wearables_pants_shared_pants_s04, "object/tangible/wearables/pants/shared_pants_s04.iff")
object_tangible_wearables_pants_shared_pants_s05 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/wearables/pants/shared_pants_s05.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/pants_s05_f.sat",
arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/pants.iff",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 16777228,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@wearables_detail:pants_s05",
gameObjectType = 16777228,
locationReservationRadius = 0,
lookAtText = "@wearables_lookat:pants_s05",
noBuildRadius = 0,
objectName = "@wearables_name:pants_s05",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 193598185,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/wearables/base/shared_wearables_base.iff", "object/tangible/wearables/base/shared_base_pants.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_wearables_pants_shared_pants_s05, "object/tangible/wearables/pants/shared_pants_s05.iff")
object_tangible_wearables_pants_shared_pants_s06 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/wearables/pants/shared_pants_s06.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/pants_s06_f.sat",
arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/pants.iff",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 16777228,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@wearables_detail:pants_s06",
gameObjectType = 16777228,
locationReservationRadius = 0,
lookAtText = "@wearables_lookat:pants_s06",
noBuildRadius = 0,
objectName = "@wearables_name:pants_s06",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 3499997822,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/wearables/base/shared_wearables_base.iff", "object/tangible/wearables/base/shared_base_pants.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_wearables_pants_shared_pants_s06, "object/tangible/wearables/pants/shared_pants_s06.iff")
object_tangible_wearables_pants_shared_pants_s07 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/wearables/pants/shared_pants_s07.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/pants_s07_f.sat",
arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/pants.iff",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 16777228,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@wearables_detail:pants_s07",
gameObjectType = 16777228,
locationReservationRadius = 0,
lookAtText = "@wearables_lookat:pants_s07",
noBuildRadius = 0,
objectName = "@wearables_name:pants_s07",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 2576408051,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/wearables/base/shared_wearables_base.iff", "object/tangible/wearables/base/shared_base_pants.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_wearables_pants_shared_pants_s07, "object/tangible/wearables/pants/shared_pants_s07.iff")
object_tangible_wearables_pants_shared_pants_s08 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/wearables/pants/shared_pants_s08.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/pants_s08_f.sat",
arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/pants.iff",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 16777228,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@wearables_detail:pants_s08",
gameObjectType = 16777228,
locationReservationRadius = 0,
lookAtText = "@wearables_lookat:pants_s08",
noBuildRadius = 0,
objectName = "@wearables_name:pants_s08",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 597357025,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/wearables/base/shared_wearables_base.iff", "object/tangible/wearables/base/shared_base_pants.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_wearables_pants_shared_pants_s08, "object/tangible/wearables/pants/shared_pants_s08.iff")
object_tangible_wearables_pants_shared_pants_s09 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/wearables/pants/shared_pants_s09.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/pants_s09_f.sat",
arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/pants.iff",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 16777228,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@wearables_detail:pants_s09",
gameObjectType = 16777228,
locationReservationRadius = 0,
lookAtText = "@wearables_lookat:pants_s09",
noBuildRadius = 0,
objectName = "@wearables_name:pants_s09",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 1788319340,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/wearables/base/shared_wearables_base.iff", "object/tangible/wearables/base/shared_base_pants.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_wearables_pants_shared_pants_s09, "object/tangible/wearables/pants/shared_pants_s09.iff")
object_tangible_wearables_pants_shared_pants_s10 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/wearables/pants/shared_pants_s10.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/pants_s10_f.sat",
arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/pants.iff",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 16777228,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@wearables_detail:pants_s10",
gameObjectType = 16777228,
locationReservationRadius = 0,
lookAtText = "@wearables_lookat:pants_s10",
noBuildRadius = 0,
objectName = "@wearables_name:pants_s10",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 2036071327,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/wearables/base/shared_wearables_base.iff", "object/tangible/wearables/base/shared_base_pants.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_wearables_pants_shared_pants_s10, "object/tangible/wearables/pants/shared_pants_s10.iff")
object_tangible_wearables_pants_shared_pants_s11 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/wearables/pants/shared_pants_s11.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/pants_s11_f.sat",
arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/pants.iff",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 16777228,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@wearables_detail:pants_s11",
gameObjectType = 16777228,
locationReservationRadius = 0,
lookAtText = "@wearables_lookat:pants_s11",
noBuildRadius = 0,
objectName = "@wearables_name:pants_s11",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 810982418,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/wearables/base/shared_wearables_base.iff", "object/tangible/wearables/base/shared_base_pants.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_wearables_pants_shared_pants_s11, "object/tangible/wearables/pants/shared_pants_s11.iff")
object_tangible_wearables_pants_shared_pants_s12 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/wearables/pants/shared_pants_s12.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/pants_s12_f.sat",
arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/pants.iff",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 16777228,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@wearables_detail:pants_s12",
gameObjectType = 16777228,
locationReservationRadius = 0,
lookAtText = "@wearables_lookat:pants_s12",
noBuildRadius = 0,
objectName = "@wearables_name:pants_s12",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 3946919045,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/wearables/base/shared_wearables_base.iff", "object/tangible/wearables/base/shared_base_pants.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_wearables_pants_shared_pants_s12, "object/tangible/wearables/pants/shared_pants_s12.iff")
object_tangible_wearables_pants_shared_pants_s13 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/wearables/pants/shared_pants_s13.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/pants_s13_f.sat",
arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/pants.iff",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 16777228,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@wearables_detail:pants_s13",
gameObjectType = 16777228,
locationReservationRadius = 0,
lookAtText = "@wearables_lookat:pants_s13",
noBuildRadius = 0,
objectName = "@wearables_name:pants_s13",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 2722910984,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/wearables/base/shared_wearables_base.iff", "object/tangible/wearables/base/shared_base_pants.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_wearables_pants_shared_pants_s13, "object/tangible/wearables/pants/shared_pants_s13.iff")
object_tangible_wearables_pants_shared_pants_s14 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/wearables/pants/shared_pants_s14.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/pants_s14_f.sat",
arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/pants.iff",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 16777228,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@wearables_detail:pants_s14",
gameObjectType = 16777228,
locationReservationRadius = 0,
lookAtText = "@wearables_lookat:pants_s14",
noBuildRadius = 0,
objectName = "@wearables_name:pants_s14",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 1504671772,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/wearables/base/shared_wearables_base.iff", "object/tangible/wearables/base/shared_base_pants.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_wearables_pants_shared_pants_s14, "object/tangible/wearables/pants/shared_pants_s14.iff")
object_tangible_wearables_pants_shared_pants_s15 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/wearables/pants/shared_pants_s15.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/pants_s15_f.sat",
arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/pants.iff",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 16777228,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@wearables_detail:pants_s15",
gameObjectType = 16777228,
locationReservationRadius = 0,
lookAtText = "@wearables_lookat:pants_s15",
noBuildRadius = 0,
objectName = "@wearables_name:pants_s15",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 279060369,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/wearables/base/shared_wearables_base.iff", "object/tangible/wearables/base/shared_base_pants.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_wearables_pants_shared_pants_s15, "object/tangible/wearables/pants/shared_pants_s15.iff")
object_tangible_wearables_pants_shared_pants_s17 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/wearables/pants/shared_pants_s17.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/pants_s17_f.sat",
arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/pants.iff",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 16777228,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@wearables_detail:pants_s17",
gameObjectType = 16777228,
locationReservationRadius = 0,
lookAtText = "@wearables_lookat:pants_s17",
noBuildRadius = 0,
objectName = "@wearables_name:pants_s17",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 2193150091,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/wearables/base/shared_wearables_base.iff", "object/tangible/wearables/base/shared_base_pants.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_wearables_pants_shared_pants_s17, "object/tangible/wearables/pants/shared_pants_s17.iff")
object_tangible_wearables_pants_shared_pants_s18 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/wearables/pants/shared_pants_s18.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/pants_s18_f.sat",
arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/pants.iff",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 16777228,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@wearables_detail:pants_s18",
gameObjectType = 16777228,
locationReservationRadius = 0,
lookAtText = "@wearables_lookat:pants_s18",
noBuildRadius = 0,
objectName = "@wearables_name:pants_s18",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 951254169,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/wearables/base/shared_wearables_base.iff", "object/tangible/wearables/base/shared_base_pants.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_wearables_pants_shared_pants_s18, "object/tangible/wearables/pants/shared_pants_s18.iff")
object_tangible_wearables_pants_shared_pants_s21 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/wearables/pants/shared_pants_s21.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/pants_s21_f.sat",
arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/pants.iff",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 16777228,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@wearables_detail:pants_s21",
gameObjectType = 16777228,
locationReservationRadius = 0,
lookAtText = "@wearables_lookat:pants_s21",
noBuildRadius = 0,
objectName = "@wearables_name:pants_s21",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 489589658,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/wearables/base/shared_wearables_base.iff", "object/tangible/wearables/base/shared_base_pants.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_wearables_pants_shared_pants_s21, "object/tangible/wearables/pants/shared_pants_s21.iff")
object_tangible_wearables_pants_shared_pants_s22 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/wearables/pants/shared_pants_s22.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/pants_s22_f.sat",
arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/pants.iff",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 16777228,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@wearables_detail:pants_s22",
gameObjectType = 16777228,
locationReservationRadius = 0,
lookAtText = "@wearables_lookat:pants_s22",
noBuildRadius = 0,
objectName = "@wearables_name:pants_s22",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 3325633293,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/wearables/base/shared_wearables_base.iff", "object/tangible/wearables/base/shared_base_pants.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_wearables_pants_shared_pants_s22, "object/tangible/wearables/pants/shared_pants_s22.iff")
object_tangible_wearables_pants_shared_pants_s24 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/wearables/pants/shared_pants_s24.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/pants_s24_f.sat",
arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/pants.iff",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 16777228,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@wearables_detail:pants_s24",
gameObjectType = 16777228,
locationReservationRadius = 0,
lookAtText = "@wearables_lookat:pants_s24",
noBuildRadius = 0,
objectName = "@wearables_name:pants_s24",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 1960275860,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/wearables/base/shared_wearables_base.iff", "object/tangible/wearables/base/shared_base_pants.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_wearables_pants_shared_pants_s24, "object/tangible/wearables/pants/shared_pants_s24.iff")
object_tangible_wearables_pants_shared_pants_s25 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/wearables/pants/shared_pants_s25.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/pants_s25_f.sat",
arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/pants.iff",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 16777228,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@wearables_detail:pants_s25",
gameObjectType = 16777228,
locationReservationRadius = 0,
lookAtText = "@wearables_lookat:pants_s25",
noBuildRadius = 0,
objectName = "@wearables_name:pants_s25",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 1037699097,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/wearables/base/shared_wearables_base.iff", "object/tangible/wearables/base/shared_base_pants.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_wearables_pants_shared_pants_s25, "object/tangible/wearables/pants/shared_pants_s25.iff")
object_tangible_wearables_pants_shared_pants_s26 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/wearables/pants/shared_pants_s26.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/pants_s26_f.sat",
arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/pants.iff",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 16777228,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@wearables_detail:pants_s26",
gameObjectType = 16777228,
locationReservationRadius = 0,
lookAtText = "@wearables_lookat:pants_s26",
noBuildRadius = 0,
objectName = "@wearables_name:pants_s26",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 3872235662,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/wearables/base/shared_wearables_base.iff", "object/tangible/wearables/base/shared_base_pants.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_wearables_pants_shared_pants_s26, "object/tangible/wearables/pants/shared_pants_s26.iff")
object_tangible_wearables_pants_shared_pants_s27 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/wearables/pants/shared_pants_s27.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/pants_s27_f.sat",
arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/pants.iff",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 16777228,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@wearables_detail:pants_s27",
gameObjectType = 16777228,
locationReservationRadius = 0,
lookAtText = "@wearables_lookat:pants_s27",
noBuildRadius = 0,
objectName = "@wearables_name:pants_s27",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 2948646659,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/wearables/base/shared_wearables_base.iff", "object/tangible/wearables/base/shared_base_pants.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_wearables_pants_shared_pants_s27, "object/tangible/wearables/pants/shared_pants_s27.iff")
object_tangible_wearables_pants_shared_pants_s28 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/wearables/pants/shared_pants_s28.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/pants_s28_f.sat",
arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/pants.iff",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 16777228,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@wearables_detail:pants_s28",
gameObjectType = 16777228,
locationReservationRadius = 0,
lookAtText = "@wearables_lookat:pants_s28",
noBuildRadius = 0,
objectName = "@wearables_name:pants_s28",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 365619985,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/wearables/base/shared_wearables_base.iff", "object/tangible/wearables/base/shared_base_pants.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_wearables_pants_shared_pants_s28, "object/tangible/wearables/pants/shared_pants_s28.iff")
object_tangible_wearables_pants_shared_pants_s29 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/wearables/pants/shared_pants_s29.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/pants_s29_f.sat",
arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/pants.iff",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 16777228,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@wearables_detail:pants_s29",
gameObjectType = 16777228,
locationReservationRadius = 0,
lookAtText = "@wearables_lookat:pants_s29",
noBuildRadius = 0,
objectName = "@wearables_name:pants_s29",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 1556581532,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/wearables/base/shared_wearables_base.iff", "object/tangible/wearables/base/shared_base_pants.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_wearables_pants_shared_pants_s29, "object/tangible/wearables/pants/shared_pants_s29.iff")
object_tangible_wearables_pants_shared_pants_s30 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/wearables/pants/shared_pants_s30.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/pants_s30_f.sat",
arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/pants.iff",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 16777228,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@wearables_detail:pants_s30",
gameObjectType = 16777228,
locationReservationRadius = 0,
lookAtText = "@wearables_lookat:pants_s30",
noBuildRadius = 0,
objectName = "@wearables_name:pants_s30",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 1326178671,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/wearables/base/shared_wearables_base.iff", "object/tangible/wearables/base/shared_base_pants.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_wearables_pants_shared_pants_s30, "object/tangible/wearables/pants/shared_pants_s30.iff")
object_tangible_wearables_pants_shared_pants_s31 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/wearables/pants/shared_pants_s31.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/pants_s31_f.sat",
arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/pants.iff",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 16777228,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@wearables_detail:pants_s31",
gameObjectType = 16777228,
locationReservationRadius = 0,
lookAtText = "@wearables_lookat:pants_s31",
noBuildRadius = 0,
objectName = "@wearables_name:pants_s31",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 101091042,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/wearables/base/shared_wearables_base.iff", "object/tangible/wearables/base/shared_base_pants.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_wearables_pants_shared_pants_s31, "object/tangible/wearables/pants/shared_pants_s31.iff")
object_tangible_wearables_pants_shared_pants_s32 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/wearables/pants/shared_pants_s32.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/pants_s32_f.sat",
arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/pants.iff",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 16777228,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@wearables_detail:pants_s32",
gameObjectType = 16777228,
locationReservationRadius = 0,
lookAtText = "@wearables_lookat:pants_s32",
noBuildRadius = 0,
objectName = "@wearables_name:pants_s32",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 3708890741,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/wearables/base/shared_wearables_base.iff", "object/tangible/wearables/base/shared_base_pants.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_wearables_pants_shared_pants_s32, "object/tangible/wearables/pants/shared_pants_s32.iff")
object_tangible_wearables_pants_shared_pants_s33 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/wearables/pants/shared_pants_s33.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/pants_s33_f.sat",
arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/pants.iff",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 16777228,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@wearables_detail:pants_s33",
gameObjectType = 16777228,
locationReservationRadius = 0,
lookAtText = "@wearables_lookat:pants_s33",
noBuildRadius = 0,
objectName = "@wearables_name:pants_s33",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 2484881912,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/wearables/base/shared_wearables_base.iff", "object/tangible/wearables/base/shared_base_pants.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_wearables_pants_shared_pants_s33, "object/tangible/wearables/pants/shared_pants_s33.iff")
|
object_tangible_loot_mustafar_jedi_relic_03 = object_tangible_loot_mustafar_shared_jedi_relic_03:new {
}
ObjectTemplates:addTemplate(object_tangible_loot_mustafar_jedi_relic_03, "object/tangible/loot/mustafar/jedi_relic_03.iff")
|
-- Keep these for backwards compatibility
function hud.save_hunger(player)
hud.set_hunger(player)
end
function hud.load_hunger(player)
hud.get_hunger(player)
end
-- Poison player
local function poisenp(tick, time, time_left, player)
time_left = time_left + tick
if time_left < time then
minetest.after(tick, poisenp, tick, time, time_left, player)
else
--reset hud image
end
if player:get_hp()-1 > 0 then
player:set_hp(player:get_hp()-1)
end
end
function hud.item_eat(hunger_change, replace_with_item, poisen, heal)
return function(itemstack, user, pointed_thing)
if itemstack:take_item() ~= nil and user ~= nil then
local name = user:get_player_name()
local h = tonumber(hud.hunger[name])
local hp = user:get_hp()
-- Saturation
if h < 30 and hunger_change then
h = h + hunger_change
if h > 30 then h = 30 end
hud.hunger[name] = h
hud.set_hunger(user)
end
-- Healing
if hp < 20 and heal then
hp = hp + heal
if hp > 20 then hp = 20 end
user:set_hp(hp)
end
-- Poison
if poisen then
--set hud-img
poisenp(1.0, poisen, 0, user)
end
--sound:eat
itemstack:add_item(replace_with_item)
end
return itemstack
end
end
local function overwrite(name, hunger_change, replace_with_item, poisen, heal)
local tab = minetest.registered_items[name]
if tab == nil then return end
tab.on_use = hud.item_eat(hunger_change, replace_with_item, poisen, heal)
minetest.registered_items[name] = tab
end
overwrite("default:apple", 2)
if minetest.get_modpath("farming") ~= nil then
overwrite("farming:bread", 4)
end
if minetest.get_modpath("mobs") ~= nil then
overwrite("mobs:meat", 6)
overwrite("mobs:meat_raw", 3)
overwrite("mobs:rat_cooked", 5)
end
if minetest.get_modpath("moretrees") ~= nil then
overwrite("moretrees:coconut_milk", 1)
overwrite("moretrees:raw_coconut", 2)
overwrite("moretrees:acorn_muffin", 3)
overwrite("moretrees:spruce_nuts", 1)
overwrite("moretrees:pine_nuts", 1)
overwrite("moretrees:fir_nuts", 1)
end
if minetest.get_modpath("dwarves") ~= nil then
overwrite("dwarves:beer", 2)
overwrite("dwarves:apple_cider", 1)
overwrite("dwarves:midus", 2)
overwrite("dwarves:tequila", 2)
overwrite("dwarves:tequila_with_lime", 2)
overwrite("dwarves:sake", 2)
end
if minetest.get_modpath("animalmaterials") ~= nil then
overwrite("animalmaterials:milk", 2)
overwrite("animalmaterials:meat_raw", 3)
overwrite("animalmaterials:meat_pork", 3)
overwrite("animalmaterials:meat_beef", 3)
overwrite("animalmaterials:meat_chicken", 3)
overwrite("animalmaterials:meat_lamb", 3)
overwrite("animalmaterials:meat_venison", 3)
overwrite("animalmaterials:meat_undead", 3, "", 3)
overwrite("animalmaterials:meat_toxic", 3, "", 5)
overwrite("animalmaterials:meat_ostrich", 3)
overwrite("animalmaterials:fish_bluewhite", 2)
overwrite("animalmaterials:fish_clownfish", 2)
end
if minetest.get_modpath("fishing") ~= nil then
overwrite("fishing:fish_raw", 2)
overwrite("fishing:fish_cooked", 5)
overwrite("fishing:sushi", 6)
overwrite("fishing:shark", 4)
overwrite("fishing:shark_cooked", 8)
overwrite("fishing:pike", 4)
overwrite("fishing:pike_cooked", 8)
end
if minetest.get_modpath("glooptest") ~= nil then
overwrite("glooptest:kalite_lump", 1)
end
if minetest.get_modpath("bushes") ~= nil then
overwrite("bushes:sugar", 1)
overwrite("bushes:strawberry", 2)
overwrite("bushes:berry_pie_raw", 3)
overwrite("bushes:berry_pie_cooked", 4)
overwrite("bushes:basket_pies", 15)
end
if minetest.get_modpath("bushes_classic") then
-- bushes_classic mod, as found in the plantlife modpack
local berries = {
"strawberry",
"blackberry",
"blueberry",
"raspberry",
"gooseberry",
"mixed_berry"}
for _, berry in ipairs(berries) do
if berry ~= "mixed_berry" then
overwrite("bushes:"..berry, 1)
end
overwrite("bushes:"..berry.."_pie_raw", 2)
overwrite("bushes:"..berry.."_pie_cooked", 5)
overwrite("bushes:basket_"..berry, 15)
end
end
if minetest.get_modpath("mushroom") ~= nil then
overwrite("mushroom:brown", 1)
overwrite("mushroom:red", 1, "", 3)
end
if minetest.get_modpath("docfarming") ~= nil then
overwrite("docfarming:carrot", 3)
overwrite("docfarming:cucumber", 2)
overwrite("docfarming:corn", 3)
overwrite("docfarming:potato", 4)
overwrite("docfarming:bakedpotato", 5)
overwrite("docfarming:raspberry", 3)
end
if minetest.get_modpath("farming_plus") ~= nil then
overwrite("farming_plus:carrot_item", 3)
overwrite("farming_plus:banana", 2)
overwrite("farming_plus:orange_item", 2)
overwrite("farming:pumpkin_bread", 4)
overwrite("farming_plus:strawberry_item", 2)
overwrite("farming_plus:tomato_item", 2)
overwrite("farming_plus:potato_item", 4)
overwrite("farming_plus:rhubarb_item", 2)
end
if minetest.get_modpath("mtfoods") ~= nil then
overwrite("mtfoods:dandelion_milk", 1)
overwrite("mtfoods:sugar", 1)
overwrite("mtfoods:short_bread", 4)
overwrite("mtfoods:cream", 1)
overwrite("mtfoods:chocolate", 2)
overwrite("mtfoods:cupcake", 2)
overwrite("mtfoods:strawberry_shortcake", 2)
overwrite("mtfoods:cake", 3)
overwrite("mtfoods:chocolate_cake", 3)
overwrite("mtfoods:carrot_cake", 3)
overwrite("mtfoods:pie_crust", 3)
overwrite("mtfoods:apple_pie", 3)
overwrite("mtfoods:rhubarb_pie", 2)
overwrite("mtfoods:banana_pie", 3)
overwrite("mtfoods:pumpkin_pie", 3)
overwrite("mtfoods:cookies", 2)
overwrite("mtfoods:mlt_burger", 5)
overwrite("mtfoods:potato_slices", 2)
overwrite("mtfoods:potato_chips", 3)
--mtfoods:medicine
overwrite("mtfoods:casserole", 3)
overwrite("mtfoods:glass_flute", 2)
overwrite("mtfoods:orange_juice", 2)
overwrite("mtfoods:apple_juice", 2)
overwrite("mtfoods:apple_cider", 2)
overwrite("mtfoods:cider_rack", 2)
end
if minetest.get_modpath("fruit") ~= nil then
overwrite("fruit:apple", 2)
overwrite("fruit:pear", 2)
overwrite("fruit:bananna", 3)
overwrite("fruit:orange", 2)
end
if minetest.get_modpath("mush45") ~= nil then
overwrite("mush45:meal", 4)
end
if minetest.get_modpath("seaplants") ~= nil then
overwrite("seaplants:kelpgreen", 1)
overwrite("seaplants:kelpbrown", 1)
overwrite("seaplants:seagrassgreen", 1)
overwrite("seaplants:seagrassred", 1)
overwrite("seaplants:seasaladmix", 6)
overwrite("seaplants:kelpgreensalad", 1)
overwrite("seaplants:kelpbrownsalad", 1)
overwrite("seaplants:seagrassgreensalad", 1)
overwrite("seaplants:seagrassgreensalad", 1)
end
if minetest.get_modpath("mobfcooking") ~= nil then
overwrite("mobfcooking:cooked_pork", 6)
overwrite("mobfcooking:cooked_ostrich", 6)
overwrite("mobfcooking:cooked_beef", 6)
overwrite("mobfcooking:cooked_chicken", 6)
overwrite("mobfcooking:cooked_lamb", 6)
overwrite("mobfcooking:cooked_venison", 6)
overwrite("mobfcooking:cooked_fish", 6)
end
if minetest.get_modpath("creatures") ~= nil then
overwrite("creatures:meat", 6)
overwrite("creatures:flesh", 3)
overwrite("creatures:rotten_flesh", 3, "", 3)
end
if minetest.get_modpath("ethereal") then
overwrite("ethereal:strawberry", 1)
overwrite("ethereal:banana", 4)
overwrite("ethereal:pine_nuts", 1)
overwrite("ethereal:bamboo_sprout", 0, "", 3)
overwrite("ethereal:fern_tubers", 1)
overwrite("ethereal:banana_bread", 7)
overwrite("ethereal:mushroom_plant", 2)
overwrite("ethereal:coconut_slice", 2)
overwrite("ethereal:golden_apple", 4, "", nil, 10)
overwrite("ethereal:wild_onion_plant", 2)
overwrite("ethereal:mushroom_soup", 4, "ethereal:bowl")
overwrite("ethereal:mushroom_soup_cooked", 6, "ethereal:bowl")
overwrite("ethereal:hearty_stew", 6, "ethereal:bowl", 3)
overwrite("ethereal:hearty_stew_cooked", 10, "ethereal:bowl")
if minetest.get_modpath("bucket") then
overwrite("ethereal:bucket_cactus", 2, "bucket:bucket_empty")
end
overwrite("ethereal:fish_raw", 2)
overwrite("ethereal:fish_cooked", 5)
overwrite("ethereal:seaweed", 1)
overwrite("ethereal:yellowleaves", 1, "", nil, 1)
overwrite("ethereal:sashimi", 4)
end
if minetest.get_modpath("farming") and farming.mod == "redo" then
overwrite("farming:bread", 6)
overwrite("farming:potato", 1)
overwrite("farming:baked_potato", 6)
overwrite("farming:cucumber", 4)
overwrite("farming:tomato", 4)
overwrite("farming:carrot", 3)
overwrite("farming:carrot_gold", 6, "", nil, 8)
overwrite("farming:corn", 3)
overwrite("farming:corn_cob", 5)
overwrite("farming:melon_slice", 2)
overwrite("farming:pumpkin_slice", 1)
overwrite("farming:pumpkin_bread", 9)
overwrite("farming:coffee_cup", 2, "farming:drinking_cup")
overwrite("farming:coffee_cup_hot", 3, "farming:drinking_cup", nil, 2)
overwrite("farming:cookie", 2)
overwrite("farming:chocolate_dark", 3)
overwrite("farming:donut", 4)
overwrite("farming:donut_chocolate", 6)
overwrite("farming:donut_apple", 6)
overwrite("farming:raspberries", 1)
if minetest.get_modpath("vessels") then
overwrite("farming:smoothie_raspberry", 2, "vessels:drinking_glass")
end
overwrite("farming:rhubarb", 1)
overwrite("farming:rhubarb_pie", 6)
end
if minetest.get_modpath("kpgmobs") ~= nil then
overwrite("kpgmobs:uley", 3)
overwrite("kpgmobs:meat", 6)
overwrite("kpgmobs:rat_cooked", 5)
overwrite("kpgmobs:med_cooked", 4)
if minetest.get_modpath("bucket") then
overwrite("kpgmobs:bucket_milk", 4, "bucket:bucket_empty")
end
end
if minetest.get_modpath("jkfarming") ~= nil then
overwrite("jkfarming:carrot", 3)
overwrite("jkfarming:corn", 3)
overwrite("jkfarming:melon_part", 2)
overwrite("jkfarming:cake", 3)
end
if minetest.get_modpath("jkanimals") ~= nil then
overwrite("jkanimals:meat", 6)
end
if minetest.get_modpath("jkwine") ~= nil then
overwrite("jkwine:grapes", 2)
overwrite("jkwine:winebottle", 1)
end
-- player-action based hunger changes
function hud.handle_node_actions(pos, oldnode, player, ext)
if not player or not player:is_player() then
return
end
local name = player:get_player_name()
local exhaus = hud.exhaustion[name]
local new = HUD_HUNGER_EXHAUST_PLACE
-- placenode event
if not ext then
new = HUD_HUNGER_EXHAUST_DIG
end
-- assume its send by main timer when movement detected
if not pos and not oldnode then
new = HUD_HUNGER_EXHAUST_MOVE
end
exhaus = exhaus + new
if exhaus > HUD_HUNGER_EXHAUST_LVL then
exhaus = 0
local h = tonumber(hud.hunger[name])
h = h - 1
if h < 0 then h = 0 end
hud.hunger[name] = h
hud.set_hunger(player)
end
hud.exhaustion[name] = exhaus
end
minetest.register_on_placenode(hud.handle_node_actions)
minetest.register_on_dignode(hud.handle_node_actions)
|
-----------------------------------
-- Area: Metalworks
-- NPC: Franziska
-- Type: Standard Info NPC
-----------------------------------
function onTrade(player,npc,trade)
end;
function onTrigger(player,npc)
if (player:getCharVar("OptionalcsCornelia") ==1) then
player:startEvent(777);
else
player:startEvent(620);
end
end;
function onEventUpdate(player,csid,option)
end;
function onEventFinish(player,csid,option)
if (csid == 777) then
player:setCharVar("OptionalcsCornelia",0);
end
end;
|
local Queue = require "util.queue"
local NoteInfo = require "noteinfo"
local MidiSignals = require "midisignals"
local NoteWave = require "notewave"
local SampleProvider = require "sampleprovider"
local MidiState = require "util.class" "MidiState"
function MidiState:__init()
self._sampleProvider = SampleProvider:new()
self._notesByIndex = self:_createNoteArray()
self._noteWaves = {}
self._playingCount = 0
end
function MidiState:_createNoteArray()
local noteArray = {}
-- 88 keys
for noteIndex = 1, 88 do
noteArray[noteIndex] = false
end
return noteArray
end
function MidiState:playNote(note, speed, time)
local noteIndex = NoteInfo.getNoteIndex(note)
if self._notesByIndex[noteIndex] then
printf("WARNING: Mismatched MIDI PLAY_NOTE for %s!", NoteInfo.getNoteName(note))
return
end
self._notesByIndex[noteIndex] = true
self._noteWaves[note] = NoteWave:new(note, speed, time)
self._playingCount = self._playingCount + 1
end
function MidiState:stopNote(note, speed, time)
local noteIndex = NoteInfo.getNoteIndex(note)
if not self._notesByIndex[noteIndex] then
printf("WARNING: Mismatched MIDI STOP_NOTE for %s!", NoteInfo.getNoteName(note))
return
end
self._notesByIndex[noteIndex] = false
self._noteWaves[note]:setStopTime(time)
self._playingCount = self._playingCount - 1
end
function MidiState:isPlaying()
return self._playingCount > 0
end
function MidiState:getPlayingNotes()
local noteWaves = {}
local i = 1
for noteIndex, noteState in ipairs(self._notesByIndex) do
local note = NoteInfo.getNoteFromIndex(noteIndex)
local noteWave = self._noteWaves[note]
if noteWave then
noteWaves[i] = noteWave
i = i + 1
end
end
return noteWaves
end
function MidiState:generateSamples(timeStamp)
return self._sampleProvider:generateBuffers(timeStamp, self:getPlayingNotes())
end
function MidiState:cleanMuteNotes()
local lastTimeStamp = self._sampleProvider:getLastTimeStamp()
local tbd = {}
for note, noteWave in pairs(self._noteWaves) do
if noteWave:isDead(lastTimeStamp) then
tbd[note] = true
end
end
for note in pairs(tbd) do
self._noteWaves[note] = nil
end
end
return MidiState
|
-- ESC/VP.net protocol dissector for Wireshark
-- Version 0.1.0
-- Author H.Doi
escvpnet = Proto("ESCVPNET","ESC/VP.net")
typeid = {
[0] = "NULL (reserved)",
[1] = "HELLO",
[2] = "PASSWORD",
[3] = "CONNECT"
}
statuscode = {
[0x00] = "Always set 0x00 since it is a request",
[0x20] = "OK",
[0x40] = "Bad Request",
[0x41] = "Unauthorized",
[0x43] = "Forbidden",
[0x45] = "Request not allowed",
[0x53] = "Service Unavailable",
[0x55] = "Protocol Version Not Supported"
}
header_id = {
[0] = "NULL (reserved)",
[1] = "Password",
[2] = "New-Password",
[3] = "Projector-Name",
[4] = "IM-Type",
[5] = "Projector-Command-Type",
}
header_attr_password = {
[0] = "no password",
[1] = "Plain (no encoding)"
}
header_attr_projectorname = {
[0] = "no projector name",
[1] = "US-ASCII",
[2] = "Shift-JIS (Reserved)",
[3] = "EUC-JP (Reserved)"
}
header_attr_imtype = {
[10] = "(Reserved)",
[11] = "(Reserved)",
[12] = "Type D",
[13] = "(Reserved)",
[14] = "(Reserved)",
[15] = "(Reserved)",
[16] = "Type A",
[17] = "(Reserved)",
[18] = "(Reserved)",
[19] = "(Reserved)",
[20] = "Initial model of EMP/PL-735",
[21] = "Type C, Type E",
[22] = "Type F",
[23] = "Type G",
[24] = "(Reserved)",
[25] = "(Reserved)",
[26] = "(Reserved)",
[27] = "(Reserved)",
[28] = "(Reserved)",
[29] = "(Reserved)",
[30] = "Type B",
[31] = "(Reserved)",
[32] = "(Reserved)",
[33] = "(Reserved)",
[34] = "(Reserved)",
[35] = "(Reserved)",
[36] = "(Reserved)",
[37] = "(Reserved)",
[38] = "(Reserved)",
[39] = "(Reserved)",
[40] = "Type H",
[41] = "Type I",
[42] = "Type J",
[43] = "(Reserved)",
[44] = "(Reserved)",
[45] = "(Reserved)",
[46] = "(Reserved)",
[47] = "(Reserved)",
[48] = "(Reserved)",
[49] = "(Reserved)",
[50] = "Type K",
[51] = "(Reserved)",
[52] = "(Reserved)",
[53] = "(Reserved)",
[54] = "(Reserved)",
[55] = "(Reserved)",
[56] = "(Reserved)",
[57] = "(Reserved)",
[58] = "(Reserved)",
[59] = "(Reserved)"
}
header_attr_projectorcommandtype = {
[0x22] = "ESC/VP Level6 (Reserved)",
[0x31] = "ESC/VP21 Ver1.0"
}
clientlist = {}
escvpnet.fields.typeid = ProtoField.uint8("escvpnet.typeid", "Type identifier", base.HEX, typeid)
escvpnet.fields.statuscode = ProtoField.uint8("escvpnet.statuscode", "Status code", base.HEX, statuscode)
escvpnet.fields.numberofheaders = ProtoField.uint8("escvpnet.numberofheaders", "Number of headers", base.HEX)
escvpnet.fields.header_id = ProtoField.uint8("escvpnet.header.id", "Header identifier", base.HEX, header_id)
escvpnet.fields.header_attr_password = ProtoField.uint8("escvpnet.header.attr.password", "Header attribute value", base.HEX, header_attr_password)
escvpnet.fields.header_attr_projectorname = ProtoField.uint8("escvpnet.header.attr.projectorname", "Header attribute value", base.HEX, header_attr_projectorname)
escvpnet.fields.header_attr_imtype = ProtoField.uint8("escvpnet.header.attr.imtype", "Header attribute value", base.HEX, header_attr_imtype)
escvpnet.fields.header_attr_projectorcommandtype = ProtoField.uint8("escvpnet.header.attr.projectorcommandtype", "Header attribute value", base.HEX, header_attr_projectorcommandtype)
escvpnet.fields.header_information = ProtoField.string("escvpnet.header.information", "Header information")
function escvpnet.dissector(buffer, pinfo, tree)
local datalen = buffer:len()
local src = tostring(pinfo.src)
local seqtype = ""
pinfo.cols.protocol = escvpnet.description
if datalen < 16 or buffer(0, 10):string() ~= "ESC/VP.net" then
if clientlist[src] ~= nil then
seqtype = "Command"
else
seqtype = "Return code"
end
pinfo.cols.info = seqtype
local subtree = tree:add(escvpnet, buffer(), escvpnet.description .. " (" .. seqtype .. ")")
local offset = 0
for i = 0, datalen - 1 do
local code = buffer(i, 1):uint()
if code == 0x0d or code == 0x3a then
local val = buffer(offset, i - offset + 1):string()
pinfo.cols.info:append(" " .. val)
if code == 0x0d then
val = val .. "¥r"
end
local item = subtree:add(buffer(offset, i - offset + 1), val)
offset = i + 1
end
end
return
end
local status = buffer(14, 1):uint()
if status == 0 then
seqtype = "Request"
else
seqtype = "Response"
end
local subtree = tree:add(escvpnet, buffer(), escvpnet.description .. " (" .. seqtype .. ")")
subtree:add(buffer(0, 10), "Protocol identifier:", buffer(0, 10):string())
local ver = buffer(10, 1):uint()
subtree:add(buffer(10, 1), "Version identifier:", bit32.rshift(ver, 4) .. "." .. bit32.band(ver, 0x0f))
subtree:add(escvpnet.fields.typeid, buffer(11, 1))
subtree:add(escvpnet.fields.statuscode, buffer(14, 1))
subtree:add(escvpnet.fields.numberofheaders, buffer(15, 1))
if (buffer(11, 1):uint() == 3 and buffer(14, 1):uint() == 0) then
clientlist[src] = pinfo.number
end
local typestr = typeid[buffer(11, 1):uint()] or "Unknown"
local statusstr = statuscode[buffer(14, 1):uint()] or "Unknown"
pinfo.cols.info = seqtype .. " " .. typestr .. " " .. statusstr
local headersize = buffer(15, 1):uint()
if headersize == 0 then
return
end
local offset = 16
for i = 1, headersize do
local htree = subtree:add(buffer(offset, 18), "Header " .. i)
htree:add(escvpnet.fields.header_id, buffer(offset, 1))
local htype = buffer(offset, 1):uint()
if htype == 1 or htype == 2 then
htree:add(escvpnet.fields.header_attr_password, buffer(offset + 1, 1))
elseif htype == 3 then
htree:add(escvpnet.fields.header_attr_projectorname, buffer(offset + 1, 1))
elseif htype == 4 then
htree:add(escvpnet.fields.header_attr_imtype, buffer(offset + 1, 1))
elseif htype == 5 then
htree:add(escvpnet.fields.header_attr_projectorcommandtype, buffer(offset + 1, 1))
end
htree:add(escvpnet.fields.header_information, buffer(offset + 2, 16))
offset = offset + 18
end
end
udp_table = DissectorTable.get("udp.port")
udp_table:add(3629, escvpnet)
tcp_table = DissectorTable.get("tcp.port")
tcp_table:add(3629, escvpnet)
|
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if item.itemid ~= 5114 then
return true
end
if player:getStorageValue(Storage.TheInquisition.Questline) == 18 then
player:teleportTo(toPosition, true)
item:transform(5115)
end
return true
end |
--[[NIGHTOWLACE_WEAPONRY]]--
--Works, But no Damage, Definitely Needs a fix.--
wait(1 / 60)
Effects = { }
local Player = game.Players.localPlayer
local Character = Player.Character
local Humanoid = Character.Humanoid
local mouse = Player:GetMouse()
local m = Instance.new('Model', Character)
m.Name = "WeaponModel"
local LeftArm = Character["Left Arm"]
local RightArm = Character["Right Arm"]
local LeftLeg = Character["Left Leg"]
local RightLeg = Character["Right Leg"]
local Head = Character.Head
local Torso = Character.Torso
local cam = game.Workspace.CurrentCamera
local RootPart = Character.HumanoidRootPart
local RootJoint = RootPart.RootJoint
local equipped = false
local attack = false
local Anim = 'Idle'
local idle = 0
local attacktype = 1
local Torsovelocity = (RootPart.Velocity * Vector3.new(1, 0, 1)).magnitude
local velocity = RootPart.Velocity.y
local sine = 0
local change = 1
local grabbed = false
local cn = CFrame.new
local mr = math.rad
local angles = CFrame.Angles
local ud = UDim2.new
local c3 = Color3.new
local NeckCF = cn(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
Humanoid.Animator:Destroy()
Character.Animate:Destroy()
local RootCF = CFrame.fromEulerAnglesXYZ(-1.57, 0, 3.14)
local RHCF = CFrame.fromEulerAnglesXYZ(0, 1.6, 0)
local LHCF = CFrame.fromEulerAnglesXYZ(0, -1.6, 0)
RSH, LSH = nil, nil
RW = Instance.new("Weld")
LW = Instance.new("Weld")
RH = Torso["Right Hip"]
LH = Torso["Left Hip"]
RSH = Torso["Right Shoulder"]
LSH = Torso["Left Shoulder"]
RSH.Parent = nil
LSH.Parent = nil
RW.Name = "RW"
RW.Part0 = Torso
RW.C0 = cn(1.5, 0.5, 0)
RW.C1 = cn(0, 0.5, 0)
RW.Part1 = RightArm
RW.Parent = Torso
LW.Name = "LW"
LW.Part0 = Torso
LW.C0 = cn(-1.5, 0.5, 0)
LW.C1 = cn(0, 0.5, 0)
LW.Part1 = LeftArm
LW.Parent = Torso
function clerp(a, b, t)
return a:lerp(b, t)
end
--[[Credits to SazErenos for his Artificial Heartbeat]]--
ArtificialHB = Instance.new("BindableEvent", script)
ArtificialHB.Name = "Heartbeat"
script:WaitForChild("Heartbeat")
frame = 1 / 30
tf = 0
allowframeloss = false
tossremainder = false
lastframe = tick()
script.Heartbeat:Fire()
game:GetService("RunService").Heartbeat:connect(function(s, p)
tf = tf + s
if tf >= frame then
if allowframeloss then
script.Heartbeat:Fire()
lastframe = tick()
else
for i = 1, math.floor(tf / frame) do
script.Heartbeat:Fire()
end
lastframe = tick()
end
if tossremainder then
tf = 0
else
tf = tf - frame * math.floor(tf / frame)
end
end
end)
function swait(num)
if num == 0 or num == nil then
ArtificialHB.Event:wait()
else
for i = 0, num do
ArtificialHB.Event:wait()
end
end
end
local RbxUtility = LoadLibrary("RbxUtility")
local Create = RbxUtility.Create
--[[ Credits to Fenrier for Outline-Remover, Part, Mesh, Weld, Raycase and Sound Creation functions ]]--
function RemoveOutlines(part)
part.TopSurface, part.BottomSurface, part.LeftSurface, part.RightSurface, part.FrontSurface, part.BackSurface = 10, 10, 10, 10, 10, 10
end
function CreatePart(Parent, Material, Reflectance, Transparency, BColor, Name, Size)
local Part = Create("Part"){
Parent = Parent,
Reflectance = Reflectance,
Transparency = Transparency,
CanCollide = false,
Locked = true,
BrickColor = BrickColor.new(tostring(BColor)),
Name = Name,
Size = Size,
Material = Material,
}
RemoveOutlines(Part)
return Part
end
function CreateMesh(Mesh, Part, MeshType, MeshId, OffSet, Scale)
local Msh = Create(Mesh){
Parent = Part,
Offset = OffSet,
Scale = Scale,
}
if Mesh == "SpecialMesh" then
Msh.MeshType = MeshType
Msh.MeshId = MeshId
end
return Msh
end
function CreateWeld(Parent, Part0, Part1, C0, C1)
local Weld = Create("Weld"){
Parent = Parent,
Part0 = Part0,
Part1 = Part1,
C0 = C0,
C1 = C1,
}
return Weld
end
function CreateBillBoardGui(Img, Pos, Siz) --returns a basic billboard gui object for further manipulation
local billpar = Create("Part"){
Transparency = 1,
Size = Vector3.new(1, 1, 1),
Anchored = true,
CanCollide = false,
CFrame = CFrame.new(Pos),
Name = "BillboardGuiPart",
}
local bill = Create("BillboardGui"){
Parent = billpar,
Adornee = billpar,
Size = UDim2.new(1, 0, 1, 0),
SizeOffset = Vector2.new(Siz, Siz),
}
local d = Create("ImageLabel"){
Parent = bill,
BackgroundTransparency = 1,
Size = UDim2.new(1, 0, 1, 0),
Image = Img,
}
return billpar
end
function rayCast(Position, Direction, Range, Ignore)
return game:service("Workspace"):FindPartOnRay(Ray.new(Position, Direction.unit * (Range or 999.999)), Ignore)
end
function CreateSound(id, par, vol, pit)
coroutine.resume(coroutine.create(function()
local S = Create("Sound"){
Volume = vol,
Pitch = pit or 1,
SoundId = id,
Parent = par or workspace,
}
swait()
S:play()
game:GetService("Debris"):AddItem(S, 6)
end))
end
local function GetNearest(obj, distance)
local last, lastx = distance + 1
for i, v in pairs(workspace:GetChildren()) do
if v:IsA'Model' and v ~= Character and v:findFirstChild('Humanoid') and v:findFirstChild('Torso') and v:findFirstChild('Humanoid').Health > 0 then
local t = v.Torso
local dist = (t.Position - obj.Position).magnitude
if dist <= distance then
if dist < last then
last = dist
lastx = v
end
end
end
end
return lastx
end
--[[ Credits to Kert109 (Ninja_Deer) for the Damage function. Fenrier for the Magnitude Damage ]]--
function Damage(hit, damage, cooldown, Color1, Color2, HSound, HPitch)
for i, v in pairs(hit:GetChildren()) do
if v:IsA("Humanoid") and hit.Name ~= Character.Name then
local find = v:FindFirstChild("DebounceHit")
if not find then
if v.Parent:findFirstChild("Head") then
local BillG = Create("BillboardGui"){
Parent = v.Parent.Head,
Size = UDim2.new(1, 0, 1, 0),
Adornee = v.Parent.Head,
StudsOffset = Vector3.new(math.random(-3, 3), math.random(3, 5), math.random(-3, 3)),
}
local TL = Create("TextLabel"){
Parent = BillG,
Size = UDim2.new(3, 3, 3, 3),
BackgroundTransparency = 1,
Text = tostring(damage).."-",
TextColor3 = Color1.Color,
TextStrokeColor3 = Color2.Color,
TextStrokeTransparency = 0,
TextXAlignment = Enum.TextXAlignment.Center,
TextYAlignment = Enum.TextYAlignment.Center,
FontSize = Enum.FontSize.Size18,
Font = "ArialBold",
}
coroutine.resume(coroutine.create(function()
swait(1)
for i = 0, 1, .1 do
swait(.1)
BillG.StudsOffset = BillG.StudsOffset + Vector3.new(0, .1, 0)
end
BillG:Destroy()
end))
end
v.Health = v.Health - damage
local bool = Create("BoolValue"){
Parent = v,
Name = "DebounceHit",
}
if HSound ~= nil and HPitch ~= nil then
CreateSound(HSound, hit, 1, HPitch)
end
game:GetService("Debris"):AddItem(bool, cooldown)
end
end
end
end
function MagnitudeDamage(Part, magni, mindam, maxdam, Color1, Color2, HSound, HPitch)
for _, c in pairs(workspace:children()) do
local hum = c:findFirstChild("Humanoid")
if hum ~= nil then
local head = c:findFirstChild("Torso")
if head ~= nil then
local targ = head.Position - Part.Position
local mag = targ.magnitude
if mag <= magni and c.Name ~= Player.Name then
Damage(head.Parent, math.random(mindam, maxdam), 0.5, Color1, Color2, HSound, HPitch)
end
end
end
end
end
BowHandle = CreatePart(m, Enum.Material.SmoothPlastic, 0, 1, "Really black", "BowHandle", Vector3.new(0.225280017, 0.788480043, 0.220000014))
BowHandleWeld = CreateWeld(m, Character["Left Arm"], BowHandle, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-0.985027075, -0.0129547119, 0.179504395, -4.25198756e-008, -1, 4.70876694e-006, 2.4576444e-008, 4.70876694e-006, 1, -1, 4.25199929e-008, 2.45762433e-008))
CreateMesh("CylinderMesh", BowHandle, "", "", Vector3.new(0, 0, 0), Vector3.new(1, 1, 0.512000144))
BowFakeHandle = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Really black", "BowFakeHandle", Vector3.new(0.225280017, 0.788480043, 0.220000014))
BowFakeHandleWeld = CreateWeld(m, BowHandle, BowFakeHandle, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0, 0, 0, 1, 0, -1.51575529e-015, 0, 1, 0, -1.51575529e-015, 0, 1))
CreateMesh("CylinderMesh", BowFakeHandle, "", "", Vector3.new(0, 0, 0), Vector3.new(1, 1, 0.512000144))
FakeArrow = CreatePart(m, Enum.Material.SmoothPlastic, 0, 1, "Black", "FakeArrow", Vector3.new(0.220000014, 0.220000014, 3.82976031))
FakeArrowWeld = CreateWeld(m, BowFakeHandle, FakeArrow, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-0.000701904297, -3.05175781e-005, -1.28746033e-005, 0.000362217397, -0.999999881, -0.000362451508, -4.614364e-007, 0.000362451421, -1, 1, 0.000362217601, -3.30150129e-007))
CreateMesh("SpecialMesh", FakeArrow, Enum.MeshType.FileMesh, "http://www.roblox.com/asset/?id=15887356", Vector3.new(0, 0, 0), Vector3.new(0.563200057, 0.675840139, 1.68960023))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Cool yellow", "Part", Vector3.new(0.220000014, 0.220000014, 0.225280017))
PartWeld = CreateWeld(m, BowFakeHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0.423294067, -0.000366210938, -0.701477051, 0.70710665, 0.707106948, -3.29177752e-008, 7.15684365e-008, -2.50156571e-008, 1, 0.707106948, -0.70710665, -6.82952788e-008))
CreateMesh("CylinderMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(0.512000144, 0.563200057, 1))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Cool yellow", "Part", Vector3.new(0.220000014, 1.68960023, 0.220000014))
PartWeld = CreateWeld(m, BowFakeHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0, 1.78413391, 2.0454483, 6.94149378e-008, -2.71691221e-008, 1, 0.707106888, 0.707106709, -2.9872318e-008, -0.707106709, 0.707106888, 6.82952432e-008))
CreateMesh("BlockMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(0.563200057, 1, 0.512000144))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Cool yellow", "Part", Vector3.new(0.220000014, 0.788480043, 0.220000014))
PartWeld = CreateWeld(m, BowFakeHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0, -1.09571838, 0.423282623, 6.94149378e-008, -2.71691221e-008, 1, 0.707106292, -0.707107365, -6.8295229e-008, 0.707107365, 0.707106292, -2.98723606e-008))
CreateMesh("BlockMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(0.563200057, 1, 0.512000144))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Black", "Part", Vector3.new(0.450560033, 0.220000014, 0.563200057))
PartWeld = CreateWeld(m, BowFakeHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-1.16461945, 0, -2.0454483, -0.707106888, -0.707106709, 6.27209218e-008, -7.15714066e-008, -1.71293646e-008, -1, 0.707106709, -0.707106888, -3.84963315e-008))
CreateMesh("BlockMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(1, 0.512000144, 1))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Cool yellow", "Part", Vector3.new(0.33792007, 0.220000014, 0.450560033))
PartWeld = CreateWeld(m, BowFakeHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-2.12782288, 0, 0.742296457, -6.40749931e-007, -1, -2.27882158e-008, 6.94149449e-008, -2.27882619e-008, 1, -1, 6.40749931e-007, 6.94149662e-008))
CreateMesh("CylinderMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(1, 0.563200057, 1))
Wedge = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Black", "Wedge", Vector3.new(0.220000014, 0.220000014, 0.220000014))
WedgeWeld = CreateWeld(m, BowFakeHandle, Wedge, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0.000366210938, 0.168947458, -0.338066101, -6.94149804e-008, -3.24350893e-008, -1, -1, 4.61936452e-007, 6.9414952e-008, 4.61936452e-007, 1, -3.24351248e-008))
CreateMesh("SpecialMesh", Wedge, Enum.MeshType.Wedge, "", Vector3.new(0, 0, 0), Vector3.new(0.512000144, 0.512000144, 0.512000144))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Institutional white", "Part", Vector3.new(0.225280017, 0.225280017, 0.220000014))
PartWeld = CreateWeld(m, BowFakeHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(4.529953e-006, -0.281555176, 0.001953125, 1, 0, -1.51575529e-015, 0, 1, 0, -1.51575529e-015, 0, 1))
CreateMesh("CylinderMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(1, 1, 0.588800073))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Black", "Part", Vector3.new(0.563200057, 0.220000014, 0.675840139))
PartWeld = CreateWeld(m, BowFakeHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-0.445208549, 0, 3.3405304, -1, 6.40749931e-007, 6.93517848e-008, 6.93517705e-008, -2.71691203e-008, 1, 6.40749931e-007, 1, 2.71690741e-008))
CreateMesh("CylinderMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(1, 0.512000144, 1))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Institutional white", "Part", Vector3.new(0.225280017, 0.225280017, 0.220000014))
PartWeld = CreateWeld(m, BowFakeHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(5.24520874e-006, 0.281600952, 0.001953125, 1, 0, -1.51575529e-015, 0, 1, 0, -1.51575529e-015, 0, 1))
CreateMesh("CylinderMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(1, 1, 0.588800073))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Cool yellow", "Part", Vector3.new(0.33792007, 0.220000014, 0.450560033))
PartWeld = CreateWeld(m, BowFakeHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-0.445208549, 0, 3.3405304, -1, 6.40749931e-007, 6.93517848e-008, 6.93517705e-008, -2.71691203e-008, 1, 6.40749931e-007, 1, 2.71690741e-008))
CreateMesh("CylinderMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(1, 0.563200057, 1))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Black", "Part", Vector3.new(1.23904014, 0.220000014, 0.563200057))
PartWeld = CreateWeld(m, BowFakeHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-2.00939178, 0, -2.04543304, -0.707106888, -0.707106709, 6.27209218e-008, -7.15714066e-008, -1.71293646e-008, -1, 0.707106709, -0.707106888, -3.84963315e-008))
CreateMesh("BlockMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(1, 0.512000144, 1))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Black", "Part", Vector3.new(0.220000014, 0.220000014, 0.518144011))
PartWeld = CreateWeld(m, BowFakeHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0.450569153, 0, 0.146412134, 4.61936452e-007, 1, 2.01980033e-008, -1.0781276e-007, 2.01980548e-008, -1, -1, 4.61936452e-007, 1.07812767e-007))
CreateMesh("BlockMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(0.512000144, 0.512000144, 1))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Cool yellow", "Part", Vector3.new(0.220000014, 1.68960023, 0.220000014))
PartWeld = CreateWeld(m, BowFakeHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0.000366210938, 1.78420258, 2.04552078, -6.94149804e-008, -3.24350893e-008, -1, 0.707106173, -0.707107425, -2.61486655e-008, -0.707107425, -0.707106173, 7.20188922e-008))
CreateMesh("BlockMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(0.563200057, 1, 0.512000144))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Black", "Part", Vector3.new(0.220000014, 0.220000014, 0.220000014))
PartWeld = CreateWeld(m, BowFakeHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0.337890625, 0, 0.315387607, 4.61936452e-007, 1, 2.01980033e-008, -1.0781276e-007, 2.01980548e-008, -1, -1, 4.61936452e-007, 1.07812767e-007))
CreateMesh("BlockMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(0.512000144, 0.512000144, 0.819200039))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Black", "Part", Vector3.new(0.220000014, 0.269084811, 0.220000014))
PartWeld = CreateWeld(m, BowFakeHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-1.99462128, 1.2387228, 0, -0.176393285, -0.984319806, -1.01567883e-008, -0.984319806, 0.17639327, 7.22781337e-008, -6.93531845e-008, 2.27469013e-008, -1))
CreateMesh("BlockMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(0.961045921, 1, 0.512000144))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Black", "Part", Vector3.new(0.489984065, 0.220000014, 0.405504048))
PartWeld = CreateWeld(m, BowFakeHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0.751953125, -0.000366210938, 0.20273602, -7.4505806e-007, -1, 3.6816779e-008, 3.10171231e-008, 3.68167683e-008, 1, -1, 7.4505806e-007, 3.10171053e-008))
CreateMesh("BlockMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(1, 0.512000144, 1))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Black", "Part", Vector3.new(0.220000014, 0.788480163, 0.563200057))
PartWeld = CreateWeld(m, BowFakeHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0, -1.70729828, -0.736948133, 6.94149378e-008, -2.71691221e-008, 1, -6.40749931e-007, -1, -2.71690759e-008, 1, -6.40749931e-007, -6.94149662e-008))
CreateMesh("BlockMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(0.512000144, 1, 1))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Cool yellow", "Part", Vector3.new(0.220000014, 0.675840139, 0.220000014))
PartWeld = CreateWeld(m, BowFakeHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0.000366210938, -1.65105438, -0.736956716, -6.94149804e-008, -3.24350893e-008, -1, 6.40749931e-007, 1, -3.24351319e-008, 1, -6.40749931e-007, -6.9414952e-008))
CreateMesh("BlockMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(0.563200057, 1, 0.512000144))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Institutional white", "Part", Vector3.new(0.225280017, 0.220000014, 0.220000014))
PartWeld = CreateWeld(m, BowFakeHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(4.05311584e-006, 6.10351563e-005, 0.001953125, 1, 0, -1.51575529e-015, 0, 1, 0, -1.51575529e-015, 0, 1))
CreateMesh("CylinderMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(1, 0.512000144, 0.588800073))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Black", "Part", Vector3.new(0.33792007, 0.220000014, 0.563200057))
PartWeld = CreateWeld(m, BowFakeHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0.870513916, -0.000366210938, -0.423362732, -0.707107067, -0.707106471, 1.80172606e-008, 5.54801183e-008, -2.99998959e-008, 1, -0.707106471, 0.707107067, 6.04434973e-008))
CreateMesh("BlockMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(1, 0.512000144, 1))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Black", "Part", Vector3.new(0.220000014, 0.269084811, 0.220000014))
PartWeld = CreateWeld(m, BowFakeHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-1.99471283, 1.23874283, -0.000366210938, -0.176392093, 0.984319985, 3.46585622e-008, -0.984319985, -0.176392093, 6.05221331e-008, 6.56866419e-008, -2.34394903e-008, 1))
CreateMesh("BlockMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(0.961045921, 1, 0.512000144))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Black", "Part", Vector3.new(0.220000014, 0.788480163, 0.563200057))
PartWeld = CreateWeld(m, BowFakeHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0.000366210938, -1.70736694, -0.736947894, -6.94149804e-008, -3.24350893e-008, -1, 6.40749931e-007, 1, -3.24351319e-008, 1, -6.40749931e-007, -6.9414952e-008))
CreateMesh("BlockMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(0.512000144, 1, 1))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Black", "Part", Vector3.new(0.450560033, 0.220000014, 0.563200057))
PartWeld = CreateWeld(m, BowFakeHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(1.26467896, 0, -0.423290253, -0.707106292, 0.707107365, 9.49445536e-008, -1.09325214e-007, 2.49467114e-008, -1, -0.707107365, -0.707106292, 5.96646856e-008))
CreateMesh("BlockMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(1, 0.512000144, 1))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Black", "Part", Vector3.new(0.450560033, 0.220000014, 0.563200057))
PartWeld = CreateWeld(m, BowFakeHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(1.26478195, -0.000366210938, -0.42338562, -0.707107067, -0.707106471, 1.80172606e-008, 5.54801183e-008, -2.99998959e-008, 1, -0.707106471, 0.707107067, 6.04434973e-008))
CreateMesh("BlockMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(1, 0.512000144, 1))
Wedge = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Black", "Wedge", Vector3.new(0.220000014, 0.220000014, 0.220000014))
WedgeWeld = CreateWeld(m, BowFakeHandle, Wedge, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0, 0.341503143, -1.47247314, 1.42978507e-007, -9.15196949e-008, 1, -0.925511479, -0.378719747, 9.76679502e-008, 0.378719717, -0.92551142, -1.38851306e-007))
CreateMesh("SpecialMesh", Wedge, Enum.MeshType.Wedge, "", Vector3.new(0, 0, 0), Vector3.new(0.511992276, 0.944333315, 0.395894557))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Black", "Part", Vector3.new(0.563200057, 0.220000014, 0.675840139))
PartWeld = CreateWeld(m, BowFakeHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-0.433936357, 0.000366210938, 3.32937622, -1, 6.40749931e-007, 6.93517848e-008, -6.93517705e-008, 2.71691221e-008, -1, -6.40749931e-007, -1, -2.71690741e-008))
CreateMesh("CylinderMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(1, 0.512000144, 1))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Cool yellow", "Part", Vector3.new(0.220000014, 0.788480163, 0.220000014))
PartWeld = CreateWeld(m, BowFakeHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0, -1.70729828, -0.736961126, 6.94149378e-008, -2.71691221e-008, 1, -6.40749931e-007, -1, -2.71690759e-008, 1, -6.40749931e-007, -6.94149662e-008))
CreateMesh("BlockMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(0.563200057, 1, 0.512000144))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Black", "Part", Vector3.new(0.220000014, 0.220000014, 0.518144011))
PartWeld = CreateWeld(m, BowFakeHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0.450660706, -0.000366210938, 0.146410823, -7.4505806e-007, -1, 3.6816779e-008, 3.10171231e-008, 3.68167683e-008, 1, -1, 7.4505806e-007, 3.10171053e-008))
CreateMesh("BlockMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(0.512000144, 0.512000144, 1))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Cool yellow", "Part", Vector3.new(0.33792007, 0.220000014, 0.450560033))
PartWeld = CreateWeld(m, BowFakeHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-0.433936357, 0.000366210938, 3.32937622, -1, 6.40749931e-007, 6.93517848e-008, -6.93517705e-008, 2.71691221e-008, -1, -6.40749931e-007, -1, -2.71690741e-008))
CreateMesh("CylinderMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(1, 0.563200057, 1))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Black", "Part", Vector3.new(0.220000014, 0.220000014, 0.220000014))
PartWeld = CreateWeld(m, BowFakeHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0.338058472, -0.000366210938, 0.315390348, -7.4505806e-007, -1, 3.6816779e-008, 3.10171231e-008, 3.68167683e-008, 1, -1, 7.4505806e-007, 3.10171053e-008))
CreateMesh("BlockMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(0.512000144, 0.512000144, 0.819200039))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Black", "Part", Vector3.new(1.23904014, 0.220000014, 0.563200057))
PartWeld = CreateWeld(m, BowFakeHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-2.00945282, -0.000366210938, -2.04550171, -0.707106113, 0.707107484, -2.42653826e-008, 6.00121624e-008, 9.43284562e-008, 1, 0.707107484, 0.707106113, -1.09135279e-007))
CreateMesh("BlockMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(1, 0.512000144, 1))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Black", "Part", Vector3.new(0.450560033, 0.220000014, 0.563200057))
PartWeld = CreateWeld(m, BowFakeHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-1.16465759, -0.000381469727, -2.04548264, -0.707106113, 0.707107484, -2.42653826e-008, 6.00121624e-008, 9.43284562e-008, 1, 0.707107484, 0.707106113, -1.09135279e-007))
CreateMesh("BlockMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(1, 0.512000144, 1))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Black", "Part", Vector3.new(0.489984065, 0.220000014, 0.405504048))
PartWeld = CreateWeld(m, BowFakeHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0.75189209, 0, 0.202737808, 4.61936452e-007, 1, 2.01980033e-008, -1.0781276e-007, 2.01980548e-008, -1, -1, 4.61936452e-007, 1.07812767e-007))
CreateMesh("BlockMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(1, 0.512000144, 1))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Cool yellow", "Part", Vector3.new(0.33792007, 0.220000014, 0.450560033))
PartWeld = CreateWeld(m, BowFakeHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-2.12789917, 0.000366210938, 0.742304683, 6.40749931e-007, 1, -3.68167576e-008, -6.94149733e-008, -3.68167079e-008, -1, -1, 6.40749931e-007, 6.9414952e-008))
CreateMesh("CylinderMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(1, 0.563200057, 1))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Black", "Part", Vector3.new(0.33792007, 0.220000014, 0.563200057))
PartWeld = CreateWeld(m, BowFakeHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0.870441437, 0, -0.423290253, -0.707106292, 0.707107365, 9.49445536e-008, -1.09325214e-007, 2.49467114e-008, -1, -0.707107365, -0.707106292, 5.96646856e-008))
CreateMesh("BlockMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(1, 0.512000144, 1))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Cool yellow", "Part", Vector3.new(0.220000014, 0.220000014, 0.225280017))
PartWeld = CreateWeld(m, BowFakeHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0.423347473, 0, -0.701530457, 0.707105875, -0.707107723, -1.24747032e-007, -1.51243015e-007, 2.51760834e-008, -1, 0.707107723, 0.707105875, -8.91429579e-008))
CreateMesh("CylinderMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(0.512000144, 0.563200057, 1))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Cool yellow", "Part", Vector3.new(0.220000014, 0.788480043, 0.220000014))
PartWeld = CreateWeld(m, BowFakeHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0.000366210938, -1.09579849, 0.423362732, -6.94149804e-008, -3.24350893e-008, -1, 0.707107067, 0.707106531, -7.20188709e-008, 0.707106531, -0.707107067, -2.6148701e-008))
CreateMesh("BlockMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(0.563200057, 1, 0.512000144))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Cool yellow", "Part", Vector3.new(0.33792007, 0.220000014, 0.33792007))
PartWeld = CreateWeld(m, BowFakeHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0.736960649, 0.000366210938, 1.36945343, -1, 6.40749931e-007, 6.93517848e-008, -6.93517705e-008, 2.71691221e-008, -1, -6.40749931e-007, -1, -2.71690741e-008))
CreateMesh("CylinderMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(1, 0.563200057, 1))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Cool yellow", "Part", Vector3.new(0.33792007, 0.220000014, 0.33792007))
PartWeld = CreateWeld(m, BowFakeHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0.736959338, 0, 1.36940765, -1, 6.40749931e-007, 6.93517848e-008, 6.93517705e-008, -2.71691203e-008, 1, 6.40749931e-007, 1, 2.71690741e-008))
CreateMesh("CylinderMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(1, 0.563200057, 1))
PivotConnector1 = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Cool yellow", "PivotConnector1", Vector3.new(0.220000014, 0.220000014, 0.220000014))
PivotConnector1Weld = CreateWeld(m, BowFakeHandle, PivotConnector1, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(3.17164612, -0.614725113, -0.000137329102, 8.04664523e-007, 1, 4.06052386e-005, -1, 8.04658157e-007, 1.50166912e-007, 1.50134269e-007, -4.06052495e-005, 1))
CreateMesh("SpecialMesh", PivotConnector1, Enum.MeshType.FileMesh, "http://www.roblox.com/asset/?id=18430887", Vector3.new(0, 0, 0), Vector3.new(0.214015961, 0.225279838, 0.585727811))
PivotConnector2 = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Cool yellow", "PivotConnector2", Vector3.new(0.220000014, 0.220000014, 0.220000014))
PivotConnector2Weld = CreateWeld(m, BowFakeHandle, PivotConnector2, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-3.22834778, -0.614701271, 0.000122070313, 8.04664523e-007, 1, 4.06052386e-005, -1, 8.04658157e-007, 1.50166912e-007, 1.50134269e-007, -4.06052495e-005, 1))
CreateMesh("SpecialMesh", PivotConnector2, Enum.MeshType.FileMesh, "http://www.roblox.com/asset/?id=18430887", Vector3.new(0, 0, 0), Vector3.new(0.214015961, 0.225279838, 0.585727811))
Wedge = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Black", "Wedge", Vector3.new(0.220000014, 0.220000014, 0.220000014))
WedgeWeld = CreateWeld(m, BowFakeHandle, Wedge, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0, 0.341524124, 1.5585022, -1.42978507e-007, 9.15196949e-008, -1, -0.92551136, -0.378719926, 9.76679004e-008, -0.378719926, 0.92551136, 1.3885132e-007))
CreateMesh("SpecialMesh", Wedge, Enum.MeshType.Wedge, "", Vector3.new(0, 0, 0), Vector3.new(0.511992276, 0.944333315, 0.386422455))
Wedge = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Black", "Wedge", Vector3.new(0.220000014, 0.220000014, 0.220000014))
WedgeWeld = CreateWeld(m, BowFakeHandle, Wedge, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-0.000366210938, 0.341472626, 1.55859375, -4.1486472e-009, -2.71666636e-008, 1, -0.925510883, 0.378721058, 6.4489738e-009, -0.378721058, -0.925510883, -2.67142202e-008))
CreateMesh("SpecialMesh", Wedge, Enum.MeshType.Wedge, "", Vector3.new(0, 0, 0), Vector3.new(0.511992276, 0.944333315, 0.386422455))
Wedge = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Black", "Wedge", Vector3.new(0.220000014, 0.220000014, 0.220000014))
WedgeWeld = CreateWeld(m, BowFakeHandle, Wedge, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0.000381469727, 0.341506958, -1.47248077, 4.1486472e-009, 2.71666636e-008, -1, -0.925510943, 0.37872082, 6.44896758e-009, 0.37872085, 0.925511003, 2.67142219e-008))
CreateMesh("SpecialMesh", Wedge, Enum.MeshType.Wedge, "", Vector3.new(0, 0, 0), Vector3.new(0.511992276, 0.944333315, 0.395894557))
Wedge = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Black", "Wedge", Vector3.new(0.220000014, 0.220000014, 0.220000014))
WedgeWeld = CreateWeld(m, BowFakeHandle, Wedge, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0, 0.168949723, -0.337890625, 6.94149378e-008, -2.71691221e-008, 1, -1, 6.40749931e-007, 6.94149662e-008, -6.40749931e-007, -1, -2.71690759e-008))
CreateMesh("SpecialMesh", Wedge, Enum.MeshType.Wedge, "", Vector3.new(0, 0, 0), Vector3.new(0.512000144, 0.512000144, 0.512000144))
QuiverHandle = CreatePart(m, Enum.Material.SmoothPlastic, 0, 1, "Black", "QuiverHandle", Vector3.new(2.20000029, 0.200000003, 0.600000024))
QuiverHandleWeld = CreateWeld(m, Character["Torso"], QuiverHandle, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-0.554016113, -0.356391907, 0.391426086, -0.965925872, -0.258818924, 2.59800936e-009, -1.29173223e-008, 5.82460693e-008, 1, -0.258818924, 0.965925872, -5.96046306e-008))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Black", "Part", Vector3.new(0.200000003, 0.200000003, 5.44000006))
PartWeld = CreateWeld(m, QuiverHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-0.454208374, -0.680118561, 1.68037415, 0.00025648062, 0.70736295, -0.706850469, 0.000258313463, 0.70685041, 0.707363009, 1, -0.000364014471, -1.44539092e-006))
CreateMesh("SpecialMesh", Part, Enum.MeshType.FileMesh, "http://www.roblox.com/asset/?id=15887356", Vector3.new(0, 0, 0), Vector3.new(0.800000012, 0.960000038, 2.4000001))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Black", "Part", Vector3.new(2.72000003, 0.200000003, 0.480000019))
PartWeld = CreateWeld(m, QuiverHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0.320007324, 1.12168884, 7.62939453e-006, 1.00000012, -5.19595522e-009, -2.5331974e-007, -5.19594989e-009, -1, 2.12064819e-008, -2.5331974e-007, -2.12064926e-008, -1.00000012))
CreateMesh("BlockMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(1, 0.800000072, 1))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Cool yellow", "Part", Vector3.new(0.200000003, 0.480000019, 0.200000003))
PartWeld = CreateWeld(m, QuiverHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(1.76008606, 0.617675781, 0.496002197, 1.00000012, -5.19595522e-009, -2.5331974e-007, -5.19594989e-009, -1, 2.12064819e-008, -2.5331974e-007, -2.12064926e-008, -1.00000012))
CreateMesh("BlockMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(0.800000072, 1, 0.800000072))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Cool yellow", "Part", Vector3.new(0.200000003, 0.480000019, 1.15999997))
PartWeld = CreateWeld(m, QuiverHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-1.11997986, 0.440233231, -0.440826416, 1.00000012, 1.30545388e-008, -8.94069672e-008, -6.14417175e-008, -0.707106829, -0.707106769, -5.77675756e-008, 0.707106769, -0.707106888))
CreateMesh("BlockMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(0.800000072, 1, 1))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Black", "Part", Vector3.new(0.200000003, 0.200000003, 5.44000006))
PartWeld = CreateWeld(m, QuiverHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0.000263214111, 0.8020401, 1.68035889, 6.25847804e-007, -0.000362336723, 1, -0.000361986837, -0.999999881, -0.000362336461, 1, -0.000361986604, -7.45036459e-007))
CreateMesh("SpecialMesh", Part, Enum.MeshType.FileMesh, "http://www.roblox.com/asset/?id=15887356", Vector3.new(0, 0, 0), Vector3.new(0.800000012, 0.960000038, 2.4000001))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Cool yellow", "Part", Vector3.new(0.200000003, 1.16000009, 0.480000019))
PartWeld = CreateWeld(m, QuiverHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-1.1199646, 0.621688843, 3.81469727e-006, 1.00000012, -5.19595522e-009, -2.5331974e-007, -5.19594989e-009, -1, 2.12064819e-008, -2.5331974e-007, -2.12064926e-008, -1.00000012))
CreateMesh("BlockMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(0.800000072, 1, 1))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Black", "Part", Vector3.new(2.72000003, 0.200000003, 0.480000019))
PartWeld = CreateWeld(m, QuiverHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0.320037842, 0.0585784912, -0.440793991, 1.00000012, -2.64309392e-008, -8.94069672e-008, -4.28664144e-008, 0.707106888, -0.707106709, 9.12440399e-008, 0.707106709, 0.707106888))
CreateMesh("BlockMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(1, 0.800000072, 1))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Cool yellow", "Part", Vector3.new(0.200000003, 0.480000019, 0.200000003))
PartWeld = CreateWeld(m, QuiverHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(1.76008606, 0.617675781, -0.504001617, 1.00000012, -5.19595522e-009, -2.5331974e-007, -5.19594989e-009, -1, 2.12064819e-008, -2.5331974e-007, -2.12064926e-008, -1.00000012))
CreateMesh("BlockMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(0.800000072, 1, 0.800000072))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Black", "Part", Vector3.new(0.200000003, 0.200000003, 5.44000006))
PartWeld = CreateWeld(m, QuiverHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-0.642028809, 0.000205993652, 1.68029785, 0.000362732593, 0.99999994, 0.000362407387, -1.63913711e-007, -0.000362407329, 1, 0.99999994, -0.000362732622, 4.47251054e-008))
CreateMesh("SpecialMesh", Part, Enum.MeshType.FileMesh, "http://www.roblox.com/asset/?id=15887356", Vector3.new(0, 0, 0), Vector3.new(0.800000012, 0.960000038, 2.4000001))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Black", "Part", Vector3.new(0.200000003, 0.200000003, 5.44000006))
PartWeld = CreateWeld(m, QuiverHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-0.64214325, -0.319789886, 1.68029785, 0.000362732593, 0.99999994, 0.000362407387, -1.63913711e-007, -0.000362407329, 1, 0.99999994, -0.000362732622, 4.47251054e-008))
CreateMesh("SpecialMesh", Part, Enum.MeshType.FileMesh, "http://www.roblox.com/asset/?id=15887356", Vector3.new(0, 0, 0), Vector3.new(0.800000012, 0.960000038, 2.4000001))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Black", "Part", Vector3.new(2.72000003, 0.200000003, 0.480000019))
PartWeld = CreateWeld(m, QuiverHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0.320007324, -0.12512207, -3.81469727e-006, 1, -4.4408921e-016, -1.54853386e-016, -4.4408921e-016, 1, 0, -1.54853386e-016, 0, 1))
CreateMesh("BlockMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(1, 0.800000072, 1))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Black", "Part", Vector3.new(0.200000003, 0.200000003, 5.44000006))
PartWeld = CreateWeld(m, QuiverHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-0.453760147, 0.680397034, 1.68035889, 0.000254766986, 0.706850529, 0.70736289, -0.000260369823, -0.707362831, 0.706850588, 1.00000012, -0.00036425679, 3.82962025e-006))
CreateMesh("SpecialMesh", Part, Enum.MeshType.FileMesh, "http://www.roblox.com/asset/?id=15887356", Vector3.new(0, 0, 0), Vector3.new(0.800000012, 0.960000038, 2.4000001))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Black", "Part", Vector3.new(0.200000003, 0.200000003, 5.44000006))
PartWeld = CreateWeld(m, QuiverHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(8.39233398e-005, 0.322044373, 1.68017578, -1.9222507e-006, -0.000362336548, 1, -0.000367632718, -0.999999881, -0.000362337218, 1, -0.000367633445, 1.80306245e-006))
CreateMesh("SpecialMesh", Part, Enum.MeshType.FileMesh, "http://www.roblox.com/asset/?id=15887356", Vector3.new(0, 0, 0), Vector3.new(0.800000012, 0.960000038, 2.4000001))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Black", "Part", Vector3.new(0.200000003, 0.200000003, 5.44000006))
PartWeld = CreateWeld(m, QuiverHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-0.642089844, -0.159805298, 1.68029785, 0.000362732593, 0.99999994, 0.000362407387, -1.63913711e-007, -0.000362407329, 1, 0.99999994, -0.000362732622, 4.47251054e-008))
CreateMesh("SpecialMesh", Part, Enum.MeshType.FileMesh, "http://www.roblox.com/asset/?id=15887356", Vector3.new(0, 0, 0), Vector3.new(0.800000012, 0.960000038, 2.4000001))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Cool yellow", "Part", Vector3.new(0.200000003, 0.200000003, 0.480000019))
PartWeld = CreateWeld(m, QuiverHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(1.7600708, 1.12168884, 7.62939453e-006, 1.00000012, -5.19595522e-009, -2.5331974e-007, -5.19594989e-009, -1, 2.12064819e-008, -2.5331974e-007, -2.12064926e-008, -1.00000012))
CreateMesh("BlockMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(0.800000072, 0.800000072, 1))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Black", "Part", Vector3.new(0.200000003, 0.200000003, 5.44000006))
PartWeld = CreateWeld(m, QuiverHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-0.641914368, 0.320201874, 1.68029785, 0.000362732593, 0.99999994, 0.000362407387, -1.63913711e-007, -0.000362407329, 1, 0.99999994, -0.000362732622, 4.47251054e-008))
CreateMesh("SpecialMesh", Part, Enum.MeshType.FileMesh, "http://www.roblox.com/asset/?id=15887356", Vector3.new(0, 0, 0), Vector3.new(0.800000012, 0.960000038, 2.4000001))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Cool yellow", "Part", Vector3.new(0.200000003, 0.480000019, 0.200000003))
PartWeld = CreateWeld(m, QuiverHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(1.7600708, 0.440826416, 0.940238953, 1, 2.1234964e-008, -1.78813934e-007, 1.47174546e-007, -0.707106829, 0.707106769, -1.21046355e-007, -0.707106769, -0.707106829))
CreateMesh("BlockMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(0.800000072, 1, 0.800000072))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Black", "Part", Vector3.new(2.72000003, 0.480000019, 0.200000003))
PartWeld = CreateWeld(m, QuiverHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0.320037842, 0.617675781, -0.504001617, 1.00000012, -5.19595522e-009, -2.5331974e-007, -5.19594989e-009, -1, 2.12064819e-008, -2.5331974e-007, -2.12064926e-008, -1.00000012))
CreateMesh("BlockMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(1, 1, 0.800000072))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Cool yellow", "Part", Vector3.new(0.200000003, 0.480000019, 1.1680001))
PartWeld = CreateWeld(m, QuiverHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-1.1199646, 0.617675781, 3.81469727e-006, 1.00000012, -5.19595522e-009, -2.5331974e-007, -5.19594989e-009, -1, 2.12064819e-008, -2.5331974e-007, -2.12064926e-008, -1.00000012))
CreateMesh("BlockMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(0.800000072, 1, 1))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Cool yellow", "Part", Vector3.new(0.200000003, 0.480000019, 1.15999997))
PartWeld = CreateWeld(m, QuiverHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-1.11997986, 0.440826416, 0.440233231, 1, 2.1234964e-008, -1.78813934e-007, 1.47174546e-007, -0.707106829, 0.707106769, -1.21046355e-007, -0.707106769, -0.707106829))
CreateMesh("BlockMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(0.800000072, 1, 1))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Cool yellow", "Part", Vector3.new(0.200000003, 0.480000019, 0.200000003))
PartWeld = CreateWeld(m, QuiverHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(1.76008606, -0.440818787, 0.0586128235, 1.00000012, -2.64309392e-008, -8.94069672e-008, -4.28664144e-008, 0.707106888, -0.707106709, 9.12440399e-008, 0.707106709, 0.707106888))
CreateMesh("BlockMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(0.800000072, 1, 0.800000072))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Cool yellow", "Part", Vector3.new(0.480000019, 0.200000003, 0.320000023))
PartWeld = CreateWeld(m, QuiverHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0, -1.12969971, 1.3600769, -8.94069672e-008, -5.96046377e-008, -1.00000012, 2.59801936e-009, 1, -5.96046306e-008, 1.00000012, -2.59802602e-009, -8.94069672e-008))
CreateMesh("CylinderMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(1, 0.800000072, 1))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Cool yellow", "Part", Vector3.new(0.200000003, 0.200000003, 0.480000019))
PartWeld = CreateWeld(m, QuiverHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(1.7600708, 0.940246582, 0.440822601, 1, 2.1234964e-008, -1.78813934e-007, 1.47174546e-007, -0.707106829, 0.707106769, -1.21046355e-007, -0.707106769, -0.707106829))
CreateMesh("BlockMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(0.800000072, 0.800000072, 1))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Black", "Part", Vector3.new(0.200000003, 0.200000003, 5.44000006))
PartWeld = CreateWeld(m, QuiverHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-0.000316619873, -0.962043762, 1.68040466, 2.60770412e-006, 0.000362485851, -1.00000012, 0.00035897718, 0.99999994, 0.000362486753, 1, -0.000358978083, 2.50341645e-006))
CreateMesh("SpecialMesh", Part, Enum.MeshType.FileMesh, "http://www.roblox.com/asset/?id=15887356", Vector3.new(0, 0, 0), Vector3.new(0.800000012, 0.960000038, 2.4000001))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Black", "Part", Vector3.new(2.72000003, 0.200000003, 0.480000019))
PartWeld = CreateWeld(m, QuiverHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0.320007324, 0.940238953, 0.440828323, 1, 2.1234964e-008, -1.78813934e-007, 1.47174546e-007, -0.707106829, 0.707106769, -1.21046355e-007, -0.707106769, -0.707106829))
CreateMesh("BlockMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(1, 0.800000072, 1))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Black", "Part", Vector3.new(0.200000003, 0.200000003, 5.44000006))
PartWeld = CreateWeld(m, QuiverHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-0.641975403, 0.160209656, 1.68029785, 0.000362732593, 0.99999994, 0.000362407387, -1.63913711e-007, -0.000362407329, 1, 0.99999994, -0.000362732622, 4.47251054e-008))
CreateMesh("SpecialMesh", Part, Enum.MeshType.FileMesh, "http://www.roblox.com/asset/?id=15887356", Vector3.new(0, 0, 0), Vector3.new(0.800000012, 0.960000038, 2.4000001))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Cool yellow", "Part", Vector3.new(0.200000003, 0.200000003, 0.480000019))
PartWeld = CreateWeld(m, QuiverHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(1.7600708, -0.12512207, -3.81469727e-006, 1, -4.4408921e-016, -1.54853386e-016, -4.4408921e-016, 1, 0, -1.54853386e-016, 0, 1))
CreateMesh("BlockMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(0.800000072, 0.800000072, 1))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Black", "Part", Vector3.new(2.72000003, 0.480000019, 0.200000003))
PartWeld = CreateWeld(m, QuiverHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0.320007324, -0.440818787, 0.0586090088, 1.00000012, -2.64309392e-008, -8.94069672e-008, -4.28664144e-008, 0.707106888, -0.707106709, 9.12440399e-008, 0.707106709, 0.707106888))
CreateMesh("BlockMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(1, 1, 0.800000072))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Black", "Part", Vector3.new(0.200000003, 0.200000003, 5.44000006))
PartWeld = CreateWeld(m, QuiverHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-0.000152587891, -0.482032776, 1.68025208, -2.10106282e-006, 0.000362470717, -0.99999994, 0.00036824515, 0.99999994, 0.000362469931, 0.999999881, -0.000368244306, -2.2053498e-006))
CreateMesh("SpecialMesh", Part, Enum.MeshType.FileMesh, "http://www.roblox.com/asset/?id=15887356", Vector3.new(0, 0, 0), Vector3.new(0.800000012, 0.960000038, 2.4000001))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Cool yellow", "Part", Vector3.new(2.07999992, 0.200000003, 0.200000003))
PartWeld = CreateWeld(m, QuiverHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0.320007324, 0.121658325, 7.62939453e-006, 1.00000012, -5.19595522e-009, -2.5331974e-007, -5.19594989e-009, -1, 2.12064819e-008, -2.5331974e-007, -2.12064926e-008, -1.00000012))
CreateMesh("BlockMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(1, 0.800000072, 0.800000072))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Cool yellow", "Part", Vector3.new(0.480000019, 0.200000003, 0.320000023))
PartWeld = CreateWeld(m, QuiverHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0, -0.121658325, 1.3600769, -8.94069672e-008, -5.96046377e-008, -1.00000012, 2.59801936e-009, 1, -5.96046306e-008, 1.00000012, -2.59802602e-009, -8.94069672e-008))
CreateMesh("CylinderMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(1, 0.800000072, 1))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Cool yellow", "Part", Vector3.new(0.200000003, 0.200000003, 0.480000019))
PartWeld = CreateWeld(m, QuiverHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(1.76010132, 0.05859375, -0.44080162, 1.00000012, -2.64309392e-008, -8.94069672e-008, -4.28664144e-008, 0.707106888, -0.707106709, 9.12440399e-008, 0.707106709, 0.707106888))
CreateMesh("BlockMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(0.800000072, 0.800000072, 1))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Black", "Part", Vector3.new(2.72000003, 0.480000019, 0.200000003))
PartWeld = CreateWeld(m, QuiverHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0.320007324, 0.440834045, 0.940233231, 1, 2.1234964e-008, -1.78813934e-007, 1.47174546e-007, -0.707106829, 0.707106769, -1.21046355e-007, -0.707106769, -0.707106829))
CreateMesh("BlockMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(1, 1, 0.800000072))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Cool yellow", "Part", Vector3.new(2.07999992, 0.200000003, 0.200000003))
PartWeld = CreateWeld(m, QuiverHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0.320007324, 1.12969971, 7.62939453e-006, 1.00000012, -5.19595522e-009, -2.5331974e-007, -5.19594989e-009, -1, 2.12064819e-008, -2.5331974e-007, -2.12064926e-008, -1.00000012))
CreateMesh("BlockMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(1, 0.800000072, 0.800000072))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Cool yellow", "Part", Vector3.new(0.480000019, 0.200000003, 0.320000023))
PartWeld = CreateWeld(m, QuiverHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-3.81469727e-006, -0.121658325, -0.719848633, -8.94069672e-008, -5.96046377e-008, -1.00000012, 2.59801936e-009, 1, -5.96046306e-008, 1.00000012, -2.59802602e-009, -8.94069672e-008))
CreateMesh("CylinderMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(1, 0.800000072, 1))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Black", "Part", Vector3.new(2.72000003, 0.480000019, 0.200000003))
PartWeld = CreateWeld(m, QuiverHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0.320022583, 0.617675781, 0.495986938, 1.00000012, -5.19595522e-009, -2.5331974e-007, -5.19594989e-009, -1, 2.12064819e-008, -2.5331974e-007, -2.12064926e-008, -1.00000012))
CreateMesh("BlockMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(1, 1, 0.800000072))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Cool yellow", "Part", Vector3.new(0.480000019, 0.200000003, 0.320000023))
PartWeld = CreateWeld(m, QuiverHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-3.81469727e-006, -1.12969971, -0.719848633, -8.94069672e-008, -5.96046377e-008, -1.00000012, 2.59801936e-009, 1, -5.96046306e-008, 1.00000012, -2.59802602e-009, -8.94069672e-008))
CreateMesh("CylinderMesh", Part, "", "", Vector3.new(0, 0, 0), Vector3.new(1, 0.800000072, 1))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Black", "Part", Vector3.new(0.200000003, 0.200000003, 5.44000006))
PartWeld = CreateWeld(m, QuiverHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-0.453941345, 0.227851868, 1.68025208, 0.000255497143, 0.706850588, 0.707362831, -0.000258075044, -0.707362771, 0.706850648, 1, -0.000363150437, 1.68385282e-006))
CreateMesh("SpecialMesh", Part, Enum.MeshType.FileMesh, "http://www.roblox.com/asset/?id=15887356", Vector3.new(0, 0, 0), Vector3.new(0.800000012, 0.960000038, 2.4000001))
Part = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Black", "Part", Vector3.new(0.200000003, 0.200000003, 5.44000006))
PartWeld = CreateWeld(m, QuiverHandle, Part, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-0.454055786, -0.227571487, 1.68025208, 0.000257970736, 0.70736295, -0.706850469, 0.000255273626, 0.706850469, 0.70736295, 1, -0.000362918596, 1.77325978e-006))
CreateMesh("SpecialMesh", Part, Enum.MeshType.FileMesh, "http://www.roblox.com/asset/?id=15887356", Vector3.new(0, 0, 0), Vector3.new(0.800000012, 0.960000038, 2.4000001))
PivotHandle1 = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Cool yellow", "PivotHandle1", Vector3.new(0.220000014, 0.220000014, 0.220000014))
PivotHandle1Weld = CreateWeld(m, PivotConnector1, PivotHandle1, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0, 0, 0, 1, 0, -7.27595761e-012, 0, 1, -2.67841305e-014, -7.27595761e-012, -2.67841305e-014, 1))
CreateMesh("SpecialMesh", PivotHandle1, Enum.MeshType.FileMesh, "http://www.roblox.com/asset/?id=18430887", Vector3.new(0, 0, 0), Vector3.new(0.214015961, 0.225279838, 0.585727811))
String1 = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Institutional white", "String1", Vector3.new(0.220000014, 3.37920046, 0.220000014))
String1Weld = CreateWeld(m, PivotHandle1, String1, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0.0047981739, -1.87628937, 0, 8.04664523e-007, -1, 1.50134269e-007, 1, 8.04658157e-007, -4.06052495e-005, 4.06052386e-005, 1.50166912e-007, 1))
CreateMesh("CylinderMesh", String1, "", "", Vector3.new(0, 0, 0), Vector3.new(0.512000144, 1, 0.153600037))
PivotHandle2 = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Cool yellow", "PivotHandle2", Vector3.new(0.220000014, 0.220000014, 0.220000014))
PivotHandle2Weld = CreateWeld(m, PivotConnector2, PivotHandle2, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0, 0, 0, 1, 0, -7.27595761e-012, 0, 1, -2.67841305e-014, -7.27595761e-012, -2.67841305e-014, 1))
CreateMesh("SpecialMesh", PivotHandle2, Enum.MeshType.FileMesh, "http://www.roblox.com/asset/?id=18430887", Vector3.new(0, 0, 0), Vector3.new(0.214015961, 0.225279838, 0.585727811))
String2 = CreatePart(m, Enum.Material.SmoothPlastic, 0, 0, "Institutional white", "String2", Vector3.new(0.220000014, 3.49184012, 0.220000014))
String2Weld = CreateWeld(m, PivotHandle2, String2, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(0.00483489037, 1.87658691, 0, 8.04664523e-007, -1, 1.50134269e-007, 1, 8.04658157e-007, -4.06052495e-005, 4.06052386e-005, 1.50166912e-007, 1))
CreateMesh("CylinderMesh", String2, "", "", Vector3.new(0, 0, 0), Vector3.new(0.512000144, 1, 0.153600037))
--[[ Credits to Fenrier for the Effect Functions. ]]--
function BlockEffect(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay, Type)
local prt = CreatePart(workspace, "Neon", 0, 0, brickcolor, "Effect", Vector3.new())
prt.Anchored = true
prt.CFrame = cframe
local msh = CreateMesh("BlockMesh", prt, "", "", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
game:GetService("Debris"):AddItem(prt, 10)
if Type == 1 or Type == nil then
table.insert(Effects, {
prt,
"Block1",
delay,
x3,
y3,
z3,
msh
})
elseif Type == 2 then
table.insert(Effects, {
prt,
"Block2",
delay,
x3,
y3,
z3,
msh
})
end
end
function SphereEffect(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
local prt = CreatePart(workspace, "Neon", 0, 0, brickcolor, "Effect", Vector3.new())
prt.Anchored = true
prt.CFrame = cframe
local msh = CreateMesh("SpecialMesh", prt, "Sphere", "", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
game:GetService("Debris"):AddItem(prt, 10)
table.insert(Effects, {
prt,
"Cylinder",
delay,
x3,
y3,
z3,
msh
})
end
function RingEffect(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
local prt = CreatePart(workspace, "Neon", 0, 0, brickcolor, "Effect", Vector3.new(0.5, 0.5, 0.5))
prt.Anchored = true
prt.CFrame = cframe * CFrame.new(x1, y1, z1)
local msh = CreateMesh("SpecialMesh", prt, "FileMesh", "rbxassetid://3270017", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
game:GetService("Debris"):AddItem(prt, 10)
table.insert(Effects, {
prt,
"Cylinder",
delay,
x3,
y3,
z3,
msh
})
end
function CylinderEffect(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
local prt = CreatePart(workspace, "Neon", 0, 0, brickcolor, "Effect", Vector3.new())
prt.Anchored = true
prt.CFrame = cframe
local msh = CreateMesh("CylinderMesh", prt, "", "", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
game:GetService("Debris"):AddItem(prt, 10)
table.insert(Effects, {
prt,
"Cylinder",
delay,
x3,
y3,
z3,
msh
})
end
function WaveEffect(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
local prt = CreatePart(workspace, "Neon", 0, 0, brickcolor, "Effect", Vector3.new())
prt.Anchored = true
prt.CFrame = cframe
local msh = CreateMesh("SpecialMesh", prt, "FileMesh", "rbxassetid://20329976", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
game:GetService("Debris"):AddItem(prt, 10)
table.insert(Effects, {
prt,
"Cylinder",
delay,
x3,
y3,
z3,
msh
})
end
function SpecialEffect(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
local prt = CreatePart(workspace, "Neon", 0, 0, brickcolor, "Effect", Vector3.new())
prt.Anchored = true
prt.CFrame = cframe
local msh = CreateMesh("SpecialMesh", prt, "FileMesh", "rbxassetid://24388358", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
game:GetService("Debris"):AddItem(prt, 10)
table.insert(Effects, {
prt,
"Cylinder",
delay,
x3,
y3,
z3,
msh
})
end
function BreakEffect(brickcolor, cframe, x1, y1, z1)
local prt = CreatePart(workspace, "Neon", 0, 0, brickcolor, "Effect", Vector3.new(0.5, 0.5, 0.5))
prt.Anchored = true
prt.CFrame = cframe * CFrame.fromEulerAnglesXYZ(math.random(-50, 50), math.random(-50, 50), math.random(-50, 50))
local msh = CreateMesh("SpecialMesh", prt, "Sphere", "", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
local num = math.random(10, 50) / 1000
game:GetService("Debris"):AddItem(prt, 10)
table.insert(Effects, {
prt,
"Shatter",
num,
prt.CFrame,
math.random() - math.random(),
0,
math.random(50, 100) / 100
})
end
spread = 100
range = 250
rangepower = 20
function Laser(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
local prt = CreatePart(workspace, "Neon", 0, 0, brickcolor, "Effect", Vector3.new(0.5, 0.5, 0.5))
prt.Anchored = true
prt.CFrame = cframe
prt.Material = "Neon"
local msh = CreateMesh("CylinderMesh", prt, "", "", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
game:GetService("Debris"):AddItem(prt, 10)
coroutine.resume(coroutine.create(function(Part, Mesh)
for i = 0, 1, delay do
swait()
--BlockEffect(BrickColor.new("Black"), CFrame.new(prt.Position) * CFrame.new(math.random(-500, 500) / 100, math.random(-500, 500) / 100, math.random(-500, 500) / 100), 1, 1, 1, .5, .5, .5, .05, 1)
Part.Transparency = i
Mesh.Scale = Mesh.Scale + Vector3.new(x3, y3, z3)
end
Part.Parent = nil
end), prt, msh)
end
function shoottrail(mouse,SpreadAmount)
local SpreadVectors = Vector3.new(math.random(-SpreadAmount,SpreadAmount), math.random(-SpreadAmount,SpreadAmount), math.random(-SpreadAmount,SpreadAmount))
local MainPos = BowHandle.Position
local MainPos2 = mouse.Hit.p+SpreadVectors
local MouseLook = CFrame.new((MainPos + MainPos2) / 2, MainPos2)
local speed = 50
local num = 50
coroutine.resume(coroutine.create(function()
repeat
swait()
local hit, pos = rayCast(MainPos, MouseLook.lookVector, speed, RootPart.Parent)
local mag = (MainPos - pos).magnitude
Laser(BrickColor.new("Black"), CFrame.new((MainPos + pos) / 2, pos) * angles(1.57, 0, 0), 1, mag * (speed / (speed / 2)), 1, -0.175, 0, -0.175, 0.15)
MainPos = MainPos + (MouseLook.lookVector * speed)
num = num - 1
MouseLook = MouseLook * angles(math.rad(-1), 0, 0)
if hit ~= nil then
num = 0
local refpart = CreatePart(workspace, "SmoothPlastic", 0, 1, BrickColor.new("Really black"), "Effect", Vector3.new())
refpart.Anchored = true
refpart.CFrame = CFrame.new(pos)
game:GetService("Debris"):AddItem(refpart, 2)
for i = 1, math.random(2, 4) do
end
end
if num <= 0 then
local refpart = CreatePart(workspace, "SmoothPlastic", 0, 1, BrickColor.new("Really black"), "Effect", Vector3.new())
refpart.Anchored = true
refpart.CFrame = CFrame.new(pos)
game:GetService("Debris"):AddItem(refpart, 2)
end
until num <= 0
end))
end
--[[ Attack Functions ]]--
local Hold = false
function CFA(x,y,z)
return CFrame.fromEulerAnglesXYZ(math.rad(x),math.rad(y),math.rad(z))
end
function attackone()
attack = true
change = 1
Humanoid.WalkSpeed = 5
for i = 0, 1, 0.2 do
swait()
RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(-65)), .3)
Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(0), math.rad(0), math.rad(65)), .3)
RW.C0 = clerp(RW.C0, CFrame.new(0.5, 0.49, -.5) * angles(math.rad(90), math.rad(0), math.rad(-60)), .3)
LW.C0 = clerp(LW.C0, CFrame.new(-1, 0.49, 0) * angles(math.rad(90), math.rad(0), math.rad(-20)), .3)
BowFakeHandleWeld.C0 = clerp(BowFakeHandleWeld.C0, cn(0, 0, 0) * angles(math.rad(0), math.rad(-50), math.rad(0)), .3)
PivotHandle1Weld.C0 = clerp(PivotHandle1Weld.C0, cn(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
PivotHandle2Weld.C0 = clerp(PivotHandle2Weld.C0, cn(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
FakeArrowWeld.C0 = clerp(FakeArrowWeld.C0, cn(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
if Torsovelocity < 1 then
RH.C0 = clerp(RH.C0, cn(1, -1, 0) * RHCF * angles(math.rad(-5), math.rad(0), math.rad(0)), .33)
LH.C0 = clerp(LH.C0, cn(-1, -1, 0) * LHCF * angles(math.rad(-5), math.rad(0), math.rad(0)), .33)
elseif Torsovelocity > 2 then
RH.C0 = clerp(RH.C0, cn(1, -1 - 0.3 * math.cos(sine / 8) / 2, -.03 + math.sin(sine / 8) / 2) * RHCF * angles(math.rad(-2), math.rad(0), math.rad(-10) - math.sin(sine / 8)), .3)
LH.C0 = clerp(LH.C0, cn(-1, -1 + 0.3 * math.cos(sine / 8) / 2, -.03 - math.sin(sine / 8) / 2) * LHCF * angles(math.rad(-2), math.rad(0), math.rad(10) - math.sin(sine / 8)), .3)
end
end
CreateSound("rbxassetid://188569331",BowHandle,1,1)
FakeArrow.Transparency = 0
for i = 0, 1, 0.2 do
swait()
RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(-65)), .3)
Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(0), math.rad(0), math.rad(65)), .3)
RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.49, 0) * angles(math.rad(90), math.rad(0), math.rad(-50)), .3)
LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.49, 0) * angles(math.rad(90), math.rad(0), math.rad(-10)), .3)
BowFakeHandleWeld.C0 = clerp(BowFakeHandleWeld.C0, cn(0, 0, 0) * angles(math.rad(0), math.rad(-60), math.rad(0)), .3)
PivotHandle1Weld.C0 = clerp(PivotHandle1Weld.C0, cn(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(30)), .3)
PivotHandle2Weld.C0 = clerp(PivotHandle2Weld.C0, cn(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(-30)), .3)
FakeArrowWeld.C0 = clerp(FakeArrowWeld.C0, cn(-1.3, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
if Torsovelocity < 1 then
RH.C0 = clerp(RH.C0, cn(1, -1, 0) * RHCF * angles(math.rad(-5), math.rad(0), math.rad(0)), .33)
LH.C0 = clerp(LH.C0, cn(-1, -1, 0) * LHCF * angles(math.rad(-5), math.rad(0), math.rad(0)), .33)
elseif Torsovelocity > 2 then
RH.C0 = clerp(RH.C0, cn(1, -1 - 0.3 * math.cos(sine / 8) / 2, -.03 + math.sin(sine / 8) / 2) * RHCF * angles(math.rad(-2), math.rad(0), math.rad(-10) - math.sin(sine / 8)), .3)
LH.C0 = clerp(LH.C0, cn(-1, -1 + 0.3 * math.cos(sine / 8) / 2, -.03 - math.sin(sine / 8) / 2) * LHCF * angles(math.rad(-2), math.rad(0), math.rad(10) - math.sin(sine / 8)), .3)
end
end
while true do
swait()
if Hold == true then
RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(-65)), .3)
Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(0), math.rad(0), math.rad(65)), .3)
RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.49, 0) * angles(math.rad(90), math.rad(0), math.rad(-50)), .3)*CFA(math.random(-.6,.6),math.random(-.5,.5),math.random(-.5,.5))
LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.49, 0) * angles(math.rad(90), math.rad(0), math.rad(-10)), .3)
BowFakeHandleWeld.C0 = clerp(BowFakeHandleWeld.C0, cn(0, 0, 0) * angles(math.rad(0), math.rad(-60), math.rad(0)), .3)
PivotHandle1Weld.C0 = clerp(PivotHandle1Weld.C0, cn(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(30)), .3)*CFA(0, 0 ,math.random(-.6,.6))
PivotHandle2Weld.C0 = clerp(PivotHandle2Weld.C0, cn(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(-30)), .3)*CFA(0, 0 ,math.random(-.6,.6))
FakeArrowWeld.C0 = clerp(FakeArrowWeld.C0, cn(-1.3, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
if Torsovelocity < 1 then
RH.C0 = clerp(RH.C0, cn(1, -1, 0) * RHCF * angles(math.rad(-5), math.rad(0), math.rad(0)), .33)
LH.C0 = clerp(LH.C0, cn(-1, -1, 0) * LHCF * angles(math.rad(-5), math.rad(0), math.rad(0)), .33)
elseif Torsovelocity > 2 then
RH.C0 = clerp(RH.C0, cn(1, -1 - 0.3 * math.cos(sine / 8) / 2, -.03 + math.sin(sine / 8) / 2) * RHCF * angles(math.rad(-2), math.rad(0), math.rad(-10) - math.sin(sine / 8)), .3)
LH.C0 = clerp(LH.C0, cn(-1, -1 + 0.3 * math.cos(sine / 8) / 2, -.03 - math.sin(sine / 8) / 2) * LHCF * angles(math.rad(-2), math.rad(0), math.rad(10) - math.sin(sine / 8)), .3)
end
elseif Hold == false then
break
end
end
CreateSound("rbxassetid://166032326",BowHandle,1,1)
FakeArrow.Transparency = 1
shoottrail(mouse,0)
for i = 0, 1, 0.2 do
swait()
RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(-40)), .3)
Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(0), math.rad(0), math.rad(40)), .3)
RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.49, 0) * angles(math.rad(130), math.rad(0), math.rad(20)), .3)
LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.49, 0) * angles(math.rad(90), math.rad(0), math.rad(-20)), .3)
BowFakeHandleWeld.C0 = clerp(BowFakeHandleWeld.C0, cn(0, 0, 0) * angles(math.rad(0), math.rad(-10), math.rad(0)), .3)
PivotHandle1Weld.C0 = clerp(PivotHandle1Weld.C0, cn(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(-4)), .5)*CFA(0, 0 ,math.random(-.6,.6))
PivotHandle2Weld.C0 = clerp(PivotHandle2Weld.C0, cn(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(4)), .5)*CFA(0, 0 ,math.random(-.6,.6))
FakeArrowWeld.C0 = clerp(FakeArrowWeld.C0, cn(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
if Torsovelocity < 1 then
RH.C0 = clerp(RH.C0, cn(1, -1, 0) * RHCF * angles(math.rad(-5), math.rad(0), math.rad(0)), .33)
LH.C0 = clerp(LH.C0, cn(-1, -1, 0) * LHCF * angles(math.rad(-5), math.rad(0), math.rad(0)), .33)
elseif Torsovelocity > 2 then
RH.C0 = clerp(RH.C0, cn(1, -1 - 0.3 * math.cos(sine / 8) / 2, -.03 + math.sin(sine / 8) / 2) * RHCF * angles(math.rad(-2), math.rad(0), math.rad(-10) - math.sin(sine / 8)), .3)
LH.C0 = clerp(LH.C0, cn(-1, -1 + 0.3 * math.cos(sine / 8) / 2, -.03 - math.sin(sine / 8) / 2) * LHCF * angles(math.rad(-2), math.rad(0), math.rad(10) - math.sin(sine / 8)), .3)
end
end
Humanoid.WalkSpeed = 18
attack = false
end
--[[Attacks]]--
mouse.Button1Down:connect(function()
if attack == false and attacktype == 1 and Hold == false then
Hold = true
attackone()
end
end)
mouse.Button1Up:connect(function(k)
if attack == true and Hold == true then
Hold = false
end
end)
mouse.KeyDown:connect(function(k)
k = k:lower()
if attack == false and k == '' then
end
end)
--[[ Credits to Fenrier for the Movement Detection and Effects table. ]]--
Humanoid.WalkSpeed = 18
while true do
swait()
if Hold == true then
local aim = CFrame.new(RootPart.Position,mouse.Hit.p)
local direction = aim.lookVector
local headingA = math.atan2(direction.x, direction.z)
headingA = math.deg(headingA)
Humanoid.AutoRotate = false
RootPart.CFrame = CFrame.new(RootPart.Position) * angles(math.rad(0), math.rad(headingA-180), math.rad(0))
else
Humanoid.AutoRotate = true
end
for i, v in pairs(Character:GetChildren()) do
if v:IsA("Part") then
v.Material = "SmoothPlastic"
elseif v:IsA("Hat") then
v:WaitForChild("Handle").Material = "SmoothPlastic"
end
end
Torsovelocity = (RootPart.Velocity * Vector3.new(1, 0, 1)).magnitude
velocity = RootPart.Velocity.y
sine = sine + change
local hit, pos = rayCast(RootPart.Position, (CFrame.new(RootPart.Position, RootPart.Position - Vector3.new(0, 1, 0))).lookVector, 4, Character)
if equipped == true or equipped == false then
if RootPart.Velocity.y > 1 and hit == nil then
Anim = "Jump"
if attack == false then
RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(-20), math.rad(0), math.rad(0)), .3)
RW.C0 = clerp(RW.C0, CFrame.new(1.45, 0.5, 0) * angles(math.rad(0), math.rad(-30), math.rad(80 + 2 * math.sin(sine / 25))), .3)
LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(-30), math.rad(0), math.rad(-50)), .3)
RH.C0 = clerp(RH.C0, cn(1, -.7, -.5) * RHCF * angles(math.rad(-5), math.rad(0), math.rad(-20)), .3)
LH.C0 = clerp(LH.C0, cn(-1, -1, 0) * LHCF * angles(math.rad(-5), math.rad(0), math.rad(10)), .3)
BowFakeHandleWeld.C0 = clerp(BowFakeHandleWeld.C0, cn(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
PivotHandle1Weld.C0 = clerp(PivotHandle1Weld.C0, cn(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
PivotHandle2Weld.C0 = clerp(PivotHandle2Weld.C0, cn(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
FakeArrowWeld.C0 = clerp(FakeArrowWeld.C0, cn(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
end
elseif RootPart.Velocity.y < -1 and hit == nil then
Anim = "Fall"
if attack == false then
RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(20), math.rad(0), math.rad(0)), .3)
RW.C0 = clerp(RW.C0, CFrame.new(1.45, 0.5, 0) * angles(math.rad(0), math.rad(-30), math.rad(80 + 2 * math.sin(sine / 25))), .3)
LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.7, 0) * angles(math.rad(20), math.rad(0), math.rad(-50)), .3)
RH.C0 = clerp(RH.C0, cn(1, -.9 - .1 * math.sin(sine / 27), 0) * RHCF * angles(math.rad(-3 + 1 * math.cos(sine / 23)), math.rad(0), math.rad(0)), .3)
LH.C0 = clerp(LH.C0, cn(-1, -.9 - .1 * math.sin(sine / 27), 0) * LHCF * angles(math.rad(-3 + 1 * math.cos(sine / 23)), math.rad(0), math.rad(0)), .3)
BowFakeHandleWeld.C0 = clerp(BowFakeHandleWeld.C0, cn(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
PivotHandle1Weld.C0 = clerp(PivotHandle1Weld.C0, cn(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
PivotHandle2Weld.C0 = clerp(PivotHandle2Weld.C0, cn(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
FakeArrowWeld.C0 = clerp(FakeArrowWeld.C0, cn(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
end
elseif Torsovelocity < 1 and hit ~= nil then
Anim = "Idle"
if attack == false then
change = 1
RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, -.1 + .1 * math.sin(sine / 27)) * angles(math.rad(0), math.rad(0), math.rad(-30)), .3)
Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(5 + 5 * math.sin(sine / 25)), math.rad(0), math.rad(30 + 3 * math.sin(sine / 25))), .3)
RW.C0 = clerp(RW.C0, CFrame.new(1.45, 0.5, 0) * angles(math.rad(0), math.rad(-30), math.rad(80 + 2 * math.sin(sine / 25))), .3)
LW.C0 = clerp(LW.C0, CFrame.new(-1.3, 0.5, 0) * angles(math.rad(25), math.rad(0), math.rad(-35 + 1 * math.sin(sine / 25))), .3)
RH.C0 = clerp(RH.C0, cn(1, -.9 - .1 * math.sin(sine / 27), 0) * RHCF * angles(math.rad(-5 + 1 * math.sin(sine / 25)), math.rad(20), math.rad(0)), .3)
LH.C0 = clerp(LH.C0, cn(-1, -.9 - .1 * math.sin(sine / 27), 0) * LHCF * angles(math.rad(-5 + 1 * math.sin(sine / 25)), math.rad(20), math.rad(0)), .3)
BowFakeHandleWeld.C0 = clerp(BowFakeHandleWeld.C0, cn(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
PivotHandle1Weld.C0 = clerp(PivotHandle1Weld.C0, cn(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
PivotHandle2Weld.C0 = clerp(PivotHandle2Weld.C0, cn(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
FakeArrowWeld.C0 = clerp(FakeArrowWeld.C0, cn(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
end
elseif Torsovelocity > 2 and hit ~= nil then
Anim = "Walk"
if attack == false then
change = 3
RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, 0) * angles(math.rad(20), math.rad(0), math.rad(-30 + 5 * math.sin(sine / 10))), .3)
Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(-10), math.rad(-5), math.rad(30 - 5 * math.sin(sine / 10))), .3)
RW.C0 = clerp(RW.C0, CFrame.new(1.45, 0.5, 0) * angles(math.rad(0), math.rad(-30), math.rad(80)), .3)
LW.C0 = clerp(LW.C0, CFrame.new(-1.3, 0.5, 0) * angles(math.rad(15), math.rad(0), math.rad(-25 + 2 * math.sin(sine / 25))), .3)
RH.C0 = clerp(RH.C0, cn(1, -1 - 0.1 * math.cos(sine / 8) / 2, -.03 + math.sin(sine / 8) / 2) * RHCF * angles(math.rad(-2), math.rad(20), math.rad(-10) - math.sin(sine / 8)), .3)
LH.C0 = clerp(LH.C0, cn(-1, -1 + 0.1 * math.cos(sine / 8) / 2, -.03 - math.sin(sine / 8) / 2) * LHCF * angles(math.rad(-2), math.rad(20), math.rad(10) - math.sin(sine / 8)), .3)
BowFakeHandleWeld.C0 = clerp(BowFakeHandleWeld.C0, cn(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
PivotHandle1Weld.C0 = clerp(PivotHandle1Weld.C0, cn(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
PivotHandle2Weld.C0 = clerp(PivotHandle2Weld.C0, cn(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
FakeArrowWeld.C0 = clerp(FakeArrowWeld.C0, cn(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
end
end
end
if #Effects > 0 then
for e = 1, #Effects do
if Effects[e] ~= nil then
local Thing = Effects[e]
if Thing ~= nil then
local Part = Thing[1]
local Mode = Thing[2]
local Delay = Thing[3]
local IncX = Thing[4]
local IncY = Thing[5]
local IncZ = Thing[6]
if Thing[1].Transparency <= 1 then
if Thing[2] == "Block1" then
Thing[1].CFrame = Thing[1].CFrame * CFrame.fromEulerAnglesXYZ(math.random(-50, 50), math.random(-50, 50), math.random(-50, 50))
Mesh = Thing[1].Mesh
Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6])
Thing[1].Transparency = Thing[1].Transparency + Thing[3]
elseif Thing[2] == "Block2" then
Thing[1].CFrame = Thing[1].CFrame
Mesh = Thing[7]
Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6])
Thing[1].Transparency = Thing[1].Transparency + Thing[3]
elseif Thing[2] == "Cylinder" then
Mesh = Thing[1].Mesh
Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6])
Thing[1].Transparency = Thing[1].Transparency + Thing[3]
elseif Thing[2] == "Blood" then
Mesh = Thing[7]
Thing[1].CFrame = Thing[1].CFrame * Vector3.new(0, .5, 0)
Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6])
Thing[1].Transparency = Thing[1].Transparency + Thing[3]
elseif Thing[2] == "Elec" then
Mesh = Thing[1].Mesh
Mesh.Scale = Mesh.Scale + Vector3.new(Thing[7], Thing[8], Thing[9])
Thing[1].Transparency = Thing[1].Transparency + Thing[3]
elseif Thing[2] == "Disappear" then
Thing[1].Transparency = Thing[1].Transparency + Thing[3]
elseif Thing[2] == "Shatter" then
Thing[1].Transparency = Thing[1].Transparency + Thing[3]
Thing[4] = Thing[4] * CFrame.new(0, Thing[7], 0)
Thing[1].CFrame = Thing[4] * CFrame.fromEulerAnglesXYZ(Thing[6], 0, 0)
Thing[6] = Thing[6] + Thing[5]
end
else
Part.Parent = nil
table.remove(Effects, e)
end
end
end
end
end
end |
platforms = {}
platforms.instances = {}
function platforms:create(x,y,w,h,b)
local platform = {}
platform.state = "solid"
platform.b = b
platform.x = x or 100
platform.y = y or 300
platform.w = w or 100
platform.h = h or 1
platform.collider = world:newRectangleCollider(platform.x,platform.y,platform.w,platform.h)
platform.collider:setType("static")
platform.collider:setCollisionClass("Platform")
function platform:update()
if platform.state == "solid" then
platform.collider:setCollisionClass("Platform")
if platform.collider:enter("Player") then
player.collider:applyLinearImpulse(0,-platform.b)
end
elseif platform.state == "ghost" then
platform.collider:setCollisionClass("Ghost")
end
if player.collider:getY()+25 > platform.collider:getY() then
platform.state = "ghost"
else
platform.state = "solid"
end
end
table.insert(platforms.instances,platform)
return platform
end
function platforms:update(dt)
for i,v in pairs(platforms.instances) do
v:update()
end
end
return platforms
|
-- chttp.lua
--
-- Wrappers and utility functions for CHTTP
-- Don't overwrite an old version of the module
if chttp then return chttp end
local function getLibExt()
local os = jit.os
local arch = jit.arch
if os == "Windows" and arch == "x86" then
return "win32"
elseif os == "Windows" and arch == "x64" then
return "win64"
elseif os == "Linux" and arch == "x86" then
return "linux"
elseif os == "Linux" and arch == "x64" then
return "linux64"
else
return nil
end
end
if not pcall(require, "chttp") or CHTTP == nil then
if CHTTP_SILENT then
return
end
local libname = getLibExt()
ErrorNoHalt("[chttp-utils] Could not load CHTTP!\n")
if not libname then
print("[chttp-utils] According to the OS information provided (" .. jit.os .. "/" .. jit.arch .. "), your system is not supported by CHTTP.")
print("[chttp-utils] If this is incorrect, please file a bug report on the GitHub page (https://github.com/timschumi/gmod-chttp-utils/issues).")
return
end
print("[chttp-utils] Please make sure that `gmsv_chttp_" .. libname .. ".dll` is present in `/garrysmod/lua/bin`.")
if jit.os == "Linux" then
print("[chttp-utils] Make sure to also try the -static libraries that are available on the Downloads page (https://github.com/timschumi/gmod-chttp/releases), but keep in mind to rename them!")
end
print("[chttp-utils] If you are absolutely sure that this should work (or you exhausted all other options), feel free to file a bug report on the GitHub page (https://github.com/timschumi/gmod-chttp/issues).")
return
end
chttp = {}
function chttp.Fetch(url, onSuccess, onFailure, headers)
CHTTP({
method = "get",
url = url,
success = function(code, body, headers)
if not onSuccess then
return
end
onSuccess(body, string.len(body), headers, code)
end,
failed = function(error)
if not onFailure then
return
end
onFailure(error)
end,
headers = headers or {},
})
end
function chttp.Post(url, parameters, onSuccess, onFailure, headers)
CHTTP({
method = "post",
url = url,
parameters = parameters,
success = function(code, body, headers)
if not onSuccess then
return
end
onSuccess(body, string.len(body), headers, code)
end,
failed = function(error)
if not onFailure then
return
end
onFailure(error)
end,
headers = header or {},
})
end
return chttp
|
-- Support for motion key sequences
local M = {}
-- Implementations of the movements
local vi_motions = require 'textadept-vi.vi_motions'
-- Wrap a possibly nested table, returning a proxy which modifies any value
-- which isn't a nested table. A nested table is considered one with no
-- integer keys (so #t == 0, or t[1] == nil). This allows storing values
-- such as { 1,2,3 }.
-- Parameters:
-- tab: the table to wrap
-- f: function to modify the value from tab.
local function wrap_table(tab, f)
result = setmetatable({wrapped=1, tt=tab}, {
__index = function(t, k)
local m = tab[k]
if m == nil then
return nil
elseif type(m) == 'table' and m[1] == nil then
return wrap_table(m, f)
else
-- Return a (possibly modified) value.
return f(m)
end
end,
})
return result
end
M.wrap_table = wrap_table
-- Valid movement types
MOV_LINE = 'linewise'
MOV_INC = 'inclusive'
MOV_EXC = 'exclusive'
-- Postponed movement. The movement isn't complete (eg a search needs entering), and should
-- be called with a continuation function, which will be called back later with the actual
-- movement.
MOV_LATER = 'later'
-- Wrap a simple movement (eg word right) into one which takes a repeat
-- count.
local function r(f)
return function(rep)
if rep==nil or rep < 1 then
rep = 1
end
for i=1,rep do
f()
end
end
end
M.r = r
-- Table of register keys, returning true.
local registers = setmetatable({splogde=123}, {
__index = function(t, key)
if string.match(key, "^%a$") then
return key
else
return nil
end
end,
})
local function restore_mark(reg)
return { MOV_LINE, function()
newpos = vi_mode.state.marks[reg]
if newpos ~= nil then
newpos = buffer:position_from_line(buffer:line_from_position(newpos))
end
if newpos ~= nil then
buffer:goto_pos(newpos)
end
end, 1 }
end
-- Table of character keys, returning true.
local characters = setmetatable({}, {
__index = function(t, key)
if type(key) == "string" and string.match(key, "^[%g ]$") then
return key
else
return nil
end
end,
})
local function till_char_right(c)
return { MOV_EXC, function()
vi_motions.next_char_of(c)
end, 1 }
end
-- Table of basic motion commands. Each is a list:
-- { type, f, count }
-- where f is a function to do the movement, type is one of
-- MOV_LINE, MOV_EXC, MOV_INC for linewise, exclusive or inclusive,
-- and count is the prefix count. This may be modified when wrapped.
local motions = {
h = { MOV_EXC, r(vi_motions.char_left), 1 },
l = { MOV_EXC, r(vi_motions.char_right), 1 },
j = { MOV_LINE, r(vi_motions.line_down), 1 },
k = { MOV_LINE, r(vi_motions.line_up), 1 },
w = { MOV_EXC, r(vi_motions.word_right), 1 },
b = { MOV_EXC, r(vi_motions.word_left), 1 },
e = { MOV_INC, r(vi_motions.word_end), 1 },
['$'] = { MOV_INC, vi_motions.line_end, 1 },
['^'] = { MOV_EXC, vi_motions.line_beg, 1 },
['_'] = { MOV_LINE, vi_motions.line_down_then_line_beg, 1 },
['{'] = { MOV_EXC, vi_motions.paragraph_backward, 1 },
['}'] = { MOV_EXC, vi_motions.paragraph_forward, 1 },
G = { MOV_LINE, vi_motions.goto_line, -1},
["'"] = wrap_table(registers, restore_mark),
t = wrap_table(characters, till_char_right),
['%'] = { MOV_INC, vi_motions.match_brace, 1 },
-- these are included here so that they work with a repeat count:
['left'] = { MOV_EXC, r(vi_motions.char_left), 1 },
['kpleft'] = { MOV_EXC, r(vi_motions.char_left), 1 },
['right'] = { MOV_EXC, r(vi_motions.char_right), 1 },
['kpright'] = { MOV_EXC, r(vi_motions.char_right), 1 },
['up'] = { MOV_LINE, r(vi_motions.line_up), 1 },
['kpup'] = { MOV_LINE, r(vi_motions.line_up), 1 },
['down'] = { MOV_LINE, r(vi_motions.line_down), 1 },
['kpdown'] = { MOV_LINE, r(vi_motions.line_down), 1 },
['\b'] = { MOV_EXC, r(vi_motions.char_left), 1 }, -- TODO COMPAT: vim moves to prev line at BOL
[' '] = { MOV_EXC, r(vi_motions.char_right), 1 }, -- TODO COMPAT: vim moves to next line at EOL
-- TODO: pgdown, kppgdown, pgup, kppgup
-- TODO: del
-- Search motions
n = { MOV_EXC, r(vi_motions.search_next), 1 },
N = { MOV_EXC, r(vi_motions.search_prev), 1 },
['*'] = { MOV_EXC, r(vi_motions.search_word_next), 1 },
['#'] = { MOV_EXC, r(vi_motions.search_word_prev), 1 },
['/'] = { MOV_LATER, vi_motions.search_fwd, 1 },
['?'] = { MOV_LATER, vi_motions.search_back, 1 },
}
-- Some non-root motions (gg)
M.motions_g = {
g = { MOV_LINE, vi_motions.goto_line_0, -1 },
}
local MOTION_ZERO = { MOV_EXC, vi_motions.line_start, 1 }
local digits = {}
for i=0,9 do
digits[i..''] = true
end
local PREFIX_COUNT = 'laksdjfasdlf' --{} -- unique table key
local function index_digits(t, k)
-- Intercept numbers to return an wrapped version.
if digits[k] then
local precount = t[PREFIX_COUNT]
if precount == nil and k == '0' then
return MOTION_ZERO -- special case - 0 is a motion by itself.
end
-- Rely on the master table never having PREFIX_COUNT.
if precount == nil then
local wrapped = t
-- If this is the first digit, return a wrapped table
local newtab = setmetatable({}, {
--__index=wrapped,
__index = function(wt, k)
-- We already have a prefix count, so increment it.
if digits[k] then
wt[PREFIX_COUNT] = wt[PREFIX_COUNT] * 10 + (k+0)
return t
else
local res = wrapped[k]
if type(res)=='table' and res[1] then
-- This is a motion, so apply the multiple
res = { res[1], res[2], wt[PREFIX_COUNT] }
end
return res
end
end})
t = newtab
precount = 0
end
-- Update the count in the (possibly new) wrapper table
precount = (precount * 10) + (k+0)
t[PREFIX_COUNT] = precount
-- Return the wrapper
return t
else
-- not found
return nil
end
end
setmetatable(motions, {
__index = index_digits,
})
M.motions = motions
-- Convert a simple movement desc into a selection movdesc
function M.movf_to_self(movedesc)
local movtype, mov_f, rep = table.unpack(movedesc)
-- Convert simple movement into a range
return { movtype, function(rep)
local pos1 = buffer.current_pos
mov_f(rep)
local pos2 = buffer.current_pos
if pos1 > pos2 then
pos1, pos2 = pos2, pos1
end
return pos1, pos2
end, rep }
end
-- Table of select (range) motions, used after some commands (eg d{motion}).
-- Each entry is a function returning (start, end) positions.
local sel_motions = setmetatable({
a = {
w = { MOV_EXC, function()
local pos = buffer.current_pos
local s = buffer:word_start_position(pos, true)
buffer:search_anchor()
local e = buffer:search_next(buffer.FIND_REGEXP, "\\s\\w") + 1
return s, e
end, 1},
-- W = function() return 'WORD' end,
},
i = {
w = { MOV_EXC, function()
local pos = buffer.current_pos
local s = buffer:word_start_position(pos, true)
local e = buffer:word_end_position(pos)
return s, e
end, 1},
-- W = function() return 'WORD' end,
},
}, {
__index=wrap_table(motions, M.movf_to_self),
})
M.sel_motions = sel_motions
-- Return an entry suitable for the keys table which implements the vi motion
-- commands.
-- actions: a table of overrides (subcommands which aren't motions), eg for
-- a 'd' handler, this would include 'd' (for 'dd', which deletes the current
-- line).
-- handler: Is called with a movdesc, and should return a no-parameter
-- function which will implement the action.
function M.bind_motions(actions, handler)
local keyseq = {}
setmetatable(actions, { __index=sel_motions })
return wrap_table(actions, handler)
end
return M
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.