repo_name
stringlengths
6
69
path
stringlengths
6
178
copies
stringclasses
278 values
size
stringlengths
4
7
content
stringlengths
671
917k
license
stringclasses
15 values
kanaka/raft.js
research_class/pgfplots/tex/generic/pgfplots/lua/pgfplots/pgfplotsutil.lua
4
3160
local math=math local string=string local type=type local tostring = tostring local tonumber = tonumber local setmetatable = setmetatable local getmetatable = getmetatable local print=print local pairs = pairs local table=table local texio=texio do local _ENV = pgfplots --------------------------------------- -- log=texio.write_nl local stringfind = string.find local stringsub = string.sub local tableinsert = table.insert -- Splits 'str' at delimiter and returns a table of strings function stringsplit( str, delimiter ) if not str or not delimiter then error("arguments must not be nil") end local result = { } local start = 1 local findStart, findEnd = stringfind( str, delimiter, start ) while findStart do tableinsert( result, stringsub( str, start, findStart-1 ) ) start = findEnd + 1 findStart, findEnd = stringfind( str, delimiter, start ) end tableinsert( result, stringsub( str, start ) ) return result end function stringOrDefault(str, default) if str == nil or type(str) == 'string' and string.len(str) == 0 then return default end return tostring(str) end pgfplotsmath = {} function pgfplotsmath.isfinite(x) if pgfplotsmath.isnan(x) or x == pgfplotsmath.infty or x == -pgfplotsmath.infty then return false end return true end local isnan = function(x) return x ~= x end pgfplotsmath.isnan = isnan local infty = 1/0 pgfplotsmath.infty = infty local nan = math.sqrt(-1) pgfplotsmath.nan = nan --------------------------------------- -- -- Creates and returns a new class object. -- -- Usage: -- complexclass = newClass() -- function complexclass:constructor() -- self.re = 0 -- self.im = 0 -- end -- -- instance = complexclass.new() -- function newClass() local result = {} -- we need this such that *instances* (which will have 'result' as meta table) -- will "inherit" the class'es methods. result.__index = result local allocator= function (...) local self = setmetatable({}, result) self:constructor(...) return self end result.new = allocator return result end -- Create a new class that inherits from a base class -- -- base = pgfplots.newClass() -- function base:constructor() -- self.variable= 'a' -- end -- -- sub = pgfplots.newClassExtends(base) -- function sub:constructor() -- -- call super constructor. -- -- it is ABSOLUTELY CRUCIAL to use <baseclass>.constructor here - not :constructor! -- base.constructor(self) -- end -- -- instance = base.new() -- -- instance2 = sub.new() -- -- @see newClass function newClassExtends( baseClass ) if not baseClass then error "baseClass must not be nil" end local new_class = newClass() -- The following is the key to implementing inheritance: -- The __index member of the new class's metatable references the -- base class. This implies that all methods of the base class will -- be exposed to the sub-class, and that the sub-class can override -- any of these methods. -- local mt = {} -- getmetatable(new_class) mt.__index = baseClass setmetatable(new_class,mt) return new_class end end
mpl-2.0
AdamGagorik/darkstar
scripts/globals/mobskills/Bai_Wing.lua
18
1087
--------------------------------------------- -- Bai Wing -- -- Description: A hot wind deals Fire damage to enemies within a very wide area of effect. Additional effect: Plague -- Type: Magical -- Utsusemi/Blink absorb: Wipes shadows -- Range: 30' radial. -- Notes: Used only by Ouryu and Cuelebre while flying. --------------------------------------------- require("scripts/globals/settings"); require("scripts/globals/status"); require("scripts/globals/monstertpmoves"); --------------------------------------------- function onMobSkillCheck(target,mob,skill) if (mob:AnimationSub() ~= 1) then return 1; end return 0; end; function onMobWeaponSkill(target, mob, skill) local typeEffect = EFFECT_SLOW; MobStatusEffectMove(mob, target, typeEffect, 300, 0, 120); local dmgmod = 1; local info = MobMagicalMove(mob,target,skill,mob:getWeaponDmg()*5,ELE_EARTH,dmgmod,TP_NO_EFFECT); local dmg = MobFinalAdjustments(info.dmg,mob,skill,target,MOBSKILL_MAGICAL,MOBPARAM_EARTH,MOBPARAM_WIPE_SHADOWS); target:delHP(dmg); return dmg; end;
gpl-3.0
AdamGagorik/darkstar
scripts/zones/Throne_Room/mobs/Zeid.lua
8
1681
----------------------------------- -- Area: Throne Room -- MOB: Zeid -- Mission 9-2 BASTOK BCNM Fight ----------------------------------- ----------------------------------- -- onMobFight ----------------------------------- function onMobFight(mob, target) printf("mobtp %u",mob:getTP()); end; ----------------------------------- -- onMobDeath ----------------------------------- function onMobDeath(mob,killer,ally) ally:startEvent(0x7d04,3,3,1,3,3,3,3,3); end; ----------------------------------- -- onEventUpdate ----------------------------------- function onEventUpdate(player,csid,option) -- printf("finishCSID: %u",csid); -- printf("RESULT: %u",option); end; ----------------------------------- -- onEventFinish ----------------------------------- function onEventFinish(player,csid,option) printf("finishCSID: %u",csid); printf("RESULT: %u",option); if (csid == 0x7d04) then if (player:getVar("bcnm_instanceid") == 1) then SpawnMob(17453064); local volker = player:getBattlefield():insertAlly(14182) volker:setSpawn(-450,-167,-239,125); volker:spawn(); player:setPos(-443,-167,-239,127); elseif (player:getVar("bcnm_instanceid") == 2) then SpawnMob(17453068); local volker = player:getBattlefield():insertAlly(14182) volker:setSpawn(-450,-167,-239,125); volker:spawn(); elseif (player:getVar("bcnm_instanceid") == 3) then SpawnMob(17453072); local volker = player:getBattlefield():insertAlly(14182) volker:setSpawn(-450,-167,-239,125); volker:spawn(); end end end;
gpl-3.0
mohammadrassoul/roborsevenn
plugins/Invite.lua
1
2215
-----my_name_is_MoHaMaMmAdRaSsOuL*#@RsEvEn -----@RsEvEn FOR UPDATE -----لطفا پیام بالا رو پاک نکنید function resolve_username(username,cb) tdcli_function ({ ID = "SearchPublicChat", username_ = username }, cb, nil) end -------------------------------------------------------------------------------------------------------------------- function getMessage(chat_id, message_id,cb) tdcli_function ({ ID = "GetMessage", chat_id_ = chat_id, message_id_ = message_id }, cb, nil) end --------------------------------------------------------------------------------------------------------------------- function from_username(msg) function gfrom_user(extra,result,success) if result.username_ then F = result.username_ else F = 'nil' end return F end local username = getUser(msg.sender_user_id_,gfrom_user) return username end --Start Function local function run(msg, matches) if matches[1] == "invite" and matches[2] and is_owner(msg) then if string.match(matches[2], '^%d+$') then tdcli.addChatMember(msg.to.id, matches[2], 0) end end --------------------------Username-------------------------------------------------------------------------------------- if matches[1] == "invite" and matches[2] and is_owner(msg) then if string.match(matches[2], '^.*$') then function invite_by_username(extra, result, success) if result.id_ then tdcli.addChatMember(msg.to.id, result.id_, 5) end end resolve_username(matches[2],invite_by_username) end end --------------------------Reply----------------------------------------------------------------------------------------- if matches[1] == "invite" and msg.reply_to_message_id_ ~= 0 and is_owner(msg) then function inv_reply(extra, result, success) tdcli.addChatMember(msg.to.id, result.sender_user_id_, 5) end getMessage(msg.chat_id_, msg.reply_to_message_id_,inv_reply) end end --End return { patterns = { "^[!#/](invite)$", "^[!#/](invite) @(.*)$", "^[!#/](invite) (.*)$",}, run =run,} -----my_name_is_MoHaMaMmAdRaSsOuL*#@RsEvEn -----@RsEvEn FOR UPDATE -----لطفا پیام بالا رو پاک نکنید
gpl-3.0
AdamGagorik/darkstar
scripts/globals/items/grape_daifuku.lua
35
1862
----------------------------------------- -- ID: 6343 -- Item: grape_daifuku -- Food Effect: 30 Min, All Races ----------------------------------------- -- HP + 20 (Pet & Master) -- Vitality + 3 (Pet & Master) -- Master MAB + 3 , Pet MAB + 14 -- Accuracy + 10% Cap: 66 (Pet & Master) Pet Cap: 75 ----------------------------------------- require("scripts/globals/status"); ----------------------------------------- -- OnItemCheck ----------------------------------------- function onItemCheck(target) local result = 0; if (target:hasStatusEffect(EFFECT_FOOD) or target:hasStatusEffect(EFFECT_FIELD_SUPPORT_FOOD)) then result = 246; end return result; end; ----------------------------------------- -- OnItemUse ----------------------------------------- function onItemUse(target) target:addStatusEffect(EFFECT_FOOD,0,0,1800,6343); end; ----------------------------------- -- onEffectGain Action ----------------------------------- function onEffectGain(target,effect) target:addMod(MOD_HP, 20) target:addMod(MOD_VIT, 3) target:addMod(MOD_MATT, 3) target:addMod(MOD_FOOD_ACCP, 10) target:addMod(MOD_FOOD_ACC_CAP, 66) target:addPetMod(MOD_HP, 20) target:addPetMod(MOD_VIT, 3) target:addPetMod(MOD_MATT, 14) target:addPetMod(MOD_FOOD_ACCP, 10) target:addPetMod(MOD_FOOD_ACC_CAP, 75) end; ----------------------------------------- -- onEffectLose Action ----------------------------------------- function onEffectLose(target,effect) target:delMod(MOD_HP, 20) target:delMod(MOD_VIT, 3) target:delMod(MOD_MATT, 3) target:delMod(MOD_FOOD_ACCP, 10) target:delMod(MOD_FOOD_ACC_CAP, 66) target:delPetMod(MOD_HP, 20) target:delPetMod(MOD_VIT, 3) target:delPetMod(MOD_MATT, 14) target:delPetMod(MOD_FOOD_ACCP, 10) target:delPetMod(MOD_FOOD_ACC_CAP, 75) end;
gpl-3.0
paritoshmmmec/kong
kong/plugins/cors/access.lua
20
1834
local responses = require "kong.tools.responses" local _M = {} local function configure_origin(ngx, conf) if conf.origin == nil then ngx.header["Access-Control-Allow-Origin"] = "*" else ngx.header["Access-Control-Allow-Origin"] = conf.origin ngx.header["Vary"] = "Origin" end end local function configure_credentials(ngx, conf) if (conf.credentials) then ngx.header["Access-Control-Allow-Credentials"] = "true" end end local function configure_headers(ngx, conf, headers) if conf.headers == nil then ngx.header["Access-Control-Allow-Headers"] = headers["access-control-request-headers"] or "" else ngx.header["Access-Control-Allow-Headers"] = table.concat(conf.headers, ",") end end local function configure_exposed_headers(ngx, conf) if conf.exposed_headers ~= nil then ngx.header["Access-Control-Expose-Headers"] = table.concat(conf.exposed_headers, ",") end end local function configure_methods(ngx, conf) if conf.methods == nil then ngx.header["Access-Control-Allow-Methods"] = "GET,HEAD,PUT,PATCH,POST,DELETE" else ngx.header["Access-Control-Allow-Methods"] = table.concat(conf.methods, ",") end end local function configure_max_age(ngx, conf) if conf.max_age ~= nil then ngx.header["Access-Control-Max-Age"] = tostring(conf.max_age) end end function _M.execute(conf) configure_origin(ngx, conf) configure_credentials(ngx, conf) if ngx.req.get_method() == "OPTIONS" then -- Preflight request configure_headers(ngx, conf, ngx.req.get_headers()) configure_methods(ngx, conf) configure_max_age(ngx, conf) if not conf.preflight_continue then -- Check if the preflight request should end here, or be proxied return responses.send_HTTP_NO_CONTENT() end else configure_exposed_headers(ngx, conf) end end return _M
mit
AdamGagorik/darkstar
scripts/globals/abilities/evokers_roll.lua
4
2703
----------------------------------- -- Ability: Evoker's Roll -- Gradually restores MP for party members within area of effect -- Optimal Job: Summoner -- Lucky Number: 5 -- Unlucky Number: 9 -- Level: 40 -- -- Die Roll |No SMN |With SMN -- -------- ------- ----------- -- 1 |+1 |+2 -- 2 |+1 |+2 -- 3 |+1 |+2 -- 4 |+1 |+2 -- 5 |+3 |+4 -- 6 |+2 |+3 -- 7 |+2 |+3 -- 8 |+2 |+3 -- 9 |+1 |+2 -- 10 |+3 |+4 -- 11 |+4 |+5 -- Bust |-1 |-1 -- -- Busting on Evoker's Roll will give you -1MP/tick less on your own total MP refreshed; i.e. you do not actually lose MP ----------------------------------- require("scripts/globals/settings"); require("scripts/globals/ability"); require("scripts/globals/status"); ----------------------------------- -- onAbilityCheck ----------------------------------- function onAbilityCheck(player,target,ability) local effectID = EFFECT_EVOKERS_ROLL ability:setRange(ability:getRange() + player:getMod(MOD_ROLL_RANGE)); if (player:hasStatusEffect(effectID) or player:hasBustEffect(effectID)) then return MSGBASIC_ROLL_ALREADY_ACTIVE,0; else return 0,0; end end; ----------------------------------- -- onUseAbility ----------------------------------- function onUseAbility(caster,target,ability,action) if (caster:getID() == target:getID()) then corsairSetup(caster, ability, action, EFFECT_EVOKERS_ROLL, JOB_SMN); end local total = caster:getLocalVar("corsairRollTotal") return applyRoll(caster,target,ability,action,total) end; function applyRoll(caster,target,ability,action,total) local duration = 300 + caster:getMerit(MERIT_WINNING_STREAK) local effectpowers = {1, 1, 1, 1, 3, 2, 2, 2, 1, 3, 4, 1} local effectpower = effectpowers[total]; if (caster:getLocalVar("corsairRollBonus") == 1 and total < 12) then effectpower = effectpower + 1 end if (caster:getMainJob() == JOB_COR and caster:getMainLvl() < target:getMainLvl()) then effectpower = effectpower * (caster:getMainLvl() / target:getMainLvl()); elseif (caster:getSubJob() == JOB_COR and caster:getSubLvl() < target:getMainLvl()) then effectpower = effectpower * (caster:getSubLvl() / target:getMainLvl()); end if (target:addCorsairRoll(caster:getMainJob(), caster:getMerit(MERIT_BUST_DURATION), EFFECT_EVOKERS_ROLL, effectpower, 0, duration, caster:getID(), total, MOD_REFRESH) == false) then ability:setMsg(422); elseif total > 11 then ability:setMsg(426); end return total; end
gpl-3.0
AdamGagorik/darkstar
scripts/globals/items/serving_of_batagreen_sautee.lua
18
1404
----------------------------------------- -- ID: 4553 -- Item: serving_of_batagreen_sautee -- Food Effect: 180Min, All Races ----------------------------------------- -- Agility 1 -- Vitality -2 -- Ranged ACC % 7 -- Ranged ACC Cap 15 ----------------------------------------- require("scripts/globals/status"); ----------------------------------------- -- OnItemCheck ----------------------------------------- function onItemCheck(target) local result = 0; if (target:hasStatusEffect(EFFECT_FOOD) == true or target:hasStatusEffect(EFFECT_FIELD_SUPPORT_FOOD) == true) then result = 246; end return result; end; ----------------------------------------- -- OnItemUse ----------------------------------------- function onItemUse(target) target:addStatusEffect(EFFECT_FOOD,0,0,10800,4553); end; ----------------------------------------- -- onEffectGain Action ----------------------------------------- function onEffectGain(target,effect) target:addMod(MOD_AGI, 1); target:addMod(MOD_VIT, -2); target:addMod(MOD_FOOD_RACCP, 7); target:addMod(MOD_FOOD_RACC_CAP, 15); end; ----------------------------------------- -- onEffectLose Action ----------------------------------------- function onEffectLose(target,effect) target:delMod(MOD_AGI, 1); target:delMod(MOD_VIT, -2); target:delMod(MOD_FOOD_RACCP, 7); target:delMod(MOD_FOOD_RACC_CAP, 15); end;
gpl-3.0
adib1380/anti2
plugins/xkcd.lua
628
1374
do function get_last_id() local res,code = https.request("http://xkcd.com/info.0.json") if code ~= 200 then return "HTTP ERROR" end local data = json:decode(res) return data.num end function get_xkcd(id) local res,code = http.request("http://xkcd.com/"..id.."/info.0.json") if code ~= 200 then return "HTTP ERROR" end local data = json:decode(res) local link_image = data.img if link_image:sub(0,2) == '//' then link_image = msg.text:sub(3,-1) end return link_image, data.title, data.alt end function get_xkcd_random() local last = get_last_id() local i = math.random(1, last) return get_xkcd(i) end function send_title(cb_extra, success, result) if success then local message = cb_extra[2] .. "\n" .. cb_extra[3] send_msg(cb_extra[1], message, ok_cb, false) end end function run(msg, matches) local receiver = get_receiver(msg) if matches[1] == "!xkcd" then url, title, alt = get_xkcd_random() else url, title, alt = get_xkcd(matches[1]) end file_path = download_to_file(url) send_photo(receiver, file_path, send_title, {receiver, title, alt}) return false end return { description = "Send comic images from xkcd", usage = {"!xkcd (id): Send an xkcd image and title. If not id, send a random one"}, patterns = { "^!xkcd$", "^!xkcd (%d+)", "xkcd.com/(%d+)" }, run = run } end
gpl-2.0
hadirahimi1380/-AhRiMaN-
plugins/xkcd.lua
628
1374
do function get_last_id() local res,code = https.request("http://xkcd.com/info.0.json") if code ~= 200 then return "HTTP ERROR" end local data = json:decode(res) return data.num end function get_xkcd(id) local res,code = http.request("http://xkcd.com/"..id.."/info.0.json") if code ~= 200 then return "HTTP ERROR" end local data = json:decode(res) local link_image = data.img if link_image:sub(0,2) == '//' then link_image = msg.text:sub(3,-1) end return link_image, data.title, data.alt end function get_xkcd_random() local last = get_last_id() local i = math.random(1, last) return get_xkcd(i) end function send_title(cb_extra, success, result) if success then local message = cb_extra[2] .. "\n" .. cb_extra[3] send_msg(cb_extra[1], message, ok_cb, false) end end function run(msg, matches) local receiver = get_receiver(msg) if matches[1] == "!xkcd" then url, title, alt = get_xkcd_random() else url, title, alt = get_xkcd(matches[1]) end file_path = download_to_file(url) send_photo(receiver, file_path, send_title, {receiver, title, alt}) return false end return { description = "Send comic images from xkcd", usage = {"!xkcd (id): Send an xkcd image and title. If not id, send a random one"}, patterns = { "^!xkcd$", "^!xkcd (%d+)", "xkcd.com/(%d+)" }, run = run } end
gpl-2.0
paritoshmmmec/kong
spec/integration/proxy/dns_resolver_spec.lua
7
1219
local spec_helper = require "spec.spec_helpers" local http_client = require "kong.tools.http_client" local TCP_PORT = 7771 describe("DNS", function() setup(function() spec_helper.prepare_db() spec_helper.insert_fixtures { api = { { name = "tests dns 1", public_dns = "dns1.com", target_url = "http://127.0.0.1:7771" }, { name = "tests dns 2", public_dns = "dns2.com", target_url = "http://localhost:7771" } } } spec_helper.start_kong() end) teardown(function() spec_helper.stop_kong() end) describe("DNS", function() it("should work when calling local IP", function() local thread = spec_helper.start_tcp_server(TCP_PORT) -- Starting the mock TCP server local _, status = http_client.get(spec_helper.STUB_GET_URL, nil, { host = "dns1.com" }) assert.are.equal(200, status) thread:join() end) it("should work when calling local hostname", function() local thread = spec_helper.start_tcp_server(TCP_PORT) -- Starting the mock TCP server local _, status = http_client.get(spec_helper.STUB_GET_URL, nil, { host = "dns2.com" }) assert.are.equal(200, status) thread:join() end) end) end)
mit
AdamGagorik/darkstar
scripts/globals/mobskills/Vitriolic_spray.lua
33
1046
--------------------------------------------- -- Vitriolic Spray -- Family: Wamouracampa -- Description: Expels a caustic stream at targets in a fan-shaped area of effect. Additional effect: Burn -- Type: Magical -- Utsusemi/Blink absorb: Wipes shadow -- Range: Cone -- Notes: Burn is 10-30/tic --------------------------------------------- require("scripts/globals/settings"); require("scripts/globals/status"); require("scripts/globals/monstertpmoves"); --------------------------------------------- function onMobSkillCheck(target,mob,skill) return 0; end; function onMobWeaponSkill(target, mob, skill) local typeEffect = EFFECT_BURN; local power = math.random(10,30); MobStatusEffectMove(mob, target, typeEffect, power, 3, 60); local dmgmod = 1; local info = MobMagicalMove(mob,target,skill,mob:getWeaponDmg()*2.7,ELE_FIRE,dmgmod,TP_NO_EFFECT); local dmg = MobFinalAdjustments(info.dmg,mob,skill,target,MOBSKILL_MAGICAL,MOBPARAM_FIRE,MOBPARAM_WIPE_SHADOWS); target:delHP(dmg); return dmg; end;
gpl-3.0
AdamGagorik/darkstar
scripts/zones/Jugner_Forest/Zone.lua
15
4110
----------------------------------- -- -- Zone: Jugner_Forest (104) -- ----------------------------------- package.loaded[ "scripts/zones/Jugner_Forest/TextIDs"] = nil; package.loaded["scripts/globals/chocobo_digging"] = nil; ----------------------------------- require("scripts/zones/Jugner_Forest/TextIDs"); require("scripts/globals/zone"); require("scripts/globals/icanheararainbow"); require("scripts/globals/conquest"); require("scripts/globals/chocobo_digging"); ----------------------------------- -- Chocobo Digging vars ----------------------------------- local itemMap = { -- itemid, abundance, requirement { 4504, 152, DIGREQ_NONE }, { 688, 182, DIGREQ_NONE }, { 697, 83, DIGREQ_NONE }, { 4386, 3, DIGREQ_NONE }, { 17396, 129, DIGREQ_NONE }, { 691, 144, DIGREQ_NONE }, { 918, 8, DIGREQ_NONE }, { 699, 76, DIGREQ_NONE }, { 4447, 38, DIGREQ_NONE }, { 695, 45, DIGREQ_NONE }, { 4096, 100, DIGREQ_NONE }, -- all crystals { 690, 15, DIGREQ_BORE }, { 1446, 8, DIGREQ_BORE }, { 702, 23, DIGREQ_BORE }, { 701, 8, DIGREQ_BORE }, { 696, 30, DIGREQ_BORE }, { 4570, 10, DIGREQ_MODIFIER }, { 4487, 11, DIGREQ_MODIFIER }, { 4409, 12, DIGREQ_MODIFIER }, { 1188, 10, DIGREQ_MODIFIER }, { 4532, 12, DIGREQ_MODIFIER }, }; local messageArray = { DIG_THROW_AWAY, FIND_NOTHING, ITEM_OBTAINED }; ----------------------------------- -- onChocoboDig ----------------------------------- function onChocoboDig(player, precheck) return chocoboDig(player, itemMap, precheck, messageArray); end; ----------------------------------- -- onInitialize ----------------------------------- function onInitialize(zone) local manuals = {17203883,17203884}; zone:registerRegion(1, -484, 10, 292, 0, 0, 0); -- Sets Mark for "Under Oath" Quest cutscene. SetFieldManual(manuals); -- Fraelissa SetRespawnTime(17203447, 900, 10800); SetRegionalConquestOverseers(zone:getRegionID()); end; ----------------------------------- -- onZoneIn ----------------------------------- function onZoneIn( player, prevZone) local cs = -1; if (player:getXPos() == 0 and player:getYPos() == 0 and player:getZPos() == 0) then player:setPos( 342, -5, 15.117, 169); end if (triggerLightCutscene(player)) then -- Quest: I Can Hear A Rainbow cs = 0x000f; end return cs; end; ----------------------------------- -- onConquestUpdate ----------------------------------- function onConquestUpdate(zone, updatetype) local players = zone:getPlayers(); for name, player in pairs(players) do conquestUpdate(zone, player, updatetype, CONQUEST_BASE); end end; ----------------------------------- -- onRegionEnter ----------------------------------- function onRegionEnter( player, region) if (region:GetRegionID() == 1) then if (player:getVar("UnderOathCS") == 7) then -- Quest: Under Oath - PLD AF3 player:startEvent(0x000E); end end end; ----------------------------------- -- onEventUpdate ----------------------------------- function onEventUpdate( player, csid, option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); if (csid == 0x000f) then lightCutsceneUpdate(player); -- Quest: I Can Hear A Rainbow end end; ----------------------------------- -- onEventFinish ----------------------------------- function onEventFinish( player, csid, option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); if (csid == 0x000f) then lightCutsceneFinish(player); -- Quest: I Can Hear A Rainbow elseif (csid == 0x000E) then player:setVar("UnderOathCS",8); -- Quest: Under Oath - PLD AF3 end end;
gpl-3.0
AdamGagorik/darkstar
scripts/zones/Boneyard_Gully/mobs/Race_Runner.lua
7
1473
----------------------------------- -- Area: Boneyard_Gully -- Name: Race Runner ----------------------------------- require("scripts/globals/titles"); require("scripts/globals/status"); local path = { -539, 0, -481, -556, 0, -478, -581, 0, -475, -579, -3, -460, -572, 2, -433, -545, 1, -440, -532, 0, -466 }; ----------------------------------- -- onMobInitialize Action ----------------------------------- function onMobInitialize(mob) end; ----------------------------------- -- onMobSpawn Action ----------------------------------- function onMobSpawn(mob) onMobRoam(mob); end; ----------------------------------- -- onMobRoamAction Action ----------------------------------- function onMobRoamAction(mob) pathfind.patrol(mob, path, PATHFLAG_REVERSE); end; ----------------------------------- -- onMobRoam Action ----------------------------------- function onMobRoam(mob) -- move to start position if not moving if (mob:isFollowingPath() == false) then mob:pathThrough(pathfind.first(path)); end end; ----------------------------------- -- onMobEngaged Action ----------------------------------- function onMobEngaged(mob,target) end; ----------------------------------- -- onMobFight Action ----------------------------------- function onMobFight(mob,target) end; ----------------------------------- -- onMobDeath ----------------------------------- function onMobDeath(mob, killer, ally) end;
gpl-3.0
AdamGagorik/darkstar
scripts/zones/Tavnazian_Safehold/npcs/Travonce.lua
13
1062
----------------------------------- -- Area: Tavnazian Safehold -- NPC: Travonce -- Type: Standard NPC -- @zone: 26 -- @pos -89.068 -14.367 -0.030 -- -- Auto-Script: Requires Verification (Verified by Brawndo) ----------------------------------- package.loaded["scripts/zones/Tavnazian_Safehold/TextIDs"] = nil; ----------------------------------- ----------------------------------- -- onTrade Action ----------------------------------- function onTrade(player,npc,trade) end; ----------------------------------- -- onTrigger Action ----------------------------------- function onTrigger(player,npc) player:startEvent(0x00d2); end; ----------------------------------- -- onEventUpdate ----------------------------------- function onEventUpdate(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); end; ----------------------------------- -- onEventFinish ----------------------------------- function onEventFinish(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); end;
gpl-3.0
TrurlMcByte/docker-prosody
etc/prosody-modules/mod_http_muc_log/mod_http_muc_log.lua
1
8873
local mt = require"util.multitable"; local datetime = require"util.datetime"; local jid_split = require"util.jid".split; local nodeprep = require"util.encodings".stringprep.nodeprep; local uuid = require"util.uuid".generate; local it = require"util.iterators"; local gettime = require"socket".gettime; local url = require"socket.url"; local os_time, os_date = os.time, os.date; local render = require"util.interpolation".new("%b{}", require"util.stanza".xml_escape); local archive = module:open_store("muc_log", "archive"); -- Support both old and new MUC code local mod_muc = module:depends"muc"; local rooms = rawget(mod_muc, "rooms"); local each_room = rawget(mod_muc, "each_room") or function() return it.values(rooms); end; local new_muc = not rooms; if new_muc then rooms = module:shared"muc/rooms"; end local get_room_from_jid = rawget(mod_muc, "get_room_from_jid") or function (jid) return rooms[jid]; end local function get_room(name) local jid = name .. '@' .. module.host; return get_room_from_jid(jid); end module:depends"http"; local template; do local template_file = module:get_option_string(module.name .. "_template", module.name .. ".html"); template_file = assert(module:load_resource(template_file)); template = template_file:read("*a"); template_file:close(); end -- local base_url = module:http_url() .. '/'; -- TODO: Generate links in a smart way local get_link do local link, path = { path = '/' }, { "", "", is_directory = true }; function get_link(room, date) path[1], path[2] = room, date; path.is_directory = not date; link.path = url.build_path(path); return url.build(link); end end local function public_room(room) if type(room) == "string" then room = get_room(room); end return (room and not (room.get_hidden or room.is_hidden)(room) and not (room.get_members_only or room.is_members_only)(room) and room._data.logging == true); end local function sort_Y(a,b) return a.year > b.year end local function sort_m(a,b) return a.n > b.n end local t_diff = os_time(os_date("*t")) - os_time(os_date("!*t")); local function time(t) return os_time(t) + t_diff; end local function find_once(room, query, retval) if query then query.limit = 1; else query = { limit = 1 }; end local iter, err = archive:find(room, query); if not iter then return iter, err; end if retval then return select(retval, iter()); end return iter(); end local function years_page(event, path) local response = event.response; local room = nodeprep(path:match("^(.*)/$")); if not room or not public_room(room) then return end local date_list = archive.dates and archive:dates(room); local dates = mt.new(); if date_list then for _, date in ipairs(date_list) do local when = datetime.parse(date.."T00:00:00Z"); local t = os_date("!*t", when); dates:set(t.year, t.month, t.day, when); end else module:log("debug", "Find all dates with messages"); local next_day; repeat local when = find_once(room, { start = next_day; with = "message<groupchat"; }, 3); if not when then break; end local t = os_date("!*t", when); dates:set(t.year, t.month, t.day, when ); next_day = when + (86400 - (when % 86400)); until not next_day; end local years = {}; for current_year, months_t in pairs(dates.data) do local t = { year = current_year, month = 1, day = 1 }; local months = { }; local year = { year = current_year, months = months }; years[#years+1] = year; for current_month, days_t in pairs(months_t) do t.day = 1; t.month = current_month; local tmp = os_date("!*t", time(t)); local days = {}; local week = { days = days } local weeks = { week }; local month = { year = year.year, month = os_date("!%B", time(t)), n = current_month, weeks = weeks }; months[#months+1] = month; local current_day = 1; for _=1, (tmp.wday+5)%7 do days[current_day], current_day = {}, current_day+1; end for i = 1, 31 do t.day = i; tmp = os_date("!*t", time(t)); if tmp.month ~= current_month then break end if i > 1 and tmp.wday == 2 then days = {}; weeks[#weeks+1] = { days = days }; current_day = 1; end days[current_day], current_day = { wday = tmp.wday, day = i, href = days_t[i] and datetime.date(days_t[i]) }, current_day+1; end end table.sort(year, sort_m); end table.sort(years, sort_Y); response.headers.content_type = "text/html; charset=utf-8"; return render(template, { title = get_room(room):get_name(); jid = get_room(room).jid; years = years; links = { { href = "../", rel = "up", text = "Back to room list" }, }; }); end local function logs_page(event, path) local response = event.response; local room, date = path:match("^(.-)/(%d%d%d%d%-%d%d%-%d%d)$"); room = nodeprep(room); if not room then return years_page(event, path); end if not public_room(room) then return end local logs, i = {}, 1; local iter, err = archive:find(room, { ["start"] = datetime.parse(date.."T00:00:00Z"); ["end"] = datetime.parse(date.."T23:59:59Z"); -- with = "message<groupchat"; }); if not iter then module:log("warn", "Could not search archive: %s", err or "no error"); return 500; end local first, last; local verb, subject, body; for key, item, when in iter do body = item:get_child_text("body"); subject = item:get_child_text("subject"); verb = nil; if subject then verb, body = "set the topic to", subject; elseif body and body:sub(1,4) == "/me " then verb, body = body:sub(5), nil; elseif item.name == "presence" then verb = item.attr.type == "unavailable" and "has left" or "has joined"; end if body or verb then logs[i], i = { key = key; datetime = datetime.datetime(when); time = datetime.time(when); verb = verb; body = body; nick = select(3, jid_split(item.attr.from)); st_name = item.name; st_type = item.attr.type; }, i + 1; end first = first or key; last = key; end if i == 1 then return end -- No items module:log("debug", "Find next date with messages"); local next_when = find_once(room, { after = last }, 3); if next_when then next_when = datetime.date(next_when); module:log("debug", "Next message: %s", next_when); else next_when = ""; end module:log("debug", "Find prev date with messages"); local prev_when = find_once(room, { before = first, reverse = true }, 3); if prev_when then prev_when = datetime.date(prev_when); module:log("debug", "Previous message: %s", prev_when); else prev_when = ""; end response.headers.content_type = "text/html; charset=utf-8"; return render(template, { title = ("%s - %s"):format(get_room(room):get_name(), date); jid = get_room(room).jid; lines = logs; links = { { href = "./", rel = "up", text = "Back to calendar" }, { href = prev_when, rel = "prev", text = prev_when}, { href = next_when, rel = "next", text = next_when}, }; }); end local function list_rooms(event) local response = event.response; local room_list, i = {}, 1; for room in each_room() do if public_room(room) then room_list[i], i = { href = get_link(jid_split(room.jid), nil); name = room:get_name(); description = room:get_description(); }, i + 1; end end response.headers.content_type = "text/html; charset=utf-8"; return render(template, { title = module:get_option_string("name", "Prosody Chatrooms"); jid = module.host; rooms = room_list; }); end local cache = setmetatable({}, {__mode = 'v'}); local function with_cache(f) return function (event, path) local request, response = event.request, event.response; local ckey = path or ""; local cached = cache[ckey]; if cached then local etag = cached.etag; local if_none_match = request.headers.if_none_match; if etag == if_none_match then module:log("debug", "Client cache hit"); return 304; end module:log("debug", "Server cache hit"); response.headers.etag = etag; response.headers.content_type = "text/html; charset=utf-8"; return cached[1]; end local start = gettime(); local rendered = f(event, path); module:log("debug", "Rendering took %dms", math.floor( (gettime() - start) * 1000 + 0.5)); if type(rendered) == "string" then local etag = uuid(); cached = { rendered, etag = etag, date = datetime.date() }; response.headers.etag = etag; cache[ckey] = cached; end response.headers.content_type = "text/html; charset=utf-8"; return rendered; end end -- How is cache invalidation a hard problem? ;) module:hook("muc-broadcast-message", function (event) local room = event.room; local room_name = jid_split(room.jid); local today = datetime.date(); cache[get_link(room_name)] = nil; cache[get_link(room_name, today)] = nil; end); module:provides("http", { route = { ["GET /"] = list_rooms; ["GET /*"] = with_cache(logs_page); }; });
mit
AdamGagorik/darkstar
scripts/globals/spells/hyoton_san.lua
5
1587
----------------------------------------- -- Spell: Hyoton: San -- Deals ice damage to an enemy and lowers its resistance against fire. ----------------------------------------- require("scripts/globals/status"); require("scripts/globals/magic"); ----------------------------------------- -- OnSpellCast ----------------------------------------- function onMagicCastingCheck(caster,target,spell) return 0; end; function onSpellCast(caster,target,spell) --doNinjutsuNuke(V,M,caster,spell,target,hasMultipleTargetReduction,resistBonus) local duration = 15 + caster:getMerit(MERIT_HYOTON_EFFECT) -- T1 bonus debuff duration local bonusAcc = 0; local bonusMab = caster:getMerit(MERIT_HYOTON_EFFECT) + caster:getMod(MOD_NIN_NUKE_BONUS); -- T1 mag atk + "enhances Ninjustu damage" mod if(caster:getMerit(MERIT_HYOTON_SAN) ~= 0) then -- T2 mag atk/mag acc, don't want to give a penalty to entities that can cast this without merits bonusMab = bonusMab + caster:getMerit(MERIT_HYOTON_SAN) - 5; -- merit gives 5 power but no bonus with one invest, thus subtract 5 bonusAcc = bonusAcc + caster:getMerit(MERIT_HYOTON_SAN) - 5; end; if (caster:isBehind(target,15) and caster:hasStatusEffect(EFFECT_INNIN)) then -- Innin mag atk bonus from behind, guesstimating angle at 15 degrees bonusMab = bonusMab + caster:getStatusEffect(EFFECT_INNIN):getPower(); end local dmg = doNinjutsuNuke(134,1.5,caster,spell,target,false,bonusAcc,bonusMab); handleNinjutsuDebuff(caster,target,spell,30,duration,MOD_FIRERES); return dmg; end;
gpl-3.0
AdamGagorik/darkstar
scripts/globals/items/rolanberry.lua
18
1176
----------------------------------------- -- ID: 4365 -- Item: rolanberry -- Food Effect: 5Min, All Races ----------------------------------------- -- Agility -4 -- Intelligence 2 ----------------------------------------- require("scripts/globals/status"); ----------------------------------------- -- OnItemCheck ----------------------------------------- function onItemCheck(target) local result = 0; if (target:hasStatusEffect(EFFECT_FOOD) == true or target:hasStatusEffect(EFFECT_FIELD_SUPPORT_FOOD) == true) then result = 246; end return result; end; ----------------------------------------- -- OnItemUse ----------------------------------------- function onItemUse(target) target:addStatusEffect(EFFECT_FOOD,0,0,300,4365); end; ----------------------------------- -- onEffectGain Action ----------------------------------- function onEffectGain(target,effect) target:addMod(MOD_AGI, -4); target:addMod(MOD_INT, 2); end; ----------------------------------------- -- onEffectLose Action ----------------------------------------- function onEffectLose(target,effect) target:delMod(MOD_AGI, -4); target:delMod(MOD_INT, 2); end;
gpl-3.0
LuaDist2/luasocket-unix
etc/lp.lua
59
11566
----------------------------------------------------------------------------- -- LPD support for the Lua language -- LuaSocket toolkit. -- Author: David Burgess -- Modified by Diego Nehab, but David is in charge -- RCS ID: $Id: lp.lua,v 1.14 2005/11/21 07:04:44 diego Exp $ ----------------------------------------------------------------------------- --[[ if you have any questions: RFC 1179 ]] -- make sure LuaSocket is loaded local io = require("io") local base = _G local os = require("os") local math = require("math") local string = require("string") local socket = require("socket") local ltn12 = require("ltn12") module("socket.lp") -- default port PORT = 515 SERVER = os.getenv("SERVER_NAME") or os.getenv("COMPUTERNAME") or "localhost" PRINTER = os.getenv("PRINTER") or "printer" local function connect(localhost, option) local host = option.host or SERVER local port = option.port or PORT local skt local try = socket.newtry(function() if skt then skt:close() end end) if option.localbind then -- bind to a local port (if we can) local localport = 721 local done, err repeat skt = socket.try(socket.tcp()) try(skt:settimeout(30)) done, err = skt:bind(localhost, localport) if not done then localport = localport + 1 skt:close() skt = nil else break end until localport > 731 socket.try(skt, err) else skt = socket.try(socket.tcp()) end try(skt:connect(host, port)) return { skt = skt, try = try } end --[[ RFC 1179 5.3 03 - Send queue state (short) +----+-------+----+------+----+ | 03 | Queue | SP | List | LF | +----+-------+----+------+----+ Command code - 3 Operand 1 - Printer queue name Other operands - User names or job numbers If the user names or job numbers or both are supplied then only those jobs for those users or with those numbers will be sent. The response is an ASCII stream which describes the printer queue. The stream continues until the connection closes. Ends of lines are indicated with ASCII LF control characters. The lines may also contain ASCII HT control characters. 5.4 04 - Send queue state (long) +----+-------+----+------+----+ | 04 | Queue | SP | List | LF | +----+-------+----+------+----+ Command code - 4 Operand 1 - Printer queue name Other operands - User names or job numbers If the user names or job numbers or both are supplied then only those jobs for those users or with those numbers will be sent. The response is an ASCII stream which describes the printer queue. The stream continues until the connection closes. Ends of lines are indicated with ASCII LF control characters. The lines may also contain ASCII HT control characters. ]] -- gets server acknowledement local function recv_ack(con) local ack = con.skt:receive(1) con.try(string.char(0) == ack, "failed to receive server acknowledgement") end -- sends client acknowledement local function send_ack(con) local sent = con.skt:send(string.char(0)) con.try(sent == 1, "failed to send acknowledgement") end -- sends queue request -- 5.2 02 - Receive a printer job -- -- +----+-------+----+ -- | 02 | Queue | LF | -- +----+-------+----+ -- Command code - 2 -- Operand - Printer queue name -- -- Receiving a job is controlled by a second level of commands. The -- daemon is given commands by sending them over the same connection. -- The commands are described in the next section (6). -- -- After this command is sent, the client must read an acknowledgement -- octet from the daemon. A positive acknowledgement is an octet of -- zero bits. A negative acknowledgement is an octet of any other -- pattern. local function send_queue(con, queue) queue = queue or PRINTER local str = string.format("\2%s\10", queue) local sent = con.skt:send(str) con.try(sent == string.len(str), "failed to send print request") recv_ack(con) end -- sends control file -- 6.2 02 - Receive control file -- -- +----+-------+----+------+----+ -- | 02 | Count | SP | Name | LF | -- +----+-------+----+------+----+ -- Command code - 2 -- Operand 1 - Number of bytes in control file -- Operand 2 - Name of control file -- -- The control file must be an ASCII stream with the ends of lines -- indicated by ASCII LF. The total number of bytes in the stream is -- sent as the first operand. The name of the control file is sent as -- the second. It should start with ASCII "cfA", followed by a three -- digit job number, followed by the host name which has constructed the -- control file. Acknowledgement processing must occur as usual after -- the command is sent. -- -- The next "Operand 1" octets over the same TCP connection are the -- intended contents of the control file. Once all of the contents have -- been delivered, an octet of zero bits is sent as an indication that -- the file being sent is complete. A second level of acknowledgement -- processing must occur at this point. -- sends data file -- 6.3 03 - Receive data file -- -- +----+-------+----+------+----+ -- | 03 | Count | SP | Name | LF | -- +----+-------+----+------+----+ -- Command code - 3 -- Operand 1 - Number of bytes in data file -- Operand 2 - Name of data file -- -- The data file may contain any 8 bit values at all. The total number -- of bytes in the stream may be sent as the first operand, otherwise -- the field should be cleared to 0. The name of the data file should -- start with ASCII "dfA". This should be followed by a three digit job -- number. The job number should be followed by the host name which has -- constructed the data file. Interpretation of the contents of the -- data file is determined by the contents of the corresponding control -- file. If a data file length has been specified, the next "Operand 1" -- octets over the same TCP connection are the intended contents of the -- data file. In this case, once all of the contents have been -- delivered, an octet of zero bits is sent as an indication that the -- file being sent is complete. A second level of acknowledgement -- processing must occur at this point. local function send_hdr(con, control) local sent = con.skt:send(control) con.try(sent and sent >= 1 , "failed to send header file") recv_ack(con) end local function send_control(con, control) local sent = con.skt:send(control) con.try(sent and sent >= 1, "failed to send control file") send_ack(con) end local function send_data(con,fh,size) local buf while size > 0 do buf,message = fh:read(8192) if buf then st = con.try(con.skt:send(buf)) size = size - st else con.try(size == 0, "file size mismatch") end end recv_ack(con) -- note the double acknowledgement send_ack(con) recv_ack(con) return size end --[[ local control_dflt = { "H"..string.sub(socket.hostname,1,31).."\10", -- host "C"..string.sub(socket.hostname,1,31).."\10", -- class "J"..string.sub(filename,1,99).."\10", -- jobname "L"..string.sub(user,1,31).."\10", -- print banner page "I"..tonumber(indent).."\10", -- indent column count ('f' only) "M"..string.sub(mail,1,128).."\10", -- mail when printed user@host "N"..string.sub(filename,1,131).."\10", -- name of source file "P"..string.sub(user,1,31).."\10", -- user name "T"..string.sub(title,1,79).."\10", -- title for banner ('p' only) "W"..tonumber(width or 132).."\10", -- width of print f,l,p only "f"..file.."\10", -- formatted print (remove control chars) "l"..file.."\10", -- print "o"..file.."\10", -- postscript "p"..file.."\10", -- pr format - requires T, L "r"..file.."\10", -- fortran format "U"..file.."\10", -- Unlink (data file only) } ]] -- generate a varying job number local seq = 0 local function newjob(connection) seq = seq + 1 return math.floor(socket.gettime() * 1000 + seq)%1000 end local format_codes = { binary = 'l', text = 'f', ps = 'o', pr = 'p', fortran = 'r', l = 'l', r = 'r', o = 'o', p = 'p', f = 'f' } -- lp.send{option} -- requires option.file send = socket.protect(function(option) socket.try(option and base.type(option) == "table", "invalid options") local file = option.file socket.try(file, "invalid file name") local fh = socket.try(io.open(file,"rb")) local datafile_size = fh:seek("end") -- get total size fh:seek("set") -- go back to start of file local localhost = socket.dns.gethostname() or os.getenv("COMPUTERNAME") or "localhost" local con = connect(localhost, option) -- format the control file local jobno = newjob() local localip = socket.dns.toip(localhost) localhost = string.sub(localhost,1,31) local user = string.sub(option.user or os.getenv("LPRUSER") or os.getenv("USERNAME") or os.getenv("USER") or "anonymous", 1,31) local lpfile = string.format("dfA%3.3d%-s", jobno, localhost); local fmt = format_codes[option.format] or 'l' local class = string.sub(option.class or localip or localhost,1,31) local _,_,ctlfn = string.find(file,".*[%/%\\](.*)") ctlfn = string.sub(ctlfn or file,1,131) local cfile = string.format("H%-s\nC%-s\nJ%-s\nP%-s\n%.1s%-s\nU%-s\nN%-s\n", localhost, class, option.job or "LuaSocket", user, fmt, lpfile, lpfile, ctlfn); -- mandatory part of ctl file if (option.banner) then cfile = cfile .. 'L'..user..'\10' end if (option.indent) then cfile = cfile .. 'I'..base.tonumber(option.indent)..'\10' end if (option.mail) then cfile = cfile .. 'M'..string.sub((option.mail),1,128)..'\10' end if (fmt == 'p' and option.title) then cfile = cfile .. 'T'..string.sub((option.title),1,79)..'\10' end if ((fmt == 'p' or fmt == 'l' or fmt == 'f') and option.width) then cfile = cfile .. 'W'..base.tonumber(option,width)..'\10' end con.skt:settimeout(option.timeout or 65) -- send the queue header send_queue(con, option.queue) -- send the control file header local cfilecmd = string.format("\2%d cfA%3.3d%-s\n",string.len(cfile), jobno, localhost); send_hdr(con,cfilecmd) -- send the control file send_control(con,cfile) -- send the data file header local dfilecmd = string.format("\3%d dfA%3.3d%-s\n",datafile_size, jobno, localhost); send_hdr(con,dfilecmd) -- send the data file send_data(con,fh,datafile_size) fh:close() con.skt:close(); return jobno, datafile_size end) -- -- lp.query({host=,queue=printer|'*', format='l'|'s', list=}) -- query = socket.protect(function(p) p = p or {} local localhost = socket.dns.gethostname() or os.getenv("COMPUTERNAME") or "localhost" local con = connect(localhost,p) local fmt if string.sub(p.format or 's',1,1) == 's' then fmt = 3 else fmt = 4 end con.try(con.skt:send(string.format("%c%s %s\n", fmt, p.queue or "*", p.list or ""))) local data = con.try(con.skt:receive("*a")) con.skt:close() return data end)
mit
Hostle/luci
protocols/luci-proto-ipv6/luasrc/model/cbi/admin_network/proto_6in4.lua
64
3139
-- Copyright 2011 Jo-Philipp Wich <jow@openwrt.org> -- Licensed to the public under the Apache License 2.0. local map, section, net = ... local ipaddr, peeraddr, ip6addr, tunnelid, username, password local defaultroute, metric, ttl, mtu ipaddr = s:taboption("general", Value, "ipaddr", translate("Local IPv4 address"), translate("Leave empty to use the current WAN address")) ipaddr.datatype = "ip4addr" peeraddr = s:taboption("general", Value, "peeraddr", translate("Remote IPv4 address"), translate("This is usually the address of the nearest PoP operated by the tunnel broker")) peeraddr.rmempty = false peeraddr.datatype = "ip4addr" ip6addr = s:taboption("general", Value, "ip6addr", translate("Local IPv6 address"), translate("This is the local endpoint address assigned by the tunnel broker, it usually ends with <code>:2</code>")) ip6addr.datatype = "ip6addr" local ip6prefix = s:taboption("general", Value, "ip6prefix", translate("IPv6 routed prefix"), translate("This is the prefix routed to you by the tunnel broker for use by clients")) ip6prefix.datatype = "ip6addr" local update = section:taboption("general", Flag, "_update", translate("Dynamic tunnel"), translate("Enable HE.net dynamic endpoint update")) update.enabled = "1" update.disabled = "0" function update.write() end function update.remove() end function update.cfgvalue(self, section) return (tonumber(m:get(section, "tunnelid")) ~= nil) and self.enabled or self.disabled end tunnelid = section:taboption("general", Value, "tunnelid", translate("Tunnel ID")) tunnelid.datatype = "uinteger" tunnelid:depends("_update", update.enabled) username = section:taboption("general", Value, "username", translate("HE.net username"), translate("This is the plain username for logging into the account")) username:depends("_update", update.enabled) username.validate = function(self, val, sid) if type(val) == "string" and #val == 32 and val:match("^[a-fA-F0-9]+$") then return nil, translate("The HE.net endpoint update configuration changed, you must now use the plain username instead of the user ID!") end return val end password = section:taboption("general", Value, "password", translate("HE.net password"), translate("This is either the \"Update Key\" configured for the tunnel or the account password if no update key has been configured")) password.password = true password:depends("_update", update.enabled) defaultroute = section:taboption("advanced", Flag, "defaultroute", translate("Default gateway"), translate("If unchecked, no default route is configured")) defaultroute.default = defaultroute.enabled metric = section:taboption("advanced", Value, "metric", translate("Use gateway metric")) metric.placeholder = "0" metric.datatype = "uinteger" metric:depends("defaultroute", defaultroute.enabled) ttl = section:taboption("advanced", Value, "ttl", translate("Use TTL on tunnel interface")) ttl.placeholder = "64" ttl.datatype = "range(1,255)" mtu = section:taboption("advanced", Value, "mtu", translate("Use MTU on tunnel interface")) mtu.placeholder = "1280" mtu.datatype = "max(9200)"
apache-2.0
Nathan22Miles/sile
core/papersizes.lua
5
1931
SILE.paperSizes = { a4 = { 595.275597, 841.8897728999999 }, letter = { 612, 792 }, note = { 612, 792 }, legal = { 612, 1008 }, executive = { 522, 756 }, halfletter = { 396, 612 }, halfexecutive = { 378, 522 }, statement = { 396, 612 }, folio = { 612, 936 }, quarto = { 610, 780 }, ledger = { 1224, 792 }, tabloid = { 792, 1224 }, a0 = { 2383.9370337, 3370.3937373 }, a1 = { 1683.7795457999998, 2383.9370337 }, a2 = { 1190.551194, 1683.7795457999998 }, a3 = { 841.8897728999999, 1190.551194 }, a5 = { 419.52756359999995, 595.275597 }, a6 = { 297.6377985, 419.52756359999995 }, a7 = { 209.76378179999998, 297.6377985 }, a8 = { 147.40157639999998, 209.76378179999998 }, a9 = { 104.88189089999999, 147.40157639999998 }, a10 = { 73.70078819999999, 104.88189089999999 }, b0 = { 2834.6457, 4008.1890197999996 }, b1 = { 2004.0945098999998, 2834.6457 }, b2 = { 1417.32285, 2004.0945098999998 }, b3 = { 1000.6299320999999, 1417.32285 }, b4 = { 708.661425, 1000.6299320999999 }, b5 = { 498.89764319999995, 708.661425 }, b6 = { 354.3307125, 498.89764319999995 }, b7 = { 249.44882159999997, 354.3307125 }, b8 = { 175.7480334, 249.44882159999997 }, b9 = { 124.72441079999999, 175.7480334 }, b10 = { 87.8740167, 124.72441079999999 }, c2 = { 1298.2677305999998, 1836.8504136 }, c3 = { 918.4252068, 1298.2677305999998 }, c4 = { 649.1338652999999, 1003.4645777999999 }, c5 = { 459.2126034, 649.1338652999999 }, c6 = { 323.1496098, 459.2126034 }, c7 = { 229.6063017, 323.1496098 }, c8 = { 161.5748049, 229.6063017 }, DL = { 311.81102699999997, 623.6220539999999 }, Comm10 = { 297, 684 }, Monarch = { 279, 540 }, archE = { 2592, 3456 }, archD = { 1728, 2592 }, archC = { 1296, 1728 }, archB = { 864, 1296 }, archA = { 648, 864 }, flsa = { 612, 936 }, flse = { 612, 936 }, csheet = { 1224, 1584 }, dsheet = { 1584, 2448 }, esheet = { 2448, 3168 } }
mit
AdamGagorik/darkstar
scripts/globals/mobskills/Shakeshroom.lua
50
1139
--------------------------------------------------- -- Shakeshroom -- Additional effect: Fires a mushroom cap, dealing damage to a single target. Additional effect: disease -- Range is 14.7 yalms. -- Piercing damage Ranged Attack. -- Secondary modifiers: INT: 20%. --------------------------------------------------- require("scripts/globals/settings"); require("scripts/globals/status"); require("scripts/globals/monstertpmoves"); --------------------------------------------------- function onMobSkillCheck(target,mob,skill) if (mob:getMobMod(MOBMOD_VAR) == 2) then return 0; end return 1; end; function onMobWeaponSkill(target, mob, skill) mob:setMobMod(MOBMOD_VAR, 3); local numhits = 1; local accmod = 1; local dmgmod = 2; local info = MobPhysicalMove(mob,target,skill,numhits,accmod,dmgmod,TP_DMG_VARIES,1,2,3); local dmg = MobFinalAdjustments(info.dmg,mob,skill,target,MOBSKILL_PHYSICAL,MOBPARAM_PIERCE,info.hitslanded); local typeEffect = EFFECT_DISEASE; MobPhysicalStatusEffectMove(mob, target, skill, typeEffect, 1, 0, 180); target:delHP(dmg); return dmg; end;
gpl-3.0
Anarchid/Zero-K-Infrastructure
Benchmarker/Benchmarks/games/fps_terraform.sdd/units/terraunit.lua
12
1714
unitDef = { unitname = [[terraunit]], name = [[Terraform]], description = [[Spent: 0]], acceleration = 0, brakeRate = 0, buildCostEnergy = 0, buildCostMetal = 0, builder = false, buildPic = [[levelterra.png]], buildTime = 000, canAttack = false, capturable = false, category = [[TERRAFORM]], collisionVolumeOffsets = [[0 -1500 0]], collisionVolumeScales = [[32 32 32]], collisionVolumeTest = 1, collisionVolumeType = [[box]], customParams = { dontcount = [[1]], mobilebuilding = [[1]], }, footprintX = 2, footprintZ = 2, idleAutoHeal = 0, idleTime = 1800, isFeature = false, kamikaze = true, kamikazeDistance = 0, kamikazeUseLOS = true, levelGround = false, mass = 500000, maxDamage = 1000000, maxSlope = 255, maxVelocity = 0, minCloakDistance = 0, objectName = [[debris1x1b.s3o]], reclaimable = false, script = [[nullscript.lua]], seismicSignature = 4, selfDestructCountdown = 1, side = [[ARM]], sightDistance = 0, airSightDistance = 0, stealth = true, turnRate = 0, upright = false, workerTime = 0, yardMap = [[yyyy]], } return lowerkeys({ terraunit = unitDef })
gpl-3.0
sbuettner/kong
kong/kong.lua
7
7524
-- Kong, the biggest ape in town -- -- /\ ____ -- <> ( oo ) -- <>_| ^^ |_ -- <> @ \ -- /~~\ . . _ | -- /~~~~\ | | -- /~~~~~~\/ _| | -- |[][][]/ / [m] -- |[][][[m] -- |[][][]| -- |[][][]| -- |[][][]| -- |[][][]| -- |[][][]| -- |[][][]| -- |[][][]| -- |[][][]| -- |[|--|]| -- |[| |]| -- ======== -- ========== -- |[[ ]]| -- ========== local IO = require "kong.tools.io" local utils = require "kong.tools.utils" local cache = require "kong.tools.database_cache" local stringy = require "stringy" local constants = require "kong.constants" local responses = require "kong.tools.responses" -- Define the plugins to load here, in the appropriate order local plugins = {} local _M = {} local function get_now() return ngx.now() * 1000 end local function load_plugin_conf(api_id, consumer_id, plugin_name) local cache_key = cache.plugin_configuration_key(plugin_name, api_id, consumer_id) local plugin = cache.get_or_set(cache_key, function() local rows, err = dao.plugins_configurations:find_by_keys { api_id = api_id, consumer_id = consumer_id ~= nil and consumer_id or constants.DATABASE_NULL_ID, name = plugin_name } if err then return responses.send_HTTP_INTERNAL_SERVER_ERROR(err) end if #rows > 0 then return table.remove(rows, 1) else return { null = true } end end) if plugin and not plugin.null and plugin.enabled then return plugin else return nil end end local function init_plugins() -- TODO: this should be handled with other default config values configuration.plugins_available = configuration.plugins_available or {} print("Discovering used plugins") local db_plugins, err = dao.plugins_configurations:find_distinct() if err then error(err) end -- Checking that the plugins in the DB are also enabled for _, v in ipairs(db_plugins) do if not utils.table_contains(configuration.plugins_available, v) then error("You are using a plugin that has not been enabled in the configuration: "..v) end end local loaded_plugins = {} for _, v in ipairs(configuration.plugins_available) do local loaded, plugin_handler_mod = utils.load_module_if_exists("kong.plugins."..v..".handler") if not loaded then error("The following plugin has been enabled in the configuration but it is not installed on the system: "..v) else print("Loading plugin: "..v) table.insert(loaded_plugins, { name = v, handler = plugin_handler_mod() }) end end table.sort(loaded_plugins, function(a, b) local priority_a = a.handler.PRIORITY or 0 local priority_b = b.handler.PRIORITY or 0 return priority_a > priority_b end) -- resolver is always the first plugin as it is the one retrieving any needed information table.insert(loaded_plugins, 1, { resolver = true, name = "resolver", handler = require("kong.resolver.handler")() }) if configuration.send_anonymous_reports then table.insert(loaded_plugins, 1, { reports = true, name = "reports", handler = require("kong.reports.handler")() }) end return loaded_plugins end -- To be called by nginx's init_by_lua directive. -- Execution: -- - load the configuration from the path computed by the CLI -- - instanciate the DAO Factory -- - load the used plugins -- - load all plugins if used and installed -- - sort the plugins by priority -- - load the resolver -- - prepare DB statements -- -- If any error during the initialization of the DAO or plugins, -- it will be thrown and needs to be catched in init_by_lua. function _M.init() -- Loading configuration configuration, dao = IO.load_configuration_and_dao(os.getenv("KONG_CONF")) -- Initializing plugins plugins = init_plugins() -- Prepare all collections' statements. Even if optional, this call is useful to check -- all statements are valid in advance. local err = dao:prepare() if err then error(err) end ngx.update_time() end -- Calls `init_worker()` on eveyr loaded plugin function _M.exec_plugins_init_worker() for _, plugin in ipairs(plugins) do plugin.handler:init_worker() end end function _M.exec_plugins_certificate() ngx.ctx.plugin_conf = {} for _, plugin in ipairs(plugins) do if ngx.ctx.api then ngx.ctx.plugin_conf[plugin.name] = load_plugin_conf(ngx.ctx.api.id, nil, plugin.name) end local plugin_conf = ngx.ctx.plugin_conf[plugin.name] if not ngx.ctx.stop_phases and (plugin.resolver or plugin_conf) then plugin.handler:certificate(plugin_conf and plugin_conf.value or {}) end end return end -- Calls `access()` on every loaded plugin function _M.exec_plugins_access() local start = get_now() ngx.ctx.plugin_conf = {} -- Iterate over all the plugins for _, plugin in ipairs(plugins) do if ngx.ctx.api then ngx.ctx.plugin_conf[plugin.name] = load_plugin_conf(ngx.ctx.api.id, nil, plugin.name) local consumer_id = ngx.ctx.authenticated_entity and ngx.ctx.authenticated_entity.consumer_id or nil if consumer_id then local app_plugin_conf = load_plugin_conf(ngx.ctx.api.id, consumer_id, plugin.name) if app_plugin_conf then ngx.ctx.plugin_conf[plugin.name] = app_plugin_conf end end end local plugin_conf = ngx.ctx.plugin_conf[plugin.name] if not ngx.ctx.stop_phases and (plugin.resolver or plugin_conf) then plugin.handler:access(plugin_conf and plugin_conf.value or {}) end end -- Append any modified querystring parameters local parts = stringy.split(ngx.var.backend_url, "?") local final_url = parts[1] if utils.table_size(ngx.req.get_uri_args()) > 0 then final_url = final_url.."?"..ngx.encode_args(ngx.req.get_uri_args()) end ngx.var.backend_url = final_url local t_end = get_now() ngx.ctx.kong_processing_access = t_end - start -- Setting a property that will be available for every plugin ngx.ctx.proxy_started_at = t_end end -- Calls `header_filter()` on every loaded plugin function _M.exec_plugins_header_filter() local start = get_now() -- Setting a property that will be available for every plugin ngx.ctx.proxy_ended_at = start if not ngx.ctx.stop_phases then ngx.header["Via"] = constants.NAME.."/"..constants.VERSION for _, plugin in ipairs(plugins) do local plugin_conf = ngx.ctx.plugin_conf[plugin.name] if plugin_conf then plugin.handler:header_filter(plugin_conf and plugin_conf.value or {}) end end end ngx.ctx.kong_processing_header_filter = get_now() - start end -- Calls `body_filter()` on every loaded plugin function _M.exec_plugins_body_filter() local start = get_now() if not ngx.ctx.stop_phases then for _, plugin in ipairs(plugins) do local plugin_conf = ngx.ctx.plugin_conf[plugin.name] if plugin_conf then plugin.handler:body_filter(plugin_conf and plugin_conf.value or {}) end end end ngx.ctx.kong_processing_body_filter = (ngx.ctx.kong_processing_body_filter or 0) + (get_now() - start) end -- Calls `log()` on every loaded plugin function _M.exec_plugins_log() if not ngx.ctx.stop_phases then for _, plugin in ipairs(plugins) do local plugin_conf = ngx.ctx.plugin_conf[plugin.name] if plugin_conf or plugin.reports then plugin.handler:log(plugin_conf and plugin_conf.value or {}) end end end end return _M
mit
samuelwbaird/brogue
source/rascal/util/timeout_group.lua
1
1336
-- a collection to store items against a number of ticks after which they signal -- has reverse look up table so frequent and arbitrary adds and removes should be handled well enough -- copyright 2016 Samuel Baird MIT Licence local class = require('core.class') return class(function (timeout_group) function timeout_group:init() self:clear() end function timeout_group:add(obj, ticks) if not ticks or ticks < 0 then assert(ticks and ticks >= 0) end local tick = self.tick + ticks local group = self.groups[tick] if not group then group = {} self.groups[tick] = group end group[obj] = obj self.reverse[obj] = group end function timeout_group:remove(obj) local group = self.reverse[obj] if group then self.reverse[obj] = nil group[obj] = nil end end function timeout_group:clear() self.tick = 0 self.groups = {} -- weakly reference reverse look up self.reverse = setmetatable({}, { __mode = 'kv' }) end function timeout_group:update(with_ready) self.tick = self.tick + 1 local group = self.groups[self.tick] if group then -- clean up self.groups[self.tick] = nil for k, v in pairs(group) do self.reverse[k] = nil end -- then callback on objects that are ready for k, v in pairs(group) do with_ready(k) end end end end)
mit
AdamGagorik/darkstar
scripts/zones/Selbina/npcs/Nomad_Moogle.lua
13
1064
----------------------------------- -- -- Nomad Moogle -- ----------------------------------- package.loaded["scripts/zones/Selbina/TextIDs"] = nil; ----------------------------------- require("scripts/zones/Selbina/TextIDs"); require("scripts/globals/settings"); ----------------------------------- -- onTrade Action ----------------------------------- function onTrade(player,npc,trade) end; ----------------------------------- -- onTrigger Action ----------------------------------- function onTrigger(player,npc) player:showText(npc,NOMAD_MOOGLE_DIALOG); player:sendMenu(1); end; ----------------------------------- -- onEventUpdate Action ----------------------------------- function onEventUpdate(player,csid,option) --print("onEventUpdate"); --printf("CSID: %u",csid); --printf("RESULT: %u",option); end; ----------------------------------- -- onEventFinish Action ----------------------------------- function onEventFinish(player,csid,option) --print("onEventFinish"); --printf("CSID: %u",csid); --printf("RESULT: %u",option); end;
gpl-3.0
AdamGagorik/darkstar
scripts/zones/Temple_of_Uggalepih/npcs/qm5.lua
13
1034
----------------------------------- -- Area: Temple of Uggalepih -- NPC: ??? (Crimson-toothed Pawberry NM) -- @pos -39 -24 27 159 ----------------------------------- package.loaded["scripts/zones/Temple_of_Uggalepih/TextIDs"] = nil; ----------------------------------- require("scripts/zones/Temple_of_Uggalepih/TextIDs"); ----------------------------------- -- onTrade Action ----------------------------------- function onTrade(player,npc,trade) respawn = GetServerVariable("[POP]Crimson-toothed_Pawberry"); -- Trade Uggalepih Offering if (trade:hasItemQty(1183,1) and trade:getItemCount() == 1 and respawn <= os.time(t)) then player:tradeComplete(); SpawnMob(17428813,300):updateClaim(player); SpawnMob(17428815,300):updateClaim(player); else player:messageSpecial(NOTHING_HAPPENS); end end; ----------------------------------- -- onTrigger Action ----------------------------------- function onTrigger(player,npc) player:messageSpecial(NM_OFFSET + 1); end;
gpl-3.0
Hostle/luci
applications/luci-app-tinyproxy/luasrc/model/cbi/tinyproxy.lua
25
7188
-- Copyright 2008 Steven Barth <steven@midlink.org> -- Copyright 2008-2010 Jo-Philipp Wich <jow@openwrt.org> -- Licensed to the public under the Apache License 2.0. m = Map("tinyproxy", translate("Tinyproxy"), translate("Tinyproxy is a small and fast non-caching HTTP(S)-Proxy")) s = m:section(TypedSection, "tinyproxy", translate("Server Settings")) s.anonymous = true s:tab("general", translate("General settings")) s:tab("privacy", translate("Privacy settings")) s:tab("filter", translate("Filtering and ACLs")) s:tab("limits", translate("Server limits")) o = s:taboption("general", Flag, "enabled", translate("Enable Tinyproxy server")) o.rmempty = false function o.write(self, section, value) if value == "1" then luci.sys.init.enable("tinyproxy") else luci.sys.init.disable("tinyproxy") end return Flag.write(self, section, value) end o = s:taboption("general", Value, "Port", translate("Listen port"), translate("Specifies the HTTP port Tinyproxy is listening on for requests")) o.optional = true o.datatype = "port" o.placeholder = 8888 o = s:taboption("general", Value, "Listen", translate("Listen address"), translate("Specifies the addresses Tinyproxy is listening on for requests")) o.optional = true o.datatype = "ipaddr" o.placeholder = "0.0.0.0" o = s:taboption("general", Value, "Bind", translate("Bind address"), translate("Specifies the address Tinyproxy binds to for outbound forwarded requests")) o.optional = true o.datatype = "ipaddr" o.placeholder = "0.0.0.0" o = s:taboption("general", Value, "DefaultErrorFile", translate("Error page"), translate("HTML template file to serve when HTTP errors occur")) o.optional = true o.default = "/usr/share/tinyproxy/default.html" o = s:taboption("general", Value, "StatFile", translate("Statistics page"), translate("HTML template file to serve for stat host requests")) o.optional = true o.default = "/usr/share/tinyproxy/stats.html" o = s:taboption("general", Flag, "Syslog", translate("Use syslog"), translate("Writes log messages to syslog instead of a log file")) o = s:taboption("general", Value, "LogFile", translate("Log file"), translate("Log file to use for dumping messages")) o.default = "/var/log/tinyproxy.log" o:depends("Syslog", "") o = s:taboption("general", ListValue, "LogLevel", translate("Log level"), translate("Logging verbosity of the Tinyproxy process")) o:value("Critical") o:value("Error") o:value("Warning") o:value("Notice") o:value("Connect") o:value("Info") o = s:taboption("general", Value, "User", translate("User"), translate("Specifies the user name the Tinyproxy process is running as")) o.default = "nobody" o = s:taboption("general", Value, "Group", translate("Group"), translate("Specifies the group name the Tinyproxy process is running as")) o.default = "nogroup" -- -- Privacy -- o = s:taboption("privacy", Flag, "XTinyproxy", translate("X-Tinyproxy header"), translate("Adds an \"X-Tinyproxy\" HTTP header with the client IP address to forwarded requests")) o = s:taboption("privacy", Value, "ViaProxyName", translate("Via hostname"), translate("Specifies the Tinyproxy hostname to use in the Via HTTP header")) o.placeholder = "tinyproxy" o.datatype = "hostname" s:taboption("privacy", DynamicList, "Anonymous", translate("Header whitelist"), translate("Specifies HTTP header names which are allowed to pass-through, all others are discarded. Leave empty to disable header filtering")) -- -- Filter -- o = s:taboption("filter", DynamicList, "Allow", translate("Allowed clients"), translate("List of IP addresses or ranges which are allowed to use the proxy server")) o.placeholder = "0.0.0.0" o.datatype = "ipaddr" o = s:taboption("filter", DynamicList, "ConnectPort", translate("Allowed connect ports"), translate("List of allowed ports for the CONNECT method. A single value \"0\" allows all ports")) o.placeholder = 0 o.datatype = "port" s:taboption("filter", FileUpload, "Filter", translate("Filter file"), translate("Plaintext file with URLs or domains to filter. One entry per line")) s:taboption("filter", Flag, "FilterURLs", translate("Filter by URLs"), translate("By default, filtering is done based on domain names. Enable this to match against URLs instead")) s:taboption("filter", Flag, "FilterExtended", translate("Filter by RegExp"), translate("By default, basic POSIX expressions are used for filtering. Enable this to activate extended regular expressions")) s:taboption("filter", Flag, "FilterCaseSensitive", translate("Filter case-sensitive"), translate("By default, filter strings are treated as case-insensitive. Enable this to make the matching case-sensitive")) s:taboption("filter", Flag, "FilterDefaultDeny", translate("Default deny"), translate("By default, the filter rules act as blacklist. Enable this option to only allow matched URLs or domain names")) -- -- Limits -- o = s:taboption("limits", Value, "Timeout", translate("Connection timeout"), translate("Maximum number of seconds an inactive connection is held open")) o.optional = true o.datatype = "uinteger" o.default = 600 o = s:taboption("limits", Value, "MaxClients", translate("Max. clients"), translate("Maximum allowed number of concurrently connected clients")) o.datatype = "uinteger" o.default = 10 o = s:taboption("limits", Value, "MinSpareServers", translate("Min. spare servers"), translate("Minimum number of prepared idle processes")) o.datatype = "uinteger" o.default = 5 o = s:taboption("limits", Value, "MaxSpareServers", translate("Max. spare servers"), translate("Maximum number of prepared idle processes")) o.datatype = "uinteger" o.default = 10 o = s:taboption("limits", Value, "StartServers", translate("Start spare servers"), translate("Number of idle processes to start when launching Tinyproxy")) o.datatype = "uinteger" o.default = 5 o = s:taboption("limits", Value, "MaxRequestsPerChild", translate("Max. requests per server"), translate("Maximum allowed number of requests per process. If it is exeeded, the process is restarted. Zero means unlimited.")) o.datatype = "uinteger" o.default = 0 -- -- Upstream -- s = m:section(TypedSection, "upstream", translate("Upstream Proxies"), translate("Upstream proxy rules define proxy servers to use when accessing certain IP addresses or domains.")) s.anonymous = true s.addremove = true t = s:option(ListValue, "type", translate("Policy"), translate("<em>Via proxy</em> routes requests to the given target via the specifed upstream proxy, <em>Reject access</em> disables any upstream proxy for the target")) t:value("proxy", translate("Via proxy")) t:value("reject", translate("Reject access")) ta = s:option(Value, "target", translate("Target host"), translate("Can be either an IP address or range, a domain name or \".\" for any host without domain")) ta.rmempty = true ta.placeholder = "0.0.0.0/0" ta.datatype = "host(1)" v = s:option(Value, "via", translate("Via proxy"), translate("Specifies the upstream proxy to use for accessing the target host. Format is <code>address:port</code>")) v:depends({type="proxy"}) v.placeholder = "10.0.0.1:8080" v.datatype = "ip4addrport" return m
apache-2.0
Hostle/luci
applications/luci-app-splash/luasrc/controller/splash/splash.lua
22
4649
module("luci.controller.splash.splash", package.seeall) local uci = luci.model.uci.cursor() local util = require "luci.util" function index() entry({"admin", "services", "splash"}, cbi("splash/splash"), _("Client-Splash"), 90) entry({"admin", "services", "splash", "splashtext" }, form("splash/splashtext"), _("Splashtext"), 10) local e e = node("splash") e.target = call("action_dispatch") node("splash", "activate").target = call("action_activate") node("splash", "splash").target = template("splash_splash/splash") node("splash", "blocked").target = template("splash/blocked") entry({"admin", "status", "splash"}, post("action_status_admin"), _("Client-Splash")) local page = node("splash", "publicstatus") page.target = call("action_status_public") page.leaf = true end function ip_to_mac(ip) local ipc = require "luci.ip" local i, n for i, n in ipairs(ipc.neighbors()) do if n.mac and n.dest and n.dest:equal(ip) then return n.mac end end end function action_dispatch() local uci = luci.model.uci.cursor_state() local mac = ip_to_mac(luci.http.getenv("REMOTE_ADDR")) or "" local access = false uci:foreach("luci_splash", "lease", function(s) if s.mac and s.mac:lower() == mac then access = true end end) uci:foreach("luci_splash", "whitelist", function(s) if s.mac and s.mac:lower() == mac then access = true end end) if #mac > 0 and access then luci.http.redirect(luci.dispatcher.build_url()) else luci.http.redirect(luci.dispatcher.build_url("splash", "splash")) end end function blacklist() leased_macs = { } uci:foreach("luci_splash", "blacklist", function(s) leased_macs[s.mac:lower()] = true end) return leased_macs end function action_activate() local ipc = require "luci.ip" local mac = ip_to_mac(luci.http.getenv("REMOTE_ADDR") or "127.0.0.1") or "" local uci_state = require "luci.model.uci".cursor_state() local blacklisted = false if mac and luci.http.formvalue("accept") then uci:foreach("luci_splash", "blacklist", function(s) if s.mac and s.mac:lower() == mac then blacklisted = true end end) if blacklisted then luci.http.redirect(luci.dispatcher.build_url("splash" ,"blocked")) else local redirect_url = uci:get("luci_splash", "general", "redirect_url") if not redirect_url then redirect_url = uci_state:get("luci_splash_locations", mac:gsub(':', ''):lower(), "location") end if not redirect_url then redirect_url = luci.model.uci.cursor():get("freifunk", "community", "homepage") or 'http://www.freifunk.net' end remove_redirect(mac:gsub(':', ''):lower()) os.execute("luci-splash lease "..mac.." >/dev/null 2>&1") luci.http.redirect(redirect_url) end else luci.http.redirect(luci.dispatcher.build_url()) end end function action_status_admin() local uci = luci.model.uci.cursor_state() local macs = luci.http.formvaluetable("save") local changes = { whitelist = { }, blacklist = { }, lease = { }, remove = { } } for key, _ in pairs(macs) do local policy = luci.http.formvalue("policy.%s" % key) local mac = luci.http.protocol.urldecode(key) if policy == "whitelist" or policy == "blacklist" then changes[policy][#changes[policy]+1] = mac elseif policy == "normal" then changes["lease"][#changes["lease"]+1] = mac elseif policy == "kicked" then changes["remove"][#changes["remove"]+1] = mac end end if #changes.whitelist > 0 then os.execute("luci-splash whitelist %s >/dev/null" % table.concat(changes.whitelist)) end if #changes.blacklist > 0 then os.execute("luci-splash blacklist %s >/dev/null" % table.concat(changes.blacklist)) end if #changes.lease > 0 then os.execute("luci-splash lease %s >/dev/null" % table.concat(changes.lease)) end if #changes.remove > 0 then os.execute("luci-splash remove %s >/dev/null" % table.concat(changes.remove)) end luci.template.render("admin_status/splash", { is_admin = true }) end function action_status_public() luci.template.render("admin_status/splash", { is_admin = false }) end function remove_redirect(mac) local mac = mac:lower() mac = mac:gsub(":", "") local uci = require "luci.model.uci".cursor_state() local redirects = uci:get_all("luci_splash_locations") --uci:load("luci_splash_locations") uci:revert("luci_splash_locations") -- For all redirects for k, v in pairs(redirects) do if v[".type"] == "redirect" then if v[".name"] ~= mac then -- Rewrite state uci:section("luci_splash_locations", "redirect", v[".name"], { location = v.location }) end end end uci:save("luci_splash_redirects") end
apache-2.0
aquileia/wesnoth
data/ai/micro_ais/cas/ca_messenger_escort_move.lua
4
3508
local H = wesnoth.require "lua/helper.lua" local AH = wesnoth.require "ai/lua/ai_helper.lua" local LS = wesnoth.require "lua/location_set.lua" local MAIUV = wesnoth.require "ai/micro_ais/micro_ai_unit_variables.lua" local messenger_next_waypoint = wesnoth.require "ai/micro_ais/cas/ca_messenger_f_next_waypoint.lua" local function get_escorts(cfg) local escorts = AH.get_units_with_moves { side = wesnoth.current.side, { "and", H.get_child(cfg, "filter_second") } } return escorts end local ca_messenger_escort_move = {} function ca_messenger_escort_move:evaluation(cfg) -- Move escort units close to messengers, and in between messengers and enemies -- The messengers have moved at this time, so we don't need to exclude them, -- but we check that there are messengers left if (not get_escorts(cfg)[1]) then return 0 end local _, _, _, messengers = messenger_next_waypoint(cfg) if (not messengers) or (not messengers[1]) then return 0 end return cfg.ca_score end function ca_messenger_escort_move:execution(cfg) local escorts = get_escorts(cfg) local _, _, _, messengers = messenger_next_waypoint(cfg) local enemies = wesnoth.get_units { { "filter_side", { { "enemy_of", { side = wesnoth.current.side } } } } } local base_rating_map = LS.create() local max_rating, best_unit, best_hex = -9e99 for _,unit in ipairs(escorts) do -- Only considering hexes unoccupied by other units is good enough for this local reach_map = AH.get_reachable_unocc(unit) -- Minor rating for the fastest and strongest unit to go first local unit_rating = unit.max_moves / 100. + unit.hitpoints / 1000. reach_map:iter( function(x, y, v) local base_rating = base_rating_map:get(x, y) if (not base_rating) then base_rating = 0 -- Distance from messenger is most important; only closest messenger counts for this -- Give somewhat of a bonus for the messenger that has moved the farthest through the waypoints local max_messenger_rating = -9e99 for _,m in ipairs(messengers) do local messenger_rating = 1. / (H.distance_between(x, y, m.x, m.y) + 2.) local wp_rating = MAIUV.get_mai_unit_variables(m, cfg.ai_id, "wp_rating") messenger_rating = messenger_rating * 10. * (1. + wp_rating * 2.) if (messenger_rating > max_messenger_rating) then max_messenger_rating = messenger_rating end end base_rating = base_rating + max_messenger_rating -- Distance from (sum of) enemies is important too -- This favors placing escort units between the messenger and close enemies for _,e in ipairs(enemies) do base_rating = base_rating + 1. / (H.distance_between(x, y, e.x, e.y) + 2.) end base_rating_map:insert(x, y, base_rating) end local rating = base_rating + unit_rating if (rating > max_rating) then max_rating = rating best_unit, best_hex = unit, { x, y } end end) end -- This will always find at least the hex the unit is on -> no check necessary AH.movefull_stopunit(ai, best_unit, best_hex) end return ca_messenger_escort_move
gpl-2.0
luveti/Urho3D
bin/Data/LuaScripts/24_Urho2DSprite.lua
24
8431
-- Urho2D sprite example. -- This sample demonstrates: -- - Creating a 2D scene with sprite -- - Displaying the scene using the Renderer subsystem -- - Handling keyboard to move and zoom 2D camera -- - Usage of Lua Closure to update scene require "LuaScripts/Utilities/Sample" function Start() -- Execute the common startup for samples SampleStart() -- Create the scene content CreateScene() -- Create the UI content CreateInstructions() -- Setup the viewport for displaying the scene SetupViewport() -- Set the mouse mode to use in the sample SampleInitMouseMode(MM_FREE) -- Hook up to the frame update events SubscribeToEvents() end function CreateScene() scene_ = Scene() -- Create the Octree component to the scene. This is required before adding any drawable components, or else nothing will -- show up. The default octree volume will be from (-1000, -1000, -1000) to (1000, 1000, 1000) in world coordinates it -- is also legal to place objects outside the volume but their visibility can then not be checked in a hierarchically -- optimizing manner scene_:CreateComponent("Octree") -- Create a scene node for the camera, which we will move around -- The camera will use default settings (1000 far clip distance, 45 degrees FOV, set aspect ratio automatically) cameraNode = scene_:CreateChild("Camera") -- Set an initial position for the camera scene node above the plane cameraNode.position = Vector3(0.0, 0.0, -10.0) local camera = cameraNode:CreateComponent("Camera") camera.orthographic = true camera.orthoSize = graphics.height * PIXEL_SIZE local sprite = cache:GetResource("Sprite2D", "Urho2D/Aster.png") if sprite == nil then return end local spriteNodes = {} local NUM_SPRITES = 200 local halfWidth = graphics.width * PIXEL_SIZE * 0.5 local halfHeight = graphics.height * PIXEL_SIZE * 0.5 for i = 1, NUM_SPRITES do local spriteNode = scene_:CreateChild("StaticSprite2D") spriteNode.position = Vector3(Random(-halfWidth, halfWidth), Random(-halfHeight, halfHeight), 0.0) local staticSprite = spriteNode:CreateComponent("StaticSprite2D") -- Set color staticSprite.color = Color(Random(1.0), Random(1.0), Random(1.0), 1.0) -- Set blend mode staticSprite.blendMode = BLEND_ALPHA -- Set sprite staticSprite.sprite = sprite -- Set move speed spriteNode.moveSpeed = Vector3(Random(-2.0, 2.0), Random(-2.0, 2.0), 0.0) -- Set rotate speed spriteNode.rotateSpeed = Random(-90.0, 90.0) table.insert(spriteNodes, spriteNode) end scene_.Update = function(self, timeStep) for _, spriteNode in ipairs(spriteNodes) do local position = spriteNode.position local moveSpeed = spriteNode.moveSpeed local newPosition = position + moveSpeed * timeStep if newPosition.x < -halfWidth or newPosition.x > halfWidth then newPosition.x = position.x moveSpeed.x = -moveSpeed.x end if newPosition.y < -halfHeight or newPosition.y > halfHeight then newPosition.y = position.y moveSpeed.y = -moveSpeed.y end spriteNode.position = newPosition spriteNode:Roll(spriteNode.rotateSpeed * timeStep) end end local animationSet = cache:GetResource("AnimationSet2D", "Urho2D/GoldIcon.scml") if animationSet == nil then return end local spriteNode = scene_:CreateChild("AnimatedSprite2D") spriteNode.position = Vector3(0.0, 0.0, -1.0) local animatedSprite = spriteNode:CreateComponent("AnimatedSprite2D") -- Set animation animatedSprite.animationSet = animationSet animatedSprite.animation = "idle" end function CreateInstructions() -- Construct new Text object, set string to display and font to use local instructionText = ui.root:CreateChild("Text") instructionText:SetText("Use WASD keys and mouse to move, Use PageUp PageDown to zoom.") instructionText:SetFont(cache:GetResource("Font", "Fonts/Anonymous Pro.ttf"), 15) -- Position the text relative to the screen center instructionText.horizontalAlignment = HA_CENTER instructionText.verticalAlignment = VA_CENTER instructionText:SetPosition(0, ui.root.height / 4) end function SetupViewport() -- Set up a viewport to the Renderer subsystem so that the 3D scene can be seen. We need to define the scene and the camera -- at minimum. Additionally we could configure the viewport screen size and the rendering path (eg. forward / deferred) to -- use, but now we just use full screen and default render path configured in the engine command line options local viewport = Viewport:new(scene_, cameraNode:GetComponent("Camera")) renderer:SetViewport(0, viewport) end function MoveCamera(timeStep) -- Do not move if the UI has a focused element (the console) if ui.focusElement ~= nil then return end -- Movement speed as world units per second local MOVE_SPEED = 4.0 -- Read WASD keys and move the camera scene node to the corresponding direction if they are pressed if input:GetKeyDown(KEY_W) then cameraNode:Translate(Vector3(0.0, 1.0, 0.0) * MOVE_SPEED * timeStep) end if input:GetKeyDown(KEY_S) then cameraNode:Translate(Vector3(0.0, -1.0, 0.0) * MOVE_SPEED * timeStep) end if input:GetKeyDown(KEY_A) then cameraNode:Translate(Vector3(-1.0, 0.0, 0.0) * MOVE_SPEED * timeStep) end if input:GetKeyDown(KEY_D) then cameraNode:Translate(Vector3(1.0, 0.0, 0.0) * MOVE_SPEED * timeStep) end if input:GetKeyDown(KEY_PAGEUP) then local camera = cameraNode:GetComponent("Camera") camera.zoom = camera.zoom * 1.01 end if input:GetKeyDown(KEY_PAGEDOWN) then local camera = cameraNode:GetComponent("Camera") camera.zoom = camera.zoom * 0.99 end end function SubscribeToEvents() -- Subscribe HandleUpdate() function for processing update events SubscribeToEvent("Update", "HandleUpdate") -- Unsubscribe the SceneUpdate event from base class to prevent camera pitch and yaw in 2D sample UnsubscribeFromEvent("SceneUpdate") end function HandleUpdate(eventType, eventData) -- Take the frame time step, which is stored as a float local timeStep = eventData["TimeStep"]:GetFloat() -- Move the camera, scale movement with time step MoveCamera(timeStep) -- Update scene scene_:Update(timeStep) end -- Create XML patch instructions for screen joystick layout specific to this sample app function GetScreenJoystickPatchString() return "<patch>" .. " <remove sel=\"/element/element[./attribute[@name='Name' and @value='Button0']]/attribute[@name='Is Visible']\" />" .. " <replace sel=\"/element/element[./attribute[@name='Name' and @value='Button0']]/element[./attribute[@name='Name' and @value='Label']]/attribute[@name='Text']/@value\">Zoom In</replace>" .. " <add sel=\"/element/element[./attribute[@name='Name' and @value='Button0']]\">" .. " <element type=\"Text\">" .. " <attribute name=\"Name\" value=\"KeyBinding\" />" .. " <attribute name=\"Text\" value=\"PAGEUP\" />" .. " </element>" .. " </add>" .. " <remove sel=\"/element/element[./attribute[@name='Name' and @value='Button1']]/attribute[@name='Is Visible']\" />" .. " <replace sel=\"/element/element[./attribute[@name='Name' and @value='Button1']]/element[./attribute[@name='Name' and @value='Label']]/attribute[@name='Text']/@value\">Zoom Out</replace>" .. " <add sel=\"/element/element[./attribute[@name='Name' and @value='Button1']]\">" .. " <element type=\"Text\">" .. " <attribute name=\"Name\" value=\"KeyBinding\" />" .. " <attribute name=\"Text\" value=\"PAGEDOWN\" />" .. " </element>" .. " </add>" .. "</patch>" end
mit
AdamGagorik/darkstar
scripts/globals/items/prominence_axe.lua
42
1450
----------------------------------------- -- ID: 18220 -- Item: Prominence Axe -- Additional Effect: Fire Damage -- Enchantment: Enfire ----------------------------------------- require("scripts/globals/status"); require("scripts/globals/magic"); ----------------------------------- -- onAdditionalEffect Action ----------------------------------- function onAdditionalEffect(player,target,damage) local chance = 5; if (math.random(0,99) >= chance) then return 0,0,0; else local dmg = math.random(3,10); local params = {}; params.bonusmab = 0; params.includemab = false; dmg = addBonusesAbility(player, ELE_FIRE, target, dmg, params); dmg = dmg * applyResistanceAddEffect(player,target,ELE_FIRE,0); dmg = adjustForTarget(target,dmg,ELE_FIRE); dmg = finalMagicNonSpellAdjustments(player,target,ELE_FIRE,dmg); local message = MSGBASIC_ADD_EFFECT_DMG; if (dmg < 0) then message = MSGBASIC_ADD_EFFECT_HEAL; end return SUBEFFECT_FIRE_DAMAGE,message,dmg; end end; ----------------------------------------- -- OnItemCheck ----------------------------------------- function onItemCheck(target) return 0; end; ----------------------------------------- -- OnItemUse ----------------------------------------- function onItemUse(target) local effect = EFFECT_ENFIRE; doEnspell(target,target,nil,effect); end;
gpl-3.0
AdamGagorik/darkstar
scripts/zones/Port_Bastok/npcs/Patient_Wheel.lua
13
1440
----------------------------------- -- Area: Port Bastok -- NPC: Patient Wheel -- Type: Quest NPC -- @pos -107.988 3.898 52.557 236 ----------------------------------- package.loaded["scripts/zones/Port_Bastok/TextIDs"] = nil; ----------------------------------- require("scripts/globals/quests"); require("scripts/zones/Port_Bastok/TextIDs"); ----------------------------------- -- onTrade Action ----------------------------------- function onTrade(player,npc,trade) end; ----------------------------------- -- onTrigger Action ----------------------------------- function onTrigger(player,npc) local WildcatBastok = player:getVar("WildcatBastok"); if (player:getQuestStatus(BASTOK,LURE_OF_THE_WILDCAT_BASTOK) == QUEST_ACCEPTED and player:getMaskBit(WildcatBastok,1) == false) then player:startEvent(0x0162); else player:startEvent(0x0145); end end; ----------------------------------- -- onEventUpdate ----------------------------------- function onEventUpdate(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); end; ----------------------------------- -- onEventFinish ----------------------------------- function onEventFinish(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); if (csid == 0x0162) then player:setMaskBit(player:getVar("WildcatBastok"),"WildcatBastok",1,true); end end;
gpl-3.0
sjznxd/lc-20130204
libs/lucid-http/luasrc/lucid/http/handler/catchall.lua
52
2325
--[[ LuCId HTTP-Slave (c) 2009 Steven Barth <steven@midlink.org> 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 $Id$ ]]-- local srv = require "luci.lucid.http.server" local proto = require "luci.http.protocol" local util = require "luci.util" local ip = require "luci.ip" local ipairs = ipairs --- Catchall Handler -- @cstyle instance module "luci.lucid.http.handler.catchall" --- Create a Redirect handler. -- @param name Name -- @param target Redirect Target -- @class function -- @return Redirect handler object Redirect = util.class(srv.Handler) function Redirect.__init__(self, name, target) srv.Handler.__init__(self, name) self.target = target end --- Handle a GET request. -- @param request Request object -- @return status code, header table, response source function Redirect.handle_GET(self, request) local target = self.target local protocol = request.env.HTTPS and "https://" or "http://" local server = request.env.SERVER_ADDR if request.env.REMOTE_ADDR and not request.env.REMOTE_ADDR:find(":") then local compare = ip.IPv4(request.env.REMOTE_ADDR) for _, iface in ipairs(request.server.interfaces) do if iface.family == "inet" and iface.addr and iface.netmask then if ip.IPv4(iface.addr, iface.netmask):contains(compare) then server = iface.addr break end end end end if server:find(":") then server = "[" .. server .. "]" end if self.target:sub(1,1) == ":" then target = protocol .. server .. target end local s, e = target:find("%TARGET%", 1, true) if s then local req = protocol .. (request.env.HTTP_HOST or server) .. request.env.REQUEST_URI target = target:sub(1, s-1) .. req .. target:sub(e+1) end return 302, { Location = target } end --- Handle a POST request. -- @class function -- @param request Request object -- @return status code, header table, response source Redirect.handle_POST = Redirect.handle_GET --- Handle a HEAD request. -- @class function -- @param request Request object -- @return status code, header table, response source function Redirect.handle_HEAD(self, request) local stat, head = self:handle_GET(request) return stat, head end
apache-2.0
AdamGagorik/darkstar
scripts/zones/Northern_San_dOria/npcs/HomePoint#3.lua
27
1277
----------------------------------- -- Area: Northern San dOria -- NPC: HomePoint#3 -- @pos 70 -0.2 10 231 ----------------------------------- package.loaded["scripts/zones/Northern_San_dOria/TextIDs"] = nil; require("scripts/globals/settings"); require("scripts/zones/Northern_San_dOria/TextIDs"); require("scripts/globals/homepoint"); ----------------------------------- -- onTrade Action ----------------------------------- function onTrade(player,npc,trade) end; ----------------------------------- -- onTrigger Action ----------------------------------- function onTrigger(player,npc) homepointMenu( player, 0x21fe, 5); end; ----------------------------------- -- onEventUpdate ----------------------------------- function onEventUpdate(player,csid,option) --printf("CSID: %u",csid); --printf("RESULT: %u",option); end; ----------------------------------- -- onEventFinish ----------------------------------- function onEventFinish(player,csid,option) --printf("CSID: %u",csid); --printf("RESULT: %u",option); if (csid == 0x21fe) then if (option == 1) then player:setHomePoint(); player:messageSpecial(HOMEPOINT_SET); else hpTeleport( player, option); end end end;
gpl-3.0
luveti/Urho3D
bin/Data/LuaScripts/07_Billboards.lua
24
11790
-- Billboard example. -- This sample demonstrates: -- - Populating a 3D scene with billboard sets and several shadow casting spotlights -- - Parenting scene nodes to allow more intuitive creation of groups of objects -- - Examining rendering performance with a somewhat large object and light count require "LuaScripts/Utilities/Sample" local lightNodes = {} local billboardNodes = {} function Start() -- Execute the common startup for samples SampleStart() -- Create the scene content CreateScene() -- Create the UI content CreateInstructions() -- Setup the viewport for displaying the scene SetupViewport() -- Set the mouse mode to use in the sample SampleInitMouseMode(MM_RELATIVE) -- Hook up to the frame update and render post-update events SubscribeToEvents() end function CreateScene() scene_ = Scene() -- Create octree, use default volume (-1000, -1000, -1000) to (1000, 1000, 1000) -- Also create a DebugRenderer component so that we can draw debug geometry scene_:CreateComponent("Octree") scene_:CreateComponent("DebugRenderer") -- Create a Zone component for ambient lighting & fog control local zoneNode = scene_:CreateChild("Zone") local zone = zoneNode:CreateComponent("Zone") zone.boundingBox = BoundingBox(-1000.0, 1000.0) zone.ambientColor = Color(0.1, 0.1, 0.1) zone.fogStart = 100.0 zone.fogEnd = 300.0 -- Create a directional light without shadows local lightNode = scene_:CreateChild("DirectionalLight") lightNode.direction = Vector3(0.5, -1.0, 0.5) local light = lightNode:CreateComponent("Light") light.lightType = LIGHT_DIRECTIONAL light.color = Color(0.2, 0.2, 0.2) light.specularIntensity = 1.0 -- Create a "floor" consisting of several tiles for y = -5, 5 do for x = -5, 5 do local floorNode = scene_:CreateChild("FloorTile") floorNode.position = Vector3(x * 20.5, -0.5, y * 20.5) floorNode.scale = Vector3(20.0, 1.0, 20.0) local floorObject = floorNode:CreateComponent("StaticModel") floorObject.model = cache:GetResource("Model", "Models/Box.mdl") floorObject.material = cache:GetResource("Material", "Materials/Stone.xml") end end -- Create groups of mushrooms, which act as shadow casters local NUM_MUSHROOMGROUPS = 25 local NUM_MUSHROOMS = 25 for i = 1, NUM_MUSHROOMGROUPS do -- First create a scene node for the group. The individual mushrooms nodes will be created as children local groupNode = scene_:CreateChild("MushroomGroup") groupNode.position = Vector3(Random(190.0) - 95.0, 0.0, Random(190.0) - 95.0) for j = 1, NUM_MUSHROOMS do local mushroomNode = groupNode:CreateChild("Mushroom") mushroomNode.position = Vector3(Random(25.0) - 12.5, 0.0, Random(25.0) - 12.5) mushroomNode.rotation = Quaternion(0.0, Random() * 360.0, 0.0) mushroomNode:SetScale(1.0 + Random() * 4.0) local mushroomObject = mushroomNode:CreateComponent("StaticModel") mushroomObject.model = cache:GetResource("Model", "Models/Mushroom.mdl") mushroomObject.material = cache:GetResource("Material", "Materials/Mushroom.xml") mushroomObject.castShadows = true end end -- Create billboard sets (floating smoke) local NUM_BILLBOARDNODES = 25 local NUM_BILLBOARDS = 10 for i = 1, NUM_BILLBOARDNODES do local smokeNode = scene_:CreateChild("Smoke") smokeNode.position = Vector3(Random(200.0) - 100.0, Random(20.0) + 10.0, Random(200.0) - 100.0) local billboardObject = smokeNode:CreateComponent("BillboardSet") billboardObject.numBillboards = NUM_BILLBOARDS billboardObject.material = cache:GetResource("Material", "Materials/LitSmoke.xml") billboardObject.sorted = true for j = 1, NUM_BILLBOARDS do local bb = billboardObject:GetBillboard(j - 1) bb.position = Vector3(Random(12.0) - 6.0, Random(8.0) - 4.0, Random(12.0) - 6.0) bb.size = Vector2(Random(2.0) + 3.0, Random(2.0) + 3.0) bb.rotation = Random() * 360.0 bb.enabled = true end -- After modifying the billboards, they need to be "committed" so that the BillboardSet updates its internals billboardObject:Commit() table.insert(billboardNodes, smokeNode) end -- Create shadow casting spotlights local NUM_LIGHTS = 9 for i = 0, NUM_LIGHTS - 1 do local lightNode = scene_:CreateChild("SpotLight") local light = lightNode:CreateComponent("Light") local angle = 0.0 local position = Vector3((i % 3) * 60.0 - 60.0, 45.0, math.floor(i / 3) * 60.0 - 60.0) local color = Color(((i + 1) % 2) * 0.5 + 0.5, (math.floor((i + 1) / 2) % 2) * 0.5 + 0.5, (math.floor((i + 1) / 4) % 2) * 0.5 + 0.5) lightNode.position = position lightNode.direction = Vector3(math.sin(M_DEGTORAD * angle), -1.5, math.cos(M_DEGTORAD * angle)) light.lightType = LIGHT_SPOT light.range = 90.0 light.rampTexture = cache:GetResource("Texture2D", "Textures/RampExtreme.png") light.fov = 45.0 light.color = color light.specularIntensity = 1.0 light.castShadows = true light.shadowBias = BiasParameters(0.00002, 0.0) -- Configure shadow fading for the lights. When they are far away enough, the lights eventually become unshadowed for -- better GPU performance. Note that we could also set the maximum distance for each object to cast shadows light.shadowFadeDistance = 100.0 -- Fade start distance light.shadowDistance = 125.0 -- Fade end distance, shadows are disabled -- Set half resolution for the shadow maps for increased performance light.shadowResolution = 0.5 -- The spot lights will not have anything near them, so move the near plane of the shadow camera farther -- for better shadow depth resolution light.shadowNearFarRatio = 0.01 table.insert(lightNodes, lightNode) end -- Create the camera. Limit far clip distance to match the fog cameraNode = scene_:CreateChild("Camera") local camera = cameraNode:CreateComponent("Camera") camera.farClip = 300.0 -- Set an initial position for the camera scene node above the plane cameraNode.position = Vector3(0.0, 5.0, 0.0) end function CreateInstructions() -- Construct new Text object, set string to display and font to use local instructionText = ui.root:CreateChild("Text") instructionText.text = "Use WASD keys and mouse to move\n".. "Space to toggle debug geometry" instructionText:SetFont(cache:GetResource("Font", "Fonts/Anonymous Pro.ttf"), 15) -- The text has multiple rows. Center them in relation to each other instructionText.textAlignment = HA_CENTER -- Position the text relative to the screen center instructionText.horizontalAlignment = HA_CENTER instructionText.verticalAlignment = VA_CENTER instructionText:SetPosition(0, ui.root.height / 4) end function SetupViewport() -- Set up a viewport to the Renderer subsystem so that the 3D scene can be seen local viewport = Viewport:new(scene_, cameraNode:GetComponent("Camera")) renderer:SetViewport(0, viewport) end function SubscribeToEvents() -- Subscribe HandleUpdate() function for processing update events SubscribeToEvent("Update", "HandleUpdate") -- Subscribe HandlePostRenderUpdate() function for processing the post-render update event, during which we request -- debug geometry SubscribeToEvent("PostRenderUpdate", "HandlePostRenderUpdate") end function MoveCamera(timeStep) -- Do not move if the UI has a focused element (the console) if ui.focusElement ~= nil then return end -- Movement speed as world units per second local MOVE_SPEED = 20.0 -- Mouse sensitivity as degrees per pixel local MOUSE_SENSITIVITY = 0.1 -- Use this frame's mouse motion to adjust camera node yaw and pitch. Clamp the pitch between -90 and 90 degrees local mouseMove = input.mouseMove yaw = yaw + MOUSE_SENSITIVITY * mouseMove.x pitch = pitch + MOUSE_SENSITIVITY * mouseMove.y pitch = Clamp(pitch, -90.0, 90.0) -- Construct new orientation for the camera scene node from yaw and pitch. Roll is fixed to zero cameraNode.rotation = Quaternion(pitch, yaw, 0.0) -- Read WASD keys and move the camera scene node to the corresponding direction if they are pressed if input:GetKeyDown(KEY_W) then cameraNode:Translate(Vector3(0.0, 0.0, 1.0) * MOVE_SPEED * timeStep) end if input:GetKeyDown(KEY_S) then cameraNode:Translate(Vector3(0.0, 0.0, -1.0) * MOVE_SPEED * timeStep) end if input:GetKeyDown(KEY_A) then cameraNode:Translate(Vector3(-1.0, 0.0, 0.0) * MOVE_SPEED * timeStep) end if input:GetKeyDown(KEY_D) then cameraNode:Translate(Vector3(1.0, 0.0, 0.0) * MOVE_SPEED * timeStep) end -- Toggle debug geometry with space if input:GetKeyPress(KEY_SPACE) then drawDebug = not drawDebug end end function AnimateScene(timeStep) local LIGHT_ROTATION_SPEED = 20.0 local BILLBOARD_ROTATION_SPEED = 50.0 -- Rotate the lights around the world Y-axis for i, v in ipairs(lightNodes) do v:Rotate(Quaternion(0.0, LIGHT_ROTATION_SPEED * timeStep, 0.0), TS_WORLD) end -- Rotate the individual billboards within the billboard sets, then recommit to make the changes visible for i, v in ipairs(billboardNodes) do local billboardObject = v:GetComponent("BillboardSet") for j = 1, billboardObject.numBillboards do local bb = billboardObject:GetBillboard(j - 1) bb.rotation = bb.rotation + BILLBOARD_ROTATION_SPEED * timeStep end billboardObject:Commit() end end function HandleUpdate(eventType, eventData) -- Take the frame time step, which is stored as a float local timeStep = eventData["TimeStep"]:GetFloat() -- Move the camera and animate the scene, scale movement with time step MoveCamera(timeStep) AnimateScene(timeStep) end function HandlePostRenderUpdate(eventType, eventData) -- If draw debug mode is enabled, draw viewport debug geometry. This time use depth test, as otherwise the result becomes -- hard to interpret due to large object count if drawDebug then renderer:DrawDebugGeometry(true) end end -- Create XML patch instructions for screen joystick layout specific to this sample app function GetScreenJoystickPatchString() return "<patch>" .. " <remove sel=\"/element/element[./attribute[@name='Name' and @value='Button1']]/attribute[@name='Is Visible']\" />" .. " <replace sel=\"/element/element[./attribute[@name='Name' and @value='Button1']]/element[./attribute[@name='Name' and @value='Label']]/attribute[@name='Text']/@value\">Debug</replace>" .. " <add sel=\"/element/element[./attribute[@name='Name' and @value='Button1']]\">" .. " <element type=\"Text\">" .. " <attribute name=\"Name\" value=\"KeyBinding\" />" .. " <attribute name=\"Text\" value=\"SPACE\" />" .. " </element>" .. " </add>" .. "</patch>" end
mit
Nathan22Miles/sile
packages/tableofcontents.lua
2
2471
-- Table of contents class -- Exports: The \tableofcontents command -- The \tocentry command (call this in your sectioning commands) -- writeToc (call this in finish) -- moveTocNodes (call this in endPage) SILE.scratch.tableofcontents = { } local moveNodes = function(self) local n = SILE.scratch.info.thispage.toc if n then for i = 1,#n do n[i].pageno = SILE.formatCounter(SILE.scratch.counters.folio) SILE.scratch.tableofcontents[#(SILE.scratch.tableofcontents)+1] = n[i] end end end local writeToc = function () local t = "return "..std.string.pickle(SILE.scratch.tableofcontents) local f,err = io.open(SILE.masterFileName .. '.toc',"w") if not f then return SU.error(err) end f:write(t) end SILE.registerCommand("tableofcontents", function (options, content) local f,err = io.open(SILE.masterFileName .. '.toc') if not f then SILE.call("tableofcontents:notocmessage") return end local doc = f:read("*all") local toc = assert(loadstring(doc))() SILE.call("tableofcontents:header") for i = 1,#toc do local item = toc[i] SILE.call("tableofcontents:item", {level = item.level, pageno= item.pageno}, item.label) end end) SILE.registerCommand("tableofcontents:item", function (o,c) SILE.settings.temporarily(function () SILE.settings.set("typesetter.parfillskip", SILE.nodefactory.zeroGlue) SILE.call("tableofcontents:level"..o.level.."item", {}, function() SILE.process({c}) -- Ideally, leaders SILE.call("hss") SILE.typesetter:typeset(o.pageno) end) end) end) SILE.registerCommand("tocentry", function (options, content) SILE.call("info", { category = "toc", value = { label = content[1], level = (options.level or 1) } }) end) return { exports = {writeToc = writeToc, moveTocNodes = moveNodes}, init = function (self) self:loadPackage("infonode") SILE.doTexlike([[% \define[command=tableofcontents:notocmessage]{\tableofcontents:headerfont{Rerun SILE to process table of contents!}}% \define[command=tableofcontents:headerfont]{\font[size=24pt,weight=800]{\process}}% \define[command=tableofcontents:header]{\par\noindent\tableofcontents:headerfont{Table of Contents}\medskip}% \define[command=tableofcontents:level1item]{\bigskip\noindent\font[size=14pt,weight=800]{\process}\medskip}% \define[command=tableofcontents:level2item]{\noindent\font[size=12pt]{\process}\medskip}% ]]) end }
mit
AdamGagorik/darkstar
scripts/zones/Stellar_Fulcrum/Zone.lua
13
2300
----------------------------------- -- -- Zone: Stellar_Fulcrum -- ----------------------------------- package.loaded["scripts/zones/Stellar_Fulcrum/TextIDs"] = nil; ----------------------------------- require("scripts/globals/missions"); require("scripts/zones/Stellar_Fulcrum/TextIDs"); ----------------------------------- -- onInitialize ----------------------------------- function onInitialize(zone) zone:registerRegion(1, -522, -2, -49, -517, -1, -43); -- To Upper Delkfutt's Tower zone:registerRegion(2, 318, -3, 2, 322, 1, 6); -- Exit BCNM to ? end; ----------------------------------- -- onConquestUpdate ----------------------------------- function onConquestUpdate(zone, updatetype) local players = zone:getPlayers(); for name, player in pairs(players) do conquestUpdate(zone, player, updatetype, CONQUEST_BASE); end end; ----------------------------------- -- onZoneIn ----------------------------------- function onZoneIn(player,prevZone) local cs = -1; if (player:getCurrentMission(ZILART) == RETURN_TO_DELKFUTTS_TOWER and player:getVar("ZilartStatus") == 2) then cs = 0x0000; end return cs; end; ----------------------------------- -- onRegionEnter ----------------------------------- function onRegionEnter(player,region) switch (region:GetRegionID()): caseof { [1] = function (x) player:startEvent(8); end, [2] = function (x) player:startEvent(8); end, } end; ----------------------------------- -- onRegionLeave ----------------------------------- function onRegionLeave(player,region) end; ----------------------------------- -- onEventUpdate ----------------------------------- function onEventUpdate(player,csid,option) --printf("CSID: %u",csid); --printf("RESULT: %u",option); end; ----------------------------------- -- onEventFinish ----------------------------------- function onEventFinish(player,csid,option) --printf("CSID: %u",csid); --printf("RESULT: %u",option); if (csid == 8 and option == 1) then player:setPos(-370, -178, -40, 243, 0x9e); elseif (csid == 0x0000) then player:setVar("ZilartStatus",3); end end;
gpl-3.0
D-m-L/evonara
modules/txt/test.lua
1
1708
m[1] = _navi:new('Alright!|,|, Here is our |c{mblue}message system|c{white}|,, working |c{mblue}CORRECTLY|c{white}|,. |nPress |c{mgreen}'..arc.btn.ent..'|c{white} to continue.', {x=sw/2, y=sh/2, alx='m', alxb='m', alyb='m'}) m[2] = _navi:new("Let's see the features. Consult |c{mred}main.lua|c{white} to understand some of the options.|nFor a more complete review, see the |c{mred}manual.txt|c{white}.|mWe can |c{mgreen}change text color|c{white}, add pauses,|: and start text |non a new line. We can also request a keypress,|! and finally, continue the message|min the next message box. All done using string |c{mpurple}formatters|c{white}.", {x=sw/2, y=sh/2, alxb='m', alyb='m', w=200, nrows=4}) m[3] = _navi:new('For instance, add a picture.', {x=10, y = 120, wbox=300, nrows=3, name='litearc', face=litearc.face, face_pos = 'r'}) m[4] = _navi:new('|c{mblue}Some messages cannot be skipped. This may be good for certain cutscenes where timing is important.', {x=scrn.w, y = scrn.h, alx='m', alxb='m', alyb='m', wbox=scrn.w/2, box=false, skip=false, wait=4}) m[5] = _navi:new("Let's see.|,.|,.|, Pick your favorite color:", {x=10, y = 120, wbox=300, nrows=3, name='litearc', face=img.avatar, nvchs=3, choices={ 'green', 'blue', "yellow",}}) m_correct = _navi:new('Correct! |,|,...', {x=160, y=140, w=160, alxb='m', alyb='m'}) m_wrong = _navi:new('Nope, sorry!', {x=160, y=140, w=100, alxb='m', alyb='m'}) m2 = _navi:new('Anyway, that\'s it! Again, read the manual for more info as I didn\'t show off everything. And please report any bugs or give suggestions in the forum topic (see the |c{mred}manual.txt|c{white} file for a link). Thanks!', {x=160, y=140, alxb='m', alyb='m', w=200})
mit
mosy210/PERSION-BOT
plugins/exchange.lua
352
2076
local ltn12 = require "ltn12" local https = require "ssl.https" -- Edit data/mashape.lua with your Mashape API key -- http://docs.mashape.com/api-keys local function comma_value(n) -- credit http://richard.warburton.it local left,num,right = string.match(n,'^([^%d]*%d)(%d*)(.-)$') return left..(num:reverse():gsub('(%d%d%d)','%1,'):reverse())..right end local mashape = load_from_file('data/mashape.lua', { api_key = '' }) local function request(value, from, to) local api = "https://currency-exchange.p.mashape.com/exchange?" local par1 = "from="..from local par2 = "&q="..value local par3 = "&to="..to local url = api..par1..par2..par3 local api_key = mashape.api_key if api_key:isempty() then return 'Configure your Mashape API Key' end local headers = { ["X-Mashape-Key"] = api_key, ["Accept"] = "text/plain" } local respbody = {} local body, code = https.request{ url = url, method = "GET", headers = headers, sink = ltn12.sink.table(respbody), protocol = "tlsv1" } if code ~= 200 then return code end local body = table.concat(respbody) local curr = comma_value(value).." "..from.." = "..to.." "..comma_value(body) return curr end local function run(msg, matches) if tonumber(matches[1]) and not matches[2] then local from = "USD" local to = "IDR" local value = matches[1] return request(value, from, to) elseif matches[2] and matches[3] then local from = string.upper(matches[2]) or "USD" local to = string.upper(matches[3]) or "IDR" local value = matches[1] or "1" return request(value, from, to, value) end end return { description = "Currency Exchange", usage = { "!exchange [value] : Exchange value from USD to IDR (default).", "!exchange [value] [from] [to] : Get Currency Exchange by specifying the value of source (from) and destination (to).", }, patterns = { "^!exchange (%d+) (%a+) (%a+)$", "^!exchange (%d+)", }, run = run }
gpl-2.0
AdamGagorik/darkstar
scripts/globals/missions.lua
10
56967
----------------------------------- -- Areas ID mission step var ----------------------------------- SANDORIA = 0; -- MissionStatus BASTOK = 1; -- MissionStatus WINDURST = 2; -- MissionStatus ZILART = 3; -- ZilartStatus TOAU = 4; -- AhtUrganStatus WOTG = 5; -- AltanaStatus COP = 6; -- PromathiaStatus ASSAULT = 7; -- n/a CAMPAIGN = 8; -- n/a ACP = 9; -- n/a AMK = 10; -- n/a ASA = 11; -- n/a SOA = 12; -- AdoulinStatus ROV = 13; -- RhapsodiesStatus ----------------------------------- -- San d'Oria (0) ----------------------------------- SMASH_THE_ORCISH_SCOUTS = 0; -- ± -- BAT_HUNT = 1; -- ± -- SAVE_THE_CHILDREN = 2; -- ± -- THE_RESCUE_DRILL = 3; -- ± -- THE_DAVOI_REPORT = 4; -- ± -- JOURNEY_ABROAD = 5; -- ± -- JOURNEY_TO_BASTOK = 6; -- ± -- JOURNEY_TO_WINDURST = 7; -- ± -- JOURNEY_TO_BASTOK2 = 8; -- ± -- JOURNEY_TO_WINDURST2 = 9; -- ± -- INFILTRATE_DAVOI = 10; -- ± -- THE_CRYSTAL_SPRING = 11; -- ± -- APPOINTMENT_TO_JEUNO = 12; -- ± -- MAGICITE_SAN_D_ORIA = 13; -- ± -- THE_RUINS_OF_FEI_YIN = 14; -- ± -- THE_SHADOW_LORD = 15; -- ± -- LEAUTE_S_LAST_WISHES = 16; -- ± -- RANPERRE_S_FINAL_REST = 17; -- ± -- PRESTIGE_OF_THE_PAPSQUE = 18; -- ± -- THE_SECRET_WEAPON = 19; -- ± -- COMING_OF_AGE = 20; -- ± -- LIGHTBRINGER = 21; -- ± -- BREAKING_BARRIERS = 22; -- ± -- THE_HEIR_TO_THE_LIGHT = 23; ----------------------------------- -- Bastok (1) ----------------------------------- THE_ZERUHN_REPORT = 0; -- ± -- GEOLOGICAL_SURVEY = 1; -- ± -- FETICHISM = 2; -- ± -- THE_CRYSTAL_LINE = 3; -- ± -- WADING_BEASTS = 4; -- ± -- THE_EMISSARY = 5; -- ± -- THE_EMISSARY_SANDORIA = 6; -- ± -- THE_EMISSARY_WINDURST = 7; -- ± -- THE_EMISSARY_SANDORIA2 = 8; -- ± -- THE_EMISSARY_WINDURST2 = 9; -- ± -- THE_FOUR_MUSKETEERS = 10; -- ± -- TO_THE_FORSAKEN_MINES = 11; -- ± -- JEUNO_MISSION = 12; -- ± -- MAGICITE_BASTOK = 13; -- ± -- DARKNESS_RISING = 14; -- ± -- XARCABARD_LAND_OF_TRUTHS = 15; -- ± -- RETURN_OF_THE_TALEKEEPER = 16; -- ± -- THE_PIRATE_S_COVE = 17; -- ± -- THE_FINAL_IMAGE = 18; -- ± -- ON_MY_WAY = 19; THE_CHAINS_THAT_BIND_US = 20; ENTER_THE_TALEKEEPER = 21; THE_SALT_OF_THE_EARTH = 22; WHERE_TWO_PATHS_CONVERGE = 23; ----------------------------------- -- Windurst (2) ----------------------------------- THE_HORUTOTO_RUINS_EXPERIMENT = 0; -- ± -- THE_HEART_OF_THE_MATTER = 1; -- ± -- THE_PRICE_OF_PEACE = 2; -- ± -- LOST_FOR_WORDS = 3; -- ± -- A_TESTING_TIME = 4; -- ± -- THE_THREE_KINGDOMS = 5; -- ± -- THE_THREE_KINGDOMS_SANDORIA = 6; -- ± -- THE_THREE_KINGDOMS_BASTOK = 7; -- ± -- THE_THREE_KINGDOMS_SANDORIA2 = 8; -- ± -- THE_THREE_KINGDOMS_BASTOK2 = 9; -- ± -- TO_EACH_HIS_OWN_RIGHT = 10; -- ± -- WRITTEN_IN_THE_STARS = 11; -- ± -- A_NEW_JOURNEY = 12; -- ± -- MAGICITE = 13; -- ± -- THE_FINAL_SEAL = 14; -- ± -- THE_SHADOW_AWAITS = 15; -- ± -- FULL_MOON_FOUNTAIN = 16; -- ± -- SAINTLY_INVITATION = 17; -- ± -- THE_SIXTH_MINISTRY = 18; -- ± -- AWAKENING_OF_THE_GODS = 19; -- ± -- VAIN = 20; THE_JESTER_WHO_D_BE_KING = 21; DOLL_OF_THE_DEAD = 22; MOON_READING = 23; ----------------------------------- -- Zilart Missions (3) ----------------------------------- THE_NEW_FRONTIER = 0; -- ± -- WELCOME_TNORG = 4; -- ± -- KAZAMS_CHIEFTAINESS = 6; -- ± -- THE_TEMPLE_OF_UGGALEPIH = 8; -- ± -- HEADSTONE_PILGRIMAGE = 10; -- ± -- THROUGH_THE_QUICKSAND_CAVES = 12; -- ± -- THE_CHAMBER_OF_ORACLES = 14; -- ± -- RETURN_TO_DELKFUTTS_TOWER = 16; -- ± -- ROMAEVE = 18; -- ± -- THE_TEMPLE_OF_DESOLATION = 20; -- ± -- THE_HALL_OF_THE_GODS = 22; -- ± -- THE_MITHRA_AND_THE_CRYSTAL = 23; -- ± -- THE_GATE_OF_THE_GODS = 24; -- ± -- ARK_ANGELS = 26; -- ± -- THE_SEALED_SHRINE = 27; -- ± -- THE_CELESTIAL_NEXUS = 28; AWAKENING = 30; THE_LAST_VERSE = 31; ----------------------------------- -- Promathia Missions (6) ----------------------------------- ANCIENT_FLAMES_BECKON = 0 -- Category THE_RITES_OF_LIFE = 1 -- ± -- BELOW_THE_ARKS = 2 -- ± -- THE_MOTHERCRYSTALS = 3 -- ± -- -- THE_ISLE_OF_FORGOTTEN_SAINTS = -- Category AN_INVITATION_WEST = 5 -- ± -- THE_LOST_CITY = 15 -- ± -- DISTANT_BELIEFS = 16 -- ± -- AN_ETERNAL_MELODY = 17 -- ± -- ANCIENT_VOWS = 18 -- ± -- A_TRANSIENT_DREAM = 19 -- Category THE_CALL_OF_THE_WYRMKING = 20 -- ± -- A_VESSEL_WITHOUT_A_CAPTAIN = 27 -- ± -- THE_ROAD_FORKS = 28 -- ± -- -- EMERALD_WATERS = -- Sub-category -- VICISSITUDES = -- ± -- DESCENDANTS_OF_A_LINE_LOST = 29 -- ± -- -- LOUVERANCE = -- ± -- -- MEMORIES_OF_A_MAIDEN = -- Sub-category COMEDY_OF_ERRORS_ACT_I = 30 -- ± -- -- COMEDY_OF_ERRORS_ACT_II = -- ± -- -- EXIT_STAGE_LEFT = -- ± -- TENDING_AGED_WOUNDS = 31 -- ± -- DARKNESS_NAMED = 32 -- ± -- -- THE_CRADLES_OF_CHILDREN_LOST = -- Category SHELTERING_DOUBT = 33 -- ± -- THE_SAVAGE = 40 -- ± -- THE_SECRETS_OF_WORSHIP = 41 -- ± -- SLANDEROUS_UTTERINGS = 42 -- ± -- -- THE_RETURN_HOME = -- Category THE_ENDURING_TUMULT_OF_WAR = 43 -- ± -- DESIRES_OF_EMPTINESS = 52 -- ± -- THREE_PATHS = 54 -- ± -- -- PAST_SINS = -- ± -- -- SOUTHERN_LEGEND = -- ± -- PARTNERS_WITHOUT_FAME = 55 -- ± -- -- A_CENTURY_OF_HARDSHIP = -- ± -- -- DEPARTURES = -- ± -- -- THE_PURSUIT_OF_PARADISE = -- ± -- SPIRAL = 56 -- ± -- -- BRANDED = -- ± -- -- PRIDE_AND_HONOR = -- ± -- -- AND_THE_COMPASS_GUIDES = -- ± -- WHERE_MESSENGERS_GATHER = 57 -- ± -- -- ENTANGLEMENT = -- ± -- -- HEAD_WIND = -- ± -- FLAMES_FOR_THE_DEAD = 58 -- ± -- -- ECHOES_OF_TIME = -- ± -- -- Category FOR_WHOM_THE_VERSE_IS_SUNG = 60 -- ± -- A_PLACE_TO_RETURN = 65 -- ± ---- It's necessary to increase MAX_MISSIONID in charentity.h to reach values > 63 MORE_QUESTIONS_THAN_ANSWERS = 66 -- ± -- ONE_TO_BE_FEARED = 67 -- ± -- -- IN_THE_LIGHT_OF_THE_CRYSTAL = -- ± -- -- Category CHAINS_AND_BONDS = 68 -- ± -- FLAMES_IN_THE_DARKNESS = 77 -- ± -- FIRE_IN_THE_EYES_OF_MEN = 78 -- ± -- CALM_BEFORE_THE_STORM = 80 -- ± -- THE_WARRIOR_S_PATH = 81 -- ± -- EMPTINESS_BLEEDS = 82 -- ± ---- Category GARDEN_OF_ANTIQUITY = 87 -- ± -- A_FATE_DECIDED = 90 -- ± -- WHEN_ANGELS_FALL = 91 -- ± -- DAWN = 92 -- ± -- THE_LAST_VERSE = 94 ----------------------------------- -- Aht Urhgan Missions (4) ----------------------------------- LAND_OF_SACRED_SERPENTS = 0; IMMORTAL_SENTRIES = 1; PRESIDENT_SALAHEEM = 2; KNIGHT_OF_GOLD = 3; CONFESSIONS_OF_ROYALTY = 4; EASTERLY_WINDS = 5; WESTERLY_WINDS = 6; A_MERCENARY_LIFE = 7; UNDERSEA_SCOUTING = 8; ASTRAL_WAVES = 9; IMPERIAL_SCHEMES = 10; ROYAL_PUPPETEER = 11; LOST_KINGDOM = 12; THE_DOLPHIN_CREST = 13; THE_BLACK_COFFIN = 14; GHOSTS_OF_THE_PAST_TOAU = 15; GUESTS_OF_THE_EMPIRE = 16; PASSING_GLORY = 17; SWEETS_FOR_THE_SOUL = 18; TEAHOUSE_TUMULT = 19; FINDERS_KEEPERS = 20; SHIELD_OF_DIPLOMACY = 21; SOCIAL_GRACES = 22; FOILED_AMBITION = 23; PLAYING_THE_PART = 24; SEAL_OF_THE_SERPENT = 25; MISPLACED_NOBILITY = 26; BASTION_OF_KNOWLEDGE = 27; PUPPET_IN_PERIL = 28; PREVALENCE_OF_PIRATES = 29; SHADES_OF_VENGEANCE = 30; IN_THE_BLOOD = 31; SENTINELS_HONOR = 32; TESTING_THE_WATERS = 33; LEGACY_OF_THE_LOST = 34; GAZE_OF_THE_SABOTEUR = 35; PATH_OF_BLOOD = 36; STIRRINGS_OF_WAR = 37; ALLIED_RUMBLINGS = 38; UNRAVELING_REASON = 39; LIGHT_OF_JUDGMENT = 40; PATH_OF_DARKNESS = 41; FANGS_OF_THE_LION = 42; NASHMEIRAS_PLEA = 43; URHGAN_MISSION_44 = 44; IMPERIAL_CORONATION = 45; THE_EMPRESS_CROWNED = 46; ETERNAL_MERCENARY = 47; ----------------------------------- -- Wings of the Goddess (5) ----------------------------------- CAVERNOUS_MAWS = 0; BACK_TO_THE_BEGINNING = 1; CAIT_SITH = 2; THE_QUEEN_OF_THE_DANCE = 3; WHILE_THE_CAT_IS_AWAY = 4; A_TIMESWEPT_BUTTERFLY = 5; PURPLE,_THE_NEW_BLACK = 6; IN_THE_NAME_OF_THE_FATHER = 7; DANCERS_IN_DISTRESS = 8; DAUGHTER_OF_A_KNIGHT = 9; A_SPOONFUL_OF_SUGAR = 10; AFFAIRS_OF_STATE = 11; BORNE_BY_THE_WIND = 12; A_NATION_ON_THE_BRINK = 13; CROSSROADS_OF_TIME = 14; SANDSWEPT_MEMORIES = 15; NORTHLAND_EXPOSURE = 16; TRAITOR_IN_THE_MIDST = 17; BETRAYAL_AT_BEAUCEDINE = 18; ON_THIN_ICE = 19; PROOF_OF_VALOR = 20; A_SANGUINARY_PRELUDE = 21; DUNGEONS_AND_DANCERS = 22; DISTORTER_OF_TIME = 23; THE_WILL_OF_THE_WORLD = 24; FATE_IN_HAZE = 25; THE_SCENT_OF_BATTLE = 26; ANOTHER_WORLD = 27; A_HAWK_IN_REPOSE = 28; THE_BATTLE_OF_XARCABARD = 29; PRELUDE_TO_A_STORM = 30; STORM_S_CRESCENDO = 31; INTO_THE_BEAST_S_MAW = 32; THE_HUNTER_ENSNARED = 33; FLIGHT_OF_THE_LION = 34; FALL_OF_THE_HAWK = 35; DARKNESS_DESCENDS = 36; ADIEU__LILISETTE = 37; BY_THE_FADING_LIGHT = 38; EDGE_OF_EXISTENCE = 39; HER_MEMORIES = 40; FORGET_ME_NOT = 41; PILLAR_OF_HOPE = 42; GLIMMER_OF_LIFE = 43; TIME_SLIPS_AWAY = 44; WHEN_WILLS_COLLIDE = 45; WHISPERS_OF_DAWN = 46; A_DREAMY_INTERLUDE = 47; CAIT_IN_THE_WOODS = 48; FORK_IN_THE_ROAD = 49; MAIDEN_OF_THE_DUSK = 50; WHERE_IT_ALL_BEGAN = 51; A_TOKEN_OF_TROTH = 52; LEST_WE_FORGET = 53; ----------------------------------- -- Assault (7) ----------------------------------- LEUJAOAM_CLEANSING = 1; ORICHALCUM_SURVEY = 2; ESCORT_PROFESSOR_CHANOIX = 3; SHANARHA_GRASS_CONSERVATION = 4; COUNTING_SHEEP = 5; SUPPLIES_RECOVERY = 6; AZURE_EXPERIMENTS = 7; IMPERIAL_CODE = 8; RED_VERSUS_BLUE = 9; BLOODY_RONDO = 10; IMPERIAL_AGENT_RESCUE = 11; PREEMPTIVE_STRIKE = 12; SAGELORD_ELIMINATION = 13; BREAKING_MORALE = 14; THE_DOUBLE_AGENT = 15; IMPERIAL_TREASURE_RETRIEVAL = 16; BLITZKRIEG = 17; MARIDS_IN_THE_MIST = 18; AZURE_AILMENTS = 19; THE_SUSANOO_SHUFFLE = 20; EXCAVATION_DUTY = 21; LEBROS_SUPPLIES = 22; TROLL_FUGITIVES = 23; EVADE_AND_ESCAPE = 24; SIEGEMASTER_ASSASSINATION = 25; APKALLU_BREEDING = 26; WAMOURA_FARM_RAID = 27; EGG_CONSERVATION = 28; OPERATION__BLACK_PEARL = 29; BETTER_THAN_ONE = 30; SEAGULL_GROUNDED = 31; REQUIEM = 32; SAVING_PRIVATE_RYAAF = 33; SHOOTING_DOWN_THE_BARON = 34; BUILDING_BRIDGES = 35; STOP_THE_BLOODSHED = 36; DEFUSE_THE_THREAT = 37; OPERATION__SNAKE_EYES = 38; WAKE_THE_PUPPET = 39; THE_PRICE_IS_RIGHT = 40; GOLDEN_SALVAGE = 41; LAMIA_NO_13 = 42; EXTERMINATION = 43; DEMOLITION_DUTY = 44; SEARAT_SALVATION = 45; APKALLU_SEIZURE = 46; LOST_AND_FOUND = 47; DESERTER = 48; DESPERATELY_SEEKING_CEPHALOPODS = 49; BELLEROPHON_S_BLISS = 50; NYZUL_ISLE_INVESTIGATION = 51; NYZUL_ISLE_UNCHARTED_AREA_SURVEY = 52; ----------------------------------- -- Campaign (8) ----------------------------------- ----------------------------------- -- A Crystalline Prophecy (9) ----------------------------------- A_CRYSTALLINE_PROPHECY = 0; -- ± -- THE_ECHO_AWAKENS = 1; -- ± -- GATHERER_OF_LIGHT_I = 2; -- ± -- GATHERER_OF_LIGHT_II = 3; THOSE_WHO_LURK_IN_SHADOWS_I = 4; -- ± -- THOSE_WHO_LURK_IN_SHADOWS_II = 5; -- ± -- THOSE_WHO_LURK_IN_SHADOWS_III = 6; -- ± -- REMEMBER_ME_IN_YOUR_DREAMS = 7; -- ± -- BORN_OF_HER_NIGHTMARES = 8; -- ± -- BANISHING_THE_ECHO = 9; ODE_OF_LIFE_BESTOWING = 10; A_CRYSTALLINE_PROPHECY_FIN = 11; ----------------------------------- -- A Moogle Kupo d'Etat (10) ----------------------------------- A_MOOGLE_KUPO_DETAT = 0; DRENCHED_IT_BEGAN_WITH_A_RAINDROP = 1; HASTEN_IN_A_JAM_IN_JEUNO = 2; WELCOME_TO_MY_DECREPIT_DOMICILE = 3; CURSES_A_HORRIFICALLY_HARROWING_HEX = 4; AN_ERRAND_THE_PROFESSORS_PRICE = 5; SHOCK_ARRANT_ABUSE_OF_AUTHORITY = 6; LENDER_BEWARE_READ_THE_FINE_PRINT = 7; RESCUE_A_MOOGLES_LABOR_OF_LOVE = 8; ROAR_A_CAT_BURGLAR_BARES_HER_FANGS = 9; RELIEF_A_TRIUMPHANT_RETURN = 10; JOY_SUMMONED_TO_A_FABULOUS_FETE = 11; A_CHALLENGE_YOU_COULD_BE_A_WINNER = 12; SMASH_A_MALEVOLENT_MENACE = 13; A_MOOGLE_KUPO_DETAT_FIN = 14; ----------------------------------- -- A Shantotto Ascension (11) ----------------------------------- A_SHANTOTTO_ASCENSION = 0; -- ± -- BURGEONING_DREAD = 1; -- ± -- THAT_WHICH_CURDLES_BLOOD = 2; -- ± -- SUGAR_COATED_DIRECTIVE = 3; -- ± -- ENEMY_OF_THE_EMPIRE_I = 4; ENEMY_OF_THE_EMPIRE_II = 5; SUGAR_COATED_SUBTERFUGE = 6; SHANTOTTO_IN_CHAINS = 7; FOUNTAIN_OF_TROUBLE = 8; BATTARU_ROYALE = 9; ROMANCING_THE_CLONE = 10; SISTERS_IN_ARMS = 11; PROJECT_SHANTOTTOFICATION = 12; AN_UNEASY_PEACE = 13; A_SHANTOTTO_ASCENSION_FIN = 14; ----------------------------------- -- Seekers of Adoulin (12) ----------------------------------- -- THE_SACRED_CITY_OF_ADOULIN = -- Category RUMORS_FROM_THE_WEST = 0; THE_GEOMAGNETRON = 1; ONWARD_TO_ADOULIN = 2; HEARTWIGNS_AND_THE_KINDHEARTED = 3; PIONEER_REGISTRATION = 4; LIFE_ON_THE_FRONTIER = 5; MEETING_OF_THE_MINDS = 6; ARCIELA_APPEARS_AGAIN = 7; -- THE_ANCIENT_PACT = -- Category BUILDING_PROSPECTS = 8; THE_LIGHT_SHINING_IN_YOUR_EYES = 9; THE_HEIRLOOM = 10; AN_AIMLESS_JOURNEY = 11; ORTHARSYNE = 12; IN_THE_PRESENCE_OF_ROYALTY = 13; THE_TWIN_WORLD_TREES = 14; HONOR_AND_AUDACITY = 15; THE_WATERGARDEN_COLISEUM = 16; FRICTION_AND_FISSURES = 17; THE_CELENNIA_MEMORIAL_LIBRARY = 18; FOR_WHOM_DO_WE_TOIL = 19; AIMING_FOR_YGNAS = 20; CALAMITY_IN_THE_KITCHEN = 21; ARCIELA_S_PROMISE = 22; PREDATOR_AND_PREY = 23; BEHIND_THE_SLUICES = 24; THE_LEAFKIN_MONARCH = 25; YGGDRASIL = 26; -- SHADOWS_UPON_ADOULIN = -- Category RETURN_OF_THE_EXORCIST = 27; THE_MERCILESS_ONE = 28; A_CURSE_FROM_THE_PAST = 29; THE_PURGATION = 30; THE_KEY = 31; THE_PRINCESSS_DILEMMA = 32; DARK_CLOUDS_AHEAD = 33; THE_SMALLEST_OF_FAVORS = 34; SUMMONED_BY_SPIRITS = 35; EVIL_ENTITIES = 36; ADOULIN_CALLING = 37; THE_DISAPPEARANCE_OF_NYLINE = 38; SHARED_CONSCIOUSNESS = 39; CLEAR_SKIES = 40; THE_MAN_IN_BLACK = 41; TO_THE_VICTOR = 42; AN_EXTRAORDINARY_GENTLEMAN = 43; THE_ORDERS_TREASURES = 44; AUGUSTS_HEIRLOOM = 45; BEAUTY_AND_THE_BEAST = 46; WILDCAT_WITH_A_GOLD_PELT = 47; IN_SEARCH_OF_ARCIELA = 48; LOOKING_FOR_LEADS = 49; DRIFTING_NORTHWEST = 50; KUMHAU_THE_FLASHFROST_NAAKUAL = 51; SOUL_SIPHON = 52; STONEWALLED = 53; SALVATION = 54; GLIMMER_OF_PORTENT = 55; -- FIN = 56; ----------------------------------- -- Rhapsodies of Vana Diel (13) ----------------------------------- RHAPSODIES_OF_VANADIEL = 0; RESONACE = 1; function rankPointMath(rank) return 0.372*rank^2 - 1.62*rank + 6.2; end function getMissionRankPoints(player, missionID) if (missionID == 3) then crystals = 9; elseif (missionID == 4) then crystals = 17; elseif (missionID == 5) then crystals = 42; elseif (missionID == 10) then crystals = 12; -- 1 stack needed to unlock elseif (missionID == 11) then crystals = 30; -- 2.5 stacks needed to unlock (2 stacks of crystals + 3.1 rank points corresponding to half a stack) elseif (missionID == 12) then crystals = 48; -- 4 stacks to unlock (3.5 stacks + 3.1 rank points corresponding to half a stack) elseif (missionID == 13) then crystals = 36; -- 3 stacks to unlock -- 5.1 starts directly after Magicite, no crystals needed elseif (missionID == 15) then crystals = 44; -- Mission unlocks at 50% rank bar ~= 44 crystals using the present formula. elseif (missionID == 16) then crystals = 36; -- 3 stacks to unlock elseif (missionID == 17) then crystals = 93; -- 3 additional stacks to unlock + 3 original stacks + 21 from mission 6.1 elseif (missionID == 18) then crystals = 45; -- 45 needed, from http://wiki.ffxiclopedia.org/wiki/The_Final_Image elseif (missionID == 19) then crystals = 119; -- 4 additional stacks needed, plus mission reward of 26 elseif (missionID == 20) then crystals = 57; -- 4 3/4 stacks needed elseif (missionID == 21) then crystals = 148; -- 5 additional stacks needed, plus mission reward of 31, elseif (missionID == 22) then crystals = 96; -- 8 stacks needed (higher value chosen so final rank bar requirement is closer to 90%) elseif (missionID == 23) then crystals = 228; -- Additional 8 stacks needed, plus mission reward of 36 (87% rank bar) end; points_needed = 1024 * (crystals-.25) / (3*rankPointMath(player:getRank())); if (player:getRankPoints() >= points_needed) then return 1; else return 0; end end; function getMissionMask(player) rank = player:getRank() nation = player:getNation(); -- 0 = San d'Oria ; 1 = Bastok ; 2 = Windurst mission_status = player:getCurrentMission(nation); first_mission = 0; repeat_mission = 0; if (nation == WINDURST) then if (rank >= 1) then if (player:hasCompletedMission(WINDURST,THE_HORUTOTO_RUINS_EXPERIMENT) == false) then -- 1-1 NOTE: This mission will not be listed in the Mission List for Windurst --first_mission = first_mission + 1; end if (player:hasCompletedMission(WINDURST,THE_HEART_OF_THE_MATTER) == false) then -- 1-2 NOTE: This mission will not be listed in the Mission List for Windurst --first_mission = first_mission + 2; end if (player:hasCompletedMission(WINDURST,THE_PRICE_OF_PEACE) == false) then -- 1-3 NOTE: This mission will not be listed in the Mission List for Windurst --first_mission = first_mission + 4; end end if (rank >= 2) then -- 2-1 if (player:hasCompletedMission(WINDURST,LOST_FOR_WORDS) == false and getMissionRankPoints(player,3) == 1) then first_mission = first_mission + 8; else if (player:hasCompletedMission(WINDURST,LOST_FOR_WORDS) and (rank > 2 or getMissionRankPoints(player,4) == 1)) then -- 2-2 Repeatable repeat_mission = repeat_mission + 16; end if (player:hasCompletedMission(WINDURST,THE_THREE_KINGDOMS) == false and getMissionRankPoints(player,5) == 1) then -- 2-3 first_mission = first_mission + 32; end end end if (rank >= 3) then -- 3-1 if (player:hasCompletedMission(WINDURST,TO_EACH_HIS_OWN_RIGHT) == false and getMissionRankPoints(player,10) == 1) then first_mission = first_mission + 1024; else if (player:hasCompletedMission(WINDURST,WRITTEN_IN_THE_STARS) == false and getMissionRankPoints(player,11) == 1) then -- 3-2 Repeatable & Skippable repeat_mission = repeat_mission + 2048; elseif (rank > 3 or getMissionRankPoints(player,11) == 1) then -- 3-2 Repeatable & Skippable repeat_mission = repeat_mission + 2048; end if (player:hasCompletedMission(WINDURST,A_NEW_JOURNEY) == false and getMissionRankPoints(player,12) == 1) then -- 3-3 first_mission = first_mission + 4096; end end end if (rank == 4) then -- The mission is triggered by the Ambassador in Jeuno -- first_mission = first_mission + 8192; end if (rank == 5) then if (player:hasCompletedMission(WINDURST,THE_FINAL_SEAL) == false and getMissionRankPoints(player,0) == 1 and mission_status == 0) then first_mission = first_mission + 16384; end if (player:hasCompletedMission(WINDURST,THE_FINAL_SEAL) and player:hasCompletedMission(WINDURST,THE_SHADOW_AWAITS) == false and getMissionRankPoints(player,15) == 1) then -- 5-2 first_mission = first_mission + 32768; end end if (rank == 6) then if (player:hasCompletedMission(WINDURST,FULL_MOON_FOUNTAIN) == false and getMissionRankPoints(player,16) == 1) then -- 6-1 first_mission = first_mission + 65536; elseif (player:hasCompletedMission(WINDURST,SAINTLY_INVITATION) == false and getMissionRankPoints(player,17) == 1) then -- 6-2 first_mission = first_mission + 131072; end end if (rank == 7) then if (player:hasCompletedMission(WINDURST,THE_SIXTH_MINISTRY) == false and getMissionRankPoints(player,18) == 1) then -- 7-1 first_mission = first_mission + 262144; elseif (player:hasCompletedMission(WINDURST,AWAKENING_OF_THE_GODS) == false and getMissionRankPoints(player,19) == 1) then -- 7-2 first_mission = first_mission + 524288; end end if (rank == 8) then if (player:hasCompletedMission(WINDURST,VAIN) == false and getMissionRankPoints(player,20) == 1) then -- 8-1 first_mission = first_mission + 1048576; elseif (player:hasCompletedMission(WINDURST,THE_JESTER_WHO_D_BE_KING) == false and getMissionRankPoints(player,21) == 1) then -- 8-2 first_mission = first_mission + 2097152; end end if (rank == 9) then if (player:hasCompletedMission(WINDURST,DOLL_OF_THE_DEAD) == false and getMissionRankPoints(player,22) == 1) then -- 9-1 first_mission = first_mission + 4194304; elseif (player:hasCompletedMission(WINDURST,MOON_READING) == false and getMissionRankPoints(player,23) == 1) then -- 9-2 first_mission = first_mission + 8388608; end end elseif (nation == SANDORIA) then if (rank >= 1) then if (player:hasCompletedMission(SANDORIA,SMASH_THE_ORCISH_SCOUTS) == false) then -- The first mission is repeatable in San d'Oria -- 1-1 repeat_mission = repeat_mission + 1; elseif (player:hasCompletedMission(SANDORIA,BAT_HUNT) == false) then -- 1-2 If we completed 1-1, we can start and repeat this mission repeat_mission = repeat_mission + 2 + 1; elseif (player:hasCompletedMission(SANDORIA,SAVE_THE_CHILDREN) == false) then -- 1-3 If we completed 1-2, we can start and repeat this mission repeat_mission = repeat_mission + 4 + 2 + 1; else repeat_mission = repeat_mission + 4 + 2 + 1; end end if (rank >= 2) then -- 2-1 if (player:hasCompletedMission(SANDORIA,THE_RESCUE_DRILL) == false and getMissionRankPoints(player,3) == 1) then first_mission = first_mission + 8; else if (rank > 2 or getMissionRankPoints(player,4) == 1) then -- 2-2 Repeatable & Skippable repeat_mission = repeat_mission + 16; end if (player:hasCompletedMission(SANDORIA,JOURNEY_ABROAD) == false and getMissionRankPoints(player,5) == 1) then -- 2-3 first_mission = first_mission + 32; end end end if (rank >= 3) then if (rank > 3 or getMissionRankPoints(player,10) == 1) then -- 3-1 repeat_mission = repeat_mission + 1024; end if (player:hasCompletedMission(SANDORIA,INFILTRATE_DAVOI) == true and getMissionRankPoints(player,11) == 1) then -- 3-2 Repeatable & Skippable repeat_mission = repeat_mission + 2048; end if (player:hasCompletedMission(SANDORIA,APPOINTMENT_TO_JEUNO) == false and getMissionRankPoints(player,12) == 1) then -- 3-3 first_mission = first_mission + 4096; end end if (rank == 4) then -- The mission is triggered by the Ambassador in Jeuno -- first_mission = first_mission + 8192; end if (rank == 5) then if (player:hasCompletedMission(SANDORIA,THE_RUINS_OF_FEI_YIN) == false and player:hasKeyItem(69) == false) then first_mission = first_mission + 16384; end if (player:hasCompletedMission(SANDORIA,THE_SHADOW_LORD) == false and player:hasCompletedMission(SANDORIA,THE_RUINS_OF_FEI_YIN) and getMissionRankPoints(player,15) == 1) then -- 5-2 first_mission = first_mission + 32768; end end if (rank == 6) then if (player:hasCompletedMission(SANDORIA,LEAUTE_S_LAST_WISHES) == false and getMissionRankPoints(player,16) == 1) then -- 6-1 first_mission = first_mission + 65536; elseif (player:hasCompletedMission(SANDORIA,RANPERRE_S_FINAL_REST) == false and getMissionRankPoints(player,17) == 1) then -- 6-2 first_mission = first_mission + 131072; end end if (rank == 7) then if (player:hasCompletedMission(SANDORIA,PRESTIGE_OF_THE_PAPSQUE) == false and getMissionRankPoints(player,18) == 1) then -- 7-1 first_mission = first_mission + 262144; elseif (player:hasCompletedMission(SANDORIA,THE_SECRET_WEAPON) == false and getMissionRankPoints(player,19) == 1) then -- 7-2 first_mission = first_mission + 524288; end end if (rank == 8) then if (player:hasCompletedMission(SANDORIA,COMING_OF_AGE) == false and getMissionRankPoints(player,20) == 1) then -- 8-1 first_mission = first_mission + 1048576; elseif (player:hasCompletedMission(SANDORIA,LIGHTBRINGER) == false and getMissionRankPoints(player,21) == 1 and player:getVar("Mission8-1Completed") == 1) then -- 8-2 first_mission = first_mission + 2097152; end end if (rank == 9) then if (player:hasCompletedMission(SANDORIA,BREAKING_BARRIERS) == false and getMissionRankPoints(player,22) == 1) then -- 9-1 first_mission = first_mission + 4194304; elseif (player:hasCompletedMission(SANDORIA,BREAKING_BARRIERS) == false and getMissionRankPoints(player,22) == 1 and player:getVar("Cutscenes_8-2") == 2) then -- 9-2 first_mission = first_mission + 8388608; elseif (player:hasCompletedMission(SANDORIA,THE_HEIR_TO_THE_LIGHT) == false and getMissionRankPoints(player,23) == 1) then -- 9-2 first_mission = first_mission + 8388608; end end elseif (nation == BASTOK) then if (rank >= 1) then if (player:hasCompletedMission(BASTOK,THE_ZERUHN_REPORT) == false) then -- 1-1 NOTE: This mission will not be listed in the Mission List for Bastok --first_mission = first_mission + 1; end if (player:hasCompletedMission(BASTOK,GEOLOGICAL_SURVEY) == false) then -- 1-2 NOTE: This mission will not be listed in the Mission List for Bastok first_mission = first_mission + 2; end if (player:hasCompletedMission(BASTOK,GEOLOGICAL_SURVEY) == true) then -- 1-3 repeat_mission = repeat_mission + 4; end end if (rank >= 2) then -- 2-1 if (player:hasCompletedMission(BASTOK,THE_CRYSTAL_LINE) == false and getMissionRankPoints(player,3) == 1) then first_mission = first_mission + 8; else if (rank > 2 or getMissionRankPoints(player,4) == 1) then -- 2-2 Repeatable repeat_mission = repeat_mission + 16; end if (player:hasCompletedMission(BASTOK,THE_EMISSARY) == false and getMissionRankPoints(player,5) == 1) then -- 2-3 first_mission = first_mission + 32; end end end if (rank >= 3) then -- 3-1 if (player:hasCompletedMission(BASTOK,THE_FOUR_MUSKETEERS) == false and getMissionRankPoints(player,10) == 1) then first_mission = first_mission + 1024; else if (rank > 3 or getMissionRankPoints(player,11) == 1) then -- 3-2 Repeatable & Skippable repeat_mission = repeat_mission + 2048; end if (player:hasCompletedMission(BASTOK,JEUNO_MISSION) == false and getMissionRankPoints(player,12) == 1) then -- 3-3 first_mission = first_mission + 4096; end end end if (rank == 4) then -- The mission is triggered by the Ambassador in Jeuno -- first_mission = first_mission + 8192; end if (rank == 5) then if (player:hasCompletedMission(BASTOK,DARKNESS_RISING) == false and getMissionRankPoints(player,0) == 1 and mission_status == 0) then first_mission = first_mission + 16384; end if (player:hasCompletedMission(BASTOK,DARKNESS_RISING) and player:hasCompletedMission(BASTOK,XARCABARD_LAND_OF_TRUTHS) == false and getMissionRankPoints(player,15) == 1) then -- 5-2 first_mission = first_mission + 32768; end end if (rank == 6) then if (player:hasCompletedMission(BASTOK,RETURN_OF_THE_TALEKEEPER) == false and getMissionRankPoints(player,16) == 1) then -- 6-1 first_mission = first_mission + 65536; elseif (player:hasCompletedMission(BASTOK,THE_PIRATE_S_COVE) == false and getMissionRankPoints(player,17) == 1) then -- 6-2 first_mission = first_mission + 131072; end end if (rank == 7) then if (player:hasCompletedMission(BASTOK,THE_FINAL_IMAGE) == false and getMissionRankPoints(player,18) == 1) then -- 7-1 first_mission = first_mission + 262144; elseif (player:hasCompletedMission(BASTOK,ON_MY_WAY) == false and getMissionRankPoints(player,19) == 1) then -- 7-2 first_mission = first_mission + 524288; end end if (rank == 8) then if (player:hasCompletedMission(BASTOK,THE_CHAINS_THAT_BIND_US) == false and getMissionRankPoints(player,20) == 1) then -- 8-1 first_mission = first_mission + 1048576; elseif (player:hasCompletedMission(BASTOK,ENTER_THE_TALEKEEPER) == false and getMissionRankPoints(player,21) == 1) then -- 8-2 first_mission = first_mission + 2097152; end end if (rank == 9) then if (player:hasCompletedMission(BASTOK,THE_SALT_OF_THE_EARTH) == false and getMissionRankPoints(player,22) == 1) then -- 9-1 first_mission = first_mission + 4194304; elseif (player:hasCompletedMission(BASTOK,WHERE_TWO_PATHS_CONVERGE) == false and getMissionRankPoints(player,23) == 1) then -- 9-2 first_mission = first_mission + 8388608; end end end if (player:getCurrentMission(nation) == THE_RUINS_OF_FEI_YIN and player:getVar("MissionStatus") == 8) then mission_mask = 2147483647 - 16384; else mission_mask = 2147483647 - repeat_mission - first_mission; -- 2^31 -1 - .. end return mission_mask,repeat_mission; end; function getMissionOffset(player,guard,pMission,MissionStatus) offset = 0; cs = 0; params = {0,0,0,0,0,0,0,0}; nation = player:getNation(); if (nation == SANDORIA) then if (guard == 1) then GuardCS = {0x03fe,0x03fd,0x0401,0x03ec,0x0400,0x03ed,0x03ee,0x0404,0x0405,0x03f4,0x0407}; elseif (guard == 2) then GuardCS = {0x07e6,0x07e5,0x07e9,0x07d4,0x07e8,0x07d5,0x07d6,0x07ec,0x07ed,0x07dc,0x07ef}; end switch (pMission) : caseof { [0] = function (x) offset = 0; end, -- Mission 1-1 [1] = function (x) if (MissionStatus == 2) then cs = GuardCS[1]; else cs = GuardCS[2]; end end, -- Mission 1-2 (1) after check tombstone [2] = function (x) if (MissionStatus == 0) then cs = GuardCS[3]; -- Mission 1-3 before Battlefield elseif (MissionStatus == 4 and player:hasCompletedMission(0,2) == false) then cs = GuardCS[4]; -- Mission 1-3 after Battlefield elseif (MissionStatus == 4) then cs = GuardCS[5]; else offset = 24; end end, -- Mission 1-3 after Battlefield (Finish Quest) [3] = function (x) if (MissionStatus == 11) then cs = GuardCS[6]; else offset = 36; end end, [4] = function (x) if (MissionStatus == 3 and player:hasCompletedMission(0,4)) then cs = GuardCS[7]; elseif (MissionStatus == 3) then cs = GuardCS[8]; params = {0,0,0,44}; else offset = 44; end end, [5] = function (x) if (MissionStatus == 0) then offset = 50; else offset = 51; end end, [10] = function (x) if (MissionStatus == 0) then cs = GuardCS[9]; elseif (MissionStatus == 4) then offset = 55; elseif (MissionStatus == 5) then offset = 60; elseif (MissionStatus == 10) then cs = GuardCS[10]; end end, [11] = function (x) if (MissionStatus == 0) then offset = 68; elseif (MissionStatus == 2) then cs = GuardCS[11]; end end, [12] = function (x) if (MissionStatus == 0) then offset = 74; end end, [14] = function (x) if (MissionStatus == 0) then cs = 0x003D; end end, } return cs, params, offset; elseif (nation == BASTOK) then switch (pMission) : caseof { [0] = function (x) offset = 0; end, [1] = function (x) offset = 3; end, [2] = function (x) offset = 6; end, [3] = function (x) offset = 19; end, [4] = function (x) offset = 21; end, [5] = function (x) offset = 23; end, [10] = function (x) offset = 27; end, [11] = function (x) offset = 30; end, [12] = function (x) offset = 35; end, [14] = function (x) cs = 0x03EF; end, [15] = function (x) offset = 39; end, [16] = function (x) offset = 0; end, [17] = function (x) offset = 3; end, [18] = function (x) offset = 5; end, [19] = function (x) offset = 7; end, [20] = function (x) offset = 10; end, [21] = function (x) offset = 12; end, [22] = function (x) offset = 14; end, [23] = function (x) offset = 19; end, } return cs, params, offset; elseif (nation == WINDURST) then if (guard == 1) then GuardCS = {0x007F,0x0088,0x0096,0x009A,0x00A0,0x01D9,0x00b1}; elseif (guard == 2) then GuardCS = {0x007b,0x0083,0x0136,0x0094,0x009c,0x00b1,0x00d7}; elseif (guard == 3) then GuardCS = {0x0059,0x0069,0x006e,0x0072,0x0078,0x0085,0x008a}; elseif (guard == 4) then GuardCS = {0x0063,0x006b,0x0070,0x0074,0x007a,0x007f,0x0086}; end switch (pMission) : caseof { [0] = function (x) cs = GuardCS[1]; end, [1] = function (x) cs = GuardCS[2]; end, [2] = function (x) if (MissionStatus <= 2) then cs = GuardCS[3]; else cs = GuardCS[4]; end end, [3] = function (x) cs = GuardCS[5]; end, [4] = function (x) cs = GuardCS[6]; end, [5] = function (x) cs = GuardCS[7]; end, } return cs, params, offset; end end; function finishMissionTimeline(player,guard,csid,option) nation = player:getNation(); -- To prevent the cs conflict, use the 1st and 2nd for guard and 3/4 for npc -- missionid, {Guard1CS,option}, {Guard2CS,option}, {NPC1 CS,option}, {NPC2 CS,option}, {{function,value},...}, -- 1: player:addMission(nation,mission); -- 2: player:messageSpecial(YOU_ACCEPT_THE_MISSION); -- 3: player:setVar(variablename,value); -- 4: player:tradeComplete(); -- 5: player:addRankPoints(number); -- 6: player:setRankPoints(0); -- 7: player:addPoint(player:getNation(),number); player:messageSpecial(YOUVE_EARNED_CONQUEST_POINTS); -- 8: player:addGil(GIL_RATE*number); player:messageSpecial(GIL_OBTAINED,GIL_RATE*number); -- 9: player:delKeyItem(number); -- 10: player:addKeyItem(number); player:messageSpecial(KEYITEM_OBTAINED,number); -- 11: player:setRank(number); -- 12: player:completeMission(nation,mission); -- 13: player:addTitle(number); -- 14: player:setVar("MissionStatus",value); if (nation == SANDORIA) then if ((csid == 0x03f1 or csid == 0x07d9) and option ~= 1073741824 and option ~= 31) then if (option > 100) then badoption = {101,1,102,2,104,4,110,10,111,11}; for op = 1, table.getn(badoption), 2 do if (option == badoption[op]) then timeline = {badoption[op+1],{0x03f1,badoption[op]},{0x07d9,badoption[op]},{0,0},{0,0},{{1},{2}}}; end end elseif (option == 14) then timeline = {option,{0x03f1,option},{0x07d9,option},{0,0},{0,0},{{1},{2},{3,"MissionStatus",9}}}; else timeline = {option,{0x03f1,option},{0x07d9,option},{0,0},{0,0},{{1},{2}}}; end else timeline = { -- MissionID,{Guard#1 DialogID, option},{Guard#2 DialogID, option},{NPC#1 DialogID, option},{NPC#2 DialogID, option},{function list} 0,{0x03e8,0},{0x07d0,0},{0,0}, {0,0},{{1},{2}}, -- MISSION 1-1 (First Mission [START]) 0,{0x03fc,0},{0x07e4,0},{0,0}, {0,0},{{4},{5,150},{12},{14,0}}, -- MISSION 1-1 0,{0x03ea,0},{0x07d2,0},{0,0}, {0,0},{{4},{5,150},{12}}, -- MISSION 1-1 [Repeat] 1,{0x03ff,0},{0x07e7,0},{0,0}, {0,0},{{4},{14,0},{5,200},{12}}, -- MISSION 1-2 1,{0x03eb,0},{0x07d3,0},{0,0}, {0,0},{{4},{14,0},{5,200},{12}}, -- MISSION 1-2 [Repeat] 2,{0x03ec,0},{0x07d4,0},{0,0}, {0,0},{{11,2},{3,"OptionalCSforSTC",1},{14,0},{6},{8,1000},{12}}, -- MISSION 1-3 2,{0x0400,0},{0x07e8,0},{0,0}, {0,0},{{14,0},{5,250},{12}}, -- MISSION 1-3 [Repeat] 3,{0x03ed,0},{0x07d5,0},{0,0}, {0,0},{{9,65},{14,0},{5,300},{12}}, -- MISSION 2-1 4,{0,0}, {0,0}, {0x02b7,0},{0,0},{{9,44},{14,0},{5,350},{12}}, -- MISSION 2-2 (Papal Chambers) 5,{0,0}, {0,0}, {0x01fb,0},{0,0},{{10,35},{6},{13,207},{8,3000},{11,3},{9,29},{14,0},{12}}, -- MISSION 2-3 (Halver) 10,{0,0}, {0,0}, {0x022a,0},{0,0},{{9,237},{14,0},{5,400},{12}}, -- MISSION 3-1 (Prince Trion (door)) 10,{0x03f4,0},{0x07dc,0},{0,0}, {0,0},{{14,0},{5,300},{12}}, -- MISSION 3-1 (Guard)[Repeat] 11,{0x0406,0},{0x07ee,0},{0,0}, {0,0},{{4},{14,2}}, -- MISSION 3-2 (dialog with the guard after trade) 11,{0,0}, {0,0}, {0x022c,0},{0,0},{{14,0},{5,400},{12}}, -- MISSION 3-2 (Chalvatot) 11,{0x03f5,0},{0x07dd,0},{0,0}, {0,0},{{4},{14,0},{5,400},{12}}, -- MISSION 3-2 (Guard)[Repeat] 12,{0,0}, {0,0}, {0x0027,0},{0,0},{{11,4},{14,0},{6},{8,5000},{12}}, -- MISSION 3-3 (Finish (Nelcabrit)) 13,{0,0}, {0,0}, {0x0024,0},{0,0},{{11,5},{14,0},{13,212},{10,69},{6},{8,10000},{12},{1,14}}, -- MISSION 4-1 (Finish (Nelcabrit)) 14,{0,0}, {0,0}, {0x0215,0},{0,0},{{10,72},{14,10}}, -- MISSION 5-1 (Finish (Halver)) 14,{0,0}, {0,0}, {0x0216,0},{0,0},{{9,73},{5,400},{14,0},{13,10},{12}}, -- MISSION 5-1 (Finish (Halver)) 15,{0,0}, {0,0}, {0x0224,0},{0,0},{{11,6},{14,5}}, -- MISSION 5-2 (Finish 1st Part (Halver)) 15,{0,0}, {0,0}, {0x003D,0},{0,0},{{14,0},{9,74},{8,20000},{6},{12}}, -- MISSION 5-2 (Finish 2nd Part (Trion in Great Hall)) 16,{0,0}, {0,0}, {0x006f,0},{0,0},{{14,0},{9,268},{10,270},{12}}, -- MISSION 6-1 (Finish (Chalvatot)) 17,{0x040a,0},{0x0409,0},{0,0},{0,0},{{14,0},{11,7},{8,40000},{6},{12}}, -- MISSION 6-2 (Finish (Guard)) 18,{0,0}, {0,0}, {0x0007,0},{0,0},{{14,1}}, -- MISSION 7-1 (setVar("MissionStatus",1) (Door: Papal Chambers)) 18,{0,0}, {0,0}, {0x0008,0},{0,0},{{14,0},{9,283},{5,1000},{12}}, -- MISSION 7-1 (Finish (Door: Papal Chambers)) 19,{0x0414,0},{0x0413,0},{0,0},{0,0},{{14,0},{6},{3,"SecretWeaponStatus",0},{9,284},{11,8},{8,60000},{12}}, -- MISSION 7-2 (Finish) 20,{0,0}, {0,0}, {0x0066,0},{0,0},{{14,0},{9,288},{5,800},{12}}, -- MISSION 8-1 (Finish) 21,{0,0}, {0,0}, {0x0068,0},{0,0},{{14,0},{9,284},{11,9},{8,80000},{6},{12}}, -- MISSION 8-2 (Finish (Door: Great Hall)) 22,{0,0}, {0,0}, {0x004c,0},{0,0},{{14,0},{9,481},{9,482},{9,483},{5,900},{12}} -- MISSION 9-1 (Finish (Door: Great Hall)) --[[0,{0,0},{0,0},{0,0},{0,0},{0},{0,0},{0,0},{0,0},{0,0},{0}, 0,{0,0},{0,0},{0,0},{0,0},{0},{0,0},{0,0},{0,0},{0,0},{0}, ]]-- }; end elseif (nation == BASTOK) then if (csid == 0x03E9 and option ~= 1073741824 and option ~= 31) then timeline = {option,{0x03E9,option},{0,0},{0,0},{0,0},{{1},{2}}}; else timeline = { 0,{0x03e8,0},{0,0},{0,0},{0,0},{{1},{2}}, -- MISSION 1-1 (First Mission [START]) 1,{0x01f8,0},{0,0},{0,0},{0,0},{{9,4},{12}}, -- MISSION 1-2 (Finish Mission) 2,{0x03F0,0},{0,0},{0,0},{0,0},{{4},{11,2},{8,1000},{12}}, -- MISSION 1-3 2,{0x03ED,0},{0,0},{0,0},{0,0},{{4},{8,1000},{12}}, -- MISSION 1-3 [Repeat] 3,{0x02c8,0},{0,0},{0,0},{0,0},{{9,12},{14,0},{5,200},{12}}, -- MISSION 2-1 (Finish (Ayame)) 4,{0x0174,0},{0,0},{0,0},{0,0},{{4},{5,250},{12}}, -- MISSION 2-2 (Finish (Alois)) 4,{0x0175,0},{0,0},{0,0},{0,0},{{4},{5,250},{12}}, -- MISSION 2-2 (Finish (Alois)) [Repeat] 5,{0x02ca,0},{0,0},{0,0},{0,0},{{10,35},{6},{13,207},{8,3000},{11,3},{9,29},{14,0},{12}}, -- MISSION 2-3 (Finish (Naji)) 10,{0x000b,0},{0,0},{0,0},{0,0},{{14,0},{5,350},{12}}, -- MISSION 3-1 (Pashhow Marshlands Zone) 11,{0x03F2,0},{0,0},{0,0},{0,0},{{4},{5,400},{12}}, -- MISSION 3-2 11,{0x03EE,0},{0,0},{0,0},{0,0},{{4},{5,400},{12}}, -- MISSION 3-2 [Repeat] 12,{0x0026,0},{0,0},{0,0},{0,0},{{11,4},{14,0},{6},{8,5000},{12}}, -- MISSION 3-3 (Finish (Goggehn)) 13,{0x0023,0},{0,0},{0,0},{0,0},{{11,5},{14,0},{13,212},{10,70},{6},{8,10000},{12},{1,14}}, -- MISSION 4-1 (Finish (Goggehn)) 14,{0x02d2,0},{0,0},{0,0},{0,0},{{14,0},{9,73},{5,600},{12}}, -- MISSION 5-1 (Finish (Naji)) 15,{0x025b,0},{0,0},{0,0},{0,0},{{11,6},{14,0},{9,74},{8,20000},{6},{12}}, -- MISSION 5-2 (Finish (Karst)) 16,{0x00b6,0},{0,0},{0,0},{0,0},{{14,0},{9,266},{5,650},{12}}, -- MISSION 6-1 (Finish (Tall Mountain)) 17,{0x02fa,0},{0,0},{0,0},{0,0},{{14,0},{6},{11,7},{8,40000},{12}}, -- MISSION 6-2 (Finish (Naji)) 18,{0x02fc,0},{0,0},{0,0},{0,0},{{14,0},{9,289},{5,700},{12}}, -- MISSION 7-1 (Finish (Cid)) 19,{0x02fe,0},{0,0},{0,0},{0,0},{{14,0},{6},{11,8},{8,60000},{3,"OptionalCSforOMW",1},{12}}, -- MISSION 7-2 (Finish (Karst)) 20,{0x0300,0},{0,0},{0,0},{0,0},{{14,0},{5,1133},{12}}, -- MISSION 8-1 (Finish (Iron Eater)) 21,{0x00b0,0},{0,0},{0,0},{0,0},{{14,0},{6},{11,9},{9,293},{8,80000},{12}}, -- MISSION 8-2 (Finish (Bastok Mines)) }; end elseif (nation == WINDURST) then guardlist = {0x0072,0x006f,0x004e,0x005d}; if (csid == guardlist[guard] and option ~= 1073741824 and option ~= 31) then timeline = {option,{guardlist[guard],option},{guardlist[guard],option},{guardlist[guard],option},{guardlist[guard],option},{{1},{2}}}; else timeline = { 0,{0x0079,1},{0x0076,1},{0x0053,1},{0x0060,1},{{1},{2}}, -- MISSION 1-1 (First Mission [START]) 0,{0x005e,0},{0,0}, {0,0}, {0,0}, {{14,0},{5,150},{9,28},{12}}, -- MISSION 1-1 (Finish (Hakkuru-Rinkuru)) 1,{0x0084,1},{0x0082,1},{0x0068,1},{0x006a,1},{{1},{2}}, -- MISSION 1-2 [START] 1,{0x008f,0},{0,0}, {0,0}, {0,0}, {{14,0},{5,200},{12}}, -- MISSION 1-2 (Finish (Apururu)) [WITHOUT ORB] 1,{0x0091,0},{0,0}, {0,0}, {0,0}, {{14,0},{5,250},{12}}, -- MISSION 1-2 (Finish (Apururu)) [WITH ORB] 2,{0x0095,2},{0x0083,2},{0x006d,2},{0x006f,2},{{1},{2}}, -- MISSION 1-3 [START] 2,{0x009A,0},{0x0094,0},{0x0072,0},{0x0074,0},{{11,2},{14,0},{5,300},{8,1000},{12}}, -- MISSION 1-3 3,{0x00a8,0},{0,0}, {0,0}, {0,0}, {{14,0},{5,350},{12}}, -- MISSION 2-1 (Finish (Tosuka-Porika)) 4,{0x00C9,0},{0,0}, {0,0}, {0,0}, {{14,0},{9,38},{5,400},{12}}, -- MISSION 2-2 (Finish (Moreno-Toeno)) (+35 mob killed) 4,{0x00CE,0},{0,0}, {0,0}, {0,0}, {{14,0},{9,38},{5,400},{12}}, -- MISSION 2-2 (Finish (Moreno-Toeno)) (+35 mob killed) [Repeat] 4,{0x00C8,0},{0,0}, {0,0}, {0,0}, {{14,0},{9,38},{5,250},{12}}, -- MISSION 2-2 (Finish (Moreno-Toeno)) (30-34 mob killed) 4,{0x00D1,0},{0,0}, {0,0}, {0,0}, {{14,0},{9,38},{5,250},{12}}, -- MISSION 2-2 (Finish (Moreno-Toeno)) (30-34 mob killed) [Repeat] 5,{0x0065,0},{0,0}, {0,0}, {0,0}, {{10,35},{6},{13,207},{8,3000},{11,3},{9,29},{14,0},{12}},-- MISSION 2-3 (Finish (Kupipi)) 10,{0,0}, {0x0072,0},{0,0}, {0,0}, {{5,450},{14,0},{12}}, -- MISSION 3-1 (Finish (Rhy Epocan)) 11,{0x0087,0},{0,0}, {0,0}, {0,0}, {{5,500},{14,0},{12}}, -- MISSION 3-2 (Finish (Zubaba)) 11,{0x0097,0},{0,0}, {0,0}, {0,0}, {{5,400},{14,0},{12}}, -- MISSION 3-2 (Finish (Zubaba)) [Repeat] 12,{0x0028,0},{0,0}, {0,0}, {0,0}, {{11,4},{9,30},{14,0},{6},{8,5000},{12}}, -- MISSION 3-3 (Finish (Ambassador's door)) 13,{0x0025,0},{0,0}, {0,0}, {0,0}, {{11,5},{14,0},{13,212},{10,71},{6},{8,10000},{12}}, -- MISSION 4-1 (Finish (Pakh Jatalfih)) 14,{0x00C0,0},{0,0}, {0,0}, {0,0}, {{14,0},{9,73},{5,600},{12}}, -- MISSION 5-1 (Finish (Star Sibyl)) 15,{0x00D8,0},{0,0}, {0,0}, {0,0}, {{11,6},{14,0},{9,74},{8,20000},{6},{12}}, -- MISSION 5-2 (Finish (Star Sibyl)) 16,{0,0}, {0,0}, {0x0032,0},{0,0}, {{14,0},{5,650},{0,0},{0,0},{0,0},{12}}, -- MISSION 6-1 (Finish (Zone: Full Moon Fountain)) 17,{0,0}, {0,0}, {0x0138,0},{0,0}, {{14,0},{11,7},{8,40000},{6},{0,0},{12}}, -- MISSION 6-2 (Finish (Star Sibyl)) 18,{0,0}, {0,0}, {0x02d4,0},{0,0}, {{14,0},{5,700},{10,251},{0,0},{0,0},{12}}, -- MISSION 7-1 (Finish (Tosuka-Porika)) 19,{0,0}, {0,0}, {0x02E6,0},{0,0}, {{14,0},{11,8},{8,60000},{6},{0,0},{12}}, -- MISSION 7-2 (Finish (Leepe-Hoppe)) 20,{0,0}, {0,0}, {0x02F6,0},{0,0}, {{14,0},{5,750},{0,0},{0},{0,0},{12}}, -- MISSION 8-1 (Finish (Morno-Toeno)) 21,{0,0}, {0,0}, {0x0261,0},{0,0}, {{14,0},{11,9},{8,80000},{6},{0,0},{12}}, -- MISSION 8-2 (Finish (Apururu)) 22,{0,0}, {0,0}, {0x003D,0},{0,0}, {{14,0},{5,800},{13,293},{0},{0,0},{12}}, -- MISSION 9-1 (Finish (Zone: Full Moon Fountain)) 23,{0,0}, {0,0}, {0x0197,0},{0,0}, {{13,294},{11,10},{8,100000},{6},{0,0},{12}} -- MISSION 9-2 (Finish (Vestal Chamber)) }; end end for cs = 1, table.getn(timeline), 6 do if (csid == timeline[cs + guard][1] and option == timeline[cs + guard][2]) then for nb = 1, table.getn(timeline[cs + 5]), 1 do messList = timeline[cs + 5][nb]; switch (messList[1]) : caseof { [1] = function (x) if (messList[2] ~= nil) then player:addMission(nation,messList[2]); else player:addMission(nation,timeline[cs]); end end, [2] = function (x) player:messageSpecial(YOU_ACCEPT_THE_MISSION); end, [3] = function (x) player:setVar(messList[2],messList[3]); end, [4] = function (x) player:tradeComplete(); end, [5] = function (x) if ((player:getRankPoints() + messList[2]) > 4000) then player:setRankPoints(4000); else player:addRankPoints(messList[2]); end end, [6] = function (x) player:setRankPoints(0); end, [7] = function (x) player:addCP(messList[2]); player:messageSpecial(YOUVE_EARNED_CONQUEST_POINTS); end, [8] = function (x) player:addGil(GIL_RATE*messList[2]); player:messageSpecial(GIL_OBTAINED,GIL_RATE*messList[2]); end, [9] = function (x) player:delKeyItem(messList[2]); end, [10] = function (x) player:addKeyItem(messList[2]); player:messageSpecial(KEYITEM_OBTAINED,messList[2]); end, [11] = function (x) player:setRank(messList[2]); end, [12] = function (x) player:completeMission(nation,timeline[cs]); end, [13] = function (x) player:addTitle(messList[2]); end, [14] = function (x) player:setVar("MissionStatus",messList[2]); end, } end end end end;
gpl-3.0
AdamGagorik/darkstar
scripts/globals/spells/bluemagic/self-destruct.lua
32
1265
----------------------------------------- -- Spell: Self-Destruct -- Sacrifices HP to damage enemies within range. Affects caster with Weakness -- Spell cost: 100 MP -- Monster Type: Arcana -- Spell Type: Magical (Fire) -- Blue Magic Points: 3 -- Stat Bonus: STR+2 -- Level: 50 -- Casting Time: 3.25 seconds -- Recast Time: 21 seconds -- Magic Bursts on: Liquefaction, Fusion, and Light -- Combos: Auto Refresh ----------------------------------------- require("scripts/globals/settings"); require("scripts/globals/magic"); require("scripts/globals/status"); require("scripts/globals/bluemagic"); ----------------------------------------- -- OnMagicCastingCheck ----------------------------------------- function onMagicCastingCheck(caster,target,spell) return 0; end; ----------------------------------------- -- OnSpellCast ----------------------------------------- function onSpellCast(caster,target,spell) local duration = 300; local playerHP = caster:getHP(); local damage = caster:getHP() -1; if (damage > 0) then target:delHP(playerHP); caster:setHP(1); caster:delStatusEffect(EFFECT_WEAKNESS); caster:addStatusEffect(EFFECT_WEAKNESS,1,0,duration); end return damage; end;
gpl-3.0
tahashakiba/xx
plugins/anti-bot.lua
369
3064
local function isBotAllowed (userId, chatId) local hash = 'anti-bot:allowed:'..chatId..':'..userId local banned = redis:get(hash) return banned end local function allowBot (userId, chatId) local hash = 'anti-bot:allowed:'..chatId..':'..userId redis:set(hash, true) end local function disallowBot (userId, chatId) local hash = 'anti-bot:allowed:'..chatId..':'..userId redis:del(hash) end -- Is anti-bot enabled on chat local function isAntiBotEnabled (chatId) local hash = 'anti-bot:enabled:'..chatId local enabled = redis:get(hash) return enabled end local function enableAntiBot (chatId) local hash = 'anti-bot:enabled:'..chatId redis:set(hash, true) end local function disableAntiBot (chatId) local hash = 'anti-bot:enabled:'..chatId redis:del(hash) end local function isABot (user) -- Flag its a bot 0001000000000000 local binFlagIsBot = 4096 local result = bit32.band(user.flags, binFlagIsBot) return result == binFlagIsBot end local function kickUser(userId, chatId) local chat = 'chat#id'..chatId local user = 'user#id'..userId chat_del_user(chat, user, function (data, success, result) if success ~= 1 then print('I can\'t kick '..data.user..' but should be kicked') end end, {chat=chat, user=user}) end local function run (msg, matches) -- We wont return text if is a service msg if matches[1] ~= 'chat_add_user' and matches[1] ~= 'chat_add_user_link' then if msg.to.type ~= 'chat' then return 'Anti-flood works only on channels' end end local chatId = msg.to.id if matches[1] == 'enable' then enableAntiBot(chatId) return 'Anti-bot enabled on this chat' end if matches[1] == 'disable' then disableAntiBot(chatId) return 'Anti-bot disabled on this chat' end if matches[1] == 'allow' then local userId = matches[2] allowBot(userId, chatId) return 'Bot '..userId..' allowed' end if matches[1] == 'disallow' then local userId = matches[2] disallowBot(userId, chatId) return 'Bot '..userId..' disallowed' end if matches[1] == 'chat_add_user' or matches[1] == 'chat_add_user_link' then local user = msg.action.user or msg.from if isABot(user) then print('It\'s a bot!') if isAntiBotEnabled(chatId) then print('Anti bot is enabled') local userId = user.id if not isBotAllowed(userId, chatId) then kickUser(userId, chatId) else print('This bot is allowed') end end end end end return { description = 'When bot enters group kick it.', usage = { '!antibot enable: Enable Anti-bot on current chat', '!antibot disable: Disable Anti-bot on current chat', '!antibot allow <botId>: Allow <botId> on this chat', '!antibot disallow <botId>: Disallow <botId> on this chat' }, patterns = { '^!antibot (allow) (%d+)$', '^!antibot (disallow) (%d+)$', '^!antibot (enable)$', '^!antibot (disable)$', '^!!tgservice (chat_add_user)$', '^!!tgservice (chat_add_user_link)$' }, run = run }
gpl-2.0
AdamGagorik/darkstar
scripts/zones/Southern_San_dOria_[S]/npcs/Leonoyne1.lua
19
1032
----------------------------------- -- Area: Southern SandOria [S] -- NPC: Leonyone -- @zone 80 -- @pos -192 -1 42 ----------------------------------- package.loaded["scripts/zones/Southern_San_dOria_[S]/TextIDs"] = nil; require("scripts/zones/Southern_San_dOria_[S]/TextIDs"); ----------------------------------- -- onTrade Action ----------------------------------- function onTrade(player,npc,trade) end; ----------------------------------- -- onTrigger Action ----------------------------------- function onTrigger(player,npc) player:showText(npc, 13454); -- (Couldn't find default dialogue) How very good to see you again! end; ----------------------------------- -- onEventUpdate ----------------------------------- function onEventUpdate(player,csid,option) --printf("CSID: %u",csid); --printf("RESULT: %u",option); end; ----------------------------------- -- onEventFinish ----------------------------------- function onEventFinish(player,csid,option) --printf("CSID: %u",csid); --printf("RESULT: %u",option); end;
gpl-3.0
kidaa/torch7
test/test_qr.lua
46
9128
-- This file contains tests for the QR decomposition functions in torch: -- torch.qr(), torch.geqrf() and torch.orgqr(). local torch = require 'torch' local tester = torch.Tester() local tests = {} -- torch.qr() with result tensors given. local function qrInPlace(tensorFunc) return function(x) local q, r = tensorFunc(), tensorFunc() torch.qr(q, r, x:clone()) return q, r end end -- torch.qr() without result tensors given. local function qrReturned(tensorFunc) return function(x) return torch.qr(x:clone()) end end -- torch.geqrf() with result tensors given. local function geqrfInPlace(tensorFunc) return function(x) local result = tensorFunc() local tau = tensorFunc() local result_, tau_ = torch.geqrf(result, tau, x) assert(torch.pointer(result) == torch.pointer(result_), 'expected result, result_ same tensor') assert(torch.pointer(tau) == torch.pointer(tau_), 'expected tau, tau_ same tensor') return result_, tau_ end end -- torch.orgqr() with result tensors given. local function orgqrInPlace(tensorFunc) return function(result, tau) local q = tensorFunc() local q_ = torch.orgqr(q, result, tau) assert(torch.pointer(q) == torch.pointer(q_), 'expected q, q_ same tensor') return q end end -- Test a custom QR routine that calls the LAPACK functions manually. local function qrManual(geqrfFunc, orgqrFunc) return function(x) local m = x:size(1) local n = x:size(2) local k = math.min(m, n) local result, tau = geqrfFunc(x) assert(result:size(1) == m) assert(result:size(2) == n) assert(tau:size(1) == k) local r = torch.triu(result:narrow(1, 1, k)) local q = orgqrFunc(result, tau) return q:narrow(2, 1, k), r end end -- Check that the given `q`, `r` matrices are a valid QR decomposition of `a`. local function checkQR(testOpts, a, q, r) local qrFunc = testOpts.qr if not q then q, r = qrFunc(a) end local k = math.min(a:size(1), a:size(2)) tester:asserteq(q:size(1), a:size(1), "Bad size for q first dimension.") tester:asserteq(q:size(2), k, "Bad size for q second dimension.") tester:asserteq(r:size(1), k, "Bad size for r first dimension.") tester:asserteq(r:size(2), a:size(2), "Bad size for r second dimension.") tester:assertTensorEq(q:t() * q, torch.eye(q:size(2)):typeAs(testOpts.tensorFunc()), testOpts.precision, "Q was not orthogonal") tester:assertTensorEq(r, r:triu(), testOpts.precision, "R was not upper triangular") tester:assertTensorEq(q * r, a, testOpts.precision, "QR = A") end -- Do a QR decomposition of `a` and check that the result is valid and matches -- the given expected `q` and `r`. local function checkQRWithExpected(testOpts, a, expected_q, expected_r) local qrFunc = testOpts.qr -- Since the QR decomposition is unique only up to the signs of the rows of -- R, we must ensure these are positive before doing the comparison. local function canonicalize(q, r) local d = r:diag():sign():diag() return q * d, d * r end local q, r = qrFunc(a) local q_canon, r_canon = canonicalize(q, r) local expected_q_canon, expected_r_canon = canonicalize(expected_q, expected_r) tester:assertTensorEq(q_canon, expected_q_canon, testOpts.precision, "Q did not match expected") tester:assertTensorEq(r_canon, expected_r_canon, testOpts.precision, "R did not match expected") checkQR(testOpts, a, q, r) end -- Generate a separate test based on `func` for each of the possible -- combinations of tensor type (double or float) and QR function (torch.qr -- in-place, torch.qr, and manually calling the geqrf and orgqr from Lua -- (both in-place and not). -- -- The tests are added to the given `tests` table, with names generated by -- appending a unique string for the specific combination to `name`. -- -- If opts.doubleTensorOnly is true, then the FloatTensor versions of the test -- will be skipped. local function addTestVariations(tests, name, func, opts) opts = opts or {} local tensorTypes = { [torch.DoubleTensor] = 1e-12, [torch.FloatTensor] = 1e-5, } for tensorFunc, requiredPrecision in pairs(tensorTypes) do local qrFuncs = { ['inPlace'] = qrInPlace(tensorFunc), ['returned'] = qrReturned(tensorFunc), ['manualInPlace'] = qrManual(geqrfInPlace(tensorFunc), orgqrInPlace(tensorFunc)), ['manualReturned'] = qrManual(torch.geqrf, torch.orgqr) } for qrName, qrFunc in pairs(qrFuncs) do local testOpts = { tensorFunc=tensorFunc, precision=requiredPrecision, qr=qrFunc, } local tensorType = tensorFunc():type() local fullName = name .. "_" .. qrName .. "_" .. tensorType assert(not tests[fullName]) if tensorType == 'torch.DoubleTensor' or not opts.doubleTensorOnly then tests[fullName] = function() local state = torch.getRNGState() torch.manualSeed(1) func(testOpts) torch.setRNGState(state) end end end end end -- Decomposing a specific square matrix. addTestVariations(tests, 'qrSquare', function(testOpts) return function(testOpts) local tensorFunc = testOpts.tensorFunc local a = tensorFunc{{1, 2, 3}, {4, 5, 6}, {7, 8, 9}} local expected_q = tensorFunc{ {-1.230914909793328e-01, 9.045340337332914e-01, 4.082482904638621e-01}, {-4.923659639173310e-01, 3.015113445777629e-01, -8.164965809277264e-01}, {-8.616404368553292e-01, -3.015113445777631e-01, 4.082482904638634e-01}, } local expected_r = tensorFunc{ {-8.124038404635959e+00, -9.601136296387955e+00, -1.107823418813995e+01}, { 0.000000000000000e+00, 9.045340337332926e-01, 1.809068067466585e+00}, { 0.000000000000000e+00, 0.000000000000000e+00, -8.881784197001252e-16}, } checkQRWithExpected(testOpts, a, expected_q, expected_r) end end, {doubleTensorOnly=true}) -- Decomposing a specific (wide) rectangular matrix. addTestVariations(tests, 'qrRectFat', function(testOpts) -- The matrix is chosen to be full-rank. local a = testOpts.tensorFunc{ {1, 2, 3, 4}, {5, 6, 7, 8}, {9, 10, 11, 13} } local expected_q = testOpts.tensorFunc{ {-0.0966736489045663, 0.907737593658436 , 0.4082482904638653}, {-0.4833682445228317, 0.3157348151855452, -0.8164965809277254}, {-0.870062840141097 , -0.2762679632873518, 0.4082482904638621} } local expected_r = testOpts.tensorFunc{ { -1.0344080432788603e+01, -1.1794185166357092e+01, -1.3244289899925587e+01, -1.5564457473635180e+01}, { 0.0000000000000000e+00, 9.4720444555662542e-01, 1.8944088911132546e+00, 2.5653453733825331e+00}, { 0.0000000000000000e+00, 0.0000000000000000e+00, 1.5543122344752192e-15, 4.0824829046386757e-01} } checkQRWithExpected(testOpts, a, expected_q, expected_r) end, {doubleTensorOnly=true}) -- Decomposing a specific (thin) rectangular matrix. addTestVariations(tests, 'qrRectThin', function(testOpts) -- The matrix is chosen to be full-rank. local a = testOpts.tensorFunc{ { 1, 2, 3}, { 4, 5, 6}, { 7, 8, 9}, {10, 11, 13}, } local expected_q = testOpts.tensorFunc{ {-0.0776150525706334, -0.833052161400748 , 0.3651483716701106}, {-0.3104602102825332, -0.4512365874254053, -0.1825741858350556}, {-0.5433053679944331, -0.0694210134500621, -0.7302967433402217}, {-0.7761505257063329, 0.3123945605252804, 0.5477225575051663} } local expected_r = testOpts.tensorFunc{ {-12.8840987267251261, -14.5916298832790581, -17.0753115655393231}, { 0, -1.0413152017509357, -1.770235842976589 }, { 0, 0, 0.5477225575051664} } checkQRWithExpected(testOpts, a, expected_q, expected_r) end, {doubleTensorOnly=true}) -- Decomposing a sequence of medium-sized random matrices. addTestVariations(tests, 'randomMediumQR', function(testOpts) for x = 0, 10 do for y = 0, 10 do local m = math.pow(2, x) local n = math.pow(2, y) local x = torch.rand(m, n) checkQR(testOpts, x:typeAs(testOpts.tensorFunc())) end end end) -- Decomposing a sequence of small random matrices. addTestVariations(tests, 'randomSmallQR', function(testOpts) for m = 1, 40 do for n = 1, 40 do checkQR(testOpts, torch.rand(m, n):typeAs(testOpts.tensorFunc())) end end end) -- Decomposing a sequence of small matrices that are not contiguous in memory. addTestVariations(tests, 'randomNonContiguous', function(testOpts) for m = 2, 40 do for n = 2, 40 do local x = torch.rand(m, n):t() tester:assert(not x:isContiguous(), "x should not be contiguous") checkQR(testOpts, x:typeAs(testOpts.tensorFunc())) end end end) tester:add(tests) tester:run()
bsd-3-clause
chfg007/skynet
lualib/snax/msgserver.lua
58
7383
local skynet = require "skynet" local gateserver = require "snax.gateserver" local netpack = require "netpack" local crypt = require "crypt" local socketdriver = require "socketdriver" local assert = assert local b64encode = crypt.base64encode local b64decode = crypt.base64decode --[[ Protocol: All the number type is big-endian Shakehands (The first package) Client -> Server : base64(uid)@base64(server)#base64(subid):index:base64(hmac) Server -> Client XXX ErrorCode 404 User Not Found 403 Index Expired 401 Unauthorized 400 Bad Request 200 OK Req-Resp Client -> Server : Request word size (Not include self) string content (size-4) dword session Server -> Client : Response word size (Not include self) string content (size-5) byte ok (1 is ok, 0 is error) dword session API: server.userid(username) return uid, subid, server server.username(uid, subid, server) return username server.login(username, secret) update user secret server.logout(username) user logout server.ip(username) return ip when connection establish, or nil server.start(conf) start server Supported skynet command: kick username (may used by loginserver) login username secret (used by loginserver) logout username (used by agent) Config for server.start: conf.expired_number : the number of the response message cached after sending out (default is 128) conf.login_handler(uid, secret) -> subid : the function when a new user login, alloc a subid for it. (may call by login server) conf.logout_handler(uid, subid) : the functon when a user logout. (may call by agent) conf.kick_handler(uid, subid) : the functon when a user logout. (may call by login server) conf.request_handler(username, session, msg) : the function when recv a new request. conf.register_handler(servername) : call when gate open conf.disconnect_handler(username) : call when a connection disconnect (afk) ]] local server = {} skynet.register_protocol { name = "client", id = skynet.PTYPE_CLIENT, } local user_online = {} local handshake = {} local connection = {} function server.userid(username) -- base64(uid)@base64(server)#base64(subid) local uid, servername, subid = username:match "([^@]*)@([^#]*)#(.*)" return b64decode(uid), b64decode(subid), b64decode(servername) end function server.username(uid, subid, servername) return string.format("%s@%s#%s", b64encode(uid), b64encode(servername), b64encode(tostring(subid))) end function server.logout(username) local u = user_online[username] user_online[username] = nil if u.fd then gateserver.closeclient(u.fd) connection[u.fd] = nil end end function server.login(username, secret) assert(user_online[username] == nil) user_online[username] = { secret = secret, version = 0, index = 0, username = username, response = {}, -- response cache } end function server.ip(username) local u = user_online[username] if u and u.fd then return u.ip end end function server.start(conf) local expired_number = conf.expired_number or 128 local handler = {} local CMD = { login = assert(conf.login_handler), logout = assert(conf.logout_handler), kick = assert(conf.kick_handler), } function handler.command(cmd, source, ...) local f = assert(CMD[cmd]) return f(...) end function handler.open(source, gateconf) local servername = assert(gateconf.servername) return conf.register_handler(servername) end function handler.connect(fd, addr) handshake[fd] = addr gateserver.openclient(fd) end function handler.disconnect(fd) handshake[fd] = nil local c = connection[fd] if c then c.fd = nil connection[fd] = nil if conf.disconnect_handler then conf.disconnect_handler(c.username) end end end handler.error = handler.disconnect -- atomic , no yield local function do_auth(fd, message, addr) local username, index, hmac = string.match(message, "([^:]*):([^:]*):([^:]*)") local u = user_online[username] if u == nil then return "404 User Not Found" end local idx = assert(tonumber(index)) hmac = b64decode(hmac) if idx <= u.version then return "403 Index Expired" end local text = string.format("%s:%s", username, index) local v = crypt.hmac_hash(u.secret, text) -- equivalent to crypt.hmac64(crypt.hashkey(text), u.secret) if v ~= hmac then return "401 Unauthorized" end u.version = idx u.fd = fd u.ip = addr connection[fd] = u end local function auth(fd, addr, msg, sz) local message = netpack.tostring(msg, sz) local ok, result = pcall(do_auth, fd, message, addr) if not ok then skynet.error(result) result = "400 Bad Request" end local close = result ~= nil if result == nil then result = "200 OK" end socketdriver.send(fd, netpack.pack(result)) if close then gateserver.closeclient(fd) end end local request_handler = assert(conf.request_handler) -- u.response is a struct { return_fd , response, version, index } local function retire_response(u) if u.index >= expired_number * 2 then local max = 0 local response = u.response for k,p in pairs(response) do if p[1] == nil then -- request complete, check expired if p[4] < expired_number then response[k] = nil else p[4] = p[4] - expired_number if p[4] > max then max = p[4] end end end end u.index = max + 1 end end local function do_request(fd, message) local u = assert(connection[fd], "invalid fd") local session = string.unpack(">I4", message, -4) message = message:sub(1,-5) local p = u.response[session] if p then -- session can be reuse in the same connection if p[3] == u.version then local last = u.response[session] u.response[session] = nil p = nil if last[2] == nil then local error_msg = string.format("Conflict session %s", crypt.hexencode(session)) skynet.error(error_msg) error(error_msg) end end end if p == nil then p = { fd } u.response[session] = p local ok, result = pcall(conf.request_handler, u.username, message) -- NOTICE: YIELD here, socket may close. result = result or "" if not ok then skynet.error(result) result = string.pack(">BI4", 0, session) else result = result .. string.pack(">BI4", 1, session) end p[2] = string.pack(">s2",result) p[3] = u.version p[4] = u.index else -- update version/index, change return fd. -- resend response. p[1] = fd p[3] = u.version p[4] = u.index if p[2] == nil then -- already request, but response is not ready return end end u.index = u.index + 1 -- the return fd is p[1] (fd may change by multi request) check connect fd = p[1] if connection[fd] then socketdriver.send(fd, p[2]) end p[1] = nil retire_response(u) end local function request(fd, msg, sz) local message = netpack.tostring(msg, sz) local ok, err = pcall(do_request, fd, message) -- not atomic, may yield if not ok then skynet.error(string.format("Invalid package %s : %s", err, message)) if connection[fd] then gateserver.closeclient(fd) end end end function handler.message(fd, msg, sz) local addr = handshake[fd] if addr then auth(fd,addr,msg,sz) handshake[fd] = nil else request(fd, msg, sz) end end return gateserver.start(handler) end return server
mit
aquileia/wesnoth
data/ai/micro_ais/cas/ca_hunter.lua
4
8270
local H = wesnoth.require "lua/helper.lua" local W = H.set_wml_action_metatable {} local AH = wesnoth.require "ai/lua/ai_helper.lua" local MAIUV = wesnoth.require "ai/micro_ais/micro_ai_unit_variables.lua" local function hunter_attack_weakest_adj_enemy(ai, hunter) -- Attack the enemy with the fewest hitpoints adjacent to 'hunter', if there is one -- Returns status of the attack: -- 'attacked': if a unit was attacked -- 'killed': if a unit was killed -- 'no_attack': if no unit was attacked if (hunter.attacks_left == 0) then return 'no_attack' end local min_hp, target = 9e99 for xa,ya in H.adjacent_tiles(hunter.x, hunter.y) do local enemy = wesnoth.get_unit(xa, ya) if enemy and wesnoth.is_enemy(enemy.side, wesnoth.current.side) then if (enemy.hitpoints < min_hp) then min_hp, target = enemy.hitpoints, enemy end end end if target then AH.checked_attack(ai, hunter, target) if target and target.valid then return 'attacked' else return 'killed' end end return 'no_attack' end local function get_hunter(cfg) local filter = H.get_child(cfg, "filter") or { id = cfg.id } local hunter = AH.get_units_with_moves { side = wesnoth.current.side, { "and", filter } }[1] return hunter end local ca_hunter = {} function ca_hunter:evaluation(cfg) if get_hunter(cfg) then return cfg.ca_score end return 0 end function ca_hunter:execution(cfg) -- Hunter does a random wander in area given by @cfg.hunting_ground until it finds -- and kills an enemy unit, then retreats to position given by @cfg.home_x/y -- for @cfg.rest_turns turns, or until fully healed local hunter = get_hunter(cfg) local hunter_vars = MAIUV.get_mai_unit_variables(hunter, cfg.ai_id) -- If hunting_status is not set for the hunter -> default behavior -> random wander if (not hunter_vars.hunting_status) then -- Hunter gets a new goal if none exist or on any move with 10% random chance local rand = math.random(10) if (not hunter_vars.goal_x) or (rand == 1) then -- 'locs' includes border hexes, but that does not matter here locs = AH.get_passable_locations((H.get_child(cfg, "filter_location") or {}), hunter) local rand = math.random(#locs) hunter_vars.goal_x, hunter_vars.goal_y = locs[rand][1], locs[rand][2] MAIUV.set_mai_unit_variables(hunter, cfg.ai_id, hunter_vars) end local reach_map = AH.get_reachable_unocc(hunter) -- Now find the one of these hexes that is closest to the goal local max_rating, best_hex = -9e99 reach_map:iter( function(x, y, v) -- Distance from goal is first rating local rating = - H.distance_between(x, y, hunter_vars.goal_x, hunter_vars.goal_y) -- Huge rating bonus if this is next to an enemy local enemy_hp = 500 for xa,ya in H.adjacent_tiles(x, y) do local enemy = wesnoth.get_unit(xa, ya) if enemy and wesnoth.is_enemy(enemy.side, wesnoth.current.side) then if (enemy.hitpoints < enemy_hp) then enemy_hp = enemy.hitpoints end end end rating = rating + 500 - enemy_hp -- prefer attack on weakest enemy if (rating > max_rating) then max_rating, best_hex = rating, { x, y } end end) if (best_hex[1] ~= hunter.x) or (best_hex[2] ~= hunter.y) then AH.checked_move(ai, hunter, best_hex[1], best_hex[2]) -- partial move only if (not hunter) or (not hunter.valid) then return end else -- If hunter did not move, we need to stop it (also delete the goal) AH.checked_stopunit_moves(ai, hunter) if (not hunter) or (not hunter.valid) then return end hunter_vars.goal_x, hunter_vars.goal_y = nil, nil MAIUV.set_mai_unit_variables(hunter, cfg.ai_id, hunter_vars) end -- If this gets the hunter to the goal, we delete the goal if (hunter.x == hunter_vars.goal_x) and (hunter.y == hunter_vars.goal_y) then hunter_vars.goal_x, hunter_vars.goal_y = nil, nil MAIUV.set_mai_unit_variables(hunter, cfg.ai_id, hunter_vars) end -- Finally, if the hunter ended up next to enemies, attack the weakest of those local attack_status = hunter_attack_weakest_adj_enemy(ai, hunter) -- If the enemy was killed, hunter returns home if hunter and hunter.valid and (attack_status == 'killed') then hunter_vars.goal_x, hunter_vars.goal_y = nil, nil hunter_vars.hunting_status = 'returning' MAIUV.set_mai_unit_variables(hunter, cfg.ai_id, hunter_vars) if cfg.show_messages then W.message { speaker = hunter.id, message = 'Now that I have eaten, I will go back home.' } end end return end -- If we got here, this means the hunter is either returning, or resting if (hunter_vars.hunting_status == 'returning') then goto_x, goto_y = wesnoth.find_vacant_tile(cfg.home_x, cfg.home_y) local next_hop = AH.next_hop(hunter, goto_x, goto_y) if next_hop then AH.movefull_stopunit(ai, hunter, next_hop) if (not hunter) or (not hunter.valid) then return end -- If there's an enemy on the 'home' hex and we got right next to it, attack that enemy if (H.distance_between(cfg.home_x, cfg.home_y, next_hop[1], next_hop[2]) == 1) then local enemy = wesnoth.get_unit(cfg.home_x, cfg.home_y) if enemy and wesnoth.is_enemy(enemy.side, hunter.side) then if cfg.show_messages then W.message { speaker = hunter.id, message = 'Get out of my home!' } end AH.checked_attack(ai, hunter, enemy) if (not hunter) or (not hunter.valid) then return end end end end -- We also attack the weakest adjacent enemy, if still possible hunter_attack_weakest_adj_enemy(ai, hunter) if (not hunter) or (not hunter.valid) then return end -- If the hunter got home, start the resting counter if (hunter.x == cfg.home_x) and (hunter.y == cfg.home_y) then hunter_vars.hunting_status = 'resting' hunter_vars.resting_until = wesnoth.current.turn + (cfg.rest_turns or 3) MAIUV.set_mai_unit_variables(hunter, cfg.ai_id, hunter_vars) if cfg.show_messages then W.message { speaker = hunter.id, message = 'I made it home - resting now until the end of Turn ' .. hunter_vars.resting_until .. ' or until fully healed.' } end end return end -- If we got here, the only remaining action should be resting if (hunter_vars.hunting_status == 'resting') then AH.checked_stopunit_moves(ai, hunter) if (not hunter) or (not hunter.valid) then return end -- We also attack the weakest adjacent enemy hunter_attack_weakest_adj_enemy(ai, hunter) if (not hunter) or (not hunter.valid) then return end -- If this is the last turn of resting, we remove the status and turn variable if (hunter.hitpoints >= hunter.max_hitpoints) and (hunter_vars.resting_until <= wesnoth.current.turn) then hunter_vars.hunting_status = nil hunter_vars.resting_until = nil MAIUV.set_mai_unit_variables(hunter, cfg.ai_id, hunter_vars) if cfg.show_messages then W.message { speaker = hunter.id, message = 'I am done resting. It is time to go hunting again next turn.' } end end return end -- In principle we should never get here, but just in case something got changed in WML: -- Reset variable, so that hunter goes hunting on next turn hunter_vars.hunting_status = nil MAIUV.set_mai_unit_variables(hunter, cfg.ai_id, hunter_vars) end return ca_hunter
gpl-2.0
rinstrum/LUA-LIB
K400Examples/myApp.lua
2
7498
#!/usr/bin/env lua ------------------------------------------------------------------------------- -- myApp -- -- Application template -- -- Copy this file to your project directory and insert the specific code of -- your application ------------------------------------------------------------------------------- local rinApp = require "rinApp" -- load in the application framework local timers = require 'rinSystem.rinTimers' local dbg = require "rinLibrary.rinDebug" --============================================================================= -- Connect to the instruments you want to control -- Define any Application variables you wish to use --============================================================================= local device = rinApp.addK400() -- make a connection to the instrument device.loadRIS("myApp.RIS") -- load default instrument settings --============================================================================= -- Register All Event Handlers and establish local application variables --============================================================================= ------------------------------------------------------------------------------- -- Callback to capture changes to current weight local curWeight = 0 local function handleNewWeight(data, err) curWeight = data print('Weight = ',curWeight) end device.addStream('grossnet', handleNewWeight, 'change') -- choose a different register if you want to track other than GROSSNET weight ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- -- Callback to monitor motion status local function handleMotion(status, active) -- status is a copy of the instrument status bits and active is true or false -- to show if active or not if active then print('motion') else print('stable') end end device.setStatusCallback('motion', handleMotion) ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- -- Callback to capture changes to instrument status local function handleIO1(IO, active) -- status is a copy of the instrument status bits and active is true or false -- to show if active or not if active then print('IO 1 is on ') else print('IO 1 is off ') end end device.setIOCallback(1, handleIO1) -- set callback to capture changes on IO1 ------------------------------------------------------------------------------- local function handleIO(data) dbg.info(' IO: ', string.format('%08X',data)) end device.setAllIOCallback(handleIO) ------------------------------------------------------------------------------- -- Callback to capture changes to instrument status local function handleSETP1(SETP, active) -- status is a copy of the instrument status bits and active is true or false -- to show if active or not if active then print ('SETP 1 is on ') else print ('SETP 1 is off ') end end device.setSETPCallback(1, handleSETP1) -- set callback to capture changes on IO1 ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- -- Callback to capture changes to instrument status local function handleSETP(data) -- status is a copy of the instrument status bits and active is true or false -- to show if active or not dbg.info('SETP: ',string.format('%04X',data)) end device.setAllSETPCallback(handleSETP) -- set callback to capture changes on IO1 --============================================================================= -- Define the state machine that drives this appliction. local function enterIdle() device.write('topLeft', 'MY APP') device.write('bottomLeft', 'F1-START F2-FINISH', 'time=1.5') device.write('bottomRight', '') end local function enterRun() device.writeAuto('topLeft', 'grossnet') device.write('bottomLeft', '') device.write('bottomRight', 'PLACE') end local function captured() device.setUserNumber(3, device.toPrimary(curWeight)) device.writeAuto('bottomLeft', 'usernum3') device.buzz(2) device.write('bottomRight', 'CAPTURED', 'time=1, wait') device.write('bottomRight', '...') end local function rerun() device.buzz(1) device.write('bottomRight', '', 'time=0.5, wait') end -- The actual state machine is pretty small: local fsm = device.stateMachine { 'myAppFSM', showState=true } -- States are the modes we can be in. .state { 'idle', enter=enterIdle } .state { 'run', enter=enterRun } .state { 'wait' } -- Transitions are the movements between modes. .trans { 'run', 'wait', status={'notzero', 'notmotion'}, activate=captured } .trans { 'wait', 'run', status='motion', activate=rerun } .trans { 'idle', 'run', event='run' } .trans { 'all', 'idle', event='reset' } ------------------------------------------------------------------------------- -- Callbacks to handle F1 key event device.setKeyCallback('f1', function() print('Long F1 Pressed') return true end, 'long') device.setKeyCallback('f1', function() fsm.raise('run') return true end, 'short') ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- -- Callbacks to handle F2 key event device.setKeyCallback('f2', function() print('Long F2 Pressed') return true end, 'long') device.setKeyCallback('f2', function() fsm.raise('reset') return true end, 'short') ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- -- Callback to handle PWR+ABORT key and end application device.setKeyCallback('pwr_cancel', rinApp.finish, 'long') ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- -- Callback to handle changes in instrument settings local function settingsChanged(status, active) end device.setStatusCallback('init', settingsChanged) ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- -- Callback for local timer local tickerStart = 0.10 -- time in seconds until timer events start triggering local tickerRepeat = 0.20 -- time in seconds that the timer repeats timers.addTimer(tickerRepeat, tickerStart, device.rotWAIT, 'topLeft', 1) ------------------------------------------------------------------------------- --============================================================================= -- Initialisation --============================================================================= -- This is a good place to put your initialisation code -- (eg, setup outputs or put a message on the LCD etc) ------------------------------------------------------------------------------- --============================================================================= -- run the application rinApp.setMainLoop(fsm.run) rinApp.run() --=============================================================================
gpl-3.0
Asher9/Asher9-s-Programms
openDHD/stargate/sprache/russian.lua
1
8623
-- pastebin run -f -- openDHD from Asher9 -- https://github.com/Asher9/Asher9-s-Programms/tree/master/openDHD return { dezimalkomma = true, pruefeKomponenten = "Проверка компонентов\n", redstoneOK = "- Редстоун карта есть - опционально", redstoneFehlt = "- Редстоун карта нет - опционально", InternetOK = "- Интернет карта есть - опционально", InternetFehlt = "- Интернет карта нет - опционально", SensorOK = "- Карта-мировой сенсор есть - опционально", SensorFehlt = "- Карта-мировой сенсор нет - опционально", gpuOK2T = "- Видеокарта Уровень II есть", gpuOK3T = "- Видеокарта Уровень III есть - достаточно Ур II", gpuFehlt = "- Видеокарта Уровень II нет", StargateOK = "- Звездные врата есть", StargateFehlt = "- Звездные врата нет", inventory_controllerOK = "- Контроллер инвентаря есть\n", inventory_controllerFehlt = "- Контроллер инвентаря нет\n", derzeitigeVersion = "\nтекущая версия: ", verfuegbareVersion = "\nновая версия: ", betaVersion = "бета версия: ", aktualisierenBeta = "\nобновить: бета версия\n", aktualisierenFrage = "\nобновить? да/нет", aktualisierenJa = "\nобновить: да\n", aktualisierenNein = "\nответ: ", aktualisierenJetzt = "\n\n\nобновление...\n", aktualisierenGleich = "Автоматическое обновление, если врата в режиме ожидания.", laden = "\nзагрузка...", ja = "да", nein = "нет", hilfe = "помощь", Adressseite = "Адреса Страница #", Unbekannt = "неизвестно", waehlen = "Дозвон ", energie1 = "Энергия ", energie2 = ": ", keineVerbindung = "Врата не обнаружены", Steuerung = "Управление", IrisSteuerung = "Управление диафрагмой ", an_aus = "вкл/выкл", AdressenBearbeiten = "Редактировать адреса", beenden = "Выход", nachrichtAngekommen = "Сообщение: ", RedstoneSignale = "Редстоун сигнал", RedstoneWeiss = "белый: не в режиме ожидания", RedstoneRot = "красный: входящее соединение", RedstoneGelb = "желтый: диафрагма закрыта", RedstoneSchwarz = "черный: idc принят", RedstoneGruen = "зеленый: есть соединение", versionName = "Версия: ", fehlerName = "<ОШИБКА>", SteuerungName = "информация", lokaleAdresse = "Локальный адрес: ", zielAdresseName = "Удаленный адрес: ", zielName = "Точка назначения: ", statusName = "Состояние: ", IrisName = "Диафрагма: ", IrisSteuerung = "Упр. диафрагмой: ", IDCakzeptiert = "IDC: принят", IDCname = "IDC: ", chevronName = "Шеврон: ", richtung = "Направление: ", autoSchliessungAus = "Автозакрытие: откл", autoSchliessungAn = "Автозакрытие: ", zeit1 = "Время: ", zeit2 = "Время:", atmosphere = "Атмосфера: ", atmosphere2 = "Атмосфера: ", atmosphereJA = "нормально", atmosphereNEIN = "опасно", abschalten = "Отключение", oeffneIris = "Открыть", schliesseIris = "Закрыть", IDCeingabe = "Ввод IDC", naechsteSeite = "След. страница", vorherigeSeite = "Пред. страница", senden = "Отправка: ", aufforderung = "Запрос", manueller = "Ручной", Eingriff = "Разрыв", stargateName = "Врата", stargateAbschalten = "Отключение", aktiviert = "активирован", zeigeAdressen = "Список адресов", EinstellungenAendern = "Изменить конфиг", irisNameOffen = "Открыта", irisNameOeffnend = "Открыта", irisNameGeschlossen = "Закрыта", irisNameSchliessend = "Закрывается", irisNameOffline = "Отсутствует", irisKontrolleNameAn = "Включено", irisKontrolleNameAus = "Отключено", RichtungNameEin = "Входящий", RichtungNameAus = "Исходящий", StatusNameUntaetig = "Ожидание", StatusNameWaehlend = "Набор", StatusNameVerbunden = "Активный туннель", StatusNameSchliessend = "Разрыв соединения", Neustart = "перезапуск", IrisSteuerungName = "Управление", ausschaltenName = "отключение...", redstoneAusschalten = "выключить редстоун: ", colorfulLampAusschalten = "выключить цветную лампу: ", verarbeiteAdressen = "Верификация адресов: ", Hilfetext = "Использование: stargate [...]\nyes\t-> обновить до стабильной версии\nno\t-> не обновять\nbeta\t-> обновить до беты\nhelp\t-> показать это сообщение", Sprachaenderung = "язык будет изменен при следующем запуске", entwicklerName = "Разработчик:", IDCgesendet = "отправка IDC", DateienFehlen = "отсутствуют файлы\nперекачать все?", speichern = 'нажмите "Ctrl + S", чтобы сохранить', schliessen = 'нажмите "Ctrl + W", чтобы закрыть', IDC = "код открытия диафрагмы", autoclosetime = "в секундах -- false без автозакрытия", RF = "показать энергию в RF вместо EU", side = "снизу, сверху, сзади, спереди, справа или слева", autoUpdate = "включить автоматические обновления", iris = "адрес этих врат", keinIDC = "без диафрагмы", nichtsAendern = "не менять ничего ниже", Update = "Обновить?", UpdateBeta = "Обновить до беты?", TastaturFehlt = "требуется клавиатура", bereitsNeusteVersion = "обновления не найдены", autoUpdate = "автоматическое обновление", akzeptiert = "принято", StargateName = "название этих врат", FrageStargateName = "Задайте название этих врат", debug = "для отладки", keineEnergie = "<нет энергии>", }
mit
AdamGagorik/darkstar
scripts/globals/effects/bust.lua
35
1737
----------------------------------- -- -- -- ----------------------------------- require("scripts/globals/status"); ----------------------------------- -- onEffectGain Action ----------------------------------- function onEffectGain(target,effect) if (effect:getSubType() == MOD_DMG) then target:addMod(MOD_DMG, effect:getPower()); else if (effect:getSubType() == MOD_ACC) then target:addMod(MOD_RACC, -effect:getPower()); elseif (effect:getSubType() == MOD_ATTP) then target:addMod(MOD_RATTP, -effect:getPower()); elseif (effect:getSubType() == MOD_PET_MACC) then target:addMod(MOD_PET_MATT, -effect:getPower()); end target:addMod(effect:getSubType(), -effect:getPower()); end --print("added "..effect:getPower().." of mod "..effect:getSubType()); end; ----------------------------------- -- onEffectTick Action ----------------------------------- function onEffectTick(target,effect) end; ----------------------------------- -- onEffectLose Action ----------------------------------- function onEffectLose(target,effect) if (effect:getSubType() == MOD_DMG) then target:delMod(MOD_DMG, effect:getPower()); else if (effect:getSubType() == MOD_ACC) then target:delMod(MOD_RACC, -effect:getPower()); elseif (effect:getSubType() == MOD_ATTP) then target:delMod(MOD_RATTP, -effect:getPower()); elseif (effect:getSubType() == MOD_PET_MACC) then target:delMod(MOD_PET_MATT, -effect:getPower()); end target:delMod(effect:getSubType(), -effect:getPower()); end --print("removed "..effect:getPower().." of mod "..effect:getSubType()); end;
gpl-3.0
samuelwbaird/brogue
examples/sqlite_example.lua
1
3043
-- demonstrate basic DB access with dweeb -- copyright 2014 Samuel Baird MIT Licence -- reference the brogue libraries package.path = '../source/?.lua;' .. package.path -- load the modules we need local sqlite = require('dweeb.sqlite') local random_key = require('rascal.util.random_key') -- open up a database for some testing print('opening db/sqlite.sqlite') local db = sqlite('db/sqlite.sqlite') -- nil name = in memory db -- execute raw sql db:exec('DROP TABLE IF EXISTS `codes`') -- use a convenience command to prepare table db:prepare_table('codes', { columns = { { name = 'id', type = 'INTEGER PRIMARY KEY AUTOINCREMENT' }, { name = 'code', type = 'TEXT' }, }, indexes = { -- no other indexes needed }, }) -- insert a bunch of short random codes into the table for our tests -- do this work within a single transaction to improve throughput print('insert a large volume short codes into a table') db:transaction(function () for i = 1, 200000 do db:insert('codes', { code = random_key.printable(3) -- use short printable codes }):execute() end end) -- find out how many unique codes were generated print('total code in the table ' .. db:query('SELECT COUNT(*) FROM codes'):value()) print('unique codes in the table ' .. db:query('SELECT COUNT(DISTINCT(code)) FROM codes'):value()) -- prepare an SQL statement, then re-use it -- prepare a select on table test, selecting id and code, using code as the criteria local select_statement = db:select('codes', 'id, code' , { 'code' }):prepare() -- lets find the id of a bunch of codes if they are present for i = 1, 10 do local code = random_key.printable(3) print('selecting code ' .. code) select_statement:query({ code }):with_each(function (row) print('found this code in row id ' .. row.id) end) end -- sql can be executed directly, built, then queried, or prepared for multiple queries -- the following approaches could all be used to delete rows print('deleting some rows') -- sql string + bindings db:execute('DELETE FROM codes WHERE id = ?', { 10 }) -- sql builder function + bindings + execute db:delete('codes', { id = 11 }):execute() -- sql builder function + empty bindings + prepare, then reused local delete_statement = db:delete('codes', { 'id' }):prepare() delete_statement:execute({ 12 }) delete_statement:execute({ 13 }) delete_statement:execute({ 14 }) -- now an sql update using our builder -- showing bindings with values supplied directly, and bindings with operators specified print('updating some rows') db:update('codes', { code = 'blank' }):where({ ['id <='] = 10 }):execute() -- now let's check if our delete and updates worked, using bindings with -- operators appended, and an id range from 8 to 16 print('searching rows between 8 and 16') db:select('codes', 'id, code', { 'id >=', 'id <=' }):query({ 8, 16 }):with_each(function (row) print('found ' .. row.id .. ' ' .. row.code) end) -- close db db:close() -- all done, sqlite command line can be used to view the data, eg. sqlite3 db/sqlite.sqlite print('done')
mit
robertfoss/nodemcu-firmware
examples/telnet.lua
61
1070
print("====Wicon, a LUA console over wifi.==========") print("Author: openthings@163.com. copyright&GPL V2.") print("Last modified 2014-11-19. V0.2") print("Wicon Server starting ......") function startServer() print("Wifi AP connected. Wicon IP:") print(wifi.sta.getip()) sv=net.createServer(net.TCP, 180) sv:listen(8080, function(conn) print("Wifi console connected.") function s_output(str) if (conn~=nil) then conn:send(str) end end node.output(s_output,0) conn:on("receive", function(conn, pl) node.input(pl) if (conn==nil) then print("conn is nil.") end end) conn:on("disconnection",function(conn) node.output(nil) end) end) print("Wicon Server running at :8080") print("===Now,Using xcon_tcp logon and input LUA.====") end tmr.alarm(0, 1000, 1, function() if wifi.sta.getip()=="0.0.0.0" then print("Connect AP, Waiting...") else startServer() tmr.stop() end end)
mit
iotcafe/nodemcu-firmware
examples/telnet.lua
61
1070
print("====Wicon, a LUA console over wifi.==========") print("Author: openthings@163.com. copyright&GPL V2.") print("Last modified 2014-11-19. V0.2") print("Wicon Server starting ......") function startServer() print("Wifi AP connected. Wicon IP:") print(wifi.sta.getip()) sv=net.createServer(net.TCP, 180) sv:listen(8080, function(conn) print("Wifi console connected.") function s_output(str) if (conn~=nil) then conn:send(str) end end node.output(s_output,0) conn:on("receive", function(conn, pl) node.input(pl) if (conn==nil) then print("conn is nil.") end end) conn:on("disconnection",function(conn) node.output(nil) end) end) print("Wicon Server running at :8080") print("===Now,Using xcon_tcp logon and input LUA.====") end tmr.alarm(0, 1000, 1, function() if wifi.sta.getip()=="0.0.0.0" then print("Connect AP, Waiting...") else startServer() tmr.stop() end end)
mit
AdamGagorik/darkstar
scripts/zones/PsoXja/npcs/_09a.lua
13
2831
----------------------------------- -- Area: Pso'Xja -- NPC: _09a (Stone Gate) -- Notes: Spawns Gargoyle when triggered -- @pos 261.600 -1.925 -50.000 9 ----------------------------------- package.loaded["scripts/zones/PsoXja/TextIDs"] = nil; ----------------------------------- require("scripts/zones/PsoXja/TextIDs"); require("scripts/globals/keyitems"); ----------------------------------- -- onTrade ----------------------------------- function onTrade(player,npc,trade) if ((trade:hasItemQty(1115,1) or trade:hasItemQty(1023,1) or trade:hasItemQty(1022,1)) and trade:getItemCount() == 1 and player:getMainJob() == 6) then local X=player:getXPos(); if (npc:getAnimation() == 9) then if (X <= 261) then if (GetMobAction(16814091) == 0) then local Rand = math.random(1,2); -- estimated 50% success as per the wiki if (Rand == 1) then -- Spawn Gargoyle player:messageSpecial(DISCOVER_DISARM_FAIL + 0x8000, 0, 0, 0, 0, true); SpawnMob(16814091,120):updateClaim(player); -- Gargoyle else player:messageSpecial(DISCOVER_DISARM_SUCCESS + 0x8000, 0, 0, 0, 0, true); npc:openDoor(30); end player:tradeComplete(); else player:messageSpecial(DOOR_LOCKED); end end end end end; ----------------------------------- -- onTrigger ----------------------------------- function onTrigger(player,npc) local X=player:getXPos(); if (npc:getAnimation() == 9) then if (X <= 261) then if (GetMobAction(16814091) == 0) then local Rand = math.random(1,10); if (Rand <=9) then -- Spawn Gargoyle player:messageSpecial(TRAP_ACTIVATED + 0x8000, 0, 0, 0, 0, true); SpawnMob(16814091,120):updateClaim(player); -- Gargoyle else player:messageSpecial(TRAP_FAILS + 0x8000, 0, 0, 0, 0, true); npc:openDoor(30); end else player:messageSpecial(DOOR_LOCKED); end elseif (X >= 262) then player:startEvent(0x001A); end end end; ----------------------------------- -- onEventUpdate ----------------------------------- function onEventUpdate(player,csid,option) --printf("CSID: %u",csid); --printf("RESULT: %u",option); end; ----------------------------------- -- onEventFinish ----------------------------------- function onEventFinish(player,csid,option) if (csid == 0x001A and option == 1) then player:setPos(260,-0.25,-20,254,111); end end;
gpl-3.0
SonyaSa/CppSharp
build/Helpers.lua
8
2717
-- This module checks for the all the project dependencies. action = _ACTION or "" depsdir = path.getabsolute("../deps"); srcdir = path.getabsolute("../src"); incdir = path.getabsolute("../include"); bindir = path.getabsolute("../bin"); examplesdir = path.getabsolute("../examples"); testsdir = path.getabsolute("../tests"); builddir = path.getabsolute("./" .. action); if _ARGS[1] then builddir = path.getabsolute("./" .. _ARGS[1]); end libdir = path.join(builddir, "lib", "%{cfg.buildcfg}_%{cfg.platform}"); gendir = path.join(builddir, "gen"); common_flags = { "Unicode", "Symbols" } msvc_buildflags = { "/wd4267" } gcc_buildflags = { "-std=c++11 -fpermissive" } msvc_cpp_defines = { } function os.is_osx() return os.is("macosx") end function os.is_windows() return os.is("windows") end function os.is_linux() return os.is("linux") end function string.starts(str, start) return string.sub(str, 1, string.len(start)) == start end function SafePath(path) return "\"" .. path .. "\"" end function SetupNativeProject() location (path.join(builddir, "projects")) local c = configuration "Debug" defines { "DEBUG" } configuration "Release" defines { "NDEBUG" } optimize "On" -- Compiler-specific options configuration "vs*" buildoptions { msvc_buildflags } defines { msvc_cpp_defines } configuration { "gmake" } buildoptions { gcc_buildflags } configuration { "macosx" } buildoptions { gcc_buildflags, "-stdlib=libc++" } links { "c++" } -- OS-specific options configuration "Windows" defines { "WIN32", "_WINDOWS" } configuration(c) end function SetupManagedProject() language "C#" location (path.join(builddir, "projects")) if not os.is_osx() then local c = configuration { "vs*" } location "." configuration(c) end end function IncludeDir(dir) local deps = os.matchdirs(dir .. "/*") for i,dep in ipairs(deps) do local fp = path.join(dep, "premake4.lua") fp = path.join(os.getcwd(), fp) if os.isfile(fp) then print(string.format(" including %s", dep)) include(dep) end end end function StaticLinksOpt(libnames) local cc = configuration() local path = table.concat(cc.configset.libdirs, ";") local formats if os.is("windows") then formats = { "%s.lib" } else formats = { "lib%s.a" } end table.insert(formats, "%s"); local existing_libnames = {} for _, libname in ipairs(libnames) do for _, fmt in ipairs(formats) do local name = string.format(fmt, libname) if os.pathsearch(name, path) then table.insert(existing_libnames, libname) end end end links(existing_libnames) end
mit
AdamGagorik/darkstar
scripts/zones/Dragons_Aery/npcs/relic.lua
13
1840
----------------------------------- -- Area: Dragon's Aery -- NPC: <this space intentionally left blank> -- @pos -20 -2 61 154 ----------------------------------- package.loaded["scripts/zones/Dragons_Aery/TextIDs"] = nil; ----------------------------------- require("scripts/zones/Dragons_Aery/TextIDs"); ----------------------------------- -- onTrade Action ----------------------------------- function onTrade(player,npc,trade) -- Working on correct relic, 4 items, Stage 4 item, Shard, Necropsyche, currencypiece if (player:getVar("RELIC_IN_PROGRESS") == 18275 and trade:getItemCount() == 4 and trade:hasItemQty(18275,1) and trade:hasItemQty(1573,1) and trade:hasItemQty(1589,1) and trade:hasItemQty(1454,1)) then player:startEvent(3,18276); end end; ----------------------------------- -- onTrigger Action ----------------------------------- function onTrigger(player,npc) player:messageSpecial(NOTHING_OUT_OF_ORDINARY); end; ----------------------------------- -- onEventUpdate ----------------------------------- function onEventUpdate(player,csid,option) --printf("CSID: %u",csid); --printf("RESULT: %u",option); end; ----------------------------------- -- onEventFinish ----------------------------------- function onEventFinish(player,csid,option) --printf("CSID: %u",csid); --printf("RESULT: %u",option); if (csid == 3) then if (player:getFreeSlotsCount() < 2) then player:messageSpecial(ITEM_CANNOT_BE_OBTAINED,18276); player:messageSpecial(FULL_INVENTORY_AFTER_TRADE,1453); else player:tradeComplete(); player:addItem(18276); player:addItem(1453,30); player:messageSpecial(ITEM_OBTAINED,18276); player:messageSpecial(ITEMS_OBTAINED,1453,30); player:setVar("RELIC_IN_PROGRESS",0); end end end;
gpl-3.0
AdamGagorik/darkstar
scripts/zones/Tavnazian_Safehold/Zone.lua
12
3411
----------------------------------- -- -- Zone: Tavnazian_Safehold (26) -- ----------------------------------- package.loaded["scripts/zones/Tavnazian_Safehold/TextIDs"] = nil; ----------------------------------- require("scripts/globals/settings"); require("scripts/globals/missions"); require("scripts/zones/Tavnazian_Safehold/TextIDs"); ----------------------------------- -- onInitialize ----------------------------------- function onInitialize(zone) zone:registerRegion(1, -5, -24, 18, 5, -20, 27); zone:registerRegion(2, 104, -42, -88, 113, -38, -77); end; ----------------------------------- -- onConquestUpdate ----------------------------------- function onConquestUpdate(zone, updatetype) local players = zone:getPlayers(); for name, player in pairs(players) do conquestUpdate(zone, player, updatetype, CONQUEST_BASE); end end; ----------------------------------- -- onZoneIn ----------------------------------- function onZoneIn(player,prevZone) local cs = -1; if (player:getXPos() == 0 and player:getYPos() == 0 and player:getZPos() == 0) then player:setPos(27.971,-14.068,43.735,66); end if (player:getCurrentMission(COP) == AN_INVITATION_WEST) then if (player:getVar("PromathiaStatus") == 1) then cs = 0x0065; end elseif (player:getCurrentMission(COP) == SHELTERING_DOUBT and player:getVar("PromathiaStatus") == 0) then cs = 0x006B; elseif (player:getCurrentMission(COP) == CHAINS_AND_BONDS and player:getVar("PromathiaStatus") == 1) then cs = 0x0072; end return cs; end; ----------------------------------- -- onRegionEnter ----------------------------------- function onRegionEnter(player,region) switch (region:GetRegionID()): caseof { [1] = function (x) if (player:getCurrentMission(COP) == AN_ETERNAL_MELODY and player:getVar("PromathiaStatus") == 2) then player:startEvent(0x0069); end end, [2] = function (x) if (player:getCurrentMission(COP) == SLANDEROUS_UTTERINGS and player:getVar("PromathiaStatus") == 0) then player:startEvent(0x0070); end end, } end; ----------------------------------- -- onRegionLeave ----------------------------------- function onRegionLeave(player,region) end; ----------------------------------- -- onEventUpdate ----------------------------------- function onEventUpdate(player,csid,option) --printf("CSID: %u",csid); --printf("RESULT: %u",option); end; ----------------------------------- -- onEventFinish ----------------------------------- function onEventFinish(player,csid,option) --printf("CSID: %u",csid); --printf("RESULT: %u",option); if (csid == 0x0065) then player:completeMission(COP,AN_INVITATION_WEST); player:addMission(COP,THE_LOST_CITY); player:setVar("PromathiaStatus",0); elseif (csid == 0x0069) then player:setVar("PromathiaStatus",0); player:completeMission(COP,AN_ETERNAL_MELODY); player:addMission(COP,ANCIENT_VOWS); elseif (csid == 0x006B) then player:setVar("PromathiaStatus",1); elseif (csid == 0x0070) then player:setVar("PromathiaStatus",1); elseif (csid == 0x0072) then player:setVar("PromathiaStatus",2); end end;
gpl-3.0
AdamGagorik/darkstar
scripts/zones/Meriphataud_Mountains/npcs/Muzeze.lua
13
1050
----------------------------------- -- Area: Meriphataud Mountains -- NPC: Muzeze -- Type: Armor Storer -- @pos -6.782 -18.428 208.185 119 ----------------------------------- package.loaded["scripts/zones/Meriphataud_Mountains/TextIDs"] = nil; ----------------------------------- require("scripts/zones/Meriphataud_Mountains/TextIDs"); ----------------------------------- -- onTrade Action ----------------------------------- function onTrade(player,npc,trade) end; ----------------------------------- -- onTrigger Action ----------------------------------- function onTrigger(player,npc) player:startEvent(0x002c); end; ----------------------------------- -- onEventUpdate ----------------------------------- function onEventUpdate(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); end; ----------------------------------- -- onEventFinish ----------------------------------- function onEventFinish(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); end;
gpl-3.0
AdamGagorik/darkstar
scripts/zones/Castle_Oztroja_[S]/Zone.lua
32
1281
----------------------------------- -- -- Zone: Castle_Oztroja_[S] (99) -- ----------------------------------- package.loaded["scripts/zones/Castle_Oztroja_[S]/TextIDs"] = nil; ----------------------------------- require("scripts/globals/settings"); require("scripts/zones/Castle_Oztroja_[S]/TextIDs"); ----------------------------------- -- onInitialize ----------------------------------- function onInitialize(zone) end; ----------------------------------- -- onZoneIn ----------------------------------- function onZoneIn(player,prevZone) local cs = -1; if (player:getXPos() == 0 and player:getYPos() == 0 and player:getZPos() == 0) then player:setPos(-239.447,-1.813,-19.98,250); end return cs; end; ----------------------------------- -- onRegionEnter ----------------------------------- function onRegionEnter(player,region) end; ----------------------------------- -- onEventUpdate ----------------------------------- function onEventUpdate(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); end; ----------------------------------- -- onEventFinish ----------------------------------- function onEventFinish(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); end;
gpl-3.0
mahmedhany128/Mr_BOT
plugins/translate.lua
3
2462
--[[ _____ ____ ____ ___ _____ |_ _| _ \ | __ ) / _ \_ _| | | | |_) | | _ \| | | || | | | | __/ | |_) | |_| || | |_| |_| |____/ \___/ |_| KASPER TP (BY @kasper_dev) _ __ _ ____ ____ _____ ____ _____ ____ | |/ / / \ / ___|| _ \| ____| _ \ |_ _| _ \ | ' / / _ \ \___ \| |_) | _| | |_) | | | | |_) | | . \ / ___ \ ___) | __/| |___| _ < | | | __/ |_|\_\/_/ \_\____/|_| |_____|_| \_\ |_| |_| --]] do function translate(source_lang, target_lang, text) local path = "http://translate.google.com/translate_a/single" -- URL query parameters local params = { client = "gtx", ie = "UTF-8", oe = "UTF-8", hl = "en", dt = "t", tl = target_lang or "en", sl = source_lang or "auto", q = URL.escape(text) } local query = format_http_params(params, true) local url = path..query local res, code = https.request(url) if code > 200 then return end local trans = res:gmatch("%[%[%[\"(.*)\"")():gsub("\"(.*)", "") return trans end function run(msg, matches) if #matches == 1 then print("First") local text = matches[1] return translate(nil, nil, text) end if #matches == 2 then print("Second") local target = matches[1] local text = matches[2] return translate(nil, target, text) end if #matches == 3 then print("Third") local source = matches[1] local target = matches[2] local text = matches[3] return translate(source, target, text) end end return { description = "", usage = { }, patterns = { "^[/!]tr ([%w]+).([%a]+) (.+)", "^[/!]tr ([%w]+) (.+)", "^[/!]tr (.+)", "^ترجم ([%w]+).([%a]+) (.+)", "^ترجم ([%w]+) (.+)", "^ترجم (.+)", }, run = run } end --[[ _____ ____ ____ ___ _____ |_ _| _ \ | __ ) / _ \_ _| | | | |_) | | _ \| | | || | | | | __/ | |_) | |_| || | |_| |_| |____/ \___/ |_| KASPER TP (BY @kasper_dev) _ __ _ ____ ____ _____ ____ _____ ____ | |/ / / \ / ___|| _ \| ____| _ \ |_ _| _ \ | ' / / _ \ \___ \| |_) | _| | |_) | | | | |_) | | . \ / ___ \ ___) | __/| |___| _ < | | | __/ |_|\_\/_/ \_\____/|_| |_____|_| \_\ |_| |_| --]]
gpl-2.0
AdamGagorik/darkstar
scripts/zones/Cloister_of_Tremors/bcnms/puppet_master.lua
27
1588
----------------------------------- -- Area: Cloister of Tremors -- BCNM: The Puppet Master -- @pos -539 1 -493 209 ----------------------------------- package.loaded["scripts/zones/Cloister_of_Tremors/TextIDs"] = nil; ------------------------------------- require("scripts/globals/quests"); require("scripts/zones/Cloister_of_Tremors/TextIDs"); ----------------------------------- -- After registering the BCNM via bcnmRegister(bcnmid) function onBcnmRegister(player,instance) end; -- Physically entering the BCNM via bcnmEnter(bcnmid) function onBcnmEnter(player,instance) end; -- Leaving the BCNM by every mean possible, given by the LeaveCode -- 1=Select Exit on circle -- 2=Winning the BC -- 3=Disconnected or warped out -- 4=Losing the BC -- via bcnmLeave(1) or bcnmLeave(2). LeaveCodes 3 and 4 are called -- from the core when a player disconnects or the time limit is up, etc function onBcnmLeave(player,instance,leavecode) -- print("leave code "..leavecode); if (leavecode == 2) then -- play end CS. Need time and battle id for record keeping + storage player:startEvent(0x7d01,1,1,1,instance:getTimeInside(),1,1,2); elseif (leavecode == 4) then player:startEvent(0x7d02); end end; function onEventUpdate(player,csid,option) -- print("bc update csid "..csid.." and option "..option); end; function onEventFinish(player,csid,option) -- print("bc finish csid "..csid.." and option "..option); if (csid == 0x7d01 and player:getVar("ThePuppetMasterProgress") == 2) then player:setVar("ThePuppetMasterProgress",3); end; end;
gpl-3.0
Hostle/luci
modules/luci-base/luasrc/http/protocol.lua
2
15535
-- Copyright 2008 Freifunk Leipzig / Jo-Philipp Wich <jow@openwrt.org> -- Licensed to the public under the Apache License 2.0. -- This class contains several functions useful for http message- and content -- decoding and to retrive form data from raw http messages. module("luci.http.protocol", package.seeall) local ltn12 = require("luci.ltn12") HTTP_MAX_CONTENT = 1024*8 -- 8 kB maximum content size -- the "+" sign to " " - and return the decoded string. function urldecode( str, no_plus ) local function __chrdec( hex ) return string.char( tonumber( hex, 16 ) ) end if type(str) == "string" then if not no_plus then str = str:gsub( "+", " " ) end str = str:gsub( "%%([a-fA-F0-9][a-fA-F0-9])", __chrdec ) end return str end -- from given url or string. Returns a table with urldecoded values. -- Simple parameters are stored as string values associated with the parameter -- name within the table. Parameters with multiple values are stored as array -- containing the corresponding values. function urldecode_params( url, tbl ) local params = tbl or { } if url:find("?") then url = url:gsub( "^.+%?([^?]+)", "%1" ) end for pair in url:gmatch( "[^&;]+" ) do -- find key and value local key = urldecode( pair:match("^([^=]+)") ) local val = urldecode( pair:match("^[^=]+=(.+)$") ) -- store if type(key) == "string" and key:len() > 0 then if type(val) ~= "string" then val = "" end if not params[key] then params[key] = val elseif type(params[key]) ~= "table" then params[key] = { params[key], val } else table.insert( params[key], val ) end end end return params end function urlencode( str ) local function __chrenc( chr ) return string.format( "%%%02x", string.byte( chr ) ) end if type(str) == "string" then str = str:gsub( "([^a-zA-Z0-9$_%-%.%~])", __chrenc ) end return str end -- separated by "&". Tables are encoded as parameters with multiple values by -- repeating the parameter name with each value. function urlencode_params( tbl ) local enc = "" for k, v in pairs(tbl) do if type(v) == "table" then for i, v2 in ipairs(v) do enc = enc .. ( #enc > 0 and "&" or "" ) .. urlencode(k) .. "=" .. urlencode(v2) end else enc = enc .. ( #enc > 0 and "&" or "" ) .. urlencode(k) .. "=" .. urlencode(v) end end return enc end -- (Internal function) -- Initialize given parameter and coerce string into table when the parameter -- already exists. local function __initval( tbl, key ) if tbl[key] == nil then tbl[key] = "" elseif type(tbl[key]) == "string" then tbl[key] = { tbl[key], "" } else table.insert( tbl[key], "" ) end end -- (Internal function) -- Append given data to given parameter, either by extending the string value -- or by appending it to the last string in the parameter's value table. local function __appendval( tbl, key, chunk ) if type(tbl[key]) == "table" then tbl[key][#tbl[key]] = tbl[key][#tbl[key]] .. chunk else tbl[key] = tbl[key] .. chunk end end -- (Internal function) -- Finish the value of given parameter, either by transforming the string value -- or - in the case of multi value parameters - the last element in the -- associated values table. local function __finishval( tbl, key, handler ) if handler then if type(tbl[key]) == "table" then tbl[key][#tbl[key]] = handler( tbl[key][#tbl[key]] ) else tbl[key] = handler( tbl[key] ) end end end -- Table of our process states local process_states = { } -- Extract "magic", the first line of a http message. -- Extracts the message type ("get", "post" or "response"), the requested uri -- or the status code if the line descripes a http response. process_states['magic'] = function( msg, chunk, err ) if chunk ~= nil then -- ignore empty lines before request if #chunk == 0 then return true, nil end -- Is it a request? local method, uri, http_ver = chunk:match("^([A-Z]+) ([^ ]+) HTTP/([01]%.[019])$") -- Yup, it is if method then msg.type = "request" msg.request_method = method:lower() msg.request_uri = uri msg.http_version = tonumber( http_ver ) msg.headers = { } -- We're done, next state is header parsing return true, function( chunk ) return process_states['headers']( msg, chunk ) end -- Is it a response? else local http_ver, code, message = chunk:match("^HTTP/([01]%.[019]) ([0-9]+) ([^\r\n]+)$") -- Is a response if code then msg.type = "response" msg.status_code = code msg.status_message = message msg.http_version = tonumber( http_ver ) msg.headers = { } -- We're done, next state is header parsing return true, function( chunk ) return process_states['headers']( msg, chunk ) end end end end -- Can't handle it return nil, "Invalid HTTP message magic" end -- Extract headers from given string. process_states['headers'] = function( msg, chunk ) if chunk ~= nil then -- Look for a valid header format local hdr, val = chunk:match( "^([A-Za-z][A-Za-z0-9%-_]+): +(.+)$" ) if type(hdr) == "string" and hdr:len() > 0 and type(val) == "string" and val:len() > 0 then msg.headers[hdr] = val -- Valid header line, proceed return true, nil elseif #chunk == 0 then -- Empty line, we won't accept data anymore return false, nil else -- Junk data return nil, "Invalid HTTP header received" end else return nil, "Unexpected EOF" end end -- data line by line with the trailing \r\n stripped of. function header_source( sock ) return ltn12.source.simplify( function() local chunk, err, part = sock:receive("*l") -- Line too long if chunk == nil then if err ~= "timeout" then return nil, part and "Line exceeds maximum allowed length" or "Unexpected EOF" else return nil, err end -- Line ok elseif chunk ~= nil then -- Strip trailing CR chunk = chunk:gsub("\r$","") return chunk, nil end end ) end -- Content-Type. Stores all extracted data associated with its parameter name -- in the params table withing the given message object. Multiple parameter -- values are stored as tables, ordinary ones as strings. -- If an optional file callback function is given then it is feeded with the -- file contents chunk by chunk and only the extracted file name is stored -- within the params table. The callback function will be called subsequently -- with three arguments: -- o Table containing decoded (name, file) and raw (headers) mime header data -- o String value containing a chunk of the file data -- o Boolean which indicates wheather the current chunk is the last one (eof) function mimedecode_message_body( src, msg, filecb ) if msg and msg.env.CONTENT_TYPE then msg.mime_boundary = msg.env.CONTENT_TYPE:match("^multipart/form%-data; boundary=(.+)$") end if not msg.mime_boundary then return nil, "Invalid Content-Type found" end local tlen = 0 local inhdr = false local field = nil local store = nil local lchunk = nil local function parse_headers( chunk, field ) local stat repeat chunk, stat = chunk:gsub( "^([A-Z][A-Za-z0-9%-_]+): +([^\r\n]+)\r\n", function(k,v) field.headers[k] = v return "" end ) until stat == 0 chunk, stat = chunk:gsub("^\r\n","") -- End of headers if stat > 0 then if field.headers["Content-Disposition"] then if field.headers["Content-Disposition"]:match("^form%-data; ") then field.name = field.headers["Content-Disposition"]:match('name="(.-)"') field.file = field.headers["Content-Disposition"]:match('filename="(.+)"$') end end if not field.headers["Content-Type"] then field.headers["Content-Type"] = "text/plain" end if field.name and field.file and filecb then __initval( msg.params, field.name ) __appendval( msg.params, field.name, field.file ) store = filecb elseif field.name then __initval( msg.params, field.name ) store = function( hdr, buf, eof ) __appendval( msg.params, field.name, buf ) end else store = nil end return chunk, true end return chunk, false end local function snk( chunk ) tlen = tlen + ( chunk and #chunk or 0 ) if msg.env.CONTENT_LENGTH and tlen > tonumber(msg.env.CONTENT_LENGTH) + 2 then return nil, "Message body size exceeds Content-Length" end if chunk and not lchunk then lchunk = "\r\n" .. chunk elseif lchunk then local data = lchunk .. ( chunk or "" ) local spos, epos, found repeat spos, epos = data:find( "\r\n--" .. msg.mime_boundary .. "\r\n", 1, true ) if not spos then spos, epos = data:find( "\r\n--" .. msg.mime_boundary .. "--\r\n", 1, true ) end if spos then local predata = data:sub( 1, spos - 1 ) if inhdr then predata, eof = parse_headers( predata, field ) if not eof then return nil, "Invalid MIME section header" elseif not field.name then return nil, "Invalid Content-Disposition header" end end if store then store( field, predata, true ) end field = { headers = { } } found = found or true data, eof = parse_headers( data:sub( epos + 1, #data ), field ) inhdr = not eof end until not spos if found then -- We found at least some boundary. Save -- the unparsed remaining data for the -- next chunk. lchunk, data = data, nil else -- There was a complete chunk without a boundary. Parse it as headers or -- append it as data, depending on our current state. if inhdr then lchunk, eof = parse_headers( data, field ) inhdr = not eof else -- We're inside data, so append the data. Note that we only append -- lchunk, not all of data, since there is a chance that chunk -- contains half a boundary. Assuming that each chunk is at least the -- boundary in size, this should prevent problems store( field, lchunk, false ) lchunk, chunk = chunk, nil end end end return true end return ltn12.pump.all( src, snk ) end -- Content-Type. Stores all extracted data associated with its parameter name -- in the params table withing the given message object. Multiple parameter -- values are stored as tables, ordinary ones as strings. function urldecode_message_body( src, msg ) local tlen = 0 local lchunk = nil local function snk( chunk ) tlen = tlen + ( chunk and #chunk or 0 ) if msg.env.CONTENT_LENGTH and tlen > tonumber(msg.env.CONTENT_LENGTH) + 2 then return nil, "Message body size exceeds Content-Length" elseif tlen > HTTP_MAX_CONTENT then return nil, "Message body size exceeds maximum allowed length" end if not lchunk and chunk then lchunk = chunk elseif lchunk then local data = lchunk .. ( chunk or "&" ) local spos, epos repeat spos, epos = data:find("^.-[;&]") if spos then local pair = data:sub( spos, epos - 1 ) local key = pair:match("^(.-)=") local val = pair:match("=([^%s]*)%s*$") if key and #key > 0 then __initval( msg.params, key ) __appendval( msg.params, key, val ) __finishval( msg.params, key, urldecode ) end data = data:sub( epos + 1, #data ) end until not spos lchunk = data end return true end return ltn12.pump.all( src, snk ) end -- version, message headers and resulting CGI environment variables from the -- given ltn12 source. function parse_message_header( src ) local ok = true local msg = { } local sink = ltn12.sink.simplify( function( chunk ) return process_states['magic']( msg, chunk ) end ) -- Pump input data... while ok do -- get data ok, err = ltn12.pump.step( src, sink ) -- error if not ok and err then return nil, err -- eof elseif not ok then -- Process get parameters if ( msg.request_method == "get" or msg.request_method == "post" ) and msg.request_uri:match("?") then msg.params = urldecode_params( msg.request_uri ) else msg.params = { } end -- Populate common environment variables msg.env = { CONTENT_LENGTH = msg.headers['Content-Length']; CONTENT_TYPE = msg.headers['Content-Type'] or msg.headers['Content-type']; REQUEST_METHOD = msg.request_method:upper(); REQUEST_URI = msg.request_uri; SCRIPT_NAME = msg.request_uri:gsub("?.+$",""); SCRIPT_FILENAME = ""; -- XXX implement me SERVER_PROTOCOL = "HTTP/" .. string.format("%.1f", msg.http_version); QUERY_STRING = msg.request_uri:match("?") and msg.request_uri:gsub("^.+?","") or "" } -- Populate HTTP_* environment variables for i, hdr in ipairs( { 'Accept', 'Accept-Charset', 'Accept-Encoding', 'Accept-Language', 'Connection', 'Cookie', 'Host', 'Referer', 'User-Agent', } ) do local var = 'HTTP_' .. hdr:upper():gsub("%-","_") local val = msg.headers[hdr] msg.env[var] = val end end end return msg end -- This function will examine the Content-Type within the given message object -- to select the appropriate content decoder. -- Currently the application/x-www-urlencoded and application/form-data -- mime types are supported. If the encountered content encoding can't be -- handled then the whole message body will be stored unaltered as "content" -- property within the given message object. function parse_message_body( src, msg, filecb ) -- Is it multipart/mime ? if msg.env.REQUEST_METHOD == "POST" and msg.env.CONTENT_TYPE and msg.env.CONTENT_TYPE:match("^multipart/form%-data") then return mimedecode_message_body( src, msg, filecb ) -- Is it application/x-www-form-urlencoded ? elseif msg.env.REQUEST_METHOD == "POST" and msg.env.CONTENT_TYPE and msg.env.CONTENT_TYPE:match("^application/x%-www%-form%-urlencoded") then return urldecode_message_body( src, msg, filecb ) -- Unhandled encoding -- If a file callback is given then feed it chunk by chunk, else -- store whole buffer in message.content else local sink -- If we have a file callback then feed it if type(filecb) == "function" then local meta = { name = "raw", encoding = msg.env.CONTENT_TYPE } sink = function( chunk ) if chunk then return filecb(meta, chunk, false) else return filecb(meta, nil, true) end end -- ... else append to .content else msg.content = "" msg.content_length = 0 sink = function( chunk ) if chunk then if ( msg.content_length + #chunk ) <= HTTP_MAX_CONTENT then msg.content = msg.content .. chunk msg.content_length = msg.content_length + #chunk return true else return nil, "POST data exceeds maximum allowed length" end end return true end end -- Pump data... while true do local ok, err = ltn12.pump.step( src, sink ) if not ok and err then return nil, err elseif not ok then -- eof return true end end return true end end statusmsg = { [200] = "OK", [206] = "Partial Content", [301] = "Moved Permanently", [302] = "Found", [304] = "Not Modified", [400] = "Bad Request", [403] = "Forbidden", [404] = "Not Found", [405] = "Method Not Allowed", [408] = "Request Time-out", [411] = "Length Required", [412] = "Precondition Failed", [416] = "Requested range not satisfiable", [500] = "Internal Server Error", [503] = "Server Unavailable", }
apache-2.0
AdamGagorik/darkstar
scripts/globals/items/plate_of_urchin_sushi.lua
17
1538
----------------------------------------- -- ID: 5151 -- Item: plate_of_urchin_sushi -- Food Effect: 30Min, All Races ----------------------------------------- -- Health 40 -- Strength 1 -- Vitality 5 -- Accuracy % 15 -- Ranged ACC % 15 -- Sleep Resist 5 ----------------------------------------- require("scripts/globals/status"); ----------------------------------------- -- OnItemCheck ----------------------------------------- function onItemCheck(target) local result = 0; if (target:hasStatusEffect(EFFECT_FOOD) == true or target:hasStatusEffect(EFFECT_FIELD_SUPPORT_FOOD) == true) then result = 246; end return result; end; ----------------------------------------- -- OnItemUse ----------------------------------------- function onItemUse(target) target:addStatusEffect(EFFECT_FOOD,0,0,1800,5151); end; ----------------------------------- -- onEffectGain Action ----------------------------------- function onEffectGain(target,effect) target:addMod(MOD_HP, 40); target:addMod(MOD_STR, 1); target:addMod(MOD_VIT, 5); target:addMod(MOD_FOOD_ACCP, 15); target:addMod(MOD_FOOD_RACCP, 15); target:addMod(MOD_SLEEPRES, 5); end; ----------------------------------------- -- onEffectLose Action ----------------------------------------- function onEffectLose(target,effect) target:delMod(MOD_HP, 40); target:delMod(MOD_STR, 1); target:delMod(MOD_VIT, 5); target:delMod(MOD_FOOD_ACCP, 15); target:delMod(MOD_FOOD_RACCP, 15); target:delMod(MOD_SLEEPRES, 5); end;
gpl-3.0
Nathan22Miles/sile
languages/cy.lua
4
63370
SILE.hyphenator.languages["cy"] = {}; SILE.hyphenator.languages["cy"].patterns = { ".ac4t", ".ad3ae", ".add5as", ".add3o", ".ad4eg", ".ad4eny", ".ad4fer", ".adl4", ".ad3r", ".ae3a", ".af3a", ".af4an", ".aff3", ".afl4u", ".af5lw", ".ag3w", ".am4le", ".am3s", ".an5ad", ".an4g3", ".anghen5a", ".anghen4r", ".an2o", ".anrhyd4", ".ansodd4e", ".an5te", ".an3w4", ".an5we", ".ar4bo", ".ar4cha", ".ar5ddel", ".ared4", ".ar4en", ".arff4", ".ar4ge", ".ar2i", ".ar3we", ".ar4wed", ".as3g", ".as3t", ".aw4e", ".ban4as", ".ban4ed", ".bara5t", ".bel3y", ".be3t4a", ".bl2", ".bl4e", ".br2", ".br4e", ".call5", ".ce4n", ".ch2", ".ch4e", ".ch4l", ".ch4o", ".chollad4", ".chr2", ".chwyn5", ".cl2", ".cr2", ".cy5we", ".dad3r", ".dd2", ".ddefn5", ".dd4i", ".ddi5an", ".ddi5dd", ".ddi3e", ".ddill5adas", ".ddill5ade", ".ddill5ado", ".ddill5adw", ".ddin4", ".ddiw5eddas", ".ddiw5edde", ".ddiw5eddo", ".ddiw5eddw", ".ddwl3", ".ddy5fala", ".ddy5fale", ".ddy5falo", ".ddy5falw", ".ddylad4", ".deallad4", ".defn3", ".der4w", ".deth5", ".di5an", ".di5dd", ".di3e", ".di3gy", ".dill5adas", ".dill5ade", ".dill5ado", ".dill5adw", ".din4", ".diw5eddas", ".diw5edde", ".diw5eddo", ".diw5eddw", ".dr4e", ".dwl3", ".dy5fala", ".dy5fale", ".dy5falo", ".dy5falw", ".dy5fo", ".dylad4", ".dyrchafad4", ".eb2", ".eb3r", ".eb4rw", ".ec2", ".ed2", ".edl4", ".edr4", ".eg2", ".egn3", ".el4or", ".els4", ".en3as", ".eny5na", ".er2", ".erfy5na", ".ern4", ".ewy5na", ".fadd3", ".falch5", ".fan3a", ".farn4ais.", ".fasg4", ".fas5ge", ".ff2", ".ff4a", ".ffer4a", ".ffe5ras", ".ffer4e", ".ff4o", ".ffor5t", ".ff4y", ".ffydd5", ".ffynad4", ".ffy5nas", ".fign5", ".fis5g", ".fon4edi", ".fordd4", ".for4o", ".for4w", ".for4y", ".fr4i", ".fryn4d", ".fydd5", ".fyn5as", ".fyw3", ".gal3e", ".gal5o", ".gan3l", ".gan5olas", ".gan5ole", ".gen5as", ".ger5b", ".geu5d", ".ghwy5na", ".gl2", ".glaf5y", ".gl4e", ".gleid4", ".gl4y", ".glyn3", ".glywad4", ".god3y", ".gof3a", ".goffad4wy", ".gollad4", ".gr2", ".grynho4em", ".grynho4wn", ".gwedd4er", ".gyd3", ".gyf5al", ".gyf5arc", ".gyfer5byna", ".gyfer5byni", ".gyfer5bynn", ".gyffel5", ".gym3o", ".gyn3a", ".gyn5e", ".gynef5", ".gyth5ru", ".gy5we", ".hac4", ".hadl4", ".haf4a", ".haf3l4", ".hagr3", ".ham4le", ".han5as", ".han4g5", ".hanghen5a", ".han5t", ".han5w4", ".har5ddel", ".hared4", ".har4en", ".har3n", ".harn4a", ".har3w", ".has3g", ".haw4", ".heb2", ".hec2", ".hed2", ".hedl4", ".he4o", ".herfy5na", ".her4w", ".heur5", ".hof4r3", ".hol4y", ".holyn5", ".hw2", ".hwn4", ".hwyl5u", ".hwyn5a", ".hwyr5", ".hwyth4au", ".hyd4", ".hydr4", ".hy3ff", ".hyf4od", ".hy5fry", ".hy3g", ".hyl4", ".hym3e", ".hym4u", ".hym4y", ".hymy5na", ".hymysg4", ".hyn2", ".hy3no", ".hy3rw", ".iach4", ".iac5has", ".iac5he", ".iac5hw", ".ir3", ".ladr3", ".ledr4e", ".le3na", ".le3o", ".lest4", ".lin3", ".ll2", ".llaw4e", ".lle5na", ".llo5nas", ".llon4e", ".llythr5", ".lo3na", ".lon4e", ".ludd3", ".lygr3", ".lyn3a", ".lythr5", ".man4ed", ".mant4a", ".mar4f", ".mign5", ".mis5g", ".mol3", ".mon4edi", ".mwyth5a", ".mwyth5w", ".myn5as", ".neilltu4ad", ".neis4i", ".nen3a", ".ner4w", ".ng2", ".ngen5as", ".nghyt5u", ".nghy5wa", ".ngl4", ".ng4w", ".ngy4", ".ni5an", ".ni3e", ".ni5fei", ".nig2", ".ni5ga", ".ni3ge", ".ni3gw", ".ni3gy", ".ni5re", ".ni3wa", ".niwl5", ".no4e", ".no4w", ".nwl3", ".nwyn3", ".oddefad4", ".od4l", ".of3a", ".of4o", ".of4u", ".og2", ".og4l4", ".ol2", ".oll3", ".ol5yga", ".ol5yge", ".olyn3", ".or1", ".orddad4", ".pl4a", ".pl4e", ".rad3r", ".rag3l", ".ra3na", ".ran5d4", ".rew3", ".rhi5a", ".ria4", ".rin4t", ".rug4l5", ".ry3n4a", ".ryn4e", ".sas4", ".ses4", ".st2", ".sych3", ".sych5e", ".talad4", ".tan4e", ".th2", ".thag5", ".th4i", ".tho5e", ".th4r4", ".thrad4", ".th4u", ".torad4", ".tr2", ".tr4a", ".trad4", ".tr4o", ".tro4en", ".uch2", ".wa5r4as", ".war4es", ".wedd4er", ".weithiad4", ".welad4", ".wen3a", ".west4", ".wn4io", ".wobr3", ".wybr4", ".wy3by", ".wy4r", ".wyw3", ".ydd4", ".yd4l", ".yf4ar", ".ym4adw", ".ym3e", ".ym4yl", ".ymysg4", ".yn4d", ".ys4b", ".ysg4", ".ys4i", ".ys4n", ".ys4t", "a1a", "a3ar2", "2ab", "ab3a", "ab4ad", "ab3ed", "ab3el", "ab5ine", "abl1", "a2b1o", "ab4or", "abr3", "a1bu", "a4bu.", "a4bum", "2ac", "ac1a", "ac5ade", "acan3", "ac4aol", "ac3ei", "ace3ne", "ac5enni.", "ach1", "a4ch.", "ach5ac", "ach5aw", "a5chef", "ach3o", "ach3r", "ach5us", "a3chwa", "achwyn5", "achy4", "aci5mw", "acl3", "ac3o", "ac3ta", "ac3te", "4ad3ac", "ad3ad", "ad5afa", "ad3arf", "adar4g", "a4dd.", "add3ad", "ad3dal", "ad3dd", "add3eu", "add5ew", "add3f", "add3i", "add2o", "ad4du", "addun4", "add3yc", "add3ys", "2ad1e", "ad3eg", "ad3el", "ad4el.", "ad4ena", "ad4ene", "ad4eni", "ad4eno", "ad4enw", "ad3i", "2adl", "ad3len", "ad5lys", "ad2na", "adnabydd4e", "adnabydded4", "ad2no", "2ado", "ad3oc", "ad3od", "ad3of", "ad3on", "4adr.", "ad4red", "ad3ri", "adr4od", "adr3on", "ad4ru", "4adunia", "ad5uniad", "ad5uro", "adwel4ed.", "ad3wi", "ad5wr.", "3ad3wys", "ad5wyt", "ad1y", "ady4n", "ad4yrn", "2aea", "ae4ada", "ae5an.", "aedd3", "ae3i", "ael1", "ael4edda", "aen3", "ae3oc", "ae3og", "aer1", "aerw4", "aer5we", "aer5wy", "aes3", "aest4", "aeth5a", "aethr4", "ae1w", "ae5wyd", "af3adw", "4af5aid", "af4al", "af3an", "afan5e", "af4ann", "4afar3", "af5arn", "af4at", "4af3au", "2af3e", "2aff", "aff3a", "aff3ed", "aff3ei", "aff3i", "affl3", "aff3w", "aff3y", "aff4yr", "af3i", "afl3a", "afl5edi", "af4l3u", "2afn1", "af3odd", "4afol", "af3ont", "2afr", "af3ra", "af3res", "af5rif", "af4ru", "af5rwy", "af1u", "2af1w", "af1y", "2a2g", "ag1a", "ag3ad", "ag3al", "age3na", "age5ne", "ag3law", "agl3o", "ag3lu", "agl3w", "ag3n", "ag3od", "ag3of", "ag4ori", "ag1r", "ag3ri", "ag3ry", "ag1u", "ag2w", "ag3wa", "ag3wel", "ag3wn", "ag3wr", "ag5yma", "agy4w", "a1h2", "ahan3", "ahanad4", "ahedr4", "a2i", "2aig", "2ail1", "ailen3", "2ain", "4ainc", "2ait", "2al", "al5abr", "al3ad", "4al3ae", "alaf3", "4alaid", "al3an", "al5arc", "al5aso", "al3ce", "alch3w", "al5cwl", "al4di", "al1e", "al5edau", "al3ei", "al3en", "al4ena", "al4es.", "al2fo", "al3fy", "al3i", "al4is", "all3a", "all3e", "all3i", "all3oc", "all3w", "all3y", "3aln", "al3oc", "al3od", "al4ogia", "alo3na", "alo3n4e", "al3ono", "al3or", "alp4e", "al1u", "4alwc", "alw3e", "4alwr", "al5wst", "al3wy", "4alwy.", "al1y", "2am", "ambl3", "am3d", "amdan5", "amel5o", "am3er", "amgym5r", "amhen4", "amhobl4", "amhryd4", "am5las", "am4led", "am4lf", "am4lg", "am5nif", "am4of", "am2or", "amor5w", "am4pa", "a4mwa", "am5wed", "am5wri", "am5wyd", "am3wyt", "amyn3", "a2n", "2an.", "an1a", "a4nab", "anadl3", "a4nae", "a4naf", "an4afi", "a4nai", "an2as", "an3at4", "a4nau", "a4naw", "4anco", "an2da", "an5dda", "an4ddy", "an2de", "an2do", "an1e", "an2ed", "an3ed.", "an5eda", "an5edd.", "an5edo", "a4n3eg", "a4nel", "an3eli", "an5er.", "an5ewi", "2anf", "an3fy", "2ang1", "ang3ad", "an4gd", "ang3e", "an4gf", "anghaff4", "anghelf4", "anghredad4", "anghrist4", "anghy4", "anghyd4", "anghydna4", "anghyf4", "anghyfar4", "anghyff4", "anghyfiawn4", "anghym4", "anghyn4e", "angl4", "ang5or", "an3if", "an3igi", "4annau", "an3oc", "an3od.", "an3odd", "an5og.", "an5og4ae", "4anol", "an3ol.", "an3om", "an3ont", "an3or", "1anr", "an5sic", "ans4ie", "ans4iw", "an5siwn", "an4ta", "ant5ac", "an5the", "ant3rw", "an1w", "an3wes", "4anwl", "anwy4", "an3wyd", "anwyn3", "an1y", "any4l3", "a1oe", "ap3a", "ap4cy", "ap5elw", "ap3l", "apl4a", "ap5ost", "ap5rwn", "ap5ryn", "ap5wll", "2ar", "ar3ab", "aradr3", "arae3", "ar3af.", "ara5ff", "ar3an", "ar4an.", "aran3a", "aran3e", "arat4", "ar3aw", "ar4ber", "arc3as", "arch5en", "ar5clo", "ar2da", "ar2de", "ard5es", "ar4dr", "ardyn3", "ar1e", "ar2eb", "ar2ei", "ar5eid", "ar3eit", "ar3fa", "arfan5", "arf5ed", "ar5fel", "ar4ff", "ar3fod", "ar1i", "ar4ian", "ar2m", "4arn.", "arn5adwy.", "ar4nd", "3arnh", "ar4no", "ar4nw", "ar4ny", "ar1o", "ar4od.", "ar4odi", "arogl3", "3aror", "ar3os", "5aros.", "ar4p3as", "arp3w", "ar3sy", "ar3te", "ar4th3", "ar3ug", "ar3ut", "aru5wc", "3arwai", "ar5wch", "arwd2", "arw5der", "ar3wed", "3ar3wi", "arw3n", "ar3wn.", "ar3wni", "ar3wy", "4arwyn", "ar3y", "2as.", "2asas", "as5awr", "1asb", "as5boe", "2asd", "2ased", "as4enn", "2asf", "2asg", "as5gal", "asgl3", "asg4oda", "as3gwr", "asg3wy", "2asia", "4asie", "2asl", "2asn", "as4ny", "as4od.", "2asoe", "2asr", "2ast", "as4tal", "as3tan", "astat5", "as3te", "as4tl", "as4tr", "as5trus", "ast2w", "as5ty.", "as3tyl", "astyn3", "2asu", "as3ur", "as5wir", "2aswr", "2asy", "as5ynn", "2a2t", "at3ad", "at5alf", "ateb3", "at3em", "ath3a", "athl3", "ath3o", "ath4r3e", "athr3w", "athr5yc", "ath3w", "ath3y", "ato2i", "at3ol", "a3tô", "at3ran", "atr5oc", "at3rod", "atro5e", "atr5yc", "at3wy", "aty3na", "aty5ne", "a2u", "2aul", "2aw", "aw1a", "aw5art", "aw5chw", "aw5ddr", "aw5dry", "aw3ed", "aw3ei", "aw3el", "aw3es", "aw3f", "aw3ga", "aw1i", "awl5ed", "awn3a", "awr1", "awr3d", "awy4r3", "3áu.", "1â", "bab4i", "bab5yd", "b3ac", "bach3", "badd3", "b3adw", "1bae", "2baet", "b1af", "b1ai", "b1an", "ban3a", "ban3e", "b4ann", "ban3o", "5barch", "bar4f", "bar4lys.", "barn3", "bar4wy", "b1as", "bas3g2", "bast4", "bat4a", "b4ath", "b1au", "bawd4a", "bawe5na", "b1d", "b1ec", "2bed", "beir4a", "be4iw", "b1em", "ben4ae", "be3nas", "be5ned", "bengl4", "bens4", "bent4", "b3ent.", "ben3w", "benwy5na", "b3ert", "b3esi", "bgal4", "2b1i", "b3ia", "bi5aidd", "3bib1", "b3id3", "b3ie", "3b2ig1", "b4inc", "bin2e", "b3io", "b3ir", "bisg4", "b3it", "bl3af", "bl5air", "bla3na", "bla5nedi", "bla5nes", "2blau", "bl5awd", "bl3ec", "bl4enni.", "blew3", "4blwr", "b4lyc", "4blyn", "bl5yn.", "bo4b4l", "b1oc", "4b3odd", "bol3", "b1om", "b2on", "bon4d", "b2r", "bra3na", "br3ed", "breg3y", "br3em", "br4enn", "br2i", "br4il", "br3ir", "brod4iae", "brog4", "br4wd", "bryf3", "bryn4d", "b1s2", "bse3na", "bse5ne", "2bu.", "1bua", "budd4l", "bu4lo", "3buo", "bw3a", "b1wc", "3bwll", "b1wn", "b4wns", "bwr1", "4bwyd", "b3wyd.", "4b3wyf", "bwyllt4", "3bwyn", "bwy4r3", "2by", "b3ych.", "bydd5i", "b2yl", "3bylla", "by3na", "by3ned", "by3nes", "byrf4", "b4yrw", "3byst.", "byw3", "cabl4en", "c1ad", "cad3a", "cad3l", "cae4a", "caethiw4ed", "c1af", "c3ai", "cal3e", "cal3o", "cam4enn", "camn4", "can3a", "ca4ne", "canghe5na", "can3l", "c4ann", "can5olas", "can5ole", "c3ant", "can4yd", "car4en", "car4ped.", "c1as", "casg4e", "3cat", "ca4t3r", "c3au", "c3áu", "c1b", "cd2", "c1e", "c3ed", "c5edig", "ceg3", "c3el", "c2en", "ce3na", "c3ent", "cer5by", "cer4f", "cer3y", "ceu4l", "c3ff", "3chae", "ch3af.", "ch4afb", "ch4afi", "chan3a", "changhe5na", "char4enn", "chasg4e", "chdr5y", "ch3eba", "ch3ebe", "ch3ebi", "ch3ebo", "ch3ebw", "ch3ech", "ch3ed.", "ch3edi", "5chein", "chelad4", "ch3ent", "chen3y", "ch3er.", "cher4f", "ch3esg", "3chest", "4chestio", "4chestol", "4chestwa", "4chestwe", "ch3eta", "ch5ig.", "chleid4", "chl5ent", "4chmyni", "4chmynnol", "chn5eg", "chob3", "chobl4", "ch3odd", "chon5ad4", "ch3ont", "chon4y", "chra4", "ch4ro", "4chu.", "ch4ub", "4chus", "5chwant", "ch3wch", "chw4f", "ch4wi", "ch3wn.", "ch3wyf", "chyd3", "chym4an", "ch4ynn", "chysg3", "chys5o", "chyt3u", "chy5wa", "c1i", "cib3", "cig1", "c3in", "ci3od.", "cl2e", "cleid4", "cl2i", "c1ll", "cllon3", "cloe4", "cl2w", "cl4wm", "cly4w", "clywad4", "cn2", "cno4en", "cn4yw", "cob1", "co4bl4", "c1oc", "c1od", "cod4l", "coffad4wy", "collad4", "c1om", "c1on", "con4y", "corn4an", "cosb3", "cr3ae", "cra4m", "3crat", "credad4", "cr4el", "cr3ie", "cring4", "crof4", "crog3", "cron4a", "cro5nas", "cron4e", "cryg3", "crygl4", "cr4yl", "cr4ym", "crynho4em", "crynho4i", "cs3a", "c3s4aw", "cs3yn", "ct2a", "c4teg", "ct4id", "c1to", "ctor3", "c3tr", "1cu", "2cus", "c1w", "c3wa", "cwast3", "cw4fa", "cwm3", "cwn4ed", "c3wy", "c4wyn3", "cwy4r", "cyb3y", "2c1yc", "cych3", "cyd3", "cydl4", "cydr4", "cy4f3a", "cyfer3", "cyffel5", "c1yl", "cyll5a", "cym3", "cym4an", "cym4ero", "c1yn", "cyn3a", "c5ynau", "cyn3e", "cynef3", "c2yny", "cy4se", "cysg3", "cys5on", "cys3t", "cys3w", "cyth5rud", "cy1w", "cy3wa", "cy3wi", "cy3wy", "d1a2", "dach3", "d3ach.", "d5achwr", "d2ad", "dad3u", "dad3w", "d5adwy", "dae5ara", "dae5ared", "dae5ari", "dae5arw", "d2ael", "d4afe", "d4afo", "dag1", "dag3w", "4dail", "da5ion", "d4ait", "d4al.", "d4ald", "d4aln", "d4alr", "d2an3a", "d2an3e", "dan3f", "d2ano", "d2anu", "d2anw", "d2any", "dar3a", "dar4ana", "dar4d", "darf2", "d5arne", "dar3w", "d5aryd", "2das", "2dau", "2daw", "dawd3", "d5awd.", "d1b", "ddad3r", "4ddaf", "3ddang", "dd4ani", "dd3ara", "dd3ari", "dd3arw", "2ddas", "dd4aw", "ddd2", "d4dda", "ddd4e", "dd4d4i4", "dd3dr", "dd4du", "dd4dy", "dd5dy.", "dd3er.", "ddeth5", "ddeuad4", "dd4eug", "dd4ew", "dd2f", "dd4fg", "2ddi.", "dd4ic", "dd4if", "ddif3a", "dd4ig.", "ddi3gy", "dd4il", "dd4im", "dd4ini", "4ddit", "dd1l2", "dd5len", "2ddo.", "4ddoc", "dd3odd", "4ddom", "4ddon3", "dd2or3", "ddr2", "ddr4a", "ddr4e", "ddr4i", "ddr4o", "ddr4w", "dd4ry", "d2du", "4dd3un", "dd5us.", "dd5waw", "4ddwc", "dd2we", "4ddwn", "5ddwrn", "dd4wyn", "3ddwyr", "dd2y", "4ddyc", "dd4ydd", "dd5yf.", "ddym4d", "dd4yn", "ddy5nad", "5ddyni", "4ddynt", "3ddyr", "3deb.", "debr3", "d1ec", "dech4a", "d1ed", "d5edd.", "deddf3", "def3a", "d1eg", "d5egol.", "de1h", "deheu5", "d2eil", "d4eim", "delff5", "d3ella", "d3elle", "d3elli", "d3ello", "dellt5", "d3ellw", "del3o", "d1em", "d3em.", "2d1en1", "d4eng", "d3ent", "de2o", "der3f", "derfyn5", "2d1es", "d3esi", "5destu", "d1et", "det5an", "deth4o", "d1eu1", "deul4", "deu4ny", "d4eut", "d1f2", "d3f4ae", "df4ann", "df4ao", "d4fa5ol", "df4at", "df4aw", "dfed5r", "d3fei", "dfe5ne", "d5ferf", "d4fery", "dff4y", "d2fi", "df4id", "df4od", "d4f3ol", "df4ry", "d2fu", "dfwr2", "d4fyd", "dfyn3a", "dfyn4ed.", "d1g2", "dgam2", "dgan5e", "dg4ei", "dgl2", "dgrynho5", "dgyf5ar", "d1h2", "dha5ol", "dhegl5", "2d1i", "di5ach", "di1b2", "dibryd4", "di1d", "did2e", "di5den", "d4ido", "di5dos", "di4et", "di3eu", "dif4an", "di5fat", "di3fe", "di3ffr", "di5fli", "di5flo", "di5fra", "di3fw", "di5gab", "dig2e", "di5gel", "di3gen", "dige5na", "dige5ne", "digl4", "di5gof", "di3gry", "di3gw", "dig2y", "di3gym4", "di3gys", "dil4a", "dil4e", "di5lec", "di5les", "dill4a", "di3lu", "dil2w", "di3lys", "d3in.", "di5niw", "di3nod", "d4inoe", "di3or", "d2ir", "d3ir.", "di3ra", "d4i3r2e", "di5rif", "3d4iro", "di4rw", "di3rym", "dis3g", "di3so", "dis3t", "di3sw", "di3sy", "4d3it.", "d2iw2", "d4iw.", "di3w4a", "d4iwe", "di5wen", "d3iwyf", "d1ï", "d3ladd", "dladr3", "dl3af", "d3lam", "d4lau", "dl3ed", "d3l4ei", "d4len.", "dle3na", "dle5ne", "d4lent", "dl3er", "d3lew", "d2lo", "dl3oc", "dl3od", "d3lon3", "dlon5e", "d1lu", "dludd3", "d2lw", "dl3yc", "d3lyd.", "d3lyn", "dl4yr", "d3lyw", "d1m2", "dm4ar", "dm4er", "dm4od", "d3my", "d1n", "d3nap", "dn3as", "d3naw", "dneb4", "d2n3ed", "dn3es", "d2ni", "d3ni.", "dno2i", "d3nos", "d2n1w", "d2ny", "d1o", "d3och", "d2od.", "d2odi", "d4odia", "dod3r", "2doe", "do4en", "d2of", "dof5yddio", "d3ol.", "d4oll", "dol4wg", "d3om", "don2a", "don2e", "d3ont", "dor2a", "dor4da", "dor5we", "dos3", "do2w", "2dr.", "3dra.", "dr3ad.", "dr3ada", "dradd3", "dr3adw", "dr3a4f", "dr5aid", "dr5ain", "dram4g", "dr4an.", "dra3na", "dra3ne", "dr4ann", "dr3ant", "dr5au.", "dr3c", "dr3ed", "dr4edo", "dr3en", "d4reu", "drew3", "dr3f", "drff4", "dr4iau", "d4r3id", "d4rir", "d4roe", "dro3es", "4drog", "drog4e", "dr3ol", "dr5ol.", "dr3on.", "dron3a", "dr3ont", "d4rwg", "dr3wn", "dr3wyf", "dr3yd", "dr3yn.", "d3ryw", "d1s2", "d1ug1", "d4un.", "dun3a", "d4unia", "d1ur", "d1us", "1dut", "du5wch", "d1w", "dw2a", "dw3adw", "d3wae", "dw3af", "d3wait", "d3wal", "dw3an", "dw3as", "dwb3", "dwbl4", "d3wc", "dwd2", "dw3edi", "d2wen", "dwer5y", "d4w3id", "d4w3ir", "d4wit", "dw5mig", "dw3o", "dwr3e", "d2wrn", "dwy3b", "d4wyc", "dwyn3", "dwy4on.", "d2wyr", "3dy.", "d1yc", "d5ych.", "d1yd", "d3yd.", "4dydd", "dyd2w", "dydw5y", "dyf5an", "dyff4", "dyf4n3", "dyf4od", "dyf5odd", "dy5fodi", "dyf2r3", "dyfrad4", "d3yg.", "d3ygl", "dy3gy", "d2yl", "dyl5ad", "dy3lan", "dyll3", "dy3lu", "d1ym", "dymag5", "dym5od", "3dyna", "dy3nas", "dy3nes", "dy3n4od", "dy3r2a", "dyr2e", "dy3ri", "dy5ryd", "2dys.", "4dysa", "dys4g", "dysg5a", "4dyso", "2ea", "e1ad", "e4adf", "e4adl", "eaf1", "e3af.", "ea4fa", "e4afg", "e1ai", "e1an3", "e4ang", "ear1", "earf2", "ear5fo", "earn4i", "e1as", "e1au", "e3aw", "eb3ad", "eb5ar.", "eb1e", "ebl2", "eb1o", "eb3ont", "ebra5ne", "ebr3e", "eb4r3i", "ebr3o", "eb1w", "eb3wy", "eb5yll", "2ec1a", "2ec3e", "ech1", "ech5od", "echr4", "ech3ry", "ech5we", "ech5wyd", "echwy5na", "echwy5ne", "2eco", "econ2", "eco5no", "ec5ord", "ecr1", "2ect", "ec4to", "2ecw", "ec3y", "2ed3a", "ed4al", "edd3ad", "edd3al", "edd3ar", "edd3e", "2eddf", "eddf3a", "eddf5i", "eddf3o", "eddf3w", "eddf3y", "4eddg", "edd3o", "edd3yc", "edd3yg", "edd5yla", "edd5yled", "edd5ylo", "edd5ylw", "edd5yn", "ed1e", "ed3eg", "ed2ei", "eden5a", "ed3fa", "ed3fe", "ed3fi", "edf4w", "4edia", "edi4f", "ed3ig", "ed3i4n", "ed3ir", "ed3iw", "3edï", "2edl1", "ed4lo", "4edr.", "edr3e", "edr3o", "edr4yd", "2edw", "ed2we", "edw3en", "edw5lw", "ed3wy4", "ed3y", "edym4", "2e1e", "ef5adwy.", "ef3an", "ef5an.", "ef3ar3", "ef3au", "ef1e", "efer2", "eff4e", "eff3r4", "eff5re", "effro4er", "eff3y", "ef3id", "ef3ig", "ef2l3", "ef4lo", "efn1", "ef5nos", "ef1o", "ef4odo", "ef2r", "efr3e", "ef4ri", "ef4ry", "ef4us", "ef1w", "efyddad5", "efy3na", "efy5ne", "e2g1", "4eg5an.", "eg4ana", "egar3", "egeir4", "eg5ell", "4egen.", "2egf", "eg5ig.", "egl3a", "egl3e", "egl3o", "2ego", "eg4on.", "4egos", "eg5os.", "egr3a", "egr3e", "egr3i", "egr3o", "egr3w", "eg3ry", "egr3yc", "eg2u", "eg3yr", "e1ho", "e1hy", "e2i", "2ei1a", "eiaf3", "ei5afr", "ei3bre", "eich3", "eidal5", "eidd3", "eidd5y", "ei5der", "eidl2", "eid5la", "2eidr", "eidr5o", "ei1e", "2eig", "eigl5ad", "eig5lenn", "eigl3w", "ei4gr", "3eilad", "4eiladwy.", "eil5ec", "eil5eg", "eil3es", "ei4ll", "ein2a", "eind5i", "ein4drw", "4einf", "eing4a", "ein5io", "4einl", "4einy", "2ei1o", "ei3ont", "eir3y", "2eit", "eith5e", "ei1w", "ei3y", "2e2l", "el1a", "el5ain", "elan5e", "el4co", "el1e", "el3ed", "el4eno", "el4era", "el4ere", "el5far", "el5fed", "elgri5", "3elh", "el5iff", "4elig", "ell1", "ell5ac", "ellt4ir", "ell5wy", "ell3y", "el2m3", "el5myn", "el1o", "el2od", "el3odd", "4elog", "el4oga", "el2ri", "el4wi", "el3wy", "el5ybia", "el5ybr", "el3yc", "4elyd", "el5yd.", "el3ydd", "elyn3", "el3yna", "el5yned", "elyng4", "el3ynn", "el3yr", "el3ys", "el4ysg", "el4yst", "em5ain", "em4at", "2em3e", "2emo", "em4os", "2emp", "empr3", "em5ryn", "2emt", "em5tas", "2emy", "en5ada", "e4n3adu", "e4nae", "en3af", "e4nag", "en5ago", "en3ai", "en3an", "e4nar3", "enar4g", "e4n3aw", "en5byl", "en3c", "en4ct", "en4cy", "2end", "endig3", "endr4", "en3ec", "en3ed.", "en5edd", "en3el", "en3em", "en3en", "en3er", "en3est", "en3eu", "e4new", "enew5y", "en5fyd", "eng3h", "en4gi", "engl3", "en5gl4og", "en5ise", "en3it", "en3o", "en4oli", "4enti", "ent4ir", "en3tr", "ent4wr", "4enty", "en5tya", "en5uch", "enw3ad", "en3wc", "en3wn", "en3wr", "en3wyd", "en3wyf", "en3yc", "en5ych.", "en5ychase", "en5ychia", "en4yg", "2eo", "e5och.", "e1od", "e1oe", "e4olae", "e4olaid", "e4olau", "e1om", "e1on", "eor3", "ep5ach", "ep3l", "er1a", "er5ain", "er2c", "erc3a", "er4ch", "4erco", "2er2d", "er3de", "erd3y", "er1e", "2erf", "er5fan", "erf5au", "er3fed", "er3ff", "er4fl", "er4fu", "er3fyd", "er3gl", "er2gy", "er3i", "er4ic", "er4il", "erin3", "er5ir.", "er5it.", "er2l", "er5lys", "er4md", "er4mw", "er4my", "er3na", "ern4i", "er5ni5as", "er5nyw", "er1o", "4erob", "erog4", "4erol", "er5oli", "er4ony", "er2se", "er5sei", "2ert", "erw3a", "er4w3e", "er4wl", "er3wn", "er4wre", "er3wy", "er4wyc", "er4wydd", "er3yc", "er3ydd", "er3yg", "er3yl", "eryl3e", "er4yll", "er3yn", "eryn4a", "eryn4e", "es3a", "es3ba", "es3e", "es5gar", "es4ge", "es4gn", "es4g3w", "es4gyn", "es3n", "es4ne", "es4t3a", "es5tam", "est3er", "2estf", "2estl", "est5ol", "4estu", "es5tyll.", "esty5na", "esty5ne", "2esu", "esurad4", "es4yd.", "es3yn3", "e2t", "et3ac", "et3ad", "e3tae", "et5eg.", "eter4", "et3er.", "eth1", "eth3e", "eth3i", "eth4le", "eth3os", "eth4r3", "eth3w", "et5iro", "et1o", "et5re.", "et5swy", "et1w", "4etwr", "ety5wy", "e2u", "eu3a", "4euau", "2eu1b2", "2eud2", "eu3da", "eu3d4e", "eud4i", "2eu1f", "eu1g", "eull4", "eu5lys", "2eun2", "eu5nan", "eu5nos", "eu5nyddi", "eu5sil", "eus3t", "eu4th", "eu4tu", "eu3w", "2ew", "ew1a", "ew3d", "ew1e", "ew3g", "ewgl4", "ewg4w", "ew3ir", "ewis3", "ewl1", "ew3o", "ew5par", "e3wyd.", "e3wyf", "2ey", "e1yc", "ey4en", "1ë", "3fa.", "fab3", "fab4i", "fach3", "fac4w", "fadd2", "fad4ei", "fad4r3", "fael3", "f1af", "3fag", "fag4d", "fagl3", "f1ai", "falch4", "f4al5on", "f4alu", "f3am", "f4an.", "fan3d", "fan5edd", "fan4es", "f3anf", "fan3o", "fant2", "3faoe", "far3a", "far4ch3", "4far2e", "f3arf", "far4fa", "far4l", "3farn", "farn3a", "f3arp", "f3art", "f4arwe", "f3arwy", "f1as", "fas4iw", "f3at", "fat4o", "fawd4a", "3fawr", "f1b2", "f1d2", "fdd2", "f2dw", "fd5wr.", "f4eb.", "febr3", "f1ec", "fed4n", "f2edr", "3feia", "3feie", "fe4io", "feiriad4u", "feith3", "fe4iw", "f4el.", "f3ell", "fel5yno", "f1em", "fe3na", "feng3", "fent4", "fentr5", "fenw3", "fen3y", "2fera", "ferch4er", "ferdd4", "2f2ere", "2f2eri", "fer4in", "2f2ero", "f2erw", "ferw5yc", "f4er3y", "f1es", "feth3", "f4eth.", "f4etha", "feu1", "3fey", "f2f", "ff3ad", "ff3ant", "ff4at", "ff3au", "ff3ed.", "ff5edig", "ff5eio", "ff5el.", "ffen5ed", "ff3ent", "ff3er.", "3ffert", "ff3esu", "ffet4", "2ffi", "ffidl5", "ff2l", "ff4la", "ffl4ac", "ff4lo", "ff5log", "ff5los", "ff3n", "ff3od", "ffod5e", "ff4odi", "3ffon.", "ffo3n4a", "ffo3n4e", "ff3ont", "ff2or", "5ffor.", "ff4os", "ff2ra", "ff2ri", "ff4rod", "ff2rw", "4ffry", "ffr3yn", "ff2t", "5ffurf3", "ff5wyf", "ff5yl.", "f1g", "fg4wr", "f1h2", "fha5ol", "f1i", "f4iadae", "2fic", "fic4e", "f2id", "f3id.", "fig4en.", "fil3y", "fin3", "f4in.", "f3ind", "fin4t", "fisg4", "f2ï", "fl2", "fl3ad", "flaf4", "fl3ai", "flamad4", "fla3na", "flan5ed", "f2las", "flaw4", "fl3ec", "fl5eis", "fl3em", "fle3na", "fle5ne", "fl4eo", "fl3id", "fl4ig", "flin3e", "fl3ir", "fl4iw", "fl3om", "f3lon", "fl5rwy", "f4l3wr", "f1ly", "f5lychw", "f4l4yd", "fl4yf", "flyn3a", "flyn3e", "f2n", "fn3a", "fn3d", "f4n3ec", "f4n3ed", "f4n3em", "f4nen", "f3nif", "fn3ig", "f3nith", "fn5lu.", "f4n3oc", "f4n3om", "f4n3on", "fn3w", "fn2y", "f4n3yc", "fn3yn", "f1oc", "fodd3", "fod4enn", "f4odf", "fodr4", "fod3rw", "f4odu", "f3oedd", "f1og", "fol3", "fol4enn", "f1om", "fon4d", "5fonog", "f4ony", "f4or.", "for4c", "f4ord", "for3f", "f3os2", "fos4i", "fos3o", "f3ot", "f4otr", "fr2a", "f2raf", "f2rai", "fra3na", "fra5ned", "fras4au", "f4r3au", "fr3d", "frdd2", "fre2", "f2rec", "f4red.", "f4reg", "freg3y", "f2rem", "f4ren", "f3reo", "f2rer", "fr3f", "f2rh", "f2rid", "fr3id.", "f2rir", "f4rit", "fr2o", "f3roa", "f5roadw", "f2roc", "frod4iae", "fro2e", "fro4en", "fro5esi", "f3ro2i", "f2rom", "f2ron", "f3roo", "fr4ot", "f3row", "fro4wc", "fro4wn", "f1ru", "fr2w", "f2rwc", "f2ry", "f3ryn", "f1ta", "f3ter", "fudd4l", "fud3w", "fu2l", "f1un3", "f4urf", "f3wa", "f1wc", "fwd3", "f1we", "4fwl.", "f1wn2", "f3wr.", "fwr5ne", "f4wy.", "f3wyd", "fwyllt4", "fwyn3", "f4wyn.", "f4wys", "f1yc", "fyd2", "fyddad4", "fydd4l", "fydd5y", "fyd4l3", "f4ydr", "fyd3y", "3fyf", "fyf4y", "f1yl", "f4yl.", "f2yn", "4fyn.", "f3yng", "fyn3o", "fyn5od", "f2yr", "fy3r2a", "f3yrd", "fyr2e", "fyrf4y", "fyr4y", "fys4t", "fystyr4o", "fys4w", "gabl4en", "g5ach.", "gad1", "gad3a", "5gadar", "g4ad2u", "5gaduri", "g4adwr", "g1ae", "gae3a", "g3af.", "gaf3a", "gaf4r3", "g1ai", "1gal2", "gal5ara", "gal5are", "gal5ari", "gal5aro", "gal5arwy", "galed5", "4gall", "gam4enn", "gamn4", "gan3a", "gan4d", "ga4ne", "ganghe5na", "g3ant", "4ganwr", "g3ao", "gar3eg", "gar4enn", "g3arf", "gar4ge", "3gart", "4garthia", "gar4we", "g1as", "5gased", "gasg4e", "ga4t3r", "2g1au", "4gawe", "2g1b", "gb4er", "g1c", "2g1d2", "gdd2", "gddig5", "gdo3ra", "gdo5r4e", "g2dw", "gd5wr.", "g1ec", "g1ed", "gedd3", "g2ede", "g4edi.", "g4edid", "g4edir", "g4edit", "g2edo", "g4edu", "g4edyc", "geg3", "g2egy", "g2ei.", "g3eid", "g4el.", "gell5a", "gel3o", "g1em", "gen4d", "g5enni.", "gen2r", "g3ent", "g4enu", "g3er.", "3g4erd", "ger4f", "ger3y", "g1es", "geu4l", "g1f2", "gfa3na", "gfa5ne", "gfe5ne", "gfyn3", "g3ga", "gh2", "ghae4", "ghan3a", "ghanghe5na", "ghar4en", "ghasg4e", "ghen5i", "gher4f", "gh4le", "ghleid4", "gh4ne", "ghob3", "ghobl4", "ghof5r", "gh4og", "ghon4y", "ghr2", "ghra4", "ghred4adu", "ghred4inia", "ghw4f", "ghyd3", "ghym4an", "ghysg3", "g1i", "gib3", "g4ida", "gi5en.", "g2ig1", "3gil", "1gip", "g3iw", "g2l", "gl3ac", "gl3adw", "glaf2", "glan5e", "gl3ant", "glas3", "g5las.", "g3lat", "gl5au.", "gl2e", "g3le.", "gl3ech", "gl3edi", "g5leisiaso", "g3leo", "gl3es", "gl3eu", "gl3f", "gl3ia", "gl3id", "g3liw", "gl4odi", "gl4ody", "glo4e", "gl4of", "5gl4oga", "glo2i", "g4lu.", "g4lwc", "g4l4wm", "g4l3wn", "g4lwyf", "gl3yc", "g3lyd.", "gl4ym", "gl4ys", "gl4yw", "g2n", "gn2i", "gn3io", "g4niw", "g3nï1", "gno3e", "gn2of", "gn2u", "gn1w", "gn4yw", "gobl4", "g1oc", "goddefad4", "go5ddr", "g2od2y", "god5yn", "g2oe", "go5fau", "go3fer", "goff4au", "gof4un", "gog2", "go3gan", "gog3e", "gog4l4", "go5gyn", "g3ol.", "goleu5", "3g4oll3", "go4lw", "gol5yga", "gol5yge", "gol5ygwy", "g3om.", "go3me", "gon5ad", "g4one", "g3ont", "gon4yn", "g2or", "gor5chy", "gorddad4", "gord5i", "g4orf", "gorn4an", "g4orol", "gor3t", "1gos", "gosb3a", "g3ota", "g3ote", "g3oti", "g3oto", "g3otw", "g2r", "gra4m", "gran3a", "gr4el", "gr3f", "gr2i", "g4rid4", "gr3ie", "gring4", "g4r3ir", "g4rit.", "gr2o", "gr3od", "gr4oe", "gr5oed", "grof4", "grog3", "gron4a", "gro5nas", "gron4ed", "gron4es", "gr4ono", "grwn5a", "gr3wo", "gr4wt", "gr2wy", "g5rwydd", "g4ryc", "gryg3", "grygl4", "gr4ym", "gr4yn", "g1s2", "gsym4", "gub3", "gudr4", "gu5edd", "gu4to", "gw2", "gwa5r4as", "gwar4es", "gw4as", "g3wc", "gweithiad4", "gwelad4", "gwel5e", "gwen3a", "gwerthad4", "gwm3", "gwn4a", "gw4n4e", "gwobr3", "g3wr.", "g4wrd", "g5wth.", "gwy3by", "g3wyd.", "gwydr5", "g3wyf", "gwy4r", "gwyw3", "3gyb", "gyb3y", "g1yc", "gych3", "g4ycho", "gydd4f5", "g2ydi", "gydl4", "gyd3r4", "g4ydu", "g4ydy", "3gyf", "gyf5an", "gy4fe", "gy4fl", "gy4fr", "g3yl3a", "3gylc", "g3yle", "g4ylio", "g3ylo", "g3ylw", "g2ym", "gym4an", "gym3u", "gyng3", "g2yno", "g2yr", "g4yro", "g2ys", "gy4se", "gysg3", "gys5on", "gys3t", "gys5to", "3gyw", "gy3wa", "gy3wed", "gy3wi", "gy3wy", "hab3yd", "hadd5as", "hadd3o", "had4eg", "had4eny", "h4adf", "had4fer", "hadl4a", "had3n", "had3r4", "h5aeol", "ha4f3a", "h4afl", "haf5ol", "h4afs", "hag3w", "h1ai", "h4aif", "hal3e", "hall3o", "hal3o", "ham4enn", "hamn4", "ham3s", "han3ad", "h4anau", "hanc4", "han3d", "ha4ne", "han5edd", "han4er", "h4ange", "hanghen4r", "han3ig", "han3l", "han2o", "han4oda", "han5olai", "han5olas", "han5ole", "han5olwy", "hanrhyd4", "hansodd4ei", "har5adwy.", "hara3t", "harato4en", "har4bwr", "har4cha", "har4fo", "h1as", "h3asf", "hast4a", "ha4tr", "hatr3e", "h1au", "hawe5nas", "hawe5ne", "hawl3", "h2â", "h1b2", "hbl4a", "h1d2", "hddad3", "h3di", "hd4ir", "hdo3na", "hdo3ne", "hd4ra", "hdr3e", "hdr5oc", "hdr5od", "hdro5ed", "hdr5wyd", "h4dwr", "h2eb", "h3eb.", "heb3ra", "hedd3", "hedd4fo", "h2ede", "hed5fo", "hed5fw", "h4edid", "h4edir", "h4edit", "h2edo", "hedr5wy", "h4edu", "h4edy", "h2ef", "h2eg", "hegn3", "h4egy", "he4ho", "h2ei2", "h4e3ia", "h4eil", "heimlad4w", "h4el.", "4helad", "4helaf", "4helai", "4helan", "4helas", "h3eld", "2hele", "4heli", "2hel3o", "hels4", "2helw", "4hely", "hel3yd", "h1em", "hen5cy", "hen4id", "hens4", "hen3wy", "henwy5na", "henwy5ne", "heny5na", "he3ol", "her3b", "h2ero", "h3esi", "h2et", "h3ete", "h3eto", "5heuae", "heu4aetha", "heu3d", "heu2l", "he4wi", "hewy5nas", "h1f2", "hfil4", "hfonhedd5", "hf4os", "hf4wy", "h1g2", "hgan3", "hgap2", "hgi5ai", "h1i2", "hiach4", "hiac5has", "hiac5he", "hiac5hw", "hi4a4n", "hib3", "hidl3", "h2ig1", "hig3y", "hin4t", "hir3", "hi4wa", "h2ï1", "hï4en", "hl2", "hl4ad", "hl5adw", "hl4am", "hla3na", "h5las.", "hl3asi", "hl3aso", "hl4aw", "hl5ech.", "hl5edig", "hledr5", "h3lef", "4hleit", "hl4en", "hl4et", "hl3id", "hlon3a", "hlon5e", "h4lus", "h4lwm", "h5lyd.", "hl3ydd", "hlym4u", "h4lyn", "hl3yn.", "hlywad4", "h1m2", "h3myg", "hmygad4", "h3myn.", "hmy3na", "hmy5ne", "h5myni", "hn2", "h3nad", "h2neg", "h4new", "hn4ie", "h1nï1", "hnod3", "h2nol", "hn5ole", "hn4yw", "ho4ad.", "ho4bl", "hod4l", "ho4dy", "ho4en", "hoffad4wy", "h3og.", "h3o4ga", "hog5lu", "ho2h", "h2ol", "h3ol.", "hol5ud", "h1om", "h2or", "h3or.", "hor4c", "horn4an", "h4os.", "hosb3", "hos3o", "h2ow", "hp2", "h2r", "hra3dd", "hr3adw", "hr3af.", "hra3g", "hr4aid.", "hr3ant", "h5raul", "hr5edig", "hr3em.", "hr3f", "hr2i", "hr3ia", "hr3id.", "hrid4a", "hr3ie", "hring4", "hr3ir", "hrisiad4", "hr3it", "hr3iwy", "hr2o", "hro4ad4", "hr5och.", "hr3odd", "hrog3", "hr3om.", "hron4a", "hro5nas", "hron4e", "hrong5", "hr3ont", "hr4ud", "hr3wn.", "hr5wyd.", "h5rwydd.", "hr3wyf", "h4ryc", "hryg3", "hrygl4", "hry3l", "hr4ym", "hrynho4e", "hrynho4i", "hrynho4wn", "h4rys", "h1s2", "hsef4", "h2t", "h2u", "hub5on", "hudd3", "hudd5y", "hudr4", "hud3w", "hud5yl", "h4uge", "hug4l", "hun3ad", "h4unn", "h3ur.", "h3us.", "h4use", "h4ust", "h4usw", "hw2a", "hw4as", "hwbl5e", "hwd3", "hw2e", "hwedl5", "h3wei", "h4wel.", "hwen3", "hwen4y", "hwe5nychaso", "hwe5nyched", "hwerw5", "hwe5ug", "hw2i", "hwiw5g", "hwm3", "hwn4e", "h3wr.", "h2wy", "h4wy.", "h4wya", "hwybr4", "hw4yc", "hwyll5t", "hw4ym", "h4wyo", "h5wyol", "hwy4r", "hyb4l", "hyb4wyl", "hyb3y", "hydd4id", "hyd4fo", "h2ydi", "hydl4", "hyd4naw", "hy4f3a", "hyfad4", "hyf4ae", "hyfar5f", "hyfer3", "hyffel5", "hyffred4in.", "hyf4iai", "hy4ga", "hygl4o", "hygl4w", "hygr4", "hyll3a", "hym4adw", "hym4ant", "hym5el", "hym4en.", "hymerad4", "hym3o", "hymp4", "hym3u", "hym5yr", "hym5ys", "hyn3a", "hyn3e", "hynef3", "hyn3yc", "hyr3a", "hyrdd5", "hyrf3", "hyr5n4o", "hyr2w", "hys4b", "hy4se", "hysg5od", "hys4ig", "hys4n", "hys5oni", "hyt4bw", "hyth5ru", "hyt2u", "hytun4deba", "hy3was", "hy3we", "hy5wed", "hy3wi", "hy3wyd", "1ia", "iab4a", "iach2", "iad3", "i4ada", "5iadaeth.", "iad4lo", "5iaduro", "i3ael", "3iaet", "4iafo", "iag3w", "2ial1", "ial4ae", "2i3am2", "iam3h", "ia3na", "4iand", "ian5da", "ia3n2e", "4i3ang", "iang4e", "ianghen5", "ian3o", "ian3w", "2iar", "i3ard", "i3arf", "iar4l", "iarll5", "iar4s", "i3asg", "iat5er", "i2au", "iawnad4", "2ib", "ib3ed", "ib3el", "iben5y", "ib3es", "ibetr4", "ib3i", "ib4il", "ibl3e", "ibl3o", "ibl3w", "ib5og.", "ib3on", "ibr3a", "ibr3w", "iby4nad4", "2ic", "ic3en", "ichl4", "ic5ied", "icon2", "ic5oni", "ic5rwy", "ics4i", "ic5siw", "ic3t2", "2ida", "idal4", "2idd", "i4ddai", "idd4au", "i2dde", "idd3f4", "idd3i", "i4ddir", "i4ddod", "idd3r", "2ide", "idel4", "ider4", "2idf", "idf4w", "2id3i", "idi4a", "id4lo", "idl3w", "2idm", "2i2d2o", "id3og", "i3dola", "i3dole", "i3dolo", "i5dolwy", "ido3na", "ido5ne", "i3dor", "2idr", "idr4a", "idr4o", "id3rwy", "2idu", "2idw", "idw3a", "idwad4w", "id4wr", "2idy", "id3yl", "id2ym", "1ie", "4iedd", "4iedi.", "iedif5", "ied4yl", "2i3ef", "i3eg", "iegwydd4", "2iei", "i3eid", "ieis4", "4ien.", "ien4a", "ien4c", "4iend", "i3ene", "2ienn", "ienw4", "i3eny", "i3esg", "2if", "if4add", "if4ae", "if4al", "ifan3a", "ifan5e", "if4ao", "if4ar", "if5ard", "ifar3e", "if4at", "if5ath", "if4aw", "if5bin", "i4fec", "i4fed.", "i4fedi", "i5feio", "i5feiw", "i4fem", "ife4n", "i4fent", "i4fer.", "i3fery", "i4fesi", "i3fet", "iffl3", "iff5or", "i3ffu2", "iffy5na", "iffy5ne", "if3i", "i3flas", "if4on.", "i3fre", "i3fry", "i1fu", "i4fwc", "i4fwn", "i4fwyd", "i4fwyf", "i1fy", "i4fyc", "i4f4yl", "ify5re", "ig3ad", "ig3af", "ig4ain", "2igan", "4i3gar", "ig1e", "ig3ed", "ig3es", "ig5hal4", "2ig3i", "ig5lan.", "ig5lann", "ig5law", "ig5let", "ig4l3o", "ig4ly", "ig5lyd", "igl3yn", "ign1", "2igo", "ig3odd", "ig4ode", "ig3oe", "ig3om", "2igr", "i3gre", "igref4", "i3gro", "ig3rw", "igryb4", "2igw", "ig5wai", "i4gwc", "i4g3wn", "ig4wrn", "2ig1y", "igyff4", "ig5yn.", "ig4yna", "ig4yr", "igys4", "ig5yso", "igysyllt4", "igyt4", "igy4w", "2i1h2", "i2han", "ihat4", "ihe4w", "2i1i", "i3iw", "2i2l", "il3a", "5ilau.", "ilc2", "ild5ir", "il3ed", "il5en.", "ilew4", "il1f", "ilf4y", "il3i", "il4ip", "ill3", "ill5iw", "illt4", "il3oc", "il3od", "il5ofy", "il3on", "il2s3", "il4sy", "il4ti", "iludd4", "il3un", "il1w", "il5wai", "ilwen3", "il4ws", "il3yd", "il3yg4", "il3yn.", "ily3na", "ily5ne", "i4lysia", "il5ywa", "2im2", "im4bi", "im3i", "iml3", "im4le", "2in", "in1a", "in3ac", "in3ad", "in3af", "in3ai", "in3an", "in2be", "inc4e", "in4ci", "inc2o", "in4cy", "in4dai", "in1e", "3in4eb", "in3f", "ing5en", "in4g3o", "ing3w", "ing5yl", "in5gyn", "in3ia", "in3id", "in5iew", "in3ig", "iniw4", "in4iwe", "in1o", "in4ode", "in4odi", "in4ody", "in3oed", "in3on", "in3os", "int4a", "in4te", "in2t3r", "in4ty", "in3w2", "in5wyc", "in1y", "1io", "3io.", "2iod.", "i3odde", "iod5le", "iod5wy", "2ioe", "2i1of", "iog3", "4iolc", "iom3", "i2on", "ion3a", "ior4c", "ior4f", "i4orw", "2ios", "2iot", "2ip", "ip5ell", "ip4og", "ir1", "ir2a", "ir5agl", "ir3an", "ir4áf", "ir3b", "irch3", "irdy5na", "irdy5ne", "2ir3f", "2iri", "i4ria", "ir3io", "i3ris", "ir4li", "ir4ll", "ir3na", "irnad4wy.", "ir3no", "irn4y", "2ir3o", "ir3w", "irw2i", "ir4wo", "ir2y", "ir3yn", "i3ryw", "2is", "isaf4", "is3b", "is5eld", "is2er", "is5er.", "is4gam", "is4ge", "isg3o", "is3gr", "isg5wyd", "is3gy", "is4la", "is5myn", "is2o", "is5odd", "is3ol", "is3on", "ist2", "is4ti", "is5tol", "is2w", "is3wn", "is5wyd.", "is4yc", "is4yr", "1it.", "3it2a", "2ith1", "ith3a", "ith4au", "ith3eg", "ith3i", "ith5or", "ith3w", "ith3y", "2iw.", "iw3adw", "iw3af", "i4wair", "i3wal", "iw3an", "iw3as", "3iwc", "iw4ch", "2iw1d2", "iwd4i", "iw5edd.", "iw3edi", "iw3eid", "iwg4w", "2iw1i", "iw1l2", "iwl4e", "iwl4i", "iwl4o", "iwl4w", "iwm4e", "iwmp4", "3iwn", "iwn4i", "4iwnl", "iw3o", "i3wre", "i3wrt", "iw5ter", "1iwy", "iw4yd", "iw4yf", "iwyn3", "4iwyr", "1iy", "2iyd", "2i1ym", "iyn3", "2i1ys", "ï3ae", "ï2i", "l1ac", "lach3", "2lad.", "l4ad4d3", "lad2m", "lad2o", "lad3r4w", "4laen", "l3af.", "5lafar", "l1ai", "l4ain", "l4air", "l4ait", "lam3", "l4an.", "lan5ced", "lan5de", "landr3", "l2ane", "lan4es", "l4ann", "lan3o", "4lant3", "lar3a", "lar4ia", "lar3n", "l1as", "l4as.", "lasg4", "last2", "las5ta", "4lat.", "lathr3", "lats5i", "2l3au", "law5dde", "lawen3", "law3l", "law3no", "lawr2", "law5ro", "law3y", "2l1b", "lb4an", "l2c", "lch1", "lch5io", "lch5iw", "lch3r", "lch5wyd.", "l3co", "lc3yn.", "2l1d2", "ldd2", "ld3i", "ld4ir", "ldro3", "ldy5na", "ldy5ne", "1le.", "le3a", "le4ad.", "le4ada", "lebr3", "lech3", "l3ed.", "leddf5", "l4eddog", "led5fy", "led3l4", "l4edr", "lef1", "lef3e", "lef3y", "l2ega", "leg5ar.", "l2egw", "leg5yr", "le5iau", "le3id.", "lei3l4", "le3ir.", "le3it.", "le4iw", "l3el", "2l1em", "l3em.", "l2ema", "len2d", "len5di", "len5ig", "l3ent", "len3y", "1leo", "le3oc", "le4on.", "l3er.", "l4erau", "ler5ig", "lesg5e", "l4esn", "let4em", "le4tr", "l4euad", "l4euh", "4leuon", "l5euon.", "le3wch", "le3wn", "lew3yn", "lf2", "lf5air", "l3fan", "lfe3ne", "lf4fa", "lff4y", "l1fi", "lf5icy", "l1fo", "lf5oda", "l1fr", "lf4wy", "lf3yd", "lfy5re", "l1g2", "lg4an", "lgo4f3", "2l1h2", "l3ha", "l3he", "l3hi", "l3ho", "l3hw", "l1i2", "liach3", "4lian", "libr3", "2lid", "li3de", "1lif1", "li4fr", "4lio.", "li5oed", "li5pal", "2lir", "l3ir.", "lis4g3", "l3it.", "lith4r3", "l4iw.", "l2l", "2ll.", "ll4ada", "lladr3", "ll5adwy.", "ll3ant", "ll5arn", "lledr4e", "ll4edy", "lle3o", "llest4", "lleu4a", "ll1f", "llf4y", "llin3e", "ll3odd", "llosgad4", "ll5tyr", "lludd3", "llw2", "ll3wa", "llw4e", "5llyd.", "llygr3", "ll4ynn", "ll4yr2", "ll5yro", "lm2", "l1ma", "l4mad", "l4maf", "lm3ai", "l2m3as", "l4mau", "lm3o", "lm3w", "lm4yn", "l1n", "2lo.", "lob5yn", "2loc", "loch3", "2lod", "lodd3", "lo3ed.", "l1og3", "logl2", "l1ol", "lol2w", "lolyg4", "2l1om", "l3om.", "lon2a", "lon3d", "lon4es", "4l3ont", "l3or.", "l4orau", "l4org", "l4ory", "2lot", "lo5ynn", "lp3a", "l3pu", "l1r2", "l3rh", "ls4ig", "l4syn", "l2t", "lt3ad", "lt5eg.", "lt3em", "l5tera", "l5tero", "l4tia", "lt4ig", "l4tio", "lt1o", "l3tra", "ltr4e", "l3tu", "l4tu.", "lt1w", "2lu.", "l2ud", "ludd5y", "lud3w", "lu4edd", "l2un3", "l4un.", "lur5ig", "lust5l", "lw1a", "lwadd4", "lw4ae", "l1wc", "l3wch", "lw3ed", "lw3er", "lw3es", "lw4fa", "lwfr5e", "l4wgr", "lw1i", "lw4ig", "l1wn", "l3wn.", "lw3o", "l1wr1", "4lwre", "l4wyc", "l4wydi", "lwyd4io", "l4wyn3", "l4wyr", "3l4wyt", "lyb3", "2lyc", "l3ych.", "lyd2", "l4yd.", "2lydd", "lydn3", "lydr3", "lyf3a", "lyf5an5", "lyf4n3", "lyf4r3", "5lyfr.", "l2yg", "4lygedd", "4lygia", "lym3", "l4ynau", "lyng3a", "l4yn3y", "lyr3a", "4lysau", "4lysen.", "lys3ga", "lys3ge", "l4ysl", "4lysn", "4lysr", "4lysyn", "lyw1", "m1", "mab3", "mab4i", "m3ac", "mac4w", "m4adad", "m4adaf", "m4adai", "m4adan", "m4adas", "m2adi", "mad4r3", "m4adwc", "m4adwn", "m4ady", "mael3", "maf4l3", "m3ag", "2mai", "m3am", "man3a", "man3e", "m4anf", "man2o", "m3ar", "m4ar.", "mar4ch3", "m4are", "m4ari", "mar4l", "marn3", "m4aru", "mar4wy", "masg2", "mas3ge", "m3at", "mat5eg", "mat4o", "m3aw", "mawd4a", "mbarato5", "m3bi", "m3by", "mcan3", "md2", "m4dai", "mdan4a", "mda5nas", "mda5n4e", "mdd2", "mddadl4", "mddef3", "mddi4d", "m5der.", "m4dera", "mdog4aetho", "mdo3na", "mdo5ne", "mdro3e", "mdwy4", "mdyng5", "mdy5re", "4meda", "4meddia", "4meddwr", "4medi", "4medï", "medr3", "meg3n4", "megni3", "meith3", "me4iw", "mel5yno", "mens4", "ment4e", "mentr5", "5menty", "men5yd", "m2er", "m3er.", "m3erad", "m4eradwy.", "m4eraf", "m4erai", "m4eran", "m4eras", "merch4er", "merdd4", "m4ere", "m5eriada", "m4eroc", "m4erom", "m4eron", "m4erw", "m4ery", "4mesia", "4mesol", "mest4", "4meswr", "4mesy", "meu1", "mfalchi5a", "mfalchi5e", "mffl4", "mfydd4", "mg2", "mgyff4", "mgyffr5o", "mgym4", "mgym5eria", "mgys2", "mh2", "mhar5ad", "mheir4a", "mhe3na", "mhe5ned", "mhe5nes", "mhen3t4", "mhen5w", "mhet2", "mhe3ta", "m2heu", "mhob4l", "mhr4a", "mhryf5", "mhyd4", "mhy3f", "2mi", "m3ias", "m3id3", "m3ie", "mi5gei", "min1", "min4t", "m3io", "m3ir", "mis2", "misg4", "mis4i", "m3it", "m3iw", "m3iy", "ml2", "m2las", "ml5blw", "m3led", "mlew3", "m3lin", "m5liwiais", "m5liwiase", "m5liwiwy", "mlo3na", "mlon4ed", "mlyn3", "m2n", "m3na", "mn4as", "m3ne", "m4ned", "mn5edi", "m5niau", "m3nï3", "m2od", "m3odd", "mod4ig", "mod3r", "mof5yd", "m3og", "m4on.", "mon3a", "mon4d", "m4onï", "mor2", "mor3c", "mordd4", "morddiw5", "mor4o", "m3os2", "mos4i", "mo5siy", "m2p", "mpr3a", "mpr3o", "mpr3w", "mp5wai", "mr2", "m2r3ai", "mra3na", "m2r4ed", "mreg3y", "m4ria", "m4rie", "m4rig", "mro4ad", "mrod4iae", "mrod4ir", "m2roe", "m2roi", "m2roo", "m2row", "m4roy", "m4ryn", "mryn4d", "mrys4o", "ms2", "m3sa", "m2se", "mse3na", "mse5ne", "m2so", "mstr4", "m2t", "mt2a", "mtas4", "m3th", "m2u", "mu4an", "mudd4l", "mud3w", "mu2l3", "mun3", "m3us", "m3w2a", "mw3as", "m3wch", "m3wi", "mwr2", "mwr3i", "m3wt", "mwy3b", "mwyllt4", "mwyn3", "m5wyse", "mwyth4adw", "mwyth4af", "mwyth4asan", "mwyth4aso", "mwyth4asw", "mwyth4ec", "mwyth4em", "mwyth4er", "mwyth4i", "mwyth4oc", "mwyth4w", "mwyth4y", "2m2y", "m3yc", "mych3", "m3yd", "mydd5i", "mydr3", "myd3y", "myf4y", "m4yl.", "myl3a", "m4yln", "m3ym", "myn4ai.", "m3yr", "myr4as", "myr5asa", "myr4edi", "myrf4", "m3ys", "m4ysg.", "mys4w", "myw3y", "3na3b2", "na4bl", "na4bo", "na4ch3", "n2ad", "n3adl", "nad4n", "nadna4", "n4ado", "nad3r", "nad3u", "nad3w", "n3adwr", "n1ae", "nae5ara", "nae5arw", "nael4", "n2afa", "n5afau", "n2af3o", "n4afy", "n4aic", "n4aig", "n4ain", "n4air", "n3al", "nan3a", "nan3e", "nan3f", "nap4om", "n3ar", "narllenad4", "n3asg", "n4asol", "n3as4t", "1nat", "nau3", "n1b2", "nbyd5r", "n2c", "nc3an", "nc5des", "nc4ed", "nc2ei", "nc5en.", "n3ch", "nchwiliad4", "n4cia", "n4cid", "n4cie", "n4cio", "n5ciod.", "n4cir", "n4cit", "n4ciw", "n4ciy", "n3cl", "ncr1", "nct1", "n5cyd.", "n5cyny", "n1d2", "nd3as", "nd3aw", "ndd2", "nd4da", "nden2", "n4d3ia", "nd3ie", "n3di3f", "n3di4g", "n3dil", "nd3io", "nd4ir", "n3dis", "n3dit", "nd3iw", "nd3iy", "n3dod", "nd3oe", "ndo3ra", "ndo5r4e", "n2dwr", "ndy5na", "ndy5ne", "n4dys", "neallad4", "n2eb1", "neb3o", "n5ebry", "neddf5", "n2ede", "n4edid", "n5ediga", "n4edir", "n4edit", "n2edo", "n4edu", "n3edy", "n1ef", "nefn3", "n4efy", "n1eg", "neg5in", "ne3h", "n3eidd", "n2eis", "n1el", "3nel.", "nel5yn", "3nenty", "ner3a", "nerch5", "n4erg", "n4erl", "3nert", "3nese", "4nesia", "n4esio", "nes4m", "3neso", "n2est", "3nesw", "n2esy", "neth5o", "n2eu", "neu3d", "n4euf", "neul4", "3new", "new5yll.", "newyn3", "n1f2", "nfadd4", "nf4am", "nfan3", "nfan5e", "nfan4t", "nfa5ol", "nf4at", "nfel2", "nff2", "nf4fa", "nff4o", "nffyn4", "nffynad4", "nf4id", "n4fil", "nfod4l", "n2fon", "nfon5a", "n5fonedi", "nf4ri", "nf4wy", "n2fy", "n5fyd.", "nfyd3a", "ng2ad", "ng5adwy.", "n4gai", "ngal4", "n3gam", "n3gar", "n4gau", "ng4ddy", "ngel4", "nghwyn5", "n2gi", "n2gl2", "n3glwm", "n4gly", "n5glym", "nglyn3", "ngn2", "ng3oe", "ngof3a", "ngol4ed", "ng3on", "ngop2", "n1gr", "ngr4a", "n2gw", "ng4wi", "ngwy5nas", "ngy3f", "n4gyn", "2n1h2", "nha3o", "nhar4", "nhaws4", "nheb5r", "nhe3na", "nhe3ne", "nhep2", "nh4es", "nho3ed", "nho5esi", "nho3n4a", "nhon4e", "nhudd4ed.", "nhu4e", "nhyc4", "nhyd2", "nhyl4", "nhym4", "n1i", "4ni4ad", "n5iald", "ni1b", "nib4a", "nib4e", "nibryd4", "ni1d", "nidd4", "ni5dde", "nid4e", "n3ie", "ni4et", "ni3eu", "n4iew", "ni3fed", "ni3fen", "ni4feryc", "ni3ffr", "ni3fw", "n2ig", "n5igam", "nige5na", "4nigiad", "n5igiad.", "n5igiada", "5nigiadw", "4nigion", "n5igion.", "5nigiont", "4n5igiwr", "nigl4", "4nigy", "ni3gym4", "nilead4", "nill5adas", "n5illio", "ni3lu", "ni3lys", "nin2", "ni3no", "nin4w", "ni3or", "ni3ra", "nir4e", "ni3ri", "ni4rw", "ni3rym", "nis3g", "ni3so", "nis3ty", "ni3sw", "ni3sy", "nith4e", "niw2", "niw4a", "ni4wc", "niw5eddas", "niw5edde", "niw5eddo", "niw5eddw", "niwl3", "niwl5e", "niwl5o", "niwl5w", "ni5ydd", "n2ïi", "nï4yc", "n1l2", "nladr3", "nlin3", "nll2", "nllon4", "nl4lw", "n4llyn", "n2ly", "nly3na", "nly3ne", "n1m2", "nmolad4", "n1n2", "nn4al", "nn4ar", "nned4", "nneth4", "n3nh", "nni2", "nnif4", "nni4l", "nnill4", "nni4o", "nnis4", "nni4w", "n5nos4b", "nn4wy", "nny3na", "nny5ne", "nn4yw", "no4ada", "n3ob", "n2od.", "n2odo", "nod3r", "n2oe", "noe4o", "no3er", "3no4et", "n1of1", "nof4el", "n2ofy", "n1og", "nol5eg", "nom3", "n4omi", "n5ones", "n1or", "norch4", "nor4f", "2nos3", "nö5es.", "np4et", "n1r2", "nre4o", "n1s2", "n2se", "n3sei", "ns3en", "ns3i", "ns4ic", "ns4ig", "n3s4il", "ns4iy", "ns5iyc", "n3siyn", "nsy3na", "nsy3ne", "nt3ad", "nt5af.", "nt5aid", "nt4ana", "nt3aw", "n2te", "n3tei", "nt3el", "nt3em", "nt3er.", "ntew3", "nth2", "n4tia", "nt5il.", "nt4in", "n3tis", "nt3oc", "nt3od", "nt5od.", "nt3oe", "n4t3or", "n1tr", "nt1w", "nt3yn", "nty3ra", "nty3r4e", "n1u", "nud2o", "nun4i", "nut1", "nw3af", "n3wait", "nw3an", "n3war", "nwar4ed.", "nw3as", "nwbl4", "nwb5le", "nwd3e", "n5wedd", "nw3edi", "n3wei", "nweithi5au", "nwelad4", "nwen5d", "nw4ia", "nw3id", "nwir4", "nw3ir.", "n3wis", "nw3o", "nwr5ei", "n4wy.", "nwybod4a", "n4wyc", "n3wyl", "n2wyn", "n4wyn.", "n3wyt", "nych3", "nyf2", "ny5fala", "ny5fale", "ny5falo", "nyff4", "nyf4n", "nyf4o", "ny5fod", "nyfr3", "n2yg", "ny3gy", "n1yl", "ny3lan", "ny3lu", "nym4a", "nym4y", "n5ynnau", "ny3n4od", "ny3ra", "nyrchafad4", "ny3ri", "n1ys", "n4ys.", "nys4g", "n3yw", "2o1a", "2o2b", "ob3ae", "ob4an", "ob5ant", "ob3ed", "ob3el", "ob5en.", "oben5y", "ob5er.", "obl3a", "obl5ed", "ob3ler", "obl5es", "obl3o", "obl3w", "o3b4ly", "ob3o", "obr1", "ob3yd", "oc1a", "oc5byn", "oc3e", "och3a", "och5an", "och5en", "ochl3a", "ochl5es", "ochl3o", "ochl3w", "och3n", "och4ni", "och3o", "ochr3", "och3w", "och3y", "2oci", "2ocr", "2oct", "2od3a", "od4ao", "odar4", "odd3a", "oddf5y", "odd5il", "oddiw3", "odd3r", "odd5ri", "4oddu", "odd3y", "odd5yd", "odd5yn", "odeb3", "o5debau", "o5debu", "od5edi", "od5eid", "od3el", "od3er", "od3i", "odl3a", "odl3ec", "odl5esi", "odl3w", "od5off", "2odog", "od4oga", "2odr", "odr3a", "odr5ec", "odr5em", "odr3o", "odr5wyd.", "od4ry", "odr5yc", "2odw", "od3wa", "od5wed", "od5wen", "od3yc", "od3yn", "od4ynn", "o1ec", "o4edd3", "oed3i", "o3edig", "oedl4a", "oed5lan", "oed5ra", "oeg3", "oel3c", "o1em", "oen3", "o3ent", "oer3", "oes3", "oesg4o", "oet5an", "oetr3", "2of.", "of3ad", "of3ai", "ofan3", "ofan5e", "of3ant", "ofa5ol", "of5ebi", "of3ed", "of3el", "of3en", "of4enn", "of3er.", "o4ferl", "o4fery", "of4f3a", "off3ed", "off5id", "off3w", "ofiad4w", "ofl3", "of3n", "of4na", "of4nd", "of4ne", "of4nf", "of1o", "of4odo", "ofr3a", "of3re", "of4rec", "of4red", "of4rem", "of4rer", "of5wyf", "of4yn", "ofy3na", "ofy3ne", "og1", "og3ai", "og2an3", "o4ganau", "o4ganu", "og3as", "og4edy", "og5elyn", "og3er", "og5erd", "og3es", "2ogf", "og3i", "2ogl", "ogl3w", "ogl3y", "2ogn3", "3og2o4f", "og5oru", "og3rwy", "o3gry", "og3yd", "ogyf4", "og4yl", "og5yrn", "o1h2", "oheb3", "oher4", "o1id", "oig1", "o1ir", "o1it", "ol1", "2olau", "ol4ce", "ol3d", "ol4da", "4oleu", "ol3eua", "ol4eued", "ol5euo", "ol4euwr", "olew3", "ol3i", "oll1", "oll3e", "oll5ed", "ol4lt", "oll5wy", "olo2", "o3los", "ol3s", "ol4sb", "2olu", "2olwr", "olw4y", "ol3wyd", "ol5wyno", "ol4yne", "ol4yni", "ol4yno", "ol4ynw", "2oma", "om4at", "2omb", "om2e", "om5eda", "om5edi", "om5eg.", "om3ei", "om3en", "om5isi", "2oml", "om4og4", "2omp", "om5pre", "on1", "on5ach.", "on5adu", "on3af", "o4n3ai", "4onair", "on3an", "o4n3au", "on5au.", "2onb", "on5cyf", "2ond", "on5did", "on2do", "2one", "on5edd.", "on3el", "onest3", "2onf", "ongl3", "ong2o", "ong3w", "on4gyr", "2oni", "2onn", "4onnu", "on5of.", "2onog", "on2t", "4onto", "on3w", "2o1o", "2op", "op3a", "op4ao", "op5aon", "opl3", "opr5ai", "op5ren", "or1a", "4orac", "or3ach", "or5aeth.", "or5aetha", "or3af", "or3ai", "or3an", "o4r3au", "or3aw4", "or3b", "or2c", "or3chw", "or4dd", "or5ddyn", "ord3en", "or5din", "or4d5yn", "or1e", "or2eb", "or4edd", "ore5ddy", "4oreg", "or4egw", "or4et", "or3fa", "orfa5na", "orfa5ne", "orff4e", "or3fo", "or3f4y", "2or3g", "or3i", "or3l", "or4mu", "or4my", "orn3a", "or3nel", "or1o", "or3of", "or4oh", "oron5a", "or3one", "or5oni.", "or5onid", "or5onir", "or5onit", "or5pws", "4orth.", "ort4i", "or4ty", "or5uwc", "or1w", "or5wah", "orw4e", "or4wel", "or5wgl", "or1y", "or3ydd", "2os", "os3a", "os4ana", "osb3as", "osb5ed", "osb3o", "osb3w", "osb3y", "os5eai", "osg3a", "os3gl", "osgo5e", "os3gor", "osg3wy", "os5iae", "os5ibi", "os2o", "os3odd", "os3ol", "os3on", "os3te", "os3tr4", "os4tu", "os3w", "os3y", "2ot1", "3ot.", "ot3e", "ot5esa", "oth3", "ots4i", "ot5sia", "o2u", "o1wc", "owg3", "owl5as", "owl3e", "o1wn", "owt5er", "o1wy", "o1yc", "oyw3", "oy4we", "ôr3f", "p1", "p2a", "pab5yd", "2p3ad", "2p3af", "2p3ai", "2p3an", "pa3od", "para3t", "par4c", "par3w", "past4", "p3au", "pawe5na", "2pec", "4p5edig", "p2ei", "peir4a", "p5eli.", "pel3y", "2pem", "pengl4", "pens4", "pen3t2", "pen3w", "penwy5na", "2per", "2pes", "pet2", "pe3ta", "p2h2", "pheir4a", "phen3t4", "phen5w", "phet2", "phe3ta", "phob4l", "phr4a", "phryf5", "p3ia", "pib1", "p3ie", "p3io", "p3iw", "p2l", "pla3na", "p4lau", "pl5eda", "p4lyc", "3plyg", "po4b4l", "pog4y", "pol3", "p2r2", "pr3as", "pryf3", "pr5ynn", "p2s", "ps4iw", "pt2", "p2ud", "p4usr", "pw2", "pwd3", "pwr1", "p4wy.", "pydr3", "p2yr", "r4abe", "r4abi", "rab5lyd", "rab3y", "rach5wy", "r4a4ci", "racs4", "r4a4ct", "r2ada", "r4add", "radd5ol", "rad4ri", "radwr4i", "r2ae", "raed4", "raeddad4", "r4aen", "ra5fann", "ra5fán", "r4aff", "rag1", "ra4ge", "rag3o", "ra3gra", "ra4ha", "ra5hau", "r1ai", "4raidd", "ram3od", "ra5mor", "ra3m2w", "ran4d3", "ran2e", "r4anf", "ran3o", "r4anod.", "ra5phe", "r3ar3", "rar4c", "2r1as", "ras4ie", "ras3t2", "r3atao", "rat3e", "2r1au", "raw3e", "5rawes", "3rawi", "rawn3", "2r1b", "r2ba", "r3bar", "r4bec", "r4bem", "r4bent", "rb4er", "r4bes", "r2bl", "r4boc", "r4bom", "r4bont", "r4bwc", "r4bwd", "r4bwn", "rbyd3", "rc2a", "rc5adw", "rc5af.", "r3car", "rc3e", "rc4er", "r2ch", "rch3ad", "rch3an", "rch3ar5", "rch5eb", "r5chei", "rch3et", "rch3l", "r3chm", "rch3oc", "rch3oe", "rch3og", "r3chu", "r3chwa", "r3chwi", "rch5wyd", "r5chwyn", "rch3yc", "rchyf4", "rchym4", "r1cy", "2rd2", "r1da", "r3dai", "rdan3", "rd5au.", "r2dd", "rdd3ad", "rdd5as", "rdd5ell", "rdd5in", "rdd5iwy", "rdd3o", "rdd4od.", "r5ddodi", "r3dd4u", "r4ddu.", "rddw4", "rdd3yc", "r5ddychw", "rddyrch5", "r5ddyw", "r1de", "rd3i", "rd4in", "rd4ir", "r1do", "r5dod.", "r1dr", "rdro3", "rdro4ada", "r3dw", "r1dy", "rdy4n", "rd3yn.", "re3a", "r3ebai", "r3ebas", "r3ebe", "r3ebi", "rebl3", "r3ebo", "rech3", "rec3i", "4redd", "r5edd.", "r4edio", "r4edol", "r4edwr", "red4yn.", "re4fa", "refn5y", "ref3y", "r4egl", "r5egl.", "r4egog", "re5iau", "r4eic", "re5id.", "reidd5", "r4eig", "r4eil", "r4eine", "re5ir.", "re5it.", "re4iw", "r3ell", "r4emi", "ren4d", "r4eng3", "r4eni", "ren3in", "r4ennyd", "re1o", "r1er", "r4er4id", "rer5in", "restr3", "r4esw", "r4eua", "r4euo", "r2euy", "re4wi", "rew5id", "re5wn.", "rew5ynn", "2r2f", "r1fa", "r4f3ad", "r4faeth.", "r4faf", "r4fai", "rf4ao", "r4fas", "rf4at", "r4fau", "r3fedw", "rfel3", "rf3en", "rf4eny", "rf4ey", "r4ff.", "rff3i", "rff3l", "rff3o", "r3ffw", "rff3y", "rf3id", "r5fil.", "r3fl", "rf3lu", "rfodad4", "rf5ol.", "rf3on", "rfor2", "rf5ord", "r3fr", "r3fu", "rf1w", "rf5wis", "rfyn5yc", "rf4yr", "r3fys", "2r1g2", "rgal4", "rgan3", "r3ge", "rgel4y", "rge3na", "rge5ne", "rgo4f", "r1h2", "rhag5e", "rhag3l", "rhag3o", "rha3n4a", "rhan4e", "r4haw", "rh4es", "rhew5y", "rhif3", "rho4ec", "rhon5a", "rhost4ir", "rhugl5", "rhyf2", "rhy3n4a", "rhyn4e", "ri2", "2ria", "r4iaethu", "riaf3", "r4iag", "ri5agl", "r3iai", "r4i5aidd", "ri5all", "ri4an", "r5iant", "r3ias", "r4iaw", "ri5awd", "rib3e", "ribl3", "rib3w", "rib3y", "ri5can", "r4ida", "ridd3", "ridd5y", "r4idi", "rid4yllau", "2rie", "ri3ei", "rif1", "rig3", "r4igo", "ri3i", "rin5dir", "rin3e", "ringl5", "r4ini", "r4inl", "2rio", "r3ioc", "ri5odad", "ri5odaf", "ri5odai", "ri5odan", "ri5odasai", "ri5odasan", "ri5odase", "ri5odasi", "ri5odasoc", "ri5odasom", "ri5odasw", "r3iodd", "ri3ode", "ri3odi", "ri5odoc", "ri5odod", "ri5odom", "ri5odon", "ri5odwc", "ri5odwn", "ri5odwy", "ri5ody", "r4ioe", "r3iom", "ri3ong", "r3iont", "r1ir", "ris4g", "risgl3", "rist3", "3r4ith", "2riw", "ri4wa", "riw3l4", "r5iwr.", "2r3iy", "r1l2", "rla3na", "rla3ne", "r3lew", "rl3ia", "rl3ie", "rl3io", "r3ll", "r4ll.", "rll4e", "rllen3", "rl4l4w", "rl5og.", "r3lon", "rludd4", "r3lw", "r2lym", "rlyn3", "rl5yn.", "r1m2", "r2ma", "rm4ac", "rm3i", "rm4il", "r2mo", "rm4od", "r3my", "2r2n1", "r4nai.", "r4nau", "rn4es.", "rn4esa", "r5nest", "rng4e", "rn3i", "rn5iae", "rn4ii", "rn5iol", "r3n2ï1", "rn4os", "rn3y", "rn4yw", "2roa", "4road", "4roau", "rob3l4", "roch3", "rochl4", "ro3cr", "rodd3", "r4odr", "rod5rw", "ro4ea", "roed3", "ro4eo", "ro3er", "r2of", "rof3l4", "rofun4ed.", "rof3w", "r3og.", "r4ogae", "ro4ge", "rol3", "r1om3", "r4onau", "rongl4", "rong5lwy", "ron3i", "r4os.", "r4osf", "rosg4", "ros3o", "2rot", "rö5edi", "rp2", "r1pa", "rpar3", "r1pe", "rp5ech", "rp5em.", "r2pen", "rp5ent", "rp5er.", "rp5esi", "rp3i", "rp3o", "rp3wy", "rp3y", "r1r2", "r3ra", "rr4og", "r1s2", "rs4ai", "r4sau", "r2s3en", "rs3i", "rs4in", "rs5li.", "r2s3t2", "r2sy", "r1t2a", "r4tau", "r4ted", "r3teis", "r4ten", "r4tes", "rth3a", "rth4eg", "r3thin", "rth3la", "rth3o", "rth5ol", "rth5ru", "r5thryc", "r4thw", "rth5wyon.", "rth5ydd", "rt4iy", "r1tr", "rtr4a", "rt5rwy", "rt2u", "rt3y", "rub4a", "r3uc", "rudd3", "3rudd.", "run4i", "r1us", "rw2a", "rw3ad", "rw3af", "r3w4ag", "r3wait", "rwb5an", "rwbl3", "r1wc", "r5wdenn", "rwedd3", "r4weddog", "r4weddol", "r4w3eid", "r3wel", "r3wer", "r2wg", "rw5hel", "rw1i", "rw3in", "r3wl", "r4wnc", "rw4ni", "rw4n3o", "rwobr4", "rw3od", "rw5old", "r1wr", "rwr5es", "rwr4iaetho", "rw2y", "r4wyb", "r5wydden.", "rwydd4iad4u", "r4wyde", "r4wydo", "rwydr3", "r4wydy", "3rwym", "rwyn3", "r4wys", "3ry.", "3rybl", "ry3bo", "rych5wai", "r2yd", "r4yd.", "ry5dano", "rydd4on.", "rydl4", "ry3f4a", "ryf2e", "ry3fer", "ryf4od", "ryl3a", "ryl2e", "ryl5it", "rym2r3", "ryn3a", "rync4", "4rynd", "ryn3e", "ryn3f", "ryng5a", "4rynn", "rynod4", "ryno5ded", "ryno5der", "ryn3yc", "rys3b", "rys5ba", "rysg5w", "rysg3y", "ry3wa", "ryw3i", "s1", "sach3", "saf3a", "saf3o", "san3a", "san3e", "san3o", "sarf5a", "sat4a", "sath4", "sathraw4", "s3au", "sá4it", "s2b2", "sbad4w", "s4bai", "s3bet", "sb3iw", "sb5iyc", "s3bl", "sbr5io", "sd4or", "se2", "sec4an", "sedd3", "3sef", "se5ion", "sen5ol", "senw3", "s4erc", "serch5", "s4eri", "s2et", "sf4am", "sfedd4", "sff4y", "sf4wy", "sf4yr", "s2g", "s5g4adr", "sg3adw", "s3gam", "sg3an", "sgar5a", "s3gaw", "s3geda", "s3gede", "s4gedig", "s5gedo", "s5gedw", "sgel4", "sg5en.", "s3ge3na", "sge5ne", "s4gia", "s4gl.", "sgl3a", "sgl3o", "s3gn", "sg3ni", "sg3od", "sg4od.", "sgo4g3", "sg4ol", "sg3om", "sg3on", "sg5oty", "sg5rwy", "sg5ryw", "s4gwc", "sg3wn", "s4gyc", "sgy4f3", "sgy3na", "sgy5nes", "2si", "s5ial.", "s5ialu", "si4am", "5siand", "s4iar", "s3id3", "sid4a", "s3ie", "s4iet", "s2ig", "s3ig.", "si4ga", "s3ige", "sigl3", "5sigl.", "s3igr", "s5igyn", "sil4f", "sins4", "s3io", "s3ir", "s3it", "si4wr", "s2iyn", "2s2ï1", "2sl2", "sl4au", "slo3na", "slo3n4e", "s3ly", "slyw4", "sm2", "sm4ar", "sm4er", "smwyt5haso", "s4nau", "sn2e", "sneg2", "s2n3i", "sn4ob", "s3oc", "sodd3", "sod4l3", "s3oe", "sof4l", "2s3og3", "s3om3", "son3", "s4on.", "s4onau", "son4deba", "son4der", "s3one", "s4ong", "sra3na", "sra5ne", "s2t", "st3ac", "s4tade", "s4taf", "st4am", "st2an", "st3as", "s4tau", "st5awc", "s4tec", "s4ted", "s4tei", "s4t3em", "s4ten", "s4tes", "st3f", "s5tiro", "stl3o", "st5lyt", "st2o", "s3tod.", "sto3ra", "sto3r4e", "st4ra", "s3tra.", "str3ec", "str3es", "str3oc", "str3ol", "s4tr3w", "str3yc", "st2u", "st3ur", "st5us.", "s5twyi", "styr3", "s2u", "sur3", "s3us", "sw2a", "s3wc", "swcr3", "s3we", "s4wed", "sw5edd", "swen3", "2swi", "swmp3", "s3wyf", "swyn3", "swy4r", "s2y", "s3yc", "s5ych.", "s3yd", "syf4l3", "2syg", "syll3a", "syllt3", "sym4l3", "symudad4", "2s3yn.", "syn4fe", "s3yr", "syr2a", "syr2e", "s3ys", "3syt", "s4ywa", "1tac", "tach3", "3tad4l3", "tad3r", "t1af", "ta4fa", "taf4l", "tag3", "t1ai", "t3aid", "t5aliae", "tal2m3", "t1an", "4tanc", "tan3e", "tang5n", "tan3o", "tan3w", "t3ao", "3tar4d", "tar4f", "t1as", "tat1", "t1au", "tawl3", "t1b", "t3ch", "t1ec", "t1ed", "tedd3", "4teg.", "4tegio", "t3eidi", "teimlad4w", "tel4y", "t3em.", "t4emi", "t1en", "ten4d", "te4ne", "terf4", "terfyn5", "t1es", "t4esa", "tes4io", "tet4a", "3tew", "4tew.", "4tewc", "tew5id", "t1f", "tff2", "tff4e", "tfod4", "tfydd4", "t1g2", "tg4af", "tg4an", "tg4en", "tg4er", "tgl4a", "tgn2", "t2gor", "t5gor.", "t5goria", "t5gorn", "tg4wc", "tg4wy", "tgy3w", "t2h", "thalad4", "thal4m3", "thang5n", "th4ar", "thar4f", "th4at", "that5y", "th1e", "th4ef", "th5ell", "therfyn5", "thet4", "thl3a", "thl5ent", "th5let", "th3n", "th5nod", "th1o", "th5old", "thollt4", "thon4e", "thorad4", "thr3ac", "th3red", "thr5ent", "thrid4", "thro3f", "th5rwf", "thryd4", "thry5da", "th3ug", "th3um", "th3un", "th3us", "th1w", "th3wa", "th4wl", "th3wyd", "th3wyf", "thwysg4", "th3ych", "thydd5", "th5yma", "thyrf4au", "thyr3w", "thy4w", "2t1i", "t3ia", "tid3", "t3ie", "t3in", "ting3", "t4ino", "tion4", "t4iono", "tï5ol.", "tl3a", "tl4ae", "tl1e", "tl4en.", "tl3on", "tl3wy", "t3lyd", "t1n2", "t3och", "t4od.", "t3odd", "to4ec", "to3edi", "to4em", "to3esi", "tof3", "t3og3", "3tois", "t2ol", "tollt4", "tol3y", "t1om", "t3om.", "t1on", "ton4e", "t3ont", "3tor", "tor2a", "tor4c", "t3os", "to4wc", "to4wn", "tra3c", "tra3dd", "tr3adw", "tr3af.", "tra3g", "tra3na", "tra5ne", "tr3ant", "3traw", "tr3ed", "3tr4ef", "tref5a", "tref3l", "4treg", "tr3em.", "tr3ent", "3trew", "tr3id4", "tr5ig.", "tro4ada", "tr3odd", "tro5fa", "tr3ola", "tr3olo", "tr3olw", "tron4o", "tr3ont", "2trw", "tr4wm", "tr3wn", "tr5wyd.", "t5r4wydd", "tr3wyf", "try3da", "tryd4y", "try3f", "try3l", "tr5yn.", "3tryw", "ts2", "ts5ach", "t1se", "ts3i", "3tud", "tudr4", "1tum", "t1un3", "1tur", "t4urm", "tw2", "t3wai", "t1wc", "t1wn", "t1wr1", "twr4n", "3twya", "t3wyd", "3twye", "t3wyf", "tw4ym", "3twyo", "twysg4", "3twyw", "t1yc", "t1yd", "tydd5y", "ty5gar", "ty3li", "tymp4", "4t3yn.", "tyng5ad", "1tyr", "tyr2a", "tyr4es", "ty3wr", "2u1a", "ual3", "u2and", "u4ane", "u3ar", "u3aw", "ub1", "2uc", "uch1", "uch3e", "uch5ed", "ud3ad", "u5dale", "udd1", "udd3a", "udd4eg", "udd3el", "udd3f", "udd3i", "ud5eir", "ud3er", "ud3i", "ud1l", "udr3", "ud5rwydd", "ud2w", "ud3wn", "ud3wr", "ud3yn", "u1e", "uedd3", "u4estai.", "u4estau", "u4estwr", "u4esty", "uf5au.", "uff4y", "uf3y", "ug3ad", "ug3af", "ug3en", "ug3i", "ugl3a", "ugl3e", "ug3lw", "ugn3", "ug1o", "ug1u", "ug1w", "ug3y", "u1h2", "u1i", "ul3ad", "ul3af", "u5lan.", "u5lann", "ul3ant", "u5lath", "ul3d", "u2l1e", "ul1f", "ul5igr", "ull1", "u1lo", "ul3oc", "ul3od", "ulon3", "ulon5e", "ul1u", "ul1w", "ul3yc", "u3lyd", "un1", "un4edy", "un5ell", "un5es.", "un3i", "unig3", "un5od.", "un2ol", "un5ol.", "2u1o", "uog3", "u3os3", "up2", "ur1", "urb4w", "ur5ddu", "ur3e", "ur5fau", "ur4fl", "ur2gy", "4urn.", "urof4", "ur2s3", "ur4ty", "ur4ud", "u5rwydd", "ur3y", "ur4yw", "1us.", "us4edda", "us5end", "usg1", "4usi.", "us3o", "3usr", "us3ter", "us3tod", "us3tr", "ut3a", "ut1e", "uth4r3", "uth3u", "uth4un", "ut3o", "utr3", "2u1w", "u2wc", "uwch3", "u1y", "2wa", "wac5ew", "wadd3", "wad2n3", "w5adwy.", "waen4i", "waer2", "wag1", "w1ai", "w3ai.", "w3aid", "w2air", "w3ais", "w4ait", "wallt5", "w4an.", "wan3a", "wan3e", "wan3o", "war5ddr", "war3e", "war4edd", "war5ia", "warth4", "wart5hai", "wart5has", "wart5hi", "wart5hw", "war3w", "3w4as.", "w3ase", "was4g", "w3asi", "w3aso", "w4as4t", "w3asw", "wat5er", "w1au", "2wb", "wbl5es", "w2c", "2wca", "wc4ed", "wch1", "4wchu", "2wci", "wc5wll", "wc4yn", "2wd", "wdd3eg", "w5ddew", "wd2e", "wd3ed", "wde3n4a", "wde5n4e", "wd3i", "wd4ih", "wd3ly", "w3dod.", "wdr1", "wd4ra", "wdry4", "wd2u", "w1eb3", "2w1ec", "2w3ed.", "w4eda", "4weddf", "4weddi", "4wedi", "w3edig", "we4gi", "wegr4", "wein3", "well5ti", "wel3o", "welw5l", "2w1em", "wen3au", "wen4d", "2w3ent", "wenwyn5", "wen3y", "2w3er.", "wer4i", "wer5id", "w4ers", "wer4yd", "2wes", "4w3esi", "w4esir", "w4esit", "5west.", "west4ai", "w1et", "w4eth", "2weu", "weu2g", "weun3", "2wf2", "w1fa", "w1fe", "wff3a", "w1fi", "wf4id", "w1fo", "wfor2", "w1fw", "wf4wy", "w3fy", "wg1", "2wg.", "w5gig.", "2wgl", "wg3n", "2w1h2", "w3he", "w3hw", "2wi", "wi4an", "wib5an", "wibl5a", "wib5ol", "widl3", "wi4fr", "3wig1", "wigl5e", "wil3", "win5gada", "win5gade", "win5gadi", "win5gado", "w4ione", "wir3", "wisg3", "w1it", "3wiw.", "wiw4e", "2wl", "3wlad.", "wlan3", "wl4co", "wl3in", "w4lip", "wll5yn", "wl5ws.", "wl4yc", "2wm", "wm3a", "wman3", "wm4br", "wm2i", "wm5iai", "wm5ian", "wm4wl", "wn1", "wn5adwy.", "wn2ae", "2wnd", "wn3de", "wn3di", "wndr3", "wn4ei", "wn4êl", "2wn3g", "wngl4", "wn3in", "wn3l", "wn2o", "w4n3oc", "wn3odd", "wn3og", "wn3ol", "w4n3om", "w4n3on", "2wnw", "2w1o", "w2od", "w3od.", "w3odd", "w2ol", "w3ol.", "w3olae", "w2or", "2wp", "wp3e", "wpl1", "wp5wrd", "wr5aet", "wrb5yn", "wrc2", "wr3ca", "wr4ce", "wr4ch3", "wr4ci", "wr5cwd", "2wrd", "wr5dei", "wr3ed", "wreig3", "wr5esi", "wr3f", "wr5fau", "wr4fi", "4wri.", "wrid3", "wr3id.", "wr3ie", "wr3l", "wr4ll", "wr3n2a", "wrn4es", "wr3no", "wr1o", "wr2t", "wrth3", "wr1w", "wr4ws", "w5rwydd", "wry4w", "ws5bre", "ws3e", "ws3g", "ws4gl", "ws4ig", "ws4og", "ws4ta", "wst5an", "ws5ter.", "wstr3", "ws4us", "ws3wa", "2wt", "wt3a", "wtan3", "wt3em", "wt5ery", "wth1", "4wth.", "wth3w", "wt3od", "wt3wy", "wt3y", "2w1w", "2wya", "wy5alc", "4wybr", "wybr5y", "wy3bu", "w1yc", "wych3", "wyd3a", "2wydd", "wydd4ly", "wydd4yd", "wydr3o", "2wydy", "2wye", "wy3fr", "wy3h", "2wyi", "2wyl", "wyl4deb", "wyll3a", "wyn5ad.", "4wynd", "wyn3eg", "wyn3f", "wyn3g4", "wy4ni", "wyn3o", "wyn3y", "2wyo", "wyr3ad", "wy3ran", "5wyrdd.", "wyrl3i", "2wys", "2wyt", "2wyw", "wy3wr", "wy3wy", "2wyy", "2y1a", "y3ar3", "y4ar.", "y4arn", "2yb", "yb4ac", "yb5edd", "yber4", "ybl1", "yb3ly", "ybr1", "ybr3i", "yb3w", "ych1", "ychan5", "ych4anwr", "ych5ei", "ych3r", "4ychwe", "ych3wy", "ychwy5na", "ychwy5ne", "ycl3", "2yd.", "2yda", "yd3ad", "yd4al", "yd2an3", "y3dana", "y3dane", "yd3ant", "y5danw", "y3dar", "yd3as", "yd3au", "ydd3", "ydd5an", "yd4de", "yd4df4", "yd4di4", "ydd4in.", "ydd4of", "ydd5yn.", "yddy5ne", "ydd4ysg", "2yde", "y3deb", "yd3ed", "yd4eddau", "yd3ei", "yd3er", "yd4eu", "yd5ffu", "ydfwr3", "ydfyn3", "yd3i", "yd1l", "yd4ma", "yd2ne", "ydne5b", "2yd3o", "yd4od.", "ydol3", "yd4os", "4ydrau", "ydr3ec", "ydr3em", "ydr5esid", "yd3rew", "yd4ri", "4ydria", "ydr3oc", "4ydrol", "ydr5wyd.", "yd5rwydd", "4ydry", "ydr3yc", "2ydw", "yd3wa", "yd5wed", "ydweithi5ol", "ydwel5e", "yd3wr", "yd1y", "ydy4l", "y1e", "y3el", "y4era", "y4ern", "2yf1", "y4f3ag", "yf3ai", "yfan3t", "yf3are", "yf3arh", "yfar5wa", "yf3eda", "yf3ede", "yf3edi", "yf3edo", "yf3edw", "yf3ei", "yfel3", "yf5erf", "yfer3n", "yf5esi", "yf5ewi", "yff1", "yf4fa", "yf5fait", "yf5fei", "y4ff3i", "yff5in", "y4ffl", "yffr3a", "yffro5ed", "yffro5em", "yffro5en", "yffro5wc", "yffr3w", "yff3ry", "yf3i", "yfl4ed", "yflo3e", "yf3ne", "yf3no", "yf3ny", "yf3o", "yf5od.", "yfogl4", "yf5rait", "yfra5ne", "yf5ryw", "yf3u", "yf5wng", "yf3yg", "yf5yn.", "yfy3na", "yfy5ne", "yfyng5", "yf4yt", "yg1", "yg3a", "yg5adu", "yg4ar", "ygeg4", "yg4eid", "yg3i", "yg4il", "3ygin", "ygl3a", "ygl3o", "ygl3w", "ygl3y", "ygn3", "yg3o", "yg4oe", "yg4of", "ygr1", "ygrad4", "yg5wyd", "y4gyc", "4ygyd", "y1h2", "y2he", "yhe3i", "yhe3w", "y1i", "y3ie", "yl3ad.", "yl5adwy.", "yl3af", "ylan3", "yl3ant", "y5law.", "2ylc", "ylch3w", "yl4dera", "yl1e", "yl1f", "y3lin", "y4lit", "yll5ad.", "yll3e", "4yllf", "yll5ida", "yll3o", "yll3w", "yll3y", "yl5nos", "yl3oc", "yl3od", "yl3on", "yl5ore", "y4lu.", "4ylwe", "yl3wy", "yl1y", "ym5ait", "ym4al", "ym5an.", "yman5t", "ymar5w", "ymbl2", "ym5edr", "ym4eri", "ym5es3u", "3ymg", "ym3heu", "ym2le", "ym2li", "ymlo5ne", "ym4oli", "ym3on", "ymp3a", "ym4pi", "ymp5od", "ym3pr", "ymra5ne", "ymr5ig", "ymro5e", "ym4ru", "ym3se", "ym4um", "5ymwyb", "ym3y", "ymyn5y", "ym5yra", "ym5yre", "ym5yri", "ym5yro", "ym5yrw", "yn4ada", "yn3ae", "yn3af", "yn3ai", "yn3an3", "ynas3", "2yn3au", "yn4aw", "yn5byn", "ync5ed", "yn3dir", "yn4eb", "yn3ec", "yn3ed.", "yn3edd", "yn2eg", "yn3ei", "yn3em", "yn3en", "yn3er", "y3nesa", "y4nesau", "2ynf", "ynfyd3", "2yng1", "yn4ge", "yng5er", "yn3gl", "yniaw4", "yni4d", "yn3i4f", "y3nig", "yn5igy", "yn3il3", "yn3n", "yn1o", "yn5o5ad", "yn5odd", "yn4odi", "yn4ody", "yn3oe", "yn3os4", "2ynr", "ynt1", "ynt4a", "yn4te", "yn4ti", "yn4to", "yn4tu", "yn4ud", "yn1w", "yn3wa", "yn2w4e", "yn3wy", "yn4wyr", "yn1y", "yn2yc", "ynydd5", "y1o", "ypl3a", "ypl3e", "ypl3o", "ypl3w", "yp3ly", "yr3ae", "yr3af", "yra3na", "yra3ne", "yr3ant", "y4r3au", "yr4ch", "yrch3e", "yrch3o", "yrch3w", "yrch3y", "yr4dd3", "yr5ddyd", "yr1e", "yr2ei", "yr5el.", "yren5d", "yrf3e", "yr3ff4", "yr4fu", "yrf5yd", "y4ria", "yr3id", "yr2l", "yr3ly", "yrn3", "yr1o", "yr5ol.", "yr2s", "yr1w", "yr5way", "yr1y", "2ysa", "ys3aw", "2ysb", "ysb5ïw", "ys4bl", "ysb3yd", "2yse", "ys5etl", "2ysf", "4ysgar.", "ys5garai", "ys5garasa", "ys5garia", "ys5garwy", "ysge4", "ysgl4e", "ysg5lw", "ys4gn", "3ysgr", "ys4gy", "2ysi", "ys5ni.", "2yso", "ys3od", "4ysol", "ys5ol.", "ys3ta", "4yste", "yst5eb", "ys5ted", "ys3ter", "ys4try", "yst4w", "ys3u", "2ysw", "ys4we", "ys4wi", "2ys3y", "ys4yg", "yt3ad", "yt1e", "yth3a", "yth3e", "ythi3e", "yth3l", "yth3o", "yth4re", "ythr5ec", "ythr5ed", "ythr5es", "yth5reu", "ythr3o", "yth5rwb", "ythr5yc", "yth5ur", "yth3w", "yth3yn", "yt5iro", "yt3o", "ytr2", "yt3ras", "yt3s", "ytw5ad", "yt3wy", "yt5ysa", "2yw", "yw4ae", "y3wait", "y1wc", "y3wedd", "y5weddia", "yw5eg.", "y4wel", "yw5en.", "yw3es", "yw1g2", "y4wia", "yw3id", "y4wio", "y4wir.", "y1wn", "yw3ol", "y2wr1", "ywr4a", "ywr5ain", "y4wyc", "y3wyf", "ywy3na", "ywy5ne", "y1y", };
mit
AdamGagorik/darkstar
scripts/zones/Northern_San_dOria/npcs/Ramua.lua
53
1884
----------------------------------- -- Area: Northern San d'Oria -- NPC: Ramua -- Type: Woodworking Synthesis Image Support -- @pos -183.750 10.999 255.770 231 ----------------------------------- package.loaded["scripts/zones/Northern_San_dOria/TextIDs"] = nil; ----------------------------------- require("scripts/globals/status"); require("scripts/globals/crafting"); require("scripts/zones/Northern_San_dOria/TextIDs"); ----------------------------------- -- onTrade Action ----------------------------------- function onTrade(player,npc,trade) end; ----------------------------------- -- onTrigger Action ----------------------------------- function onTrigger(player,npc) local guildMember = isGuildMember(player,9); local SkillCap = getCraftSkillCap(player,SKILL_WOODWORKING); local SkillLevel = player:getSkillLevel(SKILL_WOODWORKING); if (guildMember == 1) then if (player:hasStatusEffect(EFFECT_WOODWORKING_IMAGERY) == false) then player:startEvent(0x0271,SkillCap,SkillLevel,2,207,player:getGil(),0,0,0); else player:startEvent(0x0271,SkillCap,SkillLevel,2,207,player:getGil(),6857,0,0); end else player:startEvent(0x0271,SkillCap,SkillLevel,2,201,player:getGil(),0,0,0); -- Standard Dialogue end end; ----------------------------------- -- onEventUpdate ----------------------------------- function onEventUpdate(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); end; ----------------------------------- -- onEventFinish ----------------------------------- function onEventFinish(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); if (csid == 0x0271 and option == 1) then player:messageSpecial(IMAGE_SUPPORT,0,1,2); player:addStatusEffect(EFFECT_WOODWORKING_IMAGERY,1,0,120); end end;
gpl-3.0
AdamGagorik/darkstar
scripts/globals/items/butter_crepe.lua
17
1278
----------------------------------------- -- ID: 5766 -- Item: Butter Crepe -- Food Effect: 30 Min, All Races ----------------------------------------- -- HP +10 -- Magic Accuracy +2 -- Magic Defense +1 ----------------------------------------- require("scripts/globals/status"); ----------------------------------------- -- OnItemCheck ----------------------------------------- function onItemCheck(target) result = 0; if (target:hasStatusEffect(EFFECT_FOOD) == true or target:hasStatusEffect(EFFECT_FIELD_SUPPORT_FOOD) == true) then result = 246; end return result; end; ----------------------------------------- -- OnItemUse ----------------------------------------- function onItemUse(target) target:addStatusEffect(EFFECT_FOOD,0,0,1800,5766); end; ----------------------------------------- -- onEffectGain Action ----------------------------------------- function onEffectGain(target,effect) target:addMod(MOD_HP, 10); target:addMod(MOD_MACC, 2); target:addMod(MOD_MDEF, 1); end; ----------------------------------------- -- onEffectLose Action ----------------------------------------- function onEffectLose(target,effect) target:delMod(MOD_HP, 10); target:delMod(MOD_MACC, 2); target:delMod(MOD_MDEF, 1); end;
gpl-3.0
iotcafe/nodemcu-firmware
lua_examples/yet-another-bmp085.lua
65
2608
------------------------------------------------------------------------------ -- BMP085 query module -- -- LICENCE: http://opensource.org/licenses/MIT -- Vladimir Dronnikov <dronnikov@gmail.com> -- Heavily based on work of Christee <Christee@nodemcu.com> -- -- Example: -- dofile("bmp085.lua").read(sda, scl) ------------------------------------------------------------------------------ local M do -- cache local i2c, tmr = i2c, tmr -- helpers local r8 = function(reg) i2c.start(0) i2c.address(0, 0x77, i2c.TRANSMITTER) i2c.write(0, reg) i2c.stop(0) i2c.start(0) i2c.address(0, 0x77, i2c.RECEIVER) local r = i2c.read(0, 1) i2c.stop(0) return r:byte(1) end local w8 = function(reg, val) i2c.start(0) i2c.address(0, 0x77, i2c.TRANSMITTER) i2c.write(0, reg) i2c.write(0, val) i2c.stop(0) end local r16u = function(reg) return r8(reg) * 256 + r8(reg + 1) end local r16 = function(reg) local r = r16u(reg) if r > 32767 then r = r - 65536 end return r end -- calibration data local AC1, AC2, AC3, AC4, AC5, AC6, B1, B2, MB, MC, MD -- read local read = function(sda, scl, oss) i2c.setup(0, sda, scl, i2c.SLOW) -- cache calibration data if not AC1 then AC1 = r16(0xAA) AC2 = r16(0xAC) AC3 = r16(0xAE) AC4 = r16u(0xB0) AC5 = r16u(0xB2) AC6 = r16u(0xB4) B1 = r16(0xB6) B2 = r16(0xB8) MB = r16(0xBA) MC = r16(0xBC) MD = r16(0xBE) end -- get raw P if not oss then oss = 0 end if oss <= 0 then oss = 0 end if oss > 3 then oss = 3 end w8(0xF4, 0x34 + 64 * oss) tmr.delay((4 + 3 ^ oss) * 1000) local p = r8(0xF6) * 65536 + r8(0xF7) * 256 + r8(0xF8) p = p / 2 ^ (8 - oss) -- get T w8(0xF4, 0x2E) tmr.delay(5000) local t = r16(0xF6) local X1 = (t - AC6) * AC5 / 32768 local X2 = MC * 2048 / (X1 + MD) t = (X2 + X1 + 8) / 16 -- normalize P local B5 = t * 16 - 8; local B6 = B5 - 4000 local X1 = B2 * (B6 * B6 / 4096) / 2048 local X2 = AC2 * B6 / 2048 local X3 = X1 + X2 local B3 = ((AC1 * 4 + X3) * 2 ^ oss + 2) / 4 X1 = AC3 * B6 / 8192 X2 = (B1 * (B6 * B6 / 4096)) / 65536 X3 = (X1 + X2 + 2) / 4 local B4 = AC4 * (X3 + 32768) / 32768 local B7 = (p - B3) * (50000 / 2 ^ oss) p = B7 / B4 * 2 X1 = (p / 256) ^ 2 X1 = (X1 * 3038) / 65536 X2 = (-7357 * p) / 65536 p = p + (X1 + X2 + 3791) / 16 -- Celsius * 10, Hg mm * 10 return t, p * 3 / 40 end -- expose M = { read = read, } end return M
mit
AdamGagorik/darkstar
scripts/globals/items/kohlrouladen.lua
18
1269
----------------------------------------- -- ID: 5760 -- Item: kohlrouladen -- Food Effect: 1hour?, All Races ----------------------------------------- -- Strength 3 -- Agility 3 -- Intelligence -5 ----------------------------------------- require("scripts/globals/status"); ----------------------------------------- -- OnItemCheck ----------------------------------------- function onItemCheck(target) local result = 0; if (target:hasStatusEffect(EFFECT_FOOD) == true or target:hasStatusEffect(EFFECT_FIELD_SUPPORT_FOOD) == true) then result = 246; end return result; end; ----------------------------------------- -- OnItemUse ----------------------------------------- function onItemUse(target) target:addStatusEffect(EFFECT_FOOD,0,0,3600,5760); end; ----------------------------------------- -- onEffectGain Action ----------------------------------------- function onEffectGain(target,effect) target:addMod(MOD_STR, 3); target:addMod(MOD_AGI, 3); target:addMod(MOD_INT, -5); end; ----------------------------------------- -- onEffectLose Action ----------------------------------------- function onEffectLose(target,effect) target:delMod(MOD_STR, 3); target:delMod(MOD_AGI, 3); target:delMod(MOD_INT, -5); end;
gpl-3.0
AdamGagorik/darkstar
scripts/globals/items/sleepshroom.lua
18
1170
----------------------------------------- -- ID: 4374 -- Item: sleepshroom -- Food Effect: 5Min, All Races ----------------------------------------- -- Strength -3 -- Mind 1 ----------------------------------------- require("scripts/globals/status"); ----------------------------------------- -- OnItemCheck ----------------------------------------- function onItemCheck(target) local result = 0; if (target:hasStatusEffect(EFFECT_FOOD) == true or target:hasStatusEffect(EFFECT_FIELD_SUPPORT_FOOD) == true) then result = 246; end return result; end; ----------------------------------------- -- OnItemUse ----------------------------------------- function onItemUse(target) target:addStatusEffect(EFFECT_FOOD,0,0,300,4374); end; ----------------------------------- -- onEffectGain Action ----------------------------------- function onEffectGain(target,effect) target:addMod(MOD_STR, -3); target:addMod(MOD_MND, 1); end; ----------------------------------------- -- onEffectLose Action ----------------------------------------- function onEffectLose(target,effect) target:delMod(MOD_STR, -3); target:delMod(MOD_MND, 1); end;
gpl-3.0
hlieberman/sysdig
userspace/sysdig/chisels/tracers_2_statsd.lua
4
2002
--[[ Copyright (C) 2013-2018 Draios Inc dba Sysdig. This file is part of sysdig. 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. --]] -- Chisel description description = "Converts sysdig span duration data into statsd metrics and pipes them to the given statsd server. See https://github.com/draios/sysdig/wiki/Tracers for more information."; short_description = "Export spans duration as statds metrics."; category = "Tracers"; args = { { name = "server_addr", description = "The address of the statsd server to send data to", argtype = "string", optional = true }, { name = "server_port", description = "The UDP port to use", argtype = "string", optional = true }, } local lstatsd = require "statsd" local host = "127.0.0.1" local port = 8125 -- Argument notification callback function on_set_arg(name, val) if name == "server_addr" then host = val return true elseif name == "server_port" then port = tonumber(val) return true end return false end -- Initialization callback function on_init() -- Initialize statsd statsd = lstatsd({host = "127.0.0.1"}) -- Request the fields that we need ftags = chisel.request_field("span.tags") flatency = chisel.request_field("span.duration") -- set the filter chisel.set_filter("evt.type=tracer and evt.dir=<") return true end -- Event parsing callback function on_event() local tags = evt.field(ftags) local latency = evt.field(flatency) if latency then statsd:timer(tags, tonumber(latency) / 1000000) end return true end
gpl-2.0
sjznxd/lc-20130204
applications/luci-minidlna/luasrc/model/cbi/minidlna.lua
87
5720
--[[ LuCI - Lua Configuration Interface - miniDLNA support Copyright 2012 Gabor Juhos <juhosg@openwrt.org> 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 $Id$ ]]-- local m, s, o m = Map("minidlna", translate("miniDLNA"), translate("MiniDLNA is server software with the aim of being fully compliant with DLNA/UPnP-AV clients.")) m:section(SimpleSection).template = "minidlna_status" s = m:section(TypedSection, "minidlna", "miniDLNA Settings") s.addremove = false s.anonymous = true s:tab("general", translate("General Settings")) s:tab("advanced", translate("Advanced Settings")) o = s:taboption("general", Flag, "enabled", translate("Enable:")) o.rmempty = false function o.cfgvalue(self, section) return luci.sys.init.enabled("minidlna") and self.enabled or self.disabled end function o.write(self, section, value) if value == "1" then luci.sys.init.enable("minidlna") luci.sys.call("/etc/init.d/minidlna start >/dev/null") else luci.sys.call("/etc/init.d/minidlna stop >/dev/null") luci.sys.init.disable("minidlna") end return Flag.write(self, section, value) end o = s:taboption("general", Value, "port", translate("Port:"), translate("Port for HTTP (descriptions, SOAP, media transfer) traffic.")) o.datatype = "port" o.default = 8200 o = s:taboption("general", Value, "interface", translate("Interfaces:"), translate("Network interfaces to serve.")) o.template = "cbi/network_ifacelist" o.widget = "checkbox" o.nocreate = true function o.cfgvalue(self, section) local rv = { } local val = Value.cfgvalue(self, section) if val then local ifc for ifc in val:gmatch("[^,%s]+") do rv[#rv+1] = ifc end end return rv end function o.write(self, section, value) local rv = { } local ifc for ifc in luci.util.imatch(value) do rv[#rv+1] = ifc end Value.write(self, section, table.concat(rv, ",")) end o = s:taboption("general", Value, "friendly_name", translate("Friendly name:"), translate("Set this if you want to customize the name that shows up on your clients.")) o.rmempty = true o.placeholder = "OpenWrt DLNA Server" o = s:taboption("advanced", Value, "db_dir", translate("Database directory:"), translate("Set this if you would like to specify the directory where you want MiniDLNA to store its database and album art cache.")) o.rmempty = true o.placeholder = "/var/cache/minidlna" o = s:taboption("advanced", Value, "log_dir", translate("Log directory:"), translate("Set this if you would like to specify the directory where you want MiniDLNA to store its log file.")) o.rmempty = true o.placeholder = "/var/log" s:taboption("advanced", Flag, "inotify", translate("Enable inotify:"), translate("Set this to enable inotify monitoring to automatically discover new files.")) s:taboption("advanced", Flag, "enable_tivo", translate("Enable TIVO:"), translate("Set this to enable support for streaming .jpg and .mp3 files to a TiVo supporting HMO.")) o.rmempty = true o = s:taboption("advanced", Flag, "strict_dlna", translate("Strict to DLNA standard:"), translate("Set this to strictly adhere to DLNA standards. This will allow server-side downscaling of very large JPEG images, which may hurt JPEG serving performance on (at least) Sony DLNA products.")) o.rmempty = true o = s:taboption("advanced", Value, "presentation_url", translate("Presentation URL:")) o.rmempty = true o.placeholder = "http://192.168.1.1/" o = s:taboption("advanced", Value, "notify_interval", translate("Notify interval:"), translate("Notify interval in seconds.")) o.datatype = "uinteger" o.placeholder = 900 o = s:taboption("advanced", Value, "serial", translate("Announced serial number:"), translate("Serial number the miniDLNA daemon will report to clients in its XML description.")) o.placeholder = "12345678" s:taboption("advanced", Value, "model_number", translate("Announced model number:"), translate("Model number the miniDLNA daemon will report to clients in its XML description.")) o.placholder = "1" o = s:taboption("advanced", Value, "minissdpsocket", translate("miniSSDP socket:"), translate("Specify the path to the MiniSSDPd socket.")) o.rmempty = true o.placeholder = "/var/run/minissdpd.sock" o = s:taboption("general", ListValue, "root_container", translate("Root container:")) o:value(".", translate("Standard container")) o:value("B", translate("Browse directory")) o:value("M", translate("Music")) o:value("V", translate("Video")) o:value("P", translate("Pictures")) s:taboption("general", DynamicList, "media_dir", translate("Media directories:"), translate("Set this to the directory you want scanned. If you want to restrict the directory to a specific content type, you can prepend the type ('A' for audio, 'V' for video, 'P' for images), followed by a comma, to the directory (eg. media_dir=A,/mnt/media/Music). Multiple directories can be specified.")) o = s:taboption("general", DynamicList, "album_art_names", translate("Album art names:"), translate("This is a list of file names to check for when searching for album art.")) o.rmempty = true o.placeholder = "Cover.jpg" function o.cfgvalue(self, section) local rv = { } local val = Value.cfgvalue(self, section) if type(val) == "table" then val = table.concat(val, "/") elseif not val then val = "" end local file for file in val:gmatch("[^/%s]+") do rv[#rv+1] = file end return rv end function o.write(self, section, value) local rv = { } local file for file in luci.util.imatch(value) do rv[#rv+1] = file end Value.write(self, section, table.concat(rv, "/")) end return m
apache-2.0
kevindehecker/paparazzi
sw/extras/chdk/pictuav.lua
87
5350
--[[ @title PictUAV @param d Display off frame 0=never @default d 0 --]] -- Developed on IXUS 230 HS. Other cameras should work as well, but some errors or crashes are possible -- also considering that some firmwares still have CHDK bugs. -- -- Other settings in the camera that you should try to manipulate to reduce the time between taking pictures: -- CHDK menu -- Extra Photo overrides -- Disable overrides : Off -- Do not override shutter speed ( I allow the camera to determine exposure time, but feel free to experiment) -- ND filter state: Out (removes ND filter to allow more light to fall on the sensor ) -- Override subj. dist. value: 65535. (good to keep it there) -- Do not save RAW images, they take longer -- -- Camera menu -- Use P mode, certainly not automatic -- If you can hardset the focus, do this towards infinity -- Play around with aperture. Smaller apertures are better for more sharpness, but not every camera allows you to. -- (Some cameras have really bad behaviour on larger apertures that allow more light through, especially at edges). -- Disable IS (plane vibrations mess up its function and increases the chance of blur) -- Take Large images with Fine resolution. -- Turn "Review" mode off. -- Consider hard-setting ISO, but consider local weather. If set too high, shutter time goes up, which causes blur. -- Blur can then also occur in areas where there is little light reflection from the earth. -- -- How to use the script: -- Load this on the card under "CHDK/SCRIPTS" -- Enter the CHDK menu through your "ALT" button -- Under scripts, select the script and specify "Autostart: on" -- -- As the camera starts up, this also loads. with the shutter button pressed, you can interrupt the script -- Then press the "ALT" button to disable the scripting actuator. -- Press the shutter button to extend the lens -- Press "ALT" again to bring up the scripting actuator. -- Press the shutter button to reinitiate the script. -- If you have a IXUS 230HS like me, the focus can't be set automatically. Point the camera at a distant object while the script -- is starting. It should say "Focused", after which it's ready for use. -- -- Example paparazzi airframe configuration: -- -- <section name="DIGITAL_CAMERA" prefix="DC_"> -- <define name="AUTOSHOOT_QUARTERSEC_PERIOD" value="8" unit="quarter_second"/> -- <define name="AUTOSHOOT_METER_GRID" value="60" unit="meter"/> -- <define name="SHUTTER_DELAY" value="0" unit="quarter_second"/> -- <define name="POWER_OFF_DELAY" value="3" unit="quarter_second"/> -- </section> -- -- <load name="digital_cam.xml" > -- <define name="DC_SHUTTER_LED" value="4"/> -- <define name="DC_POWER_OFF_LED" value="4"/> -- <define name="DC_RELEASE" value="LED_ON" /> -- <define name="DC_PUSH" value="LED_OFF" /> -- </load> -- print( "PictUAV Started " ) function print_status (frame) local free = get_jpg_count() print("#" .. frame ) end -- switch to autofocus mode, pre-focus, then go to manual focus mode (locking focus there). -- this helps to reduce the delay between the signal and taking the picture. function pre_focus() local focused = false local try = 1 while not focused and try <= 5 do print("Pre-focus attempt " .. try) press("shoot_half") sleep(2000) if get_prop(18) > 0 then print("Focused") focused = true set_aflock(1) end release("shoot_half") sleep(500) try = try + 1 end return focused end -- set aperture/shooting mode to landscape set_prop(6,3) ap = get_prop(6) print ("AF(3=inf,4=MF) "..ap) -- Turn IS off set_prop(145, 3) -- set P mode set_capture_mode(2) sleep(1000) -- Get focusing mode p = get_prop(6) if (p==3) then print "Inf set." else -- on ixus230hs, no explicit MF. -- so set to infinity (3) while (p ~= 3) do press "left" release "left" p = get_prop (6) end print "Focus set to infinity" end -- on ixus230hs set focus doesn't fail, but doesn't do anything. set_focus(100) print "set_focus 100" sleep(2000) f = get_focus -- on ixus230hs set focus doesn't fail, but doesn't do anything. set_focus( 65535 ) print "set_focus 65535" sleep( 2000) g = get_focus if (f==g) then print "set_focus inop" -- if focusing until here didn't work, pre-focus using a different method. pre_focus() else -- set_aflock(1) fails when the camera isn't knowingly focused. print( "Setting aflock 1" ) sleep(1000) set_aflock( 1 ) end -- measuring the pulse on CHDK isn't necessarily that accurate, they can easily vary by 40ms. -- Since I'm using a 100ms wait here, the variance for a shoot is around 140ms. -- If the pulse is 250ms, then I should allow for anything down to 110. -- For Paparazzi, taking a single picture using the button may not work because the timing may be very off -- considering the 4Hz loop (this requires a change in the cam module for paparazzi). print( "PictUAV loop " ) a = -1 repeat a = get_usb_power(0) -- a pulse is detected longer than ~610ms. if (a>61) then print( "shutting down " ) shut_down() sleep(1500) break end -- a pulse longer than ~100ms is detected. if (a>10) then frame = 1 shoot() frame = frame + 1 end sleep(100) until ( false ) print( "PictUAV ended " )
gpl-2.0
AdamGagorik/darkstar
scripts/zones/Korroloka_Tunnel/npcs/qm2.lua
15
3376
----------------------------------- -- Area: Korroloka Tunnel -- NPC: ??? (qm2) -- Involved In Quest: Ayame and Kaede -- @pos -208 -9 176 173 ----------------------------------- package.loaded["scripts/zones/Korroloka_Tunnel/TextIDs"] = nil; ----------------------------------- require("scripts/globals/settings"); require("scripts/globals/keyitems"); require("scripts/globals/quests"); require("scripts/zones/Korroloka_Tunnel/TextIDs"); ----------------------------------- -- onTrade Action ----------------------------------- function onTrade(player,npc,trade) end; ----------------------------------- -- onTrigger Action ----------------------------------- function onTrigger(player,npc) if (player:getQuestStatus(BASTOK,AYAME_AND_KAEDE) == QUEST_ACCEPTED) then if (player:getVar("AyameAndKaede_Event") == 2 and player:hasKeyItem(STRANGELY_SHAPED_CORAL) == false) then local leechesDespawned = (GetMobAction(17486187) == 0 and GetMobAction(17486188) == 0 and GetMobAction(17486189) == 0); local spawnTime = player:getVar("KorrolokaLeeches_Spawned"); local canSpawn = (leechesDespawned and (os.time() - spawnTime) > 30); local killedLeeches = player:getVar("KorrolokaLeeches"); if (killedLeeches >= 1) then if ((killedLeeches == 3 and (os.time() - player:getVar("KorrolokaLeeches_Timer") < 30)) or (killedLeeches < 3 and leechesDespawned and (os.time() - spawnTime) < 30)) then player:addKeyItem(STRANGELY_SHAPED_CORAL); player:messageSpecial(KEYITEM_OBTAINED,STRANGELY_SHAPED_CORAL); player:setVar("KorrolokaLeeches",0); player:setVar("KorrolokaLeeches_Spawned",0); player:setVar("KorrolokaLeeches_Timer",0); elseif (leechesDespawned) then SpawnMob(17486187,168); -- Despawn after 3 minutes (-12 seconds for despawn delay). SpawnMob(17486188,168); SpawnMob(17486189,168); player:setVar("KorrolokaLeeches",0); player:setVar("KorrolokaLeeches_Spawned",os.time()+180); player:messageSpecial(SENSE_OF_BOREBODING); else player:messageSpecial(NOTHING_OUT_OF_ORDINARY); end elseif (canSpawn) then SpawnMob(17486187,168); -- Despawn after 3 minutes (-12 seconds for despawn delay). SpawnMob(17486188,168); SpawnMob(17486189,168); player:setVar("KorrolokaLeeches_Spawned",os.time()+180); player:messageSpecial(SENSE_OF_BOREBODING); else player:messageSpecial(NOTHING_OUT_OF_ORDINARY); end else player:messageSpecial(NOTHING_OUT_OF_ORDINARY); end else player:messageSpecial(NOTHING_OUT_OF_ORDINARY); end end; ----------------------------------- -- onEventUpdate ----------------------------------- function onEventUpdate(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); end; ----------------------------------- -- onEventFinish ----------------------------------- function onEventFinish(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); end;
gpl-3.0
AdamGagorik/darkstar
scripts/zones/Windurst_Waters_[S]/npcs/Emhi_Tchaoryo.lua
13
1076
----------------------------------- -- Area: Windurst Waters (S) -- NPC: Emhi Tchaoryo -- Type: Campaign Ops Overseer -- @zone: 94 -- @pos 10.577 -2.478 32.680 -- -- Auto-Script: Requires Verification (Verified by Brawndo) ----------------------------------- package.loaded["scripts/zones/Windurst_Waters_[S]/TextIDs"] = nil; ----------------------------------- ----------------------------------- -- onTrade Action ----------------------------------- function onTrade(player,npc,trade) end; ----------------------------------- -- onTrigger Action ----------------------------------- function onTrigger(player,npc) player:startEvent(0x0133); end; ----------------------------------- -- onEventUpdate ----------------------------------- function onEventUpdate(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); end; ----------------------------------- -- onEventFinish ----------------------------------- function onEventFinish(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); end;
gpl-3.0
AdamGagorik/darkstar
scripts/zones/Southern_San_dOria/npcs/HomePoint#2.lua
27
1275
----------------------------------- -- Area: Southern San dOria -- NPC: HomePoint#2 -- @pos 45 2 -35 230 ----------------------------------- package.loaded["scripts/zones/Southern_San_dOria/TextIDs"] = nil; require("scripts/globals/settings"); require("scripts/zones/Southern_San_dOria/TextIDs"); require("scripts/globals/homepoint"); ----------------------------------- -- onTrade Action ----------------------------------- function onTrade(player,npc,trade) end; ----------------------------------- -- onTrigger Action ----------------------------------- function onTrigger(player,npc) homepointMenu( player, 0x21fd, 1); end; ----------------------------------- -- onEventUpdate ----------------------------------- function onEventUpdate(player,csid,option) --printf("CSID: %u",csid); --printf("RESULT: %u",option); end; ----------------------------------- -- onEventFinish ----------------------------------- function onEventFinish(player,csid,option) --printf("CSID: %u",csid); --printf("RESULT: %u",option); if (csid == 0x21fd) then if (option == 1) then player:setHomePoint(); player:messageSpecial(HOMEPOINT_SET); else hpTeleport( player, option); end end end;
gpl-3.0
AdamGagorik/darkstar
scripts/zones/Pashhow_Marshlands_[S]/Zone.lua
12
2045
----------------------------------- -- -- Zone: Pashhow_Marshlands_[S] (90) -- ----------------------------------- package.loaded["scripts/zones/Pashhow_Marshlands_[S]/TextIDs"] = nil; ----------------------------------- require("scripts/zones/Pashhow_Marshlands_[S]/TextIDs"); require("scripts/globals/settings"); require("scripts/globals/weather"); require("scripts/globals/status"); ----------------------------------- -- onInitialize ----------------------------------- function onInitialize(zone) end; ----------------------------------- -- onZoneIn ----------------------------------- function onZoneIn(player,prevZone) local cs = -1; if (player:getXPos() == 0 and player:getYPos() == 0 and player:getZPos() == 0) then player:setPos(547.841,23.192,696.323,134); end return cs; end; ----------------------------------- -- onRegionEnter ----------------------------------- function onRegionEnter(player,region) end; ----------------------------------- -- onZoneWeatherChange ----------------------------------- function onZoneWeatherChange(weather) local npc = GetNPCByID(17146623); -- Indescript Markings (BOOTS) if (npc ~= nil) then if (weather == WEATHER_RAIN or weather == WEATHER_THUNDER) then npc:setStatus(STATUS_DISAPPEAR); else npc:setStatus(STATUS_NORMAL); end end npc = GetNPCByID(17146624); -- Indescript Markings (BODY) if (npc ~= nil) then if (weather == WEATHER_RAIN) then npc:setStatus(STATUS_DISAPPEAR); else npc:setStatus(STATUS_NORMAL); end end end; ----------------------------------- -- onEventUpdate ----------------------------------- function onEventUpdate(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); end; ----------------------------------- -- onEventFinish ----------------------------------- function onEventFinish(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); end;
gpl-3.0
AdamGagorik/darkstar
scripts/zones/Windurst_Waters_[S]/npcs/Lutete.lua
13
1125
----------------------------------- -- Area: Windurst Waters (S) -- NPC: Lutete -- Type: Standard NPC -- @zone: 94 -- @pos 169.205 -0.879 -9.107 -- -- Auto-Script: Requires Verification (Verified by Brawndo) ----------------------------------- package.loaded["scripts/zones/Windurst_Waters_[S]/TextIDs"] = nil; ----------------------------------- require("scripts/zones/Windurst_Waters_[S]/TextIDs"); ----------------------------------- -- onTrade Action ----------------------------------- function onTrade(player,npc,trade) end; ----------------------------------- -- onTrigger Action ----------------------------------- function onTrigger(player,npc) player:showText(npc, LUTETE_DIALOG); end; ----------------------------------- -- onEventUpdate ----------------------------------- function onEventUpdate(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); end; ----------------------------------- -- onEventFinish ----------------------------------- function onEventFinish(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); end;
gpl-3.0
AdamGagorik/darkstar
scripts/zones/Tavnazian_Safehold/npcs/Komalata.lua
13
1554
----------------------------------- -- Area: Tavnazian Safehold -- NPC: Komalata -- Standard Merchant NPC ----------------------------------- require("scripts/globals/shop"); package.loaded["scripts/zones/Tavnazian_Safehold/TextIDs"] = nil; require("scripts/zones/Tavnazian_Safehold/TextIDs"); ----------------------------------- -- onTrade Action ----------------------------------- function onTrade(player,npc,trade) end; ----------------------------------- -- onTrigger Action ----------------------------------- function onTrigger(player,npc) player:showText(npc,KOMALATA_SHOP_DIALOG); stock = {0x1118,110, -- Meat Jerky 0x03a8,14, -- Rock Salt 0x0263,36, -- Rye Flour 0x119d,10, -- Distilled Water 0x0271,91, -- Apple Vinegar (COP 4+ only) 0x110c,110, -- Black Bread (COP 4+ only) 0x0262,55, -- San d'Orian Flour (COP 4+ only) 0x1125,29, -- San d'Orian Carrot (COP 4+ only) 0x0275,44, -- Millioncorn (COP 4+ only) 0x05f3,290} -- Apple Mint (COP 4+ only) showShop(player, STATIC, stock); end; ----------------------------------- -- onEventUpdate ----------------------------------- function onEventUpdate(player,csid,option) --printf("CSID: %u",csid); --printf("RESULT: %u",option); end; ----------------------------------- -- onEventFinish ----------------------------------- function onEventFinish(player,csid,option) --printf("CSID: %u",csid); --printf("RESULT: %u",option); end;
gpl-3.0
AdamGagorik/darkstar
scripts/zones/Dynamis-Bastok/Zone.lua
21
2379
----------------------------------- -- -- Zone: Dynamis-Bastok -- ----------------------------------- package.loaded["scripts/zones/Dynamis-Bastok/TextIDs"] = nil; ----------------------------------- require("scripts/globals/status"); require("scripts/zones/Dynamis-Bastok/TextIDs"); ----------------------------------- -- onInitialize ----------------------------------- function onInitialize(zone) end; ----------------------------------- -- onConquestUpdate ----------------------------------- function onConquestUpdate(zone, updatetype) local players = zone:getPlayers(); for name, player in pairs(players) do conquestUpdate(zone, player, updatetype, CONQUEST_BASE); end end; ----------------------------------- -- onZoneIn ----------------------------------- function onZoneIn(player,prevZone) local cs = -1; local realDay = os.time(); local dynaWaitxDay = player:getVar("dynaWaitxDay"); if ((dynaWaitxDay + (BETWEEN_2DYNA_WAIT_TIME * 24 * 60 * 60)) < realDay or player:getVar("DynamisID") == GetServerVariable("[DynaBastok]UniqueID")) then if (player:isBcnmsFull() == 1) then if (player:hasStatusEffect(EFFECT_DYNAMIS, 0) == false) then inst = player:addPlayerToDynamis(1280); if (inst == 1) then player:bcnmEnter(1280); else cs = 0; end else player:bcnmEnter(1280); end else inst = player:bcnmRegister(1280); if (inst == 1) then player:bcnmEnter(1280); else cs = 0; end end else cs = 0; end return cs; end; ----------------------------------- -- onRegionEnter ----------------------------------- function onRegionEnter(player,region) end; ----------------------------------- -- onEventUpdate ----------------------------------- function onEventUpdate(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); end; ----------------------------------- -- onEventFinish ----------------------------------- function onEventFinish(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); if (csid == 0) then player:setPos(112.000,0.994,-72.000,127,0xEA); end end;
gpl-3.0
AdamGagorik/darkstar
scripts/zones/Mhaura/npcs/Rycharde.lua
29
17139
----------------------------------- -- Area: Mhaura -- NPC: Rycharde -- Standard Info NPC -- Starts & Finishes non Repeatable Quest: Rycharde the Chef, -- WAY_OF_THE_COOK, UNENDING_CHASE -- his name is Valgeir (not completed correctly, ferry not implemented) -- the clue (100%) -- the basics (not completed correctly, ferry not implemented) ----------------------------------- package.loaded["scripts/zones/Mhaura/TextIDs"] = nil; ----------------------------------- require("scripts/globals/titles"); require("scripts/globals/quests"); require("scripts/globals/settings"); require("scripts/zones/Mhaura/TextIDs"); -- player:startEvent(0x4a); -- first quest completed ok -- player:startEvent(0x4b); -- nothing to do -- player:startEvent(0x4c); -- second quest start --WAY_OF_THE_COOK -- player:startEvent(0x4e); -- you have x hours left -- player:startEvent(0x4f); -- not yet done -- player:startEvent(0x50); -- second quest completed -- player:startEvent(0x51); -- too late second quest -- player:startEvent(0x52);-- third quest -- player:startEvent(0x53);-- third quest completed -- player:startEvent(0x54);-- third quest said no, ask again -- player:startEvent(0x55);-- third quest comment no hurry -- player:startEvent(0x56);-- forth quest His Name is Valgeir -- player:startEvent(0x57);-- forth quest not done yet -- player:startEvent(0x58);-- forth quest done! -- player:startEvent(0x59);-- nothing to do -- player:startEvent(0x5a);-- fifth quest The Clue -- player:startEvent(0x5b);-- fifth quest The Clue asked again -- player:startEvent(0x5c);-- fifth quest completed -- player:startEvent(0x5d);-- fifth quest not enogh -- player:startEvent(0x5e);-- sixth quest The Basics -- player:startEvent(0x5f);-- sixth quest not done yet -- player:startEvent(0x60);-- sixth quest completed -- player:startEvent(0x61);-- sixth quest completed commentary -- player:startEvent(0x62);-- sixth quest completed commentary 2 ----------------------------------- -- onTrade Action ----------------------------------- function onTrade(player,npc,trade) if (player:getQuestStatus(OTHER_AREAS,RYCHARDE_THE_CHEF)== QUEST_ACCEPTED) then local count = trade:getItemCount(); local DhalmelMeat = trade:hasItemQty(4359,trade:getItemCount()); --4359 - slice_of_dhalmel_meat if (DhalmelMeat == true and count == 2) then player:startEvent(0x4a); -- completed ok elseif (DhalmelMeat == true and count == 1) then player:startEvent(0x49); -- that's not enogh! end elseif (player:getQuestStatus(OTHER_AREAS,WAY_OF_THE_COOK) == QUEST_ACCEPTED) then local count = trade:getItemCount(); local DhalmelMeat = trade:hasItemQty(4359,1); --4359 - slice_of_dhalmel_meat local BeehiveChip = trade:hasItemQty(912,1); --4359 - slice_of_dhalmel_meat if (DhalmelMeat == true and BeehiveChip == true and count == 2) then local Dayspassed=VanadielDayOfTheYear()-player:getVar("QuestRychardeTCDayStarted_var"); local TotalHourLeft=72-(VanadielHour()+Dayspassed*24)+player:getVar("QuestWayotcHourStarted_var"); if (TotalHourLeft>0) then player:startEvent(0x50); -- second quest completed else player:startEvent(0x51); -- too late second quest end end elseif (player:getQuestStatus(OTHER_AREAS,UNENDING_CHASE) == QUEST_ACCEPTED) then local puffball = trade:hasItemQty(4448,1); --4448 - puffball if (puffball == true) then player:startEvent(0x53); -- completed quest 3 UNENDING_CHASE end elseif (player:getQuestStatus(OTHER_AREAS,THE_CLUE) == QUEST_ACCEPTED) then local count = trade:getItemCount(); local DhalmelMeat = trade:hasItemQty(4357,trade:getItemCount()); --4357 - crawler egg if (DhalmelMeat == true and count > 3) then player:startEvent(0x5c); elseif (DhalmelMeat == true) then player:startEvent(0x5d); -- that's not enogh! end elseif (player:getQuestStatus(OTHER_AREAS,THE_BASICS) == QUEST_ACCEPTED) then local BackedPototo = trade:hasItemQty(4436,1); --4436 - baked_popoto if (BackedPototo == true) then player:startEvent(0x60); end end end; ----------------------------------- -- onTrigger Action ----------------------------------- function onTrigger(player,npc) ------------------------------------ QUEST RYCHARDE_THE_CHEF----------------------------------------- if (player:getQuestStatus(OTHER_AREAS,RYCHARDE_THE_CHEF)==QUEST_AVAILABLE) then QuestStatus = player:getVar("QuestRychardetheChef_var"); if (QuestStatus == 2 ) then -- seconnd stage one quest player:startEvent(0x46,4359); -- ask if player would do quest elseif (QuestStatus == 3 ) then player:startEvent(0x47,4359); -- said no, ask again if player would do quest else player:startEvent(0x45); -- talk about something else end elseif (player:getQuestStatus(OTHER_AREAS,RYCHARDE_THE_CHEF)==QUEST_ACCEPTED) then player:startEvent(0x48); -- not done yet huh? --------------------------------------------- quest WAY_OF_THE_COOK elseif (player:getQuestStatus(OTHER_AREAS,WAY_OF_THE_COOK)==QUEST_AVAILABLE and player:getFameLevel(WINDURST)>2) then -- quest WAY_OF_THE_COOK if (player:getVar("QuestRychardeTCCompDay_var")+ 7 < VanadielDayOfTheYear() or player:getVar("QuestRychardeTCCompYear_var") < VanadielYear()) then --8 days or so after the completition of the last quest ... and required fame player:startEvent(0x4c,4359,912);-- second quest WAY_OF_THE_COOK else player:startEvent(0x4b); -- nothing to do end elseif (player:getQuestStatus(OTHER_AREAS,WAY_OF_THE_COOK)==QUEST_ACCEPTED) then Dayspassed=VanadielDayOfTheYear()-player:getVar("QuestRychardeTCDayStarted_var"); TotalHourLeft=72-(VanadielHour()+Dayspassed*24)+player:getVar("QuestWayotcHourStarted_var"); if (TotalHourLeft>0) then player:startEvent(0x4e,TotalHourLeft); -- you have x hours left else player:startEvent(0x4f); -- not yet done end ---------------------------QUEST UNENDING_CHASE-------------------------------------------------- elseif (player:getQuestStatus(OTHER_AREAS,UNENDING_CHASE)==QUEST_AVAILABLE and player:getFameLevel(WINDURST) > 2) then if (player:getVar("QuestWayofTCCompDay_var")+7 < VanadielDayOfTheYear() or player:getVar("QuestWayofTCCompYear_var") < VanadielYear()) then -- days between quest if (player:getVar("QuestUnendingCAskedAlready_var")==2) then player:startEvent(0x54,4448);-- third quest said no, ask again else player:startEvent(0x52,4448);-- third quest UNENDING_CHASE 4448 - puffball end else player:startEvent(0x4b); -- nothing to do end elseif (player:getQuestStatus(OTHER_AREAS,UNENDING_CHASE)==QUEST_ACCEPTED) then player:startEvent(0x55);-- third quest comment no hurry -------------------------QUEST HIS_NAME_IS_VALGEIR-------------------------------------------------- elseif (player:getQuestStatus(OTHER_AREAS,HIS_NAME_IS_VALGEIR)==QUEST_AVAILABLE and player:getFameLevel(WINDURST)>2) then if (player:getVar("QuestUnendingCCompDay_var")+2< VanadielDayOfTheYear() or player:getVar("QuestUnendingCCompYear_var")< VanadielYear()) then player:startEvent(0x56);-- forth quest His Name is Valgeir else player:startEvent(0x4b); -- nothing to do end elseif (player:getQuestStatus(OTHER_AREAS,HIS_NAME_IS_VALGEIR)==QUEST_ACCEPTED) then if (player:hasKeyItem(90)) then player:startEvent(0x57);-- forth quest not done yet else player:startEvent(0x58);-- forth quest done! end ---------------------------QUEST THE CLUE-------------------------------------------------------- elseif (player:getQuestStatus(OTHER_AREAS,THE_CLUE)==QUEST_AVAILABLE and player:getFameLevel(WINDURST)>4) then if (player:getQuestStatus(OTHER_AREAS,EXPERTISE)==QUEST_COMPLETED) then if (player:getVar("QuestExpertiseCompDay_var")+7 < VanadielDayOfTheYear() or player:getVar("QuestExpertiseCompYear_var") < VanadielYear()) then if (player:getVar("QuestTheClueStatus_var")==1) then player:startEvent(0x5b,4357);-- fifth quest The Clue asked again 4357 - crawler_egg else player:startEvent(0x5a,4357);-- fifth quest The Clue 4357 - crawler_egg end; else player:startEvent(0x4b); -- nothing to do end else player:startEvent(0x4b); -- nothing to do end elseif (player:getQuestStatus(OTHER_AREAS,THE_CLUE)==QUEST_ACCEPTED) then player:startEvent(0x55);-- third quest comment no hurry ---------------------------QUEST THE Basics-------------------------------------------------------- elseif (player:getQuestStatus(OTHER_AREAS,THE_BASICS)==QUEST_AVAILABLE and player:getFameLevel(WINDURST) > 4) then if (player:getVar("QuestTheClueCompDay_var")+7 < VanadielDayOfTheYear() or player:getVar("QuestTheClueCompYear_var") < VanadielYear()) then player:startEvent(0x5e);-- sixth quest The Basics else player:startEvent(0x4b); -- nothing to do standar dialog end elseif (player:getQuestStatus(OTHER_AREAS,THE_BASICS)==QUEST_ACCEPTED) then player:startEvent(0x5f);-- sixth quest not done yet else if (player:getVar("QuestTheBasicsComentary_var")==1) then player:startEvent(0x61);-- sixth quest completed commentary else player:startEvent(0x62);-- sixth quest completed commentary 2 end end end; ----------------------------------- -- onEventUpdate ----------------------------------- function onEventUpdate(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); end; ----------------------------------- -- onEventFinish ----------------------------------- function onEventFinish(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); if (csid == 0x46 or csid == 0x47) then --accept quest 1 player:setVar("QuestRychardetheChef_var",3); -- if (option == 71 or option == 72) then --70 = answer no 71 answer yes! player:addQuest(OTHER_AREAS,RYCHARDE_THE_CHEF); end elseif (csid == 0x4a) then -- end quest 1 RYCHARDE_THE_CHEF player:tradeComplete(); player:addFame(WINDURST,120); player:addTitle(PURVEYOR_IN_TRAINING); player:addGil(GIL_RATE*1500); player:messageSpecial(GIL_OBTAINED,GIL_RATE*1500); player:setVar("QuestRychardetheChef_var",0); player:setVar("QuestRychardeTCCompDay_var",VanadielDayOfTheYear()); player:setVar("QuestRychardeTCCompYear_var",VanadielYear()); player:completeQuest(OTHER_AREAS,RYCHARDE_THE_CHEF); elseif (csid == 0x4c) then -- accept quest 2 if (option == 74 ) then -- answer yes! player:setVar("QuestWayotcHourStarted_var",VanadielHour()); player:setVar("QuestRychardeTCDayStarted_var",VanadielDayOfTheYear()); player:addQuest(OTHER_AREAS,WAY_OF_THE_COOK); end elseif (csid == 0x50) then --end quest 2 WAY_OF_THE_COOK player:tradeComplete(); player:addFame(WINDURST,120); player:addTitle(ONESTAR_PURVEYOR); player:addGil(GIL_RATE*1500); player:messageSpecial(GIL_OBTAINED,GIL_RATE*1500); player:setVar("QuestWayotcHourStarted_var",0); player:setVar("QuestRychardeTCDayStarted_var",0); player:setVar("QuestRychardeTCCompDay_var",0); player:setVar("QuestRychardeTCCompYear_var",0); player:setVar("QuestWayofTCCompDay_var",VanadielDayOfTheYear()); -- completition day of WAY_OF_THE_COOK player:setVar("QuestWayofTCCompYear_var",VanadielYear()); player:completeQuest(OTHER_AREAS,WAY_OF_THE_COOK); elseif (csid == 0x51) then --end quest 2 WAY_OF_THE_COOK player:tradeComplete(); player:addFame(WINDURST,120); player:addTitle(PURVEYOR_IN_TRAINING); player:addGil(GIL_RATE*1000); player:messageSpecial(GIL_OBTAINED,GIL_RATE*1000); player:setVar("QuestWayotcHourStarted_var",0); player:setVar("QuestRychardeTCDayStarted_var",0); player:setVar("QuestRychardeTCCompDay_var",0); player:setVar("QuestRychardeTCCompYear_var",0); player:setVar("QuestWayofTCCompDay_var",VanadielDayOfTheYear()); -- completition day of WAY_OF_THE_COOK player:setVar("QuestWayofTCCompYear_var",VanadielYear()); player:completeQuest(OTHER_AREAS,WAY_OF_THE_COOK); elseif (csid == 0x52) then -- accept quest 3 UNENDING_CHASE player:setVar("QuestUnendingCAskedAlready_var",2); if (option == 77 ) then -- answer yes! player:addQuest(OTHER_AREAS,UNENDING_CHASE); end elseif (csid == 0x54) then -- accept quest 3 UNENDING_CHASE if (option == 78 ) then -- answer yes! player:addQuest(OTHER_AREAS,UNENDING_CHASE); end elseif (csid == 0x53) then -- end quest 3 UNENDING_CHASE player:tradeComplete(); player:addFame(WINDURST,120); player:addTitle(TWOSTAR_PURVEYOR); player:addGil(GIL_RATE*2100); player:messageSpecial(GIL_OBTAINED,GIL_RATE*2100); player:setVar("QuestUnendingCAskedAlready_var",0); player:setVar("QuestWayofTCCompDay_var",0); -- completition day of WAY_OF_THE_COOK delete variable player:setVar("QuestWayofTCCompYear_var",0); player:setVar("QuestUnendingCCompDay_var",VanadielDayOfTheYear()); -- completition day of unending chase player:setVar("QuestUnendingCCompYear_var",VanadielYear()); player:completeQuest(OTHER_AREAS,UNENDING_CHASE); elseif (csid == 0x56) then -- accept quest 4 HIS_NAME_IS_VALGEIR if (option == 80 ) then -- answer yes! player:addKeyItem(ARAGONEU_PIZZA); --give pizza to player player:messageSpecial(KEYITEM_OBTAINED,ARAGONEU_PIZZA); player:addQuest(OTHER_AREAS,HIS_NAME_IS_VALGEIR); end elseif (csid == 0x58) then -- end quest 4 his name is Valgeir player:addFame(WINDURST,120); player:addKeyItem(MAP_OF_THE_TORAIMARAI_CANAL); --reward Map of the Toraimarai Canal player:messageSpecial(KEYITEM_OBTAINED,MAP_OF_THE_TORAIMARAI_CANAL); player:setVar("QuestUnendingCCompDay_var",0); -- completition day of unending chase delete player:setVar("QuestUnendingCCompYear_var",0); player:setVar("QuestHNIVCCompDay_var",VanadielDayOfTheYear()); -- completition day of unending chase player:setVar("QuestHNIVCCompYear_var",VanadielYear()); player:completeQuest(OTHER_AREAS,HIS_NAME_IS_VALGEIR); elseif (csid == 0x5a or csid == 0x5b) then --accept quest the clue player:setVar("QuestTheClueStatus_var",1); if (option == 83 ) then player:addQuest(OTHER_AREAS,THE_CLUE); end elseif (csid == 0x5c) then -- end quest THE CLUE player:tradeComplete(); player:addFame(WINDURST,120); player:addTitle(FOURSTAR_PURVEYOR); player:addGil(GIL_RATE*3000); player:messageSpecial(GIL_OBTAINED,GIL_RATE*3000); player:setVar("QuestTheClueStatus_var",0); player:setVar("QuestExpertiseCompDay_var",0); -- completition day of expertice quest player:setVar("QuestExpertiseCompYear_var",0); player:setVar("QuestTheClueCompDay_var",VanadielDayOfTheYear()); -- completition day of THE CLUE player:setVar("QuestTheClueCompYear_var",VanadielYear()); player:completeQuest(OTHER_AREAS,THE_CLUE); elseif (csid == 0x5e) then --accept quest the basics if (option == 85 ) then --TODO pay for ferry player:addKeyItem(MHAURAN_COUSCOUS); --MHAURAN_COUSCOUS = 92; player:messageSpecial(KEYITEM_OBTAINED,MHAURAN_COUSCOUS); player:addQuest(OTHER_AREAS,THE_BASICS); end elseif (csid == 0x60) then -- end quest the basics player:tradeComplete(); player:addFame(WINDURST,120); player:addTitle(FIVESTAR_PURVEYOR); if (player:getFreeSlotsCount() <= 1) then player:messageSpecial(ITEM_CANNOT_BE_OBTAINED,133); else player:addItem(133); player.messageSpecial(ITEM_OBTAINED,133); player:setVar("QuestTheClueCompDay_var",0); -- completition day of THE CLUE player:setVar("QuestTheClueCompYear_var",0); player:setVar("QuestTheBasicsComentary_var",1); player:completeQuest(OTHER_AREAS,THE_BASICS); end elseif (csid == 0x61) then --end commentary quest the basics player:setVar("QuestTheBasicsComentary_var",0); end end;
gpl-3.0
AdamGagorik/darkstar
scripts/zones/Port_Bastok/npcs/Steel_Bones.lua
13
1673
----------------------------------- -- Area: Port Bastok -- NPC: Steel Bones -- Standard Info NPC -- Involved in Quest: Guest of Hauteur ----------------------------------- package.loaded["scripts/zones/Port_Bastok/TextIDs"] = nil; ----------------------------------- require("scripts/globals/status"); require("scripts/globals/keyitems"); require("scripts/globals/quests"); require("scripts/zones/Port_Bastok/TextIDs"); ----------------------------------- -- onTrade Action ----------------------------------- function onTrade(player,npc,trade) end; ----------------------------------- -- onTrigger Action ----------------------------------- function onTrigger(player,npc) GuestofHauteur = player:getQuestStatus(BASTOK,GUEST_OF_HAUTEUR); itemEquipped = player:getEquipID(SLOT_MAIN); if (GuestofHauteur == QUEST_ACCEPTED and player:getVar("GuestofHauteur_Event") ~= 1 and (itemEquipped == 17045 or itemEquipped == 17426)) then -- Maul / Replica Maul player:startEvent(0x39); else player:startEvent(0x01d); end end; ----------------------------------- -- onEventUpdate ----------------------------------- function onEventUpdate(player,csid,option) --printf("CSID: %u",csid); --printf("RESULT: %u",option); end; ----------------------------------- -- onEventFinish ----------------------------------- function onEventFinish(player,csid,option) --printf("CSID: %u",csid); --printf("RESULT: %u",option); if (csid == 0x39 and GuestofHauteur == 1) then player:setVar("GuestofHauteur_Event",1) player:addKeyItem(LETTERS_FROM_DOMIEN); player:messageSpecial(KEYITEM_OBTAINED,LETTERS_FROM_DOMIEN); end end;
gpl-3.0
archiloque/nginx_services_logging
example/example.lua
2
1791
#! /usr/bin/env wsapi.cgi local orbit = require("orbit") local cjson = require("cjson") module("example", package.seeall, orbit.new) function log(web) local env_info = {} for k, v in pairs(web.vars) do if type(v) == "string" then env_info[k] = v end end print(web.path_info .. " " .. web.method .. " " .. cjson.encode(web.input) .. " " .. cjson.encode(env_info)) end function json_get_ok_1(web) log(web) web:content_type('application/json') return cjson.encode({ code = 1 }) end function json_post_ok(web) log(web) web:content_type('application/json') return cjson.encode({ code = 1 }) end function json_put_ok(web) log(web) web:content_type('application/json') return cjson.encode({ code = 1 }) end function json_get_ko(web) log(web) web:status("500") web:content_type('application/json') return cjson.encode({ code = 1 }) end function json_post_ko(web) log(web) web:status("500") web:content_type('application/json') return cjson.encode({ code = 1 }) end function json_put_ko(web) log(web) web:status("500") web:content_type('application/json') return cjson.encode({ code = 1 }) end function post_ok(web) log(web) web:content_type('text/plain') return "Hello" end -- Builds the application's dispatch table, you can -- pass multiple patterns, and any captures get passed to -- the controller example:dispatch_get(json_get_ok_1, "/json/ok/1") example:dispatch_post(json_post_ok, "/json/ok") example:dispatch_put(json_put_ok, "/json/ok") example:dispatch_get(json_get_ko, "/json/ko") example:dispatch_post(json_post_ko, "/json/ko") example:dispatch_put(json_put_ko, "/json/ko") example:dispatch_post(post_ok, "/post/ok") return _M
mit
D-m-L/evonara
modules/libs/stateswitcher.lua
1
1182
--[[ State switcher class: stateswitcher.lua Author: Daniel Duris, (CC-BY) 2014 dusoft[at]staznosti.sk http://www.ambience.sk License: CC-BY 4.0 This work is licensed under the Creative Commons Attribution 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/ or send a letter to Creative Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA. ]]-- passvar={} state={} function state.switch(state) passvar={} local matches={} for match in string.gmatch(state,"[^;]+") do matches[#matches+1]=match end state=matches[1] matches[1]=nil if (matches[2]~=nil) then for i,match in pairs(matches) do passvar[#passvar+1]=match end end -- remove info from metatable about state loaded to allow for new require of the state package.loaded[state]=false require(state) end --function state.switch(_state, …) -- passvar = {…} -- state = _state -- -- remove info from metatable about state loaded to allow for new require of the state -- package.loaded[state]=false -- require(state) --end function state.clear() passvar=nil end return state
mit
flybird119/Atlas
lib/admin.lua
28
9387
--[[ $%BEGINLICENSE%$ Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA $%ENDLICENSE%$ --]] function set_error(errmsg) proxy.response = { type = proxy.MYSQLD_PACKET_ERR, errmsg = errmsg or "error" } end function read_query(packet) if packet:byte() ~= proxy.COM_QUERY then set_error("[admin] we only handle text-based queries (COM_QUERY)") return proxy.PROXY_SEND_RESULT end local query = packet:sub(2) local rows = { } local fields = { } if string.find(query:lower(), "^select%s+*%s+from%s+backends$") then fields = { { name = "backend_ndx", type = proxy.MYSQL_TYPE_LONG }, { name = "address", type = proxy.MYSQL_TYPE_STRING }, { name = "state", type = proxy.MYSQL_TYPE_STRING }, { name = "type", type = proxy.MYSQL_TYPE_STRING }, } for i = 1, #proxy.global.backends do local states = { "unknown", "up", "down", "offline" } local types = { "unknown", "rw", "ro" } local b = proxy.global.backends[i] rows[#rows + 1] = { i, b.dst.name, -- configured backend address states[b.state + 1], -- the C-id is pushed down starting at 0 types[b.type + 1], -- the C-id is pushed down starting at 0 } end elseif string.find(query:lower(), "^set%s+%a+%s+%d+$") then local state,id = string.match(query:lower(), "^set%s+(%a+)%s+(%d+)$") if proxy.global.backends[id] == nil then set_error("backend id is not exsit") return proxy.PROXY_SEND_RESULT end if state == "offline" then proxy.global.backends[id].state = 3 elseif state == "online" then proxy.global.backends[id].state = 0 else set_error("invalid operation") return proxy.PROXY_SEND_RESULT end fields = { { name = "backend_ndx", type = proxy.MYSQL_TYPE_LONG }, { name = "address", type = proxy.MYSQL_TYPE_STRING }, { name = "state", type = proxy.MYSQL_TYPE_STRING }, { name = "type", type = proxy.MYSQL_TYPE_STRING }, } local states = { "unknown", "up", "down", "offline" } local types = { "unknown", "rw", "ro" } local b = proxy.global.backends[id] rows[#rows + 1] = { id, b.dst.name, -- configured backend address states[b.state + 1], -- the C-id is pushed down starting at 0 types[b.type + 1], -- the C-id is pushed down starting at 0 } elseif string.find(query:lower(), "^add%s+master%s+%d%d?%d?%.%d%d?%d?%.%d%d?%d?%.%d%d?%d?:%d%d?%d?%d?%d?$") then local newserver = string.match(query:lower(), "^add%s+master%s+(.+)$") proxy.global.backends.addmaster = newserver if proxy.global.config.rwsplit then proxy.global.config.rwsplit.max_weight = -1 end fields = { { name = "status", type = proxy.MYSQL_TYPE_STRING }, } elseif string.find(query:lower(), "^add%s+slave%s+%d%d?%d?%.%d%d?%d?%.%d%d?%d?%.%d%d?%d?:%d%d?%d?%d?%d?$") then local newserver = string.match(query:lower(), "^add%s+slave%s+(.+)$") proxy.global.backends.addslave = newserver if proxy.global.config.rwsplit then proxy.global.config.rwsplit.max_weight = -1 end fields = { { name = "status", type = proxy.MYSQL_TYPE_STRING }, } elseif string.find(query:lower(), "^remove%s+backend%s+%d+$") then local newserver = tonumber(string.match(query:lower(), "^remove%s+backend%s+(%d+)$")) if newserver <= 0 or newserver > #proxy.global.backends then set_error("invalid backend_id") return proxy.PROXY_SEND_RESULT else proxy.global.backends.removebackend = newserver - 1 if proxy.global.config.rwsplit then proxy.global.config.rwsplit.max_weight = -1 end fields = { { name = "status", type = proxy.MYSQL_TYPE_STRING }, } end elseif string.find(query:lower(), "^select%s+*%s+from%s+clients$") then fields = { { name = "client", type = proxy.MYSQL_TYPE_STRING }, } for i = 1, #proxy.global.clients do rows[#rows + 1] = { proxy.global.clients[i] } end elseif string.find(query:lower(), "^add%s+client%s+(.+)$") then local client = string.match(query:lower(), "^add%s+client%s+(.+)$") if proxy.global.clients(client) == 1 then set_error("this client is exist") return proxy.PROXY_SEND_RESULT end proxy.global.backends.addclient = client fields = { { name = "status", type = proxy.MYSQL_TYPE_STRING }, } elseif string.find(query:lower(), "^remove%s+client%s+(.+)$") then local client = string.match(query:lower(), "^remove%s+client%s+(.+)$") if proxy.global.clients(client) == 0 then set_error("this client is NOT exist") return proxy.PROXY_SEND_RESULT end proxy.global.backends.removeclient = client fields = { { name = "status", type = proxy.MYSQL_TYPE_STRING }, } elseif string.find(query:lower(), "^select%s+*%s+from%s+pwds$") then fields = { { name = "username", type = proxy.MYSQL_TYPE_STRING }, { name = "password", type = proxy.MYSQL_TYPE_STRING }, } for i = 1, #proxy.global.pwds do local user_pwd = proxy.global.pwds[i] local pos = string.find(user_pwd, ":") rows[#rows + 1] = { string.sub(user_pwd, 1, pos-1), string.sub(user_pwd, pos+1) } end elseif string.find(query, "^[aA][dD][dD]%s+[pP][wW][dD]%s+(.+):(.+)$") then local user, pwd = string.match(query, "^[aA][dD][dD]%s+[pP][wW][dD]%s+(.+):(.+)$") local ret = proxy.global.backends(user, pwd, 1) if ret == 1 then set_error("this user is exist") return proxy.PROXY_SEND_RESULT end if ret == 2 then set_error("failed to encrypt") return proxy.PROXY_SEND_RESULT end fields = { { name = "status", type = proxy.MYSQL_TYPE_STRING }, } elseif string.find(query, "^[aA][dD][dD]%s+[eE][nN][pP][wW][dD]%s+(.+):(.+)$") then local user, pwd = string.match(query, "^[aA][dD][dD]%s+[eE][nN][pP][wW][dD]%s+(.+):(.+)$") local ret = proxy.global.backends(user, pwd, 2) if ret == 1 then set_error("this user is exist") return proxy.PROXY_SEND_RESULT end if ret == 2 then set_error("failed to decrypt") return proxy.PROXY_SEND_RESULT end fields = { { name = "status", type = proxy.MYSQL_TYPE_STRING }, } elseif string.find(query, "^[rR][eE][mM][oO][vV][eE]%s+[pP][wW][dD]%s+(.+)$") then local user = string.match(query, "^[rR][eE][mM][oO][vV][eE]%s+[pP][wW][dD]%s+(.+)$") local ret = proxy.global.backends(user, nil, 3) if ret == 1 then set_error("this user is NOT exist") return proxy.PROXY_SEND_RESULT end fields = { { name = "status", type = proxy.MYSQL_TYPE_STRING }, } elseif string.find(query:lower(), "^save%s+config+$") then proxy.global.backends.saveconfig = 0 fields = { { name = "status", type = proxy.MYSQL_TYPE_STRING }, } elseif string.find(query:lower(), "^select%s+version+$") then fields = { { name = "version", type = proxy.MYSQL_TYPE_STRING }, } rows[#rows + 1] = { "2.2.2" } elseif string.find(query:lower(), "^select%s+*%s+from%s+help$") then fields = { { name = "command", type = proxy.MYSQL_TYPE_STRING }, { name = "description", type = proxy.MYSQL_TYPE_STRING }, } rows[#rows + 1] = { "SELECT * FROM help", "shows this help" } rows[#rows + 1] = { "SELECT * FROM backends", "lists the backends and their state" } rows[#rows + 1] = { "SET OFFLINE $backend_id", "offline backend server, $backend_id is backend_ndx's id" } rows[#rows + 1] = { "SET ONLINE $backend_id", "online backend server, ..." } rows[#rows + 1] = { "ADD MASTER $backend", "example: \"add master 127.0.0.1:3306\", ..." } rows[#rows + 1] = { "ADD SLAVE $backend", "example: \"add slave 127.0.0.1:3306\", ..." } rows[#rows + 1] = { "REMOVE BACKEND $backend_id", "example: \"remove backend 1\", ..." } rows[#rows + 1] = { "SELECT * FROM clients", "lists the clients" } rows[#rows + 1] = { "ADD CLIENT $client", "example: \"add client 192.168.1.2\", ..." } rows[#rows + 1] = { "REMOVE CLIENT $client", "example: \"remove client 192.168.1.2\", ..." } rows[#rows + 1] = { "SELECT * FROM pwds", "lists the pwds" } rows[#rows + 1] = { "ADD PWD $pwd", "example: \"add pwd user:raw_password\", ..." } rows[#rows + 1] = { "ADD ENPWD $pwd", "example: \"add enpwd user:encrypted_password\", ..." } rows[#rows + 1] = { "REMOVE PWD $pwd", "example: \"remove pwd user\", ..." } rows[#rows + 1] = { "SAVE CONFIG", "save the backends to config file" } rows[#rows + 1] = { "SELECT VERSION", "display the version of Atlas" } else set_error("use 'SELECT * FROM help' to see the supported commands") return proxy.PROXY_SEND_RESULT end proxy.response = { type = proxy.MYSQLD_PACKET_OK, resultset = { fields = fields, rows = rows } } return proxy.PROXY_SEND_RESULT end
gpl-2.0
AdamGagorik/darkstar
scripts/zones/Wajaom_Woodlands/npcs/leypoint.lua
13
2584
----------------------------------- -- Area: Wajaom Woodlands -- NPC: Leypoint -- Teleport point, Quest -- NAVIGATING THE UNFRIENDLY SEAS RELATED -- -- @pos -200.027 -8.500 80.058 51 ----------------------------------- require("scripts/zones/Wajaom_Woodlands/TextIDs"); require("scripts/globals/settings"); require("scripts/globals/quests"); ----------------------------------- -- onTrade Action ----------------------------------- function onTrade(player,npc,trade) if (player:getQuestStatus(AHT_URHGAN,OLDUUM) == QUEST_COMPLETED and player:hasItem(15769) == false) then if (trade:hasItemQty(2217,1) and trade:getItemCount() == 1) then -- Trade Lightning Band player:tradeComplete(); -- Trade Complete player:addItem(15769); -- Receive Olduum Ring player:messageSpecial(ITEM_OBTAINED,15769); -- Message for Receiving Ring end end if (player:getQuestStatus(AHT_URHGAN,NAVIGATING_THE_UNFRIENDLY_SEAS) == QUEST_ACCEPTED and player:getVar("NavigatingtheUnfriendlySeas") == 2) then if (trade:hasItemQty(2341,1) and trade:getItemCount() == 1) then -- Trade Hydrogauge player:messageSpecial(PLACE_HYDROGAUGE,2341); -- You set the <item> in the trench. player:tradeComplete(); --Trade Complete player:setVar("NavigatingtheUnfriendlySeas",3) player:setVar("Leypoint_waitJTime",getMidnight()); -- Time Set for 1 day real life time. printf("Midnight: %u",getMidnight()); printf("Os: %u",os.time()); end end end; ----------------------------------- -- onTrigger Action ----------------------------------- function onTrigger(player,npc) if (player:getQuestStatus(AHT_URHGAN,NAVIGATING_THE_UNFRIENDLY_SEAS) == QUEST_ACCEPTED and player:getVar("NavigatingtheUnfriendlySeas") == 3) then if (player:getVar("Leypoint_waitJTime") <= os.time()) then player:startEvent(0x01FC); player:setVar("NavigatingtheUnfriendlySeas",4); -- play cs for having waited enough time else player:messageSpecial(ENIGMATIC_LIGHT,2341); -- play cs for not waiting long enough end end end; ----------------------------------- -- onEventUpdate ----------------------------------- function onEventUpdate(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); end; ----------------------------------- -- onEventFinish ----------------------------------- function onEventFinish(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); end;
gpl-3.0
AdamGagorik/darkstar
scripts/zones/AlTaieu/npcs/_0x2.lua
15
1939
----------------------------------- -- Area: Al'Taieu -- NPC: Rubious Crystal (West Tower) -- @pos -683.709 -6.250 -222.142 33 ----------------------------------- package.loaded["scripts/zones/AlTaieu/TextIDs"] = nil; ----------------------------------- require("scripts/zones/AlTaieu/TextIDs"); require("scripts/zones/AlTaieu/mobIDs"); require("scripts/globals/missions"); ----------------------------------- -- onTrade Action ----------------------------------- function onTrade(player,npc,trade) end; ----------------------------------- -- onTrigger Action ----------------------------------- function onTrigger(player,npc) if (player:getCurrentMission(COP) == GARDEN_OF_ANTIQUITY and player:getVar("PromathiaStatus") == 2 and player:getVar("[SEA][AlTieu]WestTower") == 0 and player:getVar("[SEA][AlTieu]WestTowerCS") == 0) then player:messageSpecial(OMINOUS_SHADOW); SpawnMob(WestTowerAern,180):updateClaim(player); SpawnMob(WestTowerAern+1,180):updateClaim(player); SpawnMob(WestTowerAern+2,180):updateClaim(player); elseif (player:getCurrentMission(COP) == GARDEN_OF_ANTIQUITY and player:getVar("PromathiaStatus") == 2 and player:getVar("[SEA][AlTieu]WestTower") == 1 and player:getVar("[SEA][AlTieu]WestTowerCS") == 0) then player:startEvent(0x00A2); else player:messageSpecial(NOTHING_OF_INTEREST); end end; ----------------------------------- -- onEventUpdate ----------------------------------- function onEventUpdate(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); end; ----------------------------------- -- onEventFinish ----------------------------------- function onEventFinish(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); if (csid == 0x00A2) then player:setVar("[SEA][AlTieu]WestTowerCS", 1); player:setVar("[SEA][AlTieu]WestTower", 0); end end;
gpl-3.0
AdamGagorik/darkstar
scripts/zones/Lower_Jeuno/npcs/Sniggnix.lua
13
2349
----------------------------------- -- Area: Lower Jeuno -- NPC: Sniggnix -- Type: Standard NPC -- @zone: 245 -- @pos -45.832 4.498 -135.029 -- -- Auto-Script: Requires Verification (Verfied by Brawndo) ----------------------------------- package.loaded["scripts/zones/Lower_Jeuno/TextIDs"] = nil; ----------------------------------- require("scripts/globals/keyitems"); ----------------------------------- -- onTrade Action ----------------------------------- function onTrade(player,npc,trade) thickAsThievesGamblingCS = player:getVar("thickAsThievesGamblingCS"); if (trade:hasItemQty(1092,1) and trade:getItemCount() == 1 and thickAsThievesGamblingCS == 7) then -- Trade Regal die rand1 = math.random(1,700); player:startEvent(0x272a,0,1092,rand1); -- complete gambling side quest for as thick as thieves end end; ----------------------------------- -- onTrigger Action ----------------------------------- function onTrigger(player,npc) thickAsThievesGamblingCS = player:getVar("thickAsThievesGamblingCS"); if (thickAsThievesGamblingCS == 1) then rand1 = math.random(1,999); rand2 = math.random(1,999); player:startEvent(0x2728,0,1092,rand1,rand2); elseif (thickAsThievesGamblingCS >= 2 and thickAsThievesGamblingCS <= 6) then player:startEvent(0x2729,0,1092,rand1,rand2); else player:startEvent(0x2727); end end; ----------------------------------- -- onEventUpdate ----------------------------------- function onEventUpdate(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); end; ----------------------------------- -- onEventFinish ----------------------------------- function onEventFinish(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); if (csid == 0x2728 and option == 1) then -- player won first dice game player:setVar("thickAsThievesGamblingCS",2); elseif (csid == 0x272a) then player:tradeComplete(); player:setVar("thickAsThievesGamblingCS",8); player:delKeyItem(SECOND_FORGED_ENVELOPE); player:addKeyItem(SECOND_SIGNED_FORGED_ENVELOPE); player:messageSpecial(KEYITEM_OBTAINED,SECOND_SIGNED_FORGED_ENVELOPE); end end;
gpl-3.0
yaoqi/Atlas
lib/proxy/log.lua
41
2706
module("proxy.log", package.seeall) local config_file = string.format("proxy.conf.config_%s", proxy.global.config.instance) local config = require(config_file) level = { DEBUG = 1, INFO = 2, WARN = 3, ERROR = 4, FATAL = 5, OFF = 6 } local tag = {"DEBUG", "INFO", "WARN", "ERROR", "FATAL"} --ĬÈÏÖµ local log_level = level.OFF local is_rt = false local is_sql = false local f_log = nil local f_sql = nil local last_time function init_log() --´Óconfig.luaÀï¶ÁÈ¡ÈÕÖ¾ÉèÖà for i = 1, 6 do if config.log_level:upper() == tag[i] then log_level = i break end end is_rt = config.real_time is_sql = config.sql_log --´´½¨lua.logºÍsql.logÎļþ if log_level < level.OFF and f_log == nil then local lua_log_file = string.format("%s/lua_%s.log", proxy.global.config.logpath, proxy.global.config.instance) f_log = io.open(lua_log_file, "a+") if f_log == nil then log_level = level.OFF end end if is_sql and f_sql == nil then local sql_log_file = string.format("%s/sql_%s.log", proxy.global.config.logpath, proxy.global.config.instance) f_sql = io.open(sql_log_file, "a+") if f_sql == nil then is_sql = false end end end function write_log(cur_level, ...) if cur_level >= log_level then f_log:write("[", os.date("%b/%d/%Y"), "] [", tag[cur_level], "] ", unpack(arg)) f_log:write("\n") if is_rt then f_log:flush() end end end function write_query(query, client) if is_sql then local pos = string.find(client, ":") client_ip = string.sub(client, 1, pos-1) f_sql:write("\n[", os.date("%b/%d/%Y %X"), "] C:", client_ip, " - ERR - \"", query, "\"") if is_rt then f_sql:flush() end end end function write_sql(inj, client, server) if is_sql then local pos = string.find(client, ":") client_ip = string.sub(client, 1, pos-1) pos = string.find(server, ":") server_ip = string.sub(server, 1, pos-1) f_sql:write("\n[", os.date("%b/%d/%Y %X"), "] C:", client_ip, " S:", server_ip, " ERR - \"", inj.query:sub(2), "\"") if is_rt then f_sql:flush() end end end function write_des(index, inj, client, server) if is_sql then local pos = string.find(client, ":") client_ip = string.sub(client, 1, pos-1) pos = string.find(server, ":") server_ip = string.sub(server, 1, pos-1) local current_time = inj.response_time/1000 if index > 1 then f_sql:write(string.format("\n- C:%s S:%s OK %s \"%s\"", client_ip, server_ip, current_time-last_time, inj.query:sub(2))) last_time = current_time else f_sql:write(string.format("\n[%s] C:%s S:%s OK %s \"%s\"", os.date("%b/%d/%Y %X"), client_ip, server_ip, current_time, inj.query:sub(2))) last_time = current_time end if is_rt then f_sql:flush() end end end
gpl-2.0
AdamGagorik/darkstar
scripts/globals/spells/raptor_mazurka.lua
27
1161
----------------------------------------- -- Spell: Raptor Mazurka -- Gives party members enhanced movement ----------------------------------------- require("scripts/globals/status"); ----------------------------------------- -- OnSpellCast ----------------------------------------- function onMagicCastingCheck(caster,target,spell) return 0; end; function onSpellCast(caster,target,spell) local power = 12; local iBoost = caster:getMod(MOD_MAZURKA_EFFECT) + caster:getMod(MOD_ALL_SONGS_EFFECT); local duration = 120; duration = duration * ((iBoost * 0.1) + (caster:getMod(MOD_SONG_DURATION_BONUS)/100) + 1); if (caster:hasStatusEffect(EFFECT_SOUL_VOICE)) then duration = duration * 2; elseif (caster:hasStatusEffect(EFFECT_MARCATO)) then duration = duration * 1.5; end caster:delStatusEffect(EFFECT_MARCATO); if (caster:hasStatusEffect(EFFECT_TROUBADOUR)) then duration = duration * 2; end if not (target:addBardSong(caster,EFFECT_MAZURKA,power,0,duration,caster:getID(), 0, 1)) then spell:setMsg(75); end return EFFECT_MAZURKA; end;
gpl-3.0
mosy210/PERSION-BOT
plugins/giphy.lua
633
1796
-- Idea by https://github.com/asdofindia/telegram-bot/ -- See http://api.giphy.com/ do local BASE_URL = 'http://api.giphy.com/v1' local API_KEY = 'dc6zaTOxFJmzC' -- public beta key local function get_image(response) local images = json:decode(response).data if #images == 0 then return nil end -- No images local i = math.random(#images) local image = images[i] -- A random one if image.images.downsized then return image.images.downsized.url end if image.images.original then return image.original.url end return nil end local function get_random_top() local url = BASE_URL.."/gifs/trending?api_key="..API_KEY local response, code = http.request(url) if code ~= 200 then return nil end return get_image(response) end local function search(text) text = URL.escape(text) local url = BASE_URL.."/gifs/search?q="..text.."&api_key="..API_KEY local response, code = http.request(url) if code ~= 200 then return nil end return get_image(response) end local function run(msg, matches) local gif_url = nil -- If no search data, a random trending GIF will be sent if matches[1] == "!gif" or matches[1] == "!giphy" then gif_url = get_random_top() else gif_url = search(matches[1]) end if not gif_url then return "Error: GIF not found" end local receiver = get_receiver(msg) print("GIF URL"..gif_url) send_document_from_url(receiver, gif_url) end return { description = "GIFs from telegram with Giphy API", usage = { "!gif (term): Search and sends GIF from Giphy. If no param, sends a trending GIF.", "!giphy (term): Search and sends GIF from Giphy. If no param, sends a trending GIF." }, patterns = { "^!gif$", "^!gif (.*)", "^!giphy (.*)", "^!giphy$" }, run = run } end
gpl-2.0
AdamGagorik/darkstar
scripts/zones/Windurst_Woods/npcs/Roberta.lua
13
2317
----------------------------------- -- Area: Windurst Woods -- NPC: Roberta -- Working 100% -- @zone 241 -- @pos 21 -4 -157 ----------------------------------- require("scripts/globals/settings"); ----------------------------------- -- onTrade Action ----------------------------------- function onTrade(player,npc,trade) end; ----------------------------------- -- onTrigger Action ----------------------------------- function onTrigger(player,npc) local BlueRibbonBlues = player:getQuestStatus(WINDURST,BLUE_RIBBON_BLUES); if (BlueRibbonBlues == QUEST_ACCEPTED) then local blueRibbonProg = player:getVar("BlueRibbonBluesProg"); if (blueRibbonProg >= 2 and player:hasItem(13569)) then player:startEvent(0x017c); elseif (player:hasItem(13569)) then player:startEvent(0x017b); elseif (player:hasItem(13569) == false) then if (blueRibbonProg == 1 or blueRibbonProg == 3) then player:startEvent(0x0179,0,13569); -- replaces ribbon if lost elseif (blueRibbonProg < 1) then player:startEvent(0x0178,0,13569); --gives us ribbon end else player:startEvent(0x1b4); end else player:startEvent(0x1b4); end end; ----------------------------------- -- onEventUpdate ----------------------------------- function onEventUpdate(player,csid,option) --printf("CSID: %u",csid); --printf("RESULT: %u",option); end; ----------------------------------- -- onEventFinish ----------------------------------- function onEventFinish(player,csid,option) --printf("CSID: %u",csid); --printf("RESULT: %u",option); if (csid == 0x0178 and option == 1 or csid == 0x0179 and option == 1) then if (player:getFreeSlotsCount() >= 1) then local blueRibbonProg = player:getVar("BlueRibbonBluesProg"); if (blueRibbonProg < 1) then player:setVar("BlueRibbonBluesProg",1); elseif (blueRibbonProg == 3) then player:setVar("BlueRibbonBluesProg",4); end player:addItem(13569); player:messageSpecial(ITEM_OBTAINED,13569); else player:messageSpecial(ITEM_CANNOT_BE_OBTAINED,13569); end end end;
gpl-3.0
AdamGagorik/darkstar
scripts/zones/Riverne-Site_B01/npcs/_0t1.lua
13
1347
----------------------------------- -- Area: Riverne Site #B01 -- NPC: Unstable Displacement ----------------------------------- package.loaded["scripts/zones/Riverne-Site_B01/TextIDs"] = nil; ----------------------------------- require("scripts/globals/settings"); require("scripts/zones/Riverne-Site_B01/TextIDs"); ----------------------------------- -- onTrade ----------------------------------- function onTrade(player,npc,trade) if (trade:hasItemQty(1691,1) and trade:getItemCount() == 1) then -- Trade Giant Scale player:tradeComplete(); npc:openDoor(RIVERNE_PORTERS); player:messageSpecial(SD_HAS_GROWN); end end; ----------------------------------- -- onTrigger ----------------------------------- function onTrigger(player,npc) if (npc:getAnimation() == 8) then player:startEvent(0x7); else player:messageSpecial(SD_VERY_SMALL); end; return 1; end; ----------------------------------- -- onEventUpdate ----------------------------------- function onEventUpdate(player,csid,option) --printf("CSID: %u",csid); --printf("RESULT: %u",option); end; ----------------------------------- -- onEventFinish ----------------------------------- function onEventFinish(player,csid,option) --printf("CSID: %u",csid); --printf("RESULT: %u",option); end;
gpl-3.0
Czesti/BolScripts-1
KarthusMechanics.lua
1
16746
--[[ _____ _____ __ .__ / \_______ / _ \________/ |_|__| ____ __ __ ____ ____ / \ / \_ __ \ / /_\ \_ __ \ __\ |/ ___\| | \/ \ / _ \ / Y \ | \/ / | \ | \/| | | \ \___| | / | ( <_> ) \____|__ /__| \____|__ /__| |__| |__|\___ >____/|___| /\____/ \/ \/ \/ \/ ]] if myHero.charName ~= "Karthus" then return end local version = 0.3 local AUTOUPDATE = true local SCRIPT_NAME = "KarthusMechanics" local SOURCELIB_URL = "https://raw.github.com/TheRealSource/public/master/common/SourceLib.lua" local SOURCELIB_PATH = LIB_PATH.."SourceLib.lua" if FileExist(SOURCELIB_PATH) then require("SourceLib") else DOWNLOADING_SOURCELIB = true DownloadFile(SOURCELIB_URL, SOURCELIB_PATH, function() print("Required libraries downloaded successfully, please reload") end) end if DOWNLOADING_SOURCELIB then print("Downloading required libraries, please wait...") return end if AUTOUPDATE then SourceUpdater(SCRIPT_NAME, version, "raw.github.com", "/gmlyra/BolScripts/master/"..SCRIPT_NAME..".lua", SCRIPT_PATH .. GetCurrentEnv().FILE_NAME, "/gmlyra/BolScripts/VersionFiles/master/"..SCRIPT_NAME..".version"):CheckUpdate() end local RequireI = Require("SourceLib") RequireI:Add("vPrediction", "https://raw.github.com/Hellsing/BoL/master/common/VPrediction.lua") RequireI:Add("SOW", "https://raw.github.com/Hellsing/BoL/master/common/SOW.lua") --RequireI:Add("mrLib", "https://raw.githubusercontent.com/gmlyra/BolScripts/master/common/mrLib.lua") RequireI:Check() if RequireI.downloadNeeded == true then return end require 'VPrediction' require 'SOW' -- Constants -- local QREADY, WREADY, EREADY, RREADY = false, false, false, false local ignite, igniteReady = nil, nil local ts = nil local VP = nil local eActive = false local qOff, wOff, eOff, rOff = 0,0,0,0 local abilitySequence = {3, 1, 1, 2, 1, 4, 1, 3, 1, 3, 4, 3, 3, 2, 2, 4, 2, 2} local Ranges = { Q = 875, W = 1000, E = 425, R = 900000 , AA = 450} local skills = { skillQ = {spellName = "Lay Waste", range = 975, speed = 2000, delay = .250, width = 200}, skillW = {spellName = "Wall of Pain", range = 1000, speed = 1600, delay = .250, width = 80}, skillE = {spellName = "Defile", range = 425, speed = 1600, delay = .250, width = 425}, skillR = {spellName = "Requiem", range = 900000, speed = 200, delay = .250, width = 400}, } local AnimationCancel = { [1]=function() myHero:MoveTo(mousePos.x,mousePos.z) end, --"Move" [2]=function() SendChat('/l') end, --"Laugh" [3]=function() SendChat('/d') end, --"Dance" [4]=function() SendChat('/t') end, --"Taunt" [5]=function() SendChat('/j') end, --"joke" [6]=function() end, } local QREADY, WREADY, EREADY, RREADY= false, false, false, false local BRKSlot, DFGSlot, HXGSlot, BWCSlot, TMTSlot, RAHSlot, RNDSlot, YGBSlot = nil, nil, nil, nil, nil, nil, nil, nil local BRKREADY, DFGREADY, HXGREADY, BWCREADY, TMTREADY, RAHREADY, RNDREADY, YGBREADY = false, false, false, false, false, false, false, false --[[Auto Attacks]]-- local lastBasicAttack = 0 local swingDelay = 0.25 local swing = false function OnLoad() initComponents() end function initComponents() -- VPrediction Start VP = VPrediction() -- SOW Declare Orbwalker = SOW(VP) -- Target Selector ts = TargetSelector(TARGET_NEAR_MOUSE, 900) Menu = scriptConfig("Karthus Mechanics by Mr Articuno", "KarthusMA") Menu:addSubMenu("["..myHero.charName.." - Orbwalker]", "SOWorb") Orbwalker:LoadToMenu(Menu.SOWorb) Menu:addSubMenu("["..myHero.charName.." - Combo]", "KarthusCombo") Menu.KarthusCombo:addParam("combo", "Combo mode", SCRIPT_PARAM_ONKEYDOWN, false, 32) -- Menu.KarthusCombo:addParam("useF", "Use Flash in Combo ", SCRIPT_PARAM_ONOFF, false) Menu.KarthusCombo:addSubMenu("Q Settings", "qSet") Menu.KarthusCombo.qSet:addParam("useQ", "Use Q in combo", SCRIPT_PARAM_ONOFF, true) Menu.KarthusCombo:addSubMenu("W Settings", "wSet") Menu.KarthusCombo.wSet:addParam("useW", "Use W in combo", SCRIPT_PARAM_ONOFF, true) Menu.KarthusCombo:addSubMenu("E Settings", "eSet") Menu.KarthusCombo.eSet:addParam("useE", "Use E in combo", SCRIPT_PARAM_ONOFF, true) Menu:addSubMenu("["..myHero.charName.." - Harass]", "Harass") Menu.Harass:addParam("harass", "Harass", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("G")) Menu.Harass:addParam("useQ", "Use Q in Harass", SCRIPT_PARAM_ONOFF, true) Menu.Harass:addParam("useW", "Use W in Harass", SCRIPT_PARAM_ONOFF, true) Menu.Harass:addParam("useE", "Use E in Harass", SCRIPT_PARAM_ONOFF, true) Menu:addSubMenu("["..myHero.charName.." - Laneclear]", "Laneclear") Menu.Laneclear:addParam("lclr", "Laneclear Key", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("V")) Menu.Laneclear:addParam("useClearQ", "Use Q in Laneclear", SCRIPT_PARAM_ONOFF, true) Menu.Laneclear:addParam("useClearW", "Use W in Laneclear", SCRIPT_PARAM_ONOFF, true) Menu.Laneclear:addParam("useClearE", "Use E in Laneclear", SCRIPT_PARAM_ONOFF, true) Menu:addSubMenu("["..myHero.charName.." - Jungleclear]", "Jungleclear") Menu.Jungleclear:addParam("jclr", "Jungleclear Key", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("V")) Menu.Jungleclear:addParam("useClearQ", "Use Q in Jungleclear", SCRIPT_PARAM_ONOFF, true) Menu.Jungleclear:addParam("useClearW", "Use W in Jungleclear", SCRIPT_PARAM_ONOFF, true) Menu.Jungleclear:addParam("useClearE", "Use E in Jungleclear", SCRIPT_PARAM_ONOFF, true) Menu:addSubMenu("["..myHero.charName.." - Additionals]", "Ads") Menu.Ads:addSubMenu("Ultimate Settings", "rSet") Menu.Ads.rSet:addParam("useR", "Auto Use Ultimate", SCRIPT_PARAM_ONOFF, true) Menu.Ads.rSet:addParam("nEnemy", "Quantity of Enemies Killable", SCRIPT_PARAM_SLICE, 1, 0, 5, 0) Menu.Ads:addParam("cancel", "Animation Cancel", SCRIPT_PARAM_LIST, 1, { "Move","Laugh","Dance","Taunt","joke","Nothing" }) AddProcessSpellCallback(function(unit, spell) if unit.isMe then if spell.name == 'KarthusDefile' then eActive = not eActive elseif spell.name == 'KarthusDefileSoundDummy2' then eActive = true end lastBasicAttack = os.clock() end end) Menu.Ads:addParam("autoLevel", "Auto-Level Spells", SCRIPT_PARAM_ONOFF, false) Menu.Ads:addSubMenu("Killsteal", "KS") Menu.Ads.KS:addParam("ignite", "Use Ignite", SCRIPT_PARAM_ONOFF, false) Menu.Ads.KS:addParam("igniteRange", "Minimum range to cast Ignite", SCRIPT_PARAM_SLICE, 470, 0, 600, 0) Menu.Ads:addSubMenu("VIP", "VIP") Menu.Ads.VIP:addParam("spellCast", "Spell by Packet", SCRIPT_PARAM_ONOFF, true) Menu.Ads.VIP:addParam("skin", "Use custom skin (Requires Reload)", SCRIPT_PARAM_ONOFF, false) Menu.Ads.VIP:addParam("skin1", "Skin changer", SCRIPT_PARAM_SLICE, 1, 1, 6) Menu:addSubMenu("["..myHero.charName.." - Target Selector]", "targetSelector") Menu.targetSelector:addTS(ts) ts.name = "Focus" Menu:addSubMenu("["..myHero.charName.." - Drawings]", "drawings") local DManager = DrawManager() DManager:CreateCircle(myHero, Ranges.AA, 1, {255, 0, 255, 0}):AddToMenu(Menu.drawings,"AA range", true, true, true) DManager:CreateCircle(myHero, skills.skillQ.range, 1, {255, 0, 255, 0}):AddToMenu(Menu.drawings,"Q range", true, true, true) DManager:CreateCircle(myHero, skills.skillW.range, 1, {255, 0, 255, 0}):AddToMenu(Menu.drawings,"W range", true, true, true) DManager:CreateCircle(myHero, skills.skillE.range, 1, {255, 0, 255, 0}):AddToMenu(Menu.drawings,"E range", true, true, true) enemyMinions = minionManager(MINION_ENEMY, 360, myHero, MINION_SORT_MAXHEALTH_DEC) allyMinions = minionManager(MINION_ALLY, 360, myHero, MINION_SORT_MAXHEALTH_DEC) jungleMinions = minionManager(MINION_JUNGLE, 360, myHero, MINION_SORT_MAXHEALTH_DEC) if Menu.Ads.VIP.skin and VIP_USER then GenModelPacket("Karthus", Menu.Ads.VIP.skin1) end PrintChat("<font color = \"#33CCCC\">Karthus Mechanics by</font> <font color = \"#fff8e7\">Mr Articuno</font>") end function OnTick() ts:update() enemyMinions:update() allyMinions:update() jungleMinions:update() CDHandler() KillSteal() DFGSlot, HXGSlot, BWCSlot, SheenSlot, TrinitySlot, LichBaneSlot, BRKSlot, TMTSlot, RAHSlot, RNDSlot, STDSlot = GetInventorySlotItem(3128), GetInventorySlotItem(3146), GetInventorySlotItem(3144), GetInventorySlotItem(3057), GetInventorySlotItem(3078), GetInventorySlotItem(3100), GetInventorySlotItem(3153), GetInventorySlotItem(3077), GetInventorySlotItem(3074), GetInventorySlotItem(3143), GetInventorySlotItem(3131) QREADY = (myHero:CanUseSpell(_Q) == READY) WREADY = (myHero:CanUseSpell(_W) == READY) EREADY = (myHero:CanUseSpell(_E) == READY) RREADY = (myHero:CanUseSpell(_R) == READY) DFGREADY = (DFGSlot ~= nil and myHero:CanUseSpell(DFGSlot) == READY) HXGREADY = (HXGSlot ~= nil and myHero:CanUseSpell(HXGSlot) == READY) BWCREADY = (BWCSlot ~= nil and myHero:CanUseSpell(BWCSlot) == READY) BRKREADY = (BRKSlot ~= nil and myHero:CanUseSpell(BRKSlot) == READY) TMTREADY = (TMTSlot ~= nil and myHero:CanUseSpell(TMTSlot) == READY) RAHREADY = (RAHSlot ~= nil and myHero:CanUseSpell(RAHSlot) == READY) RNDREADY = (RNDSlot ~= nil and myHero:CanUseSpell(RNDSlot) == READY) STDREADY = (STDSlot ~= nil and myHero:CanUseSpell(STDSlot) == READY) IREADY = (ignite ~= nil and myHero:CanUseSpell(ignite) == READY) if swing and os.clock() > lastBasicAttack + 0.625 then --swing = false end if Menu.Ads.autoLevel then AutoLevel() elseif Menu.KarthusCombo.combo then Combo() elseif Menu.Harass.harass then Harass() elseif Menu.Laneclear.lclr then LaneClear() elseif Menu.Jungleclear.jclr then JungleClear() end end function CDHandler() -- Spells QREADY = (myHero:CanUseSpell(_Q) == READY) WREADY = (myHero:CanUseSpell(_W) == READY) EREADY = (myHero:CanUseSpell(_E) == READY) RREADY = (myHero:CanUseSpell(_R) == READY) -- Items tiamatSlot = GetInventorySlotItem(3077) hydraSlot = GetInventorySlotItem(3074) youmuuSlot = GetInventorySlotItem(3142) bilgeSlot = GetInventorySlotItem(3144) bladeSlot = GetInventorySlotItem(3153) tiamatReady = (tiamatSlot ~= nil and myHero:CanUseSpell(tiamatSlot) == READY) hydraReady = (hydraSlot ~= nil and myHero:CanUseSpell(hydraSlot) == READY) youmuuReady = (youmuuSlot ~= nil and myHero:CanUseSpell(youmuuSlot) == READY) bilgeReady = (bilgeSlot ~= nil and myHero:CanUseSpell(bilgeSlot) == READY) bladeReady = (bladeSlot ~= nil and myHero:CanUseSpell(bladeSlot) == READY) -- Summoners if myHero:GetSpellData(SUMMONER_1).name:find("SummonerDot") then ignite = SUMMONER_1 elseif myHero:GetSpellData(SUMMONER_2).name:find("SummonerDot") then ignite = SUMMONER_2 end igniteReady = (ignite ~= nil and myHero:CanUseSpell(ignite) == READY) end -- Harass -- function Harass() local target = ts.target if target ~= nil and ValidTarget(target) then if Menu.Harass.useE and ValidTarget(target, skills.skillE.range) and EREADY and not eActive then CastSpell(_E) end if WREADY and Menu.Harass.useW and ValidTarget(target, skills.skillW.range) then local wPosition, wChance = VP:GetLineCastPosition(target, skills.skillW.delay, skills.skillW.width, skills.skillW.range, skills.skillW.speed, myHero, false) if wPosition ~= nil and wChance >= 2 then CastSpell(_W, wPosition.x, wPosition.z) end end if QREADY and Menu.Harass.useQ and ValidTarget(target, skills.skillQ.range) then local qPosition, qChance = VP:GetCircularCastPosition(target, skills.skillQ.delay, skills.skillQ.width, skills.skillQ.range, skills.skillQ.speed, myHero, false) if qPosition ~= nil and qChance >= 2 then CastSpell(_Q, qPosition.x, qPosition.z) end end end end -- End Harass -- -- Combo Selector -- function Combo() local typeCombo = 0 if ts.target ~= nil then AllInCombo(ts.target, 0) end end -- Combo Selector -- -- All In Combo -- function AllInCombo(target, typeCombo) if target ~= nil and typeCombo == 0 then KSR() if Menu.KarthusCombo.eSet.useE and ValidTarget(target, skills.skillE.range) and EREADY and not eActive then CastSpell(_E) end if WREADY and Menu.KarthusCombo.wSet.useW and ValidTarget(target, skills.skillW.range) then local wPosition, wChance = VP:GetLineCastPosition(target, skills.skillW.delay, skills.skillW.width, skills.skillW.range, skills.skillW.speed, myHero, false) if wPosition ~= nil and wChance >= 2 then CastSpell(_W, wPosition.x, wPosition.z) end end if QREADY and Menu.KarthusCombo.qSet.useQ and ValidTarget(target, skills.skillQ.range) then local qPosition, qChance = VP:GetCircularCastPosition(target, skills.skillQ.delay, skills.skillQ.width, skills.skillQ.range, skills.skillQ.speed, myHero, false) if qPosition ~= nil and qChance >= 2 then CastSpell(_Q, qPosition.x, qPosition.z) end end end end -- All In Combo -- function LaneClear() for i, enemyMinion in pairs(enemyMinions.objects) do if Menu.Laneclear.useClearE and ValidTarget(enemyMinion, skills.skillE.range) and EREADY and not eActive then CastSpell(_E) end if QREADY and Menu.Laneclear.useClearQ and ValidTarget(enemyMinion, skills.skillQ.range) then local qPosition, qChance = VP:GetCircularCastPosition(enemyMinion, skills.skillQ.delay, skills.skillQ.width, skills.skillQ.range, skills.skillQ.speed, myHero, false) if qPosition ~= nil and qChance >= 2 then CastSpell(_Q, qPosition.x, qPosition.z) end end end end function JungleClear() for i, jungleMinion in pairs(jungleMinions.objects) do if jungleMinion ~= nil then if Menu.JungleClear.useClearE and ValidTarget(jungleMinion, skills.skillE.range) and EREADY and not eActive then CastSpell(_E) end if QREADY and Menu.JungleClear.useClearQ and ValidTarget(jungleMinion, skills.skillQ.range) then local qPosition, qChance = VP:GetCircularCastPosition(jungleMinion, skills.skillQ.delay, skills.skillQ.width, skills.skillQ.range, skills.skillQ.speed, myHero, false) if qPosition ~= nil and qChance >= 2 then CastSpell(_Q, qPosition.x, qPosition.z) end end end end end function AutoLevel() local qL, wL, eL, rL = player:GetSpellData(_Q).level + qOff, player:GetSpellData(_W).level + wOff, player:GetSpellData(_E).level + eOff, player:GetSpellData(_R).level + rOff if qL + wL + eL + rL < player.level then local spellSlot = { SPELL_1, SPELL_2, SPELL_3, SPELL_4, } local level = { 0, 0, 0, 0 } for i = 1, player.level, 1 do level[abilitySequence[i]] = level[abilitySequence[i]] + 1 end for i, v in ipairs({ qL, wL, eL, rL }) do if v < level[i] then LevelSpell(spellSlot[i]) end end end end function KillSteal() if Menu.Ads.rSet.useR then KSR() end if Menu.Ads.KS.ignite then IgniteKS() end end -- Use Ultimate -- function KSR() local numberKillable = 0 for i, enemy in ipairs(GetEnemyHeroes()) do rDmg = getDmg("R", enemy, myHero) if RREADY and enemy ~= nil and enemy.health < rDmg then numberKillable = numberKillable + 1 end end if numberKillable >= Menu.Ads.rSet.nEnemy and Menu.Ads.rSet.useR then CastSpell(_R) end end -- Use Ultimate -- -- Auto Ignite get the maximum range to avoid over kill -- function IgniteKS() if igniteReady then local Enemies = GetEnemyHeroes() for i, val in ipairs(Enemies) do if ValidTarget(val, 600) then if getDmg("IGNITE", val, myHero) > val.health and RReady ~= true and GetDistance(val) >= Menu.Ads.KS.igniteRange then CastSpell(ignite, val) end end end end end -- Auto Ignite -- function HealthCheck(unit, HealthValue) if unit.health > (unit.maxHealth * (HealthValue/100)) then return true else return false end end function animationCancel(unit, spell) if not unit.isMe then return end end function ItemUsage(target) if DFGREADY then CastSpell(DFGSlot, target) end if HXGREADY then CastSpell(HXGSlot, target) end if BWCREADY then CastSpell(BWCSlot, target) end if BRKREADY then CastSpell(BRKSlot, target) end if TMTREADY and GetDistance(target) < 275 then CastSpell(TMTSlot) end if RAHREADY and GetDistance(target) < 275 then CastSpell(RAHSlot) end if RNDREADY and GetDistance(target) < 275 then CastSpell(RNDSlot) end end -- Change skin function, made by Shalzuth function GenModelPacket(champ, skinId) p = CLoLPacket(0x97) p:EncodeF(myHero.networkID) p.pos = 1 t1 = p:Decode1() t2 = p:Decode1() t3 = p:Decode1() t4 = p:Decode1() p:Encode1(t1) p:Encode1(t2) p:Encode1(t3) p:Encode1(bit32.band(t4,0xB)) p:Encode1(1)--hardcode 1 bitfield p:Encode4(skinId) for i = 1, #champ do p:Encode1(string.byte(champ:sub(i,i))) end for i = #champ + 1, 64 do p:Encode1(0) end p:Hide() RecvPacket(p) end function OnDraw() end
gpl-2.0
AdamGagorik/darkstar
scripts/globals/spells/bluemagic/tail_slap.lua
4
1738
----------------------------------------- -- Spell: Tail Slap -- Delivers an area attack. Additional effect: "Stun." Damage varies with TP -- Spell cost: 77 MP -- Monster Type: Beastmen -- Spell Type: Physical (Blunt) -- Blue Magic Points: 4 -- Stat Bonus: MND+2 -- Level: 69 -- Casting Time: 1 seconds -- Recast Time: 28.5 seconds -- Skillchain Element: Water (can open Impaction and Induration; can close Reverberation and Fragmentation) -- Combos: Store TP ----------------------------------------- require("scripts/globals/magic"); require("scripts/globals/status"); require("scripts/globals/bluemagic"); ----------------------------------------- -- OnMagicCastingCheck ----------------------------------------- function onMagicCastingCheck(caster,target,spell) return 0; end; ----------------------------------------- -- OnSpellCast ----------------------------------------- function onSpellCast(caster,target,spell) local params = {}; -- This data should match information on http://wiki.ffxiclopedia.org/wiki/Calculating_Blue_Magic_Damage params.tpmod = TPMOD_ATTACK; params.dmgtype = DMGTYPE_H2H; params.scattr = SC_REVERBERATION; params.numhits = 1; params.multiplier = 1.625; params.tp150 = 1.625; params.tp300 = 1.625; params.azuretp = 1.625; params.duppercap = 75; params.str_wsc = 0.2; params.dex_wsc = 0.0; params.vit_wsc = 0.5; params.agi_wsc = 0.0; params.int_wsc = 0.0; params.mnd_wsc = 0.0; params.chr_wsc = 0.0; damage = BluePhysicalSpell(caster, target, spell, params); damage = BlueFinalAdjustments(caster, target, spell, damage, params); return damage; end;
gpl-3.0
LinuxPhreak/textadept
core/file_io.lua
1
11811
-- Copyright 2007-2008 Mitchell Foral mitchell<att>caladbolg.net. See LICENSE. --- -- Provides file input/output routines for Textadept. -- Opens and saves files and sessions and reads API files. -- -- Events: -- file_opened(filename) -- file_saved_as(filename) module('textadept.io', package.seeall) local events = textadept.events --- -- List of recently opened files. -- @class table -- @name recent_files recent_files = {} --- -- [Local function] Opens a file or goes to its already open buffer. -- @param filename The absolute path to the file to open. local function open_helper(filename) if not filename then return end for index, buffer in ipairs(textadept.buffers) do if filename == buffer.filename then view:goto_buffer(index) return end end local buffer = textadept.new_buffer() local f, err = io.open(filename) if f then buffer:set_text( f:read('*all') ) buffer:empty_undo_buffer() f:close() end buffer.filename = filename buffer:set_save_point() events.handle('file_opened', filename) recent_files[#recent_files + 1] = filename end --- -- Opens a list of files. -- @param filenames A '\n' separated list of filenames to open. If none -- specified, the user is prompted to open files from a dialog. -- @usage textadept.io.open(filename) function open(filenames) filenames = filenames or cocoa_dialog( 'fileselect', { title = 'Open', text = 'Select a file(s) to open', -- in Windows, dialog:get_filenames() is unavailable; only allow single -- selection ['select-multiple'] = not WIN32 or nil, ['with-directory'] = (buffer.filename or ''):match('.+/') } ) for filename in filenames:gmatch('[^\n]+') do open_helper(filename) end end --- -- Reloads the file in a given buffer. -- @param buffer The buffer to reload. This must be the currently focused -- buffer. -- @usage buffer:reload() function reload(buffer) textadept.check_focused_buffer(buffer) if not buffer.filename then return end local f, err = io.open(buffer.filename) if f then local pos = buffer.current_pos buffer:set_text( f:read('*all') ) buffer.current_pos = pos buffer:set_save_point() f:close() end end --- -- Saves the current buffer to a file. -- @param buffer The buffer to save. Its 'filename' property is used as the -- path of the file to save to. This must be the currently focused buffer. -- @usage buffer:save() function save(buffer) textadept.check_focused_buffer(buffer) if not buffer.filename then return save_as(buffer) end prepare = _m.textadept.editing.prepare_for_save if prepare then prepare() end local f, err = io.open(buffer.filename, 'w') if f then local txt, _ = buffer:get_text(buffer.length) f:write(txt) f:close() buffer:set_save_point() else events.error(err) end end --- -- Saves the current buffer to a file different than its filename property. -- @param buffer The buffer to save. This must be the currently focused buffer. -- @filename The new filepath to save the buffer to. -- @usage buffer:save_as(filename) function save_as(buffer, filename) textadept.check_focused_buffer(buffer) if not filename then filename = cocoa_dialog( 'filesave', { title = 'Save', ['with-directory'] = (buffer.filename or ''):match('.+/'), ['with-file'] = (buffer.filename or ''):match('[^/]+$'), ['no-newline'] = true } ) end if #filename > 0 then buffer.filename = filename buffer:save() events.handle('file_saved_as', filename) end end --- -- Saves all dirty buffers to their respective files. -- @usage textadept.io.save_all() function save_all() local current_buffer = buffer local current_index for idx, buffer in ipairs(textadept.buffers) do view:goto_buffer(idx) if buffer == current_buffer then current_index = idx end if buffer.filename and buffer.dirty then buffer:save() end end view:goto_buffer(current_index) end --- -- Closes the current buffer. -- If the buffer is dirty, the user is prompted to continue. The buffer is not -- saved automatically. It must be done manually. -- @param buffer The buffer to close. This must be the currently focused -- buffer. -- @usage buffer:close() function close(buffer) textadept.check_focused_buffer(buffer) if buffer.dirty and cocoa_dialog( 'yesno-msgbox', { title = 'Save?', text = 'Save changes before closing?', ['informative-text'] = 'You will have to save changes manually.', ['no-newline'] = true } ) ~= '2' then return false end buffer:delete() return true end --- -- Closes all open buffers. -- If any buffer is dirty, the user is prompted to continue. No buffers are -- saved automatically. They must be saved manually. -- @usage textadept.io.close_all() function close_all() while #textadept.buffers > 1 do view:goto_buffer(#textadept.buffers) if not buffer:close() then return end end buffer:close() -- the last one end --- -- Loads a Textadept session file. -- Textadept restores split views, opened buffers, cursor information, and -- project manager details. -- @param filename The absolute path to the session file to load. Defaults to -- $HOME/.ta_session if not specified. -- @param only_pm Flag indicating whether or not to load only the Project -- Manager session settings. Defaults to false. -- @return true if the session file was opened and read; false otherwise. -- @usage textadept.io.load_session(filename) function load_session(filename, only_pm) local textadept = textadept local user_dir = os.getenv(not WIN32 and 'HOME' or 'USERPROFILE') if not user_dir then return end local ta_session = user_dir..'/.ta_session' local f = io.open(filename or ta_session) local current_view, splits = 1, { [0] = {} } if f then for line in f:lines() do if not only_pm then if line:match('^buffer:') then local anchor, current_pos, first_visible_line, filename = line:match('^buffer: (%d+) (%d+) (%d+) (.+)$') textadept.io.open(filename or '') -- Restore saved buffer selection and view. local anchor = tonumber(anchor) or 0 local current_pos = tonumber(current_pos) or 0 local first_visible_line = tonumber(first_visible_line) or 0 local buffer = buffer buffer._anchor, buffer._current_pos = anchor, current_pos buffer._first_visible_line = first_visible_line buffer:line_scroll( 0, buffer:visible_from_doc_line(first_visible_line) ) buffer:set_sel(anchor, current_pos) elseif line:match('^%s*split%d:') then local level, num, type, size = line:match('^(%s*)split(%d): (%S+) (%d+)') local view = splits[#level] and splits[#level][ tonumber(num) ] or view splits[#level + 1] = { view:split(type == 'true') } splits[#level + 1][1].size = tonumber(size) -- could be 1 or 2 elseif line:match('^%s*view%d:') then local level, num, buf_idx = line:match('^(%s*)view(%d): (%d+)$') local view = splits[#level][ tonumber(num) ] or view view:goto_buffer( tonumber(buf_idx) ) elseif line:match('^current_view:') then local view_idx, buf_idx = line:match('^current_view: (%d+)') current_view = tonumber(view_idx) or 1 end end if line:match('^size:') then local width, height = line:match('^size: (%d+) (%d+)$') if width and height then textadept.size = { width, height } end elseif line:match('^pm:') then local width, text = line:match('^pm: (%d+) (.+)$') textadept.pm.width = width or 0 textadept.pm.entry_text = text or '' textadept.pm.activate() end end f:close() textadept.views[current_view]:focus() return true end return false end --- -- Saves a Textadept session to a file. -- Saves split views, opened buffers, cursor information, and project manager -- details. -- @param filename The absolute path to the session file to save. Defaults to -- $HOME/.ta_session if not specified. -- @usage textadept.io.save_session(filename) function save_session(filename) local session = '' local buffer_line = "buffer: %d %d %d %s\n" -- anchor, cursor, line, filename local split_line = "%ssplit%d: %s %d\n" -- level, number, type, size local view_line = "%sview%d: %d\n" -- level, number, doc index -- Write out opened buffers. (buffer: filename) local buffer_indices, offset = {}, 0 for idx, buffer in ipairs(textadept.buffers) do if buffer.filename then local current = buffer.doc_pointer == textadept.focused_doc_pointer local anchor = current and 'anchor' or '_anchor' local current_pos = current and 'current_pos' or '_current_pos' local first_visible_line = current and 'first_visible_line' or '_first_visible_line' session = session.. buffer_line:format(buffer[anchor] or 0, buffer[current_pos] or 0, buffer[first_visible_line] or 0, buffer.filename) buffer_indices[buffer.doc_pointer] = idx - offset else offset = offset + 1 -- don't save untitled files in session end end -- Write out split views. local function write_split(split, level, number) local c1, c2 = split[1], split[2] local vertical, size = tostring(split.vertical), split.size local spaces = (' '):rep(level) session = session..split_line:format(spaces, number, vertical, size) spaces = (' '):rep(level + 1) if type(c1) == 'table' then write_split(c1, level + 1, 1) else session = session..view_line:format(spaces, 1, c1) end if type(c2) == 'table' then write_split(c2, level + 1, 2) else session = session..view_line:format(spaces, 2, c2) end end local splits = textadept.get_split_table() if type(splits) == 'table' then write_split(splits, 0, 0) else session = session..view_line:format('', 1, splits) end -- Write out the current focused view. local current_view = view for idx, view in ipairs(textadept.views) do if view == current_view then current_view = idx break end end session = session..("current_view: %d\n"):format(current_view) -- Write out other things. local size = textadept.size session = session..("size: %d %d\n"):format( size[1], size[2] ) local pm = textadept.pm session = session..("pm: %d %s\n"):format(pm.width, pm.entry_text) -- Write the session. local user_dir = os.getenv(not WIN32 and 'HOME' or 'USERPROFILE') if not user_dir then return end local ta_session = user_dir..'/.ta_session' local f = io.open(filename or ta_session, 'w') if f then f:write(session) f:close() end end --- -- Reads an API file. -- Each non-empty line in the API file is structured as follows: -- identifier (parameters) description -- Whitespace is optional, but can used for formatting. In description, '\\n' -- will be interpreted as a newline (\n) character. 'Overloaded' identifiers -- are handled appropriately. -- @param filename The absolute path to the API file to read. -- @param word_chars Characters considered to be word characters for -- determining the identifier to lookup. Its contents should be in Lua -- pattern format suitable for the character class construct. -- @return API table. -- @usage textadept.io.read_api_file(filename, '%w_') function read_api_file(filename, word_chars) local api = {} local f = io.open(filename) if f then for line in f:lines() do local func, params, desc = line:match('(['..word_chars..']+)%s*(%b())(.*)$') if func and params and desc then if not api[func] then api[func] = {} end api[func][ #api[func] + 1 ] = { params, desc } end end f:close() end return api end
mit
AdamGagorik/darkstar
scripts/zones/Port_Jeuno/npcs/Illauvolahaut.lua
13
1611
----------------------------------- -- Area: Port Jeuno -- NPC: Illauvolahaut -- @zone 246 -- @pos -12 8 54 ----------------------------------- package.loaded["scripts/zones/Port_Jeuno/TextIDs"] = nil; ----------------------------------- require("scripts/globals/settings"); require("scripts/globals/keyitems"); require("scripts/zones/Port_Jeuno/TextIDs"); ----------------------------------- -- onTrade Action ----------------------------------- function onTrade(player,npc,trade) end; ----------------------------------- -- onTrigger Action ----------------------------------- function onTrigger(player,npc) KazhPass = player:hasKeyItem(AIRSHIP_PASS_FOR_KAZHAM); Gil = player:getGil(); if (KazhPass == false) then player:startEvent(0x0023); -- without pass elseif (KazhPass == true and Gil < 200) then player:startEvent(0x002d); -- Pass without money elseif (KazhPass == true) then player:startEvent(0x0025); -- Pass with money end end; -- 0x0029 without addons (ZM) ? ----------------------------------- -- onEventUpdate ----------------------------------- function onEventUpdate(player,csid,option) --printf("CSID: %u",csid); --printf("RESULT: %u",option); end; ----------------------------------- -- onEventFinish ----------------------------------- function onEventFinish(player,csid,option) --printf("CSID: %u",csid); --printf("RESULT: %u",option); if (csid == 0x0025) then Z = player:getZPos(); if (Z >= 58 and Z <= 61) then player:delGil(200); end end end;
gpl-3.0
AdamGagorik/darkstar
scripts/zones/Bhaflau_Thickets/npcs/Runic_Portal.lua
25
1774
----------------------------------- -- Area: Bhaflau Thickets -- NPC: Runic Portal -- Mamook Ja Teleporter Back to Aht Urgan Whitegate -- @pos -211 -11 -818 52 ----------------------------------- package.loaded["scripts/zones/Bhaflau_Thickets/TextIDs"] = nil; ----------------------------------- require("scripts/zones/Bhaflau_Thickets/TextIDs"); require("scripts/globals/teleports"); require("scripts/globals/missions"); require("scripts/globals/besieged"); ----------------------------------- -- onTrade Action ----------------------------------- function onTrade(player,npc,trade) end; ----------------------------------- -- onTrigger Action ----------------------------------- function onTrigger(player,npc) if (player:getCurrentMission(TOAU) == IMMORTAL_SENTRIES and player:getVar("AhtUrganStatus") == 1) then player:startEvent(111); elseif (player:getCurrentMission(TOAU) > IMMORTAL_SENTRIES) then if (hasRunicPortal(player,3) == 1) then player:startEvent(109); else player:startEvent(111); end else player:messageSpecial(RESPONSE); end end; ----------------------------------- -- onEventUpdate ----------------------------------- function onEventUpdate(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); end; ----------------------------------- -- onEventFinish ----------------------------------- function onEventFinish(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); if (csid == 111 and option == 1) then player:addNationTeleport(AHTURHGAN,8); toChamberOfPassage(player); elseif (csid == 109 and option == 1) then toChamberOfPassage(player); end end;
gpl-3.0
talldan/lua-reactor
src/reactor/utils/tableUtils.lua
1
1946
local function map(func, collection) local results = {} for index, value in pairs(collection) do local newValue, newIndex = func(value, index) results[newIndex or index] = newValue end return results end local function optionalMap(func, collection) local results = {} for index, value in pairs(collection) do local newValue, newIndex = func(value, index) if newValue then results[newIndex or index] = newValue end end return results end local function reduce(func, accum, collection) for index, value in pairs(collection) do accum = func(value, index, accum) end return accum end local function filter(func, collection) local results = {} for index, value in pairs(collection) do if func(value, index) then results[index] = value end end return results end local function assignOne(targetCollection, sourceCollection) for index, value in pairs(sourceCollection) do targetCollection[index] = value end return targetCollection end local function assign(targetCollection, ...) local sourceCollections = {...} for _, sourceCollection in ipairs(sourceCollections) do targetCollection = assignOne(targetCollection, sourceCollection) end return targetCollection end local function first(collection) return collection[1] end local function last(collection) return collection[#collection] end local function rest(collection) if #collection < 2 then return nil end local results = {} for i = 2, #collection do results[i - 1] = collection[i] end return results end local function concat(...) local result = {} for _, tbl in ipairs{...} do for _, val in pairs(tbl) do result[#result + 1] = val end end return result end return { map = map, optionalMap = optionalMap, reduce = reduce, filter = filter, assign = assign, first = first, last = last, rest = rest, concat = concat }
mit
AdamGagorik/darkstar
scripts/globals/mobskills/Binary_Tap.lua
32
1703
--------------------------------------------------- -- Binary Tap -- Attempts to absorb two buffs from a single target, or otherwise steals HP. -- Type: Magical -- Utsusemi/Blink absorb: Ignores Shadows -- Range: Melee -- Notes: Can be any (positive) buff, including food. Will drain about 100HP if it can't take any buffs --------------------------------------------------- require("scripts/globals/settings"); require("scripts/globals/status"); require("scripts/globals/monstertpmoves"); --------------------------------------------------- function onMobSkillCheck(target,mob,skill) return 0; end; function onMobWeaponSkill(target, mob, skill) -- try to drain buff local effectFirst = target:stealStatusEffect(); local effectSecond = target:stealStatusEffect(); local dmg = 0; if (effectFirst ~= nil) then local count = 1; -- add to myself mob:addStatusEffect(effectFirst:getType(), effectFirst:getPower(), effectFirst:getTickCount(), effectFirst:getDuration()); if (effectSecond ~= nil) then count = count + 1; -- add to myself mob:addStatusEffect(effectSecond:getType(), effectSecond:getPower(), effectSecond:getTickCount(), effectSecond:getDuration()); end -- add buff to myself skill:setMsg(MSG_EFFECT_DRAINED); return count; else -- time to drain HP. 100-200 local power = math.random(0, 101) + 100; dmg = MobFinalAdjustments(power,mob,skill,target,MOBSKILL_MAGICAL,MOBPARAM_DARK,MOBPARAM_IGNORE_SHADOWS); skill:setMsg(MobPhysicalDrainMove(mob, target, skill, MOBDRAIN_HP, dmg)); return dmg; end end;
gpl-3.0
TrurlMcByte/docker-prosody
etc/prosody-modules/mod_muc_ban_ip/mod_muc_ban_ip.lua
32
1765
module:set_global(); local jid_bare = require "util.jid".bare; local st = require "util.stanza"; local xmlns_muc_user = "http://jabber.org/protocol/muc#user"; local ip_bans = module:shared("bans"); local full_sessions = prosody.full_sessions; local function ban_ip(session, from) local ip = session.ip; if not ip then module:log("warn", "Failed to ban IP (IP unknown) for %s", session.full_jid); return; end local banned_from = ip_bans[ip]; if not banned_from then banned_from = {}; ip_bans[ip] = banned_from; end banned_from[from] = true; module:log("debug", "Banned IP address %s from %s", ip, from); end local function check_for_incoming_ban(event) local stanza = event.stanza; local to_session = full_sessions[stanza.attr.to]; if to_session then local directed = to_session.directed; local from = stanza.attr.from; if directed and directed[from] and stanza.attr.type == "unavailable" then -- This is a stanza from somewhere we sent directed presence to (may be a MUC) local x = stanza:get_child("x", xmlns_muc_user); if x then for status in x:childtags("status") do if status.attr.code == '301' then ban_ip(to_session, jid_bare(from)); end end end end end end local function check_for_ban(event) local ip = event.origin.ip; local to = jid_bare(event.stanza.attr.to); if ip_bans[ip] and ip_bans[ip][to] then event.origin.send(st.error_reply(event.stanza, "auth", "forbidden") :tag("x", { xmlns = xmlns_muc_user }) :tag("status", { code = '301' })); return true; end module:log("debug", "Not banned: %s from %s", ip, to) end function module.add_host(module) module:hook("presence/full", check_for_incoming_ban, 100); module:hook("pre-presence/full", check_for_ban, 100); end
mit