content
stringlengths
5
1.05M
--[[ AFK Resource - Client by: standardcombo v1.0 --]] local AFK_RES_SERVER = script:GetCustomProperty("AFKResourceServer"):WaitForObject() local PROGRESS_BAR = script:GetCustomProperty("CustomProgressBar"):WaitForObject() local UI_TEXT = script:GetCustomProperty("UITextBox"):WaitForObject() local RESOURCE_NAME = AFK_RES_SERVER:GetCustomProperty("ResourceName") local SECONDS_TO_WAIT = AFK_RES_SERVER:GetCustomProperty("SecondsToWait") local player = Game.GetLocalPlayer() local duration = SECONDS_TO_WAIT - 1 local elapsedTime = 0 function Tick(deltaTime) local percent = 0 if duration > 0 then elapsedTime = elapsedTime + deltaTime percent = CoreMath.Clamp(elapsedTime / duration) end PROGRESS_BAR:SetCustomProperty("Percent", percent) end function UpdateLabel(value) value = CoreMath.Round(value) if value <= 0 then UI_TEXT.text = tostring(value) return end -- local str = nil -- while value > 0 do -- local upto3digits = value % 1000 -- value = math.floor(value / 1000) -- if str then -- str = upto3digits .. "," .. str -- else -- str = tostring(upto3digits) -- end -- end -- Format the number with commas (i.e. 1,123) UI_TEXT.text = tostring(value):reverse():gsub("%d%d%d", "%1,"):reverse():gsub("^,", "") end function OnResourceChanged(player, resName) if resName ~= RESOURCE_NAME then return end local value = player:GetResource(resName) UpdateLabel(value) end player.resourceChangedEvent:Connect(OnResourceChanged) OnResourceChanged(player, RESOURCE_NAME) Events.Connect("AfkUpdate", function(waitTime, resValue) duration = waitTime elapsedTime = 0 UpdateLabel(resValue) end)
require("ItemTweaker_Copy_CC"); --SWATPACKREDUX --Clothing TweakItem("Base.SWATPad","DisplayCategory","ClothN"); TweakItem("Base.SwatNeck","DisplayCategory","ClothN"); TweakItem("Base.Hat_SwatGasMask","DisplayCategory","ClothN"); TweakItem("Base.SwatElbowPads","DisplayCategory","ClothN"); TweakItem("Base.SwatKneePads","DisplayCategory","ClothN"); TweakItem("Base.Trousers_Swat","DisplayCategory","ClothN"); TweakItem("Base.Shoes_RiotBoots","DisplayCategory","ClothN"); TweakItem("Base.Shoes_SwatBoots","DisplayCategory","ClothN"); TweakItem("Base.Gloves_SwatGloves","DisplayCategory","ClothN"); TweakItem("Base.Gloves_RiotGloves","DisplayCategory","ClothN"); TweakItem("Base.Hat_SwatHelmet","DisplayCategory","ClothN"); TweakItem("Base.Vest_BulletSwat","DisplayCategory","ClothN"); TweakItem("Base.Jacket_Swat","DisplayCategory","ClothN"); TweakItem("Base.Glasses_SwatGoggles","DisplayCategory","ClothN"); TweakItem("Base.Hat_Balaclava_Swat","DisplayCategory","ClothN"); TweakItem("Base.Hat_PoliceRiotHelmet","DisplayCategory","ClothN"); TweakItem("Base.Hat_SWATRiotHelmet","DisplayCategory","ClothN"); TweakItem("Base.Hat_SWATRiotHelmet2","DisplayCategory","ClothN"); TweakItem("Base.RiotArmorSuit","DisplayCategory","ClothN"); TweakItem("Base.Hat_Antibombhelmet","DisplayCategory","ClothN"); TweakItem("Base.AntibombSuit","DisplayCategory","ClothN"); TweakItem("Base.AntibombSuitP2","DisplayCategory","ClothN"); TweakItem("Base.SWATPouch","DisplayCategory","ClothA"); TweakItem("Base.Bag_BigSwatBag","DisplayCategory","ClothA"); TweakItem("Base.Bag_PoliceBag","DisplayCategory","ClothA"); --Weapons TweakItem("Base.RubberShells","DisplayCategory","WepAmmo"); TweakItem("Base.RubberShellsBox","DisplayCategory","WepAmmo"); TweakItem("Base.RiotShieldSwat","DisplayCategory","WepShield"); TweakItem("Base.RiotShieldPolice","DisplayCategory","WepShield"); TweakItem("Base.RiotShotgun","DisplayCategory","WepFire"); TweakItem("Base.Co2ShortRiotShotgun","DisplayCategory","WepFire"); TweakItem("Base.SwatMP5","DisplayCategory","WepFire"); TweakItem("Base.9mmMp5Clip","DisplayCategory","WepAmmo"); TweakItem("Base.SwatStunGrenade","DisplayCategory","WepBomb"); TweakItem("Base.SwatFragGrenade","DisplayCategory","WepBomb"); TweakItem("Base.SwatSmokeGrenade","DisplayCategory","WepBomb");
function balance(word) local length = string.len(word) local word = string.upper(word) -- If Word has no characters or 2 characters then not balanced if length == 0 or length == 2 then print(word .. " DOES NOT BALANCE") return end -- If Word has one character then is balanced by itself if length == 1 then print(word .. " - 0") return end for center = 2, length - 1, 1 do local left = 0 for l = 1, center -1, 1 do left = left + (center - l) * (string.byte(word:sub(l,l)) - (string.byte('A') - 1)) end local right = 0 for r = center + 1, length, 1 do right = right + (r - center) * (string.byte(word:sub(r,r)) - (string.byte('A') - 1)) end if left == right then print(word:sub(1, center - 1) .. " " .. word:sub(center, center) .. " " .. word:sub(center + 1, length) .. " - " .. left) return end end -- no match print(word .. " DOES NOT BALANCE") end balance("CONSUBSTANTIATION") balance("WRONGHEADED") balance("UNINTELLIGIBILITY") balance("SUPERGLUE")
local utils = require('core.utils') utils.bootstrap() require('core.options') require('core.autocmd') require('core.plugins') require('core.mappings') local compiled_ok, _ = pcall(require, 'packer_compiled') if compiled_ok then require('packer_compiled') end
Citizen.CreateThread(function() -- Pillbox hospital: RequestIpl("rc12b_hospitalinterior") RequestIpl("rc12b_destroyed") end)
stage.group.New('menu',{},"Spell show",{lifeleft=0,power=400,faith=50000,bomb=0},false) stage.group.AddStage('Spell show','Spell show@Spell show',{lifeleft=0,power=400,faith=50000,bomb=0},false) stage.group.DefStageFunc('Spell show@Spell show','init',function(self) _init_item(self) --- New(mask_fader,'open') New(reimu_player) task.New(self,function() PlaySound('tan00',0.1,0) task._Wait(300) end) task.New(self,function() while coroutine.status(self.task[1])~='dead' do task.Wait() end New(mask_fader,'close') _stop_music() task.Wait(30) stage.group.FinishStage() end) end)
local ok, lua_snip = pcall(require, 'luasnip') if not ok then vim.cmd('echom "plugin error: luasnip is missing"') return end require('user/plugins/lua-snip/mappings') local js_snips = require('user/plugins/lua-snip/js-snips') -- local function_node = plugin.function_mode; lua_snip.config.set_config { history = true, -- Update more often, :h events for more info. updateevents = "TextChanged,TextChangedI", -- ext_opts = { -- [types.choiceNode] = { -- active = { -- virt_text = { { "choiceNode", "Comment" } }, -- }, -- }, -- }, -- treesitter-hl has 100, use something higher (default is 200). ext_base_prio = 300, -- minimal increase in priority. ext_prio_increase = 1, enable_autosnippets = true, } lua_snip.snippets = { javascript = js_snips, javascriptreact = js_snips, typescript = js_snips, typescriptreact = js_snips, }
function Client_SaveConfigureUI(alert) Mod.Settings.CostPerNeutralArmy = numberInputField.GetValue(); end
-------------- -- Draconis -- -------------- draconis = {} local path = minetest.get_modpath("draconis") -- Global Tables -- local storage = dofile(path.."/storage.lua") draconis.dragons = storage.dragons draconis.bonded_dragons = storage.bonded_dragons draconis.aux_key_setting = storage.aux_key_setting draconis.attack_blacklist = storage.attack_blacklist draconis.sounds = { wood = {}, stone = {}, dirt = {} } if minetest.get_modpath("default") then if default.node_sound_wood_defaults then draconis.sounds.wood = default.node_sound_wood_defaults() end if default.node_sound_stone_defaults then draconis.sounds.stone = default.node_sound_stone_defaults() end if default.node_sound_dirt_defaults then draconis.sounds.dirt = default.node_sound_dirt_defaults() end end draconis.colors_fire = { ["black"] = "393939", ["bronze"] = "ff6d00", ["gold"] = "ffa300", ["green"] = "0abc00", ["red"] = "b10000" } draconis.colors_ice = { ["light_blue"] = "9df8ff", ["sapphire"] = "001fea", ["silver"] = "c5e4ed", ["slate"] = "4c646b", ["white"] = "e4e4e4" } draconis.global_nodes = {} minetest.register_on_mods_loaded(function() for name, def in pairs(minetest.registered_nodes) do if not draconis.global_nodes["flame"] and (name:find("flame") or name:find("fire")) and def.drawtype == "firelike" and minetest.get_item_group(name, "igniter") > 0 then draconis.global_nodes["flame"] = name elseif not draconis.global_nodes["ice"] and name:find(":ice") and minetest.get_item_group(name, "slippery") > 0 then draconis.global_nodes["ice"] = name end end end) local clear_objects = minetest.clear_objects function minetest.clear_objects(options) clear_objects(options) draconis.dragons = {} draconis.bonded_dragons = {} end -- Load Files -- dofile(path.."/api/api.lua") dofile(path.."/api/mount.lua") dofile(path.."/api/behaviors.lua") dofile(path.."/mobs/ice_dragon.lua") dofile(path.."/mobs/fire_dragon.lua") dofile(path.."/nodes.lua") dofile(path.."/craftitems.lua") if minetest.get_modpath("3d_armor") then dofile(path.."/armor.lua") end -- Spawning -- draconis.cold_biomes = {} draconis.warm_biomes = {} minetest.register_on_mods_loaded(function() for name in pairs(minetest.registered_biomes) do local biome = minetest.registered_biomes[name] local heat = biome.heat_point or 0 if heat < 40 then table.insert(draconis.cold_biomes, name) else table.insert(draconis.warm_biomes, name) end end end) dofile(path.."/mapgen.lua") local simple_spawning = minetest.settings:get_bool("simple_spawning") or false local spawn_rate = tonumber(minetest.settings:get("simple_spawn_rate")) or 512 if simple_spawning then creatura.register_mob_spawn("draconis:ice_dragon", { chance = spawn_rate, min_group = 1, max_group = 1, biomes = draconis.cold_biomes, nodes = {"air"} }) creatura.register_mob_spawn("draconis:fire_dragon", { chance = spawn_rate, min_group = 1, max_group = 1, biomes = draconis.warm_biomes, nodes = {"air"} }) end -- Aliases -- minetest.register_alias("draconis:dracolily_fire", "air") minetest.register_alias("draconis:dracolily_ice", "air") minetest.register_alias("draconis:blood_fire_dragon", "") minetest.register_alias("draconis:blood_ice_dragon", "") minetest.register_alias("draconis:manuscript", "") for color in pairs(draconis.colors_ice) do minetest.register_alias("draconis:egg_ice_dragon_" .. color, "draconis:egg_ice_" .. color) end for color in pairs(draconis.colors_fire) do minetest.register_alias("draconis:egg_fire_dragon_" .. color, "draconis:egg_fire_" .. color) end minetest.register_entity("draconis:ice_eyes", { on_activate = function(self) self.object:remove() end }) minetest.register_entity("draconis:fire_eyes", { on_activate = function(self) self.object:remove() end }) minetest.register_node("draconis:spawn_node", { drawtype = "airlike" }) minetest.register_abm({ label = "Fix Spawn Nodes", nodenames = {"draconis:spawn_node"}, interval = 10, chance = 1, action = function(pos) minetest.swap_node(pos, {name = "creatura:spawn_node"}) end, })
dofile(reaper.GetResourcePath().."/UserPlugins/ultraschall_api.lua") -- Examplecode on how to toggle bypass with FXStateChunks in TakeFX by Meo Mespotine 23rd of January 2020 bypasstoggle=1 -- set it to 1 to bypass, set it to 0 to unbypass FX of Takes -- the following order is essential. If you leave out one of them or mix them up...you're out of luck -- first, you need get the StateChunk MediaItem = reaper.GetMediaItem(0, 0) B0, ItemStateChunk = reaper.GetItemStateChunk(MediaItem, "", false) -- get the FXStateChunk. Before that, you cannot do anything with the FXStateChunks! FXStateChunk = ultraschall.GetFXStateChunk(ItemStateChunk, 1) -- let's manipulate it to make all FX bypassed FXStateChunk = string.gsub(FXStateChunk, "BYPASS.-\n", "BYPASS "..bypasstoggle.." 0 0\n") -- after the FXStateChunk is manipulated, you can set it back into the ItemStateChunk C, ItemStateChunk = ultraschall.SetFXStateChunk(ItemStateChunk, FXStateChunk, 1) -- now you can set the statechunk into the MediaItem again Result = reaper.SetItemStateChunk(MediaItem, ItemStateChunk, false) -- update Arrangeview, so any changes in MediaItem-takes are shown reaper.UpdateArrange()
local obj = {} obj.__index = obj obj.name = "Resize" function obj:enlarge(window, screen) if (window.x - 10) >= screen.x then window.x = window.x - 10 end if (window.y - 10) >= screen.y then window.y = window.y - 10 end window.w = window.w + 20 window.h = window.h + 20 return window end function obj:fullScreen(window, screen) window.x = screen.x window.y = screen.y window.w = screen.w window.h = screen.h return window end function obj:center(window, screen) window.x = ((screen.w - window.w) // 2) + screen.x window.y = ((screen.h - window.h) // 2) + screen.y return window end function obj:shrink(window, screen) window.x = window.x + 10 window.y = window.y + 10 window.w = window.w - 20 window.h = window.h - 20 return window end function obj:topHalf(window, screen) window.y = screen.y window.h = screen.h // 2 return window end function obj:topQuarter(window, screen) window.y = screen.y window.h = screen.h // 4 return window end function obj:topThreeQuarters(window, screen) window.y = screen.y window.h = (screen.h // 4) * 3 return window end function obj:topThird(window, screen) window.y = screen.y window.h = screen.h // 3 return window end function obj:topTwoThirds(window, screen) window.y = screen.y window.h = (screen.h // 3) * 2 return window end function obj:topFull(window, screen) window.y = screen.y window.h = screen.h return window end function obj:bottomHalf(window, screen) window.y = (screen.h // 2) + screen.y window.h = screen.h // 2 return window end function obj:bottomQuarter(window, screen) window.y = ((screen.h // 4) * 3) + screen.y window.h = screen.h // 4 return window end function obj:bottomThreeQuarters(window, screen) window.y = (screen.h // 4) + screen.y window.h = (screen.h // 4) * 3 return window end function obj:bottomThird(window, screen) window.y = ((screen.h // 3) * 2) + screen.y window.h = screen.h // 3 return window end function obj:bottomTwoThirds(window, screen) window.y = (screen.h // 3) + screen.y window.h = (screen.h // 3) * 2 return window end function obj:bottomFull(window, screen) window.y = screen.y window.h = screen.h return window end function obj:leftHalf(window, screen) window.x = screen.x window.w = screen.w // 2 return window end function obj:leftQuarter(window, screen) window.x = screen.x window.w = screen.w // 4 return window end function obj:leftThreeQuarters(window, screen) window.x = screen.x window.w = (screen.w // 4) * 3 return window end function obj:leftThird(window, screen) window.x = screen.x window.w = screen.w // 3 return window end function obj:leftTwoThirds(window, screen) window.x = screen.x window.w = (screen.w // 3) * 2 return window end function obj:leftFull(window, screen) window.x = screen.x window.w = screen.w return window end function obj:rightHalf(window, screen) window.x = (screen.w // 2) + screen.x window.w = screen.w // 2 return window end function obj:rightQuarter(window, screen) window.x = (screen.w // 4) * 3 + screen.x window.w = screen.w // 4 return window end function obj:rightThreeQuarters(window, screen) window.x = (screen.w // 4) + screen.x window.w = (screen.w // 4) * 3 return window end function obj:rightThird(window, screen) window.x = (screen.w // 3) * 2 + screen.x window.w = screen.w // 3 return window end function obj:rightTwoThirds(window, screen) window.x = (screen.w // 3) + screen.x window.w = (screen.w // 3) * 2 return window end function obj:rightFull(window, screen) window.x = screen.x window.w = screen.w return window end function obj:centerHorizontalThird(window, screen) window.x = screen.x window.y = screen.h // 3 window.w = screen.w window.h = screen.h // 3 return window end function obj:centerVerticalThird(window, screen) window.x = screen.w // 3 window.y = screen.y window.w = screen.w // 3 window.h = screen.h return window end return obj
conky.config = { background = true, use_xft = true, font = 'sans:size=9', xftalpha = 1, total_run_times = 0, own_window = true, own_window_type = 'override', own_window_argb_visual = true, own_window_argb_value = 0, -- own_window_transparent = false, own_window_title = 'conkyi3info', own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager', double_buffer = true, minimum_width = 1370, minimum_height = 1040, draw_shades = false, draw_outline = false, draw_borders = false, draw_graph_borders = false, alignment = 'bottom_left', gap_x = 25, gap_y = 20, no_buffers = true, cpu_avg_samples = 4, override_utf8_locale = true, color1 = '#EEEEEE', color2 = '#AAAAAA', color3 = '#888888', color4 = '#666666', color4 = '#444444', color5 = '#00AAFF', text_buffer_size = 100000, top_name_width = 32, -- This conky script is pretty much static, don't update often update_interval = 1000, }; conky.text = [[ ${color1}${font Source Han Sans:size=18}i3 settings - ${color2}modkey <super> ${color1}${font Source Han Sans:size=14}General${font Source Han Sans:size=12} ${execp grep ^bindsym ~/.i3/config | grep exit | sed 's/\$mod/<mod>/'| awk '{printf "${goto 20}${color1}%s ${goto 130}${color2}%s\n", "Exit", $2}' } ${execp grep ^bindsym ~/.i3/config | grep reload | sed 's/\$mod/<mod>/'| awk '{printf "${goto 20}${color1}%s ${goto 130}${color2}%s\n", "Reload", $2}' } ${execp grep ^bindsym ~/.i3/config | grep restart | sed 's/\$mod/<mod>/'| awk '{printf "${goto 20}${color1}%s ${goto 130}${color2}%s\n", "Restart", $2}' } ${color1}${font Source Han Sans:size=14}Applications${font Source Han Sans:size=12} ${execp grep ^bindsym ~/.i3/config | grep --invert i3 | grep exec | sed 's/\$mod/<mod>/'| awk '{printf "${goto 20}${color1}%-12s ${goto 130}${color2}%s\n", $4, $2}' } ${color1}${font Source Han Sans:size=14}Navigation${color2}-Workspace${font Source Han Sans:size=12} ${execp grep ^bindsym ~/.i3/config | grep --invert move | grep workspace | head -n 1 | sed 's/$mod/<mod>/'| sed 's/[0-9]/<N>/'| awk '{printf "${goto 20}${color1}%s ${goto 130}${color2}%s\n", "Go to <N>", $2}' } ${execp grep ^bindsym ~/.i3/config | grep move | grep workspace | head -n 1 | sed 's/$mod/<mod>/'| sed 's/[0-9]/<N>/'| awk '{printf "${goto 20}${color1}%s ${goto 130}${color2}%s\n", "Move to <N>", $2}' } ${color1}${font Source Han Sans:size=14}Extra modes${color2}${font Source Han Sans:size=12} ${execp grep ^bindsym ~/.i3/config | grep -w mode | sed 's/$mod/<mod>/'| awk '{printf "${goto 20}${color1}%s ${goto 130}${color2}%s\n", $4, $2}' } ${voffset -515} ${goto 350}${color1}${font Source Han Sans:size=14}Navigation${color2} - focus container${font Source Han Sans:size=12} ${execp grep ^bindsym ~/.i3/config | grep focus | sed 's/\$mod/<mod>/' | awk '{printf "${goto 370}${color1}%s ${goto 480}${color2}%s\n", $4, $2}' } ${goto 330}${color1}${font Source Han Sans:size=14}Navigation${color2} - move container${font Source Han Sans:size=12} ${execp grep ^bindsym ~/.i3/config | grep move | grep --invert container | sed 's/$mod/<mod>/'| awk '{printf "${goto 370}${color1}%s ${goto 480}${color2}%s\n", $4, $2}' } ${voffset -580} ${goto 700}${color1}${font Source Han Sans:size=14}Mode${color2} - resize${font Source Han Sans:size=12} ${execp sed -n '/^mode.*resize.*{/,/}/{/^mode.*resize.*{/b;/}/b;p}' ~/.i3/config | grep '^\s*bind' | sed 's/$mod/<mod>/'| awk '{printf "${goto 720}${color2}%s", $2 ; $1=$2="" ; printf "${goto 830}${color1}%s\n", $0}' } ]]
return { version = "1.1", luaversion = "5.1", tiledversion = "0.14.2", orientation = "orthogonal", renderorder = "left-down", width = 50, height = 50, tilewidth = 8, tileheight = 8, nextobjectid = 1, properties = {}, tilesets = { { name = "environment", firstgid = 1, tilewidth = 8, tileheight = 8, spacing = 0, margin = 0, image = "../visual/sprites/environment.png", imagewidth = 32, imageheight = 16, tileoffset = { x = 0, y = 0 }, properties = {}, terrains = {}, tilecount = 8, tiles = {} } }, layers = { { type = "tilelayer", name = "Tile Layer 1", x = 0, y = 0, width = 50, height = 50, visible = true, opacity = 1, offsetx = 0, offsety = 0, properties = {}, encoding = "lua", data = { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 7, 0, 0, 0, 0, 0, 0, 8, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 1, 1, 1, 1, 1, 1, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 } } } }
-- This is the Epuck principal control script. It is threaded velLeft=0 velRight=0 paramIsNoise=false paramNoiseProb=0.16 paramNoiseMean=0 paramNoiseSD=1 actualizeLEDs=function() if (relLedPositions==nil) then relLedPositions={{-0.0343,0,0.0394},{-0.0297,0.0171,0.0394},{0,0.0343,0.0394}, {0.0297,0.0171,0.0394},{0.0343,0,0.0394},{0.0243,-0.0243,0.0394}, {0.006,-0.0338,0.0394},{-0.006,-0.0338,0.0394},{-0.0243, -0.0243,0.0394}} end if (drawingObject) then simRemoveDrawingObject(drawingObject) end type=sim_drawing_painttag+sim_drawing_followparentvisibility+sim_drawing_spherepoints+ sim_drawing_50percenttransparency+sim_drawing_itemcolors+sim_drawing_itemsizes+ sim_drawing_backfaceculling+sim_drawing_emissioncolor drawingObject=simAddDrawingObject(type,0,0,bodyElements,27) m=simGetObjectMatrix(ePuckBase,-1) itemData={0,0,0,0,0,0,0} simSetLightParameters(ledLight,0) for i=1,9,1 do if (ledColors[i][1]+ledColors[i][2]+ledColors[i][3]~=0) then p=simMultiplyVector(m,relLedPositions[i]) itemData[1]=p[1] itemData[2]=p[2] itemData[3]=p[3] itemData[4]=ledColors[i][1] itemData[5]=ledColors[i][2] itemData[6]=ledColors[i][3] simSetLightParameters(ledLight,1,{ledColors[i][1],ledColors[i][2],ledColors[i][3]}) for j=1,3,1 do itemData[7]=j*0.003 simAddDrawingObjectItem(drawingObject,itemData) end end end end getLightSensors=function() data=simReceiveData(0,'EPUCK_lightSens') if (data) then lightSens=simUnpackFloatTable(data) end return lightSens end rosGetCameraData=function() local data,w,h=simGetVisionSensorCharImage(handleCamera) d={} d['header']={seq=0,stamp=simExtRosInterface_getTime(), frame_id="a"} d['height']=h d['width']=w d['encoding']='rgb8' d['is_bigendian']=1 d['step']=w*3 d['data']=data return d end randomNormal=function() -- normal distribution, centered on mean 0, std dev 1 --return sqrt(-2*log(drand())) * cos(2*M_PI*drand()); return math.sqrt(-2 * math.log(math.random())) * math.cos(2 * math.pi * math.random()) end clampValue=function(value, min, max) if (value <= min) then return min elseif (value >= max) then return max end return value end rosGetProximityData=function(proxData) d={{}, {}, {}, {}, {}, {}, {}, {}} for i=1,8,1 do d[i]['header']={seq=0,stamp=simExtRosInterface_getTime(), frame_id = ePuckName .. "/base_prox" .. (i-1)} d[i]['radiation_type']=1 --infrared d[i]['field_of_view']=0.52359878 -- 30 deg d[i]['min_range']=0.0015 d[i]['max_range']=noDetectionDistance if (paramIsNoise and paramNoiseProb > 0) then -- test probability of noise if (math.random() <= paramNoiseProb) then noise = paramNoiseMean + paramNoiseSD * randomNormal() -- noise generation if (proxData[i] == d[i]['min_range']) then d[i]['range'] = proxData[i] + noise -- WITH noise elseif (proxData[i] == d[i]['max_range']) then d[i]['range'] = proxData[i] - noise -- WITH noise else if (math.random() < 0.5) then d[i]['range'] = proxData[i] - noise -- WITH noise else d[i]['range'] = proxData[i] + noise -- WITH noise end end -- make sure that the value does not exceed minimum/maximum values d[i]['range'] = clampValue(d[i]['range'], d[i]['min_range'], d[i]['max_range']) else d[i]['range'] = proxData[i] -- no noise end else d[i]['range'] = proxData[i] -- no noise end end return d end rosGetImuData=function() msg = {} accelData=simTubeRead(accelCommunicationTube) if (accelData) then acceleration=simUnpackFloatTable(accelData) msg['header'] = {seq=0,stamp=simExtRosInterface_getTime(), frame_id = ePuckName .. "/base_link"} msg['linear_acceleration'] = {} msg['linear_acceleration']['x'] = acceleration[1] msg['linear_acceleration']['y'] = acceleration[2] msg['linear_acceleration']['z'] = acceleration[3] msg['linear_acceleration_covariance'] = {0.01, 0.0, 0.0, 0.0, 0.01, 0.0, 0.0, 0.0, 0.01} end gyroData=simTubeRead(gyroCommunicationTube) if (gyroData) then angularVariations=simUnpackFloatTable(gyroData) msg['header'] = {seq=0,stamp=simExtRosInterface_getTime(), frame_id = ePuckName .. "/base_link"} msg['angular_velocity'] = {} msg['angular_velocity']['x'] = angularVariations[1] msg['angular_velocity']['y'] = angularVariations[2] msg['angular_velocity']['z'] = angularVariations[3] msg['angular_velocity_covariance'] = {0.01, 0.0, 0.0, 0.0, 0.01, 0.0, 0.0, 0.0, 0.01} end return msg end rosCallbackCmdLed=function(msg) for i=1,9,1 do if (msg.data[i] == 1) then ledColors[i] = {1, 0, 0} --red else ledColors[i] = {0, 0, 0} --off end end end rosCallbackCmdVel=function(msg) -- constants, taken from e-puck ROS driver (epuck_driver_cpp) WHEEL_DIAMETER=40 * s -- mm. WHEEL_SEPARATION=53 * s -- Separation between wheels (mm). linear=msg.linear.x * 8.9 angular=msg.angular.z -- determine velocity in e-puck firmware scale (-1000; 1000) velLeft = (linear - (WHEEL_SEPARATION / 2.0) * angular) / WHEEL_DIAMETER; velRight = (linear + (WHEEL_SEPARATION / 2.0) * angular) / WHEEL_DIAMETER; simAddStatusbarMessage('epuck '.. ePuckName ..' newVel '.. velLeft .. ' ' .. velRight) end -- function for tf transform message generation -- adapted from http://www.forum.coppeliarobotics.com/viewtopic.php?f=5&t=6198#p24920 --getTransformStamped=function(objHandle,name,relTo,relToName) rosGetTransformStamped=function(childHandle, referenceHandle, childName, referenceName) t=simExtRosInterface_getTime() p=simGetObjectPosition(childHandle,referenceHandle) o=simGetObjectQuaternion(childHandle,referenceHandle) return { header={ stamp=t, frame_id=referenceName }, child_frame_id=childName, transform={ -- ROS has definition x=front y=side z=up translation={x=p[1],y=p[2],z=p[3]},--V-rep rotation={x=o[1],y=o[2],z=o[3],w=o[4]}--v-rep } } end threadFunction=function() while simGetSimulationState()~=sim_simulation_advancing_abouttostop do st=simGetSimulationTime() opMode=simGetScriptSimulationParameter(sim_handle_self,'opMode') lightSens=getLightSensors() s=simGetObjectSizeFactor(bodyElements) -- make sure that if we scale the robot during simulation, other values are scaled too! noDetectionDistance=0.05*s proxSensDist={noDetectionDistance,noDetectionDistance,noDetectionDistance,noDetectionDistance,noDetectionDistance,noDetectionDistance,noDetectionDistance,noDetectionDistance} for i=1,8,1 do res,dist=simReadProximitySensor(proxSens[i]) if (res>0) and (dist<noDetectionDistance) then proxSensDist[i]=dist end end if (opMode==0) then -- We wanna follow the line if (math.mod(st,2)>1.5) then intensity=1 else intensity=0 end for i=1,9,1 do ledColors[i]={intensity,0,0} -- red end -- Now make sure the light sensors have been read, we have a line and the 4 front prox. sensors didn't detect anything: if lightSens and ((lightSens[1]<0.5)or(lightSens[2]<0.5)or(lightSens[3]<0.5)) and (proxSensDist[2]+proxSensDist[3]+proxSensDist[4]+proxSensDist[5]==noDetectionDistance*4) then if (lightSens[1]>0.5) then velLeft=maxVel else velLeft=maxVel*0.25 end if (lightSens[3]>0.5) then velRight=maxVel else velRight=maxVel*0.25 end else velRight=maxVel velLeft=maxVel if (proxSensDist[2]+proxSensDist[3]+proxSensDist[4]+proxSensDist[5]==noDetectionDistance*4) then -- Nothing in front. Maybe we have an obstacle on the side, in which case we wanna keep a constant distance with it: if (proxSensDist[1]>0.25*noDetectionDistance) then velLeft=velLeft+maxVel*braitSideSens_leftMotor[1]*(1-(proxSensDist[1]/noDetectionDistance)) velRight=velRight+maxVel*braitSideSens_leftMotor[2]*(1-(proxSensDist[1]/noDetectionDistance)) end if (proxSensDist[6]>0.25*noDetectionDistance) then velLeft=velLeft+maxVel*braitSideSens_leftMotor[2]*(1-(proxSensDist[6]/noDetectionDistance)) velRight=velRight+maxVel*braitSideSens_leftMotor[1]*(1-(proxSensDist[6]/noDetectionDistance)) end else -- Obstacle in front. Use Braitenberg to avoid it for i=1,4,1 do velLeft=velLeft+maxVel*braitFrontSens_leftMotor[i]*(1-(proxSensDist[1+i]/noDetectionDistance)) velRight=velRight+maxVel*braitFrontSens_leftMotor[5-i]*(1-(proxSensDist[1+i]/noDetectionDistance)) end end end end if (opMode==1) then -- We wanna follow something! index=math.floor(1+math.mod(st*3,9)) for i=1,9,1 do if (index==i) then ledColors[i]={0,0.5,1} -- light blue else ledColors[i]={0,0,0} -- off end end velRightFollow=maxVel velLeftFollow=maxVel minDist=1000 for i=1,8,1 do velLeftFollow=velLeftFollow+maxVel*braitAllSensFollow_leftMotor[i]*(1-(proxSensDist[i]/noDetectionDistance)) velRightFollow=velRightFollow+maxVel*braitAllSensFollow_rightMotor[i]*(1-(proxSensDist[i]/noDetectionDistance)) if (proxSensDist[i]<minDist) then minDist=proxSensDist[i] end end velRightAvoid=0 velLeftAvoid=0 for i=1,8,1 do velLeftAvoid=velLeftAvoid+maxVel*braitAllSensAvoid_leftMotor[i]*(1-(proxSensDist[i]/noDetectionDistance)) velRightAvoid=velRightAvoid+maxVel*braitAllSensAvoid_rightMotor[i]*(1-(proxSensDist[i]/noDetectionDistance)) end if (minDist>0.025*s) then minDist=0.025*s end t=minDist/(0.025*s) velLeft=velLeftFollow*t+velLeftAvoid*(1-t) velRight=velRightFollow*t+velRightAvoid*(1-t) end if (opMode==2) then -- ROS interface -- publish camera simExtRosInterface_publish(pubCamera,rosGetCameraData()) -- publish proximity proximityData = rosGetProximityData(proxSensDist) for i=1,8,1 do simExtRosInterface_publish(pubProx[i], proximityData[i]) end -- publish TF tf={} tf[1] = rosGetTransformStamped(ePuckBase, -1, ePuckName .. "/base_link", "odom") for i=1,8,1 do tf[i+1] = rosGetTransformStamped(dummyProxSens[i], ePuckBase, ePuckName .. "/base_prox" .. (i-1), ePuckName .. "/base_link") end tf[10] = rosGetTransformStamped(leftWheel, ePuckBase, ePuckName .. "/left_wheel", ePuckName .. "/base_link") tf[11] = rosGetTransformStamped(rightWheel, ePuckBase, ePuckName .. "/right_wheel", ePuckName .. "/base_link") tf[12] = rosGetTransformStamped(ePuckBodyTop, ePuckBase, ePuckName .. "/body_top", ePuckName .. "/base_link") simExtRosInterface_sendTransforms(tf) -- publish IMU simExtRosInterface_publish(pubIMU, rosGetImuData()) end simSetJointTargetVelocity(leftMotor,velLeft) simSetJointTargetVelocity(rightMotor,velRight) actualizeLEDs() simSwitchThread() -- Don't waste too much time in here (simulation time will anyway only change in next thread switch) end end -- Put some initialization code here: -- Get proximity noise parameters -- If not set, use default values, specified at the beginning of this file if (simGetScriptSimulationParameter(sim_handle_self,'isNoise') ~= nil) then paramIsNoise=simGetScriptSimulationParameter(sim_handle_self,'isNoise') end if (simGetScriptSimulationParameter(sim_handle_self,'NoiseProb') ~= nil) then paramNoiseProb=simGetScriptSimulationParameter(sim_handle_self,'NoiseProb') end if (simGetScriptSimulationParameter(sim_handle_self,'NoiseMean') ~= nil) then paramNoiseMean=simGetScriptSimulationParameter(sim_handle_self,'NoiseMean') end if (simGetScriptSimulationParameter(sim_handle_self,'NoiseSD') ~= nil) then paramNoiseSD=simGetScriptSimulationParameter(sim_handle_self,'NoiseSD') end simSetThreadSwitchTiming(200) -- We will manually switch in the main loop bodyElements=simGetObjectHandle('ePuck_bodyElements') leftMotor=simGetObjectHandle('ePuck_leftJoint') rightMotor=simGetObjectHandle('ePuck_rightJoint') leftWheel=simGetObjectHandle('ePuck_leftWheel') rightWheel=simGetObjectHandle('ePuck_rightWheel') ePuck=simGetObjectHandle('ePuck') ePuckBase=simGetObjectHandle('ePuck_base') ePuckBodyTop=simGetObjectHandle('ePuck_ring') ledLight=simGetObjectHandle('ePuck_ledLight') proxSens={-1,-1,-1,-1,-1,-1,-1,-1} dummyProxSens={-1,-1,-1,-1,-1,-1,-1,-1} for i=1,8,1 do proxSens[i]=simGetObjectHandle('ePuck_proxSensor'..(i-1)) dummyProxSens[i]=simGetObjectHandle('dummy_proxSensor'..(i-1)) end maxVel=120*math.pi/180 ledColors={{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}} -- Braitenberg weights for the 4 front prox sensors (avoidance): braitFrontSens_leftMotor={1,2,-2,-1} -- Braitenberg weights for the 2 side prox sensors (following): braitSideSens_leftMotor={-1,0} -- Braitenberg weights for the 8 sensors (following): braitAllSensFollow_leftMotor={-3,-1.5,-0.5,0.8,1,0,0,-4} braitAllSensFollow_rightMotor={0,1,0.8,-0.5,-1.5,-3,-4,0} braitAllSensAvoid_leftMotor={0,0.5,1,-1,-0.5,-0.5,0,0} braitAllSensAvoid_rightMotor={-0.5,-0.5,-1,1,0.5,0,0,0} -- ROS interface initialization ePuckNumber = simGetNameSuffix(simGetScriptName(sim_handle_self)) if (ePuckNumber == -1) then ePuckNumber = 0 else ePuckNumber = ePuckNumber + 1 end ePuckName = 'ePuck' .. ePuckNumber simAddStatusbarMessage('epuck '.. ePuckName ..' initializing') -- Check if the required RosInterface is there: -- http://www.coppeliarobotics.com/helpFiles/en/rosTutorialIndigo.htm moduleName=0 index=0 rosInterfacePresent=false while moduleName do moduleName=simGetModuleName(index) if (moduleName=='RosInterface') then rosInterfacePresent=true end index=index+1 end -- Accelerometer tube open accelCommunicationTube=simTubeOpen(0,'accelerometerData'..simGetNameSuffix(nil),1) -- put this in the initialization phase -- Gyroscope tube open gyroCommunicationTube=simTubeOpen(0,'gyroData'..simGetNameSuffix(nil),1) --setup handles for various components handleCamera=simGetObjectHandle('ePuck_camera') --create publishers (proximity, imu, camera, ground_truth) pubCamera = simExtRosInterface_advertise('/' .. ePuckName ..'/camera', 'sensor_msgs/Image') simExtRosInterface_publisherTreatUInt8ArrayAsString(pubCamera) -- treat uint8 arrays as strings (much faster, tables/arrays are kind of slow in Lua) pubProx = {} for i=1,8,1 do pubProx[i] = simExtRosInterface_advertise('/' .. ePuckName .. '/proximity'..(i-1), 'sensor_msgs/Range') end pubIMU = simExtRosInterface_advertise('/' .. ePuckName ..'/imu', 'sensor_msgs/Imu') --create subscribers (leds, movement) subLED=simExtRosInterface_subscribe('/' .. ePuckName .. '/cmd_led','std_msgs/UInt8MultiArray','rosCallbackCmdLed') subVel=simExtRosInterface_subscribe('/' .. ePuckName .. '/cmd_vel','geometry_msgs/Twist','rosCallbackCmdVel') -- Here we execute the regular thread code: res,err=xpcall(threadFunction,function(err) return debug.traceback(err) end) if not res then simAddStatusbarMessage('Lua runtime error: '..err) end -- Put some clean-up code here: for i=1,9,1 do ledColors[i]={0,0,0} -- no light end actualizeLEDs()
local Game = require "game" Game.video = require("video_config")(Game.videoconfigfile) function love.load() love.keyboard.setKeyRepeat(true) end local draw_loading = function() local w, h = love.graphics.getDimensions() love.graphics.setColor(0, 0, 0) love.graphics.rectangle("fill", 0, 0, w, h) love.graphics.setColor(1, 1, 1) love.graphics.print("LOADING...", 5, 5) end function love.update(dt) if love.draw ~= draw_loading then love.draw = draw_loading return end Game.load() end
function Dump(obj) if obj.proxyType ~= nil then DumpProxy(obj); elseif type(obj) == 'table' then DumpTable(obj); else print('Dump ' .. type(obj)); end end function DumpTable(tbl) for k,v in pairs(tbl) do print('k = ' .. tostring(k) .. ' (' .. type(k) .. ') ' .. ' v = ' .. tostring(v) .. ' (' .. type(v) .. ')'); end end function DumpProxy(obj) print('type=' .. obj.proxyType .. ' readOnly=' .. tostring(obj.readonly) .. ' readableKeys=' .. table.concat(obj.readableKeys, ',') .. ' writableKeys=' .. table.concat(obj.writableKeys, ',')); end function split(str, pat) local t = {} -- NOTE: use {n = 0} in Lua-5.0 local fpat = "(.-)" .. pat local last_end = 1 local s, e, cap = str:find(fpat, 1) while s do if s ~= 1 or cap ~= "" then table.insert(t,cap) end last_end = e+1 s, e, cap = str:find(fpat, last_end) end if last_end <= #str then cap = str:sub(last_end) table.insert(t, cap) end return t end function map(array, func) local new_array = {} local i = 1; for _,v in pairs(array) do new_array[i] = func(v); i = i + 1; end return new_array end function filter(array, func) local new_array = {} local i = 1; for _,v in pairs(array) do if (func(v)) then new_array[i] = v; i = i + 1; end end return new_array end function first(array, func) for _,v in pairs(array) do if (func(v)) then return v; end end return nil; end function randomFromArray(array) local len = #array; local i = math.random(len); return array[i]; end function startsWith(str, sub) return string.sub(str, 1, string.len(sub)) == sub; 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 tablelength(T) local count = 0 for _ in pairs(T) do print(count) count = count + 1 end return count end function addToSet(set, key) set[key] = true end function removeFromSet(set, key) set[key] = nil end function setContains(set, key) return set[key] ~= nil end function toint(n) local s = tostring(n) local i, j = s:find('%.') if i then return tonumber(s:sub(1, i-1)) else return n end end function randomColor() --List given by Fizzer. 74 diffrent colors local PossibleColors = "00A0FF#00B5FF#F3FFAE#43C731#43C631#1274A4#1274A5#B03B3B#0021FF#359029#00E9FF#00FF21#FFF700#AA3A3A#43C732#00D4FF#B03C3C#00F4FF#00BFFF#4EC4FF#FFFF00#615DDF#100C08#943E3E#0000ff#4effff#59009d#008000#ff7d00#ff0000#606060#00ff05#ff697a#94652e#00ff8c#ff4700#009b9d#23a0ff#ac0059#ff87ff#ffff00#943e3e#feff9b#ad7e7e#b70aff#ffaf56#ff00b1#8ebe57#DAA520#990024#00FFFF#8F9779#880085#00755E#FFE5B4#4169E1#FF43A4#8DB600#40826D#C04000#FFDDF4#CD7F32#C19A6B#C09999#B0BF1A#3B7A57#4B5320#664C28#893F45#D2691E#36454F#FF00FF#76FF7A#100C08" local randomStart = math.random(0,73) *7; local color = string.sub(PossibleColors, randomStart,randomStart+6); return color; end
-- menu_list -- created on 2021/8/25 -- author @zoloypzuo local Group = require("ui.layouts.group") local MenuList = Class(Group, function(self, parent, name, locked) Group._ctor(self, parent) self.name = name or "" self.locked = locked or false self.ClickedEvent = EventWrapper(EventProcessor(), "ClickedEvent") -- private self.m_opened = false end) function MenuList:_UpdateImpl() if ImGui.BeginMenu(self.name, not self.locked) then if not self.m_opened then self.ClickedEvent:HandleEvent() self.m_opened = true end self:UpdateWidgets() ImGui.EndMenu() else self.m_opened = false end end return MenuList
function distanceFrom(x1,y1,x2,y2) return math.sqrt((x2 - x1) ^ 2 + (y2 - y1) ^ 2) end function makeValidPos(x,y) if x < 20 then x = 20 end if x > GameWidth - 20 then x = GameWidth - 20 end if y < 20 then y = 20 end if y > GameHeight - 20 then y = GameHeight - 20 end return x,y end function getStep(dx, dy, speed) local d = math.sqrt(dx * dx + dy * dy) if d <= speed then return dx, dy else local angle = math.atan2(dy, dx) return speed * math.cos(angle), speed * math.sin(angle) end end
sodium:on(events.ready, function() -- Key Bindings sodium:bind({keys.Super, keys.Return}, function() os.execute("open -a Terminal.app") end) -- Workspaces sodium:bind({keys.Super, keys.Num_1}, function() sodium:space(1) end) end) sodium:on(events.window_created, function(window) if sodium:match(window.bundle, "com\\.apple\\.systemprefernces") then -- Ignore System Preferences return end if sodium:match(window.bundle, "com\\.apple\\.finder") then window:set_frame { height = 600, width = 600, x = 45, y = 45 } return end end)
require'nvim-tree'.setup { hijack_netrw = false, }
red = gr.material({0.8, 0.1, 0.1}, {0.5, 0.5, 0.5}, 25) green = gr.material({0.1, 0.8, 0.1}, {0.5, 0.5, 0.5}, 25) blue = gr.material({0.1, 0.1, 0.8}, {0.5, 0.5, 0.5}, 25) root = gr.node('root') BALL = gr.sphere('BALL1') BALL:translate(500, 0, -1000) BALL:scale(100, 100, 100) BALL:set_material(green) root:add_child(BALL) BALL = gr.sphere('BALL1') BALL:translate(0, 0, 0) BALL:scale(100, 100, 100) BALL:set_material(red) root:add_child(BALL) BALL = gr.sphere('BALL1') BALL:translate(-175, 0, 700) BALL:scale(100, 100, 100) BALL:set_material(blue) root:add_child(BALL) white_light = gr.light(1, {700.0, 0.0, 700.0}, {1, 1, 1}, {1, 0, 0}) camera = gr.lcamera({0, 0, 1000}, {0, 0, -1}, {0, 1, 0}, 50, 5, 2000, 100) gr.render(root, './img/DOF.png', 1024, 1024, camera, {0.3, 0.3, 0.3}, {white_light}, {}, 0, 0, 1)
local a = require 'packer.async' local log = require 'packer.log' local util = require 'packer.util' local result = require 'packer.result' local async = a.sync local await = a.wait local config = nil local function cfg(_config) config = _config end -- Due to #679, we know that fs_symlink requires admin privileges on Windows. This is a workaround, -- as suggested by @nonsleepr. local symlink_fn if util.is_windows then symlink_fn = function(path, new_path, flags, callback) flags = flags or {} flags.junction = true return vim.loop.fs_symlink(path, new_path, flags, callback) end else symlink_fn = vim.loop.fs_symlink end local symlink = a.wrap(symlink_fn) local function setup_local(plugin) local from = plugin.path local to = plugin.install_path local plugin_name = util.get_plugin_full_name(plugin) plugin.installer = function(disp) return async(function() disp:task_update(plugin_name, 'making symlink...') local err, success = await(symlink(from, to, { dir = true })) if not success then plugin.output = { err = { err } } return result.err(err) end return result.ok() end) end plugin.updater = function(_) return async(function() return result.ok() end) end plugin.revert_last = function(_) log.warn "Can't revert a local plugin!" return result.ok() end end return { setup = setup_local, cfg = cfg }
kHydraHealth = 350 kHydraArmor = 10 kHydraPointValue = 2 kMatureHydraHealth = 450 kMatureHydraArmor = 50 kMatureHydraPointValue = 2
--[[ List implementation. With Perl-like `qw` operator. (c) 2012 David Manura. See README for details. --]] local M = {} local List = {}; List.__index = List function List.__add(a, b) local t = {} for _,v in ipairs(a) do t[#t+1] = v end for _,v in ipairs(b) do t[#t+1] = v end return setmetatable(t, List) end function List:iter() local i = 0 return function() i=i+1 return self[i] end end function List:string() return table.concat(self, ' ') end function M.qw(s) local t = {} for v in s:gmatch('%S+') do t[#t+1] = v end return setmetatable(t, List) end return M
-- 2021-Jun-12 https://github.com/Immersive-Labs-Sec/msrc-api/ in Lua extend("string") -- "string":contains(), "string":trim_end() extend("table") -- table.size local json = require("json") local http = require("http") local fmt = require("fmt") local argparse = require("argparse") local parser = argparse() parser:argument("id") local a = parser:parse(arg) local body local exploited = 0 local cves = {} local vuln_types = { ["Elevation of Privilege "] = 0, ["Security Feature Bypass"] = 0, ["Remote Code Execution "] = 0, ["Information Disclosure "] = 0, ["Denial of Service "] = 0, ["Spoofing "] = 0, } local cvrf = require("cvrf") local body, err = cvrf.get(a) fmt.assert(body, "FAIL: %s\n", err) for k in pairs(vuln_types) do for _, t in ipairs(body.Vulnerability) do local cve = t.CVE local title = t.Title.Value for _, v in ipairs(t.Threats) do if v.Type == 1 and v.Description.Value:contains("Exploited:Yes") then exploited = exploited + 1 cves[cve] = title end if v.Type == 0 and v.Description.Value == k:trim_end() then vuln_types[k] = vuln_types[k] + 1 break end end end end fmt.print("%s\n", body.DocumentTitle.Value) fmt.print("[+] Found %s vulnerabilities\n", table.size(body.Vulnerability)) for k in pairs(vuln_types) do fmt.print(" %s\t\t%s\n", k, vuln_types[k]) end if exploited > 0 then fmt.print("[+] Found %s exploited\n", exploited) for c, t in pairs(cves) do fmt.print(" %s\t%s\n", c, t) end end
local utils = require "luacheck.utils" local cache = {} -- Cache file contains check results for n unique filenames. -- Cache file consists of 3n+2 lines, the first line is empty and the second is cache format version. -- The rest are contain file records, 3 lines per file. -- For each file, first line is the filename, second is modification time, -- third is check result in lua table format. -- String fields are compressed into array indexes. cache.format_version = 27 local option_fields = { "ignore", "std", "globals", "unused_args", "self", "compat", "global", "unused", "redefined", "unused_secondaries", "allow_defined", "allow_defined_top", "module", "read_globals", "new_globals", "new_read_globals", "enable", "only", "not_globals", "max_line_length", "max_code_line_length", "max_string_line_length", "max_comment_line_length", "max_cyclomatic_complexity" } local event_fields = { "code", "name", "line", "column", "end_column", "prev_line", "prev_column", "prev_end_column", "secondary", "self", "func", "top", "msg", "index", "recursive", "mutually_recursive", "useless", "field", "label", "push", "pop", "options", "indirect", "indexing", "previous_indexing_len", "overwritten_line", "overwritten_column", "overwritten_end_column", "complexity", "function_name", "function_type" } -- Recursively replace string keys with integer keys. local function compress(t, fields) fields = fields or event_fields local res = {} for index, field in ipairs(fields) do local value = t[field] if value ~= nil then if field == "options" then value = compress(value, option_fields) end res[index] = value end end return res end local function compress_report(report) local res = {} res[1] = utils.map(compress, report.events) res[2] = {} for line, events in pairs(report.per_line_options) do res[2][line] = utils.map(compress, events) end res[3] = report.line_lengths res[4] = report.line_endings return res end -- Recursively restores a table from a compressed array. local function decompress(t, fields) fields = fields or event_fields local res = {} for index, field in ipairs(fields) do local value = t[index] if value ~= nil then if field == "options" then value = decompress(value, option_fields) end res[field] = value end end return res end local function decompress_report(compressed) local report = {} report.events = utils.map(decompress, compressed[1]) report.per_line_options = {} for line, events in pairs(compressed[2]) do report.per_line_options[line] = utils.map(decompress, events) end report.line_lengths = compressed[3] report.line_endings = compressed[4] return report end local function get_local_name(index) return string.char(index + (index > 26 and 70 or 64)) end local function max_n(t) local res = 0 for k in pairs(t) do res = math.max(res, k) end return res end -- Serializes a value into buffer. -- `strings` is a table mapping string values to where they first occured or to name of local -- variable used to represent it. -- Array part contains representations of values saved into locals. local function add_value(buffer, strings, value) if type(value) == "string" then local prev = strings[value] if type(prev) == "string" then -- There is a local with such value. table.insert(buffer, prev) elseif type(prev) == "number" and #strings < 52 then -- Value is used second time, put it into a local. table.insert(strings, ("%q"):format(value)) local local_name = get_local_name(#strings) buffer[prev] = local_name table.insert(buffer, local_name) strings[value] = local_name else table.insert(buffer, ("%q"):format(value)) strings[value] = #buffer end elseif type(value) == "table" then local is_sparse local put_one table.insert(buffer, "{") for i = 1, max_n(value) do local item = value[i] if item == nil then is_sparse = true else if put_one then table.insert(buffer, ",") end if is_sparse then table.insert(buffer, ("[%d]="):format(i)) end add_value(buffer, strings, item) put_one = true end end table.insert(buffer, "}") else table.insert(buffer, tostring(value)) end end -- Serializes check result into a string. function cache.serialize(report) local strings = {} local buffer = {"", "return "} add_value(buffer, strings, compress_report(report)) if strings[1] then local names = {} for index in ipairs(strings) do table.insert(names, get_local_name(index)) end buffer[1] = "local " .. table.concat(names, ",") .. "=" .. table.concat(strings, ",") .. ";" end return table.concat(buffer) end -- Returns array of triplets of lines from cache fh. local function read_triplets(fh) local res = {} while true do local filename = fh:read() if filename then local mtime = fh:read() or "" local cached = fh:read() or "" table.insert(res, {filename, mtime, cached}) else break end end return res end -- Writes cache triplets into fh. local function write_triplets(fh, triplets) for _, triplet in ipairs(triplets) do fh:write(triplet[1], "\n") fh:write(triplet[2], "\n") fh:write(triplet[3], "\n") end end -- Loads cached checking result from string, returns result or nil. local function load_cached(cached) local func = utils.load(cached, {}) if not func then return end local ok, res = pcall(func) if not ok then return end if type(res) == "table" then return decompress_report(res) end end local function check_version_header(fh) local first_line = fh:read() return (first_line == "" or first_line == "\r") and tonumber(fh:read()) == cache.format_version end local function write_version_header(fh) fh:write("\n", tostring(cache.format_version), "\n") end -- Loads cache for filenames given mtimes from cache cache_filename. -- Returns table mapping filenames to cached check results. -- On corrupted cache returns nil, on version mismatch returns {}. function cache.load(cache_filename, filenames, mtimes) local fh = io.open(cache_filename, "rb") if not fh then return {} end if not check_version_header(fh) then fh:close() return {} end local result = {} local not_yet_found = utils.array_to_set(filenames) while next(not_yet_found) do local filename = fh:read() if not filename then fh:close() return result end if filename:sub(-1) == "\r" then filename = filename:sub(1, -2) end local mtime = fh:read() local cached = fh:read() if not mtime or not cached then fh:close() return end mtime = tonumber(mtime) if not mtime then fh:close() return end if not_yet_found[filename] then if mtimes[not_yet_found[filename]] == mtime then result[filename] = load_cached(cached) if result[filename] == nil then fh:close() return end end not_yet_found[filename] = nil end end fh:close() return result end -- Updates cache at cache_filename with results for filenames. -- Returns success flag + whether update was append-only. function cache.update(cache_filename, filenames, mtimes, results) local old_triplets = {} local can_append = false local fh = io.open(cache_filename, "rb") if fh then if check_version_header(fh) then old_triplets = read_triplets(fh) can_append = true end fh:close() end local filename_set = utils.array_to_set(filenames) local old_filename_set = {} -- Update old cache for files which got a new result. for i, triplet in ipairs(old_triplets) do old_filename_set[triplet[1]] = true local file_index = filename_set[triplet[1]] if file_index then can_append = false old_triplets[i][2] = mtimes[file_index] old_triplets[i][3] = cache.serialize(results[file_index]) end end local new_triplets = {} for _, filename in ipairs(filenames) do -- Use unique index (there could be duplicate filenames). local file_index = filename_set[filename] if file_index and not old_filename_set[filename] then table.insert(new_triplets, { filename, mtimes[file_index], cache.serialize(results[file_index]) }) -- Do not save result for this filename again. filename_set[filename] = nil end end if can_append then if #new_triplets > 0 then fh = io.open(cache_filename, "ab") if not fh then return false end write_triplets(fh, new_triplets) fh:close() end else fh = io.open(cache_filename, "wb") if not fh then return false end write_version_header(fh) write_triplets(fh, old_triplets) write_triplets(fh, new_triplets) fh:close() end return true, can_append end return cache
--[[ Base Loader A parent class for all asset loaders. ]] local Coeus = (...) local OOP = Coeus.Utility.OOP local Loader = OOP:Static() :Members { Formats = {} } --[[ Loads the asset located at path. ]] function Loader:Load(path, ...) local loader for name, member in pairs(self.Formats) do if (member:Match(path, ...)) then return member:Load(path, ...) end end print("Could not find loader for file at " .. (path or "nil")) end return Loader
return {'aov','aover','aovers'}
t={} t.a = 0 t.b = 0 t.c = 0 t.d = 0 t.e = 0 t.b = 0 t.f = 0 for k, v in pairs(t) do print(k) end
local anim8 = require 'vendor/anim8' local player = require 'player' local utils = require 'utils' local sound = require 'vendor/TEsound' local window = require 'window' local Vehicle = {} Vehicle.__index = Vehicle Vehicle.isVehicle = true function Vehicle.new(node, collider) local vehicle = {} setmetatable(vehicle, Vehicle) local name= node.name vehicle.type = 'vehicle' vehicle.name = name vehicle.props = utils.require('nodes/vehicles/' .. name) vehicle.hasAttack = vehicle.props.hasAttack or false vehicle.width = vehicle.props.width or node.width vehicle.height = vehicle.props.height or node.height vehicle.image = love.graphics.newImage('images/vehicles/'..name..'.png') local g = anim8.newGrid(vehicle.width,vehicle.height,vehicle.image:getWidth(),vehicle.image:getHeight()) local moveAnim = vehicle.props.move vehicle.idle = anim8.newAnimation('once',g(1,1),1) vehicle.move = anim8.newAnimation(moveAnim[1],g(unpack(moveAnim[2])),moveAnim[3]) if vehicle.hasAttack then local attackAnim = vehicle.props.attack vehicle.attack = anim8.newAnimation(attackAnim[1],g(unpack(attackAnim[2])),attackAnim[3]) end local Player = player.factory() vehicle.characterImage = love.graphics.newImage('images/characters/'..Player.character.name..'/'..Player.character.costume..'.png') vehicle.mask = love.graphics.newQuad(0, 48, 48, 48, vehicle.characterImage:getWidth(), vehicle.characterImage:getHeight()) vehicle.xOffset = vehicle.props.xOffset or 0 vehicle.yOffset = vehicle.props.yOffset - Player.character.offset local yPosition = node.y - vehicle.height + 24 vehicle.bb = collider:addRectangle(node.x, yPosition, vehicle.width, vehicle.height) vehicle.bb.node = vehicle vehicle.collider = collider vehicle.collider:setPassive(vehicle.bb) vehicle.position = { x = node.x, y = yPosition} vehicle.driven = false vehicle.moving = false vehicle.attacking = false return vehicle end function Vehicle:draw() if self.driven then love.graphics.draw(self.characterImage, self.mask, self.flip and (self.position.x + self.width - self.xOffset) or (self.position.x + self.xOffset), self.position.y + self.yOffset, 0, self.flip and -1 or 1, 1) end if self.moving then self.move:draw(self.image, self.position.x, self.position.y, 0, self.flip and -1 or 1, 1, self.flip and self.width or 0) elseif self.attacking then self.attack:draw(self.image, self.position.x, self.position.y, 0, self.flip and -1 or 1, 1, self.flip and self.width or 0) else self.idle:draw(self.image, self.position.x, self.position.y, 0, self.flip and -1 or 1, 1, self.flip and self.width or 0) end end function Vehicle:keypressed( button, player ) -- Uses a copy of the nodes to eliminate a concurrency error local tmpNodes = self.containerLevel:copyNodes() -- Then look for any interactive nodes that may be at the same location local preventDoor = false for i,node in pairs(tmpNodes) do if node.isInteractive and node.isDoor and node.player_touched then preventDoor = true end end if self.driven then if button == "INTERACT" and preventDoor == false then player:drop() end end end function Vehicle:collide(node, dt, mtv_x, mtv_y) if node.isPlayer then node:registerHoldable(self) end end function Vehicle:collide_end(node, dt) if node.isPlayer then node:cancelHoldable(self) end end function Vehicle:pickup(player) local Player = player.factory() self.characterImage = love.graphics.newImage('images/characters/'..Player.character.name..'/'..Player.character.costume..'.png') self.mask = love.graphics.newQuad(0, 48, 48, 48, self.characterImage:getWidth(), self.characterImage:getHeight()) self.driven = true end function Vehicle:drop(player) self.driven = false player:cancelHoldable(self) end function Vehicle:update(dt,player) if self.driven then self.flip = (player.character.direction == 'left') and true or false if player.velocity.x ~= 0 then self.moving = true self.move:update(dt) else self.moving = false end self.position = { x = player.position.x + (player.width - self.width)/2, y = player.position.y + player.height - self.height} self:moveBoundingBox() return end end function Vehicle:moveBoundingBox() if not self.bb then return end self.bb:moveTo(self.position.x + self.width / 2, self.position.y + (self.height / 2) + 2) end return Vehicle
local socket = require("socket") local http = require("resty.http") local string_format = string.format local encode_base64 = ngx.encode_base64 local _M = {} -- 获取 IP local function get_ip_by_hostname(hostname) local _, resolved = socket.dns.toip(hostname) local list_tab = {} for _, v in ipairs(resolved.ip) do table.insert(list_tab, v) end return unpack(list_tab) end function _M.init(config) ngx.log(ngx.ERR, "node init") end function _M.get_ip() if not _M.ip then _M.ip = get_ip_by_hostname(socket.dns.gethostname()) end return _M.ip end -- 节点同步 local function sync_node_plugins(node, plugins) local sync_result = {} for _, plugin in pairs(plugins) do if plugin ~= 'stat' and plugin ~= 'node' then local httpc = http.new() -- 设置超时时间 1000 ms httpc:set_timeout(1000) local url = string_format("http://%s:%s", node.ip, node.port) local authorization = encode_base64(string_format("%s:%s", node.api_username, node.api_password)) local path = string_format('/%s/sync?seed=' .. ngx.time(), plugin) local resp, err = httpc:request_uri(url, { method = "POST", path = path, headers = { ["Authorization"] = authorization } }) if not resp or err then ngx.log(ngx.ERR, plugin .. " sync err", err) sync_result[plugin] = false else sync_result[plugin] = tonumber(resp.status) == 200 ngx.log(ngx.ERR, "status" .. resp.status, sync_result[plugin]) end httpc:close() end end return sync_result end function _M.sync(plugins, store) local table_name = 'cluster_node' local local_ip = _M:get_ip() local nodes, err = store:query({ sql = "SELECT * FROM " .. table_name .. " WHERE ip = ? LIMIT 1", params = { local_ip } }) if not nodes or err or type(nodes) ~= "table" and #nodes ~= 1 then return nil end local node = nodes[1] local sync_result = sync_node_plugins(node, plugins) if not result then ngx.log(ngx.ERR, "SYNC", err) end return sync_result end function _M.register(credentials, store) local table_name = 'cluster_node' local local_ip = _M:get_ip() local nodes, err = store:query({ sql = "SELECT * FROM " .. table_name .. " WHERE ip = ? LIMIT 1", params = { local_ip } }) if not nodes or err or type(nodes) ~= "table" or #nodes ~= 1 then nodes, err = store:query({ sql = "INSERT INTO " .. table_name .. " (name, ip, port, api_username, api_password) VALUES(?,?,?,?,?) ", params = { local_ip, local_ip, 7777, credentials.username, credentials.password } }) if not nodes or err or #nodes ~= 1 then return nil end end return nodes[1] end function _M.log() return {} end function _M.stat() return {} end return _M
kSyncConfigServer={} daytime = true primetime = false lunchtime = false cracktime = false cocainetime = false -- AI Settings 0-1 kSyncConfigServer.traffic = 1.0 kSyncConfigServer.crowd = 1.0 firstspawn = 0 robbing = false local randomselect = math.random(1,10) kSyncConfigServer.windSpeed = math.ceil(math.random(0,240)) kSyncConfigServer.windDir = math.ceil(math.random(0,360)) --kSyncConfigServer.weather = kSyncConfigServer.weatherTypes[randomselect] enableSync = true insidebuilding = false function SetEnableSync(enable) if enable == nil then enable = not noSync end enableSync = enable end tempaidsareas = { } tempaidscount = 120000 trafficblip = {} local spawning = false RegisterNetEvent('spawning') AddEventHandler('spawning', function(whatidoes) spawning = whatidoes end) increaseAI = false RegisterNetEvent('increaseAI') AddEventHandler('increaseAI', function(increase) increaseAI = increase end) RegisterNetEvent('aidsarea') AddEventHandler('aidsarea', function(add,x,y,z,h) if add then local counter = #tempaidsareas+1 local m = math.random(19099219) tempaidsareas[counter] = { ["x"] = x,["y"] = y,["z"] = z,["h"] = h, ["marker"] = m } tempaidscount = 120000 local s1, s2 = Citizen.InvokeNative( 0x2EB41072B4C1E4C0, x, y, z, Citizen.PointerValueInt(), Citizen.PointerValueInt() ) local street1 = GetStreetNameFromHashKey(s1) local street2 = GetStreetNameFromHashKey(s2) trafficblip[m] = AddBlipForCoord(x, y, z) Citizen.Trace(m) SetBlipSprite(trafficblip[m], 305) SetBlipScale(trafficblip[m], 0.7) SetBlipAsShortRange(trafficblip[m], true) BeginTextCommandSetBlipName("STRING") AddTextComponentString("Road Incident") EndTextCommandSetBlipName(trafficblip[m]) else local removals = {} for i = 1, #tempaidsareas do local dst = #(vector3(tempaidsareas[i]["x"],tempaidsareas[i]["y"],tempaidsareas[i]["z"]) - vector3(x,y,z)) if dst < 7.0 then removals[#removals+1] = i local blipid = tempaidsareas[i]["marker"] local remblip = trafficblip[blipid] RemoveBlip(remblip) end end local count = #removals while count > 0 do table.remove(tempaidsareas,removals[count]) count = count - 1 Citizen.Wait(1) end end end) aidsareas = { [1] = { ["x"] = 1822.8262939453, ["y"] = 2248.7468261719, ["z"] = 53.709140777588}, [2] = { ["x"] = 1704.5872802734, ["y"] = 3506.8410644531, ["z"] = 36.429180145264}, [3] = { ["x"] = 1726.2159423828, ["y"] = 2536.3801269531, ["z"] = 45.564891815186}, [4] = { ["x"] = 148.81317138672, ["y"] = 6529.986328125, ["z"] = 31.715270996094}, [5] = { ["x"] = -383.93887329102, ["y"] = 5997.466796875, ["z"] = 31.456497192383}, [6] = { ["x"] = 2062.81640625, ["y"] = 3721.5895996094, ["z"] = 33.070247650146}, [7] = { ["x"] = -216.88275146484, ["y"] = 6320.8959960938, ["z"] = 31.454381942749}, [8] = { ["x"] = -3100.7924804688, ["y"] = 1186.4498291016, ["z"] = 20.33984375}, [9] = { ["x"] = -2704.9948730469, ["y"] = 2305.4291992188, ["z"] = 18.006093978882}, [10] = { ['x'] = -551.43, ['y'] = 271.11, ['z'] = 82.97 }, [11] = { ['x'] = 534.99, ['y'] = -3105.27, ['z'] = 34.56 }, [12] = { ['x'] = 2396.26,['y'] = 3112.3,['z'] = 48.15 }, } function checkAids() local plyCoords = GetEntityCoords(PlayerPedId()) local returninfo = false for i = 1, #aidsareas do local distance = #(vector3(aidsareas[i]["x"],aidsareas[i]["y"],aidsareas[i]["z"]) - vector3(plyCoords["x"], plyCoords["y"], plyCoords["z"])) if distance < 350.0 then returninfo = true end end for i = 1, #tempaidsareas do local distance = #(vector3(aidsareas[i]["x"],aidsareas[i]["y"],aidsareas[i]["z"]) - vector3(plyCoords["x"], plyCoords["y"], plyCoords["z"])) if distance < 350.0 then returninfo = true end end return returninfo end function canVehBeUsed(ped) if ped == nil then return false end if ped == PlayerPedId() then return false end if not DoesEntityExist(ped) then return false end if IsPedAPlayer(ped) then return false end return true end local clearStoppedCars = {} local blockage = false local alreadyrunning = false local loop = false local stoppedHeadings = {} local headingsCounted = {} local caradded = {} function clearStoppedCarsf() for i = 1, #clearStoppedCars do if DoesEntityExist(clearStoppedCars[i]) then TaskVehicleDriveWander(GetPedInVehicleSeat(clearStoppedCars[i], -1), clearStoppedCars[i], 40.0, 1) SetPedKeepTask(GetPedInVehicleSeat(clearStoppedCars[i], -1), false) SetVehicleEngineOn(clearStoppedCars[i], true, true, 1) ClearPedTasks(GetPedInVehicleSeat(veh, -1)) end end Citizen.Wait(1000) clearStoppedCars = {} caradded = {} end RegisterNetEvent('stopcarsnow') AddEventHandler('stopcarsnow', function() alreadyrunning = true local playerped = PlayerPedId() local playerCoords = GetEntityCoords(playerped) local handle, veh = FindFirstVehicle() local success local rped = nil local distanceFrom repeat local pos = GetEntityCoords(veh) playerCoords = GetEntityCoords(PlayerPedId()) local distance = #(playerCoords - pos) if distance < 65.0 then local vehh = GetEntityHeading(veh) blockaccept = false for i = 1, #headingsCounted do onheading = correctHeading(headingsCounted[i],vehh,35.0) if onheading then blockaccept = true end end if GetPedInVehicleSeat(veh, -1) == 0 or IsPedAPlayer(GetPedInVehicleSeat(veh, -1)) then blockaccept = false end local vpos = GetEntityCoords(veh) local ohfuck = false local front = GetOffsetFromEntityInWorldCoords(veh, 0.0,3.0,0.0) local vehs = GetClosestVehicle(front["x"], front["y"], front["z"], 3.000, 0, 70) local nearpoint = false if caradded[veh] == nil then for i = 1, #tempaidsareas do local aidsdist = #(vector3(tempaidsareas[i]["x"],tempaidsareas[i]["y"],tempaidsareas[i]["z"]) - vector3(vpos["x"], vpos["y"], vpos["z"])) if aidsdist < 8.0 then nearpoint = true end end if (vehs ~= veh and DoesEntityExist(vehs)) or nearpoint then ohfuck = true end if blockaccept and ohfuck then TaskVehicleTempAction(GetPedInVehicleSeat(veh, -1), veh, 6, 10000.0) if caradded[veh] == nil then caradded[veh] = true clearStoppedCars[#clearStoppedCars+1] = veh end elseif blockaccept and GetEntitySpeed(veh) > 6.0 then SetVehicleForwardSpeed(veh, GetEntitySpeed(veh)-1.5) end end end Citizen.Wait(1) success, veh = FindNextVehicle(handle) until not success EndFindVehicle(handle) alreadyrunning = false end) -- 15 -- 345 -- 360% function oppang( ang ) return ( ang + 180 ) % 360 end function correctHeading(h1,h2,range) local opp = oppang( h1 ) local resultang = opp - h2 local negrange = 0 - range if ( resultang < range and resultang > negrange ) then return true else return false end end function scaleTwoDec(num) num = math.floor(num * 100) num = num / 100 return num end function GetPlayers() local players = {} for i = 0, 255 do if NetworkIsPlayerActive(i) then players[#players+1]= i end end return players end defaultCheck = 50.0 function CountClosestPlayers() local players = GetPlayers() local ply = PlayerPedId() local plyCoords = GetEntityCoords(ply, 0) local closecount = 1 for index,value in ipairs(players) do local target = GetPlayerPed(value) if(target ~= ply) then local targetCoords = GetEntityCoords(GetPlayerPed(value), 0) local distance = #(vector3(targetCoords["x"], targetCoords["y"], targetCoords["z"]) - vector3(plyCoords["x"], plyCoords["y"], plyCoords["z"])) if( distance < defaultCheck) then closecount = closecount + 2 end end end return closecount end DisabledScenarios = { [1]="WORLD_COYOTE_HOWL", [2]="WORLD_COYOTE_REST", [3]="WORLD_COYOTE_WANDER", [4]="WORLD_HUMAN_GUARD_PATROL", [5]="WORLD_HUMAN_GUARD_STAND", [6]="WORLD_HUMAN_GUARD_STAND_ARMY", } DensityMultiplier = 1.0 isAllowedToSpawn = true Citizen.CreateThread(function() while true do Citizen.Wait(1) if robbing then SetPedDensityMultiplierThisFrame(0.0) end end end) RegisterNetEvent("DensityModifierEnable") AddEventHandler("DensityModifierEnable",function(newValue) isAllowedToSpawn = newValue end) RegisterNetEvent('disableCrowd') AddEventHandler("disableCrowd", function() -- kSyncConfigServer.traffic = 0.0 -- kSyncConfigServer.crowd = 0.0 end) RegisterNetEvent('enableCrowd') AddEventHandler("enableCrowd", function() -- kSyncConfigServer.traffic = 0.15 -- kSyncConfigServer.crowd = 0.15 end) RegisterNetEvent('kTimeSync') AddEventHandler("kTimeSync", function( data ) if not enableSync then return end secondOfDay = data weatherTimer = 0 end) AddEventHandler('playerSpawned', function(spawn) if firstspawn == 0 then firstspawn = 1 TriggerServerEvent("kGetWeather") TriggerServerEvent("server:requestNotes") end end) synctime = {} secondOfDay = 31800 -- In-game Clock Manipulation Loop Citizen.CreateThread( function() local timeBuffer = 0.0 while true do Wait( 1000 ) -- (int)(GetMillisecondsPerGameMinute() / 60) SetWeather() SetTimeSync() local gameSecond = 10 timeBuffer = timeBuffer + round( 100.0 / gameSecond, 0 ) if timeBuffer >= 1.0 then local skipSeconds = math.floor( timeBuffer ) timeBuffer = timeBuffer - skipSeconds secondOfDay = secondOfDay + skipSeconds if secondOfDay >= 86400 then secondOfDay = secondOfDay % 86400 end end -- Apply time synctime.h = math.floor( secondOfDay / 3600 ) synctime.m = math.floor( (secondOfDay - (synctime.h * 3600)) / 60 ) synctime.s = secondOfDay - (synctime.h * 3600) - (synctime.m * 60) if enableSync and not insidebuilding and not inhotel and not robbing and not inhouse and not spawning then NetworkOverrideClockTime(synctime.h, synctime.m, synctime.s) TriggerServerEvent('weather:receivefromcl', secondOfDay)end end end) HudStage = 1 RegisterNetEvent("disableHUD") AddEventHandler("disableHUD", function(passedinfo) HudStage = passedinfo end) opacity = 0 fadein = false GPSActivated = false RegisterNetEvent("GPSActivated") AddEventHandler("GPSActivated", function(typesent) GPSActivated = typesent end) phoneEnabled = false RegisterNetEvent("phoneEnabled") AddEventHandler("phoneEnabled", function(typesent) phoneEnabled = typesent end) function drawTxt(x,y ,width,height,scale, text, r,g,b,a) SetTextFont(4) SetTextProportional(1) SetTextScale(0.0, 0.43) SetTextColour(r, g, b, opacity) SetTextDropshadow(0, 0, 0, 0, opacity) SetTextEdge(1, 0, 0, 0, opacity) SetTextDropShadow() SetTextOutline() SetTextEntry("STRING") AddTextComponentString(text) DrawText(x - width/2, y - height/2 + 0.005) end function round( n, precision ) if precision then return math.floor( (n * 10^precision) + 0.5 ) / (10^precision) end return math.floor( n + 0.5 ) end RegisterNetEvent('weather:blackout') AddEventHandler('weather:blackout', function(blackout) SetBlackout(blackout) end) RegisterNetEvent('weather:setCycle') AddEventHandler("weather:setCycle", function(cycle) SetTimecycleModifier(cycle) end) insideWeather = "CLEAR" curWeather = "CLEAR" RegisterNetEvent("kWeatherSync") AddEventHandler("kWeatherSync", function(wfer) curWeather = wfer -- if curWeather == 'SNOW' then -- SetForceVehicleTrails(true) -- SetForcePedFootstepsTracks(true) -- ForceSnowPass(true) -- else -- SetForceVehicleTrails(false) -- SetForcePedFootstepsTracks(false) -- ForceSnowPass(false) -- end end) RegisterNetEvent("kWeatherSyncForce") AddEventHandler("kWeatherSyncForce", function(wfer) curWeather = wfer weatherTimer = -99 SetWeather() end) kSyncConfigServer.weatherTypes = { "XMAS","EXTRASUNNY", "CLEAR", "CLOUDS", "OVERCAST", "CLEAR", "RAIN", "THUNDER", "CLEARING", "NEUTRAL" } function DrawText3Ds(x,y,z, text) local onScreen,_x,_y=World3dToScreen2d(x,y,z) local px,py,pz=table.unpack(GetGameplayCamCoords()) SetTextScale(0.35, 0.35) SetTextFont(4) SetTextProportional(1) SetTextColour(255, 255, 255, 175) SetTextEntry("STRING") SetTextCentre(1) AddTextComponentString(text) DrawText(_x,_y) local factor = (string.len(text)) / 370 DrawRect(_x,_y+0.0125, 0.015+ factor, 0.03, 41, 11, 41, 68) end RegisterNetEvent("robbing") AddEventHandler("robbing", function(status) robbing = status end) inhouse = false RegisterNetEvent("inhouse") AddEventHandler("inhouse", function(status) inhouse = status end) RegisterNetEvent("inhotel") AddEventHandler("inhotel", function(status) inhotel = status end) inhotel = false oldweather = "none" weatherTimer = 0 function SetWeather() local coordsply = GetEntityCoords(PlayerPedId()) if (robbing or insidebuilding or inhotel or inhouse) and not spawning then if not robbing then local lights = GetEntityCoords(PlayerPedId()) --DrawLightWithRange(lights["x"],lights["y"],lights["z"]+3, 255, 197, 143, 100.0, 0.05) --DrawLightWithRange(lights["x"],lights["y"],lights["z"]-3, 255, 197, 143, 100.0, 0.05) NetworkOverrideClockTime( 23, 0, 0 ) TriggerEvent("inside:weather",true) else NetworkOverrideClockTime( 23, 0, 0 ) TriggerEvent("inside:weather",true) end end if (robbing or insidebuilding or inhouse) then ClearOverrideWeather() ClearWeatherTypePersist() SetWeatherTypePersist(insideWeather) SetWeatherTypeNow(insideWeather) SetWeatherTypeNowPersist(insideWeather) weatherTimer = 22000 end if (coordsply["z"] < -30 and not insidebuilding and not robbing) or inhotel or inhouse then insidebuilding = true ClearOverrideWeather() ClearWeatherTypePersist() SetWeatherTypePersist(insideWeather) SetWeatherTypeNow(insideWeather) SetWeatherTypeNowPersist(insideWeather) weatherTimer = 22000 waitSet = true else if curWeather ~= oldweather or (insidebuilding and coordsply["z"] > -29) then SetWeatherTypeOverTime(curWeather, 120.0) weatherTimer = 55000 oldweather = curWeather insidebuilding = false end weatherTimer = weatherTimer - 1 if weatherTimer < 0 and curWeather == oldweather then TriggerEvent("inside:weather",false) weatherTimer = 60000 ClearOverrideWeather() ClearWeatherTypePersist() SetWeatherTypePersist(curWeather) SetWeatherTypeNow(curWeather) SetWeatherTypeNowPersist(curWeather) SetForceVehicleTrails(curWeather == 'BLIZZARD' or curWeather == 'XMAS') SetForcePedFootstepsTracks(curWeather == 'BLIZZARD' or curWeather == 'XMAS') ForceSnowPass(curWeather == 'BLIZZARD' or curWeather == 'XMAS' ) elseif weatherTimer < 0 and (insidebuilding or robbing or inhouse) then weatherTimer = 10000 ClearOverrideWeather() ClearWeatherTypePersist() SetWeatherTypePersist(insideWeather) SetWeatherTypeNow(insideWeather) SetWeatherTypeNowPersist(insideWeather) end end end local lastminute = 0 function SetTimeSync() local coordsply = GetEntityCoords(PlayerPedId()) synctime.h = math.floor( secondOfDay / 3600 ) synctime.m = math.floor( (secondOfDay - (synctime.h * 3600)) / 60 ) synctime.s = secondOfDay - (synctime.h * 3600) - (synctime.m * 60) if (synctime.h > 19 or synctime.h < 7) and daytime then daytime = false TriggerEvent("daytime",daytime) elseif (synctime.h <= 19 and synctime.h >= 7) and not daytime then daytime = true TriggerEvent("daytime",daytime) end if (synctime.h > 9 or synctime.h < 17) and not lunchtime then lunchtime = true TriggerEvent("lunchtime",lunchtime) elseif (synctime.h <= 9 and synctime.h >= 17) and lunchtime then lunchtime = false TriggerEvent("lunchtime",lunchtime) end if (synctime.h > 21 or synctime.h < 23) and not cocainetime then cocainetime = true TriggerEvent("cocainetime",cocainetime) elseif (synctime.h <= 21 and synctime.h >= 23) and cocainetime then cocainetime = false TriggerEvent("cocainetime",cocainetime) end if (synctime.h > 6 or synctime.h < 10) and not cracktime then cracktime = true TriggerEvent("cracktime",cracktime) elseif (synctime.h <= 6 and synctime.h >= 10) and cracktime then cracktime = false TriggerEvent("cracktime",cracktime) end if (synctime.h > 15 or synctime.h < 23) and primetime then primetime = false TriggerEvent("primetime",primetime) elseif (synctime.h <= 15 and synctime.h >= 23) and not primetime then primetime = true TriggerEvent("primetime",primetime) end if synctime.m ~= lastminute then lastminute = synctime.m TriggerEvent("timeheader",synctime.h,synctime.m) end end
------------------------- --- BadgerBankRobbery --- ------------------------- robberyActive = false RegisterNetEvent('BadgerBankRobbery:IsActive:Return') AddEventHandler('BadgerBankRobbery:IsActive:Return', function(bool) robberyActive = bool end) Citizen.CreateThread(function() while true do Citizen.Wait(0) if not robberyActive then if (config.enableBanks == true) then for _, bankcoords in pairs(config.bankcoords) do DrawMarker(27, bankcoords.x, bankcoords.y, bankcoords.z, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 4.0, 4.0, .2, 255, 0, 0, 255, false, true, 2, false, nil, nil, false) end end if (config.enableAmmunations == true) then for _, ammunationcoords in pairs(config.ammunationcoords) do DrawMarker(27, ammunationcoords.x, ammunationcoords.y, ammunationcoords.z, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 3.0, 3.0, .2, 255, 0, 0, 255, false, true, 2, false, nil, nil, false) end end if (config.enable247 == true) then for _, shopcoords in pairs(config.shopcoords) do DrawMarker(27, shopcoords.x, shopcoords.y, shopcoords.z, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 3.0, 3.0, .2, 255, 0, 0, 255, false, true, 2, false, nil, nil, false) end end if (config.enableGasStations == true) then for _, ltdcoords in pairs(config.ltdcoords) do DrawMarker(27, ltdcoords.x, ltdcoords.y, ltdcoords.z, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 3.0, 3.0, .2, 255, 0, 0, 255, false, true, 2, false, nil, nil, false) end end if (config.enableLiquor == true) then for _, liquorcoords in pairs(config.liquorcoords) do DrawMarker(27, liquorcoords.x, liquorcoords.y, liquorcoords.z, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 3.0, 3.0, .2, 255, 0, 0, 255, false, true, 2, false, nil, nil, false) end end -- Bank Code local coords = GetEntityCoords(GetPlayerPed(-1)) for _, bankcoords in pairs(config.bankcoords) do if (config.enableBanks == true) then if GetDistanceBetweenCoords(coords.x, coords.y, coords.z, bankcoords.x, bankcoords.y, bankcoords.z, true) < 5.0 then DisplayNotification('~r~Press the ~w~E ~r~key to rob the bank') if IsControlJustReleased(0, 38) then -- E key TriggerServerEvent('BadgerBankRobbery:SetActive', true) TriggerServerEvent('PrintBR:PrintMessage', bankcoords.alarm) if (config.displayBlips == true) then bankcoords.blip = AddBlipForCoord(bankcoords.x, bankcoords.y, bankcoords.z) SetBlipSprite(bankcoords.blip, 353) SetBlipFlashTimer(bankcoords.blip, 1000 * config.timeToRob) SetBlipAsShortRange(bankcoords.blip, true) BeginTextCommandSetBlipName("STRING") AddTextComponentString(bankcoords.name) EndTextCommandSetBlipName(bankcoords.blip) end TriggerEvent("mythic_progbar:client:progress", { name = "RobbingTheBank", duration = (1000 * config.timeToRob), -- 1000ms * x seconds label = config.robbingStr, useWhileDead = false, canCancel = false, controlDisables = { disableMovement = true, disableCarMovement = true, disableMouse = false, disableCombat = true, }, animation = { animDict = "anim@amb@clubhouse@tutorial@bkr_tut_ig3@", anim = "machinic_loop_mechandplayer", flags = 49, }, prop = { model = "prop_ing_crowbar", } }, function(status) if not status and not IsEntityDead(GetPlayerPed(-1)) then DisplayNotification('~g~Success: You have robbed the bank successfully!') TriggerServerEvent('PrintBR:PrintMessage', config.robberySuccess) else DisplayNotification('~r~Failed: Your bank robbery has failed.') TriggerServerEvent('PrintBR:PrintMessage', config.robberyFailed) end end) Wait(1000 * config.timeToRob) RemoveBlip(bankcoords.blip) end end end end -- Ammunation Code for _, ammunationcoords in pairs(config.ammunationcoords) do if (config.enableAmmunations == true) then if GetDistanceBetweenCoords(coords.x, coords.y, coords.z, ammunationcoords.x, ammunationcoords.y, ammunationcoords.z) < 5.0 then DisplayNotification('~r~Press the ~w~E ~r~key to rob the Ammunation') if IsControlJustReleased(0, 38) then -- E TriggerServerEvent('PrintBR:PrintMessage', ammunationcoords.alarm) TriggerServerEvent('BadgerBankRobbery:SetActive', true) if (config.displayBlips == true) then ammunationcoords.blip = AddBlipForCoord(ammunationcoords.x, ammunationcoords.y, ammunationcoords.z) SetBlipSprite(ammunationcoords.blip, 353) SetBlipFlashTimer(ammunationcoords.blip, 1000 * config.timeToRob) SetBlipAsShortRange(ammunationcoords.blip, true) BeginTextCommandSetBlipName("STRING") AddTextComponentString(ammunationcoords.name) EndTextCommandSetBlipName(ammunationcoords.blip) end TriggerEvent("mythic_progbar:client:progress", { name = "RobbingTheBank", duration = (1000 * config.timeToRob), -- 1000ms * x seconds label = config.robbingStr, useWhileDead = false, canCancel = false, controlDisables = { disableMovement = true, disableCarMovement = true, disableMouse = false, disableCombat = true, }, animation = { animDict = "anim@amb@clubhouse@tutorial@bkr_tut_ig3@", anim = "machinic_loop_mechandplayer", flags = 49, }, prop = { model = "prop_ing_crowbar", } }, function(status) if not status and not IsEntityDead(GetPlayerPed(-1)) then DisplayNotification('~g~Success: You have robbed the Ammunation successfully!') TriggerServerEvent('PrintBR:PrintMessage', config.robberySuccess) else DisplayNotification('~r~Failed: Your Ammunation robbery has failed.') TriggerServerEvent('PrintBR:PrintMessage', config.robberyFailed) end end) Wait(1000 * config.timeToRob) RemoveBlip(ammunationcoords.blip) end end end end -- 24/7 Code for _, shopcoords in pairs(config.shopcoords) do if (config.enable247 == true) then if GetDistanceBetweenCoords(coords.x, coords.y, coords.z, shopcoords.x, shopcoords.y, shopcoords.z) < 5.0 then DisplayNotification('~r~Press the ~w~E ~r~key to rob the 24/7') if IsControlJustReleased(0, 38) then -- E TriggerServerEvent('PrintBR:PrintMessage', shopcoords.alarm) TriggerServerEvent('BadgerBankRobbery:SetActive', true) if (config.displayBlips == true) then shopcoords.blip = AddBlipForCoord(shopcoords.x, shopcoords.y, shopcoords.z) SetBlipSprite(shopcoords.blip, 353) SetBlipFlashTimer(shopcoords.blip, 1000 * config.timeToRob) SetBlipAsShortRange(shopcoords.blip, true) BeginTextCommandSetBlipName("STRING") AddTextComponentString(shopcoords.name) EndTextCommandSetBlipName(shopcoords.blip) end TriggerEvent("mythic_progbar:client:progress", { name = "RobbingTheBank", duration = (1000 * config.timeToRob), -- 1000ms * x seconds label = config.robbingStr, useWhileDead = false, canCancel = false, controlDisables = { disableMovement = true, disableCarMovement = true, disableMouse = false, disableCombat = true, }, animation = { animDict = "anim@amb@clubhouse@tutorial@bkr_tut_ig3@", anim = "machinic_loop_mechandplayer", flags = 49, }, prop = { model = "prop_ing_crowbar", } }, function(status) if not status and not IsEntityDead(GetPlayerPed(-1)) then DisplayNotification('~g~Success: You have robbed the 24/7 successfully!') TriggerServerEvent('PrintBR:PrintMessage', config.robberySuccess) else DisplayNotification('~r~Failed: Your 24/7 robbery has failed.') TriggerServerEvent('PrintBR:PrintMessage', config.robberyFailed) end end) Wait(1000 * config.timeToRob) RemoveBlip(shopcoords.blip) end end end end -- LTD Code for _, ltdcoords in pairs(config.ltdcoords) do if (config.enableGasStations == true) then if GetDistanceBetweenCoords(coords.x, coords.y, coords.z, ltdcoords.x, ltdcoords.y, ltdcoords.z) < 5.0 then DisplayNotification('~r~Press the ~w~E ~r~key to rob the LTD Gas Station') if IsControlJustReleased(0, 38) then -- E TriggerServerEvent('PrintBR:PrintMessage', ltdcoords.alarm) TriggerServerEvent('BadgerBankRobbery:SetActive', true) if (config.displayBlips == true) then ltdcoords.blip = AddBlipForCoord(ltdcoords.x, ltdcoords.y, ltdcoords.z) SetBlipSprite(ltdcoords.blip, 353) SetBlipFlashTimer(ltdcoords.blip, 1000 * config.timeToRob) SetBlipAsShortRange(ltdcoords.blip, true) BeginTextCommandSetBlipName("STRING") AddTextComponentString(ltdcoords.name) EndTextCommandSetBlipName(ltdcoords.blip) end TriggerEvent("mythic_progbar:client:progress", { name = "RobbingTheBank", duration = (1000 * config.timeToRob), -- 1000ms * x seconds label = config.robbingStr, useWhileDead = false, canCancel = false, controlDisables = { disableMovement = true, disableCarMovement = true, disableMouse = false, disableCombat = true, }, animation = { animDict = "anim@amb@clubhouse@tutorial@bkr_tut_ig3@", anim = "machinic_loop_mechandplayer", flags = 49, }, prop = { model = "prop_ing_crowbar", } }, function(status) if not status and not IsEntityDead(GetPlayerPed(-1)) then DisplayNotification('~g~Success: You have robbed the LTD Gas Station successfully!') TriggerServerEvent('PrintBR:PrintMessage', config.robberySuccess) else DisplayNotification('~r~Failed: Your LTD Gas Station robbery has failed.') TriggerServerEvent('PrintBR:PrintMessage', config.robberyFailed) end end) Wait(1000 * config.timeToRob) RemoveBlip(ltdcoords.blip) end end end end -- Liquor Store Code for _, liquorcoords in pairs(config.liquorcoords) do if (config.enableLiquor == true) then if GetDistanceBetweenCoords(coords.x, coords.y, coords.z, liquorcoords.x, liquorcoords.y, liquorcoords.z) < 5.0 then DisplayNotification('~r~Press the ~w~E ~r~key to rob the Liquor Store') if IsControlJustReleased(0, 38) then -- E TriggerServerEvent('PrintBR:PrintMessage', liquorcoords.alarm) TriggerServerEvent('BadgerBankRobbery:SetActive', true) liquorcoords.blip = AddBlipForCoord(liquorcoords.x, liquorcoords.y, liquorcoords.z) SetBlipSprite(liquorcoords.blip, 353) SetBlipFlashTimer(liquorcoords.blip, 1000 * config.timeToRob) SetBlipAsShortRange(liquorcoords.blip, true) BeginTextCommandSetBlipName("STRING") AddTextComponentString(liquorcoords.name) EndTextCommandSetBlipName(liquorcoords.blip) TriggerEvent("mythic_progbar:client:progress", { name = "RobbingTheBank", duration = (1000 * config.timeToRob), -- 1000ms * x seconds label = config.robbingStr, useWhileDead = false, canCancel = false, controlDisables = { disableMovement = true, disableCarMovement = true, disableMouse = false, disableCombat = true, }, animation = { animDict = "anim@amb@clubhouse@tutorial@bkr_tut_ig3@", anim = "machinic_loop_mechandplayer", flags = 49, }, prop = { model = "prop_ing_crowbar", } }, function(status) if not status and not IsEntityDead(GetPlayerPed(-1)) then DisplayNotification('~g~Success: You have robbed the Liquor Store successfully!') TriggerServerEvent('PrintBR:PrintMessage', config.robberySuccess) else DisplayNotification('~r~Failed: Your Liquor Store robbery has failed.') TriggerServerEvent('PrintBR:PrintMessage', config.robberyFailed) end end) Wait(1000 * config.timeToRob) RemoveBlip(liquorcoords.blip) end end end end end end end) function DisplayNotification( text ) SetNotificationTextEntry( "STRING" ) AddTextComponentString( text ) DrawNotification( false, false ) end Citizen.CreateThread(function() while true do Citizen.Wait(1000) TriggerServerEvent('BadgerBankRobbery:IsActive') end end)
--setBufferName("shiftenter.lua") codelog = {} do setKeyHandlerProgram(keymap, stdkeyids.enter, 1, [[ local sCode = edGetLuaBlock() local p1,p2 = edGetLuaBlockPosition() if sCode == "" then sCode = getEditorLineText() p2 = getEditorLineEnd() end edSetPosition(p2) edInsertNewline() luaCall(sCode) table.insert(codelog, sCode) setClearColor(200,0,0) ]]) end do setKeyHandlerProgram(keymap, stdkeyids.enter, 2, [[ local sCode = edGetLuaBlock() if sCode == "" then sCode = getEditorLineText() end luaCall(sCode) table.insert(codelog, sCode) setClearColor(200,0,0) ]]) end do setKeyHandlerProgram(keymap, stdkeyids["s"], 2, [[ saveBuffer() setClearColor(0,200,0) print(getBufferName() .. " saved.") ]]) end --print2(codelog[#codelog]) function makeCodeLogBuffer() parentBufferName = getBufferName() local sText = "" for i=1,#codelog,1 do sText = sText .. "Entry " .. i .. "\n" sText = sText .. codelog[i] .. "\n\n" end newBuffer("codelog.txt") setBufferText(sText) edSetPosition(#sText - 1) end showTrace() print("codelogger logging") --clearTrace() do local clamp = function (x) if x < 0 then x = 0 end return x end function update() WidgetLib.callAll("update") for i=1,#skythings,1 do local thing = skythings[i] local planepos = vec3d(transform.getTranslation(airplane.lspace)) local tween = thing.p - planepos local dist = Vector3D.magnitude(tween) tween = Vector3D.normalize(tween) if dist < (30 + thing.r) then thing.p = planepos + (tween * (30+thing.r)) end end local r,g,b = getClearColor() r = clamp(r - 20) g = clamp(g - 20) setClearColor(r,g,b) end end -- passing a number by reference???
local class = require "ecs.common.class" local mt = class("entity_mgr") function mt:on_new() self.archetypes = {} self.e_to_arche_map = {} self.eid = 0 end function mt:foreach(filter, cb) local chunks = self:get_chunks_by_filter(filter) for _,chunk in ipairs(chunks) do for _,e_data in pairs(chunk) do --CAT_TODO:应该要返回一个中间table,防止在cb里访问不存在的component cb(e_data) end end end function mt:get_chunks_by_filter(filter) local ret = {} for archetype_name,v in pairs(self.archetypes) do local archetype = self.archetypes[archetype_name] if self:is_match(archetype.com_names_map, filter) then ret[#ret + 1] = v.chunk end end return ret end function mt:is_match(com_names_map, filter) if type(filter) == "string" then return com_names_map[filter] else if filter.type == "all" then for _,com_name_or_filter in ipairs(filter.com_name_or_filters) do if not self:is_match(com_names_map, com_name_or_filter) then return false end end return true elseif filter.type == "any" then for _,com_name_or_filter in ipairs(filter.com_name_or_filters) do if self:is_match(com_names_map, com_name_or_filter) then return true end end return false elseif filter.type == "no" then for _,com_name_or_filter in ipairs(filter.com_name_or_filters) do if self:is_match(com_names_map, com_name_or_filter) then return false end end return true end end return false end function mt:create_entity(...) local com_names = {...} local archetype = self:get_archetype_by_list(com_names) return self:create_entity_by_archetype(archetype) end function mt:create_entity_by_archetype(archetype) self.eid = self.eid + 1 local e = self.eid self:__add_to_archetype(e, archetype) return e end function mt:is_entity_exist(e) return self.e_to_arche_map[e] ~= nil end function mt:destroy_entity(e) local archetype = self.e_to_arche_map[e] archetype.chunk[e] = nil self.e_to_arche_map[e] = nil end function mt:__add_to_archetype( e, archetype ) local last_archetype = self.e_to_arche_map[e] if last_archetype then archetype.chunk[e] = last_archetype.chunk[e] last_archetype.chunk[e] = nil else archetype.chunk[e] = { entity = e, } end self.e_to_arche_map[e] = archetype end function mt:get_component(e, com_name) local archetype = self.e_to_arche_map[e] if archetype then return archetype.chunk[e][com_name] end return nil end function mt:set_component(e, com_name, com_val) local already_has_com = self:has_component(e, com_name) local archetype = self.e_to_arche_map[e] if already_has_com then archetype.chunk[e][com_name] = com_val else local new_com_names = {} for name,v in pairs(archetype.com_names_map) do new_com_names[#new_com_names + 1] = name end new_com_names[#new_com_names + 1] = com_name local new_archetype = self:get_archetype_by_list(new_com_names) self:__add_to_archetype(e, new_archetype) new_archetype.chunk[e][com_name] = com_val end end function mt:remove_component(e, com_name) local already_has_com = self:has_component(e, com_name) if already_has_com then local archetype = self.e_to_arche_map[e] local new_com_names = {} for name,v in pairs(archetype.com_names_map) do if name ~= com_name then new_com_names[#new_com_names + 1] = name end end local new_archetype = self:get_archetype_by_list(new_com_names) self:__add_to_archetype(e, new_archetype) new_archetype.chunk[e][com_name] = nil end end function mt:has_component(e, com_name) local archetype = self.e_to_arche_map[e] if archetype.com_names_map[com_name] then return true end return false end function mt:get_archetype_by_list(com_names) table.sort(com_names) local str = table.concat(com_names, "$") if not self.archetypes[str] then self.archetypes[str] = { com_names_map = nil, type_name = str, chunk = {} } local com_names_map = {} for _,name in ipairs(com_names) do com_names_map[name] = true end self.archetypes[str].com_names_map = com_names_map end return self.archetypes[str] end function mt:get_archetype(...) return self:get_archetype_by_list({...}) end return mt
---- Shared vars ---- -- Range and bearing MAX_LANDMARK_SENSING_RANGE = 30 LANDMARK_SIGNAL_CHANNEL = 1 LANDMARK_EXPLORED_NOTIIFICATION_CHANNEL = 2
---[[---------------------------------------------------------------------]]--- -- __ __ _ -- -- ____ ____ / /_ ______ ___ ____ _________ / /_ (_)____ -- -- / __ \/ __ \/ / / / / __ `__ \/ __ \/ ___/ __ \/ __ \/ / ___/ -- -- / /_/ / /_/ / / /_/ / / / / / / /_/ / / / /_/ / / / / / /__ -- -- / .___/\____/_/\__, /_/ /_/ /_/\____/_/ / .___/_/ /_/_/\___/ -- -- /_/ /____/ /_/ -- -- NeoVim configuration which can make your dreams come true. -- ---[[---------------------------------------------------------------------]]--- -- Author: Mora Unie Youer <mora_unie_youer@riseup.net> -- -- URLs: https://github.com/mora-unie-youer/polymorphic -- -- https://gitlab.com/mora-unie-youer/polymorphic -- -- https://notabug.org/mora-unie-youer/polymorphic -- -- License: MIT -- ---[[---------------------------------------------------------------------]]--- -- Storing startup time vim.g.start_time = vim.fn.reltime() -- Loading impatient.nvim at the start pcall(require, 'impatient') local load_modules = require('polymorphic.utils.modules').load_modules -- Load polymorphic core load_modules('polymorphic', { 'core' }) vim.defer_fn(function() -- Load polymorphic modules load_modules('polymorphic', { 'modules' }) end, 0)
-- This file is part of SA MoonLoader package. -- Licensed under the MIT License. -- Copyright (c) 2016, BlastHack Team <blast.hk> -- From https://wiki.winehq.org/List_Of_Windows_Messages local messages = { WM_CREATE = 0x0001, WM_DESTROY = 0x0002, WM_MOVE = 0x0003, WM_SIZE = 0x0005, WM_ACTIVATE = 0x0006, WM_SETFOCUS = 0x0007, WM_KILLFOCUS = 0x0008, WM_ENABLE = 0x000a, WM_SETREDRAW = 0x000b, WM_SETTEXT = 0x000c, WM_GETTEXT = 0x000d, WM_GETTEXTLENGTH = 0x000e, WM_PAINT = 0x000f, WM_CLOSE = 0x0010, WM_QUERYENDSESSION = 0x0011, WM_QUIT = 0x0012, WM_QUERYOPEN = 0x0013, WM_ERASEBKGND = 0x0014, WM_SYSCOLORCHANGE = 0x0015, WM_ENDSESSION = 0x0016, WM_SHOWWINDOW = 0x0018, WM_CTLCOLOR = 0x0019, WM_WININICHANGE = 0x001a, WM_DEVMODECHANGE = 0x001b, WM_ACTIVATEAPP = 0x001c, WM_FONTCHANGE = 0x001d, WM_TIMECHANGE = 0x001e, WM_CANCELMODE = 0x001f, WM_SETCURSOR = 0x0020, WM_MOUSEACTIVATE = 0x0021, WM_CHILDACTIVATE = 0x0022, WM_QUEUESYNC = 0x0023, WM_GETMINMAXINFO = 0x0024, WM_PAINTICON = 0x0026, WM_ICONERASEBKGND = 0x0027, WM_NEXTDLGCTL = 0x0028, WM_SPOOLERSTATUS = 0x002a, WM_DRAWITEM = 0x002b, WM_MEASUREITEM = 0x002c, WM_DELETEITEM = 0x002d, WM_VKEYTOITEM = 0x002e, WM_CHARTOITEM = 0x002f, WM_SETFONT = 0x0030, WM_GETFONT = 0x0031, WM_SETHOTKEY = 0x0032, WM_GETHOTKEY = 0x0033, WM_QUERYDRAGICON = 0x0037, WM_COMPAREITEM = 0x0039, WM_GETOBJECT = 0x003d, WM_COMPACTING = 0x0041, WM_COMMNOTIFY = 0x0044, WM_WINDOWPOSCHANGING = 0x0046, WM_WINDOWPOSCHANGED = 0x0047, WM_POWER = 0x0048, WM_COPYGLOBALDATA = 0x0049, WM_COPYDATA = 0x004a, WM_CANCELJOURNAL = 0x004b, WM_NOTIFY = 0x004e, WM_INPUTLANGCHANGEREQUEST = 0x0050, WM_INPUTLANGCHANGE = 0x0051, WM_TCARD = 0x0052, WM_HELP = 0x0053, WM_USERCHANGED = 0x0054, WM_NOTIFYFORMAT = 0x0055, WM_CONTEXTMENU = 0x007b, WM_STYLECHANGING = 0x007c, WM_STYLECHANGED = 0x007d, WM_DISPLAYCHANGE = 0x007e, WM_GETICON = 0x007f, WM_SETICON = 0x0080, WM_NCCREATE = 0x0081, WM_NCDESTROY = 0x0082, WM_NCCALCSIZE = 0x0083, WM_NCHITTEST = 0x0084, WM_NCPAINT = 0x0085, WM_NCACTIVATE = 0x0086, WM_GETDLGCODE = 0x0087, WM_SYNCPAINT = 0x0088, WM_NCMOUSEMOVE = 0x00a0, WM_NCLBUTTONDOWN = 0x00a1, WM_NCLBUTTONUP = 0x00a2, WM_NCLBUTTONDBLCLK = 0x00a3, WM_NCRBUTTONDOWN = 0x00a4, WM_NCRBUTTONUP = 0x00a5, WM_NCRBUTTONDBLCLK = 0x00a6, WM_NCMBUTTONDOWN = 0x00a7, WM_NCMBUTTONUP = 0x00a8, WM_NCMBUTTONDBLCLK = 0x00a9, WM_NCXBUTTONDOWN = 0x00ab, WM_NCXBUTTONUP = 0x00ac, WM_NCXBUTTONDBLCLK = 0x00ad, EM_GETSEL = 0x00b0, EM_SETSEL = 0x00b1, EM_GETRECT = 0x00b2, EM_SETRECT = 0x00b3, EM_SETRECTNP = 0x00b4, EM_SCROLL = 0x00b5, EM_LINESCROLL = 0x00b6, EM_SCROLLCARET = 0x00b7, EM_GETMODIFY = 0x00b8, EM_SETMODIFY = 0x00b9, EM_GETLINECOUNT = 0x00ba, EM_LINEINDEX = 0x00bb, EM_SETHANDLE = 0x00bc, EM_GETHANDLE = 0x00bd, EM_GETTHUMB = 0x00be, EM_LINELENGTH = 0x00c1, EM_REPLACESEL = 0x00c2, EM_SETFONT = 0x00c3, EM_GETLINE = 0x00c4, EM_LIMITTEXT = 0x00c5, EM_SETLIMITTEXT = 0x00c5, EM_CANUNDO = 0x00c6, EM_UNDO = 0x00c7, EM_FMTLINES = 0x00c8, EM_LINEFROMCHAR = 0x00c9, EM_SETWORDBREAK = 0x00ca, EM_SETTABSTOPS = 0x00cb, EM_SETPASSWORDCHAR = 0x00cc, EM_EMPTYUNDOBUFFER = 0x00cd, EM_GETFIRSTVISIBLELINE = 0x00ce, EM_SETREADONLY = 0x00cf, EM_SETWORDBREAKPROC = 0x00d0, EM_GETWORDBREAKPROC = 0x00d1, EM_GETPASSWORDCHAR = 0x00d2, EM_SETMARGINS = 0x00d3, EM_GETMARGINS = 0x00d4, EM_GETLIMITTEXT = 0x00d5, EM_POSFROMCHAR = 0x00d6, EM_CHARFROMPOS = 0x00d7, EM_SETIMESTATUS = 0x00d8, EM_GETIMESTATUS = 0x00d9, SBM_SETPOS = 0x00e0, SBM_GETPOS = 0x00e1, SBM_SETRANGE = 0x00e2, SBM_GETRANGE = 0x00e3, SBM_ENABLE_ARROWS = 0x00e4, SBM_SETRANGEREDRAW = 0x00e6, SBM_SETSCROLLINFO = 0x00e9, SBM_GETSCROLLINFO = 0x00ea, SBM_GETSCROLLBARINFO = 0x00eb, BM_GETCHECK = 0x00f0, BM_SETCHECK = 0x00f1, BM_GETSTATE = 0x00f2, BM_SETSTATE = 0x00f3, BM_SETSTYLE = 0x00f4, BM_CLICK = 0x00f5, BM_GETIMAGE = 0x00f6, BM_SETIMAGE = 0x00f7, BM_SETDONTCLICK = 0x00f8, WM_INPUT = 0x00ff, WM_KEYDOWN = 0x0100, WM_KEYFIRST = 0x0100, WM_KEYUP = 0x0101, WM_CHAR = 0x0102, WM_DEADCHAR = 0x0103, WM_SYSKEYDOWN = 0x0104, WM_SYSKEYUP = 0x0105, WM_SYSCHAR = 0x0106, WM_SYSDEADCHAR = 0x0107, WM_KEYLAST = 0x0108, WM_UNICHAR = 0x0109, WM_WNT_CONVERTREQUESTEX = 0x0109, WM_CONVERTREQUEST = 0x010a, WM_CONVERTRESULT = 0x010b, WM_INTERIM = 0x010c, WM_IME_STARTCOMPOSITION = 0x010d, WM_IME_ENDCOMPOSITION = 0x010e, WM_IME_COMPOSITION = 0x010f, WM_IME_KEYLAST = 0x010f, WM_INITDIALOG = 0x0110, WM_COMMAND = 0x0111, WM_SYSCOMMAND = 0x0112, WM_TIMER = 0x0113, WM_HSCROLL = 0x0114, WM_VSCROLL = 0x0115, WM_INITMENU = 0x0116, WM_INITMENUPOPUP = 0x0117, WM_SYSTIMER = 0x0118, WM_MENUSELECT = 0x011f, WM_MENUCHAR = 0x0120, WM_ENTERIDLE = 0x0121, WM_MENURBUTTONUP = 0x0122, WM_MENUDRAG = 0x0123, WM_MENUGETOBJECT = 0x0124, WM_UNINITMENUPOPUP = 0x0125, WM_MENUCOMMAND = 0x0126, WM_CHANGEUISTATE = 0x0127, WM_UPDATEUISTATE = 0x0128, WM_QUERYUISTATE = 0x0129, WM_CTLCOLORMSGBOX = 0x0132, WM_CTLCOLOREDIT = 0x0133, WM_CTLCOLORLISTBOX = 0x0134, WM_CTLCOLORBTN = 0x0135, WM_CTLCOLORDLG = 0x0136, WM_CTLCOLORSCROLLBAR = 0x0137, WM_CTLCOLORSTATIC = 0x0138, WM_MOUSEFIRST = 0x0200, WM_MOUSEMOVE = 0x0200, WM_LBUTTONDOWN = 0x0201, WM_LBUTTONUP = 0x0202, WM_LBUTTONDBLCLK = 0x0203, WM_RBUTTONDOWN = 0x0204, WM_RBUTTONUP = 0x0205, WM_RBUTTONDBLCLK = 0x0206, WM_MBUTTONDOWN = 0x0207, WM_MBUTTONUP = 0x0208, WM_MBUTTONDBLCLK = 0x0209, WM_MOUSELAST = 0x0209, WM_MOUSEWHEEL = 0x020a, WM_XBUTTONDOWN = 0x020b, WM_XBUTTONUP = 0x020c, WM_XBUTTONDBLCLK = 0x020d, WM_PARENTNOTIFY = 0x0210, WM_ENTERMENULOOP = 0x0211, WM_EXITMENULOOP = 0x0212, WM_NEXTMENU = 0x0213, WM_SIZING = 0x0214, WM_CAPTURECHANGED = 0x0215, WM_MOVING = 0x0216, WM_POWERBROADCAST = 0x0218, WM_DEVICECHANGE = 0x0219, WM_MDICREATE = 0x0220, WM_MDIDESTROY = 0x0221, WM_MDIACTIVATE = 0x0222, WM_MDIRESTORE = 0x0223, WM_MDINEXT = 0x0224, WM_MDIMAXIMIZE = 0x0225, WM_MDITILE = 0x0226, WM_MDICASCADE = 0x0227, WM_MDIICONARRANGE = 0x0228, WM_MDIGETACTIVE = 0x0229, WM_MDISETMENU = 0x0230, WM_ENTERSIZEMOVE = 0x0231, WM_EXITSIZEMOVE = 0x0232, WM_DROPFILES = 0x0233, WM_MDIREFRESHMENU = 0x0234, WM_IME_REPORT = 0x0280, WM_IME_SETCONTEXT = 0x0281, WM_IME_NOTIFY = 0x0282, WM_IME_CONTROL = 0x0283, WM_IME_COMPOSITIONFULL = 0x0284, WM_IME_SELECT = 0x0285, WM_IME_CHAR = 0x0286, WM_IME_REQUEST = 0x0288, WM_IMEKEYDOWN = 0x0290, WM_IME_KEYDOWN = 0x0290, WM_IMEKEYUP = 0x0291, WM_IME_KEYUP = 0x0291, WM_NCMOUSEHOVER = 0x02a0, WM_MOUSEHOVER = 0x02a1, WM_NCMOUSELEAVE = 0x02a2, WM_MOUSELEAVE = 0x02a3, WM_CUT = 0x0300, WM_COPY = 0x0301, WM_PASTE = 0x0302, WM_CLEAR = 0x0303, WM_UNDO = 0x0304, WM_RENDERFORMAT = 0x0305, WM_RENDERALLFORMATS = 0x0306, WM_DESTROYCLIPBOARD = 0x0307, WM_DRAWCLIPBOARD = 0x0308, WM_PAINTCLIPBOARD = 0x0309, WM_VSCROLLCLIPBOARD = 0x030a, WM_SIZECLIPBOARD = 0x030b, WM_ASKCBFORMATNAME = 0x030c, WM_CHANGECBCHAIN = 0x030d, WM_HSCROLLCLIPBOARD = 0x030e, WM_QUERYNEWPALETTE = 0x030f, WM_PALETTEISCHANGING = 0x0310, WM_PALETTECHANGED = 0x0311, WM_HOTKEY = 0x0312, WM_PRINT = 0x0317, WM_PRINTCLIENT = 0x0318, WM_APPCOMMAND = 0x0319, WM_HANDHELDFIRST = 0x0358, WM_HANDHELDLAST = 0x035f, WM_AFXFIRST = 0x0360, WM_AFXLAST = 0x037f, WM_PENWINFIRST = 0x0380, WM_RCRESULT = 0x0381, WM_HOOKRCRESULT = 0x0382, WM_GLOBALRCCHANGE = 0x0383, WM_PENMISCINFO = 0x0383, WM_SKB = 0x0384, WM_HEDITCTL = 0x0385, WM_PENCTL = 0x0385, WM_PENMISC = 0x0386, WM_CTLINIT = 0x0387, WM_PENEVENT = 0x0388, WM_PENWINLAST = 0x038f, DDM_SETFMT = 0x0400, DM_GETDEFID = 0x0400, NIN_SELECT = 0x0400, TBM_GETPOS = 0x0400, WM_PSD_PAGESETUPDLG = 0x0400, WM_USER = 0x0400, CBEM_INSERTITEMA = 0x0401, DDM_DRAW = 0x0401, DM_SETDEFID = 0x0401, HKM_SETHOTKEY = 0x0401, PBM_SETRANGE = 0x0401, RB_INSERTBANDA = 0x0401, SB_SETTEXTA = 0x0401, TB_ENABLEBUTTON = 0x0401, TBM_GETRANGEMIN = 0x0401, TTM_ACTIVATE = 0x0401, WM_CHOOSEFONT_GETLOGFONT = 0x0401, WM_PSD_FULLPAGERECT = 0x0401, CBEM_SETIMAGELIST = 0x0402, DDM_CLOSE = 0x0402, DM_REPOSITION = 0x0402, HKM_GETHOTKEY = 0x0402, PBM_SETPOS = 0x0402, RB_DELETEBAND = 0x0402, SB_GETTEXTA = 0x0402, TB_CHECKBUTTON = 0x0402, TBM_GETRANGEMAX = 0x0402, WM_PSD_MINMARGINRECT = 0x0402, CBEM_GETIMAGELIST = 0x0403, DDM_BEGIN = 0x0403, HKM_SETRULES = 0x0403, PBM_DELTAPOS = 0x0403, RB_GETBARINFO = 0x0403, SB_GETTEXTLENGTHA = 0x0403, TBM_GETTIC = 0x0403, TB_PRESSBUTTON = 0x0403, TTM_SETDELAYTIME = 0x0403, WM_PSD_MARGINRECT = 0x0403, CBEM_GETITEMA = 0x0404, DDM_END = 0x0404, PBM_SETSTEP = 0x0404, RB_SETBARINFO = 0x0404, SB_SETPARTS = 0x0404, TB_HIDEBUTTON = 0x0404, TBM_SETTIC = 0x0404, TTM_ADDTOOLA = 0x0404, WM_PSD_GREEKTEXTRECT = 0x0404, CBEM_SETITEMA = 0x0405, PBM_STEPIT = 0x0405, TB_INDETERMINATE = 0x0405, TBM_SETPOS = 0x0405, TTM_DELTOOLA = 0x0405, WM_PSD_ENVSTAMPRECT = 0x0405, CBEM_GETCOMBOCONTROL = 0x0406, PBM_SETRANGE32 = 0x0406, RB_SETBANDINFOA = 0x0406, SB_GETPARTS = 0x0406, TB_MARKBUTTON = 0x0406, TBM_SETRANGE = 0x0406, TTM_NEWTOOLRECTA = 0x0406, WM_PSD_YAFULLPAGERECT = 0x0406, CBEM_GETEDITCONTROL = 0x0407, PBM_GETRANGE = 0x0407, RB_SETPARENT = 0x0407, SB_GETBORDERS = 0x0407, TBM_SETRANGEMIN = 0x0407, TTM_RELAYEVENT = 0x0407, CBEM_SETEXSTYLE = 0x0408, PBM_GETPOS = 0x0408, RB_HITTEST = 0x0408, SB_SETMINHEIGHT = 0x0408, TBM_SETRANGEMAX = 0x0408, TTM_GETTOOLINFOA = 0x0408, CBEM_GETEXSTYLE = 0x0409, CBEM_GETEXTENDEDSTYLE = 0x0409, PBM_SETBARCOLOR = 0x0409, RB_GETRECT = 0x0409, SB_SIMPLE = 0x0409, TB_ISBUTTONENABLED = 0x0409, TBM_CLEARTICS = 0x0409, TTM_SETTOOLINFOA = 0x0409, CBEM_HASEDITCHANGED = 0x040a, RB_INSERTBANDW = 0x040a, SB_GETRECT = 0x040a, TB_ISBUTTONCHECKED = 0x040a, TBM_SETSEL = 0x040a, TTM_HITTESTA = 0x040a, WIZ_QUERYNUMPAGES = 0x040a, CBEM_INSERTITEMW = 0x040b, RB_SETBANDINFOW = 0x040b, SB_SETTEXTW = 0x040b, TB_ISBUTTONPRESSED = 0x040b, TBM_SETSELSTART = 0x040b, TTM_GETTEXTA = 0x040b, WIZ_NEXT = 0x040b, CBEM_SETITEMW = 0x040c, RB_GETBANDCOUNT = 0x040c, SB_GETTEXTLENGTHW = 0x040c, TB_ISBUTTONHIDDEN = 0x040c, TBM_SETSELEND = 0x040c, TTM_UPDATETIPTEXTA = 0x040c, WIZ_PREV = 0x040c, CBEM_GETITEMW = 0x040d, RB_GETROWCOUNT = 0x040d, SB_GETTEXTW = 0x040d, TB_ISBUTTONINDETERMINATE = 0x040d, TTM_GETTOOLCOUNT = 0x040d, CBEM_SETEXTENDEDSTYLE = 0x040e, RB_GETROWHEIGHT = 0x040e, SB_ISSIMPLE = 0x040e, TB_ISBUTTONHIGHLIGHTED = 0x040e, TBM_GETPTICS = 0x040e, TTM_ENUMTOOLSA = 0x040e, SB_SETICON = 0x040f, TBM_GETTICPOS = 0x040f, TTM_GETCURRENTTOOLA = 0x040f, RB_IDTOINDEX = 0x0410, SB_SETTIPTEXTA = 0x0410, TBM_GETNUMTICS = 0x0410, TTM_WINDOWFROMPOINT = 0x0410, RB_GETTOOLTIPS = 0x0411, SB_SETTIPTEXTW = 0x0411, TBM_GETSELSTART = 0x0411, TB_SETSTATE = 0x0411, TTM_TRACKACTIVATE = 0x0411, RB_SETTOOLTIPS = 0x0412, SB_GETTIPTEXTA = 0x0412, TB_GETSTATE = 0x0412, TBM_GETSELEND = 0x0412, TTM_TRACKPOSITION = 0x0412, RB_SETBKCOLOR = 0x0413, SB_GETTIPTEXTW = 0x0413, TB_ADDBITMAP = 0x0413, TBM_CLEARSEL = 0x0413, TTM_SETTIPBKCOLOR = 0x0413, RB_GETBKCOLOR = 0x0414, SB_GETICON = 0x0414, TB_ADDBUTTONSA = 0x0414, TBM_SETTICFREQ = 0x0414, TTM_SETTIPTEXTCOLOR = 0x0414, RB_SETTEXTCOLOR = 0x0415, TB_INSERTBUTTONA = 0x0415, TBM_SETPAGESIZE = 0x0415, TTM_GETDELAYTIME = 0x0415, RB_GETTEXTCOLOR = 0x0416, TB_DELETEBUTTON = 0x0416, TBM_GETPAGESIZE = 0x0416, TTM_GETTIPBKCOLOR = 0x0416, RB_SIZETORECT = 0x0417, TB_GETBUTTON = 0x0417, TBM_SETLINESIZE = 0x0417, TTM_GETTIPTEXTCOLOR = 0x0417, RB_BEGINDRAG = 0x0418, TB_BUTTONCOUNT = 0x0418, TBM_GETLINESIZE = 0x0418, TTM_SETMAXTIPWIDTH = 0x0418, RB_ENDDRAG = 0x0419, TB_COMMANDTOINDEX = 0x0419, TBM_GETTHUMBRECT = 0x0419, TTM_GETMAXTIPWIDTH = 0x0419, RB_DRAGMOVE = 0x041a, TBM_GETCHANNELRECT = 0x041a, TB_SAVERESTOREA = 0x041a, TTM_SETMARGIN = 0x041a, RB_GETBARHEIGHT = 0x041b, TB_CUSTOMIZE = 0x041b, TBM_SETTHUMBLENGTH = 0x041b, TTM_GETMARGIN = 0x041b, RB_GETBANDINFOW = 0x041c, TB_ADDSTRINGA = 0x041c, TBM_GETTHUMBLENGTH = 0x041c, TTM_POP = 0x041c, RB_GETBANDINFOA = 0x041d, TB_GETITEMRECT = 0x041d, TBM_SETTOOLTIPS = 0x041d, TTM_UPDATE = 0x041d, RB_MINIMIZEBAND = 0x041e, TB_BUTTONSTRUCTSIZE = 0x041e, TBM_GETTOOLTIPS = 0x041e, TTM_GETBUBBLESIZE = 0x041e, RB_MAXIMIZEBAND = 0x041f, TBM_SETTIPSIDE = 0x041f, TB_SETBUTTONSIZE = 0x041f, TTM_ADJUSTRECT = 0x041f, TBM_SETBUDDY = 0x0420, TB_SETBITMAPSIZE = 0x0420, TTM_SETTITLEA = 0x0420, MSG_FTS_JUMP_VA = 0x0421, TB_AUTOSIZE = 0x0421, TBM_GETBUDDY = 0x0421, TTM_SETTITLEW = 0x0421, RB_GETBANDBORDERS = 0x0422, MSG_FTS_JUMP_QWORD = 0x0423, RB_SHOWBAND = 0x0423, TB_GETTOOLTIPS = 0x0423, MSG_REINDEX_REQUEST = 0x0424, TB_SETTOOLTIPS = 0x0424, MSG_FTS_WHERE_IS_IT = 0x0425, RB_SETPALETTE = 0x0425, TB_SETPARENT = 0x0425, RB_GETPALETTE = 0x0426, RB_MOVEBAND = 0x0427, TB_SETROWS = 0x0427, TB_GETROWS = 0x0428, TB_GETBITMAPFLAGS = 0x0429, TB_SETCMDID = 0x042a, RB_PUSHCHEVRON = 0x042b, TB_CHANGEBITMAP = 0x042b, TB_GETBITMAP = 0x042c, MSG_GET_DEFFONT = 0x042d, TB_GETBUTTONTEXTA = 0x042d, TB_REPLACEBITMAP = 0x042e, TB_SETINDENT = 0x042f, TB_SETIMAGELIST = 0x0430, TB_GETIMAGELIST = 0x0431, TB_LOADIMAGES = 0x0432, EM_CANPASTE = 0x0432, TTM_ADDTOOLW = 0x0432, EM_DISPLAYBAND = 0x0433, TB_GETRECT = 0x0433, TTM_DELTOOLW = 0x0433, EM_EXGETSEL = 0x0434, TB_SETHOTIMAGELIST = 0x0434, TTM_NEWTOOLRECTW = 0x0434, EM_EXLIMITTEXT = 0x0435, TB_GETHOTIMAGELIST = 0x0435, TTM_GETTOOLINFOW = 0x0435, EM_EXLINEFROMCHAR = 0x0436, TB_SETDISABLEDIMAGELIST = 0x0436, TTM_SETTOOLINFOW = 0x0436, EM_EXSETSEL = 0x0437, TB_GETDISABLEDIMAGELIST = 0x0437, TTM_HITTESTW = 0x0437, EM_FINDTEXT = 0x0438, TB_SETSTYLE = 0x0438, TTM_GETTEXTW = 0x0438, EM_FORMATRANGE = 0x0439, TB_GETSTYLE = 0x0439, TTM_UPDATETIPTEXTW = 0x0439, EM_GETCHARFORMAT = 0x043a, TB_GETBUTTONSIZE = 0x043a, TTM_ENUMTOOLSW = 0x043a, EM_GETEVENTMASK = 0x043b, TB_SETBUTTONWIDTH = 0x043b, TTM_GETCURRENTTOOLW = 0x043b, EM_GETOLEINTERFACE = 0x043c, TB_SETMAXTEXTROWS = 0x043c, EM_GETPARAFORMAT = 0x043d, TB_GETTEXTROWS = 0x043d, EM_GETSELTEXT = 0x043e, TB_GETOBJECT = 0x043e, EM_HIDESELECTION = 0x043f, TB_GETBUTTONINFOW = 0x043f, EM_PASTESPECIAL = 0x0440, TB_SETBUTTONINFOW = 0x0440, EM_REQUESTRESIZE = 0x0441, TB_GETBUTTONINFOA = 0x0441, EM_SELECTIONTYPE = 0x0442, TB_SETBUTTONINFOA = 0x0442, EM_SETBKGNDCOLOR = 0x0443, TB_INSERTBUTTONW = 0x0443, EM_SETCHARFORMAT = 0x0444, TB_ADDBUTTONSW = 0x0444, EM_SETEVENTMASK = 0x0445, TB_HITTEST = 0x0445, EM_SETOLECALLBACK = 0x0446, TB_SETDRAWTEXTFLAGS = 0x0446, EM_SETPARAFORMAT = 0x0447, TB_GETHOTITEM = 0x0447, EM_SETTARGETDEVICE = 0x0448, TB_SETHOTITEM = 0x0448, EM_STREAMIN = 0x0449, TB_SETANCHORHIGHLIGHT = 0x0449, EM_STREAMOUT = 0x044a, TB_GETANCHORHIGHLIGHT = 0x044a, EM_GETTEXTRANGE = 0x044b, TB_GETBUTTONTEXTW = 0x044b, EM_FINDWORDBREAK = 0x044c, TB_SAVERESTOREW = 0x044c, EM_SETOPTIONS = 0x044d, TB_ADDSTRINGW = 0x044d, EM_GETOPTIONS = 0x044e, TB_MAPACCELERATORA = 0x044e, EM_FINDTEXTEX = 0x044f, TB_GETINSERTMARK = 0x044f, EM_GETWORDBREAKPROCEX = 0x0450, TB_SETINSERTMARK = 0x0450, EM_SETWORDBREAKPROCEX = 0x0451, TB_INSERTMARKHITTEST = 0x0451, EM_SETUNDOLIMIT = 0x0452, TB_MOVEBUTTON = 0x0452, TB_GETMAXSIZE = 0x0453, EM_REDO = 0x0454, TB_SETEXTENDEDSTYLE = 0x0454, EM_CANREDO = 0x0455, TB_GETEXTENDEDSTYLE = 0x0455, EM_GETUNDONAME = 0x0456, TB_GETPADDING = 0x0456, EM_GETREDONAME = 0x0457, TB_SETPADDING = 0x0457, EM_STOPGROUPTYPING = 0x0458, TB_SETINSERTMARKCOLOR = 0x0458, EM_SETTEXTMODE = 0x0459, TB_GETINSERTMARKCOLOR = 0x0459, EM_GETTEXTMODE = 0x045a, TB_MAPACCELERATORW = 0x045a, EM_AUTOURLDETECT = 0x045b, TB_GETSTRINGW = 0x045b, EM_GETAUTOURLDETECT = 0x045c, TB_GETSTRINGA = 0x045c, EM_SETPALETTE = 0x045d, EM_GETTEXTEX = 0x045e, EM_GETTEXTLENGTHEX = 0x045f, EM_SHOWSCROLLBAR = 0x0460, EM_SETTEXTEX = 0x0461, TAPI_REPLY = 0x0463, ACM_OPENA = 0x0464, BFFM_SETSTATUSTEXTA = 0x0464, CDM_FIRST = 0x0464, CDM_GETSPEC = 0x0464, EM_SETPUNCTUATION = 0x0464, IPM_CLEARADDRESS = 0x0464, WM_CAP_UNICODE_START = 0x0464, ACM_PLAY = 0x0465, BFFM_ENABLEOK = 0x0465, CDM_GETFILEPATH = 0x0465, EM_GETPUNCTUATION = 0x0465, IPM_SETADDRESS = 0x0465, PSM_SETCURSEL = 0x0465, UDM_SETRANGE = 0x0465, WM_CHOOSEFONT_SETLOGFONT = 0x0465, ACM_STOP = 0x0466, BFFM_SETSELECTIONA = 0x0466, CDM_GETFOLDERPATH = 0x0466, EM_SETWORDWRAPMODE = 0x0466, IPM_GETADDRESS = 0x0466, PSM_REMOVEPAGE = 0x0466, UDM_GETRANGE = 0x0466, WM_CAP_SET_CALLBACK_ERRORW = 0x0466, WM_CHOOSEFONT_SETFLAGS = 0x0466, ACM_OPENW = 0x0467, BFFM_SETSELECTIONW = 0x0467, CDM_GETFOLDERIDLIST = 0x0467, EM_GETWORDWRAPMODE = 0x0467, IPM_SETRANGE = 0x0467, PSM_ADDPAGE = 0x0467, UDM_SETPOS = 0x0467, WM_CAP_SET_CALLBACK_STATUSW = 0x0467, BFFM_SETSTATUSTEXTW = 0x0468, CDM_SETCONTROLTEXT = 0x0468, EM_SETIMECOLOR = 0x0468, IPM_SETFOCUS = 0x0468, PSM_CHANGED = 0x0468, UDM_GETPOS = 0x0468, CDM_HIDECONTROL = 0x0469, EM_GETIMECOLOR = 0x0469, IPM_ISBLANK = 0x0469, PSM_RESTARTWINDOWS = 0x0469, UDM_SETBUDDY = 0x0469, CDM_SETDEFEXT = 0x046a, EM_SETIMEOPTIONS = 0x046a, PSM_REBOOTSYSTEM = 0x046a, UDM_GETBUDDY = 0x046a, EM_GETIMEOPTIONS = 0x046b, PSM_CANCELTOCLOSE = 0x046b, UDM_SETACCEL = 0x046b, EM_CONVPOSITION = 0x046c, EM_CONVPOSITION = 0x046c, PSM_QUERYSIBLINGS = 0x046c, UDM_GETACCEL = 0x046c, MCIWNDM_GETZOOM = 0x046d, PSM_UNCHANGED = 0x046d, UDM_SETBASE = 0x046d, PSM_APPLY = 0x046e, UDM_GETBASE = 0x046e, PSM_SETTITLEA = 0x046f, UDM_SETRANGE32 = 0x046f, PSM_SETWIZBUTTONS = 0x0470, UDM_GETRANGE32 = 0x0470, WM_CAP_DRIVER_GET_NAMEW = 0x0470, PSM_PRESSBUTTON = 0x0471, UDM_SETPOS32 = 0x0471, WM_CAP_DRIVER_GET_VERSIONW = 0x0471, PSM_SETCURSELID = 0x0472, UDM_GETPOS32 = 0x0472, PSM_SETFINISHTEXTA = 0x0473, PSM_GETTABCONTROL = 0x0474, PSM_ISDIALOGMESSAGE = 0x0475, MCIWNDM_REALIZE = 0x0476, PSM_GETCURRENTPAGEHWND = 0x0476, MCIWNDM_SETTIMEFORMATA = 0x0477, PSM_INSERTPAGE = 0x0477, EM_SETLANGOPTIONS = 0x0478, MCIWNDM_GETTIMEFORMATA = 0x0478, PSM_SETTITLEW = 0x0478, WM_CAP_FILE_SET_CAPTURE_FILEW = 0x0478, EM_GETLANGOPTIONS = 0x0479, MCIWNDM_VALIDATEMEDIA = 0x0479, PSM_SETFINISHTEXTW = 0x0479, WM_CAP_FILE_GET_CAPTURE_FILEW = 0x0479, EM_GETIMECOMPMODE = 0x047a, EM_FINDTEXTW = 0x047b, MCIWNDM_PLAYTO = 0x047b, WM_CAP_FILE_SAVEASW = 0x047b, EM_FINDTEXTEXW = 0x047c, MCIWNDM_GETFILENAMEA = 0x047c, EM_RECONVERSION = 0x047d, MCIWNDM_GETDEVICEA = 0x047d, PSM_SETHEADERTITLEA = 0x047d, WM_CAP_FILE_SAVEDIBW = 0x047d, EM_SETIMEMODEBIAS = 0x047e, MCIWNDM_GETPALETTE = 0x047e, PSM_SETHEADERTITLEW = 0x047e, EM_GETIMEMODEBIAS = 0x047f, MCIWNDM_SETPALETTE = 0x047f, PSM_SETHEADERSUBTITLEA = 0x047f, MCIWNDM_GETERRORA = 0x0480, PSM_SETHEADERSUBTITLEW = 0x0480, PSM_HWNDTOINDEX = 0x0481, PSM_INDEXTOHWND = 0x0482, MCIWNDM_SETINACTIVETIMER = 0x0483, PSM_PAGETOINDEX = 0x0483, PSM_INDEXTOPAGE = 0x0484, DL_BEGINDRAG = 0x0485, MCIWNDM_GETINACTIVETIMER = 0x0485, PSM_IDTOINDEX = 0x0485, DL_DRAGGING = 0x0486, PSM_INDEXTOID = 0x0486, DL_DROPPED = 0x0487, PSM_GETRESULT = 0x0487, DL_CANCELDRAG = 0x0488, PSM_RECALCPAGESIZES = 0x0488, MCIWNDM_GET_SOURCE = 0x048c, MCIWNDM_PUT_SOURCE = 0x048d, MCIWNDM_GET_DEST = 0x048e, MCIWNDM_PUT_DEST = 0x048f, MCIWNDM_CAN_PLAY = 0x0490, MCIWNDM_CAN_WINDOW = 0x0491, MCIWNDM_CAN_RECORD = 0x0492, MCIWNDM_CAN_SAVE = 0x0493, MCIWNDM_CAN_EJECT = 0x0494, MCIWNDM_CAN_CONFIG = 0x0495, IE_GETINK = 0x0496, IE_MSGFIRST = 0x0496, MCIWNDM_PALETTEKICK = 0x0496, IE_SETINK = 0x0497, IE_GETPENTIP = 0x0498, IE_SETPENTIP = 0x0499, IE_GETERASERTIP = 0x049a, IE_SETERASERTIP = 0x049b, IE_GETBKGND = 0x049c, IE_SETBKGND = 0x049d, IE_GETGRIDORIGIN = 0x049e, IE_SETGRIDORIGIN = 0x049f, IE_GETGRIDPEN = 0x04a0, IE_SETGRIDPEN = 0x04a1, IE_GETGRIDSIZE = 0x04a2, IE_SETGRIDSIZE = 0x04a3, IE_GETMODE = 0x04a4, IE_SETMODE = 0x04a5, IE_GETINKRECT = 0x04a6, WM_CAP_SET_MCI_DEVICEW = 0x04a6, WM_CAP_GET_MCI_DEVICEW = 0x04a7, WM_CAP_PAL_OPENW = 0x04b4, WM_CAP_PAL_SAVEW = 0x04b5, IE_GETAPPDATA = 0x04b8, IE_SETAPPDATA = 0x04b9, IE_GETDRAWOPTS = 0x04ba, IE_SETDRAWOPTS = 0x04bb, IE_GETFORMAT = 0x04bc, IE_SETFORMAT = 0x04bd, IE_GETINKINPUT = 0x04be, IE_SETINKINPUT = 0x04bf, IE_GETNOTIFY = 0x04c0, IE_SETNOTIFY = 0x04c1, IE_GETRECOG = 0x04c2, IE_SETRECOG = 0x04c3, IE_GETSECURITY = 0x04c4, IE_SETSECURITY = 0x04c5, IE_GETSEL = 0x04c6, IE_SETSEL = 0x04c7, CDM_LAST = 0x04c8, EM_SETBIDIOPTIONS = 0x04c8, IE_DOCOMMAND = 0x04c8, MCIWNDM_NOTIFYMODE = 0x04c8, EM_GETBIDIOPTIONS = 0x04c9, IE_GETCOMMAND = 0x04c9, EM_SETTYPOGRAPHYOPTIONS = 0x04ca, IE_GETCOUNT = 0x04ca, EM_GETTYPOGRAPHYOPTIONS = 0x04cb, IE_GETGESTURE = 0x04cb, MCIWNDM_NOTIFYMEDIA = 0x04cb, EM_SETEDITSTYLE = 0x04cc, IE_GETMENU = 0x04cc, EM_GETEDITSTYLE = 0x04cd, IE_GETPAINTDC = 0x04cd, MCIWNDM_NOTIFYERROR = 0x04cd, IE_GETPDEVENT = 0x04ce, IE_GETSELCOUNT = 0x04cf, IE_GETSELITEMS = 0x04d0, IE_GETSTYLE = 0x04d1, MCIWNDM_SETTIMEFORMATW = 0x04db, EM_OUTLINE = 0x04dc, EM_OUTLINE = 0x04dc, MCIWNDM_GETTIMEFORMATW = 0x04dc, EM_GETSCROLLPOS = 0x04dd, EM_GETSCROLLPOS = 0x04dd, EM_SETSCROLLPOS = 0x04de, EM_SETSCROLLPOS = 0x04de, EM_SETFONTSIZE = 0x04df, EM_SETFONTSIZE = 0x04df, EM_GETZOOM = 0x04e0, MCIWNDM_GETFILENAMEW = 0x04e0, EM_SETZOOM = 0x04e1, MCIWNDM_GETDEVICEW = 0x04e1, EM_GETVIEWKIND = 0x04e2, EM_SETVIEWKIND = 0x04e3, EM_GETPAGE = 0x04e4, MCIWNDM_GETERRORW = 0x04e4, EM_SETPAGE = 0x04e5, EM_GETHYPHENATEINFO = 0x04e6, EM_SETHYPHENATEINFO = 0x04e7, EM_GETPAGEROTATE = 0x04eb, EM_SETPAGEROTATE = 0x04ec, EM_GETCTFMODEBIAS = 0x04ed, EM_SETCTFMODEBIAS = 0x04ee, EM_GETCTFOPENSTATUS = 0x04f0, EM_SETCTFOPENSTATUS = 0x04f1, EM_GETIMECOMPTEXT = 0x04f2, EM_ISIME = 0x04f3, EM_GETIMEPROPERTY = 0x04f4, EM_GETQUERYRTFOBJ = 0x050d, EM_SETQUERYRTFOBJ = 0x050e, FM_GETFOCUS = 0x0600, FM_GETDRIVEINFOA = 0x0601, FM_GETSELCOUNT = 0x0602, FM_GETSELCOUNTLFN = 0x0603, FM_GETFILESELA = 0x0604, FM_GETFILESELLFNA = 0x0605, FM_REFRESH_WINDOWS = 0x0606, FM_RELOAD_EXTENSIONS = 0x0607, FM_GETDRIVEINFOW = 0x0611, FM_GETFILESELW = 0x0614, FM_GETFILESELLFNW = 0x0615, WLX_WM_SAS = 0x0659, SM_GETSELCOUNT = 0x07e8, UM_GETSELCOUNT = 0x07e8, WM_CPL_LAUNCH = 0x07e8, SM_GETSERVERSELA = 0x07e9, UM_GETUSERSELA = 0x07e9, WM_CPL_LAUNCHED = 0x07e9, SM_GETSERVERSELW = 0x07ea, UM_GETUSERSELW = 0x07ea, SM_GETCURFOCUSA = 0x07eb, UM_GETGROUPSELA = 0x07eb, SM_GETCURFOCUSW = 0x07ec, UM_GETGROUPSELW = 0x07ec, SM_GETOPTIONS = 0x07ed, UM_GETCURFOCUSA = 0x07ed, UM_GETCURFOCUSW = 0x07ee, UM_GETOPTIONS = 0x07ef, UM_GETOPTIONS2 = 0x07f0, LVM_FIRST = 0x1000, LVM_GETBKCOLOR = 0x1000, LVM_SETBKCOLOR = 0x1001, LVM_GETIMAGELIST = 0x1002, LVM_SETIMAGELIST = 0x1003, LVM_GETITEMCOUNT = 0x1004, LVM_GETITEMA = 0x1005, LVM_SETITEMA = 0x1006, LVM_INSERTITEMA = 0x1007, LVM_DELETEITEM = 0x1008, LVM_DELETEALLITEMS = 0x1009, LVM_GETCALLBACKMASK = 0x100a, LVM_SETCALLBACKMASK = 0x100b, LVM_GETNEXTITEM = 0x100c, LVM_FINDITEMA = 0x100d, LVM_GETITEMRECT = 0x100e, LVM_SETITEMPOSITION = 0x100f, LVM_GETITEMPOSITION = 0x1010, LVM_GETSTRINGWIDTHA = 0x1011, LVM_HITTEST = 0x1012, LVM_ENSUREVISIBLE = 0x1013, LVM_SCROLL = 0x1014, LVM_REDRAWITEMS = 0x1015, LVM_ARRANGE = 0x1016, LVM_EDITLABELA = 0x1017, LVM_GETEDITCONTROL = 0x1018, LVM_GETCOLUMNA = 0x1019, LVM_SETCOLUMNA = 0x101a, LVM_INSERTCOLUMNA = 0x101b, LVM_DELETECOLUMN = 0x101c, LVM_GETCOLUMNWIDTH = 0x101d, LVM_SETCOLUMNWIDTH = 0x101e, LVM_GETHEADER = 0x101f, LVM_CREATEDRAGIMAGE = 0x1021, LVM_GETVIEWRECT = 0x1022, LVM_GETTEXTCOLOR = 0x1023, LVM_SETTEXTCOLOR = 0x1024, LVM_GETTEXTBKCOLOR = 0x1025, LVM_SETTEXTBKCOLOR = 0x1026, LVM_GETTOPINDEX = 0x1027, LVM_GETCOUNTPERPAGE = 0x1028, LVM_GETORIGIN = 0x1029, LVM_UPDATE = 0x102a, LVM_SETITEMSTATE = 0x102b, LVM_GETITEMSTATE = 0x102c, LVM_GETITEMTEXTA = 0x102d, LVM_SETITEMTEXTA = 0x102e, LVM_SETITEMCOUNT = 0x102f, LVM_SORTITEMS = 0x1030, LVM_SETITEMPOSITION32 = 0x1031, LVM_GETSELECTEDCOUNT = 0x1032, LVM_GETITEMSPACING = 0x1033, LVM_GETISEARCHSTRINGA = 0x1034, LVM_SETICONSPACING = 0x1035, LVM_SETEXTENDEDLISTVIEWSTYLE = 0x1036, LVM_GETEXTENDEDLISTVIEWSTYLE = 0x1037, LVM_GETSUBITEMRECT = 0x1038, LVM_SUBITEMHITTEST = 0x1039, LVM_SETCOLUMNORDERARRAY = 0x103a, LVM_GETCOLUMNORDERARRAY = 0x103b, LVM_SETHOTITEM = 0x103c, LVM_GETHOTITEM = 0x103d, LVM_SETHOTCURSOR = 0x103e, LVM_GETHOTCURSOR = 0x103f, LVM_APPROXIMATEVIEWRECT = 0x1040, LVM_SETWORKAREAS = 0x1041, LVM_GETSELECTIONMARK = 0x1042, LVM_SETSELECTIONMARK = 0x1043, LVM_SETBKIMAGEA = 0x1044, LVM_GETBKIMAGEA = 0x1045, LVM_GETWORKAREAS = 0x1046, LVM_SETHOVERTIME = 0x1047, LVM_GETHOVERTIME = 0x1048, LVM_GETNUMBEROFWORKAREAS = 0x1049, LVM_SETTOOLTIPS = 0x104a, LVM_GETITEMW = 0x104b, LVM_SETITEMW = 0x104c, LVM_INSERTITEMW = 0x104d, LVM_GETTOOLTIPS = 0x104e, LVM_FINDITEMW = 0x1053, LVM_GETSTRINGWIDTHW = 0x1057, LVM_GETCOLUMNW = 0x105f, LVM_SETCOLUMNW = 0x1060, LVM_INSERTCOLUMNW = 0x1061, LVM_GETITEMTEXTW = 0x1073, LVM_SETITEMTEXTW = 0x1074, LVM_GETISEARCHSTRINGW = 0x1075, LVM_EDITLABELW = 0x1076, LVM_GETBKIMAGEW = 0x108b, LVM_SETSELECTEDCOLUMN = 0x108c, LVM_SETTILEWIDTH = 0x108d, LVM_SETVIEW = 0x108e, LVM_GETVIEW = 0x108f, LVM_INSERTGROUP = 0x1091, LVM_SETGROUPINFO = 0x1093, LVM_GETGROUPINFO = 0x1095, LVM_REMOVEGROUP = 0x1096, LVM_MOVEGROUP = 0x1097, LVM_MOVEITEMTOGROUP = 0x109a, LVM_SETGROUPMETRICS = 0x109b, LVM_GETGROUPMETRICS = 0x109c, LVM_ENABLEGROUPVIEW = 0x109d, LVM_SORTGROUPS = 0x109e, LVM_INSERTGROUPSORTED = 0x109f, LVM_REMOVEALLGROUPS = 0x10a0, LVM_HASGROUP = 0x10a1, LVM_SETTILEVIEWINFO = 0x10a2, LVM_GETTILEVIEWINFO = 0x10a3, LVM_SETTILEINFO = 0x10a4, LVM_GETTILEINFO = 0x10a5, LVM_SETINSERTMARK = 0x10a6, LVM_GETINSERTMARK = 0x10a7, LVM_INSERTMARKHITTEST = 0x10a8, LVM_GETINSERTMARKRECT = 0x10a9, LVM_SETINSERTMARKCOLOR = 0x10aa, LVM_GETINSERTMARKCOLOR = 0x10ab, LVM_SETINFOTIP = 0x10ad, LVM_GETSELECTEDCOLUMN = 0x10ae, LVM_ISGROUPVIEWENABLED = 0x10af, LVM_GETOUTLINECOLOR = 0x10b0, LVM_SETOUTLINECOLOR = 0x10b1, LVM_CANCELEDITLABEL = 0x10b3, LVM_MAPINDEXTOID = 0x10b4, LVM_MAPIDTOINDEX = 0x10b5, LVM_ISITEMVISIBLE = 0x10b6, OCM__BASE = 0x2000, LVM_SETUNICODEFORMAT = 0x2005, LVM_GETUNICODEFORMAT = 0x2006, OCM_CTLCOLOR = 0x2019, OCM_DRAWITEM = 0x202b, OCM_MEASUREITEM = 0x202c, OCM_DELETEITEM = 0x202d, OCM_VKEYTOITEM = 0x202e, OCM_CHARTOITEM = 0x202f, OCM_COMPAREITEM = 0x2039, OCM_NOTIFY = 0x204e, OCM_COMMAND = 0x2111, OCM_HSCROLL = 0x2114, OCM_VSCROLL = 0x2115, OCM_CTLCOLORMSGBOX = 0x2132, OCM_CTLCOLOREDIT = 0x2133, OCM_CTLCOLORLISTBOX = 0x2134, OCM_CTLCOLORBTN = 0x2135, OCM_CTLCOLORDLG = 0x2136, OCM_CTLCOLORSCROLLBAR = 0x2137, OCM_CTLCOLORSTATIC = 0x2138, OCM_PARENTNOTIFY = 0x2210, WM_APP = 0x8000, WM_RASDIALEVENT = 0xcccd, } return messages
require("rrpg.lua"); local __o_rrpgObjs = require("rrpgObjs.lua"); require("rrpgGUI.lua"); require("rrpgDialogs.lua"); require("rrpgLFM.lua"); require("ndb.lua"); function newfrmGeography() __o_rrpgObjs.beginObjectsLoading(); local obj = gui.fromHandle(_obj_newObject("form")); local self = obj; local sheet = nil; rawset(obj, "_oldSetNodeObjectFunction", rawget(obj, "setNodeObject")); function obj:setNodeObject(nodeObject) sheet = nodeObject; self.sheet = nodeObject; self:_oldSetNodeObjectFunction(nodeObject); end; function obj:setNodeDatabase(nodeObject) self:setNodeObject(nodeObject); end; _gui_assignInitialParentForForm(obj.handle); obj:beginUpdate(); obj:setName("frmGeography"); obj:setAlign("client"); obj.scrollBox1 = gui.fromHandle(_obj_newObject("scrollBox")); obj.scrollBox1:setParent(obj); obj.scrollBox1:setAlign("client"); obj.scrollBox1:setName("scrollBox1"); obj.rectangle1 = gui.fromHandle(_obj_newObject("rectangle")); obj.rectangle1:setParent(obj.scrollBox1); obj.rectangle1:setLeft(0); obj.rectangle1:setTop(0); obj.rectangle1:setWidth(200); obj.rectangle1:setHeight(600); obj.rectangle1:setColor("black"); obj.rectangle1:setName("rectangle1"); obj.rclDestalhesDaGeografia = gui.fromHandle(_obj_newObject("recordList")); obj.rclDestalhesDaGeografia:setParent(obj.scrollBox1); obj.rclDestalhesDaGeografia:setLeft(0); obj.rclDestalhesDaGeografia:setTop(0); obj.rclDestalhesDaGeografia:setWidth(200); obj.rclDestalhesDaGeografia:setHeight(595); obj.rclDestalhesDaGeografia:setName("rclDestalhesDaGeografia"); obj.rclDestalhesDaGeografia:setField("listaDeDestalhesDaGeografia"); obj.rclDestalhesDaGeografia:setTemplateForm("frmGeographySelection"); obj.rclDestalhesDaGeografia:setLayout("vertical"); obj.rclDestalhesDaGeografia:setSelectable(true); obj.boxDetalhesDaGeografia = gui.fromHandle(_obj_newObject("dataScopeBox")); obj.boxDetalhesDaGeografia:setParent(obj.scrollBox1); obj.boxDetalhesDaGeografia:setLeft(210); obj.boxDetalhesDaGeografia:setTop(0); obj.boxDetalhesDaGeografia:setWidth(1030); obj.boxDetalhesDaGeografia:setHeight(600); obj.boxDetalhesDaGeografia:setName("boxDetalhesDaGeografia"); obj.boxDetalhesDaGeografia:setVisible(false); obj.richEdit1 = gui.fromHandle(_obj_newObject("richEdit")); obj.richEdit1:setParent(obj.boxDetalhesDaGeografia); obj.richEdit1:setAlign("client"); obj.richEdit1:setField("descricao"); lfm_setPropAsString(obj.richEdit1, "backgroundColor", "#333333"); lfm_setPropAsString(obj.richEdit1, "defaultFontSize", "12"); lfm_setPropAsString(obj.richEdit1, "defaultFontColor", "white"); obj.richEdit1:setName("richEdit1"); obj._e_event0 = obj.rclDestalhesDaGeografia:addEventListener("onEndEnumeration", function (self) if sheet~= nil then local lugares = ndb.getChildNodes(sheet.listaDeDestalhesDaGeografia); local mapa = self:findControlByName("mapa"); for i=1, #lugares, 1 do local node = lugares[i]; local altura2 = tonumber(sheet.altura2) or 30; local largura2 = tonumber(sheet.largura2) or 30; if node.name ~= nil then local btn = self:findControlByName(node.name); if btn == nil then local btn = gui.newButton(); btn.parent = mapa; btn.left = node.left; btn.top = node.top; btn.width = largura2; btn.height = altura2; btn.cursor = "handPoint"; btn.hint = node.nome; btn.opacity = 0.35; btn.name = node.name; btn.text = ""; btn.onClick = function() if sheet.dragged then sheet.dragged = false; return; end; self.boxDetalhesDaGeografia.node = node; self.boxDetalhesDaGeografia.visible = (node ~= nil); self.tabControl.tabIndex = 3; end; btn.onMouseDown = function(event) sheet.drag = true; sheet.dragX = event.x; sheet.dragY = event.y; end; btn.onMouseMove = function(event) if sheet.drag~=true then return end; sheet.dragged = true; btn.top = btn.top + (event.y - sheet.dragY); btn.left = btn.left + (event.x - sheet.dragX); end; btn.onMouseUp = function(event) local mapImage = self:findControlByName("mapImage"); local scale = 1; if mapImage.scale > 1 then scale = 0.5; end; sheet.drag = false; node.left = btn.left*scale; node.top = btn.top*scale; end; end; end; end; if self.rclDestalhesDaGeografia.selectedNode== nil and #lugares>0 then self.rclDestalhesDaGeografia.selectedNode = lugares[1]; end; end; end, obj); obj._e_event1 = obj.rclDestalhesDaGeografia:addEventListener("onSelect", function (self) local node = self.rclDestalhesDaGeografia.selectedNode; self.boxDetalhesDaGeografia.node = node; self.boxDetalhesDaGeografia.visible = (node ~= nil); end, obj); obj._e_event2 = obj.rclDestalhesDaGeografia:addEventListener("onCompare", function (self, nodeA, nodeB) -- Esse codigo organiza a ordem dos objetos da lista. if (tonumber(nodeA.contador) or 0) < (tonumber(nodeB.contador) or 0) then return -1; elseif (tonumber(nodeA.contador) or 0) > (tonumber(nodeB.contador) or 0) then return 1; else return 0; end; end, obj); function obj:_releaseEvents() __o_rrpgObjs.removeEventListenerById(self._e_event2); __o_rrpgObjs.removeEventListenerById(self._e_event1); __o_rrpgObjs.removeEventListenerById(self._e_event0); end; obj._oldLFMDestroy = obj.destroy; function obj:destroy() self:_releaseEvents(); if (self.handle ~= 0) and (self.setNodeDatabase ~= nil) then self:setNodeDatabase(nil); end; if self.scrollBox1 ~= nil then self.scrollBox1:destroy(); self.scrollBox1 = nil; end; if self.rectangle1 ~= nil then self.rectangle1:destroy(); self.rectangle1 = nil; end; if self.boxDetalhesDaGeografia ~= nil then self.boxDetalhesDaGeografia:destroy(); self.boxDetalhesDaGeografia = nil; end; if self.richEdit1 ~= nil then self.richEdit1:destroy(); self.richEdit1 = nil; end; if self.rclDestalhesDaGeografia ~= nil then self.rclDestalhesDaGeografia:destroy(); self.rclDestalhesDaGeografia = nil; end; self:_oldLFMDestroy(); end; obj:endUpdate(); __o_rrpgObjs.endObjectsLoading(); return obj; end; local _frmGeography = { newEditor = newfrmGeography, new = newfrmGeography, name = "frmGeography", dataType = "", formType = "undefined", formComponentName = "form", title = "", description=""}; frmGeography = _frmGeography; rrpg.registrarForm(_frmGeography); return _frmGeography;
_BUILD = {} _BUILD.OS = "OSX" _BUILD.NAME = "Firerooter" _BUILD.VERSION = "0.2.2-devel" _BUILD.VERSIONCODE = 3
-- Copyright (c) 2008 Mikael Lind -- -- 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. Thing = { alive = false, char = " ", count = 1, mobile = false, passable = false, stackable = false, } function Thing:new(thing) thing = thing or {} thing.inv = {} setmetatable(thing, self) self.__index = self return thing end function Thing:get_y() return self.env and self.env:get_y() end function Thing:get_x() return self.env and self.env:get_x() end
--[=[ @c Cache x Iterable @d description ]=] local json = require('json') local Iterable = require('iterables/Iterable') local null = json.null local Cache = require('class')('Cache', Iterable) function Cache:__init(array, constructor, parent) local objects = {} for _, data in ipairs(array) do local obj = constructor(data, parent) objects[obj:__hash()] = obj end self._count = #array self._objects = objects self._constructor = constructor self._parent = parent end function Cache:__pairs() return next, self._objects end function Cache:__len() return self._count end local function insert(self, k, obj) self._objects[k] = obj self._count = self._count + 1 return obj end local function remove(self, k, obj) self._objects[k] = nil self._count = self._count - 1 return obj end local function hash(data) -- local meta = getmetatable(data) -- debug -- assert(meta and meta.__jsontype == 'object') -- debug if data.id then -- snowflakes return data.id elseif data.user then -- members return data.user.id elseif data.emoji then -- reactions return data.emoji.id ~= null and data.emoji.id or data.emoji.name elseif data.code then -- invites return data.code else return nil, 'json data could not be hashed' end end function Cache:_insert(data) local k = assert(hash(data)) local old = self._objects[k] if old then old:_load(data) return old else local obj = self._constructor(data, self._parent) return insert(self, k, obj) end end function Cache:_remove(data) local k = assert(hash(data)) local old = self._objects[k] if old then old:_load(data) return remove(self, k, old) else return self._constructor(data, self._parent) end end function Cache:_delete(k) local old = self._objects[k] if old then return remove(self, k, old) else return nil end end function Cache:_load(array, update) if update then local updated = {} for _, data in ipairs(array) do local obj = self:_insert(data) updated[obj:__hash()] = true end for obj in self:iter() do local k = obj:__hash() if not updated[k] then self:_delete(k) end end else for _, data in ipairs(array) do self:_insert(data) end end end --[=[ @m get @p k * @r * @d Returns an individual object by key, where the key should match the result of calling `__hash` on the contained objects. Unlike Iterable:get, this method operates with O(1) complexity. ]=] function Cache:get(k) return self._objects[k] end --[=[ @m iter @r function @d Returns an iterator that returns all contained objects. The order of the objects is not guaranteed. ]=] function Cache:iter() local objects, k, obj = self._objects return function() k, obj = next(objects, k) return obj end end return Cache
-- =========================================================================== -- Base File -- =========================================================================== include("LaunchBar"); include("launchbar_CQUI.lua");
---------------------------------------------------------------------------------- -- Total RP 3 -- Main UI API and Widgets API -- --------------------------------------------------------------------------- -- Copyright 2014 Sylvain Cossement (telkostrasz@telkostrasz.be) -- Copyright 2014 Renaud Parize (Ellypse) (ellypse@totalrp3.info) -- -- 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. ---------------------------------------------------------------------------------- local Ellyb = Ellyb:GetInstance(...); --*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -- Minimap button widget --*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -- Config local displayMessage = TRP3_API.utils.message.displayMessage; local CONFIG_MINIMAP_SHOW = "minimap_show"; local CONFIG_MINIMAP_POSITION = "minimap_icon_position"; local getConfigValue, registerConfigKey = TRP3_API.configuration.getValue, TRP3_API.configuration.registerConfigKey; local color, strconcat = TRP3_API.utils.str.color, strconcat; local loc = TRP3_API.loc; local tinsert = tinsert; -- Minimap button API initialization TRP3_API.navigation.minimapicon = {}; local LDBObject; local icon; -- Initialize LDBIcon and display the minimap button local showMinimapButton = function() icon:Show("Total RP 3"); end TRP3_API.navigation.minimapicon.show = showMinimapButton; -- Hide the minimap button and release LDBIcon from the memory local hideMinimapButton = function() icon:Hide("Total RP 3"); end TRP3_API.navigation.minimapicon.hide = hideMinimapButton; TRP3_API.navigation.delayedRefresh = function() C_Timer.After(0.25, function() TRP3_API.events.fireEvent(TRP3_API.events.NAVIGATION_RESIZED, TRP3_MainFramePageContainer:GetWidth(), TRP3_MainFramePageContainer:GetHeight()); end); end TRP3_API.events.listenToEvent(TRP3_API.events.WORKFLOW_ON_LOADED, function() registerConfigKey(CONFIG_MINIMAP_SHOW, true); registerConfigKey(CONFIG_MINIMAP_POSITION, {}); -- Build configuration page tinsert(TRP3_API.configuration.CONFIG_FRAME_PAGE.elements, { inherit = "TRP3_ConfigH1", title = loc.CO_MINIMAP_BUTTON, }); tinsert(TRP3_API.configuration.CONFIG_FRAME_PAGE.elements, { inherit = "TRP3_ConfigCheck", title = loc.CO_MINIMAP_BUTTON_SHOW_TITLE, help = loc.CO_MINIMAP_BUTTON_SHOW_HELP, configKey = CONFIG_MINIMAP_SHOW, }); TRP3_API.configuration.registerHandler(CONFIG_MINIMAP_SHOW, function() if getConfigValue(CONFIG_MINIMAP_SHOW) then showMinimapButton(); else hideMinimapButton(); end end); LDBObject = LibStub:GetLibrary("LibDataBroker-1.1"):NewDataObject("Total RP 3", { type = "launcher", icon = "Interface\\AddOns\\totalRP3\\resources\\trp3minimap.tga", tocname = "totalRP3", OnClick = function(_, button) if button == "RightButton" and TRP3_API.toolbar then TRP3_API.toolbar.switch(); else TRP3_API.navigation.switchMainFrame(); end end, OnTooltipShow = function(tooltip) tooltip:AddLine("Total RP 3", Ellyb.ColorManager.WHITE:GetRGB()); tooltip:AddLine(Ellyb.Strings.clickInstruction(loc.CM_L_CLICK, loc.MM_SHOW_HIDE_MAIN)); if TRP3_API.toolbar then tooltip:AddLine(Ellyb.Strings.clickInstruction(loc.CM_R_CLICK, loc.MM_SHOW_HIDE_SHORTCUT)); end tooltip:AddLine(Ellyb.Strings.clickInstruction(loc.CM_DRAGDROP, loc.MM_SHOW_HIDE_MOVE)); end, }) icon = LibStub("LibDBIcon-1.0"); local configKey = getConfigValue(CONFIG_MINIMAP_POSITION); configKey.hide = not getConfigValue(CONFIG_MINIMAP_SHOW); icon:Register("Total RP 3", LDBObject, getConfigValue(CONFIG_MINIMAP_POSITION)); -- Slash command to switch frames TRP3_API.slash.registerCommand({ id = "switch", helpLine = " main || toolbar", handler = function(arg1) if arg1 ~= "main" and arg1 ~= "toolbar" then displayMessage(loc.COM_SWITCH_USAGE); elseif arg1 == "main" then TRP3_API.navigation.switchMainFrame(); else if TRP3_API.toolbar then TRP3_API.toolbar.switch(); end end end }); -- Slash command to reset frames TRP3_API.slash.registerCommand({ id = "reset", helpLine = " frames", handler = function(arg1) if arg1 ~= "frames" then displayMessage(loc.COM_RESET_USAGE); else -- Target frame if TRP3_API.target then TRP3_API.target.reset(); end -- Glance bar if TRP3_API.register.resetGlanceBar then TRP3_API.register.resetGlanceBar(); end -- Toolbar if TRP3_API.toolbar then TRP3_API.toolbar.reset(); end ReloadUI(); end end }); -- Resizing TRP3_MainFrame.Resize.onResizeStop = function() TRP3_MainFrame.Minimize:Hide(); TRP3_MainFrame.Maximize:Show(); TRP3_API.events.fireEvent(TRP3_API.events.NAVIGATION_RESIZED, TRP3_MainFramePageContainer:GetWidth(), TRP3_MainFramePageContainer:GetHeight()); end; TRP3_MainFrame.Maximize:SetScript("OnClick", function() TRP3_MainFrame.Maximize:Hide(); TRP3_MainFrame.Minimize:Show(); TRP3_MainFrame:SetSize(UIParent:GetWidth(), UIParent:GetHeight()); C_Timer.After(0.25, function() TRP3_API.events.fireEvent(TRP3_API.events.NAVIGATION_RESIZED, TRP3_MainFramePageContainer:GetWidth(), TRP3_MainFramePageContainer:GetHeight()); end); end); TRP3_MainFrame.Minimize:SetScript("OnClick", function() TRP3_MainFrame:SetSize(768, 500); C_Timer.After(0.25, function() TRP3_MainFrame.Resize.onResizeStop(); end); end); TRP3_API.ui.frame.setupMove(TRP3_MainFrame); -- Update frame TRP3_UpdateFrame.popup.title:SetText(loc.NEW_VERSION_TITLE); BINDING_NAME_TRP3_TOGGLE = loc.BINDING_NAME_TRP3_TOGGLE; BINDING_NAME_TRP3_TOOLBAR_TOGGLE = loc.BINDING_NAME_TRP3_TOOLBAR_TOGGLE; -- CTL debug frame local tostring, GetTime, pairs, type = tostring, GetTime, pairs, type; local toHTML =TRP3_API.utils.str.toHTML; local ctl = ChatThrottleLib; local ctlFrame = TRP3_CTLDebug; local ctlHTML = ctlFrame.scroll.child.HTML; local ctlHTML2 = ctlFrame.scroll.child.HTML2; TRP3_API.ui.frame.createRefreshOnFrame(ctlFrame, 0.2, function() local html = [[ ## CTL Network ### Config MAX_CPS = %s MSG_OVERHEAD = %s BURST = %s MIN_FPS = %s ### Current state securelyHooked = %s |cffff9900Available bytes|r avail = %0.2f bytes LastAvailUpdate = %0.2f seconds ago |cffff9900Queuing or choking info|r bChoking = %s bQueueing = %s |cffff9900External traffic (not with CTL)|r - nTotalSent = %s bytes - nBypass = %s bytes ### Queues ALERT: -- nTotalSent = %s bytes -- %s NORMAL: -- nTotalSent = %s bytes -- %s BULK: -- nTotalSent = %s bytes -- %s ]]; local formatRing = function(ring) if ring.pos then local str = "Pipes in ring:\n" local size = 0; for index, msg in pairs(ring.pos) do if type(index) == "number" then size = size + (msg.nSize or 0); end end str = str .. ("----- #%s bytes\n"):format(size); return str; else return "No pipe in ring"; end end html = html:format( tostring(ctl.MAX_CPS or "nil"), tostring(ctl.MSG_OVERHEAD or "nil"), tostring(ctl.BURST or "nil"), tostring(ctl.MIN_FPS or "nil"), tostring(ctl.securelyHooked or "nil"), tostring(ctl.avail or "nil"), ctl.LastAvailUpdate and (GetTime() - ctl.LastAvailUpdate) or 'nil', tostring(ctl.bChoking or "nil"), tostring(ctl.bQueueing or "nil"), tostring(ctl.nTotalSent or "nil"), tostring(ctl.nBypass or "nil"), -- Queues tostring(ctl.Prio.ALERT.nTotalSent or "nil"), tostring(formatRing(ctl.Prio.ALERT.Ring)), tostring(ctl.Prio.NORMAL.nTotalSent or "nil"), tostring(formatRing(ctl.Prio.NORMAL.Ring)), tostring(ctl.Prio.BULK.nTotalSent or "nil"), tostring(formatRing(ctl.Prio.BULK.Ring)) ); ctlHTML:SetText(toHTML(html)); local hasNYR = ""; for id, s in pairs(TRP3_API.register.HAS_NOT_YET_RESPONDED) do local duration = GetTime() - s; local character; if TRP3_API.register.isUnitIDKnown(id) then character = TRP3_API.register.getUnitIDCharacter(id); end if duration > 300 then -- Consider he has not TRP or MRP TRP3_API.register.HAS_NOT_YET_RESPONDED[id] = nil; else local text = ("\n- |cffff9900%s |cff00ff00(%s - %s)|r since %0.2f sec"):format(id, character and character.client or "?", character and character.clientVersion or "?", GetTime() - s); hasNYR = hasNYR .. text; end end if hasNYR:len() == 0 then hasNYR = "No current request"; end local incoming = ""; for unit, infos in pairs(TRP3_API.register.CURRENT_QUERY_EXCHANGES) do local infoString = ""; for type, _ in pairs(infos) do infoString = infoString .. type .. " "; end if infoString:len() > 0 then incoming = incoming .. ("\n- |cffff9900%s|r: %s"):format(unit, infoString); end end if incoming:len() == 0 then incoming = "No incoming data"; end html = [[ ## TRP Network Total sent: %s bytes Total received: %s bytes Total sent (broadcast): %s bytes Total received (broadcast): %s bytes Total sent (broadcast P2P): %s bytes Total received (broadcast P2P): %s bytes Deserialisation errors: %s |cffff9900Response times|r Min: %0.2f secondes Max: %0.2f seconds Average: %0.2f seconds |cffff9900Not yet responded:|r %s |cffff9900Incoming TRP3 data:|r %s ]] html = html:format( tostring(TRP3_API.communication.total), tostring(TRP3_API.communication.totalReceived), tostring(TRP3_API.communication.totalBroadcast), tostring(TRP3_API.communication.totalBroadcastR), tostring(TRP3_API.communication.totalBroadcastP2P), tostring(TRP3_API.communication.totalBroadcastP2PR), tostring(TRP3_API.utils.serial.errorCount), TRP3_API.communication.min, TRP3_API.communication.max, TRP3_API.communication.totalDuration / TRP3_API.communication.numStat, hasNYR, incoming ); ctlHTML2:SetText(toHTML(html)); end); ctlFrame.Resize.onResizeStop = function() local available = ctlFrame:GetWidth() - 100; ctlHTML2:SetWidth(available - ctlHTML:GetWidth()); end; ctlFrame.Resize.onResizeStop(); TRP3_API.slash.registerCommand({ id = "debug", helpLine = " Debug network", handler = function() ctlFrame:Show(); end }); TRP3_API.ui.frame.setupMove(ctlFrame); end);
local game = Concord.world() -- ADD SYSTEMS game:addSystem(_systems.motion) game:addSystem(_systems.input) return game
local classes = require "klib.classes" local m = classes.module "klib.gui" classes.import(m, "klib.gui.core") classes.import(m, "klib.gui.widget") classes.import(m, "klib.gui.button") classes.import(m, "klib.gui.checkbox") classes.import(m, "klib.gui.radiobutton") classes.import(m, "klib.gui.label") classes.import(m, "klib.gui.textfield") classes.import(m, "klib.gui.listbox") classes.import(m, "klib.gui.scrollbar") classes.import(m, "klib.gui.compound") classes.import(m, "klib.gui.container") classes.import(m, "klib.gui.window") classes.import(m, "klib.gui.desktop") classes.import(m, "klib.gui.box") classes.import(m, "klib.gui.notebook") classes.import(m, "klib.gui.dialog") classes.import(m, "klib.gui.dialog.messagedialog") classes.import(m, "klib.gui.dialog.filedialog") classes.import(m, "klib.gui.dialog.colordialog") classes.import(m, "klib.gui.dialog.aboutdialog") --classes.import(m, "klib.gui.menu") -- Broken. classes.import(m, "klib.gui.graphics") classes.import(m, "klib.gui.theme") classes.import(m, "klib.gui.mixins") return m
----------------------------------- -- Area: The_Garden_of_RuHmet ----------------------------------- require("scripts/globals/zone") ----------------------------------- zones = zones or {} zones[tpz.zone.THE_GARDEN_OF_RUHMET] = { text = { ITEM_CANNOT_BE_OBTAINED = 6382, -- You cannot obtain the <item>. Come back after sorting your inventory. ITEM_OBTAINED = 6388, -- Obtained: <item>. GIL_OBTAINED = 6389, -- Obtained <number> gil. KEYITEM_OBTAINED = 6391, -- Obtained key item: <keyitem>. CONQUEST_BASE = 7439, -- Tallying conquest results... NO_NEED_INVESTIGATE = 7618, -- There is no need to investigate further. PORTAL_SEALED = 7647, -- The portal is firmly sealed by a mysterious energy. UNKNOWN_PRESENCE = 7755, -- You sense some unknown presence... NONE_HOSTILE = 7756, -- You sense some unknown presence, but it does not seem hostile. MENACING_CREATURES = 7757, -- Menacing creatures appear out of nowhere! SHEER_ANIMOSITY = 7758, -- <name> is enveloped in sheer animosity! HOMEPOINT_SET = 7763, -- Home point set! }, mob = { AWAERN_DRG_GROUPS = -- First Aw'Aerns in each group. Used to randomize the mobID as the new placeholder. { 16920777, 16920781, 16920785, 16920789, }, AWAERN_DRK_GROUPS = { 16920660, -- NE 16920665, -- SE 16920646, -- SW 16920651, -- NW }, JAILER_OF_FORTITUDE = 16921015, KFGHRAH_WHM = 16921016, KFGHRAH_BLM = 16921017, IXAERN_DRK = 16921018, JAILER_OF_FAITH = 16921021, IXAERN_DRG = 16921022, }, npc = { IXAERN_DRK_QM_POS = { {-240, 5.00, 440}, -- Hume-Elvaan {-280, 5.00, 240}, -- Elvaan-Galka {-560, 5.00, 239}, -- Taru-Mithra {-600, 5.00, 440}, -- Mithra-Hume }, JAILER_OF_FORTITUDE_QM_POS = { {-420.00, 0.00, 755.00}, -- North / Hume tower. {-43.00, 0.00, 460.00}, -- NE / Elvaan tower. {-260.00, 0.00, 44.821}, -- SE / Galka tower. {-580.00, 0.00, 43.00}, -- SW / Tarutaru tower. {-796.00, 0.00, 460.00}, -- NW / Mithra tower. }, JAILER_OF_FAITH_QM_POS = { {-420.00, 0.00, -157.00}, -- North / Hume tower. {-157.00, 0.00, -340.00}, -- NE / Elvaan tower. {-260.00, 0.00, -643.00}, -- SE / Galka tower. {-580.00, 0.00, -644.00}, -- SW / Tarutaru tower. {-683.00, 0.00, -340.00}, -- NW / Mithra tower. }, JAILER_OF_FORTITUDE_QM = 16921027, IXAERN_DRK_QM = 16921028, JAILER_OF_FAITH_QM = 16921029, }, } return zones[tpz.zone.THE_GARDEN_OF_RUHMET]
-- These are functions that were deprecated in 7.2.0, and will be removed in the next expansion. -- Please upgrade to the updated APIs as soon as possible. if (not IsPublicBuild()) then return; end -- PvP do local function RewardMapToRewardsArray(rewardsMap) local rewards; if (rewardsMap) then rewards = {}; for i, reward in ipairs(rewardsMap) do rewards[i] = { reward.id, reward.name, reward.texture, reward.quantity; }; end end return rewards; end -- Use C_PvP.GetRandomBGRewards() instead function GetRandomBGRewards() local honor, experience, rewardsMap = C_PvP.GetRandomBGRewards(); local rewards = RewardMapToRewardsArray(rewardsMap); return honor, rewards; end -- Use C_PvP.GetArenaSkirmishRewards() instead function GetArenaSkirmishRewards() local honor, experience, rewardsMap = C_PvP.GetArenaSkirmishRewards(); local rewards = RewardMapToRewardsArray(rewardsMap); local hasWon = C_PvP.HasArenaSkirmishWinToday(); return honor, rewards, hasWon; end -- Use C_PvP.GetRatedBGRewards() instead function GetRatedBGRewards() local honor, experience, rewardsMap = C_PvP.GetRatedBGRewards(); local rewards = RewardMapToRewardsArray(rewardsMap); return honor, rewards; end -- C_PvP.GetArenaRewards(teamSize) instead function GetArenaRewards(teamSize) local honor, experience, rewardsMap = C_PvP.GetArenaRewards(teamSize); local rewards = RewardMapToRewardsArray(rewardsMap); return honor, rewards; end end -- WorldMap do function GetMapLandmarkInfo(index) local landmarkType, name, description, textureIndex, x, y, mapLinkID, inBattleMap, graveyardID, areaID, poiID, isObjectIcon, atlasIcon, displayAsBanner = C_WorldMap.GetMapLandmarkInfo(index); return landmarkType, name, description, textureIndex, x, y, mapLinkID, inBattleMap, graveyardID, areaID, poiID, isObjectIcon, atlasIcon; end end -- EquipmentSet do -- Use C_EquipmentSet.SaveEquipmentSet(equipmentSetID[, newIcon]) instead function SaveEquipmentSet(equipmentSetName, newIcon) local equipmentSetID = C_EquipmentSet.GetEquipmentSetID(equipmentSetName); C_EquipmentSet.SaveEquipmentSet(equipmentSetID, newIcon); end -- Use C_EquipmentSet.DeleteEquipmentSet(equipmentSetID) instead function DeleteEquipmentSet(equipmentSetName) local equipmentSetID = C_EquipmentSet.GetEquipmentSetID(equipmentSetName); C_EquipmentSet.DeleteEquipmentSet(equipmentSetID); end -- Use C_EquipmentSet.ModifyEquipmentSet(equipmentSetID, newName, newIcon) instead function ModifyEquipmentSet(oldName, newName, newIcon) local equipmentSetID = C_EquipmentSet.GetEquipmentSetID(oldName); C_EquipmentSet.ModifyEquipmentSet(equipmentSetID, newName, newIcon); end -- Use C_EquipmentSet.IgnoreSlotForSave(slot) instead function EquipmentManagerIgnoreSlotForSave(slot) C_EquipmentSet.IgnoreSlotForSave(slot); end -- Use C_EquipmentSet.IsSlotIgnoredForSave(slot) instead function EquipmentManagerIsSlotIgnoredForSave(slot) return C_EquipmentSet.IsSlotIgnoredForSave(slot); end -- Use C_EquipmentSet.ClearIgnoredSlotsForSave() instead function EquipmentManagerClearIgnoredSlotsForSave() C_EquipmentSet.ClearIgnoredSlotsForSave(); end -- Use C_EquipmentSet.UnignoreSlotForSave(slot) instead function EquipmentManagerUnignoreSlotForSave(slot) C_EquipmentSet.UnignoreSlotForSave(slot); end -- Use C_EquipmentSet.GetNumEquipmentSets() instead function GetNumEquipmentSets() return C_EquipmentSet.GetNumEquipmentSets(); end -- Use C_EquipmentSet.GetEquipmentSetInfo(equipmentSetID) instead function GetEquipmentSetInfo(equipmentSetIndex) local equipmentSetIDs = C_EquipmentSet.GetEquipmentSetIDs(); return C_EquipmentSet.GetEquipmentSetInfo(equipmentSetIDs[equipmentSetIndex]); end -- Use C_EquipmentSet.GetEquipmentSetInfo(equipmentSetID) instead function GetEquipmentSetInfoByName(equipmentSetName) local equipmentSetID = C_EquipmentSet.GetEquipmentSetID(equipmentSetName); return C_EquipmentSet.GetEquipmentSetInfo(equipmentSetID); end -- Use C_EquipmentSet.EquipmentSetContainsLockedItems(equipmentSetID) instead function EquipmentSetContainsLockedItems(equipmentSetName) local equipmentSetID = C_EquipmentSet.GetEquipmentSetID(equipmentSetName); return C_EquipmentSet.EquipmentSetContainsLockedItems(equipmentSetID); end -- Use C_EquipmentSet.PickupEquipmentSet(equipmentSetID) instead function PickupEquipmentSetByName(equipmentSetName) local equipmentSetID = C_EquipmentSet.GetEquipmentSetID(equipmentSetName); C_EquipmentSet.PickupEquipmentSet(equipmentSetID); end -- Use C_EquipmentSet.PickupEquipmentSet(equipmentSetID) instead function PickupEquipmentSet(equipmentSetIndex) local equipmentSetIDs = C_EquipmentSet.GetEquipmentSetIDs(); C_EquipmentSet.PickupEquipmentSet(equipmentSetIDs[equipmentSetIndex]); end -- Use C_EquipmentSet.UseEquipmentSet(equipmentSetID) instead function UseEquipmentSet(equipmentSetName) local equipmentSetID = C_EquipmentSet.GetEquipmentSetID(equipmentSetName); C_EquipmentSet.UseEquipmentSet(equipmentSetID); end -- Use C_EquipmentSet.CanUseEquipmentSets() instead function CanUseEquipmentSets() return C_EquipmentSet.CanUseEquipmentSets(); end -- Use C_EquipmentSet.GetItemIDs(equipmentSetID) instead function GetEquipmentSetItemIDs(equipmentSetName, returnTable) local equipmentSetID = C_EquipmentSet.GetEquipmentSetID(equipmentSetName); returnTable = returnTable or {}; return Mixin(returnTable, C_EquipmentSet.GetItemIDs(equipmentSetID)); end -- Use C_EquipmentSet.GetItemLocations(equipmentSetID) instead function GetEquipmentSetLocations(equipmentSetName, returnTable) local equipmentSetID = C_EquipmentSet.GetEquipmentSetID(equipmentSetName); returnTable = returnTable or {}; return Mixin(returnTable, C_EquipmentSet.GetItemLocations(equipmentSetID)); end -- Use C_EquipmentSet.GetIgnoredSlots(equipmentSetID) instead function GetEquipmentSetIgnoreSlots(equipmentSetName, returnTable) local equipmentSetID = C_EquipmentSet.GetEquipmentSetID(equipmentSetName); returnTable = returnTable or {}; return Mixin(returnTable, C_EquipmentSet.GetIgnoredSlots(equipmentSetID)); end end -- Unit* functions do -- Use UnitPower instead function UnitMana(unit) return UnitPower(unit, Enum.PowerType.Mana); end -- Use UnitPowerMax instead function UnitManaMax(unit) return UnitPowerMax(unit, Enum.PowerType.Mana); end end -- Calendar do -- Use C_Calendar.GetDayEvent instead function CalendarGetDayEvent(monthOffset, monthDay, index) local event = C_Calendar.GetDayEvent(monthOffset, monthDay, index); if (event) then local hour, minute; if (event.sequenceType == "END") then hour = event.endTime.hour; minute = event.endTime.minute; else hour = event.startTime.hour; minute = event.startTime.minute; end return event.title, hour, minute, event.calendarType, event.sequenceType, event.eventType, event.iconTexture, event.modStatus, event.inviteStatus, event.invitedBy, event.difficulty, event.inviteType, event.sequenceIndex, event.numSequenceDays, event.difficultyName; else return nil, 0, 0, "", "", 0, "", "", 0, "", 0, 0, 0, 0, ""; end end -- Use C_Calendar.GetHolidayInfo instead function CalendarGetHolidayInfo(monthOffset, monthDay, index) local holidayInfo = C_Calendar.GetHolidayInfo(monthOffset, monthDay, index); if (holidayInfo) then return holidayInfo.name, holidayInfo.description, holidayInfo.texture; end end end
local screenX, screenY = guiGetScreenSize() --------- [ Element Data returns ] --------- local function getData( theElement, key ) local key = tostring(key) if isElement(theElement) and (key) then return exports['[ars]anticheat-system']:c_callData( theElement, tostring(key) ) else return false end end local function setData( theElement, key, value, sync ) local key = tostring(key) local value = tonumber(value) or tostring(value) if isElement(theElement) and (key) and (value) then return exports['[ars]anticheat-system']:c_assignData( theElement, tostring(key), value, sync ) else return false end end local questions = { } questions[1] = { } questions[1][1] = { "If you plan to pass another vehicle, you should:", nil } questions[1][2] = { "Not assume the other driver will make space for you to return.", true } questions[1][3] = { "Assume the other driver will let you pass if you use you blinkers.", false } questions[1][4] = { "Assume the other driver will maintain a constant speed.", false } questions[2] = { } questions[2][1] = { "If an officer believes you are driving under the influence:", nil } questions[2][2] = { "You can refuse to be tested for the presence of alcohol or drugs.", false } questions[2][3] = { "You can refuse to be tested only if it is your first offense.", false } questions[2][4] = { "You cannot refuse to be tested for the presence of alcohol or drugs.", true } questions[3] = { } questions[3][1] = { "You should buckle your seat belt and make sure your passengers\ndo the same:", nil } questions[3][2] = { "When it's raining or snowing.", false } questions[3][3] = { "When you are getting ready to drive, before you start the engine.", true } questions[3][4] = { "Only when you're going on a long trip.", false } questions[4] = { } questions[4][1] = { "You may legally block an intersection:", nil } questions[4][2] = { "When you entered the intersection on the green light.", false } questions[4][3] = { "During rush hour traffic.", false } questions[4][4] = { "Under no circumstances.", true } questions[5] = { } questions[5][1] = { "Roadways are the most slippery:", nil } questions[5][2] = { "During a heavy downpour.", false } questions[5][3] = { "After it has been raining for awhile.", false } questions[5][4] = { "The first rain after a dry spell.", true } questions[6] = { } questions[6][1] = { "At intersections, crosswalks, and railroad crossings, you should\nalways:", nil } questions[6][2] = { "Stop, listen, and proceed cautiously.", false } questions[6][3] = { "Look to the sides of your vehicle to see what is coming.", true } questions[6][4] = { "Slowly pass vehicles that seem to be stopped for no reason.", false } questions[7] = { } questions[7][1] = { "You drive defensively when you:", nil } questions[7][2] = { "Always put one car length between you and the car ahead.", false } questions[7][3] = { "Look only at the car in front of you while driving.", false } questions[7][4] = { "Keep your eyes moving to look for possible hazards.", true } questions[8] = { } questions[8][1] = { "When you tailgate other drivers (drive close to their rear bumper):", nil } questions[8][2] = { "You can frustrate the other drivers and make them angry.", true } questions[8][3] = { "Your actions cannot result in a traffic citation.", false } questions[8][4] = { "You help reduce traffic congestion.", false } questions[9] = { } questions[9][1] = { "Should you always drive slower than other traffic?", nil } questions[9][2] = { "No, you can block traffic when you drive too slowly.", true } questions[9][3] = { "Yes, it is a good defensive driving technique.", false } questions[9][4] = { "Yes, it is always safer than driving faster than other traffic.", false } questions[10] = { } questions[10][1] = { "You are getting ready to make a right turn. You should:", nil } questions[10][2] = { "Signal and turn immediately.", false } questions[10][3] = { "Stop before entering the right lane and let all other traffic go first.", false } questions[10][4] = { "Slow down or stop, if necessary, and then make the turn.", true } questions[11] = { } questions[11][1] = { "There is no crosswalk and you see a pedestrian crossing your\nlane ahead.\nYou should:", nil } questions[11][2] = { "Make eye contact and then pass him/her.", false } questions[11][3] = { "Slow down as you pass him/her.", false } questions[11][4] = { "Stop and let him/her finish crossing the street.", true } questions[12] = { } questions[12][1] = { "Stopping distances on slippery roads are:", nil } questions[12][2] = { "About the same as on dry pavement.", false } questions[12][3] = { "A little less than on dry pavement.", false } questions[12][4] = { "2 to 10 times greater than on dry pavement.", true } questions[13] = { } questions[13][1] = { "When you hear the siren or see the flashing lights of an emergency\nvehicle, you must:", nil } questions[13][2] = { "Drive to the right side of the road and stop.", true } questions[13][3] = { "Slow down until it passes you.", false } questions[13][4] = { "Continue at the same speed, but pull to the right.", false } questions[14] = { } questions[14][1] = { "If you drive faster than other vehicles on a road with one lane in\neach direction and continually pass the other cars, you will:", nil } questions[14][2] = { "Get you to your destination much faster and safer.", false } questions[14][3] = { "Increase your chances of an accident.", true } questions[14][4] = { "Help prevent traffic congestion.", false } questions[15] = { } questions[15][1] = { "The safest precaution that you can take regarding the use of cell\nphones and driving is:", nil } questions[15][2] = { "Use hands-free devices so you can keep both hands on the wheel.", true } questions[15][3] = { "Keep your phone within easy reach so you can see the road.", false } questions[15][4] = { "Review the number before answering a call.", false } --------- [ Department of Motor Vehicles System ] --------- local employee = nil function createEmployee( res ) employee = createPed(147, -2035.0185, -118.3505, 1035.1718) setPedRotation(employee, 273) setElementInterior(employee, 3) setElementDimension(employee, 3) end addEventHandler("onClientResourceStart", resourceRoot, createEmployee) addEventHandler("onClientClick", root, function( button, state, absoluteX, absoluteY, worldX, worldY, worldZ, clickedElement ) if ( button == "right" and state == "up" ) then if (clickedElement) and (clickedElement == employee) then if ( getData( localPlayer, "loggedin") == 1 ) and ( not isElement( motorVehicleWindow ) ) then createMotorVehicleUI( ) end end end end ) function createMotorVehicleUI( ) local width, height = 420, 210 local x, y = (screenX/2) - (width/2), (screenY/2) - (height/2) motorVehicleWindow = guiCreateWindow(x, y, width, height, "Department of Motor Vehicles", false) motorVehicleLabel = guiCreateLabel(20, 30, 380, 20, "Which of the following licenses would you like to apply for?", false, motorVehicleWindow) licensesList = guiCreateGridList(20, 50, 380, 110, false, motorVehicleWindow) guiGridListAddColumn( licensesList, "Type", 0.5 ) guiGridListAddColumn( licensesList, "Price", 0.4 ) local drivingLicense = tonumber( getData( localPlayer, "d:license") ) if ( drivingLicense == 0 ) then local row = guiGridListAddRow( licensesList ) guiGridListSetItemText(licensesList, row, 1, "Driving License", false, false) guiGridListSetItemText(licensesList, row, 2, "$150", false, false) end buttonApplyLicense = guiCreateButton(40, 170, 110, 20, "Apply", false, motorVehicleWindow) addEventHandler("onClientGUIClick", buttonApplyLicense, function( button, state ) if ( button == "left" and state == "up" ) then local selected = guiGridListGetSelectedItem( licensesList ) if ( selected ~= -1 ) then local money = tonumber( getPlayerMoney(localPlayer)/100 ) if ( money >= 150 ) then showDrivingLicenseExam( ) triggerServerEvent("takeMoney", localPlayer, 50) triggerServerEvent("giveMoneyToGovernment", localPlayer, 50) else outputChatBox("You do not have enough money.", 255, 0, 0) end end end end ) buttonCancelApply = guiCreateButton(270, 170, 110, 20, "Cancel", false, motorVehicleWindow) addEventHandler("onClientGUIClick", buttonCancelApply, function( button, state ) if ( button == "left" and state == "up" ) then destroyElement( motorVehicleWindow ) end end ) guiSetFont(motorVehicleLabel, "clear-normal") end function showDrivingLicenseExam( ) guiSetSize(motorVehicleWindow, 420, 150, false) destroyElement( motorVehicleLabel ) destroyElement( licensesList ) destroyElement( buttonApplyLicense ) destroyElement( buttonCancelApply ) examLabel = guiCreateLabel(20, 30, 380, 30, "You need to pass an Examination before you proceed to the\nDriving Test. You must get about 60% in this Quiz to pass.", false, motorVehicleWindow) guiSetFont(examLabel, "clear-normal") buttonStartExam = guiCreateButton(155, 90, 110, 30, "Start Exam", false, motorVehicleWindow) addEventHandler("onClientGUIClick", buttonStartExam, function( button, state ) if ( button == "left" and state == "up" ) then guiSetSize(motorVehicleWindow, 460, 180, false) destroyElement( examLabel ) destroyElement( source ) -- Create Question createQuestion( ) end end, false ) end local taken = { } local radioButtons = { } local questionNo = 0 local points = 0 function createQuestion( ) if ( questionNo ~= 10 ) then local rand = getRandomQuestion( ) if ( rand == false ) then createQuestion( ) else local question = questions[rand][1][1] local answerOne = questions[rand][2][1] local answerTwo = questions[rand][3][1] local answerThree = questions[rand][4][1] local correct = nil if ( questions[rand][2][2] ) then correct = 1 elseif ( questions[rand][3][2] ) then correct = 2 elseif ( questions[rand][4][2] ) then correct = 3 end questionNo = questionNo + 1 questionLabel = guiCreateLabel(20, 30, 420, 30, "Q".. tostring(questionNo) ..". ".. tostring(question), false, motorVehicleWindow) radioOne = guiCreateRadioButton(20, 60, 420, 30, tostring(answerOne), false, motorVehicleWindow) radioTwo = guiCreateRadioButton(20, 80, 420, 30, tostring(answerTwo), false, motorVehicleWindow) radioThree = guiCreateRadioButton(20, 100, 420, 30, tostring(answerThree), false, motorVehicleWindow) guiRadioButtonSetSelected( radioOne, true ) radioButtons = { radioOne, radioTwo, radioThree } buttonNextQuestion = guiCreateButton(340, 140, 100, 20, "Next", false, motorVehicleWindow) addEventHandler("onClientGUIClick", buttonNextQuestion, function( button, state ) local selected = false for key, value in ipairs ( radioButtons ) do if ( guiRadioButtonGetSelected( value ) ) then selected = key end end if ( selected == correct ) then points = points + 1 end destroyElement( questionLabel ) for key, value in ipairs ( radioButtons ) do destroyElement( value ) end radioButtons = { } destroyElement( buttonNextQuestion ) destroyElement( buttonQuitExam ) -- Again! createQuestion( ) end, false ) buttonQuitExam = guiCreateButton(20, 140, 100, 20, "Quit", false, motorVehicleWindow) addEventHandler("onClientGUIClick", buttonQuitExam, function( button, state ) if ( button == "left" and state == "up" ) then destroyElement( motorVehicleWindow ) end end, false ) guiSetFont( radioOne, "default-bold-small") guiSetFont( radioTwo, "default-bold-small") guiSetFont( radioThree, "default-bold-small") guiSetFont( questionLabel, "default-bold-small") end else guiSetSize(motorVehicleWindow, 450, 130, false) local text = "" local r, g, b = nil, nil, nil local x = 20 if ( points >= 6 ) then text = "Congratulations! You obtained ".. tostring(points) .."0% in your exam and Passed!" r, g, b = 0, 255, 0 else text = "Sorry, You only obtained ".. tostring(points) .."0% in your exam and Failed." r, g, b = 255, 0, 0 x = 55 end resultLabel = guiCreateLabel(x, 30, 430, 20, tostring(text), false, motorVehicleWindow) guiSetFont(resultLabel, "clear-normal") guiLabelSetColor(resultLabel, r, g, b) if ( r == 0 ) then triggerServerEvent("takeMoney", localPlayer, 100) triggerServerEvent("giveMoneyToGovernment", localPlayer, 100) triggerServerEvent("setPlayerStudent", localPlayer) outputChatBox("Please go outside and sit in one of the Previons to begin your Practical Test.", 0, 255, 0) end buttonEndExam = guiCreateButton(155, 80, 110, 30, "Close", false, motorVehicleWindow) addEventHandler("onClientGUIClick", buttonEndExam, function( button, state ) if ( button == "left" and state == "up" ) then taken = { } radioButtons = { } questionNo = 0 points = 0 destroyElement( motorVehicleWindow ) end end, false ) end end function getRandomQuestion( ) local rand = math.random(1, 15) local alreadyShown = false for key, value in pairs ( taken ) do if ( key == rand ) then alreadyShown = true end end if ( alreadyShown ) then return false else taken[rand] = true return rand end end function selectExamOption( button, state ) if ( button == "left" and state == "up" ) then guiRadioButtonSetSelected( source, true ) for key, value in ipairs ( radioButtons ) do if ( value ~= source ) then guiRadioButtonSetSelected( source, false ) end end end end
-- ============================================= -- This file contains misc stuff, maybe deprecate? -- ============================================= if (GetConvar('txAdmin-menuEnabled', 'false') ~= 'true') then return end -- Consts SoundEnum = { move = 'NAV_UP_DOWN', enter = 'SELECT' } -- Audio play callback RegisterNUICallback('playSound', function(sound, cb) PlaySoundFrontend(-1, SoundEnum[sound], 'HUD_FRONTEND_DEFAULT_SOUNDSET', 1) cb({}) end) -- Heals local player RegisterNetEvent('txAdmin:menu:healed', function() debugPrint('Received heal event, healing to full') local ped = PlayerPedId() local pos = GetEntityCoords(ped) local heading = GetEntityHeading(ped) if IsEntityDead(ped) then NetworkResurrectLocalPlayer(pos[1], pos[2], pos[3], heading, false, false) end SetEntityHealth(ped, GetEntityMaxHealth(ped)) end) -- Tell the user he is an admin and that /tx is available AddEventHandler('playerSpawned', function() Wait(15000) if menuIsAccessible then sendMenuMessage('showMenuHelpInfo', {}) end end)
--- === Auto-reload or Test === --- --- If a config file changes then --- If it's listed in arot.modules_under_test, call its spec file --- If it's not, hs.reload() local M = {} -- Metadata M.name = 'AutoReloadOrTest' M.version = "0.1" M.author = "Matthew Fallshaw <m@fallshaw.me>" M.license = "MIT - https://opensource.org/licenses/MIT" M.homepage = "https://github.com/matthewfallshaw/" local logger = hs.logger.new("AutoReload") M._logger = logger local consts = require 'configConsts' local escape, unescape = require('utilities.string_escapes')() function M.hs_configdir() local dir = hs.configdir local target = hs.fs.symlinkAttributes(hs.configdir) and hs.fs.symlinkAttributes(hs.configdir).target if target then if target:sub(1,7) == '/Users/' then dir = target else dir = os.getenv("HOME")..'/'..target end end M.hs_configdir = function() return dir end -- memoize return dir end function M.modularise_file_path(file) local out = file out = (out:gsub(escape.for_regexp(M.hs_configdir()), '')) out = (out:gsub('^/spec/','')) out = (out:gsub('_spec%.lua$','.lua')) out = (out:gsub('/([^/]+)/init%.lua$','/%1.lua')) out = (out:gsub('%.lua$','')) out = (out:gsub('^/', '')) out = (out:gsub('/$', '')) out = (out:gsub('/', '.')) return out end function M.is_module_under_test(mod) local mods_under_test_with_spec_helper = {'spec_helper'} hs.fnutils.each(consts.modules_under_test, function(x) table.insert(mods_under_test_with_spec_helper, x) end) return hs.fnutils.contains(mods_under_test_with_spec_helper, mod) end function M.spec_from_module(mod) return "spec/".. (mod:gsub('%.','/')) .."_spec.lua" end function M.is_luafile(file) return (file:match('%.lua$')) and true or false end function M.is_specfile(file) return (file:match('_spec%.lua$')) end function M.file_types(files) local changed_modules_under_test = {} local changed_spec_files_for_modules_not_under_test = {} local changed_modules_not_under_test = {} hs.fnutils.each( files, function(f) if M.is_luafile(f) then local mod = M.modularise_file_path(f) if M.is_module_under_test(mod) then table.insert(changed_modules_under_test, mod) else if M.is_specfile(f) then table.insert(changed_spec_files_for_modules_not_under_test, f) else table.insert(changed_modules_not_under_test, mod) end end else -- do nothing with this file end end ) return changed_modules_under_test, changed_spec_files_for_modules_not_under_test, changed_modules_not_under_test end function M.test_module(mod) print(mod .." is under test, testing it") local output,status,ret_type,ret_code = hs.execute("/usr/local/bin/busted ".. M.spec_from_module(mod)) print(output) end function M.test_file(file) print(file .." is a spec file, running it") local output,status,ret_type,ret_code = hs.execute("/usr/local/bin/busted ".. file) print(output) end function M.test_or_reload(files) local changed_modules_under_test, changed_spec_files_for_modules_not_under_test, changed_modules_not_under_test = M.file_types(files) if #changed_modules_not_under_test > 0 then logger.i("modules not under test changed, reloading") hs.reload() else hs.fnutils.every(changed_modules_under_test, M.test_module) hs.fnutils.every(changed_spec_files_for_modules_not_under_test, M.test_file) if (#changed_modules_under_test + #changed_spec_files_for_modules_not_under_test) > 0 then hs.openConsole() end end end function M:start() logger.i("Starting config file watcher") self.configFileWatcher = hs.pathwatcher.new(hs.configdir, function(files) M.test_or_reload(files) end) self.configFileWatcher:start() end return M
function OnCommandSwitchTeamTypes(message) kTeam1Type = message.team1Type kTeam2Type = message.team2Type kTeamIndexToType[kTeam1Index] = kTeam1Type kTeamIndexToType[kTeam2Index] = kTeam2Type end Predict.HookNetworkMessage("SwitchTeamTypes", OnCommandSwitchTeamTypes)
local fs = require("filesystem") local shell = require("shell") local term = require("term") local dirsArg, ops = shell.parse(...) if #dirsArg == 0 then table.insert(dirsArg, ".") end local ec = 0 local gpu = term.gpu() local fOut = term.isAvailable() and io.output().tty local function perr(msg) io.stderr:write(msg,"\n") ec = 2 end local function _path(n,i) return n[i]:sub(1, 1) == '/' and "" or n.path end local function _name(n,i) return ops.p and n[i] or n[i]:gsub("/+$", "") end local function _sort_name(n,i) return _name(n,i):gsub("^%.","") end local function _fullPath(n,i) return fs.concat(_path(n,i),_name(n,i)) end local function _isLink(n,i) return (fs.isLink(_fullPath(n,i))) end local function _linkPath(n,i) return select(2,fs.isLink(_fullPath(n,i))) end local function _isDir(n,i) return fs.isDirectory(_fullPath(n,i)) end local function _size(n,i) return _isLink(n,i) and 0 or fs.size(_fullPath(n,i)) end local function _time(n,i) return fs.lastModified(_fullPath(n,i)) end local function _ext(n,i) return _name(n,i):match("(%.[^.]+)$") or "" end local function toArray(i) local r={} for n in i do r[#r+1]=n end return r end local restore_color = function() end local set_color = function() end local prev_color local function colorize(n,i) return prev_color end if fOut and not ops["no-color"] then local LSC = os.getenv("LS_COLORS") if type(LSC) == "string" then LSC = require("serialization").unserialize(LSC) end if not LSC then perr("ls: unparsable value for LS_COLORS environment variable") else prev_color = gpu.getForeground() restore_color = function() gpu.setForeground(prev_color) end colorize=function(n,i) return _isLink(n,i) and LSC.LINK or _isDir(n,i) and LSC.DIR or LSC['*'.._ext(n,i)] or LSC.FILE or prev_color end set_color=function(c) if gpu.getForeground() ~= c then io.stdout:flush() gpu.setForeground(c) end end end end local msft={reports=0,proxies={}} function msft.report(files, dirs, used, proxy) local free = proxy.spaceTotal() - proxy.spaceUsed() restore_color() local pattern = "%5i File(s) %11i bytes\n%5i Dir(s) %11s bytes free\n" io.write(string.format(pattern, files, used, dirs, tostring(free))) end function msft.tail(n) local x = fs.get(n.path) if not x then return end local u,f,d=0,0,0 for i=1,#n do if _isDir(n,i) then d=d+1 else f=f+1;u=u+_size(n,i) end end msft.report(f,d,u,x) local ps=msft.proxies ps[x]=ps[x]or{files=0,dirs=0,used=0} local p=ps[x] p.files=p.files+f p.dirs=p.dirs+d p.used=p.used+u msft.reports=msft.reports+1 end function msft.final() if msft.reports < 2 then return end local g = {} for p,r in pairs(msft.proxies) do g[#g+1]={proxy=p,report=r} end restore_color() print("Total Files Listed:") for _,p in ipairs(g) do if #g>1 then print("As pertaining to: "..p.proxy.address) end msft.report(p.report.files, p.report.dirs, p.report.used, p.proxy) end end if not ops.M then msft.tail=function()end msft.final=function()end end local function nod(n) return n and (tostring(n):gsub("(%.[0-9]+)0+$","%1")) or "0" end local function formatSize(size) if not ops.h and not ops['human-readable'] and not ops.si then return tostring(size) end local sizes = {"", "K", "M", "G"} local unit = 1 local power = ops.si and 1000 or 1024 while size > power and unit < #sizes do unit = unit + 1 size = size / power end return nod(math.floor(size*10)/10)..sizes[unit] end local function pad(txt) txt = tostring(txt) return #txt >= 2 and txt or "0"..txt end local day_names={"Sunday","Monday","Tuesday","Wednesday","Thursday","Friday", "Saturday"} local month_names={"January","February","March","April","May","June","July", "August","September","October","November","December"} local function formatDate(epochms) local d = os.date("*t", epochms) return ops['full-time'] and string.format("%s-%s-%s %s:%s:%s",d.year,pad(nod(d.month)),pad(nod(d.day)),pad(nod(d.hour)),pad(nod(d.min)),pad(nod(d.sec))) or string.format("%s %+2s %+2s:%+2s",month_names[d.month]:sub(1,3),nod(d.day),pad(nod(d.hour)),pad(nod(d.min))) end local function filter(n) if ops.a then return n end local s = {path=n.path} for i,x in ipairs(n) do if fs.name(_name(n,i)):sub(1,1) ~= "." then s[#s+1]=x end end return s end local function sort(n) local once=false local function ni(v) for i=1,#n do if n[i]==v then return i end end end local function sorter(_fp) once=true table.sort(n,function(a,b)return _fp(n,ni(a))>_fp(n,ni(b))end) end local rev = ops.r or ops.reverse if ops.t then sorter(_time) end if ops.X then sorter(_ext) end if ops.S then sorter(_size) end if not once then sorter(_sort_name) rev=not rev end if rev then for i=1,#n/2 do n[i],n[#n-i+1]=n[#n-i+1],n[i] end end return n end local function dig(n, dirs, dir) if ops.R then local di = 1 for i=1,#n do if _isDir(n,i) then local p=dir..(dir:sub(-1) == "/" and "" or "/") table.insert(dirs,di,p.._name(n,i)) di=di+1 end end end return n end local function wide(n,i) local t = _isLink(n,i) and 'l' or _isDir(n,i) and 'd' or 'f' local link_target = _isLink(n,i) and string.format(" -> %s",_linkPath(n,i)..(_isDir(n,i)and"/"or""))or"" local w = fs.get(_fullPath(n,i)).isReadOnly() and '-' or 'w' local size = formatSize(_size(n,i)) local modDate = formatDate(_time(n,i)) return string.format("%s-r%s %+7s %s ",t,w,size,modDate),_name(n,i)..link_target end local first_display = true local function display(n) local mt={} local lines=setmetatable({},mt) if ops.l then lines.n=#n mt.__index=function(tbl,index)local m,l=wide(n,index)return{{color=prev_color,name=m},{color=colorize(n,index),name=l}}end elseif ops["1"] or not fOut then lines.n=#n mt.__index=function(tbl,index)local m,l=wide(n,index)return{{color=colorize(n,index),name=_name(n,index)}}end else -- columns local cols,d,w=0,0,select(3,term.getGlobalArea())-1 local function real(x, y) local index = y + ((x-1) * d) return index <= #n and index or nil end local function max_name(ci) local max=0 -- return the width of the max element in ci for r=1,d do local ri=real(ci,r) if not ri then break end max=math.max(max,_name(n,ri):len()) end return max end local function measure(_cols) local t=0 for c=1,_cols do t=t+max_name(c)+(c>1 and 2 or 0) end return t end while d<#n do d=d+1 cols=math.ceil(#n/d) if measure(cols)<w then break end end lines.n=d mt.__index=function(tbl,di)return setmetatable({},{ __len=function()return cols end, __index=function(tbl,ci) local ri=real(ci, di) if not ri then return end local nm=_name(n,ri) return{ color=colorize(n,ri), name=nm..string.rep(' ',max_name(ci)-#nm+(ci<cols and 2 or 0)) }end})end end for li=1,lines.n do local l=lines[li] for ei=1,#l do local e=l[ei] if not e then break end first_display = false set_color(e.color) io.write(e.name) end print() end msft.tail(n) end local header = function() end if #dirsArg > 1 or ops.R then header = function(path) if not first_display then print() end restore_color() io.write(path,":\n") end end local function splitDirsFromFileArgs(dirs) local trimmed = {} local files = {} for _,dir in ipairs(dirs) do local path = shell.resolve(dir) if not fs.exists(path) then perr("cannot access " .. tostring(path) .. ": No such file or directory") elseif fs.isDirectory(path) then table.insert(trimmed, dir) else -- file or link table.insert(files, dir) end end return files, trimmed end local function displayDirList(dirs) while #dirs > 0 do local dir = table.remove(dirs, 1) header(dir) local path = shell.resolve(dir) local list, reason = fs.list(path) if not list then perr(reason) else local n=toArray(list) n.path=path display(dig(sort(filter(n)),dirs,dir)) end end end local tr,cp={},{path=shell.getWorkingDirectory()} for _,dir in ipairs(dirsArg) do local path = shell.resolve(dir) if not fs.exists(path) then perr("cannot access " .. tostring(path) .. ": No such file or directory") elseif fs.isDirectory(path) then tr[#tr+1]=dir else -- file or link cp[#cp+1]=dir end end io.output():setvbuf("line") if #cp > 0 then display(sort(cp)) end displayDirList(tr) msft.final() io.output():flush() io.output():setvbuf("no") restore_color() return ec
local AddonName, AddonTable = ... -- MoP Engineering AddonTable.engineering = { -- Materials 94113, -- Jard's Peculiar Energy Source 90146, -- Tinker's Kit -- Crafts 87213, -- Mist-Piercing Goggles }
--- @todo Сделать отдельную библиотеку yunit.dll, к-ая не линкуется ни с одной из библиотек Lua. Но имеет перенаправлять вызовы функций вида luaopen_yunit_lfs в вызов фукнций из соответствующей библиотеки yunit_lua_??.dll. Это естественней, т.к. на этапе компиляции, в настройках проекта (а значит прямо из CMake) можно задать имена библиотек, в к-ые нужно перенаправлять вызовы local yunitLibOutName if 'Lua 5.2' == _VERSION then yunitLibOutName = 'yunit_lua_52' elseif 'Lua 5.1' == _VERSION then yunitLibOutName = 'yunit_lua_51' else yunitLibOutName = 'yunit' end function loadSubModule(name) package.loaded['yunit.' .. name] = require(yunitLibOutName .. '.' .. name) end -- preload all C++ submodules loadSubModule('aux') loadSubModule('cppunit') loadSubModule('lfs') loadSubModule('mine') loadSubModule('trace') -- keep it as separate file for backward compatible with old version of yUnit require "yunit.default_test_run" local aux = require "yunit.aux" local fs = require "yunit.filesystem" if 'win' == fs.whatOs() then local proccesses = aux.allProccesses() local curProcParentPid = proccesses[aux.pid()].ppid local proc = proccesses[curProcParentPid] while proc do local exe = string.lower(proc.exe) if string.find(exe, 'devenv.exe') then require "yunit.work_in_vs" break; elseif string.find(exe, 'netbeans') then require "yunit.work_in_netbeans" break; elseif string.find(exe, 'scite') then require "yunit.work_in_scite" break; elseif string.find(exe, 'cmd.exe') then require "yunit.work_in_cmd" break; end proc = proccesses[proc.ppid] end else -- not Windows local pid = aux.pid() local ppid = aux.ppid(pid) local reachedInitProcess = nil == ppid or 1 == ppid while not reachedInitProcess do local exe = string.lower(aux.exePath(pid)) if string.find(exe, 'netbeans') then require "yunit.work_in_netbeans" break; elseif string.find(exe, 'scite') then require "yunit.work_in_scite" break; elseif string.find(exe, 'bash') then require "yunit.work_in_bash" break; end pid = ppid ppid = aux.ppid(pid) reachedInitProcess = nil == ppid or 1 == ppid end if reachedInitProcess then require "yunit.work_in_scite" end end --]=]
require("rrpg.lua"); local __o_rrpgObjs = require("rrpgObjs.lua"); require("rrpgGUI.lua"); require("rrpgDialogs.lua"); require("rrpgLFM.lua"); require("ndb.lua"); function newfrmAMZ2_2() __o_rrpgObjs.beginObjectsLoading(); local obj = gui.fromHandle(_obj_newObject("form")); local self = obj; local sheet = nil; rawset(obj, "_oldSetNodeObjectFunction", rawget(obj, "setNodeObject")); function obj:setNodeObject(nodeObject) sheet = nodeObject; self.sheet = nodeObject; self:_oldSetNodeObjectFunction(nodeObject); end; function obj:setNodeDatabase(nodeObject) self:setNodeObject(nodeObject); end; _gui_assignInitialParentForForm(obj.handle); obj:beginUpdate(); obj:setName("frmAMZ2_2"); obj:setAlign("client"); obj:setTheme("dark"); obj.scrollBox1 = gui.fromHandle(_obj_newObject("scrollBox")); obj.scrollBox1:setParent(obj); obj.scrollBox1:setAlign("client"); obj.scrollBox1:setName("scrollBox1"); obj.layout1 = gui.fromHandle(_obj_newObject("layout")); obj.layout1:setParent(obj.scrollBox1); obj.layout1:setLeft(0); obj.layout1:setTop(0); obj.layout1:setWidth(270); obj.layout1:setHeight(255); obj.layout1:setName("layout1"); obj.rectangle1 = gui.fromHandle(_obj_newObject("rectangle")); obj.rectangle1:setParent(obj.layout1); obj.rectangle1:setAlign("client"); obj.rectangle1:setColor("black"); obj.rectangle1:setXradius(5); obj.rectangle1:setYradius(5); obj.rectangle1:setCornerType("round"); obj.rectangle1:setName("rectangle1"); obj.label1 = gui.fromHandle(_obj_newObject("label")); obj.label1:setParent(obj.layout1); obj.label1:setLeft(0); obj.label1:setTop(0); obj.label1:setWidth(270); obj.label1:setHeight(20); obj.label1:setText("Geral"); obj.label1:setHorzTextAlign("center"); obj.label1:setName("label1"); obj.layout2 = gui.fromHandle(_obj_newObject("layout")); obj.layout2:setParent(obj.layout1); obj.layout2:setLeft(5); obj.layout2:setTop(25); obj.layout2:setWidth(260); obj.layout2:setHeight(50); obj.layout2:setName("layout2"); obj.label2 = gui.fromHandle(_obj_newObject("label")); obj.label2:setParent(obj.layout2); obj.label2:setLeft(0); obj.label2:setTop(0); obj.label2:setWidth(110); obj.label2:setHeight(20); obj.label2:setText("Modelo"); obj.label2:setHorzTextAlign("center"); obj.label2:setName("label2"); obj.comboBox1 = gui.fromHandle(_obj_newObject("comboBox")); obj.comboBox1:setParent(obj.layout2); obj.comboBox1:setLeft(110); obj.comboBox1:setTop(0); obj.comboBox1:setWidth(150); obj.comboBox1:setHeight(25); obj.comboBox1:setField("modelo_nome"); obj.comboBox1:setItems({'Inicial', 'Godlike', 'Zeus-Tester'}); obj.comboBox1:setName("comboBox1"); obj.modelo_tipo_edit = gui.fromHandle(_obj_newObject("edit")); obj.modelo_tipo_edit:setParent(obj.layout2); obj.modelo_tipo_edit:setLeft(110); obj.modelo_tipo_edit:setTop(25); obj.modelo_tipo_edit:setWidth(150); obj.modelo_tipo_edit:setHeight(25); obj.modelo_tipo_edit:setField("modelo_tipo"); obj.modelo_tipo_edit:setName("modelo_tipo_edit"); obj.modelo_tipo_edit:setVisible(false); obj.modelo_tipo_comboBox = gui.fromHandle(_obj_newObject("comboBox")); obj.modelo_tipo_comboBox:setParent(obj.layout2); obj.modelo_tipo_comboBox:setLeft(110); obj.modelo_tipo_comboBox:setTop(25); obj.modelo_tipo_comboBox:setWidth(150); obj.modelo_tipo_comboBox:setHeight(25); obj.modelo_tipo_comboBox:setField("modelo_tipo"); obj.modelo_tipo_comboBox:setName("modelo_tipo_comboBox"); obj.modelo_tipo_comboBox:setItems({'Bruiser', 'Trickster', 'Gunner', 'Elemental', 'Support'}); obj.modelo_tipo_comboBox:setVisible(false); obj.layout3 = gui.fromHandle(_obj_newObject("layout")); obj.layout3:setParent(obj.layout1); obj.layout3:setLeft(5); obj.layout3:setTop(75); obj.layout3:setWidth(260); obj.layout3:setHeight(75); obj.layout3:setName("layout3"); obj.label3 = gui.fromHandle(_obj_newObject("label")); obj.label3:setParent(obj.layout3); obj.label3:setLeft(110); obj.label3:setTop(5); obj.label3:setWidth(50); obj.label3:setHeight(20); obj.label3:setText("Inicial"); obj.label3:setHorzTextAlign("center"); obj.label3:setName("label3"); obj.label4 = gui.fromHandle(_obj_newObject("label")); obj.label4:setParent(obj.layout3); obj.label4:setLeft(160); obj.label4:setTop(5); obj.label4:setWidth(50); obj.label4:setHeight(20); obj.label4:setText("Evolução"); obj.label4:setHorzTextAlign("center"); obj.label4:setFontSize(11); obj.label4:setName("label4"); obj.label5 = gui.fromHandle(_obj_newObject("label")); obj.label5:setParent(obj.layout3); obj.label5:setLeft(210); obj.label5:setTop(5); obj.label5:setWidth(50); obj.label5:setHeight(20); obj.label5:setText("Total"); obj.label5:setHorzTextAlign("center"); obj.label5:setName("label5"); obj.label6 = gui.fromHandle(_obj_newObject("label")); obj.label6:setParent(obj.layout3); obj.label6:setLeft(0); obj.label6:setTop(25); obj.label6:setWidth(110); obj.label6:setHeight(20); obj.label6:setText("HP"); obj.label6:setHorzTextAlign("center"); obj.label6:setName("label6"); obj.edit1 = gui.fromHandle(_obj_newObject("edit")); obj.edit1:setParent(obj.layout3); obj.edit1:setLeft(110); obj.edit1:setTop(25); obj.edit1:setWidth(50); obj.edit1:setHeight(25); obj.edit1:setField("hp_inicial"); obj.edit1:setType("number"); obj.edit1:setName("edit1"); obj.edit2 = gui.fromHandle(_obj_newObject("edit")); obj.edit2:setParent(obj.layout3); obj.edit2:setLeft(160); obj.edit2:setTop(25); obj.edit2:setWidth(50); obj.edit2:setHeight(25); obj.edit2:setField("hp_evolucao"); obj.edit2:setType("number"); obj.edit2:setName("edit2"); obj.edit3 = gui.fromHandle(_obj_newObject("edit")); obj.edit3:setParent(obj.layout3); obj.edit3:setLeft(210); obj.edit3:setTop(25); obj.edit3:setWidth(50); obj.edit3:setHeight(25); obj.edit3:setField("hp_total"); obj.edit3:setType("number"); obj.edit3:setName("edit3"); obj.label7 = gui.fromHandle(_obj_newObject("label")); obj.label7:setParent(obj.layout3); obj.label7:setLeft(0); obj.label7:setTop(50); obj.label7:setWidth(110); obj.label7:setHeight(20); obj.label7:setText("Energia"); obj.label7:setHorzTextAlign("center"); obj.label7:setName("label7"); obj.edit4 = gui.fromHandle(_obj_newObject("edit")); obj.edit4:setParent(obj.layout3); obj.edit4:setLeft(110); obj.edit4:setTop(50); obj.edit4:setWidth(50); obj.edit4:setHeight(25); obj.edit4:setField("energia_inicial"); obj.edit4:setType("number"); obj.edit4:setName("edit4"); obj.edit5 = gui.fromHandle(_obj_newObject("edit")); obj.edit5:setParent(obj.layout3); obj.edit5:setLeft(160); obj.edit5:setTop(50); obj.edit5:setWidth(50); obj.edit5:setHeight(25); obj.edit5:setField("energia_evolucao"); obj.edit5:setType("number"); obj.edit5:setName("edit5"); obj.edit6 = gui.fromHandle(_obj_newObject("edit")); obj.edit6:setParent(obj.layout3); obj.edit6:setLeft(210); obj.edit6:setTop(50); obj.edit6:setWidth(50); obj.edit6:setHeight(25); obj.edit6:setField("energia_total"); obj.edit6:setType("number"); obj.edit6:setName("edit6"); obj.layout4 = gui.fromHandle(_obj_newObject("layout")); obj.layout4:setParent(obj.layout1); obj.layout4:setLeft(5); obj.layout4:setTop(150); obj.layout4:setWidth(260); obj.layout4:setHeight(25); obj.layout4:setName("layout4"); obj.label8 = gui.fromHandle(_obj_newObject("label")); obj.label8:setParent(obj.layout4); obj.label8:setLeft(0); obj.label8:setTop(0); obj.label8:setWidth(110); obj.label8:setHeight(20); obj.label8:setText("Nível"); obj.label8:setHorzTextAlign("center"); obj.label8:setName("label8"); obj.edit7 = gui.fromHandle(_obj_newObject("edit")); obj.edit7:setParent(obj.layout4); obj.edit7:setLeft(110); obj.edit7:setTop(0); obj.edit7:setWidth(150); obj.edit7:setHeight(25); obj.edit7:setField("nivel_zhul"); obj.edit7:setName("edit7"); obj.layout5 = gui.fromHandle(_obj_newObject("layout")); obj.layout5:setParent(obj.layout1); obj.layout5:setLeft(5); obj.layout5:setTop(175); obj.layout5:setWidth(260); obj.layout5:setHeight(25); obj.layout5:setName("layout5"); obj.label9 = gui.fromHandle(_obj_newObject("label")); obj.label9:setParent(obj.layout5); obj.label9:setLeft(0); obj.label9:setTop(0); obj.label9:setWidth(260); obj.label9:setHeight(20); obj.label9:setText("Informações de Resistência"); obj.label9:setHorzTextAlign("center"); obj.label9:setName("label9"); obj.layout6 = gui.fromHandle(_obj_newObject("layout")); obj.layout6:setParent(obj.layout1); obj.layout6:setLeft(5); obj.layout6:setTop(200); obj.layout6:setWidth(260); obj.layout6:setHeight(25); obj.layout6:setName("layout6"); obj.label10 = gui.fromHandle(_obj_newObject("label")); obj.label10:setParent(obj.layout6); obj.label10:setLeft(0); obj.label10:setTop(0); obj.label10:setWidth(55); obj.label10:setHeight(20); obj.label10:setText("10%"); obj.label10:setHorzTextAlign("center"); obj.label10:setName("label10"); obj.edit8 = gui.fromHandle(_obj_newObject("edit")); obj.edit8:setParent(obj.layout6); obj.edit8:setLeft(55); obj.edit8:setTop(0); obj.edit8:setWidth(75); obj.edit8:setHeight(25); obj.edit8:setField("res_10"); obj.edit8:setType("number"); obj.edit8:setName("edit8"); obj.label11 = gui.fromHandle(_obj_newObject("label")); obj.label11:setParent(obj.layout6); obj.label11:setLeft(130); obj.label11:setTop(0); obj.label11:setWidth(55); obj.label11:setHeight(20); obj.label11:setText("30%"); obj.label11:setHorzTextAlign("center"); obj.label11:setName("label11"); obj.edit9 = gui.fromHandle(_obj_newObject("edit")); obj.edit9:setParent(obj.layout6); obj.edit9:setLeft(185); obj.edit9:setTop(0); obj.edit9:setWidth(75); obj.edit9:setHeight(25); obj.edit9:setField("res_30"); obj.edit9:setType("number"); obj.edit9:setName("edit9"); obj.layout7 = gui.fromHandle(_obj_newObject("layout")); obj.layout7:setParent(obj.layout1); obj.layout7:setLeft(5); obj.layout7:setTop(225); obj.layout7:setWidth(260); obj.layout7:setHeight(25); obj.layout7:setName("layout7"); obj.label12 = gui.fromHandle(_obj_newObject("label")); obj.label12:setParent(obj.layout7); obj.label12:setLeft(0); obj.label12:setTop(0); obj.label12:setWidth(55); obj.label12:setHeight(20); obj.label12:setText("50%"); obj.label12:setHorzTextAlign("center"); obj.label12:setName("label12"); obj.edit10 = gui.fromHandle(_obj_newObject("edit")); obj.edit10:setParent(obj.layout7); obj.edit10:setLeft(55); obj.edit10:setTop(0); obj.edit10:setWidth(75); obj.edit10:setHeight(25); obj.edit10:setField("res_50"); obj.edit10:setType("number"); obj.edit10:setName("edit10"); obj.label13 = gui.fromHandle(_obj_newObject("label")); obj.label13:setParent(obj.layout7); obj.label13:setLeft(130); obj.label13:setTop(0); obj.label13:setWidth(55); obj.label13:setHeight(20); obj.label13:setText("80%"); obj.label13:setHorzTextAlign("center"); obj.label13:setName("label13"); obj.edit11 = gui.fromHandle(_obj_newObject("edit")); obj.edit11:setParent(obj.layout7); obj.edit11:setLeft(185); obj.edit11:setTop(0); obj.edit11:setWidth(75); obj.edit11:setHeight(25); obj.edit11:setField("res_80"); obj.edit11:setType("number"); obj.edit11:setName("edit11"); obj.layout8 = gui.fromHandle(_obj_newObject("layout")); obj.layout8:setParent(obj.scrollBox1); obj.layout8:setLeft(0); obj.layout8:setTop(265); obj.layout8:setWidth(270); obj.layout8:setHeight(255); obj.layout8:setName("layout8"); obj.rectangle2 = gui.fromHandle(_obj_newObject("rectangle")); obj.rectangle2:setParent(obj.layout8); obj.rectangle2:setAlign("client"); obj.rectangle2:setColor("black"); obj.rectangle2:setXradius(5); obj.rectangle2:setYradius(5); obj.rectangle2:setCornerType("round"); obj.rectangle2:setName("rectangle2"); obj.label14 = gui.fromHandle(_obj_newObject("label")); obj.label14:setParent(obj.layout8); obj.label14:setLeft(0); obj.label14:setTop(0); obj.label14:setWidth(270); obj.label14:setHeight(20); obj.label14:setText("Pontos de Personagem (PPs)"); obj.label14:setHorzTextAlign("center"); obj.label14:setName("label14"); obj.layout9 = gui.fromHandle(_obj_newObject("layout")); obj.layout9:setParent(obj.layout8); obj.layout9:setLeft(5); obj.layout9:setTop(25); obj.layout9:setWidth(260); obj.layout9:setHeight(25); obj.layout9:setName("layout9"); obj.label15 = gui.fromHandle(_obj_newObject("label")); obj.label15:setParent(obj.layout9); obj.label15:setLeft(0); obj.label15:setTop(0); obj.label15:setWidth(110); obj.label15:setHeight(20); obj.label15:setText("Total"); obj.label15:setHorzTextAlign("center"); obj.label15:setName("label15"); obj.edit12 = gui.fromHandle(_obj_newObject("edit")); obj.edit12:setParent(obj.layout9); obj.edit12:setLeft(110); obj.edit12:setTop(0); obj.edit12:setWidth(150); obj.edit12:setHeight(25); obj.edit12:setField("pps_total"); obj.edit12:setType("number"); obj.edit12:setName("edit12"); obj.layout10 = gui.fromHandle(_obj_newObject("layout")); obj.layout10:setParent(obj.layout8); obj.layout10:setLeft(5); obj.layout10:setTop(50); obj.layout10:setWidth(260); obj.layout10:setHeight(25); obj.layout10:setName("layout10"); obj.label16 = gui.fromHandle(_obj_newObject("label")); obj.label16:setParent(obj.layout10); obj.label16:setLeft(0); obj.label16:setTop(0); obj.label16:setWidth(110); obj.label16:setHeight(20); obj.label16:setText("Gastos - Allei"); obj.label16:setHorzTextAlign("center"); obj.label16:setName("label16"); obj.edit13 = gui.fromHandle(_obj_newObject("edit")); obj.edit13:setParent(obj.layout10); obj.edit13:setLeft(110); obj.edit13:setTop(0); obj.edit13:setWidth(150); obj.edit13:setHeight(25); obj.edit13:setField("pps_gastos_zhul"); obj.edit13:setType("number"); obj.edit13:setName("edit13"); obj.layout11 = gui.fromHandle(_obj_newObject("layout")); obj.layout11:setParent(obj.layout8); obj.layout11:setLeft(5); obj.layout11:setTop(75); obj.layout11:setWidth(260); obj.layout11:setHeight(25); obj.layout11:setName("layout11"); obj.label17 = gui.fromHandle(_obj_newObject("label")); obj.label17:setParent(obj.layout11); obj.label17:setLeft(0); obj.label17:setTop(0); obj.label17:setWidth(110); obj.label17:setHeight(20); obj.label17:setText("Saldo Total"); obj.label17:setHorzTextAlign("center"); obj.label17:setName("label17"); obj.rectangle3 = gui.fromHandle(_obj_newObject("rectangle")); obj.rectangle3:setParent(obj.layout11); obj.rectangle3:setLeft(110); obj.rectangle3:setTop(0); obj.rectangle3:setWidth(150); obj.rectangle3:setHeight(25); obj.rectangle3:setColor("black"); obj.rectangle3:setStrokeColor("white"); obj.rectangle3:setStrokeSize(1); obj.rectangle3:setName("rectangle3"); obj.label18 = gui.fromHandle(_obj_newObject("label")); obj.label18:setParent(obj.layout11); obj.label18:setLeft(110); obj.label18:setTop(0); obj.label18:setWidth(150); obj.label18:setHeight(25); obj.label18:setHorzTextAlign("center"); obj.label18:setField("pps_saldo"); obj.label18:setName("label18"); obj.layout12 = gui.fromHandle(_obj_newObject("layout")); obj.layout12:setParent(obj.layout8); obj.layout12:setLeft(5); obj.layout12:setTop(100); obj.layout12:setWidth(260); obj.layout12:setHeight(150); obj.layout12:setName("layout12"); obj.label19 = gui.fromHandle(_obj_newObject("label")); obj.label19:setParent(obj.layout12); obj.label19:setLeft(0); obj.label19:setTop(0); obj.label19:setWidth(260); obj.label19:setHeight(20); obj.label19:setText("Balanço de PPs"); obj.label19:setHorzTextAlign("center"); obj.label19:setName("label19"); obj.textEditor1 = gui.fromHandle(_obj_newObject("textEditor")); obj.textEditor1:setParent(obj.layout12); obj.textEditor1:setLeft(0); obj.textEditor1:setTop(25); obj.textEditor1:setWidth(260); obj.textEditor1:setHeight(125); obj.textEditor1:setField("pps_dist_zhul"); obj.textEditor1:setName("textEditor1"); obj.layout13 = gui.fromHandle(_obj_newObject("layout")); obj.layout13:setParent(obj.scrollBox1); obj.layout13:setLeft(280); obj.layout13:setTop(0); obj.layout13:setWidth(320); obj.layout13:setHeight(155); obj.layout13:setName("layout13"); obj.rectangle4 = gui.fromHandle(_obj_newObject("rectangle")); obj.rectangle4:setParent(obj.layout13); obj.rectangle4:setAlign("client"); obj.rectangle4:setColor("black"); obj.rectangle4:setXradius(5); obj.rectangle4:setYradius(5); obj.rectangle4:setCornerType("round"); obj.rectangle4:setName("rectangle4"); obj.label20 = gui.fromHandle(_obj_newObject("label")); obj.label20:setParent(obj.layout13); obj.label20:setLeft(0); obj.label20:setTop(0); obj.label20:setWidth(320); obj.label20:setHeight(20); obj.label20:setText("Atributos"); obj.label20:setHorzTextAlign("center"); obj.label20:setName("label20"); obj.layout14 = gui.fromHandle(_obj_newObject("layout")); obj.layout14:setParent(obj.layout13); obj.layout14:setLeft(5); obj.layout14:setTop(25); obj.layout14:setWidth(310); obj.layout14:setHeight(25); obj.layout14:setName("layout14"); obj.label21 = gui.fromHandle(_obj_newObject("label")); obj.label21:setParent(obj.layout14); obj.label21:setLeft(110); obj.label21:setTop(5); obj.label21:setWidth(50); obj.label21:setHeight(20); obj.label21:setText("Inicial"); obj.label21:setHorzTextAlign("center"); obj.label21:setName("label21"); obj.label22 = gui.fromHandle(_obj_newObject("label")); obj.label22:setParent(obj.layout14); obj.label22:setLeft(160); obj.label22:setTop(5); obj.label22:setWidth(50); obj.label22:setHeight(20); obj.label22:setText("Modelo"); obj.label22:setHorzTextAlign("center"); obj.label22:setName("label22"); obj.label23 = gui.fromHandle(_obj_newObject("label")); obj.label23:setParent(obj.layout14); obj.label23:setLeft(210); obj.label23:setTop(5); obj.label23:setWidth(50); obj.label23:setHeight(20); obj.label23:setText("Evolução"); obj.label23:setHorzTextAlign("center"); obj.label23:setFontSize(11); obj.label23:setName("label23"); obj.label24 = gui.fromHandle(_obj_newObject("label")); obj.label24:setParent(obj.layout14); obj.label24:setLeft(260); obj.label24:setTop(5); obj.label24:setWidth(50); obj.label24:setHeight(20); obj.label24:setText("Total"); obj.label24:setHorzTextAlign("center"); obj.label24:setName("label24"); obj.layout15 = gui.fromHandle(_obj_newObject("layout")); obj.layout15:setParent(obj.layout13); obj.layout15:setLeft(5); obj.layout15:setTop(50); obj.layout15:setWidth(310); obj.layout15:setHeight(25); obj.layout15:setName("layout15"); obj.label25 = gui.fromHandle(_obj_newObject("label")); obj.label25:setParent(obj.layout15); obj.label25:setLeft(0); obj.label25:setTop(0); obj.label25:setWidth(110); obj.label25:setHeight(20); obj.label25:setText("Força (FOR)"); obj.label25:setHorzTextAlign("center"); obj.label25:setFontSize(13); obj.label25:setName("label25"); obj.edit14 = gui.fromHandle(_obj_newObject("edit")); obj.edit14:setParent(obj.layout15); obj.edit14:setLeft(110); obj.edit14:setTop(0); obj.edit14:setWidth(50); obj.edit14:setHeight(25); obj.edit14:setField("atr_inicial_for"); obj.edit14:setType("number"); obj.edit14:setName("edit14"); obj.edit15 = gui.fromHandle(_obj_newObject("edit")); obj.edit15:setParent(obj.layout15); obj.edit15:setLeft(160); obj.edit15:setTop(0); obj.edit15:setWidth(50); obj.edit15:setHeight(25); obj.edit15:setField("atr_dom_for"); obj.edit15:setType("number"); obj.edit15:setName("edit15"); obj.edit16 = gui.fromHandle(_obj_newObject("edit")); obj.edit16:setParent(obj.layout15); obj.edit16:setLeft(210); obj.edit16:setTop(0); obj.edit16:setWidth(50); obj.edit16:setHeight(25); obj.edit16:setField("atr_evolucao_for"); obj.edit16:setType("number"); obj.edit16:setName("edit16"); obj.rectangle5 = gui.fromHandle(_obj_newObject("rectangle")); obj.rectangle5:setParent(obj.layout15); obj.rectangle5:setLeft(260); obj.rectangle5:setTop(0); obj.rectangle5:setWidth(50); obj.rectangle5:setHeight(25); obj.rectangle5:setColor("black"); obj.rectangle5:setStrokeColor("white"); obj.rectangle5:setStrokeSize(1); obj.rectangle5:setName("rectangle5"); obj.label26 = gui.fromHandle(_obj_newObject("label")); obj.label26:setParent(obj.layout15); obj.label26:setLeft(260); obj.label26:setTop(0); obj.label26:setWidth(50); obj.label26:setHeight(25); obj.label26:setHorzTextAlign("center"); obj.label26:setField("atr_total_for"); obj.label26:setName("label26"); obj.dataLink1 = gui.fromHandle(_obj_newObject("dataLink")); obj.dataLink1:setParent(obj.layout15); obj.dataLink1:setFields({'atr_inicial_for', 'atr_dom_for', 'atr_evolucao_for'}); obj.dataLink1:setName("dataLink1"); obj.layout16 = gui.fromHandle(_obj_newObject("layout")); obj.layout16:setParent(obj.layout13); obj.layout16:setLeft(5); obj.layout16:setTop(75); obj.layout16:setWidth(310); obj.layout16:setHeight(25); obj.layout16:setName("layout16"); obj.label27 = gui.fromHandle(_obj_newObject("label")); obj.label27:setParent(obj.layout16); obj.label27:setLeft(0); obj.label27:setTop(0); obj.label27:setWidth(110); obj.label27:setHeight(20); obj.label27:setText("Velocidade (VEL)"); obj.label27:setHorzTextAlign("center"); obj.label27:setFontSize(13); obj.label27:setName("label27"); obj.edit17 = gui.fromHandle(_obj_newObject("edit")); obj.edit17:setParent(obj.layout16); obj.edit17:setLeft(110); obj.edit17:setTop(0); obj.edit17:setWidth(50); obj.edit17:setHeight(25); obj.edit17:setField("atr_inicial_vel"); obj.edit17:setType("number"); obj.edit17:setName("edit17"); obj.edit18 = gui.fromHandle(_obj_newObject("edit")); obj.edit18:setParent(obj.layout16); obj.edit18:setLeft(160); obj.edit18:setTop(0); obj.edit18:setWidth(50); obj.edit18:setHeight(25); obj.edit18:setField("atr_dom_vel"); obj.edit18:setType("number"); obj.edit18:setName("edit18"); obj.edit19 = gui.fromHandle(_obj_newObject("edit")); obj.edit19:setParent(obj.layout16); obj.edit19:setLeft(210); obj.edit19:setTop(0); obj.edit19:setWidth(50); obj.edit19:setHeight(25); obj.edit19:setField("atr_evolucao_vel"); obj.edit19:setType("number"); obj.edit19:setName("edit19"); obj.rectangle6 = gui.fromHandle(_obj_newObject("rectangle")); obj.rectangle6:setParent(obj.layout16); obj.rectangle6:setLeft(260); obj.rectangle6:setTop(0); obj.rectangle6:setWidth(50); obj.rectangle6:setHeight(25); obj.rectangle6:setColor("black"); obj.rectangle6:setStrokeColor("white"); obj.rectangle6:setStrokeSize(1); obj.rectangle6:setName("rectangle6"); obj.label28 = gui.fromHandle(_obj_newObject("label")); obj.label28:setParent(obj.layout16); obj.label28:setLeft(260); obj.label28:setTop(0); obj.label28:setWidth(50); obj.label28:setHeight(25); obj.label28:setHorzTextAlign("center"); obj.label28:setField("atr_total_vel"); obj.label28:setName("label28"); obj.dataLink2 = gui.fromHandle(_obj_newObject("dataLink")); obj.dataLink2:setParent(obj.layout16); obj.dataLink2:setFields({'atr_inicial_vel', 'atr_dom_vel', 'atr_evolucao_vel'}); obj.dataLink2:setName("dataLink2"); obj.layout17 = gui.fromHandle(_obj_newObject("layout")); obj.layout17:setParent(obj.layout13); obj.layout17:setLeft(5); obj.layout17:setTop(100); obj.layout17:setWidth(310); obj.layout17:setHeight(25); obj.layout17:setName("layout17"); obj.label29 = gui.fromHandle(_obj_newObject("label")); obj.label29:setParent(obj.layout17); obj.label29:setLeft(0); obj.label29:setTop(0); obj.label29:setWidth(110); obj.label29:setHeight(20); obj.label29:setText("Maquinário (MAQ)"); obj.label29:setHorzTextAlign("center"); obj.label29:setFontSize(13); obj.label29:setName("label29"); obj.edit20 = gui.fromHandle(_obj_newObject("edit")); obj.edit20:setParent(obj.layout17); obj.edit20:setLeft(110); obj.edit20:setTop(0); obj.edit20:setWidth(50); obj.edit20:setHeight(25); obj.edit20:setField("atr_inicial_maq"); obj.edit20:setType("number"); obj.edit20:setName("edit20"); obj.edit21 = gui.fromHandle(_obj_newObject("edit")); obj.edit21:setParent(obj.layout17); obj.edit21:setLeft(160); obj.edit21:setTop(0); obj.edit21:setWidth(50); obj.edit21:setHeight(25); obj.edit21:setField("atr_dom_maq"); obj.edit21:setType("number"); obj.edit21:setName("edit21"); obj.edit22 = gui.fromHandle(_obj_newObject("edit")); obj.edit22:setParent(obj.layout17); obj.edit22:setLeft(210); obj.edit22:setTop(0); obj.edit22:setWidth(50); obj.edit22:setHeight(25); obj.edit22:setField("atr_evolucao_maq"); obj.edit22:setType("number"); obj.edit22:setName("edit22"); obj.rectangle7 = gui.fromHandle(_obj_newObject("rectangle")); obj.rectangle7:setParent(obj.layout17); obj.rectangle7:setLeft(260); obj.rectangle7:setTop(0); obj.rectangle7:setWidth(50); obj.rectangle7:setHeight(25); obj.rectangle7:setColor("black"); obj.rectangle7:setStrokeColor("white"); obj.rectangle7:setStrokeSize(1); obj.rectangle7:setName("rectangle7"); obj.label30 = gui.fromHandle(_obj_newObject("label")); obj.label30:setParent(obj.layout17); obj.label30:setLeft(260); obj.label30:setTop(0); obj.label30:setWidth(50); obj.label30:setHeight(25); obj.label30:setHorzTextAlign("center"); obj.label30:setField("atr_total_maq"); obj.label30:setName("label30"); obj.dataLink3 = gui.fromHandle(_obj_newObject("dataLink")); obj.dataLink3:setParent(obj.layout17); obj.dataLink3:setFields({'atr_inicial_maq', 'atr_dom_maq', 'atr_evolucao_maq'}); obj.dataLink3:setName("dataLink3"); obj.layout18 = gui.fromHandle(_obj_newObject("layout")); obj.layout18:setParent(obj.layout13); obj.layout18:setLeft(5); obj.layout18:setTop(125); obj.layout18:setWidth(310); obj.layout18:setHeight(25); obj.layout18:setName("layout18"); obj.label31 = gui.fromHandle(_obj_newObject("label")); obj.label31:setParent(obj.layout18); obj.label31:setLeft(0); obj.label31:setTop(0); obj.label31:setWidth(110); obj.label31:setHeight(20); obj.label31:setText("Construção Elemental (CE)"); obj.label31:setHorzTextAlign("center"); obj.label31:setFontSize(9); obj.label31:setName("label31"); obj.edit23 = gui.fromHandle(_obj_newObject("edit")); obj.edit23:setParent(obj.layout18); obj.edit23:setLeft(110); obj.edit23:setTop(0); obj.edit23:setWidth(50); obj.edit23:setHeight(25); obj.edit23:setField("atr_inicial_ce"); obj.edit23:setType("number"); obj.edit23:setName("edit23"); obj.edit24 = gui.fromHandle(_obj_newObject("edit")); obj.edit24:setParent(obj.layout18); obj.edit24:setLeft(160); obj.edit24:setTop(0); obj.edit24:setWidth(50); obj.edit24:setHeight(25); obj.edit24:setField("atr_dom_ce"); obj.edit24:setType("number"); obj.edit24:setName("edit24"); obj.edit25 = gui.fromHandle(_obj_newObject("edit")); obj.edit25:setParent(obj.layout18); obj.edit25:setLeft(210); obj.edit25:setTop(0); obj.edit25:setWidth(50); obj.edit25:setHeight(25); obj.edit25:setField("atr_evolucao_ce"); obj.edit25:setType("number"); obj.edit25:setName("edit25"); obj.rectangle8 = gui.fromHandle(_obj_newObject("rectangle")); obj.rectangle8:setParent(obj.layout18); obj.rectangle8:setLeft(260); obj.rectangle8:setTop(0); obj.rectangle8:setWidth(50); obj.rectangle8:setHeight(25); obj.rectangle8:setColor("black"); obj.rectangle8:setStrokeColor("white"); obj.rectangle8:setStrokeSize(1); obj.rectangle8:setName("rectangle8"); obj.label32 = gui.fromHandle(_obj_newObject("label")); obj.label32:setParent(obj.layout18); obj.label32:setLeft(260); obj.label32:setTop(0); obj.label32:setWidth(50); obj.label32:setHeight(25); obj.label32:setHorzTextAlign("center"); obj.label32:setField("atr_total_ce"); obj.label32:setName("label32"); obj.dataLink4 = gui.fromHandle(_obj_newObject("dataLink")); obj.dataLink4:setParent(obj.layout18); obj.dataLink4:setFields({'atr_inicial_ce', 'atr_dom_ce', 'atr_evolucao_ce'}); obj.dataLink4:setName("dataLink4"); obj.layout19 = gui.fromHandle(_obj_newObject("layout")); obj.layout19:setParent(obj.scrollBox1); obj.layout19:setLeft(610); obj.layout19:setTop(0); obj.layout19:setWidth(320); obj.layout19:setHeight(155); obj.layout19:setName("layout19"); obj.rectangle9 = gui.fromHandle(_obj_newObject("rectangle")); obj.rectangle9:setParent(obj.layout19); obj.rectangle9:setAlign("client"); obj.rectangle9:setColor("black"); obj.rectangle9:setXradius(5); obj.rectangle9:setYradius(5); obj.rectangle9:setCornerType("round"); obj.rectangle9:setName("rectangle9"); obj.label33 = gui.fromHandle(_obj_newObject("label")); obj.label33:setParent(obj.layout19); obj.label33:setLeft(0); obj.label33:setTop(0); obj.label33:setWidth(320); obj.label33:setHeight(20); obj.label33:setText("Perícias"); obj.label33:setHorzTextAlign("center"); obj.label33:setName("label33"); obj.layout20 = gui.fromHandle(_obj_newObject("layout")); obj.layout20:setParent(obj.layout19); obj.layout20:setLeft(5); obj.layout20:setTop(25); obj.layout20:setWidth(310); obj.layout20:setHeight(25); obj.layout20:setName("layout20"); obj.label34 = gui.fromHandle(_obj_newObject("label")); obj.label34:setParent(obj.layout20); obj.label34:setLeft(110); obj.label34:setTop(5); obj.label34:setWidth(50); obj.label34:setHeight(20); obj.label34:setText("Natural"); obj.label34:setHorzTextAlign("center"); obj.label34:setName("label34"); obj.label35 = gui.fromHandle(_obj_newObject("label")); obj.label35:setParent(obj.layout20); obj.label35:setLeft(160); obj.label35:setTop(5); obj.label35:setWidth(50); obj.label35:setHeight(20); obj.label35:setText("Modelo"); obj.label35:setHorzTextAlign("center"); obj.label35:setName("label35"); obj.label36 = gui.fromHandle(_obj_newObject("label")); obj.label36:setParent(obj.layout20); obj.label36:setLeft(210); obj.label36:setTop(5); obj.label36:setWidth(50); obj.label36:setHeight(20); obj.label36:setText("Evolução"); obj.label36:setHorzTextAlign("center"); obj.label36:setFontSize(11); obj.label36:setName("label36"); obj.label37 = gui.fromHandle(_obj_newObject("label")); obj.label37:setParent(obj.layout20); obj.label37:setLeft(260); obj.label37:setTop(5); obj.label37:setWidth(50); obj.label37:setHeight(20); obj.label37:setText("Total"); obj.label37:setHorzTextAlign("center"); obj.label37:setName("label37"); obj.layout21 = gui.fromHandle(_obj_newObject("layout")); obj.layout21:setParent(obj.layout19); obj.layout21:setLeft(5); obj.layout21:setTop(50); obj.layout21:setWidth(310); obj.layout21:setHeight(25); obj.layout21:setName("layout21"); obj.label38 = gui.fromHandle(_obj_newObject("label")); obj.label38:setParent(obj.layout21); obj.label38:setLeft(0); obj.label38:setTop(0); obj.label38:setWidth(110); obj.label38:setHeight(20); obj.label38:setText("Poder de Fogo (PF)"); obj.label38:setHorzTextAlign("center"); obj.label38:setFontSize(13); obj.label38:setName("label38"); obj.edit26 = gui.fromHandle(_obj_newObject("edit")); obj.edit26:setParent(obj.layout21); obj.edit26:setLeft(110); obj.edit26:setTop(0); obj.edit26:setWidth(50); obj.edit26:setHeight(25); obj.edit26:setField("atr_inicial_pf"); obj.edit26:setType("number"); obj.edit26:setName("edit26"); obj.edit27 = gui.fromHandle(_obj_newObject("edit")); obj.edit27:setParent(obj.layout21); obj.edit27:setLeft(160); obj.edit27:setTop(0); obj.edit27:setWidth(50); obj.edit27:setHeight(25); obj.edit27:setField("atr_dom_pf"); obj.edit27:setType("number"); obj.edit27:setName("edit27"); obj.edit28 = gui.fromHandle(_obj_newObject("edit")); obj.edit28:setParent(obj.layout21); obj.edit28:setLeft(210); obj.edit28:setTop(0); obj.edit28:setWidth(50); obj.edit28:setHeight(25); obj.edit28:setField("atr_evolucao_pf"); obj.edit28:setType("number"); obj.edit28:setName("edit28"); obj.rectangle10 = gui.fromHandle(_obj_newObject("rectangle")); obj.rectangle10:setParent(obj.layout21); obj.rectangle10:setLeft(260); obj.rectangle10:setTop(0); obj.rectangle10:setWidth(50); obj.rectangle10:setHeight(25); obj.rectangle10:setColor("black"); obj.rectangle10:setStrokeColor("white"); obj.rectangle10:setStrokeSize(1); obj.rectangle10:setName("rectangle10"); obj.label39 = gui.fromHandle(_obj_newObject("label")); obj.label39:setParent(obj.layout21); obj.label39:setLeft(260); obj.label39:setTop(0); obj.label39:setWidth(50); obj.label39:setHeight(25); obj.label39:setHorzTextAlign("center"); obj.label39:setField("atr_total_pf"); obj.label39:setName("label39"); obj.dataLink5 = gui.fromHandle(_obj_newObject("dataLink")); obj.dataLink5:setParent(obj.layout21); obj.dataLink5:setFields({'atr_inicial_pf', 'atr_dom_pf', 'atr_evolucao_pf'}); obj.dataLink5:setName("dataLink5"); obj.layout22 = gui.fromHandle(_obj_newObject("layout")); obj.layout22:setParent(obj.layout19); obj.layout22:setLeft(5); obj.layout22:setTop(75); obj.layout22:setWidth(310); obj.layout22:setHeight(25); obj.layout22:setName("layout22"); obj.label40 = gui.fromHandle(_obj_newObject("label")); obj.label40:setParent(obj.layout22); obj.label40:setLeft(0); obj.label40:setTop(0); obj.label40:setWidth(110); obj.label40:setHeight(20); obj.label40:setText("Agilidade (AGI)"); obj.label40:setHorzTextAlign("center"); obj.label40:setFontSize(13); obj.label40:setName("label40"); obj.edit29 = gui.fromHandle(_obj_newObject("edit")); obj.edit29:setParent(obj.layout22); obj.edit29:setLeft(110); obj.edit29:setTop(0); obj.edit29:setWidth(50); obj.edit29:setHeight(25); obj.edit29:setField("atr_inicial_agi"); obj.edit29:setType("number"); obj.edit29:setName("edit29"); obj.edit30 = gui.fromHandle(_obj_newObject("edit")); obj.edit30:setParent(obj.layout22); obj.edit30:setLeft(160); obj.edit30:setTop(0); obj.edit30:setWidth(50); obj.edit30:setHeight(25); obj.edit30:setField("atr_dom_agi"); obj.edit30:setType("number"); obj.edit30:setName("edit30"); obj.edit31 = gui.fromHandle(_obj_newObject("edit")); obj.edit31:setParent(obj.layout22); obj.edit31:setLeft(210); obj.edit31:setTop(0); obj.edit31:setWidth(50); obj.edit31:setHeight(25); obj.edit31:setField("atr_evolucao_agi"); obj.edit31:setType("number"); obj.edit31:setName("edit31"); obj.rectangle11 = gui.fromHandle(_obj_newObject("rectangle")); obj.rectangle11:setParent(obj.layout22); obj.rectangle11:setLeft(260); obj.rectangle11:setTop(0); obj.rectangle11:setWidth(50); obj.rectangle11:setHeight(25); obj.rectangle11:setColor("black"); obj.rectangle11:setStrokeColor("white"); obj.rectangle11:setStrokeSize(1); obj.rectangle11:setName("rectangle11"); obj.label41 = gui.fromHandle(_obj_newObject("label")); obj.label41:setParent(obj.layout22); obj.label41:setLeft(260); obj.label41:setTop(0); obj.label41:setWidth(50); obj.label41:setHeight(25); obj.label41:setHorzTextAlign("center"); obj.label41:setField("atr_total_agi"); obj.label41:setName("label41"); obj.dataLink6 = gui.fromHandle(_obj_newObject("dataLink")); obj.dataLink6:setParent(obj.layout22); obj.dataLink6:setFields({'atr_inicial_agi', 'atr_dom_agi', 'atr_evolucao_agi'}); obj.dataLink6:setName("dataLink6"); obj.layout23 = gui.fromHandle(_obj_newObject("layout")); obj.layout23:setParent(obj.layout19); obj.layout23:setLeft(5); obj.layout23:setTop(100); obj.layout23:setWidth(310); obj.layout23:setHeight(25); obj.layout23:setName("layout23"); obj.label42 = gui.fromHandle(_obj_newObject("label")); obj.label42:setParent(obj.layout23); obj.label42:setLeft(0); obj.label42:setTop(0); obj.label42:setWidth(110); obj.label42:setHeight(20); obj.label42:setText("Resistência (RES)"); obj.label42:setHorzTextAlign("center"); obj.label42:setFontSize(13); obj.label42:setName("label42"); obj.edit32 = gui.fromHandle(_obj_newObject("edit")); obj.edit32:setParent(obj.layout23); obj.edit32:setLeft(110); obj.edit32:setTop(0); obj.edit32:setWidth(50); obj.edit32:setHeight(25); obj.edit32:setField("atr_inicial_res"); obj.edit32:setType("number"); obj.edit32:setName("edit32"); obj.edit33 = gui.fromHandle(_obj_newObject("edit")); obj.edit33:setParent(obj.layout23); obj.edit33:setLeft(160); obj.edit33:setTop(0); obj.edit33:setWidth(50); obj.edit33:setHeight(25); obj.edit33:setField("atr_dom_res"); obj.edit33:setType("number"); obj.edit33:setName("edit33"); obj.edit34 = gui.fromHandle(_obj_newObject("edit")); obj.edit34:setParent(obj.layout23); obj.edit34:setLeft(210); obj.edit34:setTop(0); obj.edit34:setWidth(50); obj.edit34:setHeight(25); obj.edit34:setField("atr_evolucao_res"); obj.edit34:setType("number"); obj.edit34:setName("edit34"); obj.rectangle12 = gui.fromHandle(_obj_newObject("rectangle")); obj.rectangle12:setParent(obj.layout23); obj.rectangle12:setLeft(260); obj.rectangle12:setTop(0); obj.rectangle12:setWidth(50); obj.rectangle12:setHeight(25); obj.rectangle12:setColor("black"); obj.rectangle12:setStrokeColor("white"); obj.rectangle12:setStrokeSize(1); obj.rectangle12:setName("rectangle12"); obj.label43 = gui.fromHandle(_obj_newObject("label")); obj.label43:setParent(obj.layout23); obj.label43:setLeft(260); obj.label43:setTop(0); obj.label43:setWidth(50); obj.label43:setHeight(25); obj.label43:setHorzTextAlign("center"); obj.label43:setField("atr_total_res"); obj.label43:setName("label43"); obj.dataLink7 = gui.fromHandle(_obj_newObject("dataLink")); obj.dataLink7:setParent(obj.layout23); obj.dataLink7:setFields({'atr_inicial_res', 'atr_dom_res', 'atr_evolucao_res'}); obj.dataLink7:setName("dataLink7"); obj.layout24 = gui.fromHandle(_obj_newObject("layout")); obj.layout24:setParent(obj.layout19); obj.layout24:setLeft(5); obj.layout24:setTop(125); obj.layout24:setWidth(310); obj.layout24:setHeight(25); obj.layout24:setName("layout24"); obj.label44 = gui.fromHandle(_obj_newObject("label")); obj.label44:setParent(obj.layout24); obj.label44:setLeft(0); obj.label44:setTop(0); obj.label44:setWidth(110); obj.label44:setHeight(20); obj.label44:setText("Voo"); obj.label44:setHorzTextAlign("center"); obj.label44:setFontSize(13); obj.label44:setName("label44"); obj.edit35 = gui.fromHandle(_obj_newObject("edit")); obj.edit35:setParent(obj.layout24); obj.edit35:setLeft(110); obj.edit35:setTop(0); obj.edit35:setWidth(50); obj.edit35:setHeight(25); obj.edit35:setField("atr_inicial_voo"); obj.edit35:setType("number"); obj.edit35:setName("edit35"); obj.edit36 = gui.fromHandle(_obj_newObject("edit")); obj.edit36:setParent(obj.layout24); obj.edit36:setLeft(160); obj.edit36:setTop(0); obj.edit36:setWidth(50); obj.edit36:setHeight(25); obj.edit36:setField("atr_dom_voo"); obj.edit36:setType("number"); obj.edit36:setName("edit36"); obj.edit37 = gui.fromHandle(_obj_newObject("edit")); obj.edit37:setParent(obj.layout24); obj.edit37:setLeft(210); obj.edit37:setTop(0); obj.edit37:setWidth(50); obj.edit37:setHeight(25); obj.edit37:setField("atr_evolucao_voo"); obj.edit37:setType("number"); obj.edit37:setName("edit37"); obj.rectangle13 = gui.fromHandle(_obj_newObject("rectangle")); obj.rectangle13:setParent(obj.layout24); obj.rectangle13:setLeft(260); obj.rectangle13:setTop(0); obj.rectangle13:setWidth(50); obj.rectangle13:setHeight(25); obj.rectangle13:setColor("black"); obj.rectangle13:setStrokeColor("white"); obj.rectangle13:setStrokeSize(1); obj.rectangle13:setName("rectangle13"); obj.label45 = gui.fromHandle(_obj_newObject("label")); obj.label45:setParent(obj.layout24); obj.label45:setLeft(260); obj.label45:setTop(0); obj.label45:setWidth(50); obj.label45:setHeight(25); obj.label45:setHorzTextAlign("center"); obj.label45:setField("atr_total_voo"); obj.label45:setName("label45"); obj.dataLink8 = gui.fromHandle(_obj_newObject("dataLink")); obj.dataLink8:setParent(obj.layout24); obj.dataLink8:setFields({'atr_inicial_voo', 'atr_dom_voo', 'atr_evolucao_voo'}); obj.dataLink8:setName("dataLink8"); obj._e_event0 = obj.comboBox1:addEventListener("onChange", function (self) if sheet~=nil then if sheet.modelo_nome == "Inicial" then self.modelo_tipo_edit.visible = false; self.modelo_tipo_comboBox.visible = true; elseif sheet.modelo_nome == nil or sheet.modelo_nome == "" then self.modelo_tipo_edit.visible = false; self.modelo_tipo_comboBox.visible = false; else self.modelo_tipo_edit.visible = true; self.modelo_tipo_comboBox.visible = false; end; end; end, obj); obj._e_event1 = obj.dataLink1:addEventListener("onChange", function (self, field, oldValue, newValue) if sheet~=nil then local total = (tonumber(sheet.atr_inicial_for) or 0) + (tonumber(sheet.atr_dom_for) or 0) + (tonumber(sheet.atr_evolucao_for) or 0); sheet.atr_total_for = total; end; end, obj); obj._e_event2 = obj.dataLink2:addEventListener("onChange", function (self, field, oldValue, newValue) if sheet~=nil then local total = (tonumber(sheet.atr_inicial_vel) or 0) + (tonumber(sheet.atr_dom_vel) or 0) + (tonumber(sheet.atr_evolucao_vel) or 0); sheet.atr_total_vel = total; end; end, obj); obj._e_event3 = obj.dataLink3:addEventListener("onChange", function (self, field, oldValue, newValue) if sheet~=nil then local total = (tonumber(sheet.atr_inicial_maq) or 0) + (tonumber(sheet.atr_dom_maq) or 0) + (tonumber(sheet.atr_evolucao_maq) or 0); sheet.atr_total_maq = total; end; end, obj); obj._e_event4 = obj.dataLink4:addEventListener("onChange", function (self, field, oldValue, newValue) if sheet~=nil then local total = (tonumber(sheet.atr_inicial_ce) or 0) + (tonumber(sheet.atr_dom_ce) or 0) + (tonumber(sheet.atr_evolucao_ce) or 0); sheet.atr_total_ce = total; end; end, obj); obj._e_event5 = obj.dataLink5:addEventListener("onChange", function (self, field, oldValue, newValue) if sheet~=nil then local total = (tonumber(sheet.atr_inicial_pf) or 0) + (tonumber(sheet.atr_dom_pf) or 0) + (tonumber(sheet.atr_evolucao_pf) or 0); sheet.atr_total_pf = total; end; end, obj); obj._e_event6 = obj.dataLink6:addEventListener("onChange", function (self, field, oldValue, newValue) if sheet~=nil then local total = (tonumber(sheet.atr_inicial_agi) or 0) + (tonumber(sheet.atr_dom_agi) or 0) + (tonumber(sheet.atr_evolucao_agi) or 0); sheet.atr_total_agi = total; end; end, obj); obj._e_event7 = obj.dataLink7:addEventListener("onChange", function (self, field, oldValue, newValue) if sheet~=nil then local total = (tonumber(sheet.atr_inicial_res) or 0) + (tonumber(sheet.atr_dom_res) or 0) + (tonumber(sheet.atr_evolucao_res) or 0); sheet.atr_total_res = total; end; end, obj); obj._e_event8 = obj.dataLink8:addEventListener("onChange", function (self, field, oldValue, newValue) if sheet~=nil then local total = (tonumber(sheet.atr_inicial_voo) or 0) + (tonumber(sheet.atr_dom_voo) or 0) + (tonumber(sheet.atr_evolucao_voo) or 0); sheet.atr_total_voo = total; end; end, obj); function obj:_releaseEvents() __o_rrpgObjs.removeEventListenerById(self._e_event8); __o_rrpgObjs.removeEventListenerById(self._e_event7); __o_rrpgObjs.removeEventListenerById(self._e_event6); __o_rrpgObjs.removeEventListenerById(self._e_event5); __o_rrpgObjs.removeEventListenerById(self._e_event4); __o_rrpgObjs.removeEventListenerById(self._e_event3); __o_rrpgObjs.removeEventListenerById(self._e_event2); __o_rrpgObjs.removeEventListenerById(self._e_event1); __o_rrpgObjs.removeEventListenerById(self._e_event0); end; obj._oldLFMDestroy = obj.destroy; function obj:destroy() self:_releaseEvents(); if (self.handle ~= 0) and (self.setNodeDatabase ~= nil) then self:setNodeDatabase(nil); end; if self.label33 ~= nil then self.label33:destroy(); self.label33 = nil; end; if self.rectangle11 ~= nil then self.rectangle11:destroy(); self.rectangle11 = nil; end; if self.label14 ~= nil then self.label14:destroy(); self.label14 = nil; end; if self.label44 ~= nil then self.label44:destroy(); self.label44 = nil; end; if self.layout15 ~= nil then self.layout15:destroy(); self.layout15 = nil; end; if self.layout10 ~= nil then self.layout10:destroy(); self.layout10 = nil; end; if self.rectangle9 ~= nil then self.rectangle9:destroy(); self.rectangle9 = nil; end; if self.edit36 ~= nil then self.edit36:destroy(); self.edit36 = nil; end; if self.edit9 ~= nil then self.edit9:destroy(); self.edit9 = nil; end; if self.label40 ~= nil then self.label40:destroy(); self.label40 = nil; end; if self.edit33 ~= nil then self.edit33:destroy(); self.edit33 = nil; end; if self.dataLink4 ~= nil then self.dataLink4:destroy(); self.dataLink4 = nil; end; if self.label43 ~= nil then self.label43:destroy(); self.label43 = nil; end; if self.edit29 ~= nil then self.edit29:destroy(); self.edit29 = nil; end; if self.layout17 ~= nil then self.layout17:destroy(); self.layout17 = nil; end; if self.edit7 ~= nil then self.edit7:destroy(); self.edit7 = nil; end; if self.edit28 ~= nil then self.edit28:destroy(); self.edit28 = nil; end; if self.label45 ~= nil then self.label45:destroy(); self.label45 = nil; end; if self.edit12 ~= nil then self.edit12:destroy(); self.edit12 = nil; end; if self.edit35 ~= nil then self.edit35:destroy(); self.edit35 = nil; end; if self.label26 ~= nil then self.label26:destroy(); self.label26 = nil; end; if self.label23 ~= nil then self.label23:destroy(); self.label23 = nil; end; if self.label22 ~= nil then self.label22:destroy(); self.label22 = nil; end; if self.label32 ~= nil then self.label32:destroy(); self.label32 = nil; end; if self.layout24 ~= nil then self.layout24:destroy(); self.layout24 = nil; end; if self.layout13 ~= nil then self.layout13:destroy(); self.layout13 = nil; end; if self.layout3 ~= nil then self.layout3:destroy(); self.layout3 = nil; end; if self.label24 ~= nil then self.label24:destroy(); self.label24 = nil; end; if self.label13 ~= nil then self.label13:destroy(); self.label13 = nil; end; if self.layout8 ~= nil then self.layout8:destroy(); self.layout8 = nil; end; if self.label35 ~= nil then self.label35:destroy(); self.label35 = nil; end; if self.layout1 ~= nil then self.layout1:destroy(); self.layout1 = nil; end; if self.label27 ~= nil then self.label27:destroy(); self.label27 = nil; end; if self.rectangle1 ~= nil then self.rectangle1:destroy(); self.rectangle1 = nil; end; if self.rectangle10 ~= nil then self.rectangle10:destroy(); self.rectangle10 = nil; end; if self.dataLink5 ~= nil then self.dataLink5:destroy(); self.dataLink5 = nil; end; if self.layout23 ~= nil then self.layout23:destroy(); self.layout23 = nil; end; if self.edit24 ~= nil then self.edit24:destroy(); self.edit24 = nil; end; if self.rectangle5 ~= nil then self.rectangle5:destroy(); self.rectangle5 = nil; end; if self.layout12 ~= nil then self.layout12:destroy(); self.layout12 = nil; end; if self.edit14 ~= nil then self.edit14:destroy(); self.edit14 = nil; end; if self.dataLink8 ~= nil then self.dataLink8:destroy(); self.dataLink8 = nil; end; if self.edit4 ~= nil then self.edit4:destroy(); self.edit4 = nil; end; if self.label8 ~= nil then self.label8:destroy(); self.label8 = nil; end; if self.edit26 ~= nil then self.edit26:destroy(); self.edit26 = nil; end; if self.edit34 ~= nil then self.edit34:destroy(); self.edit34 = nil; end; if self.label4 ~= nil then self.label4:destroy(); self.label4 = nil; end; if self.label6 ~= nil then self.label6:destroy(); self.label6 = nil; end; if self.edit11 ~= nil then self.edit11:destroy(); self.edit11 = nil; end; if self.layout9 ~= nil then self.layout9:destroy(); self.layout9 = nil; end; if self.edit19 ~= nil then self.edit19:destroy(); self.edit19 = nil; end; if self.label31 ~= nil then self.label31:destroy(); self.label31 = nil; end; if self.label34 ~= nil then self.label34:destroy(); self.label34 = nil; end; if self.edit5 ~= nil then self.edit5:destroy(); self.edit5 = nil; end; if self.label15 ~= nil then self.label15:destroy(); self.label15 = nil; end; if self.label37 ~= nil then self.label37:destroy(); self.label37 = nil; end; if self.label41 ~= nil then self.label41:destroy(); self.label41 = nil; end; if self.label12 ~= nil then self.label12:destroy(); self.label12 = nil; end; if self.edit8 ~= nil then self.edit8:destroy(); self.edit8 = nil; end; if self.label16 ~= nil then self.label16:destroy(); self.label16 = nil; end; if self.layout19 ~= nil then self.layout19:destroy(); self.layout19 = nil; end; if self.edit2 ~= nil then self.edit2:destroy(); self.edit2 = nil; end; if self.rectangle8 ~= nil then self.rectangle8:destroy(); self.rectangle8 = nil; end; if self.label9 ~= nil then self.label9:destroy(); self.label9 = nil; end; if self.edit10 ~= nil then self.edit10:destroy(); self.edit10 = nil; end; if self.edit16 ~= nil then self.edit16:destroy(); self.edit16 = nil; end; if self.edit1 ~= nil then self.edit1:destroy(); self.edit1 = nil; end; if self.label28 ~= nil then self.label28:destroy(); self.label28 = nil; end; if self.edit31 ~= nil then self.edit31:destroy(); self.edit31 = nil; end; if self.edit30 ~= nil then self.edit30:destroy(); self.edit30 = nil; end; if self.edit21 ~= nil then self.edit21:destroy(); self.edit21 = nil; end; if self.label1 ~= nil then self.label1:destroy(); self.label1 = nil; end; if self.layout4 ~= nil then self.layout4:destroy(); self.layout4 = nil; end; if self.rectangle7 ~= nil then self.rectangle7:destroy(); self.rectangle7 = nil; end; if self.modelo_tipo_edit ~= nil then self.modelo_tipo_edit:destroy(); self.modelo_tipo_edit = nil; end; if self.label42 ~= nil then self.label42:destroy(); self.label42 = nil; end; if self.label17 ~= nil then self.label17:destroy(); self.label17 = nil; end; if self.comboBox1 ~= nil then self.comboBox1:destroy(); self.comboBox1 = nil; end; if self.edit13 ~= nil then self.edit13:destroy(); self.edit13 = nil; end; if self.layout5 ~= nil then self.layout5:destroy(); self.layout5 = nil; end; if self.layout20 ~= nil then self.layout20:destroy(); self.layout20 = nil; end; if self.edit23 ~= nil then self.edit23:destroy(); self.edit23 = nil; end; if self.dataLink1 ~= nil then self.dataLink1:destroy(); self.dataLink1 = nil; end; if self.layout18 ~= nil then self.layout18:destroy(); self.layout18 = nil; end; if self.dataLink3 ~= nil then self.dataLink3:destroy(); self.dataLink3 = nil; end; if self.label29 ~= nil then self.label29:destroy(); self.label29 = nil; end; if self.dataLink7 ~= nil then self.dataLink7:destroy(); self.dataLink7 = nil; end; if self.label36 ~= nil then self.label36:destroy(); self.label36 = nil; end; if self.rectangle2 ~= nil then self.rectangle2:destroy(); self.rectangle2 = nil; end; if self.rectangle3 ~= nil then self.rectangle3:destroy(); self.rectangle3 = nil; end; if self.rectangle6 ~= nil then self.rectangle6:destroy(); self.rectangle6 = nil; end; if self.edit37 ~= nil then self.edit37:destroy(); self.edit37 = nil; end; if self.label21 ~= nil then self.label21:destroy(); self.label21 = nil; end; if self.label30 ~= nil then self.label30:destroy(); self.label30 = nil; end; if self.dataLink6 ~= nil then self.dataLink6:destroy(); self.dataLink6 = nil; end; if self.dataLink2 ~= nil then self.dataLink2:destroy(); self.dataLink2 = nil; end; if self.label10 ~= nil then self.label10:destroy(); self.label10 = nil; end; if self.label19 ~= nil then self.label19:destroy(); self.label19 = nil; end; if self.edit17 ~= nil then self.edit17:destroy(); self.edit17 = nil; end; if self.layout2 ~= nil then self.layout2:destroy(); self.layout2 = nil; end; if self.rectangle12 ~= nil then self.rectangle12:destroy(); self.rectangle12 = nil; end; if self.label39 ~= nil then self.label39:destroy(); self.label39 = nil; end; if self.label11 ~= nil then self.label11:destroy(); self.label11 = nil; end; if self.layout11 ~= nil then self.layout11:destroy(); self.layout11 = nil; end; if self.modelo_tipo_comboBox ~= nil then self.modelo_tipo_comboBox:destroy(); self.modelo_tipo_comboBox = nil; end; if self.label3 ~= nil then self.label3:destroy(); self.label3 = nil; end; if self.textEditor1 ~= nil then self.textEditor1:destroy(); self.textEditor1 = nil; end; if self.label20 ~= nil then self.label20:destroy(); self.label20 = nil; end; if self.edit15 ~= nil then self.edit15:destroy(); self.edit15 = nil; end; if self.edit6 ~= nil then self.edit6:destroy(); self.edit6 = nil; end; if self.label25 ~= nil then self.label25:destroy(); self.label25 = nil; end; if self.label7 ~= nil then self.label7:destroy(); self.label7 = nil; end; if self.label18 ~= nil then self.label18:destroy(); self.label18 = nil; end; if self.label2 ~= nil then self.label2:destroy(); self.label2 = nil; end; if self.edit22 ~= nil then self.edit22:destroy(); self.edit22 = nil; end; if self.edit3 ~= nil then self.edit3:destroy(); self.edit3 = nil; end; if self.label5 ~= nil then self.label5:destroy(); self.label5 = nil; end; if self.layout6 ~= nil then self.layout6:destroy(); self.layout6 = nil; end; if self.label38 ~= nil then self.label38:destroy(); self.label38 = nil; end; if self.rectangle4 ~= nil then self.rectangle4:destroy(); self.rectangle4 = nil; end; if self.layout22 ~= nil then self.layout22:destroy(); self.layout22 = nil; end; if self.rectangle13 ~= nil then self.rectangle13:destroy(); self.rectangle13 = nil; end; if self.layout14 ~= nil then self.layout14:destroy(); self.layout14 = nil; end; if self.edit27 ~= nil then self.edit27:destroy(); self.edit27 = nil; end; if self.layout16 ~= nil then self.layout16:destroy(); self.layout16 = nil; end; if self.layout21 ~= nil then self.layout21:destroy(); self.layout21 = nil; end; if self.edit32 ~= nil then self.edit32:destroy(); self.edit32 = nil; end; if self.edit18 ~= nil then self.edit18:destroy(); self.edit18 = nil; end; if self.edit25 ~= nil then self.edit25:destroy(); self.edit25 = nil; end; if self.scrollBox1 ~= nil then self.scrollBox1:destroy(); self.scrollBox1 = nil; end; if self.layout7 ~= nil then self.layout7:destroy(); self.layout7 = nil; end; if self.edit20 ~= nil then self.edit20:destroy(); self.edit20 = nil; end; self:_oldLFMDestroy(); end; obj:endUpdate(); __o_rrpgObjs.endObjectsLoading(); return obj; end; local _frmAMZ2_2 = { newEditor = newfrmAMZ2_2, new = newfrmAMZ2_2, name = "frmAMZ2_2", dataType = "", formType = "undefined", formComponentName = "form", title = "", description=""}; frmAMZ2_2 = _frmAMZ2_2; rrpg.registrarForm(_frmAMZ2_2); return _frmAMZ2_2;
T.config_bug_report = { } local config_bug = T.config_bug_report local vs10_helpers = premake.vstudio.vs10_helpers local sln, prjA,prjB,prjC,prjD,prjE function config_bug.teardown() sln = nil prjA = nil prjB = nil prjC = nil prjD = nil prjE = nil end function config_bug.setup() end local config_bug_updated = function () local setCommonLibraryConfig = function() configuration "Debug or Release" kind "StaticLib" configuration "DebugDLL or ReleaseDLL" kind "SharedLib" end sln = solution "Test" configurations { "Debug", "Release", "DebugDLL", "ReleaseDLL" } language "C++" prjA = project "A" files { "a.cpp" } setCommonLibraryConfig() prjB = project "B" files { "b.cpp" } setCommonLibraryConfig() configuration "SharedLib" links { "A" } prjC = project "C" files { "c.cpp" } setCommonLibraryConfig() configuration "SharedLib" links { "A", "B" } prjD = project "D" files { "d.cpp" } setCommonLibraryConfig() configuration "SharedLib" links { "A", "B", "C" } prjE = project "Executable" kind "WindowedApp" links { "A", "B", "C", "D" } end local kindSetOnConfiguration_and_linkSetOnSharedLibProjB = function (config_kind) sln = solution "DontCare" configurations { "DebugDLL"} configuration "DebugDLL" kind(config_kind) prjA = project "A" prjB = project "B" configuration { config_kind } links { "A" } end local sharedLibKindSetOnProject_and_linkSetOnSharedLibProjB = function () sln = solution "DontCare" configurations { "DebugDLL" } project "A" prjB = project "B" configuration "DebugDLL" kind "SharedLib" configuration "SharedLib" links { "A" } defines {"defineSet"} end local kindSetOnConfiguration_and_linkSetOnBundleProjB = function (config_kind) sln = solution "DontCare" configurations { "DebugDLL"} configuration "DebugDLL" kind(config_kind) prjA = project "A" prjB = project "B" configuration { config_kind } links { "A" } end local sharedLibKindSetOnProject_and_linkSetOnBundleProjB = function () sln = solution "DontCare" configurations { "DebugDLL" } project "A" prjB = project "B" configuration "DebugDLL" kind "Bundle" configuration "Bundle" links { "A" } defines {"defineSet"} end function kind_set_on_project_config_block() sln = solution "DontCare" configurations { "DebugDLL" } local A = project "A" configuration "DebugDLL" kind "SharedLib" defines {"defineSet"} return A end function config_bug.bugUpdated_prjBLinksContainsA() config_bug_updated() premake.bake.buildconfigs() local conf = premake.getconfig(prjB,"DebugDLL","Native") test.isnotnil(conf.links.A) end function config_bug.kindSetOnProjectConfigBlock_projKindEqualsSharedLib() local proj = kind_set_on_project_config_block() premake.bake.buildconfigs() local conf = premake.getconfig(proj,"DebugDLL","Native") test.isequal("SharedLib",conf.kind) end function config_bug.kindSetOnProjectConfigBlock_projKindEqualsBundle() local proj = kind_set_on_project_config_block() premake.bake.buildconfigs() local conf = premake.getconfig(proj,"DebugDLL","Native") test.isequal("Bundle",conf.kind) end function config_bug.defineSetOnProjectConfigBlock_projDefineSetIsNotNil() local proj = kind_set_on_project_config_block() premake.bake.buildconfigs() local conf = premake.getconfig(proj,"DebugDLL","Native") test.isnotnil(conf.defines.defineSet) end function config_bug.defineSetInBlockInsideProject () sharedLibKindSetOnProject_and_linkSetOnSharedLibProjB() premake.bake.buildconfigs() local conf = premake.getconfig(prjB,"DebugDLL","Native") test.isnotnil(conf.defines.defineSet) end function config_bug.whenKindSetOnProject_PrjBLinksContainsA() sharedLibKindSetOnProject_and_linkSetOnSharedLibProjB() premake.bake.buildconfigs() local conf = premake.getconfig(prjB,"DebugDLL","Native") test.isnotnil(conf.links.A) end function config_bug.whenKindSetOnConfiguration_prjBLinksContainsA_StaticLib() -- sharedLibKindSetOnConfiguration_and_linkSetOnSharedLibProjB() kindSetOnConfiguration_and_linkSetOnSharedLibProjB("StaticLib") premake.bake.buildconfigs() local config = premake.getconfig(prjB,"DebugDLL","Native") test.isnotnil(config.links.A) end function config_bug.whenKindSetOnConfiguration_prjBLinksContainsA() -- sharedLibKindSetOnConfiguration_and_linkSetOnSharedLibProjB() kindSetOnConfiguration_and_linkSetOnSharedLibProjB("SharedLib") premake.bake.buildconfigs() local config = premake.getconfig(prjB,"DebugDLL","Native") test.isnotnil(config.links.A) end function config_bug.whenKindSetOnConfiguration_prjBLinksContainsA_bundle() -- sharedLibKindSetOnConfiguration_and_linkSetOnBundleProjB() kindSetOnConfiguration_and_linkSetOnBundleProjB("Bundle") premake.bake.buildconfigs() local config = premake.getconfig(prjB,"DebugDLL","Native") test.isnotnil(config.links.A) end
--[[Simple Button class here.]] local Button = {} Button.defaults = { button_function = function(self, msg) print("DEFAULT BUTTON FUNCTION INVOKED") end, --What to do when pressed psp_x = 1/8, --Positive space proportion on x axis psp_y = 1/8, --Positive space proportion on y axis x = 0, y = 0, z = 1, align = 'center', --Valid px,py alignments include: 'absolute' and 'center' --toggleable = false, --draggable = false, --interact_sound = nil, } function Button:init(args) local image = self.image or res.img["No-Image.png"] --Initialize image or use default local image_on_interact = self.interact_image or image --Initialize interact image or use default self.image_initial, self.interact_image_initial = image, image_on_interact --Set initial images to the original sized image self.image = _G.res.resize(image, self.psp_x, self.psp_y, self.maintain_aspect_ratio) --Resize image self.interact_image = _G.res.resize(image_on_interact, self.psp_x, self.psp_y, self.maintain_aspect_ratio) --Resize interact image --Use px,py if supplied local screen_width, screen_height = love.window.getMode() if self.px ~= nil then self.x = self.px * screen_width end --If px supplied use it to find x if self.py ~= nil then self.y = self.py * screen_height end --If py supplied use it to find y self.element = Element{ __container = self, image = self.image, x = self.x, y = self.y, z = self.z, psp_x = self.psp_x, --Positive space proportion on x axis psp_y = self.psp_x, --Positive space proportion on y axis } --Use element's rect self.rect = self.element.rect if self.align == 'center' then self.rect:center_on_xy(self.x, self.y) end end function Button:resize() local images = {} images['element.image'] = 'element.image_initial' images['interact_image']= 'interact_image_initial' for k,v in pairs(images) do if self[k] ~= nil then self[k] = _G.res.resize(self[v], self.psp_x, self.psp_y, self.maintain_aspect_ratio) end end --[[ self.element.image = _G.res.resize(self.element.image_initial, self.psp_x, self.psp_y, self.maintain_aspect_ratio) if self.interact_image ~= nil then self.interact_image = _G.res.resize(self.interact_image_initial, self.psp_x, self.psp_y, self.maintain_aspect_ratio) else self.interact_image = self.element.image --If no interact image, use the main image end ]] end --Button pressed but not yet released function Button:hover_press(msg) self.pressed = true self:change_image() msg.handled = 1 end --Button was pressed but not released. Now its not pressed/hovered over anymore. function Button:press_over(msg) self.pressed = false self:change_image() msg.handled = 1 end function Button:release(msg) self.pressed = false if self.rect.dragging ~= true then self:change_image() if self.interact_sound ~= nil then self.interact_sound:play() end if self.button_function ~= nil then self:button_function() end end msg.handled = 1 end function Button:change_image() if self.pressed then self.element.image = _G.res.resize(self.interact_image, self.psp_x, self.psp_y, self.maintain_aspect_ratio) else self.element.image = _G.res.resize(self.element.image_initial, self.psp_x, self.psp_y, self.maintain_aspect_ratio) end end Button.event_types = { mousepressed = function(self, msg) self:hover_press(msg) end, touchpressed = function(self, msg) self:hover_press(msg) end, mousereleased = function(self, msg) self:release(msg) end, touchreleased = function(self, msg) self:release(msg) end, hover_end = function(self, msg) self:press_over(msg) end, hover_cont = function(self, msg) end, resize = function(self, msg) self:resize() end, } return Button
local vim = vim local M = {} local defaults = { highlight_hovered_item = true, show_guides = true, } M.options = {} function M.setup(options) M.options = vim.tbl_deep_extend("force", {}, defaults, options or {}) end return M
require 'iuplua' local options = {'yellow','green','blue','red'} res = iup.ListDialog( 1, "Which color?", #options, options, 2, 0, 0 ) iup.Message('ListDialog',res)
local tentacle12 = scene:getObjects("tentacle12"); local tentacle12weld = weldTentacleBones(tentacle12, {3, 6, 9}, 1.5, 0.5); local park4 = scene:getObjects("park4_ph")[1]:findPlaceholderComponent(); local winch0 = scene:getObjects("winch0")[1]; local winch1 = scene:getObjects("winch1")[1]; local winch2 = scene:getObjects("winch2")[1]; local winch3 = scene:getObjects("winch3")[1]; local boulder0 = scene:getObjects("boulder0")[1]; local boulder1 = scene:getObjects("boulder1")[1]; local boulder2 = scene:getObjects("boulder2")[1]; local boulder3 = scene:getObjects("boulder3")[1]; local chain0Hooks = {scene:getObjects("chain0_hook_front")[1], scene:getObjects("chain0_hook_back")[1]}; local chain0 = table.copy(scene:getObjects("chain0"), chain0Hooks); local chain1Hooks = {scene:getObjects("chain1_hook_front")[1], scene:getObjects("chain1_hook_back")[1]}; local chain1 = table.copy(scene:getObjects("chain1"), chain1Hooks); local tentacle13 = scene:getObjects("tentacle13"); local tentacle13weld = weldTentacleBones(tentacle13, {3, 6, 9}, 1.5, 0.4); local dynomitePh = scene:getObjects("dynomite_ph")[1]:findPlaceholderComponent(); local function makeChain(name, chain, hooks) makeHooks(hooks, function(hook, eyelet, self) hook.myHooked = true; for _, obj in pairs(hooks) do if not obj.myHooked then return; end end for _, obj in pairs(chain) do obj.ggMassOverride = obj.mass; obj.ggInertiaOverride = obj.inertia; local c = obj:findPhysicsBodyComponent(); obj.myDensity = c.density; c.density = 100.0; obj:resetMassData(); obj.linearVelocity = vec2(0, 0); obj.angularVelocity = 0; c = obj:findCollisionCancelComponent(); c.immediate = true; end end, function(hook, eyelet, self) for _, obj in pairs(hooks) do if not obj.myHooked then hook.myHooked = false; return; end end hook.myHooked = false; for _, obj in pairs(chain) do local c = obj:findPhysicsBodyComponent(); c.density = obj.myDensity; obj:resetMassData(); obj.linearVelocity = vec2(0, 0); obj.angularVelocity = 0; c = obj:findCollisionCancelComponent(); c.immediate = false; end local joints = scene:getJoints(name.."_joint"); for _, j in pairs(joints) do j:clone(); j:remove(); end for _, obj in pairs(hooks) do if obj.myHooked then local j = obj.myEyelet.j:clone(); obj.myEyelet.j:remove(); obj.myEyelet.j = j; end end end); end local function makeBoulder(boulder) makeEyeletHolder(boulder); scene:addFrictionJoint(scene:getObjects("terrain0")[1], boulder, vec2(0, 0), vec2(0, 0), 10000, 10000, true); end local function makeWinchLever(leverName, winchName, rev) makeLever(leverName, not rev, function() audio:playSound("lever_pull.ogg"); scene:getJoints(winchName.."_joint")[1].motorEnabled = rev; end, function() audio:playSound("lever_pull.ogg"); scene:getJoints(winchName.."_joint")[1].motorEnabled = not rev; end); end local function makeTentaclePulse1(name) local objs = scene:getObjects(name); for _, obj in pairs(objs) do local timeF = 0.2 + math.random() * 0.2; local phaseF = 3.0 + math.random() * 2.0; local a1F = 0.1 + math.random() * 0.2; local a2F = 0.1 + math.random() * 0.2; obj:addComponent(TentaclePulseComponent(15, timeF, phaseF, a1F, a2F)); end end local function makeTentacleSwing1(name) local objs = scene:getObjects(name); for _, obj in pairs(objs) do local t = 1.0 + math.random() * 0.5; local f = 6000 + math.random() * 4000.0; obj:addComponent(TentacleSwingComponent(t, const.EaseInOutQuad, f, t, const.EaseInOutQuad, -f)); end end local function makeTentacleSwing2(name) local objs = scene:getObjects(name); for _, obj in pairs(objs) do local t = 1.0 + math.random() * 0.5; local f = 50000 + math.random() * 40000.0; obj:addComponent(TentacleSwingComponent(t, const.EaseInOutQuad, f, t, const.EaseInOutQuad, -f)); end end local function makeTentaclePulse2(name) local objs = scene:getObjects(name); for _, obj in pairs(objs) do local timeF = 0.1 + math.random() * 0.1; local phaseF = 5.0 + math.random() * 2.0; local a1F = 0.3 + math.random() * 0.4; local a2F = 0.3 + math.random() * 0.4; obj:addComponent(TentaclePulseComponent(15, timeF, phaseF, a1F, a2F)); end end local function makeTentacleSwing3(name) local objs = scene:getObjects(name); for _, obj in pairs(objs) do local t = 1.2 + math.random() * 0.5; local f = 150000 + math.random() * 70000.0; obj:addComponent(TentacleSwingComponent(t, const.EaseInOutQuad, f, t, const.EaseInOutQuad, -f)); end end local function spawnBeetleProb(name, normal, shootOnly, splitOnly, shootAndSplit) local spawn = scene:getObjects(name); local probs = {normal, shootOnly, splitOnly, shootAndSplit}; local args = {{false, false}, {true, false}, {false, true}, {true, true}}; local cargs = args[1]; local lastSpawned = nil; for _, obj in pairs(spawn) do local val = math.random(); local prob = 0; for i = 1, 4, 1 do prob = prob + probs[i]; if val < prob then cargs = args[i]; break; end end lastSpawned = factory:createBeetle1(unpack(cargs)); addSpawnedEnemy(lastSpawned, obj); end return lastSpawned; end local function spawnCaveHoleCentipedes(indices) for _, i in pairs(indices) do local centipede = factory:createCentipede1(); addSpawnedEnemy(centipede, scene:getObjects("centipede"..i)[1]); centipede:findPhysicsBodyComponent():setFilterGroupIndex(-800); local objs = centipede:getObjects(); for _, obj in pairs(objs) do obj:findPhysicsBodyComponent():setFilterGroupIndex(-800); end end end local function spawnCaveHoleBeetles(indices, normal, shootOnly, splitOnly, shootAndSplit) for _, i in pairs(indices) do local obj = spawnBeetleProb("centipede"..i, normal, shootOnly, splitOnly, shootAndSplit); obj:findPhysicsBodyComponent():setFilterGroupIndex(-800); end end function stopPlatforms2() scene:getJoints("winch0_joint")[1].motorEnabled = false; scene:getJoints("winch1_joint")[1].motorEnabled = false; scene:getJoints("winch2_joint")[1].motorEnabled = false; scene:getJoints("winch3_joint")[1].motorEnabled = false; end -- main makeTentacleFlesh("tentacle11"); makeTentacleSwing1("tentacle11"); makeTentaclePulse1("tentacle11"); makeTentacleFlesh("tentacle12"); makeTentacleSwing2("tentacle12"); makeAirlock("door12", true); setSensorEnterListener("boat7_cp", true, function(other) closeAirlock("door12", true); startAmbientMusic(true); stopPlatforms1(); addTimeoutOnce(1.0, function() if not scene.player:findPlayerComponent().flagDamagedByAcidWormOnBoat then gameShell:setAchieved(const.AchievementWormFeeling); end end); end); makeBoatPark(park4, "park4_exit"); setSensorEnterListener("boat8_cp", true, function(other) local ld = other.linearDamping; local ad = other.angularDamping; other.linearDamping = 6.0; other.angularDamping = 6.0; scene.cutscene = true; addTimeoutOnce(1.5, function() showLowerDialog( { {"player", tr.dialog84.str1}, }, function () scene.cutscene = false; other.linearDamping = ld; other.angularDamping = ad; end); end); end); makeDoor("door13", false); makeEyeletHolder(winch0); makeEyeletHolder(winch1); makeEyeletHolder(winch2); makeEyeletHolder(winch3); makeBoulder(boulder0); makeBoulder(boulder1); makeBoulder(boulder2); makeBoulder(boulder3); makeChain("chain0", chain0, chain0Hooks); makeChain("chain1", chain1, chain1Hooks); makeTentacleFlesh("tentacle13"); makeTentacleSwing3("tentacle13"); makeTentaclePulse2("tentacle13"); makeWinchLever("lever3", "winch1", false); makeWinchLever("lever4", "winch0", false); makeWinchLever("lever5", "winch2", true); makeWinchLever("lever6", "winch3", false); setSensorListener("winch2_cp", function(other) scene.respawnPoint = scene:getObjects("winch2_cp")[1]:getTransform(); scene.camera:findCameraComponent():zoomTo(50, const.EaseOutQuad, 1.5); end, function(other) scene.camera:findCameraComponent():zoomTo(35, const.EaseOutQuad, 1.5); end); setSensorListener("cave_hole_cp", function(other) end, function(other) local c = other:findPhysicsBodyComponent(); if c ~= nil then c:setFilterGroupIndex(0); end end); setSensorEnterListener("cave1_cp", true, function(other) spawnBeetleProb("cave1_beetle", 0.5, 0.3, 0.1, 0.1); end); setSensorEnterListener("cave2_cp", true, function(other) spawnBeetleProb("cave2_beetle", 0.5, 0.2, 0.2, 0.1); end); setSensorEnterListener("winch1_cp", true, function(other) audio:playSound("squid_alert1.ogg"); scene.respawnPoint = scene:getObjects("winch1_cp")[1]:getTransform(); unweldTentacleBones(tentacle13weld); spawnCaveHoleCentipedes({1, 2, 3, 6}); end); setSensorEnterListener("cave3_cp", true, function(other) local t = 0; for i = 1, 3, 1 do addTimeoutOnce(t, function() spawnCaveHoleBeetles({4, 5, 6}, 0.5, 0.3, 0.1, 0.1); end); t = t + 0.3; end end); setSensorEnterListener("cave4_cp", false, function(other) if other.name ~= "boulder0" then return; end spawnCaveHoleCentipedes({4}); local t = 0; for i = 1, 2, 1 do addTimeoutOnce(t, function() spawnCaveHoleCentipedes({2, 3}); end); t = t + 1.3; end scene:getObjects("cave4_cp")[1].active = false; end); setSensorEnterListener("cave5_cp", false, function(other) if other.name ~= "boulder1" then return; end spawnBeetleProb("cave5_beetle", 0.5, 0.2, 0.2, 0.1); fixedSpawn("cave5"); scene:getObjects("cave5_cp")[1].active = false; end); setSensorEnterListener("cave6_cp", true, function(other) spawnCaveHoleCentipedes({7, 8}); end); setSensorEnterListener("cave7_cp", true, function(other) spawnCaveHoleCentipedes({9, 10}); end); setSensorEnterListener("cave8_cp", true, function(other) fixedSpawn("cave8"); end); setSensorEnterListener("cave9_cp", true, function(other) spawnCaveHoleCentipedes({11, 12}); end); setSensorEnterListener("cave10_cp", true, function(other) scene.respawnPoint = scene:getObjects("cave10_cp")[1]:getTransform(); spawnCaveHoleCentipedes({14, 15}); spawnCaveHoleBeetles({13, 16, 17, 18, 19}, 0.5, 0.3, 0.1, 0.1); end); setSensorEnterListener("cave11_cp", true, function(other) spawnCaveHoleCentipedes({16, 18, 19, 20, 21}); end); setSensorEnterListener("cave12_cp", true, function(other) spawnCaveHoleCentipedes({20, 21}); local t = 0; for i = 1, 3, 1 do addTimeoutOnce(t, function() spawnCaveHoleBeetles({18, 20, 21}, 0.5, 0.3, 0.1, 0.1); end); t = t + 0.3; end end); setSensorEnterListener("cave13_cp", true, function(other) fixedSpawn("cave13"); end); setSensorEnterListener("cave14_cp", true, function(other) spawnBeetleProb("cave14_beetle", 0.4, 0.2, 0.2, 0.2); end); makeDoor("door14", false); makeDoor("door15", false); makeLever("lever7", false, function() audio:playSound("lever_pull.ogg"); openDoor("door15", true); openDoor("door14", false); disableLever("lever7"); end, function() audio:playSound("lever_pull.ogg"); end); setSensorEnterListener("cave15_cp", true, function(other) scene.respawnPoint = scene:getObjects("cave15_cp")[1]:getTransform(); fixedSpawn("cave15"); end); setSensorEnterListener("cave16_cp", true, function(other) spawnBeetleProb("cave16_beetle", 0.6, 0.2, 0.1, 0.1); end); setSensorEnterListener("cave17_cp", true, function(other) spawnBeetleProb("cave17_beetle", 0.6, 0.2, 0.1, 0.1); end); setSensorEnterListener("cave18_cp", true, function(other) fixedSpawn("cave18"); spawnBeetleProb("cave18_beetle", 0.6, 0.2, 0.1, 0.1); end); setSensorEnterListener("cave19_cp", true, function(other) fixedSpawn("cave19"); spawnBeetleProb("cave19_beetle", 0.4, 0.3, 0.2, 0.1); end); makeKeyDoor("blue_door", "blue_key_ph", function() openDoor("door13"); end); setSensorEnterListener("cave20_cp", true, function(other) scene.respawnPoint = scene:getObjects("cave20_cp")[1]:getTransform(); end); setSensorEnterListener("cave21_cp", true, function(other) showUpperMsg(4.0, {"player", tr.dialog85.str1}); scene:getObjects("ga1")[1]:findGoalAreaComponent():addGoal(scene:getObjects("dynomite_ph")[1].pos); end); setSensorEnterListener("cave22_cp", true, function(other) scene:getObjects("cave_hole_blocker2")[1].active = false; local rocks = scene:getObjects("expl_boulder"); local to = 0.5; local i = 1; while i <= #rocks do local ci = i; addTimeoutOnce(to, function() for j = ci, ci + 2, 1 do if j <= #rocks then local exp = factory:createExplosion1(const.zOrderExplosion); if j ~= ci then exp:findExplosionComponent():setSound(nil); end exp.pos = rocks[j].pos; scene:addObject(exp); rocks[j]:removeFromParent(); end end end); to = to + 0.2; i = i + 3; end end); dynomitePh.listener = createSensorEnterListener(false, function(other) if scene.player:findPlayerComponent().inventory:have(const.InventoryItemDynomite) then local obj = dynomitePh.parent; obj.freezable = false; scene.player:findPlayerComponent().inventory:take(const.InventoryItemDynomite); dynomitePh:removeFromParent(); local tb = factory:createTimebomb(const.InventoryItemDynomite, 1.8, 87, -115); tb:setBlast(200.0, 200.0, { const.SceneObjectTypePlayer }); local goalPos = scene:getObjects("dynomite_ph")[1].pos; tb.timeoutFn = function () scene:getObjects("ga1")[1]:findGoalAreaComponent():removeGoal(goalPos); local booms = scene:getObjects("dynomite_boom"); local to = 0.4; for _, boom in pairs(booms) do addTimeoutOnce(to, function() local exp = factory:createExplosion1(const.zOrderExplosion); exp.pos = boom.pos; scene:addObject(exp); end); to = to + 0.4; end audio:playSound("squid_alert1.ogg"); unweldTentacleBones(tentacle12weld); end obj:addComponent(tb); end end);
local util=require("moonscript.util")local dump=require("moonscript.dump")local transform=require("moonscript.transform")local NameProxy,LocalName do local _obj_0=require("moonscript.transform.names")NameProxy,LocalName=_obj_0.NameProxy,_obj_0.LocalName end local Set Set=require("moonscript.data").Set local ntype,value_can_be_statement do local _obj_0=require("moonscript.types")ntype,value_can_be_statement=_obj_0.ntype,_obj_0.value_can_be_statement end local statement_compilers=require("moonscript.compile.statement")local value_compilers=require("moonscript.compile.value")local concat,insert do local _obj_0=table concat,insert=_obj_0.concat,_obj_0.insert end local pos_to_line,get_closest_line,trim,unpack pos_to_line,get_closest_line,trim,unpack=util.pos_to_line,util.get_closest_line,util.trim,util.unpack local mtype=util.moon.type local indent_char=" "local Line,DelayedLine,Lines,Block,RootBlock do local _class_0 local _base_0={mark_pos=function(self,pos,line)if line==nil then line=#self end if not(self.posmap[line])then self.posmap[line]=pos end end,add=function(self,item)local _exp_0=mtype(item)if Line==_exp_0 then item:render(self)elseif Block==_exp_0 then item:render(self)else self[#self+1]=item end return self end,flatten_posmap=function(self,line_no,out)if line_no==nil then line_no=0 end if out==nil then out={}end local posmap=self.posmap for i,l in ipairs(self)do local _exp_0=mtype(l)if"string"==_exp_0 or DelayedLine==_exp_0 then line_no=line_no+1 out[line_no]=posmap[i]for _ in l:gmatch("\n")do line_no=line_no+1 end out[line_no]=posmap[i]elseif Lines==_exp_0 then local _ _,line_no=l:flatten_posmap(line_no,out)else error("Unknown item in Lines: "..tostring(l))end end return out,line_no end,flatten=function(self,indent,buffer)if indent==nil then indent=nil end if buffer==nil then buffer={}end for i=1,#self do local l=self[i]local t=mtype(l)if t==DelayedLine then l=l:render()t="string"end local _exp_0=t if"string"==_exp_0 then if indent then insert(buffer,indent)end insert(buffer,l)if"string"==type(self[i+1])then local lc=l:sub(-1)if(lc==")"or lc=="]")and self[i+1]:sub(1,1)=="("then insert(buffer,";")end end insert(buffer,"\n")elseif Lines==_exp_0 then l:flatten(indent and indent..indent_char or indent_char,buffer)else error("Unknown item in Lines: "..tostring(l))end end return buffer end,__tostring=function(self)local strip strip=function(t)if"table"==type(t)then local _accum_0={}local _len_0=1 for _index_0=1,#t do local v=t[_index_0]_accum_0[_len_0]=strip(v)_len_0=_len_0+1 end return _accum_0 else return t end end return"Lines<"..tostring(util.dump(strip(self)):sub(1,-2))..">"end}_base_0.__index=_base_0 _class_0=setmetatable({__init=function(self)self.posmap={}end,__base=_base_0,__name="Lines"},{__index=_base_0,__call=function(cls,...)local _self_0=setmetatable({},_base_0)cls.__init(_self_0,...)return _self_0 end})_base_0.__class=_class_0 Lines=_class_0 end do local _class_0 local _base_0={pos=nil,append_list=function(self,items,delim)for i=1,#items do self:append(items[i])if i<#items then insert(self,delim)end end return nil end,append=function(self,first,...)if Line==mtype(first)then if not(self.pos)then self.pos=first.pos end for _index_0=1,#first do local value=first[_index_0]self:append(value)end else insert(self,first)end if...then return self:append(...)end end,render=function(self,buffer)local current={}local add_current add_current=function()buffer:add(concat(current))return buffer:mark_pos(self.pos)end for _index_0=1,#self do local chunk=self[_index_0]local _exp_0=mtype(chunk)if Block==_exp_0 then local _list_0=chunk:render(Lines())for _index_1=1,#_list_0 do local block_chunk=_list_0[_index_1]if"string"==type(block_chunk)then insert(current,block_chunk)else add_current()buffer:add(block_chunk)current={}end end else insert(current,chunk)end end if current[1]then add_current()end return buffer end,__tostring=function(self)return"Line<"..tostring(util.dump(self):sub(1,-2))..">"end}_base_0.__index=_base_0 _class_0=setmetatable({__init=function()end,__base=_base_0,__name="Line"},{__index=_base_0,__call=function(cls,...)local _self_0=setmetatable({},_base_0)cls.__init(_self_0,...)return _self_0 end})_base_0.__class=_class_0 Line=_class_0 end do local _class_0 local _base_0={prepare=function()end,render=function(self)self:prepare()return concat(self)end}_base_0.__index=_base_0 _class_0=setmetatable({__init=function(self,fn)self.prepare=fn end,__base=_base_0,__name="DelayedLine"},{__index=_base_0,__call=function(cls,...)local _self_0=setmetatable({},_base_0)cls.__init(_self_0,...)return _self_0 end})_base_0.__class=_class_0 DelayedLine=_class_0 end do local _class_0 local _base_0={header="do",footer="end",export_all=false,export_proper=false,value_compilers=value_compilers,statement_compilers=statement_compilers,__tostring=function(self)local h if"string"==type(self.header)then h=self.header else h=unpack(self.header:render({}))end return"Block<"..tostring(h).."> <- "..tostring(self.parent)end,set=function(self,name,value)self._state[name]=value end,get=function(self,name)return self._state[name]end,get_current=function(self,name)return rawget(self._state,name)end,listen=function(self,name,fn)self._listeners[name]=fn end,unlisten=function(self,name)self._listeners[name]=nil end,send=function(self,name,...)do local fn=self._listeners[name]if fn then return fn(self,...)end end end,extract_assign_name=function(self,node)local is_local=false local real_name local _exp_0=mtype(node)if LocalName==_exp_0 then is_local=true real_name=node:get_name(self)elseif NameProxy==_exp_0 then real_name=node:get_name(self)elseif"table"==_exp_0 then real_name=node[1]=="ref"and node[2]elseif"string"==_exp_0 then real_name=node end return real_name,is_local end,declare=function(self,names)local undeclared do local _accum_0={}local _len_0=1 for _index_0=1,#names do local _continue_0=false repeat local name=names[_index_0]local real_name,is_local=self:extract_assign_name(name)if not(is_local or real_name and not self:has_name(real_name,true))then _continue_0=true break end self:put_name(real_name)if self:name_exported(real_name)then _continue_0=true break end local _value_0=real_name _accum_0[_len_0]=_value_0 _len_0=_len_0+1 _continue_0=true until true if not _continue_0 then break end end undeclared=_accum_0 end return undeclared end,whitelist_names=function(self,names)self._name_whitelist=Set(names)end,name_exported=function(self,name)if self.export_all then return true end if self.export_proper and name:match("^%u")then return true end end,put_name=function(self,name,...)local value=...if select("#",...)==0 then value=true end if NameProxy==mtype(name)then name=name:get_name(self)end self._names[name]=value end,has_name=function(self,name,skip_exports)if not skip_exports and self:name_exported(name)then return true end local yes=self._names[name]if yes==nil and self.parent then if not self._name_whitelist or self._name_whitelist[name]then return self.parent:has_name(name,true)end else return yes end end,is_local=function(self,node)local t=mtype(node)if t=="string"then return self:has_name(node,false)end if t==NameProxy or t==LocalName then return true end if t=="table"then if node[1]=="ref"or(node[1]=="chain"and#node==2)then return self:is_local(node[2])end end return false end,free_name=function(self,prefix,dont_put)prefix=prefix or"moon"local searching=true local name,i=nil,0 while searching do name=concat({"",prefix,i},"_")i=i+1 searching=self:has_name(name,true)end if not dont_put then self:put_name(name)end return name end,init_free_var=function(self,prefix,value)local name=self:free_name(prefix,true)self:stm({"assign",{name},{value}})return name end,add=function(self,item,pos)do local _with_0=self._lines _with_0:add(item)if pos then _with_0:mark_pos(pos)end end return item end,render=function(self,buffer)buffer:add(self.header)buffer:mark_pos(self.pos)if self.next then buffer:add(self._lines)self.next:render(buffer)else if#self._lines==0 and"string"==type(buffer[#buffer])then buffer[#buffer]=buffer[#buffer]..(" "..(unpack(Lines():add(self.footer))))else buffer:add(self._lines)buffer:add(self.footer)buffer:mark_pos(self.pos)end end return buffer end,block=function(self,header,footer)return Block(self,header,footer)end,line=function(self,...)do local _with_0=Line()_with_0:append(...)return _with_0 end end,is_stm=function(self,node)return self.statement_compilers[ntype(node)]~=nil end,is_value=function(self,node)local t=ntype(node)return self.value_compilers[t]~=nil or t=="value"end,name=function(self,node,...)if type(node)=="string"then return node else return self:value(node,...)end end,value=function(self,node,...)node=self.transform.value(node)local action if type(node)~="table"then action="raw_value"else action=node[1]end local fn=self.value_compilers[action]if not(fn)then error({"compile-error","Failed to find value compiler for: "..dump.value(node),node[-1]})end local out=fn(self,node,...)if type(node)=="table"and node[-1]then if type(out)=="string"then do local _with_0=Line()_with_0:append(out)out=_with_0 end end out.pos=node[-1]end return out end,values=function(self,values,delim)delim=delim or", "do local _with_0=Line()_with_0:append_list((function()local _accum_0={}local _len_0=1 for _index_0=1,#values do local v=values[_index_0]_accum_0[_len_0]=self:value(v)_len_0=_len_0+1 end return _accum_0 end)(),delim)return _with_0 end end,stm=function(self,node,...)if not node then return end node=self.transform.statement(node)local result do local fn=self.statement_compilers[ntype(node)]if fn then result=fn(self,node,...)else if value_can_be_statement(node)then result=self:value(node)else result=self:stm({"assign",{"_"},{node}})end end end if result then if type(node)=="table"and type(result)=="table"and node[-1]then result.pos=node[-1]end self:add(result)end return nil end,stms=function(self,stms,ret)if ret then error("deprecated stms call, use transformer")end local current_stms,current_stm_i current_stms,current_stm_i=self.current_stms,self.current_stm_i self.current_stms=stms for i=1,#stms do self.current_stm_i=i self:stm(stms[i])end self.current_stms=current_stms self.current_stm_i=current_stm_i return nil end,splice=function(self,fn)local lines={"lines",self._lines}self._lines=Lines()return self:stms(fn(lines))end}_base_0.__index=_base_0 _class_0=setmetatable({__init=function(self,parent,header,footer)self.parent,self.header,self.footer=parent,header,footer self._lines=Lines()self._names={}self._state={}self._listeners={}do self.transform={value=transform.Value:bind(self),statement=transform.Statement:bind(self)}end if self.parent then self.root=self.parent.root self.indent=self.parent.indent+1 setmetatable(self._state,{__index=self.parent._state})return setmetatable(self._listeners,{__index=self.parent._listeners})else self.indent=0 end end,__base=_base_0,__name="Block"},{__index=_base_0,__call=function(cls,...)local _self_0=setmetatable({},_base_0)cls.__init(_self_0,...)return _self_0 end})_base_0.__class=_class_0 Block=_class_0 end do local _class_0 local _parent_0=Block local _base_0={__tostring=function(self)return"RootBlock<>"end,root_stms=function(self,stms)if not(self.options.implicitly_return_root==false)then stms=transform.Statement.transformers.root_stms(self,stms)end return self:stms(stms)end,render=function(self)local buffer=self._lines:flatten()if buffer[#buffer]=="\n"then buffer[#buffer]=nil end return table.concat(buffer)end}_base_0.__index=_base_0 setmetatable(_base_0,_parent_0.__base)_class_0=setmetatable({__init=function(self,options)self.options=options self.root=self return _class_0.__parent.__init(self)end,__base=_base_0,__name="RootBlock",__parent=_parent_0},{__index=function(cls,name)local val=rawget(_base_0,name)if val==nil then local parent=rawget(cls,"__parent")if parent then return parent[name]end else return val end end,__call=function(cls,...)local _self_0=setmetatable({},_base_0)cls.__init(_self_0,...)return _self_0 end})_base_0.__class=_class_0 if _parent_0.__inherited then _parent_0.__inherited(_parent_0,_class_0)end RootBlock=_class_0 end local format_error format_error=function(msg,pos,file_str)local line_message if pos then local line=pos_to_line(file_str,pos)local line_str line_str,line=get_closest_line(file_str,line)line_str=line_str or""line_message=(" [%d] >> %s"):format(line,trim(line_str))end return concat({"Compile error: "..msg,line_message},"\n")end local value value=function(value)local out=nil do local _with_0=RootBlock()_with_0:add(_with_0:value(value))out=_with_0:render()end return out end local tree tree=function(tree,options)if options==nil then options={}end assert(tree,"missing tree")local scope=(options.scope or RootBlock)(options)local runner=coroutine.create(function()return scope:root_stms(tree)end)local success,err=coroutine.resume(runner)if not(success)then local error_msg,error_pos if type(err)=="table"then local _exp_0=err[1]if"user-error"==_exp_0 or"compile-error"==_exp_0 then error_msg,error_pos=unpack(err,2)else error_msg,error_pos=error("Unknown error thrown",util.dump(error_msg))end else error_msg,error_pos=concat({err,debug.traceback(runner)},"\n")end return nil,error_msg,error_pos or scope.last_pos end local lua_code=scope:render()local posmap=scope._lines:flatten_posmap()return lua_code,posmap end do local data=require("moonscript.data")for name,cls in pairs({Line=Line,Lines=Lines,DelayedLine=DelayedLine})do data[name]=cls end end return{tree=tree,value=value,format_error=format_error,Block=Block,RootBlock=RootBlock}
local owofaces = { "OwO", "owo", "UwU", "uwu", "^w^", ">w<" } minetest.register_on_chat_message(function(name, message) message = message:gsub("R", "W") :gsub("r", "w") :gsub("L", "W") :gsub("l", "w") minetest.chat_send_all("<"..name.."> "..message.." "..owofaces[math.random(#owofaces)]) return true end)
local AddonName, AddonTable = ... -- The Obsidian Sanctum -- https://www.wowhead.com/the-obsidian-sanctum AddonTable.os = { -- All Difficulties 43345, -- Sartharion (10) 43986, 40615, 40613, 40614, 40427, 40430, 40428, 43990, 43998, 43993, 43991, 43989, 43996, 40426, 43992, 43994, 43988, 43995, -- Sartharion (25) 43954, 40630, 40628, 40629, 44004, 44003, 40431, 44000, 40432, 40455, 44007, 40453, 40437, 40439, 40446, 44006, 44002, 40433, 40451, 44005, 40438, 44011, 44008, 43999, }
--[[ ####### Aseprite - MSX image files importer script ####### Copyright by Natalia Pujol (2021) This file is released under the terms of the MIT license. --]] -- ######################################################## -- ScreenMode class -- Definition of the MSX Screen modes. -- ######################################################## ScreenMode = { className = "ScreenMode", descName = "", -- general name of the screen mode descFormat = "", -- description of the screen format renderSprites = true, -- aseprite can render his sprites address = { tileMap = nil, tilePat = nil, tileCol = nil, sprAttr = nil, sprPat = nil, sprCol = nil, -- only MSX2 or above palette = nil, -- only MSX2 or above }, screen = { -- MSX screen mode info/data -- info variables mode = -1, -- screen mode: 1, 2, 3, 4, 5, 6, 7, 8, 10 or 12 maxWidth = 256, maxHeight = 192, maxColors = 16, paletteRes = "MSX1_DEFAULT", defaultPalette16 = false, -- data containers tileMap = nil, -- used by Screen 1..12 tilePatterns = nil, -- used by Screen 1..4 tileColors = nil, -- used by Screen 1..4 sprAttribs = nil, -- used by Screen 1..12 sprPatterns = nil, -- used by Screen 1..12 sprColors = nil, -- used by Screen 4..12 palette = nil, -- used by Screen 4..7 and 10 } } -- ============================ function ScreenMode:new() local o = {} setmetatable(o, self) self.__index = self return o end -- ============================ function ScreenMode:getInstance(mode) if mode == 1 then return ScreenMode1:new() end if mode == 2 then return ScreenMode2:new() end if mode == 3 then return ScreenMode3:new() end if mode == 4 then return ScreenMode4:new() end if mode == 5 then return ScreenMode5:new() end if mode == 6 then return ScreenMode6:new() end if mode == 7 then return ScreenMode7:new() end if mode == 8 then return ScreenMode8:new() end if mode == 10 then return ScreenMode10:new() end if mode == 12 then return ScreenMode12:new() end return nil end -- ######################################################## -- ScreenMode1 -- ######################################################## ScreenMode1 = ScreenMode:new() -- ============================ function ScreenMode1:new() o = ScreenMode:new() setmetatable(o, self) self.__index = self o.descName = "MSX Screen 1 tiled file" o.descFormat = "256x192 16 fixed colors" o.fileSize = 0x4000 o.screen.mode = 1 o.screen.maxWidth = 256 o.screen.maxHeight = 192 o.screen.maxColors = 16 o.screen.paletteRes = "MSX1_DEFAULT" o.address.tilePat = { pos=0x0000, size=0x0800 } o.address.tileMap = { pos=0x1800, size=0x300 } o.address.sprAttr = { pos=0x1b00, size=0x80 } o.address.tileCol = { pos=0x2000, size=0x20 } o.address.palette = { pos=0x2020, size=0x20 } o.address.sprPat = { pos=0x3800, size=0x800 } return o end -- ######################################################## -- ScreenMode2 -- ######################################################## ScreenMode2 = ScreenMode:new() -- ============================ function ScreenMode2:new() o = ScreenMode:new() setmetatable(o, self) self.__index = self o.descName = "MSX Screen 2 tiled file" o.descFormat = "256x192 16 fixed colors" o.fileSize = 0x4000 o.screen.mode = 2 o.screen.maxWidth = 256 o.screen.maxHeight = 192 o.screen.maxColors = 16 o.screen.paletteRes = "MSX1_DEFAULT" o.address.tilePat = { pos=0x0000, size=0x1800 } o.address.tileMap = { pos=0x1800, size=0x300 } o.address.sprAttr = { pos=0x1b00, size=0x80 } o.address.palette = { pos=0x1b80, size=0x20 } o.address.tileCol = { pos=0x2000, size=0x1800 } o.address.sprPat = { pos=0x3800, size=0x800 } return o end -- ######################################################## -- ScreenMode3 -- ######################################################## ScreenMode3 = ScreenMode:new() -- ============================ function ScreenMode3:new() o = ScreenMode:new() setmetatable(o, self) self.__index = self o.descName = "MSX Screen 3 file" o.descFormat = "64x48 16 fixed colors" o.fileSize = 0x4000 o.screen.mode = 3 o.screen.maxWidth = 256 o.screen.maxHeight = 192 o.screen.maxColors = 16 o.screen.paletteRes = "MSX1_DEFAULT" o.address.tileCol = { pos=0x0000, size=0x0600 } -- Block colors o.address.tileMap = { pos=0x0800, size=0x300 } o.address.palette = { pos=0x0f00, size=0x20 } o.address.sprAttr = { pos=0x1b00, size=0x80 } o.address.sprPat = { pos=0x3800, size=0x800 } return o end -- ######################################################## -- ScreenMode4 -- ######################################################## ScreenMode4 = ScreenMode:new() -- ============================ function ScreenMode4:new() o = ScreenMode:new() setmetatable(o, self) self.__index = self o.descName = "MSX2 Screen 4 tiled file" o.descFormat = "256x192 16col from 512" o.fileSize = 0x4000 o.screen.mode = 4 o.screen.maxWidth = 256 o.screen.maxHeight = 192 o.screen.maxColors = 16 o.screen.paletteRes = "MSX2_DEFAULT" o.address.tilePat = { pos=0x0000, size=0x1800 } o.address.tileMap = { pos=0x1800, size=0x300 } o.address.palette = { pos=0x1b80, size=0x20 } o.address.sprCol = { pos=0x1c00, size=0x200 } o.address.sprAttr = { pos=0x1e00, size=0x80 } o.address.tileCol = { pos=0x2000, size=0x1800 } o.address.sprPat = { pos=0x3800, size=0x800 } return o end -- ######################################################## -- ScreenMode5 -- ######################################################## ScreenMode5 = ScreenMode:new() -- ============================ function ScreenMode5:new() o = ScreenMode:new() setmetatable(o, self) self.__index = self o.descName = "MSX2 Screen 5 bitmap file" o.descFormat = "256x212 16col from 512" o.fileSize = 0x8000 o.screen.mode = 5 o.screen.maxWidth = 256 o.screen.maxHeight = 212 o.screen.maxColors = 16 o.screen.paletteRes = "MSX2_DEFAULT" o.address.tilePat = { pos=0x0000, size=0x6a00 } o.address.sprCol = { pos=0x7400, size=0x200 } o.address.sprAttr = { pos=0x7600, size=0x80 } o.address.palette = { pos=0x7680, size=0x20 } o.address.sprPat = { pos=0x7800, size=0x800 } return o end -- ######################################################## -- ScreenMode6 -- ######################################################## ScreenMode6 = ScreenMode:new() -- ============================ function ScreenMode6:new() o = ScreenMode:new() setmetatable(o, self) self.__index = self o.descName = "MSX2 Screen 6 bitmap file" o.descFormat = "512x212 4col from 512" o.fileSize = 0x8000 o.screen.mode = 6 o.screen.maxWidth = 512 o.screen.maxHeight = 212 o.screen.maxColors = 4 o.screen.paletteRes = "MSX2_DEFAULT" o.address.tilePat = { pos=0x0000, size=0x6a00 } o.address.sprCol = { pos=0x7400, size=0x200 } o.address.sprAttr = { pos=0x7600, size=0x80 } o.address.palette = { pos=0x7680, size=0x20 } o.address.sprPat = { pos=0x7800, size=0x800 } return o end -- ######################################################## -- ScreenMode7 -- ######################################################## ScreenMode7 = ScreenMode:new() -- ============================ function ScreenMode7:new() o = ScreenMode:new() setmetatable(o, self) self.__index = self o.descName = "MSX2 Screen 7 bitmap file" o.descFormat = "512x212 16col from 512" o.fileSize = 0xfaa0 o.screen.mode = 7 o.screen.maxWidth = 512 o.screen.maxHeight = 212 o.screen.maxColors = 16 o.screen.paletteRes = "MSX2_DEFAULT" o.address.tilePat = { pos=0x0000, size=0xd400 } o.address.sprPat = { pos=0xf000, size=0x800 } o.address.sprCol = { pos=0xf800, size=0x200 } o.address.sprAttr = { pos=0xfa00, size=0x80 } o.address.palette = { pos=0xfa80, size=0x20 } return o end -- ######################################################## -- ScreenMode8 -- ######################################################## ScreenMode8 = ScreenMode:new() -- ============================ function ScreenMode8:new() o = ScreenMode:new() setmetatable(o, self) self.__index = self o.descName = "MSX2 Screen 8 bitmap file" o.descFormat = "256x212 256 fixed col" o.fileSize = 0xfaa0 o.renderSprites = false o.screen.mode = 8 o.screen.maxWidth = 256 o.screen.maxHeight = 212 o.screen.maxColors = 256 o.screen.paletteRes = "MSX2_SC8" o.screen.defaultPalette16 = true o.address.tilePat = { pos=0x0000, size=0xd400 } o.address.sprPat = { pos=0xf000, size=0x800 } o.address.sprCol = { pos=0xf800, size=0x200 } o.address.sprAttr = { pos=0xfa00, size=0x80 } o.address.palette = { pos=0xfa80, size=0x20 } return o end -- ######################################################## -- ScreenMode10 -- ######################################################## ScreenMode10 = ScreenMode:new() -- ============================ function ScreenMode10:new() o = ScreenMode:new() setmetatable(o, self) self.__index = self o.descName = "MSX2+ Screen 10 bitmap file" o.descFormat = "256x212 12k YJK + 16 RGB" o.fileSize = 0xfaa0 o.renderSprites = false o.screen.mode = 10 o.screen.maxWidth = 256 o.screen.maxHeight = 212 o.screen.maxColors = 16 o.screen.paletteRes = "MSX2_DEFAULT" o.screen.defaultPalette16 = true o.address.tilePat = { pos=0x0000, size=0xd400 } o.address.sprPat = { pos=0xf000, size=0x800 } o.address.sprCol = { pos=0xf800, size=0x200 } o.address.sprAttr = { pos=0xfa00, size=0x80 } o.address.palette = { pos=0xfa80, size=0x20 } return o end -- ######################################################## -- ScreenMode12 -- ######################################################## ScreenMode12 = ScreenMode:new() -- ============================ function ScreenMode12:new() o = ScreenMode:new() setmetatable(o, self) self.__index = self o.descName = "MSX2+ Screen 12 bitmap file" o.descFormat = "256x212 19k YJK colors" o.fileSize = 0xfaa0 o.renderSprites = false o.screen.mode = 12 o.screen.maxWidth = 256 o.screen.maxHeight = 212 o.screen.maxColors = 16 o.screen.paletteRes = "MSX2_DEFAULT" o.screen.defaultPalette16 = true o.address.tilePat = { pos=0x0000, size=0xd400 } o.address.sprPat = { pos=0xf000, size=0x800 } o.address.sprCol = { pos=0xf800, size=0x200 } o.address.sprAttr = { pos=0xfa00, size=0x80 } o.address.palette = { pos=0xfa80, size=0x20 } return o end
-- task states return { READY = 'r', TAKEN = 't', DONE = '-', BURIED = '!', DELAYED = '~', }
local env1 = bare_environment() local env2 = add_decl(env1, mk_var_decl("A", Type)) assert(env2:is_descendant(env1)) assert(env2:is_descendant(env2)) assert(not env1:is_descendant(env2)) local env3 = env2:forget() assert(not env3:is_descendant(env1)) assert(not env3:is_descendant(env2)) assert(env3:is_descendant(env3))
DelayedCalls = DelayedCalls or {} DelayedCalls._calls = DelayedCalls._calls or {} Hooks:Add("MenuUpdate", "MenuUpdate_Queue", function(t, dt) DelayedCalls:Update(t, dt) end) Hooks:Add("GameSetupUpdate", "GameSetupUpdate_Queue", function(t, dt) DelayedCalls:Update(t, dt) end) function DelayedCalls:Update(t, dt) local t = {} for k, v in pairs(self._calls) do if v ~= nil then v.currentTime = v.currentTime + dt if v.currentTime > v.timeToWait then if v.func then v.func() end v = nil else table.insert(t, v) end end end self._calls = t end --[[ DelayedCalls:Add(id, time, func) Adds a function to be automatically called after a set delay id, Unique identifier for this delayed call time, Time in seconds to call the specified function after func, Function call to call after the time runs out ]] function DelayedCalls:Add(id, time, func) self._calls[id] = self._calls[id] or {} self._calls[id].func = func self._calls[id].timeToWait = time self._calls[id].currentTime = 0 end --[[ DelayedCalls:Remove(id) Removes a scheduled call before it can be automatically called id, Unique identifier for the delayed call remove ]] function DelayedCalls:Remove(id) self._calls[id] = nil end
local Prop = {} Prop.Name = "Evocity District Building 1" Prop.Cat = "Warehouse" Prop.Price = 4300 Prop.Doors = { Vector( -4424, 13692, 258.25 ), } GM.Property:Register( Prop )
----------------------------------- -- Area: Monarch_Linn -- NPC: Spatial Displacement -- !pos -35 -1 -539 31 ----------------------------------- local ID = require("scripts/zones/Monarch_Linn/IDs"); require("scripts/globals/bcnm"); require("scripts/globals/quests"); require("scripts/globals/missions"); require("scripts/globals/zone") ----------------------------------- function onTrade(player,npc,trade) if (TradeBCNM(player,npc,trade)) then return; end end; function onTrigger(player,npc) local npcID = npc:getID(); local X = player:getXPos(); local Z = player:getZPos(); if (X > 12.934 and X < 24.934) then if (player:getPreviousZone() == tpz.zone.RIVERNE_SITE_A01) then player:startEvent(11); -- To Riv Site A elseif (player:getPreviousZone() == tpz.zone.RIVERNE_SITE_B01) then player:startEvent(10); -- To Riv Site B end elseif ((X > -524.521 and X < -512.521) or (X > 75.524 and X < 87.524) or (X > 675.271 and X < 687.271)) then player:startEvent(32003); -- leave the battlefield elseif (X > -25.684 and X < -13.684) then -- post-battlefield exit player:startEvent(7); elseif (EventTriggerBCNM(player,npc)) then -- enter the battlefield return 1; else player:messageSpecial(ID.text.GLOWING_MIST); -- needs confirmation end end; function onEventUpdate(player,csid,option,extras) EventUpdateBCNM(player,csid,option,extras); end; function onEventFinish(player,csid,option) if (csid == 11 and option == 1) then player:setPos(-508.582,-8.471,-387.670,92,30); -- To Riv Site A (Retail confirmed) elseif (csid == 10 and option == 1) then player:setPos(-533.690,-20.5,503.656,224,29); -- To Riv Site B (Retail confirmed) elseif (csid == 7 and option ==1) then player:setPos(-538.526,-29.5,359.219,255,25); -- back to Misareaux Coast (Retail confirmed) elseif (EventFinishBCNM(player,csid,option)) then return; end end;
return { version = "1.5", luaversion = "5.1", tiledversion = "1.7.2", orientation = "orthogonal", renderorder = "right-down", width = 15, height = 60, tilewidth = 8, tileheight = 8, nextlayerid = 11, nextobjectid = 139, properties = {}, tilesets = { { name = "sprite_sheet", firstgid = 1, tilewidth = 8, tileheight = 8, spacing = 0, margin = 0, columns = 10, image = "sprite_sheet.png", imagewidth = 84, imageheight = 48, objectalignment = "unspecified", tileoffset = { x = 0, y = 0 }, grid = { orientation = "orthogonal", width = 8, height = 8 }, properties = {}, wangsets = {}, tilecount = 60, tiles = {} } }, layers = { { type = "tilelayer", x = 0, y = 0, width = 15, height = 60, id = 1, name = "Layer 1", visible = true, opacity = 1, offsetx = 0, offsety = 0, parallaxx = 1, parallaxy = 1, properties = {}, encoding = "lua", data = { 25, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 25, 25, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 25, 25, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 25, 25, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 25, 25, 52, 52, 36, 25, 26, 25, 38, 52, 52, 52, 52, 52, 52, 25, 25, 52, 52, 25, 25, 26, 25, 25, 52, 52, 52, 52, 52, 52, 25, 25, 52, 52, 1073741860, 25, 26, 25, 3221225509, 52, 52, 52, 52, 52, 52, 25, 25, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 25, 25, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 25, 25, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 25, 25, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 25, 25, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 25, 25, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 25, 25, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 25, 25, 52, 52, 52, 52, 37, 25, 26, 27, 25, 26, 27, 25, 26, 27, 25, 52, 52, 52, 52, 25, 25, 26, 27, 25, 26, 27, 25, 26, 27, 25, 52, 52, 52, 52, 25, 25, 26, 27, 25, 26, 27, 25, 26, 27, 25, 52, 52, 52, 52, 1610612773, 25, 26, 27, 25, 26, 27, 25, 26, 27, 25, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 25, 25, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 25, 25, 52, 52, 52, 52, 52, 52, 52, 52, 1610612774, 25, 2684354599, 52, 52, 25, 25, 52, 52, 52, 52, 52, 1610612774, 25, 26, 25, 26, 25, 52, 52, 25, 25, 25, 26, 27, 25, 26, 25, 26, 27, 25, 26, 25, 52, 52, 25, 25, 26, 27, 25, 26, 27, 25, 26, 27, 25, 26, 25, 52, 52, 25, 25, 25, 26, 27, 25, 26, 27, 25, 26, 27, 25, 3221225511, 52, 52, 25, 25, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 25, 25, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 25, 25, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 25, 25, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 25, 25, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 25, 25, 52, 39, 25, 52, 52, 37, 2684354596, 52, 52, 39, 25, 26, 27, 27, 25, 52, 25, 25, 52, 52, 25, 25, 52, 52, 25, 25, 25, 26, 27, 25, 52, 25, 25, 25, 26, 25, 25, 25, 26, 25, 25, 25, 26, 27, 25, 52, 25, 25, 26, 27, 25, 26, 27, 25, 26, 25, 25, 26, 27, 25, 52, 25, 25, 26, 27, 25, 26, 27, 25, 26, 25, 25, 26, 27, 25, 52, 25, 25, 26, 27, 25, 26, 27, 25, 26, 25, 25, 26, 27, 25, 52, 52, 52, 52, 52, 52, 52, 52, 52, 28, 27, 52, 52, 25, 25, 52, 52, 52, 52, 52, 52, 52, 52, 52, 26, 1610612756, 52, 52, 25, 25, 25, 26, 2684354596, 52, 52, 52, 52, 52, 52, 1610612756, 52, 52, 52, 25, 25, 26, 27, 3221225509, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 25, 25, 26, 3221225509, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 25, 25, 3221225511, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 25, 25, 52, 52, 52, 39, 25, 26, 27, 2684354596, 52, 52, 52, 52, 52, 25, 25, 52, 52, 52, 1610612772, 25, 26, 27, 3221225509, 52, 52, 52, 52, 52, 25, 25, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 25, 25, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 25, 25, 52, 52, 52, 52, 52, 36, 28, 27, 27, 25, 38, 52, 52, 25, 25, 52, 52, 52, 52, 52, 26, 52, 52, 52, 52, 28, 52, 52, 25, 25, 52, 52, 52, 52, 10, 26, 25, 27, 26, 26, 27, 26, 25, 25, 25, 52, 37, 38, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 25, 25, 52, 1610612775, 25, 25, 26, 27, 25, 26, 27, 25, 26, 27, 25, 26, 25, 52, 52, 25, 25, 26, 27, 25, 26, 27, 25, 26, 27, 25, 26, 25, 52, 52, 3221225510, 25, 26, 27, 25, 26, 27, 25, 26, 27, 25, 26, 25, 52, 52, 52, 52, 3221225510, 25, 26, 27, 27, 25, 26, 27, 25, 26, 25, 52, 52, 52, 52, 52, 52, 52, 52, 1610612773, 25, 26, 27, 25, 26, 25, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 25, 25, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 1610612773, 25, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 25, 52, 52, 52, 52, 52, 52, 52, 52, 36, 38, 52, 52, 52, 52, 25, 25, 26, 27, 25, 26, 27, 25, 26, 25, 26, 25, 26, 27, 25 } }, { type = "objectgroup", draworder = "topdown", id = 2, name = "Hitboxes", visible = true, opacity = 1, offsetx = 0, offsety = 0, parallaxx = 1, parallaxy = 1, properties = {}, objects = { { id = 78, name = "", type = "", shape = "rectangle", x = 0, y = 0, width = 8, height = 480, rotation = 0, visible = true, properties = {} }, { id = 79, name = "", type = "", shape = "rectangle", x = 8, y = 472, width = 112, height = 8, rotation = 0, visible = true, properties = {} }, { id = 80, name = "", type = "", shape = "rectangle", x = 72, y = 464, width = 16, height = 8, rotation = 0, visible = true, properties = {} }, { id = 81, name = "", type = "", shape = "rectangle", x = 16, y = 392, width = 16, height = 16, rotation = 0, visible = true, properties = {} }, { id = 82, name = "", type = "", shape = "rectangle", x = 24, y = 408, width = 96, height = 16, rotation = 0, visible = true, properties = {} }, { id = 83, name = "", type = "", shape = "rectangle", x = 32, y = 400, width = 88, height = 8, rotation = 0, visible = true, properties = {} }, { id = 84, name = "", type = "", shape = "rectangle", x = 40, y = 424, width = 80, height = 8, rotation = 0, visible = true, properties = {} }, { id = 85, name = "", type = "", shape = "rectangle", x = 72, y = 432, width = 48, height = 8, rotation = 0, visible = true, properties = {} }, { id = 86, name = "", type = "", shape = "rectangle", x = 112, y = 440, width = 8, height = 16, rotation = 0, visible = true, properties = {} }, { id = 88, name = "", type = "", shape = "rectangle", x = 112, y = 0, width = 8, height = 400, rotation = 0, visible = true, properties = {} }, { id = 89, name = "", type = "", shape = "rectangle", x = 24, y = 32, width = 40, height = 24, rotation = 0, visible = true, properties = {} }, { id = 91, name = "", type = "", shape = "rectangle", x = 40, y = 112, width = 72, height = 32, rotation = 0, visible = true, properties = {} }, { id = 92, name = "", type = "", shape = "rectangle", x = 72, y = 160, width = 24, height = 40, rotation = 0, visible = true, properties = {} }, { id = 93, name = "", type = "", shape = "rectangle", x = 48, y = 168, width = 24, height = 32, rotation = 0, visible = true, properties = {} }, { id = 94, name = "", type = "", shape = "rectangle", x = 8, y = 176, width = 40, height = 24, rotation = 0, visible = true, properties = {} }, { id = 95, name = "", type = "", shape = "rectangle", x = 16, y = 240, width = 16, height = 48, rotation = 0, visible = true, properties = {} }, { id = 97, name = "", type = "", shape = "rectangle", x = 32, y = 256, width = 16, height = 32, rotation = 0, visible = true, properties = {} }, { id = 98, name = "", type = "", shape = "rectangle", x = 48, y = 240, width = 16, height = 48, rotation = 0, visible = true, properties = {} }, { id = 99, name = "", type = "", shape = "rectangle", x = 64, y = 256, width = 16, height = 32, rotation = 0, visible = true, properties = {} }, { id = 100, name = "", type = "", shape = "rectangle", x = 80, y = 240, width = 32, height = 48, rotation = 0, visible = true, properties = {} }, { id = 101, name = "", type = "", shape = "rectangle", x = 8, y = 304, width = 24, height = 16, rotation = 0, visible = true, properties = {} }, { id = 102, name = "", type = "", shape = "rectangle", x = 8, y = 320, width = 16, height = 8, rotation = 0, visible = true, properties = {} }, { id = 103, name = "", type = "", shape = "rectangle", x = 8, y = 328, width = 8, height = 8, rotation = 0, visible = true, properties = {} }, { id = 105, name = "", type = "", shape = "rectangle", x = 32, y = 336, width = 40, height = 16, rotation = 0, visible = true, properties = {} }, { id = 108, name = "", type = "", shape = "rectangle", x = 48, y = 368, width = 8, height = 24, rotation = 0, visible = true, properties = {} }, { id = 113, name = "", type = "", shape = "rectangle", x = 88, y = 368, width = 8, height = 24, rotation = 0, visible = true, properties = {} }, { id = 114, name = "", type = "", shape = "rectangle", x = 56, y = 384, width = 32, height = 8, rotation = 0, visible = true, properties = {} }, { id = 115, name = "", type = "", shape = "rectangle", x = 56, y = 368, width = 32, height = 8, rotation = 0, visible = true, properties = {} }, { id = 130, name = "", type = "", shape = "rectangle", x = 80, y = 288, width = 8, height = 24, rotation = 0, visible = true, properties = {} }, { id = 131, name = "", type = "", shape = "rectangle", x = 88, y = 288, width = 8, height = 16, rotation = 0, visible = true, properties = {} }, { id = 135, name = "", type = "", shape = "rectangle", x = 96, y = 384, width = 16, height = 8, rotation = 0, visible = true, properties = {} }, { id = 136, name = "", type = "", shape = "rectangle", x = 40, y = 384, width = 8, height = 8, rotation = 0, visible = true, properties = {} } } }, { type = "objectgroup", draworder = "topdown", id = 3, name = "Enemies", visible = true, opacity = 1, offsetx = 0, offsety = 0, parallaxx = 1, parallaxy = 1, properties = {}, objects = { { id = 33, name = "", type = "", shape = "rectangle", x = 48, y = 232, width = 8, height = 8, rotation = 0, visible = true, properties = { ["drop"] = "rng", ["itemType"] = "random", ["type"] = "lizard" } }, { id = 34, name = "", type = "", shape = "rectangle", x = 40, y = 392, width = 8, height = 8, rotation = 0, visible = true, properties = { ["drop"] = "rng", ["itemType"] = "random", ["type"] = "lizard" } }, { id = 35, name = "", type = "", shape = "rectangle", x = 80, y = 456, width = 8, height = 8, rotation = 0, visible = true, properties = { ["drop"] = "scripted", ["itemType"] = "recovery", ["type"] = "eye" } }, { id = 116, name = "", type = "", shape = "rectangle", x = 72, y = 376, width = 8, height = 8, rotation = 0, visible = true, properties = { ["type"] = "bigEye" } }, { id = 117, name = "", type = "", shape = "rectangle", x = 64, y = 376, width = 8, height = 8, rotation = 0, visible = true, properties = { ["type"] = "bigEye" } }, { id = 118, name = "", type = "", shape = "rectangle", x = 80, y = 152, width = 8, height = 8, rotation = 0, visible = true, properties = { ["drop"] = "rng", ["itemType"] = "random", ["type"] = "lizard" } }, { id = 119, name = "", type = "", shape = "rectangle", x = 80, y = 8, width = 8, height = 8, rotation = 0, visible = true, properties = { ["drop"] = "rng", ["itemType"] = "random", ["type"] = "eyeBat" } }, { id = 120, name = "", type = "", shape = "rectangle", x = 16, y = 88, width = 8, height = 8, rotation = 0, visible = true, properties = { ["drop"] = "rng", ["itemType"] = "random", ["type"] = "eyeBat" } }, { id = 138, name = "", type = "", shape = "rectangle", x = 56, y = 160, width = 8, height = 8, rotation = 0, visible = true, properties = { ["drop"] = "rng", ["itemType"] = "random", ["type"] = "bigEye" } } } }, { type = "objectgroup", draworder = "topdown", id = 6, name = "Items", visible = true, opacity = 1, offsetx = 0, offsety = 0, parallaxx = 1, parallaxy = 1, properties = {}, objects = { { id = 122, name = "", type = "", shape = "rectangle", x = 56, y = 104, width = 8, height = 8, rotation = 0, visible = true, properties = { ["type"] = "recovery" } }, { id = 123, name = "", type = "", shape = "rectangle", x = 72, y = 104, width = 8, height = 8, rotation = 0, visible = true, properties = { ["type"] = "max_health" } }, { id = 124, name = "", type = "", shape = "rectangle", x = 88, y = 104, width = 8, height = 8, rotation = 0, visible = true, properties = { ["type"] = "attack" } }, { id = 126, name = "", type = "", shape = "rectangle", x = 104, y = 392, width = 8, height = 8, rotation = 0, visible = true, properties = { ["type"] = "attack" } }, { id = 127, name = "", type = "", shape = "rectangle", x = 88, y = 232, width = 8, height = 8, rotation = 0, visible = true, properties = { ["type"] = "max_health" } }, { id = 129, name = "", type = "", shape = "rectangle", x = 32, y = 464, width = 8, height = 8, rotation = 0, visible = true, properties = { ["type"] = "recovery" } } } }, { type = "objectgroup", draworder = "topdown", id = 8, name = "Player", visible = true, opacity = 1, offsetx = 0, offsety = 0, parallaxx = 1, parallaxy = 1, properties = {}, objects = { { id = 47, name = "", type = "", shape = "rectangle", x = 32, y = 0, width = 8, height = 8, rotation = 0, visible = true, properties = {} } } }, { type = "objectgroup", draworder = "topdown", id = 9, name = "Level Transitions", visible = true, opacity = 1, offsetx = 0, offsety = 0, parallaxx = 1, parallaxy = 1, properties = {}, objects = { { id = 52, name = "", type = "", shape = "rectangle", x = 112, y = 456, width = 8, height = 16, rotation = 0, visible = true, properties = { ["exit_direction"] = "right", ["target"] = "boss_1" } } } } } }
return require("newmodule"):from({ name = "secs", available = { "secs", "30log", "hump", "slither", "middleclass", }, }, ...)
#!/usr/bin/env luajit local xmlua = require("xmlua") local document = xmlua.XML.parse("<root class='A'/>") local root = document:root() -- Uses dot syntax to get attribute value print(root.class) -- -> A -- Uses [] syntax to get attribute value print(root["class"]) -- -> A -- Uses get_attribute method to get attribute value print(root:get_attribute("class")) -- -> A local xml = [[ <root xmlns:example="http://example.com/" example:attribute="value-example" attribute="value" nonexistent-namespace:attribute="value-nonexistent-namespace"/> ]] local document = xmlua.XML.parse(xml) local root = document:root() -- With namespace prefix print(root["example:attribute"]) -- -> value-example -- Without namespace prefix print(root["attribute"]) -- -> value -- With nonexistent namespace prefix print(root["nonexistent-namespace:attribute"]) -- -> value-nonexistent-namespace
MageStoneProphetsNpc = { 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 local mobName = "" --attacker.quest["zapped_"..mob.yname] if npc.mapTitle == "Prophet Yin" then mobName = "yin_mouse" elseif npc.mapTitle == "Prophet Yang" then mobName = "yang_mouse" elseif npc.mapTitle == "Prophet Void" then mobName = "void_mouse" end if player.quest["zapped_" .. mobName] == 0 then player:dialogSeq( { t, "You have not shown me an offering. I will not chat with you." }, 0 ) return end if npc.mapTitle == "Prophet Yin" then player:dialogSeq( { t, "Ah, someone who shows great wisdom and follows simple directions. That speaks well of you.", "You wish to become one of the Nagnang Mages, eh? Well it is more about being a mage at heart than of a town.", "Magic is not about killing and destroying. It is also about compassion and beauty. This is the quest that I bestow upon you.", "Find a rose. That is the simplicity and beauty of my request. Keep that rose with you and give it to Wand when you have done the other's bidding." }, 0 ) end if npc.mapTitle == "Prophet Yang" then player:dialogSeq( { t, "I see that you have learned your lesson as to how to greet us in the caves. Good. Good.", "So you want the power that comes with the Mages of Nagnang, do you? Well power is what we are about.", "Magic has its soft side but it has the strength and poweer to destroy and conquer. It can be stronger than any weapon or blade.", "To show this, get yourself a piece of high Ore, and keep it with you until you complete all the other's quests and return to Wand." }, 0 ) end if npc.mapTitle == "Prophet Void" then player:dialogSeq( { t, "Ah, you had the clarity of mind to follow that which Wand told you. That is good.", "Understanding the void, the absence of everything, is the most important part of being a mage of Nagnang.", "The person who understands the Void better than anyone are the dead. Walk throuogh the graves in the Crypts of the Cemetery and glean their knowledge.", "Afterwards, return to Wand with whatever thee others have you find and you will be rewarded with the stone." }, 0 ) end end) }
-- enUS and enGB use the same global strings, however -- this is needed in order to format dates correctly. WIM.AddLocale("enGB", { ["_DateFormat"] = "%d/%m/%Y" });
--[[ Outlands -- AllInOne.lua This script was written and is protected by the GPL v2. This script was released by The BLUA Scripting Project. Please give proper accredidations when re-releasing or sharing this script with others in the emulation community. ~~End of License Agreement -- Blua, December 01, 2008. ]] --[[ Only update this script IF you have finished a peice of Outlands ]]-- function Abjurist_OnEnterCombat(pUnit, Event) pUnit:RegisterEvent("Abjurist_Armor", 10000, 0) pUnit:RegisterEvent("Abjurist_Missiles", 1000,0) end function Abjurist_Armor(pUnit, Event) pUnit:CastSpell(12544) end function Abjurist_Missiles(pUnit, Event) pUnit:FullCastSpellOnTarget(34447,pUnit:GetClosestPlayer()) end function Abjurist_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Abjurist_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (19546, 1, "Abjurist_OnEnterCombat") RegisterUnitEvent (19546, 2, "Abjurist_OnLeaveCombat") RegisterUnitEvent (19546, 4, "Abjurist_OnDied") function Ambassador_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Ambassador_Fireball", 3000, 0) end function Ambassador_Fireball(pUnit,Event) pUnit:FullCastSpellOnTarget(9053,pUnit:GetClosestPlayer()) end function Ambassador_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Ambassador_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (20163, 1, "Ambassador_OnEnterCombat") RegisterUnitEvent (20163, 2, "Ambassador_OnLeaveCombat") RegisterUnitEvent (20163, 4, "Ambassador_OnDied") function Honor_OnEnterCombat(pUnit, Event) pUnit:RegisterEvent("Honor_Cleave",1000,0) end function Honor_Cleave(pUnit, Event) pUnit:FullCastSpellOnTarget(15284,pUnit:GetClosestPlayer()) end function Honor_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Honor_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (20199, 1, "Honor_OnEnterCombat") RegisterUnitEvent (20199, 2, "Honor_OnLeaveCombat") RegisterUnitEvent (20199, 4, "Honor_OnDied") function Anchorite_OnEnterCombat(pUnit, Event) pUnit:RegisterEvent("Anchorite_Heal", 3500, 0) pUnit:RegisterEvent("Anchorite_Fire", 5000, 0) pUnit:RegisterEvent("Anchorite_Smite", 2500, 0) end function Anchorite_Heal(pUnit, Event) pUnit:CastSpell(35096) end function Anchorite_Fire(pUnit, Event) pUnit:FullCastSpellOnTarget(17141, pUnit:GetClosestPlayer()) end function Anchorite_Smite(pUnit, Event) pUnit:FullCastSpellOnTarget(9734, pUnit:GetClosestPlayer()) end function Anchorite_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Anchorite_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (19467, 1, "Anchorite_OnEnterCombat") RegisterUnitEvent (19467, 2, "Anchorite_OnLeaveCombat") RegisterUnitEvent (19467, 4, "Anchorite_OnDied") function Angered_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Angered_Bolt", 1000, 0) pUnit:RegisterEvent("Angered_Blast", 6000, 0) end function Angered_Bolt(pUnit,Event) pUnit:FullCastSpellOnTarget(39337, pUnit:GetClosestPlayer()) end function Angered_Blast(pUnit,Event) pUnit:FullCastSpellOnTarget(38205, pUnit:GetClosestPlayer()) end function Angered_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Angered_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (17870, 1, "Angered_OnEnterCombat") RegisterUnitEvent (17870, 2, "Angered_OnLeaveCombat") RegisterUnitEvent (17870, 4, "Angered_OnDied") function Ardonis_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Ardonis_Shadows",10000,0) pUnit:RegisterEvent("Ardonis_Desecration",1000,0) end function Ardonis_Shadows(pUnit,Event) pUnit:CastSpell(36472) end function Ardonis_Desecration(pUnit,Event) pUnit:FullCastSpellOnTarget(36473, pUnit:GetClosestPlayer()) end function Ardonis_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Ardonis_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (19830, 1, "Ardonis_OnEnterCombat") RegisterUnitEvent (19830, 2, "Ardonis_OnLeaveCombat") RegisterUnitEvent (19830, 4, "Ardonis_OnDied") function Arconus_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Arconus_Shadows",10000,0) pUnit:RegisterEvent("Arconus_Desecration",1000,0) end function Arconus_Shadows(pUnit,Event) pUnit:CastSpell(36472) end function Arconus_Desecration(pUnit,Event) pUnit:FullCastSpellOnTarget(36473, pUnit:GetClosestPlayer()) end function Arconus_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Arconus_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (20554, 1, "Arconus_OnEnterCombat") RegisterUnitEvent (20554, 2, "Arconus_OnLeaveCombat") RegisterUnitEvent (20554, 4, "Arconus_OnDied") function Ark_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Ark_Explosion",1500,0) end function Ark_Explosion(pUnit,Event) pUnit:FullCastSpellOnTarget(11975, pUnit:GetClosestPlayer()) end function Ark_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Ark_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (19494, 1, "Ark_OnEnterCombat") RegisterUnitEvent (19494, 2, "Ark_OnLeaveCombat") RegisterUnitEvent (19494, 4, "Ark_OnDied") function Seeker_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Seeker_Burn",3000,0) pUnit:RegisterEvent("Seeker_Lock",1000,0) end function Seeker_Burn(pUnit,Event) pUnit:FullCastSpellOnTarget(11981, pUnit:GetClosestPlayer()) end function Seeker_Lock(pUnit,Event) pUnit:FullCastSpellOnTarget(30849, pUnit:GetClosestPlayer()) end function Ark_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Ark_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (19852, 1, "Seeker_OnEnterCombat") RegisterUnitEvent (19852, 2, "Seeker_OnLeaveCombat") RegisterUnitEvent (19852, 4, "Seeker_OnDied") function Avatar_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Avatar_Rain",1000,0) pUnit:RegisterEvent("Avatar_Bolt",3000,0) end function Avatar_Rain(pUnit,Event) pUnit:FullCastSpellOnTarget(34017, pUnit:GetClosestPlayer()) end function Avatar_Bolt(pUnit,Event) pUnit:FullCastSpellOnTarget(12471, pUnit:GetClosestPlayer()) end function Avatar_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Avatar_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (21925, 1, "Avatar_OnEnterCombat") RegisterUnitEvent (21925, 2, "Avatar_OnLeaveCombat") RegisterUnitEvent (21925, 4, "Avatar_OnDied") function Azure_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Azure_Screech", 1000,0) end function Azure_Screech(pUnit,Event) pUnit:FullCastSpellOnTarget(31273, pUnit:GetClosestPlayer()) end function Azure_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Azure_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (21005, 1, "Azure_OnEnterCombat") RegisterUnitEvent (21005, 2, "Azure_OnLeaveCombat") RegisterUnitEvent (21005, 4, "Azure_OnDied") function Crocolisk_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Crocolisk_Rip",1000,0) end function Crocolisk_Rip(pUnit,Event) pUnit:FullCastSpellOnTarget(3604, pUnit:GetClosestPlayer()) end function Crocolisk_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Crocolisk_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (20773, 1, "Crocolisk_OnEnterCombat") RegisterUnitEvent (20773, 2, "Crocolisk_OnLeaveCombat") RegisterUnitEvent (20773, 4, "Crocolisk_OnDied") function Mage_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Mage_Blast", 6000,0) pUnit:RegisterEvent("Mage_Flames",2500,0) end function Mage_Rip(pUnit,Event) pUnit:FullCastSpellOnTarget(17273, pUnit:GetClosestPlayer()) end function Mage_Flames(pUnit,Event) pUnit:FullCastSpellOnTarget(36104, pUnit:GetClosestPlayer()) end function Mage_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Mage_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (19543, 1, "Mage_OnEnterCombat") RegisterUnitEvent (19543, 2, "Mage_OnLeaveCombat") RegisterUnitEvent (19543, 4, "Mage_OnDied") function Bot_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Bot_Suicide",4000,1) end function Bot_Suicide(pUnit,Event) pUnit:FullCastSpellOnTarget(7,pUnit:GetClosestPlayer()) pUnit:CastSpell(7) end function Bot_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Bot_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (19692, 1, "Bot_OnEnterCombat") RegisterUnitEvent (19692, 2, "Bot_OnLeaveCombat") RegisterUnitEvent (19692, 4, "Bot_OnDied") function Captain_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Captain_Summon",1000,1) pUnit:RegisterEvent("Captain_Whirl",1000,0) pUnit:RegisterEvent("Captain_Wind",2000,0) end function Captain_Summon(pUnit,Event) pUnit:CastSpell(35882) end function Captain_Whirl(pUnit,Event) pUnit:FullCastSpellOnTarget(15576,pUnit:GetClosestPlayer()) end function Capatain_Wind(pUnit,Event) pUnit:FullCastSpellOnTarget(17207,pUnit:GetClosestPlayer()) end function Capatain_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Capatain_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (19635, 1, "Capatain_OnEnterCombat") RegisterUnitEvent (19635, 2, "Capatain_OnLeaveCombat") RegisterUnitEvent (19635, 4, "Capatain_OnDied") function Captain_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Captain_Cleave",1000,0) end function Captain_Cleave(pUnit,Event) pUnit:FullCastSpellOnTarget(15576,pUnit:GetClosestPlayer()) end function Capatain_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Capatain_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (20985, 1, "Capatain_OnEnterCombat") RegisterUnitEvent (20985, 2, "Capatain_OnLeaveCombat") RegisterUnitEvent (20985, 4, "Capatain_OnDied") function Captain_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Captain_Cleave",1000,0) pUnit:RegisterEvent("Captain_Toughen",1000,0) end function Captain_Cleave(pUnit,Event) pUnit:FullCastSpellOnTarget(15576,pUnit:GetClosestPlayer()) end function Captain_Thougen(pUnit,Event) pUnit:CastSpell(33962) end function Capatain_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Capatain_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (20727, 1, "Capatain_OnEnterCombat") RegisterUnitEvent (20727, 2, "Capatain_OnLeaveCombat") RegisterUnitEvent (20727, 4, "Capatain_OnDied") function Captured_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Captured_Glaive",1000,0) pUnit:RegisterEvent("Captured_Hamstring",10000,0) end function Captured_Glaive(pUnit,Event) pUnit:FullCastSpellOnTarget(36500,pUnit:GetClosestPlayer()) end function Captured_Hamstring(pUnit,Event) pUnit:FullCastSpellOnTarget(31553,pUnit:GetClosestPlayer()) end function Captured_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Captured_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (20763, 1, "Captured_OnEnterCombat") RegisterUnitEvent (20763, 2, "Captured_OnLeaveCombat") RegisterUnitEvent (20763, 4, "Captured_OnDied") function Chief_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Chief_Glaive",1000,0) end function Chief_Glaive(pUnit,Event) pUnit:FullCastSpellOnTarget(38204,pUnit:GetClosestPlayer()) end function Chief_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Chief_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (18697, 1, "Chief_OnEnterCombat") RegisterUnitEvent (18697, 2, "Chief_OnLeaveCombat") RegisterUnitEvent (18697, 4, "Chief_OnDied") function Frost_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Frost_Nova",8000,0) pUnit:RegisterEvent("Frost_Bolt",3000,0) pUnit:RegisterEvent("Frost_Barrier",30000,0) end function Frost_Nova(pUnit,Event) pUnit:FullCastSpellOnTarget(11831,pUnit:GetClosestPlayer()) end function Frost_Bolt(pUnit,Event) pUnit:FullCastSpellOnTarget(9672,pUnit:GetClosestPlayer()) end function Frost_Barrier(pUnit,Event) pUnit:CastSpell(33245) end function Frost_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Frost_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (19545, 1, "Frost_OnEnterCombat") RegisterUnitEvent (19545, 2, "Frost_OnLeaveCombat") RegisterUnitEvent (19545, 4, "Frost_OnDied") function Commander_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Commander_Cleave",1000,0) pUnit:RegisterEvent("Commander_Spellbreaker",1000,0) end function Commander_Cleave(pUnit,Event) pUnit:FullCastSpellOnTarget(35473,pUnit:GetClosestPlayer()) end function Commander_Spellbreaker(pUnit,Event) pUnit:FullCastSpellOnTarget(35871,pUnit:GetClosestPlayer()) end function Commander_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Commander_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (19831, 1, "Commander_OnEnterCombat") RegisterUnitEvent (19831, 2, "Commander_OnLeaveCombat") RegisterUnitEvent (19831, 4, "Commander_OnDied") function Conjurer_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Conjurer_Bolt",3000,0) pUnit:RegisterEvent("Conjurer_Sword",30000,0) end function Conjurer_Bolt(pUnit,Event) pUnit:FullCastSpellOnTarget(9532,pUnit:GetClosestPlayer()) end function Conjurer_Sword(pUnit,Event) pUnit:CastSpell(36110) end function Conjurer_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Conjurer_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (19544, 1, "Conjurer_OnEnterCombat") RegisterUnitEvent (19544, 2, "Conjurer_OnLeaveCombat") RegisterUnitEvent (19544, 4, "Conjurer_OnDied") function Basilisk_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Basilisk_Gaze",45000,0) pUnit:RegisterEvent("Basilisk_Charge",1000,0) end function Basilisk_Gaze(pUnit,Event) pUnit:FullCastSpellOnTarget(35313, pUnit:GetClosestPlayer()) end function Basilisk_Charge(pUnit,Event) pUnit:FullCastSpellOnTarget(35385, pUnit:GetClosestPlayer()) end function Basilisk_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Basilisk_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (20607, 1, "Basilisk_OnEnterCombat") RegisterUnitEvent (20607, 2, "Basilisk_OnLeaveCombat") RegisterUnitEvent (20607, 4, "Basilisk_OnDied") function Culuthas_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Culuthas_Felfire",3000,0) end function Culuthas_Felfire(pUnit,Event) pUnit:FullCastSpellOnTarget(37089, pUnit:GetClosestPlayer()) end function Culuthas_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Culuthas_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (20138, 1, "Culuthas_OnEnterCombat") RegisterUnitEvent (20138, 2, "Culuthas_OnLeaveCombat") RegisterUnitEvent (20138, 4, "Culuthas_OnDied") function Forgelord_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Forgelord_Nova",2000,0) pUnit:RegisterEvent("Forgelord_Enrage",120000,0) end function Forgelord_Nova(pUnit,Event) pUnit:FullCastSpellOnTarget(36255, pUnit:GetClosestPlayer()) end function Forgelord_Enrage(pUnit,Event) pUnit:CastSpell(8599) end function Forgelord_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Forgelord_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (16943, 1, "Forgelord_OnEnterCombat") RegisterUnitEvent (16943, 2, "Forgelord_OnLeaveCombat") RegisterUnitEvent (16943, 4, "Forgelord_OnDied") function Flames_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Flames_Dance",1000,0) pUnit:RegisterEvent("Flames_Seduction",180000,0) pUnit:RegisterEvent("Flames_Summon",1000,(1)) end function Flames_Dance(pUnit,Event) pUnit:CastSpell(45427) end function Flames_Seduction(pUnit,Event) pUnit:FullCastSpellOnTarget(47057, pUnit:GetClosestPlayer()) end function Flames_Summon(pUnit,Event) pUnit:CastSpell(45423) end function Flames_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Flames_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (25305, 1, "Flames_OnEnterCombat") RegisterUnitEvent (25305, 2, "Flames_OnLeaveCombat") RegisterUnitEvent (25305, 4, "Flames_OnDied") function Daughter_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Daughter_Nova",2000,0) end function Daughter_Nova(pUnit,Event) pUnit:FullCastSpellOnTarget(36225, pUnit:GetClosestPlayer()) end function Daughter_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Daughter_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (18860, 1, "Daughter_OnEnterCombat") RegisterUnitEvent (18860, 2, "Daughter_OnLeaveCombat") RegisterUnitEvent (18860, 4, "Daughter_OnDied") function Dimensius_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Dimensius_Trick",1000,(1)) pUnit:RegisterEvent("Dimensius_Spiral",3000,0) pUnit:RegisterEvent("Dimensius_Vault",1000,0) end function Dimensius_Trick(pUnit,Event) pUnit:CastSpell(37425) end function Dimensius_Spiral(pUnit,Event) pUnit:FullCastSpellOnTarget(37500,pUnit:GetClosestPlayer()) end function Dimensius_Vault(pUnit,Event) pUnit:FullCastSpellOnTarget(37412,pUnit:GetClosestPlayer()) end function Dimensius_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Dimensius_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (19554, 1, "Dimensius_OnEnterCombat") RegisterUnitEvent (19554, 2, "Dimensius_OnLeaveCombat") RegisterUnitEvent (19554, 4, "Dimensius_OnDied") function Exarch_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Exarch_Fortitude",2000,0) pUnit:RegisterEvent("Exarch_Devotion",1000,0) end function Exarch_Fortitude(pUnit,Event) pUnit:CastSpellOnTarget(36004,pUnit:GetRandomFriend()) end function Exarch_Devotion(pUnit,Event) pUnit:CastSpell(8258) end function Exarch_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Exarch_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (21058, 1, "Exarch_OnEnterCombat") RegisterUnitEvent (21058, 2, "Exarch_OnLeaveCombat") RegisterUnitEvent (21058, 4, "Exarch_OnDied") function Protector_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Protector_Strike",1000,0) pUnit:RegisterEvent("Protector_Smite",2500,0) end function Protector_Strike(pUnit,Event) pUnit:FullCastSpellOnTarget(36647,pUnit:GetClosestPlayer()) end function Protector_Smite(pUnit,Event) pUnit:FullCastSpellOnTarget(9734,pUnit:GetClosestPlayer()) end function Protector_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Protector_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (18873, 1, "Protector_OnEnterCombat") RegisterUnitEvent (18873, 2, "Protector_OnLeaveCombat") RegisterUnitEvent (18873, 4, "Protector_OnDied") function Vindicator_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Vindicator_Revenge",1000,0) pUnit:RegisterEvent("Vindicator_Vindication",1000,0) end function Vindicator_Revenge(pUnit,Event) pUnit:CastSpellOnTarget(36647,GetInRangeFriends()) end function Vindicator_Vindication(pUnit,Event) pUnit:FullCastSpellOnTarget(36002,pUnit:GetClosestPlayer()) end function Vindicator_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Vindicator_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (18872, 1, "Vindicator_OnEnterCombat") RegisterUnitEvent (18872, 2, "Vindicator_OnLeaveCombat") RegisterUnitEvent (18872, 4, "Vindicator_OnDied") function Doomclaw_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Doomclaw_Swipe",1000,0) pUnit:RegisterEvent("Doomclaw_Claw",1100,0) pUnit:RegisterEvent("Doomclaw_Slime",1000,0) end function Doomclaw_Swipe(pUnit,Event) pUnit:FullCastSpellOnTarget(36205,pUnit:GetClosestPlayer()) end function Doomclaw_Claw(pUnit,Event) pUnit:FullCastSpellOnTarget(36996,pUnit:GetClosestPlayer()) end function Doomclaw_Slime(pUnit,Event) pUnit:FullCastSpellOnTarget(34261,pUnit:GetClosestPlayer()) end function Doomclaw_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Doomclaw_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (19738, 1, "Doomclaw_OnEnterCombat") RegisterUnitEvent (19738, 2, "Doomclaw_OnLeaveCombat") RegisterUnitEvent (19738, 4, "Doomclaw_OnDied") function Boom_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Boom_Dynamite",1000,0) end function Boom_Dynamite(pUnit,Event) pUnit:FullCastSpellOnTarget(35276,pUnit:GetClosestPlayer()) end function Boom_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Boom_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (20284, 1, "Boom_OnEnterCombat") RegisterUnitEvent (20284, 2, "Boom_OnLeaveCombat") RegisterUnitEvent (20284, 4, "Boom_OnDied") function Inquisitor_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Inquisitor_Weakness",1000,0) pUnit:RegisterEvent("Inquisitor_Flamestrike",3000,0) end function Inquisitor_Weakness(pUnit,Event) pUnit:FullCastSpellOnTarget(11980,pUnit:GetClosestPlayer()) end function Inquisitor_Flamestrike(pUnit,Event) pUnit:FullCastSpellOnTarget(36040,pUnit:GetClosestPlayer()) end function Inquisitor_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Inquisitor_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (19493, 1, "Inquisitor_OnEnterCombat") RegisterUnitEvent (19493, 2, "Inquisitor_OnEnterCombat") RegisterUnitEvent (19493, 4, "Inquisitor_OnEnterCombat") function Archon_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Archon_Flux",1000,0) pUnit:RegisterEvent("Archon_Intangible",1000,0) pUnit:RegisterEvent("Archon_Overspark",1000,0) pUnit:RegisterEvent("Archon_Shadow",1000,0) end function Archon_Flux(pUnit,Event) pUnit:FullCastSpellOnTarget(35924,pUnit:GetClosestPlayer()) end function Archon_Intangible(pUnit,Event) pUnit:FullCastSpellOnTarget(36513,pUnit:GetClosestPlayer()) end function Archon_Overspark(pUnit,Event) pUnit:FullCastSpellOnTarget(35579,pUnit:GetClosestPlayer()) end function Archon_Shadow(pUnit,Event) pUnit:FullCastSpellOnTarget(36515,pUnit:GetClosestPlayer()) end function Archon_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Archon_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (20458, 1, "Archon_OnEnterCombat") RegisterUnitEvent (20458, 2, "Archon_OnEnterCombat") RegisterUnitEvent (20458, 4, "Archon_OnEnterCombat") function Assassin_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Assassin_Kick",1000,0) pUnit:RegisterEvent("Assassin_Warp",1000,0) end function Assassin_Kick(pUnit,Event) pUnit:FullCastSpellOnTarget(34802,pUnit:GetClosestPlayer()) end function Assassin_Warp(pUnit,Event) pUnit:FullCastSpellOnTarget(32920,pUnit:GetClosestPlayer()) end function Assassin_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Assassin_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (20452, 1, "Assassin_OnEnterCombat") RegisterUnitEvent (20452, 2, "Assassin_OnEnterCombat") RegisterUnitEvent (20452, 4, "Assassin_OnEnterCombat") function Avenger_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Avenger_Shout",1000,0) pUnit:RegisterEvent("Avenger_Charge",1000,0) pUnit:RegisterEvent("Avenger_Weapons",1000,0) end function Avenger_Charge(pUnit,Event) pUnit:FullCastSpellOnTarget(32064,pUnit:GetClosestPlayer()) end function Avenger_Intangible(pUnit,Event) pUnit:FullCastSpellOnTarget(36509,pUnit:GetClosestPlayer()) end function Avenger_Weapons(pUnit,Event) pUnit:FullCastSpellOnTarget(39489,pUnit:GetClosestPlayer()) end function Avenger_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Avenger_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (22821, 1, "Avenger_OnEnterCombat") RegisterUnitEvent (22821, 2, "Avenger_OnEnterCombat") RegisterUnitEvent (22821, 4, "Avenger_OnEnterCombat") function Gladiator_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Gladiator_Cleave",1000,0) pUnit:RegisterEvent("Gladiator_Hamstring",1000,0) pUnit:RegisterEvent("Gladiator_Strike",1000,0) end function Gladiator_Cleave(pUnit,Event) pUnit:FullCastSpellOnTarget(15284,pUnit:GetClosestPlayer()) end function Gladiator_Hamstring(pUnit,Event) pUnit:FullCastSpellOnTarget(9080,pUnit:GetClosestPlayer()) end function Gladiator_Strike(pUnit,Event) pUnit:FullCastSpellOnTarget(16856,pUnit:GetClosestPlayer()) end function Gladiator_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Gladiator_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (20854, 1, "Gladiator_OnEnterCombat") RegisterUnitEvent (20854, 2, "Gladiator_OnEnterCombat") RegisterUnitEvent (20854, 4, "Gladiator_OnEnterCombat") function Jailor_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Jailor_Presence",1000,0) end function Jailor_Presence(pUnit,Event) pUnit:CastSpell(36513) end function Jailor_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Jailor_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (23008, 1, "Jailor_OnEnterCombat") RegisterUnitEvent (23008, 2, "Jailor_OnEnterCombat") RegisterUnitEvent (23008, 4, "Jailor_OnEnterCombat") function Stalker_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Stalker_Shadowsurge",1000,0) pUnit:RegisterEvent("Stalker_Shadowtouched",1000,0) end function Stalker_Shadowsurge(pUnit,Event) pUnit:FullCastSpellOnTarget(36517,pUnit:GetClosestPlayer()) end function Stalker_Shadowtouched(pUnit,Event) pUnit:CastSpell(36515) end function Stalker_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Stalker_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (20474, 1, "Stalker_OnEnterCombat") RegisterUnitEvent (20474, 2, "Stalker_OnEnterCombat") RegisterUnitEvent (20474, 4, "Stalker_OnEnterCombat") function Nullifier_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Nullifier_Presence",1000,0) end function Nullifier_Presence(pUnit,Event) pUnit:CastSpell(36513) end function Nullifier_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Nullifier_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (22822, 1, "Nullifier_OnEnterCombat") RegisterUnitEvent (22822, 2, "Nullifier_OnEnterCombat") RegisterUnitEvent (22822, 4, "Nullifier_OnEnterCombat") function Overlord_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Overlord_Shout",1000,0) pUnit:RegisterEvent("Overlord_Charge",1000,0) pUnit:RegisterEvent("Overlord_Weapons",1000,0) pUnit:RegisterEvent("Overlord_Shadowtouched",1000,0) end function Overlord_Charge(pUnit,Event) pUnit:FullCastSpellOnTarget(36509,pUnit:GetMainTank()) end function Overlord_Shout(pUnit,Event) pUnit:CastSpell(32064) end function Overlord_Weapons(pUnit,Event) pUnit:FullCastSpellOnTarget(36510,pUnit:GetClosestPlayer()) end function Overlord_Shadowtouched(pUnit,Event) pUnit:CastSpell(36515) end function Overlord_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Overlord_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (20459, 1, "Overlord_OnEnterCombat") RegisterUnitEvent (20459, 2, "Overlord_OnLeaveCombat") RegisterUnitEvent (20459, 4, "Overlord_OnDied") function Relay_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Relay_Shadowform",1000,0) end function Relay_Shadowform(pUnit,Event) pUnit:CastSpell(16592) end function Relay_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Relay_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (20619, 1, "Relay_OnEnterCombat") RegisterUnitEvent (20619, 2, "Relay_OnLeaveCombat") RegisterUnitEvent (20619, 4, "Relay_OnDied") function Researcher_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Researcher_Energy",1000,0) pUnit:RegisterEvent("Researcher_Surge",1000,0) pUnit:RegisterEvent("Researcher_Bolt",3000,0) end function Researcher_Energy(pUnit,Event) pUnit:CastSpell(16592) end function Researcher_Surge(pUnit,Event) pUnit:FullCastSpellOnTarget(36508,pUnit:GetClosestPlayer()) end function Researcher_Bolt(pUnit,Event) pUnit:FullCastSpellOnTarget(9532,pUnit:GetClosestPlayer()) end function Researcher_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Researcher_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (20456, 1, "Researcher_OnEnterCombat") RegisterUnitEvent (20456, 2, "Researcher_OnLeaveCombat") RegisterUnitEvent (20456, 4, "Researcher_OnDied") function Shocktrooper_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Shocktrooper_Glaive",1000,0) pUnit:RegisterEvent("Shocktrooper_Hamstring",1000,0) end function Shocktrooper_Glaive(pUnit,Event) pUnit:FullCastSpellOnTarget(36500,pUnit:GetClosestPlayer()) end function Shocktrooper_Hamstring(pUnit,Event) pUnit:FullCastSpellOnTarget(31553,pUnit:GetClosestPlayer()) end function Shocktrooper_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Shocktrooper_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (20453, 1, "Shocktrooper_OnEnterCombat") RegisterUnitEvent (20453, 2, "Shocktrooper_OnLeaveCombat") RegisterUnitEvent (20453, 4, "Shocktrooper_OnDied") function Orelis_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Orelis_Shout",1000,0) pUnit:RegisterEvent("Orelis_Strike",1000,0) pUnit:RegisterEvent("Orelis_Rend",1000,0) end function Orelis_Shout(pUnit,Event) pUnit:FullCastSpellOnTarget(13730,pUnit:GetClosestPlayer()) end function Orelis_Strike(pUnit,Event) pUnit:FullCastSpellOnTarget(29426,pUnit:GetClosestPlayer()) end function Orelis_Rend(pUnit,Event) pUnit:FullCastSpellOnTarget(16509,pUnit:GetClosestPlayer()) end function Orelis_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Orelis_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (19466, 1, "Orelis_OnEnterCombat") RegisterUnitEvent (19466, 2, "Orelis_OnLeaveCombat") RegisterUnitEvent (19466, 4, "Orelis_OnDied") function Eye_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Eye_Bursts",1000,0) end function Eye_Bursts(pUnit,Event) pUnit:FullCastSpellOnTarget(36414,pUnit:GetClosestPlayer()) end function Eye_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Eye_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (20394, 1, "Eye_OnEnterCombat") RegisterUnitEvent (20394, 2, "Eye_OnLeaveCombat") RegisterUnitEvent (20394, 4, "Eye_OnDied") function Lasher_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Lasher_Enrage",1000,0) pUnit:RegisterEvent("Lasher_Roots",1500,0) pUnit:RegisterEvent("Lasher_Growth",500,0) end function Lasher_Enrage(pUnit,Event) pUnit:CastSpell(3019) end function Lasher_Roots(pUnit,Event) pUnit:FullCastSpellOnTarget(12747,pUnit:GetClosestPlayer()) end function Lasher_Growth(pUnit,Event) pUnit:FullCastSpellOnTarget(36604,pUnit:GetClosestPlayer()) end function Lasher_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Lasher_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (20774, 1, "Lasher_OnEnterCombat") RegisterUnitEvent (20774, 2, "Lasher_OnLeaveCombat") RegisterUnitEvent (20774, 4, "Lasher_OnDied") function Imp_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Imp_Bolt",2000,0) end function Imp_Bolt(pUnit,Event) pUnit:FullCastSpellOnTarget(36227,pUnit:GetClosestPlayer()) end function Imp_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Imp_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (21135, 1, "Imp_OnEnterCombat") RegisterUnitEvent (21135, 2, "Imp_OnLeaveCombat") RegisterUnitEvent (21135, 4, "Imp_OnDied") function Doomguard_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Doomguard_Strike",1000,0) pUnit:RegisterEvent("Doomguard_Stomp",1000,0) end function Doomguard_Strike(pUnit,Event) pUnit:FullCastSpellOnTarget(32736,pUnit:GetClosestPlayer()) end function Doomguard_Stomp(pUnit,Event) pUnit:FullCastSpellOnTarget(35238,pUnit:GetClosestPlayer()) end function Doomguard_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Doomguard_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (19853, 1, "Doomguard_OnEnterCombat") RegisterUnitEvent (19853, 2, "Doomguard_OnLeaveCombat") RegisterUnitEvent (19853, 4, "Doomguard_OnDied") function Wraith_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Wraith_Bolt",1000,0) pUnit:RegisterEvent("Wraith_Blast",6000,0) end function Wraith_Bolt(pUnit,Event) pUnit:FullCastSpellOnTarget(39337,pUnit:GetClosestPlayer()) end function Wraith_Blast(pUnit,Event) pUnit:FullCastSpellOnTarget(38205,pUnit:GetClosestPlayer()) end function Wraith_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Wraith_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (22408, 1, "Wraith_OnEnterCombat") RegisterUnitEvent (22408, 2, "Wraith_OnLeaveCombat") RegisterUnitEvent (22408, 4, "Wraith_OnDied") function Engineer_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Engineer_Dynamite",1000,0) end function Engineer_Dynamite(pUnit,Event) pUnit:FullCastSpellOnTarget(7978,pUnit:GetClosestPlayer()) end function Engineer_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Engineer_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (16948, 1, "Engineer_OnEnterCombat") RegisterUnitEvent (16948, 2, "Engineer_OnLeaveCombat") RegisterUnitEvent (16948, 4, "Engineer_OnDied") function Mekgineer_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Mekgineer_Drain",1000,0) pUnit:RegisterEvent("Mekgineer_Steal",1000,0) end function Mekgineer_Drain(pUnit,Event) pUnit:FullCastSpellOnTarget(36825,pUnit:GetClosestPlayer()) end function Mekgineer_Steal(pUnit,Event) pUnit:FullCastSpellOnTarget(36208,pUnit:GetClosestPlayer()) end function Mekgineer_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Mekgineer_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (16949, 1, "Mekgineer_OnEnterCombat") RegisterUnitEvent (16949, 2, "Mekgineer_OnLeaveCombat") RegisterUnitEvent (16949, 4, "Mekgineer_OnDied") function Tinker_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Tinker_Bomb",2000,0) pUnit:RegisterEvent("Tinker_Steal",1000,0) end function Tinker_Bomb(pUnit,Event) pUnit:FullCastSpellOnTarget(36846,pUnit:GetClosestPlayer()) end function Tinker_Steal(pUnit,Event) pUnit:FullCastSpellOnTarget(36208,pUnit:GetClosestPlayer()) end function Tinker_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Tinker_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (20285, 1, "Tinker_OnEnterCombat") RegisterUnitEvent (20285, 2, "Tinker_OnLeaveCombat") RegisterUnitEvent (20285, 4, "Tinker_OnDied") function Hatecryer_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Hatecryer_Curse",1000,0) pUnit:RegisterEvent("Hatecryer_Rain",1000,0) end function Hatecryer_Curse(pUnit,Event) pUnit:FullCastSpellOnTarget(36541,pUnit:GetClosestPlayer()) end function Hatecryer_Rain(pUnit,Event) pUnit:FullCastSpellOnTarget(34017,pUnit:GetClosestPlayer()) end function Hatecryer_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Hatecryer_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (20930, 1, "Hatecryer_OnEnterCombat") RegisterUnitEvent (20930, 2, "Hatecryer_OnLeaveCombat") RegisterUnitEvent (20930, 4, "Hatecryer_OnDied") function Hound_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Hound_Breath",2500,0) pUnit:RegisterEvent("Hound_Stomp",1000,0) end function Hound_Breath(pUnit,Event) pUnit:FullCastSpellOnTarget(36406,pUnit:GetClosestPlayer()) end function Hound_Stomp(pUnit,Event) pUnit:FullCastSpellOnTarget(36405,pUnit:GetClosestPlayer()) end function Hound_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Hound_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (20141, 1, "Hound_OnEnterCombat") RegisterUnitEvent (20141, 2, "Hound_OnLeaveCombat") RegisterUnitEvent (20141, 4, "Hound_OnDied") function Forgelord_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Forgelord_Hammer",1000,0) pUnit:RegisterEvent("Forgelord_Slam",1900,0) pUnit:RegisterEvent("Forgelord_Toughen",1000,0) end function Forgelord_Hammer(pUnit,Event) pUnit:FullCastSpellOnTarget(36251,pUnit:GetClosestPlayer()) end function Forgelord_Slam(pUnit,Event) pUnit:FullCastSpellOnTarget(37179,pUnit:GetClosestPlayer()) end function Forgelord_Toughen(pUnit,Event) pUnit:CastSpell(33962) end function Forgelord_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Forgelord_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (20928, 1, "Forgelord_OnEnterCombat") RegisterUnitEvent (20928, 2, "Forgelord_OnLeaveCombat") RegisterUnitEvent (20928, 4, "Forgelord_OnDied") function Kaylaan_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Kaylaan_Ressurection",4000,0) end function Kaylaan_Ressurection(pUnit,Event) pUnit:CastSpell(35746) end function Kaylaan_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Kaylaan_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (20780, 1, "Kaylaan_OnEnterCombat") RegisterUnitEvent (20780, 2, "Kaylaan_OnLeaveCombat") RegisterUnitEvent (20780, 4, "Kaylaan_OnDied") function Apprentice_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Apprentice_Hammer",1500,0) end function Apprentice_Hammer(pUnit,Event) pUnit:FullCastSpellOnTarget(37554,pUnit:GetClosestPlayer()) end function Apprentice_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Apprentice_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (20409, 1, "Apprentice_OnEnterCombat") RegisterUnitEvent (20409, 2, "Apprentice_OnLeaveCombat") RegisterUnitEvent (20409, 4, "Apprentice_OnDied") function Ghost_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Ghost_Soulbind",2000,0) end function Ghost_Soulbind(pUnit,Event) pUnit:CastSpell(36153) end function Ghost_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Ghost_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (20409, 1, "Ghost_OnEnterCombat") RegisterUnitEvent (20409, 2, "Ghost_OnLeaveCombat") RegisterUnitEvent (20409, 4, "Ghost_OnDied") function Spectre_OnEnterCombat(Unit,Event) Unit:RegisterEvent("Spectre_Curse",1000,0) Unit:RegisterEvent("Spectre_Bolt",3000,0) end function Spectre_Curse(pUnit,Event) pUnit:FullCastSpellOnTarget(11980,pUnit:GetClosestPlayer()) end function Spectre_Bolt(pUnit,Event) pUnit:FullCastSpellOnTarget(9613,pUnit:GetClosestPlayer()) end function Spectre_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Spectre_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (20496, 1, "Spectre_OnEnterCombat") RegisterUnitEvent (20496, 2, "Spectre_OnLeaveCombat") RegisterUnitEvent (20496, 4, "Spectre_OnDied") function Destroyer_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Destroyer_Knock",1000,0) pUnit:RegisterEvent("Destroyer_Strike",1000,0) end function Destroyer_Knock(pUnit,Event) pUnit:FullCastSpellOnTarget(11428,pUnit:GetClosestPlayer()) end function Destroyer_Strike(pUnit,Event) pUnit:FullCastSpellOnTarget(13737,pUnit:GetClosestPlayer()) end function Destroyer_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Destroyer_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (20403, 1, "Destroyer_OnEnterCombat") RegisterUnitEvent (20403, 2, "Destroyer_OnLeaveCombat") RegisterUnitEvent (20403, 4, "Destroyer_OnDied") function Cannon_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Cannon_Blast",3000,0) end function Cannon_Blast(pUnit,Event) pUnit:FullCastSpellOnTarget(36238,pUnit:GetClosestPlayer()) end function Cannon_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Cannon_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (21233, 1, "Cannon_OnEnterCombat") RegisterUnitEvent (21233, 2, "Cannon_OnLeaveCombat") RegisterUnitEvent (21233, 4, "Cannon_OnDied") function Shocktrooper_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Shocktrooper_Rand",1000,0) end function Shocktrooper_Rand(pUnit,Event) pUnit:FullCastSpellOnTarget(35144,pUnit:GetClosestPlayer()) end function Shocktrooper_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Shocktrooper_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (20402, 1, "Shocktrooper_OnEnterCombat") RegisterUnitEvent (20402, 2, "Shocktrooper_OnLeaveCombat") RegisterUnitEvent (20402, 4, "Shocktrooper_OnDied") function Mageslayer_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Mageslayer_Reflection",8000,0) end function Mageslayer_Reflection(pUnit,Event) pUnit:CastSpell(36096) end function Mageslayer_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Mageslayer_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (18866, 1, "Mageslayer_OnEnterCombat") RegisterUnitEvent (18866, 2, "Mageslayer_OnLeaveCombat") RegisterUnitEvent (18866, 4, "Mageslayer_OnDied") function Beast_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Beast_Burn",1000,0) end function Beast_Burn(pUnit,Event) pUnit:FullCastSpellOnTarget(36484,pUnit:GetClosestPlayer()) end function Beast_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Beast_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (21267, 1, "Beast_OnEnterCombat") RegisterUnitEvent (21267, 2, "Beast_OnLeaveCombat") RegisterUnitEvent (21267, 4, "Beast_OnDied") function Seeker_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Seeker_Burn",3000,0) pUnit:RegisterEvent("Seeker_Slow",2000,0) end function Seeker_Burn(pUnit,Event) pUnit:FullCastSpellOnTarget(11981,pUnit:GetClosestPlayer()) end function Seeker_Slow(pUnit,Event) pUnit:FullCastSpellOnTarget(36843,pUnit:GetClosestPlayer()) end function Seeker_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Seeker_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (18867, 1, "Seeker_OnEnterCombat") RegisterUnitEvent (18867, 2, "Seeker_OnLeaveCombat") RegisterUnitEvent (18867, 4, "Seeker_OnDied") function Snapper_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Snapper_DeMaterialize",1000,0) pUnit:RegisterEvent("Snapper_Burn",1000,0) end function Snapper_DeMaterialize(pUnit,Event) pUnit:CastSpell(34814) end function Snapper_Burn(pUnit,Event) pUnit:FullCastSpellOnTarget(37176,pUnit:GetMainTank()) end function Snapper_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Snapper_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (18883, 1, "Snapper_OnEnterCombat") RegisterUnitEvent (18883, 2, "Snapper_OnLeaveCombat") RegisterUnitEvent (18883, 4, "Snapper_OnDied") function Wraith_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Wraith_Mana",2000,0) end function Wraith_Mana(pUnit,Event) pUnit:FullCastSpellOnTarget(29054,pUnit:GetClosestPlayer()) end function Wraith_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Wraith_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (18864, 1, "Wraith_OnEnterCombat") RegisterUnitEvent (18864, 2, "Wraith_OnLeaveCombat") RegisterUnitEvent (18864, 4, "Wraith_OnDied") function Markaru_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Markaru_Spit",2500,0) end function Markaru_Spit(pUnit,Event) pUnit:FullCastSpellOnTarget(36627,pUnit:GetClosestPlayer()) end function Markaru_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Markaru_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (20775, 1, "Markaru_OnEnterCombat") RegisterUnitEvent (20775, 2, "Markaru_OnLeaveCombat") RegisterUnitEvent (20775, 4, "Markaru_OnDied") function Master_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Master_Arrow",1000,0) pUnit:RegisterEvent("Master_Clip",1000,0) pUnit:RegisterEvent("Master_Shoot",1000,0) end function Master_Arrow(pUnit,Event) pUnit:FullCastSpellOnTarget(35964,pUnit:GetClosestPlayer()) end function Master_Clip(pUnit,Event) pUnit:FullCastSpellOnTarget(35963,pUnit:GetClosestPlayer()) end function Master_Shoot(pUnit,Event) pUnit:FullCastSpellOnTarget(6660,pUnit:GetClosestPlayer()) end function Master_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Master_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (19705, 1, "Master_OnEnterCombat") RegisterUnitEvent (19705, 2, "Master_OnLeaveCombat") RegisterUnitEvent (19705, 4, "Master_OnDied") function Doomsmith_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Doomsmith_Doomsaw",1300,0) end function Doomsmith_Doomsaw(pUnit,Event) pUnit:FullCastSpellOnTarget(36200,pUnit:GetClosestPlayer()) end function Doomsmith_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Doomsmith_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (16944, 1, "Doomsmith_OnEnterCombat") RegisterUnitEvent (16944, 2, "Doomsmith_OnLeaveCombat") RegisterUnitEvent (16944, 4, "Doomsmith_OnDied") function WarpMaster_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("WarpMaster_Spray",2000,0) end function WarpMaster_Spray(pUnit,Event) pUnit:FullCastSpellOnTarget(36486,pUnit:GetClosestPlayer()) end function WarpMaster_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function WarpMaster_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (20326, 1, "WarpMaster_OnEnterCombat") RegisterUnitEvent (20326, 2, "WarpMaster_OnLeaveCombat") RegisterUnitEvent (20326, 4, "WarpMaster_OnDied") function Lasher_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Lasher_Growth",1500,0) end function Lasher_Growth(pUnit,Event) pUnit:FullCastSpellOnTarget(36604,pUnit:GetClosestPlayer()) end function Lasher_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Lasher_OnDied(Unit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (20983, 1, "Lasher_OnEnterCombat") RegisterUnitEvent (20983, 2, "Lasher_OnLeaveCombat") RegisterUnitEvent (20983, 4, "Lasher_OnDied") function Dragon_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Dragon_Presence",1000,0) pUnit:RegisterEvent("Dragon_Netherbreath",2500,0) end function Dragon_Presence(pUnit,Event) pUnit:FullCastSpellOnTarget(36513,pUnit:GetClosestPlayer()) end function Dragon_Netherbreath(pUnit,Event) pUnit:FullCastSpellOnTarget(36631,pUnit:GetClosestPlayer()) end function Dragon_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Dragon_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (20332, 1, "Dragon_OnEnterCombat") RegisterUnitEvent (20332, 2, "Dragon_OnLeaveCombat") RegisterUnitEvent (20332, 4, "Dragon_OnDied") function Drake_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Drake_Presence",1000,0) end function Drake_Presence(pUnit,Event) pUnit:FullCastSpellOnTarget(36513,pUnit:GetClosestPlayer()) end function Drake_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Drake_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (18877, 1, "Drake_OnEnterCombat") RegisterUnitEvent (18877, 2, "Drake_OnLeaveCombat") RegisterUnitEvent (18877, 4, "Drake_OnDied") function Ray_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Ray_Drain",1000,0) pUnit:RegisterEvent("Ray_Shock",1000,0) pUnit:RegisterEvent("Ray_Sting",1000,0) end function Ray_Drain(pUnit,Event) pUnit:FullCastSpellOnTarget(17008,pUnit:GetClosestPlayer()) end function Ray_Shock(pUnit,Event) pUnit:FullCastSpellOnTarget(35334,pUnit:GetClosestPlayer()) end function Ray_Sting(pUnit,Event) pUnit:FullCastSpellOnTarget(36659,pUnit:GetClosestPlayer()) end function Ray_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Ray_OnDied(Unit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (18880, 1, "Ray_OnEnterCombat") RegisterUnitEvent (18880, 2, "Ray_OnLeaveCombat") RegisterUnitEvent (18880, 4, "Ray_OnDied") function Grindgarr_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Grindgarr_Flames",5000,0) pUnit:RegisterEvent("Grindgarr_Stomp",4000,0) end function Grindgarr_Flames(pUnit,Event) pUnit:FullCastSpellOnTarget(36487,pUnit:GetClosestPlayer()) end function Grindgarr_Stomp(pUnit,Event) pUnit:FullCastSpellOnTarget(35238,pUnit:GetClosestPlayer()) end function Grindgarr_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Grindgarr_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (20803, 1, "Grindgarr_OnEnterCombat") RegisterUnitEvent (20803, 2, "Grindgarr_OnLeaveCombat") RegisterUnitEvent (20803, 4, "Grindgarr_OnDied") function Athanel_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Athanel_Cleave",4000,0) end function Athanel_Cleave(pUnit,Event) pUnit:FullCastSpellOnTarget(15496,pUnit:GetMainTank()) end function Athanel_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Athanel_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (20435, 1, "Athanel_OnEnterCombat") RegisterUnitEvent (20435, 2, "Athanel_OnLeaveCombat") RegisterUnitEvent (20435, 4, "Athanel_OnDied") function Azarad_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Azarad_Rage",12000,0) end function Azarad_Rage(pUnit,Event) pUnit:CastSpell(35491) end function Azarad_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Azarad_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (20685, 1, "Azarad_OnEnterCombat") RegisterUnitEvent (20685, 2, "Azarad_OnLeaveCombat") RegisterUnitEvent (20685, 4, "Azarad_OnDied") function Seylanna_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Seylanna_Crystal",2000,0) pUnit:RegisterEvent("Seylanna_Beam",4000,0) end function Seylanna_Crystal(pUnit,Event) pUnit:CastSpell(36179) end function Seylanna_Beam(pUnit,Event) pUnit:FullCastSpellOnTarget(35919,pUnit:GetClosestPlayer()) end function Seylanna_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Seylanna_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (20397, 1, "Seylanna_OnEnterCombat") RegisterUnitEvent (20397, 2, "Seylanna_OnLeaveCombat") RegisterUnitEvent (20397, 4, "Seylanna_OnDied") function Theredis_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Theredis_Disarm",8000,0) pUnit:RegisterEvent("Theredis_Breaker",9000,0) end function Theredis_Crystal(pUnit,Event) pUnit:FullCastSpellOnTarget(6713,pUnit:GetMainTank()) end function Theredis_Breaker(pUnit,Event) pUnit:FullCastSpellOnTarget(35871,pUnit:GetMainTank()) end function Theredis_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Theredis_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (20416, 1, "Theredis_OnEnterCombat") RegisterUnitEvent (20416, 2, "Theredis_OnLeaveCombat") RegisterUnitEvent (20416, 4, "Theredis_OnDied") function Beast_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Beast_Rend",15000,0) pUnit:RegisterEvent("Beast_Parasite_Spell",6000,0) pUnit:RegisterEvent("Beast_Parasite_Spawn",36000,0) end function Beast_Rend(pUnit,Event) pUnit:FullCastSpellOnTarget(13443,pUnit:GetMainTank()) end function Beast_Parasite_Spell(pUnit,Event) pUnit:FullCastSpellOnTarget(36469,pUnit:GetRandomPlayer(0)) end function Beast_Parasite_Spawn(pUnit,Event) local x = pUnit:GetX() local y = pUnit:GetY() local z = pUnit:GetZ() local o = pUnit:GetO() pUnit:CastSpell(36468) pUnit:SpawnCreature(21265, x-1, y, z, o, 14, o) end function Beast_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Beast_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(20335,1,"Beast_OnEnterCombat") RegisterUnitEvent(20335,2,"Beast_OnLeaveCombat") RegisterUnitEvent(20335,4,"Beast_OnDied") function Pentatharon_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Pentatharon_Swarm",4000,0) end function Pentatharon_Swarm(pUnit,Event) pUnit:FullCastSpellOnTarget(36039,pUnit:ClosestPlayer()) end function Pentatharon_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Pentatharon_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (20215, 1, "Pentatharon_OnEnterCombat") RegisterUnitEvent (20215, 2, "Pentatharon_OnLeaveCombat") RegisterUnitEvent (20215, 4, "Pentatharon_OnDied") function Hunter_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Hunter_DeMaterialize",8000,0) pUnit:RegisterEvent("Hunter_ManaBurn",3000,0) end function Hunter_DeMaterialize(pUnit,Event) pUnit:CastSpell(34814) pUnit:RegisterEvent("Hunter_Materialize",3000,0) end function Hunter_ManaBurn(pUnit,Event) pUnit:FullCastSpellOnTarget(13321,pUnit:GetClosestPlayer()) end function Hunter_Materialize(pUnit,Event) pUnit:CastSpell(34804) end function Hunter_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Hunter_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (18879, 1, "Hunter_OnEnterCombat") RegisterUnitEvent (18879, 2, "Hunter_OnLeaveCombat") RegisterUnitEvent (18879, 4, "Hunter_OnDied") local cry_delay = 78000 local announces = {} local announcei = 1 local choice = 1 RegisterUnitEvent(19776, 6, "ExperimentalPilot1_Setup") announces[1] = "All my bags are packed, I'm ready to go." function ExperimentalPilot1_Tick(pUnit, Event) choice = math.random(1, announcei) pUnit:SendChatMessage(12, 0, announces[choice]) end function ExperimentalPilot1_Setup(pUnit, Event) pUnit:RegisterEvent("ExperimentalPilot1_Tick", cry_delay, 0) end local cry_delay = 86000 local announces = {} local announcei = 1 local choice = 1 RegisterUnitEvent(19737, 6, "ExperimentalCrew1_Setup") announces[1] = "The ship's not ready yet. We still need to calibrate the fuse length to make sure that it doesn't burn out and leave you up there alone." function ExperimentalCrew1_Tick(pUnit, Event) choice = math.random(1, announcei) pUnit:SendChatMessage(12, 0, announces[choice]) end function ExperimentalCrew1_Setup(pUnit, Event) pUnit:RegisterEvent("ExperimentalCrew1_Tick", cry_delay, 0) end local cry_delay = 94000 local announces = {} local announcei = 1 local choice = 1 RegisterUnitEvent(19776, 6, "ExperimentalPilot2_Setup") announces[1] = "You need to do what? All this science, I don't understand ... Look, this is just my job, five days a week." function ExperimentalPilot2_Tick(pUnit, Event) choice = math.random(1, announcei) pUnit:SendChatMessage(12, 0, announces[choice]) end function ExperimentalPilot2_Setup(pUnit, Event) pUnit:RegisterEvent("ExperimentalPilot2_Tick", cry_delay, 0) end local cry_delay = 102000 local announces = {} local announcei = 1 local choice = 1 RegisterUnitEvent(19737, 6, "ExperimentalCrew2_Setup") announces[1] = "Essentially, it's going to be a long, long time till we are ready to launch. Maybe you should just head back home to your family." function ExperimentalCrew2_Tick(pUnit, Event) choice = math.random(1, announcei) pUnit:SendChatMessage(12, 0, announces[choice]) end function ExperimentalCrew2_Setup(pUnit, Event) pUnit:RegisterEvent("ExperimentalCrew2_Tick", cry_delay, 0) end local cry_delay = 110000 local announces = {} local announcei = 1 local choice = 1 RegisterUnitEvent(19776, 6, "ExperimentalPilot3_Setup") announces[1] = "I can't. I'm not the man they think I am at home. Besides, I didn't bring them out here." function ExperimentalPilot3_Tick(pUnit, Event) choice = math.random(1, announcei) pUnit:SendChatMessage(12, 0, announces[choice]) end function ExperimentalPilot3_Setup(pUnit, Event) pUnit:RegisterEvent("ExperimentalPilot3_Tick", cry_delay, 0) end local cry_delay = 190000 local announces = {} local announcei = 1 local choice = 1 RegisterUnitEvent(19737, 6, "ExperimentalCrew3_Setup") announces[1] = "Why not? A family can give you strength." function ExperimentalCrew3_Tick(pUnit, Event) choice = math.random(1, announcei) pUnit:SendChatMessage(12, 0, announces[choice]) end function ExperimentalCrew3_Setup(pUnit, Event) pUnit:RegisterEvent("ExperimentalCrew3_Tick", cry_delay, 0) end local cry_delay = 270000 local announces = {} local announcei = 1 local choice = 1 RegisterUnitEvent(19776, 6, "ExperimentalPilot4_Setup") announces[1] = "This isn't the kind of place to raise your kids. It's cold, and there'd be no one to raise them." function ExperimentalPilot4_Tick(pUnit, Event) choice = math.random(1, announcei) pUnit:SendChatMessage(12, 0, announces[choice]) end function ExperimentalPilot4_Setup(pUnit, Event) pUnit:RegisterEvent("ExperimentalPilot4_Tick", cry_delay, 0) end local cry_delay = 350000 local announces = {} local announcei = 1 local choice = 1 RegisterUnitEvent(19737, 6, "ExperimentalCrew4_Setup") announces[1] = "Couldn't you raise them?" function ExperimentalCrew4_Tick(pUnit, Event) choice = math.random(1, announcei) pUnit:SendChatMessage(12, 0, announces[choice]) end function ExperimentalCrew4_Setup(pUnit, Event) pUnit:RegisterEvent("ExperimentalCrew4_Tick", cry_delay, 0) end local cry_delay = 430000 local announces = {} local announcei = 1 local choice = 1 RegisterUnitEvent(19776, 6, "ExperimentalPilot5_Setup") announces[1] = "Oh, no, no, no... I'm a rocket man." function ExperimentalPilot5_Tick(pUnit, Event) choice = math.random(1, announcei) pUnit:SendChatMessage(12, 0, announces[choice]) end function ExperimentalPilot5_Setup(pUnit, Event) pUnit:RegisterEvent("ExperimentalPilot5_Tick", cry_delay, 0) end function Porfus_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Porfus_Hamstring",5000,0) end function Porfus_Hamstring(pUnit,Event) pUnit:FullCastSpellOnTarget(31553,pUnit:GetMainTank()) end function Porfus_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Porfus_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (20783, 1, "Porfus_OnEnterCombat") RegisterUnitEvent (20783, 2, "Porfus_OnLeaveCombat") RegisterUnitEvent (20783, 4, "Porfus_OnDied") function Avenger_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Avenger_Claive",4000,0) end function Avenger_Claive(pUnit,Event) pUnit:FullCastSpellOnTarget(36500,pUnit:GetMainTank()) end function Avenger_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Avenger_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (21805, 1, "Avenger_OnEnterCombat") RegisterUnitEvent (21805, 2, "Avenger_OnLeaveCombat") RegisterUnitEvent (21805, 4, "Avenger_OnDied") function Defender_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Defender_Claive",4000,0) pUnit:RegisterEvent("Defender_Hamstring",5000,0) end function Defender_Claive(pUnit,Event) pUnit:FullCastSpellOnTarget(36500,pUnit:GetMainTank()) end function Defender_Hamstring(pUnit,Event) pUnit:FullCastSpellOnTarget(31553,pUnit:GetMainTank()) end function Defender_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Defender_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (20984, 1, "Defender_OnEnterCombat") RegisterUnitEvent (20984, 2, "Defender_OnLeaveCombat") RegisterUnitEvent (20984, 4, "Defender_OnDied") function Regenerator_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Regenerator_Bolt",2500,0) end function Regenerator_Bolt(pUnit,Event) pUnit:FullCastSpellOnTarget(34232,pUnit:ClosestPlayer()) end function Regenerator_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Regenerator_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (21783, 1, "Regenerator_OnEnterCombat") RegisterUnitEvent (21783, 2, "Regenerator_OnLeaveCombat") RegisterUnitEvent (21783, 4, "Regenerator_OnDied") function Rhonsus_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Rhonsus_Smithery",4000,0) end function Rhonsus_Smithery(pUnit,Event) pUnit:FullCastSpellOnTarget(36103,pUnit:ClosestPlayer()) end function Rhonsus_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Rhonsus_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (20410, 1, "Rhonsus_OnEnterCombat") RegisterUnitEvent (20410, 2, "Rhonsus_OnLeaveCombat") RegisterUnitEvent (20410, 4, "Rhonsus_OnDied") function Lynx_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Lynx_Dash",5000,0) pUnit:RegisterEvent("Lynx_Rip",6000,0) pUnit:RegisterEvent("Lynx_Swipe",5000,0) end function Lynx_Dash(pUnit,Event) pUnit:CastSpell(36589) end function Lynx_Rip(pUnit,Event) pUnit:FullCastSpellOnTarget(36590,pUnit:GetMainTank()) end function Lynx_Swipe(pUnit,Event) pUnit:FullCastSpellOnTarget(31279,pUnit:GetMainTank()) end function Lynx_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Lynx_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (20671, 1, "Lynx_OnEnterCombat") RegisterUnitEvent (20671, 2, "Lynx_OnLeaveCombat") RegisterUnitEvent (20671, 4, "Lynx_OnDied") function Raptor_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Raptor_Enrage",20000,0) end function Raptor_Enrage(pUnit,Event) pUnit:CastSpell(8599) end function Raptor_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Raptor_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (20634, 1, "Raptor_OnEnterCombat") RegisterUnitEvent (20634, 2, "Raptor_OnLeaveCombat") RegisterUnitEvent (20634, 4, "Raptor_OnDied") function Sludge_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Sludge_Split",2500,0) end function Sludge_Split(pUnit,Event) pUnit:CastSpell(36465) local x = pUnit:GetX() local y = pUnit:GetY() local z = pUnit:GetZ() local o = pUnit:GetO() pUnit:SpawnCreature(21264, x-1, y, z, o, 14, o) end function Sludge_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Sludge_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (20501, 1, "Sludge_OnEnterCombat") RegisterUnitEvent (20501, 2, "Sludge_OnLeaveCombat") RegisterUnitEvent (20501, 4, "Sludge_OnDied") function Defender_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Defender_Block",1000,(1)) pUnit:RegisterEvent("Defender_Strike",5000,0) end function Defender_Block(pUnit,Event) pUnit:CastSpell(12169) end function Defender_Strike(pUnit,Event) pUnit:FullCastSpellOnTarget(36093,pUnit:GetMainTank()) end function Defender_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Defender_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (20934, 1, "Defender_OnEnterCombat") RegisterUnitEvent (20934, 2, "Defender_OnLeaveCombat") RegisterUnitEvent (20934, 4, "Defender_OnDied") function Spirit_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Spirit_Nova",10000,0) pUnit:RegisterEvent("Spirit_Bolt",4000,0) end function Spirit_Nova(pUnit,Event) pUnit:CastSpell(11831) end function Spirit_Bolt(pUnit,Event) pUnit:FullCastSpellOnTarget(20822,pUnit:GetMainTank()) end function Spirit_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Spirit_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (19881, 1, "Spirit_OnEnterCombat") RegisterUnitEvent (19881, 2, "Spirit_OnLeaveCombat") RegisterUnitEvent (19881, 4, "Spirit_OnDied") function Flayer_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Flayer_Skin",5000,0) end function Flayer_Skin(pUnit,Event) pUnit:CastSpell(36576) end function Flayer_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Flayer_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (20210, 1, "Flayer_OnEnterCombat") RegisterUnitEvent (20210, 2, "Flayer_OnLeaveCombat") RegisterUnitEvent (20210, 4, "Flayer_OnDied") function Moth_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Moth_Dust",10000,0) pUnit:RegisterEvent("Moth_Buffet",2000,0) end function Moth_Dust(pUnit,Event) pUnit:FullCastSpellOnTarget(36592,pUnit:GetMainTank()) end function Moth_Buffet(pUnit,Event) pUnit:FullCastSpellOnTarget(32914,pUnit:GetMainTank()) end function Moth_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Moth_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (20611, 1, "Moth_OnEnterCombat") RegisterUnitEvent (20611, 2, "Moth_OnLeaveCombat") RegisterUnitEvent (20611, 4, "Moth_OnDied") function Stallion_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Stallion_Kick",5000,0) end function Stallion_Kick(pUnit,Event) pUnit:FullCastSpellOnTarget(11978,pUnit:GetMainTank()) end function Stallion_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Stallion_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (20495, 1, "Stallion_OnEnterCombat") RegisterUnitEvent (20495, 2, "Stallion_OnLeaveCombat") RegisterUnitEvent (20495, 4, "Stallion_OnDied") function Dimensius_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Dimensius_Feed",5000,0) end function Dimensius_Feed(pUnit,Event) pUnit:FullCastSpellOnTarget(37450,pUnit:GetMainTank()) end function Dimensius_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Dimensius_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (21780, 1, "Dimensius_OnEnterCombat") RegisterUnitEvent (21780, 2, "Dimensius_OnLeaveCombat") RegisterUnitEvent (21780, 4, "Dimensius_OnDied") function Maryana_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Maryana_Blast",5000,0) pUnit:RegisterEvent("Maryana_Fire",7000,0) pUnit:RegisterEvent("Maryana_Intellect",1000,(1)) end function Maryana_Blast(pUnit,Event) pUnit:CastSpell(37450) end function Maryana_Fire(pUnit,Event) pUnit:CastSpell(15091) end function Maryana_Intellect(pUnit,Event) pUnit:CastSpell(35917) end function Maryana_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Maryana_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (19593, 1, "Maryana_OnEnterCombat") RegisterUnitEvent (19593, 2, "Maryana_OnLeaveCombat") RegisterUnitEvent (19593, 4, "Maryana_OnDied") function Marathelle_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Marathelle_Tempest",4500,0) pUnit:RegisterEvent("Marathelle_Ring",20000,0) end function Marathelle_Tempest(pUnit,Event) pUnit:FullCastSpellOnTarget(35843,pUnit:GetClosestPlayer()) end function Marathelle_Ring(pUnit,Event) pUnit:FullCastSpellOnTarget(35831,pUnit:GetRandomPlayer(0)) end function Marathelle_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Marathelle_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (19926, 1, "Marathelle_OnEnterCombat") RegisterUnitEvent (19926, 2, "Marathelle_OnLeaveCombat") RegisterUnitEvent (19926, 4, "Marathelle_OnDied") function Summoner_Kanthin_OnCombat(pUnit, Event) pUnit:RegisterEvent("Summoner_Kanthin_Fireball", 4000, 0) pUnit:RegisterEvent("Summoner_Kanthin_Nova", 10000, 0) pUnit:RegisterEvent("Summoner_Kanthin_Pyroblast", 7000, 0) end function Summoner_Kanthin_OnLeaveCombat(pUnit, Event) pUnit:RemoveEvents() end function Summoner_Kanthin_OnKillTarget(pUnit, Event) pUnit:RemoveEvents() end function Summoner_Kanthin_OnDeath(pUnit, Event) pUnit:RemoveEvents() end RegisterUnitEvent(19657, 1, "Summoner_Kanthin_OnCombat") RegisterUnitEvent(19657, 2, "Summoner_Kanthin_OnLeaveCombat") RegisterUnitEvent(19657, 3, "Summoner_Kanthin_OnKillTarget") RegisterUnitEvent(19657, 4, "Summoner_Kanthin_OnDeath") function Summoner_Kanthin_Fireball(pUnit, Event) pUnit:FullCastSpellOnTarget(19816,pUnit:GetClosestPlayer()) end function Summoner_Kanthin_Nova(pUnit, Event) pUnit:FullCastSpellOnTarget(19657,pUnit:GetMainTank()) end function Summoner_Kanthin_Pyroblast(pUnit, Event) pUnit:FullCastSpellOnTarget(17273,pUnit:GetClosestPlayer()) end function Sundered_Rumbler_OnCombat(pUnit, Event) pUnit:RegisterEvent("Sundered_Rumbler_Summon_Sundered_Shard", 8000, 0) end function Sundered_Rumbler_OnLeaveCombat(pUnit, Event) pUnit:RemoveEvents() end function Sundered_Rumbler_OnKillTarget(pUnit, Event) pUnit:RemoveEvents() end function Sundered_Rumbler_OnDeath(pUnit, Event) pUnit:RemoveEvents() end RegisterUnitEvent(18881, 1, "Sundered_Rumbler_OnCombat") RegisterUnitEvent(18881, 2, "Sundered_Rumbler_OnLeaveCombat") RegisterUnitEvent(18881, 3, "Sundered_Rumbler_OnKillTarget") RegisterUnitEvent(18881, 4, "Sundered_Rumbler_OnDeath") function Sundered_Rumbler_Summon_Sundered_Shard(pUnit, Event) pUnit:CastSpell(35310) local X = pUnit:GetX() local Y = pUnit:GetY() local Z = pUnit:GetZ() local O = pUnit:GetO() pUnit:SpawnCreature(20498, X, Y, Z, O, 35, 0) end function Sundered_Thunderer_OnCombat(pUnit, Event) pUnit:RegisterEvent("Sundered_Thunderer_Summon_Sundered_Shard", 8000, 0) pUnit:RegisterEvent("Sundered_Thunderer_Thunder_Clap", 6000, 0) end function Sundered_Thunderer_OnLeaveCombat(pUnit, Event) pUnit:RemoveEvents() end function Sundered_Thunderer_OnKillTarget(pUnit, Event) pUnit:RemoveEvents() end function Sundered_Thunderer_OnDeath(pUnit, Event) pUnit:RemoveEvents() end RegisterUnitEvent(18882, 1, "Sundered_Thunderer_OnCombat") RegisterUnitEvent(18882, 2, "Sundered_Thunderer_OnLeaveCombat") RegisterUnitEvent(18882, 3, "Sundered_Thunderer_OnKillTarget") RegisterUnitEvent(18882, 4, "Sundered_Thunderer_OnDeath") function Sundered_Thunderer_Thunder_Clap(pUnit, Event) pUnit:FullCastSpellOnTarget(6000,pUnit:GetMainTank()) end function Sundered_Thunderer_Summon_Sundered_Shard(pUnit, Event) pUnit:CastSpell(35007) local X = pUnit:GetX() local Y = pUnit:GetY() local Z = pUnit:GetZ() local O = pUnit:GetO() pUnit:SpawnCreature(20498, X, Y, Z, O, 35, 0) end function Sunfury_Arcanist_OnCombat(pUnit, Event) pUnit:RegisterEvent("Sunfury_Arcanist_Arcane_Missiles", 6000, 0) pUnit:RegisterEvent("Sunfury_Arcanist_Bloodcrystal_Surge", 10000, 0) end function Sunfury_Arcanist_OnLeaveCombat(pUnit, Event) pUnit:RemoveEvents() end function Sunfury_Arcanist_OnKillTarget(pUnit, Event) pUnit:RemoveEvents() end function Sunfury_Arcanist_OnDeath(pUnit, Event) pUnit:RemoveEvents() end RegisterUnitEvent(20134, 1, "Sunfury_Arcanist_OnCombat") RegisterUnitEvent(20134, 2, "Sunfury_Arcanist_OnLeaveCombat") RegisterUnitEvent(20134, 3, "Sunfury_Arcanist_OnKillTarget") RegisterUnitEvent(20134, 4, "Sunfury_Arcanist_OnDeath") function Sunfury_Arcanist_Arcane_Missiles(pUnit, Event) pUnit:FullCastSpellOnTarget(34447,pUnit:GetMainTank()) end function Sunfury_Arcanist_Bloodcrystal_Surge(pUnit, Event) pUnit:CastSpell(35778) end function Sunfury_Arch_Mage_OnCombat(pUnit, Event) pUnit:RegisterEvent("Sunfury_Arch_Mage_Nova", 10000, 0) pUnit:RegisterEvent("Sunfury_Arch_Mage_Fiery_Intellect", 1000, (1)) pUnit:RegisterEvent("Sunfury_Arch_Mage_Fireball", 4000, 0) end function Sunfury_Arch_Mage_OnLeaveCombat(pUnit, Event) pUnit:RemoveEvents() end function Sunfury_Arch_Mage_OnKillTarget(pUnit, Event) pUnit:RemoveEvents() end function Sunfury_Arch_Mage_OnDeath(pUnit, Event) pUnit:RemoveEvents() end RegisterUnitEvent(20135, 1, "Sunfury_Arch_Mage_OnCombat") RegisterUnitEvent(20135, 2, "Sunfury_Arch_Mage_OnLeaveCombat") RegisterUnitEvent(20135, 3, "Sunfury_Arch_Mage_OnKillTarget") RegisterUnitEvent(20135, 4, "Sunfury_Arch_Mage_OnDeath") function Sunfury_Arch_Mage_Nova(pUnit, Event) pUnit:CastSpell(11831) end function Sunfury_Arch_Mage_Fiery_Intellect(pUnit, Event) pUnit:CastSpell(35917) end function Sunfury_Arch_Mage_Fireball(pUnit, Event) pUnit:FullCastSpellOnTarget(20823,pUnit:GetMainTank()) end function Sunfury_Archer_OnCombat(Unit, Event) Unit:RegisterEvent("Sunfury_Archer_Net", 8000, 0) Unit:RegisterEvent("Sunfury_Archer_Immolation_Arrow", 6000, 0) Unit:RegisterEvent("Sunfury_Archer_Shoot", 6000, 0) end function Sunfury_Archer_Immolation_Arrow(pUnit, Event) pUnit:FullCastSpellOnTarget(37847, pUnit:GetMainTank()) end function Sunfury_Archer_Net(pUnit, Event) pUnit:FullCastSpellOnTarget(12024, pUnit:GetMainTank()) end function Sunfury_Archer_Shoot(pUnit, Event) pUnit:FullCastSpellOnTarget(6660, pUnit:GetMainTank()) end function Sunfury_Archer_OnLeaveCombat(Unit, Event) Unit:RemoveEvents() end function Sunfury_Archer_OnDied(Unit, Event) Unit:RemoveEvents() end function Sunfury_Archer_OnKilledTarget(Unit, Event) end RegisterUnitEvent(19707, 1, "Sunfury_Archer_OnCombat") RegisterUnitEvent(19707, 2, "Sunfury_Archer_OnLeaveCombat") RegisterUnitEvent(19707, 3, "Sunfury_Archer_OnKilledTarget") RegisterUnitEvent(19707, 4, "Sunfury_Archer_OnDied") function Astromancer_OnCombat(Unit, Event) Unit:RegisterEvent("Astromancer_Focus", 6000, 0) Unit:RegisterEvent("Astromancer_Intellect", 1000, 1) Unit:RegisterEvent("Astromancer_Scorch", 4000, 0) end function Astromancer_Focus(pUnit, Event) pUnit:CastSpell(35914) end function Astromancer_Intellect(pUnit, Event) pUnit:CastSpell(35917) end function Astromancer_Scorch(pUnit, Event) pUnit:FullCastSpellOnTarget(38391, pUnit:GetMainTank()) end function Astromancer_OnLeaveCombat(Unit, Event) Unit:RemoveEvents() end function Astromancer_OnDied(Unit, Event) Unit:RemoveEvents() end function Astromancer_OnKilledTarget(Unit, Event) end RegisterUnitEvent(19643, 1, "Astromancer_OnCombat") RegisterUnitEvent(19643, 2, "Astromancer_OnLeaveCombat") RegisterUnitEvent(19643, 3, "Astromancer_OnKilledTarget") RegisterUnitEvent(19643, 4, "Astromancer_OnDied") function Knight_OnCombat(Unit, Event) end function Knight_Heal(pUnit, Event) pUnit:CastSpell(36476) end function Knight_Enrage(pUnit, Event) pUnit:CastSpell(8599) end function Knight_Breaker(pUnit, Event) pUnit:FullCastSpellOnTarget(35871, pUnit:GetMainTank()) end function Knight_OnLeaveCombat(Unit, Event) Unit:RemoveEvents() end function Knight_OnDied(Unit, Event) Unit:RemoveEvents() end function Knight_OnKilledTarget(Unit, Event) end RegisterUnitEvent(21089, 1, "Knight_OnCombat") RegisterUnitEvent(21089, 2, "Knight_OnLeaveCombat") RegisterUnitEvent(21089, 3, "Knight_OnKilledTarget") RegisterUnitEvent(21089, 4, "Knight_OnDied") function Bloodwarder_OnCombat(Unit, Event) Unit:RegisterEvent("Bloodwarder_Enrage", 25000, 1) Unit:RegisterEvent("Bloodwarder_Mark", 10000, 0) end function Bloodwarder_Enrage(pUnit, Event) pUnit:CastSpell(8599) end function Bloodwarder_Mark(pUnit, Event) pUnit:FullCastSpellOnTarget(35877, pUnit:GetMainTank()) end function Bloodwarder_OnLeaveCombat(Unit, Event) Unit:RemoveEvents() end function Bloodwarder_OnDied(Unit, Event) Unit:RemoveEvents() end function Bloodwarder_OnKilledTarget(Unit, Event) end RegisterUnitEvent(18853, 1, "Bloodwarder_OnCombat") RegisterUnitEvent(18853, 2, "Bloodwarder_OnLeaveCombat") RegisterUnitEvent(18853, 3, "Bloodwarder_OnKilledTarget") RegisterUnitEvent(18853, 4, "Bloodwarder_OnDied") function Sunfury_Bowman_OnCombat(Unit, Event) Unit:RegisterEvent("Sunfury_Bowman_Net", 8000, 0) Unit:RegisterEvent("Sunfury_Bowman_Immolation_Arrow", 6000, 0) Unit:RegisterEvent("Sunfury_Bowman_Shoot", 6000, 0) end function Sunfury_Bowman_Immolation_Arrow(pUnit, Event) pUnit:FullCastSpellOnTarget(37847, pUnit:GetMainTank()) end function Sunfury_Bowman_Net(pUnit, Event) pUnit:FullCastSpellOnTarget(12024, pUnit:GetMainTank()) end function Sunfury_Bowman_Shoot(pUnit, Event) pUnit:FullCastSpellOnTarget(6660, pUnit:GetMainTank()) end function Sunfury_Bowman_OnLeaveCombat(Unit, Event) Unit:RemoveEvents() end function Sunfury_Bowman_OnDied(Unit, Event) Unit:RemoveEvents() end function Sunfury_Bowman_OnKilledTarget(Unit, Event) end RegisterUnitEvent(20207, 1, "Sunfury_Bowman_OnCombat") RegisterUnitEvent(20207, 2, "Sunfury_Bowman_OnLeaveCombat") RegisterUnitEvent(20207, 3, "Sunfury_Bowman_OnKilledTarget") RegisterUnitEvent(20207, 4, "Sunfury_Bowman_OnDied") function Captain_OnCombat(Unit, Event) Unit:RegisterEvent("Captain_Shout", 1000, 3) Unit:RegisterEvent("Captain_Enrage", 25000, 1) Unit:RegisterEvent("Captain_Breaker", 10000, 0) Unit:RegisterEvent("Captain_Breaker", 10000, 0) end function Captain_Shout(pUnit, Event) pUnit:CastSpellOnTarget(32064, pUnit:GetRandomFriend(0)) end function Captain_Enrage(pUnit, Event) pUnit:CastSpell(8599) end function Captain_Breaker(pUnit, Event) pUnit:CastSpell(35871) end function Captain_OnLeaveCombat(Unit, Event) Unit:RemoveEvents() end function Captain_OnDied(Unit, Event) Unit:RemoveEvents() end function Captain_OnKilledTarget(Unit, Event) end RegisterUnitEvent(19453, 1, "Captain_OnCombat") RegisterUnitEvent(19453, 2, "Captain_OnLeaveCombat") RegisterUnitEvent(19453, 3, "Captain_OnKilledTarget") RegisterUnitEvent(19453, 4, "Captain_OnDied") function Centurion_OnCombat(Unit, Event) Unit:RegisterEvent("Centurion_Enrage", 25000, 1) Unit:RegisterEvent("Centurion_Breaker", 10000, 0) end function Centurion_Enrage(pUnit, Event) pUnit:CastSpell(8599) end function Centurion_Breaker(pUnit, Event) pUnit:CastSpell(35871) end function Centurion_OnLeaveCombat(Unit, Event) Unit:RemoveEvents() end function Centurion_OnDied(Unit, Event) Unit:RemoveEvents() end function Centurion_OnKilledTarget(Unit, Event) end RegisterUnitEvent(20140, 1, "Centurion_OnCombat") RegisterUnitEvent(20140, 2, "Centurion_OnLeaveCombat") RegisterUnitEvent(20140, 3, "Centurion_OnKilledTarget") RegisterUnitEvent(20140, 4, "Centurion_OnDied") function Conjurer_OnCombat(Unit, Event) Unit:RegisterEvent("Conjurer_Surge", 10000, 0) Unit:RegisterEvent("Conjurer_Flamestrike", 8000, 0) Unit:RegisterEvent("Conjurer_Frostbolt", 6000, 0) end function Conjurer_Surge(pUnit, Event) pUnit:CastSpell(35778) end function Conjurer_Flamestrike(pUnit, Event) pUnit:FullCastSpellOnTarget(11829, pUnit:GetMainTank()) end function Conjurer_Frostbolt(pUnit, Event) pUnit:FullCastSpellOnTarget(9672, pUnit:GetMainTank()) end function Conjurer_OnLeaveCombat(Unit, Event) Unit:RemoveEvents() end function Conjurer_OnDied(Unit, Event) Unit:RemoveEvents() end function Conjurer_OnKilledTarget(Unit, Event) end RegisterUnitEvent(20139, 1, "Conjurer_OnCombat") RegisterUnitEvent(20139, 2, "Conjurer_OnLeaveCombat") RegisterUnitEvent(20139, 3, "Conjurer_OnKilledTarget") RegisterUnitEvent(20139, 4, "Conjurer_OnDied") function Flamekeeper_OnCombat(Unit, Event) Unit:RegisterEvent("Flamekeeper_Enrage", 25000, 0) Unit:RegisterEvent("Flamekeeper_Flame", 10000, 0) Unit:RegisterEvent("Flamekeeper_Torch", 5000, 0) end function Flamekeeper_Enrage(pUnit, Event) pUnit:CastSpell(8599) end function Flamekeeper_Flame(pUnit, Event) pUnit:FullCastSpellOnTarget(33731, pUnit:GetMainTank()) end function Flamekeeper_Torch(pUnit, Event) pUnit:FullCastSpellOnTarget(35857, pUnit:GetMainTank()) end function Flamekeeper_OnLeaveCombat(Unit, Event) Unit:RemoveEvents() end function Flamekeeper_OnDied(Unit, Event) Unit:RemoveEvents() end function Flamekeeper_OnKilledTarget(Unit, Event) end RegisterUnitEvent(20221, 1, "Flamekeeper_OnCombat") RegisterUnitEvent(20221, 2, "Flamekeeper_OnLeaveCombat") RegisterUnitEvent(20221, 3, "Flamekeeper_OnKilledTarget") RegisterUnitEvent(20221, 4, "Flamekeeper_OnDied") function Geologist_OnCombat(Unit, Event) Unit:RegisterEvent("Geologist_Armor", 10000, 0) Unit:RegisterEvent("Geologist_Rock", 6000, 0) end function Geologist_Armor(pUnit, Event) pUnit:FullCastSpellOnTarget(35918, pUnit:GetMainTank()) end function Geologist_Rock(pUnit, Event) pUnit:FullCastSpellOnTarget(36645, pUnit:GetMainTank()) end function Geologist_OnLeaveCombat(Unit, Event) Unit:RemoveEvents() end function Geologist_OnDied(Unit, Event) Unit:RemoveEvents() end function Geologist_OnKilledTarget(Unit, Event) end RegisterUnitEvent(19779, 1, "Geologist_OnCombat") RegisterUnitEvent(19779, 2, "Geologist_OnLeaveCombat") RegisterUnitEvent(19779, 3, "Geologist_OnKilledTarget") RegisterUnitEvent(19779, 4, "Geologist_OnDied") function Guardsman_OnCombat(Unit, Event) Unit:RegisterEvent("Guardsman_Enrage", 25000, 0) Unit:RegisterEvent("Guardsman_Mark", 10000, 0) end function Guardsman_Enrage(pUnit, Event) pUnit:CastSpell(8599) end function Guardsman_Mark(pUnit, Event) pUnit:FullCastSpellOnTarget(35877, pUnit:GetMainTank()) end function Guardsman_OnLeaveCombat(Unit, Event) Unit:RemoveEvents() end function Guardsman_OnDied(Unit, Event) Unit:RemoveEvents() end function Guardsman_OnKilledTarget(Unit, Event) end RegisterUnitEvent(18850, 1, "Guardsman_OnCombat") RegisterUnitEvent(18850, 2, "Guardsman_OnLeaveCombat") RegisterUnitEvent(18850, 3, "Guardsman_OnKilledTarget") RegisterUnitEvent(18850, 4, "Guardsman_OnDied") function Magister_OnCombat(Unit, Event) Unit:RegisterEvent("Magister_Fireball", 6000, 0) Unit:RegisterEvent("Magister_Surge", 10000, 0) end function Magister_Fireball(pUnit, Event) pUnit:FullCastSpellOnTarget(9053, pUnit:GetMainTank()) end function Magister_Surge(pUnit, Event) pUnit:CastSpell(35778) end function Magister_OnLeaveCombat(Unit, Event) Unit:RemoveEvents() end function Magister_OnDied(Unit, Event) Unit:RemoveEvents() end function Magister_OnKilledTarget(Unit, Event) end RegisterUnitEvent(18855, 1, "Magister_OnCombat") RegisterUnitEvent(18855, 2, "Magister_OnLeaveCombat") RegisterUnitEvent(18855, 3, "Magister_OnKilledTarget") RegisterUnitEvent(18855, 4, "Magister_OnDied") function Nethermancer_OnCombat(Unit, Event) Unit:RegisterEvent("Nethermancer_Surge", 10000, 0) Unit:RegisterEvent("Nethermancer_Bolt", 5000, 0) Unit:RegisterEvent("Nethermance_Summon",20000,0) end function Nethermancer_Surge(pUnit, Event) pUnit:CastSpell(35778) end function Nethermance_Summon(pUnit,Event) local x = pUnit:GetX() local y = pUnit:GetY() local z = pUnit:GetZ() local o = pUnit:GetO() pUnit:CastSpell(36477) pUnit:SpawnCreature(21267, x-1, y, z, o, 14, o) end function Nethermancer_Bolt(pUnit, Event) pUnit:FullCastSpellOnTarget(9613, pUnit:GetMainTank()) end function Nethermancer_OnLeaveCombat(Unit, Event) Unit:RemoveEvents() end function Nethermancer_OnDied(Unit, Event) Unit:RemoveEvents() end function Nethermancer_OnKilledTarget(Unit, Event) end RegisterUnitEvent(20248, 1, "Nethermancer_OnCombat") RegisterUnitEvent(20248, 2, "Nethermancer_OnLeaveCombat") RegisterUnitEvent(20248, 3, "Nethermancer_OnKilledTarget") RegisterUnitEvent(20248, 4, "Nethermancer_OnDied") function Researcher_OnCombat(Unit, Event) Unit:RegisterEvent("Researcher_Armor", 6000, 0) end function Researcher_Armor(pUnit, Event) pUnit:FullCastSpellOnTarget(35918, pUnit:GetMainTank()) end function Researcher_OnLeaveCombat(Unit, Event) Unit:RemoveEvents() end function Researcher_OnDied(Unit, Event) Unit:RemoveEvents() end function Researcher_OnKilledTarget(Unit, Event) end RegisterUnitEvent(20136, 1, "Researcher_OnCombat") RegisterUnitEvent(20136, 2, "Researcher_OnLeaveCombat") RegisterUnitEvent(20136, 3, "Researcher_OnKilledTarget") RegisterUnitEvent(20136, 4, "Researcher_OnDied") function Engineer_OnCombat(Unit, Event) Unit:RegisterEvent("Engineer_Beam", 6000, 0) end function Engineer_Beam(pUnit, Event) pUnit:FullCastSpellOnTarget(35919, pUnit:GetMainTank()) end function Engineer_OnLeaveCombat(Unit, Event) Unit:RemoveEvents() end function Engineer_OnDied(Unit, Event) Unit:RemoveEvents() end function Engineer_OnKilledTarget(Unit, Event) end RegisterUnitEvent(18852, 1, "Engineer_OnCombat") RegisterUnitEvent(18852, 2, "Engineer_OnLeaveCombat") RegisterUnitEvent(18852, 3, "Engineer_OnKilledTarget") RegisterUnitEvent(18852, 4, "Engineer_OnDied") function Master_OnCombat(Unit, Event) Unit:RegisterEvent("Master_Beam", 6000, 0) end function Master_Beam(pUnit, Event) pUnit:FullCastSpellOnTarget(35919, pUnit:GetMainTank()) end function Master_OnLeaveCombat(Unit, Event) Unit:RemoveEvents() end function Master_OnDied(Unit, Event) Unit:RemoveEvents() end function Master_OnKilledTarget(Unit, Event) end RegisterUnitEvent(18857, 1, "Master_OnCombat") RegisterUnitEvent(18857, 2, "Master_OnLeaveCombat") RegisterUnitEvent(18857, 3, "Master_OnKilledTarget") RegisterUnitEvent(18857, 4, "Master_OnDied") function Shredder_OnCombat(Unit, Event) Unit:RegisterEvent("Shredder_Blast", 6000, 0) Unit:RegisterEvent("Shredder_Shield", 1000, 1) end function Shredder_Blast(pUnit, Event) pUnit:FullCastSpellOnTarget(36594, pUnit:GetMainTank()) end function Shredder_Shield(pUnit, Event) pUnit:CastSpell(19514) end function Shredder_OnLeaveCombat(Unit, Event) Unit:RemoveEvents() end function Shredder_OnDied(Unit, Event) Unit:RemoveEvents() end function Shredder_OnKilledTarget(Unit, Event) end RegisterUnitEvent(20673, 1, "Shredder_OnCombat") RegisterUnitEvent(20673, 2, "Shredder_OnLeaveCombat") RegisterUnitEvent(20673, 3, "Shredder_OnKilledTarget") RegisterUnitEvent(20673, 4, "Shredder_OnDied") function Doe_OnCombat(Unit, Event) Unit:RegisterEvent("Doe_Gore", 5000, 0) end function Doe_Gore(pUnit, Event) pUnit:FullCastSpellOnTarget(32019, pUnit:GetMainTank()) end function Doe_OnLeaveCombat(Unit, Event) Unit:RemoveEvents() end function Doe_OnDied(Unit, Event) Unit:RemoveEvents() end function Doe_OnKilledTarget(Unit, Event) end RegisterUnitEvent(20610, 1, "Doe_OnCombat") RegisterUnitEvent(20610, 2, "Doe_OnLeaveCombat") RegisterUnitEvent(20610, 3, "Doe_OnKilledTarget") RegisterUnitEvent(20610, 4, "Doe_OnDied") function Sire_OnCombat(Unit, Event) Unit:RegisterEvent("Sire_Stomp", 6000, 0) end function Sire_Stomp(pUnit, Event) pUnit:FullCastSpellOnTarget(32023, pUnit:GetMainTank()) end function Sire_OnLeaveCombat(Unit, Event) Unit:RemoveEvents() end function Sire_OnDied(Unit, Event) Unit:RemoveEvents() end function Sire_OnKilledTarget(Unit, Event) end RegisterUnitEvent(20777, 1, "Sire_OnCombat") RegisterUnitEvent(20777, 2, "Sire_OnLeaveCombat") RegisterUnitEvent(20777, 3, "Sire_OnKilledTarget") RegisterUnitEvent(20777, 4, "Sire_OnDied") function Protector_OnCombat(Unit, Event) Unit:RegisterEvent("Protector_Cleave", 7000, 0) Unit:RegisterEvent("Protector_Flames", 5000, 0) end function Protector_Cleave(pUnit, Event) pUnit:FullCastSpellOnTarget(15496, pUnit:GetMainTank()) end function Protector_Flames(pUnit, Event) pUnit:FullCastSpellOnTarget(37488, pUnit:GetMainTank()) end function Protector_OnLeaveCombat(Unit, Event) Unit:RemoveEvents() end function Protector_OnDied(Unit, Event) Unit:RemoveEvents() end function Protector_OnKilledTarget(Unit, Event) end RegisterUnitEvent(21923, 1, "Protector_OnCombat") RegisterUnitEvent(21923, 2, "Protector_OnLeaveCombat") RegisterUnitEvent(21923, 3, "Protector_OnKilledTarget") RegisterUnitEvent(21923, 4, "Protector_OnDied") function Citizen_OnCombat(Unit, Event) Unit:RegisterEvent("Citizen_Curse", 1000, 1) Unit:RegisterEvent("Citizen_Bolt", 6000, 0) Unit:RegisterEvent("Citizen_Immune", 6000, 0) end function Citizen_Curse(pUnit, Event) pUnit:FullCastSpellOnTarget(11980, pUnit:GetMainTank()) end function Citizen_Bolt(pUnit, Event) pUnit:FullCastSpellOnTarget(9613, pUnit:GetMainTank()) end function Citizen_Immune(pUnit, Event) pUnit:FullCastSpellOnTarget(36153, pUnit:GetMainTank()) end function Citizen_OnLeaveCombat(Unit, Event) Unit:RemoveEvents() end function Citizen_OnDied(Unit, Event) Unit:RemoveEvents() end function Citizen_OnKilledTarget(Unit, Event) end RegisterUnitEvent(21065, 1, "Citizen_OnCombat") RegisterUnitEvent(21065, 2, "Citizen_OnLeaveCombat") RegisterUnitEvent(21065, 3, "Citizen_OnKilledTarget") RegisterUnitEvent(21065, 4, "Citizen_OnDied") function Soul_OnCombat(Unit, Event) Unit:RegisterEvent("Soul_Immune", 6000, 0) end function Soul_Immune(pUnit, Event) pUnit:FullCastSpellOnTarget(36153, pUnit:GetMainTank()) end function Soul_OnLeaveCombat(Unit, Event) Unit:RemoveEvents() end function Soul_OnDied(Unit, Event) Unit:RemoveEvents() end function Soul_OnKilledTarget(Unit, Event) end RegisterUnitEvent(20512, 1, "Soul_OnCombat") RegisterUnitEvent(20512, 2, "Soul_OnLeaveCombat") RegisterUnitEvent(20512, 3, "Soul_OnKilledTarget") RegisterUnitEvent(20512, 4, "Soul_OnDied") function Tyrantus_OnCombat(Unit, Event) Unit:RegisterEvent("Tyrantus_Wood", 7000, 0) Unit:RegisterEvent("Tyrantus_Fear", 6000, 0) end function Tyrantus_Wood(pUnit, Event) pUnit:FullCastSpellOnTarget(35321, pUnit:GetMainTank()) end function Tyrantus_Fear(pUnit, Event) pUnit:FullCastSpellOnTarget(36629, pUnit:GetClosestPlayer()) end function Tyrantus_OnLeaveCombat(Unit, Event) Unit:RemoveEvents() end function Tyrantus_OnDied(Unit, Event) Unit:RemoveEvents() end function Tyrantus_OnKilledTarget(Unit, Event) end RegisterUnitEvent(20931, 1, "Tyrantus_OnCombat") RegisterUnitEvent(20931, 2, "Tyrantus_OnLeaveCombat") RegisterUnitEvent(20931, 3, "Tyrantus_OnKilledTarget") RegisterUnitEvent(20931, 4, "Tyrantus_OnDied") function Voidwraith_OnCombat(Unit, Event) Unit:RegisterEvent("Voidwraith_Spawn", 6000, 0) Unit:RegisterEvent("Voidwraith_Summon", 15000,0) end function Voidwraith_Spawn(pUnit, Event) pUnit:CastSpell(34302) end function Voidwraith_Summon(pUnit,Event) local x = pUnit:GetX() local y = pUnit:GetY() local z = pUnit:GetZ() local o = pUnit:GetO() pUnit:CastSpell(36463) pUnit:SpawnCreature(17471, x-1, y, z, o, 14, o) end function Voidwraith_OnLeaveCombat(Unit, Event) Unit:RemoveEvents() end function Voidwraith_OnDied(Unit, Event) Unit:RemoveEvents() end function Voidwraith_OnKilledTarget(Unit, Event) end RegisterUnitEvent(18869, 1, "Voidwraith_OnCombat") RegisterUnitEvent(18869, 2, "Voidwraith_OnLeaveCombat") RegisterUnitEvent(18869, 3, "Voidwraith_OnKilledTarget") RegisterUnitEvent(18869, 4, "Voidwraith_OnDied") function Veronia_OnCombat(Unit, Event) Unit:RegisterEvent("Veronia_Fight", 8000, 0) end function Veronia_Fight(pUnit, Event) pUnit:CastSpell(34905) end function Veronia_OnLeaveCombat(Unit, Event) Unit:RemoveEvents() end function Veronia_OnDied(Unit, Event) Unit:RemoveEvents() end function Veronia_OnKilledTarget(Unit, Event) end RegisterUnitEvent(20162, 1, "Veronia_OnCombat") RegisterUnitEvent(20162, 2, "Veronia_OnLeaveCombat") RegisterUnitEvent(20162, 3, "Veronia_OnKilledTarget") RegisterUnitEvent(20162, 4, "Veronia_OnDied") function Conduit_OnCombat(Unit, Event) Unit:RegisterEvent("Conduit_Dummy", 9000, 0) end function Conduit_Dummy(pUnit, Event) pUnit:FullCastSpellOnTarget(36780, pUnit:GetMainTank()) end function Conduit_OnLeaveCombat(Unit, Event) Unit:RemoveEvents() end function Conduit_OnDied(Unit, Event) Unit:RemoveEvents() end RegisterUnitEvent(20899, 1, "Conduit_OnCombat") RegisterUnitEvent(20899, 2, "Conduit_OnLeaveCombat") RegisterUnitEvent(20899, 3, "Conduit_OnKilledTarget") RegisterUnitEvent(20899, 4, "Conduit_OnDied") function Waste_OnCombat(Unit, Event) Unit:RegisterEvent("Waste_Toxic", 3000, 0) end function Waste_Toxic(pUnit, Event) pUnit:FullCastSpellOnTarget(36519, pUnit:GetMainTank()) end function Waste_OnLeaveCombat(Unit, Event) Unit:RemoveEvents() end function Waste_OnDied(Unit, Event) Unit:RemoveEvents() end function Waste_OnKilledTarget(Unit, Event) end RegisterUnitEvent(20778, 1, "Waste_OnCombat") RegisterUnitEvent(20778, 2, "Waste_OnLeaveCombat") RegisterUnitEvent(20778, 3, "Waste_OnKilledTarget") RegisterUnitEvent(20778, 4, "Waste_OnDied") function Voidshrieker_OnCombat(Unit, Event) Unit:RegisterEvent("Voidshrieker_Spawn", 8000, 0) Unit:RegisterEvent("Voidshrieker_Bolt", 6000, 0) end function Voidshrieker_Spawn(pUnit, Event) pUnit:CastSpell(34302) end function Voidshrieker_Bolt(pUnit, Event) pUnit:FullCastSpellOnTarget(34344, pUnit:GetMainTank()) end function Voidshrieker_OnLeaveCombat(Unit, Event) Unit:RemoveEvents() end function Voidshrieker_OnDied(Unit, Event) Unit:RemoveEvents() end function Voidshrieker_OnKilledTarget(Unit, Event) end RegisterUnitEvent(18870, 1, "Voidshrieker_OnCombat") RegisterUnitEvent(18870, 2, "Voidshrieker_OnLeaveCombat") RegisterUnitEvent(18870, 3, "Voidshrieker_OnKilledTarget") RegisterUnitEvent(18870, 4, "Voidshrieker_OnDied") function Aberration_OnCombat(Unit, Event) Unit:RegisterEvent("Aberration_Shield", 1000, 1) Unit:RegisterEvent("Aberration_Storm", 20000, 0) end function Aberration_Shield(pUnit, Event) pUnit:CastSpell(36640) end function Aberration_Storm(pUnit, Event) local x = pUnit:GetX() local y = pUnit:GetY() local z = pUnit:GetZ() local o = pUnit:GetO() pUnit:CastSpell(36577) pUnit:SpawnCreature(21322, x-1, y, z, o, 14, o) end function Aberration_OnLeaveCombat(Unit, Event) Unit:RemoveEvents() end function Aberration_OnDied(Unit, Event) Unit:RemoveEvents() end function Aberration_OnKilledTarget(Unit, Event) end RegisterUnitEvent(18865, 1, "Aberration_OnCombat") RegisterUnitEvent(18865, 2, "Aberration_OnLeaveCombat") RegisterUnitEvent(18865, 3, "Aberration_OnKilledTarget") RegisterUnitEvent(18865, 4, "Aberration_OnDied") function Chaser_OnCombat(Unit, Event) Unit:RegisterEvent("Chaser_Invisible", 15000, 0) Unit:RegisterEvent("Chaser_Bite", 4000, 0) Unit:RegisterEvent("Chaser_Warp", 7000, 0) Unit:RegisterEvent("Chaser_WarpCharge", 5000, 0) end function Chaser_Invisible(pUnit, Event) pUnit:CastSpell(32943) end function Chaser_Bite(pUnit, Event) pUnit:FullCastSpellOnTarget(32739, pUnit:GetMainTank()) end function Chaser_Warp(pUnit, Event) pUnit:CastSpell(32920) end function Chaser_WarpCharge(pUnit, Event) pUnit:FullCastSpellOnTarget(37417, pUnit:GetMainTank()) end function Chaser_OnLeaveCombat(Unit, Event) Unit:RemoveEvents() end function Chaser_OnDied(Unit, Event) Unit:RemoveEvents() end function Chaser_OnKilledTarget(Unit, Event) end RegisterUnitEvent(18884, 1, "Chaser_OnCombat") RegisterUnitEvent(18884, 2, "Chaser_OnLeaveCombat") RegisterUnitEvent(18884, 3, "Chaser_OnKilledTarget") RegisterUnitEvent(18884, 4, "Chaser_OnDied") function Icoshock_OnCombat(Unit, Event) Unit:RegisterEvent("Icoshock_Surge", 7000, 0) Unit:RegisterEvent("Icoshock_Drain", 1000, 1) end function Icoshock_Surge(pUnit, Event) pUnit:FullCastSpellOnTarget(36517, pUnit:GetMainTank()) end function Icoshock_Drain(pUnit, Event) pUnit:CastSpell(36515) end function Icoshock_OnLeaveCombat(Unit, Event) Unit:RemoveEvents() end function Icoshock_OnDied(Unit, Event) Unit:RemoveEvents() end function Icoshock_OnKilledTarget(Unit, Event) end RegisterUnitEvent(20770, 1, "Icoshock_OnCombat") RegisterUnitEvent(20770, 2, "Icoshock_OnLeaveCombat") RegisterUnitEvent(20770, 3, "Icoshock_OnKilledTarget") RegisterUnitEvent(20770, 4, "Icoshock_OnDied") function Monstrosity_OnCombat(Unit, Event) Unit:RegisterEvent("Monstrosity_Arcane", 6000, 0) Unit:RegisterEvent("Monstrosity_Storm", 20000, 0) end function Monstrosity_Arcane(pUnit, Event) pUnit:FullCastSpellOnTarget(13901, pUnit:GetMainTank()) end function Monstrosity_Storm(pUnit, Event) local x = pUnit:GetX() local y = pUnit:GetY() local z = pUnit:GetZ() local o = pUnit:GetO() pUnit:CastSpell(36577) pUnit:SpawnCreature(21322, x-1, y, z, o, 14, o) end function Monstrosity_OnLeaveCombat(Unit, Event) Unit:RemoveEvents() end function Monstrosity_OnDied(Unit, Event) Unit:RemoveEvents() end function Monstrosity_OnKilledTarget(Unit, Event) end RegisterUnitEvent(20516, 1, "Monstrosity_OnCombat") RegisterUnitEvent(20516, 2, "Monstrosity_OnLeaveCombat") RegisterUnitEvent(20516, 3, "Monstrosity_OnKilledTarget") RegisterUnitEvent(20516, 4, "Monstrosity_OnDied") function Engineer_OnCombat(Unit, Event) Unit:RegisterEvent("Engineer_Swipe", 6000, 0) end function Engineer_Swipe(pUnit, Event) pUnit:FullCastSpellOnTarget(35147, pUnit:GetMainTank()) end function Engineer_OnLeaveCombat(Unit, Event) Unit:RemoveEvents() end function Engineer_OnDied(Unit, Event) Unit:RemoveEvents() end function Engineer_OnKilledTarget(Unit, Event) end RegisterUnitEvent(20404, 1, "Engineer_OnCombat") RegisterUnitEvent(20404, 2, "Engineer_OnLeaveCombat") RegisterUnitEvent(20404, 3, "Engineer_OnKilledTarget") RegisterUnitEvent(20404, 4, "Engineer_OnDied") function Nesaad_OnCombat(Unit, Event) Unit:RegisterEvent("Nesaad_Flux", 7000, 0) end function Nesaad_Flux(pUnit, Event) pUnit:CastSpell(35924) end function Nesaad_OnLeaveCombat(Unit, Event) Unit:RemoveEvents() end function Nesaad_OnDied(Unit, Event) Unit:RemoveEvents() end function Nesaad_OnKilledTarget(Unit, Event) end RegisterUnitEvent(19641, 1, "Nesaad_OnCombat") RegisterUnitEvent(19641, 2, "Nesaad_OnLeaveCombat") RegisterUnitEvent(19641, 3, "Nesaad_OnKilledTarget") RegisterUnitEvent(19641, 4, "Nesaad_OnDied") function Corpse_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Corpse_Rend",15000,0) pUnit:RegisterEvent("Corpse_Parasite_Spell",6000,0) pUnit:RegisterEvent("Corpse_Parasite_Spawn",36000,0) end function Corpse_Rend(pUnit,Event) pUnit:FullCastSpellOnTarget(13443,pUnit:GetMainTank()) end function Corpse_Parasite_Spell(pUnit,Event) pUnit:FullCastSpellOnTarget(36469,pUnit:GetRandomPlayer(0)) end function Corpse_Parasite_Spawn(pUnit,Event) local x = pUnit:GetX() local y = pUnit:GetY() local z = pUnit:GetZ() local o = pUnit:GetO() pUnit:CastSpell(36468) pUnit:SpawnCreature(21265, x-1, y, z, o, 14, o) end function Corpse_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Corpse_OnKilledTarget(pUnit,Event) pUnit:RemoveEvents() end function Corpse_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(20561,1,"Corpse_OnEnterCombat") RegisterUnitEvent(20561,2,"Corpse_OnLeaveCombat") RegisterUnitEvent(20561,3,"Corpes_OnKilledTarget") RegisterUnitEvent(20561,4,"Corpse_OnDied") function Lord_OnCombat(Unit, Event) Unit:RegisterEvent("Lord_Cleave", 6000, 0) end function Lord_Cleave(pUnit, Event) pUnit:FullCastSpellOnTarget(15496, pUnit:GetMainTank()) end function Lord_OnLeaveCombat(Unit, Event) Unit:RemoveEvents() end function Lord_OnDied(Unit, Event) Unit:RemoveEvents() end function Lord_OnKilledTarget(Unit, Event) end RegisterUnitEvent(20929, 1, "Lord_OnCombat") RegisterUnitEvent(20929, 2, "Lord_OnLeaveCombat") RegisterUnitEvent(20929, 3, "Lord_OnKilledTarget") RegisterUnitEvent(20929, 4, "Lord_OnDied") function Priestess_OnCombat(Unit, Event) Unit:RegisterEvent("Priestess_Rain", 9000, 0) end function Priestess_Rain(pUnit, Event) pUnit:CastSpell(34017) end function Priestess_OnLeaveCombat(Unit, Event) Unit:RemoveEvents() end function Priestess_OnDied(Unit, Event) Unit:RemoveEvents() end function Priestess_OnKilledTarget(Unit, Event) end RegisterUnitEvent(18859, 1, "Priestess_OnCombat") RegisterUnitEvent(18859, 2, "Priestess_OnLeaveCombat") RegisterUnitEvent(18859, 3, "Priestess_OnKilledTarget") RegisterUnitEvent(18859, 4, "Priestess_OnDied") function Laztarash_OnCombat(Unit, Event) Unit:RegisterEvent("Laztarash_Hamstring", 8000, 0) end function Laztarash_Hamstring(pUnit, Event) pUnit:FullCastSpellOnTarget(31553, pUnit:GetMainTank()) end function Laztarash_OnLeaveCombat(Unit, Event) Unit:RemoveEvents() end function Laztarash_OnDied(Unit, Event) Unit:RemoveEvents() end function Laztarash_OnKilledTarget(Unit, Event) end RegisterUnitEvent(20789, 1, "Laztarash_OnCombat") RegisterUnitEvent(20789, 2, "Laztarash_OnLeaveCombat") RegisterUnitEvent(20789, 3, "Laztarash_OnKilledTarget") RegisterUnitEvent(20789, 4, "Laztarash_OnDied") function Raider_OnCombat(Unit, Event) Unit:RegisterEvent("Raider_Energy", 8000, 0) end function Raider_Energy(pUnit, Event) pUnit:CastSpell(35922) end function Raider_OnLeaveCombat(Unit, Event) Unit:RemoveEvents() end function Raider_OnDied(Unit, Event) Unit:RemoveEvents() end function Raider_OnKilledTarget(Unit, Event) end RegisterUnitEvent(18875, 1, "Raider_OnCombat") RegisterUnitEvent(18875, 2, "Raider_OnLeaveCombat") RegisterUnitEvent(18875, 3, "Raider_OnKilledTarget") RegisterUnitEvent(18875, 4, "Raider_OnDied") function Stalker_OnCombat(Unit, Event) Unit:RegisterEvent("Stalker_Backstab", 6000, 0) Unit:RegisterEvent("Stalker_Warp", 8000, 0) end function Stalker_Backstab(pUnit, Event) pUnit:FullCastSpellOnTarget(7159, pUnit:GetMainTank()) end function Stalker_Warp(pUnit, Event) pUnit:CastSpell(32920) end function Stalker_OnLeaveCombat(Unit, Event) Unit:RemoveEvents() end function Stalker_OnDied(Unit, Event) Unit:RemoveEvents() end function Stalker_OnKilledTarget(Unit, Event) end RegisterUnitEvent(19642, 1, "Stalker_OnCombat") RegisterUnitEvent(19642, 2, "Stalker_OnLeaveCombat") RegisterUnitEvent(19642, 3, "Stalker_OnKilledTarget") RegisterUnitEvent(19642, 4, "Stalker_OnDied") function Apex_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Apex_Thunderclap",1000,0) end function Apex_Thunderclap(pUnit,Event) pUnit:FullCastSpellOnTraget(8078, pUnit:GetClosestPlayer()) end function Apex_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Apex_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (19940, 1, "Apex_OnEnterCombat") RegisterUnitEvent (19940, 2, "Apex_OnLeaveCombat") RegisterUnitEvent (19940, 4, "Apex_OnDied") function Annihilator_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Annihilator_Explosion",1500,0) pUnit:RegisterEvent("Annihilator_Suppression",3000,0) end function Annihilator_Explosion(pUnit,Event) pUnit:FullCastSpellOnTarget(33860, pUnit:GetClosestPlayer()) end function Annihilator_Suppression(pUnit,Event) pUnit:FullCastSpellOnTarget(35892, pUnit:GetClosestPlayer()) end function Annihilator_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Annihilator_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (18856, 1, "Annihilator_OnEnterCombat") RegisterUnitEvent (18856, 2, "Annihilator_OnLeaveCombat") RegisterUnitEvent (18856, 4, "Annihilator_OnDied") function Bruiser_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Bruiser_Net",1000,0) end function Bruiser_Net(pUnit,Event) pUnit:FullCastSpellOnTarget(12024, pUnit:GetClosestPlayer()) end function Bruiser_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Bruiser_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (20484, 1, "Bruiser_OnEnterCombat") RegisterUnitEvent (20484, 2, "Bruiser_OnLeaveCombat") RegisterUnitEvent (20484, 4, "Bruiser_OnDied") function Machine_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Machine_Rocket",2000,0) end function Machine_Rocket(pUnit,Event) pUnit:FullCastSpellOnTarget(38083, pUnit:GetClosestPlayer()) end function Machine_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Machine_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (21976, 1, "Machine_OnEnterCombat") RegisterUnitEvent (21976, 2, "Machine_OnLeaveCombat") RegisterUnitEvent (21976, 4, "Machine_OnDied") function Bruiser_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Bruiser_Net",1000,0) end function Bruiser_Net(pUnit,Event) pUnit:FullCastSpellOnTarget(12024, pUnit:GetClosestPlayer()) end function Bruiser_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Bruiser_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (20485, 1, "Bruiser_OnEnterCombat") RegisterUnitEvent (20485, 2, "Bruiser_OnLeaveCombat") RegisterUnitEvent (20485, 4, "Bruiser_OnDied") function Bruiser_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Bruiser_Net",1000,0) end function Bruiser_Net(pUnit,Event) pUnit:FullCastSpellOnTarget(12024,pUnit:GetClosestPlayer()) end function Bruiser_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Bruiser_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (22494,1,"Bruiser_OnEnterCombat") RegisterUnitEvent (22494,2,"Bruiser_OnLeaveCombat") RegisterUnitEvent (22494,4,"Bruiser_OnDied") function Cragskaar_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Cragskaar_Knock",45000,0) end function Cragskaar_Knock(pUnit,Event) pUnit:FullCastSpellOnTarget(32959, pUnit:GetClosestPlayer()) end function Cragskaar_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Cragskaar_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (20202, 1, "Cragskaar_OnEnterCombat") RegisterUnitEvent (20202, 2, "Cragskaar_OnLeaveCombat") RegisterUnitEvent (20202, 4, "Cragskaar_OnDied") function Punisher_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Punisher_Explosion",1500,0) pUnit:RegisterEvent("Punisher_Suppression",3000,0) end function Punisher_Explosion(pUnit,Event) pUnit:FullCastSpellOnTarget(33860,pUnit:GetClosestPlayer()) end function Punisher_Suppression(pUnit,Event) pUnit:FullCastSpellOnTarget(35892,pUnit:GetClosestPlayer()) end function Punisher_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Punisher_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (18698, 1, "Punisher_OnEnterCombat") RegisterUnitEvent (18698, 2, "Punisher_OnLeaveCombat") RegisterUnitEvent (18698, 4, "Punisher_OnDied") function Morug_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Morug_Blade",1500,0) pUnit:RegisterEvent("Morug_Spray",1000,0) end function Morug_Blade(pUnit,Event) pUnit:FullCastSpellOnTarget(36228,pUnit:GetClosestPlayer()) end function Morug_Spray(pUnit,Event) pUnit:FullCastSpellOnTarget(34261,pUnit:GetClosestPlayer()) end function Morug_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Morug_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (20800, 1, "Morug_OnEnterCombat") RegisterUnitEvent (20800, 2, "Morug_OnLeaveCombat") RegisterUnitEvent (20800, 4, "Morug_OnDied") function Kaylannl_OnEnterCombat(pUnit,Event) if pUnit:GetHealthPct() == 99 then pUnit:RegisterEvent("Kaylannl_Phase1",1000,0) end end function Kaylannl_Phase1(pUnit,Event) pUnit:RegisterEvent("Kaylaanl_Ressurection",15000,0) pUnit:RegisterEvent("Kaylaanl_Shield",18000,0) pUnit:RegisterEvent("Kaylannl_Light",5000,0) pUnit:RegisterEvent("Kaylannl_Power",6000,0) pUnit:RegisterEvent("Kaylannl_Consecration",6000,0) pUnit:RegisterEvent("Kaylannl_Shield2",25000,0) pUnit:RegisterEvent("Kaylannl_Heal",7000,0) pUnit:RegisterEvent("Kaylannl_Slam",7000,0) pUnit:RegisterEvent("Kaylannl_Wrath",25000,0) pUnit:RegisterEvent("Kaylannl_Despawn",1000,0) end function Kaylannl_Ressurection(pUnit,Event) pUnit:FullCastSpellOnTarget(35599,pUnit:GetRandomFriend(0)) end function Kaylannl_Shield(pUnit,Event) pUnit:FullCastSpellOnTarget(37554,pUnit:GetRandomPlayer(0)) end function Kaylannl_Light(pUnit,Event) pUnit:FullCastSpellOnTarget(37552,pUnit:GetMainTank()) end function Kaylannl_Power(pUnit,Event) local plr = pUnit:GetRandomPlayer(0) if plr ~= nil then pUnit:ChannelSpell(plr:GetGUID(),35597) end end function Kaylannl_Consecration(pUnit,Event) pUnit:CastSpell(37553) end function Kaylannl_Shield2(pUnit,Event) pUnit:CastSpell(13874) end function Kaylannl_Heal(pUnit,Event) pUnit:CastSpellOnTarget(37569,pUnit:GetRandomFriend(0)) end function Kaylannl_Slam(pUnit,Event) pUnit:FullCastSpellOnTarget(37572,pUnit:GetMainTank()) end function Kaylannl_Wrath(pUnit,Event) pUnit:FullCastSpellOnTarget(35614,pUnit:GetRandomPlayer(0)) end function Kaylannl_Despawn(pUnit,Event) if pUnit:GetHealthPct() == 25 then pUnit:Despawn(5000) local x = pUnit:GetX() local y = pUnit:GetY() local z = pUnit:GetZ() local o = pUnit:GetO() pUnit:SpawnCreature(20132, x-1, y, z, o, 14, o) end end function Kaylannl_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Kaylannl_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (20794, 1, "Kaylannl_OnEnterCombat") RegisterUnitEvent (20794, 2, "Kaylannl_OnLeaveCombat") RegisterUnitEvent (20794, 4, "Kaylannl_OnDied") function Naberius_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Naberius_Nova",1000,0) pUnit:RegisterEvent("Naberius_Bolt",3000,0) end function Naberius_Nova(pUnit,Event) pUnit:FullCastSpellOnTarget(36148,pUnit:GetClosestPlayer()) end function Naberius_Bolt(pUnit,Event) pUnit:FullCastSpellOnTarget(15497,pUnit:GetClosestPlayer()) end function Naberius_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Naberius_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (20483, 1, "Naberius_OnEnterCombat") RegisterUnitEvent (20483, 2, "Naberius_OnLeaveCombat") RegisterUnitEvent (20483, 4, "Naberius_OnDied") function Negatron_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Negatron_Charge",1000,(1)) pUnit:RegisterEvent("Negatron_Demolish",1000,0) pUnit:RegisterEvent("Negatron_Quake",1000,0) pUnit:RegisterEvent("Negatron_Enrage",1000,0) end function Negatron_Charge(pUnit,Event) pUnit:FullCastSpellOnTarget(35570,pUnit:GetClosestPlayer()) end function Negatron_Demolish(pUnit,Event) pUnit:FullCastSpellOnTarget(34625,pUnit:GetClosestPlayer()) end function Negatron_Quake(pUnit,Event) pUnit:FullCastSpellOnTarget(35565,pUnit:GetClosestPlayer()) end function Negatron_Enrage(pUnit,Event) pUnit:CastSpell(34624) end function Negatron_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Negatron_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (19851, 1, "Negatron_OnEnterCombat") RegisterUnitEvent (19851, 2, "Negatron_OnLeaveCombat") RegisterUnitEvent (19851, 4, "Negatron_OnDied") function Guard_OnCombat(pUnit, Event) pUnit:RegisterEvent("Guard_Cleave", 5000, 0) pUnit:RegisterEvent("Guard_Hamstring", 6000, 0) pUnit:RegisterEvent("Guard_Mortal_Strike", 7000, 0) end function Guard_OnLeaveCombat(pUnit, Event) pUnit:RemoveEvents() end function Guard_OnKillTarget(pUnit, Event) pUnit:RemoveEvents() end function Guard_OnDeath(pUnit, Event) pUnit:RemoveEvents() end RegisterUnitEvent(19529, 1, "Guard_OnCombat") RegisterUnitEvent(19529, 2, "Guard_OnLeaveCombat") RegisterUnitEvent(19529, 3, "Guard_OnKillTarget") RegisterUnitEvent(19529, 4, "Guard_OnDeath") function Guard_Cleave(pUnit, Event) pUnit:FullCastSpellOnTarget(15284, GetMainTank()) end function Guard_Hamstring(pUnit, Event) pUnit:FullCastSpellOnTarget(9080, GetMainTank()) end function Guard_Mortal_Strike(pUnit, Event) pUnit:FullCastSpellOnTarget(16856, GetMainTank()) end function Agent_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Agent_Shoot",1000,0) end function Agent_Shoot(pUnit,Event) pUnit:FullCastSpellOnTarget(36246,pUnit:GetClosestPlayer()) end function Agent_OnLeaveCombat(Unit,Event) Unit:RemoveEvents() end function Agent_OnDied(Unit,Event) Unit:RemoveEvents() end RegisterUnitEvent (19541, 1, "Agent_OnEnterCombat") RegisterUnitEvent (19541, 2, "Agent_OnLeaveCombat") RegisterUnitEvent (19541, 4, "Agent_OnDied") function King_OnEnterCombat(pUnit,Event) if Unit:GetHealthPct() == 99 then pUnit:RegisterEvent("King_Phase1",1000,0) end end function King_Phase1(pUnit,Event) pUnit:RegisterEvent("King_Damagebuff",1000,(1)) pUnit:RegisterEvent("King_Gravity",2500,0) pUnit:RegisterEvent("King_Statis",12000,0) pUnit:RegisterEvent("King_Phase2",1000,0) end function King_Dambagebuff(pUnit,Event) pUnit:CastSpell(37075) end function King_Gravity(pUnit,Event) pUnit:CastSpell(36533) end function King_Statis(pUnit,Event) pUnit:FullCastSpellOnTarget(36527,pUnit:GetRandomPlayer(0)) pUnit:FullCastSpellOnTarget(36527,pUnit:GetRandomPlayer(0)) end function King_Phase2(pUnit,Event) if pUnit:GetHealthPct() == 50 then pUnit:RegisterEvent("King_Damagebuff",1000,(1)) pUnit:RegisterEvent("King_Gravity",2500,0) pUnit:RegisterEvent("King_Statis",6000,0) pUnit:RegisterEvent("King_Mirror1",1000,(1)) pUnit:RegisterEvent("King_Mirror2",1000,(1)) end end function King_Mirror1(pUnit,Event) local x = pUnit:GetX() local y = pUnit:GetY() local z = pUnit:GetZ() local o = pUnit:GetO() pUnit:CastSpell(36847) pUnit:SpawnCreature(21425, x-1, y, z, o, 14, o) end function King_Mirror2(pUnit,Event) local x = pUnit:GetX() local y = pUnit:GetY() local z = pUnit:GetZ() local o = pUnit:GetO() pUnit:CastSpell(36848) pUnit:SpawnCreature(21425, x-1, y, z, o, 14, o) end function King_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function King_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (20454, 1, "King_OnEnterCombat") RegisterUnitEvent (20454, 2, "King_OnLeaveCombat") RegisterUnitEvent (20454, 4, "King_OnDied") function Silroth_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Silroth_Flames1",10000,0) pUnit:RegisterEvent("Silroth_Flames2",2000,0) end function Silroth_Flames1(pUnit,Event) pUnit:CastSpell(36253) end function Silroth_Flames2(pUnit,Event) pUnit:FullCastSpellOnTarget(36252,pUnit:GetMainTank()) end function Silroth_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Silroth_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (20801, 1, "Silroth_OnEnterCombat") RegisterUnitEvent (20801, 2, "Silroth_OnLeaveCombat") RegisterUnitEvent (20801, 4, "Silroth_OnDied") function Socrethar_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Socrethar_Shield",10000,0) pUnit:RegisterEvent("Socrethar_Backslash",5000,0) pUnit:RegisterEvent("Socrethar_Cleave",6000,0) pUnit:RegisterEvent("Socrethar_Barrage",10000,0) pUnit:RegisterEvent("Socrethar_Protection",1000,(1)) pUnit:RegisterEvent("Socrethar_Bolt",3000,0) end function Socrethar_Shield(pUnit,Event) pUnit:CastSpell(37538) end function Socrethar_Backslash(pUnit,Event) pUnit:FullCastSpellOnTarget(37537,pUnit:GetRandomPlayer(0)) end function Socrethar_Cleave(pUnit,Event) pUnit:FullCastSpellOnTarget(15496,pUnit:GetMainTank()) end function Socrethar_Barrage(pUnit,Event) pUnit:CastSpell(37541) local plr = pUnit:GetRandomPlayer() if plr ~= nil then pUnit:ChannelSpell(plr:GetGUID(),37540) end end function Socrethar_Protection(pUnit,Event) pUnit:CastSpell(37539) end function Socrethar_Bolt(pUnit,Event) pUnit:FullCastSpellOnTarget(28448,pUnit:GetRandomPlayer(0)) end function Socrethar_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Socrethar_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (20132, 1, "Socrethar_OnEnterCombat") RegisterUnitEvent (20132, 2, "Socrethar_OnLeaveCombat") RegisterUnitEvent (20132, 4, "Socrethar_OnDied") function Nuramoc_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Nuramoc_Lightning",2000,0) pUnit:RegisterEvent("Nuramoc_Bolt",4000,0) pUnit:RegisterEvent("Nuramoc_Shield",5000,0) end function Nuramoc_Lightning(pUnit,Event) pUnit:FullCastSpellOnTarget(15797,pUnit:GetClosestPlayer()) end function Nuramoc_Bolt(pUnit,Event) pUnit:FullCastSpellOnTarget(21971,pUnit:GetClosestPlayer()) end function Nuramoc_Shield(pUnit,Event) pUnit:CastSpell(38905) end function Nuramoc_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Nuramoc_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (20932, 1, "Nuramoc_OnEnterCombat") RegisterUnitEvent (20932, 2, "Nuramoc_OnLeaveCombat") RegisterUnitEvent (20932, 4, "Nuramoc_OnDied") function Adal_OnCombat(Unit, Event) Unit:RegisterEvent("Adal_Ultimate", 1000, 1) end function Adal_Ultimate(pUnit, Event) pUnit:CastSpell(35076) end function Adal_OnLeaveCombat(Unit, Event) Unit:RemoveEvents() end function Adal_OnDied(Unit, Event) Unit:RemoveEvents() end function Adal_OnKilledTarget(Unit, Event) end RegisterUnitEvent(18481, 1, "Adal_OnCombat") RegisterUnitEvent(18481, 2, "Adal_OnLeaveCombat") RegisterUnitEvent(18481, 3, "Adal_OnKilledTarget") RegisterUnitEvent(18481, 4, "Adal_OnDied") function Lightwarden_OnCombat(Unit, Event) Unit:RegisterEvent("Lightwarden_Strike", 6000, 0) Unit:RegisterEvent("Lightwarden_Hammer", 1000, 0) Unit:RegisterEvent("Lightwarden_Heal", 7000, 0) end function Lightwarden_Strike(pUnit, Event) pUnit:FullCastSpellOnTarget(14518, pUnit:GetMainTank()) end function Lightwarden_Hammer(pUnit, Event) pUnit:FullCastSpellOnTarget(13005, pUnit:GetMainTank()) end function Lightwarden_Heal(pUnit, Event) pUnit:CastSpell(13952) end function Lightwarden_OnLeaveCombat(Unit, Event) Unit:RemoveEvents() end function Lightwarden_OnDied(Unit, Event) Unit:RemoveEvents() end function Lightwarden_OnKilledTarget(Unit, Event) end RegisterUnitEvent(18537, 1, "Lightwarden_OnCombat") RegisterUnitEvent(18537, 2, "Lightwarden_OnLeaveCombat") RegisterUnitEvent(18537, 3, "Lightwarden_OnKilledTarget") RegisterUnitEvent(18537, 4, "Lightwarden_OnDied") function Vindicator_OnCombat(Unit, Event) Unit:RegisterEvent("Vindicator_Banish", 7000, 0) end function Vindicator_Banish(pUnit, Event) pUnit:FullCastSpellOnTarget(36642, pUnit:GetMainTank()) end function Vindicator_OnLeaveCombat(Unit, Event) Unit:RemoveEvents() end function Vindicator_OnDied(Unit, Event) Unit:RemoveEvents() end function Vindicator_OnKilledTarget(Unit, Event) end RegisterUnitEvent(18549, 1, "Vindicator_OnCombat") RegisterUnitEvent(18549, 2, "Vindicator_OnLeaveCombat") RegisterUnitEvent(18549, 3, "Vindicator_OnKilledTarget") RegisterUnitEvent(18549, 4, "Vindicator_OnDied") function Terokk_OnCombat(Unit, Event) Unit:RegisterEvent("Terokk_Charge", 1000, 1) Unit:RegisterEvent("Terokk_Burst", 6000, 0) end function Terokk_Charge(pUnit, Event) pUnit:FullCastSpellOnTarget(24193, pUnit:GetMainTank()) end function Terokk_Burst(pUnit, Event) pUnit:FullCastSpellOnTarget(39068, pUnit:GetMainTank()) end function Terokk_OnLeaveCombat(Unit, Event) Unit:RemoveEvents() end function Terokk_OnDied(Unit, Event) Unit:RemoveEvents() end function Terokk_OnKilledTarget(Unit, Event) end RegisterUnitEvent(22375, 1, "Terokk_OnCombat") RegisterUnitEvent(22375, 2, "Terokk_OnLeaveCombat") RegisterUnitEvent(22375, 3, "Terokk_OnKilledTarget") RegisterUnitEvent(22375, 4, "Terokk_OnDied") function Bodyguard_OnCombat(Unit, Event) Unit:RegisterEvent("Bodyguard_Demoralize", 10000, 0) Unit:RegisterEvent("Bodyguard_Rend", 6000, 0) end function Bodyguard_Demoralize(pUnit, Event) pUnit:FullCastSpellOnTarget(13730, pUnit:GetClosestPlayer()) end function Bodyguard_Rend(pUnit, Event) pUnit:FullCastSpellOnTarget(11977, pUnit:GetMainTank()) end function Bodyguard_OnLeaveCombat(Unit, Event) Unit:RemoveEvents() end function Bodyguard_OnDied(Unit, Event) Unit:RemoveEvents() end function Bodyguard_OnKilledTarget(Unit, Event) end RegisterUnitEvent(18483, 1, "Bodyguard_OnCombat") RegisterUnitEvent(18483, 2, "Bodyguard_OnLeaveCombat") RegisterUnitEvent(18483, 3, "Bodyguard_OnKilledTarget") RegisterUnitEvent(18483, 4, "Bodyguard_OnDied") function Petrifier_OnCombat(Unit, Event) Unit:RegisterEvent("Petrifier_Glare", 10000, 0) end function Petrifier_Glare(pUnit, Event) pUnit:FullCastSpellOnTarget(32905, pUnit:GetMainTank()) end function Petrifier_OnLeaveCombat(Unit, Event) Unit:RemoveEvents() end function Petrifier_OnDied(Unit, Event) Unit:RemoveEvents() end function Petrifier_OnKilledTarget(Unit, Event) end RegisterUnitEvent(21854, 1, "Petrifier_OnCombat") RegisterUnitEvent(21854, 2, "Petrifier_OnLeaveCombat") RegisterUnitEvent(21854, 3, "Petrifier_OnKilledTarget") RegisterUnitEvent(21854, 4, "Petrifier_OnDied") function MTerokk_OnCombat(Unit, Event) Unit:RegisterEvent("MTerokk_Dmg", 7000, 0) end function MTerokk_Dmg(pUnit, Event) pUnit:FullCastSpellOnTarget(38021, pUnit:GetMainTank()) end function MTerokk_OnLeaveCombat(Unit, Event) Unit:RemoveEvents() end function MTerokk_OnDied(Unit, Event) Unit:RemoveEvents() end function MTerokk_OnKilledTarget(Unit, Event) Unit:RemoveEvents() end RegisterUnitEvent(22376, 1, "MTerokk_OnCombat") RegisterUnitEvent(22376, 2, "MTerokk_OnLeaveCombat") RegisterUnitEvent(22376, 3, "MTerokk_OnKilledTarget") RegisterUnitEvent(22376, 4, "MTerokk_OnDied") function Drunk_OnCombat(Unit, Event) Unit:RegisterEvent("Drunk_Knock", 8000, 0) end function Drunk_Knock(pUnit, Event) pUnit:FullCastSpellOnTarget(10966, pUnit:GetMainTank()) end function Drunk_OnLeaveCombat(Unit, Event) Unit:RemoveEvents() end function Drunk_OnDied(Unit, Event) Unit:RemoveEvents() end function Drunk_OnKilledTarget(Unit, Event) end RegisterUnitEvent(18585, 1, "Drunk_OnCombat") RegisterUnitEvent(18585, 2, "Drunk_OnLeaveCombat") RegisterUnitEvent(18585, 3, "Drunk_OnKilledTarget") RegisterUnitEvent(18585, 4, "Drunk_OnDied") function Salsalabim_OnCombat(Unit, Event) Unit:RegisterEvent("Salsalabim_Pull", 6000, 0) end function Salsalabim_Pull(pUnit, Event) pUnit:FullCastSpellOnTarget(31705, pUnit:GetMainTank()) end function Salsalabim_OnLeaveCombat(Unit, Event) Unit:RemoveEvents() end function Salsalabim_OnDied(Unit, Event) Unit:RemoveEvents() end function Salsalabim_OnKilledTarget(Unit, Event) end RegisterUnitEvent(18584, 1, "Salsalabim_OnCombat") RegisterUnitEvent(18584, 2, "Salsalabim_OnLeaveCombat") RegisterUnitEvent(18584, 3, "Salsalabim_OnKilledTarget") RegisterUnitEvent(18584, 4, "Salsalabim_OnDied") function Guardian_OnCombat(Unit, Event) Unit:RegisterEvent("Guardian_Banish", 10000, 0) end function Guardian_Banish(pUnit, Event) pUnit:FullCastSpellOnTarget(36671, pUnit:GetMainTank()) end function Guardian_OnLeaveCombat(Unit, Event) Unit:RemoveEvents() end function Guardian_OnDied(Unit, Event) Unit:RemoveEvents() end function Guardian_OnKilledTarget(Unit, Event) end RegisterUnitEvent(18568, 1, "Guardian_OnCombat") RegisterUnitEvent(18568, 2, "Guardian_OnLeaveCombat") RegisterUnitEvent(18568, 3, "Guardian_OnKilledTarget") RegisterUnitEvent(18568, 4, "Guardian_OnDied") function Peacekeeper_OnCombat(Unit, Event) Unit:RegisterEvent("Peacekeeper_Block", 5000, 0) end function Peacekeeper_Block(pUnit, Event) pUnit:CastSpell(12169) end function Peacekeeper_OnLeaveCombat(Unit, Event) Unit:RemoveEvents() end function Peacekeeper_OnDied(Unit, Event) Unit:RemoveEvents() end function Peacekeeper_OnKilledTarget(Unit, Event) end RegisterUnitEvent(19687, 1, "Peacekeeper_OnCombat") RegisterUnitEvent(19687, 2, "Peacekeeper_OnLeaveCombat") RegisterUnitEvent(19687, 3, "Peacekeeper_OnKilledTarget") RegisterUnitEvent(19687, 4, "Peacekeeper_OnDied") function Kaan_OnCombat(Unit, Event) Unit:RegisterEvent("Kaan_Banish", 7000, 0) end function Kaan_Banish(pUnit, Event) pUnit:FullCastSpellOnTarget(36642, pUnit:GetMainTank()) end function Kaan_OnLeaveCombat(Unit, Event) Unit:RemoveEvents() end function Kaan_OnDied(Unit, Event) Unit:RemoveEvents() end function Kaan_OnKilledTarget(Unit, Event) end RegisterUnitEvent(23271, 1, "Kaan_OnCombat") RegisterUnitEvent(23271, 2, "Kaan_OnLeaveCombat") RegisterUnitEvent(23271, 3, "Kaan_OnKilledTarget") RegisterUnitEvent(23271, 4, "Kaan_OnDied") function AcientShadowmoonSpirit_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("AcientShadowmoonSpirit_Haste", 40000, 0) pUnit:RegisterEvent("AcientShadowmoonSpirit_DeathAndDecay", 30000, 0) pUnit:RegisterEvent("AcientShadowmoonSpirit_TouchOfDarkness", 15000, 1) pUnit:RegisterEvent("AcientShadowmoonSpirit_UnholyArmor", 3000, 0) end function AcientShadowmoonSpirit_Haste(pUnit,Event) pUnit:CastSpell(37728) end function AcientShadowmoonSpirit_DeathAndDecay(pUnit,Event) pUnit:FullCastSpellOnTarget(37788,pUnit:GetClosestPlayer()) end function AcientShadowmoonSpirit_TouchOfDarkness(pUnit,Event) pUnit:FullCastSpellOnTarget(37727,pUnit:GetClosestPlayer()) end function AcientShadowmoonSpirit_UnholyArmor(pUnit,Event) pUnit:CastSpell(37729) end function AcientShadowmoonSpirit_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function AcientShadowmoonSpirit_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (21797, 1, "AcientShadowmoonSpirit_OnEnterCombat") RegisterUnitEvent (21797, 2, "AcientShadowmoonSpirit_OnLeaveCombat") RegisterUnitEvent (21797, 4, "AcientShadowmoonSpirit_OnDied") function Akama_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Akama_Lightning", 1540, 0) end function Akama_Lightning(pUnit,Event) pUnit:FullCastSpellOnTarget(39945,pUnit:GetClosestPlayer()) end function Akama_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Akama_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (21700, 1, "Akama_OnEnterCombat") RegisterUnitEvent (21700, 2, "Akama_OnLeaveCombat") RegisterUnitEvent (21700, 4, "Akama_OnDied") function Alandien_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Alandien_ShadowFury", 3000, 0) pUnit:RegisterEvent("Alandien_ManaBurn", 3000, 0) end function Alandien_ShadowFury(pUnit,Event) pUnit:FullCastSpellOnTarget(39082,pUnit:GetClosestPlayer()) end function Alandien_ManaBurn(pUnit,Event) pUnit:FullCastSpellOnTarget(39262,pUnit:GetClosestPlayer()) end function Alandien_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Alandien_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (21171, 1, "Alandien_OnEnterCombat") RegisterUnitEvent (21171, 2, "Alandien_OnLeaveCombat") RegisterUnitEvent (21171, 4, "Alandien_OnDied") function AltarDefender_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("AltarDefender_Shoot", 11000, 0) end function AltarDefender_Shoot(pUnit,Event) pUnit:FullCastSpellOnTarget(41440,pUnit:GetClosestPlayer()) end function AltarDefender_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function AltarDefender_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (23453, 1, "Alandien_OnEnterCombat") RegisterUnitEvent (23453, 2, "Alandien_OnLeaveCombat") RegisterUnitEvent (23453, 4, "Alandien_OnDiedCombat") function AltarOfShatar_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("AltarOfShatar_Net", 20000, 0) end function AltarofShatar_Net(pUnit,Event) pUnit:FullCastSpellOnTarget(12024,pUnit:GetClosestPlayer()) end function AltarofShatar_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function AltarofShatar_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (21986, 1, "Alandien_OnEnterCombat") RegisterUnitEvent (21986, 2, "Alandien_OnLeaveCombat") RegisterUnitEvent (21986, 4, "Alandien_OnDied") function Jerrikar_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Jerrikar_DarkStrike", 4000, 0) pUnit:RegisterEvent("Jerrikar_DiplomaticImmunity", 40000, 0) pUnit:RegisterEvent("Jerrikar_Silence", 30000, 0) end function Jerrikar_Silence(pUnit,Event) pUnit:FullCastSpellOnTarget(38913,GetClosestPlayer()) end function Jerrikar_DarkStrike(pUnit,Event) pUnit:FullCastSpellOnTarget(38926,GetClosestPlayer()) end function Jerrikar_DiplomaticImmunity(pUnit,Event) pUnit:FullCastSpellOnTarget(38916,GetClosestPlayer()) end function Jerrikar_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Jerrikar_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (18695, 1, "Alandien_OnEnterCombat") RegisterUnitEvent (18695, 2, "Alandien_OnLeaveCombat") RegisterUnitEvent (18695, 4, "Alandien_OnDied") function AnchoriteCaalen_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("AnchoriteCaalen_HolySmite", 1540, 0) pUnit:RegisterEvent("AnchoriteCaalen_HolySmite", 5000, 0) end function AnchoriteCaalen_HolySmite(pUnit,Event) pUnit:FullCastSpellOnTarget(36176,pUnit:GetClosestPlayer()) end function AnchoriteCaalen_GreaterHeal(pUnit,Event) pUnit:FullCastSpellOnTarget(35096,pUnit:GetRandomFriend()) end function AnchoriteCaalen_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function AnchoriteCaalen_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (22862, 1, "Alandien_OnEnterCombat") RegisterUnitEvent (22862, 2, "Alandien_OnLeaveCombat") RegisterUnitEvent (22862, 4, "Alandien_OnDied") function ArcanoScorp_OnEnterCombat(pUnit,Event) pUnit:CastSpell(37917) pUnit:CastSpell(37851) pUnit:RegisterEvent("ArcanoScorp_DisMantle", 3000, 0) pUnit:RegisterEvent("ArcanoScorp_Pince", 6600, 0) end function ArcanoScorp_Dismantle(pUnit,Event) pUnit:FullCastSpellOnTarget(37919,pUnit:GetClosestPlayer()) end function ArcanoScorp_Pince(pUnit,Event) pUnit:FullCastSpellOnTarget(37918,pUnit:GetClosestPlayer()) end RegisterUnitEvent (21909, 1, "ArcanoScorp_OnEnterCombat") RegisterUnitEvent (21909, 2, "ArcanoScorp_OnLeaveCombat") RegisterUnitEvent (21909, 4, "ArcanoScorp_OnDied") function Arvoar_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Arvoar_BellowingRoar", 30000, 0) pUnit:RegisterEvent("Arvoar_Rend", 20000, 0) pUnit:RegisterEvent("Arvoar_RockShell", 33000, 0) end function Arvoar_BellowingRoar(pUnit,Event) pUnit:FullCastSpellOnTarget(40636,pUnit:GetClosestPlayer()) end function Arvoar_Rend(pUnit,Event) pUnit:FullCastSpellOnTarget(13443,pUnit:GetClosestPlayer()) end function Arvoar_RockShell(pUnit,Event) pUnit:CastSpell(33810) end function Arvoar_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Arvoar_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (23267, 1, "Arvoar_OnEnterCombat") RegisterUnitEvent (23267, 2, "Arvoar_OnLeaveCombat") RegisterUnitEvent (23267, 4, "Arvoar_OnDied") function Asghar_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Asghar_Cleave", 3300, 0) pUnit:RegisterEvent("Asghar_DarkMending", 15000, 0) end function Asghar_Cleave(pUnit,Event) pUnit:FullCastSpellOnTarget(15496,pUnit:GetClosestPlayer()) end function Asghar_DarkMending(pUnit,Event) pUnit:CastSpell(16588) end function Asghar_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Asghar_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (22025, 1, "Asgarhar_OnEnterCombat") RegisterUnitEvent (22025, 2, "Asgarhar_OnLeaveCombat") RegisterUnitEvent (22025, 4, "Asgarhar_OnDied") function AshtongueShaman_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("AshtongueShaman_Bloodlust", 60000, 0) pUnit:RegisterEvent("AshtongueShaman_LightningShield", 60000, 0) end function AshtongueShaman_Bloodlust(pUnit,Event) pUnit:CastSpell(37067) end function AshtongueShaman_LightningShield(pUnit,Event) pUnit:CastSpell(12550) end function AshtongueShaman_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function AshtongueShaman_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (21453, 1, "AshtongueShaman_OnEnterCombat") RegisterUnitEvent (21453, 2, "AshtongueShaman_OnLeaveCombat") RegisterUnitEvent (21453, 4, "AshtongueShaman_OnDied") function AshtongueWorker_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("AshtongueWorker_PierceArmor", 45000, 0) end function AshtongueWorker_PierceArmor(pUnit,Event) pUnit:FullCastSpellOnTarget(6016,pUnit:GetClosestPlayer()) end function AshtongueWorker_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function AshtongueWorker_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (21455, 1, "AshtongueWorker_OnEnterCombat") RegisterUnitEvent (21455, 2, "AshtongueWorker_OnLeaveCombat") RegisterUnitEvent (21455, 4, "AshtongueWorker_OnDied") function Azaloth_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Azaloth_RainOfFire", 30000, 0) pUnit:RegisterEvent("Azaloth_Cleave", 60000, 0) pUnit:RegisterEvent("Azaloth_Cripple", 20000, 0) pUnit:RegisterEvent("Azaloth_WarStomp", 13000, 0) end function Azaloth_RainOfFire(pUnit,Event) pUnit:FullCastSpellOnTarget(38741,pUnit:GetClosestPlayer()) end function Azaloth_Cleave(pUnit,Event) pUnit:FullCastSpellOnTarget(40504,pUnit:GetClosestPlayer()) end function Azaloth_Cripple(pUnit,Event) pUnit:FullCastSpellOnTarget(11443,pUnit:GetClosestPlayer()) end function Azaloth_WarStomp(pUnit,Event) pUnit:FullCastSpellOnTarget(38750,pUnit:GetClosestPlayer()) end function Azaloth_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Azaloth_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21506, 1, "Azaloth_OnEnterCombat") RegisterUnitEvent(21506, 2, "Azaloth_OnLeaveCombat") RegisterUnitEvent(21506, 4, "Azaloth_OnDied") function Barash_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Barash_RockShell", 11000, 0) pUnit:RegisterEvent("Barash_BellowingRoar", 40000, 0) pUnit:RegisterEvent("Barash_Rend", 5000, 0) end function Barash_RockShell(pUnit,Event) pUnit:FullCastSpellOnTarget(33810,pUnit:GetClosestPlayer()) end function Barash_BellowingRoar(pUnit,Event) pUnit:FullCastSpellOnTarget(40636,pUnit:GetClosestPlayer()) end function Barash_Rend(pUnit,Event) pUnit:FullCastSpellOnTarget(13443,pUnit:GetClosestPlayer()) end function Barash_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Barash_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(23269, 1, "Barash_OnEnterCombat") RegisterUnitEvent(23269, 2, "Barash_OnLeaveCombat") RegisterUnitEvent(23269, 4, "Barash_OnDied") function BatRiderGuard_OnEnterCombat(pUnit,Event) pUnit:FullCastSpellOnTarget(38066,pUnit:GetClosestPlayer()) pUnit:RegisterEvent("BatRiderGuard_Spell", 25000, 0) end function BatRiderGuard_Spell(pUnit,Event) pUnit:FullCastSpellOnTarget(38066,pUnit:GetClosestPlayer()) end function BatRiderGuard_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function BatRiderGuard_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(15242, 1, "BatRiderGuard_OnEnterCombat") RegisterUnitEvent(15242, 2, "BatRiderGuard_OnLeaveCombat") RegisterUnitEvent(15242, 4, "BatRiderGuard_OnDied") function BBOD_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("BBOD_Spell", 60000, 0) end function BBOD_Spell(pUnit,Event) pUnit:FullCastSpellOnTarget(7279,pUnit:GetClosestPlayer()) end function BBOD_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function BBOD_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent (23286, 1, "BBOD_OnEnterCombat") RegisterUnitEvent (23286, 2, "BBOD_OnLeaveCombat") RegisterUnitEvent (23286, 4, "BBOD_OnDied") function BlackCat_OnEnterCombat(pUnit,Event) pUnit:SendChatMessage(12, 0, "Meow!") end function BlackCat_OnDeath(pUnit,Event) pUnit:FullCastSpellOnTarget(39477,pUnit:GetClosestPlayer()) end RegisterUnitEvent(22816, 1, "BlackCat_OnEnterCombat") RegisterUnitEvent(22816, 4, "BlackCat_OnDeath") function BWM_OnEnterCombat(pUnit,Event) pUnit:RegisterUnitEvent("BWM_SnapKick", 10000, 0) end function BWM_SnapKick(pUnit,Event) pUnit:FullCastSpellOnTarget(39477,pUnit:GetClosestPlayer()) end function BWM_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function BWM_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21245, 1, "BWM_OnEnterCombat") RegisterUnitEvent(21245, 2, "BWM_OnLeaveCombat") RegisterUnitEvent(21245, 4, "BWM_OnDied") function BWMessenger_OnEnterCombat(pUnit,Event) pUnit:FullCastSpellOnTarget(35570,pUnit:GetClosestPlayer()) end RegisterUnitEvent(21244, 1, "BWMessenger_OnEnterCombat") function Borak_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Borak_SliceAndDice", 15000, 0) pUnit:RegisterEvent("Borak_Eviscerate", 5000, 0) end function Borak_SliceAndDice(pUnit,Event) pUnit:FullCastSpellOnTarget(30470,pUnit:GetClosestPlayer()) end function Borak_Eviscerate(pUnit,Event) pUnit:FullCastSpellOnTarget(27611,pUnit:GetClosestPlayer()) end function Borak_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Borak_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21293, 1, "Borak_OnEnterCombat") RegisterUnitEvent(21293, 2, "Borak_OnLeaveCombat") RegisterUnitEvent(21293, 4, "Borak_OnDied") function Bron_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Bron_ThrowHammer", 15000, 0) end function Bron_ThrowHammer(pUnit,Event) pUnit:FullCastSpellOnTarget(33822,pUnit:GetClosestPlayer()) end function Bron_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Bron_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(19395, 1, "Bron_OnEnterCombat") RegisterUnitEvent(19395, 2, "Bron_OnLeaveCombat") RegisterUnitEvent(19395, 4, "Bron_OnDied") function WaterSpirit_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("WaterSpirit_Waterbolt", 4300, 0) end function Waterspirit_WaterBolt(pUnit,Event) pUnit:FullCastSpellOnTarget(31707,pUnit:GetClosestPlayer()) end function WaterSpirit_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function WaterSpirit_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21029, 1, "WaterSpirit_OnEnterCombat") RegisterUnitEvent(21029, 2, "WaterSpirit_OnLeaveCombat") RegisterUnitEvent(21029, 4, "WaterSpirit_OnDied") function ChainOfShadows_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("ChainOfShadows_Spell", 5500, 0) end function ChainOfShadows_Spell(pUnit,Event) pUnit:FullCastSPellOnTarget(37784,pUnit:GetClosestPlayer()) end function ChainOfShadows_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function ChainOfShadows_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21876, 1, "ChainOfShadows_OnEnterCombat") RegisterUnitEvent(21876, 2, "ChainOfShadows_OnLeaveCombat") RegisterUnitEvent(21876, 4, "ChainOfShadows_OnDied") function ChancellorBloodleaf_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("ChancellorBloodleaf_Spell1", 4000, 0) pUnit:RegisterEvent("ChancellorBloodleaf_Spell2", 10000, 0) end function ChancellorBloodleaf_Spell1(pUnit,Event) pUnit:FullCastSpellOnTarget(34517,pUnit:GetClosestPlayer()) end function ChancellorBloodleaf_Spell2(pUnit,Event) pUnit:FullCastSpellOnTarget(15791,pUnit:GetClosestPlayer()) end RegisterUnitEvent(22012, 1, "ChancellorBloodleaf_OnEnterCombat") RegisterUnitEvent(22012, 2, "ChancellorBloodleaf_OnLeaveCombat") RegisterUnitEvent(22012, 4, "ChancellorBloodleaf_OnDied") function Cobra_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Cobra_Spell", 11000, 0) end function Cobra_Spell(pUnit,Event) pUnit:FullCastSpellOnTarget(38030,pUnit:GetClosestPlayer()) end function Cobra_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Cobra_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(19784, 1, "Cobra_OnEnterCombat") RegisterUnitEvent(19784, 2, "Cobra_OnLeaveCombat") RegisterUnitEvent(19784, 4, "Cobra_OnDied") function CDefender_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("CDefender_Spell1", 7000, 0) pUnit:RegisterEvent("CDefender_Spell2", 16000, 0) end function CDefender_Spell1(pUnit,Event) pUnit:FullCastSpellOnTarget(38233,pUnit:GetClosestPlayer()) end function CDefender_Spell2(pUnit,Event) pUnit:FullCastSpellOnTarget(38031,pUnit:GetClosestPlayer()) end function CDefender_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function CDefender_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(19762, 1, "CDefender_OnEnterCombat") RegisterUnitEvent(19762, 2, "CDefender_OnLeaveCombat") RegisterUnitEvent(19762, 4, "CDefender_OnDied") function CMuckwatcher_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("CMuckwatcher_BattleShout", 40000, 0) end function CMuckwatcher_BattleShout(pUnit,Event) pUnit:CastSpell(38232) end function CMuckwatcher_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function CMuckwatcher_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(19788, 1, "CMuckwatcher_OnEnterCombat") RegisterUnitEvent(19788, 2, "CMuckwatcher_OnLeaveCombat") RegisterUnitEvent(19788, 4, "CMuckwatcher_OnDied") function CMyrmidon_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("CMyrmidon_Spell", 120000, 0) end function CMyrmidon_Spell(pUnit,Event) pUnit:FullCastSpellOnTarget(38027,pUnit:GetClosestPlayer()) end function CMyrmidon_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function CMyrmidon_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(19765, 1, "CMyrmidon_OnEnterCombat") RegisterUnitEvent(19765, 2, "CMyrmidon_OnLeaveCombat") RegisterUnitEvent(19765, 4, "CMyrmidon_OnDied") function CSiren_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("CSiren_Spell1", 20000, 0) pUnit:RegisterEvent("CSiren_Spell2", 6000, 0) end function CSiren_Spell1(pUnit,Event) pUnit:FullCastSpellOnTarget(38026,pUnit:GetClosestPlayer()) end function CSiren_Spell2(pUnit,Event) pUnit:FullCastSpellOnTarget(32011,pUnit:GetClosestPlayer()) end function CSiren_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function CSiren_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(19768,1,"CSiren_OnEnterCombat") RegisterUnitEvent(19768,2,"CSiren_OnLeaveCombat") RegisterUnitEvent(19768,4,"CSiren_OnDied") function CSorceress_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("CSiren_Spell1", 20000, 0) pUnit:RegisterEvent("CSiren_Spell2", 6000, 0) end function CSorceress_Spell1(pUnit,Event) pUnit:FullCastSpellOnTarget(38026,pUnit:GetClosestPlayer()) end function CSorceress_Spell2(pUnit,Event) pUnit:FullCastSpellOnTarget(32011,pUnit:GetClosestPlayer()) end function CSorceress_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function CSorceress_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(19767,1,"CSorceress_OnEnterCombat") RegisterUnitEvent(19767,2,"CSorceress_OnLeaveCombat") RegisterUnitEvent(19767,4,"CSorceress_OnDied") function Collidus_OnEnterCombat(pUnit,Event) pUnit:FullCastSpellOnTarget(38932,pUnit:GetClosestPlayer()) pUnit:FullCastSpellOnTarget(36414,pUnit:GetClosestPlayer()) pUnit:RegisterEvent("Collidus_FocusedBursts", 40000, 0) pUnit:RegisterEvent("Collidus_Scream", 40000, 0) end function Collidus_FocusedBursts(pUnit,Event) pUnit:FullCastSpellOnTarget(36414,pUnit:GetClosestPlayer()) end function Collidus_Scream(pUnit,Event) pUnit:FullCastSpellOnTarget(34322,pUnit:GetClosestPlayer()) end function Collidus_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Collidus_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(18694, 1, "Collidus_OnEnterCombat") RegisterUnitEvent(18694, 2, "Collidus_OnLeaveCombat") RegisterUnitEvent(18694, 4, "Collidus_OnDied") function Arcus_OnEnterCombat(pUnit,Event) pUnit:FullCastSpellOnTarget(41440,pUnit:GetClosestPlayer()) pUnit:RegisterEvent("Arcus_Spell1", 10000, 0) pUnit:RegisterEvent("Arcus_Spell2", 30000, 0) end function Arcus_Spell1(pUnit,Event) pUnit:FullCastSpellOnTarget(41448,pUnit:GetClosestPlayer()) end function Arcus_Spell1(pUnit,Event) pUnit:FullCastSpellOnTarget(38370,pUnit:GetClosestPlayer()) end function Arcus_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Arcus_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(23452, 1, "Arcus_OnEnterCombat") RegisterUnitEvent(23452, 2, "Arcus_OnLeaveCombat") RegisterUnitEvent(23452, 4, "Arcus_OnDied") function Hobb_OnEnterCombat(pUnit,Event) pUnit:FullCastSpellOnTarget(41440,pUnit:GetClosestPlayer()) pUnit:RegisterEvent("Hobb_Spell1", 10000, 0) pUnit:RegisterEvent("Hobb_Spell2", 30000, 0) end function Hobb_Spell1(pUnit,Event) pUnit:FullCastSpellOnTarget(41448,pUnit:GetClosestPlayer()) end function Hobb_Spell1(pUnit,Event) pUnit:FullCastSpellOnTarget(38370,pUnit:GetClosestPlayer()) end function Hobb_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Hobb_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(23434, 1, "Hobb_OnEnterCombat") RegisterUnitEvent(23434, 2, "Hobb_OnLeaveCombat") RegisterUnitEvent(23434, 4, "Hobb_OnDied") function Corok_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Corok_Spell1", 11000, 0) pUnit:RegisterEvent("Corok_Spell2", 26000, 0) end function Corok_Spell1(pUnit,Event) pUnit:FullCastSpellOnTarget(12612,pUnit:GetClosestPlayer()) end function Corok_Spell2(pUnit,Event) pUnit:FullCastSpellOnTarget(15550,pUnit:GetClosestPlayer()) end function Corok_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Corok_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(22011, 1, "Corok_OnEnterCombat") RegisterUnitEvent(22011, 2, "Corok_OnLeaveCombat") RegisterUnitEvent(22011, 4, "Corok_OnDied") function CAE_OnEnterCombat(pUnit,Event) pUnit:CastSpell(35194) pUnit:RegisterEvent("CAE_LBolt", 5000, 0) end function CAE_LBolt(pUnit,Event) pUnit:FullCastSpellOnTarget(9532,pUnit:GetClosestPlayer()) end function CAE_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function CAE_OnDiedCombat(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21707, 1, "CAE_OnEnterCombat") RegisterUnitEvent(21707, 2, "CAE_OnLeaveCombat") RegisterUnitEvent(21707, 4, "CAE_OnDied") function CFE_OnEnterCombat(pUnit,Event) pUnit:CastSpell(35194) pUnit:RegisterEvent("CFE_Fball", 5000, 0) end function CFE_Fball(pUnit,Event) pUnit:FullCastSpellOnTarget(9053,pUnit:GetClosestPlayer()) end function CFE_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function CFE_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21706, 1, "CFE_OnEnterCombat") RegisterUnitEvent(21706, 2, "CFE_OnLeaveCombat") RegisterUnitEvent(21706, 4, "CFE_OnDied") function CWE_OnEnterCombat(pUnit,Event) pUnit:CastSpell(35194) pUnit:RegisterEvent("CWE_FBolt", 5000, 0) end function CWE_Fbolt(pUnit,Event) pUnit:FullCastSpellOnTarget(9672,pUnit:GetClosestPlayer()) end function CWE_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function CWE_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21428, 1, "CWE_OnEnterCombat") RegisterUnitEvent(21428, 2, "CWE_OnLeaveCombat") RegisterUnitEvent(21428, 4, "CWE_OnDied") function CMForeman_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("CMForeman_Enrage", 5000, 0) end function CMForeman_Enrage(pUnit,Event) pUnit:CastSpell(40743) end function CMForeman_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function CMForeman_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(23305, 1, "CMForeman_OnEnterCombat") RegisterUnitEvent(23305, 2, "CMForeman_OnLeaveCombat") RegisterUnitEvent(23305, 4, "CMForeman_OnDied") function CMMiner_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("CMMiner_Enrage", 5000, 0) end function CMMiner_Enrage(pUnit,Event) pUnit:CastSpell(40743) end function CMMiner_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function CMMiner_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(23324, 1, "CMMiner_OnEnterCombat") RegisterUnitEvent(23324, 2, "CMMiner_OnLeaveCombat") RegisterUnitEvent(23324, 4, "CMMiner_OnDied") function CShardling_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("CShardling_Enrage", 5000, 0) end function CShardling_Enrage(pUnit,Event) pUnit:CastSpell(40743) end function CShardling_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function CShardling_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21936, 1, "CMMiner_OnEnterCombat") RegisterUnitEvent(21936, 2, "CMMiner_OnLeaveCombat") RegisterUnitEvent(21936, 4, "CMMiner_OnDied") function Cyrukh_OnEnterCombat(pUnit,Event) pUnit:GetMainTank() pUnit:GetAddTank() pUnit:RegisterEvent("Cyrukh_Final", 0001, 0) pUnit:RegisterEvent("Cyrukh_Trample", 10000, 0) pUnit:RegisterEvent("Cyrukh_KnockAway", 22000, 0) end function Cyrukh_Final(pUnit,Event) if pUnit:GetHealthPct() == 10 then pUnit:RegisterEvent("Cyrukh_FinalSpell", 20000, 0) end end function Cyrukh_FinalSpell(pUnit,Event) pUnit:FullCastSpellOnTarget(39429,pUnit:GetMainTank()) end function Cyrukh_Trample(pUnit,Event) pUnit:FullCastSpellOnTarget(39425,pUnit:GetMainTank()) end function Cyrukh_KnockAway(pUnit,Event) pUnit:FullCastSpellOnTarget(18945,pUnit:GetMainTank()) end function Cyrukh_Death(pUnit,Event) pUnit:RemoveEvents() end function Cyrukh_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21181, 1, "Cyrukh_OnEnterCombat") RegisterUnitEvent(21181, 4, "Cyrukh_Death") RegisterUnitEvent(21181, 2, "Cyrukh_OnLeaveCombat") function DCHarbinger_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("DCHarbinger_Spell", 13000, 0) pUnit:RegisterEvent("DCHarbinger_Heal", 25000, 0) end function DCHarbinger_Spell(pUnit,Event) pUnit:FullCastSpelOnTarget(15496,pUnit:GetClosestPlayer()) end function DCHarbinger_Heal(pUnit,Event) pUnit:FullCastSpelOnTarget(16588,pUnit:GetRandomFriend()) end function DCHarbinger_Died(pUnit,Event) pUnit:RemoveEvents() end function DCHarbinger_LeaveCombat(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21384, 1, "DCHarbinger_OnEnterCombat") RegisterUnitEvent(21384, 4, "DCHarbinger_Died") RegisterUnitEvent(21384, 2, "DCHarbinger_LeaveCombat") function DCHawkeye_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("DCHawkeye_Spell", 32000, 0) end function DCHawkeye_Spell(pUnit,Event) pUnit:FullCastSpellOnTarget(37974,pUnit:GetClosestPlayer()) end function DCHawkeye_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function DCHawkeye_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21386, 1, "DCHawkeye_OnEnterCombat") RegisterUnitEvent(21386, 2, "DCHawkeye_OnLeaveCombat") RegisterUnitEvent(21386, 4, "DCHawkeye_OnDied") function DCRavenguard_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("DCRavenguard_Enrage", 120000, 0) pUnit:RegisterEvent("DCRavenguard_Howl", 27000, 0) end function DCRavenguard_Enrage(pUnit,Event) pUnit:FullCastSpellOnTarget(8599,pUnit:GetClosestPlayer()) end function DCRavenguard_Howl(pUnit,Event) pUnit:FullCastSpellOnTarget(23600,pUnit:GetClosestPlayer()) end function DCRavenguard_OnDied(pUnit,Event) pUnit:RemoveEvents() end function DCRavenguard_LeaveCombat(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(19827, 1, "DCRavenguard_OnEnterCombat") RegisterUnitEvent(19827, 2, "DCRavenguard_LeaveCombat") RegisterUnitEvent(19827, 4, "DCRavenguard_OnDied") function DCScorncrow_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("DCScorncrow_FrostBolt", 12000, 0) end function DCScorncrow_Frostbolt(pUnit,Event) pUnit:FullCastSpellOnTarget(9672,pUnit:GetClosestPlayer()) end function DCScorncrow_LeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function DCScorncrow_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21385, 1, "DCScorncrow_OnEnterCombat") RegisterUnitEvent(21385, 2, "DCScorncrow_LeaveCombat") RegisterUnitEvent(21385, 4, "DCScorncrow_OnDied") function DCShadowmancer_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("DCShadowmancer_ShadowBolt", 13000, 0) pUnit:RegisterEvent("DCShadowmancer_DarkMending", 25000, 0) end function DCShadowmancer_ShadowBolt(pUnit,Event) pUnit:FullCastSpelOnTarget(9613,pUnit:GetClosestPlayer()) end function DCShadowmancer_DarkMending(pUnit,Event) pUnit:FullCastSpelOnTarget(16588,pUnit:GetRandomFriend()) end function DCShadowmancer_Died(pUnit,Event) pUnit:RemoveEvents() end function DCShadowmancer_LeaveCombat(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21384, 1, "DCShadowmancer_OnEnterCombat") RegisterUnitEvent(21384, 4, "DCShadowmancer_Died") RegisterUnitEvent(21384, 2, "DCShadowmancer_LeaveCombat") function DCTalonite_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("DCTalonite_ColdTouch", 18000, 0) pUnit:RegisterEvent("DCTalonite_TalonOfJustice", 15000, 0) end function DCTalonite_ColdTouch(pUnit,Event) pUnit:FullCastSpellOnTarget(39230,pUnit:GetClosestPlayer()) end function DCTalonite_TalonOfJustice(pUnit,Event) pUnit:FullCastSpellOnTarget(39229,pUnit:GetClosestPlayer()) end function DCTalonite_OnDied(pUnit,Event) pUnit:RemoveEvents() end function DCTalonite_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(19825, 1, "DCTalonite_OnEnterCombat") RegisterUnitEvent(19825, 4, "DCTalonite_OnDied") RegisterUnitEvent(19825, 2, "DCTalonite_OnLeaveCombat") function DGuardian_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("DGuardian_Strike", 9000, 0) pUnit:RegisterEvent("DGuardian_Bash", 20000, 0) end function DGuardian_Strike(pUnit,Event) pUnit:FullCastSpellOnTarget(37998,pUnit:GetClosestPlayer()) end function DGuardian_Bash(pUnit,Event) pUnit:FullCastSpellOnTarget(11972,pUnit:GetClosestPlayer()) end function DGuardian_OnDied(pUnit,Event) pUnit:RemoveEvents() end function DGuardian_LeaveCombat(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(20878, 1, "DGuardian_OnEnterCombat") RegisterUnitEvent(20878, 1, "DGuardian_OnDied") RegisterUnitEvent(20878, 1, "DGuardian_LeaveCombat") function Dimp_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Dimp_Firebolt", 6000, 0) end function Dimp_Firebolt(pUnit,Event) pUnit:FullCastSpellOnTarget(36227,pUnit:GetClosestPlayer()) end function Dimp_OnDied(pUnit,Event) pUnit:RemoveEvents() end function Dimp_LeaveCombat(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(20887, 1, "Dimp_OnEnterCombat") RegisterUnitEvent(20887, 2, "Dimp_LeaveCombat") RegisterUnitEvent(20887, 4, "Dimp_OnDied") function DInfernal_Yell(pUnit, Event) pUnit:RemoveEvents() pUnit:CastSpell(36658) end function DInfernal_Start(pUnit, Event) pUnit:RegisterEvent("DInfernal_Yell", 1000, 0) end RegisterUnitEvent(21316, 6, "DInfernal_Start") function Dmine_OnEnterCombat(pUnit,Event) pUnit:GetMainTank() pUnit:CastSpell(5) end function Dmine_LeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Dmine_OnDied(pUnit,Event) pUnit:FullCastSpellOnTarget(38108,pUnit:GetMainTank()) end RegisterUnitEvent(22315, 2, "Dmine_OnEnterCombat") RegisterUnitEvent(22315, 2, "Dmine_LeaveCombat") RegisterUnitEvent(22315, 4, "Dmine_OnDied") function DSmith_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("DSmith_ChaosNova", 6000, 0) pUnit:RegisterEvent("DSmith_DrillArmor", 6000, 0) end function DSmith_ChaosNova(pUnit,Event) pUnit:FullCastSpellOnTarget(36225,pUnit:GetClosestPlayer()) end function DSmith_DrillArmor(pUnit,Event) pUnit:FullCastSpellOnTarget(37580,pUnit:GetClosestPlayer()) end function DSmith_LeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function DSmith_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(19756, 1, "DSmith_OnEnterCombat") RegisterUnitEvent(19756, 2, "DSmith_LeaveCombat") RegisterUnitEvent(19756, 4, "DSmith_OnDied") function DSummoner_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("DSummoner_ShadowBolt", 10000, 0) pUnit:RegisterEvent("DSummoner_ShadowBolt", 16000, 0) end function DSummoner_ShadowBolt(pUnit,Event) pUnit:FullCastSpellOnTarget(9613,pUnit:GetClosestPlayer()) end function DSummoner_FelImmolate(pUnit,Event) pUnit:FullCastSpellOnTarget(37628,pUnit:GetClosestPlayer()) end function DSummoner_OnDeath(pUnit,Event) pUnit:RemoveEvents() end function DSummoner_LeaveCombat(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(20872, 1, "DSummoner_OnEnterCombat") RegisterUnitEvent(20872, 2, "DSummoner_LeaveCombat") RegisterUnitEvent(20872, 4, "DSummoner_OnDeath") function DTinkerer_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("DTinkerer_Spell", 23000, 0) end function DTinkerer_Spell(pUnit,Event) pUnit:FullCastSpellOnTarget(38753,pUnit:GetClosestPlayer()) end function DTinkerer_LeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function DTinkerer_OnDeath(pUnit,Event) pUnit:RemoveEvents() pUnit:CastSpell(38107) end RegisterUnitEvent(19754, 1, "DTinkerer_OnEnterCombat") RegisterUnitEvent(19754, 2, "DTinkerer_LeaveCombat") RegisterUnitEvent(19754, 4, "DTinkerer_OnDeath") function DHInitiate_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("DHInitiate_SpellBreaker", 18000, 0) end function DHInitiate_SpellBreaker(pUnit,Event) pUnit:FullCastSpellOnTarget(35871,pUnit:GetClosestPlayer()) end function DHInitiate_LeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function DHInitiate_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21180, 1, "DHInitiate_OnEnterCombat") RegisterUnitEvent(21180, 2, "DHInitiate_LeaveCombat") RegisterUnitEvent(21180, 4, "DHInitiate_OnDied") function DHSupplicant_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("DHSupplicant_Spell", 40000, 0) end function DHSupplicant_Spell(pUnit,Event) pUnit:CastSpell(37683) end function DHSupplicant_OnDied(pUnit,Event) pUnit:RemoveEvents() end function DHSupplicant_LeaveCombat(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21179, 1, "DHSupplicant_OnEnterCombat") RegisterUnitEvent(21179, 2, "DHSupplicant_LeaveCombat") RegisterUnitEvent(21179, 4, "DHSupplicant_OnDied") function DDPeon_Spell(pUnit, Event) pUnit:RemoveEvents() pUnit:CastSpell(40732) pUnit:RegisterEvent("DDPeon_Spell2", 10000, 0) end function DDPeon_Spell2(pUnit, Event) pUnit:RemoveEvents() pUnit:CastSpell(40735) pUnit:RegisterEvent("DDPeon_Spell3", 20000, 0) end function DDPeon_Spell3(pUnit, Event) pUnit:RemoveEvents() pUnit:CastSpell(40714) pUnit:RegisterEvent("DDPeon_Spell1", 30000, 0) end function DDPeon_Start(pUnit, Event) pUnit:RegisterEvent("DDPeon_Spell", 1000, 0) end RegisterUnitEvent(21316, 6, "DDPeon_Start") function DFelboar_OnEnterCombat(pUnit,Event) pUnit:CastSpell(36462) pUnit:FullCastSpellOnTarget(22120,pUnit:GetClosestPlayer()) end function DFelboar_OnDied(pUnit,Event) pUnit:RemoveEvents() end function DFelboar_LeaveCombat(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21195, 1, "DFelboar_OnEnterCombat") RegisterUnitEvent(21195, 2, "DFelboar_LeaveCombat") RegisterUnitEvent(21195, 4, "DFelboar_OnDied") function DAscendant_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("DAscendant_Cleave", 40000, 0) pUnit:RegisterEvent("DAscendant_MortalStrike", 15000, 0) pUnit:RegisterEvent("DAscendant_Uppercut", 23000, 0) end function DAscendant_Cleave(pUnit,Event) pUnit:FullCastSpellOnTarget(15496,pUnit:GetClosestPlayer()) end function DAscendant_MortalStrike(pUnit,Event) pUnit:FullCastSpellOnTarget(17547,pUnit:GetClosestPlayer()) end function DAscendant_Uppercut(pUnit,Event) pUnit:FullCastSpellOnTarget(10966,pUnit:GetClosestPlayer()) end function DAscendant_LeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function DAscendant_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(22253, 1, "DAscendant_OnEnterCombat") RegisterUnitEvent(22253, 2, "DAscendant_LeaveCombat") RegisterUnitEvent(22253, 4, "DAscendant_OnDied") function DDrakeRider_OnEnterCombat(pUnit,Event) pUnit:FullCastSpellOnTarget(6660,pUnit:GetClosestPlayer()) end function DDrakeRider_LeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function DDrakeRider_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21719, 1, "DDrakeRider_OnEnterCombat") RegisterUnitEvent(21719, 2, "DDrakeRider_LeaveCombat") RegisterUnitEvent(21719, 4, "DDrakeRider_OnDied") function DElite_OnEnterCombat(pUnit,Event) pUnit:FullCastSpellOnTarget(38858,pUnit:GetClosestPlayer()) pUnit:RegisterEvent("DElite_Spell1", 36000, 0) pUnit:RegisterEvent("DElite_Spell2", 50000, 0) end function DElite_Spell1(pUnit,Event) pUnit:FullCastSpellOnTarget(38861,pUnit:GetClosestPlayer()) end function DElite_Spell2(pUnit,Event) pUnit:FullCastSpellOnTarget(38859,pUnit:GetClosestPlayer()) end function DElite_LeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function DElite_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(22331, 1, "DElite_OnEnterCombat") RegisterUnitEvent(22331, 2, "DElite_LeaveCombat") RegisterUnitEvent(22331, 4, "DElite_OnDied") function DNetherDrake_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("DNetherDrake_ArcaneBlast", 11000, 0) end function DNetherDrake_ArcaneBlast(pUnit,Event) pUnit:FullCastSpellOnTarget(38344,pUnit:GetClosestPlayer()) end function DNetherDrake_LeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function DNetherDrake_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(22000, 1, "DNetherDrake_OnEnterCombat") RegisterUnitEvent(22000, 2, "DNetherDrake_LeaveCombat") RegisterUnitEvent(22000, 4, "DNetherDrake_OnDied") function DNPeon_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("DNPeon_Spell", 46000, 0) end function DNPeon_Spell(pUnit,Event) pUnit:FullCastSpellOnTarget(15572,pUnit:GetClosestPlayer()) end function DNPeon_LeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function DNPeon_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(22252, 1, "DNPeon_OnEnterCombat") RegisterUnitEvent(22252, 2, "DNPeon_LeaveCombat") RegisterUnitEvent(22252, 4, "DNPeon_OnDied") local cry_delay = 100000 local announces = {} local announcei = 3 local choice = 1 RegisterUnitEvent(22252, 6, "DragonmawPeon_Random_Setup") announces[1] = "It put the mutton in the stomach!" announces[2] = "WHY IT PUT DA BOOTERANG ON DA SKIN?! WHY?!" announces[3] = "You is bad orc... baaad... or... argh!" function DragonmawPeon_Random_Tick(pUnit, Event) choice = math.random(1, announcei) pUnit:SendChatMessage(12, 0, announces[choice]) end function DragonmawPeon_Random_Setup(pUnit, Event) pUnit:RegisterEvent("DragonmawPeon_Random_Tick", cry_delay, 0) end function DShaman_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("DShaman_LShield", 20000, 0) pUnit:RegisterEvent("DShaman_Bloodlust", 33000, 0) end function DShaman_LShield(pUnit,Event) pUnit:CastSpell(12550) end function DShaman_Bloodlust(pUnit,Event) pUnit:CastSpell(6742) end function DShaman_OnDied(pUnit,Event) pUnit:RemoveEvents() end function DShaman_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21720, 1, "DShaman_OnEnterCombat") RegisterUnitEvent(21720, 2, "DShaman_OnLeaveCombat") RegisterUnitEvent(21720, 4, "DShaman_OnDied") function DSkybreaker_OnEnterCombat(pUnit,Event) pUnit:FullCastSpellOnTarget(38858,pUnit:GetClosestPlayer()) pUnit:RegisterEvent("DSkybreaker_Spell1", 24000, 0) pUnit:RegisterEvent("DSkybreaker_Spell2", 11000, 0) end function DSkybreaker_Spell1(pUnit,Event) pUnit:FullCastSpellOnTarget(38861,pUnit:GetClosestPlayer()) end function DSkybreaker_Spell2(pUnit,Event) pUnit:FullCastSpellOnTarget(41448,pUnit:GetClosestPlayer()) end function DSkybreaker_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function DSkybreaker_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(22274, 1, "DSkybreaker_OnEnterCombat") RegisterUnitEvent(22274, 2, "DSkybreaker_OnLeaveCombat") RegisterUnitEvent(22274, 4, "DSkybreaker_OnDied") function DSubjugator_OnEnterCombat(pUnit,Event) pUnit:FullCastSpellOnTarget(9613,pUnit:GetClosestPlayer()) pUnit:RegisterEvent("DSubjugator_Shadowbolt", 9000, 0) end function DSubjugator_Shadowbolt(pUnit,Event) pUnit:FullCastSpellOnTarget(9613,pUnit:GetClosestPlayer()) end function DSubjugator_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function DSubjugator_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21718, 1, "DSubjugator_OnEnterCombat") RegisterUnitEvent(21718, 2, "DSubjugator_OnLeaveCombat") RegisterUnitEvent(21718, 4, "DSubjugator_OnDied") function DTransporter_OnEnterCombat(pUnit,Event) pUnit:FullCastSpellOnTarget(38858,pUnit:GetClosestPlayer()) pUnit:RegisterEvent("DTransporter_Spell1Shoot", 33000, 0) pUnit:RegisterEvent("DTransporter_Spell2Shoot", 20000, 0) end function DTransporter_Spell1Shoot(pUnit,Event) pUnit:FullCastSpellOnTarget(38861,pUnit:GetClosestPlayer()) end function DTransporter_Spell2Shoot(pUnit,Event) pUnit:FullCastSpellOnTarget(38859,pUnit:GetClosestPlayer()) end function DTransporter_OnDeath(pUnit,Event) pUnit:RemoveEvents() end function DTransporter_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(23188, 1, "DTransporter_OnEnterCombat") RegisterUnitEvent(23188, 2, "DTransporter_OnLeaveCombat") RegisterUnitEvent(23188, 4, "DTransporter_OnDeath") function DWrangler_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("DWrangler_Net", 20000, 0) pUnit:RegisterEvent("DWrangler_Enrage", 1000, 0) end function DWrangler_Net(pUnit,Event) pUnit:FullCastSpellOnTarget(38338,pUnit:GetClosestPlayer()) end function DWrangler_Enrage(pUnit,Event) if pUnit:GetHealthPct() == 94 then pUnit:CastSpell(8599) end end function DWrangler_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function DWrangler_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21717, 1, "DWrangler_OnEnterCombat") RegisterUnitEvent(21717, 2, "DWrangler_OnLeaveCombat") RegisterUnitEvent(21717, 4, "DWrangler_OnDied") function Dreadwarden_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Dreadwarden_Spell1", 34000, 0) pUnit:RegisterEvent("Dreadwarden_Spell2", 21000, 0) end function Dreadwarden_Spell1(pUnit,Event) pUnit:FullCastSpellOnTarget(11443,pUnit:GetClosestPlayer()) end function Dreadwarden_Spell2(pUnit,Event) pUnit:FullCastSpellOnTarget(32736,pUnit:GetClosestPlayer()) end function Dreadwarden_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Dreadwarden_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(19744, 1, "Dreadwarden_OnEnterCombat") RegisterUnitEvent(19744, 2, "Dreadwarden_OnLeaveCombat") RegisterUnitEvent(19744, 4, "Dreadwarden_OnDied") function EArchmage_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("EArchmage_Spell1", 14000, 0) pUnit:RegisterEvent("EArchmage_Spell2", 21000, 0) pUnit:RegisterEvent("EArchmage_Spell3", 10000, 0) end function EArchmage_Spell1(pUnit,Event) pUnit:FullCastSpellOnTarget(37986,pUnit:GetClosestPlayer()) end function EArchmage_Spell2(pUnit,Event) pUnit:FullCastSpellOnTarget(11829,pUnit:GetClosestPlayer()) end function EArchmage_Spell3(pUnit,Event) pUnit:FullCastSpellOnTarget(13878,pUnit:GetClosestPlayer()) end function EArchmage_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function EArchmage_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(19796, 1, "EArchmage_OnEnterCombat") RegisterUnitEvent(19796, 2, "EArchmage_OnLeaveCombat") RegisterUnitEvent(19796, 4, "EArchmage_OnDied") function EBloodwarder_OnEnterCombat(pUnit,Event) pUnit:CastSpell(38311) pUnit:RegisterEvent("EBloodwarder_BloodLeech", 9000, 0) end function EBloodwarder_BloodLeech(pUnit,Event) pUnit:FullCastSpellOnTarget(37838,pUnit:GetClosestPlayer()) end function EBloodwarder_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function EBloodwarder_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(19806, 1, "EBloodwarder_OnEnterCombat") RegisterUnitEvent(19806, 2, "EBloodwarder_OnLeaveCombat") RegisterUnitEvent(19806, 4, "EBloodwarder_OnDied") function ECavalier_OnEnterCombat(pUnit,Event) pUnit:CastSpell(38311) pUnit:RegisterEvent("ECavalier_SpellBreaker", 20000, 0) pUnit:RegisterEvent("ECavalier_BattleShout", 60000, 0) end function ECavalier_SpellBreaker(pUnit,Event) pUnit:CastSpell(35871) end function ECavalier_BattleShout(pUnit,Event) pUnit:CastSpell(30931) end function ECavalier_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function ECavalier_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(22018, 1, "ECavalier_OnEnterCombat") RegisterUnitEvent(22018, 2, "ECavalier_OnLeaveCombat") RegisterUnitEvent(22018, 4, "ECavalier_OnDied") function ECenturion_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("ECenturion_SpellBreaker", 18000, 0) pUnit:RegisterEvent("ECenturion_Bloodheal", 1000, 0) end function ECenturion_SpellBreaker(pUnit,Event) pUnit:FullCastSpellOnTarget(35871,pUnit:GetClosestPlayer()) end function ECenturion_Bloodheal(pUnit,Event) if pUnit:GetHealthPct() == 2 then pUnit:CastSpell(36476) end end function ECenturion_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function ECenturion_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(19792, 1, "ECenturion_OnEnterCombat") RegisterUnitEvent(19792, 2, "ECenturion_OnLeaveCombat") RegisterUnitEvent(19792, 4, "ECenturion_OnDied") function EDragonhawk_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("EDragonhawk_Firebreath", 18000, 0) end function EDragonhawk_Firebreath(pUnit,Event) pUnit:FullCastSpellOnTarget(37985,pUnit:GetClosestPlayer()) end function EDragonhawk_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function EDragonhawk_OnDeath(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(20502, 1, "EDragonhawk_OnEnterCombat") RegisterUnitEvent(20502, 2, "EDragonhawk_OnLeaveCombat") RegisterUnitEvent(20502, 4, "EDragonhawk_OnDeath") function ESoldier_OnEnterCombat(pUnit,Event) if pUnit:GetHealthPct() == 3 then pUnit:CastSpell(36476) end end function ESoldier_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function ESoldier_OnDeath(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(22016, 1, "ESoldier_OnEnterCombat") RegisterUnitEvent(22016, 2, "ESoldier_OnLeaveCombat") RegisterUnitEvent(22016, 4, "ESoldier_OnDeath") function ESpellbinder_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("ESpellbinder_SummonArcane", 11000, (1)) pUnit:RegisterEvent("ESpellbinder_ArcaneMissle", 16000, 0) end function ESpellbinder_SummonArcane(pUnit,Event) pUnit:CastSpell(38171) end function ESpellbinder_ArcaneMissle(pUnit,Event) pUnit:FullCastSpellOnTarget(34447,pUnit:GetClosestPlayer()) end function ESpellbinder_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function ESpellbinder_OnDeath(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(22017, 1, "ESpellbinder_OnEnterCombat") RegisterUnitEvent(22017, 2, "ESpellbinder_OnLeaveCombat") RegisterUnitEvent(22017, 4, "ESpellbinder_OnDeath") function EDemolisher_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("EDemolisher_Stomp", 19000, 0) end function EDemolisher_Stomp(pUnit,Event) pUnit:CastSpell(38045) end function EDemolisher_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function EDemolisher_OnDeath(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21802, 1, "EDemolisher_OnEnterCombat") RegisterUnitEvent(21802, 2, "EDemolisher_OnLeaveCombat") RegisterUnitEvent(21802, 4, "EDemolisher_OnDeath") function AirSpirit_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("AirSpirit_Spell1", 11000, 0) pUnit:RegisterEvent("AirSpirit_Spell2", 25000, 0) end function AirSpirit_Spell1(pUnit,Event) pUnit:FullCastSpellOnTarget(12058,pUnit:GetClosestPlayer()) end function AirSpirit_Spell2(punit,Event) pUnit:FullCastSpellOnTarget(32717,pUnit:GetClosestPlayer()) end function AirSpirit_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function AirSpirit_OnDeath(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21060, 1, "AirSpirit_OnEnterCombat") RegisterUnitEvent(21060, 2, "AirSpirit_OnLeaveCombat") RegisterUnitEvent(21060, 4, "AirSpirit_OnDeath") function EarthSpirit_OnEnterCombat(pUnit,Event) pUnit:CastSpell(38365) pUnit:RegisterEvent("EarthSpirit_Boulder", 8500, 0) end function EarthSpirit_Boulder(pUnit,Event) pUnit:FullCastSpellOnTarget(38498,pUnit:GetClosestPlayer()) end function EarthSpirit_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function EarthSpirit_OnDeath(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21050, 1, "EarthSpirit_OnEnterCombat") RegisterUnitEvent(21050, 2, "EarthSpirit_OnLeaveCombat") RegisterUnitEvent(21050, 4, "EarthSpirit_OnDeath") function FireSpirit_OnEnterCombat(pUnit,Event) pUnit:CastSpell(36006) pUnit:RegisterEvent("FireSpirit_Enrage", 1000, 0) pUnit:RegisterEvent("FireSpirit_FelFireball", 3000, 0) end function FireSpirit_Enrage(pUnit,Event) if pUnit:GetHealthPct() == 97 then pUnit:CastSpell(8599) end end function FireSpirit_FelFireball(pUnit,Event) pUnit:FullCastSpellOnTarget(36247,pUnit:GetClosestPlayer()) end function FireSpirit_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function FireSpirit_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21061, 1, "FireSpirit_OnEnterCombat") RegisterUnitEvent(21061, 2, "FireSpirit_OnLeaveCombat") RegisterUnitEvent(21061, 4, "FireSpirit_OnDied") function WaterSoul_OnEnterCombat(pUnit,Event) pUnit:CastSpell(35923) end RegisterUnitEvent(21109, 1, "WaterSoul_OnEnterCombat") function WaterSpirit_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("WaterSpirit_Stormbolt", 12000, 0) end function WaterSpirit_Stormbolt(pUnit,Event) pUnit:FullCastSpellOnTarget(38032,pUnit:GetClosestPlayer()) end function WaterSpirit_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function WaterSpirit_OnDeath(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21059, 1, "WaterSpirit_OnEnterCombat") RegisterUnitEvent(21059, 1, "WaterSpirit_OnLeaveCombat") RegisterUnitEvent(21059, 1, "WaterSpirit_OnDeath") function ENDrake_OnEnterCombat(pUnit,Event) pUnit:CastSpell(38775) pUnit:RegisterEvent("ENDrake_Spell", 13000, 0) end function ENDrake_Spell(pUnit,Event) pUnit:FullCastSpellOnTarget(36513,pUnit:GetClosestPlayer()) end function ENDrake_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function ENDrake_OnDeath(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21722, 1, "ENDrake_OnEnterCombat") RegisterUnitEvent(21722, 2, "ENDrake_OnLeaveCombat") RegisterUnitEvent(21722, 4, "ENDrake_OnDeath") function ENWhelp_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("ENWhelp_Spell", 4000, 0) end function ENWhelp_Spell(pUnit,Event) pUnit:FullCastSpellOnTarget(38340,pUnit:GetClosestPlayer()) end function ENWhelp_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function ENWhelp_OnDeath(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21721, 1, "ENWhelp_OnEnterCombat") RegisterUnitEvent(21721, 1, "ENWhelp_OnLeaveCombat") RegisterUnitEvent(21721, 1, "ENWhelp_OnDeath") function Eykenen_OnEnterCombat(pUnit,Event) pUnit:CastSpell(32734) pUnit:RegisterEvent("Eykenen_EarthShield", 43000, 0) pUnit:RegisterEvent("Eykenen_EarthShock", 10000, 0) end function Eykenen_EarthShield(pUnit,Event) pUnit:CastSpell(32734) end function Eykenen_EarthShock(pUnit,Event) pUnit:FullCastSpellOnTarget(13281,pUnit:GetClosestPlayer()) end function Eykenen_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Eykenen_OnDeath(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21709, 1, "Eykenen_OnEnterCombat") RegisterUnitEvent(21709, 1, "Eykenen_OnLeaveCombat") RegisterUnitEvent(21709, 1, "Eykenen_OnDeath") function FRSentinel_OnEnterCombat(pUnit,Event) pUnit:CastSpell(38022) pUnit:RegisterEvent("FRSentinel_Boom", 000, 0) pUnit:RegisterEvent("FRSentinel_WorldBreaker", 16000, 0) end function FRSentinel_Boom(pUnit,Event) pUnit:FullCastSpellOnTarget(38052,pUnit:GetClosestPlayer()) end function FRSentinel_WorldBreaker(pUnit,Event) pUnit:FullCastSpellOnTarget(38052,pUnit:GetClosestPlayer()) end function FRSentinel_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function FRSentinel_OnDeath(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21949, 1, "FRSentinel_OnEnterCombat") RegisterUnitEvent(21949, 1, "FRSentinel_OnLeaveCombat") RegisterUnitEvent(21949, 1, "FRSentinel_OnDeath") function FelBoar_OnEnterCombat(pUnit,Event) pUnit:FullCastSpellOnTarget(35570,pUnit:GetClosestPlayer()) end RegisterUnitEvent(21878, 1, "FelBoar_OnEnterCombat") function FDiemetradon_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("FDiemetradon_Spell", 40000, 0) end function FDiemetradon_Spell(pUnit,Event) pUnit:FullCastSpellOnTarget(37941,pUnit:GetClosestPlayer()) end function FDiemetradon_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function FDiemetradon_OnDeath(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21408, 1, "FDiemetradon_OnEnterCombat") RegisterUnitEvent(21408, 2, "FDiemetradon_OnLeaveCombat") RegisterUnitEvent(21408, 4, "FDiemetradon_OnDeath") function Felspine_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Felspine_FelFlames", 11000, 0) pUnit:RegisterEvent("Felspine_FlamingWound", 46000, 0) end function Felspine_FelFlames(pUnit,Event) pUnit:FullCastSpellOnTarget(38356,pUnit:GetClosestPlayer()) end function Felspine_FlamingWound(pUnit,Event) pUnit:FullCastSpellOnTarget(37941,pUnit:GetClosestPlayer()) end function Felspine_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Felspine_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21897, 1, "Felspine_OnEnterCombat") RegisterUnitEvent(21897, 2, "Felspine_OnLeaveCombat") RegisterUnitEvent(21897, 4, "Felspine_OnDied") function GFDiemetradon_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("GFDiemetradon_FelFireball", 11000, 0) pUnit:RegisterEvent("GFDiemetradon_FlamingWound", 51000, 0) end function GFDiemetradon_FelFireball(pUnit,Event) pUnit:FullCastSpellOnTarget(37945,pUnit:GetClosestPlayer()) end function GFDiemetradon_FlamingWound(pUnit,Event) pUnit:FullCastSpellOnTarget(37941,pUnit:GetClosestPlayer()) end function GFDiemetradon_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function GFDiemetradon_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21462, 1, "GFDiemetradon_OnEnterCombat") RegisterUnitEvent(21462, 2, "GFDiemetradon_OnLeaveCombat") RegisterUnitEvent(21462, 4, "GFDiemetradon_OnDied") function Gromtor_OnEnterCombat(pUnit,Event) pUnit:FullCastSpellOnTarget(26281,pUnit:GetClosestPlayer()) pUnit:RegisterEvent("Gromtor_SunderArmor", 120000, 0) pUnit:RegisterEvent("Gromtor_ShieldWall", 22000, 0) pUnit:RegisterEvent("Gromtor_ShieldBlock", 40000, 0) pUnit:RegisterEvent("Gromtor_HeroicStrike", 4000, 0) pUnit:RegisterEvent("Gromtor_BattleShout", 240000, 0) end function Gromtor_SunderArmor(pUnit,Event) pUnit:FullCastSpellOnTarget(16145,pUnit:GetClosestPlayer()) end function Gromtor_ShieldWall(pUnit,Event) pUnit:FullCastSpellOnTarget(15062,pUnit:GetClosestPlayer()) end function Gromtor_ShieldBlock(pUnit,Event) pUnit:FullCastSpellOnTarget(12169,pUnit:GetClosestPlayer()) end function Gromtor_HeroicStrike(pUnit,Event) pUnit:FullCastSpellOnTarget(29426,pUnit:GetClosestPlayer()) end function Gromtor_BattleShout(pUnit,Event) pUnit:FullCastSpellOnTarget(31403,pUnit:GetClosestPlayer()) end function Gromtor_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Gromtor_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21291, 1, "Gromtor_OnEnterCombat") RegisterUnitEvent(21291, 2, "Gromtor_OnLeaveCombat") RegisterUnitEvent(21291, 4, "Gromtor_OnDied") function GRGuard_OnEnterCombat(pUnit,Event) pUnit:FullCastSpellOnTarget(38182,pUnit:GetClosestPlayer()) end RegisterUnitEvent(15241, 1, "GRGuard_OnEnterCombat") function Guldan_Channel(pUnit, Event) pUnit:RemoveEvents() pUnit:CastSpell(35996) end function Guldan_Start(pUnit, Event) pUnit:RegisterEvent("Guldan_Channel", 1000, 0) end RegisterUnitEvent(17008, 6, "Guldan_Start") function Haalum_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Haalum_Chain", 15000, 0) pUnit:RegisterEvent("Haalum_LBolt", 9000, 0) end function Haalum_Chain(pUnit,Event) pUnit:FullCastSpellOnTarget(12058,pUnit:GetClosestPlayer()) end function Haalum_LBolt(pUnit,Event) pUnit:FullCastSpellOnTarget(9532,pUnit:GetClosestPlayer()) end function Haalum_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Haalum_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21711, 1, "Haalum_OnEnterCombat") RegisterUnitEvent(21711, 2, "Haalum_OnLeaveCombat") RegisterUnitEvent(21711, 4, "Haalum_OnDied") function IAgonizer_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("IAgonizer_Firebolt", 6000, 0) end function IAgonizer_Firebolt(pUnit,Event) pUnit:FullCastSpellOnTarget(36227,pUnit:GetClosestPlayer()) end function IAgonizer_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function IAgonizer_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(19801, 1, "IAgonizer_OnEnterCombat") RegisterUnitEvent(19801, 2, "IAgonizer_OnLeaveCombat") RegisterUnitEvent(19801, 4, "IAgonizer_OnDied") function IDreadbringer_OnEnterCombat(pUnit,Event) if pUnit:GetHealthPct() == 91 then pUnit:FullCastSpellOnTarget(38167,pUnit:GetClosestPlayer()) end end RegisterUnitEvent(19799, 1, "IDreadbringer_OnEnterCombat") function IDreadlord_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("IDreadlord_PsychicScream", 23000, 0) pUnit:RegisterEvent("IDreadlord_MindBlast", 7000, 0) pUnit:RegisterEvent("IDreadlord_Sleep", 50000, 0) end function IDreadlord_PsychicScream(pUnit,Event) pUnit:FullCastSpellOnTarget(13704,pUnit:GetClosestPlayer()) end function IDreadlord_MindBlast(pUnit,Event) pUnit:FullCastSpellOnTarget(17287,pUnit:GetClosestPlayer()) end function IDreadlord_Sleep(pUnit,Event) pUnit:FullCastSpellOnTarget(12098,pUnit:GetClosestPlayer()) end function IDreadlord_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function IDreadlord_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21166, 1, "IDreadlord_OnEnterCombat") RegisterUnitEvent(21166, 2, "IDreadlord_OnLeaveCombat") RegisterUnitEvent(21166, 4, "IDreadlord_OnDied") function IHighlord_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("IHighlord_Curseofflames", 240000, 0) pUnit:RegisterEvent("IHighlord_Flamestrike", 10000, 0) pUnit:RegisterEvent("IHighlord_Spell", 0001, 0) end function IHighlord_Curseofflames(pUnit,Event) pUnit:FullCastSpellOnTarget(38010,pUnit:GetClosestPlayer()) end function IHighlord_Spell(pUnit,Event) if pUnit:GetHealthPct() == 92 then pUnit:FullCastSpellOnTarget(38010,pUnit:GetClosestPlayer()) end end function IHighlord_Flamestrike(pUnit,Event) pUnit:FullCastSpellOnTarget(16102,pUnit:GetClosestPlayer()) end function IHighlord_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function IHighlord_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(19797, 1, "IHighlord_OnEnterCombat") RegisterUnitEvent(19797, 2, "IHighlord_OnLeaveCombat") RegisterUnitEvent(19797, 4, "IHighlord_OnDied") function IJailor_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("IJailor_FelShackles", 24000, 0) end function IJailor_FelShackles(pUnit,Event) pUnit:FullCastSpellOnTarget(38051,pUnit:GetClosestPlayer()) end function IJailor_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function IJailor_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21520, 1, "IJailor_OnEnterCombat") RegisterUnitEvent(21520, 2, "IJailor_OnLeaveCombat") RegisterUnitEvent(21520, 4, "IJailor_OnDied") function IMBreaker_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("IMBreaker_Spell1", 34000, 0) pUnit:RegisterEvent("IMBreaker_Spell2", 10000, 0) pUnit:RegisterEvent("IMBreaker_Spell3", 41000, 0) end function IMBreaker_Spell1(pUnit,Event) pUnit:FullCastSpellOnTarget(38985,pUnit:GetClosestPlayer()) end function IMBreaker_Spell2(pUnit,Event) pUnit:FullCastSpellOnTarget(17194,pUnit:GetClosestPlayer()) end function IMBreaker_Spell3(pUnit,Event) pUnit:FullCastSpellOnTarget(22884,pUnit:GetClosestPlayer()) end function IMBreaker_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function IMBreaker_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(22074, 1, "IMBreaker_OnEnterCombat") RegisterUnitEvent(22074, 2, "IMBreaker_OnLeaveCombat") RegisterUnitEvent(22074, 4, "IMBreaker_OnDied") function IOverseer_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("IOverseer_MortalStrike", 20000, 0) pUnit:RegisterEvent("IOverseer_Rend", 50000, 0) end function IOverseer_MortalStrike(pUnit,Event) pUnit:FullCastSpellOnTarget(32736,pUnit:GetClosestPlayer()) end function IOverseer_Rend(pUnit,Event) pUnit:FullCastSpellOnTarget(11977,pUnit:GetClosestPlayer()) end function IOverseer_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function IOverseer_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21808, 1, "IOverseer_OnEnterCombat") RegisterUnitEvent(21808, 2, "IOverseer_OnLeaveCombat") RegisterUnitEvent(21808, 4, "IOverseer_OnDied") function IPainlasher_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("IPainlasher_LashOfPain", 4000, 0) end function IPainlasher_LashOfPain(pUnit,Event) pUnit:FullCastSpellOnTarget(15968,pUnit:GetClosestPlayer()) end function IPainlasher_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function IPainlasher_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(19800, 1, "IPainlasher_OnEnterCombat") RegisterUnitEvent(19800, 2, "IPainlasher_OnLeaveCombat") RegisterUnitEvent(19800, 4, "IPainlasher_OnDied") function IRavager_OnEnterCombat(pUnit,Event) pUnit:FullCastSpellOnTarget(33645,pUnit:GetClosestPlayer()) pUnit:RegisterEvent("IRavager_Cleave", 22000, 0) pUnit:RegisterEvent("IRavager_Cutdown", 9000, 0) pUnit:RegisterEvent("IRavager_Shout", 60000, 0) end function IRavager_Cleave(pUnit,Event) pUnit:FullCastSpellOnTarget(15496,pUnit:GetClosestPlayer()) end function IRavager_Cutdown(pUnit,Event) pUnit:FullCastSpellOnTarget(32009,pUnit:GetClosestPlayer()) end function IRavager_Shout(pUnit,Event) pUnit:CastSpell(16244) end function IRavager_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function IRavager_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(22857, 1, "IRavager_OnEnterCombat") RegisterUnitEvent(22857, 2, "IRavager_OnLeaveCombat") RegisterUnitEvent(22857, 4, "IRavager_OnDied") function ISatyr_OnEnterCombat(pUnit,Event) if pUnit:GetHealthPct() == 97 then pUnit:FullCastSpellOnTarget(38048,pUnit:GetClosestPlayer()) end end RegisterUnitEvent(21656, 1, "ISatyr_OnEnterCombat") function IShadowlord_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("IShadowlord_Sleep", 000, 0) pUnit:RegisterEvent("IShadowlord_CarrionSwarm", 000, 0) pUnit:RegisterEvent("IShadowlord_Inferno", 000, 0) end function IShadowlord_Sleep(pUnit,Event) pUnit:FullCastSpellOnTarget(12098,pUnit:GetClosestPlayer()) end function IShadowlord_CarrionSwarm(pUnit,Event) pUnit:FullCastSpellOnTarget(39942,pUnit:GetClosestPlayer()) end function IShadowlord_Inferno(pUnit,Event) if pUnit:GetHealthPct() == 64 then pUnit:FullCastSpellOnTarget(39942,pUnit:GetClosestPlayer()) end end function IShadowlord_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function IShadowlord_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(22988, 1, "IShadowlord_OnEnterCombat") RegisterUnitEvent(22988, 2, "IShadowlord_OnLeaveCombat") RegisterUnitEvent(22988, 4, "IShadowlord_OnDied") function IShadowstalker_OnEnterCombat(pUnit,Event) pUnit:FullCastSpellOnTarget(7159,pUnit:GetClosestPlayer()) pUnit:RegisterEvent("IShadowstalker_Backstab", 8000, 0) end function IShadowstalker_Backstab(pUnit,Event) pUnit:FullCastSpellOnTarget(7159,pUnit:GetClosestPlayer()) end function IShadowstalker_Stealth(pUnit,Event) pUnit:CastSpell(5916) end function IShadowstalker_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function IShadowstalker_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21337, 1, "IShadowstalker_OnEnterCombat") RegisterUnitEvent(21337, 6, "IShadowstalker_Stealth") RegisterUnitEvent(21337, 2, "IShadowstalker_OnLeaveCombat") RegisterUnitEvent(21337, 4, "IShadowstalker_OnDied") function IShocktrooper_OnEnterCombat(pUnit,Event) pUnit:FullCastSpellOnTarget(22120,pUnit:GetClosestPlayer()) pUnit:RegisterEvent("IShocktrooper_Cleave", 31000, 0) end function IShocktrooper_Cleave(pUnit,Event) pUnit:FullCastSpellOnTarget(15496,pUnit:GetClosestPlayer()) end function IShocktrooper_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function IShocktrooper_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(19802, 1, "IShocktrooper_OnEnterCombat") RegisterUnitEvent(19802, 2, "IShocktrooper_OnLeaveCombat") RegisterUnitEvent(19802, 4, "IShocktrooper_OnDied") function ISlayer_OnEnterCombat(pUnit,Event) pUnit:FullCastSpellOnTarget(35570,pUnit:GetClosestPlayer()) end RegisterUnitEvent(21639, 1, "ISlayer_OnEnterCombat") function ISoldier_OnEnterCombat(pUnit,Event) if pUnit:GetHealthPct() == 92 then pUnit:FullCastSpellOnTarget(35871,pUnit:GetClosestPlayer()) end end RegisterUnitEvent(22075, 1, "ISoldier_OnEnterCombat") function IWatcher_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("IWatcher_MStrike", 35000, 0) end function IWatcher_MStrike(pUnit,Event) pUnit:FullCastSpellOnTarget(32736,pUnit:GetClosestPlayer()) end function IWatcher_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function IWatcher_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(22093, 1, "IWatcher_OnEnterCombat") RegisterUnitEvent(22093, 2, "IWatcher_OnLeaveCombat") RegisterUnitEvent(22093, 4, "IWatcher_OnDied") function ISoul_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("ISoul_Totem", 11000, 0) end function ISoul_Totem(pUnit,Event) pUnit:CastSpell(11969) end function ISoul_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function ISoul_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(19757, 1, "ISoul_OnEnterCombat") RegisterUnitEvent(19757, 2, "ISoul_OnLeaveCombat") RegisterUnitEvent(19757, 4, "ISoul_OnDied") function Karsius_OnEnterCombat(pUnit,Event) pUnit:FullCastSpellOnTarget(37789,pUnit:GetClosestPlayer()) end function Karsius_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Karsius_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21877, 1, "Karsius_OnEnterCombat") RegisterUnitEvent(21877, 2, "Karsius_OnLeaveCombat") RegisterUnitEvent(21877, 4, "Karsius_OnDied") function KotCistern_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("KotCistern_Waterbolt", 4000, 0) end function KotCistern_Waterbolt(pUnit,Event) pUnit:FullCastSpellOnTarget(32011,pUnit:GetClosestPlayer()) end function KotCistern_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function KotCistern_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(20795, 1, "KotCistern_OnEnterCombat") RegisterUnitEvent(20795, 2, "KotCistern_OnLeaveCombat") RegisterUnitEvent(20795, 4, "KotCistern_OnDied") function KDefender_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("KDefender_Cleave", 11000, 0) end function KDefender_Cleave(pUnit,Event) pUnit:FullCastSpellOnTarget(15496,pUnit:GetMainTank()) end function KDefender_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function KDefender_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(19362, 1, "KDefender_OnEnterCombat") RegisterUnitEvent(19362, 2, "KDefender_OnLeaveCombat") RegisterUnitEvent(19362, 4, "KDefender_OnDied") function KRider_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("KRider_SnapKick", 6000, 0) pUnit:RegisterEvent("KRider_MortalStrike", 13000, 0) end function KRider_SnapKick(pUnit,Event) pUnit:FullCastSpellOnTarget(15618,pUnit:GetClosestPlayer()) end function KRider_MortalStrike(pUnit,Event) pUnit:FullCastSpellOnTarget(19643,pUnit:GetClosestPlayer()) end function KRider_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function KRider_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(19364, 1, "KRider_OnEnterCombat") RegisterUnitEvent(19364, 2, "KRider_OnLeaveCombat") RegisterUnitEvent(19364, 4, "KRider_OnDied") function LadyShavRar_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("LadyShavRar_ArcaneBolt", 8500, 0) pUnit:RegisterEvent("LadyShavRar_Freeze", 43000, 0) end function LadyShavRar_ArcaneBolt(pUnit,Event) pUnit:FullCastSpellOnTarget(13901,pUnit:GetClosestPlayer()) end function LadyShavRar_Freeze(pUnit,Event) pUnit:FullCastSpellOnTarget(38035,pUnit:GetClosestPlayer()) end function LadyShavRar_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function LadyShavRar_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(20684, 1, "LadyShavRar_OnEnterCombat") RegisterUnitEvent(20684, 2, "LadyShavRar_OnLeaveCombat") RegisterUnitEvent(20684, 4, "LadyShavRar_OnDied") function Lakaan_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Lakaan_WaterBolt", 4000, 0) end function Lakaan_WaterBolt(pUnit,Event) pUnit:FullCastSpellOnTarget(32011,pUnit:GetClosestPlayer()) end function Lakaan_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Lakaan_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21416, 1, "Lakaan_OnEnterCombat") RegisterUnitEvent(21416, 2, "Lakaan_OnLeaveCombat") RegisterUnitEvent(21416, 4, "Lakaan_OnDied") function LFCannon_OnEnterCombat(pUnit,Event) if pUnit:GetHealthPct() == 70 then pUnit:FullCastSpellOnTarget(36238,pUnit:GetClosestPlayer()) end end RegisterUnitEvent(21233, 1, "LFCannon_OnEnterCombat") function LERider_OnEnterCombat(pUnit,Event) pUnit:CastSpell(39782) pUnit:CastSpellOnTarget(31888,pUnit:GetClosestPlayer()) end RegisterUnitEvent(22966, 1, "LERider_OnEnterCombat") function LVindicator_OnEnterCombat(pUnit,Event) pUnit:FullCastSpellOnTarget(13005,pUnit:GetClosestPlayer()) pUnit:RegisterEvent("LVindicator_Exorcism", 11000, 0) pUnit:RegisterEvent("LVindicator_HolyLight", 16000, 0) end function LVindicator_Exorcism(pUnit,Event) pUnit:FullCastSpellOnTarget(33632,pUnit:GetClosestPlayer()) end function LVindicator_HolyLight(pUnit,Event) pUnit:FullCastSpellOnTarget(13952,pUnit:GetRandomFriend(0)) end function LVindicator_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function LVindicator_OnDied(pUnit,Event) pUnit:FullCastSpellOnTarget(13903,pUnit:GetRandomFriend(0)) end RegisterUnitEvent(22861, 1, "LVindicator_OnEnterCombat") RegisterUnitEvent(22861, 2, "LVindicator_OnLeaveCombat") RegisterUnitEvent(22861, 4, "LVindicator_OnDied") function Lothros_OnEnterCombat(pUnit,Event) pUnit:RegisterUnitEvent("Lothros_Spell", 60000, 0) end function Lothros_Spell(pUnit,Event) pUnit:FullCastSpellOnTarget(38167,pUnit:GetClosestPlayer()) end function Lothros_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Lothros_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21928, 1, "Lothros_OnEnterCombat") RegisterUnitEvent(21928, 2, "Lothros_OnLeaveCombat") RegisterUnitEvent(21928, 4, "Lothros_OnDied") function Makazradon_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Makazradon_Cripple", 45000, 0) pUnit:RegisterEvent("Makazradon_FelCleave", 19000, 0) pUnit:RegisterEvent("Makazradon_RainOfFire", 18000, 0) end function Makazradon_Cripple(pUnit,Event) pUnit:FullCastSpellOnTarget(11443,pUnit:GetClosestPlayer()) end function Makazradon_FelCleave(pUnit,Event) pUnit:FullCastSpellOnTarget(38742,pUnit:GetClosestPlayer()) end function Makazradon_RainOfFire(pUnit,Event) pUnit:FullCastSpellOnTarget(38741,pUnit:GetClosestPlayer()) end function Makazradon_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Makazradon_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21501, 1, "Makazradon_OnEnterCombat") RegisterUnitEvent(21501, 2, "Makazradon_OnLeaveCombat") RegisterUnitEvent(21501, 4, "Makazradon_OnDied") function MatureNetherwingDrake_OnEnterCombat(pUnit,Event) pUnit:CastSpell(38502) pUnit:RegisterEvent("MatureNetherwingDrake_IntangiblePresence", 16000, 0) pUnit:RegisterEvent("MatureNetherwingDrake_Netherbreath", 5000, 0) end function MatureNetherwingDrake_IntangiblePresence(pUnit,Event) pUnit:FullCastSpellOnTarget(36513,pUnit:GetClosestPlayer()) end function MatureNetherwingDrake_Netherbreath(pUnit,Event) pUnit:FullCastSpellOnTarget(38467,pUnit:GetClosestPlayer()) end function MatureNetherwingDrake_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function MatureNetherwingDrake_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21648, 1, "MatureNetherwingDrake_OnEnterCombat") RegisterUnitEvent(21648, 2, "MatureNetherwingDrake_OnLeaveCombat") RegisterUnitEvent(21648, 4, "MatureNetherwingDrake_OnDied") function MoArgWeaponsmith_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("MoArgWeaponsmith_ChemicalFlames", 13000, 0) pUnit:RegisterEvent("MoArgWeaponsmith_DrillArmor", 18000, 0) end function MoArgWeaponsmith_ChemicalFlames(pUnit,Event) pUnit:FullCastSpellOnTarget(36253,pUnit:GetClosestPlayer()) end function MoArgWeaponsmith_DrillArmor(pUnit,Event) pUnit:FullCastSpellOnTarget(37580,pUnit:GetClosestPlayer()) end function MoArgWeaponsmith_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function MoArgWeaponsmith_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(19755, 1, "MoArgWeaponsmith_OnEnterCombat") RegisterUnitEvent(19755, 2, "MoArgWeaponsmith_OnLeaveCombat") RegisterUnitEvent(19755, 4, "MoArgWeaponsmith_OnDied") function Mordenai_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Mordenai_Shoot", 2000, 0) pUnit:RegisterEvent("Mordenai_Start", 2000, 0) end function Mordenai_Shoot(pUnit,Event) pUnit:FullCastSpellOnTarget(38372,pUnit:GetClosestPlayer()) end function Mordenai_Start(pUnit,Eevnt) if pUnit:GetHealthPct() == 98 then pUnit:RemoveEvents() pUnit:RegisterEvent("Mordenai_AimedShot", 16000, 0) pUnit:RegisterEvent("Mordenai_ArcaneShot", 6000, 0) end end function Mordenai_AimedShot(pUnit,Event) pUnit:FullCastSpellOnTarget(38370,pUnit:GetClosestPlayer()) end function Mordenai_ArcaneShot(pUnit,Event) pUnit:FullCastSpellOnTarget(36623,pUnit:GetClosestPlayer()) end function Mordenai_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Mordenai_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(22113, 1, "Mordenai_OnEnterCombat") RegisterUnitEvent(22113, 2, "Mordenai_OnLeaveCombat") RegisterUnitEvent(22113, 4, "Mordenai_OnDied") function Morgroron_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Morgroron_MortalCleave", 12000, 0) pUnit:RegisterEvent("Morgroron_RainOfFire", 18000, 0) pUnit:RegisterEvent("Morgroron_WarStomp", 7000, 0) end function Morgroron_MortalCleave(pUnit,Event) pUnit:FullCastSpellOnTarget(22859,pUnit:GetClosestPlayer()) end function Morgroron_RainOfFire(pUnit,Event) pUnit:FullCastSpellOnTarget(38741,pUnit:GetClosestPlayer()) end function Morgroron_WarStomp(pUnit,Event) pUnit:FullCastSpellOnTarget(38750,pUnit:GetClosestPlayer()) end function Morgroron_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Morgroron_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21500, 1, "Morgroron_OnEnterCombat") RegisterUnitEvent(21500, 2, "Morgroron_OnLeaveCombat") RegisterUnitEvent(21500, 4, "Morgroron_OnDied") function MutantHorror_OnEnterCombat(pUnit,Event) pUnit:CastSpell(8599) pUnit:RegisterEvent("MutantHorror_MutatedBlood", 45000, 0) end function MutantHorror_MutatedBlood(pUnit,Event) pUnit:FullCastSpellOnTarget(37950,pUnit:GetClosestPlayer()) end function MutantHorror_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function MutantHorror_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21305, 1, "MutantHorror_OnEnterCombat") RegisterUnitEvent(21305, 2, "MutantHorror_OnLeaveCombat") RegisterUnitEvent(21305, 4, "MutantHorror_OnDied") function Netharel_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Netharel_DebilitatingStrike", 15000, 0) pUnit:RegisterEvent("Netharel_Evasion", 30000, 0) pUnit:RegisterEvent("Netharel_ManaBurn", 7000, 0) pUnit:RegisterEvent("Netharel_Metamorphosis", 1000, 1) end function Netharel_DebilitatingStrike(pUnit,Event) pUnit:FullCastSpellOnTarget(39135,pUnit:GetClosestPlayer()) end function Netharel_Evasion(pUnit,Event) pUnit:FullCastSpellOnTarget(37683,pUnit:GetClosestPlayer()) end function Netharel_ManaBurn(pUnit,Event) pUnit:FullCastSpellOnTarget(39262,pUnit:GetClosestPlayer()) end function Netharel_Metamorphosis(pUnit,Event) if pUnit:GetHealthPct() == 10 then pUnit:CastSpell(36298) end end function Netharel_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Netharel_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21164, 1, "Netharel_OnEnterCombat") RegisterUnitEvent(21164, 2, "Netharel_OnLeaveCombat") RegisterUnitEvent(21164, 4, "Netharel_OnDied") function NethermineBurster_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("NethermineBurster_Poison", 2000, 0) end function NethermineBurster_Poison(pUnit,Event) pUnit:FullCastSpellOnTarget(31747,pUnit:GetClosestPlayer()) end function NethermineBurster_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function NethermineBurster_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(23285, 1, "NethermineBurster_OnEnterCombat") RegisterUnitEvent(23285, 2, "NethermineBurster_OnLeaveCombat") RegisterUnitEvent(23285, 4, "NethermineBurster_OnDied") function NethermineFlayer_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("NethermineFlayer_Rend", 30000, 0) pUnit:RegisterEvent("NethermineFlayer_ShredArmor", 31000, 0) end function NethermineFlayer_Rend(pUnit,Event) pUnit:FullCastSpellOnTarget(13443,pUnit:GetClosestPlayer()) end function NethermineFlayer_ShredArmor(pUnit,Event) pUnit:FullCastSpellOnTarget(40770,pUnit:GetClosestPlayer()) end function NethermineFlayer_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function NethermineFlayer_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(23169, 1, "NethermineFlayer_OnEnterCombat") RegisterUnitEvent(23169, 2, "NethermineFlayer_OnLeaveCombat") RegisterUnitEvent(23169, 4, "NethermineFlayer_OnDied") function NethermineRavager_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("NethermineRavager_Rend", 15000, 0) pUnit:RegisterEvent("NethermineRavager_RockShell", 18000, 0) end function NethermineRavager_Rend(pUnit,Event) pUnit:FullCastSpellOnTarget(13443,pUnit:GetClosestPlayer()) end function NethermineRavager_RockShell(pUnit,Event) pUnit:FullCastSpellOnTarget(33810,pUnit:GetClosestPlayer()) end function NethermineRavager_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function NethermineRavager_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(23326, 1, "NethermineRavager_OnEnterCombat") RegisterUnitEvent(23326, 2, "NethermineRavager_OnLeaveCombat") RegisterUnitEvent(23326, 4, "NethermineRavager_OnDied") function Netherskate_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Netherskate_DrainMana", 1000, 0) pUnit:RegisterEvent("Netherskate_TailSting", 32000, 0) end function Netherskate_DrainMana(pUnit,Event) if pUnit:GetManaPct() == 92 then pUnit:FullCastSpellOnTarget(17008,pUnit:GetRandomPlayer(4)) end end function Netherskate_TailSting(pUnit,Event) pUnit:FullCastSpellOnTarget(36659,pUnit:GetClosestPlayer()) end function Netherskate_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Netherskate_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21901, 1, "Netherskate_OnEnterCombat") RegisterUnitEvent(21901, 2, "Netherskate_OnLeaveCombat") RegisterUnitEvent(21901, 4, "Netherskate_OnDied") function NetherwingRay_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("NetherwingRay_DrainMana", 1000, 0) pUnit:RegisterEvent("NetherwingRay_TailSting", 32000, 0) end function NetherwingRay_DrainMana(pUnit,Event) if pUnit:GetManaPct() == 92 then pUnit:FullCastSpellOnTarget(17008,pUnit:GetRandomPlayer(4)) end end function NetherwingRay_TailSting(pUnit,Event) pUnit:FullCastSpellOnTarget(36659,pUnit:GetClosestPlayer()) end function NetherwingRay_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function NetherwingRay_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(23501, 1, "NetherwingRay_OnEnterCombat") RegisterUnitEvent(23501, 2, "NetherwingRay_OnLeaveCombsat") RegisterUnitEvent(23501, 4, "NetherwingRay_OnDied") function OrkaosTheInsane_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("OrkaosTheInsane_Cleave", 14000, 0) pUnit:RegisterEvent("OrkaosTheInsane_MortalStrike", 16000, 0) pUnit:RegisterEvent("OrkaosTheInsane_Uppercut", 8000, 0) end function OrkaosTheInsane_Cleave(pUnit,Event) pUnit:FullCastSpellOnTarget(15496,pUnit:GetClosestPlayer()) end function OrkaosTheInsane_MortalStrike(pUnit,Event) pUnit:FullCastSpellOnTarget(17547,pUnit:GetClosestPlayer()) end function OrkaosTheInsane_Uppercut(pUnit,Event) pUnit:FullCastSpellOnTarget(10966,pUnit:GetClosestPlayer()) end function OrkaosTheInsane_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function OrkaosTheInsane_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(23168, 1, "OrkaosTheInsane_OnEnterCombat") RegisterUnitEvent(23168, 2, "OrkaosTheInsane_OnLeaveCombsat") RegisterUnitEvent(23168, 4, "OrkaosTheInsane_OnDied") function OronokTornheart_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("OronokTornheart_ChainLightning", 1200, 0) pUnit:RegisterEvent("OronokTornheart_FrostShock", 16000, 0) pUnit:RegisterEvent("OronokTornheart_HealingWave", 5000, 0) end function OronokTornheart_ChainLightning(pUnit,Event) pUnit:FullCastSpellOnTarget(16006,pUnit:GetClosestPlayer()) end function OronokTornheart_FrostShock(pUnit,Event) pUnit:FullCastSpellOnTarget(12548,pUnit:GetClosestPlayer()) end function OronokTornheart_HealingWave(pUnit,Event) pUnit:FullCastSpellOnTarget(12491,pUnit:GetRandomFriend()) end function OronokTornheart_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function OronokTornheart_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21183, 1, "OronokTornheart_OnEnterCombat") RegisterUnitEvent(21183, 2, "OronokTornheart_OnLeaveCombsat") RegisterUnitEvent(21183, 4, "OronokTornheart_OnDied") function OronuTheElder_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("OronuTheElder_GroundingTotem", 45000, 0) pUnit:RegisterEvent("OronuTheElder_HealingWave", 11000, 0) pUnit:RegisterEvent("OronuTheElder_LightningShield", 30000, 0) end function OronuTheElder_GroundingTotem(pUnit,Event) pUnit:CastSpell(34079) end function OronuTheElder_HealingWave(pUnit,Event) pUnit:FullCastSpellOnTarget(11986,pUnit:GetRandomFriend()) end function OronuTheElder_LightningShield(pUnit,Event) pUnit:CastSpell(12550) end function OronuTheElder_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function OronuTheElder_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21663, 1, "OronuTheElder_OnEnterCombat") RegisterUnitEvent(21663, 2, "OronuTheElder_OnLeaveCombsat") RegisterUnitEvent(21663, 4, "OronuTheElder_OnDied") function OvermineFlayer_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("OvermineFlayer_Rend", 30000, 0) pUnit:RegisterEvent("OvermineFlayer_RockShell", 18000, 0) end function OvermineFlayer_Rend(pUnit,Event) pUnit:FullCastSpellOnTarget(13443,pUnit:GetClosestPlayer()) end function OvermineFlayer_RockShell(pUnit,Event) pUnit:CastSpell(33810) end function OronuTheElder_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function OronuTheElder_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(23264, 1, "OvermineFlayer_OnEnterCombat") RegisterUnitEvent(23264, 2, "OvermineFlayer_OnLeaveCombsat") RegisterUnitEvent(23264, 4, "OvermineFlayer_OnDied") function OverseerRipsaw_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("OverseerRipsaw_GushingWound", 25000, 0) pUnit:RegisterEvent("OverseerRipsaw_SawBlade", 2500, 0) end function OverseerRipsaw_GushingWound(pUnit,Event) pUnit:FullCastSpellOnTarget(35321,pUnit:GetClosestPlayer()) end function OverseerRipsaw_SawBlade(pUnit,Event) pUnit:FullCastSpellOnTarget(32735,pUnit:GetClosestPlayer()) end function OverseerRipsaw_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function OverseerRipsaw_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21499, 1, "OverseerRipsaw_OnEnterCombat") RegisterUnitEvent(21499, 2, "OverseerRipsaw_OnLeaveCombsat") RegisterUnitEvent(21499, 4, "OverseerRipsaw_OnDied") function PainmistressGabrissa_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("PainmistressGabrissa_CurseOfPain", 120000, 0) end function PainmistressGabrissa_CurseOfPain(pUnit,Event) pUnit:FullCastSpellOnTarget(38048,pUnit:GetClosestPlayer()) if pUnit:GetHealthPct() == 50 then pUnit:RemoveEvents() end end function PainmistressGabrissa_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function PainmistressGabrissa_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21309, 1, "PainmistressGabrissa_OnEnterCombat") RegisterUnitEvent(21309, 2, "PainmistressGabrissa_OnLeaveCombsat") RegisterUnitEvent(21309, 4, "PainmistressGabrissa_OnDied") function ProphetessCavrylin_OnEnterCombat(pUnit,Event) pUnit:FullCastSpellOnTarget(36656,pUnit:GetClosestPlayer()) pUnit:CastSpell(37997) pUnit:RegisterEvent("ProphetessCavrylin_MeltFlesh", 15000, 0) end function ProphetessCavrylin_MeltFlesh(pUnit,Event) pUnit:FullCastSpellOnTarget(37629,pUnit:GetClosestPlayer()) end function ProphetessCavrylin_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function ProphetessCavrylin_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(20683, 1, "ProphetessCavrylin_OnEnterCombat") RegisterUnitEvent(20683, 2, "ProphetessCavrylin_OnLeaveCombsat") RegisterUnitEvent(20683, 4, "ProphetessCavrylin_OnDied") function RavenousFlayerMatriarch_OnEnterCombat(pUnit,Event) pUnit:CastSpell(36464) pUnit:RegisterEvent("RavenousFlayerMatriarch_GushingWound", 25000, 0) end function RavenousFlayerMatriarch_GushingWound(pUnit,Event) pUnit:FullCastSpellOnTarget(38363,pUnit:GetClosestPlayer()) end function RavenousFlayerMatriarch_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function RavenousFlayerMatriarch_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21205, 1, "RavenousFlayerMatriarch_OnEnterCombat") RegisterUnitEvent(21205, 2, "RavenousFlayerMatriarch_OnLeaveCombsat") RegisterUnitEvent(21205, 4, "RavenousFlayerMatriarch_OnDied") function RemnantofCorruption_OnSpawn(pUnit,Event) pUnit:CastSpell(39169) end RegisterUnitEvent(22439, 6, "RemnantofCorruption_OnSpawn") function RemnantofGreed_OnSpawn(pUnit,Event) pUnit:CastSpell(39168) end RegisterUnitEvent(22438, 6, "RemnantofGreed_OnSpawn") function RemnantofHate_OnSpawn(pUnit,Event) pUnit:CastSpell(38696) end RegisterUnitEvent(22094, 6, "RemnantofHate_OnSpawn") function RemnantofMalice_OnSpawn(pUnit,Event) pUnit:CastSpell(38695) end RegisterUnitEvent(22437, 6, "RemnantofMalice_OnSpawn") function RocknailFlayer_OnEnterCombat(pUnit,Event) pUnit:RegisterUnitEvent("RocknailFlayer_FlayedFlesh", 30000, 0) end function RocknailFlayer_FlayedFlesh(pUnit,Event) pUnit:FullCastSpellOnTarget(37937,pUnit:GetClosestPlayer()) end function RocknailFlayer_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function RocknailFlayer_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21477, 1, "RocknailFlayer_OnEnterCombat") RegisterUnitEvent(21477, 2, "RocknailFlayer_OnLeaveCombat") RegisterUnitEvent(21477, 4, "RocknailFlayer_OnDied") function RocknailRipper_OnEnterCombat(pUnit,Event) pUnit:RegisterUnitEvent("RocknailRipper_Rip", 11000, 0) end function RocknailRipper_Rip(pUnit,Event) pUnit:FullCastSpellOnTarget(37937,pUnit:GetClosestPlayer()) end function RocknailRipper_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function RocknailRipper_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21478, 1, "RocknailRipper_OnEnterCombat") RegisterUnitEvent(21478, 2, "RocknailRipper_OnLeaveCombat") RegisterUnitEvent(21478, 4, "RocknailRipper_OnDied") function RuulTheDarkener_OnEnterCombat(pUnit,Event) pUnit:RegisterUnitEvent("RuulTheDarkener_Cleave", 15000, 0) pUnit:RegisterUnitEvent("RuulTheDarkener_Spellbreaker", 18000, 0) local Choice=math.random(1,2) if Choice==1 then pUnit:SendChatMessage(14, 0, "Your world is at an end.") elseif Choice==2 then pUnit:SendChatMessage(14, 0, "The skies will darken and all will go quiet. Only then will you know the sweet serenity of death.") end end function RuulTheDarkener_Cleave(pUnit,Event) pUnit:FullCastSpellOnTarget(15284,pUnit:GetClosestPlayer()) end function RuulTheDarkener_Spellbreaker(pUnit,Event) pUnit:FullCastSpellOnTarget(35871,pUnit:GetClosestPlayer()) end function RuulTheDarkener_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function RuulTheDarkener_OnDied(pUnit,Event) pUnit:SpawnCreature(22106) pUnit:RemoveEvents() end RegisterUnitEvent(21315, 1, "RuulTheDarkener_OnEnterCombat") RegisterUnitEvent(21315, 2, "RuulTheDarkener_OnLeaveCombat") RegisterUnitEvent(21315, 4, "RuulTheDarkener_OnDied") function RuulsNetherdrake_OnEnterCombat(pUnit,Event) pUnit:FullCastSpellOnTarget(38344,pUnit:GetClosestPlayer()) pUnit:FullCastSpellOnTarget(36513,pUnit:GetClosestPlayer()) pUnit:RegisterEvent("RuulsNetherdrake_ArcaneBlast", 000, 0) end function RuulsNetherdrake_ArcaneBlast(pUnit,Event) pUnit:FullCastSpellOnTarget(38344,pUnit:GetClosestPlayer()) end function RuulsNetherdrake_OnDied(pUnit,Event) pUnit:RemoveEvents() end function RuulsNetherdrake_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(22106, 1, "RuulsNetherdrake_OnEnterCombat") RegisterUnitEvent(22106, 2, "RuulsNetherdrake_OnLeaveCombat") RegisterUnitEvent(22106, 4, "RuulsNetherdrake_OnDied") function SanctumDefender_OnEnterCombat(pUnit,Event) pUnit:FullCastSpellOnTarget(41440,pUnit:GetClosestPlayer()) end RegisterUnitEvent(23435, 1, "SanctumDefender_OnEnterCombat") function ScorchshellPincer_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("ScorchshellPincer_BurningPoison", 000, 0) end function ScorchshellPincer_BurningPoison(pUnit,Event) pUnit:FullCastSpellOnTarget(15284,pUnit:GetClosestPlayer()) end function ScorchshellPincer_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function ScorchshellPincer_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21864, 1, "ScorchshellPincer_OnEnterCombat") RegisterUnitEvent(21864, 2, "ScorchshellPincer_OnLeaveCombat") RegisterUnitEvent(21864, 4, "ScorchshellPincer_OnDied") function ScornedSpiritofAir_OnSpawn(pUnit,Event) pUnit:CastSpell(36206) end RegisterUnitEvent(21132, 6, "ScornedSpiritofAir_OnSpawn") function ScornedSpiritofEarth_OnSpawn(pUnit,Event) pUnit:CastSpell(36206) end RegisterUnitEvent(21129, 6, "ScornedSpiritofEarth_OnSpawn") function ScornedSpiritofFire_OnSpawn(pUnit,Event) pUnit:CastSpell(36206) end RegisterUnitEvent(21130, 6, "ScornedSpiritofFire_OnSpawn") function ScornedSpiritofWater_OnSpawn(pUnit,Event) pUnit:CastSpell(36206) end RegisterUnitEvent(21131, 6, "ScornedSpiritofWater_OnSpawn") function ScryerCavalier_OnEnterCombat(pUnit,Event) pUnit:CastSpell(30931) pUnit:registerEvent("ScryerCavalier_Spellbreaker", 24000, 0) end function ScryerCavalier_Spellbreaker(pUnit,Event) pUnit:FullCastSpellOnTarget(35871,pUnit:GetClosestPlayer()) end function ScryerCavalier_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function ScryerCavalier_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(22967, 1, "ScryerCavalier_OnEnterCombat") RegisterUnitEvent(22967, 2, "ScryerCavalier_OnLeaveCombat") RegisterUnitEvent(22967, 4, "ScryerCavalier_OnDied") function ScryerGuardian_OnEnterCombat(pUnit,Event) pUnit:registerEvent("ScryerGuardian_Fireball", 7000, 0) pUnit:registerEvent("ScryerGuardian_Scorch", 5000, 0) pUnit:registerEvent("ScryerGuardian_Slow", 40000, 0) end function ScryerGuardian_Fireball(pUnit,Event) pUnit:FullCastSpellOnTarget(15228,pUnit:GetClosestPlayer()) end function ScryerGuardian_Scorch(pUnit,Event) pUnit:FullCastSpellOnTarget(17195,pUnit:GetClosestPlayer()) end function ScryerGuardian_Slow(pUnit,Event) pUnit:FullCastSpellOnTarget(11436,pUnit:GetClosestPlayer()) end function ScryerGuardian_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function ScryerGuardian_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(19504, 1, "ScryerGuardian_OnEnterCombat") RegisterUnitEvent(19504, 2, "ScryerGuardian_OnLeaveCombat") RegisterUnitEvent(19504, 4, "ScryerGuardian_OnDied") function SeasonedMagister_OnEnterCombat(pUnit,Event) pUnit:registerEvent("SeasonedMagister_Fireball", 3000, 0) end function SeasonedMagister_Fireball(pUnit,Event) pUnit:FullCastSpellOnTarget(15228,pUnit:GetClosestPlayer()) end function SeasonedMagister_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function SeasonedMagister_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(22863, 1, "SeasonedMagister_OnEnterCombat") RegisterUnitEvent(22863, 2, "SeasonedMagister_OnLeaveCombat") RegisterUnitEvent(22863, 4, "SeasonedMagister_OnDied") function ShadowCouncilWarlock_OnEnterCombat(pUnit,Event) pUnit:SetCombatMeleeCapable(1) pUnit:registerEvent("ShadowCouncilWarlock_DrainLife", 24000, 0) pUnit:registerEvent("ShadowCouncilWarlock_ShadowBolt", 2500, 0) end function ShadowCouncilWarlock_DrainLife(pUnit,Event) pUnit:FullCastSpellOnTarget(37992,pUnit:GetClosestPlayer()) end function ShadowCouncilWarlock_ShadowBolt(pUnit,Event) pUnit:FullCastSpellOnTarget(9613,pUnit:GetClosestPlayer()) end function ShadowCouncilWarlock_OnLeaveCombat(pUnit,Event) pUnit:SetCombatMeleeCapable(0) pUnit:RemoveEvents() end function ShadowCouncilWarlock_OnDied(pUnit,Event) pUnit:SetCombatMeleeCapable(0) pUnit:RemoveEvents() end RegisterUnitEvent(21302, 1, "ShadowCouncilWarlock_OnEnterCombat") RegisterUnitEvent(21302, 2, "ShadowCouncilWarlock_OnLeaveCombat") RegisterUnitEvent(21302, 4, "ShadowCouncilWarlock_OnDied") function ShadowhoofAssassin_OnEnterCombat(pUnit,Event) pUnit:registerEvent("ShadowhoofAssassin_DebilitatingStrike", 15000, 0) pUnit:registerEvent("ShadowhoofAssassin_SinisterStrike", 6000, 0) end function ShadowhoofAssassin_DebilitatingStrike(pUnit,Event) pUnit:FullCastSpellOnTarget(37577,pUnit:GetClosestPlayer()) end function ShadowhoofAssassin_SinisterStrike(pUnit,Event) pUnit:FullCastSpellOnTarget(14873,pUnit:GetClosestPlayer()) end function ShadowhoofAssassin_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function ShadowhoofAssassin_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(22858, 1, "ShadowhoofAssassin_OnEnterCombat") RegisterUnitEvent(22858, 2, "ShadowhoofAssassin_OnLeaveCombat") RegisterUnitEvent(22858, 4, "ShadowhoofAssassin_OnDied") function ShadowhoofSummoner_OnEnterCombat(pUnit,Event) pUnit:SetCombatMeleeCapable(1) pUnit:registerEvent("ShadowhoofSummoner_CurseOfTongues", 30000, 0) pUnit:registerEvent("ShadowhoofSummoner_ShadowBolt", 3000, 0) end function ShadowhoofSummoner_CurseOfTongues(pUnit,Event) pUnit:FullCastSpellOnTarget(13338,pUnit:GetClosestPlayer()) end function ShadowhoofSummoner_ShadowBolt(pUnit,Event) pUnit:FullCastSpellOnTarget(9613,pUnit:GetClosestPlayer()) end function ShadowhoofSummoner_OnLeaveCombat(pUnit,Event) pUnit:SetCombatMeleeCapable(0) pUnit:RemoveEvents() end function ShadowhoofSummoner_OnDied(pUnit,Event) pUnit:SetCombatMeleeCapable(0) pUnit:RemoveEvents() end RegisterUnitEvent(22859, 1, "ShadowhoofSummoner_OnEnterCombat") RegisterUnitEvent(22859, 2, "ShadowhoofSummoner_OnLeaveCombat") RegisterUnitEvent(22859, 4, "ShadowhoofSummoner_OnDied") function ShadowlordDeathwail_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("ShadowlordDeathwail_DeathCoil", 18000, 0) pUnit:RegisterEvent("ShadowlordDeathwail_Fear", 24000, 0) pUnit:RegisterEvent("ShadowlordDeathwail_FelFireball", 11000, 0) pUnit:RegisterEvent("ShadowlordDeathwail_ShadowBolt", 5000, 0) pUnit:RegisterEvent("ShadowlordDeathwail_ShadowBoltVolley", 7000, 0) end function ShadowlordDeathwail_DeathCoil(pUnit,Event) pUnit:FullCastSpellOnTarget(32709,pUnit:GetClosestPlayer()) end function ShadowlordDeathwail_Fear(pUnit,Event) pUnit:FullCastSpellOnTarget(27641,pUnit:GetClosestPlayer()) end function ShadowlordDeathwail_FelFireball(pUnit,Event) pUnit:FullCastSpellOnTarget(38312,pUnit:GetClosestPlayer()) end function ShadowlordDeathwail_ShadowBolt(pUnit,Event) pUnit:FullCastSpellOnTarget(12471,pUnit:GetClosestPlayer()) end function ShadowlordDeathwail_ShadowBoltVolley(pUnit,Event) pUnit:FullCastSpellOnTarget(15245,pUnit:GetClosestPlayer()) end function ShadowlordDeathwail_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function ShadowlordDeathwail_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(22006, 1, "ShadowlordDeathwail_OnEnterCombat") RegisterUnitEvent(22006, 2, "ShadowlordDeathwail_OnLeaveCombat") RegisterUnitEvent(22006, 4, "ShadowlordDeathwail_OnDied") function ShadowmoonChosen_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("ShadowmoonChosen_Uppercut", 5000, 0) pUnit:RegisterEvent("ShadowmoonChosen_Whirlwind", 11000, 0) end function ShadowmoonChosen_Uppercut(pUnit,Event) pUnit:FullCastSpellOnTarget(10966,pUnit:GetClosestPlayer()) end function ShadowmoonChosen_Whirlwind(pUnit,Event) pUnit:FullCastSpellOnTarget(38619,pUnit:GetClosestPlayer()) pUnit:FullCastSpellOnTarget(38618,pUnit:GetClosestPlayer()) end function ShadowmoonChosen_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function ShadowmoonChosen_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(22084, 1, "ShadowmoonChosen_OnEnterCombat") RegisterUnitEvent(22084, 2, "ShadowmoonChosen_OnLeaveCombat") RegisterUnitEvent(22084, 4, "ShadowmoonChosen_OnDied") function ShadowmoonDarkweaver_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("ShadowmoonDarkweaver_Immolate", 4000, 0) pUnit:RegisterEvent("ShadowmoonDarkweaver_NetherInfusion", 35000, 3) pUnit:RegisterEvent("ShadowmoonDarkweaver_ShadowBolt", 2500, 0) pUnit:RegisterEvent("ShadowmoonDarkweaver_Shadowfury", 9000, 0) end function ShadowmoonDarkweaver_Immolate(pUnit,Event) pUnit:FullCastSpellOnTarget(11962,pUnit:GetClosestPlayer()) end function ShadowmoonDarkweaver_NetherInfusion(pUnit,Event) pUnit:FullCastSpellOnTarget(38446,pUnit:GetClosestPlayer()) end function ShadowmoonDarkweaver_ShadowBolt(pUnit,Event) pUnit:FullCastSpellOnTarget(9613,pUnit:GetClosestPlayer()) end function ShadowmoonDarkweaver_Shadowfury(pUnit,Event) pUnit:FullCastSpellOnTarget(35373,pUnit:GetClosestPlayer()) end function ShadowmoonDarkweaver_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function ShadowmoonDarkweaver_OnDied(pUnit,Event) pUnit:RemoveEvents() end function ShadowmoonDarkweaver_OnSpawn(pUnit,Event) pUnit:CastSpell(38442) end RegisterUnitEvent(22081, 1, "ShadowmoonDarkweaver_OnEnterCombat") RegisterUnitEvent(22081, 2, "ShadowmoonDarkweaver_OnLeaveCombat") RegisterUnitEvent(22081, 4, "ShadowmoonDarkweaver_OnDied") RegisterUnitEvent(22081, 6, "ShadowmoonDarkweaver_OnSpawn") function ShadowmoonRetainer_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("ShadowmoonRetainer_Shoot", 4000, 0) end function ShadowmoonRetainer_Shoot(pUnit,Event) pUnit:FullCastSpellOnTarget(15547,pUnit:GetRandomPlayer(3)) end function ShadowmoonRetainer_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function ShadowmoonRetainer_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(22102, 1, "ShadowmoonRetainer_OnEnterCombat") RegisterUnitEvent(22102, 2, "ShadowmoonRetainer_OnLeaveCombat") RegisterUnitEvent(22102, 4, "ShadowmoonRetainer_OnDied") function ShadowmoonSlayer_OnEnterCombat(pUnit,Event) pUnit:FullCastSpellOnTarget(3019,pUnit:GetClosestPlayer()) pUnit:RegisterEvent("ShadowmoonSlayer_DebilitatingStrike", 20000, 0) end function ShadowmoonSlayer_DebilitatingStrike(pUnit,Event) pUnit:FullCastSpellOnTarget(37577,pUnit:GetClosestPlayer()) end function ShadowmoonSlayer_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function ShadowmoonSlayer_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(22082, 1, "ShadowmoonSlayer_OnEnterCombat") RegisterUnitEvent(22082, 2, "ShadowmoonSlayer_OnLeaveCombat") RegisterUnitEvent(22082, 4, "ShadowmoonSlayer_OnDied") function ShadowswornDrakonid_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("ShadowswornDrakonid_Cleave", 11000, 0) pUnit:RegisterEvent("ShadowswornDrakonid_MortalStrike", 15000, 0) pUnit:RegisterEvent("ShadowswornDrakonid_SunderArmor", 30000, 0) end function ShadowswornDrakonid_Cleave(pUnit,Event) pUnit:FullCastSpellOnTarget(15496,pUnit:GetClosestPlayer()) end function ShadowswornDrakonid_MortalStrike(pUnit,Event) pUnit:FullCastSpellOnTarget(17547,pUnit:GetClosestPlayer()) end function ShadowswornDrakonid_SunderArmor(pUnit,Event) pUnit:FullCastSpellOnTarget(16145,pUnit:GetClosestPlayer()) end function ShadowswornDrakonid_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function ShadowswornDrakonid_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(22072, 1, "ShadowswornDrakonid_OnEnterCombat") RegisterUnitEvent(22072, 2, "ShadowswornDrakonid_OnLeaveCombat") RegisterUnitEvent(22072, 4, "ShadowswornDrakonid_OnDied") function ShadowwingOwl_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("ShadowwingOwl_EagleClaw", 30000, 0) end function ShadowwingOwl_EagleClaw(pUnit,Event) pUnit:FullCastSpellOnTarget(15496,pUnit:GetClosestPlayer()) end function ShadowwingOwl_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function ShadowwingOwl_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(22265, 1, "ShadowwingOwl_OnEnterCombat") RegisterUnitEvent(22265, 2, "ShadowwingOwl_OnLeaveCombat") RegisterUnitEvent(22265, 4, "ShadowwingOwl_OnDied") function SkethylOwl_OnEnterCombat(pUnit,Event) pUnit:FullCastSpellOnTarget(38254,pUnit:GetClosestPlayer()) pUnit:RegisterEvent("SkethylOwl_TerrifyingScreech", 14000, 0) end function SkethylOwl_TerrifyingScreech(pUnit,Event) pUnit:FullCastSpellOnTarget(38021,pUnit:GetClosestPlayer()) end function SkethylOwl_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function SkethylOwl_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21450, 1, "SkethylOwl_OnEnterCombat") RegisterUnitEvent(21450, 2, "SkethylOwl_OnLeaveCombat") RegisterUnitEvent(21450, 4, "SkethylOwl_OnDied") function SmithGorlunk_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("SmithGorlunk_Rend", 15000, 0) pUnit:RegisterEvent("SmithGorlunk_SunderArmor", 12000, 0) end function SmithGorlunk_Rend(pUnit,Event) pUnit:FullCastSpellOnTarget(13445,pUnit:GetClosestPlayer()) end function SmithGorlunk_SunderArmor(pUnit,Event) pUnit:FullCastSpellOnTarget(13444,pUnit:GetClosestPlayer()) end function SmithGorlunk_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function SmithGorlunk_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(22037, 1, "SmithGorlunk_OnEnterCombat") RegisterUnitEvent(22037, 2, "SmithGorlunk_OnLeaveCombat") RegisterUnitEvent(22037, 4, "SmithGorlunk_OnDied") function SonOfCorok_OnEnterCombat(pUnit,Event) pUnit:FullCastSpellOnTarget(12612,pUnit:GetClosestPlayer()) pUnit:RegisterEvent("SonOfCorok_Stomp", 15000, 0) end function SonOfCorok_Stomp(pUnit,Event) pUnit:FullCastSpellOnTarget(12612,pUnit:GetClosestPlayer()) end function SonOfCorok_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function SonOfCorok_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(19824, 1, "SonOfCorok_OnEnterCombat") RegisterUnitEvent(19824, 2, "SonOfCorok_OnLeaveCombat") RegisterUnitEvent(19824, 4, "SonOfCorok_OnDied") function SpawnOfUvuros_OnEnterCombat(pUnit,Event) pUnit:FullCastSpellOnTarget(36405,pUnit:GetClosestPlayer()) pUnit:RegisterEvent("SpawnOfUvuros_Bite", 4000, 0) pUnit:RegisterEvent("SpawnOfUvuros_DoubleBreath", 15000, 0) pUnit:RegisterEvent("SpawnOfUvuros_Growl", 1000, 1) pUnit:RegisterEvent("SpawnOfUvuros_LavaBreath", 15000, 0) pUnit:RegisterEvent("SpawnOfUvuros_Stomp", 9000, 0) end function SpawnOfUvuros_Bite(pUnit,Event) pUnit:FullCastSpellOnTarget(27050,pUnit:GetClosestPlayer()) end function SpawnOfUvuros_DoubleBreath(pUnit,Event) pUnit:FullCastSpellOnTarget(36406,pUnit:GetClosestPlayer()) end function SpawnOfUvuros_Growl(pUnit,Event) pUnit:FullCastSpellOnTarget(14921,pUnit:GetClosestPlayer()) end function SpawnOfUvuros_LavaBreath(pUnit,Event) pUnit:FullCastSpellOnTarget(58610,pUnit:GetClosestPlayer()) end function SpawnOfUvuros_Stomp(pUnit,Event) pUnit:FullCastSpellOnTarget(36405,pUnit:GetClosestPlayer()) end function SpawnOfUvuros_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function SpawnOfUvuros_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21108, 1, "SpawnOfUvuros_OnEnterCombat") RegisterUnitEvent(21108, 2, "SpawnOfUvuros_OnLeaveCombat") RegisterUnitEvent(21108, 4, "SpawnOfUvuros_OnDied") function SpellboundTerrorguard_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("SpellboundTerrorguard_FelFlames", 8000, 0) pUnit:RegisterEvent("SpellboundTerrorguard_Hamstring", 20000, 3) end function SpellboundTerrorguard_FelFlames(pUnit,Event) pUnit:FullCastSpellOnTarget(37488,pUnit:GetClosestPlayer()) end function SpellboundTerrorguard_Hamstring(pUnit,Event) pUnit:FullCastSpellOnTarget(31553,pUnit:GetClosestPlayer()) end function SpellboundTerrorguard_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function SpellboundTerrorguard_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21908, 1, "SpellboundTerrorguard_OnEnterCombat") RegisterUnitEvent(21908, 2, "SpellboundTerrorguard_OnLeaveCombat") RegisterUnitEvent(21908, 4, "SpellboundTerrorguard_OnDied") function SummonerSkartax_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("SummonerSkartax_Incinerate", 5000, 0) pUnit:RegisterEvent("SummonerSkartax_ShadowBolt", 9000, 0) end function SummonerSkartax_Incinerate(pUnit,Event) pUnit:FullCastSpellOnTarget(38401,pUnit:GetClosestPlayer()) end function SummonerSkartax_ShadowBolt(pUnit,Event) pUnit:FullCastSpellOnTarget(12471,pUnit:GetClosestPlayer()) end function SummonerSkartax_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function SummonerSkartax_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21207, 1, "SummonerSkartax_OnEnterCombat") RegisterUnitEvent(21207, 2, "SummonerSkartax_OnLeaveCombat") RegisterUnitEvent(21207, 4, "SummonerSkartax_OnDied") function SunfuryBloodLord_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("SunfuryBloodLord_DebilitatingStrike", 15000, 0) pUnit:RegisterEvent("SunfuryBloodLord_TorrentOfFlames", 5000, 0) end function SunfuryBloodLord_DebilitatingStrike(pUnit,Event) pUnit:FullCastSpellOnTarget(37577,pUnit:GetClosestPlayer()) end function SunfuryBloodLord_TorrentOfFlames(pUnit,Event) pUnit:FullCastSpellOnTarget(36104,pUnit:GetClosestPlayer()) end function SunfuryBloodLord_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function SunfuryBloodLord_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21743, 1, "SunfuryBloodLord_OnEnterCombat") RegisterUnitEvent(21743, 2, "SunfuryBloodLord_OnLeaveCombat") RegisterUnitEvent(21743, 4, "SunfuryBloodLord_OnDied") function SunfuryEradicator_OnEnterCombat(pUnit,Event) pUnit:CastSpell(38008) pUnit:RegisterEvent("SunfuryEradicator_FlashHeal", 15000, 0) end function SunfuryEradicator_FlashHeal(pUnit,Event) pUnit:FullCastSpellOnTarget(17137,pUnit:GetRandomFriend()) end function SunfuryEradicator_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function SunfuryEradicator_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21742, 1, "SunfuryEradicator_OnEnterCombat") RegisterUnitEvent(21742, 2, "SunfuryEradicator_OnLeaveCombat") RegisterUnitEvent(21742, 4, "SunfuryEradicator_OnDied") function SunfurySummoner_OnEnterCombat(pUnit,Event) pUnit:CastSpell(13901) pUnit:RegisterEvent("SunfurySummoner_ArcaneBolt", 5000, 0) pUnit:RegisterEvent("SunfurySummoner_Blink", 1000, 1) end function SunfurySummoner_ArcaneBolt(pUnit,Event) pUnit:FullCastSpellOnTarget(13901,pUnit:GetRandomFriend()) end function SunfurySummoner_Blink(pUnit,Event) if pUnit:GetHealthPct() == 4 then pUnit:CastSpell(36994) end end function SunfurySummoner_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function SunfurySummoner_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21505, 1, "SunfurySummoner_OnEnterCombat") RegisterUnitEvent(21505, 2, "SunfurySummoner_OnLeaveCombat") RegisterUnitEvent(21505, 4, "SunfurySummoner_OnDied") function SunfuryWarlock_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("SunfuryWarlock_Incinerate", 3000, 0) pUnit:RegisterEvent("SunfuryWarlock_ShadowBolt", 9000, 0) end function SunfuryWarlock_Incinerate(pUnit,Event) pUnit:FullCastSpellOnTarget(32707,pUnit:GetClosestPlayer()) end function SunfuryWarlock_ShadowBolt(pUnit,Event) pUnit:FullCastSpellOnTarget(9613,pUnit:GetClosestPlayer()) end function SunfuryWarlock_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function SunfuryWarlock_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21503, 1, "SunfuryWarlock_OnEnterCombat") RegisterUnitEvent(21503, 2, "SunfuryWarlock_OnLeaveCombat") RegisterUnitEvent(21503, 4, "SunfuryWarlock_OnDied") function Terrormaster_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Terrormaster_Cleave", 9000, 0) pUnit:RegisterEvent("Terrormaster_Fear", 24000, 0) end function Terrormaster_Cleave(pUnit,Event) pUnit:FullCastSpellOnTarget(15496,pUnit:GetClosestPlayer()) end function Terrormaster_Fear(pUnit,Event) pUnit:FullCastSpellOnTarget(38154,pUnit:GetClosestPlayer()) end function Terrormaster_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Terrormaster_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21314, 1, "Terrormaster_OnEnterCombat") RegisterUnitEvent(21314, 2, "Terrormaster_OnLeaveCombat") RegisterUnitEvent(21314, 4, "Terrormaster_OnDied") function Theras_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Terrormaster_ManaBurn", 20000, 0) pUnit:RegisterEvent("Terrormaster_Metamorphosis", 1000, 1) pUnit:RegisterEvent("Terrormaster_Spellbreaker", 12000, 0) end function Theras_ManaBurn(pUnit,Event) pUnit:FullCastSpellOnTarget(39262,pUnit:GetClosestPlayer()) end function Theras_Metamorphosis(pUnit,Event) if pUnit:GetHealthPct() == 49 then pUnit:CastSpell(36298) end end function Theras_Spellbreaker(pUnit,Event) pUnit:FullCastSpellOnTarget(35871,pUnit:GetClosestPlayer()) end function Theras_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Theras_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21168, 1, "Theras_OnEnterCombat") RegisterUnitEvent(21168, 2, "Theras_OnLeaveCombat") RegisterUnitEvent(21168, 4, "Theras_OnDied") function TorlothTheMagnificent_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("TorlothTheMagnificent_Cleave", 10000, 0) pUnit:RegisterEvent("TorlothTheMagnificent_Shadowfury", 9000, 0) pUnit:RegisterEvent("TorlothTheMagnificent_SpellReflection", 12000, 0) end function TorlothTheMagnificent_Cleave(pUnit,Event) pUnit:FullCastSpellOnTarget(15284,pUnit:GetClosestPlayer()) end function TorlothTheMagnificent_Shadowfury(pUnit,Event) pUnit:FullCastSpellOnTarget(39082,pUnit:GetClosestPlayer()) end function TorlothTheMagnificent_SpellReflection(pUnit,Event) pUnit:CastSpell(33961) end function TorlothTheMagnificent_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function TorlothTheMagnificent_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(22076, 1, "TorlothTheMagnificent_OnEnterCombat") RegisterUnitEvent(22076, 2, "TorlothTheMagnificent_OnLeaveCombat") RegisterUnitEvent(22076, 4, "TorlothTheMagnificent_OnDied") function Umberhowl_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Umberhowl_ChillingHowl", 30000, 0) pUnit:RegisterEvent("Umberhowl_Snarl", 7000, 0) end function Umberhowl_ChillingHowl(pUnit,Event) pUnit:FullCastSpellOnTarget(32918,pUnit:GetClosestPlayer()) end function Umberhowl_Snarl(pUnit,Event) pUnit:FullCastSpellOnTarget(32919,pUnit:GetClosestPlayer()) end function Umberhowl_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Umberhowl_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21255, 1, "Umberhowl_OnEnterCombat") RegisterUnitEvent(21255, 2, "Umberhowl_OnLeaveCombat") RegisterUnitEvent(21255, 4, "Umberhowl_OnDied") function Uvuros_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Uvuros_Bite", 4000, 0) pUnit:RegisterEvent("Uvuros_DoubleBreath", 8000, 0) pUnit:RegisterEvent("Uvuros_Growl", 20000, 0) pUnit:RegisterEvent("Uvuros_LavaBreath", 10000, 0) pUnit:RegisterEvent("Uvuros_TerrifyingRoar", 27000, 0) end function Uvuros_Bite(pUnit,Event) pUnit:FullCastSpellOnTarget(27050,pUnit:GetClosestPlayer()) end function Uvuros_DoubleBreath(pUnit,Event) pUnit:FullCastSpellOnTarget(38361,pUnit:GetClosestPlayer()) end function Uvuros_Growl(pUnit,Event) pUnit:FullCastSpellOnTarget(27047,pUnit:GetClosestPlayer()) end function Uvuros_LavaBreath(pUnit,Event) pUnit:FullCastSpellOnTarget(58610,pUnit:GetClosestPlayer()) end function Uvuros_TerrifyingRoar(pUnit,Event) pUnit:FullCastSpellOnTarget(37939,pUnit:GetClosestPlayer()) end function Uvuros_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Uvuros_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21102, 1, "Uvuros_OnEnterCombat") RegisterUnitEvent(21102, 2, "Uvuros_OnLeaveCombat") RegisterUnitEvent(21102, 4, "Uvuros_OnDied") function Uylaru_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Uylaru_CorruptedSearingTotem", 20000, 0) pUnit:RegisterEvent("Uylaru_FlameShock", 16000, 0) end function Uylaru_CorruptedSearingTotem(pUnit,Event) pUnit:FullCastSpellOnTarget(38581,pUnit:GetClosestPlayer()) end function Uylaru_FlameShock(pUnit,Event) pUnit:FullCastSpellOnTarget(15039,pUnit:GetClosestPlayer()) end function Uylaru_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Uylaru_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21710, 1, "Uylaru_OnEnterCombat") RegisterUnitEvent(21710, 2, "Uylaru_OnLeaveCombat") RegisterUnitEvent(21710, 4, "Uylaru_OnDied") function ValzareqTheConqueror_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Uylaru_Shoot", 2000, 3) end function ValzareqTheConqueror_Shoot(pUnit,Event) pUnit:FullCastSpellOnTarget(38094,pUnit:GetClosestPlayer()) end function ValzareqTheConqueror_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function ValzareqTheConqueror_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21979, 1, "ValzareqTheConqueror_OnEnterCombat") RegisterUnitEvent(21979, 2, "ValzareqTheConqueror_OnLeaveCombat") RegisterUnitEvent(21979, 4, "ValzareqTheConqueror_OnDied") function Varedis_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Varedis_CurseOfFlames", 120000, 0) pUnit:RegisterEvent("Varedis_Evasion", 24000, 0) pUnit:RegisterEvent("Varedis_ManaBurn", 9000, 0) end function Varedis_CurseOfFlames(pUnit,Event) pUnit:FullCastSpellOnTarget(38010,pUnit:GetClosestPlayer()) end function Varedis_Evasion(pUnit,Event) pUnit:CastSpell(37683) end function Varedis_ManaBurn(pUnit,Event) pUnit:FullCastSpellOnTarget(39262,pUnit:GetClosestPlayer()) end function Varedis_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Varedis_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21178, 1, "Varedis_OnEnterCombat") RegisterUnitEvent(21178, 2, "Varedis_OnLeaveCombat") RegisterUnitEvent(21178, 4, "Varedis_OnDied") function VhelKur_OnSpawn(pUnit,Event) pUnit:CastSpell(36553) end RegisterUnitEvent(21801, 6, "VhelKur_OnSpawn") function VilewingChimaera_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("VilewingChimaera_FroststormBreath", 5000, 0) pUnit:RegisterEvent("VilewingChimaera_VenomSpit", 15000, 0) end function VilewingChimaera_FroststormBreath(pUnit,Event) pUnit:FullCastSpellOnTarget(55491,pUnit:GetClosestPlayer()) end function VilewingChimaera_VenomSpit(pUnit,Event) pUnit:FullCastSpellOnTarget(16552,pUnit:GetClosestPlayer()) end function VilewingChimaera_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function VilewingChimaera_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21879, 1, "VilewingChimaera_OnEnterCombat") RegisterUnitEvent(21879, 2, "VilewingChimaera_OnLeaveCombat") RegisterUnitEvent(21879, 4, "VilewingChimaera_OnDied") function WarbringerRazuun_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("WarbringerRazuun_FelFireball", 3800, 0) pUnit:RegisterEvent("WarbringerRazuun_MindWarp", 45000, 1) end function WarbringerRazuun_FelFireball(pUnit,Event) pUnit:FullCastSpellOnTarget(35913,pUnit:GetClosestPlayer()) end function WarbringerRazuun_MindWarp(pUnit,Event) pUnit:FullCastSpellOnTarget(38047,pUnit:GetClosestPlayer()) end function WarbringerRazuun_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function WarbringerRazuun_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21287, 1, "WarbringerRazuun_OnEnterCombat") RegisterUnitEvent(21287, 2, "WarbringerRazuun_OnLeaveCombat") RegisterUnitEvent(21287, 4, "WarbringerRazuun_OnDied") function WildhammerScout_OnEnterCombat(pUnit,Event) pUnit:FullCastSpellOnTarget(33808,pUnit:GetClosestPlayer()) pUnit:RegisterEvent("WildhammerScout_ThrowHammer", 6000, 0) end function WildhammerScout_ThrowHammer(pUnit,Event) pUnit:FullCastSpellOnTarget(33805,pUnit:GetClosestPlayer()) pUnit:FullCastSpellOnTarget(33806,pUnit:GetClosestPlayer()) end function WildhammerScout_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function WildhammerScout_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(19384, 1, "WildhammerScout_OnEnterCombat") RegisterUnitEvent(19384, 2, "WildhammerScout_OnLeaveCombat") RegisterUnitEvent(19384, 4, "WildhammerScout_OnDied") function Wrathstalker_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Wrathstalker_Cleave", 11000, 0) end function Wrathstalker_Cleave(pUnit,Event) pUnit:FullCastSpellOnTarget(33805,pUnit:GetClosestPlayer()) end function Wrathstalker_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Wrathstalker_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21249, 1, "Wrathstalker_OnEnterCombat") RegisterUnitEvent(21249, 2, "Wrathstalker_OnLeaveCombat") RegisterUnitEvent(21249, 4, "Wrathstalker_OnDied") function Xiri_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Xiri_BlindingLight", 24000, 0) end function Xiri_OnSpawn(pUnit,Event) pUnit:RegisterEvent("Xiri_LightOfTheNaaru1", 20000, 0) pUnit:RegisterEvent("Xiri_LightOfTheNaaru2", 20000, 0) pUnit:RegisterEvent("Xiri_LightOfTheNaaru3", 20000, 0) end function Xiri_BlindingLight(pUnit,Event) pUnit:FullCastSpellOnTarget(33805) end function Xiri_LightOfTheNaaru1(pUnit,Event) pUnit:CastSpell(39828) end function Xiri_LightOfTheNaaru2(pUnit,Event) pUnit:CastSpell(39831) end function Xiri_LightOfTheNaaru3(pUnit,Event) pUnit:CastSpell(39832) end function Xiri_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(18528, 1, "Xiri_OnEnterCombat") RegisterUnitEvent(18528, 1, "Xiri_OnLeaveCombat") RegisterUnitEvent(18528, 4, "Xiri_OnDied") RegisterUnitEvent(18528, 6, "Xiri_OnSpawn") function Zandras_OnEnterCombat(pUnit,Event) pUnit:RegisterEvent("Zandras_FelShackles", 11000, 0) end function Zandras_FelShackles(pUnit,Event) pUnit:FullCastSpellOnTarget(38051,pUnit:GetClosestPlayer()) end function Zandras_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function Zandras_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(21249, 1, "Zandras_OnEnterCombat") RegisterUnitEvent(21249, 2, "Zandras_OnLeaveCombat") RegisterUnitEvent(21249, 4, "Zandras_OnDied") function ZuluhedTheWhacked_OnEnterCombat(pUnit,Event) pUnit:CastSpell(38853) pUnit:RegisterEvent("ZuluhedTheWhacked_DemonPortal", 35000, 0) end function ZuluhedTheWhacked_DemonPortal(pUnit,Event) pUnit:CastSpell(38876) end function ZuluhedTheWhacked_OnLeaveCombat(pUnit,Event) pUnit:RemoveEvents() end function ZuluhedTheWhacked_OnDied(pUnit,Event) pUnit:RemoveEvents() end RegisterUnitEvent(11980, 1, "ZuluhedTheWhacked_OnEnterCombat") RegisterUnitEvent(11980, 2, "ZuluhedTheWhacked_OnLeaveCombat") RegisterUnitEvent(11980, 4, "ZuluhedTheWhacked_OnDied")
local config = require"lspinstall/util".extract_config("yamlls") config.default_config.cmd[1] = "./node_modules/.bin/yaml-language-server" return vim.tbl_extend('error', config, { install_script = [[ ! test -f package.json && yarn init -y || true yarn add yaml-language-server@latest ]] })
require("base64") require("http_common") local http_request = require("http.request") local http_tls = require("http.tls") local openssl_ctx = require("openssl.ssl.context") local http_util = require("http.util") local gcrypt = require("lua_gcrypt") local function createGrantingTicket(context, user, pass) --Perform POST request to create a new granting ticket. local request = http_request.new_from_uri("https://localhost:8080/TicketService/GrantingTickets") request.ctx = context request.tls = true request.headers:upsert(":method", "POST") request.headers:append("content-type", "application/x-www-form-urlencoded") request:set_body(string.format("user=%s&pass=%s", user, pass)) local headers, stream =request:go(100) --Save the URI of the new resource. local resourceUri = nil print("POST /TicketService/GrantingTickets") if headers then for k, v in headers:each() do if k == "content-location" then resourceUri = v end print(k, v) end end return resourceUri end local function createTicket(userPass, grantingTicketUri, serviceName, sslContext) local formParameters = string.format("grantingTicket=%s&serviceName=%s", grantingTicketUri, serviceName) local ticketUri = nil local postRequest = http_request.new_from_uri("https://localhost:8080/TicketService/Tickets") postRequest.ctx = sslContext postRequest.tls = true postRequest.headers:upsert(":method", "POST") postRequest.headers:append("content-type", "application/x-www-form-urlencoded") postRequest.headers:upsert("authorization","Basic " .. userPass) postRequest:set_body(formParameters) local headers, stream = postRequest:go(100) --Save the URI of the new resource. local resourceUri = nil if headers then print("Headers of POST request: ") for k, v in headers:each() do if k == "content-location" then ticketUri = v end print(k, v) end end return ticketUri end local function getConfigurationFile(ticket, context) --Perform GET request to get the contentx of the file. local uri = string.format("https://localhost:8081/DhcpService/ConfigurationFile?ticket=%d", ticket) local request = http_request.new_from_uri(uri) request.ctx = context request.tls = true request.headers:upsert(":method", "GET") local headers, stream =request:go(100) --Read the status of the request. local status = nil if headers then for k, v in headers:each() do if k == ":status" then status = v end print(k, v) end end if status == "200" then return status, stream:get_body_as_string() else return status end end local function getGrantingTicket(uri, userPass, context) --Perform GET request to create a new granting ticket. local request = http_request.new_from_uri("https://localhost:8080" .. uri) request.ctx = context request.tls = true request.headers:upsert(":method", "GET") request.headers:append("content-type", "application/x-www-form-urlencoded") request.headers:upsert("authorization","Basic " .. userPass) local headers, stream =request:go(100) --Save the URI of the new resource. local status = nil print("GET", uri) if headers then for k, v in headers:each() do if k == ":status" then status = v end print(k, v) end end if status == "200" then return status, stream:get_body_as_string() else return status end end --[[ print("") local grantingTicketUri = createGrantingTicket(context) print(grantingTicketUri) print("") local ticketUri = createTicket("https://localhost:8080" .. grantingTicketUri, "leService", context) print(ticketUri) print("") local ticket = string.match(ticketUri, "/TicketService/Tickets/(%d+)") ticket = tonumber(ticket) if not ticket then print("Invalid ticket id received from ticket service") end local status, file = getConfigurationFile(ticket) print(file) ]]-- --Create SSL context that accepts self signed certificates. local g_context = http_tls:new_client_context() g_context:setVerify(openssl_ctx.VERIFY_NONE) local g_grantingTicketUri = nil local g_dhcpTicketUri = nil local g_user = nil local g_pass = nil local g_fileContent = nil local function getTicketId(ticketUri) local ticketId = string.match(ticketUri, "/TicketService/Tickets/(%d+)") return tonumber(ticketId) end local function parseGrantingTicket(html) local pattern = "<p id=\"key\">(%x+)</p>" local key = string.match(html, pattern) if not key then return nil end key = fromHex(key) pattern = "<p id=\"iv\">(%x+)</p>" local iv = string.match(html, pattern) if not iv then return nil end iv = fromHex(iv) return key, iv end local function parseConfigurationFile(html) local pattern = "<p id=\"blob\">(%x+)</p>" local blob = string.match(html, pattern) if not blob then return nil end return fromHex(blob) end function login(user, pass) local uri = createGrantingTicket(g_context, user, pass) if uri then g_grantingTicketUri = uri g_user = user g_pass = pass return true else return false end end function createDhcpTicket() if not g_user or not g_pass then return nil end local userPass = toBase64(string.format("%s:%s", g_user, g_pass)) local uri = createTicket(userPass, g_grantingTicketUri, "leService", g_context) if not uri then return false end g_dhcpTicketUri = uri return true end function readConfigurationFile() --Get ticket id from the ticket URI. local ticketId = getTicketId(g_dhcpTicketUri) if not ticketId then return false end --Make GET request for configuration file. local status, body = getConfigurationFile(ticketId, g_context) if status ~= "200" then return false end print("Content of DHCP config file\n", body) --Extract encrypted configuration file. local encryptedFile = parseConfigurationFile(body) if not encryptedFile then return false end --Make GET request for granting ticket. local userPass = toBase64(string.format("%s:%s", g_user, g_pass)) local status, grantingTicket = getGrantingTicket(g_grantingTicketUri, userPass, g_context) print("Content of granting ticket\n", grantingTicket) if status ~= "200" then return false end --Get key and initialization vector from granting ticket. local key, iv = parseGrantingTicket(grantingTicket) --Decrypt configuration file. local cypher = gcrypt.makeCipher(key, iv) g_fileContent = cypher:decrypt(encryptedFile) return true end function getFileContent() return g_fileContent end
-- Libs local awful = require("awful") local gears = require("gears") local beautiful = require("beautiful") local wibox = require("wibox") -- Titlebar button themes local theme_name = "stoplight" local titlebar_icon_path = os.getenv("HOME") .. "/.config/awesome/theme/icons/titlebar/" .. theme_name .. '/' local tip = titlebar_icon_path --alias to save time/space local titlebars = {} local theme = {} local dpi = require('beautiful').xresources.apply_dpi -- Hide tooltips when hover on titlebar buttons awful.titlebar.enable_tooltip = false -- Client layout handler require('module.titlebar-decorate-client') -- Define the images to load beautiful.titlebar_close_button_normal = tip .. "close_normal.svg" beautiful.titlebar_close_button_focus = tip .. "close_focus.svg" beautiful.titlebar_minimize_button_normal = tip .. "minimize_normal.svg" beautiful.titlebar_minimize_button_focus = tip .. "minimize_focus.svg" beautiful.titlebar_ontop_button_normal_inactive = tip .. "ontop_normal_inactive.svg" beautiful.titlebar_ontop_button_focus_inactive = tip .. "ontop_focus_inactive.svg" beautiful.titlebar_ontop_button_normal_active = tip .. "ontop_normal_active.svg" beautiful.titlebar_ontop_button_focus_active = tip .. "ontop_focus_active.svg" beautiful.titlebar_sticky_button_normal_inactive = tip .. "sticky_normal_inactive.svg" beautiful.titlebar_sticky_button_focus_inactive = tip .. "sticky_focus_inactive.svg" beautiful.titlebar_sticky_button_normal_active = tip .. "sticky_normal_active.svg" beautiful.titlebar_sticky_button_focus_active = tip .. "sticky_focus_active.svg" beautiful.titlebar_floating_button_normal_inactive = tip .. "floating_normal_inactive.svg" beautiful.titlebar_floating_button_focus_inactive = tip .. "floating_focus_inactive.svg" beautiful.titlebar_floating_button_normal_active = tip .. "floating_normal_active.svg" beautiful.titlebar_floating_button_focus_active = tip .. "floating_focus_active.svg" beautiful.titlebar_maximized_button_normal_inactive = tip .. "maximized_normal_inactive.svg" beautiful.titlebar_maximized_button_focus_inactive = tip .. "maximized_focus_inactive.svg" beautiful.titlebar_maximized_button_normal_active = tip .. "maximized_normal_active.svg" beautiful.titlebar_maximized_button_focus_active = tip .. "maximized_focus_active.svg" -- hover beautiful.titlebar_close_button_normal_hover = tip .. "close_normal_hover.svg" beautiful.titlebar_close_button_focus_hover = tip .. "close_focus_hover.svg" beautiful.titlebar_minimize_button_normal_hover = tip .. "minimize_normal_hover.svg" beautiful.titlebar_minimize_button_focus_hover = tip .. "minimize_focus_hover.svg" beautiful.titlebar_ontop_button_normal_inactive_hover = tip .. "ontop_normal_inactive_hover.svg" beautiful.titlebar_ontop_button_focus_inactive_hover = tip .. "ontop_focus_inactive_hover.svg" beautiful.titlebar_ontop_button_normal_active_hover = tip .. "ontop_normal_active_hover.svg" beautiful.titlebar_ontop_button_focus_active_hover = tip .. "ontop_focus_active_hover.svg" beautiful.titlebar_sticky_button_normal_inactive_hover = tip .. "sticky_normal_inactive_hover.svg" beautiful.titlebar_sticky_button_focus_inactive_hover = tip .. "sticky_focus_inactive_hover.svg" beautiful.titlebar_sticky_button_normal_active_hover = tip .. "sticky_normal_active_hover.svg" beautiful.titlebar_sticky_button_focus_active_hover = tip .. "sticky_focus_active_hover.svg" beautiful.titlebar_floating_button_normal_inactive_hover = tip .. "floating_normal_inactive_hover.svg" beautiful.titlebar_floating_button_focus_inactive_hover = tip .. "floating_focus_inactive_hover.svg" beautiful.titlebar_floating_button_normal_active_hover = tip .. "floating_normal_active_hover.svg" beautiful.titlebar_floating_button_focus_active_hover = tip .. "floating_focus_active_hover.svg" beautiful.titlebar_maximized_button_normal_inactive_hover = tip .. "maximized_normal_inactive_hover.svg" beautiful.titlebar_maximized_button_focus_inactive_hover = tip .. "maximized_focus_inactive_hover.svg" beautiful.titlebar_maximized_button_normal_active_hover = tip .. "maximized_normal_active_hover.svg" beautiful.titlebar_maximized_button_focus_active_hover = tip .. "maximized_focus_active_hover.svg" -- Titlebar size local titlebar_size = beautiful.titlebar_size -- Add a titlebar if titlebars_enabled is set to true in the rules. client.connect_signal("request::titlebars", function(c) -- buttons for the titlebar local buttons = gears.table.join( awful.button({ }, 1, function() c:emit_signal("request::activate", "titlebar", {raise = true}) awful.mouse.client.move(c) end), awful.button({ }, 3, function() c:emit_signal("request::activate", "titlebar", {raise = true}) awful.mouse.client.resize(c) end) ) -- General titlebar design awful.titlebar(c, {position = 'left', size = titlebar_size}) : setup { { awful.titlebar.widget.closebutton(c), awful.titlebar.widget.maximizedbutton(c), awful.titlebar.widget.minimizebutton(c), layout = wibox.layout.fixed.vertical }, { buttons = buttons, layout = wibox.layout.flex.vertical }, { awful.titlebar.widget.floatingbutton (c), layout = wibox.layout.fixed.vertical }, layout = wibox.layout.align.vertical } -- Generate a custom titlebar for each class declared below this function -- Depends: xprop local custom_titlebars = function(c, pos, bg, size) awful.titlebar(c, {position = pos, bg = bg, size = size}) : setup { { awful.titlebar.widget.closebutton(c), awful.titlebar.widget.maximizedbutton(c), awful.titlebar.widget.minimizebutton (c), layout = wibox.layout.fixed.vertical }, { buttons = buttons, layout = wibox.layout.flex.vertical }, { awful.titlebar.widget.floatingbutton (c), layout = wibox.layout.fixed.vertical }, layout = wibox.layout.align.vertical } end -- Generate a custom titlabar for each class and roles if c.class == "kitty" or c.class == "XTerm" then custom_titlebars(c, 'left', '#000000AA', titlebar_size) elseif c.role == "GtkFileChooserDialog" or c.type == 'modal' or c.type == 'dialog' then -- Let's use the gtk themes bg_color as titlebar's bg -- isn't it neat? lol custom_titlebars(c, 'left', beautiful.gtk.get_theme_variables().bg_color, titlebar_size) elseif c.class == "firefox" then custom_titlebars(c, 'left', '#252525', titlebar_size) elseif c.class == "Gimp-2.10" then custom_titlebars(c, 'left', beautiful.gtk.get_theme_variables().bg_color, titlebar_size) elseif c.class == "Subl3" then custom_titlebars(c, 'left', '#252525', titlebar_size) end end) return beautiful
-- the Royal Game of Ur -- https://en.wikipedia.org/wiki/Royal_Game_of_Ur -- the game tokens dofile(minetest.get_modpath("royal_game_of_ur").."/tokens.lua") -- nodes to create the game board dofile(minetest.get_modpath("royal_game_of_ur").."/gameboard.lua") -- nodes supplementing the game board dofile(minetest.get_modpath("royal_game_of_ur").."/caches.lua") -- the dice dofile(minetest.get_modpath("royal_game_of_ur").."/dice.lua")
local nmap = require "nmap" local shortport = require "shortport" local stdnse = require "stdnse" local string = require "string" local table = require "table" local sslcert = require "sslcert" local tls = require "tls" description = [[ Enumerates a TLS server's supported protocols by using the next protocol negotiation extension. This works by adding the next protocol negotiation extension in the client hello packet and parsing the returned server hello's NPN extension data. For more information, see: * https://tools.ietf.org/html/draft-agl-tls-nextprotoneg-03 ]] --- -- @usage -- nmap --script=tls-nextprotoneg <targets> -- --@output -- 443/tcp open https -- | tls-nextprotoneg: -- | spdy/3 -- | spdy/2 -- |_ http/1.1 -- -- @xmloutput -- <elem>spdy/4a4</elem> -- <elem>spdy/3.1</elem> -- <elem>spdy/3</elem> -- <elem>http/1.1</elem> author = "Hani Benhabiles" license = "Same as Nmap--See https://nmap.org/book/man-legal.html" categories = {"discovery", "safe", "default"} dependencies = {"https-redirect"} portrule = function(host, port) return shortport.ssl(host, port) or sslcert.getPrepareTLSWithoutReconnect(port) end --- Function that sends a client hello packet with the TLS NPN extension to the -- target host and returns the response --@args host The target host table. --@args port The target port table. --@return status true if response, false else. --@return response if status is true. local client_hello = function(host, port) local sock, status, response, err, cli_h cli_h = tls.client_hello({ ["extensions"] = { ["next_protocol_negotiation"] = "", }, }) -- Connect to the target server local status, err local sock local specialized = sslcert.getPrepareTLSWithoutReconnect(port) if specialized then status, sock = specialized(host, port) if not status then stdnse.debug1("Connection to server failed: %s", sock) return false end else sock = nmap.new_socket() status, err = sock:connect(host, port) if not status then stdnse.debug1("Connection to server failed: %s", err) return false end end sock:set_timeout(5000) -- Send Client Hello to the target server status, err = sock:send(cli_h) if not status then stdnse.debug1("Couldn't send: %s", err) sock:close() return false end -- Read response status, response, err = tls.record_buffer(sock) if not status then stdnse.debug1("Couldn't receive: %s", err) sock:close() return false end return true, response end --- Function that checks for the returned protocols to a npn extension request. --@args response Response to parse. --@return results List of found protocols. local check_npn = function(response) local i, record = tls.record_read(response, 1) if record == nil then stdnse.debug1("Unknown response from server") return nil end if record.type == "handshake" and record.body[1].type == "server_hello" then if record.body[1].extensions == nil then stdnse.debug1("Server does not support TLS NPN extension.") return nil end local results = {} local npndata = record.body[1].extensions["next_protocol_negotiation"] if npndata == nil then stdnse.debug1("Server does not support TLS NPN extension.") return nil end -- Parse data i = 1 local protocol while i <= #npndata do protocol, i = string.unpack(">s1", npndata, i) table.insert(results, protocol) end if next(results) then return results else stdnse.debug1("Server supports TLS NPN extension, but no protocols were offered.") return "<empty>" end else stdnse.debug1("Server response was not server_hello") return nil end end action = function(host, port) local status, response -- Send crafted client hello status, response = client_hello(host, port) if status and response then -- Analyze response local results = check_npn(response) return results end end
local assets = { Asset("ANIM", "anim/sch_explode_fx.zip"), } local function PlayFXAnim(proxy) local inst = CreateEntity() inst:AddTag("FX") --[[Non-networked entity]] inst.entity:SetCanSleep(false) inst.persists = false inst.entity:AddTransform() inst.entity:AddAnimState() inst.entity:AddSoundEmitter() inst.Transform:SetFromProxy(proxy.GUID) inst.AnimState:SetBank("explode") inst.AnimState:SetBuild("sch_explode_fx") inst.AnimState:PlayAnimation("small") inst.AnimState:SetBloomEffectHandle("shaders/anim.ksh") inst.AnimState:SetLightOverride(1) inst.AnimState:SetFinalOffset(1) inst.SoundEmitter:PlaySound("dontstarve/common/blackpowder_explo") inst:ListenForEvent("animover", inst.Remove) end local function PlayFXAnim1(proxy) local inst = CreateEntity() inst:AddTag("FX") --[[Non-networked entity]] inst.entity:SetCanSleep(false) inst.persists = false inst.entity:AddTransform() inst.entity:AddAnimState() inst.entity:AddSoundEmitter() inst.Transform:SetFromProxy(proxy.GUID) inst.AnimState:SetBank("explode") inst.AnimState:SetBuild("sch_explode_fx") inst.AnimState:PlayAnimation("small_firecrackers") inst.AnimState:SetBloomEffectHandle("shaders/anim.ksh") inst.AnimState:SetLightOverride(1) inst.AnimState:SetFinalOffset(1) inst.SoundEmitter:PlaySound("dontstarve/common/blackpowder_explo") inst:ListenForEvent("animover", inst.Remove) end local function fn() local inst = CreateEntity() inst.entity:AddTransform() inst.entity:AddNetwork() inst.entity:SetPristine() inst:AddTag("FX") if not TheNet:IsDedicated() then inst:DoTaskInTime(0, PlayFXAnim) end if not TheWorld.ismastersim then return inst end return inst end local function fn1() local inst = CreateEntity() inst.entity:AddTransform() inst.entity:AddNetwork() inst.entity:SetPristine() inst:AddTag("FX") if not TheNet:IsDedicated() then inst:DoTaskInTime(0, PlayFXAnim1) end if not TheWorld.ismastersim then return inst end return inst end return Prefab("sch_explode_fx_1", fn, assets), Prefab("sch_explode_fx_2", fn1, assets), Prefab("sch_explode_fx", fn1, assets) ---- Client LOG
Locales['en'] = { ['roubado_recentemente'] = "You stole recently.", ['alvo_morto'] = "The guy you're stealing is dead.", ['alvo_longe_demais'] = "The target is far away.", ['roubo_comecou'] = "Assault in progress!", ['roubo_concluido'] = "You won ~g~$%s~s~!", ['pode_roubar_novamente'] = "You can steal again!", }
local util = require("util") local M = {} -- vim.lsp.handlers["textDocument/hover"] = function(_, method, result) -- print(vim.inspect(result)) -- end M.autoformat = true function M.toggle() M.autoformat = not M.autoformat if M.autoformat then util.info("enabled format on save", "Formatting") else util.warn("disabled format on save", "Formatting") end end function M.format() if M.autoformat then vim.lsp.buf.formatting_sync(nil, 2000) end end function M.setup(client, buf) local ft = vim.api.nvim_buf_get_option(buf, "filetype") local nls = require("config.lsp.null-ls") local enable = false if nls.has_formatter(ft) then enable = client.name == "null-ls" else enable = not (client.name == "null-ls") end client.resolved_capabilities.document_formatting = enable -- format on save if client.resolved_capabilities.document_formatting then vim.cmd([[ augroup LspFormat autocmd! * <buffer> autocmd BufWritePre <buffer> lua require("config.lsp.formatting").format() augroup END ]]) end end return M
--[[ Copyright 2014-2015 The Luvit Authors. All Rights Reserved. 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. --]] --[[ Package Metadata Commands ================ These commands work with packages metadata. pkg.query(fs, path) -> meta, path - Query an on-disk path for package info. pkg.queryDb(db, path) -> meta, kind - Query an in-db hash for package info. pky.normalize(meta) -> author, tag, version - Extract and normalize pkg info ]] local isFile = require('git').modes.isFile local semver = require('semver') local pathJoin = require('luvi').path.join local listToMap = require('git').listToMap local jsonParse = require('json').parse local function evalModule(data, name) -- Match multiline lua comments that start with `lit-meta\n` local a, b = data:find("%-%-%[(=*)%[lit%-meta\n") if a then local term = "]" .. data:sub(a + 3, b - 10) .."]" local c = data:find(term, b + 1, true) if c then local fn, err = loadstring(data:sub(b + 1, c - 1), name) assert(not err, err) local env = {} setfenv(fn, env) assert(pcall(fn)) return env end end local fn, err = loadstring(data, name) if not fn then return nil, err end local exports = {} local module = { exports = exports } setfenv(fn, { exports = exports, }) local success, ret = pcall(fn) local meta = success and type(ret) == "table" and ret or module.exports if not meta then return nil, "Missing exports in " .. name end if not meta.name then return nil, "Missing name in package description in " .. name end if not meta.version then return nil, "Missing version in package description in " .. name end return meta end local validKeys = { name = "string", version = "string", private = "boolean", -- Don't allow publishing. obsolete = "boolean", -- Hide from search results. description = "string", keywords = "table", -- list of strings tags = "table", -- list of strings homepage = "string", license = "string", licenses = "table", -- table of strings author = "table", -- person {name=name, email=email, url=url} contributors = "table", -- list of people dependencies = "table", -- list of strings luvi = "table", -- {flavor=flavor,version=version}, files = "table", } local function query(fs, path) local packagePath = path local stat, data, err stat, err = fs.stat(path) local attempts = {} if stat then if stat.type == "directory" then packagePath = path .. "/" local fullPath = pathJoin(path, "package.lua") attempts[#attempts + 1] = fullPath data, err = fs.readFile(fullPath) if err and not err:match("^ENOENT:") then error(err) end if not data then fullPath = pathJoin(path, "init.lua") attempts[#attempts + 1] = fullPath data, err = fs.readFile(fullPath) if err and not err:match("^ENOENT:") then error(err) end end else attempts[#attempts + 1] = packagePath data, err = fs.readFile(packagePath) end elseif err:match("^ENOENT:") then packagePath = packagePath .. ".lua" attempts[#attempts + 1] = packagePath data, err = fs.readFile(packagePath) end if not data then local sep = "\n Looked in: " local message = "\nCan't find package at " .. path .. sep .. table.concat(attempts, sep) if err then message = message .. "\n" .. err end return data, message end local meta = evalModule(data, packagePath) local clean = {} if not meta then return nil, "No meta found" end for key, value in pairs(meta) do if type(value) == validKeys[key] then clean[key] = value end end return clean, packagePath end local function queryDb(db, hash) local kind, value = db.loadAny(hash) if kind == "tag" then hash = value.object -- Use metata data in tag message if found local meta = jsonParse(value.message) if meta then return meta, value.type, hash end local tagType = value.type -- Otherwise search root tree or blob kind, value = db.loadAny(hash) assert(kind == tagType, "type mismatch") end local meta if kind == "tree" then local path = "tree:" .. hash local tree = listToMap(value) local entry = tree["package.lua"] if entry then path = path .. "/package.lua" else entry = tree["init.lua"] path = path .. "/init.lua" end if not (entry and isFile(entry.mode)) then return nil, "ENOENT: No package.lua or init.lua in tree:" .. hash end meta = evalModule(db.loadAs("blob", entry.hash), path) elseif kind == "blob" then meta = evalModule(value, "blob:" .. hash) else error("Illegal kind: " .. kind) end return meta, kind, hash end local function normalize(meta) local author, tag = meta.name:match("^([^/]+)/(.*)$") return author, tag, semver.normalize(meta.version) end return { query = query, queryDb = queryDb, normalize = normalize, }
-- NoobDKP Options file NoobDKP_color = "|cfff0ba3c" -- maybe make a default table and a list of option names, then go through the -- real option table by name. If not there, insert from default table? if NOOBDKP_g_options == nil then NOOBDKP_g_options = {} NOOBDKP_g_options["admin_mode"] = false NOOBDKP_g_options["loot_table"] = false NOOBDKP_g_options["auto_EP"] = true NOOBDKP_g_options["scroll_scale"] = 5 -- score calculation options NOOBDKP_g_options["base_EP"] = 200 NOOBDKP_g_options["base_GP"] = 200 NOOBDKP_g_options["scale_EP"] = 100 NOOBDKP_g_options["defaultGP"] = 50 NOOBDKP_g_options["min_EP"] = 0 NOOBDKP_g_options["decay_percent"] = 30 -- gear options by inventory slot type NOOBDKP_g_options["INVTYPE_HEAD"] = 50 NOOBDKP_g_options["INVTYPE_NECK"] = 50 NOOBDKP_g_options["INVTYPE_SHOULDER"] = 50 NOOBDKP_g_options["INVTYPE_CLOAK"] = 50 NOOBDKP_g_options["INVTYPE_ROBE"] = 50 NOOBDKP_g_options["INVTYPE_CHEST"] = 50 NOOBDKP_g_options["INVTYPE_WRIST"] = 50 NOOBDKP_g_options["INVTYPE_HAND"] = 50 NOOBDKP_g_options["INVTYPE_WAIST"] = 50 NOOBDKP_g_options["INVTYPE_LEGS"] = 50 NOOBDKP_g_options["INVTYPE_FEET"] = 50 NOOBDKP_g_options["INVTYPE_FINGER"] = 50 NOOBDKP_g_options["INVTYPE_TRINKET"] = 150 NOOBDKP_g_options["INVTYPE_2HWEAPON"] = 100 NOOBDKP_g_options["INVTYPE_WEAPON"] = 100 NOOBDKP_g_options["INVTYPE_SHIELD"] = 100 NOOBDKP_g_options["INVTYPE_RANGED"] = 100 NOOBDKP_g_options["INVTYPE_THROWN"] = 100 NOOBDKP_g_options["INVTYPE_WEAPONMAINHAND"] = 100 NOOBDKP_g_options["INVTYPE_WEAPONOFFHAND"] = 100 NOOBDKP_g_options["INVTYPE_HOLDABLE"] = 100 NOOBDKP_g_options["INVTYPE_RELIC"] = 0 NOOBDKP_g_options["MARK"] = 100 NOOBDKP_g_options["HC_MARK"] = 250 NOOBDKP_g_options["HC_INVTYPE_HEAD"] = 200 NOOBDKP_g_options["HC_INVTYPE_NECK"] = 200 NOOBDKP_g_options["HC_INVTYPE_SHOULDER"] = 200 NOOBDKP_g_options["HC_INVTYPE_CLOAK"] = 200 NOOBDKP_g_options["HC_INVTYPE_ROBE"] = 200 NOOBDKP_g_options["HC_INVTYPE_CHEST"] = 200 NOOBDKP_g_options["HC_INVTYPE_WRIST"] = 200 NOOBDKP_g_options["HC_INVTYPE_HAND"] = 200 NOOBDKP_g_options["HC_INVTYPE_WAIST"] = 200 NOOBDKP_g_options["HC_INVTYPE_LEGS"] = 200 NOOBDKP_g_options["HC_INVTYPE_FEET"] = 200 NOOBDKP_g_options["HC_INVTYPE_FINGER"] = 200 NOOBDKP_g_options["HC_INVTYPE_TRINKET"] = 300 NOOBDKP_g_options["HC_INVTYPE_2HWEAPON"] = 300 NOOBDKP_g_options["HC_INVTYPE_WEAPON"] = 250 NOOBDKP_g_options["HC_INVTYPE_SHIELD"] = 250 NOOBDKP_g_options["HC_INVTYPE_RANGED"] = 250 NOOBDKP_g_options["HC_INVTYPE_THROWN"] = 250 NOOBDKP_g_options["HC_INVTYPE_WEAPONMAINHAND"] = 250 NOOBDKP_g_options["HC_INVTYPE_WEAPONOFFHAND"] = 250 NOOBDKP_g_options["HC_INVTYPE_HOLDABLE"] = 250 NOOBDKP_g_options["HC_INVTYPE_RELIC"] = 0 end if NOOBDKP_g_boss_table == nil then NOOBDKP_g_boss_table = {} NOOBDKP_g_boss_table["Lord Marrowgar"] = 20 NOOBDKP_g_boss_table["Lady Deathwhisper"] = 20 NOOBDKP_g_boss_table["Gunship Battle"] = 20 NOOBDKP_g_boss_table["Deathbringer Saurfang"] = 20 NOOBDKP_g_boss_table["Festergut"] = 20 NOOBDKP_g_boss_table["Rotface"] = 20 NOOBDKP_g_boss_table["Professor Putricide"] = 20 NOOBDKP_g_boss_table["Prince Valanar"] = 20 -- Blood Prince Council NOOBDKP_g_boss_table["Blood-Queen Lana'thel"] = 20 NOOBDKP_g_boss_table["Valithria Dreamwalker"] = 20 NOOBDKP_g_boss_table["Sindragosa"] = 20 NOOBDKP_g_boss_table["The Lich King"] = 100 NOOBDKP_g_boss_table["Halion Controller"] = 100 end if NOOBDKP_g_boss_emote == nil then NOOBDKP_g_boss_emote = { ["High Overlord Saurfang"] = { "The Alliance falter.", "Gunship Battle" }, ["Muradin Bronzebeard"] = { "Don't say I didn't warn ya", "Gunship Battle" }, ["Valthria Dreamwalker"] = { "I AM RENEWED!", "Valthria Dreamwalker" }, } end if NOOBDKP_g_loot_table == nil then NOOBDKP_g_loot_table = { ["|cffa335ee|Hitem:50063:0:0:0:0:0:0:0:1|h[Lingering Illness]|h|r"] = { ["need"] = "Holy Priest, Disco Priest", ["greed"] = "Other casters", }, ["|cffa335ee|Hitem:50793:0:0:0:0:0:0:0:1|h[Midnight Sun]|h|r"] = { ["need"] = "Resto Shaman, Holy Priest, Resto Druid", ["greed"] = "Other casters", }, ["|cffa335ee|Hitem:50171:0:0:0:0:0:0:0:1|h[Shoulders of Frost-Tipped Thorns]|h|r"] = { ["need"] = "Resto Druid, Balance Druid", ["greed"] = "Other casters", }, ["|cffa335ee|Hitem:50061:0:0:0:0:0:0:0:1|h[Holiday's Grace]|h|r"] = { ["need"] = "Holy Priests, Disco Priests", ["greed"] = "Other casters", }, ["|cffa335ee|Hitem:50798:0:0:0:0:0:0:0:1|h[Ramaladni's Blade of Culling]|h|r"] = { ["need"] = "DPS", ["greed"] = { }, }, ["|cffa335ee|Hitem:50783:0:0:0:0:0:0:0:1|h[Boots of the Frozen Seed]|h|r"] = { ["need"] = { }, ["greed"] = { }, }, ["|cffa335ee|Hitem:50805:0:0:0:0:0:0:0:1|h[Mag'hari Chieftain's Staff]|h|r"] = { ["need"] = { }, ["greed"] = { }, }, ["|cffa335ee|Hitem:50178:0:0:0:0:0:0:0:1|h[Bloodfall]|h|r"] = { ["need"] = "Ret Paladin, Cat Druid, Bear Druid", ["greed"] = "Warriors", }, ["|cffa335ee|Hitem:50414:0:0:0:0:0:0:0:1|h[Might of Blight]|h|r"] = { ["need"] = "DPS DK, Warriors", ["greed"] = "Other Melee DPS", }, ["|cffa335ee|Hitem:50413:0:0:0:0:0:0:0:1|h[Nerub'ar Stalker's Cord]|h|r"] = { ["need"] = "Hunters, Enhancement Shamans", ["greed"] = "Other DPS (mail only)", }, ["|cffa335ee|Hitem:50040:0:0:0:0:0:0:0:1|h[Distant Land]|h|r"] = { ["need"] = "Cat Druid", ["greed"] = "Other DPS (staff only)", }, ["|cffa335ee|Hitem:50351:0:0:0:0:0:0:0:1|h[Tiny Abomination in a Jar]|h|r"] = { ["need"] = "Ret Paladin, Assasin Rogue", ["greed"] = "Other Melee DPS", }, ["|cffa335ee|Hitem:50016:0:0:0:0:0:0:0:1|h[Rib Spreader]|h|r"] = { ["need"] = "Assasin Rogue", ["greed"] = "Other Melee DPS (dagger only)", }, ["|cffa335ee|Hitem:50781:0:0:0:0:0:0:0:1|h[Scourgelord's Baton]|h|r"] = { ["need"] = { }, ["greed"] = { }, }, ["|cffa335ee|Hitem:50450:0:0:0:0:0:0:0:1|h[Leggings of Dubious Charms]|h|r"] = { ["need"] = { }, ["greed"] = { }, }, ["|cffa335ee|Hitem:50808:0:0:0:0:0:0:0:1|h[Deathforged Legplates]|h|r"] = { ["need"] = { }, ["greed"] = { }, }, ["|cffa335ee|Hitem:50776:0:0:0:0:0:0:0:1|h[Njorndar Bone Bow]|h|r"] = { ["need"] = { }, ["greed"] = { }, }, ["|cffa335ee|Hitem:50177:0:0:0:0:0:0:0:1|h[Mail of Crimson Coins]|h|r"] = { ["need"] = "Resto Shaman", ["greed"] = "Other Casters (mail only)", }, ["|cffa335ee|Hitem:50342:0:0:0:0:0:0:0:1|h[Whispering Fanged Skull]|h|r"] = { ["need"] = { }, ["greed"] = { }, }, ["|cffa335ee|Hitem:50175:0:0:0:0:0:0:0:1|h[Crypt Keeper's Bracers]|h|r"] = { ["need"] = "Holy Paladin", ["greed"] = "Other Paladins", }, ["|cffa335ee|Hitem:52026:0:0:0:0:0:0:0:1|h[Protector's Mark of Sanctification]|h|r"] = { ["need"] = "Hunter, Shaman, Warrior", ["greed"] = { }, }, ["|cffa335ee|Hitem:50800:0:0:0:0:0:0:0:1|h[Hauberk of a Thousand Cuts]|h|r"] = { ["need"] = { }, ["greed"] = { }, }, ["|cffa335ee|Hitem:50340:0:0:0:0:0:0:0:1|h[Muradin's Spyglass]|h|r"] = { ["need"] = { }, ["greed"] = { }, }, ["|cffa335ee|Hitem:50069:0:0:0:0:0:0:0:1|h[Professor's Bloodied Smock]|h|r"] = { ["need"] = "Resto Druid, Balance Druid", ["greed"] = "Other Casters (leather only)", }, ["|cffa335ee|Hitem:52027:0:0:0:0:0:0:0:1|h[Conqueror's Mark of Sanctification]|h|r"] = { ["need"] = "Paladin, Priest, Warlock", ["greed"] = { }, }, ["|cffa335ee|Hitem:50789:0:0:0:0:0:0:0:1|h[Icecrown Rampart Bracers]|h|r"] = { ["need"] = { }, ["greed"] = { }, }, ["|cffa335ee|Hitem:50421:0:0:0:0:0:0:0:1|h[Sindragosa's Cruel Claw]|h|r"] = { ["need"] = "Rogues, Cat Druids, Hunters", ["greed"] = "Other DPS", }, ["|cffa335ee|Hitem:50791:0:0:0:0:0:0:0:1|h[Saronite Gargoyle Cloak]|h|r"] = { ["need"] = { }, ["greed"] = { }, }, ["|cffa335ee|Hitem:50173:0:0:0:0:0:0:0:1|h[Shadow Silk Spindle]|h|r"] = { ["need"] = "Holy Paladin, Resto Shaman, Disco Priest", ["greed"] = "Other Casters and Healers", }, ["|cffa335ee|Hitem:50030:0:0:0:0:0:0:0:1|h[Bloodsunder's Bracers]|h|r"] = { ["need"] = "Resto Shaman, Elemental Shaman", ["greed"] = "Holy Paladin", }, ["|cffa335ee|Hitem:50787:0:0:0:0:0:0:0:1|h[Frost Giant's Cleaver]|h|r"] = { ["need"] = { }, ["greed"] = { }, }, ["|cffa335ee|Hitem:50060:0:0:0:0:0:0:0:1|h[Faceplate of the Forgotten]|h|r"] = { ["need"] = { }, ["greed"] = { }, }, ["|cffa335ee|Hitem:50071:0:0:0:0:0:0:0:1|h[Treads of the Wasteland]|h|r"] = { ["need"] = "Enhance Shaman, Hunters", ["greed"] = "Other DPS (mail only)", }, ["|cffa335ee|Hitem:50180:0:0:0:0:0:0:0:1|h[Lana'thel's Chain of Flagellation]|h|r"] = { ["need"] = "DK DPS, Warriors, Retribution Paladins", ["greed"] = "Other DPS", }, ["|cffa335ee|Hitem:50065:0:0:0:0:0:0:0:1|h[Icecrown Glacial Wall]|h|r"] = { ["need"] = "Paladin Tank, Warrior Tank", ["greed"] = "Others (shield only)", }, ["|cffa335ee|Hitem:50806:0:0:0:0:0:0:0:1|h[Leggings of Unrelenting Blood]|h|r"] = { ["need"] = { }, ["greed"] = { }, }, ["|cffa335ee|Hitem:50062:0:0:0:0:0:0:0:1|h[Plague Scientist's Boots]|h|r"] = { ["need"] = "All Cloth, Balance Druids, Element Shaman, Resto Shaman", ["greed"] = "Other casters", }, ["|cffa335ee|Hitem:50807:0:0:0:0:0:0:0:1|h[Thaumaturge's Crackling Cowl]|h|r"] = { ["need"] = { }, ["greed"] = { }, }, ["|cffa335ee|Hitem:50453:0:0:0:0:0:0:0:1|h[Ring of Rotting Sinew]|h|r"] = { ["need"] = { }, ["greed"] = { }, }, ["|cffa335ee|Hitem:50226:0:0:0:0:0:0:0:1|h[Festergut's Acidic Blood]|h|r"] = { ["need"] = { }, ["greed"] = { }, }, ["|cffa335ee|Hitem:50775:0:0:0:0:0:0:0:1|h[Corrupted Silverplate Leggings]|h|r"] = { ["need"] = { }, ["greed"] = { }, }, ["|cffa335ee|Hitem:50186:0:0:0:0:0:0:0:1|h[Frostbrood Sapphire Ring]|h|r"] = { ["need"] = "Combat Rogue, Hunters, Warriors, Cat Druid", ["greed"] = "Other DPS", }, ["|cffa335ee|Hitem:50762:0:0:0:0:0:0:0:1|h[Linked Scourge Vertebrae]|h|r"] = { ["need"] = { }, ["greed"] = { }, }, ["|cffa335ee|Hitem:50763:0:0:0:0:0:0:0:1|h[Marrowgar's Scratching Choker]|h|r"] = { ["need"] = { }, ["greed"] = { }, }, ["|cffa335ee|Hitem:49919:0:0:0:0:0:0:0:1|h[Cryptmaker]|h|r"] = { ["need"] = "Warriors, Blood DK", ["greed"] = "Other DPS (2H Maces only)", }, ["|cffa335ee|Hitem:50782:0:0:0:0:0:0:0:1|h[Sister's Handshrouds]|h|r"] = { ["need"] = { }, ["greed"] = { }, }, ["|cffa335ee|Hitem:50790:0:0:0:0:0:0:0:1|h[Abomination's Bloody Ring]|h|r"] = { ["need"] = { }, ["greed"] = { }, }, ["|cffa335ee|Hitem:52025:0:0:0:0:0:0:0:1|h[Vanquisher's Mark of Sanctification]|h|r"] = { ["need"] = "Death Knights, Druids, Mages, Rogues", ["greed"] = { }, }, ["|cffa335ee|Hitem:50170:0:0:0:0:0:0:0:1|h[Valanar's Other Signet Ring]|h|r"] = { ["need"] = "DPS Casters", ["greed"] = "Other Casters", }, ["|cffa335ee|Hitem:50428:0:0:0:0:0:0:0:1|h[Royal Scepter of Terenas II]|h|r"] = { ["need"] = "Mace Casters", ["greed"] = { }, }, ["|cffa335ee|Hitem:50179:0:0:0:0:0:0:0:1|h[Last Word]|h|r"] = { ["need"] = "All Tanks", ["greed"] = "Other DPS (2H only)", }, ["|cffa335ee|Hitem:50059:0:0:0:0:0:0:0:1|h[Horrific Flesh Epaulets]|h|r"] = { ["need"] = "Elemental Shaman", ["greed"] = "Resto Shaman, Holy Paladin, Other healers", }, ["|cffa335ee|Hitem:50072:0:0:0:0:0:0:0:1|h[Landsoul's Horned Greathelm]|h|r"] = { ["need"] = "Warrior DPS, Retribution Paladin", ["greed"] = "Other DPS (plate only)", }, ["|cffa335ee|Hitem:50074:0:0:0:0:0:0:0:1|h[Royal Crimson Cloak]|h|r"] = { ["need"] = "All Tanks", ["greed"] = "Tank OS", }, ["|cffa335ee|Hitem:50771:0:0:0:0:0:0:0:1|h[Frost Needle]|h|r"] = { ["need"] = { }, ["greed"] = { }, }, ["|cffa335ee|Hitem:50426:0:0:0:0:0:0:0:1|h[Heaven's Fall, Kryss of a Thousand Lies]|h|r"] = { ["need"] = "Assasin Rogue", ["greed"] = "Other DPS (daggers only)", }, ["|cffa335ee|Hitem:50786:0:0:0:0:0:0:0:1|h[Ghoul Commander's Cuirass]|h|r"] = { ["need"] = { }, ["greed"] = { }, }, ["|cffa335ee|Hitem:50036:0:0:0:0:0:0:0:1|h[Belt of Broken Bones]|h|r"] = { ["need"] = "All Tanks", ["greed"] = "Tank OS", }, ["|cffa335ee|Hitem:50185:0:0:0:0:0:0:0:1|h[Devium's Eternally Cold Ring]|h|r"] = { ["need"] = "All Tanks", ["greed"] = "Tank OS", }, ["|cffa335ee|Hitem:50447:0:0:0:0:0:0:0:1|h[Harbinger's Bone Band]|h|r"] = { ["need"] = { }, ["greed"] = { }, }, ["|cffa335ee|Hitem:50360:0:0:0:0:0:0:0:1|h[Phylactery of the Nameless Lich]|h|r"] = { ["need"] = "All DPS Casters", ["greed"] = "DPS OS", }, ["|cffa335ee|Hitem:50779:0:0:0:0:0:0:0:1|h[Deathspeaker Zealot's Helm]|h|r"] = { ["need"] = { }, ["greed"] = { }, }, ["|cffa335ee|Hitem:50354:0:0:0:0:0:0:0:1|h[Bauble of True Blood]|h|r"] = { ["need"] = "All Healers", ["greed"] = "Healer OS", }, ["|cffa335ee|Hitem:50190:0:0:0:0:0:0:0:1|h[Grinning Skull Greatboots]|h|r"] = { ["need"] = "Warrior Tank, Paladin Tank, DK Tank", ["greed"] = "Other Plate wearers, Tank OS", }, ["|cffa335ee|Hitem:50028:0:0:0:0:0:0:0:1|h[Trauma]|h|r"] = { ["need"] = "All Healers", ["greed"] = "Healer OS", }, ["|cffa335ee|Hitem:50026:0:0:0:0:0:0:0:1|h[Helm of the Elder Moon]|h|r"] = { ["need"] = "Resto Druid, Balance Druid", ["greed"] = "Other casters (leather only)", }, ["|cffa335ee|Hitem:50202:0:0:0:0:0:0:0:1|h[Snowstorm Helm]|h|r"] = { ["need"] = "Resto Shaman", ["greed"] = "Other casters (mail only)", }, ["|cffa335ee|Hitem:50022:0:0:0:0:0:0:0:1|h[Dual-Bladed Pauldrons]|h|r"] = { ["need"] = { }, ["greed"] = { }, }, ["|cffa335ee|Hitem:50797:0:0:0:0:0:0:0:1|h[Ice-Reinforced Vrykul Helm]|h|r"] = { ["need"] = { }, ["greed"] = { }, }, ["|cffa335ee|Hitem:50785:0:0:0:0:0:0:0:1|h[Bracers of Dark Blessings]|h|r"] = { ["need"] = { }, ["greed"] = { }, }, ["|cffa335ee|Hitem:50192:0:0:0:0:0:0:0:1|h[Scourge Reaver's Legplates]|h|r"] = { ["need"] = "Unholy DK", ["greed"] = "Other DPS (plate only)", }, ["|cffa335ee|Hitem:50761:0:0:0:0:0:0:0:1|h[Citadel Enforcer's Claymore]|h|r"] = { ["need"] = { }, ["greed"] = { }, }, ["|cffa335ee|Hitem:50792:0:0:0:0:0:0:0:1|h[Pauldrons of Lost Hope]|h|r"] = { ["need"] = { }, ["greed"] = { }, }, ["|cffa335ee|Hitem:50183:0:0:0:0:0:0:0:1|h[Lungbreaker]|h|r"] = { ["need"] = "Assasin Rogue", ["greed"] = "Other DPS (dagger only)", }, ["|cffa335ee|Hitem:50184:0:0:0:0:0:0:0:1|h[Keleseth's Seducer]|h|r"] = { ["need"] = "Combat Rogue, Enhance Shaman", ["greed"] = "Other DPS (fist only)", }, ["|cffa335ee|Hitem:50024:0:0:0:0:0:0:0:1|h[Blightborne Warplate]|h|r"] = { ["need"] = "DK Tank, Warrior Tank, Paladin Tank", ["greed"] = "Tank OS", }, ["|cffa335ee|Hitem:50759:0:0:0:0:0:0:0:1|h[Bone Warden's Splitter]|h|r"] = { ["need"] = { }, ["greed"] = { }, }, ["|cffa335ee|Hitem:50452:0:0:0:0:0:0:0:1|h[Wodin's Lucky Necklace]|h|r"] = { ["need"] = { }, ["greed"] = { }, }, ["|cffa335ee|Hitem:50429:0:0:0:0:0:0:0:1|h[Archus, Greatstaff of Antonidas]|h|r"] = { ["need"] = { }, ["greed"] = { }, }, ["|cffa335ee|Hitem:50425:0:0:0:0:0:0:0:1|h[Oathbinder, Charge of the Ranger-General]|h|r"] = { ["need"] = "Bear DPS, Cat DPS, Hunters, Retribution Paladin", ["greed"] = "DPS OS (2H Only)", }, ["|cffa335ee|Hitem:49997:0:0:0:0:0:0:0:1|h[Mithrios, Bronzebeard's Legacy]|h|r"] = { ["need"] = { }, ["greed"] = { }, }, ["|cffa335ee|Hitem:50774:0:0:0:0:0:0:0:1|h[Coldwraith Bracers]|h|r"] = { ["need"] = { }, ["greed"] = { }, }, ["|cffa335ee|Hitem:50012:0:0:0:0:0:0:0:1|h[Havoc's Call, Blade of Lordaeron Kings]|h|r"] = { ["need"] = "Frost DK, Enhance Shaman, Combat Rogue", ["greed"] = "Other DPS", }, ["|cffa335ee|Hitem:50042:0:0:0:0:0:0:0:1|h[Gangrenous Leggings]|h|r"] = { ["need"] = "Combat Rogue", ["greed"] = "Other DPS (leather only)", }, ["|cffa335ee|Hitem:50067:0:0:0:0:0:0:0:1|h[Astrylian's Sutured Cinch]|h|r"] = { ["need"] = "Rogues, Cat Druid, Bear Druid, Retribution Paladin", ["greed"] = "Other DPS (leather only)", }, ["|cffa335ee|Hitem:50423:0:0:0:0:0:0:0:1|h[Sundial of Eternal Dusk]|h|r"] = { ["need"] = "Resto Druid, Holy Priest, Warlock", ["greed"] = "Other casters", }, ["|cffa335ee|Hitem:50025:0:0:0:0:0:0:0:1|h[Seal of Many Mouths]|h|r"] = { ["need"] = "Bear Druid, Cat Druid, Retribution Paladin, Rogues, Enhance Shaman", ["greed"] = "Other DPS", }, ["|cffa335ee|Hitem:50777:0:0:0:0:0:0:0:1|h[Handgrips of Frost and Sleet]|h|r"] = { ["need"] = { }, ["greed"] = { }, }, ["|cffa335ee|Hitem:50778:0:0:0:0:0:0:0:1|h[Soulthief's Braided Belt]|h|r"] = { ["need"] = { }, ["greed"] = { }, }, ["|cffa335ee|Hitem:50427:0:0:0:0:0:0:0:1|h[Bloodsurge, Kel'Thuzad's Blade of Agony]|h|r"] = { ["need"] = "Caster sword", ["greed"] = "Caster OS", }, ["|cffa335ee|Hitem:50803:0:0:0:0:0:0:0:1|h[Saurfang's Cold-Forged Band]|h|r"] = { ["need"] = { }, ["greed"] = { }, }, ["|cffa335ee|Hitem:50796:0:0:0:0:0:0:0:1|h[Bracers of Pale Illumination]|h|r"] = { ["need"] = { }, ["greed"] = { }, }, ["|cffa335ee|Hitem:50788:0:0:0:0:0:0:0:1|h[Bone Drake's Enameled Boots]|h|r"] = { ["need"] = { }, ["greed"] = { }, }, ["|cffa335ee|Hitem:50035:0:0:0:0:0:0:0:1|h[Black Bruise]|h|r"] = { ["need"] = "Enhance Shaman, Combat Rogue", ["greed"] = "Other DPS (fist only)", }, ["|cffa335ee|Hitem:50449:0:0:0:0:0:0:0:1|h[Stiffened Corpse Shoulderpads]|h|r"] = { ["need"] = { }, ["greed"] = { }, }, ["|cffa335ee|Hitem:50020:0:0:0:0:0:0:0:1|h[Raging Behemoth's Shoulderplates]|h|r"] = { ["need"] = { }, ["greed"] = { }, }, ["|cffa335ee|Hitem:50804:0:0:0:0:0:0:0:1|h[Icecrown Spire Sandals]|h|r"] = { ["need"] = { }, ["greed"] = { }, }, ["|cffa335ee|Hitem:50795:0:0:0:0:0:0:0:1|h[Cord of Dark Suffering]|h|r"] = { ["need"] = { }, ["greed"] = { }, }, ["|cffa335ee|Hitem:50195:0:0:0:0:0:0:0:1|h[Noose of Malachite]|h|r"] = { ["need"] = "All Tanks", ["greed"] = "Tank OS", }, ["|cffa335ee|Hitem:50416:0:0:0:0:0:0:0:1|h[Boots of the Funeral March]|h|r"] = { ["need"] = "Holy Paladin", ["greed"] = "Paladin OS", }, ["|cffa335ee|Hitem:50187:0:0:0:0:0:0:0:1|h[Coldwraith Links]|h|r"] = { ["need"] = "DK, Warriors", ["greed"] = "Other DPS (plate only)", }, ["|cffa335ee|Hitem:50019:0:0:0:0:0:0:0:1|h[Winding Sheet]|h|r"] = { ["need"] = "Unholy DK, Frost DK, Retribution Paladin", ["greed"] = "Other DPS", }, ["|cffa335ee|Hitem:50472:0:0:0:0:0:0:0:1|h[Nightmare Ender]|h|r"] = { ["need"] = "Holy Priest, Disco Priest, Warlock", ["greed"] = "Other Casters (wand only)", }, ["|cffa335ee|Hitem:50361:0:0:0:0:0:0:0:1|h[Sindragosa's Flawless Fang]|h|r"] = { ["need"] = "All Tanks", ["greed"] = "Tank OS", }, ["|cffa335ee|Hitem:50417:0:0:0:0:0:0:0:1|h[Bracers of Eternal Dreaming]|h|r"] = { ["need"] = "Balance Druid, Resto Druid", ["greed"] = "Other casters", }, ["|cffa335ee|Hitem:50037:0:0:0:0:0:0:0:1|h[Fleshrending Gauntlets]|h|r"] = { ["need"] = "Retribution Paladin, DK DPS", ["greed"] = "Other DPS (plate only)", }, ["|cffa335ee|Hitem:50205:0:0:0:0:0:0:0:1|h[Frostbinder's Shredded Cape]|h|r"] = { ["need"] = "Other casters", ["greed"] = "Resto Druid, Holy Priest", }, ["|cffa335ee|Hitem:50041:0:0:0:0:0:0:0:1|h[Leather of Stitched Scourge Parts]|h|r"] = { ["need"] = "Balance Druid, Resto Druid", ["greed"] = "Other casters (leather only)", }, ["|cffa335ee|Hitem:50784:0:0:0:0:0:0:0:1|h[Deathspeaker Disciple's Belt]|h|r"] = { ["need"] = { }, ["greed"] = { }, }, ["|cffa335ee|Hitem:50764:0:0:0:0:0:0:0:1|h[Shawl of Nerubian Silk]|h|r"] = { ["need"] = { }, ["greed"] = { }, }, ["|cffa335ee|Hitem:49981:0:0:0:0:0:0:0:1|h[Fal'inrush, Defender of Quel'thalas]|h|r"] = { ["need"] = "Hunters, Rogues, DPS Warriors", ["greed"] = "Other DPS (crossbow only)", }, ["|cffa335ee|Hitem:50794:0:0:0:0:0:0:0:1|h[Neverending Winter]|h|r"] = { ["need"] = { }, ["greed"] = { }, }, ["|cffa335ee|Hitem:50780:0:0:0:0:0:0:0:1|h[Chestguard of the Frigid Noose]|h|r"] = { ["need"] = { }, ["greed"] = { }, }, ["|cffa335ee|Hitem:50068:0:0:0:0:0:0:0:1|h[Rigormortis]|h|r"] = { ["need"] = "DPS Casters", ["greed"] = "Caster OS", }, ["|cffa335ee|Hitem:50033:0:0:0:0:0:0:0:1|h[Corpse-Impaling Spike]|h|r"] = { ["need"] = "Priests, Mages, Warlocks", ["greed"] = { }, }, ["|cffa335ee|Hitem:50182:0:0:0:0:0:0:0:1|h[Blood Queen's Crimson Choker]|h|r"] = { ["need"] = "Holy Paladin, Resto Shaman, Disco Priest, Mage, Balance Druid, Element Shaman", ["greed"] = "Other Casters", }, ["|cffa335ee|Hitem:50339:0:0:0:0:0:0:0:1|h[Sliver of Pure Ice]|h|r"] = { ["need"] = { }, ["greed"] = { }, }, ["|cffa335ee|Hitem:50799:0:0:0:0:0:0:0:1|h[Scourge Stranglers]|h|r"] = { ["need"] = { }, ["greed"] = { }, }, ["|cffff8000|Hitem:50274:0:0:0:0:0:0:0:1|h[Shadowfrost Shard]|h|r"] = { ["need"] = "Paladin, Warrior, DK - MUST BE ON THE QUEST", ["greed"] = { }, }, ["|cffa335ee|Hitem:50802:0:0:0:0:0:0:0:1|h[Gargoyle Spit Bracers]|h|r"] = { ["need"] = { }, ["greed"] = { }, }, ["|cffa335ee|Hitem:50181:0:0:0:0:0:0:0:1|h[Dying Light]|h|r"] = { ["need"] = "Holy Priest, Resto Druid", ["greed"] = "Other Casters", }, ["|cffa335ee|Hitem:50023:0:0:0:0:0:0:0:1|h[Bile-Encrusted Medallion]|h|r"] = { ["need"] = "All Tanks", ["greed"] = "Tank OS", }, ["|cffa335ee|Hitem:50038:0:0:0:0:0:0:0:1|h[Carapace of Forgotten Kings]|h|r"] = { ["need"] = "Enhance Shaman, Hunters", ["greed"] = "Other DPS (mail only)", }, ["|cffa335ee|Hitem:50174:0:0:0:0:0:0:0:1|h[Incarnadine Band of Mending]|h|r"] = { ["need"] = "Disco Priest", ["greed"] = "Other Healers and DPS Casters", }, ["|cffa335ee|Hitem:50176:0:0:0:0:0:0:0:1|h[San'layn Ritualist Gloves]|h|r"] = { ["need"] = "Disco Priest", ["greed"] = "Other Healers and DPS Casters", }, ["|cffa335ee|Hitem:50760:0:0:0:0:0:0:0:1|h[Bonebreaker Scepter]|h|r"] = { ["need"] = { }, ["greed"] = { }, }, ["|cffa335ee|Hitem:50801:0:0:0:0:0:0:0:1|h[Blade-Scored Carapace]|h|r"] = { ["need"] = { }, ["greed"] = { }, }, ["|cffa335ee|Hitem:50032:0:0:0:0:0:0:0:1|h[Death Surgeon's Sleeves]|h|r"] = { ["need"] = "Holy Priest, Disco Priest, Resto Druid", ["greed"] = "Other Healers and DPS Casters", }, ["|cffa335ee|Hitem:50073:0:0:0:0:0:0:0:1|h[Geistlord's Punishment Sack]|h|r"] = { ["need"] = "Cat Druid, Rogues", ["greed"] = "Other Melee DPS (leather only)", }, ["|cffa335ee|Hitem:50773:0:0:0:0:0:0:0:1|h[Cord of the Patronizing Practitioner]|h|r"] = { ["need"] = { }, ["greed"] = { }, }, ["|cffa335ee|Hitem:50172:0:0:0:0:0:0:0:1|h[Sanguine Silk Robes]|h|r"] = { ["need"] = "Resto Druid, Holy Priest", ["greed"] = "Other Healers and Caster DPS", }, ["|cff0070dd|Hitem:49908:0:0:0:0:0:0:0:1|h[Primordial Saronite]|h|r"] = { ["need"] = { }, ["greed"] = { }, }, ["|cffa335ee|Hitem:50772:0:0:0:0:0:0:0:1|h[Ancient Skeletal Boots]|h|r"] = { ["need"] = { }, ["greed"] = { }, }, ["|cffa335ee|Hitem:50021:0:0:0:0:0:0:0:1|h[Aldriana's Gloves of Secrecy]|h|r"] = { ["need"] = "Warriors, Frost DK, Cat Druid, Combat Rogue", ["greed"] = "Other DPS (leather only)", }, ["|cffa335ee|Hitem:50444:0:0:0:0:0:0:0:1|h[Rowan's Rifle of Silver Bullets]|h|r"] = { ["need"] = { }, ["greed"] = { }, }, ["|cffa335ee|Hitem:50199:0:0:0:0:0:0:0:1|h[Leggings of Dying Candles]|h|r"] = { ["need"] = "Holy Paladins", ["greed"] = "Paladin OS", }, ["|cffa335ee|Hitem:50353:0:0:0:0:0:0:0:1|h[Dislodged Foreign Object]|h|r"] = { ["need"] = "DPS Casters", ["greed"] = "DPS Caster OS", }, ["|cffa335ee|Hitem:50809:0:0:0:0:0:0:0:1|h[Soulcleave Pendant]|h|r"] = { ["need"] = { }, ["greed"] = { }, }, ["|cffa335ee|Hitem:50056:0:0:0:0:0:0:0:1|h[Plaguebringer's Stained Pants]|h|r"] = { ["need"] = "Shadow Priest, Mages, Warlocks, Holy Paladin, Balance Druid", ["greed"] = "Other Casters", }, ["|cffa335ee|Hitem:50064:0:0:0:0:0:0:0:1|h[Unclean Surgical Gloves]|h|r"] = { ["need"] = "Resto Shaman", ["greed"] = "Holy Paladin", }, ["|cffa335ee|Hitem:50424:0:0:0:0:0:0:0:1|h[Memory of Malygos]|h|r"] = { ["need"] = "Resto Druid, Holy Priest", ["greed"] = "Other Healers and Caster DPS", }, ["|cffa335ee|Hitem:50231:0:0:0:0:0:0:0:1|h[Rotface's Acidic Blood]|h|r"] = { ["need"] = { }, ["greed"] = { }, }, ["|cffa335ee|Hitem:50027:0:0:0:0:0:0:0:1|h[Rot-Resistant Breastplate]|h|r"] = { ["need"] = "Holy Paladin", ["greed"] = { }, }, ["|cffa335ee|Hitem:50070:0:0:0:0:0:0:0:1|h[Glorenzelg, High-Blade of the Silver Hand]|h|r"] = { ["need"] = "Warriors, DK DPS, Retribution Paladin", ["greed"] = "Other DPS (2H only)", }, ["|cffa335ee|Hitem:50451:0:0:0:0:0:0:0:1|h[Belt of the Lonely Noble]|h|r"] = { ["need"] = { }, ["greed"] = { }, }, ["|cffa335ee|Hitem:50188:0:0:0:0:0:0:0:1|h[Anub'ar Stalker's Gloves]|h|r"] = { ["need"] = "Retribution Paladin, Enhance Shaman", ["greed"] = "Other DPS (mail only)", }, ["|cffa335ee|Hitem:50075:0:0:0:0:0:0:0:1|h[Taldaram's Plated Fists]|h|r"] = { ["need"] = "Warrior Tank, DK Tank, Paladin Tank", ["greed"] = "Tank OS", }, ["|cffa335ee|Hitem:50418:0:0:0:0:0:0:0:1|h[Robe of the Waking Nightmare]|h|r"] = { ["need"] = "All DPS Casters", ["greed"] = "Other casters", }, } end
local spec = require('cmp.utils.spec') local lsp = require('cmp.types.lsp') describe('types.lsp', function() before_each(spec.before) describe('Position', function() vim.fn.setline('1', { 'あいうえお', 'かきくけこ', 'さしすせそ', }) local vim_position, lsp_position vim_position = lsp.Position.to_vim('%', { line = 1, character = 3 }) assert.are.equal(vim_position.row, 2) assert.are.equal(vim_position.col, 10) lsp_position = lsp.Position.to_lsp('%', vim_position) assert.are.equal(lsp_position.line, 1) assert.are.equal(lsp_position.character, 3) vim_position = lsp.Position.to_vim('%', { line = 1, character = 0 }) assert.are.equal(vim_position.row, 2) assert.are.equal(vim_position.col, 1) lsp_position = lsp.Position.to_lsp('%', vim_position) assert.are.equal(lsp_position.line, 1) assert.are.equal(lsp_position.character, 0) vim_position = lsp.Position.to_vim('%', { line = 1, character = 5 }) assert.are.equal(vim_position.row, 2) assert.are.equal(vim_position.col, 16) lsp_position = lsp.Position.to_lsp('%', vim_position) assert.are.equal(lsp_position.line, 1) assert.are.equal(lsp_position.character, 5) -- overflow (lsp -> vim) vim_position = lsp.Position.to_vim('%', { line = 1, character = 6 }) assert.are.equal(vim_position.row, 2) assert.are.equal(vim_position.col, 16) -- overflow(vim -> lsp) vim_position.col = vim_position.col + 1 lsp_position = lsp.Position.to_lsp('%', vim_position) assert.are.equal(lsp_position.line, 1) assert.are.equal(lsp_position.character, 5) end) end)
#!/usr/bin/env lua -- Matrix transposition local cl = require('mooncl') -- cl.trace_objects(true) -- Create device, context, and command queue local platform = cl.get_platform_ids()[1] local device = cl.get_device_ids(platform, cl.DEVICE_TYPE_ALL)[1] local context = cl.create_context(platform, {device}) local queue = cl.create_command_queue(context, device) -- Build program and create kernel local program = cl.create_program_with_sourcefile(context, "transpose.cl") cl.build_program(program, {device}) local kernel = cl.create_kernel(program, "transpose") -- Input data (a NxN matrix) local N = 64 -- matrix dimension (N x N) local matrix = {} for i=1,N do matrix[i] = {} for j=1,N do matrix[i][j] = (i-1)*N + j-1 end end local mem = cl.malloc('float', matrix) local buf = cl.create_buffer(context, cl.MEM_READ_WRITE|cl.MEM_COPY_HOST_PTR, mem:size(), mem:ptr()) -- Determine execution parameters local global_size = (N/4 * (N/4 + 1))/2 local local_mem_size = cl.get_device_info(device, 'local mem size') -32 -- (for some reason I cannot allocate local_mem_size bytes on my GPU, but I can -- allocate 32 bytes less than that...) -- Set arguments and enqueue kernel for execution local size = N/4 cl.set_kernel_arg(kernel, 0, buf) cl.set_kernel_arg(kernel, 1, local_mem_size) cl.set_kernel_arg(kernel, 2, 'uint', size) cl.enqueue_ndrange_kernel(queue, kernel, 1, nil, {global_size}) -- Read back the result and check it cl.enqueue_read_buffer(queue, buf, true, 0, mem:size(), mem:ptr()) local transpose = {} local rowsize = N*cl.sizeof('float') for i=1,N do transpose[i] = mem:read((i-1)*rowsize, rowsize, 'float') end local ok = true for i=1,N do for j=1,N do if transpose[i][j] ~= matrix[j][i] then ok=false break end end end print("Transpose check "..(ok and "succeeded." or "failed."))
--region data.pbc_config_manager.lua --Author : OWenT --Date : 2015/01/17 --启动载入项 local class = require('utils.class') local loader = require('utils.loader') local conf_set = class.register('data.pbc_config_data_set') -- 必须保证pbc已经载入 local pbc = protobuf function conf_set:get_by_table(key) if not self or not key then return nil end local len = #key local i = 1 local ret = self.__data while ret and i <= len do ret = ret[key[i]] i = i + 1 end return ret end -- 数据集,通过key拉取配置数据 function conf_set:get(...) return self:get_by_table({...}) end -- 数据集,拉取所有配置数据 function conf_set:get_all() return self.__data end function conf_set:set_by_table(args) if not self or not args or #args < 2 then return nil end local i = 1 local ret = self.__data local len = #args - 2 while i <= len do if not ret[args[i]] then ret[args[i]] = {} end ret = ret[args[i]] i = i + 1 end ret[args[len + 1]] = args[len + 2] return args[len + 2] end function conf_set:set(...) return self:set_by_table({...}) end local pbc_config_manager = class.register('data.pbc_config_manager', class.singleton) pbc_config_manager.__path_rule = '%s' pbc_config_manager.__list_path = nil pbc_config_manager.__data = {} -- 设置路径规则 -- @param rule 路径规则(一定要带一个%s) -- @note 当读取协议message类型为PROTO的配置时,实际查找的协议名称为string.format(rule, PROTO) -- 比如protobuf的package名称是config,那么这里rule填 config.%s function pbc_config_manager:set_path_rule(rule) self.__path_rule = rule end -- 设置配置列表加载文件 -- @param l 配置列表加载文件(一定要带一个%s) -- @note 当执行reload时,清空完原来的配置后后会重新加载 string.format(rule, PROTO) function pbc_config_manager:set_list(l) self.__list_path = l end -- 读取配置数据块 -- @param path 配置协议名称 -- @param data_blocks 二进制数据 -- @param data_collector_fn 插入规则函数function (数据集, key, 配置项) -- @param kv_fn key提取规则函数function (索引, 配置项) return key列表,可以多个 end -- @param cfg_set_name 别名,通过pbc_config_manager:get(别名)查找配置,默认和path一样 function pbc_config_manager:load_datablocks(path, data_blocks, data_collector_fn, kv_fn, cfg_set_name) cfg_set_name = cfg_set_name or path pbc_config_manager.__data[cfg_set_name] = pbc_config_manager.__data[cfg_set_name] or conf_set.new({__data = {}}) local cfg = pbc_config_manager.__data[cfg_set_name] path = string.format(self.__path_rule, tostring(path)) kv_fn = kv_fn or function(k, v) return k end for ck, cv in ipairs(data_blocks.data_block) do -- log_debug('config content %s', string.gsub(cv, '.', function(x) return string.format('%02X', string.byte(x)) end) ) local rv, error_text = pbc.decode(path, cv) if false == rv then log_error('decode config item failed, path=%s: %s', tostring(path), error_text) return false end -- pbc 解包扩展 if 'function' == type(pbc.extract) then pbc.extract(rv) end local rk = { kv_fn(ck, rv) } data_collector_fn(cfg, rk, rv) end return true end -- 读取Key-Value型配置数据块 -- @param path 配置协议名称 -- @param data_blocks 二进制数据 -- @param kv_fn key提取规则函数function (索引, 配置项) return key列表,可以多个 end -- @param cfg_set_name 别名,通过pbc_config_manager:get(别名)查找配置,默认和path一样 function pbc_config_manager:load_buffer_kv(path, buffers, kv_fn, cfg_set_name) local msg, error_text = pbc.decode("com.owent.xresloader.pb.xresloader_datablocks", buffers) if false == msg then log_error('decode buffer failed, path=%s: %s', tostring(path), error_text) return false end return self:load_datablocks(path, msg, function(cfg, rk, rv) if cfg:get_by_table(rk) then for i = 1, #rk, 1 do if 0 ~= rk[i] and "" ~= rk[i] and nil ~= rk[i] then log_warn('config [%s] already has key %s, old record will be covered', path, table.concat(rk, ', ')) break end end end table.insert(rk, rv) cfg:set_by_table(rk) end, kv_fn, cfg_set_name ) end -- 读取Key-List型配置数据块 -- @param path 配置协议名称 -- @param data_blocks 二进制数据 -- @param kv_fn key提取规则函数function (索引, 配置项) return key列表,可以多个 end -- @param cfg_set_name 别名,通过pbc_config_manager:get(别名)查找配置,默认和path一样 function pbc_config_manager:load_buffer_kl(path, buffers, kv_fn, cfg_set_name) local msg, error_text = pbc.decode("com.owent.xresloader.pb.xresloader_datablocks", buffers) if false == msg then log_error('decode buffer failed, path=%s: %s', tostring(path), error_text) return false end return self:load_datablocks(path, msg, function(cfg, rk, rv) local ls = cfg:get_by_table(rk) if ls then table.insert(ls, rv) else ls = { rv } table.insert(rk, ls) cfg:set_by_table(rk) end end, kv_fn, cfg_set_name ) end -- 设置只读 -- @note 实际上就是包装一层然后让__newindex报错,会影响pairs、ipairs等的使用 function pbc_config_manager:set_readonly() self.__data = class.set_readonly(self.__data) end -- 根据别名(路径)获取配置集合 -- @param type_name 别名(路径) -- @return 配置集或nil function pbc_config_manager:get(type_name) return self.__data[type_name] or nil end -- 重新加载配置并重新加载“列表加载文件” function pbc_config_manager:reload() self.__data = {} if self.__list_path and #self.__list_path > 0 then loader.remove(self.__list_path) loader.load(self.__list_path) end end return pbc_config_manager
-- protocol naming p4_swids = Proto('p4_swids','P4_SWIDSProtocol') -- protocol fields local p4_swids_swid = ProtoField.string('p4_swids.swid','swid') p4_swids.fields = {p4_swids_swid} -- protocol dissector function function p4_swids.dissector(buffer,pinfo,tree) pinfo.cols.protocol = 'P4_SWIDS' local subtree = tree:add(p4_swids,buffer(),'P4_SWIDS Protocol Data') subtree:add(p4_swids_swid,tostring(buffer(0,4):bitfield(0,32))) local mydissectortable = DissectorTable.get('p4_swids.metadata._parser_metadata_remaining1') Could not detect suitable parameters end print( (require 'debug').getinfo(1).source ) -- creation of table for next layer(if required) local newdissectortable = DissectorTable.new('p4_swids.metadata._parser_metadata_remaining1','P4_SWIDS.METADATA._PARSER_METADATA_REMAINING1',ftypes.STRING) -- protocol registration my_table = DissectorTable.get('p4_mri.count') my_table:add(0x0,p4_swids) my_table = DissectorTable.get('p4_swids.metadata._parser_metadata_remaining1') my_table:add(0x0,p4_swids)
-- lsp/diagnostics highlights local lush = require "lush" local base = require "nano.base" local M = {} M = lush(function() return { DiagnosticWarn { base.Popout }, DiagnosticError { base.CriticalI }, DiagnosticInfo { base.Salient }, DiagnosticHint { base.Salient }, DiagnosticUnderlineError { base.Undercurl, fg = "none", guisp = base.CriticalI.fg, }, DiagnosticUnderlineWarn { base.Undercurl, fg = "none", guisp = base.CriticalI.fg, }, DiagnosticUnderlineInfo { base.Undercurl, fg = "none", guisp = base.CriticalI.fg, }, DiagnosticUnderlineHint { base.Undercurl, fg = "none", guisp = base.CriticalI.fg, }, DiagnosticFloatingError { base.Default }, DiagnosticFloatingWarn { base.Default }, DiagnosticFloatingInfo { base.Default }, DiagnosticFloatingHint { base.Default }, -- built in neovim lsp diagnostics DiagnosticSignError { base.CriticalI }, DiagnosticSignWarn { base.Popout }, DiagnosticSignInfo { base.Salient }, DiagnosticSignHint { base.Salient }, DiagnosticVirtualTextWarn { base.Popout }, DiagnosticVirtualTextError { base.CriticalI }, DiagnosticVirtualTextInfo { base.Salient }, DiagnosticsVirtualTextHint { base.Salient }, LspReferenceRead { base.Highlight }, LspReferenceText { base.Highlight }, LspReferenceWrite { base.Highlight }, } end) return M
-- -- Author: zhong -- Date: 2016-06-27 11:36:40 -- local CardSprite = class("CardSprite", cc.Sprite); --纹理宽高 local CARD_WIDTH = 133 local CARD_HEIGHT = 174 local BACK_Z_ORDER = 2 ------ --set/get function CardSprite:setDispatched( var ) self.m_bDispatched = var; end function CardSprite:getDispatched( ) if nil ~= self.m_bDispatched then return self.m_bDispatched; end return false; end function CardSprite:getCardData() return self.m_cardData end --拖动选择 function CardSprite:setCardDragSelect( var ) self.m_bDragSelect = var end function CardSprite:getCardDragSelect() return self.m_bDragSelect end --弹出 function CardSprite:setCardShoot( var ) self.m_bShoot = var end function CardSprite:getCardShoot() return self.m_bShoot end ------ function CardSprite:ctor() self.m_cardData = 0 self.m_cardValue = 0 self.m_cardColor = 0 self.m_bDispatched = false self.m_bDragSelect = false self.m_bShoot = false self.m_nCardWidth = 0 self.m_nCardHeight = 0 end --创建卡牌 function CardSprite:createCard( cbCardData, tagParam ) local sp = CardSprite.new(); tagParam = tagParam or {} sp.m_nCardWidth = tagParam._width or CARD_WIDTH sp.m_nCardHeight = tagParam._height or CARD_HEIGHT sp.m_strCardFile = tagParam._file or "game/card.png" local tex = cc.Director:getInstance():getTextureCache():getTextureForKey(sp.m_strCardFile); if nil ~= sp and nil ~= tex and sp:initWithTexture(tex, tex:getContentSize()) then sp.m_cardData = cbCardData; sp.m_cardValue = yl.POKER_VALUE[cbCardData] --math.mod(cbCardData, 16)--bit:_and(cbCardData, 0x0F) sp.m_cardColor = yl.CARD_COLOR[cbCardData] --math.floor(cbCardData / 16)--bit:_rshift(bit:_and(cbCardData, 0xF0), 4) sp:updateSprite(); --扑克背面 sp:createBack(); return sp; end return nil; end --设置卡牌数值 function CardSprite:setCardValue( cbCardData ) self.m_cardData = cbCardData; self.m_cardValue = yl.POKER_VALUE[cbCardData] --math.mod(cbCardData, 16) --bit:_and(cbCardData, 0x0F) self.m_cardColor = yl.CARD_COLOR[cbCardData] --math.floor(cbCardData / 16) --bit:_rshift(bit:_and(cbCardData, 0xF0), 4) self:updateSprite(); end --更新纹理资源 function CardSprite:updateSprite( ) local m_cardData = self.m_cardData local m_cardValue = self.m_cardValue local m_cardColor = self.m_cardColor local c_width = self.m_nCardWidth local c_height = self.m_nCardHeight self:setTag(m_cardData); local rect = cc.rect((m_cardValue - 1) * c_width, m_cardColor * c_height, c_width, c_height); if 0 ~= m_cardData then rect = cc.rect((m_cardValue - 1) * c_width, m_cardColor * c_height, c_width, c_height); if 0x4F == m_cardData then rect = cc.rect(0, 4 * c_height, c_width, c_height); elseif 0x4E == m_cardData then rect = cc.rect(c_width, 4 * c_height, c_width, c_height); end else --使用背面纹理区域 rect = cc.rect(2 * c_width, 4 * c_height, c_width, c_height); end self:setTextureRect(rect); end --显示扑克背面 function CardSprite:showCardBack( var ) if nil ~= self.m_spBack then self.m_spBack:setVisible(var); end end --扑克选择效果 function CardSprite:showSelectEffect(bSelect) local c_width = self.m_nCardWidth local c_height = self.m_nCardHeight if nil == self.m_pMask then self.m_pMask = cc.Sprite:create("game/card.png") if nil ~= self.m_pMask then self.m_pMask:setColor(cc.BLACK) self.m_pMask:setOpacity(100) self.m_pMask:setTextureRect(cc.rect(2 * c_width, 4 * c_height, c_width, c_height)) self.m_pMask:setPosition(c_width * 0.5, c_height * 0.5) self:addChild(self.m_pMask) end end if nil ~= self.m_pMask then self.m_pMask:setVisible(bSelect) end end --创建背面 function CardSprite:createBack( ) local c_width = self.m_nCardWidth local c_height = self.m_nCardHeight local tex = cc.Director:getInstance():getTextureCache():getTextureForKey(self.m_strCardFile); --纹理区域 local rect = cc.rect(2 * c_width, 4 * c_height, c_width, c_height); local cardSize = self:getContentSize(); local m_spBack = cc.Sprite:createWithTexture(tex, rect); m_spBack:setPosition(cardSize.width * 0.5, cardSize.height * 0.5); m_spBack:setVisible(false); self:addChild(m_spBack); m_spBack:setLocalZOrder(BACK_Z_ORDER); self.m_spBack = m_spBack; end return CardSprite;
data:extend( { { type = "bool-setting", name = "remelting-smooth-integration", setting_type = "startup", default_value = true, order = "a", }, } )
local airac = {} local date = require("date") local AIRAC_INTERVAL_DAYS = 28 local AIRAC_INITIAL_DATE = date(2015, 1, 8) local function airac_date(dt) if dt == nil then dt = date(true) end return AIRAC_INITIAL_DATE:adddays(math.floor((dt - AIRAC_INITIAL_DATE):spandays() // AIRAC_INTERVAL_DAYS) * AIRAC_INTERVAL_DAYS) end local function iso_date(d) return string.format("%04d-%02d-%02d", d:getisoyear(), d:getmonth(), d:getday()) end airac.airac_date = airac_date airac.iso_date = iso_date return airac
--when tool breaks leaves a stick local groups = {"wood","stone","iron","gold","diamond"} for i = 1,table.getn(groups) do --make it so wood and stone can't mine hard ores --{"wood","stone","iron","gold","diamond"} local times = {1,2,3,4,4} local looper = i local counter = 0 timey = {} for j = 1,times[i] do counter = counter + 1 timey[counter] = (1*counter)/(i/(i*2)) end --axe minetest.register_tool("tools:"..groups[i].."_axe", { description = groups[i]:gsub("^%l", string.upper).." Axe", groups = {wood = 1}, inventory_image = "default_tool_"..groups[i].."axe.png", wield_image = "default_tool_"..groups[i].."axe.png", liquids_pointable = false, -- See "Tools" section tool_capabilities = { full_punch_interval = 1.0, max_drop_level = 0, groupcaps = { -- For example: wood = { times = timey,uses = i*5, maxlevel = i}, }, damage_groups = {fleshy=i}, }, after_use = function(itemstack, user, node, digparams) tool_break(itemstack, user, node, digparams) end, } ) minetest.register_tool("tools:"..groups[i].."_pickaxe", { description = groups[i]:gsub("^%l", string.upper).." Pickaxe", groups = {wood = 1}, inventory_image = "default_tool_"..groups[i].."pick.png", wield_image = "default_tool_"..groups[i].."pick.png", liquids_pointable = false, -- See "Tools" section tool_capabilities = { full_punch_interval = 1.0, max_drop_level = 0, groupcaps = { -- For example: stone = {times = timey, uses = i*5, maxlevel = i}, }, damage_groups = {fleshy=i}, }, after_use = function(itemstack, user, node, digparams) tool_break(itemstack, user, node, digparams) end, } ) minetest.register_tool("tools:"..groups[i].."_shovel", { description = groups[i]:gsub("^%l", string.upper).." Pickaxe", groups = {wood = 1}, inventory_image = "default_tool_"..groups[i].."shovel.png", wield_image = "default_tool_"..groups[i].."shovel.png^[transform4", liquids_pointable = false, -- See "Tools" section tool_capabilities = { full_punch_interval = 1.0, max_drop_level = 0, groupcaps = { -- For example: dirt = {times = timey, uses = i*5, maxlevel = i}, }, damage_groups = {fleshy=1}, }, after_use = function(itemstack, user, node, digparams) tool_break(itemstack, user, node, digparams) end, } ) minetest.register_tool("tools:"..groups[i].."_hoe", { description = groups[i]:gsub("^%l", string.upper).." Hoe", groups = {wood = 1}, inventory_image = "farming_tool_"..groups[i].."hoe.png", --wield_image = "farming_tool_"..groups[i].."hoe.png^[transform4", liquids_pointable = false, -- See "Tools" section tool_capabilities = { full_punch_interval = 1, max_drop_level = 0, groupcaps = { --emulate a shovel dirt = {times = timey, uses = i, maxlevel = i}, }, damage_groups = {fleshy=1}, }, --acts like on rightclick (farming action) on_place = function(itemstack, placer, pointed_thing) local node = minetest.get_node(pointed_thing.under).name if minetest.get_item_group(node,"dirt") > 0 then --cancel if the node is farmland if minetest.get_item_group(node,"farmland") > 0 then return end --cancel if no air above if minetest.get_node({x=pointed_thing.under.x,y=pointed_thing.under.y+1,z=pointed_thing.under.z}).name ~= "air" then return end minetest.set_node(pointed_thing.under,{name="nodes:dry_farmland"}) minetest.sound_play(sounds.dirt().place.name, { pos = placer:get_pos(), max_hear_distance = 100, gain = 1.0, pitch = math.random(70,100)/100, }) --call the tool break function tool_break(itemstack, placer, pointed_thing.under, {wear=(5-itemstack:get_tool_capabilities().groupcaps.dirt.uses)*500}) return(itemstack) end end, after_use = function(itemstack, user, node, digparams) tool_break(itemstack, user, node, digparams) end, } ) minetest.register_tool("tools:"..groups[i].."_paxel", { description = groups[i]:gsub("^%l", string.upper).." Paxel", groups = {wood = 1}, inventory_image = "default_tool_"..groups[i].."shovel.png^default_tool_"..groups[i].."pick.png^default_tool_"..groups[i].."axe.png", wield_image = "default_tool_"..groups[i].."shovel.png^default_tool_"..groups[i].."pick.png^default_tool_"..groups[i].."axe.png", liquids_pointable = false, -- See "Tools" section tool_capabilities = { full_punch_interval = 1.0, max_drop_level = 0, groupcaps = { -- For example: dirt = {times = timey, uses = i*15, maxlevel = i}, wood = {times = timey, uses = i*15, maxlevel = i}, stone = {times = timey, uses = i*15, maxlevel = i}, }, damage_groups = {fleshy=i*2}, }, after_use = function(itemstack, user, node, digparams) tool_break(itemstack, user, node, digparams) end, } ) end minetest.register_tool("tools:shears", { description = "Shears", groups = {shears = 1}, inventory_image = "shears.png", wield_image = "shears.png^[transform4", liquids_pointable = false, -- See "Tools" section tool_capabilities = { full_punch_interval = 1.0, max_drop_level = 0, groupcaps = { -- For example: leaves = {times = {[1] = 0.1, [2] = 0.05}, uses = 40, maxlevel = 2}, }, damage_groups = {fleshy=i}, }, after_use = function(itemstack, user, node, digparams) tool_break(itemstack, user, node, digparams) end, } ) minetest.register_tool("tools:flint_and_steel", { description = "Flint and Steel", groups = {fire_starter = 1}, inventory_image = "flint_and_steel.png", wield_image = "flint_and_steel.png^[transform4", liquids_pointable = false, on_place = function(itemstack, placer, pointed_thing) local node = minetest.get_node(pointed_thing.under).name if minetest.get_item_group(node,"flammable") > 0 then minetest.sound_play("lighter", { pos = placer:get_pos(), max_hear_distance = 100, gain = 1.0, pitch = math.random(80,110)/100, }) minetest.add_node(pointed_thing.above,{name="fire:fire"}) --call the tool break function tool_break(itemstack, placer, pointed_thing.under, {wear=(1000)}) return(itemstack) end end, } )
vipWindow = nil vipButton = nil addVipWindow = nil function init() connect(g_game, { onGameStart = refresh, onGameEnd = clear, onAddVip = onAddVip, onVipStateChange = onVipStateChange }) g_keyboard.bindKeyDown('Ctrl+P', toggle) vipButton = modules.client_topmenu.addCustomRightButton('vipListButton', tr('VIP List') .. ' (Ctrl+P)', '/images/ui/pxg/topMenu_icons/friend_icon', toggle, false) vipButton:setOn(true) vipButton:setVisible(false) vipWindow = g_ui.loadUI('viplist', modules.game_interface.getRightPanel()) refresh() vipWindow:setup() end function terminate() g_keyboard.unbindKeyDown('Ctrl+P') disconnect(g_game, { onGameStart = refresh, onGameEnd = clear, onAddVip = onAddVip, onVipStateChange = onVipStateChange }) vipWindow:destroy() vipButton:destroy() end function refresh() clear() for id,vip in pairs(g_game.getVips()) do onAddVip(id, unpack(vip)) end vipWindow:setContentMinimumHeight(38) if g_game.isOnline() then vipButton:setVisible(true) end end function clear() local vipList = vipWindow:getChildById('contentsPanel') vipList:destroyChildren() vipButton:setVisible(false) end function toggle() if vipButton:isOn() then vipWindow:close() vipButton:setOn(false) vipButton:setIcon('/images/ui/pxg/topMenu_icons/friend_icon_apagado') else vipWindow:open() vipButton:setOn(true) vipButton:setIcon('/images/ui/pxg/topMenu_icons/friend_icon') end end function onMiniWindowClose() vipButton:setOn(false) end function createAddWindow() addVipWindow = g_ui.displayUI('addvip') end function destroyAddWindow() addVipWindow:destroy() addVipWindow = nil end function addVip() g_game.addVip(addVipWindow:getChildById('name'):getText()) destroyAddWindow() end function hideOffline(state) settings = {} settings['hideOffline'] = state g_settings.mergeNode('VipList', settings) refresh() end function isHiddingOffline() local settings = g_settings.getNode('VipList') if not settings then return false end return settings['hideOffline'] end function onAddVip(id, name, state) local vipList = vipWindow:getChildById('contentsPanel') local label = g_ui.createWidget('VipListLabel') label.onMousePress = onVipListLabelMousePress label:setId('vip' .. id) label:setText(name) if state == VipState.Online then label:setColor('#00ff00') elseif state == VipState.Pending then label:setColor('#ffca38') else label:setColor('#ff0000') end label.vipState = state label:setPhantom(false) connect(label, { onDoubleClick = function () g_game.openPrivateChannel(label:getText()) return true end } ) if state == VipState.Offline and isHiddingOffline() then label:setVisible(false) end local nameLower = name:lower() local childrenCount = vipList:getChildCount() for i=1,childrenCount do local child = vipList:getChildByIndex(i) if state == VipState.Online and child.vipState ~= VipState.Online then vipList:insertChild(i, label) return end if (state ~= VipState.Online and child.vipState ~= VipState.Online) or (state == VipState.Online and child.vipState == VipState.Online) then local childText = child:getText():lower() local length = math.min(childText:len(), nameLower:len()) for j=1,length do if nameLower:byte(j) < childText:byte(j) then vipList:insertChild(i, label) return elseif nameLower:byte(j) > childText:byte(j) then break elseif j == nameLower:len() then -- We are at the end of nameLower, and its shorter than childText, thus insert before vipList:insertChild(i, label) end end end end vipList:insertChild(childrenCount+1, label) end function onVipStateChange(id, state) local vipList = vipWindow:getChildById('contentsPanel') local label = vipList:getChildById('vip' .. id) local text = label:getText() label:destroy() onAddVip(id, text, state) end function onVipListMousePress(widget, mousePos, mouseButton) if mouseButton ~= MouseRightButton then return end local vipList = vipWindow:getChildById('contentsPanel') local menu = g_ui.createWidget('PopupMenu') menu:addOption(tr('Add new VIP'), function() createAddWindow() end) if not isHiddingOffline() then menu:addOption(tr('Hide Offline'), function() hideOffline(true) end) else menu:addOption(tr('Show Offline'), function() hideOffline(false) end) end menu:display(mousePos) return true end function onVipListLabelMousePress(widget, mousePos, mouseButton) if mouseButton ~= MouseRightButton then return end local vipList = vipWindow:getChildById('contentsPanel') local menu = g_ui.createWidget('PopupMenu') menu:addOption(tr('Send Message'), function() g_game.openPrivateChannel(widget:getText()) end) menu:addOption(tr('Add new VIP'), function() createAddWindow() end) menu:addOption(tr('Remove %s', widget:getText()), function() if widget then g_game.removeVip(widget:getId():sub(4)) vipList:removeChild(widget) end end) menu:addSeparator() menu:addOption(tr('Copy Name'), function() g_window.setClipboardText(widget:getText()) end) if modules.game_console.getOwnPrivateTab() then menu:addSeparator() menu:addOption(tr('Invite to private chat'), function() g_game.inviteToOwnChannel(widget:getText()) end) menu:addOption(tr('Exclude from private chat'), function() g_game.excludeFromOwnChannel(widget:getText()) end) end if not isHiddingOffline() then menu:addOption(tr('Hide Offline'), function() hideOffline(true) end) else menu:addOption(tr('Show Offline'), function() hideOffline(false) end) end menu:display(mousePos) return true end
--[[ file meta info @file Warlock.lua @brief Tables of spell IDs for class --]] --[[ @brief Accessing the addons private table @var _ addonName, thrown away @var wt Global addonTable --]] local _, wt = ... --[[ @brief Check if the data should be loaded or not @return If not "WARLOCK", then return with nothing --]] if (wt.currentClass ~= "WARLOCK") then return end --[[ @brief Table for trainable spells for each level @table [n] Table containing spells available at level n @var id Spell id @var cost Cost in copper @table requiredIds Table containing prerequisite spell IDs @var requiredTalentId Spell ID of prerequisite talent @var faction "Alliance" or "Horde" for faction specific spells --]] wt.SpellsByLevel = { [1] = { {id = 348, cost = 10}, -- Immolate (rank 1) {id = 688, cost = 100}, -- Summon Imp }, [4] = { {id = 172, cost = 100}, -- Corruption (rank 1) {id = 702, cost = 100}, -- Curse of Weakness (rank 1) }, [6] = { {id = 1454, cost = 100}, -- Life Tap (rank 1) {id = 695, cost = 100, requiredIds = {686}}, -- Shadow Bolt (rank 2) }, [8] = { {id = 980, cost = 200}, -- Curse of Agony (rank 1) {id = 5782, cost = 200}, -- Fear (rank 1) }, [10] = { {id = 6201, cost = 300, requiredIds = {1120}}, -- Create Healthstone (rank 1) {id = 696, cost = 300, requiredIds = {687}}, -- Demon Skin (rank 2) {id = 707, cost = 300, requiredIds = {348}}, -- Immolate (rank 2) {id = 1120, cost = 300}, -- Drain Soul (rank 1) }, [12] = { {id = 1108, cost = 600, requiredIds = {702}}, -- Curse of Weakness (rank 2) {id = 755, cost = 600}, -- Health Funnel (rank 1) {id = 705, cost = 600, requiredIds = {695}}, -- Shadow Bolt (rank 3) }, [14] = { {id = 6222, cost = 900, requiredIds = {172}}, -- Corruption (rank 2) {id = 689, cost = 900}, -- Drain Life (rank 1) }, [16] = { {id = 1455, cost = 1080, requiredIds = {1454}}, -- Life Tap (rank 2) {id = 5697, cost = 1200}, -- Unending Breath }, [18] = { {id = 1014, cost = 1500, requiredIds = {980}}, -- Curse of Agony (rank 2) {id = 5676, cost = 1500}, -- Searing Pain (rank 1) {id = 693, cost = 1500, requiredIds = {1120}}, -- Create Soulstone (rank 1) }, [20] = { {id = 706, cost = 2000}, -- Demon Armor (rank 1) {id = 3698, cost = 2000, requiredIds = {755}}, -- Health Funnel (rank 2) {id = 1094, cost = 2000, requiredIds = {707}}, -- Immolate (rank 3) {id = 5740, cost = 2000}, -- Rain of Fire (rank 1) {id = 698, cost = 2000}, -- Ritual of Summoning {id = 1088, cost = 2000, requiredIds = {705}}, -- Shadow Bolt (rank 4) {id = 5784, cost = 10000}, -- Felsteed }, [22] = { {id = 6202, cost = 2500, requiredIds = {6201}}, -- Create Healthstone (rank 2) {id = 6205, cost = 2500, requiredIds = {1108}}, -- Curse of Weakness (rank 3) {id = 699, cost = 2500, requiredIds = {689}}, -- Drain Life (rank 2) {id = 126, cost = 2500}, -- Eye of Kilrogg }, [24] = { {id = 6223, cost = 3000, requiredIds = {6222}}, -- Corruption (rank 3) {id = 5138, cost = 3000}, -- Drain Mana {id = 5500, cost = 3000}, -- Sense Demons {id = 18867, cost = 148, requiredIds = {17877}, requiredTalentId = 17877}, -- Shadowburn (rank 2) {id = 8288, cost = 3000, requiredIds = {1120}}, -- Drain Soul (rank 2) }, [26] = { {id = 1714, cost = 4000}, -- Curse of Tongues (rank 1) {id = 132, cost = 4000}, -- Detect Invisibility {id = 1456, cost = 3600, requiredIds = {1455}}, -- Life Tap (rank 3) {id = 17919, cost = 4000, requiredIds = {5676}}, -- Searing Pain (rank 2) }, [28] = { {id = 710, cost = 5000}, -- Banish (rank 1) {id = 6217, cost = 5000, requiredIds = {1014}}, -- Curse of Agony (rank 3) {id = 3699, cost = 5000, requiredIds = {3698}}, -- Health Funnel (rank 3) {id = 1106, cost = 5000, requiredIds = {1088}}, -- Shadow Bolt (rank 5) {id = 6366, cost = 5000}, -- Create Firestone (rank 1) }, [30] = { {id = 1086, cost = 6000, requiredIds = {706}}, -- Demon Armor (rank 2) {id = 709, cost = 6000, requiredIds = {699}}, -- Drain Life (rank 3) {id = 1098, cost = 6000}, -- Enslave Demon (rank 1) {id = 1949, cost = 6000}, -- Hellfire (rank 1) {id = 2941, cost = 6000, requiredIds = {1094}}, -- Immolate (rank 4) {id = 20752, cost = 6000, requiredIds = {693}}, -- Create Soulstone (rank 2) }, [32] = { {id = 1490, cost = 7000}, -- Curse of the Elements (rank 1) {id = 7646, cost = 7000, requiredIds = {6205}}, -- Curse of Weakness (rank 4) {id = 6213, cost = 7000, requiredIds = {5782}}, -- Fear (rank 2) {id = 6229, cost = 7000}, -- Shadow Ward (rank 1) {id = 18868, cost = 348, requiredIds = {18867}, requiredTalentId = 17877}, -- Shadowburn (rank 3) }, [34] = { {id = 7648, cost = 8000, requiredIds = {6223}}, -- Corruption (rank 4) {id = 5699, cost = 8000, requiredIds = {6202}}, -- Create Healthstone (rank 3) {id = 6219, cost = 8000, requiredIds = {5740}}, -- Rain of Fire (rank 2) {id = 17920, cost = 8000, requiredIds = {17919}}, -- Searing Pain (rank 3) }, [36] = { {id = 3700, cost = 9000, requiredIds = {3699}}, -- Health Funnel (rank 4) {id = 11687, cost = 8100, requiredIds = {1456}}, -- Life Tap (rank 4) {id = 7641, cost = 9000, requiredIds = {1106}}, -- Shadow Bolt (rank 6) {id = 17951, cost = 9000, requiredIds = {6366}}, -- Create Firestone (rank 2) {id = 2362, cost = 9000, requiredIds = {1120}}, -- Create Spellstone (rank 1) }, [38] = { {id = 11711, cost = 10000, requiredIds = {6217}}, -- Curse of Agony (rank 4) {id = 7651, cost = 10000, requiredIds = {709}}, -- Drain Life (rank 4) {id = 8289, cost = 10000, requiredIds = {8288}}, -- Drain Soul (rank 3) }, [40] = { {id = 11733, cost = 11000, requiredIds = {1086}}, -- Demon Armor (rank 3) {id = 5484, cost = 11000}, -- Howl of Terror (rank 1) {id = 11665, cost = 11000, requiredIds = {2941}}, -- Immolate (rank 5) {id = 18869, cost = 548, requiredIds = {18868}, requiredTalentId = 17877}, -- Shadowburn (rank 4) {id = 20755, cost = 11000, requiredIds = {20752}}, -- Create Soulstone (rank 3) {id = 23161, cost = 100000}, -- Dreadsteed }, [42] = { {id = 11707, cost = 11000, requiredIds = {7646}}, -- Curse of Weakness (rank 5) {id = 6789, cost = 11000}, -- Death Coil (rank 1) {id = 11683, cost = 11000, requiredIds = {1949}}, -- Hellfire (rank 2) {id = 17921, cost = 11000, requiredIds = {17920}}, -- Searing Pain (rank 4) {id = 11739, cost = 11000, requiredIds = {6229}}, -- Shadow Ward (rank 2) }, [44] = { {id = 11671, cost = 12000, requiredIds = {7648}}, -- Corruption (rank 5) {id = 11725, cost = 12000, requiredIds = {1098}}, -- Enslave Demon (rank 2) {id = 11693, cost = 12000, requiredIds = {3700}}, -- Health Funnel (rank 5) {id = 11659, cost = 12000, requiredIds = {7641}}, -- Shadow Bolt (rank 7) }, [46] = { {id = 11729, cost = 13000, requiredIds = {5699}}, -- Create Healthstone (rank 4) {id = 11721, cost = 13000, requiredIds = {1490}}, -- Curse of the Elements (rank 2) {id = 11699, cost = 13000, requiredIds = {7651}}, -- Drain Life (rank 5) {id = 11688, cost = 11700, requiredIds = {11687}}, -- Life Tap (rank 5) {id = 11677, cost = 13000, requiredIds = {6219}}, -- Rain of Fire (rank 3) {id = 17952, cost = 13000, requiredIds = {17951}}, -- Create Firestone (rank 3) }, [48] = { {id = 18647, cost = 14000, requiredIds = {710}}, -- Banish (rank 2) {id = 11712, cost = 14000, requiredIds = {11711}}, -- Curse of Agony (rank 5) {id = 18870, cost = 700, requiredIds = {18869}, requiredTalentId = 17877}, -- Shadowburn (rank 5) {id = 6353, cost = 14000}, -- Soul Fire (rank 1) {id = 17727, cost = 14000, requiredIds = {2362}}, -- Create Spellstone (rank 2) }, [50] = { {id = 11719, cost = 15000, requiredIds = {1714}}, -- Curse of Tongues (rank 2) {id = 18937, cost = 748, requiredIds = {18220}, requiredTalentId = 18220}, -- Dark Pact (rank 2) {id = 17925, cost = 15000, requiredIds = {6789}}, -- Death Coil (rank 2) {id = 11734, cost = 15000, requiredIds = {11733}}, -- Demon Armor (rank 4) {id = 11667, cost = 15000, requiredIds = {11665}}, -- Immolate (rank 6) {id = 17922, cost = 15000, requiredIds = {17921}}, -- Searing Pain (rank 5) {id = 20756, cost = 15000, requiredIds = {20755}}, -- Create Soulstone (rank 4) }, [52] = { {id = 11708, cost = 18000, requiredIds = {11707}}, -- Curse of Weakness (rank 6) {id = 11694, cost = 18000, requiredIds = {11693}}, -- Health Funnel (rank 6) {id = 11660, cost = 18000, requiredIds = {11659}}, -- Shadow Bolt (rank 8) {id = 11740, cost = 18000, requiredIds = {11739}}, -- Shadow Ward (rank 3) {id = 11675, cost = 18000, requiredIds = {8289}}, -- Drain Soul (rank 4) }, [54] = { {id = 11672, cost = 20000, requiredIds = {11671}}, -- Corruption (rank 6) {id = 11700, cost = 20000, requiredIds = {11699}}, -- Drain Life (rank 6) {id = 11684, cost = 20000, requiredIds = {11683}}, -- Hellfire (rank 3) {id = 17928, cost = 20000, requiredIds = {5484}}, -- Howl of Terror (rank 2) }, [56] = { {id = 6215, cost = 22000, requiredIds = {6213}}, -- Fear (rank 3) {id = 11689, cost = 19800, requiredIds = {11688}}, -- Life Tap (rank 6) {id = 18871, cost = 1100, requiredIds = {18870}, requiredTalentId = 17877}, -- Shadowburn (rank 6) {id = 17924, cost = 22000, requiredIds = {6353}}, -- Soul Fire (rank 2) {id = 17953, cost = 22000, requiredIds = {17952}}, -- Create Firestone (rank 4) }, [58] = { {id = 11730, cost = 24000, requiredIds = {11729}}, -- Create Healthstone (rank 5) {id = 11713, cost = 24000, requiredIds = {11712}}, -- Curse of Agony (rank 6) {id = 17926, cost = 24000, requiredIds = {17925}}, -- Death Coil (rank 3) {id = 11726, cost = 24000, requiredIds = {11725}}, -- Enslave Demon (rank 3) {id = 11678, cost = 24000, requiredIds = {11677}}, -- Rain of Fire (rank 4) {id = 17923, cost = 24000, requiredIds = {17922}}, -- Searing Pain (rank 6) }, [60] = { {id = 25311, cost = 26000, requiredIds = {11672}}, -- Corruption (rank 7) {id = 603, cost = 26000}, -- Curse of Doom (rank 1) {id = 11722, cost = 26000, requiredIds = {11721}}, -- Curse of the Elements (rank 3) {id = 18938, cost = 1300, requiredIds = {18937}, requiredTalentId = 18220}, -- Dark Pact (rank 3) {id = 11735, cost = 26000, requiredIds = {11734}}, -- Demon Armor (rank 5) {id = 11695, cost = 26000, requiredIds = {11694}}, -- Health Funnel (rank 7) {id = 11668, cost = 26000, requiredIds = {11667}}, -- Immolate (rank 7) {id = 25309, cost = 26000, requiredIds = {11668}}, -- Immolate (rank 8) {id = 11661, cost = 26000, requiredIds = {11660}}, -- Shadow Bolt (rank 9) {id = 25307, cost = 26000, requiredIds = {11661}}, -- Shadow Bolt (rank 10) {id = 28610, cost = 34000, requiredIds = {11740}}, -- Shadow Ward (rank 4) {id = 30413, cost = 2500, requiredIds = {30283}, requiredTalentId = 30283}, -- Shadowfury (rank 2) {id = 30404, cost = 2500, requiredIds = {30108}, requiredTalentId = 30108}, -- Unstable Affliction (rank 2) {id = 20757, cost = 26000, requiredIds = {20756}}, -- Create Soulstone (rank 5) {id = 17728, cost = 26000, requiredIds = {17727}}, -- Create Spellstone (rank 3) }, [61] = { {id = 27224, cost = 30000, requiredIds = {11708}}, -- Curse of Weakness (rank 7) }, [62] = { {id = 27219, cost = 30000, requiredIds = {11700}}, -- Drain Life (rank 7) {id = 28176, cost = 34000}, -- Fel Armor (rank 1) }, [63] = { {id = 27263, cost = 1300, requiredIds = {18871}, requiredTalentId = 17877}, -- Shadowburn (rank 7) }, [64] = { {id = 29722, cost = 42000}, -- Incinerate (rank 1) {id = 27211, cost = 42000, requiredIds = {17924}}, -- Soul Fire (rank 3) }, [65] = { {id = 27216, cost = 46000, requiredIds = {25311}}, -- Corruption (rank 8) {id = 27210, cost = 46000, requiredIds = {17923}}, -- Searing Pain (rank 7) }, [66] = { {id = 29858, cost = 51000}, -- Soulshatter {id = 27250, cost = 51000, requiredIds = {17953}}, -- Create Firestone (rank 5) {id = 28172, cost = 51000, requiredIds = {17728}}, -- Create Spellstone (rank 4) }, [67] = { {id = 27218, cost = 57000, requiredIds = {11713}}, -- Curse of Agony (rank 7) {id = 27259, cost = 57000, requiredIds = {11695}}, -- Health Funnel (rank 8) {id = 27217, cost = 57000, requiredIds = {11675}}, -- Drain Soul (rank 5) }, [68] = { {id = 27230, cost = 63000, requiredIds = {11730}}, -- Create Healthstone (rank 6) {id = 27223, cost = 63000, requiredIds = {17926}}, -- Death Coil (rank 4) {id = 27213, cost = 63000, requiredIds = {11684}}, -- Hellfire (rank 4) {id = 27222, cost = 56700, requiredIds = {11689}}, -- Life Tap (rank 7) {id = 29893, cost = 63000}, -- Ritual of Souls (rank 1) }, [69] = { {id = 30909, cost = 70000, requiredIds = {27224}}, -- Curse of Weakness (rank 8) {id = 27228, cost = 70000, requiredIds = {11722}}, -- Curse of the Elements (rank 4) {id = 27220, cost = 70000, requiredIds = {27219}}, -- Drain Life (rank 8) {id = 28189, cost = 70000, requiredIds = {28176}}, -- Fel Armor (rank 2) {id = 27215, cost = 70000, requiredIds = {25309}}, -- Immolate (rank 9) {id = 27212, cost = 70000, requiredIds = {11678}}, -- Rain of Fire (rank 5) {id = 27209, cost = 70000, requiredIds = {25307}}, -- Shadow Bolt (rank 11) }, [70] = { {id = 59170, cost = 2500, requiredIds = {50796}, requiredTalentId = 50796}, -- Chaos Bolt (rank 2) {id = 30910, cost = 78000, requiredIds = {603}}, -- Curse of Doom (rank 2) {id = 27265, cost = 1300, requiredIds = {18938}, requiredTalentId = 18220}, -- Dark Pact (rank 4) {id = 27260, cost = 78000, requiredIds = {11735}}, -- Demon Armor (rank 6) {id = 59161, cost = 2500, requiredIds = {48181}, requiredTalentId = 48181}, -- Haunt (rank 2) {id = 32231, cost = 78000, requiredIds = {29722}}, -- Incinerate (rank 2) {id = 30459, cost = 78000, requiredIds = {27210}}, -- Searing Pain (rank 8) {id = 27243, cost = 78000}, -- Seed of Corruption (rank 1) {id = 30546, cost = 3900, requiredIds = {27263}, requiredTalentId = 17877}, -- Shadowburn (rank 8) {id = 30414, cost = 2500, requiredIds = {30413}, requiredTalentId = 30283}, -- Shadowfury (rank 3) {id = 30545, cost = 78000, requiredIds = {27211}}, -- Soul Fire (rank 4) {id = 30405, cost = 2500, requiredIds = {30404}, requiredTalentId = 30108}, -- Unstable Affliction (rank 3) {id = 27238, cost = 78000, requiredIds = {20757}}, -- Create Soulstone (rank 6) }, [71] = { {id = 47812, cost = 160000, requiredIds = {27216}}, -- Corruption (rank 9) {id = 50511, cost = 160000, requiredIds = {30909}}, -- Curse of Weakness (rank 9) }, [72] = { {id = 61191, cost = 70000, requiredIds = {11726}}, -- Enslave Demon (rank 4) {id = 47819, cost = 160000, requiredIds = {27212}}, -- Rain of Fire (rank 6) {id = 47890, cost = 160000, requiredIds = {28610}}, -- Shadow Ward (rank 5) {id = 47886, cost = 160000, requiredIds = {28172}}, -- Create Spellstone (rank 5) }, [73] = { {id = 47871, cost = 160000, requiredIds = {27230}}, -- Create Healthstone (rank 7) {id = 47863, cost = 160000, requiredIds = {27218}}, -- Curse of Agony (rank 8) {id = 47859, cost = 160000, requiredIds = {27223}}, -- Death Coil (rank 5) }, [74] = { {id = 47892, cost = 160000, requiredIds = {28189}}, -- Fel Armor (rank 3) {id = 47837, cost = 160000, requiredIds = {32231}}, -- Incinerate (rank 3) {id = 47814, cost = 160000, requiredIds = {30459}}, -- Searing Pain (rank 9) {id = 47808, cost = 160000, requiredIds = {27209}}, -- Shadow Bolt (rank 12) {id = 60219, cost = 160000, requiredIds = {27250}}, -- Create Firestone (rank 6) }, [75] = { {id = 59171, cost = 8000, requiredIds = {59170}, requiredTalentId = 50796}, -- Chaos Bolt (rank 3) {id = 59163, cost = 8000, requiredIds = {59161}, requiredTalentId = 48181}, -- Haunt (rank 3) {id = 47810, cost = 160000, requiredIds = {27215}}, -- Immolate (rank 10) {id = 47835, cost = 160000, requiredIds = {27243}}, -- Seed of Corruption (rank 2) {id = 47826, cost = 8000, requiredIds = {30546}, requiredTalentId = 17877}, -- Shadowburn (rank 9) {id = 47897, cost = 10000}, -- Shadowflame (rank 1) {id = 47846, cost = 8000, requiredIds = {30414}, requiredTalentId = 30283}, -- Shadowfury (rank 4) {id = 47824, cost = 160000, requiredIds = {30545}}, -- Soul Fire (rank 5) {id = 47841, cost = 8000, requiredIds = {30405}, requiredTalentId = 30108}, -- Unstable Affliction (rank 4) }, [76] = { {id = 47793, cost = 160000, requiredIds = {27260}}, -- Demon Armor (rank 7) {id = 47856, cost = 160000, requiredIds = {27259}}, -- Health Funnel (rank 9) {id = 47884, cost = 160000, requiredIds = {27238}}, -- Create Soulstone (rank 7) }, [77] = { {id = 47813, cost = 160000, requiredIds = {47812}}, -- Corruption (rank 10) {id = 47855, cost = 160000, requiredIds = {27217}}, -- Drain Soul (rank 6) }, [78] = { {id = 47865, cost = 160000, requiredIds = {27228}}, -- Curse of the Elements (rank 5) {id = 47860, cost = 160000, requiredIds = {47859}}, -- Death Coil (rank 6) {id = 47857, cost = 160000, requiredIds = {27220}}, -- Drain Life (rank 9) {id = 47823, cost = 160000, requiredIds = {27213}}, -- Hellfire (rank 5) {id = 47891, cost = 160000, requiredIds = {47890}}, -- Shadow Ward (rank 6) {id = 47888, cost = 160000, requiredIds = {47886}}, -- Create Spellstone (rank 6) }, [79] = { {id = 47878, cost = 160000, requiredIds = {47871}}, -- Create Healthstone (rank 8) {id = 47864, cost = 160000, requiredIds = {47863}}, -- Curse of Agony (rank 9) {id = 47893, cost = 160000, requiredIds = {47892}}, -- Fel Armor (rank 4) {id = 47820, cost = 160000, requiredIds = {47819}}, -- Rain of Fire (rank 7) {id = 47815, cost = 160000, requiredIds = {47814}}, -- Searing Pain (rank 10) {id = 47809, cost = 160000, requiredIds = {47808}}, -- Shadow Bolt (rank 13) }, [80] = { {id = 59172, cost = 8000, requiredIds = {59171}, requiredTalentId = 50796}, -- Chaos Bolt (rank 4) {id = 47867, cost = 160000, requiredIds = {30910}}, -- Curse of Doom (rank 3) {id = 59092, cost = 160000, requiredIds = {27265}, requiredTalentId = 18220}, -- Dark Pact (rank 5) {id = 47889, cost = 160000, requiredIds = {47793}}, -- Demon Armor (rank 8) {id = 48018, cost = 160000}, -- Demonic Circle: Summon {id = 48020, cost = 160000}, -- Demonic Circle: Teleport {id = 59164, cost = 8000, requiredIds = {59163}, requiredTalentId = 48181}, -- Haunt (rank 4) {id = 47811, cost = 160000, requiredIds = {47810}}, -- Immolate (rank 11) {id = 47838, cost = 100000, requiredIds = {47837}}, -- Incinerate (rank 4) {id = 57946, cost = 160000, requiredIds = {27222}}, -- Life Tap (rank 8) {id = 58887, cost = 160000, requiredIds = {29893}}, -- Ritual of Souls (rank 2) {id = 47836, cost = 160000, requiredIds = {47835}}, -- Seed of Corruption (rank 3 {id = 47827, cost = 8000, requiredIds = {47826}, requiredTalentId = 17877}, -- Shadowburn (rank 10) {id = 61290, cost = 10000, requiredIds = {47897}}, -- Shadowflame (rank 2) {id = 47847, cost = 8000, requiredIds = {47846}, requiredTalentId = 30283}, -- Shadowfury (rank 5) {id = 47825, cost = 160000, requiredIds = {47824}}, -- Soul Fire (rank 6) {id = 47843, cost = 8000, requiredIds = {47841}, requiredTalentId = 30108}, -- Unstable Affliction (rank 5) {id = 60220, cost = 160000, requiredIds = {60219}}, -- Create Firestone (rank 7) }, }
function love.load() sprites = {} sprites.background = love.graphics.newImage('sprites/background.png') sprites.bullet = love.graphics.newImage('sprites/bullet.png') sprites.player = love.graphics.newImage('sprites/player.png') sprites.zombie = love.graphics.newImage('sprites/zombie.png') player = {} player.x = love.graphics.getWidth() / 2 player.y = love.graphics.getHeight() / 2 player.speed = 180 zombies = {} end function love.update(dt) if love.keyboard.isDown("d") then player.x = player.x + player.speed*dt end if love.keyboard.isDown("a") then player.x = player.x - player.speed*dt end if love.keyboard.isDown("w") then player.y = player.y - player.speed*dt end if love.keyboard.isDown("s") then player.y = player.y + player.speed*dt end end function love.draw() love.graphics.draw(sprites.background, 0, 0) love.graphics.draw(sprites.player, player.x, player.y, playerMouseAngle(), nil, nil, sprites.player:getWidth()/2, sprites.player:getHeight()/2) for i,z in ipairs(zombies) do love.graphics.draw(sprites.zombie, z.x, z.y, zombiePlayerAngle(z), nil, nil, sprites.zombie:getWidth()/2, sprites.zombie:getHeight()/2) end end function love.keypressed( key ) if key == "space" then spawnZombie() end end function playerMouseAngle() return math.atan2( player.y - love.mouse.getY(), player.x - love.mouse.getX() ) + math.pi end function zombiePlayerAngle(enemy) return math.atan2( player.y - enemy.y, player.x - enemy.x ) end function spawnZombie() local zombie = {} zombie.x = math.random(0, love.graphics.getWidth()) zombie.y = math.random(0, love.graphics.getHeight()) zombie.speed = 100 table.insert(zombies, zombie) end
local curl = require "lcurl.safe" script_info = { ["title"] = "去转盘", ["description"] = "http://www.quzhuanpan.com/", ["version"] = "0.0.2", } function onSearch(key, page) local data = "" local c = curl.easy{ url = "http://www.quzhuanpan.com/source/search.action?q=" .. pd.urlEncode(key) .. "&days=down&o=1&currentPage=" .. page, httpheader = {"User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36"}, followlocation = 1, timeout = 15, proxy = pd.getProxy(), writefunction = function(buffer) data = data .. buffer return #buffer end, } c:perform() c:close() return parse(data) end function onItemClick(item) return ACT_SHARELINK, item.url end function parse(data) local result = {} local start = 1 while true do local a, b, url, title, time = string.find(data, "data%-shorturl='(.-)'.-title=\"(.-)\".-<span class=\"default\">(%d%d%d%d%-%d%d%-%d%d)</span>", start) if url == nil then break end local tooltip = string.gsub(title, "<span style='color:red'>(.-)</span>", "%1") title = string.gsub(title, "<span style='color:red'>(.-)</span>", "{c #ff0000}%1{/c}") table.insert(result, {["url"] = "https://pan.baidu.com/s/" .. url, ["title"] = title, ["time"] = time, ["showhtml"] = "true", ["tooltip"] = tooltip, ["check_url"] = "true"}) start = b + 1 end return result end
--class.lua local ssub = string.sub local sformat = string.format local dgetinfo = debug.getinfo --类模板 local class_tpls = _G.class_tpls or {} local function deep_copy(src, dst) local ndst = dst or {} for key, value in pairs(src or {}) do if is_class(value) then ndst[key] = value() elseif (type(value) == "table") then ndst[key] = deep_copy(value) else ndst[key] = value end end return ndst end local function object_init(class, object, ...) if class.__super then object_init(class.__super, object, ...) end if type(class.__init) == "function" then class.__init(object, ...) end for _, mixin in ipairs(class.__mixins) do if type(mixin.__init) == "function" then mixin.__init(object, ...) end end return object end local function object_release(class, object, ...) for _, mixin in ipairs(class.__mixins) do if type(mixin.__release) == "function" then mixin.__release(object, ...) end end if type(class.__release) == "function" then class.__release(object, ...) end if class.__super then object_release(class.__super, object, ...) end end local function object_props(class, object) if class.__super then object_props(class.__super, object) end local props = deep_copy(class.__props) for name, param in pairs(props) do object[name] = param[1] end end local function object_tostring(object) if type(object.tostring) == "function" then return object:tostring() end return sformat("class:%s(%s)", object.__moudle, object.__addr) end local function object_constructor(class, ...) local obj = {} object_props(class, obj) obj.__addr = ssub(tostring(obj), 7) local object = setmetatable(obj, class.__vtbl) object_init(class, object, ...) return object end local function object_super(obj) return obj.__super end local function mt_class_new(class, ...) if rawget(class, "__singleton") then local inst_obj = rawget(class, "__inst") if not inst_obj then inst_obj = object_constructor(class, ...) --定义单例方法 local inst_func = function() return inst_obj end rawset(class, "__inst", inst_obj) rawset(class, "inst", inst_func) end return inst_obj else return object_constructor(class, ...) end end local function mt_class_index(class, field) return class.__vtbl[field] end local function mt_class_newindex(class, field, value) class.__vtbl[field] = value end local function mt_object_release(obj) object_release(obj.__class, obj) end local classMT = { __call = mt_class_new, __index = mt_class_index, __newindex = mt_class_newindex } local function class_constructor(class, super, ...) local info = dgetinfo(2, "S") local moudle = info.short_src local class_tpl = class_tpls[moudle] if not class_tpl then local vtbl = { __class = class, __super = super, __moudle = moudle, __tostring = object_tostring, super = object_super, } vtbl.__index = vtbl vtbl.__gc = mt_object_release if super then setmetatable(vtbl, {__index = super}) end class.__vtbl = vtbl class.__super = super class.__props = {} class.__mixins = {} class_tpl = setmetatable(class, classMT) implemented(class, { ... }) class_tpls[moudle] = class_tpl end return class_tpl end function class(super, ...) return class_constructor({}, super, ...) end function singleton(super, ...) return class_constructor({__singleton = true}, super, ...) end function super(value) return value.__super end function is_class(class) return classMT == getmetatable(class) end