content
stringlengths
5
1.05M
local parsedAbilityInfo; function WoWkemon_ParseText(abilityInfo, unparsed) parsedAbilityInfo = abilityInfo; local parsed = string.gsub(unparsed, "%b[]", WoWkemon_ParseExpression); return parsed; end local parserEnv = { --Constants SELF = "self", ENEMY = "enemy", AURAWEARER = "aurawearer", AURACASTER = "auracaster", AFFECTED = "affected", --Proc types (for use in getProcIndex) PROC_ON_APPLY = PET_BATTLE_EVENT_ON_APPLY, PROC_ON_DAMAGE_TAKEN = PET_BATTLE_EVENT_ON_DAMAGE_TAKEN, PROC_ON_DAMAGE_DEALT = PET_BATTLE_EVENT_ON_DAMAGE_DEALT, PROC_ON_HEAL_TAKEN = PET_BATTLE_EVENT_ON_HEAL_TAKEN, PROC_ON_HEAL_DEALT = PET_BATTLE_EVENT_ON_HEAL_DEALT, PROC_ON_AURA_REMOVED = PET_BATTLE_EVENT_ON_AURA_REMOVED, PROC_ON_ROUND_START = PET_BATTLE_EVENT_ON_ROUND_START, PROC_ON_ROUND_END = PET_BATTLE_EVENT_ON_ROUND_END, PROC_ON_TURN = PET_BATTLE_EVENT_ON_TURN, PROC_ON_ABILITY = PET_BATTLE_EVENT_ON_ABILITY, PROC_ON_SWAP_IN = PET_BATTLE_EVENT_ON_SWAP_IN, PROC_ON_SWAP_OUT = PET_BATTLE_EVENT_ON_SWAP_OUT, --We automatically populate with state constants as well in the form STATE_%s --Utility functions ceil = math.ceil, floor = math.floor, abs = math.abs, min = math.min, max = math.max, cond = function(conditional, onTrue, onFalse) if ( conditional ) then return onTrue; else return onFalse; end end, clamp = function(value, minClamp, maxClamp) return min(max(value, minClamp), maxClamp); end, --Data fetching functions unitState = function(stateID, target) if ( not target ) then target = "default"; end return parsedAbilityInfo:GetState(stateID, target); end, unitPower = function(target) if ( not target ) then target = "default"; end return parsedAbilityInfo:GetAttackStat(target); end, unitSpeed = function(target) if ( not target ) then target = "default"; end return parsedAbilityInfo:GetSpeedStat(target); end, unitMaxHealth = function(target) if ( not target ) then target = "default"; end return parsedAbilityInfo:GetMaxHealth(target); end, unitHealth = function(target) if ( not target ) then target = "default"; end return parsedAbilityInfo:GetHealth(target); end, unitIsAlly = function(target) if ( not target ) then target = "default"; end return parsedAbilityInfo:GetPetOwner(target) == LE_BATTLE_PET_ALLY; end, unitHasAura = function(auraID, target) if ( not target ) then target = "default"; end return parsedAbilityInfo:HasAura(auraID, target); end, unitPetType = function(target) if ( not target ) then target = "default"; end return parsedAbilityInfo:GetPetType(target); end, isInBattle = function() return parsedAbilityInfo:IsInBattle(); end, numTurns = function(abilityID) if ( not abilityID ) then abilityID = parsedAbilityInfo:GetAbilityID(); end local id, name, icon, maxCooldown, description, numTurns = C_PetBattles.GetAbilityInfoByID(abilityID); return numTurns; end, currentCooldown = function() return parsedAbilityInfo:GetCurrentCooldown(); end, maxCooldown = function(abilityID) if ( not abilityID ) then abilityID = parsedAbilityInfo:GetAbilityID(); end local id, name, icon, maxCooldown, description, numTurns = C_PetBattles.GetAbilityInfoByID(abilityID); return maxCooldown; end, abilityPetType = function(abilityID) if ( not abilityID ) then abilityID = parsedAbilityInfo:GetAbilityID(); end local id, name, icon, maxCooldown, description, numTurns, petType = C_PetBattles.GetAbilityInfoByID(abilityID); return petType; end, petTypeName = function(petType) return _G["BATTLE_PET_DAMAGE_NAME_"..petType] end, remainingDuration = function() return parsedAbilityInfo:GetRemainingDuration(); end, getProcIndex = function(procType, abilityID) if ( not abilityID ) then abilityID = parsedAbilityInfo:GetAbilityID(); end local turnIndex = C_PetBattles.GetAbilityProcTurnIndex(abilityID, procType); if ( not turnIndex ) then error("No such proc type: "..tostring(procType)); end return turnIndex; end, abilityName = function(abilityID) if ( not abilityID ) then abilityID = parsedAbilityInfo:GetAbilityID(); end local id, name, icon, maxCooldown, description, numTurns, petType = C_PetBattles.GetAbilityInfoByID(abilityID); return name; end, abilityHasHints = function(abilityID) if ( not abilityID ) then abilityID = parsedAbilityInfo:GetAbilityID(); end local id, name, icon, maxCooldown, unparsedDescription, numTurns, petType, noStrongWeakHints = C_PetBattles.GetAbilityInfoByID(abilityID); return petType and not noStrongWeakHints; end, padState = function(stateID, target) if ( not target ) then target = "default"; end return parsedAbilityInfo:GetPadState(stateID, target); end, weatherState = function(stateID) return parsedAbilityInfo:GetWeatherState(stateID); end, abilityStateMod = function(stateID, abilityID) if ( not abilityID ) then abilityID = parsedAbilityInfo:GetAbilityID(); end return C_PetBattles.GetAbilityStateModification(abilityID, stateID); end, }; -- Dynamic fetching functions local effectParamStrings = {C_PetBattles.GetAllEffectNames()}; for i = 1, #effectParamStrings do parserEnv[effectParamStrings[i]] = function(turnIndex, effectIndex, abilityID) if ( not abilityID ) then abilityID = parsedAbilityInfo:GetAbilityID(); end local value = C_PetBattles.GetAbilityEffectInfo(abilityID, turnIndex, effectIndex, effectParamStrings[i]); if ( not value ) then error("No such attribute: "..effectParamStrings[i]); end return value; end; end -- Fill out the environment with all states (format: STATE_%s) C_PetBattles.GetAllStates(parserEnv); --Alias helpers local function FormatDamageHelper(baseDamage, attackType, defenderType) local output = ""; local multi = C_PetBattles.GetAttackModifier(attackType, defenderType); if ( multi > 1 ) then output = GREEN_FONT_COLOR_CODE..math.floor(baseDamage * multi)..FONT_COLOR_CODE_CLOSE; if (ENABLE_COLORBLIND_MODE == 1) then output = output.."|Tinterface\\petbattles\\battlebar-abilitybadge-strong-small:0|t"; end return output; elseif ( multi < 1 ) then output = RED_FONT_COLOR_CODE..math.floor(baseDamage * multi)..FONT_COLOR_CODE_CLOSE; if (ENABLE_COLORBLIND_MODE == 1) then output = output.."|Tinterface\\petbattles\\battlebar-abilitybadge-weak-small:0|t"; end return output; end return math.floor(baseDamage); end local function FormatHealingHelper(baseHeal, healingDone, healingTaken) local output = ""; local doneMulti = (healingDone / 100) local takenMulti = (healingTaken / 100); local finalHeal = baseHeal + baseHeal * doneMulti; finalHeal = finalHeal + finalHeal * takenMulti; local finalMulti = finalHeal / baseHeal; if ( finalMulti > 1 ) then output = GREEN_FONT_COLOR_CODE..math.floor(baseHeal * finalMulti)..FONT_COLOR_CODE_CLOSE; if (ENABLE_COLORBLIND_MODE == 1) then output = output.."|Tinterface\petbattles\battlebar-abilitybadge-strong-small:0|t"; end return output; elseif( finalMulti < 1 ) then output = RED_FONT_COLOR_CODE..math.floor(baseHeal * finalMulti)..FONT_COLOR_CODE_CLOSE; if (ENABLE_COLORBLIND_MODE == 1) then output = output.."|Tinterface\petbattles\battlebar-abilitybadge-weak-small:0|t"; end return output; end return math.floor(baseHeal); end --Aliases parserEnv.OnlyInBattle = function(text) if ( parserEnv.isInBattle() ) then return text else return ""; end end; parserEnv.School = function(abilityID) return parserEnv.petTypeName(parserEnv.abilityPetType(abilityID)); end; parserEnv.SumStates = function(stateID, target) if ( parserEnv.unitPetType(target) == 7 ) then --Elementals aren't affected by weathers. return parserEnv.unitState(stateID, target) + parserEnv.padState(stateID, target); else return parserEnv.unitState(stateID, target) + parserEnv.padState(stateID, target) + parserEnv.weatherState(stateID); end end; --Attack aliases parserEnv.AttackBonus = function() return (1 + 0.05 * parserEnv.unitPower()); end; parserEnv.SimpleDamage = function(...) return parserEnv.points(...) * parserEnv.AttackBonus(); end; parserEnv.StandardDamage = function(...) local turnIndex, effectIndex, abilityID = ...; return parserEnv.FormatDamage(parserEnv.SimpleDamage(...), abilityID); end; parserEnv.FormatDamage = function(baseDamage, abilityID) if ( parserEnv.isInBattle() and parserEnv.abilityHasHints(abilityID) ) then return FormatDamageHelper(baseDamage, parserEnv.abilityPetType(abilityID), parserEnv.unitPetType(parserEnv.AFFECTED)); else return parserEnv.floor(baseDamage); end end; --Healing aliases parserEnv.HealingBonus = function() return (1 + 0.05 * parserEnv.unitPower()); end; parserEnv.SimpleHealing = function(...) return parserEnv.points(...) * parserEnv.HealingBonus(); end; parserEnv.StandardHealing = function(...) return parserEnv.FormatHealing(parserEnv.SimpleHealing(...)); end; parserEnv.FormatHealing = function(baseHealing) if ( parserEnv.isInBattle() ) then return FormatHealingHelper(baseHealing, parserEnv.SumStates(65), parserEnv.SumStates(66)); else return parserEnv.floor(baseHealing); end end; --Don't allow designers to accidentally change the environment local safeEnv = {}; setmetatable(safeEnv, { __index = parserEnv, __newindex = function() end }); function WoWkemon_ParseExpression(expression) --Load the expression, chopping off the [] on the side. local expr = loadstring("return ("..string.sub(expression, 2, -2)..")"); if ( expr ) then --Set the environment up to restrict functions setfenv(expr, safeEnv); --Don't let designer errors cause us to stop execution local success, repl = pcall(expr); if ( success ) then if ( type(repl) == "number" ) then return math.floor(repl); --We don't want to display any decimals. else return repl or ""; end elseif ( IsGMClient() ) then local err = string.match(repl, ":%d+: (.*)"); return "[DATA ERROR: "..err.."]"; else return "DATA ERROR"; end else return "PARSING ERROR"; end end function WoWkemon_ParseAndReturn(expression) --Load the expression, chopping off the [] on the side. local expr = loadstring("return "..expression); if ( expr ) then --Set the environment up to restrict functions setfenv(expr, safeEnv); --Don't let designer errors cause us to stop execution local success, repl = pcall(expr); if ( success ) then if ( type(repl) == "number" ) then return math.floor(repl); --We don't want to display any decimals. else return repl or ""; end elseif ( IsGMClient() ) then local err = string.match(repl, ":%d+: (.*)"); return "[DATA ERROR: "..err.."]"; else local err = string.match(repl, ":%d+: (.*)"); error(err) return "DATA ERROR"; end else return "PARSING ERROR"; end end local OPA = { PET_BATTLE_COMBAT_LOG_AURA_APPLIED = PET_BATTLE_COMBAT_LOG_AURA_APPLIED; PET_BATTLE_COMBAT_LOG_AURA_FADES = PET_BATTLE_COMBAT_LOG_AURA_FADES; PET_BATTLE_COMBAT_LOG_BLOCKED = PET_BATTLE_COMBAT_LOG_BLOCKED; PET_BATTLE_COMBAT_LOG_DAMAGE_CRIT = string.sub(PET_BATTLE_COMBAT_LOG_DAMAGE,0,-2) .. PET_BATTLE_COMBAT_LOG_DAMAGE_CRIT; PET_BATTLE_COMBAT_LOG_DAMAGE_STRONG = string.sub(PET_BATTLE_COMBAT_LOG_DAMAGE,0,-2) .. PET_BATTLE_COMBAT_LOG_DAMAGE_STRONG; PET_BATTLE_COMBAT_LOG_DAMAGE_WEAK = string.sub(PET_BATTLE_COMBAT_LOG_DAMAGE,0,-2) .. PET_BATTLE_COMBAT_LOG_DAMAGE_WEAK; -- PET_BATTLE_COMBAT_LOG_DAMAGE_CRIT = PET_BATTLE_COMBAT_LOG_DAMAGE_CRIT; -- PET_BATTLE_COMBAT_LOG_DAMAGE_STRONG = PET_BATTLE_COMBAT_LOG_DAMAGE_STRONG; -- PET_BATTLE_COMBAT_LOG_DAMAGE_WEAK = PET_BATTLE_COMBAT_LOG_DAMAGE_WEAK; PET_BATTLE_COMBAT_LOG_DAMAGE = PET_BATTLE_COMBAT_LOG_DAMAGE; PET_BATTLE_COMBAT_LOG_DEATH = PET_BATTLE_COMBAT_LOG_DEATH; PET_BATTLE_COMBAT_LOG_DEFLECT = PET_BATTLE_COMBAT_LOG_DEFLECT; PET_BATTLE_COMBAT_LOG_DODGE = PET_BATTLE_COMBAT_LOG_DODGE; --PET_BATTLE_COMBAT_LOG_ENEMY = PET_BATTLE_COMBAT_LOG_ENEMY; --PET_BATTLE_COMBAT_LOG_ENEMY_LOWER = PET_BATTLE_COMBAT_LOG_ENEMY_LOWER; --PET_BATTLE_COMBAT_LOG_ENEMY_TEAM = PET_BATTLE_COMBAT_LOG_ENEMY_TEAM; --PET_BATTLE_COMBAT_LOG_ENEMY_TEAM_LOWER = PET_BATTLE_COMBAT_LOG_ENEMY_TEAM_LOWER; PET_BATTLE_COMBAT_LOG_HEALING = PET_BATTLE_COMBAT_LOG_HEALING; PET_BATTLE_COMBAT_LOG_IMMUNE = PET_BATTLE_COMBAT_LOG_IMMUNE; PET_BATTLE_COMBAT_LOG_MISS = PET_BATTLE_COMBAT_LOG_MISS; PET_BATTLE_COMBAT_LOG_NEW_ROUND = PET_BATTLE_COMBAT_LOG_NEW_ROUND; PET_BATTLE_COMBAT_LOG_PAD_AURA_APPLIED = PET_BATTLE_COMBAT_LOG_PAD_AURA_APPLIED; PET_BATTLE_COMBAT_LOG_PAD_AURA_FADES = PET_BATTLE_COMBAT_LOG_PAD_AURA_FADES; PET_BATTLE_COMBAT_LOG_PARRY = PET_BATTLE_COMBAT_LOG_PARRY; PET_BATTLE_COMBAT_LOG_PET_SWITCHED = PET_BATTLE_COMBAT_LOG_PET_SWITCHED; PET_BATTLE_COMBAT_LOG_REFLECT = PET_BATTLE_COMBAT_LOG_REFLECT; PET_BATTLE_COMBAT_LOG_TRAP_HIT = PET_BATTLE_COMBAT_LOG_TRAP_HIT; PET_BATTLE_COMBAT_LOG_TRAP_MISS = PET_BATTLE_COMBAT_LOG_TRAP_MISS; PET_BATTLE_COMBAT_LOG_WEATHER_AURA_APPLIED = PET_BATTLE_COMBAT_LOG_WEATHER_AURA_APPLIED; PET_BATTLE_COMBAT_LOG_WEATHER_AURA_FADES = PET_BATTLE_COMBAT_LOG_WEATHER_AURA_FADES; } for i,j in pairs(OPA) do j = j:gsub("%(","%%("); j = j:gsub("%)","%%)"); j = j:gsub("%%s","(.+)"); j = j:gsub("%%d","(%%d+)"); --j = j:gsub("%.","%%."); OPA[i] = j; end function WoWkemon_CombatLogEvent(unparsed) for i,j in pairs(OPA) do if unparsed:match(j) then return i; end end end
-- local function data(file, tag, names, stripFunc, postFunc) local parser = require "otherData.featParser" local names = { "Hobbyist", "Dilettante", "Dabbler", "Look and Learn" } local m = string.match local function strip(parser, str) -- local firstFeat = parser.names[1] return m(str, "(.-)Scene Features List Action Point Features List\r\n") end local function post(feats, str) local ex = {} -- local exStr = m(str, "Trainer Class Feature Prerequisite Trainer Class Feature Prerequisite\r\n(.+)") local sceneFeats = {} local actionFeats = {} local function makeFeat(tbl, class, name, preqs) table.insert(tbl, {name = name, class = class, preqs = preqs}) end -- fuck this grid shit, do it manually makeFeat(sceneFeats, "Ace Trainer", "Critical Moment", "Commander's Voice") makeFeat(sceneFeats, "Capture Specialist", "Capture Techniques (False Strike and Catch Combo Only", "Poké Ball Crafter") makeFeat(sceneFeats, "Enduring Soul", "Staying Power", "Medic Training") makeFeat(sceneFeats, "Trickster", "Sleight", "Command Versatility") makeFeat(sceneFeats, "Researcher", "Chemical Warfare", "Repel Crafter") makeFeat(sceneFeats, "Roughneck", "Mettle", "Defender") makeFeat(actionFeats, "Coordinator", "Nuanced Performance", "Grace") makeFeat(actionFeats, "Juggler", "Round Trip", "Quick Switch") makeFeat(actionFeats, "Chef", "Hits the Spot", "Basic Cooking") makeFeat(actionFeats, "Fashionista", "Style is Eternal", "Groomer") makeFeat(actionFeats, "Athlete", "Coaching", "Swimmer") makeFeat(actionFeats, "Tumbler", "Quick Gymnastics", "Acrobat") ex.sceneFeats = sceneFeats ex.actionFeats = actionFeats return ex end return parser("hobbyist.txt", "Hobbyist Class", names, strip, post)
local Broadcast = require("core.Broadcast") local EffectFlag = require("core.EffectFlag") local Heal = require("core.Heal") -- -- Effect applied by Judge skill. Reduces damage done. return { config = { name = "Judged", description = "Damage of your next attack is reduced.", type = "skill:judge", }, flags = { EffectFlag.DEBUFF }, state = { reductionPercent = 0 }, modifiers = { incomingDamage = function(self, damage, current) return current end, outgoingDamage = function(self, damage, currentAmount) if Heal:class_of(damage) or damage.attribute ~= "health" then return currentAmount end local reduction = math.floor(currentAmount * (self.state.reductionPercent / 100)); return currentAmount - reduction; end, }, listeners = { effectActivated = function(self) Broadcast.sayAt(self.target, "<yellow>The holy judgement weakens you."); end, effectDeactivated = function(self) Broadcast.sayAt(self.target, "<yellow>You feel your strength return."); end, hit = function(self) self:remove(); end, }, };
local lor = require("lor.index") local app = lor() local router = require("api.router") -- routes app:use(router()) -- 404 error app:use(function(req, res, next) if req:is_found() ~= true then res:status(404):json({ success = false, msg = "404! sorry, not found." }) end end) -- error handle middleware app:erroruse(function(err, req, res, next) ngx.log(ngx.ERR, err) res:status(500):json({ success = false, msg = "500! unknown error." }) end) app:run()
--[[ Transmit ======== Used for making server-client and cross-script communication easy. This module takes care of managing the location of all your transmission objects (remote/bindable event/function) and allows you to access them quickly and easily. Functions --------- Each one of these functions takes a `name` parameter, which determines the name of the transmission object you're generating. If the transmission object does not exist, it will be created. This means you use the same syntax across all Scripts. transmit.getLocalEvent(string name) transmit.getLocalFunction(string name) transmit.getRemoteEvent(string name) transmit.getRemoteFunction(string name) Usage ----- -- Server local event = transmit.getRemoteEvent("ServerMessage") event:FireAllClients("Greetings from the server!") -- Client local event = transmit.getRemoteEvent("ServerMessage") event.OnClientEvent:connect(function(msg) print(msg) -- "Greetings from the server!" end) --]] local replicatedStorage = game:GetService("ReplicatedStorage") local transmit = {} local STORAGE_NAME = "TransmitStorage" local STORAGE_PARENT = replicatedStorage local function new(className, parent, name) local inst = Instance.new(className, parent) inst.Name = name or inst.Name return inst end local function getStorage() local storage = STORAGE_PARENT:FindFirstChild(STORAGE_NAME) return storage or new("Folder", STORAGE_PARENT, STORAGE_NAME) end local function getTransmissionObject(className, name) assert(type(name) == "string", "Please specify a name for the transmit ".. "object.") local storage = getStorage() local object = storage:FindFirstChild(name) return object or new(className, storage, name) end -------------------------------------------------------------------------------- function transmit.getLocalEvent(name) return getTransmissionObject("BindableEvent", name) end function transmit.getLocalFunction(name) return getTransmissionObject("BindableFunction", name) end function transmit.getRemoteEvent(name) return getTransmissionObject("RemoteEvent", name) end function transmit.getRemoteFunction(name) return getTransmissionObject("RemoteFunction", name) end return transmit
return { id = "effect_fire", type = "effect", name = "Fire", description = "n/a", rarity = 1, hidden = false, thumbnailImage = "rbxassetid://3243264674", metadata = { effectType = "particle", effectInstances = { -- instances to clone into torso from assetmodels/effect "effect_fire", } } }
function SkillTreeManager:pack_to_string() local packed_string = "" for tree, data in ipairs(tweak_data.skilltree.trees) do if not data.is_custom then local points, num_skills = managers.skilltree:get_tree_progress_new(tree) packed_string = packed_string .. tostring(points) if tree ~= #tweak_data.skilltree.trees then packed_string = packed_string .. "_" end end end local current_specialization = self:digest_value(self._global.specializations.current_specialization, false, 1) local tree_data = self._global.specializations[current_specialization] if tree_data then local tier_data = tree_data.tiers if tier_data then local current_tier = self:digest_value(tier_data.current_tier, false) packed_string = packed_string .. "-" .. tostring(current_specialization) .. "_" .. tostring(current_tier) end end return packed_string end -- Debug points -- function SkillTreeManager:specialization_points() -- self._global.specializations.points = self:digest_value(100000) -- return self._global.specializations.points and self:digest_value(self._global.specializations.points, false) or 0 -- end
-- TODO: Are we keeping the reset API or doing something different? local function create() local data = {} return { get = function(name, scope) if data[name] == nil then data[name] = {} end if data[name][scope] == nil then data[name][scope] = {} end return data[name][scope] end, reset = function() for key in pairs(data) do data[key] = nil end end, } end local function createDefault() local data = {} return { get = function() return data end, reset = function() for key in pairs(data) do data[key] = nil end end, } end return { Default = createDefault(), Global = create(), Ordered = create(), }
local Component = require "component" local Attacker = Component:extend() Attacker.name = "Attacker" Attacker.requirements = {components.Stats} function Attacker:__new(options) self.defaultAttack = options.defaultAttack end function Attacker:initialize(actor) actor.defaultAttack = self.defaultAttack actor.wielded = self.defaultAttack actor:addAction(actions.Attack) actor:addAction(actions.Wield) actor:addAction(actions.Unwield) end return Attacker
---This config file is designed for adding a backdoor to the system. It has a few -- options by default, only one enabled by default. I suggest -- -- Note that none of these modules are included with Nmap by default. -- Any variable in the 'config' table in smb-psexec.nse can be overriden in the -- 'overrides' table. Most of them are not really recommended, such as the host, -- key, etc. overrides = {} --overrides.timeout = 40 modules = {} local mod -- TODO: allow the user to specify parameters --Note: password can't be longer than 14-characters, otherwise the program pauses for -- a response mod = {} mod.upload = false mod.name = "Adding a user account: $username/$password" mod.program = "net" mod.args = "user $username $password /add" mod.maxtime = 2 mod.noblank = true mod.req_args = {'username','password'} table.insert(modules, mod)
function test () print ("mathlib spline loader test") local node = Common.StringNode.LoadXml ("data/splines.xml") local splines_count = node.ChildrenCount for i = 0, splines_count - 1 do local spline_node = node:Child (i) if spline_node.Name == "Spline" then local spline = nil local spline_type = spline_node:Get ("Type") if spline_type == "float" then spline = Math.SplineLoader.LoadLinearFloatSpline (spline_node, "Key", "Time", "Value") elseif spline_type == "vec2f" then spline = Math.SplineLoader.LoadLinearVec2fSpline (spline_node, "Key", "Time", "Value") elseif spline_type == "vec3f" then spline = Math.SplineLoader.LoadLinearVec3fSpline (spline_node, "Key", "Time", "Value", " ;") elseif spline_type == "vec4f" then spline = Math.SplineLoader.LoadLinearVec4fSpline (spline_node, "Key", "Time", "Value", " ;") end print ("Loaded spline with type '" .. spline_type .. "'") print ("Keys count = " .. spline.KeysCount) end end end
-- Example `init.lua` file that adds a custom hotkey to enter normal mode -- Load & initialize Ki spoon hs.loadSpoon('Ki') -- Set custom transition event that enters normal mode. spoon.Ki.transitionEvents = { -- Add desktop mode transition event to enter normal mode with cmd+; from desktop mode desktop = { { {"cmd"}, ";", function() spoon.Ki.state:enterNormalMode() end, { "Desktop Mode", "Transition to Normal Mode" }, }, }, } -- Start Ki spoon.Ki:start()
local gps = require "nvim-gps" gps.setup { icons = { ["class-name"] = " ", -- Classes and class-like objects ["function-name"] = " ", -- Functions ["method-name"] = " ", -- Methods (functions inside class-like objects) ["container-name"] = "⛶ ", -- Containers (example: lua tables) ["tag-name"] = "", -- Tags (example: html tags) }, -- Add custom configuration per language or -- Disable the plugin for a language -- Any language not disabled here is enabled by default languages = { -- ["bash"] = false, -- disables nvim-gps for bash -- ["go"] = false, -- disables nvim-gps for golang -- ["ruby"] = { -- separator = '|', -- Overrides default separator with '|' -- icons = { -- -- Default icons not specified in the lang config -- -- will fallback to the default value -- -- "container-name" will fallback to default because it's not set -- ["function-name"] = '', -- to ensure empty values, set an empty string -- ["tag-name"] = '' -- ["class-name"] = '::', -- ["method-name"] = '#', -- } --} }, separator = " > ", -- limit for amount of context shown -- 0 means no limit -- Note: to make use of depth feature properly, make sure your separator isn't something that can appear -- in context names (eg: function names, class names, etc) depth = 0, -- indicator used when context is hits depth limit depth_limit_indicator = "..", }
test = require 'u-test' common = require 'common' function MPM_Match_Handler() print("MPM_Match") MultiDeviceSyncAndWait("MPM_Match"); XblMultiplayerManagerInitialize(); StartDoWorkLoop(); XblMultiplayerManagerLobbySessionAddLocalUser(); end function OnXblMultiplayerEventType_UserAdded() MultiDeviceSyncAndWait("UserAdded"); XblMultiplayerManagerFindMatch("PlayerSkillNoQoS"); end function OnXblMultiplayerEventType_FindMatchCompleted() VerifyMPMGameSessionProperites(); VerifyMPMLobbySessionProperites(); MultiDeviceSyncAndWait("FindMatch"); XblMultiplayerManagerLeaveGame() end function OnXblMultiplayerEventType_JoinGameCompleted() MultiDeviceSyncAndWait("JoinGameCompleted"); test.stopTest(); end function OnXblMultiplayerEventType_LeaveGameCompleted() MultiDeviceSyncAndWait("LeaveGameCompleted"); test.stopTest(); end test.ismultidevice = true test.MPM_Match = function() common.init(MPM_Match_Handler) end
local MUC_NS = "http://jabber.org/protocol/muc"; local jid = require "util.jid"; local os = require "os"; -- allow jibri to join room with password module:hook("muc-occupant-pre-join", function (event) local room, stanza = event.room, event.stanza; local user, domain, res = jid.split(event.stanza.attr.from); if user==os.getenv("JIBRI_RECORDER_USER") and domain==os.getenv("XMPP_RECORDER_DOMAIN") then local join = stanza:get_child("x", MUC_NS); join:tag("password", { xmlns = MUC_NS }):text(room:get_password()); end; end);
local bench_utils = require 'bench_utils' -- Output file local output_path = 'baseline_st.md' local output = io.open(output_path, "w") output:write("## Results\n") output:write("This file contains the results for the tests on the GTSRB dataset.\n\n") output:write("| Command line arguments | accuracy on validation set |\n") output:write("| --------------------- | ----- |\n") print("Running best result with full dataset.") local params = {} table.insert(params, {'-n -1 --st --locnet 100,200,100', {true}}) bench_utils.run_test(params, output) print("Running main tests.") params = {} table.insert(params, {'--val', {true}}) -- run tests on the validation set table.insert(params, {'--no_lnorm', {false, true}}) table.insert(params, {'--no_cnorm', {false, true}}) table.insert(params, {'--st', {true}}) table.insert(params, {'--sca --tra', {false, true}}) table.insert(params, {'--locnet ', {false, "20,20,20", "60,60,60", "100,100,100", "50,100,50", "100,200,100", "100,100,50", "150,150,100"}}) bench_utils.run_test(params, output) print("Running extra tests with bigger localization networks.") params = {} table.insert(params, {'--val', {true}}) -- run tests on the validation set table.insert(params, {'--st', {true}}) table.insert(params, {'--sca --tra', {false, true}}) table.insert(params, {'--locnet ', {"141,141,141", "150,150,150", "200,200,200", "250,250,250", "150,250,150", "200,300,200"}}) bench_utils.run_test(params, output) print("Running tests with multiple spatial transformers") params = {} table.insert(params, {'--val', {true}}) -- run tests on the validation set table.insert(params, {'--st', {true}}) table.insert(params, {'--locnet ', {'""', "150,150,150", "150,250,150"}}) table.insert(params, {'--locnet2 ', {"150,150,150", "150,250,150", "75,75,75", "75,125,75"}}) bench_utils.run_test(params, output) print("Running test with the idsia network.") params = {} table.insert(params, {'--val', {true}}) -- run tests on the validation set table.insert(params, {'--net ', {"idsia_net.lua"}}) table.insert(params, {'--cnn ', {"100,150,250,300", "150,200,300,350"}}) table.insert(params, {'--st', {true}}) table.insert(params, {'--sca --tra', {false, true}}) table.insert(params, {'--locnet ', {"100,200,100", "150,250,150"}}) bench_utils.run_test(params, output) print("Running tests with multiple spatial transformers on idsia network") params = {} table.insert(params, {'--val', {true}}) -- run tests on the validation set table.insert(params, {'--st', {true}}) table.insert(params, {'--net ', {"idsia_net.lua"}}) table.insert(params, {'--cnn ', {"150,200,300,350", "200,250,350,400"}}) table.insert(params, {'--locnet ', {'""', "150,150,150", "200,300,200"}}) table.insert(params, {'--locnet2 ', {false, "150,150,150", "75,75,75"}}) table.insert(params, {'--locnet3 ', {false, "150,150,150", "75,75,75"}}) bench_utils.run_test(params, output) output:write('\n\n') output:write('This file is generated by the `baseline_st.lua` script.\n') output:close()
-- -- Created by IntelliJ IDEA. -- User: nander -- Date: 02/03/2019 -- Time: 15:27 -- To change this template use File | Settings | File Templates. -- return function(station) return { draw = function(event) local t = event.otime - event.timeLeft local T = event.otime local stationPosition = station.position love.graphics.setColor(0.7,0.7,0.7) love.graphics.rectangle("fill", stationPosition.x-200 , stationPosition.y + 100, 400,100) love.graphics.setColor(1,1,1) love.graphics.draw(RESOURCES.cleaned, stationPosition.x-180 , stationPosition.y + 130) end, initialize = function() end } end
-- issue #10 local function inspect(options) options = options or {} return type(options) end assert(inspect(nil) == "table") local function inspect(options) options = options or setmetatable({}, {__mode = "test"}) return type(options) end assert(inspect(nil) == "table") -- issue #16 local ok, msg = pcall(function() local a = {} a[nil] = 1 end) assert(not ok and string.find(msg, "table index is nil", 1, true)) -- issue #19 local tbl = {1,2,3,4,5} assert(#tbl == 5) assert(table.remove(tbl) == 5) assert(#tbl == 4) assert(table.remove(tbl, 3) == 3) assert(#tbl == 3)
local urdf={} return urdf
--[[ Mandatory Configs TODO: All of these configs maybe should be convars.. I mean that's literally what they're for. ]] local WEBHOOK = assert( cookie.GetString("DISCORD_WEBHOOK"), "Webhook link is not set! Use cookie.Set('DISCORD_WEBHOOK', 'xyz')" ) local BOT_TOKEN = assert( cookie.GetString("DISCORD_TOKEN"), "Bot token is not set! Use cookie.Set('DISCORD_TOKEN', 'xyz')" ) --[[ Optional Configs ]] --[[ Content / Images ]] -- Avatar shown in discord channel messages local AVATAR = cookie.GetString("DISCORD_AVATAR", "https://cdn.discordapp.com/attachments/732861600708690010/937171111421038592/glua.png") -- Gateway used to communicate w/ discord. local GATEWAY = cookie.GetString("DISCORD_GATEWAY", "wss://gateway.discord.gg") -- Bot / Webhook ID local BOT_ID = cookie.GetString("DISCORD_BOT_ID") -- Steam question mark if we couldn't get the avatar of someone, or haven't yet. local QMARK_AVATAR = cookie.GetString("DISCORD_UNKNOWNAVATAR", "https://cdn.discordapp.com/attachments/732861600708690010/937444253993422848/qmark.jpg") local function CvarInt(...) return { "GetInt", CreateConVar(...) } end local function CvarStr(...) return { "GetString", CreateConVar(...) } end local function CvarBool(...) return { "GetBool", CreateConVar(...) } end local Convars = { LinkChannel = CvarStr("glink_channel_id", "", {FCVAR_PROTECTED, FCVAR_ARCHIVE, FCVAR_UNLOGGED, FCVAR_DONTRECORD}, "Channel ID to send messages to and listen to."), Prefix = CvarStr("glink_bot_prefix", "!", FCVAR_ARCHIVE, "Prefix to use with glink discord-side. Default !"), PermsRole = CvarStr("glink_perms_role", "", FCVAR_ARCHIVE, "ID of Admin / OP Role for permissions with glink commands."), Enabled = CvarBool("glink_enabled", "1", FCVAR_ARCHIVE, "Enable Glink"), } ---@class DiscordConfigs ---@field LinkChannel string ---@field Prefix string ---@field PermsRole string ---@field Enabled boolean local Configs = { AVATAR = AVATAR, WEBHOOK = WEBHOOK, BOT_TOKEN = BOT_TOKEN, BOT_ID = BOT_ID, GATEWAY = GATEWAY, QMARK_AVATAR = QMARK_AVATAR, } -- Indexing will get the convar value dynamically. setmetatable(Configs, { __index = function(_, k) local cvar_data = rawget(Convars, k) if cvar_data then local cvar_access, cvar = cvar_data[1], cvar_data[2] return cvar[cvar_access](cvar) end end }) assert(Convars.LinkChannel and Convars.LinkChannel ~= "", "Channel ID is not set! Use glink_channel_id cvar.") return Configs
local _KnockDownBoost_CopDamagedamage_melee = CopDamage.damage_melee function CopDamage:damage_melee(attack_data) if self._unit:base()._tweak_table ~= "tank" then if managers.player:player_unit():inventory():akimbo_shield_enabled() and managers.blackmarket:equipped_melee_weapon() == "weapon" then attack_data.variant = 'counter_spooc' --shield knockdown POWER! It's balanced - cit end end return _KnockDownBoost_CopDamagedamage_melee(self, attack_data) end
--[[ All network strings should be precached HERE ]]-- hook.Add("Initialize", "Precache all network strings", function() util.AddNetworkString("Death Notice") util.AddNetworkString("Class Selection") util.AddNetworkString("Taunt Selection") util.AddNetworkString("Taunt Selection BROADCAST") util.AddNetworkString("Help") util.AddNetworkString("Round Update") util.AddNetworkString("Player Death") util.AddNetworkString("Prop Update") util.AddNetworkString("Reset Prop") util.AddNetworkString("Selected Prop") util.AddNetworkString("Prop Angle Lock") util.AddNetworkString("Prop Angle Snap") util.AddNetworkString("Prop Pitch Enable") util.AddNetworkString("Prop Revert") util.AddNetworkString("Hunter Hint Updown") util.AddNetworkString("AutoTaunt Update") util.AddNetworkString("Prop Roll") util.AddNetworkString("Popup Open") util.AddNetworkString("BSOD Open") util.AddNetworkString("Reset To Spawn") util.AddNetworkString("Unstick Prop") util.AddNetworkString("Ghost Door") util.AddNetworkString("Pay Respects") util.AddNetworkString("Display Respects") end) net.Receive("Class Selection", function(len, ply) local chosen = net.ReadUInt(32) SetTeam(ply, chosen) end) net.Receive("Taunt Selection", function(len, ply) local taunt = net.ReadString() local pitch = net.ReadUInt(8) if (!QMenuAntiAbuse(ply)) then SendTaunt(ply, taunt, pitch) end end) --[[ When a player presses +use on a prop ]]-- net.Receive("Selected Prop", function(len, ply) local ent = net.ReadEntity() if (ply.pickupProp or !playerCanBeEnt(ply, ent)) then return end local oldHP = ply:GetProp().health SetPlayerProp(ply, ent, PROP_CHOSEN_SCALE) ply:GetProp().health = oldHP end) --[[ When a player wants to lock world angles on their prop ]]-- net.Receive("Prop Angle Lock", function(len, ply) local shouldAngleLock = net.ReadBit() == 1 local propAngle = net.ReadAngle() local prevLockedAngle = ply:GetPropLockedAngle() ply:SetPropAngleLocked(shouldAngleLock) ply:SetPropLockedAngle(propAngle) local prop = ply:GetProp() if (IsValid(prop)) then ResetPropToProp(ply) ply.prevAngleLockChange = true ply.prevLockedAngle = prevLockedAngle end end) --[[ When a player wants enable pitch on their prop ]]-- net.Receive("Prop Pitch Enable", function(len, ply) local shouldPitchEnable = net.ReadBit() == 1 ply:SetPropPitchEnabled(shouldPitchEnable) end) --[[ When a player wants to lock world angles on their prop ]]-- net.Receive("Prop Revert", function(len, ply) RevertProp(ply) end) net.Receive("Hunter Hint Updown", function(len, ply) local closestPropTaunting = GetClosestTaunter(ply) if (closestPropTaunting != nil) then local heightDiff = closestPropTaunting:GetPos().z - ply:GetPos().z if (heightDiff > ply:GetViewOffset().z) then ply:SetEyeAngles( ply:EyeAngles() + Angle( -15, 0, 0 ) ) elseif (heightDiff < 0) then ply:SetEyeAngles( ply:EyeAngles() + Angle( 15, 0, 0 ) ) end end end) --[[ When a player wants toggle world angle snapping on their prop ]]-- net.Receive("Prop Angle Snap", function(len, ply) local shouldAngleSnap = net.ReadBit() == 1 ply:SetPropAngleSnapped(shouldAngleSnap) end) --[[ Adjust the prop roll angle ]]-- net.Receive("Prop Roll", function(len, ply) local rollAngleToAdd = net.ReadInt(16) local newRollAngle = (ply:GetPropRollAngle() + rollAngleToAdd + 180) % 360 - 180 ply:SetPropRollAngle(newRollAngle) end) net.Receive("Unstick Prop", function(len, ply) UnstickPlayer(ply, 10) end) net.Receive("Reset To Spawn", function(len, ply) ply:SetPos(table.Random(team.GetSpawnPoints(ply:Team())):GetPos()) UnstickPlayer(ply, 10) end) --[[ When a ghost prop presses +use on a prop ]]-- net.Receive("Ghost Door", function(len, ply) if (CurTime() < ply:GetTimeOfNextDoorOpen()) then return end local door = net.ReadEntity() if (!IsValid(door) or !table.HasValue(DOORS, door:GetClass())) then return end ply:SetTimeOfNextDoorOpen(CurTime() + PROP_GHOST_DOOR_WAIT) door:Fire("Toggle") end) net.Receive("Pay Respects", function(len, ply) PayRespects(ply) end)
module(..., package.seeall) local counter = require("core.counter") local lib = require("core.lib") local data = require("lib.yang.data") local state = require("lib.yang.state") local lwutil = require("apps.lwaftr.lwutil") local write_to_file = lwutil.write_to_file function load_requested_counters(counters) local result = dofile(counters) assert(type(result) == "table", "Not a valid counters file: "..counters) return result end function diff_counters(final, initial) local results = {} for name, ref in pairs(initial) do local cur = final[name] if cur ~= ref then results[name] = tonumber(cur - ref) end end return results end function validate_diff(actual, expected) if not lib.equal(actual, expected) then local msg print('--- Expected (actual values in brackets, if any)') for k, v in pairs(expected) do msg = k..' = '..v if actual[k] ~= nil then msg = msg..' ('..actual[k]..')' end print(msg) end print('--- actual (expected values in brackets, if any)') for k, v in pairs(actual) do msg = k..' = '..v if expected[k] ~= nil then msg = msg..' ('..expected[k]..')' end print(msg) end error('counters did not match') end end function regen_counters(counters, outfile) local cnames = lwutil.keys(counters) table.sort(cnames) local out_val = {'return {'} for _,k in ipairs(cnames) do table.insert(out_val, string.format(' ["%s"] = %s,', k, counters[k])) end table.insert(out_val, '}\n') write_to_file(outfile, (table.concat(out_val, '\n'))) end
------------------------------------------------------------------------------------------------------------ -- Cairo UI - Develop by David Lannan -- -- Design Notes: -- The aim of the UI is to provide pixel consistancy for scalable graphics. What this means is the art -- and the scalable graphics use a common measurement system (currently 1024 x1024) and it auto pixel -- scales the output to match the target UI resolution. -- -- Why this is needed - Quite often when you scale Cairo you will get pixel blends and stretching that -- deform the output. Small fonts are a good example. If you rotate or place some cairo operation on a small -- font with a small base scale then you will lose pixels in the operation and the output will look poor. -- By using a high internal level of scale but maintaining the output to match the target it means -- the blending will look good for the target resolution no matter the size. -- -- When the resolution has a unique aspect (non square) then we adjust the underlying maximum sizes so that -- it still matches. For example, 640x480 will have a underlying Cairo UI size of 1024x768 rather than 1024x1024 -- to ensure close pixel approximation. A mobile phone type resolution of 480x800 will map to 614x1024 -- -- Cairo UI cannot solve all layout UI problems, but it should make development much easier in the long run. -- ------------------------------------------------------------------------------------------------------------ CAIRO_RENDER = {} -- These are valid resolution widths for textures that map closely to resolutions. -- The concept is that the underlying texture map should closely match the required resolution. -- Using this method the output graphics will be clear and 'tidy' only most devices. CAIRO_RENDER_SIZES = { 512, 1024, 2048, 4096 } -- The function here finds the best solution from an input width. function CAIRO_RENDER:GetSize(width, aspect) local w = width for k,v in pairs(CAIRO_RENDER_SIZES) do if v > width then w=v; break; end end return w, math.ceil( w * aspect ) end --Some sensible defaults... CAIRO_RENDER.DEFAULT_WIDTH = 512 CAIRO_RENDER.DEFAULT_HEIGHT = 512 CAIRO_RENDER.MAX_PIXEL_SIZE = 2048 ------------------------------------------------------------------------------------------------------------ CAIRO_UI = { LEFT = 0, RIGHT = 1, TOP = 2, BOTTOM = 3, EXPLODER_TWEEN_TIME = 0.1, SLIDER_TWEEN_TIME = 0.1 } ------------------------------------------------------------------------------------------------------------ CAIRO_TYPE = { -- Base types TEXT = 0, BUTTON = 1, IMAGE = 2, TEXTBOX = 3, -- Text entry box, same as text but has input handling and such. -- Complex types SLIDEOUT = 10, EXPLODER = 11, LISTBOX = 12, -- Technically the same as VLINE/LIST.. TODO: will need to sort out later PANEL = 13, -- Simple Dialog / Window like panel -- Layout types HLINE = 20, VLINE = 21, LIST = 22 } ------------------------------------------------------------------------------------------------------------ CAIRO_STATE = {} CAIRO_STATE.SO_STATES = { INITIAL = 0, MOVING_OUT = 1, OUT = 2, MOVING_IN = 3, IN = 4} ------------------------------------------------------------------------------------------------------------ CAIRO_STYLE = {} CAIRO_STYLE.WHITE = { r=1.0, g=1.0, b=1.0, a=1.0 } ------------------------------------------------------------------------------------------------------------ -- Metro style colours!! Base metroc colors (ala Win8) CAIRO_STYLE.METRO = {} CAIRO_STYLE.METRO.ORANGE = { r=0.97, g=0.576, b=0.117, a=1 } CAIRO_STYLE.METRO.PURPLE = { r=0.341, g=0.149, b=0.5, a=1 } CAIRO_STYLE.METRO.LBLUE = { r=0.012, g=0.684, b=0.859, a=1 } CAIRO_STYLE.METRO.SEAGREEN = { r=0.258, g=0.570, b=0.598, a=1 } CAIRO_STYLE.METRO.GREEN = { r=0.469, g=0.730, b=0.265, a=1 } ------------------------------------------------------------------------------------------------------------ CAIRO_STYLE.ICONS = {} CAIRO_STYLE.ICONS.tick_64 = "data/icons/generic_obj_tick_64.png" CAIRO_STYLE.ICONS.folder_64 = "data/icons/generic_obj_folder_64.png" CAIRO_STYLE.ICONS.arrowup_64 = "data/icons/generic_arrowup_64.png" CAIRO_STYLE.ICONS.arrowdn_64 = "data/icons/generic_arrowdn_64.png" ------------------------------------------------------------------------------------------------------------
-- Tracks a queue data structure. -- Values are tracked via incrementing ID keys, when something is nilled it is tracked as an "empty" ServerQueue = class( function(self) self:clear() end ) function ServerQueue.clear(self) self.data = {} self.first = 0 self.last = -1 self.empties = 0 end function ServerQueue.to_string(self) return "QUEUE: " .. dump(self) end function ServerQueue.to_short_string(self) local returnString = "" if self.first <= self.last then local still_empty = true for i = self.first, self.last do local msg = self.data[i] if msg ~= nil then for type, data in pairs(msg) do returnString = returnString .. type .. " " end end end end return returnString end -- push a server message in queue function ServerQueue.push(self, msg) local last = self.last + 1 self.last = last self.data[last] = msg end -- pop oldest server message in queue function ServerQueue.pop(self) local first = self.first local ret = nil for i = self.first, self.last do ret = self.data[first] self.data[first] = nil first = first + 1 if ret then break end end self.first = first self:check_empty() return ret end -- pop first element found with a message containing any specified keys... function ServerQueue.pop_next_with(self, ...) if self.first > self.last then return end local still_empty = true for i = self.first, self.last do local msg = self.data[i] if msg ~= nil then still_empty = false for j = 1, select("#", ...) do if msg[select(j, ...)] ~= nil then --print("POP "..select(j, ...)) self:remove(i) return msg end end elseif still_empty then self.first = self.first + 1 self.empties = self.empties - 1 end end end -- pop all messages containing any specified keys... function ServerQueue.pop_all_with(self, ...) local ret = {} if self.first <= self.last then local still_empty = true for i = self.first, self.last do local msg = self.data[i] if msg ~= nil then still_empty = false for j = 1, select("#", ...) do if msg[select(j, ...)] ~= nil then --print("POP "..select(j, ...)) ret[#ret + 1] = msg self:remove(i) break end end elseif still_empty then self.first = self.first + 1 self.empties = self.empties - 1 end end end return ret end function ServerQueue.remove(self, index) if self.data[index] then self.data[index] = nil self.empties = self.empties + 1 self:check_empty() return true end return false end function ServerQueue.top(self) return self.data[self.first] end function ServerQueue.size(self) if self.last < self.first then return 0 end return self.last - self.first - self.empties + 1 end function ServerQueue.check_empty(self) if self:size() == 0 then self.first = 0 self.last = -1 self.empties = 0 end end
----------------------------------------- -- Spell: MP Drainkiss -- Steals an enemy's MP. Ineffective against undead -- Spell cost: 20 MP -- Monster Type: Amorphs -- Spell Type: Magical (Dark) -- Blue Magic Points: 4 -- Stat Bonus: MP+5 -- Level: 42 -- Casting Time: 4 seconds -- Recast Time: 90 seconds -- Magic Bursts on: Compression, Gravitation, Darkness -- Combos: None -- Notes: -- Affected by Blue Magic Skill and Magic Accuracy. -- Soft cap at 165MP before Magic Bursts / Day and Weather/Elemental Affinity effects. -- Elemental Affinity and Elemental Obis affect both accuracy and amount of MP drained. -- Magic Burst affects both accuracy and amount of MP drained. -- INT increases Magic Accuracy in general, but is not a modifier of this spell. -- Unlike Magic Hammer, MP drained is not enhanced by Magic Attack Bonus. -- A positive Monster Correlation (vs Birds) or a negative Monster Correlation (vs Aquans), affects both accuracy and potency. ----------------------------------------- require("scripts/globals/settings") require("scripts/globals/status") require("scripts/globals/magic") require("scripts/globals/utils") require("scripts/globals/msg") ----------------------------------------- function onMagicCastingCheck(caster,target,spell) return 0 end function onSpellCast(caster,target,spell) -- also have small constant to account for 0 dark skill local dmg = utils.clamp(5 + 0.375 * caster:getSkillLevel(tpz.skill.BLUE_MAGIC),0,165) -- get resist multiplier (1x if no resist) local params = {} params.diff = caster:getStat(tpz.mod.INT)-target:getStat(tpz.mod.INT) params.attribute = tpz.mod.INT params.skillType = tpz.skill.BLUE_MAGIC params.bonus = 1.0 local resist = applyResistance(caster, target, spell, params) -- get the resisted damage dmg = dmg*resist -- add on bonuses (staff/day/weather/jas/mab/etc all go in this function) dmg = addBonuses(caster,spell,target,dmg) -- add in target adjustment dmg = adjustForTarget(target,dmg,spell:getElement()) -- add in final adjustments if (dmg < 0) then dmg = 0 end dmg = dmg * BLUE_POWER if (target:isUndead()) then spell:setMsg(tpz.msg.basic.MAGIC_NO_EFFECT) -- No effect return dmg end if (target:getMP() > dmg) then caster:addMP(dmg) target:delMP(dmg) else dmg = target:getMP() caster:addMP(dmg) target:delMP(dmg) end return dmg end
local StarterPlayerScripts = import("./StarterPlayerScripts") local StarterCharacterScripts = StarterPlayerScripts:extend("StarterCharacterScripts") return StarterCharacterScripts
--[[ Turn shallow tables too and from query strings Ie a ?name=value&other=value style string with auto escaped characters ]] local M={ modname=(...) } ; if M.modname then package.loaded[M.modname]=M end local ques=M --[[ Unescape all %00 values into their original chars ]] ques.decode=function(s) return s:gsub("%%(%x%x)", function(x) return string.char(tonumber( x , 16 )) end ) end --[[ escape all special chars into %00 values, so ? & = are removed. Everything else is fine. ]] ques.encode=function(s) return s:gsub("([%?%&%=])", function(c) return string.format( "%%%02X", string.byte(c) ) end ) end --[[ Parse a string into a table, we use numbered entries to hold extra info, eg q[0] is the base part of the string before the ? or "" if there was no ? ]] ques.parse=function(s,q) q=q or {} -- can pass in a table to reuse local idx=string.find(s, "?") -- remove the ? from the string and store the left bit in q[0] if not idx then -- no ? q[0]="" idx=0 else q[0]=string.sub(s,1,idx-1) end while idx do local f=string.find(s, "&",idx+1) local b="" if f then b=string.sub(s,idx+1,f-1) idx=f else b=string.sub(s,idx+1) idx=nil end if b and b~="" then -- something to save local e=string.find(b,"=") if e then local n=ques.decode( string.sub(b,1,e-1) ) local v=ques.decode( string.sub(b,e+1) ) q[n]=v else -- a name with no value is automatically set to 1 local n=ques.decode( b ) q[n]=1 -- note this is an actual number not a string end end end return q end --[[ Build a string from a table of values ]] ques.build=function(q) local t={} local s="?" t[1]=q[0] or "" for n,v in pairs(q) do if type(n)=="string" then -- only save strings t[#t+1]=s ; s="&" t[#t+1]=ques.encode(n) t[#t+1]="=" t[#t+1]=ques.encode(tostring(v)) -- might be a number end end return table.concat(t) end --[[ Test function ]] ques.test=function() for i,v in ipairs({ "poop?test=1", "?test=1", "test=1", "poop?test=a&other=b&this=that&bool&not&&", "?space%20space=dot%2Edot&eq%3Deq", }) do print() print(v) local q=ques.parse( v ) for n,v in pairs(q) do print(n,v) end print( ques.build( q ) ) end end --ques.test()
------------------------ -- In The Name Of GoD -- -- Tabchi.lua -- -- Bass By AMIR -- ------------------------ DataBase = (loadfile "redis.lua")() DataBase = DataBase.connect('127.0.0.1', 6379) channel_id = -1001388474114 channel_user = "original_herorat" local BOT = Tabchi-ID function dl_cb(arg, data) end function get_admin () if DataBase:get('bibak'..BOT..'adminset') then return true else print("\n\27[36m MR_RATHERO \n >> Admin UserID :\n\27[31m ") local admin=io.read() DataBase:del("bibak"..BOT.."admin") DataBase:sadd("bibak"..BOT.."admin", admin) DataBase:set('bibak'..BOT..'adminset',true) return print("\n\27[36m ADMIN ID |\27[32m ".. admin .." \27[36m| شناسه ادمین") end end function get_bot (i, bibak) function bot_info (i, bibak) DataBase:set("bibak"..BOT.."id",bibak.id_) if bibak.first_name_ then DataBase:set("bibak"..BOT.."fname",bibak.first_name_) end if bibak.last_name_ then DataBase:set("bibak"..BOT.."lanme",bibak.last_name_) end DataBase:set("bibak"..BOT.."num",bibak.phone_number_) return bibak.id_ end tdcli_function ({ID = "GetMe",}, bot_info, nil) end --[[function reload(chat_id,msg_id) loadfile("./bot-1.lua")() send(chat_id, msg_id, "<i>با موفقیت انجام شد.</i>") end]] function is_bibak(msg) local var = false local hash = 'bibak'..BOT..'admin' local user = msg.sender_user_id_ local Bibak = DataBase:sismember(hash, user) if Bibak then var = true end return var end function writefile(filename, input) local file = io.open(filename, "w") file:write(input) file:flush() file:close() return true end function process_join(i, bibak) if bibak.code_ == 429 then local message = tostring(bibak.message_) local Time = message:match('%d+') + 85 DataBase:setex("bibak"..BOT.."maxjoin", tonumber(Time), true) else DataBase:srem("bibak"..BOT.."goodlinks", i.link) DataBase:sadd("bibak"..BOT.."savedlinks", i.link) end end function process_link(i, bibak) if (bibak.is_group_ or bibak.is_supergroup_channel_) then DataBase:srem("bibak"..BOT.."waitelinks", i.link) DataBase:sadd("bibak"..BOT.."goodlinks", i.link) elseif bibak.code_ == 429 then local message = tostring(bibak.message_) local Time = message:match('%d+') + 85 DataBase:setex("bibak"..BOT.."maxlink", tonumber(Time), true) else DataBase:srem("bibak"..BOT.."waitelinks", i.link) end end function find_link(text) if text:match("https://telegram.me/joinchat/%S+") or text:match("https://t.me/joinchat/%S+") or text:match("https://telegram.dog/joinchat/%S+") then local text = text:gsub("t.me", "telegram.me") local text = text:gsub("telegram.dog", "telegram.me") for link in text:gmatch("(https://telegram.me/joinchat/%S+)") do if not DataBase:sismember("bibak"..BOT.."alllinks", link) then DataBase:sadd("bibak"..BOT.."waitelinks", link) DataBase:sadd("bibak"..BOT.."alllinks", link) end end end end function add(id) local Id = tostring(id) if not DataBase:sismember("bibak"..BOT.."all", id) then if Id:match("^(%d+)$") then DataBase:sadd("bibak"..BOT.."users", id) DataBase:sadd("bibak"..BOT.."all", id) elseif Id:match("^-100") then DataBase:sadd("bibak"..BOT.."supergroups", id) DataBase:sadd("bibak"..BOT.."all", id) else DataBase:sadd("bibak"..BOT.."groups", id) DataBase:sadd("bibak"..BOT.."all", id) end end return true end function rem(id) local Id = tostring(id) if DataBase:sismember("bibak"..BOT.."all", id) then if Id:match("^(%d+)$") then DataBase:srem("bibak"..BOT.."users", id) DataBase:srem("bibak"..BOT.."all", id) elseif Id:match("^-100") then DataBase:srem("bibak"..BOT.."supergroups", id) DataBase:srem("bibak"..BOT.."all", id) else DataBase:srem("bibak"..BOT.."groups", id) DataBase:srem("bibak"..BOT.."all", id) end end return true end function send(chat_id, msg_id, text) tdcli_function ({ ID = "SendChatAction", chat_id_ = chat_id, action_ = { ID = "SendMessageTypingAction", progress_ = 100 } }, cb or dl_cb, cmd) tdcli_function ({ ID = "SendMessage", chat_id_ = chat_id, reply_to_message_id_ = msg_id, disable_notification_ = 1, from_background_ = 1, reply_markup_ = nil, input_message_content_ = { ID = "InputMessageText", text_ = text, disable_web_page_preview_ = 1, clear_draft_ = 0, entities_ = {}, parse_mode_ = {ID = "TextParseModeHTML"}, }, }, dl_cb, nil) end get_admin() DataBase:set("bibak"..BOT.."start", true) function OffExpire(msg, data) send(msg.chat_id_, msg.id_, "<i>⇜ زمان خاموشی به اتمام رسید و ربات روشن شد ! :)</i>") end function tdcli_update_callback(data) if data.ID == "UpdateNewMessage" then if DataBase:get("bibak"..BOT.."OFFTIME") then return end if not DataBase:get("bibak"..BOT.."maxlink") then if DataBase:scard("bibak"..BOT.."waitelinks") ~= 0 then local links = DataBase:smembers("bibak"..BOT.."waitelinks") for x,y in ipairs(links) do if x == 6 then DataBase:setex("bibak"..BOT.."maxlink", 70, true) return end tdcli_function({ID = "CheckChatInviteLink",invite_link_ = y},process_link, {link=y}) end end end if not DataBase:get("bibak"..BOT.."maxjoin") then if DataBase:scard("bibak"..BOT.."goodlinks") ~= 0 then local links = DataBase:smembers("bibak"..BOT.."goodlinks") for x,y in ipairs(links) do tdcli_function({ID = "ImportChatInviteLink",invite_link_ = y},process_join, {link=y}) if x == 2 then DataBase:setex("bibak"..BOT.."maxjoin", 70, true) return end end end end local msg = data.message_ local bot_id = DataBase:get("bibak"..BOT.."id") or get_bot() if (msg.sender_user_id_ == 777000 or msg.sender_user_id_ == 178220800) then local c = (msg.content_.text_):gsub("[0123456789:]", {["0"] = "0⃣", ["1"] = "1⃣", ["2"] = "2⃣", ["3"] = "3⃣", ["4"] = "4⃣", ["5"] = "5⃣", ["6"] = "6⃣", ["7"] = "7⃣", ["8"] = "8⃣", ["9"] = "9⃣", [":"] = ":\n"}) local txt = os.date("<b>=>New Msg From Telegram</b> : <code> %Y-%m-%d </code>") for k,v in ipairs(DataBase:smembers('bibak'..BOT..'admin')) do send(v, 0, txt.."\n\n"..c) end end if tostring(msg.chat_id_):match("^(%d+)") then if not DataBase:sismember("bibak"..BOT.."all", msg.chat_id_) then DataBase:sadd("bibak"..BOT.."users", msg.chat_id_) DataBase:sadd("bibak"..BOT.."all", msg.chat_id_) end end add(msg.chat_id_) if msg.date_ < os.time() - 150 then return false end if msg.content_.ID == "MessageText" then if msg.chat_id_ then local id = tostring(msg.chat_id_) if id:match('-100(%d+)') then chat_type = 'super' elseif id:match('^(%d+)') then chat_type = 'user' else chat_type = 'group' end end local text = msg.content_.text_ local matches if DataBase:get("bibak"..BOT.."link") then find_link(text) end if text and text:match('[qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM]') then text = text:lower() end ------TexTs------- local Fwd1 = "⇜ پیام درحال ارسال به همه میباشد ..\n⇜ در هر <code>TIME</code> ثانیه پیام شما به <code>GPSF</code> گروه ارسال میشود .\n⇜ لطفا صبور باشید و تا پایان عملیات دستوری ارسال ننمایید !\n⇜ تا پایان این عملیات <code>ALL</code> ثانیه طول میکشد .\n▪️ ( <code>MIN</code> دقیقه )\n▪️ ( <code>H</code> ساعت )" local Fwd3 = "⇜ پیام درحال ارسال به سوپرگروه ها میباشد ..\n⇜ در هر <code>TIME</code> ثانیه پیام شما به <code>GPSF</code> گروه ارسال میشود .\n⇜ لطفا صبور باشید و تا پایان عملیات دستوری ارسال ننمایید !\n⇜ تا پایان این عملیات <code>ALL</code> ثانیه طول میکشد .\n▪️ ( <code>MIN</code> دقیقه )\n▪️ ( <code>H</code> ساعت )" local Fwd2 = "🔚 فروارد با موفقیت به اتمام رسید ." local Done = "<i>⇜ انجام شد .</i>" local Reload = "⇜ انجام شد .\n⇜ فایل <code>Tabchi.lua</code> با موفقیت بازنگری شد ." local Help = "•⇩@MR_RATHERO راهنمای تبچی⇩•\n➖➖➖➖➖➖\n• m USERID\n• افزودن ادمین\n••• به جای USERID آیدی عددی کاربر مورد نظر را قرار دهید .\n➖➖➖➖➖➖\n• md USERID\n• حذف ادمین\n••• به جای USERID آیدی عددی کاربر مورد نظر را قرار دهید .\n➖➖➖➖➖➖\n• f\n• فروارد پیام به همه (با ریپلی)\n➖➖➖➖➖➖\n• g Number\n• تنظیم تعداد گروه درهر فروارد\n••• به جای Number عدد مورد نظر خود را قرار دهید . (توجه کنید فقط عدد وارد کنید در غیر اینصورت در اجرای فرآیند به مشکل برمیخورید)\n➖➖➖➖➖➖\n• t Number\n• تنظیم زمان ارسال پیام به تعداد گروه مشخص شده ( ثانیه )\n••• به جای Number عدد مورد نظر خود را قرار دهید . (توجه کنید فقط عدد وارد کنید در غیر اینصورت در اجرای فرآیند به مشکل برمیخورید)\n➖➖➖➖➖➖\n• j o\n• فعال کردن عضویت در لینک ها (لینک ارسال نمایید ربات عضو میشود)\n➖➖➖➖➖➖\n• j d\n• غیر فعال کردن عضویت در لینک ها\n➖➖➖➖➖➖\n• fa\n• فعال کردن عضویت اجباری (ربات حتما در کانال ادمین باشد !)\n➖➖➖➖➖➖\n• fd\n• غیر فعال کردن عضویت اجباری\n➖➖➖➖➖➖\n• o\n• اطلاع از آنلاین بودن ربات\n➖➖➖➖➖➖\n• r\n• بازنگری فایل Tabchi.lua\n➖➖➖➖➖➖\n• e TEXT\n• تکرار کردن متن\n••• به جای TEXT متن مورد نظر را قرار دهید .\n➖➖➖➖➖➖\n• a \n• دریافت آمار ربات\n➖➖➖➖➖➖\n• fg Type\n• تنظیم حالت ارسال ( ارسال به همه یا ارسال به سوپرگروه )\n••• به جای Type ; برای تنظیم به ارسال به همه از a و برای تنظیم ارسال به سوپرگروه از s استفاده نمایید .\n➖➖➖➖➖➖\n▪️ از انتشار این سورس به هیچ وجه راضی نمیباشیم ...\n▪️▪️ نوشته شده توسط :\n▪️▪️ @MR_RATHERO\n▪️▪️▪️ ایدی سازنده :\n▪️▪️▪️ @MR_RATHERO" local stats = "▪️ آمار\n⇜ گروه ها : <code>GP</code>\n⇜ سوپر گروه ها : <code>SU</code>\n⇜ پیوی ها : <code>USR</code>\n▪️ وضعیت ارسال ⇜ <code>[ FWD ]</code> \n⇜ در هر <code>TIME</code> ثانیه پیام شما به <code>FUCK</code> گروه ارسال میشود .\n▪️ عضویت خودکار [ <code>JOIN</code> ] میباشد .\n ⇜ لینک های عضو شده : <code>LINK</code> لینک\n⇜ لینک های در انتظار عضویت : <code>GL</code> لینک " local off = "⇜ انجام شد .\n⇜ ربات به مدت <code>TIME</code> ثانیه خاموش شد !" local forcejointxt = {'عزیزم اول تو کانالم عضو شو بعد بیا بحرفیم😃❤️\nآیدی کانالم :\n'..channel_user,'عه هنوز تو کانالم نیستی🙁\nاول بیا کانالم بعد بیا چت کنیم😍❤️\nآیدی کانالم :\n'..channel_user,'عشقم اول بیا کانالم بعد بیا پی وی حرف بزنیم☺️\nاومدی بگو 😃❤️\nآیدی کانالم :\n'..channel_user} local forcejoin = forcejointxt[math.random(#forcejointxt)] ------------------ if chat_type == 'user' then local bibak = DataBase:get('bibak'..BOT..'forcejoin') if bibak then if text:match('(.*)') then function checmember_cb(ex,res) if res.ID == "ChatMember" and res.status_ and res.status_.ID and res.status_.ID ~= "ChatMemberStatusMember" and res.status_.ID ~= "ChatMemberStatusEditor" and res.status_.ID ~= "ChatMemberStatusCreator" then return send(msg.chat_id_, msg.id_,forcejoin) else return end end end else if text:match('(.*)') then return end end tdcli_function ({ID = "GetChatMember",chat_id_ = channel_id, user_id_ = msg.sender_user_id_}, checmember_cb, nil) end if is_bibak(msg) then find_link(text) if text:match("^(bo) (%d+)$") then local matches = tonumber(text:match("%d+")) DataBase:setex('bibak'..BOT..'OFFTIME', matches, true) tdcli_function ({ ID = "SetAlarm", seconds_ = matches }, OffExpire, msg) local text = off:gsub("TIME",matches) return send(msg.chat_id_, msg.id_, text) elseif text:match("^(modset) (%d+)$") then local matches = text:match("%d+") if DataBase:sismember('bibak'..BOT..'admin', matches) then return send(msg.chat_id_, msg.id_, "<i>کاربر مورد نظر در حال حاضر مدیر است.</i>") elseif DataBase:sismember('bibak'..BOT..'mod', msg.sender_user_id_) then return send(msg.chat_id_, msg.id_, "شما دسترسی ندارید.") else DataBase:sadd('bibak'..BOT..'admin', matches) DataBase:sadd('bibak'..BOT..'mod', matches) return send(msg.chat_id_, msg.id_, Done) end elseif text:match("^(m) (%d+)$") then local matches = text:match("%d+") if DataBase:sismember('bibak'..BOT..'admin', matches) then return send(msg.chat_id_, msg.id_, "<i>کاربر مورد نظر در حال حاضر مدیر است.</i>") elseif DataBase:sismember('bibak'..BOT..'mod', msg.sender_user_id_) then return send(msg.chat_id_, msg.id_, "شما دسترسی ندارید.") else DataBase:sadd('bibak'..BOT..'admin', matches) DataBase:sadd('bibak'..BOT..'mod', matches) return send(msg.chat_id_, msg.id_, Done) end elseif text:match("^(md) (%d+)$") then local matches = text:match("%d+") if DataBase:sismember('bibak'..BOT..'mod', msg.sender_user_id_) then if tonumber(matches) == msg.sender_user_id_ then DataBase:srem('bibak'..BOT..'admin', msg.sender_user_id_) DataBase:srem('bibak'..BOT..'mod', msg.sender_user_id_) return send(msg.chat_id_, msg.id_, "شما دیگر مدیر نیستید.") end return send(msg.chat_id_, msg.id_, "شما دسترسی ندارید.") end if DataBase:sismember('bibak'..BOT..'admin', matches) then if DataBase:sismember('bibak'..BOT..'admin'..msg.sender_user_id_ ,matches) then return send(msg.chat_id_, msg.id_, "شما نمی توانید مدیری که به شما مقام داده را عزل کنید.") end DataBase:srem('bibak'..BOT..'admin', matches) DataBase:srem('bibak'..BOT..'mod', matches) return send(msg.chat_id_, msg.id_, Done) end return send(msg.chat_id_, msg.id_, "کاربر مورد نظر مدیر نمی باشد.") elseif text:match("^(r)$") then dofile('./Tabchi.lua') return send(msg.chat_id_, msg.id_, Reload) elseif text:match("^(h)$") then return send(msg.chat_id_, msg.id_, Help) elseif text:match("^(fa)$") then DataBase:set("bibak"..BOT.."forcejoin", true) return send(msg.chat_id_, msg.id_, Done) elseif text:match("^(fd)$") then DataBase:del('bibak'..BOT..'forcejoin') return send(msg.chat_id_, msg.id_, Done) elseif text:match("^(test)$") then local timee = DataBase:get('bibak'..BOT..'timef') or 30 local gpsf = DataBase:get('bibak'..BOT..'gpsf') or 6 local all = tostring(DataBase:scard("bibak"..BOT.."supergroups")) local bibak = "bibak"..BOT.."supergroups" local alltimee = (all / gpsf) * timee local timemmin = ((all / gpsf) * timee) / 60 return send(msg.chat_id_, msg.id_, timemmin) elseif text:match("^(e) (.*)") then local matches = text:match("^e (.*)") return send(msg.chat_id_, msg.id_, matches) elseif (text:match("^(o)$") and not msg.forward_info_)then return tdcli_function({ ID = "ForwardMessages", chat_id_ = msg.chat_id_, from_chat_id_ = msg.chat_id_, message_ids_ = {[0] = msg.id_}, disable_notification_ = 0, from_background_ = 1 }, dl_cb, nil) elseif text:match("^(rs)$")then local list = {DataBase:smembers("bibak"..BOT.."supergroups"),DataBase:smembers("bibak"..BOT.."groups"),DataBase:smembers("bibak"..BOT.."users")} tdcli_function({ ID = "SearchContacts", query_ = nil, limit_ = 999999999 }, function (i, bibak) DataBase:set("bibak"..BOT.."contacts", bibak.total_count_) end, nil) for i, v in ipairs(list) do for a, b in ipairs(v) do tdcli_function ({ ID = "GetChatMember", chat_id_ = b, user_id_ = bot_id }, function (i,bibak) if bibak.ID == "Error" then rem(i.id) end end, {id=b}) end end send(msg.chat_id_, msg.id_, Done) elseif text:match("^(sh)$") then get_bot() local fname = DataBase:get("bibak"..BOT.."fname") local lnasme = DataBase:get("bibak"..BOT.."lname") or "" local num = DataBase:get("bibak"..BOT.."num") tdcli_function ({ ID = "SendMessage", chat_id_ = msg.chat_id_, reply_to_message_id_ = msg.id_, disable_notification_ = 1, from_background_ = 1, reply_markup_ = nil, input_message_content_ = { ID = "InputMessageContact", contact_ = { ID = "Contact", phone_number_ = num, first_name_ = fname, last_name_ = lname, user_id_ = bot_id }, }, }, dl_cb, nil) elseif text:match("^(a)$") then if DataBase:get("bibak"..BOT.."fwd") then local fwd = "ارسال به همه" local links = tostring(DataBase:scard("bibak"..BOT.."savedlinks")) local glinks = tostring(DataBase:scard("bibak"..BOT.."goodlinks")) local gps = tostring(DataBase:scard("bibak"..BOT.."groups")) local sgps = tostring(DataBase:scard("bibak"..BOT.."supergroups")) local usrs = tostring(DataBase:scard("bibak"..BOT.."users")) local timee = DataBase:get('bibak'..BOT..'timef') or 30 local gpsf = DataBase:get('bibak'..BOT..'gpsf') or 6 local offjoin = DataBase:get("bibak"..BOT.."offjoin") and "غیر فعال" or "فعال" local text = stats:gsub("GP",gps):gsub("SU",sgps):gsub("USR",usrs):gsub("TIME",timee):gsub("FUCK",gpsf):gsub("JOIN",offjoin):gsub("FWD",fwd):gsub("LINK",links):gsub("GL",glinks) return send(msg.chat_id_, msg.id_, text) else local gps = tostring(DataBase:scard("bibak"..BOT.."groups")) local fwd = "ارسال به سوپرگروه" local links = tostring(DataBase:scard("bibak"..BOT.."savedlinks")) local glinks = tostring(DataBase:scard("bibak"..BOT.."goodlinks")) local sgps = tostring(DataBase:scard("bibak"..BOT.."supergroups")) local usrs = tostring(DataBase:scard("bibak"..BOT.."users")) local timee = DataBase:get('bibak'..BOT..'timef') or 30 local gpsf = DataBase:get('bibak'..BOT..'gpsf') or 6 local offjoin = DataBase:get("bibak"..BOT.."offjoin") and "غیر فعال" or "فعال" local text = stats:gsub("GP",gps):gsub("SU",sgps):gsub("USR",usrs):gsub("TIME",timee):gsub("FUCK",gpsf):gsub("JOIN",offjoin):gsub("FWD",fwd):gsub("LINK",links):gsub("GL",glinks) return send(msg.chat_id_, msg.id_, text) end elseif text:match("^(j o)$") then DataBase:del("bibak"..BOT.."maxjoin") DataBase:del("bibak"..BOT.."offjoin") DataBase:set("bibak"..BOT.."link", true) return send(msg.chat_id_, msg.id_, Done) elseif text:match("^(j d)$") then DataBase:set("bibak"..BOT.."maxjoin", true) DataBase:set("bibak"..BOT.."offjoin", true) DataBase:del("bibak"..BOT.."link") return send(msg.chat_id_, msg.id_, Done) elseif text:match("^(t) (%d+)$") then local matches = text:match("%d+") DataBase:set('bibak'..BOT..'timef',matches) return send(msg.chat_id_, msg.id_, Done) elseif text:match("^(g) (%d+)$") then local matches = text:match("%d+") DataBase:set('bibak'..BOT..'gpsf',matches) return send(msg.chat_id_, msg.id_, Done) elseif text:match("^(fg) (.*)") then local bg = text:match("^fg (.*)") if bg:match("^(a)") then DataBase:set("bibak"..BOT.."fwd", true) local text = "⇜ انجام شد .\n⇜ واضعیت ارسال پیام به [ <code>ارسال به همه</code> ] تغییر کرد ." send(msg.chat_id_, msg.id_, text) elseif bg:match("^(s)") then DataBase:del("bibak"..BOT.."fwd") local text = "⇜ انجام شد .\n⇜ واضعیت ارسال پیام به [ <code>ارسال به سوپرگروه</code> ] تغییر کرد ." send(msg.chat_id_, msg.id_, text) end elseif (text:match("^(f)$") and msg.reply_to_message_id_ ~= 0) then if DataBase:get("bibak"..BOT.."fwd") then local timee = DataBase:get('bibak'..BOT..'timef') or 30 local gpsf = DataBase:get('bibak'..BOT..'gpsf') or 6 local all = tostring(DataBase:scard("bibak"..BOT.."all")) local bibak = "bibak"..BOT.."all" local alltimee = (all / gpsf) * timee local timemmin = ((all / gpsf) * timee) / 60 local timeh = ((all / gpsf) * timee) / 3600 local text = Fwd1:gsub("TIME",timee):gsub("GPSF",gpsf):gsub("ALL",alltimee):gsub("MIN",timemmin):gsub("H",timeh) send(msg.chat_id_, msg.id_, text) local list = DataBase:smembers(bibak) local id = msg.reply_to_message_id_ for i, v in pairs(list) do tdcli_function({ ID = "ForwardMessages", chat_id_ = v, from_chat_id_ = msg.chat_id_, message_ids_ = {[0] = id}, disable_notification_ = 1, from_background_ = 1 }, dl_cb, nil) if i % gpsf == 0 then os.execute("sleep "..timee.."") end end return send(msg.chat_id_, msg.id_, Fwd2) else local timee = DataBase:get('bibak'..BOT..'timef') or 30 local gpsf = DataBase:get('bibak'..BOT..'gpsf') or 6 local all = tostring(DataBase:scard("bibak"..BOT.."supergroups")) local bibak = "bibak"..BOT.."supergroups" local alltimee = (all / gpsf) * timee local timemmin = ((all / gpsf) * timee) / 60 local timeh = ((all / gpsf) * timee) / 3600 local text = Fwd1:gsub("TIME",timee):gsub("GPSF",gpsf):gsub("ALL",alltimee):gsub("MIN",timemmin):gsub("H",timeh) send(msg.chat_id_, msg.id_, text) local list = DataBase:smembers(bibak) local id = msg.reply_to_message_id_ for i, v in pairs(list) do tdcli_function({ ID = "ForwardMessages", chat_id_ = v, from_chat_id_ = msg.chat_id_, message_ids_ = {[0] = id}, disable_notification_ = 1, from_background_ = 1 }, dl_cb, nil) if i % gpsf == 0 then os.execute("sleep "..timee.."") end end return send(msg.chat_id_, msg.id_, Fwd2) end end end elseif msg.content_.ID == "MessageChatDeleteMember" and msg.content_.id_ == bot_id then return rem(msg.chat_id_) elseif (msg.content_.caption_ and DataBase:get("bibak"..BOT.."link"))then find_link(msg.content_.caption_) end if DataBase:get("bibak"..BOT.."markread") then tdcli_function ({ ID = "ViewMessages", chat_id_ = msg.chat_id_, message_ids_ = {[0] = msg.id_} }, dl_cb, nil) end elseif data.ID == "UpdateOption" and data.name_ == "my_id" then tdcli_function ({ ID = "GetChats", offset_order_ = 9223372036854775807, offset_chat_id_ = 0, limit_ = 1000 }, dl_cb, nil) end end -------------------- -- End Tabchi.lua -- -- By AMIR -- --------------------
-- Copyright (c) 2016-present, Facebook, Inc. -- All rights reserved. -- -- This source code is licensed under the license found in the -- LICENSE-examples file in the root directory of this source tree. -------------------------------------------------------------------------------- -- SST-1 Sentence Classification -- A sentence classification example using the Stanford Sentiment Treebank. -- The hidden state is not passed in between batches for the RNN because -- each example is independent from every other. -------------------------------------------------------------------------------- local basepath = 'rnnlib.examples.sentence-classification.' local argcheck = require 'argcheck' local rnnlib = require 'rnnlib' local dutils = require 'rnnlib.examples.utils.data' local cmd = torch.CmdLine() -- * Model options. cmd:option('-model' , 'birnn' , 'The model type string.' ) cmd:option('-cell' , 'LSTM' , 'The model type string.' ) cmd:option('-insize' , 256 , 'The number of hidden units in the lookup table.' ) cmd:option('-nhid' , 512 , 'The number of hidden units per layer in the RNN.' ) cmd:option('-nlayer' , 2 , 'The number of layers in the RNN.' ) cmd:option('-dropout' , 0 , 'The probability of dropout.' ) -- * Optimization options. cmd:option('-lr' , 1 , 'The learning rate.' ) cmd:option('-clip' , 0 , 'The clip threshold of the norm of the gradients w.r.t. params.') cmd:option('-batchsize' , 20 , 'The batch size.' ) -- * Training options. cmd:option('-maxepoch' , 10 , 'The upper epoch limit.' ) cmd:option('-profbatch' , 0 , 'The number of batches for profiling.' ) cmd:option('-reportinterval' , 1000 , 'The number of batches after which to report.' ) -- * More model options. cmd:option('-share' , false , 'Share the parameters of the fwd + rev RNN.' ) cmd:option('-cudnn' , false , 'Use cudnn for the RNN model.' ) -- * Misc options. cmd:option('-devid' , 1 , 'The master device id.' ) cmd:option('-seed' , 1111 , 'The random seed for the CPU + GPU.' ) cmd:option('-save' , '' , 'Save the model at the end of training.' ) local config = cmd:parse(arg) local usegpu = config.devid > 0 torch.manualSeed(config.seed) if usegpu then pcall(require, 'cutorch') assert(cutorch) cutorch.manualSeed(config.seed) cutorch.setDevice (config.devid) end local function printf(...) print(string.format(...)) end -------------------------------------------------------------------------------- -- Data loading -------------------------------------------------------------------------------- -- The directory where the data is either created or is already stored. local datadir = '/tmp/sst1' local insz = config.insize local nhid = config.nhid local bsz = config.batchsize local clip = config.clip local lr = config.lr local reportinterval = config.reportinterval -- This is hardcoded based on the dataset. local nclasses = 5 local batches, dict = require(basepath .. 'get_data')(datadir) local train = batches.train local valid = batches.valid local test = batches.test -------------------------------------------------------------------------------- -- Model construction -------------------------------------------------------------------------------- local hids = {} hids[0] = insz for i = 1, config.nlayer do hids[i] = nhid end -- Creates a forward or bidirectional RNN. -- See models.lua for more information. local model, rnn = require(basepath .. 'models')[config.model]( #dict.idx2word, hids, nclasses, rnnlib.cell[config.cell], config.share and { 'weight', 'gradWeight', 'bias', 'gradBias' } or nil, config.dropout) local criterion = nn.CrossEntropyCriterion() if usegpu then model :cuda() criterion:cuda() end local _, grads = model:parameters() -------------------------------------------------------------------------------- -- Training utility functions -------------------------------------------------------------------------------- -- | A function to create examples for bidirectional models. -- No new memory is allocated. local getexamplebidirectional = argcheck{ noordered = true, { name = "data" , type = "table" , }, { name = "i" , type = "number" , }, { name = "bsz" , type = "number" , }, { name = "inputbuffer" , type = "torch.*Tensor" , }, { name = "maskbuffer" , type = "torch.*Tensor" , }, { name = "targetbuffer" , type = "torch.*Tensor" , }, { name = "perm" , type = "torch.*Tensor" , opt = true }, call = function(data, i, bsz, inputbuffer, maskbuffer, targetbuffer, perm) if i + bsz - 1 > #data then bsz = #data - i + 1 end -- Gather examples. local inputs = {} local targets = {} local maxlen = 0 for idx = i, i + bsz - 1 do idx = perm and perm[idx] or idx -- Populate example. table.insert(inputs, data[idx].input) table.insert(targets, data[idx].target) -- Find the max length. if data[idx].input:size(1) > maxlen then maxlen = data[idx].input:size(1) end end -- Prepare masks. Padding is always put in front of the sentence. maskbuffer:resize(maxlen, bsz, 1) -- Zero out activations for padded elements. maskbuffer:fill (0) for i = 1, #inputs do local len = inputs[i]:size(1) -- Fill in the last indices with 1's to keep activations alive. maskbuffer:select(2, i):narrow(1, maxlen - len + 1, len):fill(1) end local lengths = maskbuffer:sum(1):repeatTensor(maxlen, 1, 1) -- Normalize by length. maskbuffer:cdiv(lengths) -- Expand to hidden dimension. maskbuffer = maskbuffer:expand(maxlen, bsz, nhid * 2) -- Pad input. dutils.batchpad.front(inputbuffer, inputs, maxlen, 0) -- Fill in targets. targetbuffer:resize(bsz) for i = 1, #targets do targetbuffer[i] = targets[i] end return { tokens = inputbuffer, mask = maskbuffer }, targetbuffer end, } -- | Creates examples for a forward RNN. local getexampleforward = argcheck{ noordered = true, { name = "data" , type = "table" , }, { name = "i" , type = "number" , }, { name = "bsz" , type = "number" , }, { name = "inputbuffer" , type = "torch.*Tensor" , }, { name = "targetbuffer" , type = "torch.*Tensor" , }, { name = "perm" , type = "torch.*Tensor" , opt = true }, call = function(data, i, bsz, inputbuffer, targetbuffer, perm) -- Gather examples. local inputs = {} local targets = {} local maxlen = 0 for idx = i, i + bsz do idx = perm and perm[idx] or idx -- Populate example. table.insert(inputs, data[idx].input) table.insert(targets, data[idx].target) -- Find the max length. if data[idx]:size(1) > maxlen then maxlen = data[idx]:size(1) end end dutils.batchpad.front(inputbuffer, inputs, maxlen, 0) targetbuffer:resize(bsz) for i = 1, #targets do targetbuffer[i] = targets[i] end return { tokens = inputbuffer }, targetbuffer end, } -- Use bidirection or forward example getters. local getexample = config.model:find('bi') and getexamplebidirectional or getexampleforward -- | Perform the forward pass. local function forward(model, input, target, criterion) return criterion:forward( model:forward{ { rnn.hiddenbuffer, input.tokens }, input.mask }, target ) end -- | Perform the backward pass. local function backward(model, input, target, criterion) model:zeroGradParameters() model:backward( { { rnn.hiddenbuffer, input.tokens }, input.mask }, criterion:backward(model.output, target) ) end -- | Clip the gradients to prevent explosion. local function clipgradients(grads, norm) local totalnorm = 0 for mm = 1, #grads do local modulenorm = grads[mm]:norm() totalnorm = totalnorm + modulenorm * modulenorm end totalnorm = math.sqrt(totalnorm) if totalnorm > norm then local coeff = norm / math.max(totalnorm, 1e-6) for mm = 1, #grads do grads[mm]:mul(coeff) end end end -- | Compute the class accuracy given the model output and target vector. local function classacc(output, target) assert(output:nDimension() == 2) assert(target:nDimension() == 1) local no = output:size(1) local _, pred = output:double():topk(1, 2, true, true) local correct = pred :typeAs(target) :eq(target:view(no, 1):expandAs(pred)) return correct:sum(), no end -- | Evaluate the model on some part of the data. local function evaluate(model, data, bsz, criterion, buffers, perm) model:evaluate() local loss = 0 local numexamples = 0 local ncorrect = 0 local noutputs = 0 -- Loop over data. for i = 1, #data, bsz do local input, target = getexample{ data = data, i = i, bsz = bsz, inputbuffer = buffers.input, maskbuffer = buffers.mask, targetbuffer = buffers.target, perm = perm, } rnn:initializeHidden(target:size(1)) loss = loss + forward(model, input, target, criterion) numexamples = numexamples + 1 local nc, no = classacc(model.output, target) ncorrect = ncorrect + nc noutputs = noutputs + no end -- Average out the loss. return loss / numexamples, ncorrect, noutputs end -------------------------------------------------------------------------------- -- Training -------------------------------------------------------------------------------- -- Set up auxiliary tools and buffers for training. local timer = torch.Timer() local inputbuffer = usegpu and torch.CudaLongTensor() or torch.LongTensor() local targetbuffer = usegpu and torch.CudaTensor() or torch.LongTensor() local maskbuffer if config.model:find('bi') then maskbuffer = usegpu and torch.CudaTensor() or torch.LongTensor() end local buffers = { input = inputbuffer, mask = maskbuffer, target = targetbuffer, } local prevval for epoch = 1, config.maxepoch do model:training() local trainperm = torch.randperm(#train) local loss = 0 local numexamples = 0 local ncorrect = 0 local noutputs = 0 timer:reset() for i = 1, #train, bsz do local input, target = getexample{ data = train, i = i, bsz = bsz, inputbuffer = inputbuffer, maskbuffer = maskbuffer, targetbuffer = targetbuffer, perm = trainperm, } -- Re-initializing the hidden unit is not necessary for the most part, -- since the models do not save the hidden state. -- However, this is useful for resizing the initial hidden state. rnn:initializeHidden(target:size(1)) loss = loss + forward(model, input, target, criterion) backward(model, input, target, criterion) if clip > 0 then clipgradients(grads, clip) end model:updateParameters(lr) -- Accumulate the class accuracy. local nc, no = classacc(model.output, target) ncorrect = ncorrect + nc noutputs = noutputs + no numexamples = numexamples + 1 if numexamples % reportinterval == 0 then local trainloss = loss / numexamples printf( '| epoch %03d | %05d samples | lr %02.6f | ms/batch %3d | ' .. 'train loss %5.2f | train class acc %0.4f', epoch, numexamples, lr, timer:time().real * 1000 / numexamples, trainloss, ncorrect / noutputs ) end end -- Perform validation. loss, ncorrect, noutputs = evaluate(model, valid, bsz, criterion, buffers) if prevval and loss > prevval then lr = lr / 2 end prevval = loss printf( '| end of epoch %03d | ms/batch %7d | ' .. 'valid loss %5.2f | valid class acc %0.3f', epoch, timer:time().real * 1000 / numexamples, loss, ncorrect / noutputs ) if lr < 1e-5 then break end end -- Evaluate on test set. local loss, ncorrect, noutputs = evaluate(model, test, bsz, criterion, buffers) printf( "| End of training | test loss %5.2f | test class acc %0.3f", loss, ncorrect / noutputs ) if config.save ~= '' then torch.save(config.save, model) end
local sharplua = {} local _G = _G local pcall = pcall local type = type local getmetatable = getmetatable local rawget = rawget _G.sharplua = sharplua -- make global local obj_ref = {} local obj_id = 0 local function fetch_obj(cache, obj) if obj_id > 1000000 then -- max number of cache obj_id = #cache end obj_id = obj_id + 1 cache[obj] = obj_id cache[obj_id] = obj obj_ref[obj_id] = obj -- strong reference return obj_id end local obj_cache = setmetatable({}, { __index = fetch_obj, __mode = "kv"}) local sharpobj_mt = {} -- todo: sharp object function sharplua.unref() if next(obj_ref) then obj_ref = {} -- clear strong reference, temp object in lua would be collect later. end end function sharplua._proxy(obj) if getmetatable(obj) == sharpobj_mt then return 'S', obj[1] -- sharp object else return 'L', obj_cache[obj] -- lua object end end local sharp_set = {} local function fetch_sharp(cache,id) local proxy_obj = setmetatable({id}, sharpobj_mt) cache[id] = proxy_obj sharp_set[id] = true return proxy_obj end local sharp_cache = setmetatable({}, { __index = fetch_sharp, __mode = "kv" }) function sharplua._object(type, id) if type == 'L' then -- lua object return rawget(obj_cache,id) else -- type == 'S' return sharp_cache[id] end end function sharplua._garbage() for k in pairs(sharp_set) do if not rawget(sharp_cache, k) then sharp_set[k] = nil return k end end end sharplua.call = require "sharplua.cscall" return sharplua
object_tangible_loot_creature_loot_collections_col_treasure_hunter_antique_rifle = object_tangible_loot_creature_loot_collections_shared_col_treasure_hunter_antique_rifle:new { } ObjectTemplates:addTemplate(object_tangible_loot_creature_loot_collections_col_treasure_hunter_antique_rifle, "object/tangible/loot/creature/loot/collections/col_treasure_hunter_antique_rifle.iff")
-- global config local function create_url(protocol,domain,port,path) return protocol..'://'..domain..(80==tonumber(port) and "" or ":"..port)..(nil==path and '' or path) end local _M = {} _M.debug = true _M.mysql = { host = "127.0.0.1", port = 3306, database = "db", user = "root", password = "password", charset = "utf-8", max_packet_size = 1024 * 1024 } _M.redis = { host="127.0.0.1", port = 6379 } _M.host= { domain="localhost", port=6000, protocol='http' } _M.host.url = create_url(_M.host.protocol,_M.host.domain,_M.host.port) return _M
byteCode = { 0x05, 0x53, 0x47, 0x30, 0x34, 0x00, 0x00, 0x53, 0x43, 0x30, 0x33, 0x00, 0x00, 0x41, 0x53, 0x48, 0x54, 0x00, 0x00, 0x53, 0x57, 0x35, 0x36, 0x00, 0x00, 0x53, 0x43, 0x30, 0x35, 0x00, 0x00, 0xcc, 0x03, 0xcc, 0x02, 0xcc, 0x00, 0xcc, 0x01, 0xd0, 0x00, 0x0e, 0xc5, 0x01, 0x00, 0xc0, 0x02, 0x01, 0x00, 0x01, 0xca, 0x1e, 0x00, 0xd4, 0xff, 0xd6, 0xd0, 0x01, 0x11, 0xdf, 0xc0, 0x02, 0x01, 0x00, 0x00, 0xd7, 0xd4, 0x00, 0xcf, 0x00, 0x03, 0x00, 0xce, 0x01, 0x00, 0x00, 0xd2, 0x00, 0x00, 0x1c, 0x0c, 0x1a, 0xdd, 0x01, 0xc0, 0x03, 0x01, 0x00, 0x00, 0xc5, 0x00, 0x01, 0xc0, 0x01, 0x01, 0x00, 0x00, 0xc0, 0x02, 0x01, 0x00, 0x01, 0xc9, 0x64, 0xd0, 0x00, 0xc3, 0x01, 0xc7, 0x01, 0x00, 0x37, 0x01, 0x12, 0xc4, 0x02, 0x01, 0x00, 0x01, 0x02, 0x0a, 0xcb, 0x02, 0xc5, 0x00, 0x03, 0xd4, 0x01, 0xd5, 0x01, 0xc6, 0x00, 0x0b, 0x0c, 0xc5, 0x00, 0x04, 0xca, 0x1e, 0x01, 0xd3, 0x1e, 0xc2, 0x03, 0xd0, 0x00, 0x0d, 0x08, 0xcf, 0x01, 0x03, 0x00, 0xce, 0x01, 0x01, 0x01, 0x0e, 0x09, 0xc4, 0x01, 0x00, 0x00, 0x02, 0x02, 0xd0, 0x01, 0x00, } return byteCode
--[[ Copyright (c) 2015 深圳市辉游科技有限公司. --]] __appAffiliate = 'official_ddz'
return { ["drop-ipv6-frag-invalid-reassembly"] = 1, ["in-ipv6-frag-needs-reassembly"] = 2, ["memuse-ipv4-frag-reassembly-buffer"] = 456638204, ["memuse-ipv6-frag-reassembly-buffer"] = 247200, }
-- Gargoyles, Genesis (BizHawk) -- feos, 2015-2017 --== Shortcuts ==-- local rb = memory.read_u8 local rw = memory.read_u16_be local rws = memory.read_s16_be local r24 = memory.read_u24_be local rl = memory.read_u32_be local box = gui.drawBox local text = gui.text local ptext = gui.pixelText local line = gui.drawLine local AND = bit.band local SHIFT = bit.rshift --== RAM addresses ==-- local levnum = 0xff00ba local LevelFlr = 0xff00c0 local LevelCon = 0xff00c4 local mapline_tab = 0xff0244 local GlobalBase = 0xff1c76 local GolBase = 0xff2c76 local MapA_Buff = 0xff4af0 --== Camera Hack ==-- local camhack = false local div = 1 -- scale local size = 16/div -- block size --== Block cache ==-- local col = 0 -- block color local opout = 0x33000000 -- outer opacity local opin = 0x66000000 -- inner opacity local op = 0xff000000 local cache = {} --== Other stuff ==-- local MsgCutoff = 20 local MsgTime = 1 local MsgStep = 14 local MsgOffs = 2 local MsgTable = {} local XposLast = 0 local YposLast = 0 local room = 0 local workinglast = 0 local wSize = client.getwindowsize() local lagcount = emu.lagcount() gui.defaultTextBackground(0xff000000) --== Object types ==-- local types = { "Goliath","Orb","Health1PLR","Health2PLR","Health1NME","Health2NME","Numeral", "BigExplode","SmallExplode","GlassDebris","MetalDebris","WoodDebris", "WallDebris","SignPiece","SteamVent","BreakWall","SkyLight","BreakLight", "ThrowCrate","BreakEdgeLeft","BreakEdgeRight","Spark","Spark2","Sparks", "Sparks2","Fireball","HomingProj1","HorzProj1","VertProj1","DirProj1", "DirProj2","DropMine","Scratch","Icon","RaptorBot","SniperBot","SpiderBot", "WaspBot","Xanatos","PlasmaBot","RabidHH","MorningStar","Archer","Arrow", "Valkyrie","Axe","WeaponExp","Couldron","SpittingCouldron","FireballHead", "FireballTrail","BigFireballHead","BigFireballTrail","Oil","OilGenerator", "Claw","Stump","StumpBubble","StumpFire","ClawStump","StumpFireGen","Vent", "VentSparks","Chain","FlameLick","Floor","MutVikBody","MutVikHead", "MutVikHammer","EyeOfOdin","EyeOfOdinTrail","L1BreakWall","Catapult", "L1BreakFloor","Gate","GateCrusher","Weight","WeightCrusher","WallFire", "Balista","BalistaLog","PasteWall","FlameBoulder","CastlePiece", "MutantSpiderBot","MutSpiLegs","MutSpiHead","MutSpiHeadFlame","MutSpiProj", "MutSpiElecV","MutSpiElecH","PlasmaBall","PlasmaBallTail","PlasmaDeadHead", "VertFlame","WallFlame","FloorFlame","OPPlatform","OPLink","OPOrb", "Furnace","RobotGenerator","RockGenerator","BigRock","MediumRock", "SmallRock","BigCouldronGen","BigCouldron","Trough","TroughGen","Energizer", "Demona","TrajectoryProj","WallPaste","EdgePaste","Tentacle","Infuser", "BigGuns","BigGunsProj","HighSignPole","HighSign","LowLight","L5Skylight", "L5Wall","ElecGenerator","Electricity","WaspGenerator","TunnelEdge", "ForegroundPost","Sorcerer","LightningTop","LightningBot","MDemonaWallFire", "MDemonaFloorFire","EyeRooftopUp","EyeRooftopDn","EyeRaptor" } local function RoomTime() local start11 = 894--767 local start12 = 2294 local start13 = 5468 -- 4254 -- 4101 local startl4 = 5506 local startl5 = 7117 local startl6 = 8412 local startl7 = 17117 local timer = emu.framecount() if timer < start11 then room = timer elseif timer < start12 then room = timer - start11 elseif timer < start13 then room = timer - start12 elseif timer < startl4 then room = timer - start13 elseif timer < startl5 then room = timer - startl4 elseif timer < startl6 then room = timer - startl5 elseif timer < startl7 then room = timer - startl6 end text(2, 2, string.format("cx:%5d\ncy:%5d\nroom:%d", camx, camy, room), "white", "bottomright") end local function HUD() --if working > 0 then return end local rndcol = "white" if rndlast ~= rnd1 then rndcol = "red" end text(0, 2, string.format("RNG:%08X %04X", rnd1, rnd2), rndcol, "bottomleft") text(2, 0, string.format( "x: %4d\ny: %4d\ndx: %3d\ndy: %3d\nhp: %3d\nrun:%3d\ninv:%3d", Xpos, Ypos, Xspd, Yspd, health, run, inv), "white", "topright") end local function CamhackHUD() if working == 0 then -- screen edge box((backx-camx- 1)/div, (backy-camy- 1)/div, (backx-camx+320)/div, (backy-camy+224)/div, 0xff0000ff, 0) -- map edge box( 0-camx/div+size, 0-camy/div+size, mapw/div-camx/div, maph/div-camy/div, 0xff0000ff, 0) end if camhack or div > 1 then text(0, 0, string.format("div:%d", div), "white", "topleft") end end local function PosToIndex(x, y) return math.floor(x/16)+math.floor(y/16)*xblocks end local function IndexToPos(i) return { x=(i%xblocks)*16, y=math.floor(i/xblocks)*16 } end local function InBounds(x, minimum, maximum) if x >= minimum and x <= maximum then return true else return false end end local function GetBlock(x, y) if working > 0 then return nil end local final = { contour={}, block=0 } if x > 0 and x < mapw and y > 0 and y < maph then local pixels = 0 local x1 = x/div-camx/div local x2 = x1+size-1 local y1 = y/div-camy/div local y2 = y1+size-1 local d4 = rw(mapline_tab+SHIFT(y, 4)*2) local a1 = r24(LevelFlr+1) local d1 = SHIFT(rw(MapA_Buff+d4+SHIFT(x, 4)*2), 1) final.block = rb(a1+d1+2) d1 = rw(a1+d1) a1 = r24(LevelCon+1)+d1 if rb(a1) > 0 or rb(a1+8) > 0 then for pixel=0, 15 do final.contour[pixel] = rb(a1+pixel) end else final.contour = nil end else return nil end return final end local DrawBlock = { [0x80] = function(x1, y1, x2, y2) -- WALL col = 0x00ffffff -- white line(x1, y1, x1, y2, col+op) -- left line(x2, y1, x2, y2, col+op) -- right end, [0x81] = function(x1, y1, x2, y2) -- CEILING col = 0x00ffffff -- white line(x1, y2, x2, y2, col+op) -- bottom end, [0x82] = function(x1, y1, x2, y2) -- CLIMB_U col = 0x0000ffff -- cyan line(x1, y2, x2, y2, col+op) -- bottom end, [0x83] = function(x1, y1, x2, y2) -- CLIMB_R col = 0x0000ffff -- cyan line(x1, y1, x1, y2, col+op) -- left end, [0x84] = function(x1, y1, x2, y2) -- CLIMB_L col = 0x0000ffff -- cyan line(x2, y1, x2, y2, col+op) -- right end, [0x85] = function(x1, y1, x2, y2) -- CLIMB_LR col = 0x0000ffff -- cyan line(x1, y1, x1, y2, col+op) -- left line(x2, y1, x2, y2, col+op) -- right end, [0x86] = function(x1, y1, x2, y2) -- CLIMB_R_STAND_R col = 0x00ffffff -- white line(x1, y1, x2, y1, col+op) -- top col = 0x0000ffff -- cyan line(x1, y1, x1, y2, col+op) -- left end, [0x87] = function(x1, y1, x2, y2) -- CLIMB_L_STAND_L col = 0x00ffffff -- white line(x1, y1, x2, y1, col+op) -- top col = 0x0000ffff -- cyan line(x2, y1, x2, y2, col+op) -- right end, [0x88] = function(x1, y1, x2, y2) -- CLIMB_LR_STAND_LR col = 0x00ffffff -- white line(x1, y1, x2, y1, col+op) -- top col = 0x00ff00ff -- cyan line(x1, y1, x1, y2, col+op) -- left col = 0x0000ffff -- cyan line(x2, y1, x2, y2, col+op) -- right end, [0x70] = function(x1, y1, x2, y2) -- GRAB_SWING col = 0x0000ff00 -- green box(x1, y1, x2, y2, col, col+opout) end, [0x7f] = function(x1, y1, x2, y2) -- EXIT col = 0x00ffff00 -- yellow end, [0xd0] = function(x1, y1, x2, y2) -- SPIKES col = 0x00ff0000 -- red box(x1, y1, x2, y2, col, col+opout) end, [0xd1] = function(x1, y1, x2, y2) -- SPIKES col = 0x00ff0000 -- red box(x1, y1, x2, y2, col, col+opout) end } local function DrawBlockDefault(x1, y1, x2, y2) -- LEVEL_SPECIFIC col = 0x00ff8800 -- orange box(x1, y1, x2, y2, col+opin, col+opout) end local function DrawBG(unit, x, y) local val= 0 local x1 = x/div-camx/div-(camx%16)/div local x2 = x1+size-1 local y1 = y/div-camy/div-(camy%16)/div local y2 = y1+size-1 if unit.contour ~= nil then box(x1, y1, x2, y2, 0x5500ff00, 0x5500ff00) for pixel=0, 15 do val = unit.contour[pixel] --[ [-- if val > 0 then gui.drawPixel( x1+pixel/div, y1+val/div-1/div, 0xffffff00) end --]]-- end end if unit.block > 0 then local Fn = DrawBlock[unit.block] or DrawBlockDefault Fn(x1, y1, x2, y2) box(x1, y1, x2, y2, col+opin, col+opout) end end local function Background() if working > 0 then cache = {} return end if camhack then camx = Xpos-320/2*div camy = Ypos-224/2*div box(0, 0, 320, 240, 0, 0x66000000) end local border = 0 local offset = 32 local basex = camx+border local basey = camy+border local basei = PosToIndex(basex-offset, basey-offset) local boundx = 320*div-border local boundy = 224*div-border local xblockstockeck = ((camx+boundx+offset)-(basex-offset))/size/div local yblockstockeck = ((camy+boundy+offset)-(basey-offset))/size/div for yblock = 0, yblockstockeck do for xblock = 0, xblockstockeck do local i = yblock*xblocks+xblock+basei local x = basex+xblock*size*div local y = basey+yblock*size*div if InBounds(x, basex-offset, camx+boundx+offset) then local unit = cache[i] if unit == nil or workinglast > 0 then if InBounds(x, basex, camx+boundx) and InBounds(y, basey, camy+boundy) then cache[i] = GetBlock(x, y) end else if not InBounds(x, basex, camx+boundx) and not InBounds(y, basey, camy+boundy) then cache[i] = nil end end if unit ~= nil then DrawBG(unit, x, y) end elseif cache[i] ~= nil then cache[i] = nil end end end CamhackHUD() end local function Clamp(v, vmin, vmax) if v < vmin then v = vmin end if v > vmax then v = vmax end return v end local function Objects() if working > 0 then return end for i=0, 63 do local base = GlobalBase+i*128 local flag2 = AND(rb(base+0x49), 0x10) -- active if flag2 == 0x10 then local xpos = rw (base+0x00) local ypos = rw (base+0x02) local state = rw (base+0x0c) local dmg = rb (base+0x10) local id = rw (base+0x40) local hp = rw (base+0x50) local cRAM = r24(base+0x75) -- pointer to 4 collision boxes per object local xscr = (xpos-camx)/div local yscr = (ypos-camy)/div local num = id/6 local name = types[num] local col = 0 -- collision color for boxx=0, 4 do local x0 = rw (cRAM+boxx*8) local x1 = (rws(cRAM+boxx*8+0)-camx)/div local y1 = (rws(cRAM+boxx*8+2)-camy)/div local x2 = (rws(cRAM+boxx*8+4)-camx)/div local y2 = (rws(cRAM+boxx*8+6)-camy)/div if boxx == 0 then col = 0xff00ff00 -- body -- archer hp doesn't matter if id == 282 or id == 258 then hp = 1 end if hp > 0 and id > 0 and x0 ~= 0x8888 then local xx = Clamp(xscr, 0, 318-string.len(name)*4) local yy = Clamp(yscr, 0, 214) ptext(xx, yy+2, string.format("%d", hp), col) end elseif boxx == 1 then col = 0xffffff00 -- floor elseif boxx == 2 then if dmg > 0 then col = 0xffff0000 -- projectile else col = 0xff8800ff -- item end if dmg > 0 then text(x1*wSize+2, y2*wSize+1, string.format("%d", dmg), col, 0x88000000) end else col = 0xffffffff -- other end if x1 ~= 0x8888 and x1 <= 320 and x2 >= 0 and y1 <= 224 and y2 >= 0 then box(x1, y1, x2, y2, col, 0) end end end end end local function PostRndRoll() for i = 1,#MsgTable do if MsgTable[i] and MsgTable[i].index == i then local base = MsgTable[i].base local xpos = rw(base+0x00) local ypos = rw(base+0x02) local id = rw(base+0x40) local x = (xpos-camx)/div local y = (ypos-camy)/div local num = id/6 local ymsg = 0 local yoffs = math.floor((i-1)/MsgCutoff)*14 local name = types[num] local color = 0xffffff00 if base == GolBase then name = "Goliath" elseif not name then name = string.format("%X", base) color = 0xff00ffff end if y < 224/2 then yoffs = -yoffs ymsg = 210 end x = Clamp(x, 2, 320-string.len(name)*4) y = Clamp(y, 20, 214) line ((i-1)%MsgCutoff*MsgStep+3 +MsgOffs, ymsg+yoffs+4, x, y, color-0x88000000) ptext((i-1)%MsgCutoff*MsgStep*wSize+MsgOffs, ymsg+yoffs, i, color) MsgTable[i].timer = MsgTable[i].timer-1 if MsgTable[i].timer <= 0 then MsgTable[i] = nil end end end end local function PlayerBoxes() if working > 0 then return end local xx = (Xpos-camx)/div local yy = (Ypos-camy)/div local col = 0xff00ffff local swcol = col -- usual detection if Yspd > 0 then -- gimme swings to grab! swcol = 0xff00ff00 elseif Yspd == 0 then -- can tell that too swcol = 0xffffffff end if facing == 2 then box(xx-0xf /div-2, yy-0x2c/div-1, xx-0xf/div+0, yy-0x2c/div+1, swcol, 0) -- lefttop else box(xx+0xf /div , yy-0x2c/div-1, xx+0xf/div+2, yy-0x2c/div+1, swcol, 0) -- rightttop end box(xx -1, yy-0x2c/div-1, xx +1, yy-0x2c/div+1, col, 0) -- top box(xx-0xf /div-2, yy-0x1f/div-1, xx-0xf /div+0, yy-0x1f/div+1, col, 0) -- left box(xx+0x10/div-1, yy-0x1f/div-1, xx+0x10/div+1, yy-0x1f/div+1, col, 0) -- right -- box(xx -1, yy-0x1f/div-1, xx +1, yy-0x1f/div+1, col, 0) -- center box(xx -1, yy-0x0f/div-1, xx +1, yy-0x0f/div+1, col, 0) -- bottom box(xx -1, yy -1, xx +1, yy +1,0xffffff00, 0) -- feet -- box(xx -1, yy+0x10/div-1, xx +1, yy+0x10/div+1, col, 0) -- ground end local function Input() local i, u, d, l, r, a, b, c, s if movie.isloaded() then i = movie.getinput(emu.framecount()-1) else i = joypad.getimmediate() end if i["P1 Up" ] then u = "U" else u = " " end if i["P1 Down" ] then d = "D" else d = " " end if i["P1 Left" ] then l = "L" else l = " " end if i["P1 Right"] then r = "R" else r = " " end if i["P1 A" ] then a = "A" else a = " " end if i["P1 B" ] then b = "B" else b = " " end if i["P1 C" ] then c = "C" else c = " " end if i["P1 Start"] then s = "S" else s = " " end text(1, 10, u..d..l..r..a..b..c..s, "yellow") end event.onframeend(function() emu.setislagged(rb(0xfff6d4) == 0) if rb(0xfff6d4) == 0 then lagcount = lagcount+1 framecol = "red" else framecol = "white" end emu.setlagcount(lagcount) wSize = client.getwindowsize() rndlast = rnd1 workinglast = working XposLast = Xpos YposLast = Ypos end) event.onmemoryexecute(function() local a0 = AND(emu.getregister("M68K A0"), 0xffffff) if a0 ~= 0xff4044 then for i = 1, 200 do if MsgTable[i] == nil then MsgTable[i] = { index = i, timer = MsgTime, base = a0 } break end end end end, 0x257A, "RNGseed") local function main() rnd1 = rl (0xff001c) rnd2 = rw (0xff0020) working = rb (0xff0073) xblocks = rw (0xff00d4) mapw = rw (0xff00d4)*8 maph = rw (0xff00d6)*8 Xpos = rws(0xff0106) Ypos = rws(0xff0108) camx = rws(0xff010c)+16 camy = rws(0xff010e)+16 run = rb (0xff1699) inv = rw (0xff16d2) health = rws(0xff2cc6) backx = camx backy = camy Xspd = Xpos-XposLast Yspd = Ypos-YposLast facing = AND(rb(GolBase+0x48), 2) -- object flag 1 if working > 0 then MsgTable = {} end Background() PlayerBoxes() Objects() PostRndRoll() HUD() RoomTime() end while true do main() emu.frameadvance() end
player_1 = {} player_1.body1 = love.physics.newBody(myWorld1, 2140,550, "dynamic" ) -- тело может двигаться player_1.shape1 = love.physics.newRectangleShape(32, 92) player_1.fixture1 = love.physics.newFixture(player_1.body1, player_1.shape1) player_1.speed = 200 --- [[5]] горизонтальная скорость игрока player_1.angle = 0 player_1.grounded1 = false ---[[6]] ложь если человечек в прыжке, истина если стоит на платфоме player_1.dead = false ---[[7]] направление движения для смены спрайта 1 - вправо, -1 - влево player_1.sprite = sprites.player_1d ---[[7]] player_1.body1:setFixedRotation(true) player_1.grid = anim8.newGrid(41, 42, 123, 126) playeranimation = anim8.newAnimation(player_1.grid('1-3',1, '1-3',2, '1-2',3), 0.2) ---[[8]] function player_1Update(dt) if player_1.dead == true then player_1.sprite = sprites.pusto end if player_1.body1:getY() >= 900 then player_1.dead = true end if player_1.dead == false then if love.keyboard.isDown("s") then player_1.sprite = sprites.player_1s player_1.body1:applyLinearImpulse(0, 40) else player_1.sprite = sprites.player_1a if love.keyboard.isDown("a") then player_1.body1:setX(player_1.body1:getX() - player_1.speed*dt) ---[[7]] повернем спрайт влево player_1.sprite = sprites.player_1a else player_1.sprite = sprites.player_1 if love.keyboard.isDown("d") then player_1.body1:setX(player_1.body1:getX() + player_1.speed*dt) player_1.sprite = sprites.player_1d else player_1.sprite = sprites.player_1 ---[[7]] повернем спрайт вправо -- if love.keyboard.isDown("q") then -- player_1.angle = player_1.angle + math.pi*dt -- end -- if love.keyboard.isDown("e") then --вращение влево -- player_1.angle = player_1.angle - math.pi*dt -- end if love.keyboard.isDown("w") then player_1.sprite = sprites.player_1w end ---- [[6]] -- обработка коллизий ---- [[6]] -- обработка коллизий end end end end end
local yutil = require("prototypes.util") local autofill = settings.startup["ymm-allow-barreling"].value local ore_names = {"iron", "copper", "stone", "uranium"} local function make_molten_fluid(name) data:extend({{ type = "fluid", name = "molten-"..name, icons = yutil.get_icons(name), default_temperature = yutil.temperatures[name][1], max_temperature = yutil.temperatures[name][2], heat_capacity = "0.425KJ", base_color = yutil.color.moltenmetal.base, flow_color = yutil.color.moltenmetal.flow, order = "m[molten-"..name.."]", auto_barrel = autofill }}) end for _, name in ipairs(ore_names) do make_molten_fluid(name) end -- data:extend({ -- { -- type = "fluid", -- name = "acidic-water", -- icon = "__Molten_Metals__/graphics/icons/acidic-water.png", -- icon_size = 64, icon_mipmaps = 4, -- default_temperature = 80, -- max_temperature = 100, -- heat_capacity = "0.1KJ", -- base_color = color.acidwater.base, -- flow_color = color.acidwater.flow, -- order = "z" -- }, -- })
---- -- @file PhysicsShapeBox2DBuilder ---- Brief description. -- <#Description#> -- @return <#return value description#> function PhysicsShapeBox2DBuilder:calculateSerializeBufferSize() end ---- Brief description. -- <#Description#> -- @param btSerializer <#btSerializer description#> -- @return <#return value description#> function PhysicsShapeBox2DBuilder:serialize(btSerializer) end ---- Brief description. -- <#Description#> -- @return <#return value description#> function PhysicsShapeBox2DBuilder:getObjectType() end ---- Brief description. -- <#Description#> -- @return <#return value description#> function PhysicsShapeBox2DBuilder:getClassName() end ---- Brief description. -- <#Description#> -- @return <#return value description#> function PhysicsShapeBox2DBuilder:getType() end ---- Brief description. -- <#Description#> -- @param size <#size description#> -- @return <#return value description#> function NJLI.PhysicsShapeBox2DBuilder.createArray(size) end ---- Brief description. -- <#Description#> -- @param array <#array description#> -- @return <#return value description#> function NJLI.PhysicsShapeBox2DBuilder.destroyArray(array) end ---- Brief description. -- <#Description#> -- @return <#return value description#> function NJLI.PhysicsShapeBox2DBuilder.create() end ---- Brief description. -- <#Description#> -- @param object <#object description#> -- @return <#return value description#> function NJLI.PhysicsShapeBox2DBuilder.clone(object) end ---- Brief description. -- <#Description#> -- @param object <#object description#> -- @return <#return value description#> function NJLI.PhysicsShapeBox2DBuilder.destroy(object) end ---- Brief description. -- <#Description#> -- @param object <#object description#> -- @param L <#L description#> -- @param stack_index <#stack_index description#> -- @return <#return value description#> function NJLI.PhysicsShapeBox2DBuilder.load(object, L, stack_index) end ---- Brief description. -- <#Description#> -- @return <#return value description#> function NJLI.PhysicsShapeBox2DBuilder.type() end
return Def.ActorFrame { Def.Quad { InitCommand = function(self) self:zoomto(10, 10):y(-5):skewx(1) end }, Def.Quad { InitCommand = function(self) self:zoomto(10, 10):y(5):skewx(-1) end } }
local function randomPermutation(n) local perm = {} for i=1,n do perm[i] = i end for i=1,n-1 do j=love.math.random(i,n) perm[i],perm[j] = perm[j],perm[i] end return perm end function newOrder(nColor,nShape,nFill,nLevels,name,isFullRandom) if isFullRandom then return newOrderRandom(nColor,nShape,nFill,nLevels,name) else return newOrderStratified(nColor,nShape,nFill,nLevels,name) end end function newOrderStratified(nColor,nShape,nFill,nLevels,name) local nStages = nColor*nShape*nFill if nLevels > nStages then nLevels = nStages end stageRegister = {} stages = {} stages.name = name -- randomly select some shapes, colors, fillstyles colorPerm = randomPermutation(#color) shapePerm = randomPermutation(#outline) fillPerm = randomPermutation(2) -- generate combinations and cross table crossTable = {} for i=0,nStages-1 do local N = i local thisFill= N%nFill N = (N-thisFill)/nFill local thisShape = N%nShape N = (N-thisShape)/nShape local thisColor = N%nColor thisFill = thisFill + 1 thisShape = thisShape + 1 thisColor = thisColor + 1 local newStage = {shape = shapePerm[thisShape], color=colorPerm[thisColor],fill=fillPerm[thisFill]} table.insert(stageRegister,newStage) table.insert(crossTable, 0) end for i=1,nLevels do local minCross = math.huge -- find minimum of crosstable for k,v in ipairs(crossTable) do minCross = math.min(v,minCross) end -- put minimal elements into one table local idxTable = {} for k,v in ipairs(crossTable) do if v == minCross then table.insert(idxTable,k) end end -- pull random one local idx = love.math.random(#idxTable) local newShape = stageRegister[idxTable[idx]] table.insert(stages,newShape) -- update cross table for k,v in ipairs(stageRegister) do if v.shape == newShape.shape then crossTable[k] = crossTable[k] + 1 end if v.color == newShape.color then crossTable[k] = crossTable[k] + 1 end if v.fill == newShape.fill then crossTable[k] = crossTable[k] + 1 end if v == newShape then crossTable[k] = crossTable[k] + 100 end end end -- assign directions assignDirections(stages) return stages end function newOrderRandom(nColor,nShape,nFill,nLevels,name) local nStages = nColor*nShape*nFill if nLevels > nStages then nLevels = nStages end local stages = {} stages.name = name -- randomly select some shapes, colors, fillstyles colorPerm = randomPermutation(#color) shapePerm = randomPermutation(#outline) --fillPerm = randomPermutation(2) -- generate all combinations in order for i=0,nStages-1 do local N = i local thisFill= N%nFill N = (N-thisFill)/nFill local thisShape = N%nShape N = (N-thisShape)/nShape local thisColor = N%nColor thisFill = thisFill + 1 thisShape = thisShape + 1 thisColor = thisColor + 1 newStage = {shape = shapePerm[thisShape], color=colorPerm[thisColor],fill=thisFill} table.insert(stages,newStage) end -- shuffle for i=1,nStages-1 do j = love.math.random(i,nStages) stages[i],stages[j] = stages[j],stages[i] end for i=nLevels+1,nStages do stages[i] = nil end -- assign directions assignDirections(stages) return stages end function assignDirections(stageList) local nLevels = #stageList local first = love.math.random(2) stageList[1].direction = first count={0,0} count[first] = 1 for i=2,nLevels do local thisDirection if count[2] >= nLevels/2 or count[2] > count[1]+1 or count[1] == 0 then thisDirection = 1 elseif count[1] >= nLevels/2 or count[1] > count[2]+1 or count[2] == 0 then thisDirection = 2 else if love.math.random() < 0.5 then thisDirection = 2 else thisDirection = 1 end end count[thisDirection] = count[thisDirection] + 1 stageList[i].direction = thisDirection end return stageList end function generateLevel(stages,level,nShapes) local newLevel = {} for i=1,nShapes do table.insert(newLevel,stages[love.math.random(level)]) end return newLevel end function initShapes() color = { {170,0,0}, {33,68,120}, {0,128,0}, {255,204,0}, {255,102,0}, {0,212,170}, {233,221,175}, {136,0,170}, } outline = {} -- rectangle outline[1] = {-.8,-.8,-.8,.8,.8,.8,.8,-.8} -- triangle outline[2] = {0,-.8,-0.8,0.8,0.8,0.8} -- star outline[3] = {} for i=0,4 do local factor = 0.9 local ratio = 0.49 outline[3][4*i+1] = math.sin(i*math.pi*2/5) * factor outline[3][4*i+2] = -math.cos(i*math.pi*2/5) * factor outline[3][4*i+3] = ratio*math.sin((i+0.5)*math.pi*2/5) * factor outline[3][4*i+4] = ratio*-math.cos((i+0.5)*math.pi*2/5) * factor end -- circle outline[4] = {} local nSeg = 40 local factor = 0.9 for i=0,nSeg-1 do outline[4][2*i+1] = math.sin(i*math.pi*2/nSeg) * factor outline[4][2*i+2] = -math.cos(i*math.pi*2/nSeg) * factor end -- diamond outline[5] = {0.9,0,0,0.9,-0.9,0,0,-0.9} -- cross outline[6] = {0.9,0.6,0.6,0.9,0,0.3 ,-0.6,0.9,-0.9,0.6,-0.3,0 ,-0.9,-0.6,-0.6,-0.9,0,-0.3 ,0.6,-0.9,0.9,-0.6,0.3,0} -- heart outline[7] = {} local curve = love.math.newBezierCurve( 0,0.9,0.4,0.5,1.08,-0.07,0.85,-0.65) for k,v in ipairs(curve:render()) do if k>2 then table.insert(outline[7],v) end end curve = love.math.newBezierCurve( 0.85,-0.65,0.62,-1,0.13,-.8,0.,-0.6) for k,v in ipairs(curve:render()) do if k>2 then table.insert(outline[7],v) end end curve = love.math.newBezierCurve( 0,-0.6,-.13,-0.8,-0.62,-1,-0.85,-0.65) for k,v in ipairs(curve:render()) do if k>2 then table.insert(outline[7],v) end end curve = love.math.newBezierCurve( -0.85,-0.65,-1.08,-0.07,-0.4,0.5,-0,0.9) for k,v in ipairs(curve:render()) do if k>2 then table.insert(outline[7],v) end end -- half-moon outline[8] = {} local nSeg = 20 local r = 0.9 for i=1,2*nSeg do local angle = i/nSeg*4*math.pi/3/2 + math.pi/6 table.insert(outline[8],r*math.cos(angle)) table.insert(outline[8],r*math.sin(angle)) end local cx = r*math.cos(-math.pi/6) local cy = r*math.sin(-math.pi/6) for i=1,nSeg do local angle = i*2*math.pi/3/nSeg + math.pi*5/6 table.insert(outline[8],cx + r*math.cos(angle)) table.insert(outline[8],cy -r*math.sin(angle)) end insides = {} for i=1,#outline do if love.math.isConvex(outline[i]) then insides[i] = {outline[i]} else insides[i] = love.math.triangulate(outline[i]) end end end function drawShape(x,y,colorIdx,shapeIdx,fillIdx,scale,fade) local thisScale = scale or 1 thisScale = thisScale * 50 local lineWidth = 5 local fade = fade or 1 local r = color[colorIdx][1]*fade + (1-fade) * 25 local g = color[colorIdx][2]*fade + (1-fade) * 25 local b = color[colorIdx][3]*fade + (1-fade) * 35 love.graphics.push() love.graphics.translate(x,y) love.graphics.scale(thisScale,thisScale) love.graphics.setColor(r,g,b,alpha) love.graphics.setLineWidth(0.2) for k,v in ipairs(insides[shapeIdx]) do if fillIdx == 1 then love.graphics.polygon('fill',v) end end love.graphics.polygon('line',outline[shapeIdx]) love.graphics.pop() end
westworld2_protocol = Proto("Westworld2", "Westworld2 Protocol") seq = ProtoField.int32("westworld2.seq", "Sequence Number", base.DEC) mt = ProtoField.uint8("westworld2.mt", "Message Type", base.HEX) mf = ProtoField.uint8("westworld2.mf", "Message Flag", base.BIN) ack = ProtoField.int32("westworld2.ack", "ACK", base.DEC) westworld2_protocol.fields = { seq, mt, mf, ack } function westworld2_protocol.dissector(buffer, pinfo, tree) length = buffer:len() if length == 0 then return end pinfo.cols.protocol = westworld2_protocol.name local subtree = tree:add(westworld2_protocol, buffer(), "Westworld2 Protocol") subtree:add(seq, buffer(0,4)) local mt_v = buffer(4, 1):uint() local mt_name = get_mt_name(mt_v) subtree:add(mt, buffer(4,1)):append_text(" (" .. mt_name .. ")") subtree:add(mf, buffer(5,1)) subtree:add(ack, buffer(6,4)) end function get_mt_name(mt) local mt_name = "UNKNOWN" if mt == 0 then mt_name = "HELLO" elseif mt == 1 then mt_name = "ACK" elseif mt == 2 then mt_name = "DATA" elseif mt == 3 then mt_name = "CLOSE" end return mt_name end local udp_port = DissectorTable.get("udp.port") udp_port:add(6262, westworld2_protocol)
--シューティング・セイヴァー・スター・ドラゴン --Scripted by mallu11 function c101105204.initial_effect(c) aux.AddCodeList(c,44508094) --synchro summon aux.AddSynchroMixProcedure(c,c101105204.mfilter,nil,nil,aux.NonTuner(nil),1,99,c101105204.gfilter) c:EnableReviveLimit() --special summon condition local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetCode(EFFECT_SPSUMMON_CONDITION) e1:SetRange(LOCATION_EXTRA) e1:SetValue(aux.synlimit) c:RegisterEffect(e1) --disable local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(101105204,0)) e2:SetCategory(CATEGORY_DISABLE) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) e2:SetTarget(c101105204.distg) e2:SetOperation(c101105204.disop) c:RegisterEffect(e2) --extra attack local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE) e3:SetCode(EFFECT_EXTRA_ATTACK) e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e3:SetRange(LOCATION_MZONE) e3:SetValue(c101105204.atkval) c:RegisterEffect(e3) --negate local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(101105204,1)) e4:SetCategory(CATEGORY_NEGATE+CATEGORY_REMOVE) e4:SetType(EFFECT_TYPE_QUICK_O) e4:SetCode(EVENT_CHAINING) e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e4:SetRange(LOCATION_MZONE) e4:SetCountLimit(1) e4:SetCondition(c101105204.negcon) e4:SetTarget(c101105204.negtg) e4:SetOperation(c101105204.negop) c:RegisterEffect(e4) end c101105204.material_type=TYPE_SYNCHRO function c101105204.mfilter(c) return c:IsCode(21159309) and c:IsSynchroType(TYPE_TUNER) end function c101105204.cfilter(c) return c:IsRace(RACE_DRAGON) and c:IsSynchroType(TYPE_SYNCHRO) end function c101105204.gfilter(g,syncard,c1) return g:IsExists(c101105204.cfilter,1,c1) end function c101105204.disfilter(c) return aux.disfilter1(c) and c:IsType(TYPE_EFFECT) end function c101105204.distg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(c101105204.disfilter,tp,0,LOCATION_MZONE,1,nil) end Duel.SetOperationInfo(0,CATEGORY_DISABLE,nil,1,tp,LOCATION_MZONE) end function c101105204.disop(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE) local g=Duel.SelectMatchingCard(tp,c101105204.disfilter,tp,0,LOCATION_MZONE,1,1,nil) local tc=g:GetFirst() if tc then Duel.HintSelection(g) Duel.NegateRelatedChain(tc,RESET_TURN_SET) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_DISABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetReset(RESET_EVENT+RESETS_STANDARD) tc:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e2:SetValue(RESET_TURN_SET) e2:SetReset(RESET_EVENT+RESETS_STANDARD) tc:RegisterEffect(e2) end end function c101105204.atkfilter(c) return c:IsCode(44508094) or aux.IsCodeListed(c,44508094) and c:IsType(TYPE_SYNCHRO) end function c101105204.atkval(e,c) return Duel.GetMatchingGroupCount(c101105204.atkfilter,e:GetHandlerPlayer(),LOCATION_GRAVE,0,nil) end function c101105204.negcon(e,tp,eg,ep,ev,re,r,rp) return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev) and rp==1-tp end function c101105204.negtg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return c:IsAbleToRemove() and aux.nbcon(tp,re) end Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0) Duel.SetOperationInfo(0,CATEGORY_REMOVE,c,1,0,0) if re:GetHandler():IsRelateToEffect(re) then local g=eg:Clone()+c Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,#g,0,0) end end function c101105204.negop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) and Duel.Remove(c,0,REASON_EFFECT+REASON_TEMPORARY)~=0 and c:IsLocation(LOCATION_REMOVED) then local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetCode(EVENT_PHASE+PHASE_END) e1:SetReset(RESET_PHASE+PHASE_END) e1:SetLabelObject(c) e1:SetCountLimit(1) e1:SetOperation(c101105204.retop) Duel.RegisterEffect(e1,tp) if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then Duel.Remove(eg,POS_FACEUP,REASON_EFFECT) end end end function c101105204.retop(e,tp,eg,ep,ev,re,r,rp) Duel.ReturnToField(e:GetLabelObject()) end
AddCSLuaFile() ENT.Type = "anim" ENT.Author = "TankNut" ENT.SpawnRotation = 0 ENT.UseCustomPhys = false ENT.PhysMin = Vector() ENT.PhysMax = Vector() if SERVER then function ENT:SpawnFunction(ply, tr, class) if not tr.Hit then return end local ent = ents.Create(class) local ang = Angle(0, ply:EyeAngles().y + 180, 0) + Angle(0, self.SpawnRotation, 0) ent:SetCreator(ply) ent:SetPos(tr.HitPos) ent:SetAngles(ang) ent:Spawn() ent:Activate() local pos = tr.HitPos - (tr.HitNormal * 512) pos = ent:NearestPoint(pos) pos = ent:GetPos() - pos pos = tr.HitPos + pos ent:SetPos(pos) return ent end end function ENT:Initialize() self:SetupHooks() if CLIENT then self:SetupParts() end self:SetModel(self.Model or "models/hunter/plates/plate.mdl") if self.UseCustomPhys then self:SetupPhysics(self.PhysMin, self.PhysMax) elseif SERVER then self:PhysicsInit(SOLID_VPHYSICS) self:SetMoveType(MOVETYPE_VPHYSICS) end end function ENT:SetupPhysics(mins, maxs) if IsValid(self.PhysCollide) then self.PhysCollide:Destroy() end self.PhysCollide = CreatePhysCollideBox(mins, maxs) self:SetCollisionBounds(mins, maxs) if CLIENT then self:SetRenderBounds(mins, maxs) else self:PhysicsInitBox(mins, maxs) self:SetSolid(SOLID_VPHYSICS) self:PhysWake() end self:EnableCustomCollisions(true) end function ENT:SetupDataTables() self:NetworkVar("Int", 0, "GridID") end if CLIENT then function ENT:SetupParts() TankLib.Part:Clear(self) end function ENT:Draw() self:DrawModel() TankLib.Part:Draw(self) end end function ENT:SetupHooks() if self.Hooks then for k in pairs(self.Hooks) do hook.Remove(k, self) end table.Empty(self.Hooks) else self.Hooks = {} end if CLIENT then self:Hook("PostDrawTranslucentRenderables") end end function ENT:Hook(name) self.Hooks[name] = true hook.Add(name, self, self[name]) end function ENT:OnReloaded() self:SetupHooks() if CLIENT then self:SetupParts() end end if CLIENT then function ENT:DrawWorldText(offset, text) local pos = self:GetPos() + offset local ang = (pos - EyePos()):Angle() cam.Start3D2D(pos, Angle(0, ang.y - 90, 90), 0.25) render.PushFilterMag(TEXFILTER.NONE) render.PushFilterMin(TEXFILTER.NONE) surface.SetFont("BudgetLabel") local w, h = surface.GetTextSize(text) surface.SetTextColor(255, 255, 255, 255) surface.SetTextPos(-w * 0.5, -h * 0.5) surface.DrawText(text) render.PopFilterMin() render.PopFilterMag() cam.End3D2D() end local convar = GetConVar("developer") function ENT:PostDrawTranslucentRenderables() if convar:GetBool() then self:DrawDebug() end end function ENT:DrawDebug() end else function ENT:GetTargets(range, origin) local targets = {} local pos = origin or self:WorldSpaceCenter() range = range * range for ent in pairs(SquirrelDefense.Targets) do if not SquirrelDefense:IsValidTarget(ent) then continue end local dist = pos:DistToSqr(ent:WorldSpaceCenter()) if dist <= range then table.insert(targets, {ent, dist}) end end return targets end end function ENT:GetGrid() return TankLib.Class.NetworkTable[self:GetGridID()] end function ENT:TestCollision(start, delta, isbox, extends) if not IsValid(self.PhysCollide) then return end local max = extends local min = -extends max.z = max.z - min.z min.z = 0 local hit, norm, frac = self.PhysCollide:TraceBox(self:GetPos(), self:GetAngles(), start, start + delta, min, max) if not hit then return end return { HitPos = hit, Normal = norm, Fraction = frac } end properties.Add("sd_link", { MenuLabel = "Link to grid", Order = 1, Filter = function(self, ent, ply) local ok = false for _, v in pairs(SquirrelDefense.Grids) do if v:GetOwner() == ply then ok = true break end end if not ok then return false end if not IsValid(ent) then return false end if not ent.SDCanConnect then return false end if not gamemode.Call("CanProperty", ply, "sd_link", ent) then return false end return ent:GetGridID() == 0 end, Action = function(self, ent) end, Receive = function(self, len, ply) local ent = net.ReadEntity() local id = net.ReadUInt(16) if not properties.CanBeTargeted(ent, ply) then return end if not self:Filter(ent, ply) then return end local grid = TankLib.Class:GetNetworked(id) if not grid or not grid:IsInstanceOf(SquirrelDefense.DefenseGrid) then return end if grid:GetOwner() != ply then return end grid:AddEntity(ent) end, MenuOpen = function(self, dmenu, ent, tr) local submenu = dmenu:AddSubMenu() for _, v in pairs(SquirrelDefense.Grids) do if v:GetOwner() == LocalPlayer() then submenu:AddOption(v:GetName(), function() self:SetID(ent, v.NetworkID) end) end end end, SetID = function(self, ent, id) self:MsgStart() net.WriteEntity(ent) net.WriteUInt(id, 16) self:MsgEnd() end })
--[[ Wrapper for loading the numerical library for flos --]] local ret = {} local function add_ret( tbl ) for k, v in pairs(tbl) do ret[k] = v end end add_ret(require "flos.num.shape") add_ret(require "flos.num.array") return ret
require("prototypes.misc-recipe") require("prototypes.final-fixed-science-materials") require("prototypes.final-fixed-technogies") require("prototypes.final-fixed-tiered-recipes") require("prototypes.final-fixed-recipe") require("prototypes.final-fixed-electronics") require("prototypes.final-fixed-rubber") require("prototypes.matter-to-science-pack") if not (momoIRTweak.DumpOnly) then --using local Subgroup = momoIRTweak.GetSubgroupFromItem -- write final fixed here momoIRTweak.finalFixes.MiscRecipe() data.raw["solar-panel"]["imersite-solar-panel"].production = "450kW"; momoIRTweak.finalFixes.ScienceMaterials() momoIRTweak.finalFixes.FixResearchServer() momoIRTweak.finalFixes.Technogies() momoIRTweak.finalFixes.TieredRecipes() momoIRTweak.finalFixes.Recipe() momoIRTweak.finalFixes.Electronics() momoIRTweak.finalFixes.Rubber() momoIRTweak.finalFixes.MatterToScience() -- adjust subgroup local refSubgroup = data.raw["item-subgroup"]["intermediate-product"] data.raw["item-subgroup"][momoIRTweak.science.materialSubgroup].group = refSubgroup.group local count = 0 for c, r in pairs(data.raw.recipe) do count = count + 1 end log("Total recipe = " .. count) count = 0 for c, t in pairs(data.raw.technology) do count = count + 1 end log("Total technology = " .. count) else momoIRTweak.DumpRecipes() momoIRTweak.DumpTechnologies() end
local cmds = require('commands') local getopt = require('getopt') local bin = require('bin') local utils = require('utils') local format=string.format local floor=math.floor example =[[ 1. script run test_t55x7_ask ]] author = "Iceman" usage = "script run test_t55x7_ask" desc =[[ This script will program a T55x7 TAG with the configuration: block 0x00 data 0x000100 The outlined procedure is as following: --ASK 00 00 80 40 -- max 2 -- manchester -- bit rate "lf t55xx write 0 00008040" "lf t55xx detect" "lf t55xx info" Loop: change the configuretion block 0 with: -xx 00 xxxx = RF/8 -xx 04 xxxx = RF/16 -xx 08 xxxx = RF/32 -xx 0C xxxx = RF/40 -xx 10 xxxx = RF/50 -xx 14 xxxx = RF/64 -xx 18 xxxx = RF/100 -xx 1C xxxx = RF/128 testsuit for the ASK/MANCHESTER demod Arguments: -h : this help ]] local TIMEOUT = 2000 -- Shouldn't take longer than 2 seconds local DEBUG = true -- the debug flag --BLOCK 0 = 00008040 ASK / MAN local config1 = '00' local config2 = '8040' local procedurecmds = { [1] = '%s%02X%s', [2] = 'lf t55xx detect', [3] = 'lf t55xx info', } --- -- A debug printout-function function dbg(args) if not DEBUG then return end if type(args) == "table" then local i = 1 while args[i] do dbg(args[i]) i = i+1 end else print("###", args) end end --- -- This is only meant to be used when errors occur function oops(err) print("ERROR: ",err) end --- -- Usage help function help() print(desc) print("Example usage") print(example) end -- -- Exit message function ExitMsg(msg) print( string.rep('--',20) ) print( string.rep('--',20) ) print(msg) print() end function test() local y local block = "00" for y = 0x0, 0x1d, 0x4 do for _ = 1, #procedurecmds do local pcmd = procedurecmds[_] if #pcmd == 0 then elseif _ == 1 then local config = pcmd:format(config1, y, config2) dbg(('lf t55xx write 0 %s'):format(config)) config = tonumber(config,16) local writecmd = Command:new{cmd = cmds.CMD_T55XX_WRITE_BLOCK,arg1 = config, arg2 = block, arg3 = "00", data = "00"} local err = core.SendCommand(writecmd:getBytes()) if err then return oops(err) end local response = core.WaitForResponseTimeout(cmds.CMD_ACK,TIMEOUT) else dbg(pcmd) core.console( pcmd ) end end core.clearCommandBuffer() end print( string.rep('--',20) ) end local function main(args) print( string.rep('--',20) ) print( string.rep('--',20) ) -- Arguments for the script for o, arg in getopt.getopt(args, 'h') do if o == "h" then return help() end end core.clearCommandBuffer() test() print( string.rep('--',20) ) end main(args)
-- Copyright (C) 2018 The Dota IMBA Development Team -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. -- -- Editors: -- Shush, 19.03.2017 -- CreateEmptyTalents("clinkz") ----------------------------- -- STRAFE -- ----------------------------- imba_clinkz_strafe = class({}) LinkLuaModifier("modifier_imba_strafe_aspd", "hero/hero_clinkz", LUA_MODIFIER_MOTION_NONE) LinkLuaModifier("modifier_imba_strafe_mount", "hero/hero_clinkz", LUA_MODIFIER_MOTION_NONE) LinkLuaModifier("modifier_imba_strafe_self_root", "hero/hero_clinkz", LUA_MODIFIER_MOTION_NONE) function imba_clinkz_strafe:GetAbilityTextureName() return "clinkz_strafe" end function imba_clinkz_strafe:IsHiddenWhenStolen() return false end function imba_clinkz_strafe:IsNetherWardStealable() return false end function imba_clinkz_strafe:GetCooldown(level) if IsServer() then local caster = self:GetCaster() local duration = self:GetSpecialValueFor("duration") local modifier_mount = "modifier_imba_strafe_mount" -- Assign correct cooldown. No need to update the UI if self.time_remaining ~= nil then local time_remaining = self.time_remaining self.time_remaining = nil return self.BaseClass.GetCooldown(self, level) - (duration - math.max(time_remaining,0)) end end return self.BaseClass.GetCooldown(self, level) end function imba_clinkz_strafe:GetBehavior() local caster = self:GetCaster() local modifier_mount = "modifier_imba_strafe_mount" local modifier_self_root = "modifier_imba_strafe_self_root" if caster:HasModifier(modifier_mount) then return DOTA_ABILITY_BEHAVIOR_NO_TARGET else return DOTA_ABILITY_BEHAVIOR_UNIT_TARGET end end function imba_clinkz_strafe:GetManaCost(level) local caster = self:GetCaster() -- If Clinkz is currently mounted, remove the mana cost if caster:HasModifier("modifier_imba_strafe_mount") then return 0 end -- Otherwise, return normal mana cost return self.BaseClass.GetManaCost(self, level) end function imba_clinkz_strafe:OnSpellStart() if IsServer() then -- Ability properties local caster = self:GetCaster() local ability = self local target = self:GetCursorTarget() local sound_cast = "Hero_Clinkz.Strafe" local modifier_aspd = "modifier_imba_strafe_aspd" local modifier_mount = "modifier_imba_strafe_mount" -- Ability specials local duration = ability:GetSpecialValueFor("duration") ----------------------- -- NORMAL CAST -- ----------------------- if not caster:HasModifier(modifier_mount) then -- Play cast sound EmitSoundOn(sound_cast, caster) -- Apply attack speed modifier caster:AddNewModifier(caster, ability, modifier_aspd, {duration = duration}) -- If used on ally, apply mount modifier if caster ~= target then ability:EndCooldown() local modifier = caster:AddNewModifier(caster, ability, modifier_mount, {duration = duration}) if modifier then modifier.target = target end end if caster:HasTalent("special_bonus_imba_clinkz_5") then if target == caster then local modifier_self_root = "modifier_imba_strafe_self_root" caster:AddNewModifier(caster, ability, modifier_self_root, {duration = duration}) end end ----------------------- -- DISMOUNT -- ----------------------- else -- Assign the time remaining to the ability and remove modifier local modifier_mount_handler = caster:FindModifierByName(modifier_mount) ability.time_remaining = modifier_mount_handler:GetRemainingTime() caster:RemoveModifierByName(modifier_mount) -- Renew cooldown so it would use the new time remaining variable ability:EndCooldown() ability:UseResources(false, false, true) end end end -- Attack speed modifier modifier_imba_strafe_aspd = class({}) function modifier_imba_strafe_aspd:OnCreated() self.caster = self:GetCaster() self.ability = self:GetAbility() self.modifier_mount = "modifier_imba_strafe_mount" self.as_bonus = self.ability:GetSpecialValueFor("as_bonus") self.bonus_attack_range = self.ability:GetSpecialValueFor("bonus_attack_range") end function modifier_imba_strafe_aspd:IsHidden() return false end function modifier_imba_strafe_aspd:IsPurgable() return true end function modifier_imba_strafe_aspd:IsDebuff() return false end function modifier_imba_strafe_aspd:GetEffectName() return "particles/units/heroes/hero_clinkz/clinkz_strafe_fire.vpcf" end function modifier_imba_strafe_aspd:GetEffectAttachType() return PATTACH_ABSORIGIN_FOLLOW end function modifier_imba_strafe_aspd:DeclareFunctions() local decFuncs = {MODIFIER_PROPERTY_ATTACKSPEED_BONUS_CONSTANT, MODIFIER_PROPERTY_ATTACK_RANGE_BONUS} return decFuncs end function modifier_imba_strafe_aspd:GetModifierAttackSpeedBonus_Constant() -- 7.01, grants 2x the bonus when mounted if self.caster:HasModifier(self.modifier_mount) then return self.as_bonus + self.as_bonus else return self.as_bonus end return nil end function modifier_imba_strafe_aspd:GetModifierAttackRangeBonus() -- 7.01, grants buff when not mounted, also 2x the bonus when mounted if self.caster:HasModifier(self.modifier_mount) then return self.bonus_attack_range + self.bonus_attack_range else -- 7.01, talent grants buff when not mounted, also 4x the bonus when casted on self if self.caster:HasModifier("modifier_imba_strafe_self_root") then return self.bonus_attack_range * self.caster:FindTalentValue("special_bonus_imba_clinkz_5") else return self.bonus_attack_range end end return nil end -- Mount modifier modifier_imba_strafe_mount = class({}) function modifier_imba_strafe_mount:OnCreated() if IsServer() then -- Ability properties self.caster = self:GetCaster() self.ability = self:GetAbility() -- Ability specials self.duration = self.ability:GetSpecialValueFor("duration") -- Wait a game tick so we can have the target assigned to this modifier Timers:CreateTimer(FrameTime(), function() -- Get mount location local direction = self.target:GetForwardVector() local collision_radius = self.caster:GetPaddedCollisionRadius() + self.target:GetPaddedCollisionRadius() + 80 local mount_point = self.target:GetAbsOrigin() + direction * (-1) * collision_radius -- Set Clinkz' location to it self.caster:SetAbsOrigin(mount_point) -- Start thinking self:StartIntervalThink(FrameTime()) end) end end function modifier_imba_strafe_mount:IsHidden() return false end function modifier_imba_strafe_mount:IsPurgable() return true end function modifier_imba_strafe_mount:IsDebuff() return false end function modifier_imba_strafe_mount:CheckState() local state = {[MODIFIER_STATE_ROOTED] = true, [MODIFIER_STATE_NO_UNIT_COLLISION] = true} return state end function modifier_imba_strafe_mount:OnIntervalThink() if IsServer() then -- Get new point local current_loc = self.caster:GetAbsOrigin() local direction = self.target:GetForwardVector() local collision_radius = self.caster:GetPaddedCollisionRadius() + self.target:GetPaddedCollisionRadius() + 80 local mount_point = self.target:GetAbsOrigin() + direction * (-1) * collision_radius local distance = (mount_point - current_loc):Length2D() -- If target died, kill modifier if not self.target:IsAlive() then self:Destroy() end -- If the target is invulnerable, kill modifier if self.target:IsInvulnerable() then self:Destroy() end if distance > 300 then -- Set Clinkz' location to it self.caster:SetAbsOrigin(mount_point) else -- Move Clinkz toward it direction = (mount_point - current_loc):Normalized() local target_movespeed = self.target:GetMoveSpeedModifier(self.target:GetBaseMoveSpeed()) local new_point = current_loc + direction * ((target_movespeed * 1.25) * FrameTime()) local ground_point = GetGroundPosition(new_point, self.caster) new_point.z = ground_point.z if distance > 25 then self.caster:SetAbsOrigin(new_point) end end end end function modifier_imba_strafe_mount:OnRemoved() if IsServer() then -- Start cooldown, reduce it by the duration of the skill if self.ability:IsCooldownReady() then self.ability.time_remaining = self:GetRemainingTime() self.ability:UseResources(false, false, true) end end end modifier_imba_strafe_self_root = class({}) function modifier_imba_strafe_self_root:IsHidden() return false end function modifier_imba_strafe_self_root:IsPurgable() return true end function modifier_imba_strafe_self_root:IsDebuff() return true end function modifier_imba_strafe_self_root:CheckState() local state = {[MODIFIER_STATE_ROOTED] = true} return state end ----------------------------- -- SEARING ARROWS -- ----------------------------- imba_clinkz_searing_arrows = class({}) LinkLuaModifier("modifier_imba_searing_arrows_passive", "hero/hero_clinkz", LUA_MODIFIER_MOTION_NONE) LinkLuaModifier("modifier_imba_searing_arrows_active", "hero/hero_clinkz", LUA_MODIFIER_MOTION_NONE) function imba_clinkz_searing_arrows:GetAbilityTextureName() return "clinkz_searing_arrows" end function imba_clinkz_searing_arrows:GetIntrinsicModifierName() return "modifier_imba_searing_arrows_passive" end function imba_clinkz_searing_arrows:GetCastRange(location, target) local caster = self:GetCaster() return caster:GetAttackRange() end function imba_clinkz_searing_arrows:IsHiddenWhenStolen() return false end function imba_clinkz_searing_arrows:OnUnStolen() -- Rubick interaction local caster = self:GetCaster() if caster:HasModifier("modifier_imba_searing_arrows_passive") then caster:RemoveModifierByName("modifier_imba_searing_arrows_passive") end end function imba_clinkz_searing_arrows:OnSpellStart() -- Ability properties local caster = self:GetCaster() local ability = self local target = self:GetCursorTarget() local particle_projectile = "particles/hero/clinkz/searing_flames_active/clinkz_searing_arrow.vpcf" local sound_cast = "Hero_Clinkz.SearingArrows" -- Ability specials local projectile_speed = ability:GetSpecialValueFor("projectile_speed") local vision_radius = ability:GetSpecialValueFor("vision_radius") -- Play attack sound EmitSoundOn(sound_cast, caster) -- Launch projectile on target local searing_arrow_active searing_arrow_active = { Target = target, Source = caster, Ability = ability, EffectName = particle_projectile, iMoveSpeed = projectile_speed, bDodgeable = true, bVisibleToEnemies = true, bReplaceExisting = false, bProvidesVision = true, iVisionRadius = vision_radius, iVisionTeamNumber = caster:GetTeamNumber() } ProjectileManager:CreateTrackingProjectile(searing_arrow_active) -- #4 Talent: Searing Arrow active hits in an AoE if caster:HasTalent("special_bonus_imba_clinkz_4") then local enemies = FindUnitsInRadius(caster:GetTeamNumber(), target:GetAbsOrigin(), nil, caster:FindTalentValue("special_bonus_imba_clinkz_4"), DOTA_UNIT_TARGET_TEAM_ENEMY, DOTA_UNIT_TARGET_HERO + DOTA_UNIT_TARGET_BASIC, DOTA_UNIT_TARGET_FLAG_FOW_VISIBLE + DOTA_UNIT_TARGET_FLAG_NO_INVIS, FIND_ANY_ORDER, false) -- Fire arrows at anyone that is not the main target for _,enemy in pairs(enemies) do if enemy ~= target then -- Launch projectile on enemy local searing_arrow_active_seconday searing_arrow_active_seconday = { Target = enemy, Source = caster, Ability = ability, EffectName = particle_projectile, iMoveSpeed = projectile_speed, bDodgeable = true, bVisibleToEnemies = true, bReplaceExisting = false, bProvidesVision = true, iVisionRadius = vision_radius, iVisionTeamNumber = caster:GetTeamNumber() } ProjectileManager:CreateTrackingProjectile(searing_arrow_active_seconday) end end end end function imba_clinkz_searing_arrows:OnProjectileHit(target, location) if IsServer() then -- Ability properties local caster = self:GetCaster() local ability = self local sound_hit = "Hero_Clinkz.SearingArrows.Impact" local modifier_active = "modifier_imba_searing_arrows_active" -- Ability specials local active_duration = ability:GetSpecialValueFor("active_duration") -- If target has Linken Sphere, block effect entirely if target:GetTeam() ~= caster:GetTeam() then if target:TriggerSpellAbsorb(ability) then return nil end end -- Play hit sound EmitSoundOn(sound_hit, target) -- Perform an attack on the target caster:PerformAttack(target, false, true, true, false, false, false, true) -- Apply the active debuff target:AddNewModifier(caster, ability, modifier_active, {duration = active_duration}) end end function imba_clinkz_searing_arrows:OnUpgrade() if IsServer() then local caster = self:GetCaster() caster:RemoveModifierByName("modifier_imba_searing_arrows_passive") caster:AddNewModifier(caster, self, "modifier_imba_searing_arrows_passive", {}) end end -- Passive Clinkz Searing Arrows modifier modifier_imba_searing_arrows_passive = class({}) function modifier_imba_searing_arrows_passive:OnCreated() -- Ability properties self.caster = self:GetCaster() self.ability = self:GetAbility() -- Ability specials self.bonus_damage = self.ability:GetSpecialValueFor("bonus_damage") end function modifier_imba_searing_arrows_passive:IsHidden() return true end function modifier_imba_searing_arrows_passive:IsPurgable() return false end function modifier_imba_searing_arrows_passive:IsDebuff() return false end function modifier_imba_searing_arrows_passive:DeclareFunctions() local decFuncs = {MODIFIER_EVENT_ON_ATTACK_START, MODIFIER_PROPERTY_BASEATTACK_BONUSDAMAGE} return decFuncs end function modifier_imba_searing_arrows_passive:OnAttackStart(keys) if IsServer() then local attacker = keys.attacker local target = keys.target -- If the ability is null, do nothing if self.ability:IsNull() then return nil end -- If the ability is stolen, do nothing if self.ability:IsStolen() then return nil end -- If the target is not a valid Searing Arrow target, do nothing if not target:IsHero() and not target:IsBuilding() and not target:IsCreep() then SetArrowAttackProjectile(self.caster, false) return nil end -- Only apply to the caster's attacks on enemy team if self.caster == attacker and self.caster:GetTeamNumber() ~= target:GetTeamNumber() then -- Change to correct projectile if self.caster:PassivesDisabled() then SetArrowAttackProjectile(self.caster, false) else SetArrowAttackProjectile(self.caster, true) if self.caster:HasTalent("special_bonus_imba_clinkz_7") then if RollPercentage(self.caster:FindTalentValue("special_bonus_imba_clinkz_7")) then self.caster:PerformAttack(target, false, true, true, false, true, false, false) end end end end end end function modifier_imba_searing_arrows_passive:GetModifierBaseAttack_BonusDamage() -- If the ability is null, do nothing if self.ability:IsNull() then return nil end -- Ignore if it is a stolen ability if self.ability:IsStolen() then return nil end if not self.caster:PassivesDisabled() then return self.bonus_damage -- + self.caster:FindTalentValue("special_bonus_imba_clinkz_3") end return nil end function SetArrowAttackProjectile(caster, searing_arrows) -- modifiers local skadi_modifier = "modifier_item_imba_skadi" local deso_modifier = "modifier_item_imba_desolator" local morbid_modifier = "modifier_imba_morbid_mask" local mom_modifier = "modifier_imba_mask_of_madness" local satanic_modifier = "modifier_imba_satanic" local vladimir_modifier = "modifier_item_imba_vladmir" local vladimir_2_modifier = "modifier_item_imba_vladmir_blood" -- normal projectiles local skadi_projectile = "particles/items2_fx/skadi_projectile.vpcf" local deso_projectile = "particles/items_fx/desolator_projectile.vpcf" local deso_skadi_projectile = "particles/item/desolator/desolator_skadi_projectile_2.vpcf" local lifesteal_projectile = "particles/item/lifesteal_mask/lifesteal_particle.vpcf" -- searing arrow projectiles local basic_arrow = "particles/units/heroes/hero_clinkz/clinkz_base_attack.vpcf" local searing_arrow = "particles/units/heroes/hero_clinkz/clinkz_searing_arrow.vpcf" local searing_lifesteal_projectile = "particles/hero/clinkz/searing_lifesteal/searing_lifesteal_arrow.vpcf" local searing_skadi_projectile = "particles/hero/clinkz/searing_skadi/searing_skadi_arrow.vpcf" local searing_deso_projectile = "particles/hero/clinkz/searing_desolator/searing_desolator_arrow.vpcf" local searing_deso_skadi_projectile = "particles/hero/clinkz/searing_skadi_desolator/searing_skadi_desolator_arrow.vpcf" local searing_lifesteal_skadi_projectile = "particles/hero/clinkz/searing_skadi_lifesteal/searing_skadi_steal_arrow.vpcf" local searing_lifesteal_deso_projectile = "particles/hero/clinkz/searing_deso_lifesteal/searing_deso_lifesteal.vpcf" local searing_lifesteal_deso_skadi_projectile = "particles/hero/clinkz/searing_skadi_deso_steal/searing_skadi_deso_steal_arrow.vpcf" -- Set variables local has_lifesteal local has_skadi local has_desolator -- Assign variables -- Lifesteal if caster:HasModifier(morbid_modifier) or caster:HasModifier(mom_modifier) or caster:HasModifier(satanic_modifier) or caster:HasModifier(vladimir_modifier) or caster:HasModifier(vladimir_2_modifier) then has_lifesteal = true end -- Skadi if caster:HasModifier(skadi_modifier) then has_skadi = true end -- Desolator if caster:HasModifier(deso_modifier) then has_desolator = true end -- ASSIGN PARTICLES -- searing attack if searing_arrows then -- Desolator + lifesteal + searing + skadi if has_desolator and has_skadi and has_lifesteal then caster:SetRangedProjectileName(searing_lifesteal_deso_skadi_projectile) return -- Desolator + lifesteal + searing elseif has_desolator and has_lifesteal then caster:SetRangedProjectileName(searing_lifesteal_deso_projectile) return -- Desolator + skadi + searing elseif has_skadi and has_desolator then caster:SetRangedProjectileName(searing_deso_skadi_projectile) return -- Lifesteal + skadi + searing elseif has_lifesteal and has_skadi then caster:SetRangedProjectileName(searing_lifesteal_skadi_projectile) return -- skadi + searing elseif has_skadi then caster:SetRangedProjectileName(searing_skadi_projectile) return -- lifesteal + searing elseif has_lifesteal then caster:SetRangedProjectileName(searing_lifesteal_projectile) return -- Desolator + searing elseif has_desolator then caster:SetRangedProjectileName(searing_deso_projectile) return -- searing else caster:SetRangedProjectileName(searing_arrow) return end else -- Non searing attack -- Skadi + desolator if has_skadi and has_desolator then caster:SetRangedProjectileName(deso_skadi_projectile) return -- Skadi elseif has_skadi then caster:SetRangedProjectileName(skadi_projectile) return -- Desolator elseif has_desolator then caster:SetRangedProjectileName(deso_projectile) return -- Lifesteal elseif has_lifesteal then caster:SetRangedProjectileName(lifesteal_projectile) return -- Basic arrow else caster:SetRangedProjectileName(basic_arrow) return end end end -- Active burning Searing Arrow modifier modifier_imba_searing_arrows_active = class({}) function modifier_imba_searing_arrows_active:IsHidden() return false end function modifier_imba_searing_arrows_active:IsPurgable() return true end function modifier_imba_searing_arrows_active:IsDebuff() return true end function modifier_imba_searing_arrows_active:OnCreated() -- Ability properties self.caster = self:GetCaster() self.ability = self:GetAbility() self.parent = self:GetParent() self.particle_flame = "particles/hero/clinkz/searing_flames_active/burn_effect.vpcf" -- Ability specials self.vision_radius = self.ability:GetSpecialValueFor("vision_radius") self.active_tick_interval = self.ability:GetSpecialValueFor("active_tick_interval") self.armor_burn_per_stack = self.ability:GetSpecialValueFor("armor_burn_per_stack") if IsServer() then -- Add and attach flaming particle self.particle_flame_fx = ParticleManager:CreateParticle(self.particle_flame, PATTACH_POINT_FOLLOW, self.parent) ParticleManager:SetParticleControlEnt(self.particle_flame_fx, 0, self.parent, PATTACH_POINT_FOLLOW, "attach_hitloc", self.parent:GetAbsOrigin(), true) self:AddParticle(self.particle_flame_fx, false, false, -1, false, false) -- Start revealing self:StartIntervalThink(FrameTime()) -- Strengthen the armor reduction by adding stacks once every second Timers:CreateTimer(self.active_tick_interval, function() if not self:IsNull() then self:IncrementStackCount() return self.active_tick_interval end return nil end) end end function modifier_imba_searing_arrows_active:OnIntervalThink() AddFOWViewer(self.caster:GetTeamNumber(), self.parent:GetAbsOrigin(), self.vision_radius, FrameTime(), false) end function modifier_imba_searing_arrows_active:DeclareFunctions() return { MODIFIER_PROPERTY_PHYSICAL_ARMOR_BONUS } end function modifier_imba_searing_arrows_active:GetModifierPhysicalArmorBonus() return self:GetStackCount() * self.armor_burn_per_stack * (-1) end ----------------------------- -- SKELETON WALK -- ----------------------------- imba_clinkz_skeleton_walk = class({}) LinkLuaModifier("modifier_imba_skeleton_walk_invis", "hero/hero_clinkz", LUA_MODIFIER_MOTION_NONE) LinkLuaModifier("modifier_imba_skeleton_walk_spook", "hero/hero_clinkz", LUA_MODIFIER_MOTION_NONE) LinkLuaModifier("modifier_imba_skeleton_walk_talent_root", "hero/hero_clinkz", LUA_MODIFIER_MOTION_NONE) LinkLuaModifier("modifier_imba_skeleton_walk_talent_ms", "hero/hero_clinkz", LUA_MODIFIER_MOTION_NONE) function imba_clinkz_skeleton_walk:GetAbilityTextureName() return "clinkz_wind_walk" end function imba_clinkz_skeleton_walk:IsHiddenWhenStolen() return false end function imba_clinkz_skeleton_walk:OnSpellStart() -- Ability properties local caster = self:GetCaster() local ability = self local particle_invis = "particles/units/heroes/hero_clinkz/clinkz_windwalk.vpcf" local sound_cast = "Hero_Clinkz.WindWalk" local modifier_invis = "modifier_imba_skeleton_walk_invis" local scepter = caster:HasScepter() local modifier_mount = "modifier_imba_strafe_mount" -- Ability specials local duration = ability:GetSpecialValueFor("duration") -- Play cast sound EmitSoundOn(sound_cast, caster) -- Add particle effect local particle_invis_fx = ParticleManager:CreateParticle(particle_invis, PATTACH_ABSORIGIN_FOLLOW, caster) ParticleManager:SetParticleControl(particle_invis_fx, 0, caster:GetAbsOrigin()) ParticleManager:SetParticleControl(particle_invis_fx, 1, caster:GetAbsOrigin()) -- Apply invisibilty modifier on self caster:AddNewModifier(caster, ability, modifier_invis, {duration = duration}) -- Scepter skeleton walk on mounted if scepter then if caster:HasModifier(modifier_mount) then local modifier_mount_handler = caster:FindModifierByName(modifier_mount) if modifier_mount_handler then local mounted_ally = modifier_mount_handler.target mounted_ally:AddNewModifier(caster, ability, modifier_invis, {duration = modifier_mount_handler:GetRemainingTime()}) end end end end -- Invisibility modifier modifier_imba_skeleton_walk_invis = class({}) function modifier_imba_skeleton_walk_invis:IsHidden() return false end function modifier_imba_skeleton_walk_invis:IsPurgable() return false end function modifier_imba_skeleton_walk_invis:IsDebuff() return false end function modifier_imba_skeleton_walk_invis:OnCreated() -- Ability properties self.caster = self:GetCaster() self.ability = self:GetAbility() self.parent = self:GetParent() self.sound_cast = "Hero_Clinkz.WindWalk" self.modifier_spook = "modifier_imba_skeleton_walk_spook" self.modifier_talent_ms = "modifier_imba_skeleton_walk_talent_ms" self.modifier_mount = "modifier_imba_strafe_mount" -- Ability specials self.ms_bonus_pct = self.ability:GetSpecialValueFor("ms_bonus_pct") self.spook_radius = self.ability:GetSpecialValueFor("spook_radius") self.base_spook_duration = self.ability:GetSpecialValueFor("base_spook_duration") self.spook_distance_inc = self.ability:GetSpecialValueFor("spook_distance_inc") self.spook_added_duration = self.ability:GetSpecialValueFor("spook_added_duration") -- Talent: Increases Clinkz Skeleton Walk movement speed if no enemies are nearby. if IsServer() then self:StartIntervalThink(0.2) end end function modifier_imba_skeleton_walk_invis:OnIntervalThink() if IsServer() then -- If it is someone else from the caster (agh effect) then -- Check if the caster still has the Mounted buff. Remove it if he doesn't. if self.parent ~= self.caster then if not self.caster:HasModifier(self.modifier_mount) then self:Destroy() end end -- Talent: Increases Clinkz Skeleton Walk movement speed if no enemies are nearby. local enemies = FindUnitsInRadius(self.caster:GetTeamNumber(), self.caster:GetAbsOrigin(), nil, self.spook_radius, DOTA_UNIT_TARGET_TEAM_ENEMY, DOTA_UNIT_TARGET_HERO + DOTA_UNIT_TARGET_BASIC + DOTA_UNIT_TARGET_BUILDING, DOTA_UNIT_TARGET_FLAG_NONE, FIND_ANY_ORDER, false) if self.caster:HasTalent("special_bonus_imba_clinkz_2") then if #enemies > 0 then self:SetStackCount(self.caster:FindTalentValue("special_bonus_imba_clinkz_2")) else self:SetStackCount(0) end end -- Talent: If Clinkz passed through an enemy, root him and Clinkz loses Invisibility. if self.caster:HasTalent("special_bonus_imba_clinkz_3") then local enemy_heroes = FindUnitsInRadius(self.parent:GetTeamNumber(), self.parent:GetAbsOrigin(), nil, 128, DOTA_UNIT_TARGET_TEAM_ENEMY, DOTA_UNIT_TARGET_HERO, DOTA_UNIT_TARGET_FLAG_NONE, FIND_CLOSEST, false) for _,enemy in pairs(enemy_heroes) do -- Stop at the first valid enemy that isn't magic immune if not enemy:IsMagicImmune() then enemy:AddNewModifier(self.caster, self.ability, "modifier_imba_skeleton_walk_talent_root", {duration = self.caster:FindTalentValue("special_bonus_imba_clinkz_3")}) -- If an enemy was rooted successfully, remove Clinkz's invisibility if enemy:HasModifier("modifier_imba_skeleton_walk_talent_root") then self:Destroy() end -- Stop the cycle! break end end end end end function modifier_imba_skeleton_walk_invis:CheckState() local state = {[MODIFIER_STATE_NO_UNIT_COLLISION] = true, [MODIFIER_STATE_INVISIBLE] = true} return state end function modifier_imba_skeleton_walk_invis:GetPriority() return MODIFIER_PRIORITY_NORMAL end function modifier_imba_skeleton_walk_invis:DeclareFunctions() local decFuncs = {MODIFIER_PROPERTY_MOVESPEED_BONUS_PERCENTAGE, MODIFIER_PROPERTY_MOVESPEED_MAX, MODIFIER_PROPERTY_INVISIBILITY_LEVEL, MODIFIER_EVENT_ON_ABILITY_EXECUTED, MODIFIER_EVENT_ON_ATTACK} return decFuncs end function modifier_imba_skeleton_walk_invis:GetModifierMoveSpeed_Max() if self:GetStackCount() > 0 then return 700 end end function modifier_imba_skeleton_walk_invis:GetModifierInvisibilityLevel() return 1 end function modifier_imba_skeleton_walk_invis:GetModifierMoveSpeedBonus_Percentage() return self.ms_bonus_pct + self:GetStackCount() end function modifier_imba_skeleton_walk_invis:OnAbilityExecuted(keys) if IsServer() then local caster = keys.unit -- Only apply when Clinkz was the one who activated an ability if self.parent == caster then local enemy = FindUnitsInRadius(self.parent:GetTeamNumber(), self.parent:GetAbsOrigin(), nil, 1000, DOTA_UNIT_TARGET_TEAM_ENEMY, DOTA_UNIT_TARGET_HERO + DOTA_UNIT_TARGET_BASIC, DOTA_UNIT_TARGET_FLAG_NOT_ANCIENTS, FIND_CLOSEST, false) -- Check if Clinkz is visible to the enemy when appearing if enemy[1] and enemy[1]:CanEntityBeSeenByMyTeam(self.parent) then self.detected = true end -- Remove the invisibilty self:Destroy() end end end function modifier_imba_skeleton_walk_invis:OnAttack(keys) if IsServer() then local attacker = keys.attacker -- Only apply when Clinkz was the one attacking anything if self.parent == attacker then -- Find nearby closest enemy local enemy = FindUnitsInRadius(self.parent:GetTeamNumber(), self.parent:GetAbsOrigin(), nil, 1000, DOTA_UNIT_TARGET_TEAM_ENEMY, DOTA_UNIT_TARGET_HERO + DOTA_UNIT_TARGET_BASIC, DOTA_UNIT_TARGET_FLAG_NOT_ANCIENTS, FIND_CLOSEST, false) -- Check if Clinkz is visible to the enemy when appearing if enemy[1] and enemy[1]:CanEntityBeSeenByMyTeam(self.parent) then self.detected = true end -- Remove invisibility self:Destroy() end end end function modifier_imba_skeleton_walk_invis:OnRemoved() if IsServer() then -- #6 Talent: Skeleton Walk move speed persists for a small period if self.caster:HasTalent("special_bonus_imba_clinkz_6") then self.parent:AddNewModifier(self.caster, self.ability, self.modifier_talent_ms, {duration = self.caster:FindTalentValue("special_bonus_imba_clinkz_6")}) end -- Only apply if Clinkz wasn't detected before removing modifier if self.detected then return nil end -- If Clinkz died, when it was removed, do nothing if not self.caster:IsAlive() then return nil end -- Play cast sound, yes, again EmitSoundOn(self.sound_cast, self.parent) -- Find nearby enemies local enemies = FindUnitsInRadius(self.parent:GetTeamNumber(), self.parent:GetAbsOrigin(), nil, self.spook_radius, DOTA_UNIT_TARGET_TEAM_ENEMY, DOTA_UNIT_TARGET_HERO, DOTA_UNIT_TARGET_FLAG_NOT_ANCIENTS, FIND_ANY_ORDER, false) for _,enemy in pairs(enemies) do -- Only apply on non-magic immune enemies if not enemy:IsMagicImmune() then -- Calculate distance to each enemy local distance = (enemy:GetAbsOrigin() - self.parent:GetAbsOrigin()):Length2D() -- Calculate spook duration local spook_duration = self.base_spook_duration + (((self.spook_radius - distance) / self.spook_distance_inc) * self.spook_added_duration) -- Apply spook for the duration enemy:AddNewModifier(self.parent, self.ability, self.modifier_spook, {duration = spook_duration}) end end -- Are we feeling extra spooky today? Did we actually spooky anyone? local spook_likelihood = 10 if #enemies > 0 and RollPercentage(spook_likelihood) then -- sPo0kY sCaRy sKeLeToNs EmitSoundOn("Imba.ClinkzSpooky", self.parent) end end end -- Spook modifier modifier_imba_skeleton_walk_spook = class({}) function modifier_imba_skeleton_walk_spook:IsHidden() return false end function modifier_imba_skeleton_walk_spook:IsPurgable() return true end function modifier_imba_skeleton_walk_spook:IsDebuff() return true end function modifier_imba_skeleton_walk_spook:OnCreated() if IsServer() then -- Ability properties self.caster = self:GetCaster() self.ability = self:GetAbility() self.parent = self:GetParent() self.particle_spook = "particles/hero/clinkz/spooked/spooky_skull.vpcf" -- Add particle self.particle_spook_fx = ParticleManager:CreateParticle(self.particle_spook, PATTACH_OVERHEAD_FOLLOW, self.parent) ParticleManager:SetParticleControl(self.particle_spook_fx, 0, self.parent:GetAbsOrigin()) ParticleManager:SetParticleControl(self.particle_spook_fx, 3, self.parent:GetAbsOrigin()) self:AddParticle(self.particle_spook_fx, false, false, -1, false, true) self.reacting = true -- Determine location to force move to local direction = (self.parent:GetAbsOrigin() - self.caster:GetAbsOrigin()):Normalized() local location = self.parent:GetAbsOrigin() + direction * 500 local newOrder = {UnitIndex = self.parent:entindex(), OrderType = DOTA_UNIT_ORDER_MOVE_TO_POSITION, Position = location} ExecuteOrderFromTable(newOrder) self.reacting = false self.qangle_angle = 0 -- RUN FROM CLINKZ! self:StartIntervalThink(0.1) end end function modifier_imba_skeleton_walk_spook:OnIntervalThink() -- Determine a random direction to force move to local qangle = QAngle(0, self.qangle_angle, 0) self.qangle_angle = self.qangle_angle + 30 if self.qangle_angle >= 360 then self.qangle_angle = 0 end local direction = (self.parent:GetAbsOrigin() - self.caster:GetAbsOrigin()):Normalized() local location = self.parent:GetAbsOrigin() + direction * 500 local final_location = RotatePosition(self.parent:GetAbsOrigin(), qangle, location) self.parent:MoveToPosition(final_location) end function modifier_imba_skeleton_walk_spook:OnDestroy() if IsServer() then self.parent:Stop() end end function modifier_imba_skeleton_walk_spook:CheckState() if not self.reacting then local state = {[MODIFIER_STATE_COMMAND_RESTRICTED] = true} return state end return nil end modifier_imba_skeleton_walk_talent_root = class({}) function modifier_imba_skeleton_walk_talent_root:IsHidden() return false end function modifier_imba_skeleton_walk_talent_root:IsPurgable() return true end function modifier_imba_skeleton_walk_talent_root:IsDebuff() return true end function modifier_imba_skeleton_walk_talent_root:CheckState() local state = {[MODIFIER_STATE_ROOTED] = true} return state end -- Move speed modifier for #6 Talent modifier_imba_skeleton_walk_talent_ms = class({}) function modifier_imba_skeleton_walk_talent_ms:IsHidden() return false end function modifier_imba_skeleton_walk_talent_ms:IsPurgable() return true end function modifier_imba_skeleton_walk_talent_ms:IsDebuff() return false end function modifier_imba_skeleton_walk_talent_ms:OnCreated() self.caster = self:GetCaster() self.ability = self:GetAbility() self.ms_bonus_pct = self.ability:GetSpecialValueFor("ms_bonus_pct") -- FUUUUUUSION Talent: Increases Clinkz Skeleton Walk movement speed if no enemies are nearby. + Talent 6 if IsServer() then self:StartIntervalThink(0.1) end end function modifier_imba_skeleton_walk_talent_ms:OnIntervalThink() if IsServer() then if self.caster:HasTalent("special_bonus_imba_clinkz_2") then self.spook_radius = self.ability:GetSpecialValueFor("spook_radius") local enemies = FindUnitsInRadius(self.caster:GetTeamNumber(), self.caster:GetAbsOrigin(), nil, self.spook_radius, DOTA_UNIT_TARGET_TEAM_ENEMY, DOTA_UNIT_TARGET_HERO + DOTA_UNIT_TARGET_BASIC + DOTA_UNIT_TARGET_BUILDING, DOTA_UNIT_TARGET_FLAG_NONE, FIND_ANY_ORDER, false) if #enemies > 0 then self.ms_bonus_pct = self.ability:GetSpecialValueFor("ms_bonus_pct") + self.caster:FindTalentValue("special_bonus_imba_clinkz_2") else self.ms_bonus_pct = self.ability:GetSpecialValueFor("ms_bonus_pct") end end end end function modifier_imba_skeleton_walk_talent_ms:DeclareFunctions() local decFuncs = {MODIFIER_PROPERTY_MOVESPEED_BONUS_PERCENTAGE} return decFuncs end function modifier_imba_skeleton_walk_talent_ms:GetModifierMoveSpeedBonus_Percentage() return self.ms_bonus_pct end ----------------------------- -- DEATH PACT -- ----------------------------- imba_clinkz_death_pact = class({}) LinkLuaModifier("modifier_imba_death_pact_buff", "hero/hero_clinkz", LUA_MODIFIER_MOTION_NONE) LinkLuaModifier("modifier_imba_death_pact_stack_creep", "hero/hero_clinkz", LUA_MODIFIER_MOTION_NONE) LinkLuaModifier("modifier_imba_death_pact_stack_hero", "hero/hero_clinkz", LUA_MODIFIER_MOTION_NONE) LinkLuaModifier("modifier_imba_death_pact_talent_debuff", "hero/hero_clinkz", LUA_MODIFIER_MOTION_NONE) LinkLuaModifier("modifier_imba_death_pact_talent_buff", "hero/hero_clinkz", LUA_MODIFIER_MOTION_NONE) LinkLuaModifier("modifier_imba_death_pact_hero_debuff", "hero/hero_clinkz", LUA_MODIFIER_MOTION_NONE) LinkLuaModifier("modifier_imba_death_pact_spirit_aura", "hero/hero_clinkz", LUA_MODIFIER_MOTION_NONE) LinkLuaModifier("modifier_imba_death_pact_spirit_attack_range", "hero/hero_clinkz", LUA_MODIFIER_MOTION_NONE) LinkLuaModifier("modifier_imba_death_pact_bonus_spirited", "hero/hero_clinkz", LUA_MODIFIER_MOTION_NONE) function imba_clinkz_death_pact:GetAbilityTextureName() return "clinkz_death_pact" end function imba_clinkz_death_pact:CastFilterResultTarget(target) if IsServer() then local caster = self:GetCaster() -- Can't target self if caster == target then return UF_FAIL_CUSTOM end if target:GetUnitName() == "npc_imba_clinkz_spirits" then return UF_FAIL_CUSTOM end if target:IsConsideredHero() and not target:IsHero() then return UF_FAIL_CONSIDERED_HERO end local nResult = UnitFilter( target, self:GetAbilityTargetTeam(), self:GetAbilityTargetType(), self:GetAbilityTargetFlags(), self:GetCaster():GetTeamNumber() ) return nResult end end function imba_clinkz_death_pact:GetCustomCastErrorTarget(target) if IsServer() then local caster = self:GetCaster() -- Can't target self if caster == target then return "dota_hud_error_cant_cast_on_self" end if target:GetUnitName() == "npc_imba_clinkz_spirits" then return "#dota_hud_error_cant_cast_on_spirits" end end end function imba_clinkz_death_pact:IsHiddenWhenStolen() return false end function imba_clinkz_death_pact:OnSpellStart() -- Ability properties local caster = self:GetCaster() local ability = self local target = self:GetCursorTarget() local cast_response = "clinkz_clinkz_ability_pact_0"..math.random(1, 6) local sound_cast = "Hero_Clinkz.DeathPact.Cast" local particle_pact = "particles/units/heroes/hero_clinkz/clinkz_death_pact.vpcf" local modifier_pact = "modifier_imba_death_pact_buff" local modifier_stack_creep = "modifier_imba_death_pact_stack_creep" local modifier_bonus_spirited = "modifier_imba_death_pact_bonus_spirited" local modifier_stack_hero = "modifier_imba_death_pact_stack_hero" local modifier_stack_hero_spirited = "modifier_imba_death_pact_stack_hero_spirited" local modifier_spirited_aura = "modifier_imba_death_pact_spirit_aura" local modifier_debuff_mark = "modifier_imba_death_pact_hero_debuff" local modifier_talent_debuff_mark = "modifier_imba_death_pact_talent_debuff" -- Ability specials local duration = ability:GetSpecialValueFor("duration") local hero_current_hp_damage_pct = ability:GetSpecialValueFor("hero_current_hp_damage_pct") -- If target has Linken's Sphere off cooldown, do nothing if target:GetTeam() ~= caster:GetTeam() then if target:TriggerSpellAbsorb(ability) then return nil end end -- Roll for cast response if RollPercentage(50) and caster:IsHero() then EmitSoundOn(cast_response, caster) end -- Play cast sound EmitSoundOn(sound_cast, caster) -- Add particle effect local particle_pact_fx = ParticleManager:CreateParticle(particle_pact, PATTACH_ABSORIGIN_FOLLOW, caster) ParticleManager:SetParticleControl(particle_pact_fx, 0, target:GetAbsOrigin()) ParticleManager:SetParticleControl(particle_pact_fx, 1, target:GetAbsOrigin()) ParticleManager:SetParticleControl(particle_pact_fx, 5, target:GetAbsOrigin()) -- Remove existing modifiers so new values would replace the old ones if caster:HasModifier(modifier_pact) then caster:RemoveModifierByName(modifier_pact) caster:RemoveModifierByName(modifier_stack_creep) caster:RemoveModifierByName(modifier_stack_hero) end -- Variables local pact_stacks local modifier_stacks local Clinkz_team = caster:GetTeamNumber() local target_team = target:GetTeamNumber() -- Check if it is a hero or a creep if target:IsHero() then -- Calculate damage based on current HP local current_hp = target:GetHealth() local damage = current_hp * (hero_current_hp_damage_pct * 0.01) -- Deal pure damage local damageTable = { victim = target, DAMAGE_TYPE_COMPOSITE = damage, damage_type = DAMAGE_TYPE_PURE, attacker = caster, ability = ability } ApplyDamage(damageTable) -- Assign stacks variables pact_stacks = damage modifier_stacks = caster:AddNewModifier(caster, ability, modifier_stack_hero, {duration = duration}) -- Set the 7.01 Contract if target_team == Clinkz_team or target:HasModifier("modifier_imba_reincarnation_wraith_form") then else target:AddNewModifier(caster, ability, modifier_debuff_mark, {duration = duration}) end else -- Get creeps' current HP local current_hp = target:GetHealth() -- Remove the buff first, or else interactions will cause a bug on the hero gaining his bonuses. caster:RemoveModifierByName(modifier_bonus_spirited) -- Kill any spirits that already pay their taxes, if any. local spirits_to_kill = FindUnitsInRadius(caster:GetTeamNumber(), caster:GetAbsOrigin(), nil, 500, DOTA_UNIT_TARGET_TEAM_FRIENDLY, DOTA_UNIT_TARGET_BASIC, DOTA_UNIT_TARGET_FLAG_NONE, FIND_ANY_ORDER, false) for _,unit in pairs(spirits_to_kill) do if unit:FindModifierByNameAndCaster(modifier_spirited_aura,caster) then unit:Kill(ability, caster) end end -- Summons a spirit. Wooooooooooooooooo~ :) local spirit_model = target:GetModelName() local spirit_scale = target:GetModelScale() local direction = (target:GetAbsOrigin() - caster:GetAbsOrigin()):Normalized() local distance = (target:GetAbsOrigin() - caster:GetAbsOrigin()):Length2D() local summon_point = caster:GetAbsOrigin() + direction * distance - 100 local spirit = CreateUnitByName("npc_imba_clinkz_spirits", summon_point, true, caster, caster, caster:GetTeamNumber()) -- Set the owner of the wraith as the caster spirit:SetOwner(caster) -- TURN THE TARGETS INTO SPIRITZ!! spirit:SetOriginalModel(spirit_model) spirit:SetModelScale(spirit_scale) spirit:SetRenderColor(12, 55, 74) -- Set the Wraith to die after a small duration spirit:AddNewModifier(caster, ability, "modifier_kill", {duration = duration}) spirit:AddNewModifier(caster, ability, modifier_spirited_aura, {duration = duration}) -- Add Spirit's Attack Damage local modifier_spirit_attack_range_bonus = "modifier_imba_death_pact_spirit_attack_range" spirit:AddNewModifier(caster, ability, modifier_spirit_attack_range_bonus, {duration = duration}) -- ALL YOUR STATS ARE BELONG TO CLINKZ caster:AddNewModifier(target, ability, modifier_bonus_spirited, {duration = duration}) ResolveNPCPositions(target:GetAbsOrigin(), 164) -- Kill the target. target:Kill(ability, caster) -- Assign stacks variables pact_stacks = current_hp modifier_stacks = caster:AddNewModifier(caster, ability, modifier_stack_creep, {duration = duration}) end -- If the caster is a nether ward, disable all the bonus. if not caster:IsHero() then return nil end -- Add visible modifier to the caster caster:AddNewModifier(caster, ability, modifier_pact, {duration = duration}) -- Assign stack counts to the stack modifier if modifier_stacks then modifier_stacks:SetStackCount(pact_stacks) end -- Force recalculation of stats (to recalculate HP) caster:CalculateStatBonus() -- #8 Talent: Death Pact bonuses stay permanently if enemy target dies quickly -- Apply a marker on the target if caster has the talent if caster:HasTalent("special_bonus_imba_clinkz_8") and caster:GetTeamNumber() ~= target:GetTeamNumber() then local mark_duration = caster:FindTalentValue("special_bonus_imba_clinkz_8", "mark_duration") target:AddNewModifier(caster, ability, modifier_talent_debuff_mark, {duration = mark_duration}) end end -- Dummy Death Pact buff (shows in the UI, but actually does nothing) modifier_imba_death_pact_buff = class({}) function modifier_imba_death_pact_buff:IsHidden() return false end function modifier_imba_death_pact_buff:IsPurgable() return false end function modifier_imba_death_pact_buff:IsDebuff() return false end -- Hidden buff for counting stacks (gives bonus damage and HP depending on stacks) modifier_imba_death_pact_stack_creep = class({}) function modifier_imba_death_pact_stack_creep:IsHidden() return true end function modifier_imba_death_pact_stack_creep:IsPurgable() return false end function modifier_imba_death_pact_stack_creep:IsDebuff() return false end function modifier_imba_death_pact_stack_creep:OnCreated() -- Ability properties self.caster = self:GetCaster() self.ability = self:GetAbility() self.particle_pact_buff = "particles/units/heroes/hero_clinkz/clinkz_death_pact_buff.vpcf" -- Ability specials self.creep_bonus_hp_pct = self.ability:GetSpecialValueFor("creep_bonus_hp_pct") self.creep_bonus_dmg_pct = self.ability:GetSpecialValueFor("creep_bonus_dmg_pct") -- Add buff effect self.particle_pact_buff_fx = ParticleManager:CreateParticle(self.particle_pact_buff, PATTACH_POINT_FOLLOW, self.caster) ParticleManager:SetParticleControlEnt(self.particle_pact_buff_fx, 0, self.caster, PATTACH_POINT_FOLLOW, "attach_hitloc", self.caster:GetAbsOrigin(), true) ParticleManager:SetParticleControl(self.particle_pact_buff_fx, 2, self.caster:GetAbsOrigin()) ParticleManager:SetParticleControl(self.particle_pact_buff_fx, 8, Vector(1,0,0)) self:AddParticle(self.particle_pact_buff_fx, false, false, -1, false, false) if IsServer() then Timers:CreateTimer(FrameTime(), function() local stacks = self:GetStackCount() self.caster:Heal(self.creep_bonus_hp_pct * 0.01 * stacks, self.caster) end) end end function modifier_imba_death_pact_stack_creep:DeclareFunctions() local decFuncs = {MODIFIER_PROPERTY_BASEATTACK_BONUSDAMAGE, MODIFIER_PROPERTY_EXTRA_HEALTH_BONUS} return decFuncs end function modifier_imba_death_pact_stack_creep:GetModifierBaseAttack_BonusDamage() local stacks = self:GetStackCount() local bonus_damage = self.creep_bonus_dmg_pct * 0.01 * stacks return bonus_damage end function modifier_imba_death_pact_stack_creep:GetModifierExtraHealthBonus() local stacks = self:GetStackCount() local bonus_hp = self.creep_bonus_hp_pct * 0.01 * stacks return bonus_hp end -- Creeps killed are turned into spirits modifier_imba_death_pact_spirit_aura = class({}) LinkLuaModifier("modifier_imba_death_pact_spirit_aura_invis", "hero/hero_clinkz", LUA_MODIFIER_MOTION_NONE) function modifier_imba_death_pact_spirit_aura:IsHidden() return true end function modifier_imba_death_pact_spirit_aura:IsPurgable() return false end function modifier_imba_death_pact_spirit_aura:IsDebuff() return false end function modifier_imba_death_pact_spirit_aura:OnCreated() if IsServer() then self.caster = self:GetCaster() -- Tax Collector self.ability = self:GetAbility() self.parent = self:GetParent() -- Taxed Spirits -- Ability Specials local modifier_bonus_spirited = "modifier_imba_death_pact_bonus_spirited" local duration = self.ability:GetSpecialValueFor("duration") -- YOU SHALL NOT ATTKCK! self.parent:SetAttackCapability(DOTA_UNIT_CAP_NO_ATTACK) -- Wait a game tick so we can have the target assigned to this modifier Timers:CreateTimer(FrameTime(), function() -- Get mount location local direction = self.caster:GetForwardVector() local collision_radius = self.caster:GetPaddedCollisionRadius() + self.parent:GetPaddedCollisionRadius() + 80 local mount_point = self.caster:GetAbsOrigin() + direction * (-1) * collision_radius -- Set the Sp0000000ky spirit behind Clinkz! self.parent:SetAbsOrigin(mount_point) -- Add particle effect local particle_pact = "particles/units/heroes/hero_clinkz/clinkz_death_pact.vpcf" local particle_pact_fx = ParticleManager:CreateParticle(particle_pact, PATTACH_ABSORIGIN_FOLLOW, self.parent) ParticleManager:SetParticleControl(particle_pact_fx, 0, self.parent:GetAbsOrigin()) ParticleManager:SetParticleControl(particle_pact_fx, 1, self.parent:GetAbsOrigin()) ParticleManager:SetParticleControl(particle_pact_fx, 5, self.parent:GetAbsOrigin()) -- HEY TAX COLLECTOR, YOU THERE? self:StartIntervalThink(FrameTime()) end) end end function modifier_imba_death_pact_spirit_aura:OnIntervalThink(keys) if IsServer() then -- Clinkz Spirit Talent bonus, wait a game tick so that it doesn't interact with the original bonus Clinkz gain. if self.caster:HasTalent("special_bonus_imba_clinkz_1") then self.parent:SetAttackCapability(DOTA_UNIT_CAP_RANGED_ATTACK) end local modifier_spirit_invis = "modifier_imba_death_pact_spirit_aura_invis" -- IT'S NOT FAIR IF YOU'RE INVISIBLE WHILE I'M NOT! if self.caster:IsImbaInvisible() then self.parent:AddNewModifier(self.caster, self.ability, modifier_spirit_invis, {}) else self.parent:RemoveModifierByName(modifier_spirit_invis) end -- Get new point local current_loc = self.parent:GetAbsOrigin() local direction = self.caster:GetForwardVector() local collision_radius = self.caster:GetPaddedCollisionRadius() + self.parent:GetPaddedCollisionRadius() + 80 local mount_point = self.caster:GetAbsOrigin() + direction * (-1) * collision_radius local distance = (mount_point - current_loc):Length2D() -- If Clinkz died, kill the tax payer if not self.caster:IsAlive() then self.parent:Kill(self.ability, self.caster) end -- Set the distance behind Clinkz. TAX PAYER, YOU MUST NOT ESCAPE -- F A C E Y O U R M A S T E R self.parent:SetForwardVector(direction) if distance > 300 then -- Set it to Clinkz' location self.parent:SetAbsOrigin(mount_point) else direction = (mount_point - current_loc):Normalized() local Clinkz_move_speed = self.caster:GetMoveSpeedModifier(self.caster:GetBaseMoveSpeed()) local new_point = current_loc + direction * ((Clinkz_move_speed * 1.25) * FrameTime()) local ground_point = GetGroundPosition(new_point, self.parent) new_point.z = ground_point.z if distance > 25 then self.parent:SetAbsOrigin(new_point) end end end end -- Clinkz Ult is Nether Ward confirmed. function modifier_imba_death_pact_spirit_aura:DeclareFunctions() local decFuncs = {MODIFIER_PROPERTY_INCOMING_DAMAGE_PERCENTAGE, MODIFIER_PROPERTY_DISABLE_HEALING, MODIFIER_EVENT_ON_ATTACK_LANDED} return decFuncs end function modifier_imba_death_pact_spirit_aura:GetModifierIncomingDamage_Percentage() return -100 end function modifier_imba_death_pact_spirit_aura:GetDisableHealing() return 1 end function modifier_imba_death_pact_spirit_aura:OnAttackLanded(keys) local target = keys.target local attacker = keys.attacker local modifier_spirited_aura = "modifier_imba_death_pact_spirit_aura" if target == self.parent then -- If the attacker is not a creep, deal damage. if attacker:IsHero() or attacker:IsTower() or IsRoshan(attacker) then -- If the damage is enough to kill the spirit, destroy it if self.parent:GetHealth() <= 1 then self.parent:Kill(self.ability, attacker) -- Else, reduce its HP else self.parent:SetHealth(self.parent:GetHealth() - 1) end else return nil end end end function modifier_imba_death_pact_spirit_aura:OnRemoved() if IsServer() then -- When the Spirit dies, remove Clinkz the bonuses self.parent:SetOriginalModel("models/creeps/neutral_creeps/n_creep_ghost_b/n_creep_ghost_frost.vmdl") self.caster:RemoveModifierByName("modifier_imba_death_pact_bonus_spirited") end end function modifier_imba_death_pact_spirit_aura:CheckState() local state = {[MODIFIER_STATE_ROOTED] = true, [MODIFIER_STATE_NO_UNIT_COLLISION] = true, [MODIFIER_STATE_EVADE_DISABLED] = true, [MODIFIER_STATE_PASSIVES_DISABLED] = true, [MODIFIER_STATE_COMMAND_RESTRICTED] = true} return state end -- Use Wraith King's "Ghostly" particles to indicate ghostly effect, as there are no ghostly fx ongoing. I expect this to be the hardest part. Boi, was I wrong. :D function modifier_imba_death_pact_spirit_aura:GetStatusEffectName() return "particles/status_fx/status_effect_wraithking_ghosts.vpcf" end -- If Clinkz is invisible, the spirit must also be invisible, or else IT'S A DISASTAH! modifier_imba_death_pact_spirit_aura_invis = class({}) function modifier_imba_death_pact_spirit_aura_invis:IsHidden() return false end function modifier_imba_death_pact_spirit_aura_invis:IsPurgable() return false end function modifier_imba_death_pact_spirit_aura_invis:IsDebuff() return false end function modifier_imba_death_pact_spirit_aura_invis:DeclareFunctions() local decFuncs = {MODIFIER_PROPERTY_INVISIBILITY_LEVEL} return decFuncs end function modifier_imba_death_pact_spirit_aura_invis:CheckState() local state = {[MODIFIER_STATE_INVISIBLE] = true} return state end function modifier_imba_death_pact_spirit_aura_invis:GetModifierInvisibilityLevel() return 1 end -- Adding Clinkz Attack Range and damage to the Spirit..... SP00KY! modifier_imba_death_pact_spirit_attack_range = class({}) function modifier_imba_death_pact_spirit_attack_range:IsHidden() return false end function modifier_imba_death_pact_spirit_attack_range:IsPurgable() return false end function modifier_imba_death_pact_spirit_attack_range:IsDebuff() return false end function modifier_imba_death_pact_spirit_attack_range:OnCreated() -- Ability properties if IsServer() then self.caster = self:GetCaster() self.ability = self:GetAbility() self.parent = self:GetParent() self.spirit_attack_range = self.caster:GetAttackRange() self.spirit_damage = self.caster:GetAttackDamage() -- GetBaseDamageMax self:StartIntervalThink(1) end end function modifier_imba_death_pact_spirit_attack_range:OnIntervalThink() if IsServer() then self.spirit_attack_range = self.caster:GetAttackRange() end end function modifier_imba_death_pact_spirit_attack_range:DeclareFunctions() local decFuncs = {MODIFIER_PROPERTY_ATTACK_RANGE_BONUS, MODIFIER_PROPERTY_BASEATTACK_BONUSDAMAGE} return decFuncs end function modifier_imba_death_pact_spirit_attack_range:GetModifierAttackRangeBonus() return self.spirit_attack_range end function modifier_imba_death_pact_spirit_attack_range:GetModifierBaseAttack_BonusDamage() return self.spirit_damage end -- Buff from "spirits"... modifier_imba_death_pact_bonus_spirited = class({}) function modifier_imba_death_pact_bonus_spirited:IsHidden() return false end function modifier_imba_death_pact_bonus_spirited:IsPurgable() return false end function modifier_imba_death_pact_bonus_spirited:IsDebuff() return false end function modifier_imba_death_pact_bonus_spirited:OnCreated() -- Ability properties self.caster = self:GetCaster() self.ability = self:GetAbility() self.parent = self:GetParent() if IsServer() then -- Need to set as stack count since you cannot access it clientside for some weird reason self.spirit_damage = self.caster:GetAttackDamage() -- GetBaseDamageMax self:SetStackCount(self.spirit_damage) end self.spirit_armor = self.caster:GetPhysicalArmorValue() end -- Check if there's any tax to collect. function modifier_imba_death_pact_bonus_spirited:DeclareFunctions() -- 2 BONUS DAMAGE BUFF INSTANCES WTF WHAT ARE YOU DEVS THINKING!? XD - IamInnocentX3 local decFuncs = {MODIFIER_EVENT_ON_ATTACK_START, MODIFIER_PROPERTY_BASEATTACK_BONUSDAMAGE, MODIFIER_PROPERTY_PHYSICAL_ARMOR_BONUS} return decFuncs end function modifier_imba_death_pact_bonus_spirited:GetModifierBaseAttack_BonusDamage() return self:GetStackCount() end function modifier_imba_death_pact_bonus_spirited:GetModifierPhysicalArmorBonus() return self.spirit_armor end -- Setting the attack target for the spirit. function modifier_imba_death_pact_bonus_spirited:OnAttackStart(keys) if IsServer() then local attacker = keys.attacker if self.parent == attacker then local target = self.parent:GetAttackTarget() local modifier_spirited_aura = "modifier_imba_death_pact_spirit_aura" local nearby_allies = FindUnitsInRadius(self.parent:GetTeamNumber(), self.parent:GetAbsOrigin(), nil, 500, DOTA_UNIT_TARGET_TEAM_FRIENDLY, DOTA_UNIT_TARGET_BASIC, DOTA_UNIT_TARGET_FLAG_NONE, FIND_ANY_ORDER, false) for _,spirits in pairs(nearby_allies) do if spirits:FindModifierByNameAndCaster(modifier_spirited_aura,self.parent) then spirits:SetForceAttackTarget(target) end end end end end -- Hidden buff for counting stacks. Calculates for hero modifier_imba_death_pact_stack_hero = class({}) function modifier_imba_death_pact_stack_hero:IsHidden() return true end function modifier_imba_death_pact_stack_hero:IsPurgable() return false end function modifier_imba_death_pact_stack_hero:IsDebuff() return false end function modifier_imba_death_pact_stack_hero:OnCreated() -- Ability properties self.caster = self:GetCaster() self.ability = self:GetAbility() self.particle_pact_buff = "particles/units/heroes/hero_clinkz/clinkz_death_pact_buff.vpcf" -- Ability specials self.hero_bonus_hp_dmg_mult = self.ability:GetSpecialValueFor("hero_bonus_hp_dmg_mult") self.hero_bonus_dmg_pct = self.ability:GetSpecialValueFor("hero_bonus_dmg_pct") -- Add buff effect self.particle_pact_buff_fx = ParticleManager:CreateParticle(self.particle_pact_buff, PATTACH_POINT_FOLLOW, self.caster) ParticleManager:SetParticleControlEnt(self.particle_pact_buff_fx, 0, self.caster, PATTACH_POINT_FOLLOW, "attach_hitloc", self.caster:GetAbsOrigin(), true) ParticleManager:SetParticleControl(self.particle_pact_buff_fx, 2, self.caster:GetAbsOrigin()) ParticleManager:SetParticleControl(self.particle_pact_buff_fx, 8, Vector(1,0,0)) self:AddParticle(self.particle_pact_buff_fx, false, false, -1, false, false) if IsServer() then Timers:CreateTimer(FrameTime(), function() local stacks = self:GetStackCount() self.caster:Heal(self.hero_bonus_hp_dmg_mult * stacks, self.caster) end) end end function modifier_imba_death_pact_stack_hero:DeclareFunctions() local decFuncs = {MODIFIER_PROPERTY_BASEATTACK_BONUSDAMAGE, MODIFIER_PROPERTY_EXTRA_HEALTH_BONUS} return decFuncs end function modifier_imba_death_pact_stack_hero:GetModifierBaseAttack_BonusDamage() local stacks = self:GetStackCount() local bonus_damage = self.hero_bonus_dmg_pct * 0.01 * stacks return bonus_damage end function modifier_imba_death_pact_stack_hero:GetModifierExtraHealthBonus() if IsServer() then local stacks = self:GetStackCount() local bonus_hp = self.hero_bonus_hp_dmg_mult * stacks return bonus_hp end end -- #8 Talent Debuff talent target marker modifier_imba_death_pact_talent_debuff = modifier_imba_death_pact_talent_debuff or class({}) function modifier_imba_death_pact_talent_debuff:IsHidden() return false end function modifier_imba_death_pact_talent_debuff:IsPurgable() return false end function modifier_imba_death_pact_talent_debuff:IsDebuff() return true end function modifier_imba_death_pact_talent_debuff:OnCreated() if IsServer() then self.caster = self:GetCaster() self.ability = self:GetAbility() self.parent = self:GetParent() self.modifier_hero_pact = "modifier_imba_death_pact_stack_hero" self.modifier_perma_buff = "modifier_imba_death_pact_talent_buff" end end function modifier_imba_death_pact_talent_debuff:DeclareFunctions() local decFuncs ={MODIFIER_EVENT_ON_HERO_KILLED} return decFuncs end function modifier_imba_death_pact_talent_debuff:OnHeroKilled(keys) if IsServer() then local killed_hero = keys.target -- Only apply if the killed hero is the parent of the debuff if killed_hero == self.parent and self.caster:HasModifier(self.modifier_hero_pact) then -- Get stack count from the modifier local buff_stacks = self.caster:FindModifierByName(self.modifier_hero_pact):GetStackCount() -- Calculate stack amount to keep local stacks = buff_stacks * (self.caster:FindTalentValue("special_bonus_imba_clinkz_8", "stacks_pct") * 0.01) -- Add perma buff if not exists yet if not self.caster:HasModifier(self.modifier_perma_buff) then self.caster:AddNewModifier(self.caster, self.ability, self.modifier_perma_buff, {}) end -- Increase stack count of the perma buff local modifier_buff_handler = self.caster:FindModifierByName(self.modifier_perma_buff) modifier_buff_handler:SetStackCount(modifier_buff_handler:GetStackCount() + stacks) end end end -- Spirit-to-be debuff marker modifier_imba_death_pact_hero_debuff = class({}) function modifier_imba_death_pact_hero_debuff:IsHidden() return true end function modifier_imba_death_pact_hero_debuff:IsPurgable() return false end function modifier_imba_death_pact_hero_debuff:IsDebuff() return true end function modifier_imba_death_pact_hero_debuff:OnCreated() if IsServer() then self.caster = self:GetCaster() self.ability = self:GetAbility() self.parent = self:GetParent() end end function modifier_imba_death_pact_hero_debuff:DeclareFunctions() local decFuncs ={MODIFIER_EVENT_ON_HERO_KILLED} return decFuncs end function modifier_imba_death_pact_hero_debuff:OnHeroKilled(keys) if IsServer() then local killed_hero = keys.target local modifier_stack_hero = "modifier_imba_death_pact_stack_hero" -- Only apply if the killed hero is the parent of the debuff if killed_hero == self.parent and self.caster:HasModifier(modifier_stack_hero) then local duration = self.ability:GetSpecialValueFor("duration") local modifier_bonus_spirited = "modifier_imba_death_pact_bonus_spirited" local modifier_spirited_aura = "modifier_imba_death_pact_spirit_aura" -- Kill any spirits that already pay their taxes, if any. local spirits_to_kill = FindUnitsInRadius(self.caster:GetTeamNumber(), self.caster:GetAbsOrigin(), nil, 500, DOTA_UNIT_TARGET_TEAM_FRIENDLY, DOTA_UNIT_TARGET_HERO + DOTA_UNIT_TARGET_CREEP, DOTA_UNIT_TARGET_FLAG_NONE, FIND_ANY_ORDER, false) for _,unit in pairs(spirits_to_kill) do if unit:FindModifierByNameAndCaster(modifier_spirited_aura,self.caster) then unit:Kill(self.ability,self.caster) end end self.caster:RemoveModifierByName(modifier_bonus_spirited) -- Summons a spirit. Wooooooooooooooooo~ :) local spirit_model = self.parent:GetModelName() local spirit_scale = self.parent:GetModelScale() local direction = (self.parent:GetAbsOrigin() - self.caster:GetAbsOrigin()):Normalized() local distance = (self.parent:GetAbsOrigin() - self.caster:GetAbsOrigin()):Length2D() local summon_point = self.caster:GetAbsOrigin() + direction * distance - 100 local spirit = CreateUnitByName("npc_imba_clinkz_spirits", summon_point, true, self.caster, self.caster, self.caster:GetTeamNumber()) -- Set the owner of the wraith as the caster spirit:SetOwner(self.caster) -- TURN THE TARGETS INTO SPIRITZ!! spirit:SetOriginalModel(spirit_model) spirit:SetModelScale(spirit_scale) spirit:NotifyWearablesOfModelChange(true) spirit:ManageModelChanges() -- Set the Wraith to die after a small duration spirit:AddNewModifier(self.caster, self.ability, "modifier_kill", {duration = duration}) spirit:AddNewModifier(self.caster, self.ability, modifier_spirited_aura, {duration = duration}) -- Add Spirit's Attack Damage local modifier_spirit_attack_range_bonus = "modifier_imba_death_pact_spirit_attack_range" spirit:AddNewModifier(self.caster, self.ability, modifier_spirit_attack_range_bonus, {duration = duration}) -- ALL YOUR STATS ARE BELONG TO CLINKZ self.caster:AddNewModifier(self.parent, self.ability, modifier_bonus_spirited, {duration = duration}) end end end -- #8 Talent Perma bonus buff modifier_imba_death_pact_talent_buff = class({}) function modifier_imba_death_pact_talent_buff:IsHidden() return false end function modifier_imba_death_pact_talent_buff:IsPurgable() return false end function modifier_imba_death_pact_talent_buff:IsDebuff() return false end function modifier_imba_death_pact_talent_buff:OnCreated() -- Ability properties self.caster = self:GetCaster() self.ability = self:GetAbility() -- Ability specials self.hero_bonus_hp_dmg_mult = self.ability:GetSpecialValueFor("hero_bonus_hp_dmg_mult") self.hero_bonus_dmg_pct = self.ability:GetSpecialValueFor("hero_bonus_dmg_pct") end function modifier_imba_death_pact_talent_buff:DeclareFunctions() local decFuncs = {MODIFIER_PROPERTY_BASEATTACK_BONUSDAMAGE, MODIFIER_PROPERTY_EXTRA_HEALTH_BONUS} return decFuncs end function modifier_imba_death_pact_talent_buff:GetModifierBaseAttack_BonusDamage() local stacks = self:GetStackCount() local bonus_damage = self.hero_bonus_dmg_pct * 0.01 * stacks return bonus_damage end function modifier_imba_death_pact_talent_buff:GetModifierExtraHealthBonus() local stacks = self:GetStackCount() local bonus_hp = self.hero_bonus_hp_dmg_mult * stacks return bonus_hp end
--- the module to build user api when building the project. -- @author [Alejandro Baez](https://keybase.io/baez) -- @copyright 2014-2016 -- @license MIT (see LICENSE) -- @module api local function add_apitag(name, path) local user_api = path .. "/.api_" .. name local user_tag = path .. "/.tag_" .. name if io.open(user_api) and io.open(user_tag) then table.insert(textadept.editing.api_files.rust, user_api) if _M.ctags then _M.ctags[path] = user_tag end end end --- builds the api and places in project/.api_projectname. -- @function build -- @param project_name the name of the project. -- @param project_full_path the relative/absolute location of the project. local function build(project_name, project_full_path, raw) local fapi = io.open(project_full_path .. "/.api_" .. project_name, "w") for line in io.open(raw):lines() do local tmpline = line tmpline = tmpline:gsub("/.+%prs", "\t") tmpline = tmpline:gsub("{?$.+", "") tmpline = tmpline:gsub("/%^", "") if not (line:find("(!_).+") or line:find("^test_")) then fapi:write(tmpline, "\n") end end fapi:close() end return { build = build, add_apitag = add_apitag }
return { height = function(x, z) return 3 end, block = function(x, y, z) if y == 3 then return 9 elseif y == 2 or y == 1 then return 10 -- dirt elseif y == 0 then return 33 -- bedrock else return 0 -- air end end }
RogueGuildShamanNpc = { click = async(function(player, npc) local t = { graphic = convertGraphic(npc.look, "monster"), color = npc.lookColor } player.npcGraphic = t.graphic player.npcColor = t.color player.dialogType = 0 player.lastClick = npc.ID player:dialogSeq({t, "Don't like the way you look do you?"}, 1) local choices = {"Face", "Gender", "Eyes"} local choice = player:menuString( "What appearance are you dissatisfied with?", choices ) local reject = "Ah, I see. Appear as thou wilt." if choice == "Face" then general_npc_funcs.changeFace(player, npc) elseif choice == "Gender" then general_npc_funcs.changeGender(player, npc) elseif choice == "Eyes" then general_npc_funcs.changeEyes(player, npc) end end), onSayClick = async(function(player, npc) local speech = string.lower(player.speech) local t = { graphic = convertGraphic(npc.look, "monster"), color = npc.lookColor } player.npcGraphic = t.graphic player.npcColor = t.color player.dialogType = 0 player.lastClick = npc.ID if speech == "moon" and player.level >= 50 and player.baseClass == 2 then Tools.checkKarma(player) player:dialogSeq( { t, "Under a white moon I slew a powerful man, of the family Ju, that owed me much money", "Yet, still I am not satisfied." }, 1 ) if player.quest["white_moon_axe"] == 0 then local choice = player:menuString( "Are you willing to make such a commitment?", {"Yes, I am ready.", "I am busy. Later, perhaps."}, {} ) if choice == "Yes, I am ready." then player.quest["white_moon_axe"] = 1 player:freeAsync() RogueGuildShamanNpc.onSayClick(player, npc, "moon") elseif choice == "I am busy. Later, perhaps." then player:dialogSeq( {t, "Then you were not the right person for this task."}, 0 ) end elseif player.quest["white_moon_axe"] > 0 then local choice local choice2 if player.quest["white_moon_axe"] == 1 then player:dialogSeq( { t, "If you knew what venom and speed combined were, perhaps I would consider you." }, 1 ) if player.registry["white_moon_axe_flushed_kills"] == 0 then player:flushKills("pale_scorpion") player:flushKills("skeleton_ju") player.registry["white_moon_axe_flushed_kills"] = 1 elseif player.registry["white_moon_axe_flushed_kills"] == 1 then if player:killCount("pale_scorpion") >= 5 then if player:hasItem("lucky_coin", 1) ~= true then player:dialogSeq( { t, "Your hands are empty! Had you a Lucky coin, perhaps I could trust you would survive." }, 0 ) return end player.quest["white_moon_axe"] = 2 player.registry["white_moon_axe_flushed_kills"] = 0 player:freeAsync() RogueGuildShamanNpc.onSayClick(player, npc, "moon") else player:dialogSeq( { t, "Had you slain at least five pale scorpions, you would know." }, 0 ) end end end if player.quest["white_moon_axe"] == 2 then if player:killCount("skeleton_ju") >= 1 then player.quest["white_moon_axe"] = 3 player:freeAsync() RogueGuildShamanNpc.onSayClick(player, npc, "moon") end player:dialogSeq( { t, "Someone owes me money. Lots of it.", "He's dead now, but that doesn't matter. This is about honor.", "That night of slaying the Ju family caused the earth to shake. My weapons were filled with the power of the white moon.", "But I never found the money he owed me.", "I'm charging you to torment the family's skeletal remains. Their name in life was Ju.", "Destroy the skeleton of Ju, and we'll talk about you getting my money...", "...and the axe with which I slew the powerful man under a white moon." }, 0 ) end if player.quest["white_moon_axe"] == 3 then player:dialogSeq( { t, "Ah, his torment is my music.", "But I still must have the money he owed me, and all I have is this White moon axe.", "It was more than what you have. 20,000 coins in all. Should you repay me the money I am owed, I would give you this axe." }, 1 ) choice2 = player:menuString( "Are you willing to give me 20,000 gold to replace what I am owed?", {"Yes", "No"}, {} ) if choice2 == "Yes" then if player.money < 20000 then player:dialogSeq( {t, "You do not have enough gold to repay me."}, 0 ) return end player:removeGold(20000) player:addItem("white_moon_axe", 1, 0, player.ID) player.quest["white_moon_axe"] = 0 player:dialogSeq( { t, "There you are rogue. May it inspire you as it has me." }, 1 ) player:dialogSeq( { t, "The moon is white, He's been desecrated. I have a moment of peace." }, 0 ) return elseif choice2 == "No" then player:dialogSeq( { t, "Then you were not the right person for this task." }, 0 ) return end end end end end), move = function(npc, owner) local found local moved = true local oldside = npc.side local checkmove = math.random(0, 10) if (npc.retDist <= distanceXY(npc, npc.startX, npc.startY) and npc.retDist > 1 and npc.returning == false) then npc.returning = true elseif (npc.returning == true and npc.retDist > distanceXY(npc, npc.startX, npc.startY) and npc.retDist > 1) then npc.returning = false end if (npc.returning == true) then found = toStart(npc, npc.startX, npc.startY) else if (checkmove >= 4) then npc.side = math.random(0, 3) npc:sendSide() if (npc.side == oldside) then moved = npc:move() end end end if (found == true) then npc.returning = false end end, }
--- === plugins.finalcutpro.tangent.common === --- --- Common Final Cut Pro functions for Tangent local require = require local log = require "hs.logger".new "tangentVideo" local geometry = require "hs.geometry" local timer = require "hs.timer" local axutils = require "cp.ui.axutils" local commands = require "cp.commands" local deferred = require "cp.deferred" local dialog = require "cp.dialog" local Do = require "cp.rx.go.Do" local fcp = require "cp.apple.finalcutpro" local i18n = require "cp.i18n" local If = require "cp.rx.go.If" local tools = require "cp.tools" local childrenMatching = axutils.childrenMatching local delayed = timer.delayed local displayMessage = dialog.displayMessage local ninjaMouseClick = tools.ninjaMouseClick local playErrorSound = tools.playErrorSound local tableCount = tools.tableCount local mod = {} -- DEFER -> number -- Constant -- The amount of time to defer UI updates local DEFER = 0.01 -- DELAY -> number -- Constant -- The amount of time to delay UI updates local DELAY = 0.2 --- plugins.finalcutpro.tangent.common.popupParameter(group, param, id, value, label) -> number --- Function --- Sets up a new Popup Parameter for the Tangent --- --- Parameters: --- * group - The Tangent Group. --- * param - The Parameter. --- * id - The Tangent ID. --- * value - The value to select as a string. --- * label - The label to be used by the Tangent. This can either be an i18n ID or --- a plain string. --- --- Returns: --- * An updated ID function mod.popupParameter(group, param, id, value, label) group :action(id + 1, i18n(label, {default=label})) :onPress(function() return Do(param:doShow()) :Then(param:doSelectValue(value)) :Label("plugins.finalcutpro.tangent.common.popupParameter") :Now() end) return id + 1 end --- plugins.finalcutpro.tangent.common.dynamicPopupSliderParameter(group, param, id, label, defaultValue) -> number --- Function --- Sets up a new Popup Slider parameter for the Tangent --- --- Parameters: --- * group - The Tangent Group. --- * param - The Parameter --- * id - The Tangent ID. --- * label - The label to be used by the Tangent. This can either be an i18n ID or --- a plain string. --- * defaultValue - The default value to use when the reset button is pressed. --- --- Returns: --- * An updated ID function mod.dynamicPopupSliderParameter(group, param, id, label, defaultValue) local getSelectedIndex = function(menuUI) if menuUI then local children = menuUI:attributeValue("AXChildren") for i, v in pairs(children) do if v:attributeValue("AXMenuItemMarkChar") ~= nil then return i end end end end local popupSliderCache = nil local updateUI = delayed.new(DELAY, function() Do(param:doSelectItem(popupSliderCache)) :Then(function() popupSliderCache = nil end) :Label("plugins.finalcutpro.tangent.common.dynamicPopupSliderParameter.updateUI") :Now() end) group:menu(id + 1) :name(i18n(label, {default=label})) :name9(i18n(label .. "9", {default=i18n(label, {default=label})})) :onGet(function() if popupSliderCache and param:menuUI() then return param:menuUI():attributeValue("AXChildren")[popupSliderCache]:attributeValue("AXTitle") else return param:value() end end) :onNext(function() param:show() if not param:menuUI() then param:press() end if param:menuUI() then local max = param:menuUI():attributeValueCount("AXChildren") local currentValueID = popupSliderCache or getSelectedIndex(param:menuUI()) currentValueID = currentValueID + 1 if currentValueID > max then currentValueID = 1 end popupSliderCache = currentValueID updateUI:start() end end) :onPrev(function() param:show() if not param:menuUI() then param:press() end if param:menuUI() then local max = param:menuUI():attributeValueCount("AXChildren") local currentValueID = popupSliderCache or getSelectedIndex(param:menuUI()) currentValueID = currentValueID - 1 if currentValueID <= 0 then currentValueID = max end popupSliderCache = currentValueID updateUI:start() end end) :onReset(function() return Do(function() popupSliderCache = type(defaultValue) == "number" and defaultValue or 1 end) :Then( If(function() return type(defaultValue) == "string" end) :Then(param:doSelectValue(defaultValue)) :Otherwise(param:doSelectItem(defaultValue)) ) :Then(function() popupSliderCache = nil end) :Label("plugins.finalcutpro.tangent.common.dynamicPopupSliderParameter.reset") :Now() end) return id + 1 end --- plugins.finalcutpro.tangent.common.popupSliderParameter(group, param, id, label, options, resetIndex) -> number --- Function --- Sets up a new Popup Slider parameter for the Tangent --- --- Parameters: --- * group - The Tangent Group. --- * param - The Parameter --- * id - The Tangent ID. --- * label - The label to be used by the Tangent. This can either be an i18n ID or --- a plain string. --- * options - A table of options. The key for each option should be a number ID --- (in the order it appears in the UI), and the value should be another --- table with keys for `flexoID` and `i18n` values. --- * resetIndex - An index of which item to use when "reset" is triggered. --- --- Returns: --- * An updated ID function mod.popupSliderParameter(group, param, id, label, options, resetIndex) local popupSliderCache = nil local maxValue = tableCount(options) local loopupID = function(name) for i, v in pairs(options) do if v.flexoID then if name == fcp:string(v.flexoID) then return i end end end end local updateUI = delayed.new(DELAY, function() Do(param:doSelectItem(popupSliderCache)) :Then(function() popupSliderCache = nil end) :Label("plugins.finalcutpro.tangent.common.popupSliderParameter.updateUI") :Now() end) group:menu(id + 1) :name(i18n(label, {default=label})) :name9(i18n(label .. "9", {default=i18n(label, {default=label})})) :onGet(function() if popupSliderCache then if options[popupSliderCache].i18n ~= nil then local v = options[popupSliderCache].i18n return i18n(v .. "9", {default= i18n(v, {default=v})}) end else local i = loopupID(param:value()) local v = options[i] and options[i].i18n return v and i18n(v .. "9", {default=i18n(v, {default=v})}) end end) :onNext(function() param:show() -- NOTE: I tried using a `doShow()` here, but it was causing a timing issue. local currentValue = param:value() local currentValueID = popupSliderCache or (currentValue and loopupID(currentValue)) if type(currentValueID) ~= "number" then return end local newID = currentValueID and currentValueID + 1 if newID > maxValue then newID = 1 end -------------------------------------------------------------------------------- -- TODO: This is a horrible temporary workaround for menu non-enabled items. -- It should probably be some kind of loop. -------------------------------------------------------------------------------- if options[newID] and options[newID].flexoID == nil then newID = newID + 1 end if options[newID] and options[newID].flexoID == nil then newID = newID + 1 end if newID > maxValue then newID = 1 end -------------------------------------------------------------------------------- popupSliderCache = newID updateUI:start() end) :onPrev(function() param:show() -- NOTE: I tried using a `doShow()` here, but it was causing a timing issue. local currentValue = param:value() local currentValueID = popupSliderCache or (currentValue and loopupID(currentValue)) if type(currentValueID) ~= "number" then return end local newID = currentValueID and currentValueID - 1 if newID == 0 then newID = maxValue - 1 end -------------------------------------------------------------------------------- -- TODO: This is a horrible temporary workaround for menu non-enabled items. -- It should probably be some kind of loop. -------------------------------------------------------------------------------- if options[newID] and options[newID].flexoID == nil then newID = newID - 1 end if options[newID] and options[newID].flexoID == nil then newID = newID - 1 end if newID <= 0 then newID = maxValue - 1 end -------------------------------------------------------------------------------- popupSliderCache = newID updateUI:start() end) :onReset(function() return Do(function() popupSliderCache = resetIndex end) :Then(param:doShow()) :Then(param:doSelectValue(fcp:string(options[resetIndex].flexoID))) :Then(function() popupSliderCache = nil end) :Label("plugins.finalcutpro.tangent.common.popupSliderParameter.reset") :Now() end) return id + 1 end --- plugins.finalcutpro.tangent.common.popupParameters(group, param, id, options) -> number --- Function --- Sets up a new Popup Parameter for the Tangent --- --- Parameters: --- * group - The Tangent Group. --- * param - The Parameter --- * id - The Tangent ID. --- * options - A table of options. The key for each option should be a number ID --- (in the order it appears in the UI), and the value should be another --- table with keys for `flexoID` and `i18n` values. --- --- Returns: --- * An updated ID function mod.popupParameters(group, param, id, options) for i=1, tableCount(options) do local v = options[i] if v.flexoID ~= nil then id = mod.popupParameter(group, param, id, fcp:string(v.flexoID), v.i18n) end end return id end --- plugins.finalcutpro.tangent.common.checkboxParameter(group, param, id, label) -> number --- Function --- Sets up a new Checkbox Parameter for the Tangent --- --- Parameters: --- * group - The Tangent Group. --- * param - The Parameter --- * id - The Tangent ID. --- * label - The label to be used by the Tangent. This can either be an i18n ID or --- a plain string. --- --- Returns: --- * An updated ID function mod.checkboxParameter(group, param, id, label) group :action(id + 1, i18n(label, {default=label})) :onPress(function() return Do(param:doShow()):Then( If(param):Is(nil):Then():Otherwise( param:doPress() ) ) :Label("plugins.finalcutpro.tangent.common.checkboxParameter") :Now() end) return id + 1 end --- plugins.finalcutpro.tangent.common.checkboxSliderParameter(group, id, label, options, resetIndex) -> number --- Function --- Sets up a new Popup Slider parameter for the Tangent --- --- Parameters: --- * group - The Tangent Group. --- * id - The Tangent ID. --- * label - The label to be used by the Tangent. This can either be an i18n ID or --- a plain string. --- * options - A table of options. The key for each option should be a number ID --- (in the order it appears in the UI), and the value should be another --- table with keys for `flexoID` and `i18n` values. --- * resetIndex - An index of which item to use when "reset" is triggered. --- --- Returns: --- * An updated ID function mod.checkboxSliderParameter(group, id, label, options, resetIndex) local getIndexOfSelectedCheckbox = function() for i, v in pairs(options) do local ui = v.param and v.param:UI() if ui and ui:attributeValue("AXValue") == 1 then return i end end end local cachedValue = nil local maxValue = tableCount(options) local updateUI = delayed.new(DELAY, function() Do(options[1].param:doShow()) :Then( options[cachedValue].param:doPress() ) :Then(function() cachedValue = nil end) :Label("plugins.finalcutpro.tangent.common.checkboxSliderParameter.updateUI") :Now() end) group:menu(id + 1) :name(i18n(label, {default=label})) :name9(i18n(label .. "9", {default=i18n(label, {default=label})})) :onGet(function() local index = cachedValue or getIndexOfSelectedCheckbox() local result = index and options[index].i18n return result and i18n(result .. "9", {default=i18n(result, {default=result})}) end) :onNext(function() options[1].param:show() local indexOfSelectedCheckbox = getIndexOfSelectedCheckbox() if indexOfSelectedCheckbox then local currentValueID = cachedValue or getIndexOfSelectedCheckbox() local newID = currentValueID and currentValueID + 1 if newID > maxValue then newID = 1 end cachedValue = newID updateUI:start() end end) :onPrev(function() options[1].param:show() local indexOfSelectedCheckbox = getIndexOfSelectedCheckbox() if indexOfSelectedCheckbox then local currentValueID = cachedValue or getIndexOfSelectedCheckbox() local newID = currentValueID and currentValueID - 1 if newID == 0 then newID = maxValue - 1 end cachedValue = newID updateUI:start() end end) :onReset(function() return Do(function() cachedValue = 1 end) :Then(options[1].param:doShow()) :Then(options[resetIndex].param:doPress()) :Then(function() cachedValue = nil end) :Label("plugins.finalcutpro.tangent.common.checkboxSliderParameter.reset") :Now() end) return id + 1 end --- plugins.finalcutpro.tangent.common.doShortcut(id) -> none --- Function --- Triggers a shortcut via Rx. --- --- Parameters: --- * id - The ID of the shortcut. --- --- Returns: --- * None function mod.doShortcut(id) return fcp:doShortcut(id):Catch(function(message) log.wf("Unable to perform %q shortcut: %s", id, message) displayMessage(i18n("tangentFinalCutProShortcutFailed")) end) end --- plugins.finalcutpro.tangent.common.radioButtonParameter(group, param, id, label) -> number --- Function --- Sets up a new Checkbox Parameter for the Tangent --- --- Parameters: --- * group - The Tangent Group. --- * param - The Parameter --- * id - The Tangent ID. --- * label - The label to be used by the Tangent. This can either be an i18n ID or --- a plain string. --- --- Returns: --- * An updated ID function mod.radioButtonParameter(group, param, id, label) group :action(id + 1, i18n(label, {default=label})) :onPress(function() return Do(param:doShow()) :Then(param:doPress()) :Label("plugins.finalcutpro.tangent.common.radioButtonParameter") :Now() end) return id + 1 end --- plugins.finalcutpro.tangent.common.buttonParameter(group, param, id, label) -> number --- Function --- Sets up a new Button Parameter for the Tangent --- --- Parameters: --- * group - The Tangent Group. --- * param - The Parameter --- * id - The Tangent ID. --- * label - The label to be used by the Tangent. This can either be an i18n ID or --- a plain string. --- --- Returns: --- * An updated ID function mod.buttonParameter(group, param, id, label) group :action(id + 1, i18n(label, {default=label})) :onPress(function() return Do(param:doShow()) :Then( param:doPress() ) :Label("plugins.finalcutpro.tangent.common.buttonParameter") :Now() end) return id + 1 end --- plugins.finalcutpro.tangent.common.doShowParameter(group, param, id, label) -> number --- Function --- Sets up a new `DoShow` Parameter for the Tangent --- --- Parameters: --- * group - The Tangent Group. --- * param - The Parameter --- * id - The Tangent ID. --- * label - The label to be used by the Tangent. This can either be an i18n ID or --- a plain string. --- --- Returns: --- * An updated ID function mod.doShowParameter(group, param, id, label) group :action(id + 1, i18n(label, {default=label})) :onPress(function() return Do(param:doShow()) :Label("plugins.finalcutpro.tangent.common.buttonParameter") :Now() end) return id + 1 end --- plugins.finalcutpro.tangent.common.commandParameter(group, id, commandID) -> number --- Function --- Sets up a new Command Parameter for the Tangent --- --- Parameters: --- * group - The Tangent Group. --- * id - The Tangent ID. --- * commandID - The command ID. --- --- Returns: --- * An updated ID function mod.commandParameter(group, id, groupID, commandID) local cmd = commands.group(groupID):get(commandID) group :action(id + 1, cmd:getTitle()) :onPress(function() cmd:pressed() end) return id + 1 end --- plugins.finalcutpro.tangent.common.shortcutParameter(group, id, label, shortcutID) -> number --- Function --- Sets up a new Final Cut Pro Shortcut Parameter for the Tangent. --- --- Parameters: --- * group - The Tangent Group. --- * id - The Tangent ID. --- * label - The label to be used by the Tangent. This can either be an i18n ID or --- a plain string. --- * shortcutID - The shortcut ID. --- --- Returns: --- * An updated ID function mod.shortcutParameter(group, id, label, shortcut) group :action(id + 1, i18n(label, {default=label})) :onPress(function() return fcp:doShortcut(shortcut):Now() end) return id + 1 end --- plugins.finalcutpro.tangent.common.menuParameter(group, id, label, path) -> number --- Function --- Sets up a new Final Cut Pro Menu Parameter for the Tangent. --- --- Parameters: --- * group - The Tangent Group. --- * id - The Tangent ID. --- * label - The label to be used by the Tangent. This can either be an i18n ID or --- a plain string. --- * path - The list of menu items you'd like to activate as a table. --- --- Returns: --- * An updated ID function mod.menuParameter(group, id, label, path) group :action(id + 1, i18n(label, {default=label})) :onPress(function() return fcp:doSelectMenu(path):Now() end) return id + 1 end --- plugins.finalcutpro.tangent.common.functionParameter(group, id, label, fn) -> number --- Function --- Sets up a new Function Parameter for the Tangent. --- --- Parameters: --- * group - The Tangent Group. --- * id - The Tangent ID. --- * label - The label to be used by the Tangent. This can either be an i18n ID or --- a plain string. --- * path - The list of menu items you'd like to activate as a table. --- --- Returns: --- * An updated ID function mod.functionParameter(group, id, label, fn) group :action(id + 1, i18n(label, {default=label})) :onPress(function() fn() end) return id + 1 end --- plugins.finalcutpro.tangent.common.buttonParameter(group, param, id, label) -> number --- Function --- Sets up a new Button Parameter for the Tangent --- --- Parameters: --- * group - The Tangent Group. --- * param - The Parameter --- * id - The Tangent ID. --- * label - The label to be used by the Tangent. This can either be an i18n ID or --- a plain string. --- --- Returns: --- * An updated ID function mod.ninjaButtonParameter(group, param, id, label) group :action(id + 1, i18n(label, {default=label})) :onPress(function() param:show() local frame = param:frame() if frame then local center = geometry(frame).center if center then ninjaMouseClick(center) return end end playErrorSound() end) return id + 1 end --- plugins.finalcutpro.tangent.common.checkboxParameterByIndex(group, section, nextSection, id, label, index) -> number --- Function --- Sets up a new AXCheckBox object for the Tangent. --- --- Parameters: --- * group - The Tangent Group. --- * section - The section as it appears in the FCPX Inspector. --- * nextSection - The next section as it appears in the FCPX Inspector. --- * id - The Tangent ID. --- * label - The label to be used by the Tangent. This can either be an i18n ID or --- a plain string. --- * index - The index of the checkbox in the section. --- --- Returns: --- * An updated ID function mod.checkboxParameterByIndex(group, section, nextSection, id, label, index) group :action(id + 1, i18n(label, {default=label})) :onPress(function() section:show():expanded(true) local children = section:propertiesUI():children() local sectionFrame = section and section:UI() and section:UI():frame() local nextSectionFrame = nextSection and nextSection:UI() and nextSection:UI():frame() local allowedX = section and section.enabled and section.enabled:UI() and section.enabled:UI():frame().x if sectionFrame and allowedX then local checkboxes = childrenMatching(children, function(e) local frame = e:attributeValue("AXFrame") local result = e:attributeValue("AXRole") == "AXCheckBox" and frame.x == allowedX and frame.y > (sectionFrame.y + sectionFrame.h) if nextSectionFrame then result = result and ((frame.y + frame.h) < nextSectionFrame.y) end return result end) local checkbox = checkboxes and checkboxes[index] if checkbox then checkbox:doPress() return end end playErrorSound() end) return id + 1 end --- plugins.finalcutpro.tangent.common.xyParameter(group, param, id, minValue, maxValue, stepSize) -> number --- Function --- Sets up a new XY Parameter --- --- Parameters: --- * group - The Tangent Group --- * param - The Parameter --- * id - The Tangent ID --- --- Returns: --- * An updated ID --- * The `x` parameter value --- * The `y` parameter value --- * The xy binding function mod.xyParameter(group, param, id, minValue, maxValue, stepSize) minValue, maxValue, stepSize = minValue or 0, maxValue or 100, stepSize or 0.5 -------------------------------------------------------------------------------- -- Set up the accumulator: -------------------------------------------------------------------------------- local x, y = 0, 0 local updateUI = deferred.new(DEFER) local updating = false updateUI:action(function() return If(function() return not updating and (x ~= 0 or y ~= 0) end) :Then( Do(param:doShow()) :Then(function() updating = true if x ~= 0 then local current = param:x() if current then param:x(current + x) end x = 0 end if y ~= 0 then local current = param:y() if current then param:y(current + y) end y = 0 end mod._manager.controls:findByID(id + 1):update() -- Force the Tangent display to update. updating = false end) ) :Label("plugins.finalcutpro.tangent.common.xyParameter.updateUI") :Now() end) local label = param:label() local xParam = group:parameter(id + 1) :name(label .. " X") :minValue(minValue) :maxValue(maxValue) :stepSize(stepSize) :onGet(function() return param:x() end) :onChange(function(amount) x = x + amount updateUI() end) :onReset(function() param:x(0) end) local yParam = group:parameter(id + 2) :name(label .. " Y") :minValue(minValue) :maxValue(maxValue) :stepSize(stepSize) :onGet(function() return param:y() end) :onChange(function(amount) y = y + amount updateUI() end) :onReset(function() param:y(0) end) local xyBinding = group:binding(label):members(xParam, yParam) return id + 2, xParam, yParam, xyBinding end --- plugins.finalcutpro.tangent.common.sliderParameter(group, param, id, minValue, maxValue, stepSize, default, label, optionalParamA, optionalParamB) -> number, parameter --- Function --- Sets up a new Slider Parameter --- --- Parameters: --- * group - The Tangent Group --- * param - The Parameter --- * id - The Tangent ID --- * minValue - The minimum value --- * maxValue - The maximum value --- * stepSize - The step size --- * default - The default value --- * label - An optional label as an i18n ID or plain string. If no label is supplied the --- `param` label will be used. --- * optionalParamA - An optional parameter. Useful if you need to link parameters. --- * optionalParamB - An optional parameter. Useful if you need to link parameters. --- --- Returns: --- * An updated ID --- * The parameters value function mod.sliderParameter(group, param, id, minValue, maxValue, stepSize, default, label, optionalParamA, optionalParamB) -------------------------------------------------------------------------------- -- Set up deferred update: -------------------------------------------------------------------------------- local value = 0 local updateUI = deferred.new(DEFER) local updating = false updateUI:action(function() return If(function() return not updating and value ~= 0 end) :Then( Do(param:doShow()) :Then(function() updating = true local currentValue = param:value() if currentValue then param:value(currentValue + value) if optionalParamA then optionalParamA:value(currentValue + value) end if optionalParamB then optionalParamB:value(currentValue + value) end value = 0 end mod._manager.controls:findByID(id + 1):update() -- Force the Tangent display to update. updating = false end) ) :Label("plugins.finalcutpro.tangent.common.sliderParameter.updateUI") :Now() end) default = default or 0 label = (label and i18n(label, {default=label})) or param:label() local valueParam = group:parameter(id + 1) :name(label) :minValue(minValue) :maxValue(maxValue) :stepSize(stepSize) :onGet(function() local currentValue = param:value() return currentValue and currentValue + value end) :onChange(function(amount) value = value + amount updateUI() end) :onReset(function() param:value(default) end) return id + 1, valueParam end --- plugins.finalcutpro.tangent.common.volumeSliderParameter(group, param, id, minValue, maxValue, stepSize, default, label) -> number, parameter --- Function --- Sets up a new Volume Slider Parameter --- --- Parameters: --- * group - The Tangent Group --- * param - The Parameter --- * id - The Tangent ID --- * minValue - The minimum value --- * maxValue - The maximum value --- * stepSize - The step size --- * default - The default value --- * label - An optional label as an i18n ID or plain string. If no label is supplied the --- `param` label will be used. --- --- Returns: --- * An updated ID --- * The parameters value function mod.volumeSliderParameter(group, param, id, minValue, maxValue, stepSize, default, label) -------------------------------------------------------------------------------- -- Set up deferred update: -------------------------------------------------------------------------------- local value = 0 local updateUI = deferred.new(DEFER) local updating = false local wasPlaying = false updateUI:action(function() return If(function() return not updating and value ~= 0 end) :Then( Do(param:doShow()) :Then(function() updating = true end) :Then( If(function() wasPlaying = fcp:timeline():isPlaying() return wasPlaying end) :Then(fcp:doSelectMenu({"View", "Playback", "Play"})) :Then(fcp:doSelectMenu({"Modify", "Add Keyframe to Selected Effect in Animation Editor"})) ) :Then(function() local currentValue = param:value() if currentValue then param:value(currentValue + value) value = 0 end end) :Then( If(function() return wasPlaying end) :Then(fcp:doSelectMenu({"View", "Playback", "Play"})) ) :Then(function() updating = false end) ) :Label("plugins.finalcutpro.tangent.common.volumeSliderParameter.updateUI") :Now() end) default = default or 0 label = (label and i18n(label, {default=label})) or param:label() local valueParam = group:parameter(id + 1) :name(label) :minValue(minValue) :maxValue(maxValue) :stepSize(stepSize) :onGet(function() local currentValue = param:value() return currentValue and currentValue + value end) :onChange(function(amount) value = value + amount updateUI() end) :onReset(function() param:value(default) end) return id + 1, valueParam end local plugin = { id = "finalcutpro.tangent.common", group = "finalcutpro", dependencies = { ["core.tangent.manager"] = "manager", }, } function plugin.init(deps) mod._manager = deps.manager return mod end return plugin
-- Represents a single drawable object local Class = require 'libs.hump.class' local Entity = Class{} function Entity:init(world, x, y, w, h) self.world = world self.x = x self.y = y self.w = w self.h = h end function Entity:getRect() return self.x, self.y, self.w, self.h end function Entity:draw() -- Do nothing by default, but we still have to have something to call end function Entity:update(dt) -- Do nothing by default, but we still have to have something to call end function Entity:keypressed(key,isrepeat) -- Do nothing by default, but we still have to have something to call end function Entity:keyreleased(key) -- Do nothing by default, but we still have to have something to call end function Entity:mousepressed(x, y, button) -- Do nothing by default, but we still have to have something to call end function Entity:mousereleased(x, y, button) -- Do nothing by default, but we still have to have something to call end return Entity
----------------------------------- ---------- Discord Reports -------- --- by Badger --- ----------------------------------- -- Config -- webhookURL = '' displayIdentifiers = true; -- CODE -- function GetPlayers() local players = {} for _, i in ipairs(GetActivePlayers()) do if NetworkIsPlayerActive(i) then table.insert(players, i) end end return players end RegisterCommand("report", function(source, args, rawCommand) sm = stringsplit(rawCommand, " "); if #args < 2 then TriggerClientEvent('chatMessage', source, "^1ERROR: Invalid Usage. ^2Proper Usage: /report <id> <reason>") return; end id = sm[2] if GetPlayerIdentifiers(id)[1] == nil then TriggerClientEvent('chatMessage', source, "^1ERROR: The specified ID is not currently online...") return; end msg = "" local message = "" msg = msg .. " ^9(^6" .. GetPlayerName(source) .. "^9) ^1[^3" .. id .. "^1] " for i = 3, #sm do msg = msg .. sm[i] .. " " message = message .. sm[i] .. " " end -- TriggerClientEvent('chatMessage', source, "^9[^1Badger-Tags^9] ^3Your tag is now ^2active") -- TriggerClientEvent('SandyRestrictions:IsAOP:Return', -1, isSandyAOP, false) if tonumber(id) ~= nil then -- it's a number TriggerClientEvent("Reports:CheckPermission:Client", -1, msg, false) TriggerClientEvent('chatMessage', source, "^9[^1Badger-Reports^9] ^2Report has been submitted! Thank you for helping us :)") if not displayIdentifiers then sendToDisc("NEW REPORT: _[" .. tostring(id) .. "] " .. GetPlayerName(id) .. "_", 'Reason: **' .. message .. '**', "Reported by: [" .. source .. "] " .. GetPlayerName(source)) else -- Display the identifiers with the report local ids = ExtractIdentifiers(id); local steam = ids.steam:gsub("steam:", ""); local steamDec = tostring(tonumber(steam,16)); steam = "https://steamcommunity.com/profiles/" .. steamDec; local gameLicense = ids.license; local discord = ids.discord; sendToDisc("NEW REPORT: _[" .. tostring(id) .. "] " .. GetPlayerName(id) .. "_", 'Reason: **' .. message .. '**\n' .. 'Steam: **' .. steam .. '**\n' .. 'GameLicense: **' .. gameLicense .. '**\n' .. 'Discord Tag: **<@' .. discord:gsub('discord:', '') .. '>**\n' .. 'Discord UID: **' .. discord:gsub('discord:', '') .. '**', "Reported by: [" .. source .. "] " .. GetPlayerName(source)) end --print("Runs report command fine and is number for ID") -- TODO - Debug else -- It's not a number TriggerClientEvent('chatMessage', source, "^9[^1Badger-Reports^9] ^1Invalid Format. ^1Proper Format: /report <id> <report>") end end) function sendToDisc(title, message, footer) local embed = {} embed = { { ["color"] = 16711680, -- GREEN = 65280 --- RED = 16711680 ["title"] = "**".. title .."**", ["description"] = "" .. message .. "", ["footer"] = { ["text"] = footer, }, } } -- Start -- TODO Input Webhook PerformHttpRequest(webhookURL, function(err, text, headers) end, 'POST', json.encode({username = name, embeds = embed}), { ['Content-Type'] = 'application/json' }) -- END end local function has_value (tab, val) for index, value in ipairs(tab) do if value == val then return true end end return false end function sleep (a) local sec = tonumber(os.clock() + a); while (os.clock() < sec) do end end hasPermission = {} doesNotHavePermission = {} RegisterNetEvent("Reports:CheckPermission") AddEventHandler("Reports:CheckPermission", function(msg, error) local src = source if IsPlayerAceAllowed(src, "BadgerReports.See") then TriggerClientEvent('chatMessage', src, "^9[^1Report^9] ^8" .. msg) end end) function stringsplit(inputstr, sep) if sep == nil then sep = "%s" end local t={} ; i=1 for str in string.gmatch(inputstr, "([^"..sep.."]+)") do t[i] = str i = i + 1 end return t end function ExtractIdentifiers(src) local identifiers = { steam = "", ip = "", discord = "", license = "", xbl = "", live = "" } --Loop over all identifiers for i = 0, GetNumPlayerIdentifiers(src) - 1 do local id = GetPlayerIdentifier(src, i) --Convert it to a nice table. if string.find(id, "steam") then identifiers.steam = id elseif string.find(id, "ip") then identifiers.ip = id elseif string.find(id, "discord") then identifiers.discord = id elseif string.find(id, "license") then identifiers.license = id elseif string.find(id, "xbl") then identifiers.xbl = id elseif string.find(id, "live") then identifiers.live = id end end return identifiers end
local Objects = { createObject(3115,2167.1001,611.40002,4.1,270,0,0), createObject(3115,2188,611.40002,4.1,270,0,0), createObject(3115,2146,611.40002,4.1,270,0,0), createObject(3115,2135.7,601.09998,4.1,270,0,90), createObject(3115,2135.7,580,4.1,270,0,90), createObject(3115,2135.7,559,4.1,270,0,90), createObject(3115,2198.3,601.09998,4.1,270,0,270), createObject(3115,2198.3,580,4.1,270,0,270), createObject(3115,2198.3,559,4.1,270,0,270), createObject(3115,2188,548.70001,4.1,270,0,180), createObject(3115,2167,548.70001,4.1,270,0,179.995), createObject(3115,2146,548.70001,4.1,270,0,179.995), createObject(3115,2135.7,559,-14.4,270,0,90), createObject(3115,2135.7,559,-32.9,270,0,90), createObject(3115,2146,548.7002,-14.4,270,0,179.995), createObject(3115,2146,548.7002,-32.9,270,0,179.995), createObject(3115,2167,548.70001,-14.4,270,0,179.995), createObject(3115,2167,548.70001,-32.9,270,0,179.995), createObject(3115,2188,548.7002,-14.4,270,0,179.995), createObject(3115,2188,548.70001,-32.9,270,0,179.995), createObject(3115,2198.3,559,-14.4,270,0,270), createObject(3115,2198.3,559,-33,270,0,270), createObject(3113,2142.8999,600.29999,12.9,0,285,0), createObject(3113,2142.8999,577.70001,12.9,0,284.996,0), createObject(3113,2142.9004,559.90039,12.9,0,284.991,0), createObject(3113,2194.3999,559.79999,12.9,0,284.996,0), createObject(3113,2194.3999,582.40002,12.9,0,284.996,0), createObject(3113,2194.3999,600.20001,12.9,0,284.996,0), createObject(8417,2167.2998,591.59961,13.5,0,179.995,0), createObject(8417,2167,551.59998,13.5,0,179.995,0), createObject(3115,2157,531.79999,4.1,270,0,179.995), createObject(3115,2177.1001,531.79999,4.1,270,0,179.995), createObject(3115,2187.3999,542.09998,4.1,270,0,270), createObject(3115,2146.6001,542.09998,4.1,270,0,90), createObject(3114,2187.3,611,19,90,0,0), createObject(3114,2146.7,611,19,90,0,0), createObject(3114,2198,601.09998,19,90,0,270), createObject(3114,2198,580,19,90,0,270), createObject(3114,2198,559,19,90,0,270), createObject(3114,2136.1001,601.09998,19,90,0,90), createObject(3114,2136.1001,580,19,90,0,90), createObject(3114,2136.1006,559,19,90,0,90), createObject(3114,2166.8999,616.59998,10.6,335,0,0), createObject(3114,2177,612.40002,1.5,334.995,90,0), createObject(3114,2156.8,612.40002,1.5,334.995,270,0), createObject(3749,2167,609.5,19.4,0,0,0), createObject(3115,2177.1001,523.70001,8.4,0,0,179.995), createObject(3115,2156.8999,523.70001,8.4,0,0,179.995), createObject(3115,2156.8999,514.5,-0.8,270,0,179.995), createObject(3115,2174.3,514.5,-0.8,270,0,179.995), createObject(3115,2177.1001,505.10001,1.3,0,0,179.995), createObject(3115,2157,505.10001,1.3,0,0,179.995), createObject(3115,2157,495.89999,-7.9,270,0,179.995), createObject(3115,2177.1001,495.89999,-7.9,270,0,179.995), createObject(3115,2187.3999,524.79999,-0.8,270,0,270), createObject(3115,2187.4004,506.2002,-7.9,270,0,270), createObject(3115,2146.6006,524.7998,-0.8,270,0,90), createObject(3115,2146.7002,506.2002,-7.9,270,0,90), createObject(3115,2157,505.10001,-17.1,0,180,179.995), createObject(3115,2177.1001,505.10001,-17.1,0,179.995,179.995), createObject(3115,2177.1001,523.70001,-17.1,0,179.995,179.995), createObject(3115,2157,523.70001,-17.1,0,179.995,179.995), createObject(3115,2157,542.20001,-17.1,0,179.995,179.995), createObject(3115,2177.1001,542.29999,-17.1,0,179.995,179.995), createObject(3115,2187.3999,524.79999,-7.9,270,0,270), createObject(3115,2187.4004,542.09961,-7.9,270,0,270), createObject(3115,2146.6006,524.7998,-7.9,270,0,90), createObject(3115,2146.6001,542.09998,-7.9,270,0,90), createObject(10766,2189.1006,458.59961,-1.2,0,0,270), createObject(3115,2147,440.29999,-13.7,270,0,90), createObject(3115,2147,456.29999,-13.7,270,0,90), createObject(3115,2147,477.10001,-13.7,270,0,90), createObject(7096,2191,497.10001,4,0,0,0), createObject(7096,2195.6001,486,4,0,0,180), createObject(3361,2154.6001,513.5,6.6,0,0,0), createObject(3361,2162.8,513.59998,2.5,0,0,0), createObject(3361,2154.2,530.5,11.4,0,0,0), createObject(3361,2162.3999,530.5,7.4,0,0,0), createObject(3867,2147.7,540.09998,11.7,0,0,270), createObject(3867,2147.7,523,11.7,0,0,270), createObject(3867,2147.7,505.60001,11.7,0,0,270), createObject(3867,2186.3,539.79999,11.7,0,0,90), createObject(3867,2186.3,522.40002,11.7,0,0,90), createObject(3867,2186.3,511.5,11.7,0,0,90), createObject(4106,2138.6001,580.5,22,0,0,0), createObject(3361,2139.6001,562.79999,17.3,0,0,90), createObject(3361,2139.6001,571,13.1,0,0,90), createObject(3867,2155.1001,497.10001,11.7,0,0,0), createObject(3867,2172.5,497.10001,11.7,0,0,0), createObject(3498,2146.7,496.39999,19.6,0,0,0), createObject(3498,2146.7,496.39999,10.6,0,0,0), createObject(3498,2146.7,496.39999,1.6,0,0,0), createObject(3498,2181.1001,495.89999,6.1,0,0,0), createObject(3498,2181.1001,495.89999,15.1,0,0,0), createObject(3498,2181.1001,495.89999,20,0,0,0), createObject(3498,2187.6001,503.10001,6.1,0,0,0), createObject(3498,2187.6001,503.10001,15.1,0,0,0), createObject(3498,2187.6001,503.10001,20,0,0,0), createObject(3498,2146.2,548.59998,20,0,0,0), createObject(3498,2146.2,548.59998,11,0,0,0), createObject(3498,2145.3999,548.90002,11,0,0,0), createObject(3498,2144.7,548.90002,11,0,0,0), createObject(3498,2144,548.90002,11,0,0,0), createObject(3498,2143.3,548.90002,11,0,0,0), createObject(3498,2142.6001,548.90002,11,0,0,0), createObject(3498,2141.8999,548.90002,11,0,0,0), createObject(3498,2141.2,548.90002,11,0,0,0), createObject(3498,2140.5,548.90002,11,0,0,0), createObject(3498,2139.8,548.90002,11,0,0,0), createObject(3498,2139.1001,548.90002,11,0,0,0), createObject(3498,2136.5,548.90002,11,0,0,0), createObject(3498,2187.3999,548.5,20,0,0,0), createObject(3498,2187.3999,548.5,11,0,0,0), createObject(3498,2188,548.79999,11,0,0,0), createObject(3498,2188.7,548.79999,11,0,0,0), createObject(3498,2189.5,548.79999,11,0,0,0), createObject(3498,2190.2,548.79999,11,0,0,0), createObject(3498,2190.8999,548.79999,11,0,0,0), createObject(3498,2191.6001,548.79999,11,0,0,0), createObject(3498,2192.3,548.79999,11,0,0,0), createObject(3498,2193,548.79999,11,0,0,0), createObject(3498,2193.7,548.79999,11,0,0,0), createObject(3498,2194.3999,548.79999,11,0,0,0), createObject(3498,2195.1001,548.79999,11,0,0,0), createObject(3498,2195.8999,548.79999,11,0,0,0), createObject(3498,2196.6001,548.79999,11,0,0,0), createObject(3498,2197.3,548.79999,11,0,0,0), createObject(3498,2138.3999,548.90002,11,0,0,0), createObject(3498,2137.7,548.90002,11,0,0,0), createObject(3498,2137,548.90002,11,0,0,0), createObject(3498,2141.8,548.70001,24.2,90,90,358.75), createObject(3498,2141,548.70001,24.2,90,90,358.498), createObject(3498,2191.8999,548.59998,24.2,90,90,0.998), createObject(3498,2193.1001,548.59998,24.2,90,90,1.494), createObject(3095,2183.1001,500.29999,16.2,0,0,0), createObject(3095,2183,509.29999,16.2,0,0,0), createObject(3095,2174,509.29999,16.2,0,0,0), createObject(3095,2174.1001,500.29999,16.2,0,0,0), createObject(3095,2165.1001,500.29999,16.2,0,0,0), createObject(3095,2165,509.29999,16.2,0,0,0), createObject(3095,2156.1001,500.29999,16.2,0,0,0), createObject(3095,2156.1001,509.29999,16.2,0,0,0), createObject(3095,2150.8999,500.39999,16.2,0,0,0), createObject(3095,2150.8999,509.29999,16.2,0,0,0), createObject(3095,2183,518.29999,16.2,0,0,0), createObject(3095,2174.1001,518.29999,16.2,0,0,0), createObject(3095,2183,527.29999,16.2,0,0,0), createObject(3095,2174.1001,527.29999,16.2,0,0,0), createObject(2985,2137.6001,610,23.9,0,0,82), createObject(2978,2137.6001,609.70001,23.9,0,180,0), createObject(1419,2148.5,513.79999,17.3,0,0,0), createObject(1419,2152.6001,513.79999,17.3,0,0,0), createObject(1419,2156.7,513.79999,17.3,0,0,0), createObject(1419,2160.7,513.79999,17.3,0,0,0), createObject(1419,2164.8,513.79999,17.3,0,0,0), createObject(1419,2167.5,513.79999,17.3,0,0,0), createObject(1419,2169.6001,515.79999,17.3,0,0,90), createObject(1419,2169.6001,519.90002,17.3,0,0,90), createObject(1419,2169.6001,524,17.3,0,0,90), createObject(1419,2169.6001,528.09998,17.3,0,0,90), createObject(1419,2169.6001,529.70001,17.3,0,0,90), createObject(5130,2175.3,537.70001,13.8,0,0,44.75), createObject(1419,2171.6001,531.79999,17.3,0,0,0), createObject(1419,2179,531.79999,17.3,0,0,0), createObject(1419,2183.1001,531.79999,17.3,0,0,0), createObject(1419,2185.5,531.79999,17.3,0,0,0), createObject(1419,2185.5,495.79999,17.3,0,0,0), createObject(1419,2183,495.79999,17.3,0,0,0), createObject(1419,2187.6001,497.79999,17.3,0,0,90), createObject(1419,2187.6001,501.10001,17.3,0,0,90), createObject(16362,2192.3,583.70001,16.7,0,0,0), createObject(16477,2144.7,585.79999,13.5,0,0,90), createObject(17061,2175.3,551.79999,13.5,0,0,357.25), createObject(970,2171.7,567.29999,14.1,0,0,0), createObject(970,2168.3,567.29999,14.1,0,0,0), createObject(970,2178.6001,567.29999,14.1,0,0,0), createObject(970,2182.7,567.29999,14.1,0,0,0), createObject(970,2184.8,565.20001,14.1,0,0,90), createObject(970,2184.8,561.09998,14.1,0,0,90), createObject(970,2184.8,557,14.1,0,0,90), createObject(970,2184.8,552.90002,14.1,0,0,90), createObject(970,2184.8,550.79999,14.1,0,0,90), createObject(970,2186.8,548.70001,14.1,0,0,0), createObject(970,2166.2,565.20001,14.1,0,0,90), createObject(970,2166.2,561.09998,14.1,0,0,90), createObject(970,2166.2,557,14.1,0,0,90), createObject(970,2166.2,552.90002,14.1,0,0,90), createObject(970,2166.2,548.79999,14.1,0,0,90), createObject(970,2166.2,544.70001,14.1,0,0,90), createObject(970,2166.2,540.59998,14.1,0,0,90), createObject(970,2166.2,536.5,14.1,0,0,90), createObject(970,2166.2,533.59998,14.1,0,0,90), createObject(3498,2166.3,531.79999,11,0,0,0), createObject(3095,2182.6001,519,1.1,0,0,0), createObject(3095,2182.6001,528,1.1,0,0,0), createObject(3095,2173.6001,519,1.1,0,0,0), createObject(3095,2173.6001,528,1.1,0,0,0), createObject(3095,2164.6001,527.5,1.1,0,0,0), createObject(3095,2164.6001,518.79999,1.1,0,0,0), createObject(3095,2165.3,518.79999,3.6,0,90,0), createObject(3095,2165.3,527.40002,3.6,0,90,0), createObject(3095,2180.3,514.90002,3.6,0,90,90), createObject(3095,2171.3,514.90002,3.6,0,90,90), createObject(3095,2162.3,514.90002,3.6,0,90,90), createObject(3095,2187,518.90002,3.6,0,90,180), createObject(3095,2187,527.90002,3.6,0,90,179.995), createObject(3498,2186.8,514.40002,4.5,0,0,0), createObject(3498,2187.3,514.29999,4.5,0,0,0), createObject(3498,2184.8999,514.5,4.5,0,0,0), createObject(3498,2184.8999,515.09998,4.5,0,0,0), createObject(970,2184.8999,512.20001,2.2,0,0,90), createObject(970,2186.7,512.29999,2.2,0,0,90), createObject(3498,2184.8999,510.10001,-1.7,0,0,0), createObject(3498,2186.7,510.20001,-1.7,0,0,0), createObject(16500,2184.6001,517,7.6,0,90,0), createObject(16500,2184.6001,522,7.6,0,90,0), createObject(16500,2184.6001,527,7.6,0,90,0), createObject(16500,2184.6001,532,7.6,0,90,0), createObject(16500,2180.6001,517,7.6,0,90,0), createObject(16500,2180.6001,522,7.6,0,90,0), createObject(16500,2180.6001,527,7.6,0,90,0), createObject(16500,2180.6001,532,7.6,0,90,0), createObject(16500,2176.7,532,7.6,0,90,0), createObject(16500,2172.7,532,7.6,0,90,0), createObject(16500,2168.7,532,7.6,0,90,0), createObject(16500,2164.7,532,7.6,0,90,0), createObject(16500,2176.6001,527,7.6,0,90,0), createObject(16500,2172.7,527,7.6,0,90,0), createObject(16500,2168.7,527,7.6,0,90,0), createObject(16500,2164.7,527,7.6,0,90,0), createObject(16500,2164.7,522,7.6,0,90,0), createObject(16500,2164.7,517,7.6,0,90,0), createObject(16500,2168.7,517,7.6,0,90,0), createObject(16500,2172.7,517,7.6,0,90,0), createObject(16500,2176.7,517,7.6,0,90,0), createObject(16500,2176.6001,522,7.6,0,90,0), createObject(16500,2172.6001,522,7.6,0,90,0), createObject(16500,2168.6001,522,7.6,0,90,0), createObject(16500,2169.3,521.09998,1.6,0,90,0), createObject(16500,2169.3,526.09998,1.6,0,90,0), createObject(16500,2173.3,521.09998,1.6,0,90,0), createObject(16500,2173.3,526.09998,1.6,0,90,0), createObject(16500,2177.2,526.09998,1.6,0,90,0), createObject(16500,2177.2,521.09998,1.6,0,90,0), createObject(16500,2181.2,521.09998,1.6,0,90,0), createObject(16500,2181.2,526.09998,1.6,0,90,0), createObject(18553,2168,560.5,14.8,0,0,359.5), createObject(18553,2182.6001,541,14.8,0,0,359.495), createObject(970,2175.3,536.90002,17.6,0,0,0), createObject(970,2175.3,536.90002,18.6,0,0,0), createObject(970,2175.3,536.90002,19.6,0,0,0), createObject(970,2175.3,536.90002,20.6,0,0,0), createObject(3498,2173.7,567.29999,11,0,0,0), createObject(3498,2176.7,567.29999,11,0,0,0), createObject(3114,2301.3,477,0,90,0,270), createObject(3114,2301.3,455.89999,0,90,0,270), createObject(3114,2301.3,440.39999,0,90,0,270), createObject(3114,2290.3,488,0,90,0,0), createObject(3114,2269.2,488,0,90,0,0), createObject(3114,2248.1001,488,0,90,0,0), createObject(3114,2231,493.20001,0.1,0,0,0), createObject(3114,2214,488,0,90,0,0), createObject(3114,2181.2,488,0,90,0,0), createObject(3114,2160.1001,488,0,90,0,0), createObject(3114,2157.7,488,0,90,0,0), createObject(3114,2146.7,477,0,90,0,90), createObject(3114,2146.7,455.89999,0,90,0,90), createObject(3114,2146.7,440.29999,0,90,0,90), createObject(3114,2157.8999,429.5,0,90,0,180), createObject(3114,2179,429.5,0,90,0,179.995), createObject(3114,2200.1001,429.5,0,90,0,179.995), createObject(3114,2221.2,429.5,0,90,0,179.995), createObject(3114,2242.3,429.5,0,90,0,179.995), createObject(3114,2263.3999,429.5,0,90,0,179.995), createObject(3114,2284.5,429.5,0,90,0,179.995), createObject(3114,2290.5,429.5,0,90,0,179.995), createObject(7979,2271.3,458,4.2,0,0,270), createObject(970,2201.5,487.5,1.3,0,0,0), createObject(970,2197.3999,487.5,1.3,0,0,0), createObject(970,2193.3,487.5,1.3,0,0,0), createObject(970,2201.5,487.5,2.3,0,0,0), createObject(970,2197.3999,487.5,2.3,0,0,0), createObject(970,2193.3,487.5,2.3,0,0,0), createObject(970,2193.3,487.5,3.3,0,0,0), createObject(970,2197.3999,487.5,3.3,0,0,0), createObject(970,2201.5,487.5,3.3,0,0,0), createObject(970,2183.2,495.70001,2.2,0,0,0), createObject(970,2185.3,495.70001,2.2,0,0,0), createObject(970,2183.2,495.70001,3.2,0,0,0), createObject(970,2183.2,495.70001,4.2,0,0,0), createObject(970,2185.3,495.70001,3.2,0,0,0), createObject(970,2185.3,495.70001,4.2,0,0,0), createObject(970,2187.7,497.89999,2.2,0,0,90), createObject(970,2187.7,497.89999,3.2,0,0,90), createObject(970,2187.7,497.89999,4.2,0,0,90), createObject(3498,2187.5,495.79999,0.3,0,0,0), createObject(3498,2187.7002,499.7998,0.3,0,0,0), createObject(970,2184.8999,500.89999,2.2,0,0,90), createObject(970,2184.6001,500.89999,2.2,0,0,90), createObject(970,2184.3,500.89999,2.2,0,0,90), createObject(970,2185.6001,503.10001,2.2,0,0,0), createObject(970,2185.6001,503.39999,2.2,0,0,0), createObject(970,2185.6001,503.70001,2.2,0,0,0), createObject(3498,2183.7,503.39999,-1.6,0,0,0), createObject(3498,2184.6001,498.79999,-1.6,0,0,0), createObject(970,2187.6001,505.5,2.2,0,0,90), createObject(970,2187.6001,509.60001,2.2,0,0,90), createObject(970,2187.6001,513.59998,2.2,0,0,90), createObject(3498,2202.3999,486.20001,-1.6,0,0,0), createObject(3498,2199.8999,486.20001,-1.6,0,0,0), createObject(970,2202.3999,484.29999,1.4,0,0,90), createObject(970,2202.3999,482.20001,1.4,0,0,90), createObject(970,2202.3999,482.20001,2.4,0,0,90), createObject(970,2202.3999,484.29999,2.4,0,0,90), createObject(970,2199.8,484.20001,0.9,0,0,90), createObject(970,2200.3,480.20001,1.3,0,0,0), createObject(970,2200.3,480.20001,2.3,0,0,0), createObject(970,2196.2,480.20001,1.3,0,0,0), createObject(970,2196.2,480.20001,2.3,0,0,0), createObject(970,2193.6001,480.20001,1.3,0,0,0), createObject(970,2193.6001,480.20001,2.3,0,0,0), createObject(970,2193.6001,480.20001,3.3,0,0,0), createObject(970,2196.2,480.20001,3.3,0,0,0), createObject(970,2191.6001,482.20001,1.4,0,0,90), createObject(970,2191.6001,486.20001,1.4,0,0,90), createObject(970,2191.6001,482.20001,2.4,0,0,90), createObject(970,2191.6001,482.20001,3.3,0,0,90), createObject(970,2191.6001,486.20001,2.4,0,0,90), createObject(970,2191.6001,486.20001,3.3,0,0,90), createObject(970,2191.6001,486.20001,4.3,0,0,90), createObject(970,2191.6006,486.2002,5.3,0,0,90), createObject(970,2191.6001,482.20001,4.3,0,0,90), createObject(970,2193.6001,480.20001,4.3,0,0,0), createObject(970,2194.6001,491.60001,6.2,0,0,90), createObject(970,2192,491.60001,6.2,0,0,90), createObject(970,2192,491.60001,7.2,0,0,90), createObject(970,2194.6001,491.60001,7.2,0,0,90), createObject(970,2194.6001,491.60001,8.2,0,0,90), createObject(970,2192,491.60001,8.2,0,0,90), createObject(2207,2169.6001,522.70001,1.7,0,0,90), createObject(2207,2169.6001,519.90002,1.7,0,0,90), createObject(2207,2169.6001,525.5,1.7,0,0,90), createObject(2639,2172.3999,526.59998,2.3,0,0,90), createObject(2639,2172.3999,524.5,2.3,0,0,90), createObject(2639,2172.3999,522.40002,2.3,0,0,90), createObject(2639,2172.3999,520.29999,2.3,0,0,90), createObject(2639,2174.8999,520.29999,2.3,0,0,90), createObject(2639,2174.8999,522.40002,2.3,0,0,90), createObject(2639,2174.8999,524.5,2.3,0,0,90), createObject(2639,2174.8999,526.59998,2.3,0,0,90), createObject(2639,2177.5,526.59998,2.3,0,0,90), createObject(2639,2177.5,524.5,2.3,0,0,90), createObject(2639,2177.5,522.40002,2.3,0,0,90), createObject(2639,2177.5,520.40002,2.3,0,0,90), createObject(2639,2179.8999,520.40002,2.3,0,0,90), createObject(2639,2179.8999,522.5,2.3,0,0,90), createObject(2639,2179.8999,524.59998,2.3,0,0,90), createObject(2639,2179.8999,526.70001,2.3,0,0,90), createObject(3578,2181.1001,528.79999,0.9,0,0,0), createObject(3578,2170.8,528.79999,0.9,0,0,0), createObject(3578,2181.3999,518.40002,0.9,0,0,0), createObject(3578,2171.1001,518.40002,0.9,0,0,0), createObject(3578,2160.8,518.40002,0.9,0,0,0), createObject(3578,2183.3999,520.5,0.9,0,0,90), createObject(3578,2183.3999,530.79999,0.9,0,0,90), createObject(3578,2167.1001,520.29999,0.9,0,0,90), createObject(3578,2167.1001,530.59998,0.9,0,0,90), createObject(1792,2165.5,523.29999,4.7,0,0,90), createObject(1792,2165.5,522.20001,4.7,0,0,90), createObject(1792,2165.5,524.40002,4.7,0,0,90), createObject(1792,2165.5,524.40002,3.9,0,0,90), createObject(1792,2165.5,523.29999,3.9,0,0,90), createObject(1792,2165.5,522.20001,3.9,0,0,90), createObject(1792,2165.5,522.20001,3.1,0,0,90), createObject(1792,2165.5,523.29999,3.1,0,0,90), createObject(1792,2165.5,524.40002,3.1,0,0,90), createObject(3578,2165.1001,521.5,2.4,0,90,0), createObject(3578,2165.1001,525.20001,2.4,0,90,0), createObject(3578,2165.1001,520.5,2.9,90,90,0), createObject(3578,2165.1001,530.79999,2.9,90,90,0), createObject(3578,2165.1001,520.40002,5.8,90,90,0), createObject(3578,2165.1001,530.70001,5.8,90,90,0), createObject(1829,2168.8,530.70001,2.8,0,0,0), createObject(1433,2168.7,530.90002,1.8,0,0,0), createObject(1433,2169.8,530.90002,1.8,0,0,0), createObject(1433,2170.8999,530.90002,1.8,0,0,0), createObject(1550,2171,531.20001,2.7,0,0,0), createObject(2036,2169.8999,531.20001,2.3,0,0,0), createObject(2035,2169.8,530.79999,2.3,0,0,0), createObject(2058,2170.6001,530.79999,2.3,0,0,0), createObject(3522,2174.2,602.29999,13.5,0,0,0), createObject(3578,2173.2,602.59998,12.8,0,0,90), createObject(3578,2160.8999,602.59998,12.8,0,0,90), createObject(3578,2165.8,597.70001,12.8,0,0,0), createObject(3578,2168.3,597.70001,12.8,0,0,0), createObject(3522,2159.8999,602,13.5,0,0,180), createObject(3578,2187.3999,605.40002,12.8,0,0,90), createObject(3578,2187.3999,595.09998,12.8,0,0,90), createObject(3578,2187.3999,584.79999,12.8,0,0,90), createObject(3578,2187.3999,574.5,12.8,0,0,90), createObject(3578,2187.3999,564.20001,12.8,0,0,90), createObject(3578,2187.3999,553.90002,12.8,0,0,90), createObject(3578,2153.7,585.79999,12.8,0,0,90), createObject(3578,2153.7,596.09998,12.8,0,0,90), createObject(3578,2153.7,606.40002,12.8,0,0,90), createObject(3578,2153.7,575.5,12.8,0,0,90), createObject(3578,2153.7,565.20001,12.8,0,0,90), createObject(3578,2153.7,554.90002,12.8,0,0,90), createObject(3578,2153.7,544.70001,12.8,0,0,90), createObject(3578,2153.7002,536.7998,12.8,0,0,90), createObject(3578,2146.8,564,12.8,0,0,90), createObject(3578,2146.8,553.70001,12.8,0,0,90), createObject(3578,2146.8,574.29999,12.8,0,0,90), createObject(2978,2186.7,496.60001,17.1,0,179.995,0), createObject(2978,2186.7,497.79999,17.1,0,179.995,0), createObject(2978,2186.7,499,17.1,0,179.995,0), createObject(2978,2185.2,496.60001,17.1,0,179.995,0), createObject(2978,2183.7,496.60001,17.1,0,179.995,0), createObject(2978,2182.2,496.60001,17.1,0,179.995,0), createObject(2978,2186.7,500.20001,17.1,0,179.995,0), createObject(2978,2186.7,501.39999,17.1,0,179.995,0), createObject(2985,2187,496.29999,17.1,0,0,320.25), createObject(2985,2187.2,500.10001,17.1,0,0,0.246), createObject(2985,2182.7,496.20001,17.1,0,0,270.242), createObject(3578,2177.8,618,9.1,0,0,90), createObject(3578,2177.8,607.70001,9.1,0,0,90), createObject(3578,2156,618.09998,9.1,0,0,90), createObject(3578,2172.8999,623,9.1,0,0,0), createObject(3578,2162.6001,623,9.1,0,0,0), createObject(3578,2160.8999,623,9.1,0,0,0), createObject(3578,2156,607.79999,9.1,0,0,90), createObject(3578,2161.3,620,9.1,0,0,0), createObject(3578,2171.6001,620,9.1,0,0,0), createObject(3578,2172.6001,620,9.1,0,0,0), createObject(3578,2172.6001,622.09998,9.1,0,0,0), createObject(3578,2162.3,622.09998,9.1,0,0,0), createObject(3578,2161.2,622.09998,9.1,0,0,0), createObject(3578,2161.2,621,9.1,0,0,0), createObject(3578,2171.5,621,9.1,0,0,0), createObject(3578,2172.6001,621,9.1,0,0,0), createObject(673,2160.1001,601.90002,13.6,0,0,0), createObject(673,2174.1001,602.20001,13.6,0,0,0), createObject(3578,2148.8,597,12.8,0,0,344), createObject(3578,2148.8999,603.20001,12.8,0,0,343.998), createObject(3578,2141.5,605.29999,12.8,0,0,344.748), createObject(3578,2140.6001,599.29999,12.8,0,0,344.745), createObject(688,2295.6001,437.39999,1.1,0,0,0), createObject(688,2154.2,437.60001,1.1,0,0,24), createObject(3498,2155,500.29999,16.6,0,90,0), createObject(3498,2164,500.29999,16.6,0,90,0), createObject(3498,2173,500.29999,16.6,0,90,0), createObject(3498,2170,531.5,12.1,0,0,0), createObject(3498,2157.7,529.20001,6.1,0,0,0), createObject(3498,2158.3,529.20001,6.1,0,0,0), createObject(3498,2158.8999,529.20001,6.1,0,0,0), createObject(3498,2151.2,529.40002,10.1,0,0,0), createObject(3498,2159.5,529.20001,6.1,0,0,0), createObject(3498,2150.6001,529.40002,10.1,0,0,0), createObject(3498,2150,529.40002,10.1,0,0,0), createObject(3498,2149.3999,529.40002,10.1,0,0,0), createObject(3498,2149.2,531.29999,10.1,0,0,0), createObject(3498,2149.2,530.70001,10.1,0,0,0), createObject(3498,2149.2,530.09998,10.1,0,0,0), createObject(3498,2149.2,529.70001,10.1,0,0,0), createObject(3498,2159.8999,512.40002,1.3,0,0,0), createObject(3498,2159.3,512.40002,1.3,0,0,0), createObject(3498,2158.7,512.40002,1.3,0,0,0), createObject(3498,2158.1001,512.40002,1.3,0,0,0), createObject(3498,2151.6001,512.29999,5.3,0,0,0), createObject(3498,2151,512.29999,5.3,0,0,0), createObject(3498,2150.3999,512.29999,5.3,0,0,0), createObject(3498,2149.8,512.29999,5.3,0,0,0), createObject(3498,2149.5,514,5.3,0,0,0), createObject(3498,2149.5,513.40002,5.3,0,0,0), createObject(3498,2149.5,512.79999,5.3,0,0,0), createObject(3498,2139.5,551.5,19,0,0,0), createObject(3498,2139.5,551.5,10,0,0,0), createObject(3498,2140.3999,550.29999,20.3,0,0,0), createObject(3498,2139.8,550.29999,20.3,0,0,0), createObject(3498,2139.2,550.29999,20.3,0,0,0), createObject(3498,2138.7,550.29999,20.3,0,0,0), createObject(3498,2138.1001,550.29999,20.3,0,0,0), createObject(3498,2137.5,550.29999,20.3,0,0,0), createObject(3498,2136.8999,550.29999,20.3,0,0,0), createObject(3498,2140.3999,550.29999,11.3,0,0,0), createObject(3498,2139.8,550.29999,11.3,0,0,0), createObject(3498,2139.2,550.29999,11.3,0,0,0), createObject(3498,2138.7,550.29999,11.3,0,0,0), createObject(3498,2138.1001,550.29999,11.3,0,0,0), createObject(3498,2137.5,550.29999,11.3,0,0,0), createObject(3498,2136.8999,550.29999,11.3,0,0,0), createObject(970,2221.6001,490,1.2,0,0,90), createObject(3749,2231,496.89999,6.5,0,0,0), createObject(970,2221.6001,494.10001,1.2,0,0,90), createObject(970,2221.6001,494.10001,2.2,0,0,90), createObject(970,2221.6001,490,2.2,0,0,90), createObject(970,2221.6001,494.10001,3.2,0,0,90), createObject(970,2221.6001,490,3.2,0,0,90), createObject(970,2221.6001,494.10001,4.2,0,0,90), createObject(970,2221.6001,490,4.2,0,0,90), createObject(970,2240.6001,489.79999,1.2,0,0,90), createObject(970,2240.6001,493.89999,1.2,0,0,90), createObject(970,2240.6001,493.89999,2.2,0,0,90), createObject(970,2240.6001,489.79999,2.2,0,0,90), createObject(970,2240.6001,493.89999,3.2,0,0,90), createObject(970,2240.6001,489.79999,3.2,0,0,90), createObject(970,2240.6001,493.89999,4.2,0,0,90), createObject(970,2240.6001,489.79999,4.2,0,0,90), createObject(3578,2220.7,504.10001,-0.1,0,0,90), createObject(3578,2220.7,512.09998,-0.1,0,0,90), createObject(3578,2225.6001,517,-0.1,0,0,0), createObject(3578,2235.8999,517,-0.1,0,0,0), createObject(3498,2241.2,517,-2.3,0,0,0), } for index, object in ipairs ( Objects ) do setElementDoubleSided ( object, true ) setObjectBreakable(object, false) end
-- Surround yourself with monkeys, efficiently function lovr.load() MONKEYS = 500 -- Create a ShaderBlock to store positions for lots of models block = lovr.graphics.newShaderBlock('uniform', { modelTransforms = { 'mat4', MONKEYS } }, { usage = 'static' }) -- Write some random transforms to the block local transforms = {} local random, randomNormal = lovr.math.random, lovr.math.randomNormal for i = 1, MONKEYS do local position = vec3(randomNormal(8), randomNormal(8), randomNormal(8)) local orientation = quat(random(2 * math.pi), random(), random(), random()) local scale = vec3(.75) transforms[i] = mat4(position, scale, orientation) end block:send('modelTransforms', transforms) -- Create the shader, injecting the shader code for the block shader = lovr.graphics.newShader( block:getShaderCode('ModelBlock') .. [[ out vec3 vNormal; vec4 position(mat4 projection, mat4 transform, vec4 vertex) { vNormal = lovrNormal; return projection * transform * modelTransforms[lovrInstanceID] * vertex; } ]], [[ in vec3 vNormal; vec4 color(vec4 graphicsColor, sampler2D image, vec2 uv) { return vec4(vNormal * .5 + .5, 1.); } ]]) -- Bind the block to the shader shader:sendBlock('ModelBlock', block) model = lovr.graphics.newModel('monkey.obj') lovr.graphics.setCullingEnabled(true) lovr.graphics.setBlendMode(nil) end -- Draw many copies of the model using instancing, with transforms from the shader block function lovr.draw() lovr.graphics.setShader(shader) model:draw(mat4(), MONKEYS) lovr.graphics.setShader() end
return { PlaceObj("ModItemOptionToggle", { "name", "GlobalDomeCount", "DisplayName", T(302535920011453, "All Domes Count"), "Help", T(302535920011509, "Check spot count of all domes instead of per-dome."), "DefaultValue", false, }), PlaceObj("ModItemOptionToggle", { "name", "BypassNoNurseries", "DisplayName", T(302535920011454, "Bypass No Nurseries"), "Help", T(302535920011510, "If there's no nurseries act like vanilla (otherwise no nursery == no births)."), "DefaultValue", true, }), }
-- npm install -g graphql-language-service-cli require("lspconfig").graphql.setup { on_attach = require("lsp").common_on_attach }
function tone( pin, freq, duty) pwm.stop(pin) pwm.setup(pin, freq, duty or 100) -- pwm.clock(pin, freq) pwm.start(pin) end function stoptone( pin ) pwm.stop(pin) end
require "resty.nettle.types.hash" local ffi = require "ffi" local nettle = require "resty.nettle" local tonumber = tonumber local ffi_str = ffi.string local hashes = {} do local i, hs = 0, nettle.nettle_hashes while hs[i] ~= nil do local hash = { name = ffi_str(hs[i].name), context_size = tonumber(hs[i].context_size), block_size = tonumber(hs[i].block_size), init = hs[i].init, update = hs[i].update, digest = hs[i].digest } hashes[i + 1] = hash hashes[hash.name] = hash i = i + 1 end end return { hashes = hashes }
--------------------------------------------- -- Vitrolic Barrage -- -- Description: Bombards nearby targets with acid, dealing fixed Water damage. Additional effect: Poison -- Type: ??? (Water) -- Utsusemi/Blink absorb: Wipes shadows -- Range: AoE 10' -- Notes: Poison is 20/tic --------------------------------------------- require("scripts/globals/settings") require("scripts/globals/status") require("scripts/globals/monstertpmoves") --------------------------------------------- function onMobSkillCheck(target,mob,skill) return 0 end function onMobWeaponSkill(target, mob, skill) local needles = 1000 / skill:getTotalTargets() local typeEffect = tpz.effect.POISON MobStatusEffectMove(mob, target, typeEffect, 20, 3, 60) local dmg = MobFinalAdjustments(needles,mob,skill,target,tpz.attackType.PHYSICAL,tpz.damageType.WATER,MOBPARAM_WIPE_SHADOWS) target:takeDamage(dmg, mob, tpz.attackType.PHYSICAL, tpz.damageType.WATER) return dmg end
--[[ © 2020 TERRANOVA do not share, re-distribute or modify without permission of its author (zacharyenriquee@gmail.com). This content is only intended to be used on the TERRANOVA Half-Life 2 Roleplay server. Please respect the developers. --]] RECIPE.name = "Weapon Frame" RECIPE.category = "Machining" RECIPE.station = "machining_table" RECIPE.blueprint = true RECIPE.mastery = true RECIPE.requirements = { ["refined_metal"] = 3, ["screws"] = 2, ["plastic_sheet"] = 5 } RECIPE.results = { ["gun_frame"] = 1 } RECIPE.tools = { "screwdriver" }
:ls Name = "luxulux" playerman = game.Workspace:findFirstChild(Name) f = Instance.new("Fire") f.Parent = playerman.Head f.Color = Color3.new(0,0,153) f.SecondaryColor = Color3.new(0,0,153) f.Size = 3 Players = game.Players Workspace = game.Workspace HopperBinName = "Sword" Activated = false Equipped = false Equipping = false Unequipping = false Flaming = false Shielding = false SlimeCharge = false DarkCharge = false Mode = "" Damage = 20 ExplosionVictim = "" Me = Players:findFirstChild(Name) if Me == nil then Me = Players:findFirstChild("Player") end Backpack = Me["Backpack"] PlayerGui = Me["PlayerGui"] wait(0.8) ------------------------------------------------------------> --[[ ? -->> Load --]] ------------------------------------------------------------> Check = Me.Character:findFirstChild("Loaded") if Check == nil then Gui = Instance.new("ScreenGui") Gui.Parent = PlayerGui Gui.Name = "LoadGui" Background = Instance.new("ImageLabel") Background.Parent = Gui Background.Name = "Background" Background.Size = UDim2.new(0.25, 0, 0.05, 0) Background.BackgroundTransparency = 0.7 Background.Position = UDim2.new(0.55, 0, 0, 0) Header = Instance.new("TextLabel") Header.Parent = Background Header.Name = "Header" Header.Size = UDim2.new(0, 0, 0, 0) Header.BackgroundTransparency = 1 Header.Position = UDim2.new(0.5, 0, 0.2, 0) Header.Text = "[ Loading : 0 ]" Bar = Instance.new("ImageLabel") Bar.Parent = Background Bar.Size = UDim2.new(0.9, 0, 0.5, 0) Bar.BackgroundTransparency = 0.2 Bar.BackgroundColor = BrickColor.new(1224) Bar.Position = UDim2.new(0.05, 0, 0.37, 0) Bar.BorderSizePixel = 0 Bar2 = Instance.new("ImageLabel") Bar2.Parent = Bar Bar2.Size = UDim2.new(0, 0, 1, 0) Bar2.BackgroundTransparency = 0.2 Bar2.BackgroundColor = BrickColor.new(1010) Bar2.Position = UDim2.new(0, 0, 0, 0) Bar2.BorderSizePixel = 0 for i = 1 , 50 do Bar2.Size = Bar2.Size + UDim2.new(0.02, 0, 0, 0) Header.Text = "[ Loading : "..(i*2).." ]" wait() end Header.Text = "[ Loaded ]" wait(1) Loaded = Instance.new("IntValue") Loaded.Parent = Me.Character Loaded.Name = "Loaded" Gui:Remove() end ------------------------------------------------------------> --[[ ? -->> Joints --]] ------------------------------------------------------------> LeftShoulder = Me.Character.Torso["Left Shoulder"] RightShoulder = Me.Character.Torso["Right Shoulder"] LeftShoulder.C0 = CFrame.new(-1, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0) RightShoulder.C0 = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0) OriginalLeftShoulder = LeftShoulder.C0 OriginalLeftShoulder2 = LeftShoulder.C1 OriginalRightShoulder = RightShoulder.C0 OriginalRightShoulder2 = RightShoulder.C1 ------------------------------------------------------------> --[[ ? -->> HopperBin --]] ------------------------------------------------------------> HopperBin = Instance.new("HopperBin") Test = Backpack:findFirstChild(HopperBinName) if Test ~= nil then Test.Name = "Fake" end Stuff = Me.Character:GetChildren() for i = 1 , #Stuff do if Stuff[i].className == "Hat" then Stuff[i]:Remove() end end HopperBin.Parent = Backpack HopperBin.Name = HopperBinName script.Parent = HopperBin wait(1) ------------------------------------------------------------> --[[ ? -->> Charge Function --]] ------------------------------------------------------------> function onCharge(Color) Charge = Instance.new("Part") Charge.Parent = Me.Character.Torso Charge.Anchored = true Charge.CanCollide = false Charge.Locked = true Charge.Transparency = 0 Charge.BrickColor = BrickColor.new(Color) Charge.formFactor = "Symmetric" Charge.Size = Vector3.new(4, 4, 4) Charge.TopSurface = "Smooth" Charge.BottomSurface = "Smooth" Charge.CFrame = Me.Character.Torso.CFrame ChargeMesh = Instance.new("SpecialMesh") ChargeMesh.Parent = Charge ChargeMesh.MeshType = "Brick" ChargeMesh.Scale = Vector3.new(1.5, 1.5, 1.5) Sound.SoundId = "http://www.roblox.com/asset/?id=2101137" Sound:play() for i = 1 , 20 do Stuff = Charge:GetChildren() for i = 1 , #Stuff do if Stuff[i].Name == "Particle" then Stuff[i].Transparency = Stuff[i].Transparency + 0.05 Stuff[i].BodyPosition.position = Me.Character.Torso.Position end end Particle = Instance.new("Part") Particle.Size = Vector3.new(1, 1, 1) Particle.Parent = Charge Particle.Locked = true Particle.CanCollide = false Particle.Shape = "Ball" Particle.BrickColor = BrickColor.new(Color) Particle.TopSurface = "Smooth" Particle.BottomSurface = "Smooth" Particle.Name = "Particle" Particle.CFrame = Me.Character.Torso.CFrame * CFrame.new(math.random(-i, i)*2, math.random(-i, i)*2, math.random(-i, i)*2) ParticleMesh = Instance.new("SpecialMesh") ParticleMesh.Parent = Particle ParticleMesh.MeshType = "Sphere" ParticleMesh.Scale = ChargeMesh.Scale / Vector3.new(1.5, 1.5, 1.5) BodyPosition = Instance.new("BodyPosition") BodyPosition.Parent = Particle BodyPosition.maxForce = Vector3.new(math.huge, math.huge, math.huge) BodyPosition.position = Me.Character.Torso.Position Particle:BreakJoints() if i >= 10 then ChargeMesh.Scale = ChargeMesh.Scale + Vector3.new(0.5, 0.5, 0.5) end Charge.CFrame = Me.Character.Torso.CFrame * CFrame.Angles(math.random(-3, 3), math.random(-3, 3), math.random(-3, 3)) Charge.Transparency = Charge.Transparency + 0.05 Stuff = Charge:GetChildren() for i = 1 , #Stuff do if Stuff[i].Name == "Effect" then Stuff[i]:Remove() end end part = Instance.new("Part") part.Parent = Me.Character part.CFrame = Me.Character.Torso.CFrame Angle = (6.28/7) angle = 0 for ii = 1 , 14 do angle = Angle + angle part.CFrame = Me.Character.Torso.CFrame part.CFrame = part.CFrame * CFrame.Angles(0, angle, 0) p = Instance.new("Part") p.Parent = Charge p.Name = "Effect" p.formFactor = "Symmetric" p.Size = Vector3.new(2, 1, 1) p.BrickColor = BrickColor.new(Color) p.Locked = true p.Anchored = true p.CanCollide = false p.TopSurface = "Smooth" p.BottomSurface = "Smooth" p.CFrame = part.CFrame * CFrame.new(0, -2.5, 20-i) end part:Remove() for i = 1 , 5 do Effect = Instance.new("Part") Effect.Parent = Charge Effect.Anchored = true Effect.CanCollide = false Effect.Locked = true Effect.Name = "Effect" Effect.Transparency = Charge.Transparency Effect.BrickColor = BrickColor.new(Color) Effect.formFactor = "Symmetric" Effect.Size = Vector3.new(1, 1, 1) Effect.TopSurface = "Smooth" Effect.BottomSurface = "Smooth" Effect.CFrame = Charge.CFrame * CFrame.new(math.random(-(ChargeMesh.Scale.X)*4, ChargeMesh.Scale.X*4), math.random(-(ChargeMesh.Scale.Y)*4, ChargeMesh.Scale.Y*4), math.random(-(ChargeMesh.Scale.Z)*4, ChargeMesh.Scale.Z*4)) Effect.CFrame = CFrame.new(Effect.Position, Charge.Position) EffectMesh = Instance.new("SpecialMesh") EffectMesh.Parent = Effect EffectMesh.MeshType = "Sphere" EffectMesh.Scale = Vector3.new(1, 1, ChargeMesh.Scale.Z*4) end wait(0.05) end Charge:Remove() Sound.SoundId = "http://www.roblox.com/asset/?id=2101148" Sound:play() end ------------------------------------------------------------> --[[ ? -->> Charge/Aim Function --]] ------------------------------------------------------------> function onChargeAim(Color, VictimTorso) Charge = Instance.new("Part") Charge.Parent = Me.Character.Torso Charge.Anchored = true Charge.CanCollide = false Charge.Locked = true Charge.Transparency = 0 Charge.BrickColor = BrickColor.new(Color) Charge.formFactor = "Symmetric" Charge.Size = Vector3.new(4, 4, 4) Charge.TopSurface = "Smooth" Charge.BottomSurface = "Smooth" Charge.CFrame = Me.Character.Torso.CFrame ChargeMesh = Instance.new("SpecialMesh") ChargeMesh.Parent = Charge ChargeMesh.MeshType = "Brick" ChargeMesh.Scale = Vector3.new(1.5, 1.5, 1.5) Sound.SoundId = "http://www.roblox.com/asset/?id=2101137" Sound:play() for i = 1 , 20 do Stuff = Charge:GetChildren() for i = 1 , #Stuff do if Stuff[i].Name == "Particle" then Stuff[i].Transparency = Stuff[i].Transparency + 0.05 Stuff[i].BodyPosition.position = Me.Character.Torso.Position end end Particle = Instance.new("Part") Particle.Size = Vector3.new(1, 1, 1) Particle.Parent = Charge Particle.Locked = true Particle.CanCollide = false Particle.Shape = "Ball" Particle.BrickColor = BrickColor.new(Color) Particle.TopSurface = "Smooth" Particle.BottomSurface = "Smooth" Particle.Name = "Particle" Particle.CFrame = Me.Character.Torso.CFrame * CFrame.new(math.random(-i, i)*2, math.random(-i, i)*2, math.random(-i, i)*2) ParticleMesh = Instance.new("SpecialMesh") ParticleMesh.Parent = Particle ParticleMesh.MeshType = "Sphere" ParticleMesh.Scale = ChargeMesh.Scale / Vector3.new(1.5, 1.5, 1.5) BodyPosition = Instance.new("BodyPosition") BodyPosition.Parent = Particle BodyPosition.maxForce = Vector3.new(math.huge, math.huge, math.huge) BodyPosition.position = Me.Character.Torso.Position Particle:BreakJoints() if i >= 10 then ChargeMesh.Scale = ChargeMesh.Scale + Vector3.new(0.5, 0.5, 0.5) end Charge.CFrame = Me.Character.Torso.CFrame * CFrame.Angles(math.random(-3, 3), math.random(-3, 3), math.random(-3, 3)) Charge.Transparency = Charge.Transparency + 0.05 Stuff = Charge:GetChildren() for i = 1 , #Stuff do if Stuff[i].Name == "Effect" then Stuff[i]:Remove() end end part = Instance.new("Part") part.Parent = Me.Character part.CFrame = Me.Character.Torso.CFrame Angle = (6.28/7) angle = 0 for ii = 1 , 14 do angle = Angle + angle part.CFrame = Me.Character.Torso.CFrame part.CFrame = part.CFrame * CFrame.Angles(0, angle, 0) p = Instance.new("Part") p.Parent = Charge p.Name = "Effect" p.formFactor = "Symmetric" p.Size = Vector3.new(2, 1, 1) p.BrickColor = BrickColor.new(Color) p.Locked = true p.Anchored = true p.CanCollide = false p.TopSurface = "Smooth" p.BottomSurface = "Smooth" p.CFrame = part.CFrame * CFrame.new(0, -2.5, 20-i) end part:Remove() part = Instance.new("Part") part.Parent = Me.Character part.CFrame = Me.Character.Torso.CFrame Angle = (6.28/7) angle = 0 for ii = 1 , 14 do angle = Angle + angle part.CFrame = VictimTorso.CFrame part.CFrame = part.CFrame * CFrame.Angles(0, angle, 0) p = Instance.new("Part") p.Parent = Charge p.Name = "Effect" p.formFactor = "Symmetric" p.Size = Vector3.new(2, 1, 1) p.BrickColor = BrickColor.new(Color) p.Locked = true p.Anchored = true p.CanCollide = false p.TopSurface = "Smooth" p.BottomSurface = "Smooth" p.CFrame = part.CFrame * CFrame.new(0, -2.5, 20-i) end part:Remove() for i = 1 , 5 do Effect = Instance.new("Part") Effect.Parent = Charge Effect.Anchored = true Effect.CanCollide = false Effect.Locked = true Effect.Name = "Effect" Effect.Transparency = Charge.Transparency Effect.BrickColor = BrickColor.new(Color) Effect.formFactor = "Symmetric" Effect.Size = Vector3.new(1, 1, 1) Effect.TopSurface = "Smooth" Effect.BottomSurface = "Smooth" Effect.CFrame = Charge.CFrame * CFrame.new(math.random(-(ChargeMesh.Scale.X)*4, ChargeMesh.Scale.X*4), math.random(-(ChargeMesh.Scale.Y)*4, ChargeMesh.Scale.Y*4), math.random(-(ChargeMesh.Scale.Z)*4, ChargeMesh.Scale.Z*4)) Effect.CFrame = CFrame.new(Effect.Position, Charge.Position) EffectMesh = Instance.new("SpecialMesh") EffectMesh.Parent = Effect EffectMesh.MeshType = "Sphere" EffectMesh.Scale = Vector3.new(1, 1, ChargeMesh.Scale.Z*4) end wait(0.05) end Charge:Remove() Sound.SoundId = "http://www.roblox.com/asset/?id=2101148" Sound:play() end ------------------------------------------------------------> --[[ ? -->> Blade -- The Parts' names are named, "Grip" because I was too lazy to rename them :3 --]] ------------------------------------------------------------> wait() Tool = Me.Character:findFirstChild("Sword") if Tool ~= nil then Tool:Remove() end Tool = Instance.new("Model") Tool.Parent = Me.Character Tool.Name = "Sword" Handle = Instance.new("Part") Handle.Parent = Tool Handle.Locked = true Handle.CanCollide = false Handle.TopSurface = "Smooth" Handle.BottomSurface = "Smooth" Handle.Size = Vector3.new(1, 1, 1) Handle.formFactor = "Symmetric" Handle.Transparency = 1 Handle.Name = "Handle" Handle.Reflectance = 0 Mesh = Instance.new("SpecialMesh") Mesh.Parent = Handle Mesh.MeshType = "Brick" Mesh.Scale = Vector3.new(0, 0, 0) Weld = Instance.new("Weld") Weld.Parent = Me.Character["Torso"] Weld.Part0 = Me.Character["Torso"] Weld.Part1 = Handle Weld.C0 = CFrame.new(1.6, 2.3, 0.6) * CFrame.Angles(0, 0, 2.2) Weld.C0 = Weld.C0 * CFrame.Angles(0, 1.57, 0) Grip1 = Instance.new("Part") Grip1.Parent = Tool Grip1.Locked = true Grip1.BrickColor = BrickColor.new("Navy blue") Grip1.TopSurface = "Smooth" Grip1.BottomSurface = "Smooth" Grip1.Size = Vector3.new(1, 1, 1) Grip1.formFactor = "Symmetric" Grip1.Transparency = 0 Grip1.Reflectance = 0 Grip1.CanCollide = false Grip1.Name = "Grip1" GripMesh1 = Instance.new("CylinderMesh") GripMesh1.Parent = Grip1 GripMesh1.Scale = Vector3.new(0.45, 1.6, 0.45) GripWeld = Instance.new("Weld") GripWeld.Parent = Handle GripWeld.Part0 = Handle GripWeld.Part1 = Grip1 GripWeld.C0 = CFrame.new(0, 0, 0)*CFrame.Angles(0, 0, 0) Grip2 = Instance.new("Part") Grip2.Parent = Tool Grip2.Locked = true Grip2.BrickColor = BrickColor.new("Navy blue") Grip2.TopSurface = "Smooth" Grip2.BottomSurface = "Smooth" Grip2.Size = Vector3.new(1, 1, 1) Grip2.formFactor = "Symmetric" Grip2.Transparency = 0 Grip2.CanCollide = false Grip2.Name = "Grip2" GripMesh2 = Instance.new("CylinderMesh") GripMesh2.Parent = Grip2 GripMesh2.Scale = Vector3.new(0.46, 0.1, 0.46) GripWeld2 = Instance.new("Weld") GripWeld2.Parent = Handle GripWeld2.Part0 = Handle GripWeld2.Part1 = Grip2 GripWeld2.C0 = CFrame.new(0, -0.4, 0)*CFrame.Angles(0, 0, 0) Grip3 = Instance.new("Part") Grip3.Parent = Tool Grip3.Locked = true Grip3.BrickColor = BrickColor.new("Navy blue") Grip3.TopSurface = "Smooth" Grip3.BottomSurface = "Smooth" Grip3.Size = Vector3.new(1, 1, 1) Grip3.formFactor = "Symmetric" Grip3.Transparency = 0 Grip3.CanCollide = false Grip3.Name = "Grip3" GripMesh3 = Instance.new("CylinderMesh") GripMesh3.Parent = Grip3 GripMesh3.Scale = Vector3.new(0.46, 0.1, 0.46) GripWeld3 = Instance.new("Weld") GripWeld3.Parent = Handle GripWeld3.Part0 = Handle GripWeld3.Part1 = Grip3 GripWeld3.C0 = CFrame.new(0, -0.29, 0)*CFrame.Angles(0, 0, 0.05) Grip4 = Instance.new("Part") Grip4.Parent = Tool Grip4.Locked = true Grip4.BrickColor = BrickColor.new("Navy blue") Grip4.TopSurface = "Smooth" Grip4.BottomSurface = "Smooth" Grip4.Size = Vector3.new(1, 1, 1) Grip4.formFactor = "Symmetric" Grip4.Transparency = 0 Grip4.CanCollide = false Grip4.Name = "Grip4" GripMesh4 = Instance.new("CylinderMesh") GripMesh4.Parent = Grip4 GripMesh4.Scale = Vector3.new(0.46, 0.1, 0.46) GripWeld4 = Instance.new("Weld") GripWeld4.Parent = Handle GripWeld4.Part0 = Handle GripWeld4.Part1 = Grip4 GripWeld4.C0 = CFrame.new(0, -0.18, 0)*CFrame.Angles(0, 0, 0) Grip5 = Instance.new("Part") Grip5.Parent = Tool Grip5.Locked = true Grip5.BrickColor = BrickColor.new("Navy blue") Grip5.TopSurface = "Smooth" Grip5.BottomSurface = "Smooth" Grip5.Size = Vector3.new(1, 1, 1) Grip5.formFactor = "Symmetric" Grip5.Transparency = 0 Grip5.CanCollide = false Grip5.Name = "Grip5" GripMesh5 = Instance.new("CylinderMesh") GripMesh5.Parent = Grip5 GripMesh5.Scale = Vector3.new(0.46, 0.1, 0.46) GripWeld5 = Instance.new("Weld") GripWeld5.Parent = Handle GripWeld5.Part0 = Handle GripWeld5.Part1 = Grip5 GripWeld5.C0 = CFrame.new(0, -0.07, 0)*CFrame.Angles(0, 0, 0.03) Grip6 = Instance.new("Part") Grip6.Parent = Tool Grip6.Locked = true Grip6.BrickColor = BrickColor.new("Navy blue") Grip6.TopSurface = "Smooth" Grip6.BottomSurface = "Smooth" Grip6.Size = Vector3.new(1, 1, 1) Grip6.formFactor = "Symmetric" Grip6.Transparency = 0 Grip6.CanCollide = false Grip6.Name = "Grip6" GripMesh = Instance.new("CylinderMesh") GripMesh.Parent = Grip6 GripMesh.Scale = Vector3.new(0.46, 0.1, 0.46) GripWeld = Instance.new("Weld") GripWeld.Parent = Handle GripWeld.Part0 = Handle GripWeld.Part1 = Grip6 GripWeld.C0 = CFrame.new(0, 0.04, 0)*CFrame.Angles(0, 0, -0.05) Grip7 = Instance.new("Part") Grip7.Parent = Tool Grip7.Locked = true Grip7.BrickColor = BrickColor.new("Navy blue") Grip7.TopSurface = "Smooth" Grip7.BottomSurface = "Smooth" Grip7.Size = Vector3.new(1, 1, 1) Grip7.formFactor = "Symmetric" Grip7.Transparency = 0 Grip7.CanCollide = false Grip7.Name = "Grip7" GripMesh7 = Instance.new("CylinderMesh") GripMesh7.Parent = Grip7 GripMesh7.Scale = Vector3.new(0.46, 0.1, 0.46) GripWeld7 = Instance.new("Weld") GripWeld7.Parent = Handle GripWeld7.Part0 = Handle GripWeld7.Part1 = Grip7 GripWeld7.C0 = CFrame.new(0, 0.15, 0)*CFrame.Angles(0, 0, 0) Grip8 = Instance.new("Part") Grip8.Parent = Tool Grip8.Locked = true Grip8.BrickColor = BrickColor.new("Navy blue") Grip8.TopSurface = "Smooth" Grip8.BottomSurface = "Smooth" Grip8.Size = Vector3.new(1, 1, 1) Grip8.formFactor = "Symmetric" Grip8.Transparency = 0 Grip8.CanCollide = false Grip8.Name = "Grip8" GripMesh8 = Instance.new("CylinderMesh") GripMesh8.Parent = Grip8 GripMesh8.Scale = Vector3.new(0.46, 0.1, 0.46) GripWeld8 = Instance.new("Weld") GripWeld8.Parent = Handle GripWeld8.Part0 = Handle GripWeld8.Part1 = Grip8 GripWeld8.C0 = CFrame.new(0, 0.26, 0)*CFrame.Angles(0, 0, 0) Grip9 = Instance.new("Part") Grip9.Parent = Tool Grip9.Locked = true Grip9.BrickColor = BrickColor.new("Navy blue") Grip9.TopSurface = "Smooth" Grip9.BottomSurface = "Smooth" Grip9.Size = Vector3.new(1, 1, 1) Grip9.formFactor = "Symmetric" Grip9.Transparency = 0 Grip9.CanCollide = false Grip9.Name = "Grip9" GripMesh9 = Instance.new("CylinderMesh") GripMesh9.Parent = Grip9 GripMesh9.Scale = Vector3.new(0.46, 0.1, 0.46) GripWeld9 = Instance.new("Weld") GripWeld9.Parent = Handle GripWeld9.Part0 = Handle GripWeld9.Part1 = Grip9 GripWeld9.C0 = CFrame.new(0, 0.37, 0)*CFrame.Angles(0, 0, 0.07) Grip10 = Instance.new("Part") Grip10.Parent = Tool Grip10.Locked = true Grip10.Reflectance = 0 Grip10.CanCollide = false Grip10.BrickColor = BrickColor.new(1003) Grip10.TopSurface = "Smooth" Grip10.BottomSurface = "Smooth" Grip10.Size = Vector3.new(1, 1, 1) Grip10.formFactor = "Symmetric" Grip10.Transparency = 0 Grip10.Name = "Grip10" GripMesh10 = Instance.new("SpecialMesh") GripMesh10.Parent = Grip10 GripMesh10.MeshType = "Sphere" GripMesh10.Scale = Vector3.new(0.6, 0.6, 0.6) GripWeld10 = Instance.new("Weld") GripWeld10.Parent = Handle GripWeld10.Part0 = Handle GripWeld10.Part1 = Grip10 GripWeld10.C0 = CFrame.new(0, -0.8, 0)*CFrame.Angles(0, 0, 0) Grip11 = Instance.new("Part") Grip11.Parent = Tool Grip11.Locked = true Grip11.BrickColor = BrickColor.new(1003) Grip11.TopSurface = "Smooth" Grip11.CanCollide = false Grip11.BottomSurface = "Smooth" Grip11.Size = Vector3.new(1, 1, 1) Grip11.formFactor = "Symmetric" Grip11.Transparency = 0 Grip11.Name = "Grip11" Grip11.Reflectance = 0 GripMesh11 = Instance.new("SpecialMesh") GripMesh11.Parent = Grip11 GripMesh11.MeshType = "Brick" GripMesh11.Scale = Vector3.new(0.55, 0.4, 1.4) GripWeld11 = Instance.new("Weld") GripWeld11.Parent = Handle GripWeld11.Part0 = Handle GripWeld11.Part1 = Grip11 GripWeld11.C0 = CFrame.new(0, 0.85, 0)*CFrame.Angles(0, 0, 0) Grip12 = Instance.new("Part") Grip12.Parent = Tool Grip12.Locked = true Grip12.CanCollide = false Grip12.BrickColor = BrickColor.new(1003) Grip12.TopSurface = "Smooth" Grip12.BottomSurface = "Smooth" Grip12.Size = Vector3.new(1, 1, 1) Grip12.formFactor = "Symmetric" Grip12.Transparency = 0 Grip12.Name = "Grip12" Grip12.Reflectance = 0 GripMesh12 = Instance.new("SpecialMesh") GripMesh12.Parent = Grip12 GripMesh12.MeshType = "Wedge" GripMesh12.Scale = Vector3.new(0.55, 0.4, 0.9) GripWeld12 = Instance.new("Weld") GripWeld12.Parent = Handle GripWeld12.Part0 = Handle GripWeld12.Part1 = Grip12 GripWeld12.C0 = CFrame.new(0, 0.908, 1.1)*CFrame.Angles(3, 0, 0) Grip13 = Instance.new("Part") Grip13.Parent = Tool Grip13.Locked = true Grip13.CanCollide = false Grip13.BrickColor = BrickColor.new(1003) Grip13.TopSurface = "Smooth" Grip13.BottomSurface = "Smooth" Grip13.Size = Vector3.new(1, 1, 1) Grip13.formFactor = "Symmetric" Grip13.Transparency = 0 Grip13.Name = "Grip13" Grip13.Reflectance = 0 GripMesh13 = Instance.new("SpecialMesh") GripMesh13.Parent = Grip13 GripMesh13.MeshType = "Wedge" GripMesh13.Scale = Vector3.new(0.55, 0.4, 0.9) GripWeld13 = Instance.new("Weld") GripWeld13.Parent = Handle GripWeld13.Part0 = Handle GripWeld13.Part1 = Grip13 GripWeld13.C0 = CFrame.new(0, 0.908, -1.1)*CFrame.Angles(-3, 3.14, 0) Grip14 = Instance.new("Part") Grip14.Parent = Tool Grip14.Locked = true Grip14.CanCollide = false Grip14.BrickColor = BrickColor.new("Navy blue") Grip14.TopSurface = "Smooth" Grip14.BottomSurface = "Smooth" Grip14.Size = Vector3.new(1, 1, 1) Grip14.formFactor = "Symmetric" Grip14.Transparency = 0.1 Grip14.Name = "Grip14" Grip14.Reflectance = 0 GripMesh14 = Instance.new("SpecialMesh") GripMesh14.Parent = Grip14 GripMesh14.MeshType = "Brick" GripMesh14.Scale = Vector3.new(0.552, 0.15, 1.3) GripWeld14 = Instance.new("Weld") GripWeld14.Parent = Handle GripWeld14.Part0 = Handle GripWeld14.Part1 = Grip14 GripWeld14.C0 = CFrame.new(0, 0.85, 0)*CFrame.Angles(0, 0, 0) Grip15 = Instance.new("Part") Grip15.Parent = Tool Grip15.Locked = true Grip15.CanCollide = false Grip15.BrickColor = BrickColor.new("Navy blue") Grip15.TopSurface = "Smooth" Grip15.BottomSurface = "Smooth" Grip15.Size = Vector3.new(1, 1, 1) Grip15.formFactor = "Symmetric" Grip15.Transparency = 0.1 Grip15.Name = "Grip15" Grip15.Reflectance = 0 GripMesh15 = Instance.new("SpecialMesh") GripMesh15.Parent = Grip15 GripMesh15.MeshType = "Sphere" GripMesh15.Scale = Vector3.new(0.6, 0.4, 1.5) GripWeld15 = Instance.new("Weld") GripWeld15.Parent = Handle GripWeld15.Part0 = Handle GripWeld15.Part1 = Grip15 GripWeld15.C0 = CFrame.new(0, 0.85, 0)*CFrame.Angles(0, 0, 0) Grip16 = Instance.new("Part") Grip16.Parent = Tool Grip16.Locked = true Grip16.BrickColor = BrickColor.new("Navy blue") Grip16.TopSurface = "Smooth" Grip16.BottomSurface = "Smooth" Grip16.Size = Vector3.new(1, 1, 1) Grip16.formFactor = "Symmetric" Grip16.Transparency = 0 Grip16.Name = "Grip16" Grip16.CanCollide = false Grip16.Reflectance = 0 GripMesh16 = Instance.new("SpecialMesh") GripMesh16.Parent = Grip16 GripMesh16.MeshType = "Brick" GripMesh16.Scale = Vector3.new(0.2, 0.3, 1) GripWeld = Instance.new("Weld") GripWeld.Parent = Handle GripWeld.Part0 = Handle GripWeld.Part1 = Grip16 GripWeld.C0 = CFrame.new(0, 1.1, 0)*CFrame.Angles(0, 0, 0) Grip17 = Instance.new("Part") Grip17.Parent = Tool Grip17.Locked = true Grip17.BrickColor = BrickColor.new(1003) Grip17.TopSurface = "Smooth" Grip17.BottomSurface = "Smooth" Grip17.Size = Vector3.new(1, 3, 1) Grip17.formFactor = "Symmetric" Grip17.Transparency = 0 Grip17.Name = "Grip17" Grip17.CanCollide = false Grip17.Reflectance = 0 GripMesh17 = Instance.new("SpecialMesh") GripMesh17.Parent = Grip17 GripMesh17.MeshType = "Brick" GripMesh17.Scale = Vector3.new(0.19, 1, 1) GripWeld17 = Instance.new("Weld") GripWeld17.Parent = Handle GripWeld17.Part0 = Handle GripWeld17.Part1 = Grip17 GripWeld17.C0 = CFrame.new(0, 2.21, -0.08)*CFrame.Angles(-0.08, 0, 0) Grip18 = Instance.new("Part") Grip18.Parent = Tool Grip18.Locked = true Grip18.BrickColor = BrickColor.new(1003) Grip18.TopSurface = "Smooth" Grip18.BottomSurface = "Smooth" Grip18.Size = Vector3.new(1, 3, 1) Grip18.formFactor = "Symmetric" Grip18.Transparency = 0 Grip18.Name = "Grip18" Grip18.CanCollide = false Grip18.Reflectance = 0 GripMesh18 = Instance.new("SpecialMesh") GripMesh18.Parent = Grip18 GripMesh18.MeshType = "Brick" GripMesh18.Scale = Vector3.new(0.19, 1, 1) GripWeld18 = Instance.new("Weld") GripWeld18.Parent = Handle GripWeld18.Part0 = Handle GripWeld18.Part1 = Grip18 GripWeld18.C0 = CFrame.new(0, 4.15, -0.155)*CFrame.Angles(0, 0, 0) Grip19 = Instance.new("Part") Grip19.Parent = Tool Grip19.Locked = true Grip19.BrickColor = BrickColor.new(1003) Grip19.TopSurface = "Smooth" Grip19.BottomSurface = "Smooth" Grip19.Size = Vector3.new(1, 3, 1) Grip19.formFactor = "Symmetric" Grip19.Transparency = 0 Grip19.CanCollide = false Grip19.Name = "Grip19" Grip19.Reflectance = 0 GripMesh19 = Instance.new("SpecialMesh") GripMesh19.Parent = Grip19 GripMesh19.MeshType = "Wedge" GripMesh19.Scale = Vector3.new(0.19, 1, 1) GripWeld19 = Instance.new("Weld") GripWeld19.Parent = Handle GripWeld19.Part0 = Handle GripWeld19.Part1 = Grip19 GripWeld19.C0 = CFrame.new(0, 6.99, -0.07)*CFrame.Angles(0.08, 0, 0) Grip20 = Instance.new("Part") Grip20.Parent = Tool Grip20.Locked = true Grip20.BrickColor = BrickColor.new("Navy blue") Grip20.TopSurface = "Smooth" Grip20.BottomSurface = "Smooth" Grip20.Size = Vector3.new(1, 3, 1) Grip20.formFactor = "Symmetric" Grip20.Transparency = 0 Grip20.Name = "Grip20" Grip20.CanCollide = false Grip20.Reflectance = 0 GripMesh20 = Instance.new("SpecialMesh") GripMesh20.Parent = Grip20 GripMesh20.MeshType = "Brick" GripMesh20.Scale = Vector3.new(0.193, 1, 0.2) GripWeld20 = Instance.new("Weld") GripWeld20.Parent = Handle GripWeld20.Part0 = Handle GripWeld20.Part1 = Grip20 GripWeld20.C0 = CFrame.new(0, 2.21, -0.08)*CFrame.Angles(-0.08, 0, 0) Grip21 = Instance.new("Part") Grip21.Parent = Tool Grip21.Locked = true Grip21.BrickColor = BrickColor.new("Navy blue") Grip21.TopSurface = "Smooth" Grip21.BottomSurface = "Smooth" Grip21.Size = Vector3.new(1, 1, 1) Grip21.formFactor = "Symmetric" Grip21.Transparency = 0 Grip21.Name = "Grip21" Grip21.CanCollide = false Grip21.Reflectance = 0 GripMesh21 = Instance.new("SpecialMesh") GripMesh21.Parent = Grip21 GripMesh21.MeshType = "Brick" GripMesh21.Scale = Vector3.new(0.193, 1, 0.2) GripWeld21 = Instance.new("Weld") GripWeld21.Parent = Handle GripWeld21.Part0 = Handle GripWeld21.Part1 = Grip21 GripWeld21.C0 = CFrame.new(0, 3.7, -0.155)*CFrame.Angles(0, 0, 0) Grip22 = Instance.new("Part") Grip22.Parent = Tool Grip22.Locked = true Grip22.BrickColor = BrickColor.new("Navy blue") Grip22.TopSurface = "Smooth" Grip22.BottomSurface = "Smooth" Grip22.Size = Vector3.new(1, 1, 1) Grip22.formFactor = "Symmetric" Grip22.Transparency = 0 Grip22.CanCollide = false Grip22.Name = "Grip22" Grip22.Reflectance = 0 GripMesh22 = Instance.new("CylinderMesh") GripMesh22.Parent = Grip22 GripMesh22.Scale = Vector3.new(0.6, 0.193, 0.6) GripWeld22 = Instance.new("Weld") GripWeld22.Parent = Handle GripWeld22.Part0 = Handle GripWeld22.Part1 = Grip22 GripWeld22.C0 = CFrame.new(0, 4.2, -0.155)*CFrame.Angles(0, 0, 1.57) ------------------------------------------------------------> --[[ ? -->> Sounds --]] ------------------------------------------------------------> Sound = Instance.new("Sound") Sound.Parent = Handle Sound.Name = "Sound" Sound.Pitch = 1 Sound.SoundId = "" Sound.Volume = 2 ------------------------------------------------------------> --[[ ? -->> Button1Down --]] ------------------------------------------------------------> function onButton1Down() if Activated then return end if Me.Character.Humanoid.Sit == true or Me.Character.Humanoid.PlatformStand == true then Me.Character.Humanoid.Jump = true Me.Character.Humanoid.PlatformStand = false Me.Character.Humanoid.Sit = false Me.Character.Torso.Velocity = Vector3.new(0, 20, 0) end if Mode == "Swing" then Activated = true if Me.Character.Humanoid.Jump == true then Weld.Parent = Me.Character["Left Arm"] Weld.Part0 = Me.Character["Left Arm"] Weld.C0 = CFrame.new(0.3, -1, -0.05) * CFrame.Angles(-1.15, 0.3, -1.3) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(0, 1, 0) Sound.SoundId = "rbxasset://sounds\\swordslash.wav" Sound:play() for i = 1 , 8 do Clone1 = Grip17:clone() Clone1.Parent = Tool Clone1.Name = "Shadow" Clone1.Anchored = true Clone1.CanCollide = false Clone1.Transparency = 0.2 Clone1.BrickColor = BrickColor.new(1003) Clone2 = Grip18:clone() Clone2.Parent = Tool Clone2.Name = "Shadow" Clone2.Anchored = true Clone2.CanCollide = false Clone2.Transparency = 0.2 Clone2.BrickColor = BrickColor.new(1003) Clone3 = Grip19:clone() Clone3.Parent = Tool Clone3.Name = "Shadow" Clone3.Anchored = true Clone3.CanCollide = false Clone3.Transparency = 0.2 Clone3.BrickColor = BrickColor.new(1003) FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(-0.13, 0, 0) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(-0.39, 0, 0) wait() end wait() for i = 1 , 8 do Clone1 = Grip17:clone() Clone1.Parent = Tool Clone1.Name = "Shadow" Clone1.Anchored = true Clone1.CanCollide = false Clone1.Transparency = 0.2 Clone1.BrickColor = BrickColor.new(1003) Clone2 = Grip18:clone() Clone2.Parent = Tool Clone2.Name = "Shadow" Clone2.Anchored = true Clone2.CanCollide = false Clone2.Transparency = 0.2 Clone2.BrickColor = BrickColor.new(1003) Clone3 = Grip19:clone() Clone3.Parent = Tool Clone3.Name = "Shadow" Clone3.Anchored = true Clone3.CanCollide = false Clone3.Transparency = 0.2 Clone3.BrickColor = BrickColor.new(1003) FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(0.13, 0, 0) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(0.39, 0, 0) wait() end FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(0, -1, 0) Weld.Parent = Me.Character["Right Arm"] Weld.Part0 = Me.Character["Right Arm"] Weld.C0 = CFrame.new(-0.3, -1, 0.05) * CFrame.Angles(-1.15, -0.3, -0.15) else Weld.Parent = Me.Character["Left Arm"] Weld.Part0 = Me.Character["Left Arm"] Weld.C0 = CFrame.new(0.3, -1, -0.05) * CFrame.Angles(-1.15, 0.3, -1.3) Sound.SoundId = "rbxasset://sounds\\swordslash.wav" Sound:play() for i = 1 , 8 do Clone1 = Grip17:clone() Clone1.Parent = Tool Clone1.Name = "Shadow" Clone1.Anchored = true Clone1.CanCollide = false Clone1.Transparency = 0.2 Clone1.BrickColor = BrickColor.new(1003) Clone2 = Grip18:clone() Clone2.Parent = Tool Clone2.Name = "Shadow" Clone2.Anchored = true Clone2.CanCollide = false Clone2.Transparency = 0.2 Clone2.BrickColor = BrickColor.new(1003) Clone3 = Grip19:clone() Clone3.Parent = Tool Clone3.Name = "Shadow" Clone3.Anchored = true Clone3.CanCollide = false Clone3.Transparency = 0.2 Clone3.BrickColor = BrickColor.new(1003) FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(-0.13, 0, 0) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(-0.39, 0, 0) wait() end wait(0.2) for i = 1 , 8 do Clone1 = Grip17:clone() Clone1.Parent = Tool Clone1.Name = "Shadow" Clone1.Anchored = true Clone1.CanCollide = false Clone1.Transparency = 0.2 Clone1.BrickColor = BrickColor.new(1003) Clone2 = Grip18:clone() Clone2.Parent = Tool Clone2.Name = "Shadow" Clone2.Anchored = true Clone2.CanCollide = false Clone2.Transparency = 0.2 Clone2.BrickColor = BrickColor.new(1003) Clone3 = Grip19:clone() Clone3.Parent = Tool Clone3.Name = "Shadow" Clone3.Anchored = true Clone3.CanCollide = false Clone3.Transparency = 0.2 Clone3.BrickColor = BrickColor.new(1003) FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(0.13, 0, 0) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(0.39, 0, 0) wait() end Weld.Parent = Me.Character["Right Arm"] Weld.Part0 = Me.Character["Right Arm"] Weld.C0 = CFrame.new(-0.3, -1, 0.05) * CFrame.Angles(-1.15, -0.3, -0.15) end Activated = false end if Mode == "Spin" then Activated = true Weld.Parent = Me.Character["Left Arm"] Weld.Part0 = Me.Character["Left Arm"] Weld.C0 = CFrame.new(0.3, -1, -0.05) * CFrame.Angles(-1.15, 0.3, -1.3) Sound.SoundId = "rbxasset://sounds\\swordslash.wav" Sound:play() for i = 1 , 8 do Clone1 = Grip17:clone() Clone1.Parent = Tool Clone1.Name = "Shadow" Clone1.Anchored = true Clone1.CanCollide = false Clone1.Transparency = 0.2 Clone1.BrickColor = BrickColor.new(1003) Clone2 = Grip18:clone() Clone2.Parent = Tool Clone2.Name = "Shadow" Clone2.Anchored = true Clone2.CanCollide = false Clone2.Transparency = 0.2 Clone2.BrickColor = BrickColor.new(1003) Clone3 = Grip19:clone() Clone3.Parent = Tool Clone3.Name = "Shadow" Clone3.Anchored = true Clone3.CanCollide = false Clone3.Transparency = 0.2 Clone3.BrickColor = BrickColor.new(1003) FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(-0.13, 0, 0) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(-0.39, 0, 0) wait() end Sound.SoundId = "http://www.roblox.com/asset/?id=18478970" Sound:play() Gyro = Instance.new("BodyGyro") Gyro.Parent = Me.Character.Torso Gyro.maxTorque = Vector3.new(math.huge, math.huge, math.huge) Gyro.cframe = Me.Character.Torso.CFrame Gyro.D = 50 Wave = Instance.new("Part") Wave.Parent = Me.Character.Torso Wave.Anchored = true Wave.CanCollide = false Wave.Locked = true Wave.Transparency = 0.2 Wave.BrickColor = BrickColor.new(1004) Wave.Size = Vector3.new(2, 1, 2) Wave.TopSurface = "Smooth" Wave.BottomSurface = "Smooth" Wave.CFrame = Me.Character.Torso.CFrame * CFrame.new(0, -2.4, 0) WaveMesh = Instance.new("CylinderMesh") WaveMesh.Parent = Wave WaveMesh.Scale = Vector3.new(1, 0.1, 1) for i = 1 , 16 do Wave.Size = Wave.Size + Vector3.new(1, 0, 1) Wave.Transparency = Wave.Transparency + 0.055 Wave.CFrame = Me.Character.Torso.CFrame * CFrame.new(0, -2.4, 0) Gyro.cframe = Gyro.cframe * CFrame.Angles(0, 0.785, 0) wait() end Wave:Remove() Gyro:Remove() wait(0.2) for i = 1 , 8 do Clone1 = Grip17:clone() Clone1.Parent = Tool Clone1.Name = "Shadow" Clone1.Anchored = true Clone1.CanCollide = false Clone1.Transparency = 0.2 Clone1.BrickColor = BrickColor.new(1003) Clone2 = Grip18:clone() Clone2.Parent = Tool Clone2.Name = "Shadow" Clone2.Anchored = true Clone2.CanCollide = false Clone2.Transparency = 0.2 Clone2.BrickColor = BrickColor.new(1003) Clone3 = Grip19:clone() Clone3.Parent = Tool Clone3.Name = "Shadow" Clone3.Anchored = true Clone3.CanCollide = false Clone3.Transparency = 0.2 Clone3.BrickColor = BrickColor.new(1003) FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(0.13, 0, 0) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(0.39, 0, 0) wait() end Weld.Parent = Me.Character["Right Arm"] Weld.Part0 = Me.Character["Right Arm"] Weld.C0 = CFrame.new(-0.3, -1, 0.05) * CFrame.Angles(-1.15, -0.3, -0.15) Activated = false end if Mode == "Teleport" then if mouse.Target ~= nil then Activated = true MousePosition = mouse.Hit.p Weld.Parent = Me.Character["Left Arm"] Weld.Part0 = Me.Character["Left Arm"] Weld.C0 = CFrame.new(0.3, -1, -0.05) * CFrame.Angles(-1.15, 0.3, -1.3) Sound.SoundId = "rbxasset://sounds\\swordslash.wav" Sound:play() for i = 1 , 8 do Clone1 = Grip17:clone() Clone1.Parent = Tool Clone1.Name = "Shadow" Clone1.Anchored = true Clone1.CanCollide = false Clone1.Transparency = 0.2 Clone1.BrickColor = BrickColor.new(1003) Clone2 = Grip18:clone() Clone2.Parent = Tool Clone2.Name = "Shadow" Clone2.Anchored = true Clone2.CanCollide = false Clone2.Transparency = 0.2 Clone2.BrickColor = BrickColor.new(1003) Clone3 = Grip19:clone() Clone3.Parent = Tool Clone3.Name = "Shadow" Clone3.Anchored = true Clone3.CanCollide = false Clone3.Transparency = 0.2 Clone3.BrickColor = BrickColor.new(1003) FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(-0.13, 0, 0) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(-0.39, 0, 0) wait() end Me.Character.Torso.CFrame = CFrame.new(MousePosition+Vector3.new(0, 3, 0)) Sound.SoundId = "http://www.roblox.com/asset/?id=18478970" Sound:play() Gyro = Instance.new("BodyGyro") Gyro.Parent = Me.Character.Torso Gyro.maxTorque = Vector3.new(math.huge, math.huge, math.huge) Gyro.cframe = Me.Character.Torso.CFrame Gyro.D = 50 Wave = Instance.new("Part") Wave.Parent = Me.Character.Torso Wave.Anchored = true Wave.CanCollide = false Wave.Locked = true Wave.Transparency = 0.2 Wave.BrickColor = BrickColor.new(1004) Wave.Size = Vector3.new(2, 1, 2) Wave.TopSurface = "Smooth" Wave.BottomSurface = "Smooth" Wave.CFrame = Me.Character.Torso.CFrame * CFrame.new(0, -2.4, 0) WaveMesh = Instance.new("CylinderMesh") WaveMesh.Parent = Wave WaveMesh.Scale = Vector3.new(1, 0.1, 1) for i = 1 , 5 do Wave.Size = Wave.Size + Vector3.new(1, 0, 1) Wave.Transparency = Wave.Transparency + 0.055 Wave.CFrame = Me.Character.Torso.CFrame * CFrame.new(0, -2.4, 0) Gyro.cframe = Gyro.cframe * CFrame.Angles(0, 1, 0) wait() end Wave:Remove() for i = 1 , 15 do Gyro.cframe = Gyro.cframe * CFrame.Angles(0, 1, 0) wait() end Gyro:Remove() wait(0.2) for i = 1 , 8 do Clone1 = Grip17:clone() Clone1.Parent = Tool Clone1.Name = "Shadow" Clone1.Anchored = true Clone1.CanCollide = false Clone1.Transparency = 0.2 Clone1.BrickColor = BrickColor.new(1003) Clone2 = Grip18:clone() Clone2.Parent = Tool Clone2.Name = "Shadow" Clone2.Anchored = true Clone2.CanCollide = false Clone2.Transparency = 0.2 Clone2.BrickColor = BrickColor.new(1003) Clone3 = Grip19:clone() Clone3.Parent = Tool Clone3.Name = "Shadow" Clone3.Anchored = true Clone3.CanCollide = false Clone3.Transparency = 0.2 Clone3.BrickColor = BrickColor.new(1003) FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(0.13, 0, 0) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(0.39, 0, 0) wait() end Weld.Parent = Me.Character["Right Arm"] Weld.Part0 = Me.Character["Right Arm"] Weld.C0 = CFrame.new(-0.3, -1, 0.05) * CFrame.Angles(-1.15, -0.3, -0.15) Activated = false end end if Mode == "Explosion" then Activated = true for i = 1 , 8 do Clone1 = Grip17:clone() Clone1.Parent = Tool Clone1.Name = "Shadow" Clone1.Anchored = true Clone1.CanCollide = false Clone1.Transparency = 0.2 Clone1.BrickColor = BrickColor.new(1003) Clone2 = Grip18:clone() Clone2.Parent = Tool Clone2.Name = "Shadow" Clone2.Anchored = true Clone2.CanCollide = false Clone2.Transparency = 0.2 Clone2.BrickColor = BrickColor.new(1003) Clone3 = Grip19:clone() Clone3.Parent = Tool Clone3.Name = "Shadow" Clone3.Anchored = true Clone3.CanCollide = false Clone3.Transparency = 0.2 Clone3.BrickColor = BrickColor.new(1003) FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(0, 0, 0.13) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(-0.39, 0, 0) wait() end onCharge(24) Range = 10 for i = 1 , 5 do Range = Range + 15 Me.Character.Humanoid.WalkSpeed = 0 Boom = Instance.new("Explosion") Boom.Parent = Workspace Boom.BlastRadius = Range/2 Boom.Position = Me.Character.Torso.Position+Vector3.new(Range, 0, 0) Boom = Instance.new("Explosion") Boom.Parent = Workspace Boom.BlastRadius = Range/2 Boom.Position = Me.Character.Torso.Position+Vector3.new(-Range, 0, 0) Boom = Instance.new("Explosion") Boom.Parent = Workspace Boom.BlastRadius = Range/2 Boom.Position = Me.Character.Torso.Position+Vector3.new(0, 0, Range) Boom = Instance.new("Explosion") Boom.Parent = Workspace Boom.BlastRadius = Range/2 Boom.Position = Me.Character.Torso.Position+Vector3.new(0, 0, -Range) Boom = Instance.new("Explosion") Boom.Parent = Workspace Boom.BlastRadius = Range/2 Boom.Position = Me.Character.Torso.Position+Vector3.new(Range, 0, Range) Boom = Instance.new("Explosion") Boom.Parent = Workspace Boom.BlastRadius = Range/2 Boom.Position = Me.Character.Torso.Position+Vector3.new(-Range, 0, Range) Boom = Instance.new("Explosion") Boom.Parent = Workspace Boom.BlastRadius = Range/2 Boom.Position = Me.Character.Torso.Position+Vector3.new(Range, 0, -Range) Boom = Instance.new("Explosion") Boom.Parent = Workspace Boom.BlastRadius = Range/2 Boom.Position = Me.Character.Torso.Position+Vector3.new(-Range, 0, -Range) wait(0.05) end for i = 1 , 8 do Clone1 = Grip17:clone() Clone1.Parent = Tool Clone1.Name = "Shadow" Clone1.Anchored = true Clone1.CanCollide = false Clone1.Transparency = 0.2 Clone1.BrickColor = BrickColor.new(1003) Clone2 = Grip18:clone() Clone2.Parent = Tool Clone2.Name = "Shadow" Clone2.Anchored = true Clone2.CanCollide = false Clone2.Transparency = 0.2 Clone2.BrickColor = BrickColor.new(1003) Clone3 = Grip19:clone() Clone3.Parent = Tool Clone3.Name = "Shadow" Clone3.Anchored = true Clone3.CanCollide = false Clone3.Transparency = 0.2 Clone3.BrickColor = BrickColor.new(1003) FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(0, 0, -0.13) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(0.39, 0, 0) wait() end Activated = false end if Mode == "ExplodeVictim" then if mouse.Target ~= nil then torso = mouse.Target.Parent:findFirstChild("Torso") if torso ~= nil and torso.Parent.Name ~= Me.Name then Activated = true for i = 1 , 8 do Clone1 = Grip17:clone() Clone1.Parent = Tool Clone1.Name = "Shadow" Clone1.Anchored = true Clone1.CanCollide = false Clone1.Transparency = 0.2 Clone1.BrickColor = BrickColor.new(1003) Clone2 = Grip18:clone() Clone2.Parent = Tool Clone2.Name = "Shadow" Clone2.Anchored = true Clone2.CanCollide = false Clone2.Transparency = 0.2 Clone2.BrickColor = BrickColor.new(1003) Clone3 = Grip19:clone() Clone3.Parent = Tool Clone3.Name = "Shadow" Clone3.Anchored = true Clone3.CanCollide = false Clone3.Transparency = 0.2 Clone3.BrickColor = BrickColor.new(1003) FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(0, 0, 0.13) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(-0.39, 0, 0) wait() end onChargeAim(24, torso) Boom = Instance.new("Explosion") Boom.Parent = Workspace Boom.BlastRadius = 20 Boom.Position = torso.Position Stuff = torso.Parent:GetChildren() for i = 1 , #Stuff do if Stuff[i].className == "Part" then Stuff[i].Anchored = false Stuff[i]:BreakJoints() Stuff[i].BrickColor = BrickColor.new("Really black") Stuff[i].CanCollide = true end end for i = 1 , 8 do Clone1 = Grip17:clone() Clone1.Parent = Tool Clone1.Name = "Shadow" Clone1.Anchored = true Clone1.CanCollide = false Clone1.Transparency = 0.2 Clone1.BrickColor = BrickColor.new(1003) Clone2 = Grip18:clone() Clone2.Parent = Tool Clone2.Name = "Shadow" Clone2.Anchored = true Clone2.CanCollide = false Clone2.Transparency = 0.2 Clone2.BrickColor = BrickColor.new(1003) Clone3 = Grip19:clone() Clone3.Parent = Tool Clone3.Name = "Shadow" Clone3.Anchored = true Clone3.CanCollide = false Clone3.Transparency = 0.2 Clone3.BrickColor = BrickColor.new(1003) FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(0, 0, -0.13) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(0.39, 0, 0) wait() end Activated = false end end end if Mode == "Assassinate" then if mouse.Target ~= nil then torso = mouse.Target.Parent:findFirstChild("Torso") if torso ~= nil and torso.Parent.Name ~= Me.Name then Activated = true Sound.SoundId = "rbxasset://sounds\\unsheath.wav" Sound:play() for i = 1 , 8 do FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(-0.05, 0, 0) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.Angles(-0.15, 0, 0) wait() end wait() for i = 1 , 8 do FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(0, 0, 0.2) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.Angles(0, 0, 0.19) wait() end FakeLeftShoulder.C0 = OriginalLeftShoulder Weld = Instance.new("Weld") Weld.Parent = Me.Character["Torso"] Weld.Part0 = Me.Character["Torso"] Weld.Part1 = Handle Weld.C0 = CFrame.new(1.6, 2.5, 0.6) * CFrame.Angles(0, 0, 2.2) Weld.C0 = Weld.C0 * CFrame.Angles(0, 1.57, 0) for i = 1 , 16 do Weld.C0 = Weld.C0 * CFrame.new(0, 0, -0.03) * CFrame.Angles(0.03, 0, 0.11) end for i = 1 , 16 do FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(0, 0, -0.1) Weld.C0 = Weld.C0 * CFrame.new(0, 0, 0.03) * CFrame.Angles(-0.03, 0, -0.11) wait() end FakeRightShoulder.Parent = Me.Character.Torso FakeRightShoulder.Part0 = Me.Character.Torso FakeRightShoulder.Part1 = Me.Character["Right Arm"] FakeRightShoulder.C0 = OriginalRightShoulder FakeRightShoulder.C1 = OriginalRightShoulder2 FakeLeftShoulder.Parent = Me.Character.Torso FakeLeftShoulder.Part0 = Me.Character.Torso FakeLeftShoulder.Part1 = Me.Character["Left Arm"] FakeLeftShoulder.C0 = OriginalLeftShoulder FakeLeftShoulder.C1 = OriginalLeftShoulder2 FakeRightShoulder.C0 = OriginalRightShoulder * CFrame.Angles(-0.1, 0, 0) FakeLeftShoulder.C0 = OriginalLeftShoulder * CFrame.Angles(-0.1, 0, 0) wait(0.1) FakeRightShoulder.C0 = OriginalRightShoulder * CFrame.Angles(-0.2, 0, 0) FakeLeftShoulder.C0 = OriginalLeftShoulder * CFrame.Angles(-0.2, 0, 0) wait(0.1) Blade1 = Instance.new("Part") Blade1.Parent = Me.Character["Right Arm"] Blade1.CanCollide = false Blade1.formFactor = "Symmetric" Blade1.Size = Vector3.new(1, 2, 1) Blade1.TopSurface = "Smooth" Blade1.BottomSurface = "Smooth" Blade1.Locked = true Blade1.BrickColor = BrickColor.new(1003) Blade1.Name = "Blade1" Blade1.CFrame = Me.Character["Right Arm"].CFrame Blade2 = Instance.new("Part") Blade2.Parent = Me.Character["Left Arm"] Blade2.CanCollide = false Blade2.formFactor = "Symmetric" Blade2.Size = Vector3.new(1, 2, 1) Blade2.TopSurface = "Smooth" Blade2.BottomSurface = "Smooth" Blade2.Locked = true Blade2.BrickColor = BrickColor.new(1003) Blade2.Name = "Blade2" Blade2.CFrame = Me.Character["Left Arm"].CFrame Blade1Mesh = Instance.new("SpecialMesh") Blade1Mesh.Parent = Blade1 Blade1Mesh.MeshType = "Brick" Blade1Mesh.Scale = Vector3.new(0.2, 1, 0.2) Blade2Mesh = Instance.new("SpecialMesh") Blade2Mesh.Parent = Blade2 Blade2Mesh.MeshType = "Brick" Blade2Mesh.Scale = Vector3.new(0.2, 1, 0.2) Blade1Weld = Instance.new("Weld") Blade1Weld.Parent = Me.Character["Right Arm"] Blade1Weld.Part0 = Me.Character["Right Arm"] Blade1Weld.Part1 = Blade1 Blade1Weld.C0 = CFrame.new(-0.3, 0, 0) Blade2Weld = Instance.new("Weld") Blade2Weld.Parent = Me.Character["Left Arm"] Blade2Weld.Part0 = Me.Character["Left Arm"] Blade2Weld.Part1 = Blade2 Blade2Weld.C0 = CFrame.new(0.3, 0, 0) for i = 1 , 17 do Blade1Weld.C0 = Blade1Weld.C0 * CFrame.new(0, -0.1, 0) Blade2Weld.C0 = Blade2Weld.C0 * CFrame.new(0, -0.1, 0) Me.Character:MoveTo(Me.Character.Torso.Position) wait(0.05) end for i = 1 , 5 do FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(0, 0, -0.1) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.Angles(0, 0, 0.1) wait() end wait(0.5) Me.Character:MoveTo(Me.Character.Torso.Position) BodyPosition = Instance.new("BodyPosition") BodyPosition.Parent = Me.Character.Torso BodyPosition.maxForce = Vector3.new(math.huge, math.huge, math.huge) BodyPosition.position = torso.Position BodyGyro = Instance.new("BodyGyro") BodyGyro.maxTorque = Vector3.new(math.huge, math.huge, math.huge) BodyGyro.Parent = Me.Character.Torso BodyGyro.cframe = CFrame.new(Me.Character.Torso.Position, torso.Position) wait(0.8) BodyPosition:Remove() BodyGyro:Remove() Me.Character.Torso.CFrame = torso.CFrame FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(0, 0, 0.5) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.Angles(0, 0, -0.5) FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(0, 0, 1.57) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.Angles(0, 0, -1.57) FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(0.785, 0, 0) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.Angles(0.785, 0, 0) KillWeld = Instance.new("Weld") KillWeld.Parent = Me.Character.Torso KillWeld.Part0 = Me.Character.Torso KillWeld.Part1 = torso KillWeld.C0 = CFrame.new(0, 0, -1.6) wait(0.3) for i = 1 , 12 do KillWeld.C0 = KillWeld.C0 * CFrame.new(0, 0.08, 0.02) * CFrame.Angles(0.1, 0, 0) FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(0, 0, 0.1) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.Angles(0, 0, -0.1) wait(0.1) end wait(0.15) KillWeld:Remove() if torso ~= nil then torso:BreakJoints() end FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(-0.785, 0, 0) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.Angles(-0.785, 0, 0) for i = 1 , 3 do FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(0, 0, 0.1) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.Angles(0, 0, -0.1) wait() end FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(0, 0, 0.07) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.Angles(0, 0, -0.07) wait(0.1) for i = 1 , 17 do Blade1Weld.C0 = Blade1Weld.C0 * CFrame.new(0, 0.1, 0) Blade2Weld.C0 = Blade2Weld.C0 * CFrame.new(0, 0.1, 0) wait(0.05) end FakeRightShoulder.C0 = OriginalRightShoulder FakeLeftShoulder.C0 = OriginalLeftShoulder wait() Sound.SoundId = "rbxasset://sounds\\unsheath.wav" Sound:play() FakeRightShoulder.Parent = Me.Character.Torso FakeRightShoulder.Part0 = Me.Character.Torso FakeRightShoulder.Part1 = Me.Character["Right Arm"] FakeRightShoulder.C0 = OriginalRightShoulder FakeRightShoulder.C1 = OriginalRightShoulder2 FakeLeftShoulder.Parent = Me.Character.Torso FakeLeftShoulder.Part0 = Me.Character.Torso FakeLeftShoulder.Part1 = Me.Character["Left Arm"] FakeLeftShoulder.C0 = OriginalLeftShoulder * CFrame.new(-0.25, 0, -0.45) FakeLeftShoulder.C1 = OriginalLeftShoulder2 Weld:Remove() Weld = Instance.new("Weld") Weld.Parent = Me.Character["Torso"] Weld.Part0 = Me.Character["Torso"] Weld.Part1 = Handle Weld.C0 = CFrame.new(1.6, 2.5, 0.6) * CFrame.Angles(0, 0, 2.2) Weld.C0 = Weld.C0 * CFrame.Angles(0, 1.57, 0) for i = 1 , 16 do FakeRightShoulder.C0 = OriginalRightShoulder * CFrame.Angles(0, 0, (i/5.2)) Weld.C0 = Weld.C0 * CFrame.new(0, 0, -0.03) * CFrame.Angles(0.03, 0, 0.11) wait() end wait() Weld.Parent = Me.Character["Right Arm"] Weld.Part0 = Me.Character["Right Arm"] Weld.C0 = CFrame.new(-0.3, -1, 0.05) * CFrame.Angles(-1.15, -0.3, -0.15) for i = 1 , 8 do FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(0, 0, -0.2) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.Angles(0, 0, -0.19) wait() end wait() for i = 1 , 8 do FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(0.05, 0, 0) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.Angles(0.15, 0, 0) wait() end wait(0.2) Activated = false end end end if Mode == "Tornado" then Activated = true Weld.Parent = Me.Character["Left Arm"] Weld.Part0 = Me.Character["Left Arm"] Weld.C0 = CFrame.new(0.3, -1, -0.05) * CFrame.Angles(-1.15, 0.3, -1.3) Sound.SoundId = "rbxasset://sounds\\swordslash.wav" Sound:play() for i = 1 , 8 do Clone1 = Grip17:clone() Clone1.Parent = Tool Clone1.Name = "Shadow" Clone1.Anchored = true Clone1.CanCollide = false Clone1.Transparency = 0.2 Clone1.BrickColor = BrickColor.new(1003) Clone2 = Grip18:clone() Clone2.Parent = Tool Clone2.Name = "Shadow" Clone2.Anchored = true Clone2.CanCollide = false Clone2.Transparency = 0.2 Clone2.BrickColor = BrickColor.new(1003) Clone3 = Grip19:clone() Clone3.Parent = Tool Clone3.Name = "Shadow" Clone3.Anchored = true Clone3.CanCollide = false Clone3.Transparency = 0.2 Clone3.BrickColor = BrickColor.new(1003) FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(-0.13, 0, 0) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(-0.39, 0, 0) wait() end Sound.SoundId = "http://www.roblox.com/asset/?id=18478970" Sound:play() Gyro = Instance.new("BodyGyro") Gyro.Parent = Me.Character.Torso Gyro.maxTorque = Vector3.new(math.huge, math.huge, math.huge) Gyro.cframe = Me.Character.Torso.CFrame Gyro.D = 50 Part = Instance.new("Part") Part.Transparency = 1 Part.CanCollide = false Part.Anchored = true Part.Parent = Me.Character.Torso range = 10 Sound.SoundId = "rbxasset://sounds\\swordslash.wav" Sound:play() for i = 1 , 80 do range = range + 2 Part.CFrame = Me.Character.Torso.CFrame * CFrame.new(0, 0, -(range*1.2)) p = game.Workspace:GetChildren() for i = 1 , #p do torso = p[i]:findFirstChild("Torso") if torso ~= nil and torso.Parent.Name ~= Me.Name then if (Me.Character.Torso.Position-torso.Position).magnitude <= 200 then humanoid = torso.Parent:findFirstChild("Humanoid") bp = torso:findFirstChild("BodyPosition") if bp == nil then bp = Instance.new("BodyPosition") bp.Parent = torso bp.maxForce = Vector3.new(math.huge, math.huge, math.huge) bp.position = Part.Position + Vector3.new(0, range, 0) end if bp ~= nil then bp.position = Part.Position + Vector3.new(0, range, 0) end bg = torso:findFirstChild("BodyGyro") if bg == nil then bg = Instance.new("BodyGyro") bg.Parent = torso bg.maxTorque = Vector3.new(math.huge, math.huge, math.huge) bg.cframe = CFrame.Angles(math.random(-3, 3), math.random(-3, 3), math.random(-3, 3)) end if bg ~= nil then bg.cframe = CFrame.Angles(math.random(-3, 3), math.random(-3, 3), math.random(-3, 3)) end if humanoid ~= nil then humanoid.Sit = true humanoid.MaxHealth = 100 humanoid:TakeDamage(2) end end end end Gyro.cframe = Gyro.cframe * CFrame.Angles(0, 1.3, 0) wait() end p = game.Workspace:GetChildren() for i = 1 , #p do torso = p[i]:findFirstChild("Torso") if torso ~= nil and torso.Parent.Name ~= Me.Name then humanoid = torso.Parent:findFirstChild("Humanoid") bp = torso:findFirstChild("BodyPosition") if bp ~= nil then bp:Remove() end bg = torso:findFirstChild("BodyGyro") if bg ~= nil then bg:Remove() end if humanoid ~= nil then humanoid.Sit = true torso.Velocity = torso.CFrame.lookVector * 100 end end wait() end Stuff = Workspace:GetChildren() for i = 1 , #Stuff do torso = Stuff[i]:findFirstChild("Torso") if torso ~= nil then hax = torso:GetChildren() for i = 1 , #hax do if hax[i].className == "BodyPosition" then hax[i]:Remove() end end end end Gyro:Remove() wait(0.2) for i = 1 , 8 do Clone1 = Grip17:clone() Clone1.Parent = Tool Clone1.Name = "Shadow" Clone1.Anchored = true Clone1.CanCollide = false Clone1.Transparency = 0.2 Clone1.BrickColor = BrickColor.new(1003) Clone2 = Grip18:clone() Clone2.Parent = Tool Clone2.Name = "Shadow" Clone2.Anchored = true Clone2.CanCollide = false Clone2.Transparency = 0.2 Clone2.BrickColor = BrickColor.new(1003) Clone3 = Grip19:clone() Clone3.Parent = Tool Clone3.Name = "Shadow" Clone3.Anchored = true Clone3.CanCollide = false Clone3.Transparency = 0.2 Clone3.BrickColor = BrickColor.new(1003) FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(0.13, 0, 0) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(0.39, 0, 0) wait() end Weld.Parent = Me.Character["Right Arm"] Weld.Part0 = Me.Character["Right Arm"] Weld.C0 = CFrame.new(-0.3, -1, 0.05) * CFrame.Angles(-1.15, -0.3, -0.15) Activated = false end if Mode == "TripleSlash" then Activated = true Weld.Parent = Me.Character["Left Arm"] Weld.Part0 = Me.Character["Left Arm"] Weld.C0 = CFrame.new(0.3, -1, -0.05) * CFrame.Angles(-1.15, 0.3, -1.3) Sound.SoundId = "rbxasset://sounds\\swordslash.wav" Sound:play() for i = 1 , 4 do Clone1 = Grip17:clone() Clone1.Parent = Tool Clone1.Name = "Shadow" Clone1.Anchored = true Clone1.CanCollide = false Clone1.Transparency = 0.2 Clone1.BrickColor = BrickColor.new(1003) Clone2 = Grip18:clone() Clone2.Parent = Tool Clone2.Name = "Shadow" Clone2.Anchored = true Clone2.CanCollide = false Clone2.Transparency = 0.2 Clone2.BrickColor = BrickColor.new(1003) Clone3 = Grip19:clone() Clone3.Parent = Tool Clone3.Name = "Shadow" Clone3.Anchored = true Clone3.CanCollide = false Clone3.Transparency = 0.2 Clone3.BrickColor = BrickColor.new(1003) FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(-0.26, 0, 0) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.Angles(-0.62, 0, 0) wait() end for i = 1 , 2 do FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.Angles(0, 1.57, 0) wait() end Sound.SoundId = "rbxasset://sounds\\swordslash.wav" Sound:play() for i = 1 , 4 do Clone1 = Grip17:clone() Clone1.Parent = Tool Clone1.Name = "Shadow" Clone1.Anchored = true Clone1.CanCollide = false Clone1.Transparency = 0.2 Clone1.BrickColor = BrickColor.new(1003) Clone2 = Grip18:clone() Clone2.Parent = Tool Clone2.Name = "Shadow" Clone2.Anchored = true Clone2.CanCollide = false Clone2.Transparency = 0.2 Clone2.BrickColor = BrickColor.new(1003) Clone3 = Grip19:clone() Clone3.Parent = Tool Clone3.Name = "Shadow" Clone3.Anchored = true Clone3.CanCollide = false Clone3.Transparency = 0.2 Clone3.BrickColor = BrickColor.new(1003) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.Angles(-0.62, 0, 0) wait() end for i = 1 , 2 do FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.Angles(0, -1.57, 0) wait() end Sound.SoundId = "rbxasset://sounds\\swordslash.wav" Sound:play() for i = 1 , 4 do Clone1 = Grip17:clone() Clone1.Parent = Tool Clone1.Name = "Shadow" Clone1.Anchored = true Clone1.CanCollide = false Clone1.Transparency = 0.2 Clone1.BrickColor = BrickColor.new(1003) Clone2 = Grip18:clone() Clone2.Parent = Tool Clone2.Name = "Shadow" Clone2.Anchored = true Clone2.CanCollide = false Clone2.Transparency = 0.2 Clone2.BrickColor = BrickColor.new(1003) Clone3 = Grip19:clone() Clone3.Parent = Tool Clone3.Name = "Shadow" Clone3.Anchored = true Clone3.CanCollide = false Clone3.Transparency = 0.2 Clone3.BrickColor = BrickColor.new(1003) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.Angles(-0.62, 0, 0) wait() end for i = 1 , 4 do Clone1 = Grip17:clone() Clone1.Parent = Tool Clone1.Name = "Shadow" Clone1.Anchored = true Clone1.CanCollide = false Clone1.Transparency = 0.2 Clone1.BrickColor = BrickColor.new(1003) Clone2 = Grip18:clone() Clone2.Parent = Tool Clone2.Name = "Shadow" Clone2.Anchored = true Clone2.CanCollide = false Clone2.Transparency = 0.2 Clone2.BrickColor = BrickColor.new(1003) Clone3 = Grip19:clone() Clone3.Parent = Tool Clone3.Name = "Shadow" Clone3.Anchored = true Clone3.CanCollide = false Clone3.Transparency = 0.2 Clone3.BrickColor = BrickColor.new(1003) FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(0.26, 0, 0) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.Angles(0.62, 0, 0) wait() end Weld.Parent = Me.Character["Right Arm"] Weld.Part0 = Me.Character["Right Arm"] Weld.C0 = CFrame.new(-0.3, -1, 0.05) * CFrame.Angles(-1.15, -0.3, -0.15) Activated = false end if Mode == "Slashes" then Activated = true f = Instance.new("Fire") f.Parent = Grip17 f.Size = 2 ff = Instance.new("Fire") ff.Parent = Grip18 ff.Size = 2 fff = Instance.new("Fire") fff.Parent = Grip18 fff.Size = 2 Weld.Parent = Me.Character["Left Arm"] Weld.Part0 = Me.Character["Left Arm"] Weld.C0 = CFrame.new(0.3, -1, -0.05) * CFrame.Angles(-1.15, 0.3, -1.3) Test = FakeLeftShoulder.C0 FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(-(0.26*4), 0, 0) for i = 1 , 20 do Sound.SoundId = "rbxasset://sounds\\swordslash.wav" Sound:play() for i = 1 , 4 do Clone1 = Grip17:clone() Clone1.Parent = Tool Clone1.Name = "Shadow" Clone1.Anchored = true Clone1.CanCollide = false Clone1.Transparency = 0.2 Clone1.BrickColor = BrickColor.new(1004) Clone2 = Grip18:clone() Clone2.Parent = Tool Clone2.Name = "Shadow" Clone2.Anchored = true Clone2.CanCollide = false Clone2.Transparency = 0.2 Clone2.BrickColor = BrickColor.new(1004) Clone3 = Grip19:clone() Clone3.Parent = Tool Clone3.Name = "Shadow" Clone3.Anchored = true Clone3.CanCollide = false Clone3.Transparency = 0.2 Clone3.BrickColor = BrickColor.new(1004) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.Angles(-0.62, 0, 0) wait() end for i = 1 , 2 do FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.Angles(0, 1.57, 0) wait() end Sound.SoundId = "rbxasset://sounds\\swordslash.wav" Sound:play() for i = 1 , 4 do Clone1 = Grip17:clone() Clone1.Parent = Tool Clone1.Name = "Shadow" Clone1.Anchored = true Clone1.CanCollide = false Clone1.Transparency = 0.2 Clone1.BrickColor = BrickColor.new(1005) Clone2 = Grip18:clone() Clone2.Parent = Tool Clone2.Name = "Shadow" Clone2.Anchored = true Clone2.CanCollide = false Clone2.Transparency = 0.2 Clone2.BrickColor = BrickColor.new(1005) Clone3 = Grip19:clone() Clone3.Parent = Tool Clone3.Name = "Shadow" Clone3.Anchored = true Clone3.CanCollide = false Clone3.Transparency = 0.2 Clone3.BrickColor = BrickColor.new(1005) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.Angles(-0.62, 0, 0) wait() end for i = 1 , 2 do FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.Angles(0, -1.57, 0) wait() end end for i = 1 , 2 do FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.Angles(0, 1.57, 0) end Sound.SoundId = "rbxasset://sounds\\swordslash.wav" Sound:play() for i = 1 , 4 do Clone1 = Grip17:clone() Clone1.Parent = Tool Clone1.Name = "Shadow" Clone1.Anchored = true Clone1.CanCollide = false Clone1.Transparency = 0.2 Clone1.BrickColor = BrickColor.new(1009) Clone2 = Grip18:clone() Clone2.Parent = Tool Clone2.Name = "Shadow" Clone2.Anchored = true Clone2.CanCollide = false Clone2.Transparency = 0.2 Clone2.BrickColor = BrickColor.new(1009) Clone3 = Grip19:clone() Clone3.Parent = Tool Clone3.Name = "Shadow" Clone3.Anchored = true Clone3.CanCollide = false Clone3.Transparency = 0.2 Clone3.BrickColor = BrickColor.new(1009) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.Angles(-0.62, 0, 0) wait() end for i = 1 , 4 do Clone1 = Grip17:clone() Clone1.Parent = Tool Clone1.Name = "Shadow" Clone1.Anchored = true Clone1.CanCollide = false Clone1.Transparency = 0.2 Clone1.BrickColor = BrickColor.new(1004) Clone2 = Grip18:clone() Clone2.Parent = Tool Clone2.Name = "Shadow" Clone2.Anchored = true Clone2.CanCollide = false Clone2.Transparency = 0.2 Clone2.BrickColor = BrickColor.new(1004) Clone3 = Grip19:clone() Clone3.Parent = Tool Clone3.Name = "Shadow" Clone3.Anchored = true Clone3.CanCollide = false Clone3.Transparency = 0.2 Clone3.BrickColor = BrickColor.new(1004) FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(0.26, 0, 0) FakeLeftShoulder.C0 = Test wait() end Weld.Parent = Me.Character["Right Arm"] Weld.Part0 = Me.Character["Right Arm"] Weld.C0 = CFrame.new(-0.3, -1, 0.05) * CFrame.Angles(-1.15, -0.3, -0.15) Activated = false f:remove() ff:remove() fff:remove() end if Mode == "Wave" then Activated = true Weld.Parent = Me.Character["Left Arm"] Weld.Part0 = Me.Character["Left Arm"] Weld.C0 = CFrame.new(0.3, -1, -0.05) * CFrame.Angles(-1.15, 0.3, -1.3) Sound.SoundId = "rbxasset://sounds\\swordslash.wav" Sound:play() for i = 1 , 4 do Clone1 = Grip17:clone() Clone1.Parent = Tool Clone1.Name = "Shadow" Clone1.Anchored = true Clone1.CanCollide = false Clone1.Transparency = 0.2 Clone1.BrickColor = BrickColor.new(1003) Clone2 = Grip18:clone() Clone2.Parent = Tool Clone2.Name = "Shadow" Clone2.Anchored = true Clone2.CanCollide = false Clone2.Transparency = 0.2 Clone2.BrickColor = BrickColor.new(1003) Clone3 = Grip19:clone() Clone3.Parent = Tool Clone3.Name = "Shadow" Clone3.Anchored = true Clone3.CanCollide = false Clone3.Transparency = 0.2 Clone3.BrickColor = BrickColor.new(1003) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.Angles(-0.62, 0, 0) wait() end for i = 1 , 2 do FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.Angles(0, 1.57, 0) wait() end Sound.SoundId = "rbxasset://sounds\\swordslash.wav" Sound:play() for i = 1 , 4 do Clone1 = Grip17:clone() Clone1.Parent = Tool Clone1.Name = "Shadow" Clone1.Anchored = true Clone1.CanCollide = false Clone1.Transparency = 0.2 Clone1.BrickColor = BrickColor.new(1003) Clone2 = Grip18:clone() Clone2.Parent = Tool Clone2.Name = "Shadow" Clone2.Anchored = true Clone2.CanCollide = false Clone2.Transparency = 0.2 Clone2.BrickColor = BrickColor.new(1003) Clone3 = Grip19:clone() Clone3.Parent = Tool Clone3.Name = "Shadow" Clone3.Anchored = true Clone3.CanCollide = false Clone3.Transparency = 0.2 Clone3.BrickColor = BrickColor.new(1003) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.Angles(-0.62, 0, 0) wait() end for i = 1 , 2 do FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.Angles(0, -1.57, 0) wait() end Velocity = Instance.new("BodyVelocity") Velocity.Parent = Me.Character.Torso Velocity.maxForce = Vector3.new(math.huge, math.huge, math.huge) Velocity.velocity = Vector3.new(0, 30, 0) Gyro = Instance.new("BodyGyro") Gyro.Parent = Me.Character.Torso Gyro.maxTorque = Vector3.new(math.huge, math.huge, math.huge) Gyro.cframe = Me.Character.Torso.CFrame Gyro.D = 50 Sound.SoundId = "rbxasset://sounds\\swordslash.wav" Sound:play() for i = 1 , 8 do Clone1 = Grip17:clone() Clone1.Parent = Tool Clone1.Name = "Shadow" Clone1.Anchored = true Clone1.CanCollide = false Clone1.Transparency = 0.2 Clone1.BrickColor = BrickColor.new(1003) Clone2 = Grip18:clone() Clone2.Parent = Tool Clone2.Name = "Shadow" Clone2.Anchored = true Clone2.CanCollide = false Clone2.Transparency = 0.2 Clone2.BrickColor = BrickColor.new(1003) Clone3 = Grip19:clone() Clone3.Parent = Tool Clone3.Name = "Shadow" Clone3.Anchored = true Clone3.CanCollide = false Clone3.Transparency = 0.2 Clone3.BrickColor = BrickColor.new(1003) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.Angles(-0.31, 0, 0) Gyro.cframe = Gyro.cframe * CFrame.Angles(0, (0.785*2), 0) wait() end Velocity.maxForce = Vector3.new(math.huge, 0, math.huge) Velocity.velocity = Vector3.new(0, 0, 0) for i = 1 , 2 do Clone1 = Grip17:clone() Clone1.Parent = Tool Clone1.Name = "Shadow" Clone1.Anchored = true Clone1.CanCollide = false Clone1.Transparency = 0.2 Clone1.BrickColor = BrickColor.new(1003) Clone2 = Grip18:clone() Clone2.Parent = Tool Clone2.Name = "Shadow" Clone2.Anchored = true Clone2.CanCollide = false Clone2.Transparency = 0.2 Clone2.BrickColor = BrickColor.new(1003) Clone3 = Grip19:clone() Clone3.Parent = Tool Clone3.Name = "Shadow" Clone3.Anchored = true Clone3.CanCollide = false Clone3.Transparency = 0.2 Clone3.BrickColor = BrickColor.new(1003) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.Angles(1.24, 0, 0) wait() end Weld.Parent = Me.Character["Right Arm"] Weld.Part0 = Me.Character["Right Arm"] Weld.C0 = CFrame.new(-0.3, -1, 0.05) * CFrame.Angles(-1.15, -0.3, -0.15) for i = 1 , 4 do FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(0, 0, 0.4) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.Angles(-0.62, 0, 0) wait() end wait(0.2) for i = 1 , 8 do FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(0, 0, -0.4) wait() end Wave = Instance.new("Part") Wave.Parent = Me.Character.Torso Wave.Anchored = true Wave.CanCollide = false Wave.Locked = true Wave.Transparency = 0.2 Wave.Size = Vector3.new(2, 1, 2) Wave.TopSurface = "Smooth" Wave.BrickColor = BrickColor.new(1004) Wave.BottomSurface = "Smooth" Wave.CFrame = Me.Character.Torso.CFrame * CFrame.new(0, -2.4, 0) WaveMesh = Instance.new("CylinderMesh") WaveMesh.Parent = Wave WaveMesh.Scale = Vector3.new(1, 0.3, 1) for i = 1 , 32 do Wave.Size = Wave.Size + Vector3.new(3, 0, 3) Wave.Transparency = Wave.Transparency + (0.8/32) Wave.CFrame = Me.Character.Torso.CFrame * CFrame.new(0, -2.4, 0) Stuff = Workspace:GetChildren() for i = 1 , #Stuff do Torso = Stuff[i]:findFirstChild("Torso") if Torso ~= nil then if (Me.Character.Torso.Position-Torso.Position).magnitude <= (Wave.Size.X/2) then if Torso.Parent.Name ~= Me.Name then Humanoid = Torso.Parent:findFirstChild("Humanoid") if Humanoid ~= nil then Humanoid.MaxHealth = 100 Humanoid:TakeDamage(Damage) end end end end end wait() end for i = 1 , 4 do FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.Angles(0.62, 0, 0) FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(0, 0, 0.4) wait() end wait(0.4) Gyro:Remove() Velocity:Remove() Activated = false end if Mode == "ForwardSpin" then Activated = true Weld.Parent = Me.Character["Left Arm"] Weld.Part0 = Me.Character["Left Arm"] Weld.C0 = CFrame.new(0.3, -1, -0.05) * CFrame.Angles(-1.15, 0.3, -1.3) Sound.SoundId = "rbxasset://sounds\\swordslash.wav" Sound:play() for i = 1 , 8 do Clone1 = Grip17:clone() Clone1.Parent = Tool Clone1.Name = "Shadow" Clone1.Anchored = true Clone1.CanCollide = false Clone1.Transparency = 0.2 Clone1.BrickColor = BrickColor.new(1003) Clone2 = Grip18:clone() Clone2.Parent = Tool Clone2.Name = "Shadow" Clone2.Anchored = true Clone2.CanCollide = false Clone2.Transparency = 0.2 Clone2.BrickColor = BrickColor.new(1003) Clone3 = Grip19:clone() Clone3.Parent = Tool Clone3.Name = "Shadow" Clone3.Anchored = true Clone3.CanCollide = false Clone3.Transparency = 0.2 Clone3.BrickColor = BrickColor.new(1003) FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(-0.13, 0, 0) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(-0.39, 0, 0) wait() end Sound.SoundId = "http://www.roblox.com/asset/?id=18478970" Sound:play() Velocity = Instance.new("BodyVelocity") Velocity.Parent = Me.Character.Torso Velocity.maxForce = Vector3.new(math.huge, 0, math.huge) Velocity.velocity = Me.Character.Torso.CFrame.lookVector * 200 Gyro = Instance.new("BodyGyro") Gyro.Parent = Me.Character.Torso Gyro.maxTorque = Vector3.new(math.huge, math.huge, math.huge) Gyro.cframe = Me.Character.Torso.CFrame Gyro.D = 50 Wave = Instance.new("Part") Wave.Parent = Me.Character.Torso Wave.Anchored = true Wave.CanCollide = false Wave.Locked = true Wave.Transparency = 0.2 Wave.BrickColor = BrickColor.new(1004) Wave.Size = Vector3.new(2, 1, 2) Wave.TopSurface = "Smooth" Wave.BottomSurface = "Smooth" Wave.CFrame = Me.Character.Torso.CFrame * CFrame.new(0, -2.4, 0) WaveMesh = Instance.new("CylinderMesh") WaveMesh.Parent = Wave WaveMesh.Scale = Vector3.new(1, 0.1, 1) for i = 1 , 16 do Wave.Size = Wave.Size + Vector3.new(1, 0, 1) Wave.Transparency = Wave.Transparency + 0.055 Wave.CFrame = Me.Character.Torso.CFrame * CFrame.new(0, -2.4, 0) Gyro.cframe = Gyro.cframe * CFrame.Angles(0, 0.785, 0) wait() end Wave:Remove() Gyro:Remove() Velocity:Remove() wait(1) for i = 1 , 8 do Clone1 = Grip17:clone() Clone1.Parent = Tool Clone1.Name = "Shadow" Clone1.Anchored = true Clone1.CanCollide = false Clone1.Transparency = 0.2 Clone1.BrickColor = BrickColor.new(1003) Clone2 = Grip18:clone() Clone2.Parent = Tool Clone2.Name = "Shadow" Clone2.Anchored = true Clone2.CanCollide = false Clone2.Transparency = 0.2 Clone2.BrickColor = BrickColor.new(1003) Clone3 = Grip19:clone() Clone3.Parent = Tool Clone3.Name = "Shadow" Clone3.Anchored = true Clone3.CanCollide = false Clone3.Transparency = 0.2 Clone3.BrickColor = BrickColor.new(1003) FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(0.13, 0, 0) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(0.39, 0, 0) wait() end Weld.Parent = Me.Character["Right Arm"] Weld.Part0 = Me.Character["Right Arm"] Weld.C0 = CFrame.new(-0.3, -1, 0.05) * CFrame.Angles(-1.15, -0.3, -0.15) Activated = false end if Mode == "DownThrust" then Activated = true Sound.SoundId = "rbxasset://sounds\\swordslash.wav" Sound:play() for i = 1 , 24 do Weld.C0 = Weld.C0 * CFrame.Angles(-0.3925, 0, 0) wait() end for i = 1 , 8 do Clone1 = Grip17:clone() Clone1.Parent = Tool Clone1.Name = "Shadow" Clone1.Anchored = true Clone1.CanCollide = false Clone1.Transparency = 0.2 Clone1.BrickColor = BrickColor.new(1003) Clone2 = Grip18:clone() Clone2.Parent = Tool Clone2.Name = "Shadow" Clone2.Anchored = true Clone2.CanCollide = false Clone2.Transparency = 0.2 Clone2.BrickColor = BrickColor.new(1003) Clone3 = Grip19:clone() Clone3.Parent = Tool Clone3.Name = "Shadow" Clone3.Anchored = true Clone3.CanCollide = false Clone3.Transparency = 0.2 Clone3.BrickColor = BrickColor.new(1003) FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(0, 0, 0.13) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(-0.39, 0, 0) wait() end Velocity = Instance.new("BodyVelocity") Velocity.Parent = Me.Character.Torso Velocity.maxForce = Vector3.new(math.huge, math.huge, math.huge) Velocity.velocity = Vector3.new(0, 30, 0) Gyro = Instance.new("BodyGyro") Gyro.Parent = Me.Character.Torso Gyro.maxTorque = Vector3.new(math.huge, math.huge, math.huge) Gyro.cframe = Me.Character.Torso.CFrame Gyro.D = 50 wait(0.8) Velocity:Remove() for i = 1 , 8 do Clone1 = Grip17:clone() Clone1.Parent = Tool Clone1.Name = "Shadow" Clone1.Anchored = true Clone1.CanCollide = false Clone1.Transparency = 0.2 Clone1.BrickColor = BrickColor.new(1003) Clone2 = Grip18:clone() Clone2.Parent = Tool Clone2.Name = "Shadow" Clone2.Anchored = true Clone2.CanCollide = false Clone2.Transparency = 0.2 Clone2.BrickColor = BrickColor.new(1003) Clone3 = Grip19:clone() Clone3.Parent = Tool Clone3.Name = "Shadow" Clone3.Anchored = true Clone3.CanCollide = false Clone3.Transparency = 0.2 Clone3.BrickColor = BrickColor.new(1003) FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(0, 0, -0.13) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(0.39, 0, 0) wait(0.08) end Wave = Instance.new("Part") Wave.Parent = Me.Character.Torso Wave.Anchored = true Wave.CanCollide = false Wave.Locked = true Wave.Transparency = 0.2 Wave.Size = Vector3.new(2, 1, 2) Wave.TopSurface = "Smooth" Wave.BottomSurface = "Smooth" Wave.BrickColor = BrickColor.new(1004) Wave.CFrame = Me.Character.Torso.CFrame * CFrame.new(0, -2.4, 0) WaveMesh = Instance.new("CylinderMesh") WaveMesh.Parent = Wave WaveMesh.Scale = Vector3.new(1, 0.1, 1) for i = 1 , 16 do Wave.Size = Wave.Size + Vector3.new(1, 0, 1) Wave.Transparency = Wave.Transparency + 0.055 Wave.CFrame = Me.Character.Torso.CFrame * CFrame.new(0, -2.4, 0) wait() end Wave:Remove() Gyro:Remove() wait(0.8) for i = 1 , 20 do Weld.C0 = Weld.C0 * CFrame.Angles(0.3925*2, 0, 0) wait() end Activated = false end if Mode == "Escape" then Activated = true Weld.Parent = Me.Character["Left Arm"] Weld.Part0 = Me.Character["Left Arm"] Weld.C0 = CFrame.new(0.3, -1, -0.05) * CFrame.Angles(-1.15, 0.3, -1.3) Sound.SoundId = "rbxasset://sounds\\swordslash.wav" Sound:play() for i = 1 , 8 do Clone1 = Grip17:clone() Clone1.Parent = Tool Clone1.Name = "Shadow" Clone1.Anchored = true Clone1.CanCollide = false Clone1.Transparency = 0.2 Clone1.BrickColor = BrickColor.new(1003) Clone2 = Grip18:clone() Clone2.Parent = Tool Clone2.Name = "Shadow" Clone2.Anchored = true Clone2.CanCollide = false Clone2.Transparency = 0.2 Clone2.BrickColor = BrickColor.new(1003) Clone3 = Grip19:clone() Clone3.Parent = Tool Clone3.Name = "Shadow" Clone3.Anchored = true Clone3.CanCollide = false Clone3.Transparency = 0.2 Clone3.BrickColor = BrickColor.new(1003) FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(-0.13, 0, 0) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(-0.39, 0, 0) wait() end Stuff = Me.Character:GetChildren() for i = 1 , #Stuff do if Stuff[i].className == "Part" then Stuff[i].Anchored = false end end Stuff = Me.Character:GetChildren() for i = 1 , #Stuff do if Stuff[i].className == "Part" then Stuff[i].Anchored = false end Stuff2 = Stuff[i]:GetChildren() for i = 1 , #Stuff2 do if Stuff2[i].className == "BodyPosition" or Stuff2[i].className == "BodyVelocity" or Stuff2[i].className == "BodyGyro" then Stuff2[i]:Remove() end end end Sound.SoundId = "http://www.roblox.com/asset/?id=18478970" Sound:play() Velocity = Instance.new("BodyVelocity") Velocity.Parent = Me.Character.Torso Velocity.maxForce = Vector3.new(math.huge, math.huge, math.huge) Velocity.velocity = Vector3.new(0, 40, 0) Gyro = Instance.new("BodyGyro") Gyro.Parent = Me.Character.Torso Gyro.maxTorque = Vector3.new(math.huge, math.huge, math.huge) Gyro.cframe = Me.Character.Torso.CFrame Gyro.D = 50 Wave = Instance.new("Part") Wave.Parent = Me.Character.Torso Wave.Anchored = true Wave.CanCollide = false Wave.Locked = true Wave.Transparency = 0.2 Wave.Size = Vector3.new(2, 1, 2) Wave.TopSurface = "Smooth" Wave.BottomSurface = "Smooth" Wave.BrickColor = BrickColor.new(1004) Wave.CFrame = Me.Character.Torso.CFrame * CFrame.new(0, -2.4, 0) WaveMesh = Instance.new("CylinderMesh") WaveMesh.Parent = Wave WaveMesh.Scale = Vector3.new(1, 0.1, 1) for i = 1 , 16 do Wave.Size = Wave.Size + Vector3.new(1, 0, 1) Wave.Transparency = Wave.Transparency + 0.055 Wave.CFrame = Me.Character.Torso.CFrame * CFrame.new(0, -2.4, 0) Gyro.cframe = Gyro.cframe * CFrame.Angles(0, 0.785, 0) wait() end Wave:Remove() Gyro:Remove() Velocity:Remove() wait(1) for i = 1 , 8 do Clone1 = Grip17:clone() Clone1.Parent = Tool Clone1.Name = "Shadow" Clone1.Anchored = true Clone1.CanCollide = false Clone1.Transparency = 0.2 Clone1.BrickColor = BrickColor.new(1003) Clone2 = Grip18:clone() Clone2.Parent = Tool Clone2.Name = "Shadow" Clone2.Anchored = true Clone2.CanCollide = false Clone2.Transparency = 0.2 Clone2.BrickColor = BrickColor.new(1003) Clone3 = Grip19:clone() Clone3.Parent = Tool Clone3.Name = "Shadow" Clone3.Anchored = true Clone3.CanCollide = false Clone3.Transparency = 0.2 Clone3.BrickColor = BrickColor.new(1003) FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(0.13, 0, 0) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(0.39, 0, 0) wait() end Weld.Parent = Me.Character["Right Arm"] Weld.Part0 = Me.Character["Right Arm"] Weld.C0 = CFrame.new(-0.3, -1, 0.05) * CFrame.Angles(-1.15, -0.3, -0.15) Activated = false end if Mode == "Toss" then Activated = true Weld.Parent = Me.Character["Left Arm"] Weld.Part0 = Me.Character["Left Arm"] Weld.C0 = CFrame.new(0.3, -1, -0.05) * CFrame.Angles(-1.15, 0.3, -1.3) Sound.SoundId = "rbxasset://sounds\\swordslash.wav" Sound:play() for i = 1 , 4 do Clone1 = Grip17:clone() Clone1.Parent = Tool Clone1.Name = "Shadow" Clone1.Anchored = true Clone1.CanCollide = false Clone1.Transparency = 0.2 Clone1.BrickColor = BrickColor.new(1005) Clone2 = Grip18:clone() Clone2.Parent = Tool Clone2.Name = "Shadow" Clone2.Anchored = true Clone2.CanCollide = false Clone2.Transparency = 0.2 Clone2.BrickColor = BrickColor.new(1005) Clone3 = Grip19:clone() Clone3.Parent = Tool Clone3.Name = "Shadow" Clone3.Anchored = true Clone3.CanCollide = false Clone3.Transparency = 0.2 Clone3.BrickColor = BrickColor.new(1005) FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(-0.13, 0, 0) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(-0.39, 0, 0) wait() end Weld:Remove() Sound.SoundId = "http://www.roblox.com/asset/?id=18478970" Sound:play() Gyro = Instance.new("BodyGyro") Gyro.Parent = Handle Gyro.maxTorque = Vector3.new(math.huge, math.huge, math.huge) Gyro.cframe = Me.Character.Torso.CFrame * CFrame.Angles(0, 0, 1.57) Gyro.D = 50 Velocity = Instance.new("BodyVelocity") Velocity.Parent = Handle Velocity.maxForce = Vector3.new(math.huge, math.huge, math.huge) Velocity.velocity = Vector3.new(0, 1, 0) * 10 for i = 1 , 4 do FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(-0.13, 0, 0) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(-0.39, 0, 0) wait() end for i = 1 , 15 do Gyro.cframe = Gyro.cframe * CFrame.Angles(0, 1, 1) wait(0.1) end Velocity.velocity = Vector3.new(0, 0, 0) for i = 1 , 5 do Gyro.cframe = Gyro.cframe * CFrame.Angles(0, 1, 1) wait(0.1) end Velocity:Remove() Position = Instance.new("BodyPosition") Position.Parent = Handle Position.maxForce = Vector3.new(9999999999, 9999999999, 9999999999) Position.position = Me.Character["Left Arm"].Position for i = 1 , 10 do Gyro.cframe = Gyro.cframe * CFrame.Angles(0, 1, 1) Position.position = Me.Character["Left Arm"].Position wait(0.1) end Gyro:Remove() Position:Remove() Weld = Instance.new("Weld") Weld.Parent = Me.Character["Left Arm"] Weld.Part0 = Me.Character["Left Arm"] Weld.Part1 = Handle Weld.C0 = CFrame.new(0.3, -1, -0.05) * CFrame.Angles(-1.15, 0.3, -1.3) for i = 1 , 8 do Clone1 = Grip17:clone() Clone1.Parent = Tool Clone1.Name = "Shadow" Clone1.Anchored = true Clone1.CanCollide = false Clone1.Transparency = 0.2 Clone1.BrickColor = BrickColor.new(1005) Clone2 = Grip18:clone() Clone2.Parent = Tool Clone2.Name = "Shadow" Clone2.Anchored = true Clone2.CanCollide = false Clone2.Transparency = 0.2 Clone2.BrickColor = BrickColor.new(1005) Clone3 = Grip19:clone() Clone3.Parent = Tool Clone3.Name = "Shadow" Clone3.Anchored = true Clone3.CanCollide = false Clone3.Transparency = 0.2 Clone3.BrickColor = BrickColor.new(1005) FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(0.13, 0, 0) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(0.39, 0, 0) wait() end Weld.Parent = Me.Character["Right Arm"] Weld.Part0 = Me.Character["Right Arm"] Weld.C0 = CFrame.new(-0.3, -1, 0.05) * CFrame.Angles(-1.15, -0.3, -0.15) Activated = false end if Mode == "Boomerang" then Activated = true Weld.Parent = Me.Character["Left Arm"] Weld.Part0 = Me.Character["Left Arm"] Weld.C0 = CFrame.new(0.3, -1, -0.05) * CFrame.Angles(-1.15, 0.3, -1.3) Sound.SoundId = "rbxasset://sounds\\swordslash.wav" Sound:play() for i = 1 , 4 do Clone1 = Grip17:clone() Clone1.Parent = Tool Clone1.Name = "Shadow" Clone1.Anchored = true Clone1.CanCollide = false Clone1.Transparency = 0.2 Clone1.BrickColor = BrickColor.new(1003) Clone2 = Grip18:clone() Clone2.Parent = Tool Clone2.Name = "Shadow" Clone2.Anchored = true Clone2.CanCollide = false Clone2.Transparency = 0.2 Clone2.BrickColor = BrickColor.new(1003) Clone3 = Grip19:clone() Clone3.Parent = Tool Clone3.Name = "Shadow" Clone3.Anchored = true Clone3.CanCollide = false Clone3.Transparency = 0.2 Clone3.BrickColor = BrickColor.new(1003) FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(-0.13, 0, 0) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(-0.39, 0, 0) wait() end Weld:Remove() Sound.SoundId = "http://www.roblox.com/asset/?id=18478970" Sound:play() Gyro = Instance.new("BodyGyro") Gyro.Parent = Handle Gyro.maxTorque = Vector3.new(math.huge, math.huge, math.huge) Gyro.cframe = Me.Character.Torso.CFrame * CFrame.Angles(0, 0, 1.57) Gyro.D = 50 Velocity = Instance.new("BodyVelocity") Velocity.Parent = Handle Velocity.maxForce = Vector3.new(math.huge, math.huge, math.huge) Velocity.velocity = Me.Character.Torso.CFrame.lookVector * 100 for i = 1 , 4 do FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(-0.13, 0, 0) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(-0.39, 0, 0) wait() end for i = 1 , 15 do Gyro.cframe = Gyro.cframe * CFrame.Angles(1, 0, 0) wait(0.1) end Velocity.velocity = Vector3.new(0, 0, 0) for i = 1 , 5 do Gyro.cframe = Gyro.cframe * CFrame.Angles(1, 0, 0) wait(0.1) end Velocity:Remove() Position = Instance.new("BodyPosition") Position.Parent = Handle Position.maxForce = Vector3.new(9999999999, 9999999999, 9999999999) Position.position = Me.Character["Left Arm"].Position for i = 1 , 10 do Gyro.cframe = Gyro.cframe * CFrame.Angles(1, 0, 0) Position.position = Me.Character["Left Arm"].Position wait(0.1) end Gyro:Remove() Position:Remove() Weld = Instance.new("Weld") Weld.Parent = Me.Character["Left Arm"] Weld.Part0 = Me.Character["Left Arm"] Weld.Part1 = Handle Weld.C0 = CFrame.new(0.3, -1, -0.05) * CFrame.Angles(-1.15, 0.3, -1.3) for i = 1 , 8 do Clone1 = Grip17:clone() Clone1.Parent = Tool Clone1.Name = "Shadow" Clone1.Anchored = true Clone1.CanCollide = false Clone1.Transparency = 0.2 Clone1.BrickColor = BrickColor.new(1003) Clone2 = Grip18:clone() Clone2.Parent = Tool Clone2.Name = "Shadow" Clone2.Anchored = true Clone2.CanCollide = false Clone2.Transparency = 0.2 Clone2.BrickColor = BrickColor.new(1003) Clone3 = Grip19:clone() Clone3.Parent = Tool Clone3.Name = "Shadow" Clone3.Anchored = true Clone3.CanCollide = false Clone3.Transparency = 0.2 Clone3.BrickColor = BrickColor.new(1003) FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(0.13, 0, 0) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(0.39, 0, 0) wait() end Weld.Parent = Me.Character["Right Arm"] Weld.Part0 = Me.Character["Right Arm"] Weld.C0 = CFrame.new(-0.3, -1, 0.05) * CFrame.Angles(-1.15, -0.3, -0.15) Activated = false end if Mode == "Remover" then Activated = true Weld.Parent = Me.Character["Left Arm"] Weld.Part0 = Me.Character["Left Arm"] Weld.C0 = CFrame.new(0.3, -1, -0.05) * CFrame.Angles(-1.15, 0.3, -1.3) for i = 1 , 8 do Clone1 = Grip17:clone() Clone1.Parent = Tool Clone1.Name = "Shadow" Clone1.Anchored = true Clone1.CanCollide = false Clone1.Transparency = 0.2 Clone1.BrickColor = BrickColor.new(1003) Clone2 = Grip18:clone() Clone2.Parent = Tool Clone2.Name = "Shadow" Clone2.Anchored = true Clone2.CanCollide = false Clone2.Transparency = 0.2 Clone2.BrickColor = BrickColor.new(1003) Clone3 = Grip19:clone() Clone3.Parent = Tool Clone3.Name = "Shadow" Clone3.Anchored = true Clone3.CanCollide = false Clone3.Transparency = 0.2 Clone3.BrickColor = BrickColor.new(1003) FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(-0.13, 0, 0) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(-0.39, 0, 0) wait() end Gyro = Instance.new("BodyGyro") Gyro.Parent = Me.Character.Torso Gyro.maxTorque = Vector3.new(math.huge, math.huge, math.huge) Gyro.cframe = Me.Character.Torso.CFrame Gyro.D = 50 ShockWave = Instance.new("Part") ShockWave.Parent = Me.Character.Torso ShockWave.Anchored = true ShockWave.CanCollide = false ShockWave.Locked = true ShockWave.Transparency = 0 ShockWave.Shape = "Ball" ShockWave.BrickColor = BrickColor.new(1004) ShockWave.Size = Vector3.new(1, 1, 1) ShockWave.TopSurface = "Smooth" ShockWave.BottomSurface = "Smooth" ShockWave.CFrame = Me.Character.Torso.CFrame ShockWaveMesh = Instance.new("SpecialMesh") ShockWaveMesh.Parent = ShockWave ShockWaveMesh.MeshType = "Sphere" ShockWaveMesh.Scale = Vector3.new(1, 1, 1) for ii = 1 , 50 do ShockWave.Size = ShockWave.Size + Vector3.new(2, 2, 2) ShockWave.Transparency = ShockWave.Transparency + 0.02 ShockWave.CFrame = Me.Character.Torso.CFrame Gyro.cframe = Gyro.cframe * CFrame.Angles(0, 0.785, 0) Stuff = game.Workspace:GetChildren() for i = 1 , #Stuff do if Stuff[i].Name ~= "Base" and Stuff[i].Name ~= Me.Name then if Stuff[i].className == "Part" then if (Me.Character.Torso.Position-Stuff[i].Position).magnitude <= ii then Stuff[i]:Remove() end end if Stuff[i].className == "Model" then Stuff2 = Stuff[i]:GetChildren() for i = 1 , #Stuff2 do if Stuff2[i].className == "Part" then if (Me.Character.Torso.Position-Stuff2[i].Position).magnitude <= ii then Stuff2[i]:Remove() end end end end end end wait() end ShockWave:Remove() Gyro:Remove() wait(0.2) for i = 1 , 8 do Clone1 = Grip17:clone() Clone1.Parent = Tool Clone1.Name = "Shadow" Clone1.Anchored = true Clone1.CanCollide = false Clone1.Transparency = 0.2 Clone1.BrickColor = BrickColor.new(1003) Clone2 = Grip18:clone() Clone2.Parent = Tool Clone2.Name = "Shadow" Clone2.Anchored = true Clone2.CanCollide = false Clone2.Transparency = 0.2 Clone2.BrickColor = BrickColor.new(1003) Clone3 = Grip19:clone() Clone3.Parent = Tool Clone3.Name = "Shadow" Clone3.Anchored = true Clone3.CanCollide = false Clone3.Transparency = 0.2 Clone3.BrickColor = BrickColor.new(1003) FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(0.13, 0, 0) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(0.39, 0, 0) wait() end Weld.Parent = Me.Character["Right Arm"] Weld.Part0 = Me.Character["Right Arm"] Weld.C0 = CFrame.new(-0.3, -1, 0.05) * CFrame.Angles(-1.15, -0.3, -0.15) Activated = false end if Mode == "Alchemy" then Activated = true Weld.Parent = Me.Character["Left Arm"] Weld.Part0 = Me.Character["Left Arm"] Weld.C0 = CFrame.new(0.3, -1, -0.05) * CFrame.Angles(-1.15, 0.3, -1.3) for i = 1 , 8 do Clone1 = Grip17:clone() Clone1.Parent = Tool Clone1.Name = "Shadow" Clone1.Anchored = true Clone1.CanCollide = false Clone1.Transparency = 0.2 Clone1.BrickColor = BrickColor.new(1003) Clone2 = Grip18:clone() Clone2.Parent = Tool Clone2.Name = "Shadow" Clone2.Anchored = true Clone2.CanCollide = false Clone2.Transparency = 0.2 Clone2.BrickColor = BrickColor.new(1003) Clone3 = Grip19:clone() Clone3.Parent = Tool Clone3.Name = "Shadow" Clone3.Anchored = true Clone3.CanCollide = false Clone3.Transparency = 0.2 Clone3.BrickColor = BrickColor.new(1003) FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(-0.13, 0, 0) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(-0.39, 0, 0) wait() end Point1 = Instance.new("Part") Point1.Parent = Me.Character.Torso Point1.Anchored = true Point1.Locked = true Point1.Transparency = 1 Point1.Size = Vector3.new(5, 10, 5) Point1.TopSurface = "Smooth" Point1.BottomSurface = "Smooth" Point1.CFrame = Me.Character.Torso.CFrame * CFrame.new(100, -2, 0) Point1Mesh = Instance.new("CylinderMesh") Point1Mesh.Parent = Point1 Point1Mesh.Scale = Vector3.new(0.7, 1, 0.7) Point2 = Instance.new("Part") Point2.Parent = Me.Character.Torso Point2.Anchored = true Point2.Locked = true Point2.Transparency = 1 Point2.Size = Vector3.new(5, 10, 5) Point2.TopSurface = "Smooth" Point2.BottomSurface = "Smooth" Point2.CFrame = Me.Character.Torso.CFrame * CFrame.new(-100, -2, 0) Point2Mesh = Instance.new("CylinderMesh") Point2Mesh.Parent = Point2 Point2Mesh.Scale = Vector3.new(0.7, 1, 0.7) Point3 = Instance.new("Part") Point3.Parent = Me.Character.Torso Point3.Anchored = true Point3.Locked = true Point3.Transparency = 1 Point3.Size = Vector3.new(5, 10, 5) Point3.TopSurface = "Smooth" Point3.BottomSurface = "Smooth" Point3.CFrame = Me.Character.Torso.CFrame * CFrame.new(0, -2, 100) Point3Mesh = Instance.new("CylinderMesh") Point3Mesh.Parent = Point3 Point3Mesh.Scale = Vector3.new(0.7, 1, 0.7) Point4 = Instance.new("Part") Point4.Parent = Me.Character.Torso Point4.Anchored = true Point4.Locked = true Point4.Transparency = 1 Point4.Size = Vector3.new(5, 10, 5) Point4.TopSurface = "Smooth" Point4.BottomSurface = "Smooth" Point4.CFrame = Me.Character.Torso.CFrame * CFrame.new(0, -2, -100) Point4Mesh = Instance.new("CylinderMesh") Point4Mesh.Parent = Point4 Point4Mesh.Scale = Vector3.new(0.7, 1, 0.7) for i = 1 , 10 do Point1.Transparency = Point1.Transparency - 0.1 Point2.Transparency = Point2.Transparency - 0.1 Point3.Transparency = Point3.Transparency - 0.1 Point4.Transparency = Point4.Transparency - 0.1 wait(0.1) end Line1 = Instance.new("Part") Line1.Parent = Me.Character.Torso Line1.Anchored = true Line1.Locked = true Line1.Transparency = 0.5 Line1.BrickColor = BrickColor.new(1) Line1.Size = Vector3.new(1, 1, 1) Line1.TopSurface = "Smooth" Line1.BottomSurface = "Smooth" Line1.CFrame = CFrame.new((Point1.Position+Point3.Position)/2, Point3.Position) Line1Mesh = Instance.new("SpecialMesh") Line1Mesh.MeshType = "Brick" Line1Mesh.Parent = Line1 Line1Mesh.Scale = Vector3.new(1, 1, (Point1.Position-Point3.Position).magnitude) Line2 = Instance.new("Part") Line2.Parent = Me.Character.Torso Line2.Anchored = true Line2.Locked = true Line2.Transparency = 0.5 Line2.BrickColor = BrickColor.new(1) Line2.Size = Vector3.new(1, 1, 1) Line2.TopSurface = "Smooth" Line2.BottomSurface = "Smooth" Line2.CFrame = CFrame.new((Point1.Position+Point4.Position)/2, Point4.Position) Line2Mesh = Instance.new("SpecialMesh") Line2Mesh.MeshType = "Brick" Line2Mesh.Parent = Line2 Line2Mesh.Scale = Vector3.new(1, 1, (Point1.Position-Point4.Position).magnitude) Line3 = Instance.new("Part") Line3.Parent = Me.Character.Torso Line3.Anchored = true Line3.Locked = true Line3.Transparency = 0.5 Line3.BrickColor = BrickColor.new(1) Line3.Size = Vector3.new(1, 1, 1) Line3.TopSurface = "Smooth" Line3.BottomSurface = "Smooth" Line3.CFrame = CFrame.new((Point2.Position+Point3.Position)/2, Point3.Position) Line3Mesh = Instance.new("SpecialMesh") Line3Mesh.MeshType = "Brick" Line3Mesh.Parent = Line3 Line3Mesh.Scale = Vector3.new(1, 1, (Point2.Position-Point3.Position).magnitude) Line4 = Instance.new("Part") Line4.Parent = Me.Character.Torso Line4.Anchored = true Line4.Locked = true Line4.Transparency = 0.5 Line4.BrickColor = BrickColor.new(1) Line4.Size = Vector3.new(1, 1, 1) Line4.TopSurface = "Smooth" Line4.BottomSurface = "Smooth" Line4.CFrame = CFrame.new((Point2.Position+Point4.Position)/2, Point4.Position) Line4Mesh = Instance.new("SpecialMesh") Line4Mesh.MeshType = "Brick" Line4Mesh.Parent = Line4 Line4Mesh.Scale = Vector3.new(1, 1, (Point2.Position-Point4.Position).magnitude) for i = 1 , 20 do Sound.SoundId = "http://www.roblox.com/asset/?id=10756118" Sound:play() Line1Mesh.Scale = Line1Mesh.Scale + Vector3.new(0, 90, 0) Line2Mesh.Scale = Line2Mesh.Scale + Vector3.new(0, 90, 0) Line3Mesh.Scale = Line3Mesh.Scale + Vector3.new(0, 90, 0) Line4Mesh.Scale = Line4Mesh.Scale + Vector3.new(0, 90, 0) Stuff = Workspace:GetChildren() for i = 1 , #Stuff do if Stuff[i].Name ~= "Base" and Stuff[i].Name ~= Me.Name then if Stuff[i].className == "Part" then if (Me.Character.Torso.Position-Stuff[i].Position).magnitude <= 100 then if Stuff[i].BrickColor ~= BrickColor.new(28) then Stuff[i]:Remove() end end end if Stuff[i].className == "Model" then Stuff2 = Stuff[i]:GetChildren() for i = 1 , #Stuff2 do if Stuff2[i].className == "Part" then if (Me.Character.Torso.Position-Stuff2[i].Position).magnitude <= 100 then Stuff2[i]:Remove() end end end end end end wait(0.05) end wait(1) for i = 1 , 20 do Line1Mesh.Scale = Line1Mesh.Scale - Vector3.new(0, 90, 0) Line2Mesh.Scale = Line2Mesh.Scale - Vector3.new(0, 90, 0) Line3Mesh.Scale = Line3Mesh.Scale - Vector3.new(0, 90, 0) Line4Mesh.Scale = Line4Mesh.Scale - Vector3.new(0, 90, 0) wait(0.05) end Line1:Remove() Line2:Remove() Line3:Remove() Line4:Remove() for i = 1 , 10 do Point1.Transparency = Point1.Transparency + 0.1 Point2.Transparency = Point2.Transparency + 0.1 Point3.Transparency = Point3.Transparency + 0.1 Point4.Transparency = Point4.Transparency + 0.1 wait(0.1) end Point1:Remove() Point2:Remove() Point3:Remove() Point4:Remove() for i = 1 , 8 do Clone1 = Grip17:clone() Clone1.Parent = Tool Clone1.Name = "Shadow" Clone1.Anchored = true Clone1.CanCollide = false Clone1.Transparency = 0.2 Clone1.BrickColor = BrickColor.new(1003) Clone2 = Grip18:clone() Clone2.Parent = Tool Clone2.Name = "Shadow" Clone2.Anchored = true Clone2.CanCollide = false Clone2.Transparency = 0.2 Clone2.BrickColor = BrickColor.new(1003) Clone3 = Grip19:clone() Clone3.Parent = Tool Clone3.Name = "Shadow" Clone3.Anchored = true Clone3.CanCollide = false Clone3.Transparency = 0.2 Clone3.BrickColor = BrickColor.new(1003) FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(0.13, 0, 0) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(0.39, 0, 0) wait() end Weld.Parent = Me.Character["Right Arm"] Weld.Part0 = Me.Character["Right Arm"] Weld.C0 = CFrame.new(-0.3, -1, 0.05) * CFrame.Angles(-1.15, -0.3, -0.15) Activated = false end if Mode == "Lightning" then Activated = true Weld.Parent = Me.Character["Left Arm"] Weld.Part0 = Me.Character["Left Arm"] Weld.C0 = CFrame.new(0.3, -1, -0.05) * CFrame.Angles(-1.15, 0.3, -1.3) for i = 1 , 8 do Clone1 = Grip17:clone() Clone1.Parent = Tool Clone1.Name = "Shadow" Clone1.Anchored = true Clone1.CanCollide = false Clone1.Transparency = 0.2 Clone1.BrickColor = BrickColor.new(24) Clone2 = Grip18:clone() Clone2.Parent = Tool Clone2.Name = "Shadow" Clone2.Anchored = true Clone2.CanCollide = false Clone2.Transparency = 0.2 Clone2.BrickColor = BrickColor.new(24) Clone3 = Grip19:clone() Clone3.Parent = Tool Clone3.Name = "Shadow" Clone3.Anchored = true Clone3.CanCollide = false Clone3.Transparency = 0.2 Clone3.BrickColor = BrickColor.new(24) FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(-0.13, 0, 0) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(-0.39, 0, 0) wait() end Bolt = Instance.new("Part") Bolt.Parent = Tool Bolt.Anchored = true Bolt.Name = "Shadow" Bolt.CanCollide = false Bolt.Locked = true Bolt.Transparency = 0.2 Bolt.formFactor = "Symmetric" Bolt.Size = Vector3.new(1, 1, math.random(5, 10)) Bolt.TopSurface = "Smooth" Bolt.BrickColor = BrickColor.new(1009) Bolt.BottomSurface = "Smooth" Value = (math.random(-5, 5)/100) Value2 = (math.random(-5, 5)/100) Value3 = (math.random(-5, 5)/100) Bolt.CFrame = Me.Character.Torso.CFrame * CFrame.new(0, 0, -6) * CFrame.Angles(Value, Value2, Value3) BoltMesh = Instance.new("SpecialMesh") BoltMesh.MeshType = "Brick" BoltMesh.Parent = Bolt BoltMesh.Scale = Vector3.new(0.3, 0.3, 1) Stuff = Workspace:GetChildren() for i = 1 , #Stuff do if Stuff[i].className == "Model" and Stuff[i].Name ~= Me.Name then Torso = Stuff[i]:findFirstChild("Torso") Humanoid = Stuff[i]:findFirstChild("Humanoid") if Torso ~= nil and Humanoid ~= nil then if (Bolt.Position-Torso.Position).magnitude <= 15 then Humanoid.MaxHealth = 100 Humanoid:TakeDamage(Damage) end end end end game.Lighting.Brightness = 10 Sound.SoundId = "http://www.roblox.com/asset/?id=12222030" Sound:play() for i = 1 , math.random(9, 13) do FakeBolt = Instance.new("Part") FakeBolt.Parent = Tool FakeBolt.Anchored = true FakeBolt.Name = "Shadow" FakeBolt.CanCollide = false FakeBolt.Locked = true FakeBolt.Transparency = 0.2 FakeBolt.formFactor = "Symmetric" FakeBolt.Size = Vector3.new(1, 1, math.random(5, 10)) FakeBolt.TopSurface = "Smooth" FakeBolt.BrickColor = BrickColor.new(1009) FakeBolt.BottomSurface = "Smooth" Value = (math.random(-5, 5)/100) Value2 = (math.random(-5, 5)/100) Value3 = (math.random(-5, 5)/100) FakeBolt.CFrame = Bolt.CFrame * CFrame.new(0, 0, -(Bolt.Size.Z/2)) FakeBolt.CFrame = FakeBolt.CFrame * CFrame.Angles(Value, Value2, Value3) FakeBolt.CFrame = FakeBolt.CFrame * CFrame.new(0, 0, -(FakeBolt.Size.Z/2)) FakeBoltMesh = Instance.new("SpecialMesh") FakeBoltMesh.MeshType = "Brick" FakeBoltMesh.Parent = FakeBolt FakeBoltMesh.Scale = Vector3.new(0.3, 0.3, 1) Stuff = Workspace:GetChildren() for i = 1 , #Stuff do if Stuff[i].className == "Model" and Stuff[i].Name ~= Me.Name then Torso = Stuff[i]:findFirstChild("Torso") Humanoid = Stuff[i]:findFirstChild("Humanoid") if Torso ~= nil and Humanoid ~= nil then if (FakeBolt.Position-Torso.Position).magnitude <= 15 then Humanoid.MaxHealth = 100 Humanoid:TakeDamage(Damage) end end end end Bolt:Remove() Bolt = Instance.new("Part") Bolt.Parent = Tool Bolt.Anchored = true Bolt.Name = "Shadow" Bolt.CanCollide = false Bolt.Locked = true Bolt.Transparency = 0.2 Bolt.formFactor = "Symmetric" Bolt.Size = Vector3.new(1, 1, math.random(5, 10)) Bolt.TopSurface = "Smooth" Bolt.BrickColor = BrickColor.new(1009) Bolt.BottomSurface = "Smooth" Value = (math.random(-5, 5)/100) Value2 = (math.random(-5, 5)/100) Value3 = (math.random(-5, 5)/100) Bolt.CFrame = FakeBolt.CFrame * CFrame.new(0, 0, -(FakeBolt.Size.Z/2)) Bolt.CFrame = Bolt.CFrame * CFrame.Angles(Value, Value2, Value3) Bolt.CFrame = Bolt.CFrame * CFrame.new(0, 0, -(Bolt.Size.Z/2)) BoltMesh = Instance.new("SpecialMesh") BoltMesh.MeshType = "Brick" BoltMesh.Parent = Bolt BoltMesh.Scale = Vector3.new(0.3, 0.3, 1) Stuff = Workspace:GetChildren() for i = 1 , #Stuff do if Stuff[i].className == "Model" and Stuff[i].Name ~= Me.Name then Torso = Stuff[i]:findFirstChild("Torso") Humanoid = Stuff[i]:findFirstChild("Humanoid") if Torso ~= nil and Humanoid ~= nil then if (Bolt.Position-Torso.Position).magnitude <= 15 then Humanoid.MaxHealth = 100 Humanoid:TakeDamage(Damage) end end end end Bolt2 = Instance.new("Part") Bolt2.Parent = Tool Bolt2.Anchored = true Bolt2.Name = "Shadow" Bolt2.CanCollide = false Bolt2.Locked = true Bolt2.Transparency = 0.2 Bolt2.formFactor = "Symmetric" Bolt2.Size = Bolt.Size Bolt2.TopSurface = "Smooth" Bolt2.BrickColor = BrickColor.new(1009) Bolt2.BottomSurface = "Smooth" Bolt2.CFrame = Bolt.CFrame BoltMesh = Instance.new("SpecialMesh") BoltMesh.MeshType = "Brick" BoltMesh.Parent = Bolt2 BoltMesh.Scale = Vector3.new(0.3, 0.3, 1) Stuff = Workspace:GetChildren() for i = 1 , #Stuff do if Stuff[i].className == "Model" and Stuff[i].Name ~= Me.Name then Torso = Stuff[i]:findFirstChild("Torso") Humanoid = Stuff[i]:findFirstChild("Humanoid") if Torso ~= nil and Humanoid ~= nil then if (Bolt2.Position-Torso.Position).magnitude <= 20 then Humanoid.MaxHealth = 100 Humanoid:TakeDamage(Damage) end end end end end FakeBolt = Instance.new("Part") FakeBolt.Parent = Tool FakeBolt.Anchored = true FakeBolt.Name = "Shadow" FakeBolt.CanCollide = false FakeBolt.Locked = true FakeBolt.Transparency = 0.2 FakeBolt.formFactor = "Symmetric" FakeBolt.Size = Vector3.new(1, 1, math.random(5, 10)) FakeBolt.TopSurface = "Smooth" FakeBolt.BrickColor = BrickColor.new(1009) FakeBolt.BottomSurface = "Smooth" Value = (math.random(-5, 5)/100) Value2 = (math.random(-5, 5)/100) Value3 = (math.random(-5, 5)/100) FakeBolt.CFrame = Bolt.CFrame * CFrame.new(0, 0, -(Bolt.Size.Z/2)) FakeBolt.CFrame = FakeBolt.CFrame * CFrame.Angles(Value, Value2, Value3) FakeBolt.CFrame = FakeBolt.CFrame * CFrame.new(0, 0, -(FakeBolt.Size.Z/2)) FakeBoltMesh = Instance.new("SpecialMesh") FakeBoltMesh.MeshType = "Brick" FakeBoltMesh.Parent = FakeBolt FakeBoltMesh.Scale = Vector3.new(0.3, 0.3, 1) Stuff = Workspace:GetChildren() for i = 1 , #Stuff do if Stuff[i].className == "Model" and Stuff[i].Name ~= Me.Name then Torso = Stuff[i]:findFirstChild("Torso") Humanoid = Stuff[i]:findFirstChild("Humanoid") if Torso ~= nil and Humanoid ~= nil then if (FakeBolt.Position-Torso.Position).magnitude <= 10 then Humanoid.MaxHealth = 100 Humanoid:TakeDamage(Damage) FakeBolt.CFrame = CFrame.new(FakeBolt.Position, Torso.Position) end end end end Bolt:Remove() wait(0.1) game.Lighting.Brightness = 1 for i = 1 , 8 do Clone1 = Grip17:clone() Clone1.Parent = Tool Clone1.Name = "Shadow" Clone1.Anchored = true Clone1.CanCollide = false Clone1.Transparency = 0.2 Clone1.BrickColor = BrickColor.new(24) Clone2 = Grip18:clone() Clone2.Parent = Tool Clone2.Name = "Shadow" Clone2.Anchored = true Clone2.CanCollide = false Clone2.Transparency = 0.2 Clone2.BrickColor = BrickColor.new(24) Clone3 = Grip19:clone() Clone3.Parent = Tool Clone3.Name = "Shadow" Clone3.Anchored = true Clone3.CanCollide = false Clone3.Transparency = 0.2 Clone3.BrickColor = BrickColor.new(24) FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(0.13, 0, 0) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(0.39, 0, 0) wait() end Weld.Parent = Me.Character["Right Arm"] Weld.Part0 = Me.Character["Right Arm"] Weld.C0 = CFrame.new(-0.3, -1, 0.05) * CFrame.Angles(-1.15, -0.3, -0.15) Activated = false end if Mode == "Lazor" then Activated = true Weld.Parent = Me.Character["Left Arm"] Weld.Part0 = Me.Character["Left Arm"] Weld.C0 = CFrame.new(0.3, -1, -0.05) * CFrame.Angles(-1.15, 0.3, -1.3) for i = 1 , 8 do Clone1 = Grip17:clone() Clone1.Parent = Tool Clone1.Name = "Shadow" Clone1.Anchored = true Clone1.CanCollide = false Clone1.Transparency = 0.2 Clone1.BrickColor = BrickColor.new(1010) Clone2 = Grip18:clone() Clone2.Parent = Tool Clone2.Name = "Shadow" Clone2.Anchored = true Clone2.CanCollide = false Clone2.Transparency = 0.2 Clone2.BrickColor = BrickColor.new(1010) Clone3 = Grip19:clone() Clone3.Parent = Tool Clone3.Name = "Shadow" Clone3.Anchored = true Clone3.CanCollide = false Clone3.Transparency = 0.2 Clone3.BrickColor = BrickColor.new(1010) FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(-0.13, 0, 0) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(-0.39, 0, 0) wait() end Bolt = Instance.new("Part") Bolt.Parent = Tool Bolt.Anchored = true Bolt.Name = "Shadow" Bolt.CanCollide = false Bolt.Locked = true Bolt.Transparency = 0.2 Bolt.formFactor = "Symmetric" Bolt.Size = Vector3.new(1, 1, math.random(5, 10)) Bolt.TopSurface = "Smooth" Bolt.BrickColor = BrickColor.new(1010) Bolt.BottomSurface = "Smooth" Value = (math.random(-5, 5)/100) Value2 = (math.random(-5, 5)/100) Value3 = (math.random(-5, 5)/100) Bolt.CFrame = Me.Character.Torso.CFrame * CFrame.new(0, 0, -6) * CFrame.Angles(Value, Value2, Value3) BoltMesh = Instance.new("SpecialMesh") BoltMesh.MeshType = "Brick" BoltMesh.Parent = Bolt BoltMesh.Scale = Vector3.new(10, 10, 3) Stuff = Workspace:GetChildren() for i = 1 , #Stuff do if Stuff[i].className == "Model" and Stuff[i].Name ~= Me.Name then Torso = Stuff[i]:findFirstChild("Torso") Humanoid = Stuff[i]:findFirstChild("Humanoid") if Torso ~= nil and Humanoid ~= nil then if (Bolt.Position-Torso.Position).magnitude <= 15 then Humanoid.MaxHealth = 100 Humanoid:TakeDamage(Damage) end end end end game.Lighting.Brightness = 10 Sound.SoundId = "http://www.roblox.com/asset/?id=12222030" Sound:play() for i = 1 , math.random(9, 13) do FakeBolt = Instance.new("Part") FakeBolt.Parent = Tool FakeBolt.Anchored = true FakeBolt.Name = "Shadow" FakeBolt.CanCollide = false FakeBolt.Locked = true FakeBolt.Transparency = 0.2 FakeBolt.formFactor = "Symmetric" FakeBolt.Size = Vector3.new(1, 1, math.random(5, 10)) FakeBolt.TopSurface = "Smooth" FakeBolt.BrickColor = BrickColor.new(1010) FakeBolt.BottomSurface = "Smooth" Value = (math.random(-5, 5)/100) Value2 = (math.random(-5, 5)/100) Value3 = (math.random(-5, 5)/100) FakeBolt.CFrame = Bolt.CFrame * CFrame.new(0, 0, -(Bolt.Size.Z/2)) FakeBolt.CFrame = FakeBolt.CFrame * CFrame.Angles(Value, Value2, Value3) FakeBolt.CFrame = FakeBolt.CFrame * CFrame.new(0, 0, -(FakeBolt.Size.Z/2)) FakeBoltMesh = Instance.new("SpecialMesh") FakeBoltMesh.MeshType = "Brick" FakeBoltMesh.Parent = FakeBolt FakeBoltMesh.Scale = Vector3.new(10, 10, 3) Stuff = Workspace:GetChildren() for i = 1 , #Stuff do if Stuff[i].className == "Model" and Stuff[i].Name ~= Me.Name then Torso = Stuff[i]:findFirstChild("Torso") Humanoid = Stuff[i]:findFirstChild("Humanoid") if Torso ~= nil and Humanoid ~= nil then if (FakeBolt.Position-Torso.Position).magnitude <= 15 then Humanoid.MaxHealth = 100 Humanoid:TakeDamage(Damage) end end end end Bolt:Remove() Bolt = Instance.new("Part") Bolt.Parent = Tool Bolt.Anchored = true Bolt.Name = "Shadow" Bolt.CanCollide = false Bolt.Locked = true Bolt.Transparency = 0.2 Bolt.formFactor = "Symmetric" Bolt.Size = Vector3.new(1, 1, math.random(5, 10)) Bolt.TopSurface = "Smooth" Bolt.BrickColor = BrickColor.new(1010) Bolt.BottomSurface = "Smooth" Value = (math.random(-5, 5)/100) Value2 = (math.random(-5, 5)/100) Value3 = (math.random(-5, 5)/100) Bolt.CFrame = FakeBolt.CFrame * CFrame.new(0, 0, -(FakeBolt.Size.Z/2)) Bolt.CFrame = Bolt.CFrame * CFrame.Angles(Value, Value2, Value3) Bolt.CFrame = Bolt.CFrame * CFrame.new(0, 0, -(Bolt.Size.Z/2)) BoltMesh = Instance.new("SpecialMesh") BoltMesh.MeshType = "Brick" BoltMesh.Parent = Bolt BoltMesh.Scale = Vector3.new(10, 10, 3) Stuff = Workspace:GetChildren() for i = 1 , #Stuff do if Stuff[i].className == "Model" and Stuff[i].Name ~= Me.Name then Torso = Stuff[i]:findFirstChild("Torso") Humanoid = Stuff[i]:findFirstChild("Humanoid") if Torso ~= nil and Humanoid ~= nil then if (Bolt.Position-Torso.Position).magnitude <= 15 then Humanoid.MaxHealth = 100 Humanoid:TakeDamage(Damage) end end end end Bolt2 = Instance.new("Part") Bolt2.Parent = Tool Bolt2.Anchored = true Bolt2.Name = "Shadow" Bolt2.CanCollide = false Bolt2.Locked = true Bolt2.Transparency = 0.2 Bolt2.formFactor = "Symmetric" Bolt2.Size = Bolt.Size Bolt2.TopSurface = "Smooth" Bolt2.BrickColor = BrickColor.new(1010) Bolt2.BottomSurface = "Smooth" Bolt2.CFrame = Bolt.CFrame BoltMesh = Instance.new("SpecialMesh") BoltMesh.MeshType = "Brick" BoltMesh.Parent = Bolt2 BoltMesh.Scale = Vector3.new(10, 10, 3) Stuff = Workspace:GetChildren() for i = 1 , #Stuff do if Stuff[i].className == "Model" and Stuff[i].Name ~= Me.Name then Torso = Stuff[i]:findFirstChild("Torso") Humanoid = Stuff[i]:findFirstChild("Humanoid") if Torso ~= nil and Humanoid ~= nil then if (Bolt2.Position-Torso.Position).magnitude <= 20 then Humanoid.MaxHealth = 100 Humanoid:TakeDamage(Damage) end end end end end FakeBolt = Instance.new("Part") FakeBolt.Parent = Tool FakeBolt.Anchored = true FakeBolt.Name = "Shadow" FakeBolt.CanCollide = false FakeBolt.Locked = true FakeBolt.Transparency = 0.2 FakeBolt.formFactor = "Symmetric" FakeBolt.Size = Vector3.new(1, 1, math.random(5, 10)) FakeBolt.TopSurface = "Smooth" FakeBolt.BrickColor = BrickColor.new(1010) FakeBolt.BottomSurface = "Smooth" Value = (math.random(-5, 5)/100) Value2 = (math.random(-5, 5)/100) Value3 = (math.random(-5, 5)/100) FakeBolt.CFrame = Bolt.CFrame * CFrame.new(0, 0, -(Bolt.Size.Z/2)) FakeBolt.CFrame = FakeBolt.CFrame * CFrame.Angles(Value, Value2, Value3) FakeBolt.CFrame = FakeBolt.CFrame * CFrame.new(0, 0, -(FakeBolt.Size.Z/2)) FakeBoltMesh = Instance.new("SpecialMesh") FakeBoltMesh.MeshType = "Brick" FakeBoltMesh.Parent = FakeBolt FakeBoltMesh.Scale = Vector3.new(10, 10, 3) Stuff = Workspace:GetChildren() for i = 1 , #Stuff do if Stuff[i].className == "Model" and Stuff[i].Name ~= Me.Name then Torso = Stuff[i]:findFirstChild("Torso") Humanoid = Stuff[i]:findFirstChild("Humanoid") if Torso ~= nil and Humanoid ~= nil then if (FakeBolt.Position-Torso.Position).magnitude <= 10 then Humanoid.MaxHealth = 100 Humanoid:TakeDamage(Damage) FakeBolt.CFrame = CFrame.new(FakeBolt.Position, Torso.Position) end end end end Bolt:Remove() wait(0.1) game.Lighting.Brightness = 1 for i = 1 , 8 do Clone1 = Grip17:clone() Clone1.Parent = Tool Clone1.Name = "Shadow" Clone1.Anchored = true Clone1.CanCollide = false Clone1.Transparency = 0.2 Clone1.BrickColor = BrickColor.new(1010) Clone2 = Grip18:clone() Clone2.Parent = Tool Clone2.Name = "Shadow" Clone2.Anchored = true Clone2.CanCollide = false Clone2.Transparency = 0.2 Clone2.BrickColor = BrickColor.new(1010) Clone3 = Grip19:clone() Clone3.Parent = Tool Clone3.Name = "Shadow" Clone3.Anchored = true Clone3.CanCollide = false Clone3.Transparency = 0.2 Clone3.BrickColor = BrickColor.new(1010) FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(0.13, 0, 0) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(0.39, 0, 0) wait() end Weld.Parent = Me.Character["Right Arm"] Weld.Part0 = Me.Character["Right Arm"] Weld.C0 = CFrame.new(-0.3, -1, 0.05) * CFrame.Angles(-1.15, -0.3, -0.15) Activated = false end if Mode == "Ice" then Activated = true Weld.Parent = Me.Character["Left Arm"] Weld.Part0 = Me.Character["Left Arm"] Weld.C0 = CFrame.new(0.3, -1, -0.05) * CFrame.Angles(-1.15, 0.3, -1.3) for i = 1 , 8 do Clone1 = Grip17:clone() Clone1.Parent = Tool Clone1.Name = "Shadow" Clone1.Anchored = true Clone1.CanCollide = false Clone1.Transparency = 0.2 Clone1.BrickColor = BrickColor.new(23) Clone2 = Grip18:clone() Clone2.Parent = Tool Clone2.Name = "Shadow" Clone2.Anchored = true Clone2.CanCollide = false Clone2.Transparency = 0.2 Clone2.BrickColor = BrickColor.new(23) Clone3 = Grip19:clone() Clone3.Parent = Tool Clone3.Name = "Shadow" Clone3.Anchored = true Clone3.CanCollide = false Clone3.Transparency = 0.2 Clone3.BrickColor = BrickColor.new(23) FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(-0.13, 0, 0) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(-0.39, 0, 0) wait() end Bolt = Instance.new("Part") Bolt.Parent = Tool Bolt.Anchored = true Bolt.Name = "Shadow" Bolt.CanCollide = false Bolt.Locked = true Bolt.Transparency = 0.2 Bolt.Reflectance = 0.3 Bolt.formFactor = "Symmetric" Bolt.Size = Vector3.new(1, 3, math.random(5, 10)) Bolt.TopSurface = "Smooth" Bolt.BrickColor = BrickColor.new(1) Bolt.BottomSurface = "Smooth" Value = (math.random(-5, 5)/100) Value2 = (math.random(-5, 5)/100) Value3 = (math.random(-5, 5)/100) Bolt.CFrame = Me.Character.Torso.CFrame * CFrame.new(0, 0, -6) * CFrame.Angles(Value, Value2, Value3) BoltMesh = Instance.new("SpecialMesh") BoltMesh.MeshType = "Brick" BoltMesh.Parent = Bolt BoltMesh.Scale = Vector3.new(0.7, 0.7, 1) Stuff = Workspace:GetChildren() for i = 1 , #Stuff do if Stuff[i].className == "Model" and Stuff[i].Name ~= Me.Name then Torso = Stuff[i]:findFirstChild("Torso") Humanoid = Stuff[i]:findFirstChild("Humanoid") if Torso ~= nil and Humanoid ~= nil then if (Bolt.Position-Torso.Position).magnitude <= 15 then Humanoid.MaxHealth = 100 Humanoid:TakeDamage(Damage) Stuff2 = Stuff[i]:GetChildren() for i = 1 , #Stuff2 do if Stuff2[i].className == "Part" then Stuff2[i].Anchored = true Stuff2[i].Transparency = 0.5 Stuff2[i].Reflectance = 0.5 Stuff2[i].Friction = 0 IceBrick = Instance.new("Part") IceBrick.Parent = Stuff2[i] IceBrick.Anchored = true IceBrick.Locked = true IceBrick.Transparency = 0.5 IceBrick.Reflectance = 0.5 IceBrick.Size = Stuff2[i].Size + Vector3.new(math.random(2, 4), math.random(2, 4), math.random(2, 4)) IceBrick.TopSurface = "Smooth" IceBrick.BottomSurface = "Smooth" IceBrick.CFrame = Stuff2[i].CFrame * CFrame.Angles(math.random(-3, 3), math.random(-3, 3), math.random(-3, 3)) end end end end end end for i = 1 , math.random(9, 13) do FakeBolt = Instance.new("Part") FakeBolt.Parent = Tool FakeBolt.Anchored = true FakeBolt.Name = "Shadow" FakeBolt.CanCollide = false FakeBolt.Locked = true FakeBolt.Reflectance = 0.3 FakeBolt.Transparency = 0.2 FakeBolt.formFactor = "Symmetric" FakeBolt.Size = Vector3.new(1, 3, math.random(5, 10)) FakeBolt.TopSurface = "Smooth" FakeBolt.BrickColor = BrickColor.new(1) FakeBolt.BottomSurface = "Smooth" Value = (math.random(-5, 5)/100) Value2 = (math.random(-5, 5)/100) Value3 = (math.random(-5, 5)/100) FakeBolt.CFrame = Bolt.CFrame * CFrame.new(0, 0, -(Bolt.Size.Z/2)) FakeBolt.CFrame = FakeBolt.CFrame * CFrame.Angles(Value, Value2, Value3) FakeBolt.CFrame = FakeBolt.CFrame * CFrame.new(0, 0, -(FakeBolt.Size.Z/2)) FakeBoltMesh = Instance.new("SpecialMesh") FakeBoltMesh.MeshType = "Brick" FakeBoltMesh.Parent = FakeBolt FakeBoltMesh.Scale = Vector3.new(0.7, 0.7, 1) Stuff = Workspace:GetChildren() for i = 1 , #Stuff do if Stuff[i].className == "Model" and Stuff[i].Name ~= Me.Name then Torso = Stuff[i]:findFirstChild("Torso") Humanoid = Stuff[i]:findFirstChild("Humanoid") if Torso ~= nil and Humanoid ~= nil then if (FakeBolt.Position-Torso.Position).magnitude <= 15 then Humanoid.MaxHealth = 100 Humanoid:TakeDamage(Damage) Stuff2 = Stuff[i]:GetChildren() for i = 1 , #Stuff2 do if Stuff2[i].className == "Part" then Stuff2[i].Anchored = true Stuff2[i].Transparency = 0.5 Stuff2[i].Reflectance = 0.5 Stuff2[i].Friction = 0 IceBrick = Instance.new("Part") IceBrick.Parent = Stuff2[i] IceBrick.Anchored = true IceBrick.Locked = true IceBrick.Transparency = 0.5 IceBrick.Reflectance = 0.5 IceBrick.Size = Stuff2[i].Size + Vector3.new(math.random(2, 4), math.random(2, 4), math.random(2, 4)) IceBrick.TopSurface = "Smooth" IceBrick.BottomSurface = "Smooth" IceBrick.CFrame = Stuff2[i].CFrame * CFrame.Angles(math.random(-3, 3), math.random(-3, 3), math.random(-3, 3)) end end end end end end Bolt:Remove() Bolt = Instance.new("Part") Bolt.Parent = Tool Bolt.Anchored = true Bolt.Name = "Shadow" Bolt.CanCollide = false Bolt.Locked = true Bolt.Reflectance = 0.3 Bolt.Transparency = 0.2 Bolt.formFactor = "Symmetric" Bolt.Size = Vector3.new(1, 3, math.random(5, 10)) Bolt.TopSurface = "Smooth" Bolt.BrickColor = BrickColor.new(1) Bolt.BottomSurface = "Smooth" Value = (math.random(-5, 5)/100) Value2 = (math.random(-5, 5)/100) Value3 = (math.random(-5, 5)/100) Bolt.CFrame = FakeBolt.CFrame * CFrame.new(0, 0, -(FakeBolt.Size.Z/2)) Bolt.CFrame = Bolt.CFrame * CFrame.Angles(Value, Value2, Value3) Bolt.CFrame = Bolt.CFrame * CFrame.new(0, 0, -(Bolt.Size.Z/2)) BoltMesh = Instance.new("SpecialMesh") BoltMesh.MeshType = "Brick" BoltMesh.Parent = Bolt BoltMesh.Scale = Vector3.new(0.7, 0.7, 1) Stuff = Workspace:GetChildren() for i = 1 , #Stuff do if Stuff[i].className == "Model" and Stuff[i].Name ~= Me.Name then Torso = Stuff[i]:findFirstChild("Torso") Humanoid = Stuff[i]:findFirstChild("Humanoid") if Torso ~= nil and Humanoid ~= nil then if (Bolt.Position-Torso.Position).magnitude <= 15 then Humanoid.MaxHealth = 100 Humanoid:TakeDamage(Damage) Stuff2 = Stuff[i]:GetChildren() for i = 1 , #Stuff2 do if Stuff2[i].className == "Part" then Stuff2[i].Anchored = true Stuff2[i].Transparency = 0.5 Stuff2[i].Reflectance = 0.5 Stuff2[i].Friction = 0 IceBrick = Instance.new("Part") IceBrick.Parent = Stuff2[i] IceBrick.Anchored = true IceBrick.Locked = true IceBrick.Transparency = 0.5 IceBrick.Reflectance = 0.5 IceBrick.Size = Stuff2[i].Size + Vector3.new(math.random(2, 4), math.random(2, 4), math.random(2, 4)) IceBrick.TopSurface = "Smooth" IceBrick.BottomSurface = "Smooth" IceBrick.CFrame = Stuff2[i].CFrame * CFrame.Angles(math.random(-3, 3), math.random(-3, 3), math.random(-3, 3)) end end end end end end Bolt2 = Instance.new("Part") Bolt2.Parent = Tool Bolt2.Anchored = true Bolt2.Name = "Shadow" Bolt2.CanCollide = false Bolt2.Locked = true Bolt2.Reflectance = 0.3 Bolt2.Transparency = 0.2 Bolt2.formFactor = "Symmetric" Bolt2.Size = Bolt.Size Bolt2.TopSurface = "Smooth" Bolt2.BrickColor = BrickColor.new(1) Bolt2.BottomSurface = "Smooth" Bolt2.CFrame = Bolt.CFrame BoltMesh = Instance.new("SpecialMesh") BoltMesh.MeshType = "Brick" BoltMesh.Parent = Bolt2 BoltMesh.Scale = Vector3.new(0.7, 0.7, 1) Stuff = Workspace:GetChildren() for i = 1 , #Stuff do if Stuff[i].className == "Model" and Stuff[i].Name ~= Me.Name then Torso = Stuff[i]:findFirstChild("Torso") Humanoid = Stuff[i]:findFirstChild("Humanoid") if Torso ~= nil and Humanoid ~= nil then if (Bolt2.Position-Torso.Position).magnitude <= 20 then Humanoid.MaxHealth = 100 Humanoid:TakeDamage(Damage) Stuff2 = Stuff[i]:GetChildren() for i = 1 , #Stuff2 do if Stuff2[i].className == "Part" then Stuff2[i].Anchored = true Stuff2[i].Transparency = 0.5 Stuff2[i].Reflectance = 0.5 Stuff2[i].Friction = 0 IceBrick = Instance.new("Part") IceBrick.Parent = Stuff2[i] IceBrick.Anchored = true IceBrick.Locked = true IceBrick.Transparency = 0.5 IceBrick.Reflectance = 0.5 IceBrick.Size = Stuff2[i].Size + Vector3.new(math.random(2, 4), math.random(2, 4), math.random(2, 4)) IceBrick.TopSurface = "Smooth" IceBrick.BottomSurface = "Smooth" IceBrick.CFrame = Stuff2[i].CFrame * CFrame.Angles(math.random(-3, 3), math.random(-3, 3), math.random(-3, 3)) end end end end end end end FakeBolt = Instance.new("Part") FakeBolt.Parent = Tool FakeBolt.Anchored = true FakeBolt.Name = "Shadow" FakeBolt.CanCollide = false FakeBolt.Locked = true FakeBolt.Reflectance = 0.3 FakeBolt.Transparency = 0.2 FakeBolt.formFactor = "Symmetric" FakeBolt.Size = Vector3.new(1, 3, math.random(5, 10)) FakeBolt.TopSurface = "Smooth" FakeBolt.BrickColor = BrickColor.new(1) FakeBolt.BottomSurface = "Smooth" Value = (math.random(-5, 5)/100) Value2 = (math.random(-5, 5)/100) Value3 = (math.random(-5, 5)/100) FakeBolt.CFrame = Bolt.CFrame * CFrame.new(0, 0, -(Bolt.Size.Z/2)) FakeBolt.CFrame = FakeBolt.CFrame * CFrame.Angles(Value, Value2, Value3) FakeBolt.CFrame = FakeBolt.CFrame * CFrame.new(0, 0, -(FakeBolt.Size.Z/2)) FakeBoltMesh = Instance.new("SpecialMesh") FakeBoltMesh.MeshType = "Brick" FakeBoltMesh.Parent = FakeBolt FakeBoltMesh.Scale = Vector3.new(0.7, 0.7, 1) Stuff = Workspace:GetChildren() for i = 1 , #Stuff do if Stuff[i].className == "Model" and Stuff[i].Name ~= Me.Name then Torso = Stuff[i]:findFirstChild("Torso") Humanoid = Stuff[i]:findFirstChild("Humanoid") if Torso ~= nil and Humanoid ~= nil then if (FakeBolt.Position-Torso.Position).magnitude <= 10 then Humanoid.MaxHealth = 100 Humanoid:TakeDamage(Damage) Stuff2 = Stuff[i]:GetChildren() for i = 1 , #Stuff2 do if Stuff2[i].className == "Part" then Stuff2[i].Anchored = true Stuff2[i].Transparency = 0.5 Stuff2[i].Reflectance = 0.5 Stuff2[i].Friction = 0 IceBrick = Instance.new("Part") IceBrick.Parent = Stuff2[i] IceBrick.Anchored = true IceBrick.Locked = true IceBrick.Transparency = 0.5 IceBrick.Reflectance = 0.5 IceBrick.Size = Stuff2[i].Size + Vector3.new(math.random(2, 4), math.random(2, 4), math.random(2, 4)) IceBrick.TopSurface = "Smooth" IceBrick.BottomSurface = "Smooth" IceBrick.CFrame = Stuff2[i].CFrame * CFrame.Angles(math.random(-3, 3), math.random(-3, 3), math.random(-3, 3)) end end end end end end Bolt:Remove() wait(0.1) for i = 1 , 8 do Clone1 = Grip17:clone() Clone1.Parent = Tool Clone1.Name = "Shadow" Clone1.Anchored = true Clone1.CanCollide = false Clone1.Transparency = 0.2 Clone1.BrickColor = BrickColor.new(23) Clone2 = Grip18:clone() Clone2.Parent = Tool Clone2.Name = "Shadow" Clone2.Anchored = true Clone2.CanCollide = false Clone2.Transparency = 0.2 Clone2.BrickColor = BrickColor.new(23) Clone3 = Grip19:clone() Clone3.Parent = Tool Clone3.Name = "Shadow" Clone3.Anchored = true Clone3.CanCollide = false Clone3.Transparency = 0.2 Clone3.BrickColor = BrickColor.new(23) FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(0.13, 0, 0) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(0.39, 0, 0) wait() end Weld.Parent = Me.Character["Right Arm"] Weld.Part0 = Me.Character["Right Arm"] Weld.C0 = CFrame.new(-0.3, -1, 0.05) * CFrame.Angles(-1.15, -0.3, -0.15) Activated = false end if Mode == "Fire" then Activated = true Weld.Parent = Me.Character["Left Arm"] Weld.Part0 = Me.Character["Left Arm"] Weld.C0 = CFrame.new(0.3, -1, -0.05) * CFrame.Angles(-1.15, 0.3, -1.3) Sound.SoundId = "rbxasset://sounds\\swordslash.wav" Sound:play() for i = 1 , 8 do Clone1 = Grip17:clone() Clone1.Parent = Tool Clone1.Name = "Shadow" Clone1.Anchored = true Clone1.CanCollide = false Clone1.Transparency = 0.2 Clone1.BrickColor = BrickColor.new(21) Clone2 = Grip18:clone() Clone2.Parent = Tool Clone2.Name = "Shadow" Clone2.Anchored = true Clone2.CanCollide = false Clone2.Transparency = 0.2 Clone2.BrickColor = BrickColor.new(21) Clone3 = Grip19:clone() Clone3.Parent = Tool Clone3.Name = "Shadow" Clone3.Anchored = true Clone3.CanCollide = false Clone3.Transparency = 0.2 Clone3.BrickColor = BrickColor.new(21) FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(-0.13, 0, 0) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(-0.39, 0, 0) wait() end Flaming = true while Flaming == true do wait() end wait(0.2) for i = 1 , 8 do Clone1 = Grip17:clone() Clone1.Parent = Tool Clone1.Name = "Shadow" Clone1.Anchored = true Clone1.CanCollide = false Clone1.Transparency = 0.2 Clone1.BrickColor = BrickColor.new(21) Clone2 = Grip18:clone() Clone2.Parent = Tool Clone2.Name = "Shadow" Clone2.Anchored = true Clone2.CanCollide = false Clone2.Transparency = 0.2 Clone2.BrickColor = BrickColor.new(21) Clone3 = Grip19:clone() Clone3.Parent = Tool Clone3.Name = "Shadow" Clone3.Anchored = true Clone3.CanCollide = false Clone3.Transparency = 0.2 Clone3.BrickColor = BrickColor.new(21) FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(0.13, 0, 0) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(0.39, 0, 0) wait() end Weld.Parent = Me.Character["Right Arm"] Weld.Part0 = Me.Character["Right Arm"] Weld.C0 = CFrame.new(-0.3, -1, 0.05) * CFrame.Angles(-1.15, -0.3, -0.15) Activated = false end if Mode == "Slime" then Activated = true Weld.Parent = Me.Character["Left Arm"] Weld.Part0 = Me.Character["Left Arm"] Weld.C0 = CFrame.new(0.3, -1, -0.05) * CFrame.Angles(-1.15, 0.3, -1.3) Sound.SoundId = "rbxasset://sounds\\swordslash.wav" Sound:play() for i = 1 , 8 do Clone1 = Grip17:clone() Clone1.Parent = Tool Clone1.Name = "Shadow" Clone1.Anchored = true Clone1.CanCollide = false Clone1.Transparency = 0.2 Clone1.BrickColor = BrickColor.new(1004) Clone2 = Grip18:clone() Clone2.Parent = Tool Clone2.Name = "Shadow" Clone2.Anchored = true Clone2.CanCollide = false Clone2.Transparency = 0.2 Clone2.BrickColor = BrickColor.new(1004) Clone3 = Grip19:clone() Clone3.Parent = Tool Clone3.Name = "Shadow" Clone3.Anchored = true Clone3.CanCollide = false Clone3.Transparency = 0.2 Clone3.BrickColor = BrickColor.new(1004) FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(-0.13, 0, 0) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(-0.39, 0, 0) wait() end SlimeCharge = true Slime = Instance.new("Part") Slime.Parent = Me.Character.Torso Slime.Size = Vector3.new(1, 1, 1) Slime.BrickColor = BrickColor.new(1003) Slime.Locked = true Slime.Shape = "Ball" Slime.Anchored = true Slime.TopSurface = "Smooth" Slime.BottomSurface = "Smooth" Slime.Transparency = 0.4 Slime.CFrame = Me.Character.Torso.CFrame * CFrame.new(0, 0, -10) Nucleus = Instance.new("Part") Nucleus.Parent = Slime Nucleus.Size = Vector3.new(2, 2, 2) Nucleus.BrickColor = BrickColor.new(1004) Nucleus.Locked = true Nucleus.LeftSurface = "Glue" Nucleus.Anchored = true Nucleus.RightSurface = "Glue" Nucleus.FrontSurface = "Glue" Nucleus.BackSurface = "Glue" Nucleus.TopSurface = "Glue" Nucleus.BottomSurface = "Glue" Nucleus.Transparency = 0.1 Nucleus.Shape = "Ball" Nucleus.CFrame = Slime.CFrame SlimeWeld = Instance.new("Weld") SlimeWeld.Parent = Slime SlimeWeld.Part0 = Slime SlimeWeld.Part1 = Nucleus SlimeWeld.C0 = CFrame.new(0, 0, 0) while SlimeCharge == true do Slime.CFrame = Me.Character.Torso.CFrame * CFrame.new(0, 0, -10) Nucleus.CFrame = Slime.CFrame if Slime.Size.X <= 10 then SlimeWeld:Remove() Slime.Size = Slime.Size + Vector3.new(1, 1, 1) Slime.CFrame = Me.Character.Torso.CFrame * CFrame.new(0, 0, -10) Nucleus.CFrame = Slime.CFrame SlimeWeld = Instance.new("Weld") SlimeWeld.Parent = Slime SlimeWeld.Part0 = Slime SlimeWeld.Part1 = Nucleus SlimeWeld.C0 = CFrame.new(0, 0, 0) end wait() end wait(0.2) for i = 1 , 8 do Clone1 = Grip17:clone() Clone1.Parent = Tool Clone1.Name = "Shadow" Clone1.Anchored = true Clone1.CanCollide = false Clone1.Transparency = 0.2 Clone1.BrickColor = BrickColor.new(1010) Clone2 = Grip18:clone() Clone2.Parent = Tool Clone2.Name = "Shadow" Clone2.Anchored = true Clone2.CanCollide = false Clone2.Transparency = 0.2 Clone2.BrickColor = BrickColor.new(1010) Clone3 = Grip19:clone() Clone3.Parent = Tool Clone3.Name = "Shadow" Clone3.Anchored = true Clone3.CanCollide = false Clone3.Transparency = 0.2 Clone3.BrickColor = BrickColor.new(1010) FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(0.13, 0, 0) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(0.39, 0, 0) wait() end Weld.Parent = Me.Character["Right Arm"] Weld.Part0 = Me.Character["Right Arm"] Weld.C0 = CFrame.new(-0.3, -1, 0.05) * CFrame.Angles(-1.15, -0.3, -0.15) Activated = false end if Mode == "DarkPulse" then Activated = true Weld.Parent = Me.Character["Left Arm"] Weld.Part0 = Me.Character["Left Arm"] Weld.C0 = CFrame.new(0.3, -1, -0.05) * CFrame.Angles(-1.15, 0.3, -1.3) Sound.SoundId = "rbxasset://sounds\\swordslash.wav" Sound:play() for i = 1 , 8 do Clone1 = Grip17:clone() Clone1.Parent = Tool Clone1.Name = "Shadow" Clone1.Anchored = true Clone1.CanCollide = false Clone1.Transparency = 0.2 Clone1.BrickColor = BrickColor.new(1003) Clone2 = Grip18:clone() Clone2.Parent = Tool Clone2.Name = "Shadow" Clone2.Anchored = true Clone2.CanCollide = false Clone2.Transparency = 0.2 Clone2.BrickColor = BrickColor.new(1003) Clone3 = Grip19:clone() Clone3.Parent = Tool Clone3.Name = "Shadow" Clone3.Anchored = true Clone3.CanCollide = false Clone3.Transparency = 0.2 Clone3.BrickColor = BrickColor.new(1003) FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(-0.13, 0, 0) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(-0.39, 0, 0) wait() end DarkCharge = true Dark = Instance.new("Part") Dark.Parent = Me.Character.Torso Dark.Size = Vector3.new(1, 2, 1) Dark.BrickColor = BrickColor.new(1003) Dark.Locked = true Dark.Anchored = true Dark.TopSurface = "Smooth" Dark.BottomSurface = "Smooth" Dark.Transparency = 0 Dark.CFrame = Me.Character.Torso.CFrame * CFrame.new(0, 0, -20) DarkMesh = Instance.new("SpecialMesh") DarkMesh.Parent = Dark DarkMesh.MeshType = "Sphere" Gyro = Instance.new("BodyGyro") Gyro.Parent = Dark Gyro.maxTorque = Vector3.new(math.huge, math.huge, math.huge) Gyro.D = 50 Gyro.cframe = Dark.CFrame while DarkCharge == true do if Dark.Transparency < 0 then Dark.Transparency = Dark.Transparency + 0 end Dark.CFrame = Me.Character.Torso.CFrame * CFrame.new(0, 0, -20) if Dark.Size.X <= 20 then Dark.Size = Dark.Size + Vector3.new(1, 0, 1) Dark.CFrame = Me.Character.Torso.CFrame * CFrame.new(0, 0, -20) end wait() end wait(0.2) for i = 1 , 8 do Clone1 = Grip17:clone() Clone1.Parent = Tool Clone1.Name = "Shadow" Clone1.Anchored = true Clone1.CanCollide = false Clone1.Transparency = 0.2 Clone1.BrickColor = BrickColor.new(1003) Clone2 = Grip18:clone() Clone2.Parent = Tool Clone2.Name = "Shadow" Clone2.Anchored = true Clone2.CanCollide = false Clone2.Transparency = 0.2 Clone2.BrickColor = BrickColor.new(1003) Clone3 = Grip19:clone() Clone3.Parent = Tool Clone3.Name = "Shadow" Clone3.Anchored = true Clone3.CanCollide = false Clone3.Transparency = 0.2 Clone3.BrickColor = BrickColor.new(1003) FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(0.13, 0, 0) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(0.39, 0, 0) wait() end Weld.Parent = Me.Character["Right Arm"] Weld.Part0 = Me.Character["Right Arm"] Weld.C0 = CFrame.new(-0.3, -1, 0.05) * CFrame.Angles(-1.15, -0.3, -0.15) end if Mode == "Raise" then if mouse.Target ~= nil then Activated = true MousePosition = mouse.Hit.p Sound.SoundId = "rbxasset://sounds\\swordslash.wav" Sound:play() for i = 1 , 8 do Clone1 = Grip17:clone() Clone1.Parent = Tool Clone1.Name = "Shadow" Clone1.Anchored = true Clone1.CanCollide = false Clone1.Transparency = 0.2 Clone1.BrickColor = BrickColor.new("Dark stone grey") Clone2 = Grip18:clone() Clone2.Parent = Tool Clone2.Name = "Shadow" Clone2.Anchored = true Clone2.CanCollide = false Clone2.Transparency = 0.2 Clone2.BrickColor = BrickColor.new("Dark stone grey") Clone3 = Grip19:clone() Clone3.Parent = Tool Clone3.Name = "Shadow" Clone3.Anchored = true Clone3.CanCollide = false Clone3.Transparency = 0.2 Clone3.BrickColor = BrickColor.new("Dark stone grey") FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(0, 0, 0.13) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(-0.39, 0, 0) wait() end onCharge(28) WidthSize = 10 for i = 1 , 20 do Rock = Instance.new("Part") Rock.Parent = Tool Rock.Name = "Rock" Rock.Anchored = true Rock.BrickColor = BrickColor.new("Dark stone grey") Base = Workspace:findFirstChild("Base") if Base ~= nil then Rock.BrickColor = Base.BrickColor end Rock.Material = "Concrete" Rock.Size = Vector3.new(60+(WidthSize*i), 2, 60+(WidthSize*i)) Rock.formFactor = "Symmetric" Rock.Locked = true Rock.BottomSurface = "Smooth" Rock.CFrame = CFrame.new(MousePosition-Vector3.new(0, 2+((WidthSize/1.9)*i), 0)) end for i = 1 , 32 do Stuff = Tool:GetChildren() for i = 1 , #Stuff do if Stuff[i].Name == "Rock" then Stuff2 = Workspace:GetChildren() for i = 1 , #Stuff2 do Torso = Stuff2[i]:findFirstChild("Torso") if Torso ~= nil then if (Rock.Position-Torso.Position).magnitude <= 30 then Torso.Velocity = Vector3.new(0, 200, 0) end end end Stuff[i].Velocity = Vector3.new(0, 100, 0) P = Stuff[i].CFrame Stuff[i].Size = Stuff[i].Size + Vector3.new(0, 4, 0) Stuff[i].CFrame = P * CFrame.new(0, 1.5, 0) end end wait() end wait(5) for i = 1 , 40 do Stuff = Tool:GetChildren() for i = 1 , #Stuff do if Stuff[i].Name == "Rock" then P = Stuff[i].CFrame Stuff[i].Size = Stuff[i].Size + Vector3.new(0, -4, 0) Stuff[i].CFrame = P * CFrame.new(0, -1.5, 0) end end wait() end Stuff = Tool:GetChildren() for i = 1 , #Stuff do if Stuff[i].Name == "Rock" then Stuff[i]:Remove() end end wait(0.2) for i = 1 , 8 do Clone1 = Grip17:clone() Clone1.Parent = Tool Clone1.Name = "Shadow" Clone1.Anchored = true Clone1.CanCollide = false Clone1.Transparency = 0.2 Clone1.BrickColor = BrickColor.new("Dark stone grey") Clone2 = Grip18:clone() Clone2.Parent = Tool Clone2.Name = "Shadow" Clone2.Anchored = true Clone2.CanCollide = false Clone2.Transparency = 0.2 Clone2.BrickColor = BrickColor.new("Dark stone grey") Clone3 = Grip19:clone() Clone3.Parent = Tool Clone3.Name = "Shadow" Clone3.Anchored = true Clone3.CanCollide = false Clone3.Transparency = 0.2 Clone3.BrickColor = BrickColor.new("Dark stone grey") FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(0, 0, -0.13) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(0.39, 0, 0) wait() end Activated = false end end if Mode == "Stone" then Activated = true Sound.SoundId = "rbxasset://sounds\\swordslash.wav" Sound:play() for i = 1 , 8 do Clone1 = Grip17:clone() Clone1.Parent = Tool Clone1.Name = "Shadow" Clone1.Anchored = true Clone1.CanCollide = false Clone1.Transparency = 0.2 Clone1.BrickColor = BrickColor.new("Dark stone grey") Clone2 = Grip18:clone() Clone2.Parent = Tool Clone2.Name = "Shadow" Clone2.Anchored = true Clone2.CanCollide = false Clone2.Transparency = 0.2 Clone2.BrickColor = BrickColor.new("Dark stone grey") Clone3 = Grip19:clone() Clone3.Parent = Tool Clone3.Name = "Shadow" Clone3.Anchored = true Clone3.CanCollide = false Clone3.Transparency = 0.2 Clone3.BrickColor = BrickColor.new("Dark stone grey") FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(0, 0, 0.13) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(-0.39, 0, 0) wait() end onCharge(27) Stuff = game.Workspace:GetChildren() for i = 1 , #Stuff do if Stuff[i].Name ~= Me.Name then Torso = Stuff[i]:findFirstChild("Torso") Humanoid = Stuff[i]:findFirstChild("Humanoid") if Torso ~= nil and Humanoid ~= nil then if (Me.Character.Torso.Position-Torso.Position).magnitude <= 200 then Humanoid.Sit = true Rock = Instance.new("Part") Rock.Parent = Tool Rock.Name = "Rock" Rock.Anchored = true Rock.BrickColor = BrickColor.new("Dark stone grey") Rock.Material = "Concrete" Rock.Size = Vector3.new(10, 2, 10) Rock.formFactor = "Symmetric" Rock.Locked = true Rock.TopSurface = "Smooth" Rock.BottomSurface = "Smooth" Rock.CFrame = CFrame.new(Torso.Position-Vector3.new(0, 2, 0)) Torso.Velocity = Vector3.new(math.random(-20, 20), 150, math.random(-20, 20)) Humanoid.MaxHealth = 100 Humanoid:TakeDamage(Damage*3) end end end end for i = 1 , 10 do Stuff = Tool:GetChildren() for i = 1 , #Stuff do if Stuff[i].Name == "Rock" then P = Stuff[i].CFrame Stuff[i].Size = Stuff[i].Size + Vector3.new(0, 2, 0) Stuff[i].CFrame = P * CFrame.new(0, 1, 0) end end wait() end wait(0.1) for i = 1 , 10 do Stuff = Tool:GetChildren() for i = 1 , #Stuff do if Stuff[i].Name == "Rock" then P = Stuff[i].CFrame Stuff[i].Size = Stuff[i].Size - Vector3.new(0, 2, 0) Stuff[i].CFrame = P * CFrame.new(0, -1, 0) end end wait() end Stuff = Tool:GetChildren() for i = 1 , #Stuff do if Stuff[i].Name == "Rock" then Stuff[i]:Remove() end end wait(0.2) for i = 1 , 8 do Clone1 = Grip17:clone() Clone1.Parent = Tool Clone1.Name = "Shadow" Clone1.Anchored = true Clone1.CanCollide = false Clone1.Transparency = 0.2 Clone1.BrickColor = BrickColor.new("Dark stone grey") Clone2 = Grip18:clone() Clone2.Parent = Tool Clone2.Name = "Shadow" Clone2.Anchored = true Clone2.CanCollide = false Clone2.Transparency = 0.2 Clone2.BrickColor = BrickColor.new("Dark stone grey") Clone3 = Grip19:clone() Clone3.Parent = Tool Clone3.Name = "Shadow" Clone3.Anchored = true Clone3.CanCollide = false Clone3.Transparency = 0.2 Clone3.BrickColor = BrickColor.new("Dark stone grey") FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(0, 0, -0.13) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(0.39, 0, 0) wait() end Activated = false end if Mode == "Shield" then Activated = true Weld.Parent = Me.Character["Left Arm"] Weld.Part0 = Me.Character["Left Arm"] Weld.C0 = CFrame.new(0.3, -1, -0.05) * CFrame.Angles(-1.15, 0.3, -1.3) Sound.SoundId = "rbxasset://sounds\\swordslash.wav" Sound:play() for i = 1 , 8 do Clone1 = Grip17:clone() Clone1.Parent = Tool Clone1.Name = "Shadow" Clone1.Anchored = true Clone1.CanCollide = false Clone1.Transparency = 0.2 Clone1.BrickColor = BrickColor.new("Dark stone grey") Clone2 = Grip18:clone() Clone2.Parent = Tool Clone2.Name = "Shadow" Clone2.Anchored = true Clone2.CanCollide = false Clone2.Transparency = 0.2 Clone2.BrickColor = BrickColor.new("Dark stone grey") Clone3 = Grip19:clone() Clone3.Parent = Tool Clone3.Name = "Shadow" Clone3.Anchored = true Clone3.CanCollide = false Clone3.Transparency = 0.2 Clone3.BrickColor = BrickColor.new("Dark stone grey") FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(-0.13, 0, 0) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(-0.39, 0, 0) wait() end Shielding = true while Shielding == true do Me.Character.Humanoid.WalkSpeed = 0 Stuff = game.Workspace:GetChildren() for i = 1 , #Stuff do if Stuff[i].Name ~= "Base" and Stuff[i].Name ~= Me.Name then if Stuff[i].className == "Part" then if (Me.Character.Torso.Position-Stuff[i].Position).magnitude <= 30 then Stuff[i]:Remove() end end if Stuff[i].className == "Model" then Stuff2 = Stuff[i]:GetChildren() for i = 1 , #Stuff2 do if Stuff2[i].className == "Part" then if (Me.Character.Torso.Position-Stuff2[i].Position).magnitude <= 30 then Stuff2[i]:Remove() end end end end end end wait() end for i = 1 , 8 do Clone1 = Grip17:clone() Clone1.Parent = Tool Clone1.Name = "Shadow" Clone1.Anchored = true Clone1.CanCollide = false Clone1.Transparency = 0.2 Clone1.BrickColor = BrickColor.new("Dark stone grey") Clone2 = Grip18:clone() Clone2.Parent = Tool Clone2.Name = "Shadow" Clone2.Anchored = true Clone2.CanCollide = false Clone2.Transparency = 0.2 Clone2.BrickColor = BrickColor.new("Dark stone grey") Clone3 = Grip19:clone() Clone3.Parent = Tool Clone3.Name = "Shadow" Clone3.Anchored = true Clone3.CanCollide = false Clone3.Transparency = 0.2 Clone3.BrickColor = BrickColor.new("Dark stone grey") FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(0.13, 0, 0) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(0.39, 0, 0) wait() end Weld.Parent = Me.Character["Right Arm"] Weld.Part0 = Me.Character["Right Arm"] Weld.C0 = CFrame.new(-0.3, -1, 0.05) * CFrame.Angles(-1.15, -0.3, -0.15) Activated = false end if Mode == "Snipe" then if mouse.Target ~= nil then Torso = mouse.Target.Parent:findFirstChild("Torso") if mouse.Target.Parent.Name ~= Me.Name and Torso ~= nil then Activated = true Weld.Parent = Me.Character["Left Arm"] Weld.Part0 = Me.Character["Left Arm"] Weld.C0 = CFrame.new(0.3, -1, -0.05) * CFrame.Angles(-1.15, 0.3, -1.3) Sound.SoundId = "rbxasset://sounds\\swordslash.wav" Sound:play() for i = 1 , 4 do Clone1 = Grip17:clone() Clone1.Parent = Tool Clone1.Name = "Shadow" Clone1.Anchored = true Clone1.CanCollide = false Clone1.Transparency = 0.2 Clone1.BrickColor = BrickColor.new(1003) Clone2 = Grip18:clone() Clone2.Parent = Tool Clone2.Name = "Shadow" Clone2.Anchored = true Clone2.CanCollide = false Clone2.Transparency = 0.2 Clone2.BrickColor = BrickColor.new(1003) Clone3 = Grip19:clone() Clone3.Parent = Tool Clone3.Name = "Shadow" Clone3.Anchored = true Clone3.CanCollide = false Clone3.Transparency = 0.2 Clone3.BrickColor = BrickColor.new(1003) FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(-0.13, 0, 0) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(-0.39, 0, 0) wait() end Weld:Remove() Sound.SoundId = "http://www.roblox.com/asset/?id=18478970" Sound:play() Gyro = Instance.new("BodyGyro") Gyro.Parent = Handle Gyro.maxTorque = Vector3.new(math.huge, math.huge, math.huge) Gyro.cframe = Me.Character.Torso.CFrame * CFrame.Angles(0, 0, 1.57) Gyro.D = 50 Position = Instance.new("BodyPosition") Position.Parent = Handle Position.maxForce = Vector3.new(9999999999, 9999999999, 9999999999) Position.position = Torso.Position for i = 1 , 4 do FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(-0.13, 0, 0) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(-0.39, 0, 0) wait() end for i = 1 , 20 do if Torso ~= nil then Gyro.cframe = CFrame.new(Handle.Position, Torso.Position) * CFrame.Angles(-1.57, 0, 0) Position.position = Torso.Position end wait(0.1) end Gyro:Remove() Position:Remove() for i = 1 , 10 do Gyro.cframe = CFrame.new(Handle.Position, Me.Character.Torso.Position) * CFrame.Angles(-1.57, 0, 0) Position.position = Me.Character.Torso.Position wait(0.1) end Weld = Instance.new("Weld") Weld.Parent = Me.Character["Left Arm"] Weld.Part0 = Me.Character["Left Arm"] Weld.Part1 = Handle Weld.C0 = CFrame.new(0.3, -1, -0.05) * CFrame.Angles(-1.15, 0.3, -1.3) for i = 1 , 8 do Clone1 = Grip17:clone() Clone1.Parent = Tool Clone1.Name = "Shadow" Clone1.Anchored = true Clone1.CanCollide = false Clone1.Transparency = 0.2 Clone1.BrickColor = BrickColor.new(1003) Clone2 = Grip18:clone() Clone2.Parent = Tool Clone2.Name = "Shadow" Clone2.Anchored = true Clone2.CanCollide = false Clone2.Transparency = 0.2 Clone2.BrickColor = BrickColor.new(1003) Clone3 = Grip19:clone() Clone3.Parent = Tool Clone3.Name = "Shadow" Clone3.Anchored = true Clone3.CanCollide = false Clone3.Transparency = 0.2 Clone3.BrickColor = BrickColor.new(1003) FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(0.13, 0, 0) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.new(0, 0, 0) * CFrame.Angles(0.39, 0, 0) wait() end Weld.Parent = Me.Character["Right Arm"] Weld.Part0 = Me.Character["Right Arm"] Weld.C0 = CFrame.new(-0.3, -1, 0.05) * CFrame.Angles(-1.15, -0.3, -0.15) Activated = false end end end end ------------------------------------------------------------> --[[ ? -->> onButton1Up --]] ------------------------------------------------------------> function onButton1Up() Flaming = false Shielding = false if DarkCharge == true then Sound.SoundId = "http://www.roblox.com/asset/?id=11998770" Sound:play() DarkCharge = false Dark.Anchored = false Velocity = Instance.new("BodyVelocity") Velocity.Parent = Dark Velocity.maxForce = Vector3.new(math.huge, math.huge, math.huge) Velocity.velocity = Me.Character.Torso.CFrame.lookVector * 150 for i = 1 , 40 do Dark.Transparency = Dark.Transparency + 0.02 function DarkHit(Hit) if Hit.Name ~= "Base" and Hit.Parent.Name ~= "Sword" and Hit.Parent.Name ~= Me.Name and Hit.Parent.Parent.Name ~= Me.Name then Hit:Remove() end end Dark.Touched:connect(DarkHit) wait(0.1) end Dark:Remove() Activated = false end if SlimeCharge == true then SlimeCharge = false Slime.Anchored = false Nucleus.Anchored = false SlimeWeld = Instance.new("Weld") SlimeWeld.Parent = Slime SlimeWeld.Part0 = Slime SlimeWeld.Part1 = Nucleus SlimeWeld.C0 = CFrame.new(0, 0, 0) Velocity = Instance.new("BodyVelocity") Velocity.Parent = Slime Velocity.maxForce = Vector3.new(math.huge, 0, math.huge) Velocity.velocity = Me.Character.Torso.CFrame.lookVector * 100 function SlimeWeld(Hit) if Hit.Parent.Name ~= Me.Name then Humanoid = Hit.Parent:findFirstChild("Humanoid") if Humanoid ~= nil then Humanoid.MaxHealth = 0 Humanoid.Health = 0 Stuff = Humanoid.Parent:GetChildren() for i = 1 , #Stuff do if Stuff[i].className == "Part" then SlimeWeldz = Instance.new("Weld") SlimeWeldz.Parent = Slime SlimeWeldz.Part0 = Slime SlimeWeldz.Part1 = Stuff[i] SlimeWeldz.C0 = CFrame.new(math.random(-1, 1), math.random(-1, 1), math.random(-1, 1)) * CFrame.Angles(math.random(-3, 3), math.random(-3, 3), math.random(-3, 3)) end end end end end Slime.Touched:connect(SlimeWeld) end end ------------------------------------------------------------> --[[ ? -->> Selected --]] ------------------------------------------------------------> function onSelected(Mouse) Sound.SoundId = "rbxasset://sounds\\unsheath.wav" Sound:play() Mouse.Button1Down:connect(function() onButton1Down(mouse) end) Mouse.Button1Up:connect(function() onButton1Up(mouse) end) mouse = Mouse FakeRightShoulder = Instance.new("Weld") FakeRightShoulder.Parent = Me.Character.Torso FakeRightShoulder.Part0 = Me.Character.Torso FakeRightShoulder.Part1 = Me.Character["Right Arm"] FakeRightShoulder.C0 = OriginalRightShoulder FakeRightShoulder.C1 = OriginalRightShoulder2 FakeLeftShoulder = Instance.new("Weld") FakeLeftShoulder.Parent = Me.Character.Torso FakeLeftShoulder.Part0 = Me.Character.Torso FakeLeftShoulder.Part1 = Me.Character["Left Arm"] FakeLeftShoulder.C0 = OriginalLeftShoulder * CFrame.new(-0.25, 0, -0.45) FakeLeftShoulder.C1 = OriginalLeftShoulder2 Weld:Remove() Weld = Instance.new("Weld") Weld.Parent = Me.Character["Torso"] Weld.Part0 = Me.Character["Torso"] Weld.Part1 = Handle Weld.C0 = CFrame.new(1.6, 2.5, 0.6) * CFrame.Angles(0, 0, 2.2) Weld.C0 = Weld.C0 * CFrame.Angles(0, 1.57, 0) equipped = true Activated = false Equipping = true Unequipping = false Flaming = false Shielding = false SlimeCharge = false DarkCharge = false for i = 1 , 16 do FakeRightShoulder.C0 = OriginalRightShoulder * CFrame.Angles(0, 0, (i/5.2)) Weld.C0 = Weld.C0 * CFrame.new(0, 0, -0.03) * CFrame.Angles(0.03, 0, 0.11) wait() end wait() Weld.Parent = Me.Character["Right Arm"] Weld.Part0 = Me.Character["Right Arm"] Weld.C0 = CFrame.new(-0.3, -1, 0.05) * CFrame.Angles(-1.15, -0.3, -0.15) for i = 1 , 8 do FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(0, 0, -0.2) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.Angles(0, 0, -0.19) wait() end wait() for i = 1 , 8 do FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(0.05, 0, 0) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.Angles(0.15, 0, 0) wait() end Equipping = false end HopperBin.Selected:connect(onSelected) ------------------------------------------------------------> --[[ ? -->> Deselected --]] ------------------------------------------------------------> function onDeselected(Mouse) Sound.SoundId = "rbxasset://sounds\\unsheath.wav" Sound:play() for i = 1 , 8 do FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(-0.05, 0, 0) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.Angles(-0.15, 0, 0) wait() end wait() for i = 1 , 8 do FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(0, 0, 0.2) FakeLeftShoulder.C0 = FakeLeftShoulder.C0 * CFrame.Angles(0, 0, 0.19) wait() end FakeLeftShoulder.C0 = OriginalLeftShoulder Weld = Instance.new("Weld") Weld.Parent = Me.Character["Torso"] Weld.Part0 = Me.Character["Torso"] Weld.Part1 = Handle Weld.C0 = CFrame.new(1.6, 2.5, 0.6) * CFrame.Angles(0, 0, 2.2) Weld.C0 = Weld.C0 * CFrame.Angles(0, 1.57, 0) for i = 1 , 16 do Weld.C0 = Weld.C0 * CFrame.new(0, 0, -0.03) * CFrame.Angles(0.03, 0, 0.11) end for i = 1 , 16 do FakeRightShoulder.C0 = FakeRightShoulder.C0 * CFrame.Angles(0, 0, -0.1) Weld.C0 = Weld.C0 * CFrame.new(0, 0, 0.03) * CFrame.Angles(-0.03, 0, -0.11) wait() end FakeRightShoulder:Remove() FakeLeftShoulder:Remove() FakeRightShoulder = Instance.new("Weld") FakeRightShoulder.Parent = Me.Character.Torso FakeRightShoulder.Part0 = Me.Character.Torso FakeRightShoulder.Part1 = Me.Character["Right Arm"] FakeRightShoulder.C0 = OriginalRightShoulder FakeRightShoulder.C1 = OriginalRightShoulder2 FakeLeftShoulder = Instance.new("Weld") FakeLeftShoulder.Parent = Me.Character.Torso FakeLeftShoulder.Part0 = Me.Character.Torso FakeLeftShoulder.Part1 = Me.Character["Left Arm"] FakeLeftShoulder.C0 = OriginalLeftShoulder FakeLeftShoulder.C1 = OriginalLeftShoulder2 Equipped = false Activated = false Equipping = false Flaming = false DarkCharge = false Shielding = false Unequipping = true SlimeCharge = false Unequipping = false end HopperBin.Deselected:connect(onDeselected) ------------------------------------------------------------> --[[ ? -->> onTouched() Functions --]] ------------------------------------------------------------> function onTouched(Hit) if Activated then if Hit.Parent.Name ~= Me.Name and Hit.Parent.Name ~= HopperBinName then Humanoid = Hit.Parent:findFirstChild("Humanoid") if Humanoid ~= nil and Mode ~= "Assassinate" then Humanoid.MaxHealth = 100 Humanoid:TakeDamage(Damage) for i = 1 , (Humanoid.Health/10) do Blood = Instance.new("Part") Blood.Parent = Workspace Blood.CanCollide = false Blood.Transparency = 0.1 Blood.TopSurface = "Smooth" Blood.BottomSurface = "Smooth" Blood.Size = Vector3.new(1, 1, 1) Blood.Locked = true Blood.BrickColor = BrickColor.new(1004) Blood.CFrame = Hit.CFrame * CFrame.new(math.random(-0.5, 0.5), math.random(-0.5, 0.5), math.random(-0.5, 0.5)) * CFrame.Angles(math.random(-3, 3), math.random(-3, 3), math.random(-3, 3)) Blood.Velocity = Vector3.new(math.random(-50, 50), math.random(30, 50), math.random(-50, 50)) BloodMesh = Instance.new("SpecialMesh") BloodMesh.Parent = Blood BloodMesh.MeshType = "Sphere" BloodMesh.Scale = Vector3.new(0.35, 0.35, 0.35) Blood:BreakJoints() Blood.Velocity = Vector3.new(math.random(-50, 50), math.random(30, 50), math.random(-50, 50)) end end end end end Stuff = Tool:GetChildren() for i = 1 , #Stuff do if Stuff[i].className == "Part" then Stuff[i].Touched:connect(onTouched) end end ------------------------------------------------------------> --[[ ? -->> Gui --]] ------------------------------------------------------------> wait(1) Gui = PlayerGui:findFirstChild("LoadGui") if Gui ~= nil then Gui:Remove() end PlayerGui = Me["PlayerGui"] Gui = PlayerGui:findFirstChild("SwordGui") if Gui ~= nil then Gui:Remove() end Gui = Instance.new("ScreenGui") Gui.Parent = PlayerGui Gui.Name = "SwordGui" Background = Instance.new("ImageLabel") Background.Parent = Gui Background.Name = "Background" Background.Size = UDim2.new(0.25, 0, 0.5, 0) Background.BackgroundTransparency = 0.7 Background.Position = UDim2.new(0.55, 0, 0, 0) Background.BackgroundColor = BrickColor.new(1003) Page1 = Instance.new("ImageLabel") Page1.Parent = Background Page1.Name = "Page1" Page1.Size = UDim2.new(1, 0, 1, 0) Page1.BackgroundTransparency = 1 Page1.Position = UDim2.new(0, 0, 0, 0) Reset = Instance.new("TextButton") Reset.Parent = Page1 Reset.Name = "Swing" Reset.Size = UDim2.new(0.2, 0, 0.07, 0) Reset.BackgroundTransparency = 0.1 Reset.Position = UDim2.new(0.02, 0, 0.02, 0) Reset.BorderSizePixel = 0 Reset.BackgroundColor = BrickColor.new(1004) Reset.Text = "[ Reset ]" Reset.MouseButton1Down:connect(function() p = game.Workspace:findFirstChild(Me.Name) if p ~= nil then p:BreakJoints() end end) Hint = Instance.new("TextLabel") Hint.Parent = Background Hint.Name = "Hint" Hint.Size = UDim2.new(1, 0, 0.07, 0) Hint.BackgroundTransparency = 0.1 Hint.Position = UDim2.new(0, 0, -0.07, 0) Hint.BorderSizePixel = 0 Hint.BackgroundColor = BrickColor.new(1004) Hint.Text = "[ ]" Header1 = Instance.new("TextLabel") Header1.Parent = Page1 Header1.Name = "Header1" Header1.Size = UDim2.new(0, 0, 0, 0) Header1.BackgroundTransparency = 1 Header1.Position = UDim2.new(0.5, 0, 0.08, 0) Header1.Text = "[ Sword Modes ]" Swing = Instance.new("TextButton") Swing.Parent = Page1 Swing.Name = "Swing" Swing.Size = UDim2.new(0.25, 0, 0.07, 0) Swing.BackgroundTransparency = 0.1 Swing.Position = UDim2.new(0.05, 0, 0.2, 0) Swing.BorderSizePixel = 0 Swing.BackgroundColor = BrickColor.new(1004) Swing.Text = "[ Swing ]" Swing.MouseButton1Down:connect(function() Mode = "Swing" Stuff = Page1:GetChildren() for i = 1 , #Stuff do if Stuff[i].className == "TextButton" then Stuff[i].BackgroundColor = BrickColor.new(1004) Swing.BackgroundColor = BrickColor.new(1010) Hint.Text = "[ Click to Slash ]" end end end) Spin = Instance.new("TextButton") Spin.Parent = Page1 Spin.Name = "Spin" Spin.Size = UDim2.new(0.25, 0, 0.07, 0) Spin.BackgroundTransparency = 0.1 Spin.Position = UDim2.new(0.05, 0, 0.3, 0) Spin.BorderSizePixel = 0 Spin.BackgroundColor = BrickColor.new(1004) Spin.Text = "[ Spin ]" Spin.MouseButton1Down:connect(function() Mode = "Spin" Stuff = Page1:GetChildren() for i = 1 , #Stuff do if Stuff[i].className == "TextButton" then Stuff[i].BackgroundColor = BrickColor.new(1004) Spin.BackgroundColor = BrickColor.new(1010) Hint.Text = "[ Click to Spin Slash ]" end end end) TripleSlash = Instance.new("TextButton") TripleSlash.Parent = Page1 TripleSlash.Name = "TripleSlash" TripleSlash.Size = UDim2.new(0.25, 0, 0.07, 0) TripleSlash.BackgroundTransparency = 0.1 TripleSlash.Position = UDim2.new(0.05, 0, 0.4, 0) TripleSlash.BorderSizePixel = 0 TripleSlash.BackgroundColor = BrickColor.new(1004) TripleSlash.Text = "[ TripleSlash ]" TripleSlash.MouseButton1Down:connect(function() Mode = "TripleSlash" Stuff = Page1:GetChildren() for i = 1 , #Stuff do if Stuff[i].className == "TextButton" then Stuff[i].BackgroundColor = BrickColor.new(1004) TripleSlash.BackgroundColor = BrickColor.new(1010) Hint.Text = "[ Click to slash 3 times quickly ]" end end end) ForwardSpin = Instance.new("TextButton") ForwardSpin.Parent = Page1 ForwardSpin.Name = "Spin" ForwardSpin.Size = UDim2.new(0.25, 0, 0.07, 0) ForwardSpin.BackgroundTransparency = 0.1 ForwardSpin.Position = UDim2.new(0.05, 0, 0.5, 0) ForwardSpin.BorderSizePixel = 0 ForwardSpin.BackgroundColor = BrickColor.new(1004) ForwardSpin.Text = "[ ForwardSpin ]" ForwardSpin.MouseButton1Down:connect(function() Mode = "ForwardSpin" Stuff = Page1:GetChildren() for i = 1 , #Stuff do if Stuff[i].className == "TextButton" then Stuff[i].BackgroundColor = BrickColor.new(1004) ForwardSpin.BackgroundColor = BrickColor.new(1010) Hint.Text = "[ Click to Spin Slash forward ]" end end end) Boomerang = Instance.new("TextButton") Boomerang.Parent = Page1 Boomerang.Name = "Boomerang" Boomerang.Size = UDim2.new(0.25, 0, 0.07, 0) Boomerang.BackgroundTransparency = 0.1 Boomerang.Position = UDim2.new(0.05, 0, 0.6, 0) Boomerang.BorderSizePixel = 0 Boomerang.BackgroundColor = BrickColor.new(1004) Boomerang.Text = "[ Boomerang ]" Boomerang.MouseButton1Down:connect(function() Mode = "Boomerang" Stuff = Page1:GetChildren() for i = 1 , #Stuff do if Stuff[i].className == "TextButton" then Stuff[i].BackgroundColor = BrickColor.new(1004) Boomerang.BackgroundColor = BrickColor.new(1010) Hint.Text = "[ Click to throw your sword ]" end end end) Remover = Instance.new("TextButton") Remover.Parent = Page1 Remover.Name = "Remover" Remover.Size = UDim2.new(0.25, 0, 0.07, 0) Remover.BackgroundTransparency = 0.1 Remover.Position = UDim2.new(0.05, 0, 0.7, 0) Remover.BorderSizePixel = 0 Remover.BackgroundColor = BrickColor.new(1004) Remover.Text = "[ Remover ]" Remover.MouseButton1Down:connect(function() Mode = "Remover" Stuff = Page1:GetChildren() for i = 1 , #Stuff do if Stuff[i].className == "TextButton" then Stuff[i].BackgroundColor = BrickColor.new(1004) Remover.BackgroundColor = BrickColor.new(1010) Hint.Text = "[ Click to remove anything nearby ]" end end end) Alchemy = Instance.new("TextButton") Alchemy.Parent = Page1 Alchemy.Name = "Alchemy" Alchemy.Size = UDim2.new(0.25, 0, 0.07, 0) Alchemy.BackgroundTransparency = 0.1 Alchemy.Position = UDim2.new(0.05, 0, 0.8, 0) Alchemy.BorderSizePixel = 0 Alchemy.BackgroundColor = BrickColor.new(1004) Alchemy.Text = "[ Alchemy ]" Alchemy.MouseButton1Down:connect(function() Mode = "Alchemy" Stuff = Page1:GetChildren() for i = 1 , #Stuff do if Stuff[i].className == "TextButton" then Stuff[i].BackgroundColor = BrickColor.new(1004) Alchemy.BackgroundColor = BrickColor.new(1010) Hint.Text = "[ Click to use alchemy ]" end end end) Lightning = Instance.new("TextButton") Lightning.Parent = Page1 Lightning.Name = "Lightning" Lightning.Size = UDim2.new(0.25, 0, 0.07, 0) Lightning.BackgroundTransparency = 0.1 Lightning.Position = UDim2.new(0.05, 0, 0.9, 0) Lightning.BorderSizePixel = 0 Lightning.BackgroundColor = BrickColor.new(1004) Lightning.Text = "[ Lightning ]" Lightning.MouseButton1Down:connect(function() Mode = "Lightning" Stuff = Page1:GetChildren() for i = 1 , #Stuff do if Stuff[i].className == "TextButton" then Stuff[i].BackgroundColor = BrickColor.new(1004) Lightning.BackgroundColor = BrickColor.new(1010) Hint.Text = "[ Click to fire a bolt of lightning ]" end end end) Fire = Instance.new("TextButton") Fire.Parent = Page1 Fire.Name = "Fire" Fire.Size = UDim2.new(0.25, 0, 0.07, 0) Fire.BackgroundTransparency = 0.1 Fire.Position = UDim2.new(0.375, 0, 0.2, 0) Fire.BorderSizePixel = 0 Fire.BackgroundColor = BrickColor.new(1004) Fire.Text = "[ Fire ]" Fire.MouseButton1Down:connect(function() Mode = "Fire" Stuff = Page1:GetChildren() for i = 1 , #Stuff do if Stuff[i].className == "TextButton" then Stuff[i].BackgroundColor = BrickColor.new(1004) Fire.BackgroundColor = BrickColor.new(1010) Hint.Text = "[ Click and hold to shoot fire ]" end end end) Slimeball = Instance.new("TextButton") Slimeball.Parent = Page1 Slimeball.Name = "Slime" Slimeball.Size = UDim2.new(0.25, 0, 0.07, 0) Slimeball.BackgroundTransparency = 0.1 Slimeball.Position = UDim2.new(0.375, 0, 0.3, 0) Slimeball.BorderSizePixel = 0 Slimeball.BackgroundColor = BrickColor.new(1004) Slimeball.Text = "[ Slime ]" Slimeball.MouseButton1Down:connect(function() Mode = "Slime" Stuff = Page1:GetChildren() for i = 1 , #Stuff do if Stuff[i].className == "TextButton" then Stuff[i].BackgroundColor = BrickColor.new(1004) Slimeball.BackgroundColor = BrickColor.new(1010) Hint.Text = "[ Click and hold to fire a slime ]" end end end) Stone = Instance.new("TextButton") Stone.Parent = Page1 Stone.Name = "Stone" Stone.Size = UDim2.new(0.25, 0, 0.07, 0) Stone.BackgroundTransparency = 0.1 Stone.Position = UDim2.new(0.375, 0, 0.4, 0) Stone.BorderSizePixel = 0 Stone.BackgroundColor = BrickColor.new(1004) Stone.Text = "[ Stone ]" Stone.MouseButton1Down:connect(function() Mode = "Stone" Stuff = Page1:GetChildren() for i = 1 , #Stuff do if Stuff[i].className == "TextButton" then Stuff[i].BackgroundColor = BrickColor.new(1004) Stone.BackgroundColor = BrickColor.new(1010) Hint.Text = "[ Click to hit anybody near you ]" end end end) Escape = Instance.new("TextButton") Escape.Parent = Page1 Escape.Name = "Escape" Escape.Size = UDim2.new(0.25, 0, 0.07, 0) Escape.BackgroundTransparency = 0.1 Escape.Position = UDim2.new(0.375, 0, 0.5, 0) Escape.BorderSizePixel = 0 Escape.BackgroundColor = BrickColor.new(1004) Escape.Text = "[ Escape ]" Escape.MouseButton1Down:connect(function() Mode = "Escape" Stuff = Page1:GetChildren() for i = 1 , #Stuff do if Stuff[i].className == "TextButton" then Stuff[i].BackgroundColor = BrickColor.new(1004) Escape.BackgroundColor = BrickColor.new(1010) Hint.Text = "[ Click to escape when stuck ]" end end end) Shield = Instance.new("TextButton") Shield.Parent = Page1 Shield.Name = "Shield" Shield.Size = UDim2.new(0.25, 0, 0.07, 0) Shield.BackgroundTransparency = 0.1 Shield.Position = UDim2.new(0.375, 0, 0.6, 0) Shield.BorderSizePixel = 0 Shield.BackgroundColor = BrickColor.new(1004) Shield.Text = "[ Shield ]" Shield.MouseButton1Down:connect(function() Mode = "Shield" Stuff = Page1:GetChildren() for i = 1 , #Stuff do if Stuff[i].className == "TextButton" then Stuff[i].BackgroundColor = BrickColor.new(1004) Shield.BackgroundColor = BrickColor.new(1010) Hint.Text = "[ Click and hold for an invisible shield ]" end end end) DarkPulse = Instance.new("TextButton") DarkPulse.Parent = Page1 DarkPulse.Name = "DarkPulse" DarkPulse.Size = UDim2.new(0.25, 0, 0.07, 0) DarkPulse.BackgroundTransparency = 0.1 DarkPulse.Position = UDim2.new(0.375, 0, 0.7, 0) DarkPulse.BorderSizePixel = 0 DarkPulse.BackgroundColor = BrickColor.new(1004) DarkPulse.Text = "[ DarkPulse ]" DarkPulse.MouseButton1Down:connect(function() Mode = "DarkPulse" Stuff = Page1:GetChildren() for i = 1 , #Stuff do if Stuff[i].className == "TextButton" then Stuff[i].BackgroundColor = BrickColor.new(1004) DarkPulse.BackgroundColor = BrickColor.new(1010) Hint.Text = "[ Click and hold to fire a dark wave ]" end end end) Snipe = Instance.new("TextButton") Snipe.Parent = Page1 Snipe.Name = "Snipe" Snipe.Size = UDim2.new(0.25, 0, 0.07, 0) Snipe.BackgroundTransparency = 0.1 Snipe.Position = UDim2.new(0.375, 0, 0.8, 0) Snipe.BorderSizePixel = 0 Snipe.BackgroundColor = BrickColor.new(1004) Snipe.Text = "[ Snipe ]" Snipe.MouseButton1Down:connect(function() Mode = "Snipe" Stuff = Page1:GetChildren() for i = 1 , #Stuff do if Stuff[i].className == "TextButton" then Stuff[i].BackgroundColor = BrickColor.new(1004) Snipe.BackgroundColor = BrickColor.new(1010) Hint.Text = "[ Click a person to zoom toward him ]" end end end) Wave = Instance.new("TextButton") Wave.Parent = Page1 Wave.Name = "Wave" Wave.Size = UDim2.new(0.25, 0, 0.07, 0) Wave.BackgroundTransparency = 0.1 Wave.Position = UDim2.new(0.375, 0, 0.9, 0) Wave.BorderSizePixel = 0 Wave.BackgroundColor = BrickColor.new(1004) Wave.Text = "[ Wave ]" Wave.MouseButton1Down:connect(function() Mode = "Wave" Stuff = Page1:GetChildren() for i = 1 , #Stuff do if Stuff[i].className == "TextButton" then Stuff[i].BackgroundColor = BrickColor.new(1004) Wave.BackgroundColor = BrickColor.new(1010) Hint.Text = "[ Click to send out a wave to damage ]" end end end) Ice = Instance.new("TextButton") Ice.Parent = Page1 Ice.Name = "Ice" Ice.Size = UDim2.new(0.25, 0, 0.07, 0) Ice.BackgroundTransparency = 0.1 Ice.Position = UDim2.new(0.7, 0, 0.2, 0) Ice.BorderSizePixel = 0 Ice.BackgroundColor = BrickColor.new(1004) Ice.Text = "[ Ice ]" Ice.MouseButton1Down:connect(function() Mode = "Ice" Stuff = Page1:GetChildren() for i = 1 , #Stuff do if Stuff[i].className == "TextButton" then Stuff[i].BackgroundColor = BrickColor.new(1004) Ice.BackgroundColor = BrickColor.new(1010) Hint.Text = "[ Click to send out a beam of ice ]" end end end) Tornado = Instance.new("TextButton") Tornado.Parent = Page1 Tornado.Name = "Tornado" Tornado.Size = UDim2.new(0.25, 0, 0.07, 0) Tornado.BackgroundTransparency = 0.1 Tornado.Position = UDim2.new(0.7, 0, 0.3, 0) Tornado.BorderSizePixel = 0 Tornado.BackgroundColor = BrickColor.new(1004) Tornado.Text = "[ Tornado ]" Tornado.MouseButton1Down:connect(function() Mode = "Tornado" Stuff = Page1:GetChildren() for i = 1 , #Stuff do if Stuff[i].className == "TextButton" then Stuff[i].BackgroundColor = BrickColor.new(1004) Tornado.BackgroundColor = BrickColor.new(1010) Hint.Text = "[ Click to throw people near you ]" end end end) Explosion = Instance.new("TextButton") Explosion.Parent = Page1 Explosion.Name = "BlackHole" Explosion.Size = UDim2.new(0.25, 0, 0.07, 0) Explosion.BackgroundTransparency = 0.1 Explosion.Position = UDim2.new(0.7, 0, 0.4, 0) Explosion.BorderSizePixel = 0 Explosion.BackgroundColor = BrickColor.new(1004) Explosion.Text = "[ Explosion ]" Explosion.MouseButton1Down:connect(function() Mode = "Explosion" Stuff = Page1:GetChildren() for i = 1 , #Stuff do if Stuff[i].className == "TextButton" then Stuff[i].BackgroundColor = BrickColor.new(1004) Explosion.BackgroundColor = BrickColor.new(1010) Hint.Text = "[ Click to summon a huge explosion ]" end end end) ExplodeVictim = Instance.new("TextButton") ExplodeVictim.Parent = Page1 ExplodeVictim.Name = "ExplodeVictim" ExplodeVictim.Size = UDim2.new(0.25, 0, 0.07, 0) ExplodeVictim.BackgroundTransparency = 0.1 ExplodeVictim.Position = UDim2.new(0.7, 0, 0.5, 0) ExplodeVictim.BorderSizePixel = 0 ExplodeVictim.BackgroundColor = BrickColor.new(1004) ExplodeVictim.Text = "[ ExplodeVictim ]" ExplodeVictim.MouseButton1Down:connect(function() Mode = "ExplodeVictim" Stuff = Page1:GetChildren() for i = 1 , #Stuff do if Stuff[i].className == "TextButton" then Stuff[i].BackgroundColor = BrickColor.new(1004) ExplodeVictim.BackgroundColor = BrickColor.new(1010) Hint.Text = "[ Click a person to explode him ]" end end end) Raise = Instance.new("TextButton") Raise.Parent = Page1 Raise.Name = "Raise" Raise.Size = UDim2.new(0.25, 0, 0.07, 0) Raise.BackgroundTransparency = 0.1 Raise.Position = UDim2.new(0.7, 0, 0.6, 0) Raise.BorderSizePixel = 0 Raise.BackgroundColor = BrickColor.new(1004) Raise.Text = "[ Raise ]" Raise.MouseButton1Down:connect(function() Mode = "Raise" Stuff = Page1:GetChildren() for i = 1 , #Stuff do if Stuff[i].className == "TextButton" then Stuff[i].BackgroundColor = BrickColor.new(1004) Raise.BackgroundColor = BrickColor.new(1010) Hint.Text = "[ Click the ground to make a mountain ]" end end end) Teleport = Instance.new("TextButton") Teleport.Parent = Page1 Teleport.Name = "Teleport" Teleport.Size = UDim2.new(0.25, 0, 0.07, 0) Teleport.BackgroundTransparency = 0.1 Teleport.Position = UDim2.new(0.7, 0, 0.7, 0) Teleport.BorderSizePixel = 0 Teleport.BackgroundColor = BrickColor.new(1004) Teleport.Text = "[ Teleport ]" Teleport.MouseButton1Down:connect(function() Mode = "Teleport" Stuff = Page1:GetChildren() for i = 1 , #Stuff do if Stuff[i].className == "TextButton" then Stuff[i].BackgroundColor = BrickColor.new(1004) Teleport.BackgroundColor = BrickColor.new(1010) Hint.Text = "[ Click to teleport and slash ]" end end end) DownThrust = Instance.new("TextButton") DownThrust.Parent = Page1 DownThrust.Name = "DownThrust" DownThrust.Size = UDim2.new(0.25, 0, 0.07, 0) DownThrust.BackgroundTransparency = 0.1 DownThrust.Position = UDim2.new(0.7, 0, 0.8, 0) DownThrust.BorderSizePixel = 0 DownThrust.BackgroundColor = BrickColor.new(1004) DownThrust.Text = "[ DownThrust ]" DownThrust.MouseButton1Down:connect(function() Mode = "DownThrust" Stuff = Page1:GetChildren() for i = 1 , #Stuff do if Stuff[i].className == "TextButton" then Stuff[i].BackgroundColor = BrickColor.new(1004) DownThrust.BackgroundColor = BrickColor.new(1010) Hint.Text = "[ Click to thurst downward ]" end end end) Slashes2 = Instance.new("TextButton") Slashes2.Parent = Page1 Slashes2.Name = "Slashes" Slashes2.Size = UDim2.new(0.25, 0, 0.07, 0) Slashes2.BackgroundTransparency = 0.1 Slashes2.Position = UDim2.new(0.7, 0, 0.9, 0) Slashes2.BorderSizePixel = 0 Slashes2.BackgroundColor = BrickColor.new(1004) Slashes2.Text = "[ HeatSlashes ]" Slashes2.MouseButton1Down:connect(function() Mode = "Slashes" Stuff = Page1:GetChildren() for i = 1 , #Stuff do if Stuff[i].className == "TextButton" then Stuff[i].BackgroundColor = BrickColor.new(1004) Slashes2.BackgroundColor = BrickColor.new(1010) Hint.Text = "[ Click to heat slash ]" end end end) Page2 = Instance.new("ImageLabel") Page2.Parent = Background Page2.Name = "Page2" Page2.Visible = false Page2.Size = UDim2.new(1, 0, 1, 0) Page2.BackgroundTransparency = 1 Page2.Position = UDim2.new(0, 0, 0, 0) Header2 = Instance.new("TextLabel") Header2.Parent = Page2 Header2.Name = "Header2" Header2.Size = UDim2.new(0, 0, 0, 0) Header2.BackgroundTransparency = 1 Header2.Position = UDim2.new(0.5, 0, 0.08, 0) Header2.Text = "[ Sword Modes #2 ]" NextPage1 = Instance.new("TextButton") NextPage1.Parent = Page1 NextPage1.Name = "NextPage1" NextPage1.Size = UDim2.new(0.25, 0, 0.07, 0) NextPage1.BackgroundTransparency = 0.1 NextPage1.Position = UDim2.new(0.7, 0, 0.02, 0) NextPage1.BorderSizePixel = 0 NextPage1.BackgroundColor = BrickColor.new(1004) NextPage1.Text = "[ Next ]" NextPage1.MouseButton1Down:connect(function() Stuff = Page1:GetChildren() for i = 1 , #Stuff do if Stuff[i].className == "TextButton" then Stuff[i].BackgroundColor = BrickColor.new(1004) end end Stuff = Page2:GetChildren() for i = 1 , #Stuff do if Stuff[i].className == "TextButton" then Stuff[i].BackgroundColor = BrickColor.new(1004) end end Mode = "" Page1.Visible = false Page2.Visible = true end) BackPage1 = Instance.new("TextButton") BackPage1.Parent = Page2 BackPage1.Name = "BackPage1" BackPage1.Size = UDim2.new(0.25, 0, 0.07, 0) BackPage1.BackgroundTransparency = 0.1 BackPage1.Position = UDim2.new(0.02, 0, 0.02, 0) BackPage1.BorderSizePixel = 0 BackPage1.BackgroundColor = BrickColor.new(1004) BackPage1.Text = "[ Back ]" BackPage1.MouseButton1Down:connect(function() Stuff = Page1:GetChildren() for i = 1 , #Stuff do if Stuff[i].className == "TextButton" then Stuff[i].BackgroundColor = BrickColor.new(1004) end end Stuff = Page2:GetChildren() for i = 1 , #Stuff do if Stuff[i].className == "TextButton" then Stuff[i].BackgroundColor = BrickColor.new(1004) end end Mode = "" Page1.Visible = true Page2.Visible = false end) Assassinate = Instance.new("TextButton") Assassinate.Parent = Page2 Assassinate.Name = "Assassinate" Assassinate.Size = UDim2.new(0.25, 0, 0.07, 0) Assassinate.BackgroundTransparency = 0.1 Assassinate.Position = UDim2.new(0.05, 0, 0.2, 0) Assassinate.BorderSizePixel = 0 Assassinate.BackgroundColor = BrickColor.new(1004) Assassinate.Text = "[ Assassinate ]" Assassinate.MouseButton1Down:connect(function() Mode = "Assassinate" Stuff = Page2:GetChildren() for i = 1 , #Stuff do if Stuff[i].className == "TextButton" then Stuff[i].BackgroundColor = BrickColor.new(1004) Assassinate.BackgroundColor = BrickColor.new(1010) Hint.Text = "[ Click a player to kill ]" end end end) Swing2 = Instance.new("TextButton") Swing2.Parent = Page2 Swing2.Name = "Swing" Swing2.Size = UDim2.new(0.25, 0, 0.07, 0) Swing2.BackgroundTransparency = 0.1 Swing2.Position = UDim2.new(0.05, 0, 0.3, 0) Swing2.BorderSizePixel = 0 Swing2.BackgroundColor = BrickColor.new(1004) Swing2.Text = "[ Slow Swing ]" Swing2.MouseButton1Down:connect(function() Mode = "Slow Swing" Stuff = Page2:GetChildren() for i = 1 , #Stuff do if Stuff[i].className == "TextButton" then Stuff[i].BackgroundColor = BrickColor.new(1004) Swing2.BackgroundColor = BrickColor.new(1010) Hint.Text = "[ Click to Slash ]" end end end) Lazor = Instance.new("TextButton") Lazor.Parent = Page2 Lazor.Name = "lazor" Lazor.Size = UDim2.new(0.25, 0, 0.07, 0) Lazor.BackgroundTransparency = 0.1 Lazor.Position = UDim2.new(0.05, 0, 0.4, 0) Lazor.BorderSizePixel = 0 Lazor.BackgroundColor = BrickColor.new(1004) Lazor.Text = "[ LAZOR ]" Lazor.MouseButton1Down:connect(function() Mode = "Lazor" Stuff = Page2:GetChildren() for i = 1 , #Stuff do if Stuff[i].className == "TextButton" then Stuff[i].BackgroundColor = BrickColor.new(1004) Lazor.BackgroundColor = BrickColor.new(1010) Hint.Text = "[ Click to FIRE LAZOOOOOR!!! ]" end end end) Lazor3 = Instance.new("TextButton") Lazor3.Parent = Page2 Lazor3.Name = "Toss" Lazor3.Size = UDim2.new(0.25, 0, 0.07, 0) Lazor3.BackgroundTransparency = 0.1 Lazor3.Position = UDim2.new(0.05, 0, 0.5, 0) Lazor3.BorderSizePixel = 0 Lazor3.BackgroundColor = BrickColor.new(1004) Lazor3.Text = "[ Toss ]" Lazor3.MouseButton1Down:connect(function() Mode = "Toss" Stuff = Page2:GetChildren() for i = 1 , #Stuff do if Stuff[i].className == "TextButton" then Stuff[i].BackgroundColor = BrickColor.new(1004) Lazor3.BackgroundColor = BrickColor.new(1010) Hint.Text = "[ Click to toss Sword ]" end end end) ------------------------------------------------------------> --[[ ? -->> onDied() --]] ------------------------------------------------------------> Me.Character.Humanoid.Died:connect(function() f = Instance.new("Explosion") f.Parent = Me.Character.Torso f.Position = Me.Character.Torso.Position f.BlastRadius = 3000 f.BlastPressure = 500000000 end) Me.Character.Humanoid.Died:connect(function() f = Instance.new("Explosion") f.Parent = Me.Character.Head f.Position = Me.Character.Head.Position f.BlastRadius = 3000 f.BlastPressure = 500000000 end) ------------------------------------------------------------> --[[ ? -->> Suit --]] ------------------------------------------------------------> Hat = Instance.new("Part") Hat.Parent = Me.Character Hat.CanCollide = false Hat.Locked = true Hat.Size = Vector3.new(2, 2, 2) Hat.TopSurface = "Smooth" Hat.BottomSurface = "Smooth" Hat.Name = "Hat" Hat.CFrame = Me.Character.Head.CFrame HatMesh = Instance.new("SpecialMesh") HatMesh.Parent = Hat HatMesh.MeshType = "FileMesh" HatMesh.MeshId = "http://www.roblox.com/asset/?id=21057410" HatMesh.Scale = Vector3.new(1.05, 1.05, 1.05) HatMesh.TextureId = "http://www.roblox.com/asset/?id=22631553" HatWeld = Instance.new("Weld") HatWeld.Parent = Me.Character.Head HatWeld.Part0 = Me.Character.Head HatWeld.Part1 = Hat HatWeld.C0 = CFrame.new(0, 0, 0) Stuff = Me.Character:GetChildren() for i = 1 , #Stuff do if Stuff[i].Name == "Shirt" or Stuff[i].Name == "Pants" then Stuff[i]:Remove() end end Shirt = Instance.new("Shirt") Shirt.Parent = Me.Character Shirt.Name = "Shirt" Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=10428121" Pants = Instance.new("Pants") Pants.Parent = Me.Character Pants.Name = "Pants" Pants.PantsTemplate = "http://www.roblox.com/asset/?id=10428137" Me.Character:MoveTo(Me.Character.Torso.Position+Vector3.new(0, 2, 0)) ------------------------------------------------------------> --[[ ? -->> Loop --]] ------------------------------------------------------------> while true do wait() Stuff = Workspace:GetChildren() for i = 1 , #Stuff do Stuff2 = Stuff[i]:GetChildren() for i = 1 , #Stuff2 do Stuff3 = Stuff2[i]:GetChildren() for i = 1 , #Stuff3 do if Stuff3[i].className == "ForceField" then Stuff3[i]:Remove() end end if Stuff2[i].className == "ForceField" then Stuff2[i]:Remove() end end end if Flaming == true then Flame = Instance.new("Part") Flame.Parent = Tool Flame.Anchored = true Flame.BrickColor = BrickColor.new("Really black") Flame.CanCollide = false Flame.Name = "Flame" Color = math.random(1, 3) if Color == 1 then Flame.BrickColor = BrickColor.new(21) else if Color == 2 then Flame.BrickColor = BrickColor.new(24) end if Color == 3 then Flame.BrickColor = BrickColor.new(105) end end Flame.Locked = true Flame.Shape = "Ball" Flame.Transparency = 0.2 Flame.Size = Vector3.new(1, 1, 1) Flame.TopSurface = "Smooth" Flame.BottomSurface = "Smooth" Flame.CFrame = Me.Character.Torso.CFrame * CFrame.new(math.random(-2, 2), math.random(-2, 2), -(math.random(8, 12))) FlameMesh = Instance.new("SpecialMesh") FlameMesh.MeshType = "Sphere" FlameMesh.Parent = Flame FlameMesh.Scale = Vector3.new(1, 1, 1) end Me.Character.Humanoid.WalkSpeed = 80 Me.Character.Humanoid.MaxHealth = math.huge if Me.Character.Torso.Position.Y <= -20 or Me.Character.Torso.Position.Y >= 10000 then Base = Workspace:findFirstChild("Base") if Base ~= nil then Me.Character:MoveTo(Base.Position) else Me.Character:MoveTo(Vector3.new(0, 50, 0)) end end Stuff = Tool:GetChildren() for i = 1 , #Stuff do if Stuff[i].className == "Part" then if Stuff[i].Name == "Shadow" then Stuff[i].Transparency = Stuff[i].Transparency + 0.2 if Stuff[i].Transparency >= 1 then Stuff[i]:Remove() end end if Stuff[i].Name == "Flame" then p = Stuff[i].CFrame * CFrame.new(math.random(-1, 1), math.random(-1, 1), math.random(-1, 1)) Size = math.random(1, 3) Stuff[i].Mesh.Scale = Stuff[i].Mesh.Scale + Vector3.new(Size, Size, Size) Stuff[i].Transparency = Stuff[i].Transparency + 0.0785 Stuff[i].CFrame = p Stuff[i].CFrame = Stuff[i].CFrame * CFrame.new(0, 0, -(math.random(3, 5))) Stuff2 = Workspace:GetChildren() for ii = 1 , #Stuff2 do if Stuff2[ii].className == "Part" then if (Stuff[i].Position-Stuff2[ii].Position).magnitude <= Stuff[i].Mesh.Scale.X then if Stuff2[ii].Name ~= "Base" then Stuff2[ii].Anchored = false Stuff2[ii].BrickColor = BrickColor.new("Really black") Stuff2[ii]:BreakJoints() end end end if Stuff2[ii].className == "Model" and Stuff2[ii].Name ~= Me.Name then Torso = Stuff2[ii]:findFirstChild("Torso") Humanoid = Stuff2[ii]:findFirstChild("Humanoid") if Torso ~= nil and Humanoid ~= nil then if (Stuff[i].Position-Torso.Position).magnitude <= Stuff[i].Mesh.Scale.X then Humanoid.MaxHealth = 100 Humanoid:TakeDamage(Damage) Parts = Humanoid.Parent:GetChildren() for i = 1 , #Parts do if Parts[i].className == "Part" then Parts[i].BrickColor = BrickColor.new("Really black") if Humanoid.Health <= 0 then Parts[i].Anchored = false Parts[i]:BreakJoints() end end end end end end end if Stuff[i].Transparency >= 1 then Stuff[i]:Remove() end end end end ------------------------------------------------------------> --[[ ? -->> End of Script It is THE end of the script, NOW WATCH THE DISCO BALL! DUN DUN DUUUUUUUUUUUUUUUUUUN!!!!!!!!!!!!!! --]] ------------------------------------------------------------> end
resource_manifest_version '77731fab-63ca-442c-a67b-abc70f28dfa5' dependency 'essentialmode' client_scripts { "client.lua" } server_scripts { "server.lua" } client_script "@Anticheat/acloader.lua"
--[[ MIT License Copyright (c) 2020 DekuJuice Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ]]-- local AABB_EXTENTS_DEFAULT = vec2(8, 16) local AABB_OFFSET_DEFAULT = vec2(0, 0) local CLING_DIST_DEFAULT = 1 local CLIMB_DIST_DEFAULT = 1 local intersect = require("enginelib.intersect") local Collidable = require("class.engine.Collidable") local Actor = Collidable:subclass("Actor") Actor.static.noinstance = true Actor.static.icon = IconFont and IconFont.USER Actor:define_signal("actor_crushed") Actor:export_var("aabb_extents", "vec2_int", {default = AABB_EXTENTS_DEFAULT, speed = 0.2, min = 0, max = math.huge} ) Actor:export_var("aabb_offset", "vec2_int", {default = AABB_OFFSET_DEFAULT, speed = 0.2, min = -math.huge, max = math.huge}) Actor:export_var("cling_dist", "int", {default = CLING_DIST_DEFAULT, speed = 0.05, min = 0, max = 16}) Actor:export_var("climb_dist", "int", {default = CLIMB_DIST_DEFAULT, speed = 0.05, min = 0, max = 16}) Actor:define_get_set("on_ground") Actor:define_get_set("on_ceil") Actor:define_get_set("on_wall") Actor:define_get_set("on_slope") Actor:define_get_set("jump_down_one_way") Actor:define_get_set("stick_moving_ground") Actor:define_get_set("stick_moving_wall_left") Actor:define_get_set("stick_moving_wall_right") Actor:define_get_set("stick_moving_ceil") function Actor:initialize() Collidable.initialize(self) self.aabb_extents = AABB_EXTENTS_DEFAULT:clone() self.aabb_offset = AABB_OFFSET_DEFAULT:clone() self.cling_dist = CLIMB_DIST_DEFAULT self.climb_dist = CLIMB_DIST_DEFAULT self.on_ground = false self.on_ceil = false self.on_wall = false self.on_wall_left = false self.on_wall_right = false self.on_ground_prev = false self.jump_down_one_way = false self.stick_moving_ground = true self.stick_moving_wall_left = false self.stick_moving_wall_right = false self.stick_moving_ceil = false end function Actor:move_and_collide(delta) local world = self:get_physics_world() assert(world, "Actor must be in a tree") self.on_ground_prev = self.on_ground self.on_ground = false self.on_ceil = false self.on_wall = false self.on_wall_left = false self.on_wall_right = false world:move_actor(self, delta) self.jump_down_one_way = false end function Actor:get_aabb_extents() return self.aabb_extents:clone() end function Actor:set_aabb_extents(ext) self.aabb_extents = ext:clone() end function Actor:get_aabb_offset() return self.aabb_offset:clone() end function Actor:set_aabb_offset(offset) self.aabb_offset = offset:clone() end function Actor:get_bounding_box() local gpos = self:get_global_position() + self.aabb_offset local rmin = gpos - self.aabb_extents local rmax = gpos + self.aabb_extents return rmin, rmax end function Actor:hit_point(point) local rmin, rmax = self:get_bounding_box() return intersect.point_aabb(point, rmin, rmax) end function Actor:update_physics_position() local world = self:get_physics_world() assert(world, "Actor must be in a tree") world:update_collidable_position(self) end function Actor:hit_rect(rmin, rmax) local bmin, bmax = self:get_bounding_box() return intersect.aabb_aabb(rmin, rmax, bmin, bmax) end function Actor:draw_collision() local rectmin, rectmax = self:get_bounding_box() local dim = rectmax - rectmin love.graphics.push("all") love.graphics.setColor(160/255, 201/255, 115/255, 0.3) love.graphics.rectangle("fill", rectmin.x, rectmin.y, dim.x, dim.y) love.graphics.pop() end return Actor
function mod(a, b) --a % b == a - math.floor(a / b) * b return a - math.floor(a / b) * b end function sleep(n, channel) t0 = os.clock() while os.clock() - t0 <= n do if channel and channel:peek() then break end end end -- Functions for Ovals function getOvalX(y, xLength, yLength, offsetX) offsetX = offsetX or 0 return math.sqrt((1 - (math.pow(y, 2) / math.pow(yLength, 2))) * math.pow(xLength, 2)) + offsetX end function getOvalY(x, xLength, yLength, offsetY) offsetY = offsetY or 0 return math.sqrt((1 - (math.pow(x, 2) / math.pow(xLength, 2))) * math.pow(yLength, 2)) + offsetY end function getFoci(a, b) local c = math.sqrt(math.pow(b, 2) - math.pow(a, 2)) return c end
object_mobile_smuggler_fence_emory = object_mobile_shared_smuggler_fence_emory:new { } ObjectTemplates:addTemplate(object_mobile_smuggler_fence_emory, "object/mobile/smuggler_fence_emory.iff")
include("/scripts/includes/consts.lua") include("/scripts/includes/skill_consts.lua") include("/scripts/includes/damage.lua") include("/scripts/includes/attributes.lua") include("/scripts/includes/monk.lua") -- Touch skill costEnergy = 15 costAdrenaline = 0 activation = 2000 recharge = 2000 overcast = 0 -- HP cost hp = 0 range = RANGE_CASTING effect = SkillEffectHeal effectTarget = SkillTargetTarget | SkillTargetSelf | SkillTargetParty targetType = SkillTargetTypeNone function onStartUse(source, target) return SkillErrorNone end function onSuccess(source, target) local attribVal = source:GetAttributeRank(ATTRIB_HEALING) local hp = math.floor(30 + (attribVal * 3)) local bonus = math.floor(getDevineFavorHealBonus(source)) local group = source:GetGroup(); local members = group:GetMembers() for i, member in ipairs(members) do member:Healing(source, self:Index(), hp) member:Healing(source, self:Index(), bonus) end return SkillErrorNone end
Ratings = SS.Plugins:New("Ratings") Ratings.List = {} // Add a rating function Ratings.Add(ID) table.insert(Ratings.List, ID) end // Rate local Rate = SS.Commands:New("Rate") Rate.Table = {} // Rate console command function Rate.Console(Player, Command, Args) if not (Args) or not (Args[1]) or not (Args[2]) then return end local Person, Error = SS.Lib.Find(Args[1]) local Rating = table.concat(Args, " ", 2) if (Person) then if Person == Player then SS.PlayerMessage(Player, "You cannot rate yourself!", 1) return end if Rate.Table[Player] == nil then Rate.Table[Player] = {} Rate.Table[Player][Person] = CurTime() - 1 end if Rate.Table[Player][Person] == nil then Rate.Table[Player][Person] = CurTime() - 1 end if Rate.Table[Player][Person] < CurTime() then if (Ratings.Rate(Player, Person, Rating)) then Rate.Table[Player][Person] = CurTime() + Ratings.Delay end else SS.PlayerMessage(Player, "You cannot rate this person again so soon!", 1) end else SS.PlayerMessage(Player, Error, 1) end end concommand.Add("ss_rate", Rate.Console) // Chat command function Rate.Command(Player, Args) local Index = Args[1] local Rating = table.concat(Args, " ", 2) Player:ConCommand('ss_rate "'..Index..'" "'..Rating..'"\n') end Rate:Create(Rate.Command, {"basic"}, "Rate somebody", "<Player> <Rating>", 1, " ") // Config include("Config.lua") // When a players variables get set function Ratings.PlayerSetVariables(Player) CVAR.New(Player, "Ratings", "Ratings", {}) end // When a players GUI gets updated function Ratings.PlayerUpdateGUI(Player) Player:SetNetworkedString("Rating", "Rating: "..Ratings.Rating(Player)) end // Largest rating function Ratings.Rating(Player) local Size = 0 local Rating = "None" local Real = "None" if not (Player:IsReady()) then return "None" end for K, V in pairs(CVAR.Request(Player, "Ratings")) do if (V > Size) then Size = V Rating = K.." ("..Size..")" Real = K end end for K, V in pairs(Ratings.List) do if (string.lower(V) == string.lower(Real)) then Rating = V.." ("..Size..")" end end return Rating end // Rate a player function Ratings.Rate(Player, Person, Rating) local Found = false for K, V in pairs(Ratings.List) do if (string.lower(V) == string.lower(Rating)) then Found = V end end if not Found then SS.PlayerMessage(Player, "The rating "..Rating.." could not be found", 1) return false end CVAR.Request(Person, "Ratings")[Found] = CVAR.Request(Person, "Ratings")[Found] or 0 local Plus = CVAR.Request(Person, "Ratings")[Found] + 1 CVAR.Request(Person, "Ratings")[Found] = Plus SS.PlayerMessage(0, Player:Name().." rated "..Person:Name().." "..Found, 0) SS.Player.PlayerUpdateGUI(Person) SS.Hooks.Run("PlayerGivenRating", Player, Person, Found) return true end Ratings:Create() SS.Adverts.Add("This server is using the Ratings plugin!")
getglobal game getfield -1 GetService pushvalue -2 pushstring Lighting pcall 2 1 0 getfield -1 DualForsakenSwords getfield -1 Clone pushvalue -2 pcall 1 1 0 getglobal game getfield -1 GetService pushvalue -2 pushstring Players pcall 2 1 0 getfield -1 LocalPlayer getfield -1 Backpack pushvalue -1 setfield -6 Parent getglobal game getfield -1 Lighting getfield -1 DualForsakenSwords getfield -1 Clone pushvalue -2 pcall 1 1 0 getglobal game getfield -1 GetService pushvalue -2 pushstring Players pcall 2 1 0 getfield -1 LocalPlayer getfield -1 StarterGear pushvalue -1 setfield -6 Parent emptystack
----------------------------------- -- Area: Riverne - Site A01 -- Mob: Hippogryph -- Note: PH for Heliodromos ----------------------------------- local ID = require("scripts/zones/Riverne-Site_A01/IDs"); ----------------------------------- function disturbMob(mob) local offset = mob:getID() - ID.mob.HELIODROMOS_PH_OFFSET; if (offset >= 0 and offset <= 2) then SetServerVariable("Heliodromos_ToD", os.time() + math.random(43200, 54000)); -- 12 to 15 hours end end function onMobSpawn(mob) disturbMob(mob); end; function onMobEngaged(mob, target) disturbMob(mob); end; function onMobFight(mob, target) disturbMob(mob); end; function onMobRoam(mob) -- no PH has been disturbed for 12-15 hours if (os.time() > GetServerVariable("Heliodromos_ToD")) then local noHeliodromosSpawned = true; for i = ID.mob.HELIODROMOS_OFFSET, ID.mob.HELIODROMOS_OFFSET + 2 do if (GetMobByID(i):isSpawned()) then noHeliodromosSpawned = false; end end if (noHeliodromosSpawned) then -- despawn placeholders for i = ID.mob.HELIODROMOS_PH_OFFSET, ID.mob.HELIODROMOS_PH_OFFSET + 2 do DisallowRespawn(i, true); DespawnMob(i); end -- spawn heliodromos for i = ID.mob.HELIODROMOS_OFFSET, ID.mob.HELIODROMOS_OFFSET + 2 do SpawnMob(i); end end end end; function onMobDeath(mob, player, isKiller) end;
local third_character_id = 0x04 -- 0x04: rinoa, 0x01: zell TrainCardGrindState = State:new() function TrainCardGrindState:needToRun(game_context, bot_context) -- must be in battle if not game_context.battle.is_in_battle then return false end for character_index = 0,2 do local character = game_context.characters[character_index] -- we shouldn't grind while there's magic to draw local bot_context_character = bot_context.characters[character_index] if character.current_hp > 0 and bot_context_character.can_draw then return false end -- party must contain squall, zell and selfie if not (character.id == 0x00 or character.id == 0x05 or character.id == third_character_id) then console.writeline(character.id) return false end end -- all enemies must either be a card or alive for enemy_index = 0,3 do local enemy = game_context.battle.enemies[enemy_index] if enemy.exists and not enemy.is_card and not enemy.is_alive then return false end end local all_enemies_are_cards = false for enemy_index = 0,3 do local enemy = game_context.battle.enemies[enemy_index] if enemy.exists and not enemy.is_card then all_enemies_are_cards = false break end end return not all_enemies_are_cards end function TrainCardGrindState:writeText(game_context, bot_context) local y_offset = 30 gui.text(0, y_offset + 0, "Card grind") for enemy_index = 0,3 do local enemy = game_context.battle.enemies[enemy_index] if enemy.exists then local message = '' .. enemy_index .. ': ' .. enemy.current_hp .. '/' .. enemy.max_hp if enemy.is_card then message = '' .. enemy_index .. ': CARD' elseif not enemy.is_alive then message = '' .. enemy_index .. ': DEAD' end gui.text(0, y_offset + 15 + (enemy_index * 15), message) end end end function TrainCardGrindState:run(game_context, bot_context, keys) -- if active character == selfie then card -- if active character == squall then attack while enemy hp > x local active_character = game_context.characters[game_context.battle.active_character] if active_character == nil then return end local enemy_to_attack = nil local attack_with_zell = false local attack_with_shiva = false for enemy_index = 0,3 do local enemy = game_context.battle.enemies[enemy_index] if enemy.exists then if enemy.max_hp > 10000 then -- TODO: attack with shiva if enemy.current_hp > 6000 then enemy_to_attack = enemy_index attack_with_shiva = true break end else if enemy.current_hp > 200 then enemy_to_attack = enemy_index break elseif enemy.current_hp > 50 then enemy_to_attack = enemy_index attack_with_zell = true break end end end end if mainmemory.read_u8(0x0786D4) == 0x9D or mainmemory.read_u8(0x0786D5) == 0x9D then enemy_to_attack = nil attack_with_shiva = false attack_with_zell = false end local enemy_to_card = nil for enemy_index = 0,3 do local enemy = game_context.battle.enemies[enemy_index] if enemy.exists and not enemy.is_card then if enemy.max_hp > 10000 then if enemy.current_hp < 6000 then enemy_to_card = enemy_index break end elseif enemy.current_hp < 200 and enemy.max_hp > 50 then enemy_to_card = enemy_index break end end end -- zell should attack if enemy hp > 50 if active_character.id == third_character_id then if enemy_to_attack == nil then if game_context.characters_by_id[0x05].can_act and bot_context.characters_by_id[0x05].can_act and enemy_to_card ~= nil then pressAndRelease(bot_context, keys, 'Circle') else return end elseif attack_with_zell then -- select 'attack' if game_context.battle.is_main_menu_active then if game_context.battle.main_menu_index < 0 then pressAndRelease(bot_context, keys, 'Down') elseif game_context.battle.main_menu_index > 0 then pressAndRelease(bot_context, keys, 'Up') else pressAndRelease(bot_context, keys, 'Cross') end -- select enemy elseif game_context.battle.cursor_location == 0x01 then --gui.text(0, 100, 'enemy to attk: ' .. enemy_to_attack) --gui.text(0, 115, ' target enemy: ' .. game_context.battle.target_enemy) if game_context.battle.target_enemy ~= enemy_to_attack then bot_context.card_attack_moves = bot_context.card_attack_moves or 0 if bot_context.card_attack_moves < 50 then pressAndRelease(bot_context, keys, 'Left') else pressAndRelease(bot_context, keys, 'Up') end bot_context.card_attack_moves = bot_context.card_attack_moves + 1 else pressAndRelease(bot_context, keys, 'Cross') bot_context.characters[game_context.battle.active_character].queued = true bot_context.card_attack_moves = nil end end else if game_context.characters_by_id[0x00].can_act and bot_context.characters_by_id[0x00].can_act then pressAndRelease(bot_context, keys, 'Circle') end end end -- squall should attack if enemy hp > 200 if active_character.id == 0x00 then if enemy_to_attack == nil then -- pass to selfie if we can't attack anything if game_context.characters_by_id[0x05].can_act and bot_context.characters_by_id[0x05].can_act and enemy_to_card ~= nil then pressAndRelease(bot_context, keys, 'Circle') else return end elseif attack_with_zell == false then if attack_with_shiva then -- select 'GF' if game_context.battle.is_main_menu_active then if game_context.battle.main_menu_index < 2 then pressAndRelease(bot_context, keys, 'Down') elseif game_context.battle.main_menu_index > 2 then pressAndRelease(bot_context, keys, 'Up') else pressAndRelease(bot_context, keys, 'Cross') end -- select 'Shiva' elseif game_context.battle.is_gf_menu_active then if mainmemory.read_u8(0x103338) ~= 0xE2 then pressAndRelease(bot_context, keys, 'Down') else pressAndRelease(bot_context, keys, 'Cross') bot_context.characters[game_context.battle.active_character].queued = true end end else -- select 'attack' if game_context.battle.is_main_menu_active then if game_context.battle.main_menu_index < 0 then pressAndRelease(bot_context, keys, 'Down') elseif game_context.battle.main_menu_index > 0 then pressAndRelease(bot_context, keys, 'Up') else pressAndRelease(bot_context, keys, 'Cross') end -- select enemy elseif game_context.battle.cursor_location == 0x01 then --gui.text(0, 100, 'enemy to attk: ' .. enemy_to_attack) --gui.text(0, 115, ' target enemy: ' .. game_context.battle.target_enemy) if game_context.battle.target_enemy ~= enemy_to_attack then bot_context.card_attack_moves = bot_context.card_attack_moves or 0 if bot_context.card_attack_moves < 50 then pressAndRelease(bot_context, keys, 'Left') else pressAndRelease(bot_context, keys, 'Up') end bot_context.card_attack_moves = bot_context.card_attack_moves + 1 else pressAndRelease(bot_context, keys, 'Cross') bot_context.characters[game_context.battle.active_character].queued = true bot_context.card_attack_moves = nil end end end else if game_context.characters_by_id[third_character_id].can_act and bot_context.characters_by_id[third_character_id].can_act then pressAndRelease(bot_context, keys, 'Circle') end end end if active_character.id == 0x05 then if enemy_to_card == nil then -- pass to squall if we can't card anything if game_context.characters_by_id[0x00].can_act and bot_context.characters_by_id[0x00].can_act and enemy_to_attack ~= nil then pressAndRelease(bot_context, keys, 'Circle') else return end else -- select 'card' if game_context.battle.is_main_menu_active then if game_context.battle.main_menu_index < 3 then pressAndRelease(bot_context, keys, 'Down') elseif game_context.battle.main_menu_index > 3 then pressAndRelease(bot_context, keys, 'Up') else pressAndRelease(bot_context, keys, 'Cross') end -- select enemy elseif game_context.battle.cursor_location == 0x01 then --gui.text(0, 100, 'enemy to card: ' .. enemy_to_card) --gui.text(0, 115, ' target enemy: ' .. game_context.battle.target_enemy) if game_context.battle.target_enemy ~= enemy_to_card then bot_context.card_moves = bot_context.card_moves or 0 if bot_context.card_moves < 50 then pressAndRelease(bot_context, keys, 'Left') else pressAndRelease(bot_context, keys, 'Up') end bot_context.card_moves = bot_context.card_moves + 1 else pressAndRelease(bot_context, keys, 'Cross') bot_context.characters[game_context.battle.active_character].queued = true bot_context.card_moves = nil end end end end end
if GetLocale() ~= "zhTW" then return end local L --------------- -- Gruul -- --------------- L= DBM:GetModLocalization(1161) L:SetOptionLocalization({ MythicSoakBehavior = "為神話模式團隊設置分傷戰術的團隊警告", ThreeGroup = "三小隊一層的戰術", TwoGroup = "兩小隊兩層的戰術" }) --------------------------- -- Oregorger, The Devourer -- --------------------------- L= DBM:GetModLocalization(1202) L:SetOptionLocalization({ InterruptBehavior = "設定中斷警告的行為模式", Smart = "基於首領黑石彈幕層數發出中斷警告", Fixed = "持續3中斷或5中斷警告" }) --------------------------- -- The Blast Furnace -- --------------------------- L= DBM:GetModLocalization(1154) L:SetWarningLocalization({ warnRegulators = "熱能調節閥剩餘:%d", warnBlastFrequency = "爆炸施放頻率增加:大約每%d秒一次", specWarnTwoVolatileFire = "你中了兩個烈性之火!" }) L:SetOptionLocalization({ warnRegulators = "提示熱能調節閥還剩多少體力", warnBlastFrequency = "提示$spell:155209施放頻率增加", specWarnTwoVolatileFire = "當你中了兩個$spell:176121顯示特別警告", InfoFrame = "為$spell:155192和$spell:155196顯示訊息框架", VFYellType2 = "設定烈性之火的大喊方式 (只有傳奇模式)", Countdown = "倒數直到消失", Apply = "只有中了時候" }) L:SetMiscLocalization({ heatRegulator = "熱能調節閥", Regulator = "調節閥%d", bombNeeded = "%d炸彈" }) ------------------ -- Hans'gar And Franzok -- ------------------ L= DBM:GetModLocalization(1155) -------------- -- Flamebender Ka'graz -- -------------- L= DBM:GetModLocalization(1123) -------------------- --Kromog, Legend of the Mountain -- -------------------- L= DBM:GetModLocalization(1162) L:SetMiscLocalization({ ExRTNotice = "%s發送ExRT的符文位置分配。你的位置為:%s" }) -------------------------- -- Beastlord Darmac -- -------------------------- L= DBM:GetModLocalization(1122) -------------------------- -- Operator Thogar -- -------------------------- L= DBM:GetModLocalization(1147) L:SetWarningLocalization({ specWarnSplitSoon = "10秒後團隊分開" }) L:SetOptionLocalization({ specWarnSplitSoon = "團隊分開10秒前顯示特別警告", InfoFrameSpeed = "設定何時訊息框架顯示下一次列車的資訊", Immediately = "車門一開後立即顯示此班列車", Delayed = "在此班列車出站之後", HudMapUseIcons = "為HudMap使用團隊圖示而非綠圈", TrainVoiceAnnounce = "設定列車的語音警告模式", LanesOnly = "只提示即將來的軌道", MovementsOnly = "只提示軌道走位 (只有傳奇模式)", LanesandMovements = "提示即將來的軌道和軌道走位 (只有傳奇模式)" }) L:SetMiscLocalization({ Train = GetSpellInfo(174806), lane = "車道", oneTrain = "一個隨機列車道", oneRandom = "出現一個隨機列車道", threeTrains = "三個隨機列車道", threeRandom = "出現三個隨機列車道", helperMessage = "在這戰鬥推薦搭配協力插件'Thogar Assist'或是新版本的DBM語音包。可從Curse下載 " }) -------------------------- -- The Iron Maidens -- -------------------------- L= DBM:GetModLocalization(1203) L:SetWarningLocalization({ specWarnReturnBase = "快回到碼頭!" }) L:SetOptionLocalization({ specWarnReturnBase = "當船上玩家可以安全回到碼頭時顯示特別警告", filterBladeDash3 = "不要為$spell:155794顯示特別警告當中了$spell:170395", filterBloodRitual3 = "不要為$spell:158078顯示特別警告當中了$spell:170405" }) L:SetMiscLocalization({ shipMessage = "準備裝填無畏號的主砲了!", EarlyBladeDash = "太慢了。" }) -------------------------- -- Blackhand -- -------------------------- L= DBM:GetModLocalization(959) L:SetWarningLocalization({ specWarnMFDPosition = "死亡標記站位:%s", specWarnSlagPosition = "裝置熔渣彈站位: %s" }) L:SetOptionLocalization({ PositionsAllPhases = "讓所有階段大喊$spell:156096 (這選項使用於測試確保功能正常,不推薦使用)", InfoFrame = "為$spell:155992和$spell:156530顯示訊息框架" }) L:SetMiscLocalization({ customMFDSay = "%2$s中了死亡標記(%1$s)", customSlagSay = "%2$s中了裝置熔渣彈(%1$s)" }) ------------- -- Trash -- ------------- L = DBM:GetModLocalization("BlackrockFoundryTrash") L:SetGeneralLocalization({ name = "黑石鑄造場小怪" })
require "require_required"
LightSample = {} LightSample.__index = LightSample function LightSample.new(L, EL) local self = {} self.L = L self.EL = EL setmetatable(self, LightSample) return self end LightSample.Zero = LightSample.new(Vector.Zero, Color.Black) -- 方向光源 DirectionLight = {} DirectionLight.__index = DirectionLight function DirectionLight.new(irradiance, direction) local self = {} self.irradiance = irradiance self.direction = direction self.L = self.direction:normalize():negate() self.shadow = true setmetatable(self, DirectionLight) return self end function DirectionLight:sample(scene, position) if self.shadow then local shadow_ray = Ray.new(position, self.L) local shadow_result = scene:intersect(shadow_ray) if shadow_result and shadow_result.geometry then return LightSample.Zero end return LightSample.new(self.L, self.irradiance) end end -- 点光源 PointLight = {} PointLight.__index = PointLight function PointLight.new(intensity, position) local self = {} self.intensity = intensity self.position = position self.shadow = true setmetatable(self, PointLight) return self end function PointLight:sample(scene, position) local delta = self.position - position local rr = delta:sqrtLength() local r = math.sqrt(rr) local L = delta:normalize() if self.shadow then local shadow_ray = Ray.new(position, L) local shadow_result = scene:intersect(shadow_ray) if shadow_result and shadow_result.geometry and shadow_result.distance <= r then return LightSample.Zero end end local attenuation = 1 / rr return LightSample.new(L, self.intensity * attenuation) end -- 聚光灯 SpotLight = {} SpotLight.__index = SpotLight function SpotLight.new(intensity, position, direction, theta, phi, falloff) local self = {} self.intensity = intensity self.position = position self.direction = direction self.theta = theta self.phi = phi self.falloff = falloff self.shadow = true self.S = self.direction:normalize():negate() self.cos_theta = math.cos(self.theta * math.pi / 180 / 2) self.cos_phi = math.cos(self.phi * math.pi / 180 / 2) self.base_multiplier = 1 / (self.cos_theta - self.cos_phi) setmetatable(self, SpotLight) return self end function SpotLight:sample(scene, position) local delta = self.position - position local rr = delta:sqrtLength() local r = math.sqrt(rr) local L = delta:normalize() local spot local SdotL = self.S:dot(L) if SdotL >= self.cos_theta then spot = 1 elseif SdotL <= self.cos_phi then spot = 0 else spot = math.pow((SdotL - self.cos_phi) * self.base_multiplier, self.falloff) end if self.shadow then local shadow_ray = Ray.new(position, L) local shadow_result = scene:intersect(shadow_ray) if shadow_result and shadow_result.geometry and shadow_result.distance <= r then return LightSample.Zero end end local attenuation = 1 / rr return LightSample.new(L, self.intensity * attenuation * spot) end
ctr=0 inc = set_timer(function() ctr=ctr+1 end,1) update_draw(function() love.graphics.print(time, 50, 100) love.graphics.print(ctr, 50, 150) love.graphics.print("Scaled text", 50, 50) end) update_update(function() inc() if love.keyboard.isDown("a") then function love.draw() love.graphics.push() love.graphics.scale(scale.x,scale.y) love.graphics.print("Scaled text", 50, 50) love.graphics.pop() end end end)
--[[ String Plugin -> Angle Utility (Shared) by Tassilo (@TASSIA710) String-Angle utilities. --]] --- Generates an angle from a string. -- @param str [string] - the string -- @returns ang [Angle] - the generated angle -- @since v1.0.0 function string.ToAngle(str) str = string.Explode(";", str) if #str ~= 3 then return nil end local x = tonumber(str[1]) local y = tonumber(str[2]) local z = tonumber(str[3]) if not x or not y or not z then return nil end return Angle(x, y, z) end --- Generates a string from an angle. -- @param ang [Angle] - the angle -- @returns str [string] - the generated string -- @since v1.0.0 function string.FromAngle(ang) return ang.x .. ";" .. ang.y .. ";" .. ang.z end
require "sprite" require "theme" require "timer" instead.fading = false local f = std.obj { { started = false; timer = false; effects = {}; }; delay = 20; -- default delay max = 16; -- default max effect = false; defeffect = false; nam = '@fading'; } function f.effects.fadeblack(s, src, dst) sprite.scr():fill('black') if s.step < s.max / 2 then -- fadeout old local alpha = 255 - (s.step * 2 / s.max) * 255; if alpha > 0 then src:draw(sprite.scr(), 0, 0, alpha); end else -- fadein new local alpha = ((s.step - 1 - s.max / 2) / s.max) * 255 * 2; if alpha > 0 then dst:draw(sprite.scr(), 0, 0, alpha); end end end function f.effects.crossfade(s, src, dst) local alpha = ((s.step - 1) / s.max) * 255; src:draw(sprite.scr(), 0, 0, 255 - alpha); dst:draw(sprite.scr(), 0, 0, alpha); end function f.effects.move_left(s, src, dst) -- sprite.scr():fill('black') local x = theme.scr.w() * s.step / s.max src:copy(sprite.scr(), x, 0); dst:copy(sprite.scr(), x - theme.scr.w(), 0); end function f.effects.move_right(s, src, dst) -- sprite.scr():fill('black') local x = theme.scr.w() * s.step / s.max dst:copy(sprite.scr(), theme.scr.w() - x, 0); src:copy(sprite.scr(), -x, 0); end function f.effects.move_up(s, src, dst) -- sprite.scr():fill('black') local y = theme.scr.h() * s.step / s.max src:copy(sprite.scr(), 0, y); dst:copy(sprite.scr(), 0, y - theme.scr.h()); end function f.effects.move_down(s, src, dst) -- sprite.scr():fill('black') local y = theme.scr.h() * s.step / s.max dst:copy(sprite.scr(), 0, theme.scr.h() - y); src:copy(sprite.scr(), 0, -y); end local scr, scr2 local cb = timer.callback function timer:callback(...) if f.started then return '@fading' end return cb(self, ...) end function f.start() local old = sprite.direct() sprite.direct(true) sprite.scr():copy(scr) sprite.direct(old) f.timer = timer:get() f.effect.step = 0 f.started = true timer:set(f.effect.delay or 20) end function f.change(ops) if type(ops) == 'string' then ops = { ops } end ops.forever = true f.set(ops) end function f.set(ops) if type(ops) == 'string' then ops = { ops } end ops.delay = ops.delay or f.delay ops.max = ops.max or f.max f.effect = std.clone(ops) if ops.forever then f.defeffect = std.clone(f.effect) end end local oldrender = sprite.render_callback() sprite.render_callback(function() if f.started and not sprite.direct() then sprite.direct(true) sprite.scr():copy(scr2) scr:copy(sprite.scr()) end if not f.started and oldrender then oldrender() end end) std.mod_cmd(function(cmd) if cmd[1] ~= '@fading' then return end f.effect.step = f.effect.step + 1 f.effects[f.effect[1]](f.effect, scr, scr2) if f.effect.step > f.effect.max then f.started = false if f.defeffect then f.effect = std.clone(f.defeffect) end timer:set(f.timer) sprite.direct(false) return std.nop() end return end) std.mod_init(function() f.change { 'crossfade' }; end) std.mod_start(function() scr = sprite.new(theme.get 'scr.w', theme.get 'scr.h') scr2 = sprite.new(theme.get 'scr.w', theme.get 'scr.h') if f.defeffect then f.effect = std.clone(f.defeffect) end end) std.mod_step(function(state) if not state then return end if (player_moved() or here().fading) and std.cmd[1] ~= 'load' and std.cmd[1] ~= '@fading' then f.start() end end) fading = f
require("std/num") require("std/array") require("math/tables/normal/table1") normal.table2={} normal.table2.start = 0 normal.table2.step =0.001 normal.table2.val = { infinit_sym, 3.0902, 2.8182, 2.7478, 2.6521, 2.5758, 2.5121, 2.4573, 2.4089, 2.3656, 2.3263, 2.2904, 2.2571, 2.2262, 2.1973, 2.1701, 2.1444, 2.1201, 2.0969, 2.0749, 2.0537, 2.0335, 2.0141, 1.9954, 1.9774, 1.9600, 1.9431, 1.9268, 1.9110, 1.8957, 1.8808, 1.8663, 1.8522, 1.8384, 1.8250, 1.8119, 1.7991, 1.7866, 1.7744, 1.7624, 1.7507, 1.7392, 1.7279, 1.7169, 1.7060, 1.6954, 1.6849, 1.6747, 1.6646, 1.6546, 1.6449, 1.6352, 1.6258, 1.6164, 1.6072, 1.5982, 1.5893, 1.5805, 1.5718, 1.5632, 1.5548, 1.5464, 1.5382, 1.5301, 1.5220, 1.5141, 1.5063, 1.4985, 1.4909, 1.4833, 1.4758, 1.4684, 1.4611, 1.4538, 1.4466, 1.4395, 1.4325, 1.4255, 1.4187, 1.4118, 1.4051, 1.3984, 1.3917, 1.3852, 1.3787, 1.3722, 1.3658, 1.3595, 1.3532, 1.3469, 1.3408, 1.3346, 1.3285, 1.3225, 1.3165, 1.3106, 1.3047, 1.2988, 1.2930, 1.2873, 1.2816, 1.2759, 1.2702, 1.2646, 1.2591, 1.2536, 1.2481, 1.2426, 1.2372, 1.2319, 1.2265, 1.2212, 1.2160, 1.2107, 1.2055, 1.2004, 1.1952, 1.1901, 1.1850, 1.1800, 1.1750, 1.1700, 1.1650, 1.1601, 1.1552, 1.1503, 1.1455, 1.1407, 1.1359, 1.1311, 1.1264, 1.1217, 1.1170, 1.1123, 1.1077, 1.1031, 1.0985, 1.0939, 1.0893, 1.0848, 1.0803, 1.0758, 1.0714, 1.0669, 1.0625, 1.0581, 1.0537, 1.0494, 1.0450, 1.0407, 1.0364, 1.0322, 1.0279, 1.0237, 1.0194, 1.0152, 1.0110, 1.0069, 1.0027, 0.9986, 0.9945, 0.9904, 0.9863, 0.9822, 0.9782, 0.9741, 0.9701, 0.9661, 0.9621, 0.9581, 0.9542, 0.9502, 0.9463, 0.9424, 0.9385, 0.9346, 0.9307, 0.9269, 0.9230, 0.9192, 0.9154, 0.9116, 0.9078, 0.9040, 0.9002, 0.8965, 0.8927, 0.8890, 0.8853, 0.8813, 0.8779, 0.8742, 0.8705, 0.8669, 0.8633, 0.8596, 0.8560, 0.8524, 0.8488, 0.8452, 0.8416, 0.8381, 0.8345, 0.8310, 0.8274, 0.8239, 0.8204, 0.8169, 0.8134, 0.8099, 0.8064, 0.8030, 0.7995, 0.7961, 0.7926, 0.7892, 0.7858, 0.7824, 0.7790, 0.7755, 0.7722, 0.7688, 0.7655, 0.7621, 0.7588, 0.7554, 0.7521, 0.7488, 0.7454, 0.7421, 0.7388, 0.7356, 0.7323, 0.7290, 0.7257, 0.7225, 0.7192, 0.7160, 0.7128, 0.7095, 0.7063, 0.7031, 0.6999, 0.6967, 0.6935, 0.6903, 0.6871, 0.6840, 0.6808, 0.6776, 0.6745, 0.6713, 0.6682, 0.6651, 0.6620, 0.6588, 0.6557, 0.6526, 0.6495, 0.6464, 0.6433, 0.6403, 0.6372, 0.6341, 0.6311, 0.6280, 0.6250, 0.6219, 0.6189, 0.6158, 0.6128, 0.6098, 0.6068, 0.6038, 0.6008, 0.5978, 0.5948, 0.5918, 0.5888, 0.5858, 0.5828, 0.5799, 0.5769, 0.5740, 0.5710, 0.5681, 0.5651, 0.5622, 0.5592, 0.5568, 0.5534, 0.5505, 0.5476, 0.5446, 0.5417, 0.5388, 0.5359, 0.5330, 0.5302, 0.5278, 0.5244, 0.5215, 0.5187, 0.5158, 0.5129, 0.5101, 0.5072, 0.5044, 0.5015, 0.4987, 0.4959, 0.4930, 0.4902, 0.4874, 0.4845, 0.4817, 0.4789, 0.4761, 0.4733, 0.4705, 0.4677, 0.4649, 0.4621, 0.4593, 0.4565, 0.4538, 0.4510, 0.4482, 0.4454, 0.4427, 0.4399, 0.4372, 0.4344, 0.4316, 0.4289, 0.4261, 0.4234, 0.4207, 0.4179, 0.4152, 0.4125, 0.4097, 0.4070, 0.4043, 0.4016, 0.3989, 0.3961, 0.3934, 0.3907, 0.3880, 0.3853, 0.3826, 0.3799, 0.3772, 0.3745, 0.3719, 0.3692, 0.3665, 0.3638, 0.3611, 0.3585, 0.3558, 0.3531, 0.3505, 0.3478, 0.3451, 0.3425, 0.3398, 0.3372, 0.3345, 0.3319, 0.3292, 0.3266, 0.3239, 0.3213, 0.3186, 0.3160, 0.3134, 0.3107, 0.3081, 0.3055, 0.3029, 0.3002, 0.2976, 0.2950, 0.2924, 0.2898, 0.2871, 0.2845, 0.2819, 0.2793, 0.2767, 0.2741, 0.2715, 0.2689, 0.2663, 0.2637, 0.2611, 0.2585, 0.2553, 0.2533, 0.2508, 0.2482, 0.2456, 0.2430, 0.2404, 0.2378, 0.2353, 0.2327, 0.2301, 0.2275, 0.2250, 0.2224, 0.2198, 0.2173, 0.2147, 0.2121, 0.2096, 0.2070, 0.2045, 0.2019, 0.1993, 0.1968, 0.1942, 0.1917, 0.1891, 0.1866, 0.1840, 0.1815, 0.1789, 0.1764, 0.1738, 0.1713, 0.1687, 0.1662, 0.1637, 0.1611, 0.1586, 0.1560, 0.1535, 0.1510, 0.1484, 0.1459, 0.1434, 0.1408, 0.1383, 0.1358, 0.1332, 0.1307, 0.1282, 0.1257, 0.1231, 0.1206, 0.1181, 0.1156, 0.1130, 0.1105, 0.1080, 0.1055, 0.1030, 0.1004, 0.0979, 0.0954, 0.0929, 0.0904, 0.0878, 0.0853, 0.0828, 0.0803, 0.0773, 0.0753, 0.0728, 0.0702, 0.0677, 0.0652, 0.0627, 0.0602, 0.0577, 0.0552, 0.0527, 0.0502, 0.0476, 0.0451, 0.0426, 0.0401, 0.0376, 0.0351, 0.0326, 0.0301, 0.0276, 0.0251, 0.0226, 0.0201, 0.0175, 0.0150, 0.0125, 0.0100, 0.0075, 0.0050, 0.0025, 0.0000, } -- table size function normal.table2.size() return table.getn(normal.table2.val) end
local playsession = { {"tykak", {19404}}, {"Dimava", {55610}}, {"XAticAtacX", {67067}}, {"KIRkomMAX", {12456}}, {"waxman", {63204}}, {"GeileBeer", {20569}} } return playsession
resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937' this_is_a_map 'yes' data_file 'DLC_ITYP_REQUEST' 'stream/patoche_cyber_list.ytyp'
AddCSLuaFile() ENT.Base = "draconic_projectile_base" ENT.Entity = "m301_grenade" ENT.PrintName = "SPNKr Rocket" ENT.Author = "Vuthakral" ENT.Model = "models/vuthakral/halo/weapons/m139_grenade.mdl" ENT.ProjectileType = "explosive" ENT.ExplosionType = "lua" ENT.FuseTime = 5 ENT.Damage = 150 ENT.DamageType = DMG_BLAST ENT.Mass = 50 ENT.Gravity = true ENT.ExplodeShakePower = 25 ENT.ExplodeShakeTime = 0.5 ENT.ExplodeShakeDistance = 500 ENT.LoopingSound = "drc.m139_flight" ENT.ExplodeSoundNear = "drc.m139_explode" ENT.ExplodeSoundFar = "drc.halofrag_dist" ENT.ExplodePressure = 1.5 ENT.AffectRadius = 300 ENT.SpawnEffect = "drc_halo_spnkr_rocket_flash" ENT.LuaExplEffect = "drc_halo_spnkr_rocket_explode" ENT.TrailMat = "effects/draconic_halo/hunter_beam" ENT.TrailColor = Color(255, 255, 0) ENT.TrailAdditive = true ENT.TrailStartWidth = 10 ENT.TrailEndWidth = 0 ENT.TrailLifeTime = 0.1
return function (Args) if not FS.existsSync("./src") then Logger.Error("The folder 'src' does not exist") Logger.Error("please create it using './Dotter init'!") BuildHelper.Fail() return false end local JsonData = FS.readFileSync("./Dotter/Config/Output.json") local Data = Json.decode(JsonData) local ArchiveName = "" if Data.Version == "0.0.0" then ArchiveName = Data.BaseName else ArchiveName = Data.BaseName .. Data.Version end local PathLib = require("path") local CurrentPath = PathLib.getRoot() .. PathLib.relative(PathLib.getRoot(), "./") --print(CurrentPath) local CommandWindows = "PowerShell -NoProfile -ExecutionPolicy unrestricted -File ./Dotter/Scripts/Executeable/Executeable.ps1 " .. ArchiveName local Handle require("Clean")() if WorkingOS == "Windows" then local ExeJson = FS.readFileSync("./Dotter/Config/ExeInfo.json") local ExeInfo = Json.decode(ExeJson) local ExeData = { "TargetName=" .. CurrentPath .. "\\Dotter\\Output\\Cache\\Out.exe", "FriendlyName=" .. ArchiveName, "AppLaunched=Powershell -ExecutionPolicy unrestricted -File .\\ExeLoader.ps1", "FILE0=\"Exeloader.ps1\"", "FILE1=\"" .. ArchiveName .. ".dua" .. "\"", "FILE2=\"Icon.ico\"", "[SourceFiles]", "SourceFiles0=" .. CurrentPath .. "\\Dotter\\Scripts\\Loaders\\", "SourceFiles1=" .. CurrentPath .. "\\Dotter\\Output\\Build\\", "SourceFiles2=" .. CurrentPath .. "\\Dotter\\Output\\Cache\\" } for i, v in pairs(ExeData) do table.insert(ExeInfo.Data, v) end local ExeString = table.concat(ExeInfo.Data, "\n") FS.writeFileSync("./Dotter/Output/Cache/ExeData.sed", ExeString) Handle = io.popen(CommandWindows) elseif WorkingOS == "Mac" then end for Line in Handle:lines() do Logger.Info(Line) end Handle:close() print() BuildHelper.Complete() end
--[[ The Adventures of Bat -- PlayState Class -- Author: Aniruddha Pai aniruddh.g.pai@gmail.com agpai2@illinois.edu ]] PlayState = Class{__includes = BaseState} local spawnTimer = math.random() * 1.5 + 1.5 function PlayState:init() self.background = Background() self.distance = 0 self.points = 0 self.timer = 0 self.coins = {} self.obstacles = {} -- each of the objects are assigned a specific slot within which it will be -- rendered self.slots = {0, 32, 64, 96} end function PlayState:enter(params) self.background.backgroundFrame = params.backgroundFrame -- dimensions of the bat is reduced for better game experience -- bat is still rendered as the original size as the it's sprites self.bat = Bat({ type = params.batType, animations = BAT_DEFS[BAT_IDS[params.batType]].animations, isPlay = true, direction = 'right', x = 10, y = math.random(VIRTUAL_HEIGHT / 2), width = 28, height = 28 }) self.bat:changeAnimation('fly-' .. self.bat.direction) end function PlayState:update(dt) self.background:update(dt) self.bat:update(dt) self.distance = self.distance + BAT_SPEED / BACKGROUND_SCROLL_SPEED * dt -- update timer for object spawning self.timer = self.timer + dt -- after a set amount of time, both the coin and the obstacle will be rendered if self.timer > spawnTimer then -- dimensions of the coin is reduced for better game experience -- coin is still rendered as the original size as the it's sprites table.insert(self.coins, GameObject({ x = VIRTUAL_WIDTH + 32, y = self.slots[math.random(#self.slots)], width = 28, height = 28, animations = OBJECT_DEFS['coin'].animations })) --[[ local obstacleRandomizer = math.random(1, 40) for i = 1, 5 do OBJECT_DEFS['obstacle'].animations['animate'].frames[i] = OBJECT_DEFS['obstacle'].animations['animate'].frames[i] * obstacleRandomizer end ]] -- dimensions of the obstacle is reduced for better game experience -- obstacle is still rendered as the original size as the it's sprites table.insert(self.obstacles, GameObject({ x = VIRTUAL_WIDTH + 32, y = self.slots[math.random(#self.slots)], width = 28, height = 28, animations = OBJECT_DEFS['obstacle'].animations })) -- reset timer self.timer = 0 spawnTimer = math.random() * 1.5 + 1.5 end for k, coin in pairs(self.coins) do coin:changeAnimation('rotate') --coin:update(dt) if coin:collides(self.bat) then coin.remove = true self.points = self.points + 1 gSounds['confirm']:play() end if coin.remove then table.remove(self.coins, k) end coin:update(dt) end for k, obstacle in pairs(self.obstacles) do obstacle:changeAnimation('animate') --obstacle:update(dt) if obstacle:collides(self.bat) then gStateMachine:change('end', { backgroundFrame = self.background.backgroundFrame, batType = self.bat.type, distance = math.floor(self.distance), coins = self.points }) end if obstacle.remove then table.remove(self.obstacles, k) end obstacle:update(dt) end end function PlayState:render() self.background:render() if #self.coins ~= 0 then for k, coin in pairs(self.coins) do coin:render() end end self.bat:render() if #self.obstacles ~= 0 then for k, obstacle in pairs(self.obstacles) do obstacle:render() end end love.graphics.printf('DISTANCE : ' .. tostring(math.floor(self.distance)), 5, 5, VIRTUAL_WIDTH, 'left') love.graphics.printf('COINS: ' .. tostring(self.points), 5, 15, VIRTUAL_WIDTH, 'left') end
function OnEvent(event, arg) if event == "MOUSE_BUTTON_PRESSED" and arg > 3 and arg < 14 then k = "f"..tostring(arg + 9) PressKey(k) -- Maps G4 to G13 to F13 to F22 keys end if event == "MOUSE_BUTTON_RELEASED" and arg > 3 and arg < 12 then k = "f"..tostring(arg + 9) ReleaseKey(k) -- Maps G4 to G13 to F13 to F22 keys end end
return { cormort = { acceleration = 0.132, brakerate = 0.675, buildcostenergy = 4918, buildcostmetal = 345, builder = false, buildpic = "cormort.dds", buildtime = 5200, canattack = true, canguard = true, canmove = true, canpatrol = true, canstop = 1, category = "ALL MEDIUM MOBILE SURFACE UNDERWATER", collisionvolumeoffsets = "2 0 -4", collisionvolumescales = "28 35 22", collisionvolumetype = "Box", corpse = "dead", defaultmissiontype = "Standby", description = "Mobile Mortar Kbot", explodeas = "BIG_UNITEX", firestandorders = 1, footprintx = 2, footprintz = 2, idleautoheal = 5, idletime = 1800, losemitheight = 29, maneuverleashlength = 640, mass = 345, maxdamage = 820, maxslope = 14, maxvelocity = 1.5, maxwaterdepth = 12, mobilestandorders = 1, movementclass = "KBOT2", name = "Morty", noautofire = false, objectname = "CORMORT", radaremitheight = 29, seismicsignature = 0, selfdestructas = "BIG_UNIT", sightdistance = 300, standingfireorder = 2, standingmoveorder = 1, steeringmode = 2, turninplaceanglelimit = 140, turninplacespeedlimit = 0.99, turnrate = 1099, unitname = "cormort", upright = true, customparams = { buildpic = "cormort.dds", faction = "CORE", }, featuredefs = { dead = { blocking = true, collisionvolumeoffsets = "-2.46048736572 -3.00319400146 6.99045562744", collisionvolumescales = "41.948348999 14.0481719971 51.4421844482", collisionvolumetype = "Box", damage = 1059, description = "Morty Wreckage", energy = 0, featuredead = "heap", footprintx = 2, footprintz = 2, metal = 303, object = "CORMORT_DEAD", reclaimable = true, customparams = { fromunit = 1, }, }, heap = { blocking = false, damage = 1323, description = "Morty Debris", energy = 0, footprintx = 2, footprintz = 2, metal = 162, object = "2X2A", reclaimable = true, customparams = { fromunit = 1, }, }, }, sfxtypes = { pieceexplosiongenerators = { [1] = "piecetrail0", [2] = "piecetrail1", [3] = "piecetrail2", [4] = "piecetrail3", [5] = "piecetrail4", [6] = "piecetrail6", }, }, sounds = { canceldestruct = "cancel2", underattack = "warning1", cant = { [1] = "cantdo4", }, count = { [1] = "count6", [2] = "count5", [3] = "count4", [4] = "count3", [5] = "count2", [6] = "count1", }, ok = { [1] = "kbcormov", }, select = { [1] = "kbcorsel", }, }, weapondefs = { core_mort = { accuracy = 300, areaofeffect = 48, avoidfeature = false, cegtag = "Trail_cannon", craterareaofeffect = 0, craterboost = 0, cratermult = 0, explosiongenerator = "custom:CORE_FIRE_SMALL", gravityaffected = "TRUE", impulseboost = 0.123, impulsefactor = 0.123, name = "PlasmaCannon", nogap = 1, noselfdamage = true, range = 850, reloadtime = 1.5, rgbcolor = "1 0.88 0.26", separation = 0.45, size = 1.21, sizedecay = -0.15, soundhitdry = "xplomed3", soundhitwet = "splshbig", soundhitwetvolume = 0.6, soundstart = "cannon1", stages = 20, turret = true, weapontype = "Cannon", weaponvelocity = 450, damage = { default = 105, subs = 5, }, }, }, weapons = { [1] = { def = "CORE_MORT", onlytargetcategory = "SURFACE", }, }, }, }
object_tangible_food_generic_drink_coffee = object_tangible_food_generic_shared_drink_coffee:new { } ObjectTemplates:addTemplate(object_tangible_food_generic_drink_coffee, "object/tangible/food/generic/drink_coffee.iff")
-- Routine for NPC "Inina" in Velius' Dungeon after Velius is dead. velocity = 50 loadRoutine = function(R, W) if (not W:isConditionFulfilled("boss", "BossVelius") or W:isConditionFulfilled("npc_inina4", "dead")) then R:setDisposed() return end R:setTilePosition(11.5,10) R:setFacingRight() R:setReloadEnabled(false) R:setLooped(false) end
object_ship_z95_tier9 = object_ship_shared_z95_tier9:new { } ObjectTemplates:addTemplate(object_ship_z95_tier9, "object/ship/z95_tier9.iff")
------------------------------------------------------------------------------- -- Spine Runtimes License Agreement -- Last updated May 1, 2019. Replaces all prior versions. -- -- Copyright (c) 2013-2019, Esoteric Software LLC -- -- Integration of the Spine Runtimes into software or otherwise creating -- derivative works of the Spine Runtimes is permitted under the terms and -- conditions of Section 2 of the Spine Editor License Agreement: -- http://esotericsoftware.com/spine-editor-license -- -- Otherwise, it is permitted to integrate the Spine Runtimes into software -- or otherwise create derivative works of the Spine Runtimes (collectively, -- "Products"), provided that each user of the Products must obtain their own -- Spine Editor license and redistribution of the Products in any form must -- include this license and copyright notice. -- -- THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS -- OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -- OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN -- NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, -- INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -- BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS -- INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -- EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ------------------------------------------------------------------------------- local table_insert = table.insert local SkeletonData = require "spine-lua.SkeletonData" local BoneData = require "spine-lua.BoneData" local SlotData = require "spine-lua.SlotData" local Skin = require "spine-lua.Skin" local AttachmentLoader = require "spine-lua.AttachmentLoader" local Animation = require "spine-lua.Animation" local IkConstraintData = require "spine-lua.IkConstraintData" local IkConstraint = require "spine-lua.IkConstraint" local PathConstraintData = require "spine-lua.PathConstraintData" local PathConstraint = require "spine-lua.PathConstraint" local TransformConstraintData = require "spine-lua.TransformConstraintData" local TransformConstraint = require "spine-lua.TransformConstraint" local EventData = require "spine-lua.EventData" local Event = require "spine-lua.Event" local AttachmentType = require "spine-lua.attachments.AttachmentType" local BlendMode = require "spine-lua.BlendMode" local TransformMode = require "spine-lua.TransformMode" local utils = require "spine-lua.utils" local Color = require "spine-lua.Color" local SkeletonJson = {} function SkeletonJson.new (attachmentLoader) if not attachmentLoader then attachmentLoader = AttachmentLoader.new() end local self = { attachmentLoader = attachmentLoader, scale = 1, linkedMeshes = {} } function self:readSkeletonDataFile (fileName, base) return self:readSkeletonData(utils.readFile(fileName, base)) end local readAttachment local readAnimation local readCurve local getArray local getValue = function (map, name, default) local value = map[name] if value == nil then return default else return value end end function self:readSkeletonData (jsonText) local scale = self.scale local skeletonData = SkeletonData.new(self.attachmentLoader) local root = utils.readJSON(jsonText) if not root then error("Invalid JSON: " .. jsonText, 2) end -- Skeleton. local skeletonMap = root["skeleton"] if skeletonMap then skeletonData.hash = skeletonMap["hash"] skeletonData.version = skeletonMap["spine"] skeletonData.x = skeletonMap["x"] skeletonData.y = skeletonMap["y"] skeletonData.width = skeletonMap["width"] skeletonData.height = skeletonMap["height"] skeletonData.fps = skeletonMap["fps"] skeletonData.imagesPath = skeletonMap["images"] end -- Bones. for i,boneMap in ipairs(root["bones"]) do local boneName = boneMap["name"] local parent = nil local parentName = boneMap["parent"] if parentName then parent = skeletonData:findBone(parentName) if not parent then error("Parent bone not found: " .. parentName) end end local data = BoneData.new(i, boneName, parent) data.length = getValue(boneMap, "length", 0) * scale; data.x = getValue(boneMap, "x", 0) * scale; data.y = getValue(boneMap, "y", 0) * scale; data.rotation = getValue(boneMap, "rotation", 0); data.scaleX = getValue(boneMap, "scaleX", 1); data.scaleY = getValue(boneMap, "scaleY", 1); data.shearX = getValue(boneMap, "shearX", 0); data.shearY = getValue(boneMap, "shearY", 0); data.transformMode = TransformMode[getValue(boneMap, "transform", "normal")] data.skinRequired = getValue(boneMap, "skin", false) table_insert(skeletonData.bones, data) end -- Slots. if root["slots"] then for i,slotMap in ipairs(root["slots"]) do local slotName = slotMap["name"] local boneName = slotMap["bone"] local boneData = skeletonData:findBone(boneName) if not boneData then error("Slot bone not found: " .. boneName) end local data = SlotData.new(i, slotName, boneData) local color = slotMap["color"] if color then data.color:set(tonumber(color:sub(1, 2), 16) / 255, tonumber(color:sub(3, 4), 16) / 255, tonumber(color:sub(5, 6), 16) / 255, tonumber(color:sub(7, 8), 16) / 255) end local dark = slotMap["dark"] if dark then data.darkColor = Color.newWith(1, 1, 1, 1) data.darkColor:set(tonumber(dark:sub(1, 2), 16) / 255, tonumber(dark:sub(3, 4), 16) / 255, tonumber(dark:sub(5, 6), 16) / 255, 0) end data.attachmentName = getValue(slotMap, "attachment", nil) data.blendMode = BlendMode[getValue(slotMap, "blend", "normal")] table_insert(skeletonData.slots, data) skeletonData.slotNameIndices[data.name] = #skeletonData.slots end end -- IK constraints. if root["ik"] then for _,constraintMap in ipairs(root["ik"]) do local data = IkConstraintData.new(constraintMap["name"]) data.order = getValue(constraintMap, "order", 0) data.skinRequired = getValue(constraintMap, "skin", false) for _,boneName in ipairs(constraintMap["bones"]) do local bone = skeletonData:findBone(boneName) if not bone then error("IK bone not found: " .. boneName) end table_insert(data.bones, bone) end local targetName = constraintMap["target"] data.target = skeletonData:findBone(targetName) if not data.target then error("Target bone not found: " .. targetName) end data.mix = getValue(constraintMap, "mix", 1) data.softness = getValue(constraintMap, "softness", 0) * scale if constraintMap["bendPositive"] == nil or constraintMap["bendPositive"] == true then data.bendDirection = 1 else data.bendDirection = -1 end if constraintMap["compress"] == nil or constraintMap["compress"] == false then data.compress = false else data.compress = true end if constraintMap["stretch"] == nil or constraintMap["stretch"] == false then data.stretch = false else data.stretch = true end if constraintMap["uniform"] == nil or constraintMap["uniform"] == false then data.uniform = false else data.uniform = true end table_insert(skeletonData.ikConstraints, data) end end -- Transform constraints if root["transform"] then for _,constraintMap in ipairs(root["transform"]) do local data = TransformConstraintData.new(constraintMap.name) data.order = getValue(constraintMap, "order", 0) data.skinRequired = getValue(constraintMap, "skin", false) for _,boneName in ipairs(constraintMap.bones) do local bone = skeletonData:findBone(boneName) if not bone then error("Transform constraint bone not found: " .. boneName, 2) end table_insert(data.bones, bone) end local targetName = constraintMap.target data.target = skeletonData:findBone(targetName) if not data.target then error("Transform constraint target bone not found: " .. (targetName or "none"), 2) end data.offsetRotation = getValue(constraintMap, "rotation", 0); data.offsetX = getValue(constraintMap, "x", 0) * scale; data.offsetY = getValue(constraintMap, "y", 0) * scale; data.offsetScaleX = getValue(constraintMap, "scaleX", 0); data.offsetScaleY = getValue(constraintMap, "scaleY", 0); data.offsetShearY = getValue(constraintMap, "shearY", 0); data.rotateMix = getValue(constraintMap, "rotateMix", 1); data.translateMix = getValue(constraintMap, "translateMix", 1); data.scaleMix = getValue(constraintMap, "scaleMix", 1); data.shearMix = getValue(constraintMap, "shearMix", 1); table_insert(skeletonData.transformConstraints, data) end end -- Path constraints if root["path"] then for _,constraintMap in ipairs(root.path) do local data = PathConstraintData.new(constraintMap.name); data.order = getValue(constraintMap, "order", 0) data.skinRequired = getValue(constraintMap, "skin", false) for _,boneName in ipairs(constraintMap.bones) do local bone = skeletonData:findBone(boneName) if not bone then error("Path constraint bone not found: " .. boneName, 2) end table_insert(data.bones, bone) end local targetName = constraintMap.target; data.target = skeletonData:findSlot(targetName) if data.target == nil then error("Path target slot not found: " .. targetName, 2) end data.positionMode = PathConstraintData.PositionMode[getValue(constraintMap, "positionMode", "percent"):lower()] data.spacingMode = PathConstraintData.SpacingMode[getValue(constraintMap, "spacingMode", "length"):lower()] data.rotateMode = PathConstraintData.RotateMode[getValue(constraintMap, "rotateMode", "tangent"):lower()] data.offsetRotation = getValue(constraintMap, "rotation", 0); data.position = getValue(constraintMap, "position", 0); if data.positionMode == PathConstraintData.PositionMode.fixed then data.position = data.position * scale end data.spacing = getValue(constraintMap, "spacing", 0); if data.spacingMode == PathConstraintData.SpacingMode.length or data.spacingMode == PathConstraintData.SpacingMode.fixed then data.spacing = data.spacing * scale end data.rotateMix = getValue(constraintMap, "rotateMix", 1); data.translateMix = getValue(constraintMap, "translateMix", 1); table_insert(skeletonData.pathConstraints, data) end end -- Skins. if root["skins"] then for skinName,skinMap in pairs(root["skins"]) do local skin = Skin.new(skinMap["name"]) for slotName,slotMap in pairs(skinMap.attachments) do local slotIndex = skeletonData.slotNameIndices[slotName] for attachmentName,attachmentMap in pairs(slotMap) do local attachment = readAttachment(attachmentMap, skin, slotIndex, attachmentName, skeletonData) if attachment then skin:setAttachment(slotIndex, attachmentName, attachment) end end end table_insert(skeletonData.skins, skin) if skin.name == "default" then skeletonData.defaultSkin = skin end end end -- Linked meshes for _, linkedMesh in ipairs(self.linkedMeshes) do local skin = skeletonData.defaultSkin if linkedMesh.skin then skin = skeletonData:findSkin(linkedMesh.skin) end if not skin then error("Skin not found: " .. linkedMesh.skin) end local parent = skin:getAttachment(linkedMesh.slotIndex, linkedMesh.parent) if not parent then error("Parent mesh not found: " + linkedMesh.parent) end if linkedMesh.inheritDeform then linkedMesh.mesh.deformAttachment = parent else linkedMesh.mesh.deformAttachment = linkedMesh.mesh end linkedMesh.mesh:setParentMesh(parent) linkedMesh.mesh:updateUVs() end self.linkedMeshes = {} -- Events. if root["events"] then for eventName,eventMap in pairs(root["events"]) do local data = EventData.new(eventName) data.intValue = getValue(eventMap, "int", 0) data.floatValue = getValue(eventMap, "float", 0) data.stringValue = getValue(eventMap, "string", "") data.audioPath = getValue(eventMap, "audio", nil) if data.audioPath ~= nil then data.volume = getValue(eventMap, "volume", 1) data.balance = getValue(eventMap, "balance", 0) end table_insert(skeletonData.events, data) end end -- Animations. if root["animations"] then for animationName,animationMap in pairs(root["animations"]) do readAnimation(animationMap, animationName, skeletonData) end end return skeletonData end readAttachment = function (map, skin, slotIndex, name, skeletonData) local scale = self.scale name = getValue(map, "name", name) local type = AttachmentType[getValue(map, "type", "region")] local path = getValue(map, "path", name) if type == AttachmentType.region then local region = attachmentLoader:newRegionAttachment(skin, name, path) if not region then return nil end region.path = path region.x = getValue(map, "x", 0) * scale region.y = getValue(map, "y", 0) * scale region.scaleX = getValue(map, "scaleX", 1); region.scaleY = getValue(map, "scaleY", 1); region.rotation = getValue(map, "rotation", 0); region.width = map.width * scale; region.height = map.height * scale; local color = map["color"] if color then region.color:set(tonumber(color:sub(1, 2), 16) / 255, tonumber(color:sub(3, 4), 16) / 255, tonumber(color:sub(5, 6), 16) / 255, tonumber(color:sub(7, 8), 16) / 255) end region:updateOffset() return region elseif type == AttachmentType.boundingbox then local box = attachmentLoader:newBoundingBoxAttachment(skin, name) if not box then return nil end readVertices(map, box, map.vertexCount * 2) local color = map.color if color then box.color:set(tonumber(color:sub(1, 2), 16) / 255, tonumber(color:sub(3, 4), 16) / 255, tonumber(color:sub(5, 6), 16) / 255, tonumber(color:sub(7, 8), 16) / 255) end return box elseif type == AttachmentType.mesh or type == AttachmentType.linkedmesh then local mesh = attachmentLoader:newMeshAttachment(skin, name, path) if not mesh then return nil end mesh.path = path local color = map.color if color then mesh.color:set(tonumber(color:sub(1, 2), 16) / 255, tonumber(color:sub(3, 4), 16) / 255, tonumber(color:sub(5, 6), 16) / 255, tonumber(color:sub(7, 8), 16) / 255) end mesh.width = getValue(map, "width", 0) * scale mesh.height = getValue(map, "height", 0) * scale local parent = map.parent if parent then table_insert(self.linkedMeshes, { mesh = mesh, skin = getValue(map, "skin", nil), slotIndex = slotIndex, parent = parent, inheritDeform = getValue(map, "deform", true) }) return mesh end local uvs = getArray(map, "uvs", 1) readVertices(map, mesh, #uvs) mesh.triangles = getArray(map, "triangles", 1) -- adjust triangle indices by 1, vertices are one-indexed for i,v in ipairs(mesh.triangles) do mesh.triangles[i] = v + 1 end mesh.regionUVs = uvs mesh:updateUVs() mesh.hullLength = getValue(map, "hull", 0) * 2 return mesh elseif type == AttachmentType.path then local path = self.attachmentLoader:newPathAttachment(skin, name) if not path then return nil end path.closed = getValue(map, "closed", false) path.constantSpeed = getValue(map, "constantSpeed", true) local vertexCount = map.vertexCount readVertices(map, path, vertexCount * 2) local lengths = utils.newNumberArray(vertexCount / 3, 0) for i,v in ipairs(map.lengths) do lengths[i] = v * scale end path.lengths = lengths local color = map.color if color then path.color:set(tonumber(color:sub(1, 2), 16) / 255, tonumber(color:sub(3, 4), 16) / 255, tonumber(color:sub(5, 6), 16) / 255, tonumber(color:sub(7, 8), 16) / 255) end return path; elseif type == AttachmentType.point then local point = self.attachmentLoader:newPointAttachment(skin, name) if not point then return nil end point.x = getValue(map, "x", 0) * scale point.y = getValue(map, "y", 0) * scale point.rotation = getValue(map, "rotation", 0) local color = map.color if color then path.color:set(tonumber(color:sub(1, 2), 16) / 255, tonumber(color:sub(3, 4), 16) / 255, tonumber(color:sub(5, 6), 16) / 255, tonumber(color:sub(7, 8), 16) / 255) end return point elseif type == AttachmentType.clipping then local clip = attachmentLoader:newClippingAttachment(skin, name) if not clip then return nil end local _end = getValue(map, "end", nil) if _end then local slot = skeletonData:findSlot(_end) if not slot then error("Clipping end slot not found: " + _end) end clip.endSlot = slot end readVertices(map, clip, map.vertexCount * 2) local color = map.color if color then clip.color:set(tonumber(color:sub(1, 2), 16) / 255, tonumber(color:sub(3, 4), 16) / 255, tonumber(color:sub(5, 6), 16) / 255, tonumber(color:sub(7, 8), 16) / 255) end return clip end error("Unknown attachment type: " .. type .. " (" .. name .. ")") end readVertices = function (map, attachment, verticesLength) local scale = self.scale attachment.worldVerticesLength = verticesLength local vertices = getArray(map, "vertices", 1) if verticesLength == #vertices then if scale ~= 1 then local i = 0 local n = #vertices while i < n do vertices[i + 1] = vertices[i + 1] * scale i = i + 1 end end attachment.vertices = vertices return end local weights = {} local bones = {} local i = 0 local n = #vertices while i < n do local boneCount = vertices[i + 1] i = i + 1 table_insert(bones, boneCount) local nn = i + boneCount * 4 while i < nn do table_insert(bones, vertices[i + 1] + 1) -- +1 because bones are one-indexed table_insert(weights, vertices[i + 2] * scale) table_insert(weights, vertices[i + 3] * scale) table_insert(weights, vertices[i + 4]) i = i + 4 end end attachment.bones = bones attachment.vertices = weights end readAnimation = function (map, name, skeletonData) local timelines = {} local duration = 0 local scale = self.scale -- Slot timelines local slotsMap = map["slots"] if slotsMap then for slotName,timelineMap in pairs(slotsMap) do local slotIndex = skeletonData.slotNameIndices[slotName] for timelineName,values in pairs(timelineMap) do if timelineName == "color" then local timeline = Animation.ColorTimeline.new(#values) timeline.slotIndex = slotIndex local frameIndex = 0 for _,valueMap in ipairs(values) do local color = valueMap["color"] timeline:setFrame( frameIndex, getValue(valueMap, "time", 0), tonumber(color:sub(1, 2), 16) / 255, tonumber(color:sub(3, 4), 16) / 255, tonumber(color:sub(5, 6), 16) / 255, tonumber(color:sub(7, 8), 16) / 255 ) readCurve(valueMap, timeline, frameIndex) frameIndex = frameIndex + 1 end table_insert(timelines, timeline) duration = math.max(duration, timeline.frames[(timeline:getFrameCount() - 1) * Animation.ColorTimeline.ENTRIES]) elseif timelineName == "twoColor" then local timeline = Animation.TwoColorTimeline.new(#values) timeline.slotIndex = slotIndex local frameIndex = 0 for _,valueMap in ipairs(values) do local light = valueMap["light"] local dark = valueMap["dark"] timeline:setFrame( frameIndex, getValue(valueMap, "time", 0), tonumber(light:sub(1, 2), 16) / 255, tonumber(light:sub(3, 4), 16) / 255, tonumber(light:sub(5, 6), 16) / 255, tonumber(light:sub(7, 8), 16) / 255, tonumber(dark:sub(1, 2), 16) / 255, tonumber(dark:sub(3, 4), 16) / 255, tonumber(dark:sub(5, 6), 16) / 255 ) readCurve(valueMap, timeline, frameIndex) frameIndex = frameIndex + 1 end table_insert(timelines, timeline) duration = math.max(duration, timeline.frames[(timeline:getFrameCount() - 1) * Animation.TwoColorTimeline.ENTRIES]) elseif timelineName == "attachment" then local timeline = Animation.AttachmentTimeline.new(#values) timeline.slotIndex = slotIndex local frameIndex = 0 for _,valueMap in ipairs(values) do local attachmentName = valueMap["name"] timeline:setFrame(frameIndex, getValue(valueMap, "time", 0), attachmentName) frameIndex = frameIndex + 1 end table_insert(timelines, timeline) duration = math.max(duration, timeline.frames[timeline:getFrameCount() - 1]) else error("Invalid frame type for a slot: " .. timelineName .. " (" .. slotName .. ")") end end end end -- Bone timelines local bonesMap = map["bones"] if bonesMap then for boneName,timelineMap in pairs(bonesMap) do local boneIndex = skeletonData:findBoneIndex(boneName) if boneIndex == -1 then error("Bone not found: " .. boneName) end for timelineName,values in pairs(timelineMap) do if timelineName == "rotate" then local timeline = Animation.RotateTimeline.new(#values) timeline.boneIndex = boneIndex local frameIndex = 0 for _,valueMap in ipairs(values) do timeline:setFrame(frameIndex, getValue(valueMap, "time", 0), getValue(valueMap, "angle", 0)) readCurve(valueMap, timeline, frameIndex) frameIndex = frameIndex + 1 end table_insert(timelines, timeline) duration = math.max(duration, timeline.frames[(timeline:getFrameCount() - 1) * Animation.RotateTimeline.ENTRIES]) elseif timelineName == "translate" or timelineName == "scale" or timelineName == "shear" then local timeline local timelineScale = 1 local defaultValue = 0 if timelineName == "scale" then timeline = Animation.ScaleTimeline.new(#values) defaultValue = 1 elseif timelineName == "shear" then timeline = Animation.ShearTimeline.new(#values) else timeline = Animation.TranslateTimeline.new(#values) timelineScale = self.scale end timeline.boneIndex = boneIndex local frameIndex = 0 for _,valueMap in ipairs(values) do local x = getValue(valueMap, "x", defaultValue) * timelineScale local y = getValue(valueMap, "y", defaultValue) * timelineScale timeline:setFrame(frameIndex, getValue(valueMap, "time", 0), x, y) readCurve(valueMap, timeline, frameIndex) frameIndex = frameIndex + 1 end table_insert(timelines, timeline) duration = math.max(duration, timeline.frames[(timeline:getFrameCount() - 1) * Animation.TranslateTimeline.ENTRIES]) else error("Invalid timeline type for a bone: " .. timelineName .. " (" .. boneName .. ")") end end end end -- IK timelines. local ik = map["ik"] if ik then for ikConstraintName,values in pairs(ik) do local ikConstraint = skeletonData:findIkConstraint(ikConstraintName) local timeline = Animation.IkConstraintTimeline.new(#values) for i,other in pairs(skeletonData.ikConstraints) do if other == ikConstraint then timeline.ikConstraintIndex = i break end end local frameIndex = 0 for _,valueMap in ipairs(values) do local mix = 1 local softness = 0 if valueMap["mix"] ~= nil then mix = valueMap["mix"] end if valueMap["softness"] ~= nil then softness = valueMap["softness"] * scale end local bendPositive = 1 if valueMap["bendPositive"] == false then bendPositive = -1 end local stretch = false if valueMap["stretch"] ~= nil then stretch = valueMap["stretch"] end local compress = false if valueMap["compress"] ~= nil then compress = valueMap["compress"] end timeline:setFrame(frameIndex, getValue(valueMap, "time", 0), mix, softness, bendPositive, compress, stretch) readCurve(valueMap, timeline, frameIndex) frameIndex = frameIndex + 1 end table_insert(timelines, timeline) duration = math.max(duration, timeline.frames[(timeline:getFrameCount() - 1) * Animation.IkConstraintTimeline.ENTRIES]) end end -- Transform constraint timelines. local transform = map["transform"] if transform then for constraintName, values in pairs(transform) do local constraint = skeletonData:findTransformConstraint(constraintName) local timeline = Animation.TransformConstraintTimeline.new(#values) for i,other in pairs(skeletonData.transformConstraints) do if other == constraint then timeline.transformConstraintIndex = i break end end local frameIndex = 0 for _,valueMap in ipairs(values) do timeline:setFrame(frameIndex, getValue(valueMap, "time", 0), getValue(valueMap, "rotateMix", 1), getValue(valueMap, "translateMix", 1), getValue(valueMap, "scaleMix", 1), getValue(valueMap, "shearMix", 1)) readCurve(valueMap, timeline, frameIndex) frameIndex = frameIndex + 1 end table_insert(timelines, timeline) duration = math.max(duration, timeline.frames[(timeline:getFrameCount() - 1) * Animation.TransformConstraintTimeline.ENTRIES]) end end -- Path constraint timelines. if map.paths then for constraintName,constraintMap in pairs(map.paths) do local index = skeletonData:findPathConstraintIndex(constraintName) if index == -1 then error("Path constraint not found: " .. constraintName, 2) end local data = skeletonData.pathConstraints[index] for timelineName, timelineMap in pairs(constraintMap) do if timelineName == "position" or timelineName == "spacing" then local timeline = nil local timelineScale = 1 if timelineName == "spacing" then timeline = Animation.PathConstraintSpacingTimeline.new(#timelineMap) if data.spacingMode == PathConstraintData.SpacingMode.length or data.spacingMode == PathConstraintData.SpacingMode.fixed then timelineScale = scale end else timeline = Animation.PathConstraintPositionTimeline.new(#timelineMap) if data.positionMode == PathConstraintData.PositionMode.fixed then timelineScale = scale end end timeline.pathConstraintIndex = index local frameIndex = 0 for _,valueMap in ipairs(timelineMap) do timeline:setFrame(frameIndex, getValue(valueMap, "time", 0), getValue(valueMap, timelineName, 0) * timelineScale) readCurve(valueMap, timeline, frameIndex) frameIndex = frameIndex + 1 end table_insert(timelines, timeline) duration = math.max(duration, timeline.frames[(timeline:getFrameCount() - 1) * Animation.PathConstraintPositionTimeline.ENTRIES]) elseif timelineName == "mix" then local timeline = Animation.PathConstraintMixTimeline.new(#timelineMap) timeline.pathConstraintIndex = index local frameIndex = 0 for _,valueMap in ipairs(timelineMap) do timeline:setFrame(frameIndex, getValue(valueMap, "time", 0), getValue(valueMap, "rotateMix", 1), getValue(valueMap, "translateMix", 1)) readCurve(valueMap, timeline, frameIndex) frameIndex = frameIndex + 1 end table_insert(timelines, timeline) duration = math.max(duration, timeline.frames[(timeline:getFrameCount() - 1) * Animation.PathConstraintMixTimeline.ENTRIES]) end end end end -- Deform timelines. if map.deform then for deformName, deformMap in pairs(map.deform) do local skin = skeletonData:findSkin(deformName) if not skin then error("Skin not found: " .. deformName, 2) end for slotName,slotMap in pairs(deformMap) do local slotIndex = skeletonData:findSlotIndex(slotName) if slotIndex == -1 then error("Slot not found: " .. slotMap.name, 2) end for timelineName,timelineMap in pairs(slotMap) do local attachment = skin:getAttachment(slotIndex, timelineName) if not attachment then error("Deform attachment not found: " .. timelineMap.name, 2) end local weighted = attachment.bones ~= nil local vertices = attachment.vertices; local deformLength = #vertices if weighted then deformLength = math.floor(#vertices / 3) * 2 end local timeline = Animation.DeformTimeline.new(#timelineMap) timeline.slotIndex = slotIndex timeline.attachment = attachment local frameIndex = 0 for _,valueMap in ipairs(timelineMap) do local deform = nil local verticesValue = getValue(valueMap, "vertices", nil) if verticesValue == nil then deform = vertices if weighted then deform = utils.newNumberArray(deformLength) end else deform = utils.newNumberArray(deformLength) local start = getValue(valueMap, "offset", 0) + 1 utils.arrayCopy(verticesValue, 1, deform, start, #verticesValue) if scale ~= 1 then local i = start local n = i + #verticesValue while i < n do deform[i] = deform[i] * scale i = i + 1 end end if not weighted then local i = 1 local n = i + deformLength while i < n do deform[i] = deform[i] + vertices[i] i = i + 1 end end end timeline:setFrame(frameIndex, getValue(valueMap, "time", 0), deform) readCurve(valueMap, timeline, frameIndex) frameIndex = frameIndex + 1 end table_insert(timelines, timeline) duration = math.max(duration, timeline.frames[timeline:getFrameCount() - 1]) end end end end -- Draworder timeline. local drawOrderValues = map["drawOrder"] if not drawOrderValues then drawOrderValues = map["draworder"] end if drawOrderValues then local timeline = Animation.DrawOrderTimeline.new(#drawOrderValues) local slotCount = #skeletonData.slots local frameIndex = 0 for _,drawOrderMap in ipairs(drawOrderValues) do local drawOrder = nil local offsets = drawOrderMap["offsets"] if offsets then drawOrder = {} local unchanged = {} local originalIndex = 1 local unchangedIndex = 1 for _,offsetMap in ipairs(offsets) do local slotIndex = skeletonData:findSlotIndex(offsetMap["slot"]) if slotIndex == -1 then error("Slot not found: " .. offsetMap["slot"]) end -- Collect unchanged items. while originalIndex ~= slotIndex do unchanged[unchangedIndex] = originalIndex unchangedIndex = unchangedIndex + 1 originalIndex = originalIndex + 1 end -- Set changed items. drawOrder[originalIndex + offsetMap["offset"]] = originalIndex originalIndex = originalIndex + 1 end -- Collect remaining unchanged items. while originalIndex <= slotCount do unchanged[unchangedIndex] = originalIndex unchangedIndex = unchangedIndex + 1 originalIndex = originalIndex + 1 end -- Fill in unchanged items. for ii = slotCount, 1, -1 do if not drawOrder[ii] then unchangedIndex = unchangedIndex - 1 drawOrder[ii] = unchanged[unchangedIndex] end end end timeline:setFrame(frameIndex, getValue(drawOrderMap, "time", 0), drawOrder) frameIndex = frameIndex + 1 end table_insert(timelines, timeline) duration = math.max(duration, timeline.frames[timeline:getFrameCount() - 1]) end -- Event timeline. local events = map["events"] if events then local timeline = Animation.EventTimeline.new(#events) local frameIndex = 0 for _,eventMap in ipairs(events) do local eventData = skeletonData:findEvent(eventMap["name"]) if not eventData then error("Event not found: " .. eventMap["name"]) end local event = Event.new(getValue(eventMap, "time", 0), eventData) if eventMap["int"] ~= nil then event.intValue = eventMap["int"] else event.intValue = eventData.intValue end if eventMap["float"] ~= nil then event.floatValue = eventMap["float"] else event.floatValue = eventData.floatValue end if eventMap["string"] ~= nil then event.stringValue = eventMap["string"] else event.stringValue = eventData.stringValue end if eventData.audioPath ~= nil then event.volume = getValue(eventMap, "volume", 1) event.balance = getValue(eventMap, "balance", 0) end timeline:setFrame(frameIndex, event) frameIndex = frameIndex + 1 end table_insert(timelines, timeline) duration = math.max(duration, timeline.frames[timeline:getFrameCount() - 1]) end table_insert(skeletonData.animations, Animation.new(name, timelines, duration)) end readCurve = function (map, timeline, frameIndex) local curve = map["curve"] if not curve then return end if curve == "stepped" then timeline:setStepped(frameIndex) else timeline:setCurve(frameIndex, getValue(map, "curve", 0), getValue(map, "c2", 0), getValue(map, "c3", 1), getValue(map, "c4", 1)) end end getArray = function (map, name, scale) local list = map[name] local values = {} if scale == 1 then for i = 1, #list do values[i] = list[i] end else for i = 1, #list do values[i] = list[i] * scale end end return values end return self end return SkeletonJson
return function() local CorePackages = game:GetService("CorePackages") local Roact = require(CorePackages.Roact) local NetworkSummary = require(script.Parent.NetworkSummary) it("should create and destroy without errors", function() local element = Roact.createElement(NetworkSummary) local instance = Roact.mount(element) Roact.unmount(instance) end) end
local version = 3 if frotify and frotify.VERSION >= version then return end frotify = { VERSION = version, AUTHOR = "fruitwasp", AUTHOR_URL = "https://steamcommunity.com/id/fruitwasp", DEFAULT_PREFIX = "[game]", PRINT_PREFIX_COLOR = Color( 0, 255, 0 ), PRINT_COLOR = Color( 255, 255, 255 ), DEFAULT_NOTIFICATION_LENGTH_TIME = 4 } function frotify.print( message, prefix ) prefix = prefix or frotify.DEFAULT_PREFIX MsgC( frotify.PRINT_PREFIX_COLOR, prefix .. " ", frotify.PRINT_COLOR, message .. "\n" ) end if SERVER then NOTIFY_GENERIC = NOTIFY_GENERIC or 0 NOTIFY_ERROR = NOTIFY_ERROR or 1 NOTIFY_UNDO = NOTIFY_UNDO or 2 NOTIFY_HINT = NOTIFY_HINT or 3 NOTIFY_CLEANUP = NOTIFY_CLEANUP or 4 util.AddNetworkString( "frotify" ) function frotify.notify( message, messageType, timeLength, targets ) messageType = messageType or NOTIFY_GENERIC timeLength = timeLength or frotify.DEFAULT_NOTIFICATION_LENGTH_TIME net.Start( "frotify" ) net.WriteString( message ) net.WriteUInt( messageType, 2 ) net.WriteUInt( timeLength, 4 ) net.Send( targets or player.GetAll() ) end if DarkRP then function DarkRP.notify( targets, messageType, timeLength, message ) frotify.notify( message, messageType, timeLength, targets ) end end end if CLIENT then net.Receive( "frotify", function() local message = net.ReadString() local messageType = net.ReadUInt( 2 ) local timeLength = net.ReadUInt( 4 ) frotify.notify( message, messageType, timeLength ) end ) function frotify.notify( message, messageType, timeLength ) notification.AddLegacy( message, messageType, timeLength ) end end
require('kommentary.config').configure_language('default', { prefer_single_line_comments = true, ignore_whitespace = false })
-- combat_AlienBuyFuncs.lua function GetPurchasedTechIds() local player = Client.GetLocalPlayer() if player then -- get All ups from the personal combat table (send from the server via OnCommandSetUpgrades(upgradeId) local purchasedList = {} if player.combatUpgrades then for _, upgradeId in ipairs (player.combatUpgrades) do local upgrade = GetUpgradeFromId(tonumber(upgradeId)) -- don't show the icon from a class if (upgrade and upgrade:GetType() ~= kCombatUpgradeTypes.Class) then table.insert(purchasedList, upgrade:GetTechId()) end end end return purchasedList end return nil end function AlienBuy_GetUpgradePurchased(techId) local player = Client.GetLocalPlayer() if player then -- get All ups from the personal combat table (send from the server via OnCommandSetUpgrades(upgradeId) local gotTechId = false if player.combatUpgrades then for _, upgradeId in ipairs (player.combatUpgrades) do local upgrade = GetUpgradeFromId(tonumber(upgradeId)) -- don't show the icon from a class if (upgrade and upgrade:GetType() ~= kCombatUpgradeTypes.Class) then if techId == upgrade:GetTechId() then gotTechId = true break end end end end return gotTechId end return false end function AlienUI_GetUpgradesForCategory(category) return { category } end -- iconx, icony, name, tooltip, research, cost. Need to change that to change the costs function GetUnpurchasedUpgradeInfoArray(techIdTable) local t = {} local player = Client.GetLocalPlayer() if player then for _, techId in ipairs(techIdTable) do local iconX, iconY = GetMaterialXYOffset(techId, false) if iconX and iconY then local techTree = GetTechTree(player:GetTeamNumber()) local upgradeName = GetDisplayNameForTechId(techId, string.format("<name not found - %s>", EnumToString(kTechId, techId))) local upgrade = GetUpgradeFromTechId(techId) table.insert(t, iconX) table.insert(t, iconY) table.insert(t, upgradeName) table.insert(t, GetTooltipInfoText(techId)) table.insert(t, GetTechTree():GetResearchProgressForNode(techId)) -- cost table.insert(t, upgrade:GetLevels()) table.insert(t, techId) if techTree then table.insert(t, techTree:GetIsTechAvailable(techId)) else table.insert(t, false) end end end end return t end function GetUnpurchasedTechIds() -- get All ups for the aliens local allUps = GetAllUpgrades("Alien") local techUps = GetUpgradesOfType(allUps, kCombatUpgradeTypes.Tech) local addOnUpgrades = {} local player = Client.GetLocalPlayer() for _, upgrade in ipairs(techUps) do if not player:GotItemAlready(upgrade) then table.insert(addOnUpgrades, upgrade:GetTechId()) end end return addOnUpgrades end function AlienBuy_GetPurchasedUpgradeInfoArray(techIdTable) local t = {} local player = Client.GetLocalPlayer() for _, techId in ipairs(techIdTable) do local iconX, iconY = GetMaterialXYOffset(techId, false) if iconX and iconY then local techTree = GetTechTree(player:GetTeamNumber()) table.insert(t, iconX) table.insert(t, iconY) table.insert(t, GetDisplayNameForTechId(techId, string.format("<not found - %s>", EnumToString(kTechId, techId)))) table.insert(t, GetTooltipInfoText(techId)) table.insert(t, techId) table.insert(t, true) if techTree then table.insert(t, true) else table.insert(t, false) end else Print("GetPurchasedUpgradeInfoArray():GetAlienUpgradeIconXY(%s): Couldn't find upgrade icon.", ToString(techId)) end end return t end function AlienBuy_GetPurchasedUpgrades(idx) return AlienBuy_GetPurchasedUpgradeInfoArray(GetPurchasedTechIds(IndexToAlienTechId(idx))) end function AlienBuy_GetIsUpgradeAllowed(techId, upgradeTechIdList) local player = Client.GetLocalPlayer() if player then local upgrade = GetUpgradeFromTechId(techId) if upgrade then return player:GotRequirementsFromTechIds(upgrade, upgradeTechIdList) end end return false end function AlienBuy_GetTechIdForAlien(idx) return IndexToAlienTechId(idx) end -- -- Return cost for the base alien type -- function AlienBuy_GetAlienCost(alienType) local techId = AlienBuy_GetTechIdForAlien(alienType) local upgrade = GetUpgradeFromTechId(techId) if upgrade then return upgrade:GetLevels() end return 0 end -- -- Return current alien type -- function AlienBuy_GetCurrentAlien() local player = Client.GetLocalPlayer() local techId = player:GetTechId() local index = AlienTechIdToIndex(techId) index = ConditionalValue( index < 1, 5, index) --ASSERT(index >= 1 and index <= table.count(indexToAlienTechIdTable), "AlienBuy_GetCurrentAlien(" .. ToString(techId) .. "): returning invalid index " .. ToString(index) .. " for " .. SafeClassName(player)) return index end function AlienBuy_Purchase(purchases) local player = Client.GetLocalPlayer() local textCodes = {} if player then for _, purchaseId in ipairs(purchases) do local upgrade = GetUpgradeFromTechId(purchaseId) if upgrade then local textCode = upgrade:GetTextCode() table.insert(textCodes, textCode) end end if table.maxn(textCodes) > 0 then player:Combat_PurchaseItemAndUpgrades(textCodes) end end end function AlienBuy_GetAbilitiesFor() return {} end function AlienBuy_IsAlienResearched() return true end
module(..., package.seeall) local config = require("core.config") local manager = require("lib.ptree.ptree") local PcapFilter = require("apps.packet_filter.pcap_filter").PcapFilter local V4V6 = require("apps.lwaftr.V4V6").V4V6 local VirtioNet = require("apps.virtio_net.virtio_net").VirtioNet local lwaftr = require("apps.lwaftr.lwaftr") local lwutil = require("apps.lwaftr.lwutil") local basic_apps = require("apps.basic.basic_apps") local pcap = require("apps.pcap.pcap") local ipv4_echo = require("apps.ipv4.echo") local ipv4_fragment = require("apps.ipv4.fragment") local ipv4_reassemble = require("apps.ipv4.reassemble") local arp = require("apps.ipv4.arp") local ipv6_echo = require("apps.ipv6.echo") local ipv6_fragment = require("apps.ipv6.fragment") local ipv6_reassemble = require("apps.ipv6.reassemble") local ndp = require("apps.lwaftr.ndp") local vlan = require("apps.vlan.vlan") local pci = require("lib.hardware.pci") local cltable = require("lib.cltable") local ipv4 = require("lib.protocol.ipv4") local ethernet = require("lib.protocol.ethernet") local ipv4_ntop = require("lib.yang.util").ipv4_ntop local binary = require("lib.yang.binary") local S = require("syscall") local engine = require("core.app") local lib = require("core.lib") local shm = require("core.shm") local yang = require("lib.yang.yang") local alarms = require("lib.yang.alarms") local alarm_notification = false local capabilities = { ['ietf-softwire-br']={feature={'binding'}}, ['ietf-alarms']={feature={'operator-actions', 'alarm-shelving', 'alarm-history'}}, } require('lib.yang.schema').set_default_capabilities(capabilities) function read_config(filename) return yang.load_configuration(filename, {schema_name=lwaftr.LwAftr.yang_schema}) end local function convert_ipv4(addr) if addr ~= nil then return ipv4:pton(ipv4_ntop(addr)) end end -- Checks the existence of PCI devices. local function validate_pci_devices(devices) for _, address in pairs(devices) do assert(lwutil.nic_exists(address), ("Could not locate PCI device '%s'"):format(address)) end end function lwaftr_app(c, conf) assert(type(conf) == 'table') local function append(t, elem) table.insert(t, elem) end local function prepend(t, elem) table.insert(t, 1, elem) end local device, id, queue = lwutil.parse_instance(conf) -- Global interfaces local gexternal_interface = conf.softwire_config.external_interface local ginternal_interface = conf.softwire_config.internal_interface -- Instance specific interfaces local iexternal_interface = queue.external_interface local iinternal_interface = queue.internal_interface config.app(c, "reassemblerv4", ipv4_reassemble.Reassembler, { max_concurrent_reassemblies = gexternal_interface.reassembly.max_packets, max_fragments_per_reassembly = gexternal_interface.reassembly.max_fragments_per_packet }) config.app(c, "reassemblerv6", ipv6_reassemble.Reassembler, { max_concurrent_reassemblies = ginternal_interface.reassembly.max_packets, max_fragments_per_reassembly = ginternal_interface.reassembly.max_fragments_per_packet }) config.app(c, "icmpechov4", ipv4_echo.ICMPEcho, { address = convert_ipv4(iexternal_interface.ip) }) config.app(c, "icmpechov6", ipv6_echo.ICMPEcho, { address = iinternal_interface.ip }) config.app(c, "lwaftr", lwaftr.LwAftr, conf) config.app(c, "fragmenterv4", ipv4_fragment.Fragmenter, { mtu=gexternal_interface.mtu }) config.app(c, "fragmenterv6", ipv6_fragment.Fragmenter, { mtu=ginternal_interface.mtu }) config.app(c, "ndp", ndp.NDP, { self_ip = iinternal_interface.ip, self_mac = iinternal_interface.mac, next_mac = iinternal_interface.next_hop.mac, shared_next_mac_key = "group/"..device.."-ipv6-next-mac", next_ip = iinternal_interface.next_hop.ip, alarm_notification = conf.alarm_notification }) config.app(c, "arp", arp.ARP, { self_ip = convert_ipv4(iexternal_interface.ip), self_mac = iexternal_interface.mac, next_mac = iexternal_interface.next_hop.mac, shared_next_mac_key = "group/"..device.."-ipv4-next-mac", next_ip = convert_ipv4(iexternal_interface.next_hop.ip), alarm_notification = conf.alarm_notification }) if conf.alarm_notification then local lwaftr = require('program.lwaftr.alarms') alarms.default_alarms(lwaftr.alarms) end local preprocessing_apps_v4 = { "reassemblerv4" } local preprocessing_apps_v6 = { "reassemblerv6" } local postprocessing_apps_v4 = { "fragmenterv4" } local postprocessing_apps_v6 = { "fragmenterv6" } if gexternal_interface.ingress_filter then config.app(c, "ingress_filterv4", PcapFilter, { filter = gexternal_interface.ingress_filter, alarm_type_qualifier='ingress-v4'}) append(preprocessing_apps_v4, "ingress_filterv4") end if ginternal_interface.ingress_filter then config.app(c, "ingress_filterv6", PcapFilter, { filter = ginternal_interface.ingress_filter, alarm_type_qualifier='ingress-v6'}) append(preprocessing_apps_v6, "ingress_filterv6") end if gexternal_interface.egress_filter then config.app(c, "egress_filterv4", PcapFilter, { filter = gexternal_interface.egress_filter, alarm_type_qualifier='egress-v4'}) prepend(postprocessing_apps_v4, "egress_filterv4") end if ginternal_interface.egress_filter then config.app(c, "egress_filterv6", PcapFilter, { filter = ginternal_interface.egress_filter, alarm_type_qualifier='egress-v6'}) prepend(postprocessing_apps_v6, "egress_filterv6") end -- Add a special hairpinning queue to the lwaftr app. config.link(c, "lwaftr.hairpin_out -> lwaftr.hairpin_in") append(preprocessing_apps_v4, { name = "arp", input = "south", output = "north" }) append(preprocessing_apps_v4, { name = "icmpechov4", input = "south", output = "north" }) prepend(postprocessing_apps_v4, { name = "icmpechov4", input = "north", output = "south" }) prepend(postprocessing_apps_v4, { name = "arp", input = "north", output = "south" }) append(preprocessing_apps_v6, { name = "ndp", input = "south", output = "north" }) append(preprocessing_apps_v6, { name = "icmpechov6", input = "south", output = "north" }) prepend(postprocessing_apps_v6, { name = "icmpechov6", input = "north", output = "south" }) prepend(postprocessing_apps_v6, { name = "ndp", input = "north", output = "south" }) set_preprocessors(c, preprocessing_apps_v4, "lwaftr.v4") set_preprocessors(c, preprocessing_apps_v6, "lwaftr.v6") set_postprocessors(c, "lwaftr.v6", postprocessing_apps_v6) set_postprocessors(c, "lwaftr.v4", postprocessing_apps_v4) end local function link_apps(c, apps) for i=1, #apps - 1 do local output, input = "output", "input" local src, dst = apps[i], apps[i+1] if type(src) == "table" then src, output = src["name"], src["output"] end if type(dst) == "table" then dst, input = dst["name"], dst["input"] end config.link(c, ("%s.%s -> %s.%s"):format(src, output, dst, input)) end end function set_preprocessors(c, apps, dst) assert(type(apps) == "table") link_apps(c, apps) local last_app, output = apps[#apps], "output" if type(last_app) == "table" then last_app, output = last_app.name, last_app.output end config.link(c, ("%s.%s -> %s"):format(last_app, output, dst)) end function set_postprocessors(c, src, apps) assert(type(apps) == "table") local first_app, input = apps[1], "input" if type(first_app) == "table" then first_app, input = first_app.name, first_app.input end config.link(c, ("%s -> %s.%s"):format(src, first_app, input)) link_apps(c, apps) end local function link_source(c, v4_in, v6_in) config.link(c, v4_in..' -> reassemblerv4.input') config.link(c, v6_in..' -> reassemblerv6.input') end local function link_sink(c, v4_out, v6_out) config.link(c, 'fragmenterv4.output -> '..v4_out) config.link(c, 'fragmenterv6.output -> '..v6_out) end function load_phy(c, conf, v4_nic_name, v6_nic_name, ring_buffer_size) local v4_pci, id, queue = lwutil.parse_instance(conf) local v6_pci = queue.external_interface.device local v4_info = pci.device_info(v4_pci) local v6_info = pci.device_info(v6_pci) validate_pci_devices({v4_pci, v6_pci}) lwaftr_app(c, conf, v4_pci) config.app(c, v4_nic_name, require(v4_info.driver).driver, { pciaddr=v4_pci, vmdq=true, -- Needed to enable MAC filtering/stamping. rxq=id, txq=id, poolnum=0, vlan=queue.external_interface.vlan_tag, rxcounter=1, ring_buffer_size=ring_buffer_size, macaddr=ethernet:ntop(queue.external_interface.mac)}) config.app(c, v6_nic_name, require(v6_info.driver).driver, { pciaddr=v6_pci, vmdq=true, -- Needed to enable MAC filtering/stamping. rxq=id, txq=id, poolnum=0, vlan=queue.internal_interface.vlan_tag, rxcounter=1, ring_buffer_size=ring_buffer_size, macaddr = ethernet:ntop(queue.internal_interface.mac)}) link_source(c, v4_nic_name..'.'..v4_info.tx, v6_nic_name..'.'..v6_info.tx) link_sink(c, v4_nic_name..'.'..v4_info.rx, v6_nic_name..'.'..v6_info.rx) end function load_on_a_stick(c, conf, args) local pciaddr, id, queue = lwutil.parse_instance(conf) local device = pci.device_info(pciaddr) local driver = require(device.driver).driver validate_pci_devices({pciaddr}) lwaftr_app(c, conf, pciaddr) local v4_nic_name, v6_nic_name, v4v6, mirror = args.v4_nic_name, args.v6_nic_name, args.v4v6, args.mirror if v4v6 then assert(queue.external_interface.vlan_tag == queue.internal_interface.vlan_tag) config.app(c, 'nic', driver, { pciaddr = pciaddr, vmdq=true, -- Needed to enable MAC filtering/stamping. rxq=id, txq=id, poolnum=0, vlan=queue.external_interface.vlan_tag, ring_buffer_size=args.ring_buffer_size, macaddr = ethernet:ntop(queue.external_interface.mac)}) if mirror then local Tap = require("apps.tap.tap").Tap local ifname = mirror config.app(c, 'tap', Tap, ifname) config.app(c, v4v6, V4V6, { mirror = true }) config.link(c, v4v6..'.mirror -> tap.input') else config.app(c, v4v6, V4V6) end config.link(c, 'nic.'..device.tx..' -> '..v4v6..'.input') config.link(c, v4v6..'.output -> nic.'..device.rx) link_source(c, v4v6..'.v4', v4v6..'.v6') link_sink(c, v4v6..'.v4', v4v6..'.v6') else config.app(c, v4_nic_name, driver, { pciaddr = pciaddr, vmdq=true, -- Needed to enable MAC filtering/stamping. rxq=id, txq=id, poolnum=0, vlan=queue.external_interface.vlan_tag, ring_buffer_size=args.ring_buffer_size, macaddr = ethernet:ntop(queue.external_interface.mac)}) config.app(c, v6_nic_name, driver, { pciaddr = pciaddr, vmdq=true, -- Needed to enable MAC filtering/stamping. rxq=id, txq=id, poolnum=1, vlan=queue.internal_interface.vlan_tag, ring_buffer_size=args.ring_buffer_size, macaddr = ethernet:ntop(queue.internal_interface.mac)}) link_source(c, v4_nic_name..'.'..device.tx, v6_nic_name..'.'..device.tx) link_sink(c, v4_nic_name..'.'..device.rx, v6_nic_name..'.'..device.rx) end end function load_virt(c, conf, v4_nic_name, v6_nic_name) local v4_pci, id, queue = lwutil.parse_instance(conf) local v6_pci = queue.external_device.device lwaftr_app(c, conf, device) validate_pci_devices({v4_pci, v6_pci}) config.app(c, v4_nic_name, VirtioNet, { pciaddr=v4_pci, vlan=queue.external_interface.vlan_tag, macaddr=ethernet:ntop(queue.external_interface.mac)}) config.app(c, v6_nic_name, VirtioNet, { pciaddr=v6_pci, vlan=queue.internal_interface.vlan_tag, macaddr = ethernet:ntop(queue.internal_interface.mac)}) link_source(c, v4_nic_name..'.tx', v6_nic_name..'.tx') link_sink(c, v4_nic_name..'.rx', v6_nic_name..'.rx') end function load_bench(c, conf, v4_pcap, v6_pcap, v4_sink, v6_sink) local device, id, queue = lwutil.parse_instance(conf) lwaftr_app(c, conf, device) config.app(c, "capturev4", pcap.PcapReader, v4_pcap) config.app(c, "capturev6", pcap.PcapReader, v6_pcap) config.app(c, "repeaterv4", basic_apps.Repeater) config.app(c, "repeaterv6", basic_apps.Repeater) if queue.external_interface.vlan_tag then config.app(c, "untagv4", vlan.Untagger, { tag=queue.external_interface.vlan_tag }) end if queue.internal_interface.vlan_tag then config.app(c, "untagv6", vlan.Untagger, { tag=queue.internal_interface.vlan_tag }) end config.app(c, v4_sink, basic_apps.Sink) config.app(c, v6_sink, basic_apps.Sink) config.link(c, "capturev4.output -> repeaterv4.input") config.link(c, "capturev6.output -> repeaterv6.input") local v4_src, v6_src = 'repeaterv4.output', 'repeaterv6.output' if queue.external_interface.vlan_tag then config.link(c, v4_src.." -> untagv4.input") v4_src = "untagv4.output" end if queue.internal_interface.vlan_tag then config.link(c, v6_src.." -> untagv6.input") v6_src = "untagv6.output" end link_source(c, v4_src, v6_src) link_sink(c, v4_sink..'.input', v6_sink..'.input') end function load_check_on_a_stick (c, conf, inv4_pcap, inv6_pcap, outv4_pcap, outv6_pcap) local device, id, queue = lwutil.parse_instance(conf) lwaftr_app(c, conf, device) config.app(c, "capturev4", pcap.PcapReader, inv4_pcap) config.app(c, "capturev6", pcap.PcapReader, inv6_pcap) config.app(c, "output_filev4", pcap.PcapWriter, outv4_pcap) config.app(c, "output_filev6", pcap.PcapWriter, outv6_pcap) if queue.external_interface.vlan_tag then config.app(c, "untagv4", vlan.Untagger, { tag=queue.external_interface.vlan_tag }) config.app(c, "tagv4", vlan.Tagger, { tag=queue.external_interface.vlan_tag }) end if queue.internal_interface.vlan_tag then config.app(c, "untagv6", vlan.Untagger, { tag=queue.internal_interface.vlan_tag }) config.app(c, "tagv6", vlan.Tagger, { tag=queue.internal_interface.vlan_tag }) end config.app(c, 'v4v6', V4V6) config.app(c, 'splitter', V4V6) config.app(c, 'join', basic_apps.Join) local sources = { "v4v6.v4", "v4v6.v6" } local sinks = { "v4v6.v4", "v4v6.v6" } if queue.external_interface.vlan_tag then config.link(c, "capturev4.output -> untagv4.input") config.link(c, "capturev6.output -> untagv6.input") config.link(c, "untagv4.output -> join.in1") config.link(c, "untagv6.output -> join.in2") config.link(c, "join.output -> v4v6.input") config.link(c, "v4v6.output -> splitter.input") config.link(c, "splitter.v4 -> tagv4.input") config.link(c, "splitter.v6 -> tagv6.input") config.link(c, "tagv4.output -> output_filev4.input") config.link(c, "tagv6.output -> output_filev6.input") else config.link(c, "capturev4.output -> join.in1") config.link(c, "capturev6.output -> join.in2") config.link(c, "join.output -> v4v6.input") config.link(c, "v4v6.output -> splitter.input") config.link(c, "splitter.v4 -> output_filev4.input") config.link(c, "splitter.v6 -> output_filev6.input") end link_source(c, unpack(sources)) link_sink(c, unpack(sinks)) end function load_check(c, conf, inv4_pcap, inv6_pcap, outv4_pcap, outv6_pcap) local device, id, queue = lwutil.parse_instance(conf) lwaftr_app(c, conf, device) config.app(c, "capturev4", pcap.PcapReader, inv4_pcap) config.app(c, "capturev6", pcap.PcapReader, inv6_pcap) config.app(c, "output_filev4", pcap.PcapWriter, outv4_pcap) config.app(c, "output_filev6", pcap.PcapWriter, outv6_pcap) if queue.external_interface.vlan_tag then config.app(c, "untagv4", vlan.Untagger, { tag=queue.external_interface.vlan_tag }) config.app(c, "tagv4", vlan.Tagger, { tag=queue.external_interface.vlan_tag }) end if queue.internal_interface.vlan_tag then config.app(c, "untagv6", vlan.Untagger, { tag=queue.internal_interface.vlan_tag }) config.app(c, "tagv6", vlan.Tagger, { tag=queue.internal_interface.vlan_tag }) end local sources = { "capturev4.output", "capturev6.output" } local sinks = { "output_filev4.input", "output_filev6.input" } if queue.external_interface.vlan_tag then sources = { "untagv4.output", "untagv6.output" } sinks = { "tagv4.input", "tagv6.input" } config.link(c, "capturev4.output -> untagv4.input") config.link(c, "capturev6.output -> untagv6.input") config.link(c, "tagv4.output -> output_filev4.input") config.link(c, "tagv6.output -> output_filev6.input") end link_source(c, unpack(sources)) link_sink(c, unpack(sinks)) end function load_soak_test(c, conf, inv4_pcap, inv6_pcap) local device, id, queue = lwutil.parse_instance(conf) lwaftr_app(c, conf, device) config.app(c, "capturev4", pcap.PcapReader, inv4_pcap) config.app(c, "capturev6", pcap.PcapReader, inv6_pcap) config.app(c, "loop_v4", basic_apps.Repeater) config.app(c, "loop_v6", basic_apps.Repeater) config.app(c, "sink", basic_apps.Sink) if queue.external_interface.vlan_tag then config.app(c, "untagv4", vlan.Untagger, { tag=queue.external_interface.vlan_tag }) config.app(c, "tagv4", vlan.Tagger, { tag=queue.external_interface.vlan_tag }) end if queue.internal_interface.vlan_tag then config.app(c, "untagv6", vlan.Untagger, { tag=queue.internal_interface.vlan_tag }) config.app(c, "tagv6", vlan.Tagger, { tag=queue.internal_interface.vlan_tag }) end local sources = { "loop_v4.output", "loop_v6.output" } local sinks = { "sink.v4", "sink.v6" } config.link(c, "capturev4.output -> loop_v4.input") config.link(c, "capturev6.output -> loop_v6.input") if queue.external_interface.vlan_tag then sources = { "untagv4.output", "untagv6.output" } sinks = { "tagv4.input", "tagv6.input" } config.link(c, "loop_v4.output -> untagv4.input") config.link(c, "loop_v6.output -> untagv6.input") config.link(c, "tagv4.output -> sink.v4") config.link(c, "tagv6.output -> sink.v6") end link_source(c, unpack(sources)) link_sink(c, unpack(sinks)) end function load_soak_test_on_a_stick (c, conf, inv4_pcap, inv6_pcap) local device, id, queue = lwutil.parse_instance(conf) lwaftr_app(c, conf, device) config.app(c, "capturev4", pcap.PcapReader, inv4_pcap) config.app(c, "capturev6", pcap.PcapReader, inv6_pcap) config.app(c, "loop_v4", basic_apps.Repeater) config.app(c, "loop_v6", basic_apps.Repeater) config.app(c, "sink", basic_apps.Sink) if queue.external_interface.vlan_tag then config.app(c, "untagv4", vlan.Untagger, { tag=queue.external_interface.vlan_tag }) config.app(c, "tagv4", vlan.Tagger, { tag=queue.external_interface.vlan_tag }) end if queue.internal_interface.vlan_tag then config.app(c, "untagv6", vlan.Untagger, { tag=queue.internal_interface.vlan_tag }) config.app(c, "tagv6", vlan.Tagger, { tag=queue.internal_interface.vlan_tag }) end config.app(c, 'v4v6', V4V6) config.app(c, 'splitter', V4V6) config.app(c, 'join', basic_apps.Join) local sources = { "v4v6.v4", "v4v6.v6" } local sinks = { "v4v6.v4", "v4v6.v6" } config.link(c, "capturev4.output -> loop_v4.input") config.link(c, "capturev6.output -> loop_v6.input") if queue.external_interface.vlan_tag then config.link(c, "loop_v4.output -> untagv4.input") config.link(c, "loop_v6.output -> untagv6.input") config.link(c, "untagv4.output -> join.in1") config.link(c, "untagv6.output -> join.in2") config.link(c, "join.output -> v4v6.input") config.link(c, "v4v6.output -> splitter.input") config.link(c, "splitter.v4 -> tagv4.input") config.link(c, "splitter.v6 -> tagv6.input") config.link(c, "tagv4.output -> sink.in1") config.link(c, "tagv6.output -> sink.in2") else config.link(c, "loop_v4.output -> join.in1") config.link(c, "loop_v6.output -> join.in2") config.link(c, "join.output -> v4v6.input") config.link(c, "v4v6.output -> splitter.input") config.link(c, "splitter.v4 -> sink.in1") config.link(c, "splitter.v6 -> sink.in2") end link_source(c, unpack(sources)) link_sink(c, unpack(sinks)) end -- Produces configuration for each worker. Each queue on each device -- will get its own worker process. local function compute_worker_configs(conf) local ret = {} local copier = binary.config_copier_for_schema_by_name('snabb-softwire-v2') local make_copy = copier(conf) for device, queues in pairs(conf.softwire_config.instance) do for k, _ in cltable.pairs(queues.queue) do local worker_id = string.format('%s/%s', device, k.id) local worker_config = make_copy() local instance = worker_config.softwire_config.instance for other_device, queues in pairs(conf.softwire_config.instance) do if other_device ~= device then instance[other_device] = nil else for other_k, _ in cltable.pairs(queues.queue) do if other_k.id ~= k.id then instance[device].queue[other_k] = nil end end end end ret[worker_id] = worker_config end end return ret end function ptree_manager(f, conf, manager_opts) -- Claim the name if one is defined. local function switch_names(config) local currentname = engine.program_name local name = config.softwire_config.name -- Don't do anything if the name isn't set. if name == nil then return end local success, err = pcall(engine.claim_name, name) if success == false then -- Restore the previous name. config.softwire_config.name = currentname assert(success, err) end end local function setup_fn(conf) switch_names(conf) local worker_app_graphs = {} for worker_id, worker_config in pairs(compute_worker_configs(conf)) do local app_graph = config.new() worker_config.alarm_notification = true f(app_graph, worker_config) worker_app_graphs[worker_id] = app_graph end return worker_app_graphs end local initargs = { setup_fn = setup_fn, initial_configuration = conf, schema_name = 'snabb-softwire-v2', default_schema = 'ietf-softwire-br', -- log_level="DEBUG" } for k, v in pairs(manager_opts or {}) do assert(not initargs[k]) initargs[k] = v end return manager.new_manager(initargs) end
local function new(name, ...) -- @example -- local A = new(a) -- local B = new(b) -- local C = new(c) -- local t = { a = A, b = B, c = C } -- === -- @example -- local t = new(a, b, c) -- multiple constructor definition {{{ local args = {...} if #args > 0 then local ret = {} ret[name] = new(name) for _, name_ in ipairs(args) do ret[name_] = new(name_) end return ret end --- }}} name = name or '(annon)' name = name .. ":" .. tostring({}):match("0x[0-f]+") return setmetatable({name = name}, { __call = function(_, ...) local content = {...} -- salting content.name = name return setmetatable(content, { __pow = function(l, r) return l.name == r.name end }) end }) end local match = function(e, t) -- e = adt -- t = {{adt, fun}, ...} for _, tup in ipairs(t) do if tup[1] ^ e then return tup[2](table.unpack(e)) end end return error('pattern matching failed') end return { new = new, match = match }
--[[ MIT License Copyright (c) 2022 Michael Wiesendanger Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ]]-- -- luacheck: globals STANDARD_TEXT_FONT local mod = rgpvpw local me = {} mod.zoneMenu = me me.tag = "ZoneMenu" -- track whether the menu was already built local builtMenu = false --[[ Build the ui for the general menu @param {table} frame The addon configuration frame to attach to ]]-- function me.BuildUi(frame) if builtMenu then return end me.BuildTitle(frame) me.BuildLabel( frame, {"TOPLEFT", 20, -50}, rgpvpw.L["label_arenas"] ) me.BuildZoneOption( frame, RGPVPW_CONSTANTS.ELEMENT_ZONE_NAGRAND_ARENA_CHECK_BOX, {"TOPLEFT", 20, -80}, rgpvpw.L["arena_nagrand_arena"], RGPVPW_ZONE.ZONE_ARENA_NAGRAND_ARENA ) me.BuildZoneOption( frame, RGPVPW_CONSTANTS.ELEMENT_ZONE_RUINS_OF_LORDAERON_CHECK_BOX, {"TOPLEFT", 20, -120}, rgpvpw.L["arena_ruins_of_lordaeron"], RGPVPW_ZONE.ZONE_ARENA_RUINS_OF_LORDAERON ) me.BuildZoneOption( frame, RGPVPW_CONSTANTS.ELEMENT_ZONE_BLADES_EDGE_ARENA_CHECK_BOX, {"TOPLEFT", 20, -160}, rgpvpw.L["arena_bladges_edge_arena"], RGPVPW_ZONE.ZONE_ARENA_BLADES_EDGE_ARENA ) me.BuildLabel( frame, {"TOPLEFT", 20, -200}, rgpvpw.L["label_battlegrounds"] ) me.BuildZoneOption( frame, RGPVPW_CONSTANTS.ELEMENT_ZONE_ALTERAC_VALLEY, {"TOPLEFT", 20, -230}, rgpvpw.L["battleground_alterac_valley"], RGPVPW_ZONE.ZONE_BATTLEGROUND_ALTERAC_VALLEY ) me.BuildZoneOption( frame, RGPVPW_CONSTANTS.ELEMENT_ZONE_EYE_OF_THE_STORM, {"TOPLEFT", 20, -270}, rgpvpw.L["battleground_eye_of_the_storm"], RGPVPW_ZONE.ZONE_BATTLEGROUND_EYE_OF_THE_STORM ) me.BuildZoneOption( frame, RGPVPW_CONSTANTS.ELEMENT_ZONE_ARATHI_BASIN, {"TOPLEFT", 20, -310}, rgpvpw.L["battleground_arathi_basin"], RGPVPW_ZONE.ZONE_BATTLEGROUND_ARATHI_BASIN ) me.BuildZoneOption( frame, RGPVPW_CONSTANTS.ELEMENT_ZONE_WARSONG_GULCH, {"TOPLEFT", 20, -350}, rgpvpw.L["battleground_warsong_gulch"], RGPVPW_ZONE.ZONE_BATTLEGROUND_WARSONG_GULCH ) me.BuildLabel( frame, {"TOPLEFT", 20, -390}, rgpvpw.L["label_world"] ) me.BuildZoneOption( frame, RGPVPW_CONSTANTS.ELEMENT_ZONE_SHATTRATH, {"TOPLEFT", 20, -420}, rgpvpw.L["world_shattrath"], RGPVPW_ZONE.ZONE_WORLD_SHATTRATH ) builtMenu = true end --[[ Build the title for the general menu @param {table} parentFrame The addon configuration frame to attach to ]]-- function me.BuildTitle(parentFrame) local titleFontString = parentFrame:CreateFontString(RGPVPW_CONSTANTS.ELEMENT_ZONE_TITLE, "OVERLAY") titleFontString:SetFont(STANDARD_TEXT_FONT, 20) titleFontString:SetPoint("TOP", 0, -20) titleFontString:SetSize(parentFrame:GetWidth(), 20) titleFontString:SetText(rgpvpw.L["zone_title"]) end --[[ @param {table} frame @param {table} position @param {string} text ]]-- function me.BuildLabel(frame, position, text) local zoneLabel = frame:CreateFontString( nil, "OVERLAY" ) zoneLabel:SetPoint(unpack(position)) zoneLabel:SetFont(STANDARD_TEXT_FONT, 20) zoneLabel:SetTextColor(1, 1, 1) zoneLabel:SetText(text) end --[[ Create a zone checkbox and load its state @param {table} parentFrame @param {string} frameName @param {table} position @param {string} text @param {number} zone A zone from RGPVPW_ZONE ]]-- function me.BuildZoneOption(parentFrame, frameName, position, text, zone) local zoneOption = mod.guiHelper.CreateCheckBox( frameName, parentFrame, position, function(self) me.OnClickCallback(self) end, function(self) me.OnShowCallback(self) end, text ) zoneOption.value = zone -- set the map or instance id --[[ After creating a new zoneOption show and manually invoke its OnShowCallback to load the initial state ]]-- zoneOption:Show() me.OnShowCallback(zoneOption) end --[[ Update the configuration state of the option. Invoked via onClick event. @param {table} self ]]-- function me.OnClickCallback(self) -- change state local enabled = self:GetChecked() if enabled then mod.configuration.EnableZone(self.value) else mod.configuration.DisableZone(self.value) end end --[[ Load the configuration state of the option. Invoked manually or via onShow event. @param {table} self ]]-- function me.OnShowCallback(self) -- initial state local isZoneEnabled = mod.configuration.IsZoneEnabled(self.value) if isZoneEnabled then self:SetChecked(true) else self:SetChecked(false) end end
local Age = Class(function(self, inst) self.saved_age = 0 self.spawntime = GetTime() end) function Age:GetAge() return self.saved_age + (GetTime() - self.spawntime) end function Age:OnSave() return { age = self:GetAge() } end function Age:GetDebugString() if self:GetAge() > .5*TUNING.TOTAL_DAY_TIME then return string.format("%2.2f days", self:GetAge() / TUNING.TOTAL_DAY_TIME) else return string.format("%2.2f s", self:GetAge()) end end function Age:LongUpdate(dt) self.saved_age = self.saved_age + dt end function Age:OnLoad(data) if data and data.age then self.saved_age = data.age end end return Age
--------------------------------------------------------------------------------- -- -- scene.lua -- --------------------------------------------------------------------------------- local sceneName = ... local composer = require( "composer" ) -- Load scene with same root filename as this file local scene = composer.newScene( sceneName ) --------------------------------------------------------------------------------- local nextSceneButton function scene:create( event ) local sceneGroup = self.view __brightness.getBright() print("INITIAL BRIGHTNESS LEVEL SET TO = " .. __initialBrightLevel) -- Called when the scene's view does not exist -- -- INSERT code here to initialize the scene -- e.g. add display objects to 'sceneGroup', add touch listeners, etc local contentText = "" if ( tonumber(__initialBrightLevel) < 0 ) then contentText = "brightness.getBright() -- Your current brightness is using phone settings, because you haven't modified it yet" else contentText = "brightness.getBright() -- Your current brightness level is : " .. __initialBrightLevel * 100 .. "%" end text1 = display.newText( sceneGroup, contentText, display.contentCenterX, display.contentCenterY, display.actualContentWidth-40, 0, fRegular ,20 ) text1:setFillColor(0, 0, 0, 1) end function scene:show( event ) local sceneGroup = self.view local phase = event.phase if phase == "will" then -- Called when the scene is still off screen and is about to move on screen local title = self:getObjectByName( "Title" ) title.x = display.contentWidth / 2 title.y = display.contentHeight / 2 title.size = display.contentWidth / 10 local goToScene2Btn = self:getObjectByName( "GoToScene2Btn" ) goToScene2Btn.x = display.contentWidth - 95 goToScene2Btn.y = display.contentHeight - 35 local goToScene2Text = self:getObjectByName( "GoToScene2Text" ) goToScene2Text.x = display.contentWidth - 92 goToScene2Text.y = display.contentHeight - 35 elseif phase == "did" then -- Called when the scene is now on screen -- -- INSERT code here to make the scene come alive -- e.g. start timers, begin animation, play audio, etc -- we obtain the object by id from the scene's object hierarchy nextSceneButton = self:getObjectByName( "GoToScene2Btn" ) if nextSceneButton then -- touch listener for the button function nextSceneButton:touch ( event ) local phase = event.phase if "ended" == phase then composer.removeScene("scene1") composer.gotoScene( "scene2", { effect = "fade", time = 300 } ) end end -- add the touch event listener to the button nextSceneButton:addEventListener( "touch", nextSceneButton ) end end end function scene:hide( event ) local sceneGroup = self.view local phase = event.phase if event.phase == "will" then -- Called when the scene is on screen and is about to move off screen -- -- INSERT code here to pause the scene -- e.g. stop timers, stop animation, unload sounds, etc.) elseif phase == "did" then -- Called when the scene is now off screen if nextSceneButton then nextSceneButton:removeEventListener( "touch", nextSceneButton ) end end end function scene:destroy( event ) local sceneGroup = self.view -- Called prior to the removal of scene's "view" (sceneGroup) -- -- INSERT code here to cleanup the scene -- e.g. remove display objects, remove touch listeners, save state, etc end --------------------------------------------------------------------------------- -- Listener setup scene:addEventListener( "create", scene ) scene:addEventListener( "show", scene ) scene:addEventListener( "hide", scene ) scene:addEventListener( "destroy", scene ) --------------------------------------------------------------------------------- return scene