repo_name stringlengths 6 78 | path stringlengths 4 206 | copies stringclasses 281 values | size stringlengths 4 7 | content stringlengths 625 1.05M | license stringclasses 15 values |
|---|---|---|---|---|---|
electromatter/cuberite | Server/Plugins/APIDump/Hooks/OnPluginsLoaded.lua | 44 | 2702 | return
{
HOOK_PLUGINS_LOADED =
{
CalledWhen = "All the enabled plugins have been loaded",
DefaultFnName = "OnPluginsLoaded", -- also used as pagename
Desc = [[
This callback gets called when the server finishes loading and initializing plugins. This is the
perfect occasion for a plugin to query other plugins through {{cPluginManager}}:GetPlugin() and
possibly start communicating with them using the {{cPlugin}}:Call() function.
]],
Params = {},
Returns = [[
The return value is ignored, all registered callbacks are called.
]],
CodeExamples =
{
{
Title = "CoreMessaging",
Desc = [[
This example shows how to implement the CoreMessaging functionality - messages to players will be
sent through the Core plugin, formatted by that plugin. As a fallback for when the Core plugin is
not present, the messages are sent directly by this code, unformatted.
]],
Code = [[
-- These are the fallback functions used when the Core is not present:
local function SendMessageFallback(a_Player, a_Message)
a_Player:SendMessage(a_Message);
end
local function SendMessageSuccessFallback(a_Player, a_Message)
a_Player:SendMessage(a_Message);
end
local function SendMessageFailureFallback(a_Player, a_Message)
a_Player:SendMessage(a_Message);
end
-- These three "variables" will hold the actual functions to call.
-- By default they are initialized to the Fallback variants,
-- but will be redirected to Core when all plugins load
SendMessage = SendMessageFallback;
SendMessageSuccess = SendMessageSuccessFallback;
SendMessageFailure = SendMessageFailureFallback;
-- The callback tries to connect to the Core
-- If successful, overwrites the three functions with Core ones
local function OnPluginsLoaded()
local CorePlugin = cPluginManager:Get():GetPlugin("Core");
if (CorePlugin == nil) then
-- The Core is not loaded, keep the Fallback functions
return;
end
-- Overwrite the three functions with Core functionality:
SendMessage = function(a_Player, a_Message)
CorePlugin:Call("SendMessage", a_Player, a_Message);
end
SendMessageSuccess = function(a_Player, a_Message)
CorePlugin:Call("SendMessageSuccess", a_Player, a_Message);
end
SendMessageFailure = function(a_Player, a_Message)
CorePlugin:Call("SendMessageFailure", a_Player, a_Message);
end
end
-- Global scope, register the callback:
cPluginManager.AddHook(cPluginManager.HOOK_PLUGINS_LOADED, CoreMessagingPluginsLoaded);
-- Usage, anywhere else in the plugin:
SendMessageFailure(
a_Player,
"Cannot teleport to player, the destination player " .. PlayerName .. " was not found"
);
]],
},
} , -- CodeExamples
}, -- HOOK_PLUGINS_LOADED
}
| apache-2.0 |
m241dan/darkstar | scripts/zones/Port_Windurst/npcs/Newlyn.lua | 13 | 1049 | -----------------------------------
-- Area: Port Windurst
-- NPC: Newlyn
-- Type: Standard NPC
-- @zone: 240
-- @pos 200.673 -6.601 108.665
--
-- Auto-Script: Requires Verification (Verfied By Brawndo)
-----------------------------------
package.loaded["scripts/zones/Port_Windurst/TextIDs"] = nil;
-----------------------------------
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
player:startEvent(0x00be);
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 |
santssoft/darkstar | scripts/zones/Arrapago_Reef/npcs/_1ie.lua | 12 | 2591 | -----------------------------------
-- Area: Arrapago Reef
-- Door: Iron Gate (Lamian Fang Key)
-- !pos 580 -17 120
-----------------------------------
local ID = require("scripts/zones/Arrapago_Reef/IDs")
require("scripts/globals/npc_util")
require("scripts/globals/status")
-----------------------------------
function onTrade(player,npc,trade)
if npc:getAnimation() == dsp.anim.CLOSE_DOOR then
if npcUtil.tradeHas(trade, 2219) then
npc:openDoor()
player:messageSpecial(ID.text.KEY_BREAKS,2219)
player:confirmTrade()
elseif npcUtil.tradeHas(trade, 1022) and player:getMainJob() == dsp.job.THF then -- thief's tools
if math.random(1,2) == 1 then -- TODO: figure out actual percentage chance to pick locks; 50% for now
player:messageSpecial(ID.text.LOCK_SUCCESS,1022)
npc:openDoor()
else
player:messageSpecial(ID.text.LOCK_FAIL,1022)
end
player:confirmTrade()
elseif npcUtil.tradeHas(trade, 1023) and player:getMainJob() == dsp.job.THF then -- living key
if math.random(1,2) == 1 then -- TODO: figure out actual percentage chance to pick locks; 50% for now
player:messageSpecial(ID.text.LOCK_SUCCESS,1023)
npc:openDoor()
else
player:messageSpecial(ID.text.LOCK_FAIL,1023)
end
player:confirmTrade()
elseif npcUtil.tradeHas(trade, 1115) and player:getMainJob() == dsp.job.THF then -- skeleton key
if math.random(1,2) == 1 then -- TODO: figure out actual percentage chance to pick locks; 50% for now
player:messageSpecial(ID.text.LOCK_SUCCESS,1115)
npc:openDoor()
else
player:messageSpecial(ID.text.LOCK_FAIL,1115)
end
player:confirmTrade()
end
end
end
function onTrigger(player,npc)
if player:getZPos() < 120 and npc:getAnimation() == dsp.anim.CLOSE_DOOR then
if player:getMainJob() == dsp.job.THF then
player:messageSpecial(ID.text.DOOR_IS_LOCKED2, 2219, 1022) -- message only THF's get
else
player:messageSpecial(ID.text.DOOR_IS_LOCKED, 2219)
end
elseif player:getZPos() >= 120 and npc:getAnimation() == dsp.anim.CLOSE_DOOR then
player:messageSpecial(ID.text.YOU_UNLOCK_DOOR) -- message from "inside" of door
npc:openDoor()
end
end
function onEventUpdate(player,csid,option,target)
end
function onEventFinish(player,csid,option,target)
end | gpl-3.0 |
m241dan/darkstar | scripts/zones/Selbina/npcs/Dohdjuma.lua | 1 | 1509 | -----------------------------------
-- Area: Selbina
-- NPC: Dohdjuma
-- Standard Merchant NPC
-----------------------------------
package.loaded["scripts/zones/Selbina/TextIDs"] = nil;
-----------------------------------
require("scripts/zones/Selbina/TextIDs");
require("scripts/globals/shop");
package.loaded["scripts/globals/melfaugments"] = nil;
require("scripts/globals/melfaugments" );
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
onAugmentTrade( player, trade );
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
player:showText(npc,DOHDJUMA_SHOP_DIALOG);
stock = {0x0263,36, --Rye Flour
0x1393,233, --Scroll of Sheepfoe Mambo
0x1036,2335, --Eye Drops
0x1034,284, --Antidote
0x119D,10, --Distilled Water
0x1010,819, --Potion
0x43F3,10, --Lugworm
0x111A,54, --Selbina Milk
0x118A,432, --Pickled Herring
0x11CF,4485, --Herb Quus
0x0b32,9200, --Selbina Waystone
}
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 |
dvr333/Zero-K | scripts/bomberprec.lua | 4 | 11715 | local base = piece 'base'
local fuselage = piece 'fuselage'
local wingl1 = piece 'wingl1'
local wingr1 = piece 'wingr1'
local wingl2 = piece 'wingl2'
local wingr2 = piece 'wingr2'
local engines = piece 'engines'
local fins = piece 'fins'
local rflap = piece 'rflap'
local lflap = piece 'lflap'
local predrop = piece 'predrop'
local drop = piece 'drop'
local thrustl = piece 'thrustl'
local thrustr = piece 'thrustr'
local wingtipl = piece 'wingtipl'
local wingtipr = piece 'wingtipr'
local xp,zp = piece("x","z")
local spGetUnitPosition = Spring.GetUnitPosition
local spGetUnitHeading = Spring.GetUnitHeading
local spGetUnitVelocity = Spring.GetUnitVelocity
local spMoveCtrlGetTag = Spring.MoveCtrl.GetTag
local spGetUnitMoveTypeData = Spring.GetUnitMoveTypeData
local spSetAirMoveTypeData = Spring.MoveCtrl.SetAirMoveTypeData
local spGetGroundHeight = Spring.GetGroundHeight
local min, max = math.min, math.max
local smokePiece = {fuselage, thrustr, thrustl}
local bombs = 1
include "bombers.lua"
include "fakeUpright.lua"
include "constants.lua"
include "fixedwingTakeOff.lua"
local ud = UnitDefs[unitDefID]
local highBehaviour = {
wantedHeight = UnitDefNames["bomberprec"].wantedHeight*1.5,
maxPitch = ud.maxPitch,
maxBank = ud.maxBank,
turnRadius = ud.turnRadius,
maxAileron = ud.maxAileron,
maxElevator = ud.maxElevator,
maxRudder = ud.maxRudder,
}
local lowBehaviour = {
maxPitch = 0.72,
maxBank = 0.5,
turnRadius = 80,
maxAileron = 0.004,
maxElevator = 0.018,
maxRudder = 0.02,
}
local currentBehaviour = {
wantedHeight = highBehaviour.wantedHeight,
maxPitch = highBehaviour.maxPitch,
maxBank = highBehaviour.maxBank,
turnRadius = highBehaviour.turnRadius,
maxAileron = highBehaviour.maxAileron,
maxElevator = highBehaviour.maxElevator,
maxRudder = highBehaviour.maxRudder,
}
local pitchOverride = false
local SIG_TAKEOFF = 1
local SIG_CHANGE_FLY_HEIGHT = 2
local SIG_SPEED_CONTROL = 4
local takeoffHeight = UnitDefNames["bomberprec"].wantedHeight
local fullHeight = UnitDefNames["bomberprec"].wantedHeight/1.5
local minSpeedMult = 0.75
local function SetMoveTypeDataWithOverrides(behaviour)
if behaviour then
currentBehaviour.wantedHeight = behaviour.wantedHeight or currentBehaviour.wantedHeight
currentBehaviour.maxPitch = behaviour.maxPitch or currentBehaviour.maxPitch
currentBehaviour.maxBank = behaviour.maxBank or currentBehaviour.maxBank
currentBehaviour.turnRadius = behaviour.turnRadius or currentBehaviour.turnRadius
currentBehaviour.maxAileron = behaviour.maxAileron or currentBehaviour.maxAileron
currentBehaviour.maxElevator = behaviour.maxElevator or currentBehaviour.maxElevator
currentBehaviour.maxRudder = behaviour.maxRudder or currentBehaviour.maxRudder
end
local origPitch = currentBehaviour.maxPitch
if pitchOverride and (pitchOverride > currentBehaviour.maxPitch) then
currentBehaviour.maxPitch = pitchOverride
end
if not Spring.MoveCtrl.GetTag(unitID) then
spSetAirMoveTypeData(unitID, currentBehaviour)
end
currentBehaviour.maxPitch = origPitch
end
local PREDICT_FRAMES = 10
local function TargetHeightUpdateThread(targetID, behaviour)
-- Inherits signals from BehaviourChangeThread
local flatDiveHeight = behaviour.wantedHeight
while Spring.ValidUnitID(targetID) do
local tx,_,tz = spGetUnitPosition(targetID)
local tHeight = max(Spring.GetGroundHeight(tx, tz), 0)
local ux,_,uz = spGetUnitPosition(unitID)
local vx,vy,vz = spGetUnitVelocity(unitID)
vx, vz = vx*PREDICT_FRAMES, vz*PREDICT_FRAMES
local predictX, predictZ = ux + vx, uz + vz
if math.abs(ux - tx) < vx then
predictX = tx
end
if math.abs(uz - tz) < vz then
predictZ = tz
end
local uHeight = max(spGetGroundHeight(predictX, predictZ), 0)
behaviour.wantedHeight = flatDiveHeight + max((tHeight - uHeight)*0.4, 0)
if not Spring.MoveCtrl.GetTag(unitID) then
SetMoveTypeDataWithOverrides(behaviour)
end
Sleep(200)
end
end
local pitchUpdateReset = false
local function PitchOverrideResetThread()
pitchUpdateReset = 1
while pitchUpdateReset > 0 do
pitchUpdateReset = pitchUpdateReset - 1
Sleep(300)
end
if pitchOverride then
pitchOverride = false
SetMoveTypeDataWithOverrides()
end
pitchUpdateReset = false
end
local function PitchUpdate(targetID, targetHeight)
if not pitchUpdateReset then
StartThread(PitchOverrideResetThread)
end
if targetID and Spring.ValidUnitID(targetID) then
local tx,ty,tz = spGetUnitPosition(targetID)
targetHeight = ty
end
if not targetHeight then
return
end
local ux,uy,uz = spGetUnitPosition(unitID)
if uy < targetHeight then
local newPitch = 0.9
if targetHeight - uy < 100 then
newPitch = 0.5 + 0.4*(targetHeight - uy)/100
end
if pitchOverride ~= newPitch then
pitchOverride = newPitch
SetMoveTypeDataWithOverrides()
end
elseif pitchOverride then
pitchOverride = false
SetMoveTypeDataWithOverrides()
end
pitchUpdateReset = 1
end
local function BehaviourChangeThread(behaviour, targetID)
Signal(SIG_CHANGE_FLY_HEIGHT)
SetSignalMask(SIG_CHANGE_FLY_HEIGHT)
takeoffHeight = behaviour.wantedHeight/1.5
local state = spGetUnitMoveTypeData(unitID).aircraftState
local flying = spMoveCtrlGetTag(unitID) == nil and (state == "flying" or state == "takeoff")
if not flying then
StartThread(GG.TakeOffFuncs.TakeOffThread, takeoffHeight, SIG_TAKEOFF)
end
while not flying do
Sleep(600)
state = spGetUnitMoveTypeData(unitID).aircraftState
flying = spMoveCtrlGetTag(unitID) == nil and (state == "flying" or state == "takeoff")
end
SetMoveTypeDataWithOverrides(behaviour)
if targetID then
TargetHeightUpdateThread(targetID, behaviour)
end
--Spring.SetUnitRulesParam(unitID, "selfMoveSpeedChange", 1)
--GG.UpdateUnitAttributes(unitID)
--GG.UpdateUnitAttributes(unitID)
end
local function SpeedControl()
Signal(SIG_SPEED_CONTROL)
SetSignalMask(SIG_SPEED_CONTROL)
while true do
local x,y,z = spGetUnitPosition(unitID)
local terrain = max(spGetGroundHeight(x,z), 0) -- not amphibious, treat water as ground
local speedMult = minSpeedMult + (1-minSpeedMult)*max(0, min(1, (y - terrain - 50)/(fullHeight - 60)))
Spring.SetUnitRulesParam(unitID, "selfMoveSpeedChange", speedMult)
GG.UpdateUnitAttributes(unitID)
GG.UpdateUnitAttributes(unitID)
Sleep(50 + 2*max(0, y - terrain - 80))
end
end
function BomberDive_HighPitchUpdate(targetID, attackGroundHeight)
PitchUpdate(targetID, attackGroundHeight)
end
function BomberDive_FlyHigh()
StartThread(BehaviourChangeThread, highBehaviour)
end
function BomberDive_FlyLow(height, targetID)
height = math.min(height, highBehaviour.wantedHeight)
StartThread(SpeedControl)
lowBehaviour.wantedHeight = height
StartThread(BehaviourChangeThread, lowBehaviour, targetID)
end
function script.StartMoving()
--Turn(fins, z_axis, math.rad(-(-30)), math.rad(50))
Move(wingr1, x_axis, 0, 50)
Move(wingr2, x_axis, 0, 50)
Move(wingl1, x_axis, 0, 50)
Move(wingl2, x_axis, 0, 50)
StartThread(SpeedControl)
end
function script.StopMoving()
--Turn(fins, z_axis, math.rad(-(0)), math.rad(80))
Move(wingr1, x_axis, 5, 30)
Move(wingr2, x_axis, 5, 30)
Move(wingl1, x_axis, -5, 30)
Move(wingl2, x_axis, -5, 30)
StartThread(GG.TakeOffFuncs.TakeOffThread, takeoffHeight, SIG_TAKEOFF)
end
local function Lights()
while select(5, Spring.GetUnitHealth(unitID)) < 1 do
Sleep(400)
end
while true do
EmitSfx(wingtipr, 1024)
EmitSfx(wingtipl, 1025)
Sleep(2000)
end
end
function script.Create()
SetInitialBomberSettings()
StartThread(GG.Script.SmokeUnit, unitID, smokePiece)
StartThread(GG.TakeOffFuncs.TakeOffThread, takeoffHeight, SIG_TAKEOFF)
GG.FakeUpright.FakeUprightInit(xp, zp, drop)
--StartThread(Lights)
end
function script.QueryWeapon(num)
return drop
end
function script.AimFromWeapon(num)
return drop
end
function script.AimWeapon(num, heading, pitch)
return (Spring.GetUnitRulesParam(unitID, "noammo") ~= 1)
end
local predictMult = 3
function script.BlockShot(num, targetID)
if num ~= 2 then
return false
end
local ableToFire = not ((GetUnitValue(COB.CRASHING) == 1) or RearmBlockShot())
if not (targetID and ableToFire) then
return not ableToFire
end
local x,y,z = spGetUnitPosition(unitID)
local _,_,_,_,_,_,tx,ty,tz = spGetUnitPosition(targetID, true, true)
local vx,vy,vz = spGetUnitVelocity(targetID)
local heading = spGetUnitHeading(unitID)*GG.Script.headingToRad
vx, vy, vz = vx*predictMult, vy*predictMult, vz*predictMult
local dx, dy, dz = tx + vx - x, ty + vy - y, tz + vz - z
local cosHeading = math.cos(heading)
local sinHeading = math.sin(heading)
dx, dz = cosHeading*dx - sinHeading*dz, cosHeading*dz + sinHeading*dx
local isMobile = not GG.IsUnitIdentifiedStructure(true, targetID)
local damage = (isMobile and 500.05) or GG.OverkillPrevention_GetHealthThreshold(targetID, 800.1, 770.1)
--Spring.Echo(vx .. ", " .. vy .. ", " .. vz)
--Spring.Echo(dx .. ", " .. dy .. ", " .. dz)
--Spring.Echo(heading)
if GG.OverkillPrevention_CheckBlockNoFire(unitID, targetID, damage, 60, false, false, false) then
-- Remove attack command on blocked target, it's already dead so move on.
local cQueue = Spring.GetCommandQueue(unitID, 1)
if cQueue and cQueue[1] and cQueue[1].id == CMD.ATTACK and (not cQueue[1].params[2]) and cQueue[1].params[1] == targetID then
Spring.GiveOrderToUnit(unitID, CMD.REMOVE, cQueue[1].tag, 0)
end
return true
end
if dy > 0 then
return true
end
if isMobile and (dz > 30 or dz < -30 or dx > 80 or dx < -80) then
return true
end
if isMobile then
dx = math.min(math.max(-50, dx), 50)
dz = math.min(math.max(-20, dz), 20)
dy = math.max(dy, -20)
else
dx = math.min(math.max(-30, dx), 30)
dz = math.min(math.max(-10, dz), 10)
dy = math.max(dy, -5)
end
GG.FakeUpright.FakeUprightTurn(unitID, xp, zp, base, predrop)
Move(drop, x_axis, dx)
Move(drop, z_axis, dz)
Move(drop, y_axis, dy)
local distance = math.max((Spring.GetUnitSeparation(unitID, targetID) or 1) - 25, 1)
local unitHeight = (GG.GetUnitHeight and GG.GetUnitHeight(targetID)) or 0
distance = math.max(0, distance - unitHeight/2)
local projectileTime = 35*math.min(1, distance/340)
if GG.OverkillPrevention_CheckBlock(unitID, targetID, damage, projectileTime, false, false, false) then
return true
end
return false
end
local function SpamFireCheck()
for i = 1, 10 do
GG.Bomber_Dive_fake_fired(unitID)
Sleep(100)
end
end
function script.FireWeapon(num)
if num == 2 then
SetUnarmedAI()
GG.Bomber_Dive_fired(unitID)
Sleep(33) -- delay before clearing attack order; else bomb loses target and fails to home
Move(drop, x_axis, 0)
Move(drop, z_axis, 0)
Move(drop, y_axis, 0)
Reload()
elseif num == 3 then
StartThread(SpamFireCheck)
end
end
function script.Killed(recentDamage, maxHealth)
Signal(SIG_TAKEOFF)
local severity = recentDamage/maxHealth
if severity <= 0.25 then
Explode(fuselage, SFX.NONE)
Explode(engines, SFX.NONE)
Explode(wingl1, SFX.NONE)
Explode(wingr2, SFX.NONE)
return 1
elseif severity <= 0.50 or (Spring.GetUnitMoveTypeData(unitID).aircraftState == "crashing") then
Explode(fuselage, SFX.NONE)
Explode(engines, SFX.NONE)
Explode(wingl2, SFX.NONE)
Explode(wingr1, SFX.NONE)
return 1
elseif severity <= 1 then
Explode(fuselage, SFX.NONE)
Explode(engines, SFX.FALL + SFX.SMOKE + SFX.FIRE)
Explode(wingl1, SFX.FALL + SFX.SMOKE + SFX.FIRE)
Explode(wingr2, SFX.FALL + SFX.SMOKE + SFX.FIRE)
return 2
else
Explode(fuselage, SFX.NONE)
Explode(engines, SFX.FALL + SFX.SMOKE + SFX.FIRE)
Explode(wingl1, SFX.FALL + SFX.SMOKE + SFX.FIRE)
Explode(wingl2, SFX.FALL + SFX.SMOKE + SFX.FIRE)
return 2
end
end
| gpl-2.0 |
condor-the-bird/tarantool | test/box/fio.test.lua | 8 | 2664 | fio = require 'fio'
errno = require 'errno'
-- umask
type(fio.umask(0))
fio.umask()
-- pathjoin
fio.basename(nil, nil)
fio.pathjoin('abc', 'cde')
fio.pathjoin('/', 'abc')
fio.pathjoin('abc/', '/cde')
fio.pathjoin('/', '/cde')
-- basename
fio.basename(nil)
fio.basename('/')
fio.basename('abc')
fio.basename('abc.cde', '.cde')
fio.basename('abc^cde', '.cde')
fio.basename('/path/to/file.cde', '.cde')
-- other tests
tmpdir = fio.tempdir()
file1 = fio.pathjoin(tmpdir, 'file.1')
file2 = fio.pathjoin(tmpdir, 'file.2')
file3 = fio.pathjoin(tmpdir, 'file.3')
file4 = fio.pathjoin(tmpdir, 'file.4')
fio.open(nil)
fh1 = fio.open(file1, { 'O_RDWR', 'O_TRUNC', 'O_CREAT' }, 0777)
fh1 ~= nil
f1s = fh1:stat()
f1s.size
f1s.is_reg()
f1s:is_reg()
f1s:is_dir()
f1s:is_link()
f1s:is_sock()
f1s:is_fifo()
f1s:is_chr()
f1s:is_blk()
fh1:seek(121)
fh1:stat().size
fh1:write(nil)
fh1:write("Hello, world")
fh1:stat().size
fh1:fsync()
fh1:fdatasync()
fio.sync()
fh1:pread(512, 121)
fh1:pread(5, 121)
fh1:write("; Ehllo, again")
fh1:seek(121)
fh1:read(13)
fh1:read(512)
fh1:pread(512, 14 + 121)
fh1:pwrite("He", 14 + 121)
fh1:pread(512, 14 + 121)
{ fh1:stat().size, fio.stat(file1).size }
fh1:seek(121)
fh1:read(512)
fio.link(nil, nil)
fio.link(file1, file2)
fio.glob(nil)
glob = fio.glob(fio.pathjoin(tmpdir, '*'))
#glob
{ string.match(glob[1], '^.*/(.*)'), string.match(glob[2], '^.*/(.*)') }
fio.stat(file1).inode == fio.stat(file2).inode
fh3 = fio.open(file3, { 'O_RDWR', 'O_TRUNC', 'O_CREAT' }, 0x1FD)
fh1:stat().inode ~= fh3:stat().inode
0775
bit.band(fh3:stat().mode, 0x1FF) == 0x1FD
fh3:write("abc")
fio.rename(nil, nil)
fio.rename(file3, file4)
fio.symlink(nil, nil)
fio.symlink(file4, file3)
fio.stat(nil)
fio.stat(file3).size
fio.lstat(file3).size ~= fio.stat(file3).size
fio.lstat(file3).mode ~= fio.stat(file3).mode
fio.basename(fio.readlink(file3))
bit.band(fio.stat(file4).mode, 0x1FF) == 0x1FD
fio.chmod(nil, 0x1F8)
fio.chmod(file4, 0x1F8) -- 0x770
bit.band(fh3:stat().mode, 0x1FF) == 0x1F8
bit.band(fio.stat(file4).mode, 0x1FF) == 0x1F8
fio.mkdir(nil)
fio.mkdir(fio.pathjoin(tmpdir, "dir"))
-- cleanup directories
{ fh1:close(), fh3:close() }
{ fh1:close(), errno.strerror(), fh3:close(), errno.strerror() }
fio.rmdir(nil)
fio.rmdir(fio.pathjoin(tmpdir, "dir"))
{ fio.unlink(file1), fio.unlink(file2), fio.unlink(file3), fio.unlink(file4) }
{ fio.unlink(file1), fio.unlink(file2), fio.unlink(file3), fio.unlink(file4) }
fio.rmdir(tmpdir)
{ fio.rmdir(tmpdir), errno.strerror() }
fio.unlink()
fio.unlink(nil)
-- dirname
fio.dirname(nil)
fio.dirname('abc')
fio.dirname('/abc')
fio.dirname('/abc/cde')
fio.dirname('/abc/cde/')
fio.dirname('/')
| bsd-2-clause |
m241dan/darkstar | scripts/globals/items/meat_chiefkabob.lua | 18 | 1449 | -----------------------------------------
-- ID: 4574
-- Item: meat_chiefkabob
-- Food Effect: 60Min, All Races
-----------------------------------------
-- Strength 5
-- Agility 1
-- Intelligence -2
-- Attack % 22
-- Attack Cap 65
-----------------------------------------
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,4574);
end;
-----------------------------------
-- onEffectGain Action
-----------------------------------
function onEffectGain(target,effect)
target:addMod(MOD_STR, 5);
target:addMod(MOD_AGI, 1);
target:addMod(MOD_INT, -2);
target:addMod(MOD_FOOD_ATTP, 22);
target:addMod(MOD_FOOD_ATT_CAP, 65);
end;
-----------------------------------------
-- onEffectLose Action
-----------------------------------------
function onEffectLose(target,effect)
target:delMod(MOD_STR, 5);
target:delMod(MOD_AGI, 1);
target:delMod(MOD_INT, -2);
target:delMod(MOD_FOOD_ATTP, 22);
target:delMod(MOD_FOOD_ATT_CAP, 65);
end;
| gpl-3.0 |
santssoft/darkstar | scripts/globals/items/chocolate_cake.lua | 11 | 1127 | -----------------------------------------
-- ID: 5633
-- Item: Chocolate Cake
-- Food Effect: 3 Hrs, All Races
-----------------------------------------
-- TODO: Group Effect
-- MP +3% (cap 90)
-- HP Recovered while healing +1
-- MP Recovered while healing +6
-----------------------------------------
require("scripts/globals/status")
require("scripts/globals/msg")
-----------------------------------------
function onItemCheck(target)
local result = 0
if target:hasStatusEffect(dsp.effect.FOOD) or target:hasStatusEffect(dsp.effect.FIELD_SUPPORT_FOOD) then
result = dsp.msg.basic.IS_FULL
end
return result
end
function onItemUse(target)
target:addStatusEffect(dsp.effect.FOOD,0,0,10800,5633)
end
function onEffectGain(target, effect)
target:addMod(dsp.mod.FOOD_MPP, 3)
target:addMod(dsp.mod.FOOD_MP_CAP, 90)
target:addMod(dsp.mod.HPHEAL, 1)
target:addMod(dsp.mod.MPHEAL, 6)
end
function onEffectLose(target, effect)
target:delMod(dsp.mod.FOOD_MPP, 3)
target:delMod(dsp.mod.FOOD_MP_CAP, 90)
target:delMod(dsp.mod.HPHEAL, 1)
target:delMod(dsp.mod.MPHEAL, 6)
end
| gpl-3.0 |
m241dan/darkstar | scripts/zones/Bastok_Mines/npcs/Gorvik.lua | 13 | 1060 | -----------------------------------
-- Area: Bastok Mines
-- NPC: Gorvik
-- Type: Past Event Watcher
-- @zone: 234
-- @pos 21.033 -1 -98.486
--
-- Auto-Script: Requires Verification (Verfied by Brawndo)
-----------------------------------
package.loaded["scripts/zones/Bastok_Mines/TextIDs"] = nil;
require("scripts/zones/Bastok_Mines/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
player:startEvent(0x00b9);
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 |
dvr333/Zero-K | units/energywind.lua | 4 | 3190 | return { energywind = {
unitname = [[energywind]],
name = [[Wind/Tidal Generator]],
description = [[Small Powerplant]],
activateWhenBuilt = true,
buildCostMetal = 35,
builder = false,
buildingGroundDecalDecaySpeed = 30,
buildingGroundDecalSizeX = 5,
buildingGroundDecalSizeY = 5,
buildingGroundDecalType = [[energywind_aoplane.dds]],
buildPic = [[energywind.png]],
category = [[FLOAT UNARMED]],
collisionVolumeOffsets = [[0 15 0]],
collisionVolumeScales = [[30 60 30]],
collisionVolumeType = [[CylY]],
corpse = [[DEAD]],
customParams = {
bait_level_target = 1,
pylonrange = 60,
windgen = true,
modelradius = [[12]],
removewait = 1,
removestop = 1,
default_spacing = 2,
tidal_health = 400,
},
energyMake = 1.2, --[[ as tidal; NOT added to wind (which is fully gadgeted
and cannot be found in this unit def file). Also used
as the income of a "generic" turbine, i.e. unspecified
whether wind or tidal (for example when hovering over
the icon on the UI to check OD payback ETA) since it
approximately averages the income of a wind with some
penalty for unreliability. ]]
energyUse = 0,
explodeAs = [[SMALL_BUILDINGEX]],
floater = true,
footprintX = 3,
footprintZ = 3,
iconType = [[energywind]],
idleAutoHeal = 5,
idleTime = 1800,
levelGround = false,
losEmitHeight = 30,
maxDamage = 150, -- as wind; see customparams for tidal
maxSlope = 75,
objectName = [[arm_wind_generator.s3o]],
script = [[energywind.lua]],
selfDestructAs = [[SMALL_BUILDINGEX]],
sightDistance = 273,
useBuildingGroundDecal = true,
yardMap = [[ooooooooo]],
featureDefs = {
DEAD = {
blocking = true,
featureDead = [[HEAP]],
footprintX = 3,
footprintZ = 3,
object = [[arm_wind_generator_dead.s3o]],
},
HEAP = {
blocking = false,
footprintX = 3,
footprintZ = 3,
object = [[debris4x4a.s3o]],
},
DEADWATER = {
blocking = true,
featureDead = [[HEAP]],
footprintX = 3,
footprintZ = 3,
object = [[arm_wind_generator_dead_water.s3o]],
customparams = {
health_override = 400,
},
}
},
} }
| gpl-2.0 |
m241dan/darkstar | scripts/globals/items/dish_of_spaghetti_carbonara.lua | 18 | 1821 | -----------------------------------------
-- ID: 5190
-- Item: dish_of_spaghetti_carbonara
-- Food Effect: 30Min, All Races
-----------------------------------------
-- Health % 14
-- Health Cap 175
-- Magic 10
-- Strength 4
-- Vitality 2
-- Intelligence -3
-- Attack % 18
-- Attack Cap 65
-- Store TP 6
-----------------------------------------
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,5190);
end;
-----------------------------------------
-- onEffectGain Action
-----------------------------------------
function onEffectGain(target,effect)
target:addMod(MOD_FOOD_HPP, 14);
target:addMod(MOD_FOOD_HP_CAP, 175);
target:addMod(MOD_MP, 10);
target:addMod(MOD_STR, 4);
target:addMod(MOD_VIT, 2);
target:addMod(MOD_INT, -3);
target:addMod(MOD_FOOD_ATTP, 18);
target:addMod(MOD_FOOD_ATT_CAP, 65);
target:addMod(MOD_STORETP, 6);
end;
-----------------------------------------
-- onEffectLose Action
-----------------------------------------
function onEffectLose(target,effect)
target:delMod(MOD_FOOD_HPP, 14);
target:delMod(MOD_FOOD_HP_CAP, 175);
target:delMod(MOD_MP, 10);
target:delMod(MOD_STR, 4);
target:delMod(MOD_VIT, 2);
target:delMod(MOD_INT, -3);
target:delMod(MOD_FOOD_ATTP, 18);
target:delMod(MOD_FOOD_ATT_CAP, 65);
target:delMod(MOD_STORETP, 6);
end;
| gpl-3.0 |
santssoft/darkstar | scripts/globals/items/plate_of_mushroom_paella_+1.lua | 11 | 1072 | -----------------------------------------
-- ID: 5971
-- Item: Plate of Mushroom Paella +1
-- Food Effect: 4 Hrs, All Races
-----------------------------------------
-- HP 43
-- Mind 6
-- Magic Accuracy 6
-- Undead Killer 6
-----------------------------------------
require("scripts/globals/status")
require("scripts/globals/msg")
-----------------------------------------
function onItemCheck(target)
local result = 0
if target:hasStatusEffect(dsp.effect.FOOD) or target:hasStatusEffect(dsp.effect.FIELD_SUPPORT_FOOD) then
result = dsp.msg.basic.IS_FULL
end
return result
end
function onItemUse(target)
target:addStatusEffect(dsp.effect.FOOD,0,0,14400,5971)
end
function onEffectGain(target,effect)
target:addMod(dsp.mod.HP, 45)
target:addMod(dsp.mod.MND, 6)
target:addMod(dsp.mod.MACC, 6)
target:addMod(dsp.mod.UNDEAD_KILLER, 6)
end
function onEffectLose(target, effect)
target:delMod(dsp.mod.HP, 45)
target:delMod(dsp.mod.MND, 6)
target:delMod(dsp.mod.MACC, 6)
target:delMod(dsp.mod.UNDEAD_KILLER, 6)
end
| gpl-3.0 |
m241dan/darkstar | scripts/zones/Vunkerl_Inlet_[S]/Zone.lua | 12 | 2365 | -----------------------------------
--
-- Zone: Vunkerl_Inlet_[S] (83)
--
-----------------------------------
package.loaded["scripts/zones/Vunkerl_Inlet_[S]/TextIDs"] = nil;
-----------------------------------
require("scripts/zones/Vunkerl_Inlet_[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(-393.238,-50.034,741.199,2);
end
return cs;
end;
-----------------------------------
-- onZoneWeatherChange
-----------------------------------
function onZoneWeatherChange(weather)
local npc = GetNPCByID(17118004); -- Indescript Markings
if (npc ~= nil) then
if (weather == WEATHER_FOG or weather == WEATHER_THUNDER) then
npc:setStatus(STATUS_DISAPPEAR);
elseif (VanadielHour() >= 16 or VanadielHour() <= 6) then
npc:setStatus(STATUS_NORMAL);
end
end
end;
-----------------------------------
-- onGameHour
-----------------------------------
function onGameHour()
local npc = GetNPCByID(17118004); -- Indescript Markings
if (npc ~= nil) then
if (VanadielHour() == 16) then
npc:setStatus(STATUS_DISAPPEAR);
end
if (VanadielHour() == 6) then
npc:setStatus(STATUS_NORMAL);
end
end
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 |
m241dan/darkstar | scripts/globals/spells/bluemagic/heat_breath.lua | 1 | 1752 | -----------------------------------------
-- Spell: Heat Breath
-- Deals fire damage to enemies within a fan-shaped area originating from the caster
-- Spell cost: 169 MP
-- Monster Type: Beasts
-- Spell Type: Magical (Fire)
-- Blue Magic Points: 4
-- Stat Bonus: STR+3
-- Level: 71
-- Casting Time: 7.5 seconds
-- Recast Time: 49 seconds
-- Magic Bursts on: Liquefaction, Fusion, Light
-- Combos: Magic Attack Bonus
-----------------------------------------
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 multi = 6.38;
local resist = applyResistance(caster,spell,target,caster:getStat(MOD_INT) - target:getStat(MOD_INT),BLUE_SKILL,1.0);
local params = {};
-- This data should match information on http://wiki.ffxiclopedia.org/wiki/Calculating_Blue_Magic_Damage
params.multiplier = multi;
params.tMultiplier = 1.5;
params.duppercap = 69;
params.str_wsc = 0.0;
params.dex_wsc = 0.0;
params.vit_wsc = 0.0;
params.agi_wsc = 0.0;
params.int_wsc = 0.0;
params.mnd_wsc = 0.3;
params.chr_wsc = 0.0;
damage = BlueMagicalSpell(caster, target, spell, params, MND_BASED);
damage = BlueFinalAdjustments(caster, target, spell, damage, params);
if (caster:hasStatusEffect(EFFECT_AZURE_LORE)) then
multi = multi + 0.50;
end
return damage;
end;
| gpl-3.0 |
m241dan/darkstar | scripts/zones/West_Ronfaure/npcs/Zovriace.lua | 27 | 38376 | -----------------------------------
-- Area: West Ronfaure
-- NPC: Zovriace
-- Type: Patrol NPC
-- @pos -436.356 -15.851 -258.168 100
-----------------------------------
package.loaded["scripts/zones/West_Ronfaure/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/pathfind");
-----------------------------------
local path = {
-439.970062, -16.752592, -255.100327,
-440.602631, -16.538126, -255.958786,
-441.127228, -16.394150, -256.900909,
-441.494019, -16.267317, -257.915710,
-441.581543, -16.133537, -258.985992,
-441.024231, -16.028330, -259.826294,
-439.954132, -16.028715, -259.822601,
-438.925629, -16.072157, -259.474915,
-437.941528, -16.180017, -259.014008,
-437.021820, -15.868464, -258.524048,
-436.108673, -15.583454, -258.000946,
-435.179413, -15.400028, -257.455811,
-432.864655, -15.075329, -256.065369,
-423.557495, -14.982476, -250.437790,
-422.761383, -15.055836, -249.708817,
-422.268677, -15.117037, -248.744232,
-421.972382, -15.198636, -247.701523,
-421.776733, -15.333975, -246.640106,
-421.618866, -15.467649, -245.572189,
-421.478943, -15.717875, -244.517334,
-421.351807, -15.921570, -243.463135,
-421.186218, -16.198463, -241.860138,
-421.114075, -16.145809, -240.774628,
-421.063721, -16.139482, -239.687912,
-420.994019, -16.130768, -237.785126,
-420.230377, -15.989685, -211.979935,
-420.197784, -15.922558, -210.893448,
-420.124512, -15.798100, -207.772995,
-420.100586, -15.813488, -206.552765,
-419.909180, -16.017889, -199.219910,
-420.047943, -16.120964, -198.143524,
-420.387573, -15.748003, -197.158432,
-420.822083, -15.460172, -196.220764,
-421.321320, -15.238870, -195.271896,
-421.853363, -15.129681, -194.327469,
-423.947327, -15.024358, -190.672211,
-427.640472, -14.942602, -184.327072,
-428.275848, -15.015442, -183.448257,
-428.993866, -15.115380, -182.637329,
-429.774628, -15.196917, -181.884567,
-430.584961, -15.269184, -181.162048,
-431.407013, -15.339080, -180.452606,
-432.945740, -15.590717, -179.147598,
-446.838165, -18.853514, -167.615036,
-447.872925, -18.977230, -166.740967,
-450.464325, -19.402002, -164.580673,
-451.186340, -19.500000, -163.781158,
-451.724823, -19.500000, -162.836929,
-452.156342, -19.526083, -161.839020,
-452.542633, -19.574369, -160.823151,
-452.902069, -19.619282, -159.797119,
-453.247406, -19.652224, -158.765945,
-454.379395, -19.973661, -155.298203,
-455.345062, -20.866318, -152.299789,
-455.671997, -20.945515, -151.285309,
-456.993286, -21.072395, -147.165604,
-457.321960, -21.268314, -146.147049,
-460.919006, -21.558647, -134.955734,
-461.252441, -21.516457, -133.920914,
-463.684235, -20.974045, -126.322334,
-463.735504, -21.005585, -125.238617,
-463.618225, -21.100723, -124.159538,
-463.476532, -21.130386, -123.083138,
-460.845245, -21.814005, -103.009911,
-460.340668, -21.860525, -102.053253,
-459.548370, -21.859089, -101.316696,
-458.651062, -21.799015, -100.705299,
-457.715729, -21.738424, -100.153778,
-456.764191, -21.662802, -99.631622,
-455.801666, -21.716837, -99.128433,
-452.543488, -21.461651, -97.451981,
-427.263428, -19.779127, -84.644547,
-426.292938, -19.805960, -84.153252,
-424.000397, -20.058718, -82.994804,
-423.030975, -19.983002, -82.507225,
-396.179047, -20.642097, -68.915520,
-395.230957, -20.758915, -68.394829,
-394.369598, -20.974821, -67.755898,
-393.589478, -21.246567, -67.048546,
-392.859406, -21.419449, -66.273178,
-392.153625, -21.557785, -65.456947,
-391.468964, -21.778866, -64.640053,
-390.559631, -22.323750, -63.552891,
-389.849030, -22.824114, -62.691097,
-387.739929, -24.336773, -60.088634,
-387.035553, -24.853951, -59.230145,
-386.339355, -25.370905, -58.366211,
-385.651886, -26.125864, -57.510376,
-385.033325, -27.045774, -56.701607,
-384.452972, -27.587692, -55.817024,
-383.951385, -27.987345, -54.938370,
-383.386536, -28.294943, -53.910427,
-382.906982, -28.606924, -52.984940,
-382.409454, -28.917976, -52.069004,
-381.867371, -29.025024, -51.137131,
-381.301788, -29.172449, -50.219383,
-380.727570, -29.320223, -49.307129,
-364.454529, -30.016165, -24.085087,
-354.090363, -29.671881, -8.006002,
-353.540497, -29.834528, -7.080005,
-353.008911, -30.037712, -6.150451,
-351.508148, -30.500000, -3.461302,
-344.298309, -31.130165, 9.622360,
-343.719788, -31.229996, 10.534849,
-343.014465, -31.336742, 11.354795,
-342.196075, -31.448938, 12.062510,
-341.337769, -31.562546, 12.721281,
-340.463776, -31.676613, 13.359138,
-339.578003, -31.747307, 13.983932,
-338.684845, -31.777473, 14.604170,
-331.282471, -31.493895, 19.661541,
-330.308228, -31.447271, 20.141212,
-329.288361, -31.455376, 20.518837,
-328.249207, -31.395697, 20.818035,
-327.199799, -31.337658, 21.087675,
-326.141876, -31.381889, 21.338877,
-325.082703, -31.432835, 21.581512,
-320.835022, -31.395533, 22.525442,
-319.773651, -31.337238, 22.757223,
-316.724976, -31.168060, 23.434225,
-315.697601, -31.067081, 23.774858,
-314.713531, -31.001366, 24.234629,
-313.761444, -30.953598, 24.758646,
-312.835083, -30.887995, 25.325043,
-311.918732, -30.789017, 25.902380,
-310.216614, -30.826614, 27.010038,
-307.517303, -31.226393, 28.788122,
-306.582703, -31.154129, 29.342878,
-305.625275, -31.055418, 29.852215,
-304.660309, -30.967735, 30.347439,
-303.691956, -30.867880, 30.831894,
-301.273224, -30.522186, 32.021267,
-300.325226, -30.253407, 32.488640,
-297.896606, -29.961315, 33.678493,
-296.921356, -29.980268, 34.155445,
-283.175232, -30.000000, 40.879360,
-282.197723, -30.000000, 41.357021,
-273.907654, -30.223761, 45.435520,
-273.112213, -30.613419, 46.087021,
-272.551117, -31.027349, 46.919304,
-272.154144, -31.419172, 47.850975,
-271.860565, -31.801704, 48.831139,
-271.583862, -32.090355, 49.799915,
-271.340332, -32.425247, 50.806000,
-270.992645, -32.844288, 52.328403,
-269.161621, -35.016342, 60.795799,
-268.899292, -35.537270, 62.046036,
-267.436157, -38.003387, 68.796013,
-267.218933, -38.403229, 69.785110,
-266.716248, -39.181328, 72.162575,
-266.646820, -39.236248, 73.245872,
-266.741486, -39.305218, 74.326553,
-266.943451, -39.503807, 75.379707,
-267.198029, -39.606842, 76.420052,
-267.467224, -39.573181, 77.473747,
-267.751343, -39.537670, 78.523438,
-269.489166, -39.688145, 84.654762,
-269.779968, -39.940563, 85.672394,
-270.407593, -40.357700, 87.859993,
-270.701263, -40.217247, 88.897224,
-271.803741, -39.582218, 92.765701,
-272.103394, -39.621971, 93.822968,
-274.938629, -40.094635, 103.757698,
-275.234436, -39.950058, 104.796463,
-278.316315, -39.956299, 115.598122,
-278.657959, -40.000000, 116.626968,
-279.067108, -40.000000, 117.634903,
-279.518555, -40.000000, 118.624847,
-279.993774, -40.000000, 119.603645,
-280.484222, -40.000000, 120.574821,
-280.980164, -40.000000, 121.543243,
-286.929169, -39.008667, 132.941757,
-287.430420, -38.897781, 133.901459,
-287.937683, -38.781601, 134.856888,
-288.510773, -38.692963, 135.778198,
-289.157349, -38.665531, 136.652649,
-289.833923, -38.639122, 137.504150,
-290.523529, -38.604607, 138.344910,
-291.396698, -38.552856, 139.386200,
-300.068176, -35.596138, 149.616638,
-300.450134, -35.417088, 150.612869,
-300.480957, -35.302635, 151.691971,
-300.363770, -35.374798, 152.765915,
-300.181000, -35.526699, 153.827637,
-299.967926, -35.682739, 154.883087,
-299.740814, -35.856140, 155.933807,
-299.166321, -36.110737, 158.434998,
-297.842926, -36.519508, 164.110306,
-297.711517, -36.728516, 165.169052,
-297.791962, -36.897087, 166.237534,
-298.034912, -37.036209, 167.288712,
-298.354279, -37.162457, 168.321182,
-298.708008, -37.283379, 169.343033,
-299.123047, -37.480621, 170.478378,
-299.870880, -38.047672, 172.461945,
-300.458160, -38.762894, 173.968826,
-301.121552, -39.588573, 175.707932,
-301.488495, -39.880459, 176.703125,
-301.741180, -40.187134, 177.714966,
-301.840820, -40.504196, 178.748749,
-301.855133, -40.822124, 179.788849,
-301.822845, -41.188747, 180.817581,
-301.758820, -41.552467, 181.840881,
-301.682739, -41.920956, 182.862518,
-301.407043, -42.825760, 186.114990,
-300.501160, -45.446545, 196.063461,
-300.327515, -45.781693, 197.086868,
-300.107330, -46.023857, 198.101761,
-299.892059, -46.020031, 199.202560,
-299.658722, -46.049198, 200.264832,
-299.083496, -45.989109, 202.775665,
-298.839966, -45.840462, 203.825668,
-298.599335, -45.612335, 204.856720,
-297.294495, -45.038647, 210.384552,
-296.802460, -45.031513, 211.348297,
-296.003754, -44.947575, 212.076996,
-295.089417, -44.939152, 212.665131,
-294.132080, -44.971771, 213.180725,
-293.159241, -45.004112, 213.666809,
-292.177643, -45.043068, 214.134933,
-290.945007, -45.035225, 214.709396,
-282.860168, -45.922268, 218.423615,
-281.928314, -46.162800, 218.882782,
-280.925964, -46.093803, 219.302551,
-279.942993, -46.035995, 219.765259,
-278.976990, -46.039272, 220.261993,
-278.019318, -46.126381, 220.774200,
-276.532257, -45.679039, 221.595612,
-273.266785, -45.098358, 223.469131,
-272.324432, -45.015408, 224.010422,
-268.550629, -45.024551, 226.176529,
-267.745361, -45.022247, 226.900223,
-267.117981, -44.979355, 227.787445,
-266.573853, -44.975834, 228.729248,
-266.066772, -44.982010, 229.691788,
-265.576538, -45.041542, 230.663071,
-265.079071, -45.163151, 231.627274,
-264.597351, -45.264587, 232.595947,
-264.152435, -45.446598, 233.563171,
-263.697998, -45.680012, 234.523819,
-262.016174, -46.281578, 238.029846,
-261.556702, -46.201237, 239.014328,
-256.600128, -45.025234, 249.377197,
-255.970734, -44.957794, 250.260529,
-255.212357, -44.939751, 251.038193,
-254.386093, -44.945457, 251.745514,
-253.526093, -44.969048, 252.411560,
-252.652176, -45.002594, 253.058823,
-251.770966, -45.036087, 253.696213,
-244.441742, -45.275829, 258.863953,
-243.505188, -45.542328, 259.357666,
-242.523361, -45.906620, 259.648193,
-241.460144, -46.028633, 259.823212,
-240.374603, -46.019741, 259.894318,
-239.287964, -46.013302, 259.945831,
-238.200699, -46.008728, 259.982391,
-235.359665, -46.299160, 260.041962,
-231.212814, -47.047096, 260.111084,
-228.414734, -47.613140, 260.165649,
-227.395874, -48.089172, 260.184479,
-225.697647, -48.950203, 260.216675,
-224.363464, -49.629337, 260.239838,
-223.352081, -49.953148, 260.253906,
-216.001205, -52.412048, 260.375458,
-214.947723, -52.636997, 260.390472,
-204.417313, -55.326168, 260.560699,
-203.368652, -55.655231, 260.576294,
-202.049591, -56.112896, 260.577698,
-200.935196, -56.080486, 260.591614,
-184.915848, -56.834442, 260.617188,
-183.857697, -57.100548, 260.594025,
-182.771301, -57.095242, 260.613068,
-181.551437, -57.195465, 260.611603,
-180.467743, -57.268650, 260.554718,
-179.388474, -57.235741, 260.443207,
-178.313416, -57.323948, 260.301849,
-177.240799, -57.410061, 260.141052,
-175.639709, -57.602425, 259.888031,
-153.454758, -59.971466, 256.230652,
-152.371017, -59.941368, 256.202332,
-151.338013, -59.899998, 256.526245,
-150.409531, -59.899998, 257.091797,
-149.546631, -59.905708, 257.754150,
-148.712616, -59.944000, 258.451752,
-147.891266, -59.982349, 259.164490,
-147.077164, -59.987167, 259.886108,
-145.559814, -59.996250, 261.249481,
-135.296967, -61.920395, 270.550049,-- report?
-136.090424, -61.731232, 269.830048,
-136.884094, -61.542065, 269.110352,
-150.086914, -59.899998, 257.147797,
-151.020218, -59.899998, 256.592834,
-152.073257, -59.902092, 256.345337,
-153.159882, -59.929256, 256.347260,
-154.243652, -59.956352, 256.436890,
-155.322754, -59.991856, 256.572998,
-156.398727, -59.956062, 256.729126,
-158.145386, -59.938908, 257.003632,
-178.976608, -57.275406, 260.436218,
-180.056641, -57.302162, 260.523682,
-181.140915, -57.218544, 260.571320,
-182.225555, -57.135334, 260.593964,
-183.310730, -57.070732, 260.604950,
-184.389069, -56.970604, 260.592346,
-185.446976, -56.699245, 260.612305,
-186.534317, -56.616566, 260.619019,
-188.029251, -56.562798, 260.618652,
-207.543884, -54.695351, 260.506195,
-208.593231, -54.421879, 260.490112,
-227.786392, -47.844944, 260.176392,
-228.828674, -47.528126, 260.161072,
-230.026764, -47.278732, 260.139496,
-234.035889, -46.541107, 260.063751,
-240.660934, -46.011520, 259.960083,
-241.744278, -46.169971, 259.869843,
-242.749298, -45.785637, 259.621307,
-243.688675, -45.496006, 259.184814,
-244.613403, -45.269833, 258.647064,
-245.518509, -45.137951, 258.052887,
-246.419617, -45.087288, 257.445129,
-247.315887, -45.036938, 256.830475,
-249.769028, -45.024799, 255.119431,
-254.651855, -44.940964, 251.663010,
-255.433929, -44.937099, 250.909637,
-256.076324, -44.971489, 250.033737,
-256.635040, -45.035885, 249.102524,
-257.142975, -45.097923, 248.142441,
-257.629761, -45.233803, 247.177734,
-258.461090, -45.483078, 245.483109,
-259.049194, -45.740898, 244.276123,
-259.516541, -45.851563, 243.307846,
-264.719360, -45.247227, 232.364548,
-265.227234, -45.105091, 231.261398,
-265.719788, -44.985176, 230.292435,
-266.195129, -44.977989, 229.313889,
-266.685333, -44.971275, 228.342972,
-267.309906, -44.990795, 227.454300,
-268.097290, -45.024536, 226.706238,
-268.976410, -45.019974, 226.065643,
-269.888763, -45.017735, 225.473099,
-270.818024, -45.019180, 224.907379,
-271.753998, -45.000942, 224.352997,
-273.165039, -45.084061, 223.535965,
-274.098724, -45.217224, 222.991837,
-275.034912, -45.352219, 222.454132,
-276.433075, -45.645039, 221.653473,
-278.282349, -46.227036, 220.580002,
-279.259583, -46.019772, 220.105209,
-280.239838, -46.051945, 219.636856,
-281.715057, -46.138523, 218.944061,
-295.072144, -44.942986, 212.826477,
-295.975891, -44.965645, 212.229233,
-296.626495, -44.995678, 211.363297,
-297.092560, -45.025742, 210.383209,
-297.438629, -45.079567, 209.353546,
-297.736084, -45.130760, 208.308319,
-298.005737, -45.248287, 207.260376,
-298.264038, -45.386070, 206.212494,
-299.041473, -45.962364, 202.959167,
-299.294495, -46.129169, 201.913116,
-299.533417, -46.064907, 200.852234,
-299.778412, -46.034283, 199.792679,
-300.021393, -46.009171, 198.732605,
-300.230682, -45.949970, 197.678162,
-300.387177, -45.645302, 196.654877,
-300.517700, -45.328785, 195.618057,
-300.631744, -45.131599, 194.554199,
-300.736755, -44.933083, 193.489655,
-301.916626, -41.039673, 180.393494,
-301.952759, -40.689056, 179.362061,
-301.844147, -40.380367, 178.326706,
-301.584625, -40.074371, 177.315918,
-301.265717, -39.777336, 176.319107,
-300.939575, -39.442776, 175.363297,
-300.565338, -38.942703, 174.325500,
-300.181183, -38.417553, 173.289810,
-299.740601, -37.873989, 172.134750,
-299.364197, -37.599380, 171.148911,
-298.786713, -37.338978, 169.644882,
-298.402985, -37.208858, 168.635559,
-298.027802, -37.092781, 167.620956,
-297.779541, -36.955162, 166.573044,
-297.768494, -36.779991, 165.501678,
-297.893860, -36.572292, 164.441559,
-298.075348, -36.378498, 163.386337,
-298.291718, -36.245903, 162.328415,
-298.523804, -36.191105, 161.267609,
-299.099976, -36.119068, 158.749771,
-300.622803, -35.272141, 152.185272,
-300.546265, -35.356747, 151.112457,
-300.139984, -35.533932, 150.124802,
-299.563080, -35.738934, 149.226395,
-298.926300, -35.974628, 148.366928,
-298.292847, -36.369488, 147.566315,
-297.652222, -36.771412, 146.784256,
-296.598267, -37.424564, 145.524170,
-289.386353, -38.662991, 137.017761,
-288.751190, -38.680820, 136.135315,
-288.184235, -38.716503, 135.207581,
-287.656708, -38.841850, 134.261246,
-286.957916, -39.001762, 132.948334,
-286.436218, -38.979378, 131.993698,
-285.933044, -39.086742, 131.035538,
-279.544037, -40.000000, 118.786339,
-279.095001, -40.000000, 117.795532,
-278.723389, -40.000000, 116.773209,
-278.390717, -40.000000, 115.739441,
-278.077759, -39.844975, 114.705635,
-277.060913, -39.500000, 111.198402,
-271.665955, -39.568001, 92.294022,
-271.258362, -39.819828, 90.879639,
-269.650452, -39.829777, 85.218178,
-269.097565, -39.500000, 83.293137,
-266.809784, -39.475517, 75.200165,
-266.649567, -39.287212, 74.141655,
-266.706604, -39.230602, 73.057381,
-266.841522, -39.182301, 71.979034,
-267.013214, -38.883488, 70.972496,
-267.203888, -38.458267, 69.986374,
-267.405945, -38.092369, 68.997025,
-267.967316, -37.205059, 66.336739,
-269.169342, -35.011940, 60.768829,
-269.416901, -34.755840, 59.608253,
-271.049866, -32.833099, 52.036350,
-271.266663, -32.500420, 51.020298,
-271.939880, -31.580200, 47.963612,
-272.323029, -31.133356, 47.024605,
-273.091705, -30.631182, 46.207066,
-273.918060, -30.234310, 45.609779,
-274.847778, -30.141161, 45.052742,
-275.801636, -30.049332, 44.537346,
-276.767395, -30.004099, 44.039276,
-277.740051, -30.000000, 43.551609,
-295.029419, -30.001234, 35.084103,
-296.004395, -30.028824, 34.606136,
-298.320343, -30.011620, 33.472553,
-299.292633, -30.127960, 32.998138,
-300.744598, -30.420561, 32.287434,
-301.822388, -30.660269, 31.766117,
-305.449860, -31.039577, 29.961134,
-306.393860, -31.150333, 29.427002,
-307.322937, -31.208359, 28.864517,
-308.242828, -31.225145, 28.287502,
-309.370667, -30.999538, 27.554298,
-313.548218, -30.951408, 24.807213,
-314.496948, -30.999880, 24.278208,
-315.499756, -31.051682, 23.858809,
-316.537872, -31.154470, 23.544914,
-317.590332, -31.206734, 23.277721,
-318.646790, -31.269846, 23.025274,
-319.705627, -31.330627, 22.782150,
-328.585144, -31.461010, 20.809793,
-329.604736, -31.452932, 20.447485,
-330.576935, -31.458323, 19.959888,
-331.516846, -31.525490, 19.415882,
-332.434601, -31.586788, 18.835255,
-333.342133, -31.637566, 18.237196,
-334.808746, -31.720680, 17.253775,
-341.755096, -31.512569, 12.505347,
-342.587311, -31.399881, 11.814846,
-343.284424, -31.293304, 10.987100,
-343.903748, -31.204266, 10.098687,
-344.476776, -31.068769, 9.182813,
-345.021790, -30.936897, 8.250527,
-345.557404, -30.848867, 7.308527,
-346.944550, -30.665789, 4.819434,
-352.769531, -30.134678, -5.750056,
-353.430542, -29.865831, -6.908241,
-353.990356, -29.703238, -7.826676,
-354.571625, -29.606535, -8.750077,
-359.278839, -30.020227, -16.060516,
-359.865417, -29.940750, -16.974663,
-366.939056, -29.873177, -27.931231,
-367.528503, -29.888115, -28.845236,
-376.512451, -29.969620, -42.758610,
-377.103638, -29.932671, -43.671219,
-381.560516, -29.108587, -50.606083,
-382.097595, -28.962421, -51.540813,
-382.600891, -28.786295, -52.479153,
-383.076721, -28.473091, -53.406521,
-383.741272, -28.044344, -54.676407,
-384.273438, -27.694052, -55.554253,
-384.877289, -27.241680, -56.411148,
-385.524475, -26.414268, -57.283955,
-386.158508, -25.591860, -58.105274,
-386.828674, -24.977655, -58.949734,
-390.529175, -22.315744, -63.529224,
-392.262146, -21.522633, -65.653603,
-392.948425, -21.380217, -66.485573,
-393.689911, -21.182203, -67.244202,
-394.540680, -20.930220, -67.872482,
-395.454437, -20.739042, -68.440071,
-396.398987, -20.635540, -68.968857,
-397.357697, -20.571712, -69.479454,
-398.320526, -20.508863, -69.982239,
-400.858337, -20.346436, -71.281647,
-416.078491, -20.016394, -78.992798,
-417.048981, -19.936098, -79.480896,
-427.943085, -19.760998, -84.990929,
-428.913177, -19.807173, -85.480782,
-432.057404, -20.048246, -87.078934,
-433.018707, -20.206867, -87.563354,
-434.463531, -20.382471, -88.293999,
-435.430756, -20.458065, -88.786209,
-452.483673, -21.459229, -97.418785,
-453.453613, -21.498474, -97.910263,
-455.629822, -21.682997, -99.016502,
-456.597382, -21.676950, -99.507576,
-459.140961, -21.836069, -100.792534,
-459.946869, -21.893318, -101.510696,
-460.448151, -21.846874, -102.472565,
-460.755463, -21.810520, -103.514992,
-460.974854, -21.743179, -104.577850,
-461.155731, -21.659788, -105.647171,
-461.317200, -21.591896, -106.720940,
-461.468292, -21.524906, -107.796364,
-463.602295, -21.103918, -124.129204,
-463.619171, -21.024265, -125.213806,
-463.478882, -21.006443, -126.292236,
-463.249878, -21.002714, -127.355629,
-462.966309, -21.089417, -128.399185,
-462.668304, -21.285374, -129.427078,
-462.235779, -21.446602, -130.840286,
-460.657928, -21.688395, -135.754669,
-460.330139, -21.662376, -136.789734,
-455.015533, -20.520708, -153.317886,
-454.692139, -20.245014, -154.319489,
-452.376251, -19.553642, -161.505966,
-451.983276, -19.504547, -162.518814,
-451.383820, -19.500000, -163.425491,
-450.662170, -19.500000, -164.235107,
-449.881348, -19.324495, -164.978180,
-449.075256, -19.183504, -165.695129,
-448.256256, -19.045288, -166.398026,
-447.224274, -18.874338, -167.267380,
-446.393372, -18.880678, -167.969147,
-444.853027, -18.565512, -169.265442,
-429.819672, -15.220426, -181.753754,
-429.047333, -15.136473, -182.514877,
-428.378082, -15.023755, -183.364578,
-427.766907, -14.929929, -184.258438,
-427.184479, -14.948370, -185.176834,
-426.620789, -14.981401, -186.106918,
-420.939972, -15.316271, -195.861465,
-420.463104, -15.644215, -196.799393,
-420.179413, -15.996948, -197.782822,
-420.054016, -16.013285, -198.776382,
-420.006409, -16.007343, -199.863220,
-419.994202, -16.007246, -200.951035,
-420.002808, -16.006878, -202.039001,
-420.028076, -16.012650, -203.534683,
-420.136383, -15.819376, -208.158340,
-420.158417, -15.863979, -209.517258,
-420.217560, -15.970049, -212.114258,
-420.270721, -15.849182, -213.198792,
-420.324890, -15.797634, -214.692932,
-420.826080, -15.902279, -232.085022,
-420.854614, -15.979057, -233.178070,
-421.049957, -16.137796, -239.834213,
-421.117493, -16.146238, -240.920044,
-421.206573, -16.172615, -242.004349,
-421.315979, -15.984070, -243.070419,
-421.494659, -15.643467, -244.787292,
-421.819092, -15.221020, -247.595215,
-422.154602, -15.128119, -248.622253,
-422.758545, -15.061894, -249.519104,
-423.569183, -14.987906, -250.238434,
-424.447510, -14.935026, -250.876724,
-425.353729, -14.944465, -251.478790,
-426.272919, -14.957020, -252.060471,
-427.197968, -14.990112, -252.632385,
-435.669800, -15.466051, -257.761230,
-436.582245, -15.703817, -258.315826,
-437.807831, -16.083422, -259.079224,
-438.774384, -16.063610, -259.543793,
-439.841156, -16.037457, -259.752838,
-440.927063, -16.028862, -259.821381,
-442.012054, -16.065359, -259.827911,
-443.029694, -15.716091, -259.796082,
-444.055817, -15.340240, -259.815460,
-445.097931, -15.219767, -260.104065,
-446.074341, -15.110579, -260.570770,
-447.027344, -15.057332, -261.092285,
-447.959381, -15.005149, -261.650909,
-448.870300, -15.018632, -262.244598,
-452.834351, -15.055134, -264.874695,
-453.655518, -15.037918, -265.585449,
-454.313416, -14.975594, -266.448151,
-454.843811, -14.943377, -267.396851,
-455.317291, -14.926654, -268.376190,
-455.755920, -14.934984, -269.371826,
-456.179169, -14.990575, -270.372711,
-458.718781, -15.924042, -276.598358,
-459.454010, -16.074858, -278.487640,
-459.765564, -16.035896, -279.529297,
-460.018890, -16.008865, -280.586884,
-460.219788, -16.034010, -281.655853,
-460.388611, -15.869349, -282.697662,
-460.631561, -15.373913, -284.238556,
-463.079895, -10.491953, -301.043823,
-463.087708, -10.158780, -302.077850,
-462.960846, -9.836479, -303.109039,
-462.774170, -9.560242, -304.125580,
-462.522583, -8.986555, -305.196259,
-462.273163, -8.643255, -306.190765,
-462.021210, -8.278727, -307.184570,
-460.034760, -6.387301, -314.867249,
-459.871155, -6.200213, -315.926605,
-459.784912, -6.106617, -317.006958,
-459.729767, -6.040372, -318.091217,
-459.694733, -6.044695, -319.178589,
-459.585297, -6.053058, -324.342834,
-459.546967, -5.772733, -326.638885,
-459.503937, -5.646238, -328.802887,
-459.475159, -5.742835, -330.568115,
-459.458099, -5.785998, -331.654663,
-459.434814, -5.762313, -332.741577,
-459.407196, -5.823767, -334.235260,
-459.388367, -5.885840, -335.321259,
-459.238617, -5.855601, -343.748810,
-459.212708, -5.653573, -345.233765,
-459.171204, -5.405949, -347.661652,
-459.148193, -5.488004, -349.155365,
-459.102081, -5.651767, -351.733948,
-459.078918, -5.694240, -352.820526,
-459.029205, -6.086042, -355.647919,
-459.029083, -6.127892, -356.731750,
-459.140869, -6.113956, -357.812897,
-459.383789, -6.083621, -358.872314,
-459.727936, -6.040620, -359.903625,
-460.125519, -6.022241, -360.915192,
-460.547241, -6.109803, -361.916656,
-460.983124, -5.974494, -362.906189,
-461.694427, -5.748822, -364.503021,
-464.664276, -4.937500, -371.008911,
-465.236359, -4.933529, -371.931122,
-466.029266, -4.964595, -372.673553,
-466.928986, -4.997910, -373.282715,
-467.884674, -5.034942, -373.801270,
-468.857971, -5.029415, -374.286438,
-469.843262, -5.023180, -374.747375,
-470.833405, -5.019099, -375.197601,
-472.694275, -5.035691, -376.029572,
-473.677887, -5.200471, -376.472137,
-474.661591, -5.361502, -376.908600,
-476.374115, -5.724977, -377.667419,
-477.943665, -6.254426, -378.389740,
-478.940887, -6.155789, -378.806549,
-479.933899, -6.100767, -379.246948,
-480.918152, -6.043252, -379.707092,
-481.900665, -6.081943, -380.169891,
-484.013855, -5.418111, -381.186493,
-491.435669, -5.052667, -384.848053,
-492.353546, -5.041574, -385.430573,
-493.202301, -5.007907, -386.109772,
-493.992279, -4.974132, -386.856659,
-494.756409, -4.940371, -387.630280,
-495.507080, -4.923118, -388.417175,
-496.431793, -4.977174, -389.412140,
-497.107117, -5.046514, -390.261566,
-497.657043, -5.110490, -391.197357,
-498.112122, -5.190608, -392.182343,
-498.507446, -5.332036, -393.186005,
-498.873962, -5.472911, -394.200806,
-499.234314, -5.613681, -395.218109,
-499.678253, -5.800858, -396.489166,
-500.778503, -6.103849, -399.830353,
-501.068237, -6.140066, -400.878174,
-501.285126, -6.187640, -401.943726,
-501.455048, -5.907662, -402.972321,
-501.603912, -5.583361, -404.001343,
-501.743408, -5.360402, -405.062927,
-502.090485, -4.776625, -407.835724,
-503.105774, -2.217786, -416.217438,
-503.239807, -1.832487, -417.352051,
-503.333099, -1.481157, -418.377258,
-503.423798, -1.100163, -419.395477,
-503.386627, -0.703467, -420.402710,
-503.246399, -0.351263, -421.441803,
-502.988159, -0.045092, -422.453247,
-502.687469, 0.254894, -423.455109,
-502.373627, 0.594657, -424.430695,
-502.022430, 1.109420, -425.470734,
-501.691040, 1.542306, -426.415924,
-499.392395, 3.206969, -433.018402,
-499.253448, 3.375491, -434.080170,
-499.522461, 3.599207, -435.105164,
-500.032349, 3.822114, -436.033020,
-500.653107, 3.809904, -436.925049,
-501.312653, 3.793942, -437.789276,
-501.987488, 3.745028, -438.639038,
-503.010254, 3.617167, -439.904755,
-504.546265, 3.195670, -441.791504,
-505.474762, 3.454881, -442.943634,
-506.260468, 3.535620, -443.878723,
-506.956055, 3.542965, -444.714844,
-508.938232, 3.486761, -447.139069,
-509.594696, 3.471608, -448.007050,
-510.234344, 3.489084, -448.886902,
-512.427246, 3.586239, -451.998352,
-513.936096, 3.984726, -454.195862,
-514.540894, 4.233383, -455.064941,
-515.166321, 4.378668, -455.945282,
-516.262939, 4.290412, -457.499878,
-516.891174, 4.174067, -458.381256,
-517.627136, 3.970321, -459.154846,
-518.497131, 3.965434, -459.776428,
-519.472900, 3.961867, -460.252655,
-520.468811, 3.907594, -460.686981,
-521.475464, 3.856341, -461.097015,
-522.467651, 3.899534, -461.479309,
-523.431274, 4.273953, -461.837158,
-532.930542, 4.970236, -465.372864,
-533.836426, 5.003310, -465.964172,
-534.517090, 5.036720, -466.809723,
-535.063843, 5.069100, -467.748749,
-535.532227, 5.071708, -468.730682,
-535.968689, 5.042767, -469.726746,
-536.385559, 4.985219, -470.730225,
-536.996216, 4.874025, -472.240662,
-538.487976, 4.135559, -475.968048,
-538.877197, 4.030794, -476.973175,
-539.262268, 3.887287, -477.981995,
-539.575439, 3.940336, -479.021515,
-539.779053, 3.965811, -480.089569,
-539.916809, 3.983058, -481.168549,
-540.027405, 3.990070, -482.250732,
-540.122314, 3.997955, -483.334686,
-540.210938, 3.984653, -484.419312,
-541.090576, 3.211054, -496.324768,
-541.168152, 3.029897, -497.395050,
-541.225708, 2.852559, -498.466858,
-541.208801, 2.688696, -499.542267,
-541.137390, 2.576481, -500.620575,
-541.029846, 2.491427, -501.699982,
-540.901306, 2.387329, -502.777466,
-540.700256, 2.348901, -504.390961,
-539.072510, 0.190201, -516.318054,
-538.841309, 0.175944, -517.380859,
-538.530579, 0.156524, -518.422974,
-538.178406, 0.134513, -519.452148,
-537.805481, 0.111208, -520.473999,
-537.424194, 0.087378, -521.492676,
-536.306885, 0.056635, -524.412842,
-533.919128, 0.072274, -530.589355,
-534.307983, 0.225401, -529.584229,
-534.697571, 0.361172, -528.577515,
-538.121399, 0.130942, -519.723328,
-538.474670, 0.153023, -518.694641,
-538.752563, 0.170393, -517.643005,
-538.969421, 0.183949, -516.577148,
-539.157410, 0.272568, -515.513428,
-539.318237, 0.485071, -514.458435,
-539.542297, 0.803161, -512.873474,
-539.692932, 0.970816, -511.811584,
-539.838379, 1.181126, -510.753571,
-540.765686, 2.421811, -503.992981,
-540.907532, 2.391479, -502.915649,
-541.162781, 2.543372, -500.897217,
-541.213013, 2.639980, -499.816193,
-541.198853, 2.814182, -498.741730,
-541.153137, 2.989250, -497.668915,
-541.090637, 3.167528, -496.597382,
-540.901733, 3.472016, -493.766296,
-539.946655, 3.986804, -480.899536,
-539.758118, 3.963221, -479.829315,
-539.464539, 3.926524, -478.782715,
-539.127625, 3.884508, -477.750854,
-538.753662, 4.055820, -476.738281,
-538.086609, 4.375992, -474.991974,
-535.247925, 5.074961, -467.828430,
-534.701660, 5.041934, -466.858551,
-533.907593, 5.008235, -466.119568,
-532.972717, 4.975322, -465.566498,
-531.983582, 4.943339, -465.114624,
-530.979858, 4.951505, -464.695160,
-529.968079, 4.959478, -464.295441,
-528.951843, 4.983376, -463.907593,
-522.430969, 3.916511, -461.465240,
-521.404968, 3.857628, -461.086182,
-520.377686, 3.902210, -460.729462,
-519.369934, 3.953047, -460.322479,
-518.443848, 3.963709, -459.761841,
-517.644409, 3.968113, -459.040253,
-516.927307, 4.138369, -458.245422,
-516.257751, 4.275104, -457.397705,
-515.619324, 4.360233, -456.520050,
-514.989380, 4.372784, -455.633331,
-514.354065, 4.148522, -454.766449,
-513.569702, 3.888090, -453.690735,
-512.848206, 3.701035, -452.650909,
-512.268372, 3.550035, -451.781738,
-511.656403, 3.532558, -450.883881,
-510.565186, 3.495838, -449.323639,
-509.924683, 3.478686, -448.444824,
-509.263702, 3.481614, -447.580719,
-508.588806, 3.498191, -446.727631,
-507.732697, 3.521606, -445.671478,
-504.967285, 3.235765, -442.320770,
-504.184204, 3.426662, -441.405670,
-503.524536, 3.552731, -440.548615,
-502.838013, 3.638559, -439.709167,
-499.995270, 3.863406, -436.248932,
-499.458771, 3.631288, -435.332092,
-499.354584, 3.427225, -434.275543,
-499.518890, 3.263798, -433.213623,
-499.786255, 3.119409, -432.168945,
-500.093414, 2.942964, -431.138855,
-500.416901, 2.698143, -430.129211,
-500.756897, 2.452024, -429.125366,
-501.102753, 2.205250, -428.123657,
-501.993927, 1.130284, -425.598083,
-502.375153, 0.625838, -424.550262,
-502.760925, 0.259216, -423.439453,
-503.125061, -0.073914, -422.319733,
-503.344879, -0.434069, -421.301147,
-503.392548, -0.782053, -420.267029,
-503.345978, -1.156086, -419.237427,
-503.275909, -1.517113, -418.212494,
-503.200043, -1.875748, -417.190155,
-503.092529, -2.185827, -416.171051,
-501.571167, -5.735084, -403.501678,
-501.418823, -6.069547, -402.475281,
-501.176941, -6.153698, -401.405243,
-500.898254, -6.118875, -400.354431,
-500.586060, -6.079853, -399.313019,
-500.255157, -6.038494, -398.277283,
-499.919769, -5.917615, -397.250214,
-498.133850, -5.162109, -391.881653,
-497.607086, -5.099213, -390.933563,
-496.951874, -5.030679, -390.068451,
-496.247040, -4.960183, -389.242767,
-495.526642, -4.922899, -388.429321,
-494.798859, -4.939609, -387.620911,
-494.057587, -4.973323, -386.825287,
-493.242004, -5.007064, -386.107086,
-492.357513, -5.040519, -385.475281,
-491.422150, -5.050906, -384.920258,
-490.463867, -5.046978, -384.405090,
-489.496246, -5.027953, -383.907104,
-488.524017, -5.008810, -383.419098,
-483.903564, -5.444798, -381.144897,
-482.970856, -5.764278, -380.673676,
-482.046753, -6.081060, -380.195770,
-481.059265, -6.036974, -379.756531,
-480.068268, -6.092669, -379.310974,
-478.083740, -6.252785, -378.424103,
-475.939850, -5.600721, -377.478241,
-474.095123, -5.269806, -376.659973,
-472.988983, -5.088950, -376.167572,
-471.997314, -4.996942, -375.725739,
-467.519684, -5.021126, -373.745483,
-466.568787, -4.988472, -373.221497,
-465.785889, -4.954824, -372.473022,
-465.155731, -4.938012, -371.586975,
-464.613434, -4.943035, -370.644104,
-464.112732, -4.970317, -369.678741,
-463.636993, -5.030797, -368.702332,
-463.174835, -5.119479, -367.720856,
-462.721741, -5.261708, -366.742218,
-461.430298, -5.878856, -363.953918,
-460.990692, -5.964869, -362.965485,
-459.656555, -6.049467, -359.997162,
-459.353271, -6.087378, -358.954742,
-459.191864, -6.107553, -357.879517,
-459.106384, -6.118238, -356.795227,
-459.081055, -6.089601, -355.710297,
-459.074738, -5.935709, -354.633362,
-459.104004, -5.658697, -351.932465,
-459.120667, -5.591868, -350.846558,
-459.187042, -5.479144, -346.507324,
-459.430115, -5.749809, -332.941071,
-459.453735, -5.802073, -331.854553,
-459.471832, -5.754164, -330.767517,
-459.490845, -5.694329, -329.681580,
-459.512299, -5.627197, -328.459930,
-459.529968, -5.682715, -327.376678,
-459.596893, -6.022334, -323.863861,
-459.627655, -6.068361, -321.961487,
-459.653656, -6.049818, -320.465668,
-459.672607, -6.047450, -319.377808,
-459.690857, -6.045168, -318.289795,
-459.733826, -6.098748, -317.204376,
-459.866302, -6.163945, -316.126587,
-460.061859, -6.354894, -315.070129,
-460.284729, -6.588387, -314.031128,
-460.533112, -6.826213, -312.999054,
-460.823303, -7.095395, -311.840057,
-462.704620, -9.301330, -304.645416,
-462.954193, -9.692020, -303.546783,
-463.049988, -10.017150, -302.513519,
-463.025604, -10.351537, -301.479034,
-462.936340, -10.689318, -300.448883,
-462.818665, -11.044333, -299.424500,
-462.686890, -11.409551, -298.408417,
-462.388000, -12.191285, -296.252502,
-460.616119, -15.430405, -284.034149,
-460.460663, -15.766811, -283.004272,
-460.297577, -16.098799, -281.981476,
-460.138611, -16.023895, -280.905792,
-459.880035, -16.021536, -279.850311,
-459.524323, -16.066000, -278.793884,
-459.151947, -16.112444, -277.774414,
-458.760895, -15.948345, -276.768036,
-457.728149, -15.418857, -274.162994,
-457.121918, -15.183194, -272.663147,
-455.141998, -14.929026, -267.753723,
-454.605865, -14.961267, -266.809937,
-453.910492, -14.994783, -265.975586,
-453.106659, -15.028536, -265.243866,
-452.248810, -15.071724, -264.575989,
-451.363373, -15.070765, -263.944366,
-450.467194, -15.049448, -263.327393,
-449.339539, -15.027678, -262.566895,
-446.158661, -15.106158, -260.478607,
-445.146484, -15.217936, -260.096680,
-444.094391, -15.313764, -259.845978,
-443.059662, -15.693615, -259.832489,
-442.038452, -16.061672, -259.905914,
-440.926056, -16.011379, -259.961243,
-439.853027, -16.029181, -259.818878,
-438.834473, -16.076151, -259.442963,
-437.860443, -16.135080, -258.975220,
-436.944824, -15.842243, -258.482483,
-436.029755, -15.561083, -257.958588,
-435.103333, -15.389626, -257.408356,
-433.018707, -15.096863, -256.158447,
-423.253204, -15.007891, -250.244461,
-422.581299, -15.076889, -249.399033,
-422.162994, -15.134439, -248.398422,
-421.907043, -15.243899, -247.346481,
-421.727417, -15.378567, -246.282013,
-421.576630, -15.511925, -245.212921,
-421.436920, -15.814054, -244.166107,
-421.312561, -15.977121, -243.104950,
-421.161774, -16.151787, -241.633881,
-421.101837, -16.144278, -240.547592,
-421.054230, -16.138294, -239.460739,
-420.986694, -16.129854, -237.557938,
-420.237152, -15.986206, -212.018356,
-420.191437, -15.916931, -210.797974,
-420.120667, -15.789013, -207.812439,
-420.097992, -15.820995, -206.456985,
-419.913025, -16.017410, -199.259720,
-420.074188, -16.138962, -198.186157,
-420.394592, -15.806675, -197.200790,
-420.823639, -15.475427, -196.257751,
-421.315735, -15.246454, -195.308350,
-421.840698, -15.131503, -194.360291,
-422.374817, -15.078588, -193.413864,
-424.067291, -15.028349, -190.467560,
-427.695129, -14.944219, -184.241776,
-428.330750, -15.027770, -183.363968,
-429.060547, -15.124342, -182.563538,
-429.847046, -15.204210, -181.816025,
-430.657654, -15.276329, -181.094086,
-431.483185, -15.340816, -180.388275,
-432.919403, -15.584278, -179.168777,
-446.700073, -18.848972, -167.730667,
-447.838928, -18.971676, -166.769211,
-450.328156, -19.379137, -164.696960,
-451.060272, -19.534018, -163.909332,
-451.625610, -19.500000, -162.980560,
-452.083923, -19.517031, -161.994354,
-452.476959, -19.566160, -160.981140,
-452.841187, -19.611700, -159.956909,
-453.191650, -19.646599, -158.927551,
-454.367828, -19.964460, -155.331253,
-455.293671, -20.791029, -152.456436,
-455.619934, -20.976021, -151.448273,
-460.864044, -21.582912, -135.124496,
-461.198395, -21.523344, -134.089920,
-463.464020, -20.982677, -127.008972,
-463.628113, -20.996647, -125.935585,
-463.609283, -21.038952, -124.848961,
-463.521912, -21.146475, -123.767731,
-463.400543, -21.146563, -122.686722,
-463.201691, -21.188892, -121.067558,
-463.072876, -21.257940, -119.990120,
-462.932098, -21.293131, -118.911903,
-460.858124, -21.810720, -103.154648,
-460.394226, -21.855116, -102.181808,
-459.633484, -21.864172, -101.409859,
-458.751892, -21.805742, -100.775322,
-457.821533, -21.747103, -100.215164,
-456.871063, -21.669014, -99.690086,
-455.908997, -21.711084, -99.185425,
-452.652191, -21.466049, -97.507286,
-427.503632, -19.772459, -84.766029,
-426.533905, -19.798971, -84.273788,
-424.118073, -20.060156, -83.055641,
-423.148651, -19.991360, -82.567337
};
-----------------------------------
-- onSpawn Action
-----------------------------------
function onSpawn(npc)
npc:initNpcAi();
npc:setPos(pathfind.first(path));
onPath(npc);
end;
-----------------------------------
-- onPath Action
-----------------------------------
function onPath(npc)
if (npc:atPoint(pathfind.get(path, 288))) then
local Colmaie = GetNPCByID(npc:getID() + 4);
Colmaie:showText(npc, ZOVRIACE_REPORT);
-- small delay after path finish
npc:wait(8000);
end
pathfind.patrol(npc, path);
end;
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
player:showText(npc, ZOVRIACE_DIALOG);
npc:wait();
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 |
m241dan/darkstar | scripts/zones/Lufaise_Meadows/TextIDs.lua | 15 | 1194 | -- Variable TextID Description text
-- General Texts
ITEM_CANNOT_BE_OBTAINED = 6379; -- You cannot obtain the item <item>. Come back after sorting your inventory.
ITEM_OBTAINED = 6384; -- Obtained: <item>.
GIL_OBTAINED = 6385; -- Obtained <number> gil.
KEYITEM_OBTAINED = 6387; -- Obtained key item: <keyitem>.
NOTHING_OUT_OF_THE_ORDINARY = 6398; -- There is nothing out of the ordinary here.
FISHING_MESSAGE_OFFSET = 7547; -- You can't fish here.
-- Conquest
CONQUEST = 7213; -- You've earned conquest points!
-- Logging
LOGGING_IS_POSSIBLE_HERE = 7719; -- Logging is possible here if you have
-- Other Texts
SURVEY_THE_SURROUNDINGS = 7726; -- You survey the surroundings but see nothing out of the ordinary.
MURDEROUS_PRESENCE = 7727; -- Wait, you sense a murderous presence...!
YOU_CAN_SEE_FOR_MALMS = 7728; -- You can see for malms in every direction.
SPINE_CHILLING_PRESENCE = 7730; -- You sense a spine-chilling presence!
KI_STOLEN = 7671; -- The ?Possible Special Code: 01??Possible Special Code: 05?3??BAD CHAR: 80??BAD CHAR: 80? has been stolen!
-- conquest Base
CONQUEST_BASE = 7045; -- Tallying conquest results...
| gpl-3.0 |
dvr333/Zero-K | units/shieldaa.lua | 3 | 3870 | return { shieldaa = {
unitname = [[shieldaa]],
name = [[Vandal]],
description = [[Anti-Air Bot]],
acceleration = 1.35,
brakeRate = 8.1,
buildCostMetal = 90,
buildPic = [[shieldaa.png]],
canGuard = true,
canMove = true,
canPatrol = true,
category = [[LAND]],
collisionVolumeOffsets = [[0 -4 0]],
collisionVolumeScales = [[30 40 30]],
collisionVolumeType = [[ellipsoid]],
corpse = [[DEAD]],
customParams = {
bait_level_default = 0,
},
explodeAs = [[BIG_UNITEX]],
footprintX = 2,
footprintZ = 2,
iconType = [[walkeraa]],
idleAutoHeal = 5,
idleTime = 1800,
leaveTracks = true,
maxDamage = 650,
maxSlope = 36,
maxVelocity = 2.7,
maxWaterDepth = 22,
movementClass = [[KBOT2]],
moveState = 0,
noChaseCategory = [[TERRAFORM LAND SINK TURRET SHIP SWIM FLOAT SUB HOVER]],
objectName = [[crasher.s3o]],
script = [[shieldaa.lua]],
selfDestructAs = [[BIG_UNITEX]],
sfxtypes = {
explosiongenerators = {
[[custom:CRASHMUZZLE]],
},
},
sightDistance = 660,
trackOffset = 0,
trackStrength = 8,
trackStretch = 1,
trackType = [[ComTrack]],
trackWidth = 22,
turnRate = 2640,
upright = true,
weapons = {
{
def = [[ARMKBOT_MISSILE]],
--badTargetCategory = [[GUNSHIP]],
onlyTargetCategory = [[GUNSHIP FIXEDWING]],
},
},
weaponDefs = {
ARMKBOT_MISSILE = {
name = [[Homing Missiles]],
areaOfEffect = 48,
canattackground = false,
cegTag = [[missiletrailblue]],
craterBoost = 1,
craterMult = 2,
cylinderTargeting = 1,
customParams = {
burst = Shared.BURST_RELIABLE,
isaa = [[1]],
light_color = [[0.5 0.6 0.6]],
light_radius = 380,
},
damage = {
default = 7.2,
planes = 72,
},
explosionGenerator = [[custom:FLASH2]],
fireStarter = 70,
flightTime = 3,
impulseBoost = 0,
impulseFactor = 0.4,
interceptedByShieldType = 2,
model = [[wep_m_fury.s3o]], -- Model radius 150 for QuadField fix.
noSelfDamage = true,
range = 900,
reloadtime = 2,
smokeTrail = true,
soundHit = [[weapon/missile/rocket_hit]],
soundStart = [[weapon/missile/missile_fire7]],
startVelocity = 650,
texture1 = [[flarescale01]],
texture2 = [[AAsmoketrail]],
tolerance = 9000,
tracks = true,
turnRate = 63000,
turret = true,
weaponAcceleration = 141,
weaponType = [[MissileLauncher]],
weaponVelocity = 850,
},
},
featureDefs = {
DEAD = {
blocking = true,
featureDead = [[HEAP]],
footprintX = 2,
footprintZ = 2,
object = [[crasher_dead.s3o]],
},
HEAP = {
blocking = false,
footprintX = 2,
footprintZ = 2,
object = [[debris2x2a.s3o]],
},
},
} }
| gpl-2.0 |
m241dan/darkstar | scripts/globals/mobskills/Crystal_Weapon.lua | 37 | 1031 | ---------------------------------------------
-- Crystal Weapon
--
-- Description: Invokes the power of a crystal to deal magical damage of a random element to a single target.
-- Type: Magical
-- Utsusemi/Blink absorb: Ignores shadows
-- Range: Unknown
-- Notes: Can be Fire, Earth, Wind, or Water element. Functions even at a distance (outside of melee range).
---------------------------------------------
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 element = math.random(6,9);
local dmgmod = 1;
local accmod = 1;
local info = MobMagicalMove(mob,target,skill,mob:getWeaponDmg() * 5,accmod,dmgmod,TP_MAB_BONUS,1);
local dmg = MobFinalAdjustments(info.dmg,mob,skill,target,MOBSKILL_MAGICAL,element,MOBPARAM_IGNORE_SHADOWS);
target:delHP(dmg);
return dmg;
end;
| gpl-3.0 |
m241dan/darkstar | scripts/globals/items/blackened_toad.lua | 18 | 1358 | -----------------------------------------
-- ID: 4599
-- Item: Blackened Toad
-- Food Effect: 180Min, All Races
-----------------------------------------
-- Dexterity 2
-- Agility 2
-- Mind -1
-- Poison 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,10800,4599);
end;
-----------------------------------------
-- onEffectGain Action
-----------------------------------------
function onEffectGain(target,effect)
target:addMod(MOD_DEX, 2);
target:addMod(MOD_AGI, 2);
target:addMod(MOD_MND, -1);
target:addMod(MOD_POISONRES, 5);
end;
-----------------------------------------
-- onEffectLose Action
-----------------------------------------
function onEffectLose(target,effect)
target:delMod(MOD_DEX, 2);
target:delMod(MOD_AGI, 2);
target:delMod(MOD_MND, -1);
target:delMod(MOD_POISONRES, 5);
end;
| gpl-3.0 |
m241dan/darkstar | scripts/globals/weaponskills/skewer.lua | 11 | 1366 | -----------------------------------
-- Skewer
-- Polearm weapon skill
-- Skill Level: 200
-- Delivers a three-hit attack. Chance of params.critical hit varies with TP.
-- Will stack with Sneak Attack.
-- Aligned with the Light Gorget & Thunder Gorget.
-- Aligned with the Light Belt & Thunder Belt.
-- Element: None
-- Modifiers: STR:50%
-- 100%TP 200%TP 300%TP
-- 1.00 1.00 1.00
-----------------------------------
require("scripts/globals/status");
require("scripts/globals/settings");
require("scripts/globals/weaponskills");
-----------------------------------
function onUseWeaponSkill(player, target, wsID, tp, primary)
local params = {};
params.numHits = 3;
params.ftp100 = 1; params.ftp200 = 1; params.ftp300 = 1;
params.str_wsc = 0.35; params.dex_wsc = 0.0; params.vit_wsc = 0.0; params.agi_wsc = 0.0; params.int_wsc = 0.0; params.mnd_wsc = 0.0; params.chr_wsc = 0.0;
params.crit100 = 0.1; params.crit200 = 0.3; params.crit300 = 0.5;
params.canCrit = true;
params.acc100 = 0.0; params.acc200= 0.0; params.acc300= 0.0;
params.atkmulti = 1;
if (USE_ADOULIN_WEAPON_SKILL_CHANGES == true) then
params.str_wsc = 0.5;
end
local damage, criticalHit, tpHits, extraHits = doPhysicalWeaponskill(player, target, wsID, params, tp, primary);
return tpHits, extraHits, criticalHit, damage;
end
| gpl-3.0 |
m241dan/darkstar | scripts/zones/Lower_Jeuno/npcs/Subash.lua | 13 | 1026 | ----------------------------------
-- Area: Lower Jeuno
-- NPC: Subash
-- Type: Item Deliverer
-- @zone: 245
-- @pos -19.84 -0.101 -38.081
--
-----------------------------------
package.loaded["scripts/zones/Lower_Jeuno/TextIDs"] = nil;
require("scripts/zones/Lower_Jeuno/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
player:showText(npc, ITEM_DELIVERY_DIALOG);
player:openSendBox();
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 |
santssoft/darkstar | scripts/zones/Horlais_Peak/bcnms/under_observation.lua | 9 | 1064 | -----------------------------------
-- Under Observation
-- Horlais Peak BCNM40, Star Orb
-- !additem 1131
-----------------------------------
require("scripts/globals/battlefield")
-----------------------------------
function onBattlefieldInitialise(battlefield)
battlefield:setLocalVar("loot", 1)
end
function onBattlefieldTick(battlefield, tick)
dsp.battlefield.onBattlefieldTick(battlefield, tick)
end
function onBattlefieldRegister(player, battlefield)
end
function onBattlefieldEnter(player, battlefield)
end
function onBattlefieldLeave(player, battlefield, leavecode)
if leavecode == dsp.battlefield.leaveCode.WON then
local name, clearTime, partySize = battlefield:getRecord()
player:startEvent(32001, battlefield:getArea(), clearTime, partySize, battlefield:getTimeInside(), 1, battlefield:getLocalVar("[cs]bit"), 0)
elseif leavecode == dsp.battlefield.leaveCode.LOST then
player:startEvent(32002)
end
end
function onEventUpdate(player, csid, option)
end
function onEventFinish(player, csid, option)
end
| gpl-3.0 |
santssoft/darkstar | scripts/zones/Beaucedine_Glacier/npcs/Torino-Samarino.lua | 9 | 2648 | -----------------------------------
-- Area: Beaucedine Glacier
-- NPC: Torino-Samarino
-- Type: Quest NPC
-- Involved in Quests: Curses, Foiled A-Golem!?, Tuning Out
-- !pos 105 -20 140 111
-----------------------------------
require("scripts/globals/quests");
require("scripts/globals/settings");
local ID = require("scripts/zones/Beaucedine_Glacier/IDs");
require("scripts/globals/keyitems");
-----------------------------------
function onTrade(player,npc,trade)
end;
function onTrigger(player,npc)
local FoiledAGolem = player:getQuestStatus(WINDURST,dsp.quest.id.windurst.CURSES_FOILED_A_GOLEM);
-- Curses, Foiled A_Golem!?
if (player:hasKeyItem(dsp.ki.SHANTOTTOS_EXSPELL) and FoiledAGolem == QUEST_ACCEPTED) then
player:startEvent(108); -- key item taken, wait one game day for new spell
elseif (player:getCharVar("golemwait") == 1 and FoiledAGolem == QUEST_ACCEPTED) then
local gDay = VanadielDayOfTheYear();
local gYear = VanadielYear();
local dFinished = player:getCharVar("golemday");
local yFinished = player:getCharVar("golemyear");
if (gDay == dFinished and gYear == yFinished) then
player:startEvent(113); -- re-write reminder
elseif (gDay == dFinished + 1 and gYear == yFinished) then
player:startEvent(109); -- re-write done
end
elseif (player:getCharVar("foiledagolemdeliverycomplete") == 1) then
player:startEvent(110); -- talk to Shantotto reminder
elseif (FoiledAGolem == QUEST_ACCEPTED) then
player:startEvent(104); -- receive key item
else
player:startEvent(101); -- standard dialog
end
end;
function onEventUpdate(player,csid,option)
end;
function onEventFinish(player,csid,option)
-- Curses, Foiled A_Golem!?
if (csid == 104 and option == 1) then
player:addKeyItem(dsp.ki.SHANTOTTOS_NEW_SPELL);
player:messageSpecial(ID.text.KEYITEM_OBTAINED,dsp.ki.SHANTOTTOS_NEW_SPELL); -- add new spell key item
elseif (csid == 108) then -- start wait for new scroll
player:delKeyItem(dsp.ki.SHANTOTTOS_EXSPELL);
player:setCharVar("golemday",VanadielDayOfTheYear());
player:setCharVar("golemyear",VanadielYear());
player:setCharVar("golemwait",1);
elseif (csid == 109) then
player:addKeyItem(dsp.ki.SHANTOTTOS_NEW_SPELL);
player:messageSpecial(ID.text.KEYITEM_OBTAINED,dsp.ki.SHANTOTTOS_NEW_SPELL); -- add new spell key item
player:setCharVar("golemday",0);
player:setCharVar("golemyear",0);
player:setCharVar("golemwait",0);
end
end; | gpl-3.0 |
ILiebhardt/darktable | tools/lua_doc/old_api/dt_api202.lua | 7 | 170644 | API = {
["__text"] = [[This documentation is for the *development* version of darktable. for the stable version, please visit the user manual
To access the darktable specific functions you must load the darktable environment:<code>darktable = require "darktable"</code>All functions and data are accessed through the darktable module.
This documentation for API version 2.0.2.]],
["__attributes"] = {
["reported_type"] = [[documentation node]],
},
["darktable"] = {
["__text"] = [[The darktable library is the main entry point for all access to the darktable internals.]],
["__attributes"] = {
["reported_type"] = [[documentation node]],
},
["print"] = {
["__text"] = [[Will print a string to the darktable control log (the long overlaid window that appears over the main panel).]],
["__attributes"] = {
["reported_type"] = [[function]],
["signature"] = {
["1"] = {
["__text"] = [[The string to display which should be a single line.]],
["__attributes"] = {
["reported_type"] = [[string]],
},
},
},
},
},
["print_error"] = {
["__text"] = [[This function will print its parameter if the Lua logdomain is activated. Start darktable with the "-d lua" command line option to enable the Lua logdomain.]],
["__attributes"] = {
["reported_type"] = [[function]],
["signature"] = {
["1"] = {
["__text"] = [[The string to display.]],
["__attributes"] = {
["reported_type"] = [[string]],
},
},
},
},
},
["register_event"] = {
["__text"] = [[This function registers a callback to be called when a given event happens.
Events are documented in the event section.]],
["__attributes"] = {
["reported_type"] = [[function]],
["signature"] = {
["1"] = {
["__text"] = [[The name of the event to register to.]],
["__attributes"] = {
["reported_type"] = [[string]],
},
},
["2"] = {
["__text"] = [[The function to call on event. The signature of the function depends on the type of event.]],
["__attributes"] = {
["reported_type"] = [[function]],
},
},
["3"] = {
["__text"] = [[Some events need extra parameters at registration time; these must be specified here.]],
["__attributes"] = {
["reported_type"] = [[variable]],
},
},
},
},
},
["register_storage"] = {
["__text"] = [[This function will add a new storage implemented in Lua.
A storage is a module that is responsible for handling images once they have been generated during export. Examples of core storages include filesystem, e-mail, facebook...]],
["__attributes"] = {
["reported_type"] = [[function]],
["signature"] = {
["1"] = {
["__text"] = [[A Unique name for the plugin.]],
["__attributes"] = {
["reported_type"] = [[string]],
},
},
["2"] = {
["__text"] = [[A human readable name for the plugin.]],
["__attributes"] = {
["reported_type"] = [[string]],
},
},
["3"] = {
["__text"] = [[This function is called once for each exported image. Images can be exported in parallel but the calls to this function will be serialized.]],
["__attributes"] = {
["optional"] = true,
["reported_type"] = [[function]],
["signature"] = {
["1"] = {
["__text"] = [[The storage object used for the export.]],
["__attributes"] = {
["reported_type"] = {
["__text"] = [[A virtual type representing all storage types.]],
["__attributes"] = {
["has_pairs"] = true,
["reported_type"] = [[dt_type]],
},
["plugin_name"] = {
["__text"] = [[A unique name for the plugin.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[string]],
["write"] = true,
},
},
["name"] = {
["__text"] = [[A human readable name for the plugin.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[string]],
["write"] = true,
},
},
["width"] = {
["__text"] = [[The currently selected width for the plugin.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[number]],
["write"] = true,
},
},
["height"] = {
["__text"] = [[The currently selected height for the plugin.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[number]],
["write"] = true,
},
},
["recommended_width"] = {
["__text"] = [[The recommended width for the plugin.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[number]],
["write"] = true,
},
},
["recommended_height"] = {
["__text"] = [[The recommended height for the plugin.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[number]],
["write"] = true,
},
},
["supports_format"] = {
["__text"] = [[Checks if a format is supported by this storage.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[function]],
["ret_val"] = {
["__text"] = [[True if the format is supported by the storage.]],
["__attributes"] = {
["reported_type"] = [[boolean]],
},
},
["signature"] = {
["1"] = {
["__text"] = [[The storage type to check against.]],
["__attributes"] = {
["is_self"] = true,
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
},
},
["2"] = {
["__text"] = [[The format type to check.]],
["__attributes"] = {
["reported_type"] = {
["__text"] = [[A virtual type representing all format types.]],
["__attributes"] = {
["has_pairs"] = true,
["reported_type"] = [[dt_type]],
},
["plugin_name"] = {
["__text"] = [[A unique name for the plugin.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[string]],
},
},
["name"] = {
["__text"] = [[A human readable name for the plugin.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[string]],
},
},
["extension"] = {
["__text"] = [[The typical filename extension for that format.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[string]],
},
},
["mime"] = {
["__text"] = [[The mime type associated with the format.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[string]],
},
},
["max_width"] = {
["__text"] = [[The max width allowed for the format (0 = unlimited).]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[number]],
["write"] = true,
},
},
["max_height"] = {
["__text"] = [[The max height allowed for the format (0 = unlimited).]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[number]],
["write"] = true,
},
},
["write_image"] = {
["__text"] = [[Exports an image to a file. This is a blocking operation that will not return until the image is exported.]],
["__attributes"] = {
["implicit_yield"] = true,
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[function]],
["ret_val"] = {
["__text"] = [[Returns true on success.]],
["__attributes"] = {
["reported_type"] = [[boolean]],
},
},
["signature"] = {
["1"] = {
["__text"] = [[The format that will be used to export.]],
["__attributes"] = {
["is_self"] = true,
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
["2"] = {
["__text"] = [[The image object to export.]],
["__attributes"] = {
["reported_type"] = {
["__text"] = [[Image objects represent an image in the database. This is slightly different from a file on disk since a file can have multiple developments.
Note that this is the real image object; changing the value of a field will immediately change it in darktable and will be reflected on any copy of that image object you may have kept.]],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["reported_type"] = [[dt_type]],
},
["attach_tag"] = {
["__text"] = [[Attach a tag to an image; the order of the parameters can be reversed.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[function]],
["signature"] = {
["1"] = {
["__text"] = [[The tag to be attached.]],
["__attributes"] = {
["reported_type"] = {
["__text"] = [[A tag that can be attached to an image.]],
["__attributes"] = {
["has_ipairs"] = true,
["has_length"] = true,
["has_pairs"] = true,
["has_tostring"] = true,
["reported_type"] = [[dt_type]],
},
["delete"] = {
["__text"] = [[Deletes the tag object, detaching it from all images.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[function]],
["signature"] = {
["1"] = {
["__text"] = [[The tag to be deleted.]],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["attach_tag"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
},
},
},
},
},
["attach"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["attach_tag"]]=],
["detach"] = {
["__text"] = [[Detach a tag from an image; the order of the parameters can be reversed.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[function]],
["signature"] = {
["1"] = {
["__text"] = [[The tag to be detached.]],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["attach_tag"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
},
},
["2"] = {
["__text"] = [[The image to detach the tag from.]],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
},
},
},
["name"] = {
["__text"] = [[The name of the tag.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[string]],
},
},
["#"] = {
["__text"] = [[The images that have that tag attached to them.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
},
},
},
["2"] = {
["__text"] = [[The image to attach the tag to.]],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
},
},
},
["detach_tag"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["attach_tag"].__attributes["signature"]["1"].__attributes["reported_type"]["detach"]]=],
["get_tags"] = {
["__text"] = [[Gets all tags attached to an image.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[function]],
["ret_val"] = {
["__text"] = [[A table of tags that are attached to the image.]],
["__attributes"] = {
["reported_type"] = [[table of types.dt_lua_tag_t]],
},
},
["signature"] = {
["1"] = {
["__text"] = [[The image to get the tags from.]],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
},
},
},
["create_style"] = {
["__text"] = [[Create a new style based on an image.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[function]],
["ret_val"] = {
["__text"] = [[The new style object.]],
["__attributes"] = {
["reported_type"] = {
["__text"] = [[A style that can be applied to an image.]],
["__attributes"] = {
["has_ipairs"] = true,
["has_length"] = true,
["has_pairs"] = true,
["has_tostring"] = true,
["reported_type"] = [[dt_type]],
},
["delete"] = {
["__text"] = [[Deletes an existing style.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[function]],
["signature"] = {
["1"] = {
["__text"] = [[the style to delete]],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"].__attributes["ret_val"].__attributes["reported_type"]]=],
},
},
},
},
},
["duplicate"] = {
["__text"] = [[Create a new style based on an existing style.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[function]],
["ret_val"] = {
["__text"] = [[The new style object.]],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"].__attributes["ret_val"].__attributes["reported_type"]]=],
},
},
["signature"] = {
["1"] = {
["__text"] = [[The style to base the new style on.]],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"].__attributes["ret_val"].__attributes["reported_type"]]=],
},
},
["2"] = {
["__text"] = [[The new style's name.]],
["__attributes"] = {
["reported_type"] = [[string]],
},
},
["3"] = {
["__text"] = [[The new style's description.]],
["__attributes"] = {
["reported_type"] = [[string]],
},
},
},
},
},
["apply"] = {
["__text"] = [[Apply a style to an image. The order of parameters can be inverted.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[function]],
["signature"] = {
["1"] = {
["__text"] = [[The style to use.]],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"].__attributes["ret_val"].__attributes["reported_type"]]=],
},
},
["2"] = {
["__text"] = [[The image to apply the style to.]],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
},
},
},
["export"] = {
["__text"] = [[Export a style to an external .dtstyle file]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[function]],
["signature"] = {
["1"] = {
["__text"] = [[The style to export]],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"].__attributes["ret_val"].__attributes["reported_type"]]=],
},
},
["2"] = {
["__text"] = [[The directory to export to]],
["__attributes"] = {
["reported_type"] = [[string]],
},
},
["3"] = {
["__text"] = [[Is overwriting an existing file allowed]],
["__attributes"] = {
["reported_type"] = [[boolean]],
},
},
},
},
},
["name"] = {
["__text"] = [[The name of the style.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[string]],
},
},
["description"] = {
["__text"] = [[The description of the style.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[string]],
},
},
["#"] = {
["__text"] = [[The different items that make the style.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = {
["__text"] = [[An element that is part of a style.]],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["reported_type"] = [[dt_type]],
},
["name"] = {
["__text"] = [[The name of the style item.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[string]],
},
},
["num"] = {
["__text"] = [[The position of the style item within its style.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[number]],
},
},
},
},
},
},
},
},
["signature"] = {
["1"] = {
["__text"] = [[The image to create the style from.]],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
["2"] = {
["__text"] = [[The name to give to the new style.]],
["__attributes"] = {
["reported_type"] = [[string]],
},
},
["3"] = {
["__text"] = [[The description of the new style.]],
["__attributes"] = {
["reported_type"] = [[string]],
},
},
},
},
},
["apply_style"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"].__attributes["ret_val"].__attributes["reported_type"]["apply"]]=],
["duplicate"] = {
["__text"] = [[Creates a duplicate of an image and returns it.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[function]],
["ret_val"] = {
["__text"] = [[The created image if an image is imported or the toplevel film object if a film was imported.]],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
["signature"] = {
["1"] = {
["__text"] = [[the image to duplicate]],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
},
},
},
["move"] = {
["__text"] = [[Physically moves an image (and all its duplicates) to another film.
This will move the image file, the related XMP and all XMP for the duplicates to the directory of the new film
Note that the parameter order is not relevant.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[function]],
["signature"] = {
["1"] = {
["__text"] = [[The image to move]],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
["2"] = {
["__text"] = [[The film to move to]],
["__attributes"] = {
["reported_type"] = {
["__text"] = [[A film in darktable; this represents a directory containing imported images.]],
["__attributes"] = {
["has_ipairs"] = true,
["has_length"] = true,
["has_pairs"] = true,
["has_tostring"] = true,
["reported_type"] = [[dt_type]],
},
["move_image"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["move"]]=],
["copy_image"] = {
["__text"] = [[Physically copies an image to another film.
This will copy the image file and the related XMP to the directory of the new film
If there is already a file with the same name as the image file, it will create a duplicate from that file instead
Note that the parameter order is not relevant.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[function]],
["ret_val"] = {
["__text"] = [[The new image]],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
["signature"] = {
["1"] = {
["__text"] = [[The image to copy]],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
["2"] = {
["__text"] = [[The film to copy to]],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["move"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
},
},
},
["#"] = {
["__text"] = [[The different images within the film.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
["id"] = {
["__text"] = [[A unique numeric id used by this film.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[number]],
["write"] = true,
},
},
["path"] = {
["__text"] = [[The path represented by this film.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[string]],
["write"] = true,
},
},
["delete"] = {
["__text"] = [[Removes the film from the database.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[function]],
["signature"] = {
["1"] = {
["__text"] = [[The film to remove.]],
["__attributes"] = {
["is_self"] = true,
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["move"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
["2"] = {
["__text"] = [[Force removal, even if the film is not empty.]],
["__attributes"] = {
["optional"] = true,
["reported_type"] = [[Boolean]],
},
},
},
},
},
},
},
},
},
},
},
["copy"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["move"].__attributes["signature"]["2"].__attributes["reported_type"]["copy_image"]]=],
["id"] = {
["__text"] = [[A unique id identifying the image in the database.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[number]],
},
},
["path"] = {
["__text"] = [[The file the directory containing the image.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[string]],
},
},
["film"] = {
["__text"] = [[The film object that contains this image.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["move"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
["filename"] = {
["__text"] = [[The filename of the image.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[string]],
},
},
["duplicate_index"] = {
["__text"] = [[If there are multiple images based on a same file, each will have a unique number, starting from 0.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[number]],
},
},
["publisher"] = {
["__text"] = [[The publisher field of the image.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[string]],
["write"] = true,
},
},
["title"] = {
["__text"] = [[The title field of the image.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[string]],
["write"] = true,
},
},
["creator"] = {
["__text"] = [[The creator field of the image.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[string]],
["write"] = true,
},
},
["rights"] = {
["__text"] = [[The rights field of the image.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[string]],
["write"] = true,
},
},
["description"] = {
["__text"] = [[The description field for the image.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[string]],
["write"] = true,
},
},
["exif_maker"] = {
["__text"] = [[The maker exif data.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[string]],
["write"] = true,
},
},
["exif_model"] = {
["__text"] = [[The camera model used.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[string]],
["write"] = true,
},
},
["exif_lens"] = {
["__text"] = [[The id string of the lens used.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[string]],
["write"] = true,
},
},
["exif_aperture"] = {
["__text"] = [[The aperture saved in the exif data.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[number]],
["write"] = true,
},
},
["exif_exposure"] = {
["__text"] = [[The exposure time of the image.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[number]],
["write"] = true,
},
},
["exif_focal_length"] = {
["__text"] = [[The focal length of the image.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[number]],
["write"] = true,
},
},
["exif_iso"] = {
["__text"] = [[The iso used on the image.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[number]],
["write"] = true,
},
},
["exif_datetime_taken"] = {
["__text"] = [[The date and time of the image.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[string]],
["write"] = true,
},
},
["exif_focus_distance"] = {
["__text"] = [[The distance of the subject.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[number]],
["write"] = true,
},
},
["exif_crop"] = {
["__text"] = [[The exif crop data.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[number]],
["write"] = true,
},
},
["latitude"] = {
["__text"] = [[GPS latitude data of the image, nil if not set.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[documentation node]],
["write"] = true,
},
},
["longitude"] = {
["__text"] = [[GPS longitude data of the image, nil if not set.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[documentation node]],
["write"] = true,
},
},
["is_raw"] = {
["__text"] = [[True if the image is a RAW file.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[boolean]],
},
},
["is_ldr"] = {
["__text"] = [[True if the image is a ldr image.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[boolean]],
},
},
["is_hdr"] = {
["__text"] = [[True if the image is a hdr image.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[boolean]],
},
},
["width"] = {
["__text"] = [[The width of the image.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[number]],
},
},
["height"] = {
["__text"] = [[The height of the image.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[number]],
},
},
["rating"] = {
["__text"] = [[The rating of the image (-1 for rejected).]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[number]],
["write"] = true,
},
},
["red"] = {
["__text"] = [[True if the image has the corresponding colorlabel.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[boolean]],
["write"] = true,
},
},
["blue"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["red"]]=],
["green"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["red"]]=],
["yellow"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["red"]]=],
["purple"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["red"]]=],
["reset"] = {
["__text"] = [[Removes all processing from the image, resetting it back to its original state]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[function]],
["signature"] = {
["1"] = {
["__text"] = [[The image whose history will be deleted]],
["__attributes"] = {
["is_self"] = true,
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
},
},
},
["delete"] = {
["__text"] = [[Removes an image from the database]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[function]],
["signature"] = {
["1"] = {
["__text"] = [[The image to remove]],
["__attributes"] = {
["is_self"] = true,
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
},
},
},
["group_with"] = {
["__text"] = [[Puts the first image in the same group as the second image. If no second image is provided the image will be in its own group.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[function]],
["signature"] = {
["1"] = {
["__text"] = [[The image whose group must be changed.]],
["__attributes"] = {
["is_self"] = true,
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
["2"] = {
["__text"] = [[The image we want to group with.]],
["__attributes"] = {
["optional"] = true,
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
},
},
},
["make_group_leader"] = {
["__text"] = [[Makes the image the leader of its group.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[function]],
["signature"] = {
["1"] = {
["__text"] = [[The image we want as the leader.]],
["__attributes"] = {
["is_self"] = true,
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
},
},
},
["get_group_members"] = {
["__text"] = [[Returns a table containing all types.dt_lua_image_t of the group. The group leader is both at a numeric key and at the "leader" special key (so you probably want to use ipairs to iterate through that table).]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[function]],
["ret_val"] = {
["__text"] = [[A table of image objects containing all images that are in the same group as the image.]],
["__attributes"] = {
["reported_type"] = [[table of types.dt_lua_image_t]],
},
},
["signature"] = {
["1"] = {
["__text"] = [[The image whose group we are querying.]],
["__attributes"] = {
["is_self"] = true,
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
},
},
},
["group_leader"] = {
["__text"] = [[The image which is the leader of the group this image is a member of.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
["local_copy"] = {
["__text"] = [[True if the image has a copy in the local cache]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[boolean]],
["write"] = true,
},
},
["drop_cache"] = {
["__text"] = [[drops the cached version of this image.
This function should be called if an image is modified out of darktable to force DT to regenerate the thumbnail
Darktable will regenerate the thumbnail by itself when it is needed]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[function]],
["signature"] = {
["1"] = {
["__text"] = [[The image whose cache must be dropped.]],
["__attributes"] = {
["is_self"] = true,
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
},
},
},
},
},
},
["3"] = {
["__text"] = [[The filename to export to.]],
["__attributes"] = {
["reported_type"] = [[string]],
},
},
},
},
},
},
},
},
},
},
},
},
},
},
["2"] = {
["__text"] = [[The exported image object.]],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
["3"] = {
["__text"] = [[The format object used for the export.]],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
["4"] = {
["__text"] = [[The name of a temporary file where the processed image is stored.]],
["__attributes"] = {
["reported_type"] = [[string]],
},
},
["5"] = {
["__text"] = [[The number of the image out of the export series.]],
["__attributes"] = {
["reported_type"] = [[integer]],
},
},
["6"] = {
["__text"] = [[The total number of images in the export series.]],
["__attributes"] = {
["reported_type"] = [[integer]],
},
},
["7"] = {
["__text"] = [[True if the export is high quality.]],
["__attributes"] = {
["reported_type"] = [[boolean]],
},
},
["8"] = {
["__text"] = [[An empty Lua table to take extra data. This table is common to the initialize, store and finalize calls in an export serie.]],
["__attributes"] = {
["reported_type"] = [[table]],
},
},
},
},
},
["4"] = {
["__text"] = [[This function is called once all images are processed and all store calls are finished.]],
["__attributes"] = {
["optional"] = true,
["reported_type"] = [[function]],
["signature"] = {
["1"] = {
["__text"] = [[The storage object used for the export.]],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
},
},
["2"] = {
["__text"] = [[A table keyed by the exported image objects and valued with the corresponding temporary export filename.]],
["__attributes"] = {
["reported_type"] = [[table]],
},
},
["3"] = {
["__text"] = [[An empty Lua table to store extra data. This table is common to all calls to store and the call to finalize in a given export series.]],
["__attributes"] = {
["reported_type"] = [[table]],
},
},
},
},
},
["5"] = {
["__text"] = [[A function called to check if a given image format is supported by the Lua storage; this is used to build the dropdown format list for the GUI.
Note that the parameters in the format are the ones currently set in the GUI; the user might change them before export.]],
["__attributes"] = {
["optional"] = true,
["reported_type"] = [[function]],
["ret_val"] = {
["__text"] = [[True if the corresponding format is supported.]],
["__attributes"] = {
["reported_type"] = [[boolean]],
},
},
["signature"] = {
["1"] = {
["__text"] = [[The storage object tested.]],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
},
},
["2"] = {
["__text"] = [[The format object to report about.]],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
},
},
},
["6"] = {
["__text"] = [[A function called before storage happens
This function can change the list of exported functions]],
["__attributes"] = {
["optional"] = true,
["reported_type"] = [[function]],
["ret_val"] = {
["__text"] = [[The modified table of images to export or nil
If nil (or nothing) is returned, the original list of images will be exported
If a table of images is returned, that table will be used instead. The table can be empty. The images parameter can be modified and returned]],
["__attributes"] = {
["reported_type"] = [[table or nil]],
},
},
["signature"] = {
["1"] = {
["__text"] = [[The storage object tested.]],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
},
},
["2"] = {
["__text"] = [[The format object to report about.]],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
["3"] = {
["__text"] = [[A table containing images to be exported.]],
["__attributes"] = {
["reported_type"] = [[table of types.dt_lua_image_t]],
},
},
["4"] = {
["__text"] = [[True if the export is high quality.]],
["__attributes"] = {
["reported_type"] = [[boolean]],
},
},
["5"] = {
["__text"] = [[An empty Lua table to take extra data. This table is common to the initialize, store and finalize calls in an export serie.]],
["__attributes"] = {
["reported_type"] = [[table]],
},
},
},
},
},
},
},
},
["films"] = {
["__text"] = [[A table containing all the film objects in the database.]],
["__attributes"] = {
["has_ipairs"] = true,
["has_length"] = true,
["has_pairs"] = true,
["is_singleton"] = true,
["reported_type"] = [[dt_singleton]],
},
["#"] = {
["__text"] = [[Each film has a numeric entry in the database.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["move"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
["new"] = {
["__text"] = [[Creates a new empty film
see darktable.database.import to import a directory with all its images and to add images to a film]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[function]],
["ret_val"] = {
["__text"] = [[The newly created film, or the existing film if the directory is already imported]],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["move"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
["signature"] = {
["1"] = {
["__text"] = [[The directory that the new film will represent. The directory must exist]],
["__attributes"] = {
["reported_type"] = [[string]],
},
},
},
},
},
["delete"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["move"].__attributes["signature"]["2"].__attributes["reported_type"]["delete"]]=],
},
["new_format"] = {
["__text"] = [[Creates a new format object to export images]],
["__attributes"] = {
["reported_type"] = [[function]],
["ret_val"] = {
["__text"] = [[The newly created object. Exact type depends on the type passed]],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
["signature"] = {
["1"] = {
["__text"] = [[The type of format object to create, one of :
* copy
* exr
* j2k
* jpeg
* pfm
* png
* ppm
* tiff
* webp
]],
["__attributes"] = {
["reported_type"] = [[string]],
},
},
},
},
},
["new_storage"] = {
["__text"] = [[Creates a new storage object to export images]],
["__attributes"] = {
["reported_type"] = [[function]],
["ret_val"] = {
["__text"] = [[The newly created object. Exact type depends on the type passed]],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
},
},
["signature"] = {
["1"] = {
["__text"] = [[The type of storage object to create, one of :
* disk
* email
* facebook
* flickr
* gallery
* latex
* picasa
(Other, lua-defined, storage types may appear.)]],
["__attributes"] = {
["reported_type"] = [[string]],
},
},
},
},
},
["gui"] = {
["__text"] = [[This subtable contains function and data to manipulate the darktable user interface with Lua.
Most of these function won't do anything if the GUI is not enabled (i.e you are using the command line version darktabl-cli instead of darktable).]],
["__attributes"] = {
["has_pairs"] = true,
["is_singleton"] = true,
["reported_type"] = [[dt_singleton]],
},
["action_images"] = {
["__text"] = [[A table of types.dt_lua_image_t on which the user expects UI actions to happen.
It is based on both the hovered image and the selection and is consistent with the way darktable works.
It is recommended to use this table to implement Lua actions rather than darktable.gui.hovered or darktable.gui.selection to be consistent with darktable's GUI.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[table]],
},
},
["hovered"] = {
["__text"] = [[The image under the cursor or nil if no image is hovered.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[documentation node]],
},
},
["selection"] = {
["__text"] = [[Allows to change the set of selected images.]],
["__attributes"] = {
["implicit_yield"] = true,
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[function]],
["ret_val"] = {
["__text"] = [[A table containing the selection as it was before the function was called.]],
["__attributes"] = {
["reported_type"] = [[table of types.dt_lua_image_t]],
},
},
["signature"] = {
["1"] = {
["__text"] = [[A table of images which will define the selected images. If this parameter is not given the selection will be untouched. If an empty table is given the selection will be emptied.]],
["__attributes"] = {
["optional"] = true,
["reported_type"] = [[table of types.dt_lua_image_t]],
},
},
},
},
},
["current_view"] = {
["__text"] = [[Allows to change the current view.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[function]],
["ret_val"] = {
["__text"] = [[the current view]],
["__attributes"] = {
["reported_type"] = {
["__text"] = [[A darktable view]],
["__attributes"] = {
["has_pairs"] = true,
["reported_type"] = [[dt_type]],
},
["id"] = {
["__text"] = [[A unique string identifying the view]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[string]],
},
},
["name"] = {
["__text"] = [[The name of the view]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[string]],
},
},
},
},
},
["signature"] = {
["1"] = {
["__text"] = [[The view to switch to. If empty the current view is unchanged]],
["__attributes"] = {
["optional"] = true,
["reported_type"] = {} --[=[API["darktable"]["gui"]["current_view"].__attributes["ret_val"].__attributes["reported_type"]]=],
},
},
},
},
},
["create_job"] = {
["__text"] = [[Create a new progress_bar displayed in darktable.gui.libs.backgroundjobs]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[function]],
["ret_val"] = {
["__text"] = [[The newly created job object]],
["__attributes"] = {
["reported_type"] = {
["__text"] = [[A lua-managed entry in the backgroundjob lib]],
["__attributes"] = {
["has_pairs"] = true,
["reported_type"] = [[dt_type]],
},
["percent"] = {
["__text"] = [[The value of the progress bar, between 0 and 1. will return nil if there is no progress bar, will raise an error if read or written on an invalid job]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[number]],
["write"] = true,
},
},
["valid"] = {
["__text"] = [[True if the job is displayed, set it to false to destroy the entry
An invalid job cannot be made valid again]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[boolean]],
["write"] = true,
},
},
},
},
},
["signature"] = {
["1"] = {
["__text"] = [[The text to display in the job entry]],
["__attributes"] = {
["reported_type"] = [[string]],
},
},
["2"] = {
["__text"] = [[Should a progress bar be displayed]],
["__attributes"] = {
["optional"] = true,
["reported_type"] = [[boolean]],
},
},
["3"] = {
["__text"] = [[A function called when the cancel button for that job is pressed
note that the job won't be destroyed automatically. You need to set types.dt_lua_backgroundjob_t.valid to false for that]],
["__attributes"] = {
["optional"] = true,
["reported_type"] = [[function]],
["signature"] = {
["1"] = {
["__text"] = [[The job who is being cancelded]],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["gui"]["create_job"].__attributes["ret_val"].__attributes["reported_type"]]=],
},
},
},
},
},
},
},
},
["views"] = {
["__text"] = [[The different views in darktable]],
["__attributes"] = {
["has_pairs"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["read"] = true,
["reported_type"] = [[dt_singleton]],
},
["map"] = {
["__text"] = [[The map view]],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["gui"]["current_view"].__attributes["ret_val"].__attributes["reported_type"]]=],
["read"] = true,
["reported_type"] = [[dt_singleton]],
},
["latitude"] = {
["__text"] = [[The latitude of the center of the map]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[number]],
["write"] = true,
},
},
["longitude"] = {
["__text"] = [[The longitude of the center of the map]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[number]],
["write"] = true,
},
},
["zoom"] = {
["__text"] = [[The current zoom level of the map]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[number]],
["write"] = true,
},
},
},
["darkroom"] = {
["__text"] = [[The darkroom view]],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["gui"]["current_view"].__attributes["ret_val"].__attributes["reported_type"]]=],
["read"] = true,
["reported_type"] = [[dt_singleton]],
},
},
["lighttable"] = {
["__text"] = [[The lighttable view]],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["gui"]["current_view"].__attributes["ret_val"].__attributes["reported_type"]]=],
["read"] = true,
["reported_type"] = [[dt_singleton]],
},
},
["tethering"] = {
["__text"] = [[The tethering view]],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["gui"]["current_view"].__attributes["ret_val"].__attributes["reported_type"]]=],
["read"] = true,
["reported_type"] = [[dt_singleton]],
},
},
["slideshow"] = {
["__text"] = [[The slideshow view]],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["gui"]["current_view"].__attributes["ret_val"].__attributes["reported_type"]]=],
["read"] = true,
["reported_type"] = [[dt_singleton]],
},
},
},
["libs"] = {
["__text"] = [[This table allows to reference all lib objects
lib are the graphical blocks within each view.
To quickly figure out what lib is what, you can use the following code which will make a given lib blink.
<code>local tested_module="global_toolbox"
dt.gui.libs[tested_module].visible=false
coroutine.yield("wait_ms",2000)
while true do
dt.gui.libs[tested_module].visible = not dt.gui.libs[tested_module].visible
coroutine.yield("wait_ms",2000)
end</code>]],
["__attributes"] = {
["has_pairs"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["read"] = true,
["reported_type"] = [[dt_singleton]],
},
["snapshots"] = {
["__text"] = [[The UI element that manipulates snapshots in darkroom]],
["__attributes"] = {
["has_ipairs"] = true,
["has_length"] = true,
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {
["__text"] = [[The type of a UI lib]],
["__attributes"] = {
["has_pairs"] = true,
["reported_type"] = [[dt_type]],
},
["id"] = {
["__text"] = [[A unit string identifying the lib]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[string]],
},
},
["name"] = {
["__text"] = [[The translated title of the UI element]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[string]],
},
},
["version"] = {
["__text"] = [[The version of the internal data of this lib]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[number]],
},
},
["visible"] = {
["__text"] = [[Allow to make a lib module completely invisible to the user.
Note that if the module is invisible the user will have no way to restore it without lua]],
["__attributes"] = {
["implicit_yield"] = true,
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[boolean]],
["write"] = true,
},
},
["expandable"] = {
["__text"] = [[True if the lib can be expanded/retracted]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[boolean]],
},
},
["expanded"] = {
["__text"] = [[True if the lib is expanded]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[boolean]],
["write"] = true,
},
},
["reset"] = {
["__text"] = [[A function to reset the lib to its default values
This function will do nothing if the lib is not visible or can't be reset]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[function]],
["signature"] = {
["1"] = {
["__text"] = [[The lib to reset]],
["__attributes"] = {
["is_self"] = true,
["reported_type"] = {} --[=[API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]]=],
},
},
},
},
},
["on_screen"] = {
["__text"] = [[True if the lib is currently visible on the screen]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[boolean]],
},
},
},
["read"] = true,
["reported_type"] = [[dt_singleton]],
},
["ratio"] = {
["__text"] = [[The place in the screen where the line separating the snapshot is. Between 0 and 1]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[number]],
["write"] = true,
},
},
["direction"] = {
["__text"] = [[The direction of the snapshot overlay]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = {
["__text"] = [[Which part of the main window is occupied by a snapshot]],
["__attributes"] = {
["reported_type"] = [[enum]],
["values"] = {
["1"] = [[left]],
["2"] = [[right]],
["3"] = [[top]],
["4"] = [[bottom]],
},
},
},
["write"] = true,
},
},
["#"] = {
["__text"] = [[The different snapshots for the image]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = {
["__text"] = [[The description of a snapshot in the snapshot lib]],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["reported_type"] = [[dt_type]],
},
["filename"] = {
["__text"] = [[The filename of an image containing the snapshot]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[string]],
},
},
["select"] = {
["__text"] = [[Activates this snapshot on the display. To deactivate all snapshot you need to call this function on the active snapshot]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[function]],
["signature"] = {
["1"] = {
["__text"] = [[The snapshot to activate]],
["__attributes"] = {
["is_self"] = true,
["reported_type"] = {} --[=[API["darktable"]["gui"]["libs"]["snapshots"]["#"].__attributes["reported_type"]]=],
},
},
},
},
},
["name"] = {
["__text"] = [[The name of the snapshot, as seen in the UI]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[string]],
},
},
},
},
},
["selected"] = {
["__text"] = [[The currently selected snapshot]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[documentation node]],
},
},
["take_snapshot"] = {
["__text"] = [[Take a snapshot of the current image and add it to the UI
The snapshot file will be generated at the next redraw of the main window]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[function]],
["signature"] = {
},
},
},
["max_snapshot"] = {
["__text"] = [[The maximum number of snapshots]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[number]],
},
},
},
["styles"] = {
["__text"] = [[The style selection menu]],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]]=],
["read"] = true,
["reported_type"] = [[dt_singleton]],
},
},
["metadata_view"] = {
["__text"] = [[The widget displaying metadata about the current image]],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]]=],
["read"] = true,
["reported_type"] = [[dt_singleton]],
},
},
["metadata"] = {
["__text"] = [[The widget allowing modification of metadata fields on the current image]],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]]=],
["read"] = true,
["reported_type"] = [[dt_singleton]],
},
},
["hinter"] = {
["__text"] = [[The small line of text at the top of the UI showing the number of selected images]],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]]=],
["read"] = true,
["reported_type"] = [[dt_singleton]],
},
},
["modulelist"] = {
["__text"] = [[The window allowing to set modules as visible/hidden/favorite]],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]]=],
["read"] = true,
["reported_type"] = [[dt_singleton]],
},
},
["filmstrip"] = {
["__text"] = [[The filmstrip at the bottom of some views]],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]]=],
["read"] = true,
["reported_type"] = [[dt_singleton]],
},
},
["viewswitcher"] = {
["__text"] = [[The labels allowing to switch view]],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]]=],
["read"] = true,
["reported_type"] = [[dt_singleton]],
},
},
["darktable_label"] = {
["__text"] = [[The darktable logo in the upper left corner]],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]]=],
["read"] = true,
["reported_type"] = [[dt_singleton]],
},
},
["tagging"] = {
["__text"] = [[The tag manipulation UI]],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]]=],
["read"] = true,
["reported_type"] = [[dt_singleton]],
},
},
["geotagging"] = {
["__text"] = [[The geotagging time synchronisation UI]],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]]=],
["read"] = true,
["reported_type"] = [[dt_singleton]],
},
},
["recentcollect"] = {
["__text"] = [[The recent collection UI element]],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]]=],
["read"] = true,
["reported_type"] = [[dt_singleton]],
},
},
["global_toolbox"] = {
["__text"] = [[The common tools to all view (settings, grouping...)]],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]]=],
["read"] = true,
["reported_type"] = [[dt_singleton]],
},
["grouping"] = {
["__text"] = [[The current status of the image grouping option]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[boolean]],
["write"] = true,
},
},
["show_overlays"] = {
["__text"] = [[the current status of the image overlays option]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[boolean]],
["write"] = true,
},
},
},
["filter"] = {
["__text"] = [[The image-filter menus at the top of the UI]],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]]=],
["read"] = true,
["reported_type"] = [[dt_singleton]],
},
},
["import"] = {
["__text"] = [[The buttons to start importing images]],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]]=],
["read"] = true,
["reported_type"] = [[dt_singleton]],
},
},
["ratings"] = {
["__text"] = [[The starts to set the rating of an image]],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]]=],
["read"] = true,
["reported_type"] = [[dt_singleton]],
},
},
["select"] = {
["__text"] = [[The buttons that allow to quickly change the selection]],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]]=],
["read"] = true,
["reported_type"] = [[dt_singleton]],
},
},
["collect"] = {
["__text"] = [[The collection UI element that allows to filter images by collection]],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]]=],
["read"] = true,
["reported_type"] = [[dt_singleton]],
},
},
["colorlabels"] = {
["__text"] = [[The color buttons that allow to set labels on an image]],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]]=],
["read"] = true,
["reported_type"] = [[dt_singleton]],
},
},
["lighttable_mode"] = {
["__text"] = [[The navigation and zoom level UI in lighttable]],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]]=],
["read"] = true,
["reported_type"] = [[dt_singleton]],
},
},
["copy_history"] = {
["__text"] = [[The UI element that manipulates history]],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]]=],
["read"] = true,
["reported_type"] = [[dt_singleton]],
},
},
["image"] = {
["__text"] = [[The UI element that manipulates the current image]],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]]=],
["read"] = true,
["reported_type"] = [[dt_singleton]],
},
},
["modulegroups"] = {
["__text"] = [[The icons describing the different iop groups]],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]]=],
["read"] = true,
["reported_type"] = [[dt_singleton]],
},
},
["module_toolbox"] = {
["__text"] = [[The tools on the bottom line of the UI (overexposure)]],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]]=],
["read"] = true,
["reported_type"] = [[dt_singleton]],
},
},
["session"] = {
["__text"] = [[The session UI when tethering]],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]]=],
["read"] = true,
["reported_type"] = [[dt_singleton]],
},
},
["histogram"] = {
["__text"] = [[The histogram widget]],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]]=],
["read"] = true,
["reported_type"] = [[dt_singleton]],
},
},
["export"] = {
["__text"] = [[The export menu]],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]]=],
["read"] = true,
["reported_type"] = [[dt_singleton]],
},
},
["history"] = {
["__text"] = [[The history manipulation menu]],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]]=],
["read"] = true,
["reported_type"] = [[dt_singleton]],
},
},
["colorpicker"] = {
["__text"] = [[The colorpicker menu]],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]]=],
["read"] = true,
["reported_type"] = [[dt_singleton]],
},
},
["navigation"] = {
["__text"] = [[The full image preview to allow navigation]],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]]=],
["read"] = true,
["reported_type"] = [[dt_singleton]],
},
},
["masks"] = {
["__text"] = [[The masks window]],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]]=],
["read"] = true,
["reported_type"] = [[dt_singleton]],
},
},
["view_toolbox"] = {
["__text"] = [[]],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]]=],
["read"] = true,
["reported_type"] = [[dt_singleton]],
},
},
["live_view"] = {
["__text"] = [[The liveview window]],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]]=],
["read"] = true,
["reported_type"] = [[dt_singleton]],
},
},
["map_settings"] = {
["__text"] = [[The map setting window]],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]]=],
["read"] = true,
["reported_type"] = [[dt_singleton]],
},
},
["camera"] = {
["__text"] = [[The camera selection UI]],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]]=],
["read"] = true,
["reported_type"] = [[dt_singleton]],
},
},
["location"] = {
["__text"] = [[The location ui]],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]]=],
["read"] = true,
["reported_type"] = [[dt_singleton]],
},
},
["backgroundjobs"] = {
["__text"] = [[The window displaying the currently running jobs]],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]]=],
["read"] = true,
["reported_type"] = [[dt_singleton]],
},
},
},
},
["tags"] = {
["__text"] = [[Allows access to all existing tags.]],
["__attributes"] = {
["has_ipairs"] = true,
["has_length"] = true,
["has_pairs"] = true,
["is_singleton"] = true,
["reported_type"] = [[dt_singleton]],
},
["#"] = {
["__text"] = [[Each existing tag has a numeric entry in the tags table - use ipairs to iterate over them.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["attach_tag"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
},
},
["create"] = {
["__text"] = [[Creates a new tag and return it. If the tag exists return the existing tag.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[function]],
["signature"] = {
["1"] = {
["__text"] = [[The name of the new tag.]],
["__attributes"] = {
["reported_type"] = [[string]],
},
},
},
},
},
["find"] = {
["__text"] = [[Returns the tag object or nil if the tag doesn't exist.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[function]],
["ret_val"] = {
["__text"] = [[The tag object or nil.]],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["attach_tag"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
},
},
["signature"] = {
["1"] = {
["__text"] = [[The name of the tag to find.]],
["__attributes"] = {
["reported_type"] = [[string]],
},
},
},
},
},
["delete"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["attach_tag"].__attributes["signature"]["1"].__attributes["reported_type"]["delete"]]=],
["attach"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["attach_tag"]]=],
["detach"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["attach_tag"].__attributes["signature"]["1"].__attributes["reported_type"]["detach"]]=],
["get_tags"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["get_tags"]]=],
},
["configuration"] = {
["__text"] = [[This table regroups values that describe details of the configuration of darktable.]],
["__attributes"] = {
["reported_type"] = [[table]],
},
["version"] = {
["__text"] = [[The version number of darktable.]],
["__attributes"] = {
["reported_type"] = [[string]],
},
},
["has_gui"] = {
["__text"] = [[True if darktable has a GUI (launched through the main darktable command, not darktable-cli).]],
["__attributes"] = {
["reported_type"] = [[boolean]],
},
},
["verbose"] = {
["__text"] = [[True if the Lua logdomain is enabled.]],
["__attributes"] = {
["reported_type"] = [[boolean]],
},
},
["tmp_dir"] = {
["__text"] = [[The name of the directory where darktable will store temporary files.]],
["__attributes"] = {
["reported_type"] = [[string]],
},
},
["config_dir"] = {
["__text"] = [[The name of the directory where darktable will find its global configuration objects (modules).]],
["__attributes"] = {
["reported_type"] = [[string]],
},
},
["cache_dir"] = {
["__text"] = [[The name of the directory where darktable will store its mipmaps.]],
["__attributes"] = {
["reported_type"] = [[string]],
},
},
["api_version_major"] = {
["__text"] = [[The major version number of the lua API.]],
["__attributes"] = {
["reported_type"] = [[number]],
},
},
["api_version_minor"] = {
["__text"] = [[The minor version number of the lua API.]],
["__attributes"] = {
["reported_type"] = [[number]],
},
},
["api_version_patch"] = {
["__text"] = [[The patch version number of the lua API.]],
["__attributes"] = {
["reported_type"] = [[number]],
},
},
["api_version_suffix"] = {
["__text"] = [[The version suffix of the lua API.]],
["__attributes"] = {
["reported_type"] = [[string]],
},
},
["api_version_string"] = {
["__text"] = [[The version description of the lua API. This is a string compatible with the semantic versioning convention]],
["__attributes"] = {
["reported_type"] = [[string]],
},
},
["check_version"] = {
["__text"] = [[Check that a module is compatible with the running version of darktable
Add the following line at the top of your module : <code>darktable.configuration.check(...,{M,m,p},{M2,m2,p2})</code>To document that your module has been tested with API version M.m.p and M2.m2.p2.
This will raise an error if the user is running a released version of DT and a warning if he is running a development version
(the ... here will automatically expand to your module name if used at the top of your script]],
["__attributes"] = {
["reported_type"] = [[function]],
["signature"] = {
["1"] = {
["__text"] = [[The name of the module to report on error]],
["__attributes"] = {
["reported_type"] = [[string]],
},
},
["2"] = {
["__text"] = [[Tables of API versions that are known to work with the scrip]],
["__attributes"] = {
["reported_type"] = [[table...]],
},
},
},
},
},
},
["preferences"] = {
["__text"] = [[Lua allows you do manipulate preferences. Lua has its own namespace for preferences and you can't access nor write normal darktable preferences.
Preference handling functions take a _script_ parameter. This is a string used to avoid name collision in preferences (i.e namespace). Set it to something unique, usually the name of the script handling the preference.
Preference handling functions can't guess the type of a parameter. You must pass the type of the preference you are handling.
Note that the directory, enum and file type preferences are stored internally as string. The user can only select valid values, but a lua script can set it to any string]],
["__attributes"] = {
["reported_type"] = [[table]],
},
["register"] = {
["__text"] = [[Creates a new preference entry in the Lua tab of the preference screen. If this function is not called the preference can't be set by the user (you can still read and write invisible preferences).]],
["__attributes"] = {
["reported_type"] = [[function]],
["signature"] = {
["1"] = {
["__text"] = [[Invisible prefix to guarantee unicity of preferences.]],
["__attributes"] = {
["reported_type"] = [[string]],
},
},
["2"] = {
["__text"] = [[A unique name used with the script part to identify the preference.]],
["__attributes"] = {
["reported_type"] = [[string]],
},
},
["3"] = {
["__text"] = [[The type of the preference - one of the string values described above.]],
["__attributes"] = {
["reported_type"] = {
["__text"] = [[The type of value to save in a preference]],
["__attributes"] = {
["reported_type"] = [[enum]],
["values"] = {
["1"] = [[string]],
["2"] = [[bool]],
["3"] = [[integer]],
["4"] = [[float]],
["5"] = [[file]],
["6"] = [[directory]],
["7"] = [[enum]],
},
},
},
},
},
["4"] = {
["__text"] = [[The label displayed in the preference screen.]],
["__attributes"] = {
["reported_type"] = [[string]],
},
},
["5"] = {
["__text"] = [[The tooltip to display in the preference menu.]],
["__attributes"] = {
["reported_type"] = [[string]],
},
},
["6"] = {
["__text"] = [[Default value to use when not set explicitly or by the user.
For the enum type of pref, this is mandatory]],
["__attributes"] = {
["optional"] = true,
["reported_type"] = [[depends on type]],
},
},
["7"] = {
["__text"] = [[Minimum value (integer and float preferences only).]],
["__attributes"] = {
["optional"] = true,
["reported_type"] = [[int or float]],
},
},
["8"] = {
["__text"] = [[Maximum value (integer and float preferences only).]],
["__attributes"] = {
["optional"] = true,
["reported_type"] = [[int or float]],
},
},
["9"] = {
["__text"] = [[Step of the spinner (float preferences only).]],
["__attributes"] = {
["optional"] = true,
["reported_type"] = [[float]],
},
},
["10"] = {
["__text"] = [[Other allowed values (enum preferences only)]],
["__attributes"] = {
["reported_type"] = [[string...]],
},
},
},
},
},
["read"] = {
["__text"] = [[Reads a value from a Lua preference.]],
["__attributes"] = {
["reported_type"] = [[function]],
["ret_val"] = {
["__text"] = [[The value of the preference.]],
["__attributes"] = {
["reported_type"] = [[depends on type]],
},
},
["signature"] = {
["1"] = {
["__text"] = [[Invisible prefix to guarantee unicity of preferences.]],
["__attributes"] = {
["reported_type"] = [[string]],
},
},
["2"] = {
["__text"] = [[The name of the preference displayed in the preference screen.]],
["__attributes"] = {
["reported_type"] = [[string]],
},
},
["3"] = {
["__text"] = [[The type of the preference.]],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["preferences"]["register"].__attributes["signature"]["3"].__attributes["reported_type"]]=],
},
},
},
},
},
["write"] = {
["__text"] = [[Writes a value to a Lua preference.]],
["__attributes"] = {
["reported_type"] = [[function]],
["signature"] = {
["1"] = {
["__text"] = [[Invisible prefix to guarantee unicity of preferences.]],
["__attributes"] = {
["reported_type"] = [[string]],
},
},
["2"] = {
["__text"] = [[The name of the preference displayed in the preference screen.]],
["__attributes"] = {
["reported_type"] = [[string]],
},
},
["3"] = {
["__text"] = [[The type of the preference.]],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["preferences"]["register"].__attributes["signature"]["3"].__attributes["reported_type"]]=],
},
},
["4"] = {
["__text"] = [[The value to set the preference to.]],
["__attributes"] = {
["reported_type"] = [[depends on type]],
},
},
},
},
},
},
["styles"] = {
["__text"] = [[This pseudo table allows you to access and manipulate styles.]],
["__attributes"] = {
["has_ipairs"] = true,
["has_length"] = true,
["has_pairs"] = true,
["is_singleton"] = true,
["reported_type"] = [[dt_singleton]],
},
["#"] = {
["__text"] = [[Each existing style has a numeric index; you can iterate them using ipairs.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"].__attributes["ret_val"].__attributes["reported_type"]]=],
},
},
["create"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"]]=],
["delete"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"].__attributes["ret_val"].__attributes["reported_type"]["delete"]]=],
["duplicate"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"].__attributes["ret_val"].__attributes["reported_type"]["duplicate"]]=],
["apply"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"].__attributes["ret_val"].__attributes["reported_type"]["apply"]]=],
["import"] = {
["__text"] = [[Import a style from an external .dtstyle file]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[function]],
["signature"] = {
["1"] = {
["__text"] = [[The file to import]],
["__attributes"] = {
["reported_type"] = [[string]],
},
},
},
},
},
["export"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"].__attributes["ret_val"].__attributes["reported_type"]["export"]]=],
},
["database"] = {
["__text"] = [[Allows to access the database of images. Note that duplicate images (images with the same RAW but different XMP) will appear multiple times with different duplicate indexes. Also note that all images are here. This table is not influenced by any GUI filtering (collections, stars etc...).]],
["__attributes"] = {
["has_ipairs"] = true,
["has_length"] = true,
["has_pairs"] = true,
["is_singleton"] = true,
["reported_type"] = [[dt_singleton]],
},
["#"] = {
["__text"] = [[Each image in the database appears with a numerical index; you can interate them using ipairs.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
["duplicate"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["duplicate"]]=],
["import"] = {
["__text"] = [[Imports new images into the database.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[function]],
["signature"] = {
["1"] = {
["__text"] = [[The filename or directory to import images from.
NOTE: If the images are set to be imported recursively in preferences only the toplevel film is returned (the one whose path was given as a parameter).
NOTE2: If the parameter is a directory the call is non-blocking; the film object will not have the newly imported images yet. Use a post-import-film filtering on that film to react when images are actually imported.
]],
["__attributes"] = {
["reported_type"] = [[string]],
},
},
},
},
},
["move_image"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["move"]]=],
["copy_image"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["move"].__attributes["signature"]["2"].__attributes["reported_type"]["copy_image"]]=],
["delete"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["delete"]]=],
},
["debug"] = {
["__text"] = [[This section must be activated separately by calling
require "darktable.debug"
]],
["__attributes"] = {
["reported_type"] = [[table]],
},
["dump"] = {
["__text"] = [[This will return a string describing everything Lua knows about an object, used to know what an object is.
This function is recursion-safe and can be used to dump _G if needed.]],
["__attributes"] = {
["reported_type"] = [[function]],
["ret_val"] = {
["__text"] = [[A string containing a text description of the object - can be very long.]],
["__attributes"] = {
["reported_type"] = [[string]],
},
},
["signature"] = {
["1"] = {
["__text"] = [[The object to dump.]],
["__attributes"] = {
["reported_type"] = [[anything]],
},
},
["2"] = {
["__text"] = [[A name to use for the object.]],
["__attributes"] = {
["optional"] = true,
["reported_type"] = [[string]],
},
},
["3"] = {
["__text"] = [[A table of object,string pairs. Any object in that table will not be dumped, the string will be printed instead.
defaults to darktable.debug.known if not set]],
["__attributes"] = {
["optional"] = true,
["reported_type"] = [[table]],
},
},
},
},
},
["debug"] = {
["__text"] = [[Initialized to false; set it to true to also dump information about metatables.]],
["__attributes"] = {
["reported_type"] = [[boolean]],
},
},
["max_depth"] = {
["__text"] = [[Initialized to 10; The maximum depth to recursively dump content.]],
["__attributes"] = {
["reported_type"] = [[number]],
},
},
["known"] = {
["__text"] = [[A table containing the default value of darktable.debug.dump.known]],
["__attributes"] = {
["reported_type"] = [[table]],
},
},
["type"] = {
["__text"] = [[Similar to the system function type() but it will return the real type instead of "userdata" for darktable specific objects.]],
["__attributes"] = {
["reported_type"] = [[function]],
["ret_val"] = {
["__text"] = [[A string describing the type of the object.]],
["__attributes"] = {
["reported_type"] = [[string]],
},
},
["signature"] = {
["1"] = {
["__text"] = [[The object whos type must be reported.]],
["__attributes"] = {
["reported_type"] = [[anything]],
},
},
},
},
},
},
},
["types"] = {
["__text"] = [[This section documents types that are specific to darktable's Lua API.]],
["__attributes"] = {
["reported_type"] = [[documentation node]],
},
["dt_lua_image_t"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
["dt_imageio_module_format_t"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
["dt_imageio_module_format_data_png"] = {
["__text"] = [[Type object describing parameters to export to png.]],
["__attributes"] = {
["has_pairs"] = true,
["parent"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
["reported_type"] = [[dt_type]],
},
["bpp"] = {
["__text"] = [[The bpp parameter to use when exporting.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[number]],
["write"] = true,
},
},
},
["dt_imageio_module_format_data_tiff"] = {
["__text"] = [[Type object describing parameters to export to tiff.]],
["__attributes"] = {
["has_pairs"] = true,
["parent"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
["reported_type"] = [[dt_type]],
},
["bpp"] = {
["__text"] = [[The bpp parameter to use when exporting.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[number]],
["write"] = true,
},
},
},
["dt_imageio_module_format_data_exr"] = {
["__text"] = [[Type object describing parameters to export to exr.]],
["__attributes"] = {
["has_pairs"] = true,
["parent"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
["reported_type"] = [[dt_type]],
},
["compression"] = {
["__text"] = [[The compression parameter to use when exporting.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[string]],
["write"] = true,
},
},
},
["dt_imageio_module_format_data_copy"] = {
["__text"] = [[Type object describing parameters to export to copy.]],
["__attributes"] = {
["has_pairs"] = true,
["parent"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
["reported_type"] = [[dt_type]],
},
},
["dt_imageio_module_format_data_pfm"] = {
["__text"] = [[Type object describing parameters to export to pfm.]],
["__attributes"] = {
["has_pairs"] = true,
["parent"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
["reported_type"] = [[dt_type]],
},
},
["dt_imageio_module_format_data_jpeg"] = {
["__text"] = [[Type object describing parameters to export to jpeg.]],
["__attributes"] = {
["has_pairs"] = true,
["parent"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
["reported_type"] = [[dt_type]],
},
["quality"] = {
["__text"] = [[The quality to use at export time.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[number]],
["write"] = true,
},
},
},
["dt_imageio_module_format_data_ppm"] = {
["__text"] = [[Type object describing parameters to export to ppm.]],
["__attributes"] = {
["has_pairs"] = true,
["parent"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
["reported_type"] = [[dt_type]],
},
},
["dt_imageio_module_format_data_webp"] = {
["__text"] = [[Type object describing parameters to export to webp.]],
["__attributes"] = {
["has_pairs"] = true,
["parent"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
["reported_type"] = [[dt_type]],
},
["quality"] = {
["__text"] = [[The quality to use at export time.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[number]],
["write"] = true,
},
},
["comp_type"] = {
["__text"] = [[The overall quality to use; can be one of "webp_lossy" or "webp_lossless".]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = {
["__text"] = [[Type of compression for webp]],
["__attributes"] = {
["reported_type"] = [[enum]],
["values"] = {
["1"] = [[webp_lossy]],
["2"] = [[webp_lossless]],
},
},
},
["write"] = true,
},
},
["hint"] = {
["__text"] = [[A hint on the overall content of the image.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = {
["__text"] = [[a hint on the way to encode a webp image]],
["__attributes"] = {
["reported_type"] = [[enum]],
["values"] = {
["1"] = [[hint_default]],
["2"] = [[hint_picture]],
["3"] = [[hint_photo]],
["4"] = [[hint_graphic]],
},
},
},
["write"] = true,
},
},
},
["dt_imageio_module_format_data_j2k"] = {
["__text"] = [[Type object describing parameters to export to jpeg2000.]],
["__attributes"] = {
["has_pairs"] = true,
["parent"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
["reported_type"] = [[dt_type]],
},
["quality"] = {
["__text"] = [[The quality to use at export time.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[number]],
["write"] = true,
},
},
["bpp"] = {
["__text"] = [[The bpp parameter to use when exporting.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[number]],
["write"] = true,
},
},
["format"] = {
["__text"] = [[The format to use.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = {
["__text"] = [[J2K format type]],
["__attributes"] = {
["reported_type"] = [[enum]],
["values"] = {
["1"] = [[j2k]],
["2"] = [[jp2]],
},
},
},
["write"] = true,
},
},
["preset"] = {
["__text"] = [[The preset to use.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = {
["__text"] = [[J2K preset type]],
["__attributes"] = {
["reported_type"] = [[enum]],
["values"] = {
["1"] = [[off]],
["2"] = [[cinema2k_24]],
["3"] = [[cinema2k_48]],
["4"] = [[cinema4k_24]],
},
},
},
["write"] = true,
},
},
},
["dt_imageio_module_storage_t"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
["dt_imageio_module_storage_data_email"] = {
["__text"] = [[An object containing parameters to export to email.]],
["__attributes"] = {
["has_pairs"] = true,
["parent"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
["reported_type"] = [[dt_type]],
},
},
["dt_imageio_module_storage_data_flickr"] = {
["__text"] = [[An object containing parameters to export to flickr.]],
["__attributes"] = {
["has_pairs"] = true,
["parent"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
["reported_type"] = [[dt_type]],
},
},
["dt_imageio_module_storage_data_facebook"] = {
["__text"] = [[An object containing parameters to export to facebook.]],
["__attributes"] = {
["has_pairs"] = true,
["parent"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
["reported_type"] = [[dt_type]],
},
},
["dt_imageio_module_storage_data_latex"] = {
["__text"] = [[An object containing parameters to export to latex.]],
["__attributes"] = {
["has_pairs"] = true,
["parent"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
["reported_type"] = [[dt_type]],
},
["filename"] = {
["__text"] = [[The filename to export to.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[string]],
["write"] = true,
},
},
["title"] = {
["__text"] = [[The title to use for export.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[string]],
["write"] = true,
},
},
},
["dt_imageio_module_storage_data_picasa"] = {
["__text"] = [[An object containing parameters to export to picasa.]],
["__attributes"] = {
["has_pairs"] = true,
["parent"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
["reported_type"] = [[dt_type]],
},
},
["dt_imageio_module_storage_data_gallery"] = {
["__text"] = [[An object containing parameters to export to gallery.]],
["__attributes"] = {
["has_pairs"] = true,
["parent"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
["reported_type"] = [[dt_type]],
},
["filename"] = {
["__text"] = [[The filename to export to.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[string]],
["write"] = true,
},
},
["title"] = {
["__text"] = [[The title to use for export.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[string]],
["write"] = true,
},
},
},
["dt_imageio_module_storage_data_disk"] = {
["__text"] = [[An object containing parameters to export to disk.]],
["__attributes"] = {
["has_pairs"] = true,
["parent"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
["reported_type"] = [[dt_type]],
},
["filename"] = {
["__text"] = [[The filename to export to.]],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [[string]],
["write"] = true,
},
},
},
["dt_lua_film_t"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["move"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
["dt_style_t"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"].__attributes["ret_val"].__attributes["reported_type"]]=],
["dt_style_item_t"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"].__attributes["ret_val"].__attributes["reported_type"]["#"].__attributes["reported_type"]]=],
["dt_lua_tag_t"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["attach_tag"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
["dt_lib_module_t"] = {} --[=[API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]]=],
["dt_view_t"] = {} --[=[API["darktable"]["gui"]["current_view"].__attributes["ret_val"].__attributes["reported_type"]]=],
["dt_lua_backgroundjob_t"] = {} --[=[API["darktable"]["gui"]["create_job"].__attributes["ret_val"].__attributes["reported_type"]]=],
["dt_lua_snapshot_t"] = {} --[=[API["darktable"]["gui"]["libs"]["snapshots"]["#"].__attributes["reported_type"]]=],
["hint_t"] = {} --[=[API["types"]["dt_imageio_module_format_data_webp"]["hint"].__attributes["reported_type"]]=],
["snapshot_direction_t"] = {} --[=[API["darktable"]["gui"]["libs"]["snapshots"]["direction"].__attributes["reported_type"]]=],
["dt_imageio_j2k_format_t"] = {} --[=[API["types"]["dt_imageio_module_format_data_j2k"]["format"].__attributes["reported_type"]]=],
["dt_imageio_j2k_preset_t"] = {} --[=[API["types"]["dt_imageio_module_format_data_j2k"]["preset"].__attributes["reported_type"]]=],
["yield_type"] = {
["__text"] = [[What type of event to wait for]],
["__attributes"] = {
["reported_type"] = [[enum]],
["values"] = {
["1"] = [[WAIT_MS]],
["2"] = [[FILE_READABLE]],
["3"] = [[RUN_COMMAND]],
},
},
},
["comp_type_t"] = {} --[=[API["types"]["dt_imageio_module_format_data_webp"]["comp_type"].__attributes["reported_type"]]=],
["lua_pref_type"] = {} --[=[API["darktable"]["preferences"]["register"].__attributes["signature"]["3"].__attributes["reported_type"]]=],
["dt_imageio_exr_compression_t"] = {
["__text"] = [[The type of compression to use for the EXR image]],
["__attributes"] = {
["reported_type"] = [[enum]],
["values"] = {
["1"] = [[off]],
["2"] = [[rle]],
["3"] = [[zips]],
["4"] = [[zip]],
["5"] = [[piz]],
["6"] = [[pxr24]],
["7"] = [[b44]],
["8"] = [[b44a]],
},
},
},
},
["events"] = {
["__text"] = [[This section documents events that can be used to trigger Lua callbacks.]],
["__attributes"] = {
["reported_type"] = [[documentation node]],
},
["intermediate-export-image"] = {
["__text"] = [[This event is called each time an image is exported, once for each image after the image has been processed to an image format but before the storage has moved the image to its final destination.]],
["__attributes"] = {
["reported_type"] = [[event]],
},
["callback"] = {
["__text"] = [[]],
["__attributes"] = {
["reported_type"] = [[function]],
["signature"] = {
["1"] = {
["__text"] = [[The name of the event that triggered the callback.]],
["__attributes"] = {
["reported_type"] = [[string]],
},
},
["2"] = {
["__text"] = [[The image object that has been exported.]],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
["3"] = {
["__text"] = [[The name of the file that is the result of the image being processed.]],
["__attributes"] = {
["reported_type"] = [[string]],
},
},
["4"] = {
["__text"] = [[The format used to export the image.]],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
["5"] = {
["__text"] = [[The storage used to export the image (can be nil).]],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
},
},
},
},
},
["extra_registration_parameters"] = {
["__text"] = [[This event has no extra registration parameters.]],
["__attributes"] = {
["reported_type"] = [[documentation node]],
},
},
},
["post-import-image"] = {
["__text"] = [[This event is triggered whenever a new image is imported into the database.
This event can be registered multiple times, all callbacks will be called.]],
["__attributes"] = {
["reported_type"] = [[event]],
},
["callback"] = {
["__text"] = [[]],
["__attributes"] = {
["reported_type"] = [[function]],
["signature"] = {
["1"] = {
["__text"] = [[The name of the event that triggered the callback.]],
["__attributes"] = {
["reported_type"] = [[string]],
},
},
["2"] = {
["__text"] = [[The image object that has been exported.]],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
},
},
},
["extra_registration_parameters"] = {
["__text"] = [[This event has no extra registration parameters.]],
["__attributes"] = {
["reported_type"] = [[documentation node]],
},
},
},
["shortcut"] = {
["__text"] = [[This event registers a new keyboard shortcut. The shortcut isn't bound to any key until the users does so in the preference panel.
The event is triggered whenever the shortcut is triggered.
This event can only be registered once per value of shortcut.
]],
["__attributes"] = {
["reported_type"] = [[event]],
},
["callback"] = {
["__text"] = [[]],
["__attributes"] = {
["reported_type"] = [[function]],
["signature"] = {
["1"] = {
["__text"] = [[The name of the event that triggered the callback.]],
["__attributes"] = {
["reported_type"] = [[string]],
},
},
["2"] = {
["__text"] = [[The tooltip string that was given at registration time.]],
["__attributes"] = {
["reported_type"] = [[string]],
},
},
},
},
},
["extra_registration_parameters"] = {
["__text"] = [[]],
["__attributes"] = {
["reported_type"] = [[documentation node]],
["signature"] = {
["1"] = {
["__text"] = [[The string that will be displayed on the shortcut preference panel describing the shortcut.]],
["__attributes"] = {
["reported_type"] = [[string]],
},
},
},
},
},
},
["post-import-film"] = {
["__text"] = [[This event is triggered when an film import is finished (all post-import-image callbacks have already been triggered). This event can be registered multiple times.
]],
["__attributes"] = {
["reported_type"] = [[event]],
},
["callback"] = {
["__text"] = [[]],
["__attributes"] = {
["reported_type"] = [[function]],
["signature"] = {
["1"] = {
["__text"] = [[The name of the event that triggered the callback.]],
["__attributes"] = {
["reported_type"] = [[string]],
},
},
["2"] = {
["__text"] = [[The new film that has been added. If multiple films were added recursively only the top level film is reported.]],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["move"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
},
},
},
["extra_registration_parameters"] = {
["__text"] = [[This event has no extra registration parameters.]],
["__attributes"] = {
["reported_type"] = [[documentation node]],
},
},
},
["view-changed"] = {
["__text"] = [[This event is triggered after the user changed the active view]],
["__attributes"] = {
["reported_type"] = [[event]],
},
["callback"] = {
["__text"] = [[]],
["__attributes"] = {
["reported_type"] = [[function]],
["signature"] = {
["1"] = {
["__text"] = [[The view that we just left]],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["gui"]["current_view"].__attributes["ret_val"].__attributes["reported_type"]]=],
},
},
["2"] = {
["__text"] = [[The view we are now in]],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["gui"]["current_view"].__attributes["ret_val"].__attributes["reported_type"]]=],
},
},
},
},
},
["extra_registration_parameters"] = {
["__text"] = [[This event has no extra registration parameters.]],
["__attributes"] = {
["reported_type"] = [[documentation node]],
},
},
},
["global_toolbox-grouping_toggle"] = {
["__text"] = [[This event is triggered after the user toggled the grouping button.]],
["__attributes"] = {
["reported_type"] = [[event]],
},
["callback"] = {
["__text"] = [[]],
["__attributes"] = {
["reported_type"] = [[function]],
["signature"] = {
["1"] = {
["__text"] = [[the new grouping status.]],
["__attributes"] = {
["reported_type"] = [[boolean]],
},
},
},
},
},
["extra_registration_parameters"] = {
["__text"] = [[This event has no extra registration parameters.]],
["__attributes"] = {
["reported_type"] = [[documentation node]],
},
},
},
["global_toolbox-overlay_toggle"] = {
["__text"] = [[This event is triggered after the user toggled the overlay button.]],
["__attributes"] = {
["reported_type"] = [[event]],
},
["callback"] = {
["__text"] = [[]],
["__attributes"] = {
["reported_type"] = [[function]],
["signature"] = {
["1"] = {
["__text"] = [[the new overlay status.]],
["__attributes"] = {
["reported_type"] = [[boolean]],
},
},
},
},
},
["extra_registration_parameters"] = {
["__text"] = [[This event has no extra registration parameters.]],
["__attributes"] = {
["reported_type"] = [[documentation node]],
},
},
},
},
["attributes"] = {
["__text"] = [[This section documents various attributes used throughout the documentation.]],
["__attributes"] = {
["reported_type"] = [[documentation node]],
},
["write"] = {
["__text"] = [[This object is a variable that can be written to.]],
["__attributes"] = {
["reported_type"] = [[documentation node]],
},
},
["has_tostring"] = {
["__text"] = [[This object has a specific reimplementation of the "tostring" method that allows pretty-printing it.]],
["__attributes"] = {
["reported_type"] = [[documentation node]],
},
},
["implicit_yield"] = {
["__text"] = [[This call will release the Lua lock while executing, thus allowing other Lua callbacks to run.]],
["__attributes"] = {
["reported_type"] = [[documentation node]],
},
},
["parent"] = {
["__text"] = [[This object inherits some methods from another object. You can call the methods from the parent on the child object]],
["__attributes"] = {
["reported_type"] = [[documentation node]],
},
},
},
["system"] = {
["__text"] = [[This section documents changes to system functions.]],
["__attributes"] = {
["reported_type"] = [[documentation node]],
},
["coroutine"] = {
["__text"] = [[]],
["__attributes"] = {
["reported_type"] = [[documentation node]],
},
["yield"] = {
["__text"] = [[Lua functions can yield at any point. The parameters and return types depend on why we want to yield.
A callback that is yielding allows other Lua code to run.
* wait_ms: one extra parameter; the execution will pause for that many milliseconds; yield returns nothing;
* file_readable: an opened file from a call to the OS library; will return when the file is readable; returns nothing;
* run_command: a command to be run by "sh -c"; will return when the command terminates; returns the return code of the execution.
]],
["__attributes"] = {
["reported_type"] = [[function]],
["ret_val"] = {
["__text"] = [[Nothing for "wait_ms" and "file_readable"; the returned code of the command for "run_command".]],
["__attributes"] = {
["reported_type"] = [[variable]],
},
},
["signature"] = {
["1"] = {
["__text"] = [[The type of yield.]],
["__attributes"] = {
["reported_type"] = {} --[=[API["types"]["yield_type"]]=],
},
},
["2"] = {
["__text"] = [[An extra parameter: integer for "wait_ms", open file for "file_readable", string for "run_command".]],
["__attributes"] = {
["reported_type"] = [[variable]],
},
},
},
},
},
},
},
}
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"].__attributes["ret_val"].__attributes["reported_type"]["delete"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"].__attributes["ret_val"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"].__attributes["ret_val"].__attributes["reported_type"]["duplicate"].__attributes["ret_val"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"].__attributes["ret_val"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"].__attributes["ret_val"].__attributes["reported_type"]["duplicate"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"].__attributes["ret_val"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"].__attributes["ret_val"].__attributes["reported_type"]["apply"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"].__attributes["ret_val"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"].__attributes["ret_val"].__attributes["reported_type"]["export"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"].__attributes["ret_val"].__attributes["reported_type"]
API["darktable"]["styles"]["#"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"].__attributes["ret_val"].__attributes["reported_type"]
API["types"]["dt_style_t"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"].__attributes["ret_val"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["4"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["5"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["6"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["new_storage"].__attributes["ret_val"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]
API["types"]["dt_imageio_module_storage_t"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]
API["types"]["dt_imageio_module_storage_data_email"].__attributes["parent"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]
API["types"]["dt_imageio_module_storage_data_flickr"].__attributes["parent"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]
API["types"]["dt_imageio_module_storage_data_facebook"].__attributes["parent"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]
API["types"]["dt_imageio_module_storage_data_latex"].__attributes["parent"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]
API["types"]["dt_imageio_module_storage_data_picasa"].__attributes["parent"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]
API["types"]["dt_imageio_module_storage_data_gallery"].__attributes["parent"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]
API["types"]["dt_imageio_module_storage_data_disk"].__attributes["parent"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]
API["events"]["intermediate-export-image"]["callback"].__attributes["signature"]["5"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["styles"]["export"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"].__attributes["ret_val"].__attributes["reported_type"]["export"]
API["darktable"]["database"]["duplicate"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["duplicate"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["blue"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["red"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["green"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["red"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["yellow"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["red"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["purple"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["red"]
API["darktable"]["styles"]["delete"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"].__attributes["ret_val"].__attributes["reported_type"]["delete"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["attach_tag"].__attributes["signature"]["1"].__attributes["reported_type"]["detach"].__attributes["signature"]["2"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["attach_tag"].__attributes["signature"]["1"].__attributes["reported_type"]["#"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["attach_tag"].__attributes["signature"]["2"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["get_tags"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"].__attributes["ret_val"].__attributes["reported_type"]["apply"].__attributes["signature"]["2"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["duplicate"].__attributes["ret_val"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["duplicate"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["move"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["move"].__attributes["signature"]["2"].__attributes["reported_type"]["copy_image"].__attributes["ret_val"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["move"].__attributes["signature"]["2"].__attributes["reported_type"]["copy_image"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["move"].__attributes["signature"]["2"].__attributes["reported_type"]["#"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["reset"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["delete"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["group_with"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["group_with"].__attributes["signature"]["2"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["make_group_leader"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["get_group_members"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["group_leader"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["drop_cache"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["2"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["database"]["#"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]
API["types"]["dt_lua_image_t"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]
API["events"]["intermediate-export-image"]["callback"].__attributes["signature"]["2"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]
API["events"]["post-import-image"]["callback"].__attributes["signature"]["2"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["apply_style"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"].__attributes["ret_val"].__attributes["reported_type"]["apply"]
API["darktable"]["styles"]["apply"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"].__attributes["ret_val"].__attributes["reported_type"]["apply"]
API["types"]["comp_type_t"] = API["types"]["dt_imageio_module_format_data_webp"]["comp_type"].__attributes["reported_type"]
API["types"]["hint_t"] = API["types"]["dt_imageio_module_format_data_webp"]["hint"].__attributes["reported_type"]
API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]["reset"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]
API["darktable"]["gui"]["libs"]["styles"].__attributes["parent"] = API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]
API["darktable"]["gui"]["libs"]["metadata_view"].__attributes["parent"] = API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]
API["darktable"]["gui"]["libs"]["metadata"].__attributes["parent"] = API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]
API["darktable"]["gui"]["libs"]["hinter"].__attributes["parent"] = API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]
API["darktable"]["gui"]["libs"]["modulelist"].__attributes["parent"] = API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]
API["darktable"]["gui"]["libs"]["filmstrip"].__attributes["parent"] = API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]
API["darktable"]["gui"]["libs"]["viewswitcher"].__attributes["parent"] = API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]
API["darktable"]["gui"]["libs"]["darktable_label"].__attributes["parent"] = API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]
API["darktable"]["gui"]["libs"]["tagging"].__attributes["parent"] = API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]
API["darktable"]["gui"]["libs"]["geotagging"].__attributes["parent"] = API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]
API["darktable"]["gui"]["libs"]["recentcollect"].__attributes["parent"] = API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]
API["darktable"]["gui"]["libs"]["global_toolbox"].__attributes["parent"] = API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]
API["darktable"]["gui"]["libs"]["filter"].__attributes["parent"] = API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]
API["darktable"]["gui"]["libs"]["import"].__attributes["parent"] = API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]
API["darktable"]["gui"]["libs"]["ratings"].__attributes["parent"] = API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]
API["darktable"]["gui"]["libs"]["select"].__attributes["parent"] = API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]
API["darktable"]["gui"]["libs"]["collect"].__attributes["parent"] = API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]
API["darktable"]["gui"]["libs"]["colorlabels"].__attributes["parent"] = API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]
API["darktable"]["gui"]["libs"]["lighttable_mode"].__attributes["parent"] = API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]
API["darktable"]["gui"]["libs"]["copy_history"].__attributes["parent"] = API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]
API["darktable"]["gui"]["libs"]["image"].__attributes["parent"] = API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]
API["darktable"]["gui"]["libs"]["modulegroups"].__attributes["parent"] = API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]
API["darktable"]["gui"]["libs"]["module_toolbox"].__attributes["parent"] = API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]
API["darktable"]["gui"]["libs"]["session"].__attributes["parent"] = API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]
API["darktable"]["gui"]["libs"]["histogram"].__attributes["parent"] = API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]
API["darktable"]["gui"]["libs"]["export"].__attributes["parent"] = API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]
API["darktable"]["gui"]["libs"]["history"].__attributes["parent"] = API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]
API["darktable"]["gui"]["libs"]["colorpicker"].__attributes["parent"] = API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]
API["darktable"]["gui"]["libs"]["navigation"].__attributes["parent"] = API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]
API["darktable"]["gui"]["libs"]["masks"].__attributes["parent"] = API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]
API["darktable"]["gui"]["libs"]["view_toolbox"].__attributes["parent"] = API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]
API["darktable"]["gui"]["libs"]["live_view"].__attributes["parent"] = API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]
API["darktable"]["gui"]["libs"]["map_settings"].__attributes["parent"] = API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]
API["darktable"]["gui"]["libs"]["camera"].__attributes["parent"] = API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]
API["darktable"]["gui"]["libs"]["location"].__attributes["parent"] = API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]
API["darktable"]["gui"]["libs"]["backgroundjobs"].__attributes["parent"] = API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]
API["types"]["dt_lib_module_t"] = API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"]
API["types"]["snapshot_direction_t"] = API["darktable"]["gui"]["libs"]["snapshots"]["direction"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["move"].__attributes["signature"]["2"].__attributes["reported_type"]["copy_image"].__attributes["signature"]["2"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["move"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["move"].__attributes["signature"]["2"].__attributes["reported_type"]["delete"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["move"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["film"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["move"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["films"]["#"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["move"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["films"]["new"].__attributes["ret_val"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["move"].__attributes["signature"]["2"].__attributes["reported_type"]
API["types"]["dt_lua_film_t"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["move"].__attributes["signature"]["2"].__attributes["reported_type"]
API["events"]["post-import-film"]["callback"].__attributes["signature"]["2"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["move"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["styles"]["duplicate"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"].__attributes["ret_val"].__attributes["reported_type"]["duplicate"]
API["darktable"]["films"]["delete"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["move"].__attributes["signature"]["2"].__attributes["reported_type"]["delete"]
API["darktable"]["gui"]["current_view"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["gui"]["current_view"].__attributes["ret_val"].__attributes["reported_type"]
API["darktable"]["gui"]["views"]["map"].__attributes["parent"] = API["darktable"]["gui"]["current_view"].__attributes["ret_val"].__attributes["reported_type"]
API["darktable"]["gui"]["views"]["darkroom"].__attributes["parent"] = API["darktable"]["gui"]["current_view"].__attributes["ret_val"].__attributes["reported_type"]
API["darktable"]["gui"]["views"]["lighttable"].__attributes["parent"] = API["darktable"]["gui"]["current_view"].__attributes["ret_val"].__attributes["reported_type"]
API["darktable"]["gui"]["views"]["tethering"].__attributes["parent"] = API["darktable"]["gui"]["current_view"].__attributes["ret_val"].__attributes["reported_type"]
API["darktable"]["gui"]["views"]["slideshow"].__attributes["parent"] = API["darktable"]["gui"]["current_view"].__attributes["ret_val"].__attributes["reported_type"]
API["types"]["dt_view_t"] = API["darktable"]["gui"]["current_view"].__attributes["ret_val"].__attributes["reported_type"]
API["events"]["view-changed"]["callback"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["gui"]["current_view"].__attributes["ret_val"].__attributes["reported_type"]
API["events"]["view-changed"]["callback"].__attributes["signature"]["2"].__attributes["reported_type"] = API["darktable"]["gui"]["current_view"].__attributes["ret_val"].__attributes["reported_type"]
API["darktable"]["tags"]["get_tags"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["get_tags"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["move"].__attributes["signature"]["2"].__attributes["reported_type"]["move_image"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["move"]
API["darktable"]["database"]["move_image"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["move"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["detach_tag"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["attach_tag"].__attributes["signature"]["1"].__attributes["reported_type"]["detach"]
API["darktable"]["tags"]["detach"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["attach_tag"].__attributes["signature"]["1"].__attributes["reported_type"]["detach"]
API["darktable"]["styles"]["create"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"]
API["types"]["dt_imageio_j2k_preset_t"] = API["types"]["dt_imageio_module_format_data_j2k"]["preset"].__attributes["reported_type"]
API["types"]["dt_style_item_t"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"].__attributes["ret_val"].__attributes["reported_type"]["#"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["attach_tag"].__attributes["signature"]["1"].__attributes["reported_type"]["delete"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["attach_tag"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["attach_tag"].__attributes["signature"]["1"].__attributes["reported_type"]["detach"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["attach_tag"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["tags"]["#"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["attach_tag"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["tags"]["find"].__attributes["ret_val"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["attach_tag"].__attributes["signature"]["1"].__attributes["reported_type"]
API["types"]["dt_lua_tag_t"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["attach_tag"].__attributes["signature"]["1"].__attributes["reported_type"]
API["types"]["dt_imageio_j2k_format_t"] = API["types"]["dt_imageio_module_format_data_j2k"]["format"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["attach_tag"].__attributes["signature"]["1"].__attributes["reported_type"]["attach"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["attach_tag"]
API["darktable"]["tags"]["attach"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["attach_tag"]
API["darktable"]["database"]["delete"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["delete"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["copy"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["move"].__attributes["signature"]["2"].__attributes["reported_type"]["copy_image"]
API["darktable"]["database"]["copy_image"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["move"].__attributes["signature"]["2"].__attributes["reported_type"]["copy_image"]
API["darktable"]["gui"]["libs"]["snapshots"]["#"].__attributes["reported_type"]["select"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["gui"]["libs"]["snapshots"]["#"].__attributes["reported_type"]
API["types"]["dt_lua_snapshot_t"] = API["darktable"]["gui"]["libs"]["snapshots"]["#"].__attributes["reported_type"]
API["darktable"]["tags"]["delete"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["attach_tag"].__attributes["signature"]["1"].__attributes["reported_type"]["delete"]
API["darktable"]["preferences"]["read"].__attributes["signature"]["3"].__attributes["reported_type"] = API["darktable"]["preferences"]["register"].__attributes["signature"]["3"].__attributes["reported_type"]
API["darktable"]["preferences"]["write"].__attributes["signature"]["3"].__attributes["reported_type"] = API["darktable"]["preferences"]["register"].__attributes["signature"]["3"].__attributes["reported_type"]
API["types"]["lua_pref_type"] = API["darktable"]["preferences"]["register"].__attributes["signature"]["3"].__attributes["reported_type"]
API["system"]["coroutine"]["yield"].__attributes["signature"]["1"].__attributes["reported_type"] = API["types"]["yield_type"]
API["darktable"]["gui"]["create_job"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["gui"]["create_job"].__attributes["ret_val"].__attributes["reported_type"]
API["types"]["dt_lua_backgroundjob_t"] = API["darktable"]["gui"]["create_job"].__attributes["ret_val"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["3"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["5"].__attributes["signature"]["2"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["6"].__attributes["signature"]["2"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["new_format"].__attributes["ret_val"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]
API["types"]["dt_imageio_module_format_t"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]
API["types"]["dt_imageio_module_format_data_png"].__attributes["parent"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]
API["types"]["dt_imageio_module_format_data_tiff"].__attributes["parent"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]
API["types"]["dt_imageio_module_format_data_exr"].__attributes["parent"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]
API["types"]["dt_imageio_module_format_data_copy"].__attributes["parent"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]
API["types"]["dt_imageio_module_format_data_pfm"].__attributes["parent"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]
API["types"]["dt_imageio_module_format_data_jpeg"].__attributes["parent"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]
API["types"]["dt_imageio_module_format_data_ppm"].__attributes["parent"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]
API["types"]["dt_imageio_module_format_data_webp"].__attributes["parent"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]
API["types"]["dt_imageio_module_format_data_j2k"].__attributes["parent"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]
API["events"]["intermediate-export-image"]["callback"].__attributes["signature"]["4"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]
return API
--
-- vim: shiftwidth=2 expandtab tabstop=2 cindent syntax=lua
| gpl-3.0 |
santssoft/darkstar | scripts/globals/items/humpty_dumpty_effigy.lua | 11 | 1096 | -----------------------------------------
-- ID: 5683
-- Item: humpty_dumpty_effigy
-- Food Effect: 3 hours, All Races
-----------------------------------------
-- Max HP % 6 (cap 160)
-- Max MP % 6 (cap 160)
-----------------------------------------
require("scripts/globals/status")
require("scripts/globals/msg")
-----------------------------------------
function onItemCheck(target)
local result = 0
if target:hasStatusEffect(dsp.effect.FOOD) or target:hasStatusEffect(dsp.effect.FIELD_SUPPORT_FOOD) then
result = dsp.msg.basic.IS_FULL
end
return result
end
function onItemUse(target)
target:addStatusEffect(dsp.effect.FOOD,0,0,10800,5683)
end
function onEffectGain(target, effect)
target:addMod(dsp.mod.FOOD_HPP, 6)
target:addMod(dsp.mod.FOOD_HP_CAP, 160)
target:addMod(dsp.mod.FOOD_MPP, 6)
target:addMod(dsp.mod.FOOD_MP_CAP, 160)
end
function onEffectLose(target, effect)
target:delMod(dsp.mod.FOOD_HPP, 6)
target:delMod(dsp.mod.FOOD_HP_CAP, 160)
target:delMod(dsp.mod.FOOD_MPP, 6)
target:delMod(dsp.mod.FOOD_MP_CAP, 160)
end
| gpl-3.0 |
santssoft/darkstar | scripts/globals/mobskills/typhoon.lua | 11 | 1159 | ---------------------------------------------
-- Typhoon
--
-- Description: Spins around dealing damage to targets in an area of effect.
-- Type: Physical
-- Utsusemi/Blink absorb: 2-4 shadows
-- Range: 10' radial
-- Notes:
---------------------------------------------
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 numhits = 4
local accmod = 1
local dmgmod = 0.5
local info = MobPhysicalMove(mob,target,skill,numhits,accmod,dmgmod,TP_NO_EFFECT)
local dmg = MobFinalAdjustments(info.dmg,mob,skill,target,dsp.attackType.PHYSICAL,dsp.damageType.BLUNT,info.hitslanded)
target:takeDamage(dmg, mob, dsp.attackType.PHYSICAL, dsp.damageType.BLUNT)
if (mob:getName() == "Faust") then
if (mob:getLocalVar("Typhoon") == 0) then
mob:useMobAbility(539)
mob:setLocalVar("Typhoon", 1)
else
mob:setLocalVar("Typhoon", 0)
end
end
return dmg
end
| gpl-3.0 |
santssoft/darkstar | scripts/globals/items/slice_of_ziz_meat.lua | 11 | 1070 | -----------------------------------------
-- ID: 5581
-- Item: Slice of Ziz Meat
-- Effect: 5 Minutes, food effect, Galka Only
-----------------------------------------
-- Strength +4
-- Intelligence -6
-----------------------------------------
require("scripts/globals/status")
require("scripts/globals/msg")
-----------------------------------------
function onItemCheck(target)
local result = 0
if (target:getRace() ~= dsp.race.GALKA) then
result = dsp.msg.basic.CANNOT_EAT
end
if (target:getMod(dsp.mod.EAT_RAW_MEAT) == 1) then
result = 0
end
if target:hasStatusEffect(dsp.effect.FOOD) or target:hasStatusEffect(dsp.effect.FIELD_SUPPORT_FOOD) then
result = dsp.msg.basic.IS_FULL
end
return result
end
function onItemUse(target)
target:addStatusEffect(dsp.effect.FOOD,0,0,300,5581)
end
function onEffectGain(target,effect)
target:addMod(dsp.mod.STR, 4)
target:addMod(dsp.mod.INT,-6)
end
function onEffectLose(target,effect)
target:delMod(dsp.mod.STR, 4)
target:delMod(dsp.mod.INT,-6)
end | gpl-3.0 |
m241dan/darkstar | scripts/zones/Bastok_Markets/npcs/Reet.lua | 13 | 1335 | -----------------------------------
-- Area: Bastok Markets
-- NPC: Reet
-- Adventurer's Assistant
-- @zone 235
-- @pos -237 -12 -41
-------------------------------------
package.loaded["scripts/zones/Bastok_Markets/TextIDs"] = nil;
-------------------------------------
require("scripts/globals/settings");
require("scripts/zones/Bastok_Markets/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
if (trade:getItemCount() == 1 and trade:hasItemQty(536,1) == true) then
player:startEvent(0x0006);
end
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
player:startEvent(0x0005);
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 == 0x0006) then
player:tradeComplete();
player:addGil(GIL_RATE*50);
player:messageSpecial(GIL_OBTAINED,GIL_RATE*50);
end
end;
| gpl-3.0 |
santssoft/darkstar | scripts/globals/automatonweaponskills.lua | 10 | 12163 | -- Uses a mixture of mob and player WS formulas
require("scripts/globals/weaponskills");
require("scripts/globals/magicburst");
require("scripts/globals/status");
require("scripts/globals/utils");
require("scripts/globals/magic");
require("scripts/globals/msg");
-- params contains: ftp100, ftp200, ftp300, str_wsc, dex_wsc, vit_wsc, int_wsc, mnd_wsc, canCrit, crit100, crit200, crit300, acc100, acc200, acc300, ignoresDef, ignore100, ignore200, ignore300, atkmulti, kick, accBonus, weaponType, weaponDamage
function doAutoPhysicalWeaponskill(attacker, target, wsID, tp, primaryMsg, action, taChar, wsParams, skill, action)
-- Determine cratio and ccritratio
local ignoredDef = 0
if (wsParams.ignoresDef == not nil and wsParams.ignoresDef == true) then
ignoredDef = calculatedIgnoredDef(tp, target:getStat(dsp.mod.DEF), wsParams.ignored100, wsParams.ignored200, wsParams.ignored300)
end
local cratio, ccritratio = getAutocRatio(attacker, target, wsParams, ignoredDef, true)
-- Set up conditions and wsParams used for calculating weaponskill damage
-- Handle Flame Holder attachment.
-- DSP Mod usage, and values returned by Flame Holder script, might not be correct.
local flameHolderFTP = attacker:getMod(dsp.mod.WEAPONSKILL_DAMAGE_BASE) / 100
local attack =
{
['type'] = dsp.attackType.PHYSICAL,
['slot'] = dsp.slot.MAIN,
['weaponType'] = attacker:getWeaponSkillType(dsp.slot.MAIN),
['damageType'] = attacker:getWeaponDamageType(dsp.slot.MAIN)
}
local calcParams = {}
calcParams.weaponDamage = getMeleeDmg(attacker, attack.weaponType, wsParams.kick)
calcParams.fSTR = utils.clamp(attacker:getStat(dsp.mod.STR) - target:getStat(dsp.mod.VIT), -10, 10)
calcParams.cratio = cratio
calcParams.ccritratio = ccritratio
calcParams.accStat = attacker:getACC()
calcParams.melee = true
calcParams.mustMiss = target:hasStatusEffect(dsp.effect.PERFECT_DODGE) or
(target:hasStatusEffect(dsp.effect.TOO_HIGH) and not wsParams.hitsHigh)
calcParams.sneakApplicable = false
calcParams.taChar = taChar
calcParams.trickApplicable = false
calcParams.assassinApplicable = false
calcParams.guaranteedHit = false
calcParams.mightyStrikesApplicable = attacker:hasStatusEffect(dsp.effect.MIGHTY_STRIKES)
calcParams.forcedFirstCrit = false
calcParams.extraOffhandHit = false
calcParams.hybridHit = false
calcParams.flourishEffect = false
calcParams.alpha = 1
calcParams.bonusWSmods = math.max(attacker:getMainLvl() - target:getMainLvl(), 0)
calcParams.bonusTP = wsParams.bonusTP or 0
calcParams.bonusfTP = flameHolderFTP or 0
calcParams.bonusAcc = 0 + attacker:getMod(dsp.mod.WSACC)
calcParams.hitRate = getAutoHitRate(attacker, target, false, calcParams.bonusAcc, calcParams.melee)
-- Send our wsParams off to calculate our raw WS damage, hits landed, and shadows absorbed
calcParams = calculateRawWSDmg(attacker, target, wsID, tp, action, wsParams, calcParams)
local finaldmg = calcParams.finalDmg
-- Delete statuses that may have been spent by the WS
attacker:delStatusEffectSilent(dsp.effect.BUILDING_FLOURISH)
-- Calculate reductions
if not wsParams.formless then
--finaldmg = target:physicalDmgTaken(finaldmg, attack.damageType)
if (attack.weaponType == dsp.skill.HAND_TO_HAND) then
finaldmg = finaldmg * target:getMod(dsp.mod.HTHRES) / 1000
elseif (attack.weaponType == dsp.skill.DAGGER or attack.weaponType == dsp.skill.POLEARM) then
finaldmg = finaldmg * target:getMod(dsp.mod.PIERCERES) / 1000
elseif (attack.weaponType == dsp.skill.CLUB or attack.weaponType == dsp.skill.STAFF) then
finaldmg = finaldmg * target:getMod(dsp.mod.IMPACTRES) / 1000
else
finaldmg = finaldmg * target:getMod(dsp.mod.SLASHRES) / 1000
end
end
finaldmg = finaldmg * WEAPON_SKILL_POWER -- Add server bonus
calcParams.finalDmg = finaldmg
if calcParams.tpHitsLanded + calcParams.extraHitsLanded > 0 then
finaldmg = takeWeaponskillDamage(target, attacker, wsParams, primaryMsg, attack, calcParams, action)
else
skill:setMsg(dsp.msg.basic.SKILL_MISS)
end
return finaldmg, calcParams.criticalHit, calcParams.tpHitsLanded, calcParams.extraHitsLanded, calcParams.shadowsAbsorbed
end
-- params contains: ftp100, ftp200, ftp300, str_wsc, dex_wsc, vit_wsc, int_wsc, mnd_wsc, canCrit, crit100, crit200, crit300, acc100, acc200, acc300, ignoresDef, ignore100, ignore200, ignore300, atkmulti, accBonus, weaponDamage
function doAutoRangedWeaponskill(attacker, target, wsID, wsParams, tp, primaryMsg, skill, action)
-- Determine cratio and ccritratio
local ignoredDef = 0
if (wsParams.ignoresDef == not nil and wsParams.ignoresDef == true) then
ignoredDef = calculatedIgnoredDef(tp, target:getStat(dsp.mod.DEF), wsParams.ignored100, wsParams.ignored200, wsParams.ignored300)
end
local cratio, ccritratio = getAutocRatio(attacker, target, wsParams, ignoredDef, false)
-- Set up conditions and wsParams used for calculating weaponskill damage
-- Handle Flame Holder attachment.
-- DSP Mod usage, and values returned by Flame Holder script, might not be correct.
local flameHolderFTP = attacker:getMod(dsp.mod.WEAPONSKILL_DAMAGE_BASE) / 100
local attack =
{
['type'] = dsp.attackType.RANGED,
['slot'] = dsp.slot.RANGED,
['weaponType'] = attacker:getWeaponSkillType(dsp.slot.RANGED),
['damageType'] = attacker:getWeaponDamageType(dsp.slot.RANGED)
}
local calcParams =
{
weaponDamage = {wsParams.weaponDamage or attacker:getRangedDmg()},
fSTR = utils.clamp(attacker:getStat(dsp.mod.STR) - target:getStat(dsp.mod.VIT), -10, 10),
cratio = cratio,
ccritratio = ccritratio,
accStat = attacker:getRACC(),
melee = false,
mustMiss = false,
sneakApplicable = false,
trickApplicable = false,
assassinApplicable = false,
mightyStrikesApplicable = false,
forcedFirstCrit = false,
extraOffhandHit = false,
flourishEffect = false,
alpha = 1,
bonusWSmods = math.max(attacker:getMainLvl() - target:getMainLvl(), 0),
bonusTP = wsParams.bonusTP or 0,
bonusfTP = flameHolderFTP or 0,
bonusAcc = 0 + attacker:getMod(dsp.mod.WSACC)
}
calcParams.hitRate = getAutoHitRate(attacker, target, false, calcParams.bonusAcc, calcParams.melee)
-- Send our params off to calculate our raw WS damage, hits landed, and shadows absorbed
calcParams = calculateRawWSDmg(attacker, target, wsID, tp, action, wsParams, calcParams)
local finaldmg = calcParams.finalDmg
-- Calculate reductions
finaldmg = target:rangedDmgTaken(finaldmg)
finaldmg = finaldmg * target:getMod(dsp.mod.PIERCERES) / 1000
finaldmg = finaldmg * WEAPON_SKILL_POWER -- Add server bonus
calcParams.finalDmg = finaldmg
if calcParams.tpHitsLanded + calcParams.extraHitsLanded > 0 then
finaldmg = takeWeaponskillDamage(target, attacker, wsParams, primaryMsg, attack, calcParams, action)
else
skill:setMsg(dsp.msg.basic.SKILL_MISS)
end
return finaldmg, calcParams.criticalHit, calcParams.tpHitsLanded, calcParams.extraHitsLanded, calcParams.shadowsAbsorbed
end
function getAutoHitRate(attacker,defender,capHitRate,bonus,melee)
local acc = (melee and attacker:getACC() or attacker:getRACC()) + (bonus or 0);
local eva = defender:getEVA();
local levelbonus = 0;
if (attacker:getMainLvl() > defender:getMainLvl()) then
levelbonus = 2 * (attacker:getMainLvl() - defender:getMainLvl());
end
local hitrate = acc - eva + levelbonus + 75;
hitrate = hitrate/100;
-- Applying hitrate caps
if (capHitRate) then -- this isn't capped for when acc varies with tp, as more penalties are due
hitrate = utils.clamp(hitrate, 0.2, 0.95);
end
return hitrate;
end;
-- Given the raw ratio value (atk/def) and levels, returns the cRatio (min then max)
function getAutocRatio(attacker, defender, params, ignoredDef, melee)
local cratio = (melee and attacker:getStat(dsp.mod.ATT) or attacker:getRATT()) * params.atkmulti / (defender:getStat(dsp.mod.DEF) - ignoredDef)
local levelbonus = 0;
if attacker:getMainLvl() > defender:getMainLvl() then
levelbonus = 0.05 * (attacker:getMainLvl() - defender:getMainLvl())
end
cratio = cratio + levelbonus
cratio = utils.clamp(cratio, 0, melee and 4.0 or 3.0)
local pdif = {}
local pdifcrit = {}
if melee then
local pdifmin = 0
local pdifmax = 1
if cratio < 0.5 then
pdifmax = cratio + 0.5
elseif 0.5 <= cratio and cratio <= 0.7 then
pdifmax = 1
elseif 0.7 < cratio and cratio <= 1.2 then
pdifmax = cratio + 0.3
elseif 1.2 < cratio and cratio <= 1.5 then
pdifmax = (cratio * 0.25) + cratio
elseif 1.5 < cratio and cratio <= 2.625 then
pdifmax = cratio + 0.375
elseif 2.625 < cratio and cratio <= 3.25 then
pdifmax = 3
else
pdifmax = cratio
end
if cratio < 0.38 then
pdifmin = 0
elseif 0.38 <= cratio and cratio <= 1.25 then
pdifmin = cratio * 1176 / 1024 - 448 / 1024
elseif 1.25 < cratio and cratio <= 1.51 then
pdifmin = 1
elseif 1.51 < cratio and cratio <= 2.44 then
pdifmin = cratio * 1176 / 1024 - 775 / 1024
else
pdifmin = cratio - 0.375
end
pdif[1] = pdifmin
pdif[2] = pdifmax
cratio = cratio + 1
cratio = utils.clamp(cratio, 0, 4.0)
-- printf("ratio: %f min: %f max %f\n", cratio, pdifmin, pdifmax)
if cratio < 0.5 then
pdifmax = cratio + 0.5
elseif 0.5 <= cratio and cratio <= 0.7 then
pdifmax = 1
elseif 0.7 < cratio and cratio <= 1.2 then
pdifmax = cratio + 0.3;
elseif 1.2 < cratio and cratio <= 1.5 then
pdifmax = cratio * 0.25 + cratio;
elseif 1.5 < cratio and cratio <= 2.625 then
pdifmax = cratio + 0.375
elseif 2.625 < cratio and cratio <= 3.25 then
pdifmax = 3
else
pdifmax = cratio
end
if cratio < 0.38 then
pdifmin = 0
elseif 0.38 <= cratio and cratio <= 1.25 then
pdifmin = cratio * 1176 / 1024 - 448 / 1024
elseif 1.25 < cratio and cratio <= 1.51 then
pdifmin = 1
elseif 1.51 < cratio and cratio <= 2.44 then
pdifmin = cratio * 1176 / 1024 - 775 / 1024
else
pdifmin = cratio - 0.375
end
local critbonus = attacker:getMod(dsp.mod.CRIT_DMG_INCREASE) - defender:getMod(dsp.mod.CRIT_DEF_BONUS);
critbonus = utils.clamp(critbonus, 0, 100)
pdifcrit[1] = pdifmin * (100 + critbonus) / 100
pdifcrit[2] = pdifmax * (100 + critbonus) / 100
else
-- max
local pdifmax = 0
if cratio < 0.9 then
pdifmax = cratio * 10 / 9
elseif cratio < 1.1 then
pdifmax = 1
else
pdifmax = cratio
end
-- min
local pdifmin = 0
if cratio < 0.9 then
pdifmin = cratio
elseif cratio < 1.1 then
pdifmin = 1
else
pdifmin = cratio * 20 / 19 - 3 / 19
end
pdif[1] = pdifmin
pdif[2] = pdifmax
-- printf("ratio: %f min: %f max %f\n", cratio, pdifmin, pdifmax)
pdifmin = pdifmin * 1.25
pdifmax = pdifmax * 1.25
local critbonus = attacker:getMod(dsp.mod.CRIT_DMG_INCREASE) - defender:getMod(dsp.mod.CRIT_DEF_BONUS);
critbonus = utils.clamp(critbonus, 0, 100)
pdifcrit[1] = pdifmin * (100 + critbonus) / 100
pdifcrit[2] = pdifmax * (100 + critbonus) / 100
end
return pdif, pdifcrit
end
| gpl-3.0 |
santssoft/darkstar | scripts/zones/Crawlers_Nest/npcs/qm9.lua | 9 | 1178 | -----------------------------------
-- Area: Crawlers Nest
-- NPC: ???
-- Used In Quest: A Boy's Dream
-- !pos -18 -8 124 197
-----------------------------------
local ID = require("scripts/zones/Crawlers_Nest/IDs")
require("scripts/globals/npc_util")
require("scripts/globals/quests")
-----------------------------------
function onTrade(player,npc,trade)
end
function onTrigger(player,npc)
if player:getQuestStatus(SANDORIA, dsp.quest.id.sandoria.A_BOY_S_DREAM) == QUEST_ACCEPTED and VanadielDayOfTheYear() ~= player:getCharVar("DreadbugNM_Day") then
if os.time() > player:getCharVar("DreadbugNM_Timer") + 30 and npcUtil.popFromQM(player, npc, ID.mob.DREADBUG, {claim=true, hide=0}) then
player:messageSpecial(ID.text.SENSE_OF_FOREBODING)
player:setCharVar("DreadbugNM_Timer", os.time() + 180)
player:setCharVar("DreadbugNM_Day", VanadielDayOfTheYear())
else
player:messageSpecial(ID.text.NOTHING_SEEMS_TO_HAPPEN)
end
else
player:messageSpecial(ID.text.NOTHING_WILL_HAPPEN_YET)
end
end
function onEventUpdate(player,csid,option)
end
function onEventFinish(player,csid,option)
end | gpl-3.0 |
m241dan/darkstar | scripts/zones/Bastok_Mines/npcs/Babenn.lua | 12 | 2348 | -----------------------------------
-- Area: Bastok Mines
-- NPC: Babenn
-- Finishes Quest: The Eleventh's Hour
-- Involved in Quests: Riding on the Clouds
-- @zone 234
-- @pos 73 -1 34
-----------------------------------
package.loaded["scripts/zones/Bastok_Mines/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/settings");
require("scripts/globals/titles");
require("scripts/globals/keyitems");
require("scripts/globals/quests");
require("scripts/zones/Bastok_Mines/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
if (player:getQuestStatus(JEUNO,RIDING_ON_THE_CLOUDS) == QUEST_ACCEPTED and player:getVar("ridingOnTheClouds_2") == 1) then
if (trade:hasItemQty(1127,1) and trade:getItemCount() == 1) then -- Trade Kindred seal
player:setVar("ridingOnTheClouds_2",0);
player:tradeComplete();
player:addKeyItem(SMILING_STONE);
player:messageSpecial(KEYITEM_OBTAINED,SMILING_STONE);
end
end
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
if (player:getQuestStatus(BASTOK,THE_ELEVENTH_S_HOUR) == QUEST_ACCEPTED and player:getVar("EleventhsHour") == 1) then
player:startEvent(0x002d);
else
player:startEvent(0x0028);
end
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
--printf("CSID2: %u",csid);
--printf("RESULT2: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
if (csid == 0x002d) then
if (player:getFreeSlotsCount() > 1) then
player:setVar("EleventhsHour",0);
player:delKeyItem(OLD_TOOLBOX);
player:addTitle(PURSUER_OF_THE_TRUTH);
player:addItem(16629);
player:messageSpecial(ITEM_OBTAINED,16629);
player:addFame(BASTOK,30);
player:completeQuest(BASTOK,THE_ELEVENTH_S_HOUR);
else
player:messageSpecial(ITEM_CANNOT_BE_OBTAINED, 16629);
end
end
end; | gpl-3.0 |
santssoft/darkstar | scripts/globals/mobskills/chains_of_envy.lua | 12 | 1259 | ---------------------------------------------
-- Chains of Envy
--
---------------------------------------------
local ID = require("scripts/zones/Empyreal_Paradox/IDs")
require("scripts/globals/monstertpmoves")
require("scripts/globals/keyitems")
require("scripts/globals/settings")
require("scripts/globals/status")
require("scripts/globals/msg")
---------------------------------------------
function onMobSkillCheck(target,mob,skill)
local targets = mob:getEnmityList()
for i,v in pairs(targets) do
if (v.entity:isPC()) then
local race = v.entity:getRace()
if (race == dsp.race.MITHRA) and not v.entity:hasKeyItem(dsp.ki.LIGHT_OF_DEM) then
mob:showText(mob, ID.text.PROMATHIA_TEXT + 3)
return 0
end
end
end
return 1
end
function onMobWeaponSkill(target, mob, skill)
local typeEffect = dsp.effect.TERROR
local power = 30
local duration = 30
if target:isPC() and ((target:getRace() == dsp.race.MITHRA) and not target:hasKeyItem(dsp.ki.LIGHT_OF_DEM)) then
skill:setMsg(MobStatusEffectMove(mob, target, typeEffect, power, 0, duration))
else
skill:setMsg(dsp.msg.basic.SKILL_NO_EFFECT)
end
return typeEffect
end
| gpl-3.0 |
santssoft/darkstar | scripts/zones/Port_San_dOria/npcs/Prietta.lua | 9 | 1171 | -----------------------------------
-- Area: Port San d'Oria
-- NPC: Prietta
-- Standard Info NPC
-----------------------------------
local ID = require("scripts/zones/Port_San_dOria/IDs");
require("scripts/globals/quests");
-----------------------------------
function onTrade(player,npc,trade)
if (player:getQuestStatus(SANDORIA,dsp.quest.id.sandoria.FLYERS_FOR_REGINE) == QUEST_ACCEPTED) then
if (trade:hasItemQty(532,1) and trade:getItemCount() == 1 and player:getCharVar("tradePrietta") == 0) then
player:messageSpecial(ID.text.PRIETTA_DIALOG);
player:addCharVar("FFR", -1)
player:setCharVar("tradePrietta",1);
player:messageSpecial(ID.text.FLYER_ACCEPTED);
player:messageSpecial(ID.text.FLYERS_HANDED,17 - player:getCharVar("FFR"));
player:tradeComplete();
elseif (player:getCharVar("tradePrietta") ==1) then
player:messageSpecial(ID.text.FLYER_ALREADY);
end
end
end;
function onTrigger(player,npc)
player:startEvent(596);
end;
function onEventUpdate(player,csid,option)
end;
function onEventFinish(player,csid,option)
end;
| gpl-3.0 |
mday299/ardupilot | libraries/AP_Scripting/examples/mission-edit-demo.lua | 6 | 9732 | -- mission editing demo lua script.
-- by Buzz 2020
current_pos = nil
home = 0
a = {}
demostage = 0
eventcounter = 0
function update () -- periodic function that will be called
current_pos = ahrs:get_position()
-- adds new/extra mission item at the end by copying the last one and modifying it
-- get number of last mission item
wp_num = mission:num_commands()-1
--get last item from mission
m = mission:get_item(wp_num)
-- get first item from mission
m1 = mission:get_item(1)
if wp_num > 0 then
gcs:send_text(0, string.format("LUA - Please clear misn to continue demo. size:%d",wp_num+1))
return update, 1000
end
-- no mission, just home at [0] means user has cleared any mission in the system, and this demo is clear to write something new.
-- it's not required that the mission be empty before we do things, but this script is multi-stage demo so its conveneient
if ( mission:num_commands() == 1) then
if demostage == 0 then
demostage = 1
gcs:send_text(0, string.format("LUA demo stage 1 starting"))
return stage1, 1000
end
if demostage == 2 then
demostage = 3
gcs:send_text(0, string.format("LUA demo stage 3 starting"))
return stage3, 1000
end
if demostage == 4 then
demostage = 5
gcs:send_text(0, string.format("LUA demo stage 5 starting"))
return stage5, 1000
end
if demostage == 6 then
demostage = 7
gcs:send_text(0, string.format("LUA demo stage 7 starting"))
return stage7, 1000
end
if demostage == 8 then
demostage = 9
gcs:send_text(0, string.format("LUA MISSION demo all COMPLETED."))
--return update, 1000
end
end
return update, 1000
end
function read_table_from_sd()
-- Opens a file in read mode
file = io.open("miss.txt", "r")
-- sets the default input file as xxxx.txt
io.input(file)
-- read whole file, or get empty string
content = io.read("*all")
if (content == nil) then
gcs:send_text(0, string.format("file not found, skipping read of miss.txt from sd"))
return update(), 1000
end
local pat = "wp:(%S+)%s+lat:(%S+)%s+lon:(%S+)%s+alt:(%S+)"
for s1, s2 ,s3,s4 in string.gmatch(content, pat) do
--s = string.format("wp:%s lat:%s lon:%s alt:%s",s1,s2,s3,s4)
--gcs:send_text(0, s)
n1 = tonumber(s1)
n2 = math.floor(tonumber(s2*10000000))
n3 = math.floor(tonumber(s3*10000000))
n4 = tonumber(s4)
-- use previous item as template...
m = mission:get_item(mission:num_commands()-1)
m:command(16) -- 16 = normal WAYPOINT
m:x(n2)
m:y(n3)
m:z(n4)
-- write as a new item to the end of the list.
mission:set_item(mission:num_commands(),m)
end
gcs:send_text(0, '...loaded file from SD')
-- closes the open file
io.close(file)
return update(), 1000
end
function stage1 ()
-- demo stage 1 implementation.
if (demostage == 1 ) and ( mission:num_commands() == 1 ) then
demostage = 2
return read_table_from_sd(), 1000
end
end
function stage3 ()
-- demo stage 3 implementation.
--get number of 'last' mission item
wp_num = mission:num_commands()-1
-- get HOME item from mission as the 'reference' for future items
m1 = mission:get_item(0)
--get last item from mission
m = mission:get_item(wp_num)
if (demostage == 3 ) then
-- demo stage 3 starts by writing 10 do-JUMPS over 10 seconds, just for fun
if mission:num_commands() < 10 then
m:command(177) -- 177 = DO_JUMP
m:param1(m:param1()+1) -- some increments for fun/demo
m:param2(m:param2()+1)
gcs:send_text(0, string.format("LUA new miss-item DO_JUMP %d ", wp_num+1))
mission:set_item(mission:num_commands(),m)
return stage3, 100 -- stay in stage 3 for now
end
-- change copy of last item slightly, for giggles and demo.
-- This is reading a copy of whatever is currently the last item in the mission, do_jump
-- and changing/ensuring its type is a 'normal' waypoint, and setting its lat/long/alt
-- to data we earlier took from HOME, adding an offset and then writing it
-- as a NEW mission item at the end
if mission:num_commands() == 10 then
m:command(16) -- 16 = normal WAYPOINT
m:x(m1:x()+200)
m:y(m1:y()+200)
m:z(m1:z()+1)
gcs:send_text(0, string.format("LUA new miss-item WAYPOINT a %d ", wp_num+1))
mission:set_item(mission:num_commands(),m)
return stage3, 100 -- stay in stage 3 for now
end
-- change copy of last item slightly, for giggles, and append as a new item
if (mission:num_commands() > 10) and (mission:num_commands() < 20) then
m:command(16) -- 16 = normal WAYPOINT
m:x(m:x()+200)
m:y(m:y()+200)
m:z(m:z()+1)
gcs:send_text(0, string.format("LUA new miss-item WAYPOINT b %d ", wp_num+1))
mission:set_item(mission:num_commands(),m)
return stage3, 100 -- stay in stage 3 for now
end
-- change copy of last item slightly, for giggles.
if (mission:num_commands() >= 20) and (mission:num_commands() < 30) then
m:command(16) -- 16 = normal WAYPOINT
m:x(m:x()+200)
m:y(m:y()+200)
m:z(m:z()+1)
gcs:send_text(0, string.format("LUA new miss-item WAYPOINT c %d ", wp_num+1))
mission:set_item(mission:num_commands(),m)
return stage3, 100 -- stay in stage 3 for now
end
-- move on at end of this dempo stage
if (mission:num_commands() >= 30) then
gcs:send_text(0, string.format("LUA DEMO stage 3 done. ", wp_num+1))
demostage = 4
return update, 100 -- drop to next stage via an update() call
end
end
end
function stage5 ()
-- demo stage 5 implementation for when there's only one wp , HOME, in th system
if (demostage == 5 ) then
-- when no mission, uses home as reference point, otherwise its the 'last item'
m = mission:get_item(mission:num_commands()-1)
m:x(m:x())
m:y(m:y()-400)
m:z(m:z())
mission:set_item(1,m)
gcs:send_text(0, string.format("LUA mode 5 single wp nudge %d",eventcounter))
eventcounter = eventcounter+1
if eventcounter > 50 then
demostage = 6
eventcounter = 0
gcs:send_text(0, string.format("LUA DEMO stage 5 done. "))
return update, 100 -- drop to next stage via an update() call
end
return stage5, 100 -- stay in stage 3 for now
end
end
function stage7 ()
-- demo stage 5 implementation for when there's more than wp in the system
if (demostage == 7 ) then --and (mission:num_commands() >= 3) and (mission:num_commands() < 50) then
-- fiurst time in , there's no mission, lets throw a few wps in to play with later..
-- change copy of last item slightly, for giggles, and append as a new item
if (mission:num_commands() == 1) then
for x = 1, 10 do
m:command(16) -- 16 = normal WAYPOINT
m:x(m:x()+math.random(-10000,10000)) -- add something random
m:y(m:y()+math.random(-10000,10000))
m:z(m:z()+1)
gcs:send_text(0, string.format("LUA stage 7 making 10 new nearby random wp's %d ", wp_num+1))
mission:set_item(mission:num_commands(),m)
end
gcs:send_text(0, string.format("LUA scattering complete. %d ", wp_num+1))
return stage7, 100 -- stay in stage 3 for now
end
-- things that are further away from this one than distance X..
m1 = mission:get_item(1)
-- leave item 0 alone, always
for x = 1, mission:num_commands()-1 do
mitem = mission:get_item(x)
-- look at each mission item above 1, and get the distance from it to the copter.
local target = Location()
target:lat(mitem:x())
target:lng(mitem:y())
local cur_d = current_pos:get_distance(target)
if cur_d > 100 then
if mitem:x() > m1:x() then
mitem:x(mitem:x()+400)
end
if mitem:x() < m1:x() then
mitem:x(mitem:x()-400)
end
if mitem:y() > m1:y() then
mitem:y(mitem:y()+400)
end
if mitem:y() < m1:y() then
mitem:y(mitem:y()-400)
end
end
-- write as a new item to the end of the list.
mission:set_item(x,mitem)
end
gcs:send_text(0, string.format("LUA mode 7 scattering existing wp's.. %d",eventcounter))
end
-- do it 50 times then consider it done
eventcounter = eventcounter+1
if eventcounter > 50 then
demostage = 8
eventcounter = 0
gcs:send_text(0, string.format("LUA DEMO stage 7 done. "))
return update, 100 -- drop to next stage via an update() call
end
return stage7, 500
end
function wait_for_home()
current_pos = ahrs:get_position()
if current_pos == nil then
return wait_for_home, 1000
end
home = ahrs:get_home()
if home == nil then
return wait_for_home, 1000
end
if home:lat() == 0 then
return wait_for_home, 1000
end
gcs:send_text(0, string.format("LUA MISSION Waiting for Home."))
return update, 1000
end
function delayed_boot()
gcs:send_text(0, string.format("LUA MISSION DEMO START"))
return wait_for_home, 1000
end
return delayed_boot, 5000
| gpl-3.0 |
Newbrict/ObjHunt | gamemode/gui/main_hud.lua | 1 | 8320 | -- the font I will use for info
surface.CreateFont( "ObjHUDFont",
{
font = "Helvetica",
size = 40,
weight = 2000,
antialias = true,
outline = false
})
surface.CreateFont( "barHUD",
{
font = "Helvetica",
size = 16,
weight = 1000,
antialias = false,
outline = true
})
--[[=======================]]--
--[[ This has all the bars ]]--
--[[=======================]]--
local function ObjHUD()
local ply = LocalPlayer()
if( !ply:IsValid() ) then return end
local width = 200
local height = 125
local padding = 10
local iconX = padding
local barX = padding*2 + 16
local startY = ScrH()
-- random color just to let the icon draw
surface.SetDrawColor( PANEL_BORDER )
-- HP GUI
if( ply:Alive() && ( ply:Team() == TEAM_PROPS || ply:Team() == TEAM_HUNTERS ) ) then
startY = startY - padding - 16
-- icon
local heartMat = Material("icon16/heart.png", "unlitgeneric")
surface.SetMaterial( heartMat )
surface.DrawTexturedRect( iconX, startY, 16 , 16)
-- bar
hpFrac = math.Clamp( ply:Health(), 0, 100 )/100
local widthOffset = width - (padding*3) - 16
surface.SetDrawColor( PANEL_FILL )
surface.DrawRect( barX, startY, widthOffset, 16)
surface.SetDrawColor( HP_COLOR )
surface.DrawRect( barX, startY, widthOffset*hpFrac, 16)
surface.SetDrawColor( PANEL_BORDER )
surface.DrawOutlinedRect( barX, startY, widthOffset, 16)
--text
surface.SetFont( "barHUD" )
surface.SetTextColor( 255, 255, 255, 255 )
local textToDraw = LocalPlayer():Health()
local textWidth, textHeight = surface.GetTextSize( textToDraw )
local textX = barX + 3
local textY = startY
surface.SetTextPos( textX, textY )
surface.DrawText( textToDraw )
end
-- PROP COOLDOWN GUI
if( ply:Alive() && ply:Team() == TEAM_PROPS ) then
-- this needs to be here otherwise some people get errors for some unknown reason
if( ply.viewOrigin == nil || ply.wantThirdPerson == nil ) then return end
if( ply.lastPropChange == nil ) then return end
startY = startY - padding - 16
-- icon
local propMat = Material("icon16/package.png", "unlitgeneric")
surface.SetMaterial( propMat )
surface.DrawTexturedRect( iconX, startY, 16 , 16)
-- bar
local propFrac = math.Clamp( CurTime() - ply.lastPropChange , 0, PROP_CHOOSE_COOLDOWN)/PROP_CHOOSE_COOLDOWN
local propColor = LerpColor( propFrac, DEPLETED_COLOR, FULL_COLOR )
local widthOffset = width - (padding*3) - 16
surface.SetDrawColor( PANEL_FILL )
surface.DrawRect( barX, startY, widthOffset, 16)
surface.SetDrawColor( propColor )
surface.DrawRect( barX, startY, widthOffset*propFrac, 16)
surface.SetDrawColor( PANEL_BORDER )
surface.DrawOutlinedRect( barX, startY, widthOffset, 16)
--text
local textToDraw = PROP_CHOOSE_COOLDOWN - propFrac*PROP_CHOOSE_COOLDOWN
textToDraw = math.ceil( textToDraw )
if( textToDraw != 0 ) then
surface.SetFont( "barHUD" )
surface.SetTextColor( 255, 255, 255, 255 )
local textWidth, textHeight = surface.GetTextSize( textToDraw )
local textX = barX + 3
local textY = startY
surface.SetTextPos( textX, textY )
surface.DrawText( textToDraw )
end
end
-- TAUNT COOLDOWN GUI
if( ply:Alive() && ( ply:Team() == TEAM_PROPS || ply:Team() == TEAM_HUNTERS ) ) then
-- defaults
if( !ply.lastTaunt ) then
LocalPlayer().lastTaunt = 0
LocalPlayer().lastTauntDuration = 1
LocalPlayer().lastTauntPitch = 100
end
startY = startY - padding - 16
-- icon
local tauntMat = Material("icon16/music.png", "unlitgeneric")
surface.SetMaterial( tauntMat )
surface.DrawTexturedRect( iconX, startY, 16 , 16)
-- bar
local tauntFrac = math.Clamp( CurTime() - ply.lastTaunt , 0, ply.lastTauntDuration)/ply.lastTauntDuration
local tauntColor = TAUNT_BAR_COLOR
local widthOffset = width - (padding*3) - 16
surface.SetDrawColor( PANEL_FILL )
surface.DrawRect( barX, startY, widthOffset, 16)
surface.SetDrawColor( tauntColor )
surface.DrawRect( barX, startY, widthOffset*tauntFrac, 16)
surface.SetDrawColor( PANEL_BORDER )
surface.DrawOutlinedRect( barX, startY, widthOffset, 16)
--text
local textToDraw = ply.lastTauntDuration - tauntFrac*ply.lastTauntDuration
textToDraw = math.ceil( textToDraw )
if( textToDraw != 0 ) then
surface.SetFont( "barHUD" )
surface.SetTextColor( 255, 255, 255, 255 )
local textWidth, textHeight = surface.GetTextSize( textToDraw )
local textX = barX + 3
local textY = startY
surface.SetTextPos( textX, textY )
surface.DrawText( textToDraw )
end
end
-- INFO GUI
startY = startY - padding - 16
-- icon
local infoMat = Material("icon16/information.png", "unlitgeneric")
surface.SetMaterial( infoMat )
surface.DrawTexturedRect( iconX, startY, 16 , 16)
--text
surface.SetFont( "barHUD" )
surface.SetTextColor( 255, 255, 255, 255 )
local textToDraw = "Press F1 For Information"
local textWidth, textHeight = surface.GetTextSize( textToDraw )
local textX = barX
local textY = startY
surface.SetTextPos( textX, textY )
surface.DrawText( textToDraw )
end
--[[=========================]]--
--[[ This has the round info ]]--
--[[=========================]]--
local function RoundHUD()
local ply = LocalPlayer()
if( !ply:IsValid() ) then return end
local width = 200
local height = 50
local padding = 10
local startY = ScrH() - padding - height
local startX = ScrW() - padding - width
startX = startX/2
-- box with border
surface.SetDrawColor( ROUND_TIME_COLOR )
surface.DrawRect( startX, startY, width, height)
surface.SetDrawColor( PANEL_BORDER )
surface.DrawOutlinedRect( startX, startY, width, height)
local lineX = startX + width/2
local lineY = startY + height - 1
local box1Width = lineX - startX
local box2Width = startX + width - lineX
if( round.state ) then
-- labels for round/ time left
surface.SetFont( "InfoFont" )
surface.SetTextColor( 255, 255, 255, 255 )
local textToDraw = "Time"
local textWidth, textHeight = surface.GetTextSize( textToDraw )
local textX = startX + box1Width/2 - textWidth/2
local textY = startY - textHeight
surface.SetTextPos( textX, textY )
surface.DrawText( textToDraw )
textToDraw = "Round"
textWidth, textHeight = surface.GetTextSize( textToDraw )
textX = lineX + box2Width/2 - textWidth/2
surface.SetTextPos( textX, textY )
surface.DrawText( textToDraw )
surface.DrawLine( lineX, lineY, lineX, startY)
-- Time left text
surface.SetFont( "ObjHUDFont" )
surface.SetTextColor( 255, 255, 255, 255 )
if( round.startTime == 0 || round.state == 3 ) then
textToDraw = "00:00"
else
local secs = CurTime() - round.startTime + round.timePad
secs = OBJHUNT_ROUND_TIME - secs
secs = math.max( 0, secs )
secs = math.Round( secs, 0 )
textToDraw = string.FormattedTime( secs, "%02i:%02i" )
end
textWidth, textHeight = surface.GetTextSize( textToDraw )
textX = startX + box1Width/2 - textWidth/2
textY = startY + height/2 - textHeight/2
surface.SetTextPos( textX, textY )
surface.DrawText( textToDraw )
-- Rounds text
textToDraw = round.current.."/"..OBJHUNT_ROUNDS
textWidth, textHeight = surface.GetTextSize( textToDraw )
textX = lineX + box2Width/2 - textWidth/2
textY = startY + height/2 - textHeight/2
surface.SetTextPos( textX, textY )
surface.DrawText( textToDraw )
end
end
--[[=========================]]--
--[[ This has spectater info ]]--
--[[=========================]]--
local function SpectateHUD()
local ply = LocalPlayer()
if( !ply:IsValid() ) then return end
local sTarget = ply:GetObserverTarget()
if( !sTarget ) then return end
if( !sTarget:IsPlayer() ) then return end --Fix console errors--
local sNick = sTarget:Nick()
local padding = 10
local fColor
if( sTarget:Team() == TEAM_HUNTERS ) then
fColor = TEAM_HUNTERS_COLOR
else
fColor = TEAM_PROPS_COLOR
end
local dColor = LerpColor( .70, fColor, Color(255,255,255,255) )
surface.SetFont( "ObjHUDFont" )
surface.SetTextColor( dColor )
local textWidth, textHeight = surface.GetTextSize( sNick )
local textX = ScrW()/2 - textWidth/2
local textY = padding*2
local width = textWidth + 2*padding
local height = textHeight + 2*padding
surface.SetTextPos( textX, textY )
surface.DrawText( sNick )
end
hook.Add("HUDPaint", "Main ObjHunt HUD", ObjHUD )
hook.Add("HUDPaint", "Round HUD", RoundHUD )
hook.Add("HUDPaint", "Spec HUD", SpectateHUD ) | apache-2.0 |
ch3n2k/luci | applications/luci-diag-devinfo/luasrc/model/cbi/luci_diag/smap_devinfo_mini.lua | 141 | 1031 | --[[
smap_devinfo - SIP Device Information
(c) 2009 Daniel Dickinson
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$
]]--
require("luci.i18n")
require("luci.util")
require("luci.sys")
require("luci.model.uci")
require("luci.controller.luci_diag.smap_common")
require("luci.controller.luci_diag.devinfo_common")
local debug = false
m = SimpleForm("luci-smap-to-devinfo", translate("Phone Information"), translate("Scan for supported SIP devices on specified networks."))
m.reset = false
m.submit = false
local outnets = luci.controller.luci_diag.smap_common.get_params()
luci.controller.luci_diag.devinfo_common.run_processes(outnets, luci.controller.luci_diag.smap_common.command_function)
luci.controller.luci_diag.devinfo_common.parse_output(m, outnets, true, "smap", true, debug)
luci.controller.luci_diag.smap_common.action_links(m, true)
return m
| apache-2.0 |
santssoft/darkstar | scripts/globals/weaponskills/metatron_torment.lua | 10 | 2376 | -----------------------------------
-- Metatron Torment
-- Hand-to-Hand Skill level: 5 Description: Delivers a threefold attack. Damage varies wit weapon skill
-- Great Axe Weapon Skill
-- Skill Level: N/A
-- Lowers target's defense. Additional effect: temporarily lowers damage taken from enemies.
-- Defense Down effect is 18.5%, 1 minute duration.
-- Damage reduced is 20.4% or 52/256.
-- Lasts 20 seconds at 100TP, 40 seconds at 200TP and 60 seconds at 300TP.
-- Available only when equipped with the Relic Weapons Abaddon Killer (Dynamis use only) or Bravura.
-- Also available as a Latent effect on Barbarus Bhuj
-- Since these Relic Weapons are only available to Warriors, only Warriors may use this Weapon Skill.
-- Aligned with the Flame Gorget & Light Gorget.
-- Aligned with the Flame Belt & Light Belt.
-- Element: None
-- Modifiers: STR:60%
-- 100%TP 200%TP 300%TP
-- 2.75 2.75 2.75
-----------------------------------
require("scripts/globals/aftermath")
require("scripts/globals/settings")
require("scripts/globals/status")
require("scripts/globals/weaponskills")
-----------------------------------
function onUseWeaponSkill(player, target, wsID, tp, primary, action, taChar)
local params = {}
params.numHits = 1
params.ftp100 = 2.75 params.ftp200 = 2.75 params.ftp300 = 2.75
params.str_wsc = 0.6 params.dex_wsc = 0.0 params.vit_wsc = 0.0 params.agi_wsc = 0.0 params.int_wsc = 0.0 params.mnd_wsc = 0.0 params.chr_wsc = 0.0
params.crit100 = 0.0 params.crit200 = 0.0 params.crit300 = 0.0
params.canCrit = false
params.acc100 = 0.0 params.acc200= 0.0 params.acc300= 0.0
params.atk100 = 1; params.atk200 = 1; params.atk300 = 1;
if USE_ADOULIN_WEAPON_SKILL_CHANGES then
params.str_wsc = 0.8
end
local damage, criticalHit, tpHits, extraHits = doPhysicalWeaponskill(player, target, wsID, params, tp, action, primary, taChar)
if damage > 0 then
if not target:hasStatusEffect(dsp.effect.ATTACK_DOWN) then
local duration = tp / 1000 * 20 * applyResistanceAddEffect(player, target, dsp.magic.ele.WIND, 0)
target:addStatusEffect(dsp.effect.DEFENSE_DOWN, 19, 0, duration)
end
-- Apply aftermath
dsp.aftermath.addStatusEffect(player, tp, dsp.slot.MAIN, dsp.aftermath.type.RELIC)
end
return tpHits, extraHits, criticalHit, damage
end
| gpl-3.0 |
santssoft/darkstar | scripts/globals/weaponskills/shield_break.lua | 10 | 1952 | -----------------------------------
-- Shield Break
-- Great Axe weapon skill
-- Skill level: 5
-- Lowers enemy's Evasion. Duration of effect varies with TP.
-- Lowers Evasion by as much as 40 if unresisted.
-- Strong against: Bees, Beetles, Birds, Crabs, Crawlers, Flies, Lizards, Mandragora, Opo-opo, Pugils, Sabotenders, Scorpions, Sea Monks, Spiders, Tonberry, Yagudo.
-- Immune: Bombs, Gigas, Ghosts, Sheep, Skeletons, Tigers.
-- Will stack with Sneak Attack.
-- Aligned with the Thunder Gorget.
-- Aligned with the Thunder Belt.
-- Element: Ice
-- Modifiers: STR:60% VIT:60%
-- 100%TP 200%TP 300%TP
-- 1.00 1.00 1.00
-----------------------------------
require("scripts/globals/status")
require("scripts/globals/settings")
require("scripts/globals/weaponskills")
-----------------------------------
function onUseWeaponSkill(player, target, wsID, tp, primary, action, taChar)
local params = {}
params.numHits = 1
params.ftp100 = 1 params.ftp200 = 1 params.ftp300 = 1
params.str_wsc = 0.2 params.dex_wsc = 0.0 params.vit_wsc = 0.2 params.agi_wsc = 0.0 params.int_wsc = 0.0 params.mnd_wsc = 0.0 params.chr_wsc = 0.0
params.crit100 = 0.0 params.crit200 = 0.0 params.crit300 = 0.0
params.canCrit = false
params.acc100 = 0.0 params.acc200= 0.0 params.acc300= 0.0
params.atk100 = 1; params.atk200 = 1; params.atk300 = 1;
if (USE_ADOULIN_WEAPON_SKILL_CHANGES == true) then
params.str_wsc = 0.6 params.vit_wsc = 0.6
end
local damage, criticalHit, tpHits, extraHits = doPhysicalWeaponskill(player, target, wsID, params, tp, action, primary, taChar)
if (damage > 0 and target:hasStatusEffect(dsp.effect.EVASION_DOWN) == false) then
local duration = (120 + (tp/1000 * 60)) * applyResistanceAddEffect(player,target,dsp.magic.ele.ICE,0)
target:addStatusEffect(dsp.effect.EVASION_DOWN, 40, 0, duration)
end
return tpHits, extraHits, criticalHit, damage
end
| gpl-3.0 |
santssoft/darkstar | scripts/zones/QuBia_Arena/bcnms/die_by_the_sword.lua | 9 | 1062 | -----------------------------------
-- Die by the Sword
-- Qu'Bia Arena BCNM30, Sky Orb
-- !additem 1552
-----------------------------------
require("scripts/globals/battlefield")
-----------------------------------
function onBattlefieldInitialise(battlefield)
battlefield:setLocalVar("loot", 1)
end
function onBattlefieldTick(battlefield, tick)
dsp.battlefield.onBattlefieldTick(battlefield, tick)
end
function onBattlefieldRegister(player, battlefield)
end
function onBattlefieldEnter(player, battlefield)
end
function onBattlefieldLeave(player, battlefield, leavecode)
if leavecode == dsp.battlefield.leaveCode.WON then
local name, clearTime, partySize = battlefield:getRecord()
player:startEvent(32001, battlefield:getArea(), clearTime, partySize, battlefield:getTimeInside(), 1, battlefield:getLocalVar("[cs]bit"), 0)
elseif leavecode == dsp.battlefield.leaveCode.LOST then
player:startEvent(32002)
end
end
function onEventUpdate(player, csid, option)
end
function onEventFinish(player, csid, option)
end
| gpl-3.0 |
rekotc/game-engine-experimental-3 | Source/GCC4/3rdParty/luaplus51-all/Src/Modules/penlight/lua/pl/list.lua | 3 | 14059 | --- Python-style list class. <p>
-- Based on original code by Nick Trout.
-- <p>
-- <b>Please Note</b>: methods that change the list will return the list.
-- This is to allow for method chaining, but please note that <tt>ls = ls:sort()</tt>
-- does not mean that a new copy of the list is made. In-place (mutable) methods
-- are marked as returning 'the list' in this documentation.
-- <p>
-- See the Guide for further <a href="../../index.html#list">discussion</a>
-- <p>
-- See <a href="http://www.python.org/doc/current/tut/tut.html">http://www.python.org/doc/current/tut/tut.html</a>, section 5.1
-- <p>
-- <b>Note</b>: The comments before some of the functions are from the Python docs
-- and contain Python code.
-- <p>
-- Written for Lua version 4.0 <br />
-- Redone for Lua 5.1, Steve Donovan.
-- @class module
-- @name pl.list
local tinsert,tremove,concat,tsort = table.insert,table.remove,table.concat,table.sort
local setmetatable, getmetatable,type,tostring,assert,string,next = setmetatable,getmetatable,type,tostring,assert,string,next
local write = io.write
local tablex = require 'pl.tablex'
local filter,imap,imap2,reduce,transform,tremovevalues = tablex.filter,tablex.imap,tablex.imap2,tablex.reduce,tablex.transform,tablex.removevalues
local tablex = tablex
local tsub = tablex.sub
local utils = require 'pl.utils'
local function_arg = utils.function_arg
local is_type = utils.is_type
local split = utils.split
local assert_arg = utils.assert_arg
local normalize_slice = tablex._normalize_slice
--[[
module ('pl.list',utils._module)
]]
local list = {}
local Multimap = utils.stdmt.MultiMap
-- metatable for our list objects
list.List = utils.stdmt.List
local List = list.List
List.__index = List
List._name = "List"
List._class = List
-- we give the metatable its own metatable so that we can call it like a function!
setmetatable(List,{
__call = function (tbl,arg)
return List:new(arg)
end,
})
local function makelist (t)
return setmetatable(t,List)
end
local function is_list(t)
return getmetatable(t) == List
end
local function simple_table(t)
return type(t) == 'table' and not is_list(t) and #t > 0
end
--- Create a new list. Can optionally pass a table;
-- passing another instance of List will cause a copy to be created
-- we pass anything which isn't a simple table to iter() to work out
-- an appropriate iterator @see iter
-- @param t An optional list-like table
-- @return a new List
-- @usage ls = List(); ls = List {1,2,3,4}
function List:new(t)
if not t then t={}
elseif not simple_table(t) then
local tbl = t
t = {}
for v in iter(tbl) do
tinsert(t,v)
end
end
makelist(t,List)
return t
end
---Add an item to the end of the list.
-- @param i An item
-- @return the list
function List:append(i)
tinsert(self,i)
return self
end
List.push = tinsert
--- Extend the list by appending all the items in the given list.
-- equivalent to 'a[len(a):] = L'.
-- @param L Another List
-- @return the list
function List:extend(L)
assert_arg(1,L,'table')
for i = 1,#L do tinsert(self,L[i]) end
return self
end
--- Insert an item at a given position. i is the index of the
-- element before which to insert.
-- @param i index of element before whichh to insert
-- @param x A data item
-- @return the list
function List:insert(i, x)
assert_arg(1,i,'number')
tinsert(self,i,x)
return self
end
--- Insert an item at the begining of the list.
-- @param x a data item
-- @return the list
function List:put (x)
return self:insert(1,x)
end
--- Remove an element given its index.
-- (equivalent of Python's del s[i])
-- @param i the index
-- @return the list
function List:remove (i)
assert_arg(1,i,'number')
tremove(self,i)
return self
end
--- Remove the first item from the list whose value is given.
-- (This is called 'remove' in Python; renamed to avoid confusion
-- with table.remove)
-- Return nil if there is no such item.
-- @param x A data value
-- @return the list
function List:remove_value(x)
for i=1,#self do
if self[i]==x then tremove(self,i) return self end
end
return self
end
--- Remove the item at the given position in the list, and return it.
-- If no index is specified, a:pop() returns the last item in the list.
-- The item is also removed from the list.
-- @param i An index
-- @return the item
function List:pop(i)
if not i then i = #self end
assert_arg(1,i,'number')
return tremove(self,i)
end
List.get = List.pop
--- Return the index in the list of the first item whose value is given.
-- Return nil if there is no such item.
-- @class function
-- @name List:index
-- @param x A data value
-- @param idx where to start search (default 1)
-- @return the index, or nil if not found.
local tfind = tablex.find
List.index = tfind
--- does this list contain the value?.
-- @param x A data value
-- @return true or false
function List:contains(x)
return tfind(self,x) and true or false
end
--- Return the number of times value appears in the list.
-- @param x A data value
-- @return number of times x appears
function List:count(x)
local cnt=0
for i=1,#self do
if self[i]==x then cnt=cnt+1 end
end
return cnt
end
--- Sort the items of the list, in place.
-- @param cmp an optional comparison function; '<' is used if not given.
-- @return the list
function List:sort(cmp)
tsort(self,cmp)
return self
end
--- Reverse the elements of the list, in place.
-- @return the list
function List:reverse()
local t = self
local n = #t
local n2 = n/2
for i = 1,n2 do
local k = n-i+1
t[i],t[k] = t[k],t[i]
end
return self
end
--- Emulate list slicing. like 'list[first:last]' in Python.
-- If first or last are negative then they are relative to the end of the list
-- eg. slice(-2) gives last 2 entries in a list, and
-- slice(-4,-2) gives from -4th to -2nd
-- @param first An index
-- @param last An index
-- @return a new List
function List:slice(first,last)
return tsub(self,first,last)
end
--- empty the list.
-- @return the list
function List:clear()
for i=1,#self do tremove(self,i) end
return self
end
--- Emulate Python's range(x) function.
-- Include it in List table for tidiness
-- @param start A number
-- @param finish A number greater than start; if zero, then 0..start-1
-- @usage List.range(0,3) == List {0,1,2,3}
function List.range(start,finish)
if not finish then
start = 0
finish = finish - 1
end
assert_arg(1,start,'number')
assert_arg(2,finish,'number')
local t = List:new()
for i=start,finish do tinsert(t,i) end
return t
end
--- list:len() is the same as #list.
function List:len()
return #self
end
-- Extended operations --
--- Remove a subrange of elements.
-- equivalent to 'del s[i1:i2]' in Python.
-- @param i1 start of range
-- @param i2 end of range
-- @return the list
function List:chop(i1,i2)
return tremovevalues(self,i1,i2)
end
--- Insert a sublist into a list
-- equivalent to 's[idx:idx] = list' in Python
-- @param idx index
-- @param list list to insert
-- @return the list
-- @usage l = List{10,20}; l:splice(2,{21,22}); assert(l == List{10,21,22,20})
function List:splice(idx,list)
assert_arg(1,idx,'number')
idx = idx - 1
local i = 1
for v in iter(list) do
tinsert(self,i+idx,v)
i = i + 1
end
return self
end
--- general slice assignment s[i1:i2] = seq.
-- @param i1 start index
-- @param i2 end index
-- @param seq a list
-- @return the list
function List:slice_assign(i1,i2,seq)
assert_arg(1,i1,'number')
assert_arg(1,i2,'number')
i1,i2 = normalize_slice(self,i1,i2)
if i2 >= i1 then self:chop(i1,i2) end
self:splice(i1,seq)
return self
end
--- concatenation operator .. .
-- @param L another List
-- @return a new list consisting of the list with the elements of the new list appended
function List:__concat(L)
assert_arg(1,L,'table')
local ls = List(self)
ls:extend(L)
return ls
end
--- equality operator ==. True iff all elements of two lists are equal.
-- @param L another List
-- @return true or false
function List:__eq(L)
if #self ~= #L then return false end
for i = 1,#self do
if self[i] ~= L[i] then return false end
end
return true
end
--- join the elements of a list using a delimiter.<br>
-- This method uses tostring on all elements.
-- @param delim a delimiter string, can be empty.
-- @return a string
function List:join (delim,v2s)
v2s = v2s or tostring
delim = delim or ''
assert_arg(1,delim,'string')
return concat(imap(v2s,self),delim)
end
--- join a list of strings. <br>
-- Uses table.concat directly.
-- @class function
-- @name List:concat
-- @param delim a delimiter
-- @return a string
List.concat = concat
local function tostring_q(val)
local s = tostring(val)
if type(val) ~= 'number' then
s = '"'..s..'"'
end
return s
end
--- how our list should be rendered as a string. Uses join().
-- @see pl.list.List:join
function List:__tostring()
return '{'..self:join(',',tostring_q)..'}'
end
--[[
-- NOTE: this works, but is unreliable. If you leave the loop before finishing,
-- then the iterator is not reset.
--- can iterate over a list directly.
-- @usage for v in ls do print(v) end
function List:__call()
if not self.key then self.key = 1 end
local value = self[self.key]
self.key = self.key + 1
if not value then self.key = nil end
return value
end
--]]
--[[
function List.__call(t,v,i)
i = (i or 0) + 1
v = t[i]
if v then return i, v end
end
--]]
--- call the function for each element of the list.
-- @param fun a function or callable object
function List:foreach (fun,...)
local t = self
fun = function_arg(1,fun)
for i = 1,#t do
fun(t[i],...)
end
end
--- create a list of all elements which match a function.
-- @param fun a boolean function
-- @param optional argument to be passed as second argument of the predicate
-- @return a new filtered list.
function List:filter (fun,arg)
return makelist(filter(self,fun,arg))
end
--- split a string using a delimiter.
-- @param s the string
-- @param delim the delimiter (default spaces)
-- @return a List of strings
-- @see pl.utils.split
function List.split (s,delim)
assert_arg(1,s,'string')
return makelist(split(s,delim))
end
--- apply a function to all elements.
-- Any extra arguments will be passed to the function
-- @param fun a function of at least one argument
-- @param arg1 an optional argument
-- @param ... arbitrary extra arguments.
-- @return a new list: {f(x) for x in self}
-- @see pl.tablex.imap
function List:map (fun,...)
return imap(fun,self,...)
end
--- apply a function to all elements, in-place.
-- Any extra arguments are passed to the function.
-- @param fun A function that takes at least one argument
-- @param ... arbitrary extra arguments.
function List:transform (fun,t,...)
transform(fun,self,...)
end
--- apply a function to elements of two lists.
-- Any extra arguments will be passed to the function
-- @param fun a function of at least two arguments
-- @param ... arbitrary extra arguments.
-- @return a new list: {f(x,y) for x in self, for x in arg1}
-- @see pl.tablex.imap2
function List:map2 (fun,ls,...)
return makelist(imap2(fun,self,ls,...))
end
--- apply a named meethod to all elements.
-- Any extra arguments will be passed to the method.
-- @param name name of method
-- @param ... extra arguments
-- @return a new list of the results
-- @see pl.seq.mapmethod
function List:mapm (name,...)
local res = {}
local t = self
for i = 1,#t do
local val = t[i]
local fn = val[name]
if not fn then error(type(val).." does not have method "..name) end
res[i] = fn(val,...)
end
return makelist(res)
end
--- 'reduce' a list using a binary function.
-- @param fun a function of two arguments
-- @return result of the function
-- @see pl.tablex.reduce
function List:reduce (fun)
return reduce(fun,self)
end
--- partition a list using a classifier function.
-- The function may return nil, but this will be converted to the string key '<nil>'.
-- @param fun a function of at least one argument
-- @param ... will also be passed to the function
-- @return a table where the keys are the returned values, and the values are Lists
-- of values where the function returned that key. It is given the type of Multimap.
-- @see pl.classx.MultiMap
function List:partition (fun,...)
fun = function_arg(1,fun)
local res = {}
for i = 1,#self do
local val = self[i]
local klass = fun(val,...)
if klass == nil then klass = '<nil>' end
if not res[klass] then res[klass] = List() end
res[klass]:append(val)
end
return setmetatable(res,Multimap)
end
--- return an iterator over all values.
function List:iter ()
return iter(self)
end
--- Create an iterator over a seqence.
-- This captures the Python concept of 'sequence'.
-- For tables, iterates over all values with integer indices.
-- @param seq a sequence; a string (over characters), a table, a file object (over lines) or an iterator function
-- @usage for x in iter {1,10,22,55} do io.write(x,',') end ==> 1,10,22,55
-- @usage for ch in iter 'help' do do io.write(ch,' ') end ==> h e l p
function iter(seq)
if type(seq) == 'string' then
local idx = 0
local n = #seq
local sub = string.sub
return function ()
idx = idx + 1
if idx > n then return nil
else
return sub(seq,idx,idx)
end
end
elseif type(seq) == 'table' then
local idx = 0
local n = #seq
return function()
idx = idx + 1
if idx > n then return nil
else
return seq[idx]
end
end
elseif type(seq) == 'function' then
return seq
elseif type(seq) == 'userdata' and io.type(seq) == 'file' then
return seq:lines()
end
end
return list
| lgpl-3.0 |
santssoft/darkstar | scripts/globals/spells/frazzle.lua | 12 | 1626 | -----------------------------------------
-- Spell: Frazzle
-----------------------------------------
require("scripts/globals/magic")
require("scripts/globals/msg")
require("scripts/globals/status")
require("scripts/globals/utils")
-----------------------------------------
function onMagicCastingCheck(caster, target, spell)
return 0
end
function onSpellCast(caster, target, spell)
local dMND = caster:getStat(dsp.mod.MND) - target:getStat(dsp.mod.MND)
-- Base magic evasion reduction is determend by enfeebling skill
-- Caps at -25 magic evasion at 125 skill
local basePotency = utils.clamp(math.floor(caster:getSkillLevel(dsp.skill.ENFEEBLING_MAGIC) / 5), 0, 25)
-- dMND is tacked on after
-- Min cap: 0 at 0 dMND
-- Max cap: 10 at 50 dMND
basePotency = basePotency + utils.clamp(math.floor(dMND / 5), 0, 10)
local power = calculatePotency(basePotency, spell:getSkillType(), caster, target)
local duration = calculateDuration(120, spell:getSkillType(), spell:getSpellGroup(), caster, target)
local params = {}
params.diff = dMND
params.skillType = dsp.skill.ENFEEBLING_MAGIC
params.bonus = 0
params.effect = dsp.effect.MAGIC_EVASION_DOWN
local resist = applyResistanceEffect(caster, target, spell, params)
if resist >= 0.5 then
if target:addStatusEffect(params.effect, power, 0, duration * resist) then
spell:setMsg(dsp.msg.basic.MAGIC_ENFEEB_IS)
else
spell:setMsg(dsp.msg.basic.MAGIC_NO_EFFECT)
end
else
spell:setMsg(dsp.msg.basic.MAGIC_RESIST)
end
return params.effect
end | gpl-3.0 |
ultrasn0w/mc_u_world | danidani_programs/opencomputers/4a2bb039-e2e9-4561-b12a-b45d94e2576b/bin/install.lua | 15 | 2650 | local component = require("component")
local computer = require("computer")
local event = require("event")
local filesystem = require("filesystem")
local unicode = require("unicode")
local shell = require("shell")
local args, options = shell.parse(...)
local fromAddress = options.from and component.get(options.from) or filesystem.get(os.getenv("_")).address
local candidates = {}
for address in component.list("filesystem") do
local dev = component.proxy(address)
if not dev.isReadOnly() and dev.address ~= computer.tmpAddress() and dev.address ~= fromAddress then
table.insert(candidates, dev)
end
end
if #candidates == 0 then
io.write("No writable disks found, aborting.\n")
os.exit()
end
for i = 1, #candidates do
local label = candidates[i].getLabel()
if label then
label = label .. " (" .. candidates[i].address:sub(1, 8) .. "...)"
else
label = candidates[i].address
end
io.write(i .. ") " .. label .. "\n")
end
io.write("To select the device to install to, please enter a number between 1 and " .. #candidates .. ".\n")
io.write("Press 'q' to cancel the installation.\n")
local choice
while not choice do
result = io.read()
if result:sub(1, 1):lower() == "q" then
os.exit()
end
local number = tonumber(result)
if number and number > 0 and number <= #candidates then
choice = candidates[number]
else
io.write("Invalid input, please try again.\n")
end
end
local function findMount(address)
for fs, path in filesystem.mounts() do
if fs.address == component.get(address) then
return path
end
end
end
local name = options.name or "OpenOS"
io.write("Installing " .. name .." to device " .. (choice.getLabel() or choice.address) .. "\n")
os.sleep(0.25)
local cpPath = filesystem.concat(findMount(filesystem.get(os.getenv("_")).address), "bin/cp")
local cpOptions = "-vrx" .. (options.u and "ui " or "")
local cpSource = filesystem.concat(findMount(fromAddress), options.fromDir or "/", "*")
local cpDest = findMount(choice.address) .. "/"
local result, reason = os.execute(cpPath .. " " .. cpOptions .. " " .. cpSource .. " " .. cpDest)
if not result then
error(reason, 0)
end
if not options.nolabelset then pcall(choice.setLabel, name) end
if not options.noreboot then
io.write("All done! " .. ((not options.noboot) and "Set as boot device and r" or "R") .. "eboot now? [Y/n]\n")
local result = io.read()
if not result or result == "" or result:sub(1, 1):lower() == "y" then
if not options.noboot then computer.setBootAddress(choice.address)end
io.write("\nRebooting now!\n")
computer.shutdown(true)
end
end
io.write("Returning to shell.\n")
| unlicense |
santssoft/darkstar | scripts/globals/mobskills/crystal_weapon.lua | 11 | 1067 | ---------------------------------------------
-- Crystal Weapon
--
-- Description: Invokes the power of a crystal to deal magical damage of a random element to a single target.
-- Type: Magical
-- Utsusemi/Blink absorb: Ignores shadows
-- Range: Unknown
-- Notes: Can be Fire, Earth, Wind, or Water element. Functions even at a distance (outside of melee range).
---------------------------------------------
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 element = math.random(6,9)
local dmgmod = 1
local accmod = 1
local info = MobMagicalMove(mob,target,skill,mob:getWeaponDmg() * 5,accmod,dmgmod,TP_MAB_BONUS,1)
local dmg = MobFinalAdjustments(info.dmg,mob,skill,target,dsp.attackType.MAGICAL,element,MOBPARAM_IGNORE_SHADOWS)
target:takeDamage(dmg, mob, dsp.attackType.MAGICAL, element)
return dmg
end
| gpl-3.0 |
santssoft/darkstar | scripts/globals/mobskills/catapult.lua | 11 | 1034 | ---------------------------------------------------
-- Ranged Attack
-- Deals a ranged attack to a single target.
---------------------------------------------------
require("scripts/globals/settings")
require("scripts/globals/status")
require("scripts/globals/monstertpmoves")
---------------------------------------------------
function onMobSkillCheck(target,mob,skill)
-- Ranged attack only used when target is out of range
if (mob:checkDistance(target) > 2) then
return 0
else
return 1
end
end
function onMobWeaponSkill(target, mob, skill)
local numhits = 1
local accmod = 1
local dmgmod = 1.6
local info = MobRangedMove(mob,target,skill,numhits,accmod,dmgmod,TP_NO_EFFECT)
local dmg = MobFinalAdjustments(info.dmg,mob,skill,target,dsp.attackType.RANGED,dsp.damageType.PIERCING,info.hitslanded)
if (dmg > 0) then
target:addTP(20)
mob:addTP(80)
end
target:takeDamage(dmg, mob, dsp.attackType.RANGED, dsp.damageType.PIERCING)
return dmg
end
| gpl-3.0 |
m241dan/darkstar | scripts/zones/Windurst_Walls/npcs/Koru-Moru.lua | 25 | 11771 | -----------------------------------
-- Area: Windurst Walls
-- NPC: Koru-Moru
-- Starts & Ends Quest: Star Struck
-- Involved in Quest: Making the Grade, Riding on the Clouds
-- @pos -120 -6 124 239
-----------------------------------
package.loaded["scripts/zones/Windurst_Waters/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/settings");
require("scripts/globals/titles");
require("scripts/globals/keyitems");
require("scripts/globals/quests");
require("scripts/zones/Windurst_Waters/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
local qStarStruck = player:getQuestStatus(WINDURST,STAR_STRUCK);
local count = trade:getItemCount();
if (trade:hasItemQty(544,1) and count == 1 and trade:getGil() == 0) then
if (player:getQuestStatus(WINDURST,MAKING_THE_GRADE) == QUEST_ACCEPTED) then
if (player:getVar("QuestMakingTheGrade_prog") == 1) then
player:startEvent(0x011d); -- MAKING THE GRADE: Turn in Test Answer & Told to go back to Fuepepe & Chomoro
else
player:startEvent(0x011f); -- MAKING THE GRADE: Have test answers but not talked/given to Fuepepe
end
end
elseif (trade:hasItemQty(584,1) and count == 1 and trade:getGil() == 0) then
player:startEvent(0x00c7);
elseif (qStarStruck == QUEST_ACCEPTED and trade:hasItemQty(582,1) and count == 1 and trade:getGil() == 0) then
player:startEvent(0x00d3);
elseif (trade:hasItemQty(1127,1) and trade:getItemCount() == 1) then -- Trade Kindred seal
if (player:getQuestStatus(JEUNO,RIDING_ON_THE_CLOUDS) == QUEST_ACCEPTED and player:getVar("ridingOnTheClouds_4") == 4) then
player:setVar("ridingOnTheClouds_4",0);
player:tradeComplete();
player:addKeyItem(SPIRITED_STONE);
player:messageSpecial(KEYITEM_OBTAINED,SPIRITED_STONE);
end
elseif (trade:hasItemQty(16511,1) and count == 1 and trade:getGil() == 0) then
if (player:getQuestStatus(WINDURST,BLAST_FROM_THE_PAST) == QUEST_ACCEPTED) then
player:startEvent(0x00e0); -- Complete quest!
else
player:startEvent(0x00e1); -- not the shell
end
elseif (trade:hasItemQty(829,1) and count == 1 and trade:getGil() == 0) then
if (player:getQuestStatus(WINDURST,THE_ROOT_OF_THE_PROBLEM) == QUEST_ACCEPTED) then
player:startEvent(0x15D);
player:tradeComplete();
player:setVar("rootProblem",2);
end
elseif (trade:hasItemQty(17299,4) and count == 4 and trade:getGil() == 0) then -- trade:getItemCount() is apparently checking total of all 8 slots combined. Could have sworn that wasn't how it worked before.
if (player:getQuestStatus(WINDURST,CLASS_REUNION) == 1 and player:getVar("ClassReunionProgress") == 2) then
player:startEvent(0x0197); -- now Koru remembers something that you need to inquire his former students.
end;
end;
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
local qStarStruck = player:getQuestStatus(WINDURST,STAR_STRUCK);
local blastFromPast = player:getQuestStatus(WINDURST,BLAST_FROM_THE_PAST);
local blastProg = player:getVar("BlastFromThePast_Prog");
local rootProblem = player:getQuestStatus(WINDURST,THE_ROOT_OF_THE_PROBLEM);
local ThePuppetMaster = player:getQuestStatus(WINDURST,THE_PUPPET_MASTER);
local ThePuppetMasterProgress = player:getVar("ThePuppetMasterProgress");
local ClassReunion = player:getQuestStatus(WINDURST,CLASS_REUNION);
local ClassReunionProgress = player:getVar("ClassReunionProgress");
local talk1 = player:getVar("ClassReunion_TalkedToFupepe");
local talk2 = player:getVar("ClassReunion_TalkedToFurakku");
local CarbuncleDebacle = player:getQuestStatus(WINDURST,CARBUNCLE_DEBACLE);
local CarbuncleDebacleProgress = player:getVar("CarbuncleDebacleProgress");
if (blastFromPast == QUEST_AVAILABLE and qStarStruck == QUEST_COMPLETED and player:getQuestStatus(WINDURST,CLASS_REUNION) ~= QUEST_ACCEPTED and player:getFameLevel(WINDURST) >= 3 and player:needToZone() == false) then
player:startEvent(0x00d6);
elseif (blastFromPast == QUEST_ACCEPTED and blastProg >= 2) then
player:startEvent(0x00d7);
elseif (blastFromPast == QUEST_ACCEPTED) then
player:startEvent(0x00d8);
elseif (player:getQuestStatus(WINDURST,MAKING_THE_GRADE) == QUEST_ACCEPTED) then
local makingGradeProg = player:getVar("QuestMakingTheGrade_prog");
if (makingGradeProg == 0 and player:hasItem(544)) then
player:startEvent(0x011f); -- MAKING THE GRADE: Have test answers but not talked/given to Fuepepe
elseif (makingGradeProg == 1) then
player:startEvent(0x011d); -- MAKING THE GRADE: Turn in Test Answer & Told to go back to Fuepepe & Chomoro
elseif (makingGradeProg >= 2) then
player:startEvent(0x011e); -- MAKING THE GRADE: Reminder to go away
else
player:startEvent(0x00c1);
end
elseif (qStarStruck == QUEST_ACCEPTED) then
player:startEvent(0x00c6);
elseif ((qStarStruck == QUEST_AVAILABLE) and (ClassReunion ~= QUEST_ACCEPTED) and player:hasItem(584)) then
player:startEvent(0x00c5);
----------------------------------------------------------
-- Carbuncle Debacle
elseif (CarbuncleDebacle == QUEST_ACCEPTED and CarbuncleDebacleProgress == 1 or CarbuncleDebacleProgress == 2) then
player:startEvent(0x01a0); -- go and see Ripapa
elseif (CarbuncleDebacle == QUEST_ACCEPTED and CarbuncleDebacleProgress == 4) then
player:startEvent(0x01a1); -- now go and see Agado-Pugado
elseif (CarbuncleDebacle == QUEST_ACCEPTED and CarbuncleDebacleProgress == 5) then
player:startEvent(0x01a2); -- Uran-Mafran must be stopped
elseif (CarbuncleDebacle == QUEST_ACCEPTED and CarbuncleDebacleProgress == 7) then
player:startEvent(0x01a3); -- ending cs
elseif (ThePuppetMaster == QUEST_COMPLETED and ClassReunion == QUEST_COMPLETED and CarbuncleDebacle == QUEST_COMPLETED) then
player:startEvent(0x01a4); -- new cs after all 3 SMN AFs done
----------------------------------------------------------
-- Class Reunion
elseif (ClassReunion == QUEST_ACCEPTED and ClassReunionProgress == 1) then
player:startEvent(0x019c,0,450,17299,0,0,0,0,0); -- bring Koru 4 astragaloi
elseif (ClassReunion == QUEST_ACCEPTED and ClassReunionProgress == 2) then
player:startEvent(0x019e,0,0,17299,0,0,0,0,0); -- reminder to bring 4 astragaloi
elseif ((ClassReunion == QUEST_ACCEPTED and ClassReunionProgress >= 3) and (talk1 ~= 1 or talk2 ~= 1)) then
player:startEvent(0x0198); -- reminder to visit the students
elseif (ClassReunion == QUEST_ACCEPTED and ClassReunionProgress == 6 and talk1 == 1 and talk2 == 1) then
player:startEvent(0x019a); -- ending cs
elseif (ThePuppetMaster == QUEST_COMPLETED and ClassReunion == QUEST_COMPLETED) then
player:startEvent(0x019b); -- new cs after completed AF2
----------------------------------------------------------
-- The Puppet Master
elseif (ThePuppetMaster == QUEST_ACCEPTED and ThePuppetMasterProgress == 4) then
player:startEvent(0x0194); -- ending cs
elseif (ThePuppetMaster == QUEST_COMPLETED and ClassReunion ~= 2) then
player:startEvent(0x0195); -- new cs after completed AF1
----------------------------------------------------------
elseif (rootProblem == QUEST_ACCEPTED and player:getVar("rootProblem") == 1) then
player:startEvent(0x015C,0,829);
else
if (qStarStruck == QUEST_COMPLETED) then
player:startEvent(0x00d5);
else
player:startEvent(0x00c1);
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 == 0x011d) then -- Giving him KI from Principle
player:tradeComplete();
player:addKeyItem(TATTERED_TEST_SHEET);
player:messageSpecial(KEYITEM_OBTAINED,TATTERED_TEST_SHEET);
player:setVar("QuestMakingTheGrade_prog",2);
elseif (csid == 0x00d3) then
player:tradeComplete();
player:addItem(12502);
player:messageSpecial(ITEM_OBTAINED,12502);
player:completeQuest(WINDURST,STAR_STRUCK);
player:needToZone(true);
player:addFame(WINDURST,20);
elseif (csid == 0x00c7) then
player:tradeComplete();
player:messageSpecial(GIL_OBTAINED,50);
player:addGil(50);
elseif (csid == 0x00c5 and option == 0) then
player:addQuest(WINDURST,STAR_STRUCK);
elseif (csid == 0x00d6 and option == 0) then
player:addQuest(WINDURST,BLAST_FROM_THE_PAST);
elseif (csid == 0x00e0) then
player:tradeComplete();
player:setVar("BlastFromThePast_Prog",0);
player:completeQuest(WINDURST,BLAST_FROM_THE_PAST);
player:addItem(17030);
player:messageSpecial(ITEM_OBTAINED,17030);
player:addTitle(FOSSILIZED_SEA_FARER);
player:addFame(WINDURST,30);
player:needToZone(true);
elseif (csid == 0x0194) then
if (player:getFreeSlotsCount() ~= 0) then
player:addItem(17532);
player:messageSpecial(ITEM_OBTAINED,17532);
player:completeQuest(WINDURST,THE_PUPPET_MASTER);
player:setVar("ThePuppetMasterProgress",0);
player:needToZone(true);
player:addFame(WINDURST,AF1_FAME);
else
player:messageSpecial(ITEM_CANNOT_BE_OBTAINED,17532);
end;
elseif (csid == 0x019c) then
player:delKeyItem(CARBUNCLES_TEAR);
player:setVar("ClassReunionProgress",2);
elseif (csid == 0x0197) then
player:tradeComplete();
player:setVar("ClassReunionProgress",3);
elseif (csid == 0x019a) then
if (player:getFreeSlotsCount() ~= 0) then
player:addItem(14228);
player:messageSpecial(ITEM_OBTAINED,14228);
player:completeQuest(WINDURST,CLASS_REUNION);
player:setVar("ClassReunionProgress",0);
player:setVar("ClassReunion_TalkedToFurakku",0);
player:setVar("ClassReunion_TalkedToFupepe",0);
player:needToZone(true);
player:addFame(WINDURST,AF2_FAME);
else
player:messageSpecial(ITEM_CANNOT_BE_OBTAINED,14228);
end;
elseif (csid == 0x01a0) then
player:setVar("CarbuncleDebacleProgress",2);
elseif (csid == 0x01a1) then
player:setVar("CarbuncleDebacleProgress",5);
player:addKeyItem(DAZEBREAKER_CHARM);
player:messageSpecial(KEYITEM_OBTAINED,DAZEBREAKER_CHARM);
elseif (csid == 0x01a3) then
if (player:getFreeSlotsCount() ~= 0) then
player:addItem(12520); -- Evoker's Horn
player:messageSpecial(ITEM_OBTAINED,12520);
player:addTitle(PARAGON_OF_SUMMONER_EXCELLENCE);
player:completeQuest(WINDURST,CARBUNCLE_DEBACLE);
player:addFame(WINDURST,AF3_FAME);
player:setVar("CarbuncleDebacleProgress",0);
player:needToZone(true);
else
player:messageSpecial(ITEM_CANNOT_BE_OBTAINED,12520);
end;
end;
end; | gpl-3.0 |
m241dan/darkstar | scripts/zones/Metalworks/npcs/Savae_E_Paleade.lua | 13 | 2796 | -----------------------------------
-- Area: Metalworks
-- NPC: Savae E Paleade
-- Involved In Mission: Journey Abroad
-- @pos 23.724 -17.39 -43.360 237
-----------------------------------
package.loaded["scripts/zones/Metalworks/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/keyitems");
require("scripts/globals/missions");
require("scripts/zones/Metalworks/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
if (player:getCurrentMission(SANDORIA) == JOURNEY_TO_BASTOK and player:getVar("MissionStatus") == 5) then
if (trade:hasItemQty(599,1) and trade:getItemCount() == 1) then -- Trade Mythril Sand
player:startEvent(0x00cd);
end
end
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
-- San d'Oria Mission 2-3 Part I - Bastok > Windurst
if (player:getCurrentMission(SANDORIA) == JOURNEY_ABROAD and player:getVar("MissionStatus") == 2) then
player:startEvent(0x00cc);
-- San d'Oria Mission 2-3 Part II - Windurst > Bastok
elseif (player:getCurrentMission(SANDORIA) == JOURNEY_ABROAD and player:getVar("MissionStatus") == 7) then
player:startEvent(0x00ce);
elseif (player:getCurrentMission(SANDORIA) == JOURNEY_TO_BASTOK2 and player:getVar("MissionStatus") == 11) then
player:startEvent(0x00cf);
-----------------
elseif (player:getCurrentMission(SANDORIA) ~= 255) then
player:startEvent(0x00d0);
else
player:startEvent(0x00c8);
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 == 0x00cc) then
player:addMission(SANDORIA,JOURNEY_TO_BASTOK);
player:setVar("MissionStatus",3);
player:delKeyItem(LETTER_TO_THE_CONSULS_SANDORIA);
elseif (csid == 0x00cd) then
player:tradeComplete();
player:setVar("MissionStatus",6);
player:addMission(SANDORIA,JOURNEY_ABROAD);
elseif (csid == 0x00ce) then
player:addMission(SANDORIA,JOURNEY_TO_BASTOK2);
player:setVar("MissionStatus",8);
elseif (csid == 0x00cf) then
player:addMission(SANDORIA,JOURNEY_ABROAD);
player:delKeyItem(KINDRED_CREST);
player:addKeyItem(KINDRED_REPORT);
player:messageSpecial(KEYITEM_OBTAINED,KINDRED_REPORT);
end
end; | gpl-3.0 |
m241dan/darkstar | scripts/globals/mobskills/Gregale_Wing_Air.lua | 33 | 1081 | ---------------------------------------------
-- Gregale Wing
--
-- Description: An icy wind deals Ice damage to enemies within a very wide area of effect. Additional effect: Paralyze
-- Type: Magical
-- Utsusemi/Blink absorb: Wipes shadows
-- Range: 30' radial.
-- Notes: Used only Jormungand and Isgebind
---------------------------------------------
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_PARALYSIS;
MobStatusEffectMove(mob, target, typeEffect, 40, 0, 120);
local dmgmod = 1;
local info = MobMagicalMove(mob,target,skill,mob:getWeaponDmg()*5,ELE_ICE,dmgmod,TP_NO_EFFECT);
local dmg = MobFinalAdjustments(info.dmg,mob,skill,target,MOBSKILL_MAGICAL,MOBPARAM_ICE,MOBPARAM_WIPE_SHADOWS);
target:delHP(dmg);
return dmg;
end;
| gpl-3.0 |
m241dan/darkstar | scripts/zones/Lower_Jeuno/npcs/Ruslan.lua | 13 | 2102 | -----------------------------------
-- Area: Lower Jeuno
-- NPC: Ruslan
-- Involved In Quest: Wondering Minstrel
-- Working 100%
-- @zone = 245
-- @pos = -19 -1 -58
-----------------------------------
package.loaded["scripts/zones/Lower_Jeuno/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/settings");
require("scripts/globals/quests");
require("scripts/globals/titles");
require("scripts/globals/keyitems");
require("scripts/zones/Lower_Jeuno/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
wonderingstatus = player:getQuestStatus(WINDURST,WONDERING_MINSTREL);
if (wonderingstatus == QUEST_ACCEPTED) then
prog = player:getVar("QuestWonderingMin_var")
if (prog == 0) then -- WONDERING_MINSTREL + Rosewood Lumber: During Quest / Progression
player:startEvent(0x2719,0,718);
player:setVar("QuestWonderingMin_var",1);
elseif (prog == 1) then -- WONDERING_MINSTREL + Rosewood Lumber: Quest Objective Reminder
player:startEvent(0x271a,0,718);
end
elseif (wonderingstatus == QUEST_COMPLETED) then
rand = math.random(3);
if (rand == 1) then
player:startEvent(0x271b); -- WONDERING_MINSTREL: After Quest
else
player:startEvent(0x2718); -- Standard Conversation
end
else
player:startEvent(0x2718); -- Standard Conversation
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 |
m241dan/darkstar | scripts/zones/Arrapago_Reef/TextIDs.lua | 6 | 1141 | -- Variable TextID Description text
-- General Texts
ITEM_CANNOT_BE_OBTAINED = 6379; -- You cannot obtain the item <item> come back again after sorting your inventory
ITEM_OBTAINED = 6384; -- Obtained: <item>
GIL_OBTAINED = 6385; -- Obtained <number> gil
KEYITEM_OBTAINED = 6387; -- Obtained key item: <keyitem>
FISHING_MESSAGE_OFFSET = 7045; -- You can't fish here
-- Assault
CANNOT_ENTER = 8433; -- You cannot enter at this time. Please wait a while before trying again.
AREA_FULL = 8434; -- This area is fully occupied. You were unable to enter.
MEMBER_NO_REQS = 8438; -- Not all of your party members meet the requirements for this objective. Unable to enter area.
MEMBER_TOO_FAR = 8442; -- One or more party members are too far away from the entrance. Unable to enter area.
-- Other Texts
NOTHING_HAPPENS = 119; -- Nothing happens...
RESPONSE = 7320; -- There is no response...
-- Medusa
MEDUSA_ENGAGE = 8544; -- Foolish two-legs... Have you forgotten the terrible power of the gorgons you created? It is time you were reminded...
MEDUSA_DEATH = 8545; -- No... I cannot leave my sisters...
| gpl-3.0 |
hetter/NPLRuntime | Server/trunk/LuaJIT-2.1/src/jit/dis_ppc.lua | 59 | 20301 | ----------------------------------------------------------------------------
-- LuaJIT PPC disassembler module.
--
-- Copyright (C) 2005-2017 Mike Pall. All rights reserved.
-- Released under the MIT/X license. See Copyright Notice in luajit.h
----------------------------------------------------------------------------
-- This is a helper module used by the LuaJIT machine code dumper module.
--
-- It disassembles all common, non-privileged 32/64 bit PowerPC instructions
-- plus the e500 SPE instructions and some Cell/Xenon extensions.
--
-- NYI: VMX, VMX128
------------------------------------------------------------------------------
local type = type
local byte, format = string.byte, string.format
local match, gmatch, gsub = string.match, string.gmatch, string.gsub
local concat = table.concat
local bit = require("bit")
local band, bor, tohex = bit.band, bit.bor, bit.tohex
local lshift, rshift, arshift = bit.lshift, bit.rshift, bit.arshift
------------------------------------------------------------------------------
-- Primary and extended opcode maps
------------------------------------------------------------------------------
local map_crops = {
shift = 1, mask = 1023,
[0] = "mcrfXX",
[33] = "crnor|crnotCCC=", [129] = "crandcCCC",
[193] = "crxor|crclrCCC%", [225] = "crnandCCC",
[257] = "crandCCC", [289] = "creqv|crsetCCC%",
[417] = "crorcCCC", [449] = "cror|crmoveCCC=",
[16] = "b_lrKB", [528] = "b_ctrKB",
[150] = "isync",
}
local map_rlwinm = setmetatable({
shift = 0, mask = -1,
},
{ __index = function(t, x)
local rot = band(rshift(x, 11), 31)
local mb = band(rshift(x, 6), 31)
local me = band(rshift(x, 1), 31)
if mb == 0 and me == 31-rot then
return "slwiRR~A."
elseif me == 31 and mb == 32-rot then
return "srwiRR~-A."
else
return "rlwinmRR~AAA."
end
end
})
local map_rld = {
shift = 2, mask = 7,
[0] = "rldiclRR~HM.", "rldicrRR~HM.", "rldicRR~HM.", "rldimiRR~HM.",
{
shift = 1, mask = 1,
[0] = "rldclRR~RM.", "rldcrRR~RM.",
},
}
local map_ext = setmetatable({
shift = 1, mask = 1023,
[0] = "cmp_YLRR", [32] = "cmpl_YLRR",
[4] = "twARR", [68] = "tdARR",
[8] = "subfcRRR.", [40] = "subfRRR.",
[104] = "negRR.", [136] = "subfeRRR.",
[200] = "subfzeRR.", [232] = "subfmeRR.",
[520] = "subfcoRRR.", [552] = "subfoRRR.",
[616] = "negoRR.", [648] = "subfeoRRR.",
[712] = "subfzeoRR.", [744] = "subfmeoRR.",
[9] = "mulhduRRR.", [73] = "mulhdRRR.", [233] = "mulldRRR.",
[457] = "divduRRR.", [489] = "divdRRR.",
[745] = "mulldoRRR.",
[969] = "divduoRRR.", [1001] = "divdoRRR.",
[10] = "addcRRR.", [138] = "addeRRR.",
[202] = "addzeRR.", [234] = "addmeRR.", [266] = "addRRR.",
[522] = "addcoRRR.", [650] = "addeoRRR.",
[714] = "addzeoRR.", [746] = "addmeoRR.", [778] = "addoRRR.",
[11] = "mulhwuRRR.", [75] = "mulhwRRR.", [235] = "mullwRRR.",
[459] = "divwuRRR.", [491] = "divwRRR.",
[747] = "mullwoRRR.",
[971] = "divwouRRR.", [1003] = "divwoRRR.",
[15] = "iselltRRR", [47] = "iselgtRRR", [79] = "iseleqRRR",
[144] = { shift = 20, mask = 1, [0] = "mtcrfRZ~", "mtocrfRZ~", },
[19] = { shift = 20, mask = 1, [0] = "mfcrR", "mfocrfRZ", },
[371] = { shift = 11, mask = 1023, [392] = "mftbR", [424] = "mftbuR", },
[339] = {
shift = 11, mask = 1023,
[32] = "mferR", [256] = "mflrR", [288] = "mfctrR", [16] = "mfspefscrR",
},
[467] = {
shift = 11, mask = 1023,
[32] = "mtxerR", [256] = "mtlrR", [288] = "mtctrR", [16] = "mtspefscrR",
},
[20] = "lwarxRR0R", [84] = "ldarxRR0R",
[21] = "ldxRR0R", [53] = "lduxRRR",
[149] = "stdxRR0R", [181] = "stduxRRR",
[341] = "lwaxRR0R", [373] = "lwauxRRR",
[23] = "lwzxRR0R", [55] = "lwzuxRRR",
[87] = "lbzxRR0R", [119] = "lbzuxRRR",
[151] = "stwxRR0R", [183] = "stwuxRRR",
[215] = "stbxRR0R", [247] = "stbuxRRR",
[279] = "lhzxRR0R", [311] = "lhzuxRRR",
[343] = "lhaxRR0R", [375] = "lhauxRRR",
[407] = "sthxRR0R", [439] = "sthuxRRR",
[54] = "dcbst-R0R", [86] = "dcbf-R0R",
[150] = "stwcxRR0R.", [214] = "stdcxRR0R.",
[246] = "dcbtst-R0R", [278] = "dcbt-R0R",
[310] = "eciwxRR0R", [438] = "ecowxRR0R",
[470] = "dcbi-RR",
[598] = {
shift = 21, mask = 3,
[0] = "sync", "lwsync", "ptesync",
},
[758] = "dcba-RR",
[854] = "eieio", [982] = "icbi-R0R", [1014] = "dcbz-R0R",
[26] = "cntlzwRR~", [58] = "cntlzdRR~",
[122] = "popcntbRR~",
[154] = "prtywRR~", [186] = "prtydRR~",
[28] = "andRR~R.", [60] = "andcRR~R.", [124] = "nor|notRR~R=.",
[284] = "eqvRR~R.", [316] = "xorRR~R.",
[412] = "orcRR~R.", [444] = "or|mrRR~R=.", [476] = "nandRR~R.",
[508] = "cmpbRR~R",
[512] = "mcrxrX",
[532] = "ldbrxRR0R", [660] = "stdbrxRR0R",
[533] = "lswxRR0R", [597] = "lswiRR0A",
[661] = "stswxRR0R", [725] = "stswiRR0A",
[534] = "lwbrxRR0R", [662] = "stwbrxRR0R",
[790] = "lhbrxRR0R", [918] = "sthbrxRR0R",
[535] = "lfsxFR0R", [567] = "lfsuxFRR",
[599] = "lfdxFR0R", [631] = "lfduxFRR",
[663] = "stfsxFR0R", [695] = "stfsuxFRR",
[727] = "stfdxFR0R", [759] = "stfduxFR0R",
[855] = "lfiwaxFR0R",
[983] = "stfiwxFR0R",
[24] = "slwRR~R.",
[27] = "sldRR~R.", [536] = "srwRR~R.",
[792] = "srawRR~R.", [824] = "srawiRR~A.",
[794] = "sradRR~R.", [826] = "sradiRR~H.", [827] = "sradiRR~H.",
[922] = "extshRR~.", [954] = "extsbRR~.", [986] = "extswRR~.",
[539] = "srdRR~R.",
},
{ __index = function(t, x)
if band(x, 31) == 15 then return "iselRRRC" end
end
})
local map_ld = {
shift = 0, mask = 3,
[0] = "ldRRE", "lduRRE", "lwaRRE",
}
local map_std = {
shift = 0, mask = 3,
[0] = "stdRRE", "stduRRE",
}
local map_fps = {
shift = 5, mask = 1,
{
shift = 1, mask = 15,
[0] = false, false, "fdivsFFF.", false,
"fsubsFFF.", "faddsFFF.", "fsqrtsF-F.", false,
"fresF-F.", "fmulsFF-F.", "frsqrtesF-F.", false,
"fmsubsFFFF~.", "fmaddsFFFF~.", "fnmsubsFFFF~.", "fnmaddsFFFF~.",
}
}
local map_fpd = {
shift = 5, mask = 1,
[0] = {
shift = 1, mask = 1023,
[0] = "fcmpuXFF", [32] = "fcmpoXFF", [64] = "mcrfsXX",
[38] = "mtfsb1A.", [70] = "mtfsb0A.", [134] = "mtfsfiA>>-A>",
[8] = "fcpsgnFFF.", [40] = "fnegF-F.", [72] = "fmrF-F.",
[136] = "fnabsF-F.", [264] = "fabsF-F.",
[12] = "frspF-F.",
[14] = "fctiwF-F.", [15] = "fctiwzF-F.",
[583] = "mffsF.", [711] = "mtfsfZF.",
[392] = "frinF-F.", [424] = "frizF-F.",
[456] = "fripF-F.", [488] = "frimF-F.",
[814] = "fctidF-F.", [815] = "fctidzF-F.", [846] = "fcfidF-F.",
},
{
shift = 1, mask = 15,
[0] = false, false, "fdivFFF.", false,
"fsubFFF.", "faddFFF.", "fsqrtF-F.", "fselFFFF~.",
"freF-F.", "fmulFF-F.", "frsqrteF-F.", false,
"fmsubFFFF~.", "fmaddFFFF~.", "fnmsubFFFF~.", "fnmaddFFFF~.",
}
}
local map_spe = {
shift = 0, mask = 2047,
[512] = "evaddwRRR", [514] = "evaddiwRAR~",
[516] = "evsubwRRR~", [518] = "evsubiwRAR~",
[520] = "evabsRR", [521] = "evnegRR",
[522] = "evextsbRR", [523] = "evextshRR", [524] = "evrndwRR",
[525] = "evcntlzwRR", [526] = "evcntlswRR",
[527] = "brincRRR",
[529] = "evandRRR", [530] = "evandcRRR", [534] = "evxorRRR",
[535] = "evor|evmrRRR=", [536] = "evnor|evnotRRR=",
[537] = "eveqvRRR", [539] = "evorcRRR", [542] = "evnandRRR",
[544] = "evsrwuRRR", [545] = "evsrwsRRR",
[546] = "evsrwiuRRA", [547] = "evsrwisRRA",
[548] = "evslwRRR", [550] = "evslwiRRA",
[552] = "evrlwRRR", [553] = "evsplatiRS",
[554] = "evrlwiRRA", [555] = "evsplatfiRS",
[556] = "evmergehiRRR", [557] = "evmergeloRRR",
[558] = "evmergehiloRRR", [559] = "evmergelohiRRR",
[560] = "evcmpgtuYRR", [561] = "evcmpgtsYRR",
[562] = "evcmpltuYRR", [563] = "evcmpltsYRR",
[564] = "evcmpeqYRR",
[632] = "evselRRR", [633] = "evselRRRW",
[634] = "evselRRRW", [635] = "evselRRRW",
[636] = "evselRRRW", [637] = "evselRRRW",
[638] = "evselRRRW", [639] = "evselRRRW",
[640] = "evfsaddRRR", [641] = "evfssubRRR",
[644] = "evfsabsRR", [645] = "evfsnabsRR", [646] = "evfsnegRR",
[648] = "evfsmulRRR", [649] = "evfsdivRRR",
[652] = "evfscmpgtYRR", [653] = "evfscmpltYRR", [654] = "evfscmpeqYRR",
[656] = "evfscfuiR-R", [657] = "evfscfsiR-R",
[658] = "evfscfufR-R", [659] = "evfscfsfR-R",
[660] = "evfsctuiR-R", [661] = "evfsctsiR-R",
[662] = "evfsctufR-R", [663] = "evfsctsfR-R",
[664] = "evfsctuizR-R", [666] = "evfsctsizR-R",
[668] = "evfststgtYRR", [669] = "evfststltYRR", [670] = "evfststeqYRR",
[704] = "efsaddRRR", [705] = "efssubRRR",
[708] = "efsabsRR", [709] = "efsnabsRR", [710] = "efsnegRR",
[712] = "efsmulRRR", [713] = "efsdivRRR",
[716] = "efscmpgtYRR", [717] = "efscmpltYRR", [718] = "efscmpeqYRR",
[719] = "efscfdR-R",
[720] = "efscfuiR-R", [721] = "efscfsiR-R",
[722] = "efscfufR-R", [723] = "efscfsfR-R",
[724] = "efsctuiR-R", [725] = "efsctsiR-R",
[726] = "efsctufR-R", [727] = "efsctsfR-R",
[728] = "efsctuizR-R", [730] = "efsctsizR-R",
[732] = "efststgtYRR", [733] = "efststltYRR", [734] = "efststeqYRR",
[736] = "efdaddRRR", [737] = "efdsubRRR",
[738] = "efdcfuidR-R", [739] = "efdcfsidR-R",
[740] = "efdabsRR", [741] = "efdnabsRR", [742] = "efdnegRR",
[744] = "efdmulRRR", [745] = "efddivRRR",
[746] = "efdctuidzR-R", [747] = "efdctsidzR-R",
[748] = "efdcmpgtYRR", [749] = "efdcmpltYRR", [750] = "efdcmpeqYRR",
[751] = "efdcfsR-R",
[752] = "efdcfuiR-R", [753] = "efdcfsiR-R",
[754] = "efdcfufR-R", [755] = "efdcfsfR-R",
[756] = "efdctuiR-R", [757] = "efdctsiR-R",
[758] = "efdctufR-R", [759] = "efdctsfR-R",
[760] = "efdctuizR-R", [762] = "efdctsizR-R",
[764] = "efdtstgtYRR", [765] = "efdtstltYRR", [766] = "efdtsteqYRR",
[768] = "evlddxRR0R", [769] = "evlddRR8",
[770] = "evldwxRR0R", [771] = "evldwRR8",
[772] = "evldhxRR0R", [773] = "evldhRR8",
[776] = "evlhhesplatxRR0R", [777] = "evlhhesplatRR2",
[780] = "evlhhousplatxRR0R", [781] = "evlhhousplatRR2",
[782] = "evlhhossplatxRR0R", [783] = "evlhhossplatRR2",
[784] = "evlwhexRR0R", [785] = "evlwheRR4",
[788] = "evlwhouxRR0R", [789] = "evlwhouRR4",
[790] = "evlwhosxRR0R", [791] = "evlwhosRR4",
[792] = "evlwwsplatxRR0R", [793] = "evlwwsplatRR4",
[796] = "evlwhsplatxRR0R", [797] = "evlwhsplatRR4",
[800] = "evstddxRR0R", [801] = "evstddRR8",
[802] = "evstdwxRR0R", [803] = "evstdwRR8",
[804] = "evstdhxRR0R", [805] = "evstdhRR8",
[816] = "evstwhexRR0R", [817] = "evstwheRR4",
[820] = "evstwhoxRR0R", [821] = "evstwhoRR4",
[824] = "evstwwexRR0R", [825] = "evstwweRR4",
[828] = "evstwwoxRR0R", [829] = "evstwwoRR4",
[1027] = "evmhessfRRR", [1031] = "evmhossfRRR", [1032] = "evmheumiRRR",
[1033] = "evmhesmiRRR", [1035] = "evmhesmfRRR", [1036] = "evmhoumiRRR",
[1037] = "evmhosmiRRR", [1039] = "evmhosmfRRR", [1059] = "evmhessfaRRR",
[1063] = "evmhossfaRRR", [1064] = "evmheumiaRRR", [1065] = "evmhesmiaRRR",
[1067] = "evmhesmfaRRR", [1068] = "evmhoumiaRRR", [1069] = "evmhosmiaRRR",
[1071] = "evmhosmfaRRR", [1095] = "evmwhssfRRR", [1096] = "evmwlumiRRR",
[1100] = "evmwhumiRRR", [1101] = "evmwhsmiRRR", [1103] = "evmwhsmfRRR",
[1107] = "evmwssfRRR", [1112] = "evmwumiRRR", [1113] = "evmwsmiRRR",
[1115] = "evmwsmfRRR", [1127] = "evmwhssfaRRR", [1128] = "evmwlumiaRRR",
[1132] = "evmwhumiaRRR", [1133] = "evmwhsmiaRRR", [1135] = "evmwhsmfaRRR",
[1139] = "evmwssfaRRR", [1144] = "evmwumiaRRR", [1145] = "evmwsmiaRRR",
[1147] = "evmwsmfaRRR",
[1216] = "evaddusiaawRR", [1217] = "evaddssiaawRR",
[1218] = "evsubfusiaawRR", [1219] = "evsubfssiaawRR",
[1220] = "evmraRR",
[1222] = "evdivwsRRR", [1223] = "evdivwuRRR",
[1224] = "evaddumiaawRR", [1225] = "evaddsmiaawRR",
[1226] = "evsubfumiaawRR", [1227] = "evsubfsmiaawRR",
[1280] = "evmheusiaawRRR", [1281] = "evmhessiaawRRR",
[1283] = "evmhessfaawRRR", [1284] = "evmhousiaawRRR",
[1285] = "evmhossiaawRRR", [1287] = "evmhossfaawRRR",
[1288] = "evmheumiaawRRR", [1289] = "evmhesmiaawRRR",
[1291] = "evmhesmfaawRRR", [1292] = "evmhoumiaawRRR",
[1293] = "evmhosmiaawRRR", [1295] = "evmhosmfaawRRR",
[1320] = "evmhegumiaaRRR", [1321] = "evmhegsmiaaRRR",
[1323] = "evmhegsmfaaRRR", [1324] = "evmhogumiaaRRR",
[1325] = "evmhogsmiaaRRR", [1327] = "evmhogsmfaaRRR",
[1344] = "evmwlusiaawRRR", [1345] = "evmwlssiaawRRR",
[1352] = "evmwlumiaawRRR", [1353] = "evmwlsmiaawRRR",
[1363] = "evmwssfaaRRR", [1368] = "evmwumiaaRRR",
[1369] = "evmwsmiaaRRR", [1371] = "evmwsmfaaRRR",
[1408] = "evmheusianwRRR", [1409] = "evmhessianwRRR",
[1411] = "evmhessfanwRRR", [1412] = "evmhousianwRRR",
[1413] = "evmhossianwRRR", [1415] = "evmhossfanwRRR",
[1416] = "evmheumianwRRR", [1417] = "evmhesmianwRRR",
[1419] = "evmhesmfanwRRR", [1420] = "evmhoumianwRRR",
[1421] = "evmhosmianwRRR", [1423] = "evmhosmfanwRRR",
[1448] = "evmhegumianRRR", [1449] = "evmhegsmianRRR",
[1451] = "evmhegsmfanRRR", [1452] = "evmhogumianRRR",
[1453] = "evmhogsmianRRR", [1455] = "evmhogsmfanRRR",
[1472] = "evmwlusianwRRR", [1473] = "evmwlssianwRRR",
[1480] = "evmwlumianwRRR", [1481] = "evmwlsmianwRRR",
[1491] = "evmwssfanRRR", [1496] = "evmwumianRRR",
[1497] = "evmwsmianRRR", [1499] = "evmwsmfanRRR",
}
local map_pri = {
[0] = false, false, "tdiARI", "twiARI",
map_spe, false, false, "mulliRRI",
"subficRRI", false, "cmpl_iYLRU", "cmp_iYLRI",
"addicRRI", "addic.RRI", "addi|liRR0I", "addis|lisRR0I",
"b_KBJ", "sc", "bKJ", map_crops,
"rlwimiRR~AAA.", map_rlwinm, false, "rlwnmRR~RAA.",
"oriNRR~U", "orisRR~U", "xoriRR~U", "xorisRR~U",
"andi.RR~U", "andis.RR~U", map_rld, map_ext,
"lwzRRD", "lwzuRRD", "lbzRRD", "lbzuRRD",
"stwRRD", "stwuRRD", "stbRRD", "stbuRRD",
"lhzRRD", "lhzuRRD", "lhaRRD", "lhauRRD",
"sthRRD", "sthuRRD", "lmwRRD", "stmwRRD",
"lfsFRD", "lfsuFRD", "lfdFRD", "lfduFRD",
"stfsFRD", "stfsuFRD", "stfdFRD", "stfduFRD",
false, false, map_ld, map_fps,
false, false, map_std, map_fpd,
}
------------------------------------------------------------------------------
local map_gpr = {
[0] = "r0", "sp", "r2", "r3", "r4", "r5", "r6", "r7",
"r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
"r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23",
"r24", "r25", "r26", "r27", "r28", "r29", "r30", "r31",
}
local map_cond = { [0] = "lt", "gt", "eq", "so", "ge", "le", "ne", "ns", }
-- Format a condition bit.
local function condfmt(cond)
if cond <= 3 then
return map_cond[band(cond, 3)]
else
return format("4*cr%d+%s", rshift(cond, 2), map_cond[band(cond, 3)])
end
end
------------------------------------------------------------------------------
-- Output a nicely formatted line with an opcode and operands.
local function putop(ctx, text, operands)
local pos = ctx.pos
local extra = ""
if ctx.rel then
local sym = ctx.symtab[ctx.rel]
if sym then extra = "\t->"..sym end
end
if ctx.hexdump > 0 then
ctx.out(format("%08x %s %-7s %s%s\n",
ctx.addr+pos, tohex(ctx.op), text, concat(operands, ", "), extra))
else
ctx.out(format("%08x %-7s %s%s\n",
ctx.addr+pos, text, concat(operands, ", "), extra))
end
ctx.pos = pos + 4
end
-- Fallback for unknown opcodes.
local function unknown(ctx)
return putop(ctx, ".long", { "0x"..tohex(ctx.op) })
end
-- Disassemble a single instruction.
local function disass_ins(ctx)
local pos = ctx.pos
local b0, b1, b2, b3 = byte(ctx.code, pos+1, pos+4)
local op = bor(lshift(b0, 24), lshift(b1, 16), lshift(b2, 8), b3)
local operands = {}
local last = nil
local rs = 21
ctx.op = op
ctx.rel = nil
local opat = map_pri[rshift(b0, 2)]
while type(opat) ~= "string" do
if not opat then return unknown(ctx) end
opat = opat[band(rshift(op, opat.shift), opat.mask)]
end
local name, pat = match(opat, "^([a-z0-9_.]*)(.*)")
local altname, pat2 = match(pat, "|([a-z0-9_.]*)(.*)")
if altname then pat = pat2 end
for p in gmatch(pat, ".") do
local x = nil
if p == "R" then
x = map_gpr[band(rshift(op, rs), 31)]
rs = rs - 5
elseif p == "F" then
x = "f"..band(rshift(op, rs), 31)
rs = rs - 5
elseif p == "A" then
x = band(rshift(op, rs), 31)
rs = rs - 5
elseif p == "S" then
x = arshift(lshift(op, 27-rs), 27)
rs = rs - 5
elseif p == "I" then
x = arshift(lshift(op, 16), 16)
elseif p == "U" then
x = band(op, 0xffff)
elseif p == "D" or p == "E" then
local disp = arshift(lshift(op, 16), 16)
if p == "E" then disp = band(disp, -4) end
if last == "r0" then last = "0" end
operands[#operands] = format("%d(%s)", disp, last)
elseif p >= "2" and p <= "8" then
local disp = band(rshift(op, rs), 31) * p
if last == "r0" then last = "0" end
operands[#operands] = format("%d(%s)", disp, last)
elseif p == "H" then
x = band(rshift(op, rs), 31) + lshift(band(op, 2), 4)
rs = rs - 5
elseif p == "M" then
x = band(rshift(op, rs), 31) + band(op, 0x20)
elseif p == "C" then
x = condfmt(band(rshift(op, rs), 31))
rs = rs - 5
elseif p == "B" then
local bo = rshift(op, 21)
local cond = band(rshift(op, 16), 31)
local cn = ""
rs = rs - 10
if band(bo, 4) == 0 then
cn = band(bo, 2) == 0 and "dnz" or "dz"
if band(bo, 0x10) == 0 then
cn = cn..(band(bo, 8) == 0 and "f" or "t")
end
if band(bo, 0x10) == 0 then x = condfmt(cond) end
name = name..(band(bo, 1) == band(rshift(op, 15), 1) and "-" or "+")
elseif band(bo, 0x10) == 0 then
cn = map_cond[band(cond, 3) + (band(bo, 8) == 0 and 4 or 0)]
if cond > 3 then x = "cr"..rshift(cond, 2) end
name = name..(band(bo, 1) == band(rshift(op, 15), 1) and "-" or "+")
end
name = gsub(name, "_", cn)
elseif p == "J" then
x = arshift(lshift(op, 27-rs), 29-rs)*4
if band(op, 2) == 0 then x = ctx.addr + pos + x end
ctx.rel = x
x = "0x"..tohex(x)
elseif p == "K" then
if band(op, 1) ~= 0 then name = name.."l" end
if band(op, 2) ~= 0 then name = name.."a" end
elseif p == "X" or p == "Y" then
x = band(rshift(op, rs+2), 7)
if x == 0 and p == "Y" then x = nil else x = "cr"..x end
rs = rs - 5
elseif p == "W" then
x = "cr"..band(op, 7)
elseif p == "Z" then
x = band(rshift(op, rs-4), 255)
rs = rs - 10
elseif p == ">" then
operands[#operands] = rshift(operands[#operands], 1)
elseif p == "0" then
if last == "r0" then
operands[#operands] = nil
if altname then name = altname end
end
elseif p == "L" then
name = gsub(name, "_", band(op, 0x00200000) ~= 0 and "d" or "w")
elseif p == "." then
if band(op, 1) == 1 then name = name.."." end
elseif p == "N" then
if op == 0x60000000 then name = "nop"; break end
elseif p == "~" then
local n = #operands
operands[n-1], operands[n] = operands[n], operands[n-1]
elseif p == "=" then
local n = #operands
if last == operands[n-1] then
operands[n] = nil
name = altname
end
elseif p == "%" then
local n = #operands
if last == operands[n-1] and last == operands[n-2] then
operands[n] = nil
operands[n-1] = nil
name = altname
end
elseif p == "-" then
rs = rs - 5
else
assert(false)
end
if x then operands[#operands+1] = x; last = x end
end
return putop(ctx, name, operands)
end
------------------------------------------------------------------------------
-- Disassemble a block of code.
local function disass_block(ctx, ofs, len)
if not ofs then ofs = 0 end
local stop = len and ofs+len or #ctx.code
stop = stop - stop % 4
ctx.pos = ofs - ofs % 4
ctx.rel = nil
while ctx.pos < stop do disass_ins(ctx) end
end
-- Extended API: create a disassembler context. Then call ctx:disass(ofs, len).
local function create(code, addr, out)
local ctx = {}
ctx.code = code
ctx.addr = addr or 0
ctx.out = out or io.write
ctx.symtab = {}
ctx.disass = disass_block
ctx.hexdump = 8
return ctx
end
-- Simple API: disassemble code (a string) at address and output via out.
local function disass(code, addr, out)
create(code, addr, out):disass()
end
-- Return register name for RID.
local function regname(r)
if r < 32 then return map_gpr[r] end
return "f"..(r-32)
end
-- Public module functions.
return {
create = create,
disass = disass,
regname = regname
}
| gpl-2.0 |
mramirbad/teleatom | plugins/face.lua | 641 | 3073 | local https = require("ssl.https")
local ltn12 = require "ltn12"
-- Edit data/mashape.lua with your Mashape API key
-- http://docs.mashape.com/api-keys
local mashape = load_from_file('data/mashape.lua', {
api_key = ''
})
local function request(imageUrl)
local api_key = mashape.api_key
if api_key:isempty() then
return nil, 'Configure your Mashape API Key'
end
local api = "https://faceplusplus-faceplusplus.p.mashape.com/detection/detect?"
local parameters = "attribute=gender%2Cage%2Crace"
parameters = parameters .. "&url="..(URL.escape(imageUrl) or "")
local url = api..parameters
local headers = {
["X-Mashape-Key"] = api_key,
["Accept"] = "Accept: application/json"
}
print(url)
local respbody = {}
local body, code = https.request{
url = url,
method = "GET",
headers = headers,
sink = ltn12.sink.table(respbody),
protocol = "tlsv1"
}
if code ~= 200 then return "", code end
local body = table.concat(respbody)
return body, code
end
local function parseData(data)
local jsonBody = json:decode(data)
local response = ""
if jsonBody.error ~= nil then
if jsonBody.error == "IMAGE_ERROR_FILE_TOO_LARGE" then
response = response .. "The image is too big. Provide a smaller image."
elseif jsonBody.error == "IMAGE_ERROR_FAILED_TO_DOWNLOAD" then
response = response .. "Is that a valid url for an image?"
else
response = response .. jsonBody.error
end
elseif jsonBody.face == nil or #jsonBody.face == 0 then
response = response .. "No faces found"
else
response = response .. #jsonBody.face .." face(s) found:\n\n"
for k,face in pairs(jsonBody.face) do
local raceP = ""
if face.attribute.race.confidence > 85.0 then
raceP = face.attribute.race.value:lower()
elseif face.attribute.race.confidence > 50.0 then
raceP = "(probably "..face.attribute.race.value:lower()..")"
else
raceP = "(posibly "..face.attribute.race.value:lower()..")"
end
if face.attribute.gender.confidence > 85.0 then
response = response .. "There is a "
else
response = response .. "There may be a "
end
response = response .. raceP .. " " .. face.attribute.gender.value:lower() .. " "
response = response .. ", " .. face.attribute.age.value .. "(±".. face.attribute.age.range ..") years old \n"
end
end
return response
end
local function run(msg, matches)
--return request('http://www.uni-regensburg.de/Fakultaeten/phil_Fak_II/Psychologie/Psy_II/beautycheck/english/durchschnittsgesichter/m(01-32)_gr.jpg')
local data, code = request(matches[1])
if code ~= 200 then return "There was an error. "..code end
return parseData(data)
end
return {
description = "Who is in that photo?",
usage = {
"!face [url]",
"!recognise [url]"
},
patterns = {
"^!face (.*)$",
"^!recognise (.*)$"
},
run = run
}
| gpl-2.0 |
yongshengwang/hue | tools/wrk-scripts/lib/equal-5bb8dbf.lua | 22 | 1818 | -- The MIT License (MIT)
--
-- Copyright (c) 2014, Cyril David <cyx@cyx.is>
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to deal
-- in the Software without restriction, including without limitation the rights
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-- copies of the Software, and to permit persons to whom the Software is
-- furnished to do so, subject to the following conditions:
--
-- The above copyright notice and this permission notice shall be included in
-- all copies or substantial portions of the Software.
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-- THE SOFTWARE.
local function equal(x, y)
local t1, t2 = type(x), type(y)
-- Shortcircuit if types not equal.
if t1 ~= t2 then return false end
-- For primitive types, direct comparison works.
if t1 ~= 'table' and t2 ~= 'table' then return x == y end
-- Since we have two tables, make sure both have the same
-- length so we can avoid looping over different length arrays.
if #x ~= #y then return false end
-- Case 1: check over all keys of x
for k,v in pairs(x) do
if not equal(v, y[k]) then return false end
end
-- Case 2: check over `y` this time.
for k,v in pairs(y) do
if not equal(v, x[k]) then return false end
end
return true
end
return equal
| apache-2.0 |
santssoft/darkstar | scripts/zones/Windurst_Woods/npcs/Nokkhi_Jinjahl.lua | 12 | 5098 | -----------------------------------
-- Area: Windurst Woods
-- NPC: Nokkhi Jinjahl
-- Type: Travelling Merchant NPC / NPC Quiver Maker / Windurst 1st Place
-- !pos 4 1 -43 241
-----------------------------------
local ID = require("scripts/zones/Windurst_Woods/IDs")
-----------------------------------
function onTrade(player,npc,trade)
local ammoList =
{
{21307, 6199}, -- arrow, achiyalabopa
{21306, 6200}, -- arrow, adlivun
{19195, 5819}, -- arrow, antlion
{18154, 4221}, -- arrow, beetle
{21309, 6137}, -- arrow, chapuli
{18159, 4224}, -- arrow, demon
{21302, 6269}, -- arrow, eminent
{19800, 5912}, -- arrow, gargouille
{18156, 4222}, -- arrow, horn
{17320, 4225}, -- arrow, iron
{17325, 5332}, -- arrow, kabura
{21308, 6138}, -- arrow, mantid
{21303, 6280}, -- arrow, ra'kaznar
{21304, 6202}, -- arrow, raaz
{19182, 5871}, -- arrow, ruszor
{18155, 4223}, -- arrow, scorpion
{17321, 4226}, -- arrow, silver
{18158, 5333}, -- arrow, sleep
{17330, 4219}, -- arrow, stone
{21305, 6201}, -- arrow, tulfaire
{21314, 6278}, -- bolt, abrasion
{21321, 6203}, -- bolt, achiyalabopa
{18148, 5335}, -- bolt, acid
{19801, 5913}, -- bolt, adaman
{21320, 6204}, -- bolt, adlivun
{21318, 6206}, -- bolt, bismuth
{18150, 5334}, -- bolt, blind
{18151, 5339}, -- bolt, bloody
{21322, 6140}, -- bolt, damascus
{19183, 5872}, -- bolt, dark adaman
{19196, 5820}, -- bolt, darkling
{17338, 4229}, -- bolt, darksteel
{21316, 6270}, -- bolt, eminent
{19197, 5821}, -- bolt, fusion
{21313, 6310}, -- bolt, gashing
{18153, 5336}, -- bolt, holy
{21324, 6139}, -- bolt, midrium
{17337, 4228}, -- bolt, mythril
{21323, 6141}, -- bolt, oxidant
{21317, 6281}, -- bolt, ra'kaznar
{21315, 6279}, -- bolt, righteous
{18149, 5337}, -- bolt, sleep
{21319, 6205}, -- bolt, titanium
{18152, 5338}, -- bolt, venom
{19803, 5915}, -- bullet, adaman
{21336, 6208}, -- bullet, adlivun
{21337, 6207}, -- bullet, achiyalabopa
{17340, 5363}, -- bullet
{21333, 6210}, -- bullet, bismuth
{17343, 5359}, -- bullet, bronze
{21338, 6143}, -- bullet, damascus
{19184, 5873}, -- bullet, dark adaman
{21330, 6311}, -- bullet, decimating
{21328, 6437}, -- bullet, divine
{19198, 5822}, -- bullet, dweomer
{21331, 6271}, -- bullet, eminent
{17312, 5353}, -- bullet, iron
{19802, 5914}, -- bullet, orichalcum
{19199, 5823}, -- bullet, oberon's
{21332, 6282}, -- bullet, ra'kaznar
{17341, 5340}, -- bullet, silver
{18723, 5416}, -- bullet, steel
{18160, 5341}, -- bullet, spartan
{21335, 6209}, -- bullet, titanium
{2176, 5402}, -- card, fire
{2177, 5403}, -- card, ice
{2178, 5404}, -- card, wind
{2179, 5405}, -- card, earth
{2180, 5406}, -- card, thunder
{2181, 5407}, -- card, water
{2182, 5408}, -- card, light
{2183, 5409}, -- card, dark
}
local carnationsNeeded = 0
local giveToPlayer = {}
-- check for invalid items
for i = 0,8,1 do
local itemId = trade:getItemId(i)
if itemId > 0 and itemId ~= 948 then
local validSlot = false
for k, v in pairs(ammoList) do
if v[1] == itemId then
local itemQty = trade:getSlotQty(i)
if itemQty % 99 ~= 0 then
player:messageSpecial(ID.text.NOKKHI_BAD_COUNT)
return
end
local stacks = itemQty / 99
carnationsNeeded = carnationsNeeded + stacks
giveToPlayer[#giveToPlayer+1] = {v[2], stacks}
validSlot = true
break
end
end
if not validSlot then
player:messageSpecial(ID.text.NOKKHI_BAD_ITEM)
return
end
end
end
-- check for correct number of carnations
if carnationsNeeded == 0 or trade:getItemQty(948) ~= carnationsNeeded then
player:messageSpecial(ID.text.NOKKHI_BAD_COUNT)
return
end
-- check for enough inventory space
if player:getFreeSlotsCount() < carnationsNeeded then
player:messageSpecial(ID.text.ITEM_CANNOT_BE_OBTAINED, giveToPlayer[1][1])
return
end
-- make the trade
player:messageSpecial(ID.text.NOKKHI_GOOD_TRADE)
for k, v in pairs(giveToPlayer) do
player:addItem(v[1], v[2])
player:messageSpecial(ID.text.ITEM_OBTAINED,v[1])
end
player:tradeComplete()
end
function onTrigger(player,npc)
player:startEvent(667,npc:getID())
end
function onEventUpdate(player,csid,option)
end
function onEventFinish(player,csid,option)
end
| gpl-3.0 |
santssoft/darkstar | scripts/globals/items/plate_of_royal_saute.lua | 11 | 1568 | -----------------------------------------
-- ID: 4295
-- Item: plate_of_royal_sautee
-- Food Effect: 240Min, All Races
-----------------------------------------
-- Strength 5
-- Agility 1
-- Intelligence -2
-- Attack +22% (cap 80)
-- Ranged Attack +22% (cap 80)
-- Stun Resist +4
-- HP recovered while healing +1
-----------------------------------------
require("scripts/globals/status")
require("scripts/globals/msg")
-----------------------------------------
function onItemCheck(target)
local result = 0
if target:hasStatusEffect(dsp.effect.FOOD) or target:hasStatusEffect(dsp.effect.FIELD_SUPPORT_FOOD) then
result = dsp.msg.basic.IS_FULL
end
return result
end
function onItemUse(target)
target:addStatusEffect(dsp.effect.FOOD,0,0,14400,4295)
end
function onEffectGain(target, effect)
target:addMod(dsp.mod.STR, 5)
target:addMod(dsp.mod.AGI, 1)
target:addMod(dsp.mod.INT, -2)
target:addMod(dsp.mod.FOOD_ATTP, 22)
target:addMod(dsp.mod.FOOD_ATT_CAP, 80)
target:addMod(dsp.mod.FOOD_RATTP, 22)
target:addMod(dsp.mod.FOOD_RATT_CAP, 80)
target:addMod(dsp.mod.STUNRES, 4)
target:addMod(dsp.mod.HPHEAL, 1)
end
function onEffectLose(target, effect)
target:delMod(dsp.mod.STR, 5)
target:delMod(dsp.mod.AGI, 1)
target:delMod(dsp.mod.INT, -2)
target:delMod(dsp.mod.FOOD_ATTP, 22)
target:delMod(dsp.mod.FOOD_ATT_CAP, 80)
target:delMod(dsp.mod.FOOD_RATTP, 22)
target:delMod(dsp.mod.FOOD_RATT_CAP, 80)
target:delMod(dsp.mod.STUNRES, 4)
target:delMod(dsp.mod.HPHEAL, 1)
end
| gpl-3.0 |
CapsAdmin/pac3 | lua/pac3/editor/server/bans.lua | 1 | 2252 | local function get_bans()
local str = file.Read("pac_bans.txt", "DATA")
local bans = {}
if str and str ~= "" then
bans = util.KeyValuesToTable(str)
end
do -- check if this needs to be rebuilt
local k,v = next(bans)
if isstring(v) then
local temp = {}
for k,v in pairs(bans) do
temp[util.CRC("gm_" .. v .. "_gm")] = {steamid = v, name = k}
end
bans = temp
end
end
return bans
end
function pace.Ban(ply)
ply:ConCommand("pac_clear_parts")
timer.Simple( 1, function() -- made it a timer because the ConCommand don't run fast enough. - Bizzclaw
net.Start("pac_submit_acknowledged")
net.WriteBool(false)
net.WriteString("You have been banned from using pac!")
net.Send(ply)
local bans = get_bans()
for key, data in pairs(bans) do
if ply:SteamID() == data.steamid then
bans[key] = nil
end
end
bans[ply:UniqueID()] = {steamid = ply:SteamID(), nick = ply:Nick()}
pace.Bans = bans
file.Write("pac_bans.txt", util.TableToKeyValues(bans), "DATA")
end)
end
function pace.Unban(ply)
net.Start("pac_submit_acknowledged")
net.WriteBool(true)
net.WriteString("You are now permitted to use pac!")
net.Send(ply)
local bans = get_bans()
for key, data in pairs(bans) do
if ply:SteamID() == data.steamid then
bans[key] = nil
end
end
pace.Bans = bans
file.Write("pac_bans.txt", util.TableToKeyValues(bans), "DATA")
end
local function GetPlayer(target)
for key, ply in pairs(player.GetAll()) do
if ply:SteamID() == target or ply:UniqueID() == target or ply:Nick():lower():find(target:lower()) then
return ply
end
end
end
concommand.Add("pac_ban", function(ply, cmd, args)
local target = GetPlayer(args[1])
if (not IsValid(ply) or ply:IsAdmin()) and target then
pace.Ban(target)
pac.Message(ply, " banned ", target, " from PAC.")
end
end)
concommand.Add("pac_unban", function(ply, cmd, args)
local target = GetPlayer(args[1])
if (not IsValid(ply) or ply:IsAdmin()) and target then
pace.Unban(target)
pac.Message(ply, " unbanned ", target, " from PAC.")
end
end)
function pace.IsBanned(ply)
if not ply or not ply:IsValid() then return false end
if not pace.Bans then
pace.Bans = get_bans()
end
return pace.Bans[ply:UniqueID()] ~= nil
end
| gpl-3.0 |
m241dan/darkstar | scripts/globals/abilities/celerity.lua | 27 | 1130 | -----------------------------------
-- Ability: Celerity
-- Reduces the casting time and the recast time of your next white magic spell by 50%.
-- Obtained: Scholar Level 25
-- Recast Time: Stratagem Charge
-- Duration: 1 white magic spell or 60 seconds, whichever occurs first.
--
-- Level |Charges |Recharge Time per Charge
-- ----- -------- ---------------
-- 10 |1 |4:00 minutes
-- 30 |2 |2:00 minutes
-- 50 |3 |1:20 minutes
-- 70 |4 |1:00 minute
-- 90 |5 |48 seconds
-----------------------------------
require("scripts/globals/settings");
require("scripts/globals/status");
-----------------------------------
-- onAbilityCheck
-----------------------------------
function onAbilityCheck(player,target,ability)
if player:hasStatusEffect(EFFECT_CELERITY) then
return MSGBASIC_EFFECT_ALREADY_ACTIVE, 0;
end
return 0,0;
end;
-----------------------------------
-- onUseAbility
-----------------------------------
function onUseAbility(player,target,ability)
player:addStatusEffect(EFFECT_CELERITY,1,0,60);
return EFFECT_CELERITY;
end; | gpl-3.0 |
Har1eyquinn/dbot | plugins/img_google.lua | 1 | 3215 | do
local mime = require("mime")
local google_config = load_from_file('data/google.lua')
local cache = {}
--[[
local function send_request(url)
local t = {}
local options = {
url = url,
sink = ltn12.sink.table(t),
method = "GET"
}
local a, code, headers, status = http.request(options)
return table.concat(t), code, headers, status
end]]--
local function get_google_data(text)
local url = "http://ajax.googleapis.com/ajax/services/search/images?"
url = url.."v=1.0&rsz=5"
url = url.."&q="..URL.escape(text)
url = url.."&imgsz=small|medium|large"
if google_config.api_keys then
local i = math.random(#google_config.api_keys)
local api_key = google_config.api_keys[i]
if api_key then
url = url.."&key="..api_key
end
end
local res, code = http.request(url)
if code ~= 200 then
print("HTTP Error code:", code)
return nil
end
local google = json:decode(res)
return google
end
-- Returns only the useful google data to save on cache
local function simple_google_table(google)
local new_table = {}
new_table.responseData = {}
new_table.responseDetails = google.responseDetails
new_table.responseStatus = google.responseStatus
new_table.responseData.results = {}
local results = google.responseData.results
for k,result in pairs(results) do
new_table.responseData.results[k] = {}
new_table.responseData.results[k].unescapedUrl = result.unescapedUrl
new_table.responseData.results[k].url = result.url
end
return new_table
end
local function save_to_cache(query, data)
-- Saves result on cache
if string.len(query) <= 7 then
local text_b64 = mime.b64(query)
if not cache[text_b64] then
local simple_google = simple_google_table(data)
cache[text_b64] = simple_google
end
end
end
local function process_google_data(google, receiver, query)
if google.responseStatus == 403 then
local text = 'ERROR: Reached maximum searches per day'
send_msg(receiver, text, ok_cb, false)
elseif google.responseStatus == 200 then
local data = google.responseData
if not data or not data.results or #data.results == 0 then
local text = 'Image not found.'
send_msg(receiver, text, ok_cb, false)
return false
end
-- Random image from table
local i = math.random(#data.results)
local url = data.results[i].unescapedUrl or data.results[i].url
local old_timeout = http.TIMEOUT or 10
http.TIMEOUT = 5
send_photo_from_url(receiver, url)
http.TIMEOUT = old_timeout
save_to_cache(query, google)
else
local text = 'ERROR!'
send_msg(receiver, text, ok_cb, false)
end
end
function run(msg, matches)
local receiver = get_receiver(msg)
local text = matches[1]
local text_b64 = mime.b64(text)
local cached = cache[text_b64]
if cached then
process_google_data(cached, receiver, text)
else
local data = get_google_data(text)
process_google_data(data, receiver, text)
end
end
return {
description = "Search image with Google API and sends it.",
usage = "!img [term]: Random search an image with Google API.",
patterns = {
"^!img (.*)$",
"^/img (.*)$"
},
run = run
}
end
| gpl-2.0 |
dvr333/Zero-K | LuaUI/Widgets/gui_custom_markers.lua | 6 | 15518 | function widget:GetInfo()
return {
name = "Custom Markers",
desc = "Alternative to Spring map markers",
author = "Evil4Zerggin (adapted by KingRaptor)",
date = "29 December 2008",
license = "GNU LGPL, v2.1 or later",
layer = 1001, -- more than Chili
alwaysStart = true,
enabled = true -- loaded by default?
}
end
----------------------------------------------------------------
--config
----------------------------------------------------------------
--negative to disable blinking
local blinkPeriod = -1
local ttl = 15
local highlightSize = 32
local highlightLineMin = 24
local highlightLineMax = 40
local edgeMarkerSize = 16
local lineWidth = 2
local maxAlpha = 1
local fontSize = 32
local circleFreq = 1
local circleUpdateFreq = 0.01
local circleRadius = 150
local circleRadiusMin = 50
local circleAlpha = 0.9
--local circleAlphaMin = 0.1
local circleTTL = 3
local minimapHighlightSize = 8
local minimapHighlightLineMin = 6
local minimapHighlightLineMax = 10
local useFade = false
local circleDrawList
--[[
-- supported parameters (for both presets and manual args):
-- color
-- fontSize (note: offscreen arrow's text size is hardcoded to 2/3 normal font size)
-- showArrow [default true]
-- scaleTextSize (draws text in world instead of on screen) [default false]
-- noSmoke [default false]
-- technically position, text and even expiry frame can be enforced too but why would you do that?
]]
local stylePresets = {
--[[
examplePreset = {
color = {0.2, 0.7, 0.1},
fontSize = 24,
showArrow = false,
noSmoke = true,
scaleTextSize = true,
}
]]
small = {
fontSize = 24,
}
}
local colorPresets = {
red = {1, 0.2, 0.2, 1},
green = {0.2, 1, 0.2, 1},
blue = {0.2, 0.2, 1, 1},
}
local sizePresets = {
small = {
fontSize = 24,
showArrow = false,
},
}
for name, color in pairs(colorPresets) do
stylePresets[name] = {
color = color,
}
for sizeName, params in pairs(sizePresets) do
local new = {
color = color,
}
for key, value in pairs(params) do
new[key] = value
end
stylePresets[name .. "_" .. sizeName] = new
end
end
----------------------------------------------------------------
--speedups
----------------------------------------------------------------
local ArePlayersAllied = Spring.ArePlayersAllied
local GetPlayerInfo = Spring.GetPlayerInfo
local GetTeamColor = Spring.GetTeamColor
local GetSpectatingState = Spring.GetSpectatingState
local WorldToScreenCoords = Spring.WorldToScreenCoords
local glColor = gl.Color
local glRect = gl.Rect
local glLineWidth = gl.LineWidth
local glShape = gl.Shape
local glPolygonMode = gl.PolygonMode
local glText = gl.Text
local max = math.max
local abs = math.abs
local strSub = string.sub
local GL_LINES = GL.LINES
local GL_TRIANGLES = GL.TRIANGLES
local GL_LINE = GL.LINE
local GL_FRONT_AND_BACK = GL.FRONT_AND_BACK
local GL_FILL = GL.FILL
local EMPTY_TABLE = {}
local WHITE = {1, 1, 1, 1}
----------------------------------------------------------------
--Lups definition
----------------------------------------------------------------
local smokeFX = {
layer = 1,
alwaysVisible = true,
speed = 0.65,
count = 2,
colormap = { {0, 0, 0, 0.01},
{0.4, 0.4, 0.4, 0.01},
{0.35, 0.15, 0.15, 0.20},
{0, 0, 0, 0.01} },
delaySpread = 10,
life = 45,
lifeSpread = 15,
rotSpeed = 1,
rotSpeedSpread = -2,
rotSpread = 360,
size = 30,
sizeSpread = 5,
sizeGrowth = 0.2,
emitVector = {0,1,0},
emitRotSpread = 60,
texture = 'bitmaps/smoke/smoke01.tga',
}
local Lups
----------------------------------------------------------------
--vars
----------------------------------------------------------------
local mapPoints = {}
local circles = {}
local timeNow, timePart
local on = false
local mapX = Game.mapX * 512
local mapY = Game.mapY * 512
local vsx, vsy, sMidX, sMidY
----------------------------------------------------------------
--local functions
----------------------------------------------------------------
local function GetPlayerColor(playerID)
local _, _, isSpec, teamID = GetPlayerInfo(playerID)
if (isSpec) then return GetTeamColor(Spring.GetGaiaTeamID()) end
if (not teamID) then return nil end
return GetTeamColor(teamID)
end
local function StartTime()
local viewSizeX, viewSizeY = widgetHandler:GetViewSizes()
widget:ViewResize(viewSizeX, viewSizeY)
timeNow = 0
timePart = 0
on = true
end
local function SetUseFade(bool)
useFade = bool
end
local function RemovePoint(id)
local point = mapPoints[id]
if point and point.fx then
point.fx:Destroy()
end
mapPoints[id] = nil
end
local function AddPoint(id, x, z, text, styleName)
if mapPoints[id] then
RemovePoint(id)
end
local expiration = (timeNow or 0) + ttl
local y = Spring.GetGroundHeight(x, z)
local pointData = {x = x, y = y, z = z, text = text, expiration = expiration}
if styleName and stylePresets[styleName] then
pointData = Spring.Utilities.MergeTable(stylePresets[styleName], pointData, true)
end
if not pointData.color then
pointData.color = WHITE
end
mapPoints[id] = pointData
end
local function ClearPoints()
for id in pairs(mapPoints) do
RemovePoint(id)
end
end
-- makes a color char from a color table
-- explanation for string.char: http://springrts.com/phpbb/viewtopic.php?f=23&t=24952
local function GetColorChar(colorTable)
if colorTable == nil then return string.char(255,255,255,255) end
local col = {}
for i=1,3 do
col[i] = math.ceil((colorTable[i] or 1)*255)
end
return string.char(255,col[1],col[2],col[3])
end
local function CreateCircle(point)
circles[#circles + 1] = {
point = point,
x = point.x,
y = point.y,
z = point.z,
color = point.color,
alpha = 0,
radius = circleRadius,
time = 0,
}
end
-- from gfx_commands_fx.lua
local function CircleVertices(circleDivs)
for i = 1, circleDivs do
local theta = 2 * math.pi * i / circleDivs
gl.Vertex(math.cos(theta), math.sin(theta), 0)
end
end
local function DrawCircle(circle)
if not Spring.IsSphereInView(circle.x, circle.y, circle.z, circle.radius) then
return
end
gl.PushMatrix()
gl.Translate(circle.x, circle.y + 10, circle.z)
gl.Rotate(90, 1, 0, 0)
gl.Scale(circle.radius, circle.radius, 1)
gl.Color(circle.color[1], circle.color[2], circle.color[3], circle.alpha * circle.color[4])
gl.CallList(circleDrawList)
gl.PopMatrix()
end
local function DrawBillboardedText(point)
if not Spring.IsSphereInView(point.x, point.y, point.z, 250) then
return
end
local alpha = maxAlpha * (point.expiration - timeNow) / ttl
if (alpha <= 0) then
return
end
glColor(point.color[1], point.color[2], point.color[3], alpha * point.color[4])
gl.PushMatrix()
gl.Translate(point.x, point.y + 32, point.z )
gl.Billboard()
local cChar = GetColorChar(point.color)
glText(cChar..point.text.."\008", 0, 16, point.fontSize or fontSize, 'cno')
gl.PopMatrix()
end
local function DrawOnScreenPoint(point, sx, sy, sz, fontSizeLocal)
--[[ -- draw a targeting box
local vertices = {
{v = {sx, sy - highlightLineMin, 0}},
{v = {sx, sy - highlightLineMax, 0}},
{v = {sx, sy + highlightLineMin, 0}},
{v = {sx, sy + highlightLineMax, 0}},
{v = {sx - highlightLineMin, sy, 0}},
{v = {sx - highlightLineMax, sy, 0}},
{v = {sx + highlightLineMin, sy, 0}},
{v = {sx + highlightLineMax, sy, 0}},
}
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE)
glRect(sx - highlightSize, sy - highlightSize, sx + highlightSize, sy + highlightSize)
glShape(GL_LINES, vertices)
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL)
]]
if point.text and (not point.scaleTextSize) then
local cChar = GetColorChar(point.color)
glText(cChar..point.text.."\008", sx, sy + 16, fontSizeLocal, 'cno')
end
end
----------------------------------------------------------------
--callins
----------------------------------------------------------------
function widget:Initialize()
timeNow = nil
timePart = nil
Lups = WG.Lups
WG.CustomMarker = {
AddPoint = AddPoint,
RemovePoint = RemovePoint,
ClearPoints = ClearPoints,
SetUseFade = SetUseFade
}
circleDrawList = gl.CreateList(gl.BeginEnd, GL.LINE_LOOP, CircleVertices, 48)
widgetHandler:RegisterGlobal('AddCustomMapMarker', AddPoint)
widgetHandler:RegisterGlobal('RemoveCustomMapMarker', RemovePoint)
-- debug
--WG.CustomMarker.AddPoint("newPoint", Game.mapSizeX/2, Game.mapSizeZ/2, "Custom marker", "examplePreset")
--WG.CustomMarker.AddPoint("newPoint2", Game.mapSizeX/2 + 300, Game.mapSizeZ/2 - 300, "Custom marker 2", {1, 0.5, 1})
--WG.CustomMarker.AddPoint("newPoint3", Game.mapSizeX/2 - 300, Game.mapSizeZ/2 + 300, "Custom marker 3", {fontSize = 48, color = {0, 0.2, 1}})
end
function widget:Shutdown()
ClearPoints()
WG.CustomMarker = nil
gl.DeleteList(circleDrawList)
widgetHandler:DeregisterGlobal('AddCustomMapMarker', AddPoint)
widgetHandler:DeregisterGlobal('RemoveCustomMapMarker', RemovePoint)
end
-- update smoke
function widget:GameFrame(f)
if Lups and f%10 == 0 then
local wx, wy, wz = Spring.GetWind()
wx, wy, wz = wx*0.05, wy*0.05, wz*0.05
smokeFX.force = {wx,wy+2,wz}
for id,point in pairs(mapPoints) do
if not point.noSmoke then
local color = point.color
smokeFX.pos = {point.x, point.y, point.z}
smokeFX.partpos = "r*sin(alpha),0,r*cos(alpha) | alpha=rand()*2*pi, r=rand()*20"
smokeFX.colormap[2] = { color[1], color[2], color[3], smokeFX.colormap[2][4]}
smokeFX.colormap[3] = { color[1], color[2], color[3], smokeFX.colormap[3][4]}
smokeFX.texture = "bitmaps/smoke/smoke0" .. math.random(1,9) .. ".tga"
Lups.AddParticles('SimpleParticles2',smokeFX)
end
end
end
end
-- draw rings, scaling text
function widget:DrawWorldPreUnit()
glLineWidth(4)
gl.DepthTest(false)
--gl.LineStipple(true)
for i=1,#circles do
local circle = circles[i]
DrawCircle(circle)
end
for id,point in pairs(mapPoints) do
if point.text and point.scaleTextSize then
DrawBillboardedText(point)
end
end
glLineWidth(1)
gl.DepthTest(true)
gl.Color(1,1,1,1)
--gl.LineStipple(false)
end
-- draw non-scaling text and offscreen markers
function widget:DrawScreen()
if (not on) then
return
end
glLineWidth(lineWidth)
for id, point in pairs(mapPoints) do
local fontSizeLocal = point.fontSize or fontSize
local alpha = maxAlpha * (point.expiration - timeNow) / ttl
if (alpha <= 0) then
mapPoints[id] = nil
else
local sx, sy, sz = WorldToScreenCoords(point.x, point.y + 32, point.z)
glColor(point.color[1], point.color[2], point.color[3], alpha * point.color[4])
if (sx >= 0 and sy >= 0 and sx <= vsx and sy <= vsy) then
--in screen
DrawOnScreenPoint(point, sx, sy, sz, fontSizeLocal)
elseif point.showArrow ~= false then
--out of screen
local func = function()
glColor(point.color[1], point.color[2], point.color[3], alpha * point.color[4])
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL)
--flip if behind screen
if (sz > 1) then
sx = sMidX - sx
sy = sMidY - sy
end
local xRatio = sMidX / abs(sx - sMidX)
local yRatio = sMidY / abs(sy - sMidY)
local edgeDist, vertices, textX, textY, textOptions
local smallFontSize = math.floor(fontSizeLocal * 2 / 3 + 0.5)
if (xRatio < yRatio) then
edgeDist = (sy - sMidY) * xRatio + sMidY
if (sx > 0) then
vertices = {
{v = {vsx, edgeDist, 0}},
{v = {vsx - edgeMarkerSize, edgeDist + edgeMarkerSize, 0}},
{v = {vsx - edgeMarkerSize, edgeDist - edgeMarkerSize, 0}},
}
textX = vsx - edgeMarkerSize
textY = edgeDist - smallFontSize * 0.5
textOptions = "rn"
else
vertices = {
{v = {0, edgeDist, 0}},
{v = {edgeMarkerSize, edgeDist - edgeMarkerSize, 0}},
{v = {edgeMarkerSize, edgeDist + edgeMarkerSize, 0}},
}
textX = edgeMarkerSize
textY = edgeDist - smallFontSize * 0.5
textOptions = "n"
end
else
edgeDist = (sx - sMidX) * yRatio + sMidX
if (sy > 0) then
vertices = {
{v = {edgeDist, vsy, 0}},
{v = {edgeDist - edgeMarkerSize, vsy - edgeMarkerSize, 0}},
{v = {edgeDist + edgeMarkerSize, vsy - edgeMarkerSize, 0}},
}
textX = edgeDist
textY = vsy - edgeMarkerSize - smallFontSize
textOptions = "cn"
else
vertices = {
{v = {edgeDist, 0, 0}},
{v = {edgeDist + edgeMarkerSize, edgeMarkerSize, 0}},
{v = {edgeDist - edgeMarkerSize, edgeMarkerSize, 0}},
}
textX = edgeDist
textY = edgeMarkerSize
textOptions = "cn"
end
end
glShape(GL_TRIANGLES, vertices)
if point.text then
local cChar = GetColorChar(point.color)
glText(cChar..point.text.."\008", textX, textY, smallFontSize, textOptions .. 'o')
end
glColor(1, 1, 1)
glLineWidth(1)
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL)
end
if WG.DrawAfterChili then
WG.DrawAfterChili(func)
else
func()
end
end
end
end
glColor(1, 1, 1)
glLineWidth(1)
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL)
end
function widget:ViewResize(viewSizeX, viewSizeY)
vsx = viewSizeX
vsy = viewSizeY
sMidX = viewSizeX * 0.5
sMidY = viewSizeY * 0.5
end
-- handle points' rings
local ringPeriod = 0
local ringUpdatePeriod = 0
function widget:Update(dt)
if (not timeNow) then
StartTime()
else
if useFade then
timeNow = timeNow + dt
end
timePart = timePart + dt
if (timePart > blinkPeriod and blinkPeriod > 0) then
timePart = timePart - blinkPeriod
on = not on
end
end
ringPeriod = ringPeriod + dt
if ringPeriod > circleFreq then
for id, point in pairs(mapPoints) do
CreateCircle(point)
end
ringPeriod = 0
end
ringUpdatePeriod = ringUpdatePeriod + dt
if ringUpdatePeriod > circleUpdateFreq then
local notRemoved = {}
local delta = ringUpdatePeriod/circleTTL
for i=1,#circles do
local circle = circles[i]
local age = circle.time / circleTTL
if age <= 1 then
circle.time = circle.time + ringUpdatePeriod
circle.radius = circleRadius - (circleRadius - circleRadiusMin) * age
local alphaMult = 0.5 - math.abs(0.5 - age)
circle.alpha = circleAlpha * alphaMult * 2
notRemoved[#notRemoved + 1] = circle
end
end
circles = notRemoved
ringUpdatePeriod = 0
end
end
function widget:DrawInMiniMap(sx, sy)
if (not on) then return end
glLineWidth(lineWidth)
gl.Lighting(false)
local ratioX = sx / mapX
local ratioY = sy / mapY
for id,point in pairs(mapPoints) do
local alpha = maxAlpha * (point.expiration - timeNow) / ttl
if (alpha <= 0) then
mapPoints[id] = nil
else
local x = point.x * ratioX
local y = sy - point.z * ratioY
glColor(point.color[1], point.color[2], point.color[3], alpha * point.color[4])
local vertices = {
{v = {x, y - minimapHighlightLineMin, 0}},
{v = {x, y - minimapHighlightLineMax, 0}},
{v = {x, y + minimapHighlightLineMin, 0}},
{v = {x, y + minimapHighlightLineMax, 0}},
{v = {x - minimapHighlightLineMin, y, 0}},
{v = {x - minimapHighlightLineMax, y, 0}},
{v = {x + minimapHighlightLineMin, y, 0}},
{v = {x + minimapHighlightLineMax, y, 0}},
}
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE)
glRect(x - minimapHighlightSize, y - minimapHighlightSize, x + minimapHighlightSize, y + minimapHighlightSize)
glShape(GL_LINES, vertices)
end
end
glColor(1, 1, 1)
glLineWidth(1)
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL)
end
| gpl-2.0 |
rekotc/game-engine-experimental-3 | Source/GCC4/3rdParty/luaplus51-all/Src/Modules/wxLua/bindings/wxwidgets/wxxrc_rules.lua | 3 | 7817 | -- ----------------------------------------------------------------------------
-- Rules to build wxWidgets' wxXRC binding for wxLua
-- load using : $lua -e"rulesFilename=\"rules.lua\"" genwxbind.lua
-- ----------------------------------------------------------------------------
-- ----------------------------------------------------------------------------
-- Set the root directory of the wxLua distribution, used only in this file
wxlua_dir = "../"
-- ============================================================================
-- Set the Lua namespace (Lua table) that the bindings will be placed into.
-- See wxLuaBinding::GetLuaNamespace(); eg. wx.wxWindow(...)
hook_lua_namespace = "wx"
-- Set the unique C++ "namespace" for the bindings, not a real namespace, but
-- a string used in declared C++ objects to prevent duplicate names.
-- See wxLuaBinding::GetBindingName().
hook_cpp_namespace = "wxxrc"
-- ============================================================================
-- Set the directory to output the bindings to, both C++ header and source files
output_cpp_header_filepath = wxlua_dir.."modules/wxbind/include"
output_cpp_filepath = wxlua_dir.."modules/wxbind/src"
-- ============================================================================
-- Set the DLLIMPEXP macros for compiling these bindings into a DLL
-- Use "WXLUA_NO_DLLIMPEXP" and "WXLUA_NO_DLLIMPEXP_DATA" for no IMPEXP macros
output_cpp_impexpsymbol = "WXDLLIMPEXP_BINDWXXRC"
output_cpp_impexpdatasymbol = "WXDLLIMPEXP_DATA_BINDWXXRC"
-- ----------------------------------------------------------------------------
-- Set the name of the header file that will have the #includes from the
-- bindings in it. This will be used as #include "hook_cpp_header_filename" in
-- the C++ wrapper files, so it must include the proper #include path.
hook_cpp_header_filename = "wxbind/include/"..hook_cpp_namespace.."_bind.h"
-- ----------------------------------------------------------------------------
-- Set the name of the main binding file that will have the glue code for the
-- bindings in it. This file along with the output from the *.i files will be
-- placed in the "output_cpp_filepath".
hook_cpp_binding_filename = hook_cpp_namespace.."_bind.cpp"
-- ----------------------------------------------------------------------------
-- Generate only a single output C++ binding source file with the name of
-- hook_cpp_binding_filename, as opposed to generating a single cpp file
-- for each *.i file plus the hook_cpp_binding_filename file.
output_single_cpp_binding_file = true
-- ----------------------------------------------------------------------------
-- Set the name of the subclassed wxLuaBinding class
hook_cpp_binding_classname = "wxLuaBinding_"..hook_cpp_namespace
-- ----------------------------------------------------------------------------
-- Set the function names that wrap the output structs of defined values,
-- objects, events, functions, and classes.
hook_cpp_define_funcname = "wxLuaGetDefineList_"..hook_cpp_namespace
hook_cpp_string_funcname = "wxLuaGetStringList_"..hook_cpp_namespace
hook_cpp_object_funcname = "wxLuaGetObjectList_"..hook_cpp_namespace
hook_cpp_event_funcname = "wxLuaGetEventList_"..hook_cpp_namespace
hook_cpp_function_funcname = "wxLuaGetFunctionList_"..hook_cpp_namespace
hook_cpp_class_funcname = "wxLuaGetClassList_"..hook_cpp_namespace
-- ----------------------------------------------------------------------------
-- Set any #includes or other C++ code to be placed verbatim at the top of
-- every generated cpp file or "" for none
hook_cpp_binding_includes = ""
-- ----------------------------------------------------------------------------
-- Set any #includes or other C++ code to be placed verbatim below the
-- #includes of every generated cpp file or "" for none
hook_cpp_binding_post_includes = ""
-- ----------------------------------------------------------------------------
-- Add additional include information or C++ code for the binding header file.
-- This code will be place directly after any #includes at the top of the file
hook_cpp_binding_header_includes =
"#include \"wxbind/include/wxbinddefs.h\"\n"..
"#include \"wxluasetup.h\"\n"..
"#include \"wxbind/include/wxcore_bind.h\"\n"
-- ----------------------------------------------------------------------------
-- Set any #includes or other C++ code to be placed verbatim at the top of
-- the single hook_cpp_binding_filename generated cpp file or "" for none
hook_cpp_binding_source_includes = ""
-- ============================================================================
-- Set the bindings directory that contains the *.i interface files
interface_filepath = wxlua_dir.."bindings/wxwidgets"
-- ----------------------------------------------------------------------------
-- A list of interface files to use to make the bindings. These files will be
-- converted into *.cpp and placed in the output_cpp_filepath directory.
-- The files are loaded from the interface_filepath.
interface_fileTable =
{
"wxxrc_xrc.i"
}
-- ----------------------------------------------------------------------------
-- A list of files that contain bindings that need to be overridden or empty
-- table {} for none.
-- The files are loaded from the interface_filepath.
--override_fileTable = { "wxxrc_override.hpp" }
-- ============================================================================
-- A table containing filenames of XXX_datatype.lua from other wrappers to
-- to define classes and data types used in this wrapper
-- NOTE: for the base wxWidgets wrappers we don't load the cache since they
-- don't depend on other wrappers and can cause problems when interface
-- files are updated. Make sure you delete or have updated any cache file
-- that changes any data types used by this binding.
datatype_cache_input_fileTable = { wxlua_dir.."bindings/wxwidgets/wxcore_datatypes.lua" }
-- ----------------------------------------------------------------------------
-- The file to output the data type cache for later use with a binding that
-- makes use of data types (classes, enums, etc) that are declared in this
-- binding. The file will be generated in the interface_filepath.
datatypes_cache_output_filename = hook_cpp_namespace.."_datatypes.lua"
-- ============================================================================
-- Declare functions or member variables for the derived wxLuaBinding class
-- that will be generated for this binding. The string will be copied verbatim
-- into the body of the hook_cpp_binding_classname class declaration in the
-- hook_cpp_header_filename header file. May be remmed out to ignore it.
-- See usage in the wxWidgets wxbase_rules.lua file.
--wxLuaBinding_class_declaration = nothing to do here
-- ----------------------------------------------------------------------------
-- Implement the functions or member variables for the derived wxLuaBinding
-- class that you have declared. The string will be copied into the
-- hook_cpp_binding_filename source file. May be remmed out to ignore it.
-- See usage in the wxWidgets wxbase_rules.lua file.
--wxLuaBinding_class_implementation = nothing to do here
-- ============================================================================
-- Add additional conditions here
-- example: conditions["DOXYGEN_INCLUDE"] = "defined(DOXYGEN_INCLUDE)"
-- ----------------------------------------------------------------------------
-- Add additional data types here
-- example: AllocDataType("wxArrayInt", "class",false)
-- ============================================================================
-- Generate comments into binding C++ code
comment_cpp_binding_code = true
| lgpl-3.0 |
santssoft/darkstar | scripts/globals/weaponskills/glory_slash.lua | 10 | 1635 | -----------------------------------
-- Glory Slash
-- Sword weapon skill
-- Skill Level: NA
-- Only avaliable during Campaign Battle while weilding Lex Talionis.
-- Delivers and area attack that deals triple damage. Damage varies with TP. Additional effect Stun.
-- Will stack with Sneak Attack.
-- Aligned with the Flame Gorget & Light Gorget.
-- Aligned with the Flame Belt & Light Belt.
-- Element: Light
-- Modifiers: STR:30%
-- 100%TP 200%TP 300%TP
-- 3.00 3.50 4.00
-----------------------------------
require("scripts/globals/weaponskills")
require("scripts/globals/settings")
require("scripts/globals/status")
-----------------------------------
function onUseWeaponSkill(player, target, wsID, tp, primary, action, taChar)
local params = {}
params.numHits = 1
params.ftp100 = 3 params.ftp200 = 3.5 params.ftp300 = 4
params.str_wsc = 0.3 params.dex_wsc = 0.0 params.vit_wsc = 0.0 params.agi_wsc = 0.0 params.int_wsc = 0.0 params.mnd_wsc = 0.0 params.chr_wsc = 0.0
params.crit100 = 0.0 params.crit200 = 0.0 params.crit300 = 0.0
params.canCrit = false
params.acc100 = 0.0 params.acc200= 0.0 params.acc300= 0.0
params.atk100 = 1; params.atk200 = 1; params.atk300 = 1;
if (damage > 0 and target:hasStatusEffect(dsp.effect.STUN) == false) then
local duration = (tp/500) * applyResistanceAddEffect(player,target,dsp.magic.ele.LIGHTNING,0)
target:addStatusEffect(dsp.effect.STUN, 1, 0, duration)
end
local damage, tpHits, extraHits = doPhysicalWeaponskill(player, target, wsID, params, tp, action, primary, taChar)
return tpHits, extraHits, damage
end
| gpl-3.0 |
kireevco/luasense | app/app.lua | 1 | 6006 | -- app.lua
local http = require "lapis.nginx.http"
local lapis = require("lapis")
local console = require("lapis.console")
local http = require("lapis.nginx.http")
local config = require("lapis.config").get()
--local colors = require("ansicolors")
local logging = require("lapis.logging")
local util = require("lapis.util")
local json_params = require("lapis.application").json_params
local socketurl = require("socket.url")
local sqlite3 = require("lsqlite3")
local inspect = require('inspect')
local strlen = string.len
local cjson = require "cjson"
local rabbitmq = require "resty.rabbitmqstomp"
sensors = {}
local data = {}
local app = lapis.Application()
app:enable("etlua")
app.layout = require "views._layout"
--setCache("test","abc")
app:match("all", "/console", console.make())
app:get("index", "/", function(self)
self.title = "Dashboard"
self.temp = 4.3
self.test = data.test
self.class_active = 'class=active'
return {render = true}
end)
app:get('/pub', function(self)
data = {
sensor='all',
request='getData',
}
postRabbitMQRequest(data)
return "OK"
end)
app:get('sensors','/sensors', function(self)
self.title = "Sensors"
-- self.temp = 4.3
-- self.test = data.test
-- self.sensors = getSensors()
return {render = true}
-- return self.route_name
-- return self:url_for('index')
-- return inspect(self)
end)
app:get('websocket_test','/websocket_test', function(self)
-- self.title = "Websocket Test"
-- self.temp = 4.3
-- self.test = data.test
-- self.sensors = getSensors()
-- return {render = true}
-- return self.route_name
-- return self:url_for('index')
return inspect(self.route_name)
end)
app:get("/api/collectSensors", function(self)
-- a simple GET request
getSensorData(0)
return "response: " .. body
end)
app:get("/api/getSensors", json_params(function(self)
-- Set api layout
app.layout = require "views._layout_api"
local body = getSensors()
return util.to_json(body)
end))
-----------------------------
-----------------------------
function postRabbitMQRequest (msg)
local opts = {
username = "luasense",
password = "luasense",
vhost = "/",
}
local headers = {}
local mq, err = rabbitmq:new(opts)
if not mq then
return
end
mq:set_timeout(10000)
local ok, err = mq:connect("127.0.0.1",61613)
if not ok then
ngx.log(ngx.ERROR, "Error: ")
return
else
headers['ok'] = 'true'
end
headers["destination"] = "/topic/luasense"
-- headers["receipt"] = "msg#1"
-- headers["app-id"] = "luaresty"
-- headers["persistent"] = "true"
headers["content-type"] = "application/json"
local ok, err = mq:send(cjson.encode(msg), headers)
-- local ok, err = mq:send(msg, headers)
if not ok then
return
end
logging.notice("Published: ".. cjson.encode(msg))
return true
end
function requestSensorReadings ()
-- Requesting a refresh for sensors
end
function getSensors()
-- Getting a list of sensors that we have
db = sqlite3.open(config.sqlitedb)
for row in db:nrows('SELECT * FROM sensors') do
sensors[row.id] = row
end
db:close()
return sensors
end
function getSensorData (sensorID)
print(sensors)
if sensors[1].type == 0 then
local body, status_code, headers = http.simple(sensors[sensorID].ip)
end
end
function setCache(key, value)
memc:set_timeout(1000) -- 1 sec
local ok, err = memc:connect("192.168.174.135", "11211")
if not ok then
ngx.say("failed to connect: ", err)
return
end
local ok, err = memc:set(key, value)
if not ok then
ngx.say("failed to set "..key..": ", err)
return
end
return true
end
function getCache(key)
memc:set_timeout(1000) -- 1 sec
local ok, err = memc:connect("192.168.174.135", "11211")
if not ok then
ngx.say("failed to connect: ", err)
return
end
local res, flags, err = memc:get(key)
if err then
ngx.say("failed to get "..key..": ", err)
return
end
if not res then
ngx.say( key.."not found")
return
end
return res
end
function initDB ()
-- If tables don't exist - create.
end
function table.val_to_str ( v )
if "string" == type( v ) then
v = string.gsub( v, "\n", "\\n" )
if string.match( string.gsub(v,"[^'\"]",""), '^"+$' ) then
return "'" .. v .. "'"
end
return '"' .. string.gsub(v,'"', '\\"' ) .. '"'
else
return "table" == type( v ) and table.tostring( v ) or
tostring( v )
end
end
function table.key_to_str ( k )
if "string" == type( k ) and string.match( k, "^[_%a][_%a%d]*$" ) then
return k
else
return "[" .. table.val_to_str( k ) .. "]"
end
end
function table.tostring( tbl )
local result, done = {}, {}
for k, v in ipairs( tbl ) do
table.insert( result, table.val_to_str( v ) )
done[ k ] = true
end
for k, v in pairs( tbl ) do
if not done[ k ] then
table.insert( result,
table.key_to_str( k ) .. "=" .. table.val_to_str( v ) )
end
end
return "{" .. table.concat( result, "," ) .. "}"
end
-----------
--
--local headers = {}
--headers["destination"] = "/amq/queue/queuename"
--headers["persistent"] = "true"
--headers["id"] = "123"
--
--local ok, err = mq:subscribe(headers)
--if not ok then
-- return
--end
--
--local data, err = mq:receive()
--if not ok then
-- return
--end
--ngx.log(ngx.INFO, "Consumed: " .. data)
--
--local headers = {}
--headers["persistent"] = "true"
--headers["id"] = "123"
--
--local ok, err = mq:unsubscribe(headers)
--
--local ok, err = mq:set_keepalive(10000, 10000)
--if not ok then
-- return
--end
-----------
return app | mit |
ducseb/domoticz | scripts/dzVents/runtime/Utils.lua | 5 | 1304 | local self = {
LOG_ERROR = 1,
LOG_FORCE = 0.5,
LOG_MODULE_EXEC_INFO = 2,
LOG_INFO = 3,
LOG_DEBUG = 4,
}
function self.fileExists(name)
local f = io.open(name, "r")
if f ~= nil then
io.close(f)
return true
else
return false
end
end
function self.osExecute(cmd)
if (_G.TESTMODE) then return end
os.execute(cmd)
end
function self.print(msg)
if (_G.TESTMODE) then return end
print(msg)
end
function self.urlEncode(str)
if (str) then
str = string.gsub(str, "\n", "\r\n")
str = string.gsub(str, "([^%w %-%_%.%~])",
function(c) return string.format("%%%02X", string.byte(c)) end)
str = string.gsub(str, " ", "+")
end
return str
end
function self.log(msg, level)
if (level == nil) then level = self.LOG_INFO end
local lLevel = _G.logLevel == nil and 1 or _G.logLevel
local marker = ''
if (level == self.LOG_ERROR) then
marker = marker .. 'Error: '
elseif (level == self.LOG_DEBUG) then
marker = marker .. 'Debug: '
elseif (level == self.LOG_INFO or level == self.LOG_MODULE_EXEC_INFO) then
marker = marker .. 'Info: '
elseif (level == self.LOG_FORCE) then
marker = marker .. '!Info: '
end
if (_G.logMarker ~= nil) then
marker = marker .. _G.logMarker .. ': '
end
if (level <= lLevel) then
self.print(tostring(marker) .. msg)
end
end
return self | gpl-3.0 |
santssoft/darkstar | scripts/zones/Bibiki_Bay/npcs/Clamming_Point.lua | 9 | 5819 | -----------------------------------
-- Area: Bibiki Bay
-- NPC: Clamming Point
-----------------------------------
local ID = require("scripts/zones/Bibiki_Bay/IDs");
require("scripts/globals/keyitems");
-----------------------------------
-- Local Variables
-----------------------------------
-- clammingItems = item id, weight, drop rate, improved drop rate
local clammingItems = {
1311, 6, 0.001, 0.003, -- Oxblood
885, 6, 0.002, 0.006, -- Turtle Shell
1193, 6, 0.003, 0.009, -- HQ Crab Shell
1446, 6, 0.004, 0.012, -- Lacquer Tree Log
4318, 6, 0.005, 0.015, -- Bibiki Urchin
1586, 6, 0.008, 0.024, -- Titanictus Shell
5124, 20, 0.011, 0.033, -- Tropical Clam
690, 6, 0.014, 0.042, -- Elm Log
887, 6, 0.017, 0.051, -- Coral Fragment
703, 6, 0.021, 0.063, -- Petrified Log
691, 6, 0.025, 0.075, -- Maple Log
4468, 6, 0.029, 0.087, -- Pamamas
3270, 6, 0.033, 0.099, -- HQ Pugil Scales
888, 6, 0.038, 0.114, -- Seashell
4328, 6, 0.044, 0.132, -- Hobgoblin Bread
485, 6, 0.051, 0.153, -- Broken Willow Rod
510, 6, 0.058, 0.174, -- Goblin Armor
5187, 6, 0.065, 0.195, -- Elshimo Coconut
507, 6, 0.073, 0.219, -- Goblin Mail
881, 6, 0.081, 0.243, -- Crab Shell
4325, 6, 0.089, 0.267, -- Hobgoblin Pie
936, 6, 0.098, 0.294, -- Rock Salt
4361, 6, 0.107, 0.321, -- Nebimonite
864, 6, 0.119, 0.357, -- Fish Scales
4484, 6, 0.140, 0.420, -- Shall Shell
624, 6, 0.178, 0.534, -- Pamtam Kelp
1654, 35, 0.225, 0.675, -- Igneous Rock
17296, 7, 0.377, 0.784, -- Pebble
5123, 11, 0.628, 0.892, -- Jacknife
5122, 3, 1.000, 1.000 -- Bibiki Slug
};
-----------------------------------
-- Local Functions
-----------------------------------
local function giveImprovedResults(player)
if (player:getMod(dsp.mod.CLAMMING_IMPROVED_RESULTS) > 0) then
return 1;
end
return 0;
end;
local function giveReducedIncidents(player)
if (player:getMod(dsp.mod.CLAMMING_REDUCED_INCIDENTS) > 0) then
return 0.05;
end
return 0.1;
end;
function onTrade(player,npc,trade)
end;
function onTrigger(player,npc)
if (player:hasKeyItem(dsp.ki.CLAMMING_KIT)) then
player:setLocalVar("ClammingPointID", npc:getID());
if (GetServerVariable("ClammingPoint_" .. npc:getID() .. "_InUse") == 1) then
player:messageSpecial(ID.text.IT_LOOKS_LIKE_SOMEONE);
else
if (player:getCharVar("ClammingKitBroken") > 0) then -- Broken bucket
player:messageSpecial(ID.text.YOU_CANNOT_COLLECT);
else
local delay = GetServerVariable("ClammingPoint_" .. npc:getID() .. "_Delay");
if ( delay > 0 and delay > os.time()) then -- player has to wait a little longer
player:messageSpecial(ID.text.IT_LOOKS_LIKE_SOMEONE);
else
SetServerVariable("ClammingPoint_" .. npc:getID() .. "_InUse", 1);
SetServerVariable("ClammingPoint_" .. npc:getID() .. "_Delay", 0);
player:startEvent(20, 0, 0, 0, 0, 0, 0, 0, 0);
end
end
end
else
player:messageSpecial(ID.text.AREA_IS_LITTERED);
end;
end;
function onEventUpdate(player,csid,option)
if (csid == 20) then
if (player:getCharVar("ClammingKitSize") == 200 and math.random() <= giveReducedIncidents(player)) then
player:setLocalVar("SomethingJumpedInBucket", 1);
else
local dropRate = math.random();
local improvedResults = giveImprovedResults(player);
for itemDrop = 3, #clammingItems, 4 do
if (dropRate <= clammingItems[itemDrop + improvedResults]) then
player:setLocalVar("ClammedItem", clammingItems[itemDrop - 2]);
player:addCharVar("ClammedItem_" .. clammingItems[itemDrop - 2], 1);
player:addCharVar("ClammingKitWeight", clammingItems[itemDrop - 1]);
if (player:getCharVar("ClammingKitWeight") > player:getCharVar("ClammingKitSize")) then -- Broken bucket
player:setCharVar("ClammingKitBroken", 1);
end
break;
end
end
end
end
end;
function onEventFinish(player,csid,option)
if (csid == 20) then
if (player:getLocalVar("SomethingJumpedInBucket") > 0) then
player:setLocalVar("SomethingJumpedInBucket", 0);
player:messageSpecial(ID.text.SOMETHING_JUMPS_INTO);
player:setCharVar("ClammingKitBroken", 1);
for item = 1, #clammingItems, 4 do -- Remove items from bucket
player:setCharVar("ClammedItem_" .. clammingItems[item], 0);
end
else
local clammedItem = player:getLocalVar("ClammedItem");
if (clammedItem > 0) then
if (player:getCharVar("ClammingKitBroken") > 0) then --Broken bucket
player:messageSpecial(ID.text.THE_WEIGHT_IS_TOO_MUCH, clammedItem);
for item = 1, #clammingItems, 4 do -- Remove items from bucket
player:setCharVar("ClammedItem_" .. clammingItems[item], 0);
end
else
player:messageSpecial(ID.text.YOU_FIND_ITEM, clammedItem);
end
SetServerVariable("ClammingPoint_" .. player:getLocalVar("ClammingPointID") .. "_Delay", os.time() + 10);
player:setLocalVar("ClammedItem", 0);
end
end
SetServerVariable("ClammingPoint_" .. player:getLocalVar("ClammingPointID") .. "_InUse", 0);
player:setLocalVar("ClammingPointID", 0);
end
end; | gpl-3.0 |
hughperkins/nn | SpatialDropout.lua | 33 | 1453 | local SpatialDropout, Parent = torch.class('nn.SpatialDropout', 'nn.Module')
function SpatialDropout:__init(p)
Parent.__init(self)
self.p = p or 0.5
self.train = true
self.noise = torch.Tensor()
end
function SpatialDropout:updateOutput(input)
self.output:resizeAs(input):copy(input)
if self.train then
if input:dim() == 4 then
self.noise:resize(input:size(1), input:size(2), 1, 1)
elseif input:dim() == 3 then
self.noise:resize(input:size(1), 1, 1)
else
error('Input must be 4D (nbatch, nfeat, h, w) or 3D (nfeat, h, w)')
end
self.noise:bernoulli(1-self.p)
-- We expand the random dropouts to the entire feature map because the
-- features are likely correlated accross the map and so the dropout
-- should also be correlated.
self.output:cmul(torch.expandAs(self.noise, input))
else
self.output:mul(1-self.p)
end
return self.output
end
function SpatialDropout:updateGradInput(input, gradOutput)
if self.train then
self.gradInput:resizeAs(gradOutput):copy(gradOutput)
self.gradInput:cmul(torch.expandAs(self.noise, input)) -- simply mask the gradients with the noise vector
else
error('backprop only defined while training')
end
return self.gradInput
end
function SpatialDropout:setp(p)
self.p = p
end
function SpatialDropout:__tostring__()
return string.format('%s(%f)', torch.type(self), self.p)
end
| bsd-3-clause |
Mailaender/OpenRA | mods/cnc/maps/gdi09/gdi09-AI.lua | 3 | 6273 | --[[
Copyright 2007-2020 The OpenRA Developers (see AUTHORS)
This file is part of OpenRA, which is free software. It is made
available to you under the terms of the GNU General Public License
as published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later version. For more
information, see COPYING.
]]
AttackPaths = { { waypoint7 }, { waypoint8 } }
NodBase = { handofnod, nodairfield, nodrefinery, NodCYard, nodpower1, nodpower2, nodpower3, nodpower4, nodpower5, gun5, gun6, gun7, gun8, nodsilo1, nodsilo2, nodsilo3, nodsilo4, nodobelisk }
PatrolProductionQueue = { }
InfantryAttackGroup = { }
InfantryGroupSize = 5
InfantryProductionCooldown = DateTime.Minutes(3)
InfantryProductionTypes = { "e1", "e1", "e1", "e3", "e3", "e4" }
HarvesterProductionType = { "harv" }
VehicleAttackGroup = { }
VehicleGroupSize = 5
VehicleProductionCooldown = DateTime.Minutes(3)
VehicleProductionTypes = { "bggy", "bggy", "bggy", "ltnk", "ltnk", "arty" }
StartingCash = 14000
BaseRefinery = { type = "proc", pos = CPos.New(12, 25) }
BaseNuke1 = { type = "nuke", pos = CPos.New(5, 24) }
BaseNuke2 = { type = "nuke", pos = CPos.New(3, 24) }
BaseNuke3 = { type = "nuke", pos = CPos.New(16, 30) }
BaseNuke4 = { type = "nuke", pos = CPos.New(14, 30) }
BaseNuke5 = { type = "nuke", pos = CPos.New(12, 30) }
InfantryProduction = { type = "hand", pos = CPos.New(15, 24) }
VehicleProduction = { type = "afld", pos = CPos.New(3, 27) }
NodGuards = { Actor168, Actor169, Actor170, Actor171, Actor172, Actor181, Actor177, Actor188, Actor189, Actor190 }
BaseBuildings = { BaseRefinery, BaseNuke1, BaseNuke2, BaseNuke3, BaseNuke4, InfantryProduction, VehicleProduction }
BuildBuilding = function(building, cyard)
local buildingCost = Actor.Cost(building.type)
if CyardIsBuilding or Nod.Cash < buildingCost then
Trigger.AfterDelay(DateTime.Seconds(10), function() BuildBuilding(building, cyard) end)
return
end
CyardIsBuilding = true
Nod.Cash = Nod.Cash - buildingCost
Trigger.AfterDelay(Actor.BuildTime(building.type), function()
CyardIsBuilding = false
if cyard.IsDead or cyard.Owner ~= Nod then
Nod.Cash = Nod.Cash + buildingCost
return
end
local actor = Actor.Create(building.type, true, { Owner = Nod, Location = building.pos })
if actor.Type == 'hand' or actor.Type == 'pyle' then
Trigger.AfterDelay(DateTime.Seconds(10), function() ProduceInfantry(actor) end)
elseif actor.Type == 'afld' or actor.Type == 'weap' then
Trigger.AfterDelay(DateTime.Seconds(10), function() ProduceVehicle(actor) end)
end
Trigger.OnKilled(actor, function()
BuildBuilding(building, cyard)
end)
RepairBuilding(Nod, actor, 0.75)
end)
end
HasHarvester = function()
local harv = Nod.GetActorsByType("harv")
return #harv > 0
end
GuardBase = function()
Utils.Do(NodBase, function(building)
Trigger.OnDamaged(building, function()
if not building.IsDead then
Utils.Do(NodGuards, function(guard)
if not guard.IsDead then
guard.Stop()
guard.Guard(building)
end
end)
end
end)
end)
end
ProduceHarvester = function(building)
if not buildingHarvester then
buildingHarvester = true
building.Build(HarvesterProductionType, function()
buildingHarvester = false
end)
end
end
ProduceInfantry = function(building)
if building.IsDead or building.Owner ~= Nod then
return
elseif not HasHarvester() then
Trigger.AfterDelay(DateTime.Seconds(10), function() ProduceInfantry(building) end)
return
end
if #PatrolProductionQueue >= 1 then
local inQueue = PatrolProductionQueue[1]
local toBuild = { inQueue.unit[1] }
local patrolPath = inQueue.waypoints
building.Build(toBuild, function(unit)
ReplenishPatrolUnit(unit[1], handofnod, patrolPath, 40)
table.remove(PatrolProductionQueue, 1)
end)
Trigger.AfterDelay(DateTime.Seconds(10), function() ProduceInfantry(building) end)
return
end
local delay = Utils.RandomInteger(DateTime.Seconds(3), DateTime.Seconds(9))
local toBuild = { Utils.Random(InfantryProductionTypes) }
local Path = Utils.Random(AttackPaths)
building.Build(toBuild, function(unit)
InfantryAttackGroup[#InfantryAttackGroup + 1] = unit[1]
if #InfantryAttackGroup >= InfantryGroupSize then
MoveAndHunt(InfantryAttackGroup, Path)
InfantryAttackGroup = { }
Trigger.AfterDelay(InfantryProductionCooldown, function() ProduceInfantry(building) end)
else
Trigger.AfterDelay(delay, function() ProduceInfantry(building) end)
end
end)
end
ProduceVehicle = function(building)
if building.IsDead or building.Owner ~= Nod then
return
elseif not HasHarvester() then
ProduceHarvester(building)
Trigger.AfterDelay(DateTime.Seconds(10), function() ProduceVehicle(building) end)
return
end
local delay = Utils.RandomInteger(DateTime.Seconds(12), DateTime.Seconds(17))
local toBuild = { Utils.Random(VehicleProductionTypes) }
local Path = Utils.Random(AttackPaths)
building.Build(toBuild, function(unit)
VehicleAttackGroup[#VehicleAttackGroup + 1] = unit[1]
if #VehicleAttackGroup >= VehicleGroupSize then
MoveAndHunt(VehicleAttackGroup, Path)
VehicleAttackGroup = { }
Trigger.AfterDelay(VehicleProductionCooldown, function() ProduceVehicle(building) end)
else
Trigger.AfterDelay(delay, function() ProduceVehicle(building) end)
end
end)
end
StartAI = function()
RepairNamedActors(Nod, 0.75)
Nod.Cash = StartingCash
GuardBase()
end
Trigger.OnAllKilledOrCaptured(NodBase, function()
Utils.Do(Nod.GetGroundAttackers(), IdleHunt)
end)
Trigger.OnKilled(nodrefinery, function(building)
BuildBuilding(BaseRefinery, NodCYard)
end)
Trigger.OnKilled(nodpower1, function(building)
BuildBuilding(BaseNuke1, NodCYard)
end)
Trigger.OnKilled(nodpower2, function(building)
BuildBuilding(BaseNuke2, NodCYard)
end)
Trigger.OnKilled(nodpower3, function(building)
BuildBuilding(BaseNuke3, NodCYard)
end)
Trigger.OnKilled(nodpower4, function(building)
BuildBuilding(BaseNuke4, NodCYard)
end)
Trigger.OnKilled(nodpower5, function(building)
BuildBuilding(BaseNuke5, NodCYard)
end)
Trigger.OnKilled(handofnod, function(building)
BuildBuilding(InfantryProduction, NodCYard)
end)
Trigger.OnKilled(nodairfield, function(building)
BuildBuilding(VehicleProduction, NodCYard)
end)
| gpl-3.0 |
m241dan/darkstar | scripts/zones/Kazham/npcs/Dodmos.lua | 6 | 3150 | -----------------------------------
-- Area: Kazham
-- NPC: Dodmos
-- Starts Quest: Trial Size Trial By Fire
-- @pos 102.647 -14.999 -97.664 250
-----------------------------------
package.loaded["scripts/zones/Kazham/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/settings");
require("scripts/globals/status");
require("scripts/globals/quests");
require("scripts/globals/teleports");
require("scripts/zones/Kazham/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
if (trade:hasItemQty(1544,1) == true and player:getQuestStatus(OUTLANDS,TRIAL_SIZE_TRIAL_BY_FIRE) == QUEST_ACCEPTED and player:getMainJob() == JOBS.SMN) then
player:startEvent(0x011f,0,1544,0,20);
end
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
local TrialSizeFire = player:getQuestStatus(OUTLANDS,TRIAL_SIZE_TRIAL_BY_FIRE);
if (player:getMainLvl() >= 20 and player:getMainJob() == JOBS.SMN and TrialSizeFire == QUEST_AVAILABLE and player:getFameLevel(KAZHAM) >= 2) then --Requires player to be Summoner at least lvl 20
player:startEvent(0x011e,0,1544,0,20); --mini tuning fork, zone, level
elseif (TrialSizeFire == QUEST_ACCEPTED) then
local FireFork = player:hasItem(1544);
if (FireFork == true) then
player:startEvent(0x0110); --Dialogue given to remind player to be prepared
elseif (FireFork == false and tonumber(os.date("%j")) ~= player:getVar("TrialSizeFire_date")) then
player:startEvent(0x0122,0,1544,0,20); --Need another mini tuning fork
end
elseif (TrialSizeFire == QUEST_COMPLETED) then
player:startEvent(0x0121); --Defeated Avatar
else
player:startEvent(0x0113); --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 == 0x011e and option == 1) then
if (player:getFreeSlotsCount() == 0) then
player:messageSpecial(ITEM_CANNOT_BE_OBTAINED,1544); --Mini tuning fork
else
player:setVar("TrialSizeFire_date", 0);
player:addQuest(OUTLANDS,TRIAL_SIZE_TRIAL_BY_FIRE);
player:addItem(1544);
player:messageSpecial(ITEM_OBTAINED,1544);
end
elseif (csid == 0x0122 and option == 1) then
if (player:getFreeSlotsCount() == 0) then
player:messageSpecial(ITEM_CANNOT_BE_OBTAINED,1544); --Mini tuning fork
else
player:addItem(1544);
player:messageSpecial(ITEM_OBTAINED,1544);
end
elseif (csid == 0x011f and option == 1) then
toCloisterOfFlames(player);
end
end;
| gpl-3.0 |
santssoft/darkstar | scripts/globals/items/copper_frog.lua | 11 | 1130 | -----------------------------------------
-- ID: 4515
-- Item: copper_frog
-- Food Effect: 5Min, Mithra only
-----------------------------------------
-- Dexterity 2
-- Agility 2
-- Mind -4
-----------------------------------------
require("scripts/globals/status")
require("scripts/globals/msg")
-----------------------------------------
function onItemCheck(target)
local result = 0
if (target:getRace() ~= dsp.race.MITHRA) then
result = dsp.msg.basic.CANNOT_EAT
end
if (target:getMod(dsp.mod.EAT_RAW_FISH) == 1) then
result = 0
end
if target:hasStatusEffect(dsp.effect.FOOD) or target:hasStatusEffect(dsp.effect.FIELD_SUPPORT_FOOD) then
result = dsp.msg.basic.IS_FULL
end
return result
end
function onItemUse(target)
target:addStatusEffect(dsp.effect.FOOD,0,0,300,4515)
end
function onEffectGain(target,effect)
target:addMod(dsp.mod.DEX, 2)
target:addMod(dsp.mod.AGI, 2)
target:addMod(dsp.mod.MND, -4)
end
function onEffectLose(target, effect)
target:delMod(dsp.mod.DEX, 2)
target:delMod(dsp.mod.AGI, 2)
target:delMod(dsp.mod.MND, -4)
end
| gpl-3.0 |
palmettos/test | protocols/sstp/luasrc/model/network/proto_sstp.lua | 3 | 1456 | --[[
LuCI - Network model - SSTP protocol extension
Copyright 2011 Jo-Philipp Wich <xm@subsignal.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
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
]]--
local netmod = luci.model.network
local _, p
for _, p in ipairs({"sstp"}) do
local proto = netmod:register_protocol(p)
function proto.get_i18n(self)
if p == "sstp" then
return luci.i18n.translate("SSTP")
end
end
function proto.ifname(self)
return p .. "-" .. self.sid
end
function proto.opkg_package(self)
if p == "sstp" then
return "sstp-client"
end
end
function proto.is_installed(self)
if p == "sstp" then
return nixio.fs.access("/lib/netifd/proto/sstp.sh")
end
end
function proto.is_floating(self)
return true
end
function proto.is_virtual(self)
return true
end
function proto.get_interfaces(self)
return nil
end
function proto.contains_interface(self, ifc)
return (netmod:ifnameof(ifc) == self:ifname())
end
netmod:register_pattern_virtual("^%s-%%w" % p)
end
| apache-2.0 |
santssoft/darkstar | scripts/zones/Balgas_Dais/bcnms/saintly_invitation.lua | 9 | 1701 | -----------------------------------
-- Area: Horlais Peak
-- Name: Saintly Invitation
-- !pos 299 -123 345 146
-----------------------------------
require("scripts/globals/battlefield")
require("scripts/globals/keyitems")
require("scripts/globals/missions")
require("scripts/globals/npc_util")
-----------------------------------
function onBattlefieldTick(battlefield, tick)
dsp.battlefield.onBattlefieldTick(battlefield, tick)
end
function onBattlefieldRegister(player, battlefield)
end
function onBattlefieldEnter(player, battlefield)
end
function onBattlefieldLeave(player, battlefield, leavecode)
if leavecode == dsp.battlefield.leaveCode.WON then
local name, clearTime, partySize = battlefield:getRecord()
if player:hasCompletedMission(WINDURST, dsp.mission.id.windurst.SAINTLY_INVITATION) then
player:startEvent(32001, battlefield:getArea(), clearTime, partySize, battlefield:getTimeInside(), 1, battlefield:getLocalVar("[cs]bit"), 1)
else
player:startEvent(32001, battlefield:getArea(), clearTime, partySize, battlefield:getTimeInside(), 1, battlefield:getLocalVar("[cs]bit"), 0)
end
elseif leavecode == dsp.battlefield.leaveCode.LOST then
player:startEvent(32002)
end
end
function onEventUpdate(player, csid, option)
end
function onEventFinish(player, csid, option)
if csid == 32001 then
if player:getCurrentMission(WINDURST) == dsp.mission.id.windurst.SAINTLY_INVITATION then
player:addTitle(dsp.title.VICTOR_OF_THE_BALGA_CONTEST)
npcUtil.giveKeyItem(player, dsp.ki.BALGA_CHAMPION_CERTIFICATE)
player:setCharVar("MissionStatus", 2)
end
end
end
| gpl-3.0 |
m241dan/darkstar | scripts/zones/Windurst_Woods/npcs/Bozack.lua | 13 | 1051 | -----------------------------------
-- Area: Windurst Woods
-- NPC: Bozack
-- Type: Event Replayer
-- @zone: 241
-- @pos 92.591 -5.58 -31.529
--
-- Auto-Script: Requires Verification (Verfied by Brawndo)
-----------------------------------
package.loaded["scripts/zones/Windurst_Woods/TextIDs"] = nil;
-----------------------------------
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
player:startEvent(0x0264);
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 |
m241dan/darkstar | scripts/globals/abilities/pets/thunderspark.lua | 1 | 1521 | ---------------------------------------------------
-- Thunderspark M=whatever
---------------------------------------------------
require("scripts/globals/settings");
require("scripts/globals/status");
require("scripts/globals/summon");
require("scripts/globals/magic");
require("scripts/globals/monstertpmoves");
---------------------------------------------------
function onAbilityCheck(player, target, ability)
return 0,0;
end;
function onPetAbility(target, pet, skill)
local numhits = 1;
local accmod = 1;
local dmgmod = 2;
local dmgmodsubsequent = 1; -- ??
local totaldamage = 0;
local damage = AvatarPhysicalMove(pet,target,skill,numhits,accmod,dmgmod,dmgmodsubsequent,TP_NO_EFFECT,1,2,3);
--get resist multiplier (1x if no resist)
local resist = applyPlayerResistance(pet,-1,target,pet:getStat(MOD_INT)-target:getStat(MOD_INT),ELEMENTAL_MAGIC_SKILL, ELE_THUNDER);
--get the resisted damage
damage.dmg = damage.dmg*resist;
--add on bonuses (staff/day/weather/jas/mab/etc all go in this function)
damage.dmg = mobAddBonuses(pet,spell,target,damage.dmg,1);
local tp = skill:getTP();
if tp < 1000 then
tp = 1000;
end
damage.dmg = damage.dmg * tp / 1000;
totaldamage = AvatarFinalAdjustments(damage.dmg,pet,skill,target,MOBSKILL_PHYSICAL,MOBPARAM_BLUNT,numhits);
target:addStatusEffect(EFFECT_PARALYSIS, 15, 0, 60);
target:delHP(totaldamage);
target:updateEnmityFromDamage(pet,totaldamage);
return totaldamage;
end
| gpl-3.0 |
santssoft/darkstar | scripts/globals/spells/bluemagic/self-destruct.lua | 7 | 1166 | -----------------------------------------
-- 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")
function onMagicCastingCheck(caster,target,spell)
caster:setLocalVar("self-destruct_hp", caster:getHP())
return 0
end
function onSpellCast(caster,target,spell)
local duration = 300
local playerHP = caster:getLocalVar("self-destruct_hp")
local damage = playerHP - 1
if damage > 0 then
target:takeDamage(playerHP, caster, dsp.attackType.MAGICAL, dsp.damageType.FIRE)
caster:setHP(1)
caster:delStatusEffect(dsp.effect.WEAKNESS)
caster:addStatusEffect(dsp.effect.WEAKNESS,1,0,duration)
end
return damage
end
| gpl-3.0 |
m241dan/darkstar | scripts/globals/bcnm.lua | 1 | 42653 | require("scripts/globals/status");
require("scripts/globals/keyitems");
require("scripts/globals/missions");
require("scripts/globals/quests");
-- NEW SYSTEM BCNM NOTES
-- The "core" functions TradeBCNM EventUpdateBCNM EventTriggerBCNM EventFinishBCNM all return TRUE if the action performed is covered by the function.
-- This means all the old code will still be executed if the new functions don't support it. This means that there is effectively 'backwards compatibility' with the old system.
-- array to map (for each zone) the item id of the valid trade item with the bcnmid in the database
-- e.g. zone, {itemid, bcnmid, itemid, bcnmid, itemid, bcnmid}
-- DO NOT INCLUDE MAAT FIGHTS
itemid_bcnmid_map = {6, {0, 0}, -- Bearclaw_Pinnacle
8, {0, 0}, -- Boneyard_Gully
10, {0, 0}, -- The_Shrouded_Maw
13, {0, 0}, -- Mine_Shaft_2716
17, {0, 0}, -- Spire of Holla
19, {0, 0}, -- Spire of Dem
21, {0, 0}, -- Spire of Mea
23, {0, 0}, -- Spire of Vahzl
29, {0, 0}, -- Riverne Site #B01
31, {0, 0}, -- Monarch Linn
32, {0, 0}, -- Sealion's Den
35, {0, 0}, -- The Garden of RuHmet
36, {0, 0}, -- Empyreal Paradox
139, {1177, 4, 1552, 10, 1553, 11, 1131, 12, 1175, 15, 1180, 17}, -- Horlais Peak
140, {1551, 34, 1552, 35, 1552, 36}, -- Ghelsba Outpost
144, {1166, 68, 1178, 81, 1553, 76, 1180, 82, 1130, 79, 1552, 73}, -- Waughroon Shrine
146, {1553, 107, 1551, 105, 1177, 100}, -- Balgas Dias
163, {1130, 129}, -- Sacrificial Chamber
168, {0, 0}, -- Chamber of Oracles
170, {0, 0}, -- Full Moon Fountain
180, {1550, 293}, -- LaLoff Amphitheater
181, {0, 0}, -- The Celestial Nexus
201, {1546, 418, 1174, 417}, -- Cloister of Gales
202, {1548, 450, 1172, 449}, -- Cloister of Storms
203, {1545, 482, 1171, 481}, -- Cloister of Frost
206, {0, 0}, -- Qu'Bia Arena
207, {1544, 545}, -- Cloister of Flames
209, {1547, 578, 1169, 577}, -- Cloister of Tremors
211, {1549, 609}}; -- Cloister of Tides
-- array to map (for each zone) the BCNM ID to the Event Parameter corresponding to this ID.
-- DO NOT INCLUDE MAAT FIGHTS (only included one for testing!)
-- bcnmid, paramid, bcnmid, paramid, etc
-- The BCNMID is found via the database.
-- The paramid is a bitmask which you need to find out. Being a bitmask, it will be one of:
-- 0, 1, 2, 3, 4, 5, ...
bcnmid_param_map = {6, {640, 0},
8, {672, 0, 673, 1},
10, {704, 0, 706, 2},
13, {736, 0},
17, {768, 0},
19, {800, 0},
21, {832, 0},
23, {864, 0},
29, {896, 0},
31, {960, 0, 961, 1},
32, {992, 0, 993, 1},
35, {1024, 0},
36, {1056, 0},
139, {0, 0, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 10, 10, 11, 11, 12, 12, 15, 15, 17, 17},
140, {32, 0, 33, 1, 34, 2, 35, 3, 36, 4},
144, {65, 1, 73, 9, 64, 0, 67, 3, 68, 4, 70, 6, 71, 7, 72, 8, 81, 17, 76, 12, 82, 18, 79, 15},
146, {99, 3, 96, 0, 101, 5, 102, 6, 103, 7, 107, 11, 105, 9},
163, {128, 0, 129, 1},
165, {160, 0, 161, 1},
168, {192, 0, 194, 2, 195, 3, 196, 4},
170, {224, 0, 225, 1},
179, {256, 0},
180, {293, 5, 288, 0, 289, 1, 290, 2, 291, 3, 292, 4},
181, {320, 0},
201, {416, 0, 417, 1, 418, 2, 420, 4},
202, {448, 0, 449, 1, 450, 2, 452, 4},
203, {480, 0, 481, 1, 482, 2, 484, 4},
206, {512, 0, 516, 4, 517, 5, 518, 6, 519, 7, 532, 20},
207, {544, 0, 545, 1, 547, 3},
209, {576, 0, 577, 1, 578, 2, 580, 4},
211, {608, 0, 609, 1, 611, 3}};
-- Call this onTrade for burning circles
function TradeBCNM(player, zone, trade, npc)
-- return false;
if (player:hasStatusEffect(EFFECT_BATTLEFIELD)) then -- cant start a new bc
player:messageBasic(94, 0, 0);
return false;
elseif (player:hasWornItem(trade:getItem())) then -- If already used orb or testimony
player:messageBasic(56, 0, 0); -- i need correct dialog
return false;
end
if (CheckMaatFights(player, zone, trade, npc)) then -- This function returns true for maat fights
return true;
end
-- the following is for orb battles, etc
local id = ItemToBCNMID(player, zone, trade);
if (id == -1) then -- no valid BCNMs with this item
-- todo: display message based on zone text offset
player:setVar("trade_bcnmid", 0);
player:setVar("trade_itemid", 0);
return false;
else -- a valid BCNM with this item, start it.
mask = GetBattleBitmask(id, zone, 1);
if (mask == -1) then -- Cannot resolve this BCNMID to an event number, edit bcnmid_param_map!
print("Item is for a valid BCNM but cannot find the event parameter to display to client.");
player:setVar("trade_bcnmid", 0);
player:setVar("trade_itemid", 0);
return false;
end
if (player:isBcnmsFull() == 1) then -- temp measure, this will precheck the instances
print("all bcnm instances are currently occupied.");
npc:messageBasic(246, 0, 0); -- this wont look right in other languages!
return true;
end
player:startEvent(0x7d00, 0, 0, 0, mask, 0, 0, 0, 0);
return true;
end
end;
function EventTriggerBCNM(player, npc)
player:setVar("trade_bcnmid", 0);
player:setVar("trade_itemid", 0);
if (player:hasStatusEffect(EFFECT_BATTLEFIELD)) then
if (player:isInBcnm() == 1) then
player:startEvent(0x7d03); -- Run Away or Stay menu
else -- You're not in the BCNM but you have the Battlefield effect. Think: non-trader in a party
status = player:getStatusEffect(EFFECT_BATTLEFIELD);
playerbcnmid = status:getPower();
playermask = GetBattleBitmask(playerbcnmid, player:getZoneID(), 1);
if (playermask~=-1) then
-- This gives players who did not trade to go in the option of entering the fight
player:startEvent(0x7d00, 0, 0, 0, playermask, 0, 0, 0, 0);
else
player:messageBasic(94, 0, 0);
end
end
return true;
else
if (checkNonTradeBCNM(player, npc)) then
return true;
end
end
return false;
end;
function EventUpdateBCNM(player, csid, option, entrance)
-- return false;
local id = player:getVar("trade_bcnmid"); -- this is 0 if the bcnm isnt handled by new functions
local skip = CutsceneSkip(player, npc);
print("UPDATE csid "..csid.." option "..option);
-- seen: option 2, 3, 0 in that order
if (csid == 0x7d03 and option == 2) then -- leaving a BCNM the player is currently in.
player:bcnmLeave(1);
return true;
end
if (option == 255 and csid == 0x7d00) then -- Clicked yes, try to register bcnmid
if (player:hasStatusEffect(EFFECT_BATTLEFIELD)) then
-- You're entering a bcnm but you already had the battlefield effect, so you want to go to the
-- instance that your battlefield effect represents.
player:setVar("bcnm_instanceid_tick", 0);
player:setVar("bcnm_instanceid", player:getBattlefieldID()); -- returns 255 if non-existent.
return true;
end
inst = player:bcnmRegister(id);
if (inst > 0) then
player:setVar("bcnm_instanceid", inst);
player:setVar("bcnm_instanceid_tick", 0);
player:updateEvent(0, 3, 0, 0, 1, 0);
if (entrance ~= nil and player:getBattlefield() ~= nil) then
player:getBattlefield():setEntrance(entrance);
end
-- player:tradeComplete();
else
-- no free battlefields at the moment!
print("no free instances");
player:setVar("bcnm_instanceid", 255);
player:setVar("bcnm_instanceid_tick", 0);
end
elseif (option == 0 and csid == 0x7d00) then -- Requesting an Instance
-- Increment the instance ticker.
-- The client will send a total of THREE EventUpdate packets for each one of the free instances.
-- If the first instance is free, it should respond to the first packet
-- If the second instance is free, it should respond to the second packet, etc
local instance = player:getVar("bcnm_instanceid_tick");
instance = instance + 1;
player:setVar("bcnm_instanceid_tick", instance);
if (instance == player:getVar("bcnm_instanceid")) then
-- respond to this packet
local mask = GetBattleBitmask(id, player:getZoneID(), 2);
local status = player:getStatusEffect(EFFECT_BATTLEFIELD);
local playerbcnmid = status:getPower();
if (mask < playerbcnmid) then
mask = GetBattleBitmask(playerbcnmid, player:getZoneID(), 2);
player:updateEvent(2, mask, 0, 1, 1, skip); -- Add mask number for the correct entering CS
player:bcnmEnter(id);
player:setVar("bcnm_instanceid_tick", 0);
-- print("mask is "..mask)
-- print("playerbcnmid is "..playerbcnmid);
elseif (mask >= playerbcnmid) then
mask = GetBattleBitmask(id, player:getZoneID(), 2);
player:updateEvent(2, mask, 0, 1, 1, skip); -- Add mask number for the correct entering CS
player:bcnmEnter(id);
player:setVar("bcnm_instanceid_tick", 0);
-- print("mask2 is "..mask)
-- print("playerbcnmid2 is "..playerbcnmid);
end
if (entrance ~= nil and player:getBattlefield() ~= nil) then
player:getBattlefield():setEntrance(entrance);
end
elseif (player:getVar("bcnm_instanceid") == 255) then -- none free
-- print("nfa");
-- player:updateEvent(2, 5, 0, 0, 1, 0); -- @cs 32000 0 0 0 0 0 0 0 2
-- param1
-- 2=generic enter cs
-- 3=spam increment instance requests
-- 4=cleared to enter but cant while ppl engaged
-- 5=dont meet req, access denied.
-- 6=room max cap
-- param2 alters the eventfinish option (offset)
-- param7/8 = does nothing??
end
-- @pos -517 159 -209
-- @pos -316 112 -103
-- player:updateEvent(msgid, bcnmFight, 0, record, numadventurers, skip); skip=1 to skip anim
-- msgid 1=wait a little longer, 2=enters
end
return true;
end;
function EventFinishBCNM(player, csid, option)
printf("FINISH csid "..csid.." option "..option);
if (player:hasStatusEffect(EFFECT_BATTLEFIELD) == false) then -- Temp condition for normal bcnm (started with onTrigger)
return false;
else
local id = player:getVar("trade_bcnmid");
local item = player:getVar("trade_itemid");
if (id == 68 or id == 418 or id == 450 or id == 482 or id == 545 or id == 578 or id == 609 or id == 293) then
player:tradeComplete(); -- Removes the item
elseif ((item >= 1426 and item <= 1440) or item == 1130 or item == 1131 or item == 1175 or item == 1177 or item == 1180 or item == 1178 or item == 1551 or item == 1552 or item == 1553) then -- Orb and Testimony (one time item)
player:createWornItem(item);
end
return true;
end
end;
-- Returns TRUE if you're trying to do a maat fight, regardless of outcome e.g. if you trade testimony on wrong job, this will return true in order to prevent further execution of TradeBCNM. Returns FALSE if you're not doing a maat fight (in other words, not trading a testimony!!)
function CheckMaatFights(player, zone, trade, npc)
player:setVar("trade_bcnmid", 0);
player:setVar("trade_itemid", 0);
-- check for maat fights (one maat fight per zone in the db, but >1 mask entries depending on job, so we
-- need to choose the right one depending on the players job, and make sure the right testimony is traded,
-- and make sure the level is right!
local itemid = trade:getItem();
local job = player:getMainJob();
local lvl = player:getMainLvl();
if (itemid >= 1426 and itemid <= 1440) then -- The traded item IS A TESTIMONY
if (lvl < 66) then
return true;
end
if (player:isBcnmsFull() == 1) then -- temp measure, this will precheck the instances
print("all bcnm instances are currently occupied.");
npc:messageBasic(246, 0, 0);
return true;
end
-- Zone, {item, job, menu, bcnmid, ...}
maatList = {139, {1426, 1, 32, 5, 1429, 4, 64, 6, 1436, 11, 128, 7}, -- Horlais Peak [WAR BLM RNG]
144, {1430, 5, 64, 70, 1431, 6, 128, 71, 1434, 9, 256, 72}, -- Waughroon Shrine [RDM THF BST]
146, {1427, 2, 32, 101, 1428, 3, 64, 102, 1440, 15, 128, 103}, -- Balga's Dais [MNK WHM SMN]
168, {1437, 12, 4, 194, 1438, 13, 8, 195, 1439, 14, 16, 196}, -- Chamber of Oracles [SAM NIN DRG]
206, {1432, 7, 32, 517, 1433, 8, 64, 518, 1435, 10, 128, 519} };-- Qu'Bia Arena [PLD DRK BRD]
for nb = 1, table.getn(maatList), 2 do
if (maatList[nb] == zone) then
for nbi = 1, table.getn(maatList[nb + 1]), 4 do
if (itemid == maatList[nb + 1][nbi] and job == maatList[nb + 1][nbi + 1]) then
player:startEvent(0x7d00, 0, 0, 0, maatList[nb + 1][nbi + 2], 0, 0, 0, 0);
player:setVar("trade_bcnmid", maatList[nb + 1][nbi + 3]);
player:setVar("trade_itemid", maatList[nb + 1][nbi]);
break;
end
end
end
end
return true;
end
-- if it got this far then its not a testimony
return false;
end;
function GetBattleBitmask(id, zone, mode)
-- normal sweep for NON MAAT FIGHTS
local ret = -1;
local mask = 0;
for zoneindex = 1, table.getn(bcnmid_param_map), 2 do
if (zone==bcnmid_param_map[zoneindex]) then -- matched zone
for bcnmindex = 1, table.getn(bcnmid_param_map[zoneindex + 1]), 2 do -- loop bcnms in this zone
if (id==bcnmid_param_map[zoneindex+1][bcnmindex]) then -- found bcnmid
if (mode == 1) then
ret = mask + (2^bcnmid_param_map[zoneindex+1][bcnmindex+1]); -- for trigger (mode 1): 1, 2, 4, 8, 16, 32, ...
else
ret = mask + bcnmid_param_map[zoneindex+1][bcnmindex+1]; -- for update (mode 2): 0, 1, 2, 3, 4, 5, 6, ...
end
end
end
end
end
return ret;
end;
function ItemToBCNMID(player, zone, trade)
for zoneindex = 1, table.getn(itemid_bcnmid_map), 2 do
if (zone==itemid_bcnmid_map[zoneindex]) then -- matched zone
for bcnmindex = 1, table.getn(itemid_bcnmid_map[zoneindex + 1]), 2 do -- loop bcnms in this zone
if (trade:getItem()==itemid_bcnmid_map[zoneindex+1][bcnmindex]) then
local item = trade:getItem();
local questTimelineOK = 0;
-- Job/lvl condition for smn battle lvl20
if (item >= 1544 and item <= 1549 and player:getMainJob() == 15 and player:getMainLvl() >= 20) then
questTimelineOK = 1;
elseif (item == 1166 and player:getVar("aThiefinNorgCS") == 6) then -- AF3 SAM condition
questTimelineOK = 1;
elseif (item == 1551) then -- BCNM20
questTimelineOK = 1;
elseif (item == 1552) then -- BCNM30
questTimelineOK = 1;
elseif (item == 1131) then -- BCNM40
questTimelineOK = 1;
elseif (item == 1177) then -- BCNM50
questTimelineOK = 1;
elseif (item == 1130) then -- BCNM60
questTimelineOK = 1;
elseif (item == 1175) then -- KSNM30
questTimelineOK = 1;
elseif (item == 1178) then -- KSNM30
questTimelineOK = 1;
elseif (item == 1180) then -- KSNM30
questTimelineOK = 1;
elseif (item == 1553) then -- KSNM99
questTimelineOK = 1;
elseif (item == 1550 and (player:getQuestStatus(OUTLANDS, DIVINE_MIGHT) == QUEST_ACCEPTED or player:getQuestStatus(OUTLANDS, DIVINE_MIGHT_REPEAT) == QUEST_ACCEPTED)) then -- Divine Might
questTimelineOK = 1;
elseif (item == 1169 and player:getVar("ThePuppetMasterProgress") == 2) then -- The Puppet Master
questTimelineOK = 1;
elseif (item == 1171 and player:getVar("ClassReunionProgress") == 5) then -- Class Reunion
questTimelineOK = 1;
elseif (item == 1172 and player:getVar("CarbuncleDebacleProgress") == 3) then -- Carbuncle Debacle (Gremlims)
questTimelineOK = 1;
elseif (item == 1174 and player:getVar("CarbuncleDebacleProgress") == 6) then -- Carbuncle Debacle (Ogmios)
questTimelineOK = 1;
end
if (questTimelineOK == 1) then
player:setVar("trade_bcnmid", itemid_bcnmid_map[zoneindex+1][bcnmindex+1]);
player:setVar("trade_itemid", itemid_bcnmid_map[zoneindex+1][bcnmindex]);
return itemid_bcnmid_map[zoneindex+1][bcnmindex+1];
end
end
end
end
end
return -1;
end;
-- E.g. mission checks go here, you must know the right bcnmid for the mission you want to code.
-- You also need to know the bitmask (event param) which should be put in bcnmid_param_map
function checkNonTradeBCNM(player, npc)
local mask = 0;
local Zone = player:getZoneID();
if (Zone == 6) then -- Bearclaw_Pinnacle
if (player:getCurrentMission(COP) == THREE_PATHS and player:getVar("COP_Ulmia_s_Path") == 6) then -- flames_for_the_dead
mask = GetBattleBitmask(640, Zone, 1);
player:setVar("trade_bcnmid", 640);
end
elseif (Zone == 8) then -- Boneyard_Gully
if (player:getCurrentMission(COP) == THREE_PATHS and player:getVar("COP_Ulmia_s_Path") == 5) then -- head_wind
mask = GetBattleBitmask(672, Zone, 1);
player:setVar("trade_bcnmid", 672);
elseif (player:hasKeyItem(MIASMA_FILTER)==true) then
mask = GetBattleBitmask(673, Zone, 1);
player:setVar("trade_bcnmid", 673);
else
end
elseif (Zone == 10) then -- The_Shrouded_Maw
if (player:getCurrentMission(COP) == DARKNESS_NAMED and player:getVar("PromathiaStatus") == 2) then-- DARKNESS_NAMED
mask = GetBattleBitmask(704, Zone, 1);
player:setVar("trade_bcnmid", 704);
elseif (player:hasKeyItem(VIAL_OF_DREAM_INCENSE)==true) then -- waking_dreams (diabolos avatar quest)
mask = GetBattleBitmask(706, Zone, 1);
player:setVar("trade_bcnmid", 706);
end
elseif (Zone == 13) then -- Mine_Shaft_2716
if (player:getCurrentMission(COP) == THREE_PATHS and player:getVar("COP_Louverance_s_Path") == 5) then -- century_of_hardship
mask = GetBattleBitmask(736, Zone, 1);
player:setVar("trade_bcnmid", 736);
end
elseif (Zone == 17) then -- Spire of Holla
if (player:getCurrentMission(COP) == BELOW_THE_ARKS and player:getVar("PromathiaStatus") ==1 ) then
mask = GetBattleBitmask(768, Zone, 1);
player:setVar("trade_bcnmid", 768);
elseif (player:getCurrentMission(COP) == THE_MOTHERCRYSTALS and player:hasKeyItem(LIGHT_OF_HOLLA) == false) then -- light of holla
mask = GetBattleBitmask(768, Zone, 1);
player:setVar("trade_bcnmid", 768);
end
elseif (Zone == 19) then -- Spire of Dem
if (player:getCurrentMission(COP) == BELOW_THE_ARKS and player:getVar("PromathiaStatus") ==1 ) then
mask = GetBattleBitmask(800, Zone, 1);
player:setVar("trade_bcnmid", 800);
elseif (player:getCurrentMission(COP) == THE_MOTHERCRYSTALS and player:hasKeyItem(LIGHT_OF_DEM) == false) then -- light of dem
mask = GetBattleBitmask(800, Zone, 1);
player:setVar("trade_bcnmid", 800);
end
elseif (Zone == 21) then -- Spire of Mea
if (player:getCurrentMission(COP) == BELOW_THE_ARKS and player:getVar("PromathiaStatus") ==1 ) then
mask = GetBattleBitmask(832, Zone, 1);
player:setVar("trade_bcnmid", 832);
elseif (player:getCurrentMission(COP) == THE_MOTHERCRYSTALS and player:hasKeyItem(LIGHT_OF_MEA) == false) then -- light of mea
mask = GetBattleBitmask(832, Zone, 1);
player:setVar("trade_bcnmid", 832);
end
elseif (Zone == 23) then -- Spire of vahzl
if (player:getCurrentMission(COP) == DESIRES_OF_EMPTINESS and player:getVar("PromathiaStatus")==8) then -- desires of emptiness
mask = GetBattleBitmask(864, Zone, 1);
player:setVar("trade_bcnmid", 864);
end
elseif (Zone == 29) then -- Riverne Site #B01
if (player:getQuestStatus(JEUNO,STORMS_OF_FATE) == QUEST_ACCEPTED and player:getVar('StormsOfFate') == 2) then -- Storms of Fate BCNM
mask = GetBattleBitmask(896, Zone, 1);
player:setVar("trade_bcnmid", 896);
end
elseif (Zone == 31) then -- Monarch Linn
if (player:getCurrentMission(COP) == ANCIENT_VOWS and player:getVar("PromathiaStatus") == 2) then -- Ancient Vows bcnm
mask = GetBattleBitmask(960, Zone, 1);
player:setVar("trade_bcnmid", 960);
elseif (player:getCurrentMission(COP) == THE_SAVAGE and player:getVar("PromathiaStatus") == 1) then
mask = GetBattleBitmask(961, Zone, 1);
player:setVar("trade_bcnmid", 961);
end
elseif (Zone == 32) then -- Sealion's Den
if (player:getCurrentMission(COP) == ONE_TO_BE_FEARED and player:getVar("PromathiaStatus")==2) then -- one_to_be_feared
mask = GetBattleBitmask(992, Zone, 1);
player:setVar("trade_bcnmid", 992);
elseif (player:getCurrentMission(COP) == THE_WARRIOR_S_PATH) then -- warriors_path
mask = GetBattleBitmask(993, Zone, 1);
player:setVar("trade_bcnmid", 993);
end
elseif (Zone == 35) then -- The Garden of RuHmet
if (player:getCurrentMission(COP) == WHEN_ANGELS_FALL and player:getVar("PromathiaStatus")==4) then -- when_angels_fall
mask = GetBattleBitmask(1024, Zone, 1);
player:setVar("trade_bcnmid", 1024);
end
elseif (Zone == 36) then -- Empyreal Paradox
if (player:getCurrentMission(COP) == DAWN and player:getVar("PromathiaStatus")==2) then -- dawn
mask = GetBattleBitmask(1056, Zone, 1);
player:setVar("trade_bcnmid", 1056);
end
elseif (Zone == 139) then -- Horlais Peak
if ((player:getCurrentMission(BASTOK) == THE_EMISSARY_SANDORIA2 or
player:getCurrentMission(WINDURST) == THE_THREE_KINGDOMS_SANDORIA2) and player:getVar("MissionStatus") == 9) then -- Mission 2-3
mask = GetBattleBitmask(0, Zone, 1);
player:setVar("trade_bcnmid", 0);
elseif (player:getCurrentMission(SANDORIA) == THE_SECRET_WEAPON and player:getVar("SecretWeaponStatus") == 2) then
mask = GetBattleBitmask(3, Zone, 1)
player:setVar("trade_bcnmid", 3);
end
elseif (Zone == 140) then -- Ghelsba Outpost
local MissionStatus = player:getVar("MissionStatus");
local sTcCompleted = player:hasCompletedMission(SANDORIA, SAVE_THE_CHILDREN)
if (player:getCurrentMission(SANDORIA) == SAVE_THE_CHILDREN and (sTcCompleted and MissionStatus <= 2 or sTcCompleted == false and MissionStatus == 2)) then -- Sandy Mission 1-3
mask = GetBattleBitmask(32, Zone, 1);
player:setVar("trade_bcnmid", 32);
elseif (player:hasKeyItem(DRAGON_CURSE_REMEDY)) then -- DRG Flag Quest
mask = GetBattleBitmask(33, Zone, 1);
player:setVar("trade_bcnmid", 33);
end
elseif (Zone == 144) then -- Waughroon Shrine
if ((player:getCurrentMission(SANDORIA) == JOURNEY_TO_BASTOK2 or
player:getCurrentMission(WINDURST) == THE_THREE_KINGDOMS_BASTOK2) and player:getVar("MissionStatus") == 10) then -- Mission 2-3
mask = GetBattleBitmask(64, Zone, 1);
player:setVar("trade_bcnmid", 64);
elseif ((player:getCurrentMission(BASTOK) == ON_MY_WAY) and (player:getVar("MissionStatus") == 2)) then
mask = GetBattleBitmask(67, Zone, 1);
player:setVar("trade_bcnmid", 67);
end
elseif (Zone == 146) then -- Balga's Dais
if (player:hasKeyItem(DARK_KEY)) then -- Mission 2-3
mask = GetBattleBitmask(96, Zone, 1);
player:setVar("trade_bcnmid", 96);
elseif ((player:getCurrentMission(WINDURST) == SAINTLY_INVITATION) and (player:getVar("MissionStatus") == 1)) then -- Mission 6-2
mask = GetBattleBitmask(99, Zone, 1);
player:setVar("trade_bcnmid", 99);
end
elseif (Zone == 163) then -- Sacrificial Chamber
if (player:getCurrentMission(ZILART) == THE_TEMPLE_OF_UGGALEPIH) then -- Zilart Mission 4
mask = GetBattleBitmask(128, Zone, 1);
player:setVar("trade_bcnmid", 128);
end
elseif (Zone == 165) then -- Throne Room
if (player:getCurrentMission(player:getNation()) == 15 and player:getVar("MissionStatus") == 3) then -- Mission 5-2
mask = GetBattleBitmask(160, Zone, 1);
player:setVar("trade_bcnmid", 160);
elseif (player:getCurrentMission(BASTOK) == WHERE_TWO_PATHS_CONVERGE and player:getVar("BASTOK92") == 1) then -- bastok 9-2
mask = GetBattleBitmask(161, Zone, 1);
player:setVar("trade_bcnmid", 161);
end
elseif (Zone == 168) then -- Chamber of Oracles
if (player:getCurrentMission(ZILART) == THROUGH_THE_QUICKSAND_CAVES or player:getCurrentMission(ZILART) == THE_CHAMBER_OF_ORACLES) then -- Zilart Mission 6
mask = GetBattleBitmask(192, Zone, 1);
player:setVar("trade_bcnmid", 192);
end
elseif (Zone == 170) then -- Full Moon Fountain
if (player:hasKeyItem(MOON_BAUBLE)) then -- The Moonlit Path
mask = GetBattleBitmask(224, Zone, 1);
player:setVar("trade_bcnmid", 224);
elseif ((player:getCurrentMission(WINDURST) == MOON_READING) and player:getVar("WINDURST92") == 2) then -- Moon reading
mask = GetBattleBitmask(225, Zone, 1);
player:setVar("trade_bcnmid", 225);
end
elseif (Zone == 179) then -- Stellar Fulcrum
if (player:getCurrentMission(ZILART) == RETURN_TO_DELKFUTTS_TOWER and player:getVar("ZilartStatus") == 3) then -- Zilart Mission 8
mask = GetBattleBitmask(256, Zone, 1);
player:setVar("trade_bcnmid", 256);
end
elseif (Zone == 180) then -- La'Loff Amphitheater
if (player:getCurrentMission(ZILART) == ARK_ANGELS and player:getVar("ZilartStatus") == 1) then
local qmid = npc:getID();
if (qmid == 17514791 and player:hasKeyItem(SHARD_OF_APATHY) == false) then -- Hume, Ark Angels 1
mask = GetBattleBitmask(288, Zone, 1);
player:setVar("trade_bcnmid", 288);
elseif (qmid == 17514792 and player:hasKeyItem(SHARD_OF_COWARDICE) == false) then -- Tarutaru, Ark Angels 2
mask = GetBattleBitmask(289, Zone, 1);
player:setVar("trade_bcnmid", 289);
elseif (qmid == 17514793 and player:hasKeyItem(SHARD_OF_ENVY) == false) then -- Mithra, Ark Angels 3
mask = GetBattleBitmask(290, Zone, 1);
player:setVar("trade_bcnmid", 290);
elseif (qmid == 17514794 and player:hasKeyItem(SHARD_OF_ARROGANCE) == false) then -- Elvaan, Ark Angels 4
mask = GetBattleBitmask(291, Zone, 1);
player:setVar("trade_bcnmid", 291);
elseif (qmid == 17514795 and player:hasKeyItem(SHARD_OF_RAGE) == false) then -- Galka, Ark Angels 5
mask = GetBattleBitmask(292, Zone, 1);
player:setVar("trade_bcnmid", 292);
end
end
elseif (Zone == 181) then -- The Celestial Nexus
if (player:getCurrentMission(ZILART) == THE_CELESTIAL_NEXUS) then -- Zilart Mission 16
mask = GetBattleBitmask(320, Zone, 1);
player:setVar("trade_bcnmid", 320);
end
elseif (Zone == 201) then -- Cloister of Gales
if (player:hasKeyItem(TUNING_FORK_OF_WIND)) then -- Trial by Wind
mask = GetBattleBitmask(416, Zone, 1);
player:setVar("trade_bcnmid", 416);
elseif (player:getCurrentMission(ASA) == SUGAR_COATED_DIRECTIVE and player:hasKeyItem(DOMINAS_EMERALD_SEAL)) then
mask = GetBattleBitmask(420, Zone, 1);
player:setVar("trade_bcnmid", 420);
end
elseif (Zone == 202) then -- Cloister of Storms
if (player:hasKeyItem(TUNING_FORK_OF_LIGHTNING)) then -- Trial by Lightning
mask = GetBattleBitmask(448, Zone, 1);
player:setVar("trade_bcnmid", 448);
elseif (player:getCurrentMission(ASA) == SUGAR_COATED_DIRECTIVE and player:hasKeyItem(DOMINAS_VIOLET_SEAL)) then
mask = GetBattleBitmask(452, Zone, 1);
player:setVar("trade_bcnmid", 452);
end
elseif (Zone == 203) then -- Cloister of Frost
if (player:hasKeyItem(TUNING_FORK_OF_ICE)) then -- Trial by Ice
mask = GetBattleBitmask(480, Zone, 1);
player:setVar("trade_bcnmid", 480);
elseif (player:getCurrentMission(ASA) == SUGAR_COATED_DIRECTIVE and player:hasKeyItem(DOMINAS_AZURE_SEAL)) then
mask = GetBattleBitmask(484, Zone, 1);
player:setVar("trade_bcnmid", 484);
end
elseif (Zone == 206) then -- Qu'Bia Arena
if (player:getCurrentMission(player:getNation()) == 14 and player:getVar("MissionStatus") == 11) then -- Mission 5-1
mask = GetBattleBitmask(512, Zone, 1);
player:setVar("trade_bcnmid", 512);
elseif (player:getCurrentMission(SANDORIA) == THE_HEIR_TO_THE_LIGHT and player:getVar("MissionStatus") == 3) then -- sando 9-2
mask = GetBattleBitmask(516, Zone, 1);
player:setVar("trade_bcnmid", 516);
-- Temp disabled pending BCNM mob fixes
-- elseif (player:getCurrentMission(ACP) >= THOSE_WHO_LURK_IN_SHADOWS_III and player:hasKeyItem(MARK_OF_SEED)) then -- ACP Mission 7
-- mask = GetBattleBitmask(532, Zone, 1);
-- player:setVar("trade_bcnmid", 532);
end
elseif (Zone == 207) then -- Cloister of Flames
if (player:hasKeyItem(TUNING_FORK_OF_FIRE)) then -- Trial by Fire
mask = GetBattleBitmask(544, Zone, 1);
player:setVar("trade_bcnmid", 544);
elseif (player:getCurrentMission(ASA) == SUGAR_COATED_DIRECTIVE and player:hasKeyItem(DOMINAS_SCARLET_SEAL)) then
mask = GetBattleBitmask(547, Zone, 1);
player:setVar("trade_bcnmid", 547);
end
elseif (Zone == 209) then -- Cloister of Tremors
if (player:hasKeyItem(TUNING_FORK_OF_EARTH)) then -- Trial by Earth
mask = GetBattleBitmask(576, Zone, 1);
player:setVar("trade_bcnmid", 576);
elseif (player:getCurrentMission(ASA) == SUGAR_COATED_DIRECTIVE and player:hasKeyItem(DOMINAS_AMBER_SEAL)) then
mask = GetBattleBitmask(580, Zone, 1);
player:setVar("trade_bcnmid", 580);
end
elseif (Zone == 211) then -- Cloister of Tides
if (player:hasKeyItem(TUNING_FORK_OF_WATER)) then -- Trial by Water
mask = GetBattleBitmask(608, Zone, 1);
player:setVar("trade_bcnmid", 608);
elseif (player:getCurrentMission(ASA) == SUGAR_COATED_DIRECTIVE and player:hasKeyItem(DOMINAS_CERULEAN_SEAL)) then
mask = GetBattleBitmask(611, Zone, 1);
player:setVar("trade_bcnmid", 611);
end
end
if (mask == -1) then
print("BCNMID/Mask pair not found"); -- something went wrong
return true;
elseif (mask ~= 0) then
player:startEvent(0x7d00, 0, 0, 0, mask, 0, 0, 0, 0);
print("BCNMID found with mask "..mask);
return true;
else
return false;
end
end;
function CutsceneSkip(player, npc)
local skip = 0;
local Zone = player:getZoneID();
if (Zone == 6) then -- Bearclaw Pinnacle
if ((player:hasCompletedMission(COP, THREE_PATHS)) or (player:getCurrentMission(COP) == THREE_PATHS and player:getVar("COP_Ulmia_s_Path") > 6)) then -- flames_for_the_dead
skip = 1;
end
elseif (Zone == 8) then -- Boneyard Gully
if ((player:hasCompletedMission(COP, THREE_PATHS)) or (player:getCurrentMission(COP) == THREE_PATHS and player:getVar("COP_Ulmia_s_Path") > 5)) then -- head_wind
skip = 1;
end
elseif (Zone == 10) then -- The_Shrouded_Maw
if ((player:hasCompletedMission(COP, DARKNESS_NAMED)) or (player:getCurrentMission(COP) == DARKNESS_NAMED and player:getVar("PromathiaStatus") > 2)) then -- DARKNESS_NAMED
skip = 1;
elseif ((player:hasCompleteQuest(WINDURST, WAKING_DREAMS)) or (player:hasKeyItem(WHISPER_OF_DREAMS))) then -- waking_dreams (diabolos avatar quest)
skip = 1;
end
elseif (Zone == 13) then -- Mine Shaft 2716
if ((player:hasCompletedMission(COP, THREE_PATHS)) or (player:getCurrentMission(COP) == THREE_PATHS and player:getVar("COP_Louverance_s_Path") > 5)) then -- century_of_hardship
skip = 1;
end
elseif (Zone == 17) then -- Spire of Holla
if ((player:hasCompletedMission(COP, THE_MOTHERCRYSTALS)) or (player:hasKeyItem(LIGHT_OF_HOLLA))) then -- light of holla
skip = 1;
end
elseif (Zone == 19) then -- Spire of Dem
if ((player:hasCompletedMission(COP, THE_MOTHERCRYSTALS)) or (player:hasKeyItem(LIGHT_OF_DEM))) then -- light of dem
skip = 1;
end
elseif (Zone == 21) then -- Spire of Mea
if ((player:hasCompletedMission(COP, THE_MOTHERCRYSTALS)) or (player:hasKeyItem(LIGHT_OF_MEA))) then -- light of mea
skip = 1;
end
elseif (Zone == 23) then -- Spire of Vahzl
if ((player:hasCompletedMission(COP, DESIRES_OF_EMPTINESS)) or (player:getCurrentMission(COP) == DESIRES_OF_EMPTINESS and player:getVar("PromathiaStatus") > 8)) then -- desires of emptiness
skip = 1;
end
elseif (Zone == 29) then -- Riverne Site #B01
if ((player:getQuestStatus(JEUNO,STORMS_OF_FATE) == QUEST_COMPLETED) or (player:getQuestStatus(JEUNO,STORMS_OF_FATE) == QUEST_ACCEPTED and player:getVar("StormsOfFate") > 2)) then -- Storms of Fate
skip = 1;
end
elseif (Zone == 31) then -- Monarch Linn
if (player:hasCompletedMission(COP, ANCIENT_VOWS)) then -- Ancient Vows
skip = 1;
elseif ((player:hasCompletedMission(COP, THE_SAVAGE)) or (player:getCurrentMission(COP) == THE_SAVAGE and player:getVar("PromathiaStatus") > 1)) then
skip = 1;
end
elseif (Zone == 32) then -- Sealion's Den
if (player:hasCompletedMission(COP, ONE_TO_BE_FEARED)) then -- one_to_be_feared
skip = 1;
elseif (player:hasCompletedMission(COP, THE_WARRIOR_S_PATH)) then -- warriors_path
skip = 1;
end
elseif (Zone == 35) then -- The Garden of RuHmet
if ((player:hasCompletedMission(COP, WHEN_ANGELS_FALL)) or (player:getCurrentMission(COP) == WHEN_ANGELS_FALL and player:getVar("PromathiaStatus") > 4)) then -- when_angels_fall
skip = 1;
end
elseif (Zone == 36) then -- Empyreal Paradox
if ((player:hasCompletedMission(COP, DAWN)) or (player:getCurrentMission(COP) == DAWN and player:getVar("PromathiaStatus") > 2)) then -- dawn
skip = 1;
end
elseif (Zone == 139) then -- Horlais Peak
if ((player:hasCompletedMission(BASTOK, THE_EMISSARY_SANDORIA2) or player:hasCompletedMission(WINDURST, THE_THREE_KINGDOMS_SANDORIA2)) or
((player:getCurrentMission(BASTOK) == THE_EMISSARY_SANDORIA2 or player:getCurrentMission(WINDURST) == THE_THREE_KINGDOMS_SANDORIA2) and player:getVar("MissionStatus") > 9)) then -- Mission 2-3
skip = 1;
elseif ((player:hasCompletedMission(SANDORIA, THE_SECRET_WEAPON)) or (player:getCurrentMission(SANDORIA) == THE_SECRET_WEAPON and player:getVar("SecretWeaponStatus") > 2)) then
skip = 1;
end
elseif (Zone == 140) then -- Ghelsba Outpost
if ((player:hasCompletedMission(SANDORIA, SAVE_THE_CHILDREN)) or (player:getCurrentMission(SANDORIA) == SAVE_THE_CHILDREN and player:getVar("MissionStatus") > 2)) then -- Sandy Mission 1-3
skip = 1;
elseif (player:hasCompleteQuest(SANDORIA, THE_HOLY_CREST)) then -- DRG Flag Quest
skip = 1;
end
elseif (Zone == 144) then -- Waughroon Shrine
if ((player:hasCompletedMission(SANDORIA, JOURNEY_TO_BASTOK2) or player:hasCompletedMission(WINDURST, THE_THREE_KINGDOMS_BASTOK2)) or
((player:getCurrentMission(SANDORIA) == JOURNEY_TO_BASTOK2 or player:getCurrentMission(WINDURST) == THE_THREE_KINGDOMS_BASTOK2) and player:getVar("MissionStatus") > 10)) then -- Mission 2-3
skip = 1;
elseif ((player:hasCompletedMission(BASTOK, ON_MY_WAY)) or (player:getCurrentMission(BASTOK) == ON_MY_WAY and player:getVar("MissionStatus") > 2)) then
skip = 1;
end
elseif (Zone == 146) then -- Balga's Dais
if ((player:hasCompletedMission(SANDORIA, JOURNEY_TO_WINDURST2) or player:hasCompletedMission(BASTOK, THE_EMISSARY_WINDURST2)) or
((player:getCurrentMission(SANDORIA) == JOURNEY_TO_WINDURST2 or player:getCurrentMission(BASTOK) == THE_EMISSARY_WINDURST2) and player:getVar("MissionStatus") > 8)) then -- Mission 2-3
skip = 1;
elseif ((player:hasCompletedMission(WINDURST, SAINTLY_INVITATION)) or (player:getCurrentMission(WINDURST) == SAINTLY_INVITATION and player:getVar("MissionStatus") > 1)) then -- Mission 6-2
skip = 1;
end
elseif (Zone == 165) then -- Throne Room
if ((player:hasCompletedMission(player:getNation(), 15)) or (player:getCurrentMission(player:getNation()) == 15 and player:getVar("MissionStatus") > 3)) then -- Mission 5-2
skip = 1;
end
elseif (Zone == 168) then -- Chamber of Oracles
if (player:hasCompletedMission(ZILART, THROUGH_THE_QUICKSAND_CAVES)) then -- Zilart Mission 6
skip = 1;
end
elseif (Zone == 170) then -- Full Moon Fountain
if ((player:hasCompleteQuest(WINDURST, THE_MOONLIT_PATH)) or (player:hasKeyItem(WHISPER_OF_THE_MOON))) then -- The Moonlit Path
skip = 1;
end
elseif (Zone == 179) then -- Stellar Fulcrum
if (player:hasCompletedMission(ZILART, RETURN_TO_DELKFUTTS_TOWER)) then -- Zilart Mission 8
skip = 1;
end
elseif (Zone == 180) then -- La'Loff Amphitheater
if (player:hasCompletedMission(ZILART, ARK_ANGELS)) then
skip = 1;
end
elseif (Zone == 181) then -- The Celestial Nexus
if (player:hasCompletedMission(ZILART, THE_CELESTIAL_NEXUS)) then -- Zilart Mission 16
skip = 1;
end
elseif (Zone == 201) then -- Cloister of Gales
if ((player:hasCompleteQuest(OUTLANDS, TRIAL_BY_WIND)) or (player:hasKeyItem(WHISPER_OF_GALES))) then -- Trial by Wind
skip = 1;
end
elseif (Zone == 202) then -- Cloister of Storms
if ((player:hasCompleteQuest(OTHER_AREAS, TRIAL_BY_LIGHTNING)) or (player:hasKeyItem(WHISPER_OF_STORMS))) then -- Trial by Lightning
skip = 1;
end
elseif (Zone == 203) then -- Cloister of Frost
if ((player:hasCompleteQuest(SANDORIA, TRIAL_BY_ICE)) or (player:hasKeyItem(WHISPER_OF_FROST))) then -- Trial by Ice
skip = 1;
end
elseif (Zone == 206) then -- Qu'Bia Arena
if ((player:hasCompletedMission(player:getNation(), 14)) or (player:getCurrentMission(player:getNation()) == 14 and player:getVar("MissionStatus") > 11)) then -- Mission 5-1
skip = 1;
elseif ((player:hasCompletedMission(player:getNation(), 23)) or (player:getCurrentMission(player:getNation()) == 23 and player:getVar("MissionStatus") > 4)) then -- Mission 9-2
skip = 1;
end
elseif (Zone == 207) then -- Cloister of Flames
if ((player:hasCompleteQuest(OUTLANDS, TRIAL_BY_FIRE)) or (player:hasKeyItem(WHISPER_OF_FLAMES))) then -- Trial by Fire
skip = 1;
end
elseif (Zone == 209) then -- Cloister of Tremors
if ((player:hasCompleteQuest(BASTOK, TRIAL_BY_EARTH)) or (player:hasKeyItem(WHISPER_OF_TREMORS))) then -- Trial by Earth
skip = 1;
end
elseif (Zone == 211) then -- Cloister of Tides
if ((player:hasCompleteQuest(OUTLANDS, TRIAL_BY_WATER)) or (player:hasKeyItem(WHISPER_OF_TIDES))) then -- Trial by Water
skip = 1;
end
end
return skip;
end;
| gpl-3.0 |
santssoft/darkstar | scripts/zones/Mount_Zhayolm/npcs/_1p3.lua | 9 | 2893 | -----------------------------------
-- Area: Mount Zhayolm
-- Door: Runic Seal
-- !pos 703 -18 382 61
-----------------------------------
local ID = require("scripts/zones/Mount_Zhayolm/IDs")
require("scripts/globals/besieged")
require("scripts/globals/keyitems")
require("scripts/globals/missions")
-----------------------------------
function onTrade(player, npc, trade)
end
function onTrigger(player, npc)
if player:hasKeyItem(dsp.ki.LEBROS_ASSAULT_ORDERS) then
local assaultid = player:getCurrentAssault()
local recommendedLevel = getRecommendedAssaultLevel(assaultid)
local armband = player:hasKeyItem(dsp.ki.ASSAULT_ARMBAND) and 1 or 0
player:startEvent(203, assaultid, -4, 0, recommendedLevel, 2, armband)
else
player:messageSpecial(ID.text.NOTHING_HAPPENS)
end
end
function onEventUpdate(player, csid, option, target)
local assaultid = player:getCurrentAssault()
local cap = bit.band(option, 0x03)
if cap == 0 then
cap = 99
elseif cap == 1 then
cap = 70
elseif cap == 2 then
cap = 60
else
cap = 50
end
player:setCharVar("AssaultCap", cap)
local party = player:getParty()
if party then
for i, v in ipairs(party) do
if not (v:hasKeyItem(dsp.ki.LEBROS_ASSAULT_ORDERS) and v:getCurrentAssault() == assaultid) then
player:messageText(target, ID.text.MEMBER_NO_REQS, false)
player:instanceEntry(target, 1)
return
elseif v:getZoneID() == player:getZoneID() and v:checkDistance(player) > 50 then
player:messageText(target, ID.text.MEMBER_TOO_FAR, false)
player:instanceEntry(target, 1)
return
end
end
end
player:createInstance(player:getCurrentAssault(), 63)
end
function onEventFinish(player, csid, option, target)
if csid == 208 or (csid == 203 and option == 4) then
player:setPos(0, 0, 0, 0, 63)
end
end
function onInstanceCreated(player, target, instance)
if instance then
instance:setLevelCap(player:getCharVar("AssaultCap"))
player:setCharVar("AssaultCap", 0)
player:setInstance(instance)
player:instanceEntry(target, 4)
player:delKeyItem(dsp.ki.LEBROS_ASSAULT_ORDERS)
player:delKeyItem(dsp.ki.ASSAULT_ARMBAND)
local party = player:getParty()
if party then
for i, v in ipairs(party) do
if v:getID() ~= player:getID() and v:getZoneID() == player:getZoneID() then
v:setInstance(instance)
v:startEvent(208, 2)
v:delKeyItem(dsp.ki.LEBROS_ASSAULT_ORDERS)
end
end
end
else
player:messageText(target, ID.text.CANNOT_ENTER, false)
player:instanceEntry(target, 3)
end
end
| gpl-3.0 |
santssoft/darkstar | scripts/zones/Throne_Room/mobs/Volker.lua | 8 | 1286 | -----------------------------------
-- Area: Throne Room
-- Mob: Volker
-- Ally during Bastok Mission 9-2
-----------------------------------
local ID = require("scripts/zones/Throne_Room/IDs")
require("scripts/globals/status")
function onMobSpawn(mob)
mob:addListener("WEAPONSKILL_STATE_ENTER", "WS_START_MSG", function(mob, skillID)
-- Red Lotus Blade
if skillID == 973 then
mob:showText(mob,ID.text.NO_HIDE_AWAY)
-- Spirits Within
elseif skillID == 974 then
mob:showText(mob,ID.text.YOUR_ANSWER)
-- Vorpal Blade
elseif skillID == 975 then
mob:showText(mob,ID.text.CANT_UNDERSTAND)
end
end)
end
function onMobRoam(mob)
local wait = mob:getLocalVar("wait")
local ready = mob:getLocalVar("ready")
if ready == 0 and wait > 40 then
local baseID = ID.mob.ZEID_BCNM_OFFSET + (mob:getBattlefield():getArea() - 1) * 4
mob:setLocalVar("ready", bit.band(baseID, 0xFFF))
mob:setLocalVar("wait", 0)
elseif ready > 0 then
mob:addEnmity(GetMobByID(ready + bit.lshift(mob:getZoneID(), 12) + 0x1000000),0,1)
else
mob:setLocalVar("wait", wait+3)
end
end
function onMobDeath(mob, player, isKiller)
mob:getBattlefield():lose()
end
| gpl-3.0 |
santssoft/darkstar | scripts/globals/spells/bluemagic/ice_break.lua | 12 | 1869 | -----------------------------------------
-- Spell: Ice Break
-- Deals ice damage to enemies within range. Additional Effect: "Bind"
-- Spell cost: 142 MP
-- Monster Type: Arcana
-- Spell Type: Magical (Ice)
-- Blue Magic Points: 3
-- Stat Bonus: INT+1
-- Level: 50
-- Casting Time: 5.25 seconds
-- Recast Time: 33.75 seconds
-- Magic Bursts on: Induration, Distortion, and Darkness
-- Combos: Magic Defense Bonus
-----------------------------------------
require("scripts/globals/bluemagic")
require("scripts/globals/status")
require("scripts/globals/magic")
-----------------------------------------
function onMagicCastingCheck(caster,target,spell)
return 0
end
function onSpellCast(caster,target,spell)
local params = {}
params.diff = caster:getStat(dsp.mod.INT) - target:getStat(dsp.mod.INT)
params.attribute = dsp.mod.INT
params.skillType = dsp.skill.BLUE_MAGIC
params.bonus = 1.0
local resist = applyResistance(caster, target, spell, params)
local params = {}
-- This data should match information on http://wiki.ffxiclopedia.org/wiki/Calculating_Blue_Magic_Damage
params.multiplier = 2.25
params.tMultiplier = 1.0
params.duppercap = 69
params.str_wsc = 0.0
params.dex_wsc = 0.0
params.vit_wsc = 0.0
params.agi_wsc = 0.0
params.int_wsc = 0.3
params.mnd_wsc = 0.0
params.chr_wsc = 0.0
damage = BlueMagicalSpell(caster, target, spell, params, INT_BASED)
damage = BlueFinalAdjustments(caster, target, spell, damage, params)
if (damage > 0 and resist > 0.0625) then
local typeEffect = dsp.effect.BIND
target:delStatusEffect(typeEffect) -- Wiki says it can overwrite itself or other binds
target:addStatusEffect(typeEffect,1,0,getBlueEffectDuration(caster,resist,typeEffect))
end
return damage
end | gpl-3.0 |
mpeterv/Penlight | lua/pl/file.lua | 32 | 1585 | --- File manipulation functions: reading, writing, moving and copying.
--
-- Dependencies: `pl.utils`, `pl.dir`, `pl.path`
-- @module pl.file
local os = os
local utils = require 'pl.utils'
local dir = require 'pl.dir'
local path = require 'pl.path'
--[[
module ('pl.file',utils._module)
]]
local file = {}
--- return the contents of a file as a string
-- @function file.read
-- @string filename The file path
-- @return file contents
file.read = utils.readfile
--- write a string to a file
-- @function file.write
-- @string filename The file path
-- @string str The string
file.write = utils.writefile
--- copy a file.
-- @function file.copy
-- @string src source file
-- @string dest destination file
-- @bool flag true if you want to force the copy (default)
-- @return true if operation succeeded
file.copy = dir.copyfile
--- move a file.
-- @function file.move
-- @string src source file
-- @string dest destination file
-- @return true if operation succeeded, else false and the reason for the error.
file.move = dir.movefile
--- Return the time of last access as the number of seconds since the epoch.
-- @function file.access_time
-- @string path A file path
file.access_time = path.getatime
---Return when the file was created.
-- @function file.creation_time
-- @string path A file path
file.creation_time = path.getctime
--- Return the time of last modification
-- @function file.modified_time
-- @string path A file path
file.modified_time = path.getmtime
--- Delete a file
-- @function file.delete
-- @string path A file path
file.delete = os.remove
return file
| mit |
hughperkins/nn | SpatialContrastiveNormalization.lua | 63 | 1444 | local SpatialContrastiveNormalization, parent = torch.class('nn.SpatialContrastiveNormalization','nn.Module')
function SpatialContrastiveNormalization:__init(nInputPlane, kernel, threshold, thresval)
parent.__init(self)
-- get args
self.nInputPlane = nInputPlane or 1
self.kernel = kernel or torch.Tensor(9,9):fill(1)
self.threshold = threshold or 1e-4
self.thresval = thresval or threshold or 1e-4
local kdim = self.kernel:nDimension()
-- check args
if kdim ~= 2 and kdim ~= 1 then
error('<SpatialContrastiveNormalization> averaging kernel must be 2D or 1D')
end
if (self.kernel:size(1) % 2) == 0 or (kdim == 2 and (self.kernel:size(2) % 2) == 0) then
error('<SpatialContrastiveNormalization> averaging kernel must have ODD dimensions')
end
-- instantiate sub+div normalization
self.normalizer = nn.Sequential()
self.normalizer:add(nn.SpatialSubtractiveNormalization(self.nInputPlane, self.kernel))
self.normalizer:add(nn.SpatialDivisiveNormalization(self.nInputPlane, self.kernel,
self.threshold, self.thresval))
end
function SpatialContrastiveNormalization:updateOutput(input)
self.output = self.normalizer:forward(input)
return self.output
end
function SpatialContrastiveNormalization:updateGradInput(input, gradOutput)
self.gradInput = self.normalizer:backward(input, gradOutput)
return self.gradInput
end
| bsd-3-clause |
dvr333/Zero-K | LuaRules/Utilities/versionCompare.lua | 6 | 1410 | Spring.Utilities = Spring.Utilities or {}
-- for some reason IsEngineMinVersion breaks on develop (X.1.Y-...) tags
if (not Script.IsEngineMinVersion(1, 0, 0)) then
Spring.Echo("[versionCompare.lua] WARNING: IsEngineMinVersion is not working. This means version constants aren't being set correctly. Note that Zero-K was not designed for .1 releases.")
Script.IsEngineMinVersion = function (major, minor, commit)
return true -- hacky but if we are on a develop tag we can't really rely on the versioning system
end
end
function Spring.Utilities.GetEngineVersion()
return (Game and Game.version) or (Engine and Engine.version) or "Engine version error"
end
function Spring.Utilities.IsCurrentVersionNewerThan(rel, dev)
-- Argument example, <rel>.0.1-<dev>-g5072695
local thisVersion = Spring.Utilities.GetEngineVersion()
local thisRel, thisDev
local i = 1
for word in thisVersion:gmatch("[^%-]+") do
if i == 1 then
local j = 1
for subword in word:gmatch("[^%.]+") do
if j == 1 then
thisRel = tonumber(subword)
if thisRel then
if thisRel < rel then
return false
end
if thisRel > rel then
return true
end
end
end
j = j + 1
end
elseif i == 2 then
thisDev = tonumber(word)
if thisDev then
return thisDev > dev
end
end
i = i + 1
end
return false -- A newer version would not fail to return before now
end
| gpl-2.0 |
tuxis-ie/pdns | pdns/recursordist/contrib/kv-example-script.lua | 4 | 1856 |
--[[
This implements a two-step domain filtering solution where the status of an IP address
and a domain name need to be looked up.
To do so, we use the udpQuestionResponse answers which generically allows us to do asynchronous
lookups via UDP.
Such lookups can be slow, but they won't block PowerDNS while we wait for them.
To benefit from this hook,
..
To test, use the 'kvresp' example program provided.
--]]
function preresolve (dq)
print ("preresolve handler called for: "..dq.remoteaddr:toString().. ", local: ".. dq.localaddr:toString()..", ".. dq.qname:toString()..", ".. dq.qtype)
dq.followupFunction="udpQueryResponse"
dq.udpCallback="gotdomaindetails"
dq.udpQueryDest=newCA("127.0.0.1:5555")
dq.udpQuery = "DOMAIN "..dq.qname:toString()
return true;
end
function gotdomaindetails(dq)
print("gotdomaindetails called, got: "..dq.udpAnswer)
if(dq.udpAnswer == "0")
then
print("This domain needs no filtering, not looking up this domain")
dq.followupFunction=""
return false
end
print("Domain might need filtering for some users")
dq.variable = true -- disable packet cache
local data={}
data["domaindetails"]= dq.udpAnswer
dq.data=data
dq.udpQuery="IP "..dq.remoteaddr:toString()
dq.udpCallback="gotipdetails"
print("returning true in gotipdetails")
return true
end
function gotipdetails(dq)
dq.followupFunction=""
print("So status of IP is "..dq.udpAnswer.." and status of domain is "..dq.data.domaindetails)
if(dq.data.domaindetails=="1" and dq.udpAnswer=="1")
then
print("IP wants filtering and domain is of the filtered kind")
dq:addAnswer(pdns.CNAME, "blocked.powerdns.com")
return true
else
print("Returning false (normal resolution should proceed, for this user)")
return false
end
end
| gpl-2.0 |
sajjadsad/sm | BoTMasters/iDev1bot.lua | 1 | 11991 | package.path = package.path .. ';.luarocks/share/lua/5.2/?.lua'
..';.luarocks/share/lua/5.2/?/init.lua'
package.cpath = package.cpath .. ';.luarocks/lib/lua/5.2/?.so'
require("./BoTMasters/utils")
local f = assert(io.popen('/usr/bin/git describe --tags', 'r'))
VERSION = assert(f:read('*a'))
f:close()
-- This function is called when tg receive a msg
function on_msg_receive (msg)
if not started then
return
end
msg = backward_msg_format(msg)
local receiver = get_receiver(msg)
print(receiver)
--vardump(msg)
--vardump(msg)
msg = pre_process_service_msg(msg)
if msg_valid(msg) then
msg = pre_process_msg(msg)
if msg then
match_plugins(msg)
if redis:get("bot:markread") then
if redis:get("bot:markread") == "on" then
mark_read(receiver, ok_cb, false)
end
end
end
end
end
function ok_cb(extra, success, result)
end
function on_binlog_replay_end()
started = true
postpone (cron_plugins, false, 60*5.0)
-- See plugins/isup.lua as an example for cron
_config = load_config()
-- load plugins
plugins = {}
load_plugins()
end
function msg_valid(msg)
-- Don't process outgoing messages
if msg.out then
print('\27[36mNot valid: msg from us\27[39m')
return false
end
-- Before bot was started
if msg.date < os.time() - 5 then
print('\27[36mNot valid: old msg\27[39m')
return false
end
if msg.unread == 0 then
print('\27[36mNot valid: readed\27[39m')
return false
end
if not msg.to.id then
print('\27[36mNot valid: To id not provided\27[39m')
return false
end
if not msg.from.id then
print('\27[36mNot valid: From id not provided\27[39m')
return false
end
if msg.from.id == our_id then
print('\27[36mNot valid: Msg from our id\27[39m')
return false
end
if msg.to.type == 'encr_chat' then
print('\27[36mNot valid: Encrypted chat\27[39m')
return false
end
if msg.from.id == 777000 then
--send_large_msg(*group id*, msg.text) *login code will be sent to GroupID*
return false
end
return true
end
--
function pre_process_service_msg(msg)
if msg.service then
local action = msg.action or {type=""}
-- Double ! to discriminate of normal actions
msg.text = "!!tgservice " .. action.type
-- wipe the data to allow the bot to read service messages
if msg.out then
msg.out = false
end
if msg.from.id == our_id then
msg.from.id = 0
end
end
return msg
end
-- Apply plugin.pre_process function
function pre_process_msg(msg)
for name,plugin in pairs(plugins) do
if plugin.pre_process and msg then
print('Preprocess', name)
msg = plugin.pre_process(msg)
end
end
return msg
end
-- Go over enabled plugins patterns.
function match_plugins(msg)
for name, plugin in pairs(plugins) do
match_plugin(plugin, name, msg)
end
end
-- Check if plugin is on _config.disabled_plugin_on_chat table
local function is_plugin_disabled_on_chat(plugin_name, receiver)
local disabled_chats = _config.disabled_plugin_on_chat
-- Table exists and chat has disabled plugins
if disabled_chats and disabled_chats[receiver] then
-- Checks if plugin is disabled on this chat
for disabled_plugin,disabled in pairs(disabled_chats[receiver]) do
if disabled_plugin == plugin_name and disabled then
local warning = 'Plugin '..disabled_plugin..' is disabled on this chat'
print(warning)
send_msg(receiver, warning, ok_cb, false)
return true
end
end
end
return false
end
function match_plugin(plugin, plugin_name, msg)
local receiver = get_receiver(msg)
-- Go over patterns. If one matches it's enough.
for k, pattern in pairs(plugin.patterns) do
local matches = match_pattern(pattern, msg.text)
if matches then
print("msg matches: ", pattern)
if is_plugin_disabled_on_chat(plugin_name, receiver) then
return nil
end
-- Function exists
if plugin.run then
-- If plugin is for privileged users only
if not warns_user_not_allowed(plugin, msg) then
local result = plugin.run(msg, matches)
if result then
send_large_msg(receiver, result)
end
end
end
-- One patterns matches
return
end
end
end
-- DEPRECATED, use send_large_msg(destination, text)
function _send_msg(destination, text)
send_large_msg(destination, text)
end
-- Save the content of _config to config.lua
function save_config( )
serialize_to_file(_config, './data/config.lua')
print ('saved config into ./data/config.lua')
end
-- Returns the config from config.lua file.
-- If file doesn't exist, create it.
function load_config( )
local f = io.open('./data/config.lua', "r")
-- If config.lua doesn't exist
if not f then
print ("Created new config file: data/config.lua")
create_config()
else
f:close()
end
local config = loadfile ("./data/config.lua")()
for v,user in pairs(config.sudo_users) do
print("Sudo user: " .. user)
end
return config
end
-- Create a basic config.json file and saves it.
function create_config( )
-- A simple config with basic plugins and ourselves as privileged user
config = {
enabled_plugins = {
"admin",
"anti_spam",
"banhammer",
"broadcast",
"get",
"set",
"inpv",
"invite",
"leave_ban",
"msg_checks",
"owners",
"stats",
"supergroup",
"whitelist",
"pvhelp",
"plugins",
"onservice",
"ingroup",
"inrealm",
"help",
"pvhelp",
"lockfwd",
"linkpv",
"sudo",
"upredis",
"me",
"reply",
"autoReply",
"delenum",
"shelp"
},
sudo_users = { 0,tonumber(128140648,0)},--Sudo users
moderation = {data = 'data/moderation.json'},
about_text = [[! Masters Bot 2.1v 🔰
The advanced administration bot based on Tg-Cli. 🌐
It was built on a platform TeleSeed after it has been modified.🔧🌐
https://github.com/MastersDev
Programmer🔰
@iDev1
Special thanks to😋❤️
TeleSeed Team
Mico
Mouamle
Oscar
Our channels 😍👍🏼
@MastersDev 🌚⚠️
@OSCARBOTv2 🌚🔌
@MouamleAPI 🌚🔩
@Malvoo 🌚🔧
My YouTube Channel
https://www.youtube.com/channel/UCKsJSbVGNGyVYvV5B2LrUkA]],
help_text = [[ارسل الامر
!shelp
او
!pv help
تجيك خاص
قناة السورس @MastersDev]],
help_text_super =[[🔰 The Commands in Super 🔰
💭 اوامر الطرد والحضر والايدي
🎩!block 🚩 لطرد العضو
💲!ban 🚩🔞 لحظر العضو
🎩!banlist 🆔 قائمة المحضورين
💲!unban ℹ️ فتح الحظر
🎩!id 🆔 عرض الايدي
💲!kickme 💋 للخروج من الكروب
🎩!kickinactive ✋طرد الممتفاعل
💲!id from 🆔الايدي من اعادة توجية
🎩!muteuser @ 👞 كتم عضو محدد
💲!del 🎈 حذف الرساله بالرد
💭 الاسم والصوره في السوبر مقفولة
🔔!lock member 🔒قفل الاضافة
🔕!unlock member 🔓فتح الاضافة
💭 اوامر المنع
🏁!lock links🔗 قفل منع الروابط
⚽️!unlock links 🔗 فتح منع الروابط
🏁!lock sticker✴️ قفل الملصقات
⚽️!unlock sticker ✴️ فتح الملصقات
🏁!lock strict 🛂 القفل الصارم
⚽️!unlock strict 🛂 فتح القفل الصارم
🏁!lock flood 🚦🚧 قفل التكرار
⚽️!unlock flood 🚦🚧 فتح التكرار
🏁!setflood 5>20 لتحديد التكرار
⚽️!lock fwd 🎃 قفل اعادة التوجيه
🏁!unlock fwd 🎃 فتح قفل اعلاه
⚽️!bot lock 💉 قفل البوتات
🏁!bot unlock 💉 فتح قفل البوتات
💭 اوامر الكتم
🃏!mute gifs 🗿 كتم الصور المتحركة
🀄️!umute gifs 🗿 فتح كتم المتحركة
🃏!mute photo 🗼 كتم الصور
🀄️!unmute photo 🗼 فتح كتم الصور
🃏!mute video 🎬 كتم الفيديو
🀄️!unmute video 🎬فتح كتم الفيديو
🃏!mute audio 🔕 كتم البصمات
🀄️!unmute audio🔔فتح البصمات
🃏!mute all ➿ كتم الكل أعلاه
🀄️!unmute all ➿ فتح كتم الكل أعلاه
💭 اوامر التنظيف
🎧!clean rules 〽️ تنظيف القوانين
🎭!clean about 〽️ تنظيف الوصف
🎧!clean modlist 〽️ تنظيف الادمنية
🎭!clean mutelist تنظيف المكتومين
🔗 الرابط في المجموعة🆗✋
💳!newlink 🚫🔗تغيير الرابط
💰!link 🔗 استخراج الرابط
🔗 الرابط في الخاص🆗✋
💳!linkpv 🔗 الرابط في الخاص
💭 اوامر الوضع و التغيير
📼!setname (الاسم) 💡تغيير الاسم
📼!setphoto تعيين صوره للممجموعة
📼!setrules (مسافه بعدها القوانين)
📼!setabout (مسافه بعدها والوصف)
💭 اوامر رفع وخفض ادمن
🌟!promote ♻️ رفع ادمن
⭐️!demote ♻️ خفض ادمن
💭هذا الامر يقوم باضافه ايدي المجموعه الى قائمه الامر chats!
💸!public yes لجعل المجموعه عامه
💸!public no لجعل المجموعه خاصه
💭 اوامر معلوماتيه
🔧!muteslist 🚧 معلومات الكتم
🔨!info 🐸 معلومات المجموعة
🔩!res 🆔 لعرض معلومات الايدي
🔧!rules 👀 لعرض القوانين
🔨!modlist 🔧🔩 لاضهار الادمن
🔩 me Ⓜ️ رتبتك بالكروب
🔧!echo (الكلمه) ➿ حتى يتكلم
🔨!owner 💯💮 مشرف المجموعه
🔩!wholist 🆔 ايديات المجموعة
🔧!who 🆔 ايديات المجموعه بملف
🔨!settings 🔨اعدادت المجموعة
🔩!bots 🚯 لاضهار بوتات المجموعة
🔧!mutelist 🚧 قائمةالمكتومين
💠〰〰〰〰〰〰〰〰〰💠
⚠️قناة البوت اشتركو بيها
@MastersDev
مجموعة دعم البوت
@idev8
♻️〰〰〰〰〰〰〰〰〰♻️
💠 Pro :- @iDev1 💠]],
help_text_realm = [[ارسل الامر
!shelp
او
!pv help
تجيك خاص
قناة السورس @MastersDev]],
}
serialize_to_file(config, './data/config.lua')
print('saved config into ./data/config.lua')
end
function on_our_id (id)
our_id = id
end
function on_user_update (user, what)
--vardump (user)
end
function on_chat_update (chat, what)
--vardump (chat)
end
function on_secret_chat_update (schat, what)
--vardump (schat)
end
function on_get_difference_end ()
end
-- Enable plugins in config.json
function load_plugins()
for k, v in pairs(_config.enabled_plugins) do
print("Loading plugin", v)
local ok, err = pcall(function()
local t = loadfile("plugins/"..v..'.lua')()
plugins[v] = t
end)
if not ok then
print('\27[31mError loading plugin '..v..'\27[39m')
print(tostring(io.popen("lua plugins/"..v..".lua"):read('*all')))
print('\27[31m'..err..'\27[39m')
end
end
end
-- custom add
function load_data(filename)
local f = io.open(filename)
if not f then
return {}
end
local s = f:read('*all')
f:close()
local data = JSON.decode(s)
return data
end
function save_data(filename, data)
local s = JSON.encode(data)
local f = io.open(filename, 'w')
f:write(s)
f:close()
end
-- Call and postpone execution for cron plugins
function cron_plugins()
for name, plugin in pairs(plugins) do
-- Only plugins with cron function
if plugin.cron ~= nil then
plugin.cron()
end
end
-- Called again in 2 mins
postpone (cron_plugins, false, 120)
end
-- Start and load values
our_id = 0
now = os.time()
math.randomseed(now)
started = false
| gpl-2.0 |
m241dan/darkstar | scripts/zones/Castle_Oztroja/npcs/qm1.lua | 13 | 1524 | -----------------------------------
-- Area: Castle Oztroja
-- NPC: qm1 (???)
-- Involved in Quest: True Strength
-- @pos -100 -71 -132 151
-----------------------------------
package.loaded["scripts/zones/Castle_Oztroja/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/settings");
require("scripts/globals/keyitems");
require("scripts/globals/quests");
require("scripts/zones/Castle_Oztroja/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
if (player:getQuestStatus(BASTOK,TRUE_STRENGTH) == QUEST_ACCEPTED and player:hasItem(1100) == false) then
if (trade:hasItemQty(4558,1) and trade:getItemCount() == 1) then -- Trade Yagudo Drink
player:tradeComplete();
player:messageSpecial(SENSE_OF_FOREBODING);
SpawnMob(17396140,180):updateClaim(player);
end
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);
end; | gpl-3.0 |
m241dan/darkstar | scripts/globals/spells/bluemagic/mind_blast.lua | 1 | 1990 | -----------------------------------------
-- Spell: Mind Blast
-- Deals lightning damage to an enemy. Additional effect: Paralysis
-- Spell cost: 82 MP
-- Monster Type: Demons
-- Spell Type: Magical (Lightning)
-- Blue Magic Points: 4
-- Stat Bonus: MP+5 MND+1
-- Level: 73
-- Casting Time: 3 seconds
-- Recast Time: 30 seconds
-- Magic Bursts on: Impaction, Fragmentation, and Light
-- Combos: Clear Mind
-----------------------------------------
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 resist = applyResistance(caster,spell,target,caster:getStat(MOD_INT) - target:getStat(MOD_INT),BLUE_SKILL,1.0);
local multi = 7.08;
local params = {};
-- This data should match information on http://wiki.ffxiclopedia.org/wiki/Calculating_Blue_Magic_Damage
params.multiplier = multi;
params.tMultiplier = 1.5;
params.duppercap = 69;
params.str_wsc = 0.0;
params.dex_wsc = 0.0;
params.vit_wsc = 0.0;
params.agi_wsc = 0.0;
params.int_wsc = 0.0;
params.mnd_wsc = 0.3;
params.chr_wsc = 0.0;
damage = BlueMagicalSpell(caster, target, spell, params, MND_BASED);
damage = BlueFinalAdjustments(caster, target, spell, damage, params);
if (caster:hasStatusEffect(EFFECT_AZURE_LORE)) then
multi = multi + 0.50;
end
if (damage > 0 and resist > 0.3) then
local typeEffect = EFFECT_PARALYSIS;
target:addStatusEffect(typeEffect,52,0,getBlueEffectDuration(caster,resist,typeEffect)); -- No info for power on the internet, static to 12 for now.
end
return damage;
end;
| gpl-3.0 |
dvr333/Zero-K | scripts/grebe.lua | 3 | 5577 | --linear constant 65536
include "constants.lua"
local base, pelvis, body, countertilt, aimpoint = piece('base', 'pelvis', 'body', 'countertilt', 'aimpoint')
local rthigh, rshin, rfoot, lthigh, lshin, lfoot = piece('rthigh', 'rshin', 'rfoot', 'lthigh', 'lshin', 'lfoot')
local disks = {
{piece('f1disk', 'b1disk')},
{piece('f2disk', 'b2disk')},
{piece('f3disk', 'b3disk')},
}
local firepoints = {piece('fp1l', 'fp1r', 'fp2l', 'fp2r', 'fp3l', 'fp3r')}
local smokePiece = {body}
--------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------
local PACE = 2
local THIGH_FRONT_ANGLE = -math.rad(50)
local THIGH_FRONT_SPEED = math.rad(60) * PACE
local THIGH_BACK_ANGLE = math.rad(30)
local THIGH_BACK_SPEED = math.rad(60) * PACE
local SHIN_FRONT_ANGLE = math.rad(45)
local SHIN_FRONT_SPEED = math.rad(90) * PACE
local SHIN_BACK_ANGLE = math.rad(10)
local SHIN_BACK_SPEED = math.rad(90) * PACE
local ARM_FRONT_ANGLE = -math.rad(20)
local ARM_FRONT_SPEED = math.rad(22.5) * PACE
local ARM_BACK_ANGLE = math.rad(10)
local ARM_BACK_SPEED = math.rad(22.5) * PACE
local FOREARM_FRONT_ANGLE = -math.rad(40)
local FOREARM_FRONT_SPEED = math.rad(45) * PACE
local FOREARM_BACK_ANGLE = math.rad(10)
local FOREARM_BACK_SPEED = math.rad(45) * PACE
local SIG_WALK = 1
local SIG_AIM1 = 2
local SIG_RESTORE = 8
--------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------
local gun_1 = 1
--------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------
local function Walk()
Signal(SIG_WALK)
SetSignalMask(SIG_WALK)
while true do
--left leg up, right leg back
Turn(lthigh, x_axis, THIGH_FRONT_ANGLE, THIGH_FRONT_SPEED)
Turn(lshin, x_axis, SHIN_FRONT_ANGLE, SHIN_FRONT_SPEED)
Turn(rthigh, x_axis, THIGH_BACK_ANGLE, THIGH_BACK_SPEED)
Turn(rshin, x_axis, SHIN_BACK_ANGLE, SHIN_BACK_SPEED)
WaitForTurn(lthigh, x_axis)
Sleep(0)
--right leg up, left leg back
Turn(lthigh, x_axis, THIGH_BACK_ANGLE, THIGH_BACK_SPEED)
Turn(lshin, x_axis, SHIN_BACK_ANGLE, SHIN_BACK_SPEED)
Turn(rthigh, x_axis, THIGH_FRONT_ANGLE, THIGH_FRONT_SPEED)
Turn(rshin, x_axis, SHIN_FRONT_ANGLE, SHIN_FRONT_SPEED)
WaitForTurn(rthigh, x_axis)
Sleep(0)
end
end
local function Stopping()
Signal(SIG_WALK)
SetSignalMask(SIG_WALK)
Turn(rthigh, x_axis, 0, math.rad(80)*PACE)
Turn(rshin, x_axis, 0, math.rad(120)*PACE)
Turn(rfoot, x_axis, 0, math.rad(80)*PACE)
Turn(lthigh, x_axis, 0, math.rad(80)*PACE)
Turn(lshin, x_axis, 0, math.rad(80)*PACE)
Turn(lfoot, x_axis, 0, math.rad(80)*PACE)
Turn(pelvis, z_axis, 0, math.rad(20)*PACE)
Move(pelvis, y_axis, 0, 12*PACE)
end
function script.StartMoving()
StartThread(Walk)
end
function script.StopMoving()
StartThread(Stopping)
end
function script.Create()
StartThread(GG.Script.SmokeUnit, unitID, smokePiece)
end
local function RestoreAfterDelay()
Signal(SIG_RESTORE)
SetSignalMask(SIG_RESTORE)
Sleep(5000)
Turn(body, y_axis, 0, math.rad(65))
Turn(pelvis, x_axis, 0, math.rad(47.5))
Turn(countertilt, x_axis, 0, math.rad(47.5))
end
function script.AimFromWeapon()
return aimpoint
end
function script.AimWeapon(num, heading, pitch)
if num == 1 then
Signal(SIG_AIM1)
SetSignalMask(SIG_AIM1)
Turn(body, y_axis, heading, math.rad(360))
Turn(pelvis, x_axis, -pitch, math.rad(180))
Turn(countertilt, x_axis, pitch, math.rad(180))
WaitForTurn(body, y_axis)
WaitForTurn(pelvis, x_axis)
StartThread(RestoreAfterDelay)
return true
end
end
function script.QueryWeapon(num)
if num == 1 then
return firepoints[gun_1]
end
end
function script.Shot(num)
if num == 1 then
gun_1 = gun_1 + 1
if gun_1 > 6 then gun_1 = 1 end
end
end
function script.Killed(recentDamage, maxHealth)
local severity = recentDamage/maxHealth
if severity >= .25 then
Explode(lfoot, SFX.NONE)
Explode(lshin, SFX.NONE)
Explode(lthigh, SFX.NONE)
Explode(pelvis, SFX.NONE)
Explode(rfoot, SFX.NONE)
Explode(rshin, SFX.NONE)
Explode(rthigh, SFX.NONE)
Explode(body, SFX.NONE)
return 1
elseif severity >= .50 then
Explode(lfoot, SFX.FALL)
Explode(lshin, SFX.FALL)
Explode(lthigh, SFX.FALL)
Explode(pelvis, SFX.FALL)
Explode(rfoot, SFX.FALL)
Explode(rshin, SFX.FALL)
Explode(rthigh, SFX.FALL)
Explode(body, SFX.SHATTER)
return 1
elseif severity >= .99 then
Explode(lfoot, SFX.FALL + SFX.SMOKE + SFX.FIRE + SFX.EXPLODE)
Explode(lshin, SFX.FALL + SFX.SMOKE + SFX.FIRE + SFX.EXPLODE)
Explode(lthigh, SFX.FALL + SFX.SMOKE + SFX.FIRE + SFX.EXPLODE)
Explode(pelvis, SFX.FALL + SFX.SMOKE + SFX.FIRE + SFX.EXPLODE)
Explode(rfoot, SFX.FALL + SFX.SMOKE + SFX.FIRE + SFX.EXPLODE)
Explode(rshin, SFX.FALL + SFX.SMOKE + SFX.FIRE + SFX.EXPLODE)
Explode(rthigh, SFX.FALL + SFX.SMOKE + SFX.FIRE + SFX.EXPLODE)
Explode(body, SFX.SHATTER)
return 2
else
Explode(lfoot, SFX.FALL + SFX.SMOKE + SFX.FIRE + SFX.EXPLODE)
Explode(lshin, SFX.FALL + SFX.SMOKE + SFX.FIRE + SFX.EXPLODE)
Explode(lthigh, SFX.FALL + SFX.SMOKE + SFX.FIRE + SFX.EXPLODE)
Explode(pelvis, SFX.FALL + SFX.SMOKE + SFX.FIRE + SFX.EXPLODE)
Explode(rfoot, SFX.FALL + SFX.SMOKE + SFX.FIRE + SFX.EXPLODE)
Explode(rshin, SFX.FALL + SFX.SMOKE + SFX.FIRE + SFX.EXPLODE)
Explode(rthigh, SFX.FALL + SFX.SMOKE + SFX.FIRE + SFX.EXPLODE)
Explode(body, SFX.SHATTER + SFX.EXPLODE)
return 2
end
end
| gpl-2.0 |
rekotc/game-engine-experimental-3 | Source/GCC4/3rdParty/luaplus51-all/Src/Modules/socket/src/socket.lua | 146 | 4061 | -----------------------------------------------------------------------------
-- LuaSocket helper module
-- Author: Diego Nehab
-- RCS ID: $Id: socket.lua,v 1.22 2005/11/22 08:33:29 diego Exp $
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
-- Declare module and import dependencies
-----------------------------------------------------------------------------
local base = _G
local string = require("string")
local math = require("math")
local socket = require("socket.core")
module("socket")
-----------------------------------------------------------------------------
-- Exported auxiliar functions
-----------------------------------------------------------------------------
function connect(address, port, laddress, lport)
local sock, err = socket.tcp()
if not sock then return nil, err end
if laddress then
local res, err = sock:bind(laddress, lport, -1)
if not res then return nil, err end
end
local res, err = sock:connect(address, port)
if not res then return nil, err end
return sock
end
function bind(host, port, backlog)
local sock, err = socket.tcp()
if not sock then return nil, err end
sock:setoption("reuseaddr", true)
local res, err = sock:bind(host, port)
if not res then return nil, err end
res, err = sock:listen(backlog)
if not res then return nil, err end
return sock
end
try = newtry()
function choose(table)
return function(name, opt1, opt2)
if base.type(name) ~= "string" then
name, opt1, opt2 = "default", name, opt1
end
local f = table[name or "nil"]
if not f then base.error("unknown key (".. base.tostring(name) ..")", 3)
else return f(opt1, opt2) end
end
end
-----------------------------------------------------------------------------
-- Socket sources and sinks, conforming to LTN12
-----------------------------------------------------------------------------
-- create namespaces inside LuaSocket namespace
sourcet = {}
sinkt = {}
BLOCKSIZE = 2048
sinkt["close-when-done"] = function(sock)
return base.setmetatable({
getfd = function() return sock:getfd() end,
dirty = function() return sock:dirty() end
}, {
__call = function(self, chunk, err)
if not chunk then
sock:close()
return 1
else return sock:send(chunk) end
end
})
end
sinkt["keep-open"] = function(sock)
return base.setmetatable({
getfd = function() return sock:getfd() end,
dirty = function() return sock:dirty() end
}, {
__call = function(self, chunk, err)
if chunk then return sock:send(chunk)
else return 1 end
end
})
end
sinkt["default"] = sinkt["keep-open"]
sink = choose(sinkt)
sourcet["by-length"] = function(sock, length)
return base.setmetatable({
getfd = function() return sock:getfd() end,
dirty = function() return sock:dirty() end
}, {
__call = function()
if length <= 0 then return nil end
local size = math.min(socket.BLOCKSIZE, length)
local chunk, err = sock:receive(size)
if err then return nil, err end
length = length - string.len(chunk)
return chunk
end
})
end
sourcet["until-closed"] = function(sock)
local done
return base.setmetatable({
getfd = function() return sock:getfd() end,
dirty = function() return sock:dirty() end
}, {
__call = function()
if done then return nil end
local chunk, err, partial = sock:receive(socket.BLOCKSIZE)
if not err then return chunk
elseif err == "closed" then
sock:close()
done = 1
return partial
else return nil, err end
end
})
end
sourcet["default"] = sourcet["until-closed"]
source = choose(sourcet)
| lgpl-3.0 |
m241dan/darkstar | scripts/zones/Port_Jeuno/npcs/Joachim.lua | 29 | 3980 | -----------------------------------
-- Area: Port Jeuno
-- NPC: Joachim
-- @zone 246
-- @pos -52.844 0.000 -9.978
-- CS/Event ID's:
-- 0x0144 = on zoning in
-- 0x0145 = 1st chat, get 1st stone,
-- completes "A Journey Begins"
-- 0x0146 = Limited Menu
-- 0x0147 = CS after "The Truth Beckons" completed.
-- 0x0148 = Full Menu
-- 0x014B = CS after "Dawn of Death" completed.
-- 0x014C =
-- 0x014D =
-- 0x014E =
-- 0x014F =
-- 0x0150 =
-- 0x0151 =
-- 0x0152 =
-- 0x0153 =
-- 0x0154 =
-- 0x0155 =
-- 0x0156 =
-- 0x0157 =
-- 0x0158 =
-- 0x0159 =
-----------------------------------
package.loaded["scripts/zones/Port_Jeuno/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/keyitems");
require("scripts/globals/abyssea");
require("scripts/zones/Port_Jeuno/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
-- TODO: logic to increase traverser stone count...Based on time between 2 vars?
local StonesStock = player:getCurrency("traverser_stones");
local StonesKI = getTravStonesTotal(player);
local MaxKI = getMaxTravStones(player);
local isCap = 0;
if (StonesKI >= MaxKI) then
isCap = 1;
end
if (player:getQuestStatus(ABYSSEA, A_JOURNEY_BEGINS) == QUEST_ACCEPTED) then
player:startEvent(0x0145);
elseif (player:getQuestStatus(ABYSSEA, THE_TRUTH_BECKONS) == QUEST_ACCEPTED and player:getVar("1stTimeAyssea") == 1) then
player:startEvent(0x0147,0,0,MaxKI); -- cs for "The Truth Beckons" completion
elseif (player:getQuestStatus(ABYSSEA, THE_TRUTH_BECKONS) ~= QUEST_COMPLETED) then
player:startEvent(0x0146); -- Pre "The Truth Beckons" Menu
elseif (player:getQuestStatus(ABYSSEA, DAWN_OF_DEATH) == QUEST_ACCEPTED) then
player:startEvent(0x0148,0,StonesStock,StonesKI,isCap,1,1,1,3); -- Post "The Truth Beckons" Menu
-- elseif
-- player:startEvent(0x014C);
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 == 0x0145) then
player:messageSpecial(KEYITEM_OBTAINED,TRAVERSER_STONE1);
player:addKeyItem(TRAVERSER_STONE1)
player:completeQuest(ABYSSEA, A_JOURNEY_BEGINS);
player:addQuest(ABYSSEA, THE_TRUTH_BECKONS);
elseif (csid == 0x0147) then
player:completeQuest(ABYSSEA, THE_TRUTH_BECKONS);
player:addQuest(ABYSSEA, DAWN_OF_DEATH);
player:setVar("1stTimeAyssea",0);
elseif (csid == 0x0148 and option == 6) then
local StonesKI = getTravStonesTotal(player);
if (StonesKI == 5) then
player:messageSpecial(KEYITEM_OBTAINED,TRAVERSER_STONE6);
player:addKeyItem(TRAVERSER_STONE6)
elseif (StonesKI == 4) then
player:messageSpecial(KEYITEM_OBTAINED,TRAVERSER_STONE5);
player:addKeyItem(TRAVERSER_STONE5)
elseif (StonesKI == 3) then
player:messageSpecial(KEYITEM_OBTAINED,TRAVERSER_STONE4)
player:addKeyItem(TRAVERSER_STONE4);
elseif (StonesKI == 2) then
player:messageSpecial(KEYITEM_OBTAINED,TRAVERSER_STONE3);
player:addKeyItem(TRAVERSER_STONE3)
elseif (StonesKI == 1) then
player:messageSpecial(KEYITEM_OBTAINED,TRAVERSER_STONE2);
player:addKeyItem(TRAVERSER_STONE2)
elseif (StonesKI == 0) then
player:messageSpecial(KEYITEM_OBTAINED,TRAVERSER_STONE1);
player:addKeyItem(TRAVERSER_STONE1)
end
end
end; | gpl-3.0 |
m241dan/darkstar | scripts/globals/items/dish_of_spaghetti_nero_di_seppia_+1.lua | 18 | 1800 | -----------------------------------------
-- ID: 5202
-- Item: Dish of Spaghetti Nero Di Seppia +1
-- Food Effect: 60 Mins, All Races
-----------------------------------------
-- HP % 17 (cap 140)
-- Dexterity 3
-- Vitality 2
-- Agility -1
-- Mind -2
-- Charisma -1
-- Double Attack 1
-- Store TP 6
-----------------------------------------
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,3600,5202);
end;
-----------------------------------------
-- onEffectGain Action
-----------------------------------------
function onEffectGain(target,effect)
target:addMod(MOD_FOOD_HPP, 17);
target:addMod(MOD_FOOD_HP_CAP, 140);
target:addMod(MOD_DEX, 3);
target:addMod(MOD_VIT, 2);
target:addMod(MOD_AGI, -1);
target:addMod(MOD_MND, -2);
target:addMod(MOD_CHR, -1);
target:addMod(MOD_DOUBLE_ATTACK, 1);
target:addMod(MOD_STORETP, 6);
end;
-----------------------------------------
-- onEffectLose Action
-----------------------------------------
function onEffectLose(target,effect)
target:delMod(MOD_FOOD_HPP, 17);
target:delMod(MOD_FOOD_HP_CAP, 140);
target:delMod(MOD_DEX, 3);
target:delMod(MOD_VIT, 2);
target:delMod(MOD_AGI, -1);
target:delMod(MOD_MND, -2);
target:delMod(MOD_CHR, -1);
target:delMod(MOD_DOUBLE_ATTACK, 1);
target:delMod(MOD_STORETP, 6);
end;
| gpl-3.0 |
Armyluix/darkstar | scripts/zones/Port_Bastok/npcs/Oggbi.lua | 17 | 3223 | -----------------------------------
-- Area: Port Bastok
-- NPC: Oggbi
-- Starts and Finishes: Ghosts of the Past, The First Meeting
-- @zone 236
-- @pos -159 -7 5
-----------------------------------
package.loaded["scripts/zones/Port_Bastok/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/settings");
require("scripts/globals/keyitems");
require("scripts/globals/quests");
require("scripts/zones/Port_Bastok/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
if (player:getQuestStatus(BASTOK,GHOSTS_OF_THE_PAST) == QUEST_ACCEPTED) then
if (trade:hasItemQty(13122,1) and trade:getItemCount() == 1) then -- Trade Miner's Pendant
player:startEvent(0x00e8); -- Finish Quest "Ghosts of the Past"
end
end
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
ghostsOfThePast = player:getQuestStatus(BASTOK,GHOSTS_OF_THE_PAST);
theFirstMeeting = player:getQuestStatus(BASTOK,THE_FIRST_MEETING);
mLvl = player:getMainLvl();
mJob = player:getMainJob();
if (ghostsOfThePast == QUEST_AVAILABLE and mJob == 2 and mLvl >= 40) then
player:startEvent(0x00e7); -- Start Quest "Ghosts of the Past"
elseif (ghostsOfThePast == QUEST_COMPLETED and player:needToZone() == false and theFirstMeeting == QUEST_AVAILABLE and mJob == 2 and mLvl >= 50) then
player:startEvent(0x00e9); -- Start Quest "The First Meeting"
elseif (player:hasKeyItem(LETTER_FROM_DALZAKK) and player:hasKeyItem(SANDORIAN_MARTIAL_ARTS_SCROLL)) then
player:startEvent(0x00ea); -- Finish Quest "The First Meeting"
else
player:startEvent(0x00e6); -- Standard Dialog
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 == 0x00e7) then
player:addQuest(BASTOK,GHOSTS_OF_THE_PAST);
elseif (csid == 0x00e8) then
if (player:getFreeSlotsCount() == 0) then
player:messageSpecial(ITEM_CANNOT_BE_OBTAINED,17478); -- Beat Cesti
else
player:tradeComplete();
player:addItem(17478);
player:messageSpecial(ITEM_OBTAINED,17478); -- Beat Cesti
player:needToZone(true);
player:addFame(BASTOK,AF1_FAME);
player:completeQuest(BASTOK,GHOSTS_OF_THE_PAST);
end
elseif (csid == 0x00e9) then
player:addQuest(BASTOK,THE_FIRST_MEETING);
elseif (csid == 0x00ea) then
if (player:getFreeSlotsCount() == 0) then
player:messageSpecial(ITEM_CANNOT_BE_OBTAINED,14090); -- Temple Gaiters
else
player:delKeyItem(LETTER_FROM_DALZAKK);
player:delKeyItem(SANDORIAN_MARTIAL_ARTS_SCROLL);
player:addItem(14090);
player:messageSpecial(ITEM_OBTAINED,14090); -- Temple Gaiters
player:addFame(BASTOK,AF2_FAME);
player:completeQuest(BASTOK,THE_FIRST_MEETING);
end
end
end; | gpl-3.0 |
ElectroDuk/QuackWars | garrysmod/gamemodes/Basewars/entities(maybe_outdated)/weapons/OldSweps/www_changed/weapon_galil2/shared.lua | 2 | 3096 | // this was rickster's ak47.
if ( SERVER ) then
AddCSLuaFile( "shared.lua" )
SWEP.HoldType = "ar2"
end
if ( CLIENT ) then
SWEP.PrintName = "Galil"
SWEP.Author = "HLTV Proxy"
SWEP.Slot = 3
SWEP.SlotPos = 4
SWEP.IconLetter = "v"
SWEP.ViewModelFlip = false
killicon.AddFont( "weapon_galil2", "CSKillIcons", SWEP.IconLetter, Color( 100, 100, 100, 255 ) )
end
SWEP.Base = "weapon_cs_base2"
SWEP.Spawnable = true
SWEP.AdminSpawnable = true
SWEP.ViewModel = "models/weapons/v_rif_galil.mdl"
SWEP.WorldModel = "models/weapons/w_rif_galil.mdl"
SWEP.Weight = 5
SWEP.AutoSwitchTo = false
SWEP.AutoSwitchFrom = false
SWEP.Primary.Sound = Sound( "Weapon_Galil.Single" )
SWEP.Primary.Recoil = .65
SWEP.Primary.Damage = 22.5
SWEP.Primary.NumShots = 1
SWEP.Primary.Cone = 0.004
SWEP.Primary.ClipSize = 20
SWEP.Primary.Delay = 0.095
SWEP.Primary.DefaultClip = 20
SWEP.Primary.Automatic = true
SWEP.Primary.Ammo = "smg1"
SWEP.Secondary.ClipSize = -1
SWEP.Secondary.DefaultClip = -1
SWEP.Secondary.Automatic = false
SWEP.Secondary.Ammo = "none"
SWEP.IronSightsPos = Vector( -5.15, -7, 2.425 )
SWEP.IronSightsAng = Vector( -1.25, 0, 0 )
// galil upgrade = lower recoil
function SWEP:Upgrade(bool)
self.Weapon:SetNWBool("upgraded",bool)
end
function SWEP:Reload()
if (self.Weapon:GetNWBool("upgraded") && self.Weapon:Clip1()<40) || (!self.Weapon:GetNWBool("upgraded") && self.Weapon:Clip1()<25) then
self.Weapon:DefaultReload( ACT_VM_RELOAD );
self:SetIronsights( false )
self.Owner:SetFOV(self.ViewModelFOV,.3)
end
end
function SWEP:PrimaryAttack()
self.Weapon:SetNextSecondaryFire( CurTime() + self.Primary.Delay )
if self.Owner:GetNWBool("doubletapped") then
self.Weapon:SetNextPrimaryFire( CurTime() + self.Primary.Delay*drugeffect_doubletapmod )
else
self.Weapon:SetNextPrimaryFire( CurTime() + self.Primary.Delay )
end
if ( !self:CanPrimaryAttack() ) then
return
end
// Play shoot sound
self.Weapon:EmitSound( self.Primary.Sound )
// Shoot the bullet
local rcone = self.Primary.Cone
if (self.Owner:GetNWBool("focused")) then
rcone = rcone*0.5
end
if(self:GetIronsights() == true) then
if (self.Weapon:GetNWBool("upgraded")) then
self:CSShootBullet( self.Primary.Damage, .55, self.Primary.NumShots, rcone )
else
self:CSShootBullet( self.Primary.Damage, self.Primary.Recoil, self.Primary.NumShots, rcone )
end
else
self:CSShootBullet( self.Primary.Damage, self.Primary.Recoil + 3, self.Primary.NumShots, rcone + .05 )
end
// Remove 1 bullet from our clip
self:TakePrimaryAmmo( 1 )
// Punch the player's view
self.Owner:ViewPunch( Angle( math.Rand(-0.2,-0.1) * self.Primary.Recoil, math.Rand(-0.1,0.1) *self.Primary.Recoil, 0 ) )
// In singleplayer this doesn't get called on the client, so we use a networked float
// to send the last shoot time. In multiplayer this is predicted clientside so we don't need to
// send the float.
if ( (SinglePlayer() && SERVER) || CLIENT ) then
self.Weapon:SetNetworkedFloat( "LastShootTime", CurTime() )
end
end | mit |
abriasffxi/darkstar | scripts/zones/Rabao/npcs/Scamplix.lua | 17 | 1532 | -----------------------------------
-- Area: Rabao
-- NPC: Scamplix
-- Standard Merchant NPC
-----------------------------------
require("scripts/globals/shop");
package.loaded["scripts/zones/Rabao/TextIDs"] = nil;
require("scripts/zones/Rabao/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
player:showText(npc,SCAMPLIX_SHOP_DIALOG);
stock = {0x119D,10, -- Distilled Waterr
0x1118,108, -- Meat Jerky
0x116A,270, -- Goblin Bread
0x0719,720, -- Cactus Arm
0x1020,4348, -- Ether
0x113C,292, -- Thundermelon
0x118B,180, -- Watermelon
0x1010,819, -- Potion
0x1034,284, -- Antidote
0x1043,1080, -- Blinding Potion
0x3410,4050, -- Mythril Earring
0x006B,180, -- Water Jug
0x0b34,9000} -- Rabao Waystone
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 |
abriasffxi/darkstar | scripts/globals/weaponskills/fast_blade.lua | 25 | 1373 | -----------------------------------
-- Fast Blade
-- Sword weapon skill
-- Skill Level: 5
-- Delivers a two-hit attack. Damage varies with TP.
-- Will stack with Sneak Attack.
-- Aligned with the Soil Gorget.
-- Aligned with the Soil Belt.
-- Element: None
-- Modifiers: STR:20% ; DEX:20%
-- 100%TP 200%TP 300%TP
-- 1.00 1.50 2.00
-----------------------------------
require("scripts/globals/status");
require("scripts/globals/settings");
require("scripts/globals/weaponskills");
-----------------------------------
function onUseWeaponSkill(player, target, wsID, tp, primary, action, taChar)
local params = {};
params.numHits = 2;
params.ftp100 = 1; params.ftp200 = 1.5; params.ftp300 = 2;
params.str_wsc = 0.2; params.dex_wsc = 0.2; params.vit_wsc = 0.0; params.agi_wsc = 0.0; params.int_wsc = 0.0; params.mnd_wsc = 0.0; params.chr_wsc = 0.0;
params.crit100 = 0.0; params.crit200 = 0.0; params.crit300 = 0.0;
params.canCrit = false;
params.acc100 = 0.0; params.acc200= 0.0; params.acc300= 0.0;
params.atkmulti = 1;
if (USE_ADOULIN_WEAPON_SKILL_CHANGES == true) then
params.str_wsc = 0.4; params.dex_wsc = 0.4;
end
local damage, criticalHit, tpHits, extraHits = doPhysicalWeaponskill(player, target, wsID, tp, primary, action, taChar, params);
return tpHits, extraHits, criticalHit, damage;
end
| gpl-3.0 |
Jai-Chaudhary/torch7 | torchcwrap.lua | 54 | 15111 | local wrap = require 'cwrap'
local types = wrap.types
types.Tensor = {
helpname = function(arg)
if arg.dim then
return string.format("Tensor~%dD", arg.dim)
else
return "Tensor"
end
end,
declare = function(arg)
local txt = {}
table.insert(txt, string.format("THTensor *arg%d = NULL;", arg.i))
if arg.returned then
table.insert(txt, string.format("int arg%d_idx = 0;", arg.i));
end
return table.concat(txt, '\n')
end,
check = function(arg, idx)
if arg.dim then
return string.format("(arg%d = luaT_toudata(L, %d, torch_Tensor)) && (arg%d->nDimension == %d)", arg.i, idx, arg.i, arg.dim)
else
return string.format("(arg%d = luaT_toudata(L, %d, torch_Tensor))", arg.i, idx)
end
end,
read = function(arg, idx)
if arg.returned then
return string.format("arg%d_idx = %d;", arg.i, idx)
end
end,
init = function(arg)
if type(arg.default) == 'boolean' then
return string.format('arg%d = THTensor_(new)();', arg.i)
elseif type(arg.default) == 'number' then
return string.format('arg%d = %s;', arg.i, arg.args[arg.default]:carg())
else
error('unknown default tensor type value')
end
end,
carg = function(arg)
return string.format('arg%d', arg.i)
end,
creturn = function(arg)
return string.format('arg%d', arg.i)
end,
precall = function(arg)
local txt = {}
if arg.default and arg.returned then
table.insert(txt, string.format('if(arg%d_idx)', arg.i)) -- means it was passed as arg
table.insert(txt, string.format('lua_pushvalue(L, arg%d_idx);', arg.i))
table.insert(txt, string.format('else'))
if type(arg.default) == 'boolean' then -- boolean: we did a new()
table.insert(txt, string.format('luaT_pushudata(L, arg%d, torch_Tensor);', arg.i))
else -- otherwise: point on default tensor --> retain
table.insert(txt, string.format('{'))
table.insert(txt, string.format('THTensor_(retain)(arg%d);', arg.i)) -- so we need a retain
table.insert(txt, string.format('luaT_pushudata(L, arg%d, torch_Tensor);', arg.i))
table.insert(txt, string.format('}'))
end
elseif arg.default then
-- we would have to deallocate the beast later if we did a new
-- unlikely anyways, so i do not support it for now
if type(arg.default) == 'boolean' then
error('a tensor cannot be optional if not returned')
end
elseif arg.returned then
table.insert(txt, string.format('lua_pushvalue(L, arg%d_idx);', arg.i))
end
return table.concat(txt, '\n')
end,
postcall = function(arg)
local txt = {}
if arg.creturned then
-- this next line is actually debatable
table.insert(txt, string.format('THTensor_(retain)(arg%d);', arg.i))
table.insert(txt, string.format('luaT_pushudata(L, arg%d, torch_Tensor);', arg.i))
end
return table.concat(txt, '\n')
end
}
types.Generator = {
helpname = function(arg)
return "Generator"
end,
declare = function(arg)
return string.format("THGenerator *arg%d = NULL;", arg.i)
end,
check = function(arg, idx)
return string.format("(arg%d = luaT_toudata(L, %d, torch_Generator))", arg.i, idx)
end,
read = function(arg, idx)
end,
init = function(arg)
local text = {}
-- If no generator is supplied, pull the default out of the torch namespace.
table.insert(text, 'lua_getglobal(L,"torch");')
table.insert(text, string.format('arg%d = luaT_getfieldcheckudata(L, -1, "_gen", torch_Generator);', arg.i))
table.insert(text, 'lua_pop(L, 2);')
return table.concat(text, '\n')
end,
carg = function(arg)
return string.format('arg%d', arg.i)
end,
creturn = function(arg)
return string.format('arg%d', arg.i)
end,
precall = function(arg)
end,
postcall = function(arg)
end
}
types.IndexTensor = {
helpname = function(arg)
return "LongTensor"
end,
declare = function(arg)
local txt = {}
table.insert(txt, string.format("THLongTensor *arg%d = NULL;", arg.i))
if arg.returned then
table.insert(txt, string.format("int arg%d_idx = 0;", arg.i));
end
return table.concat(txt, '\n')
end,
check = function(arg, idx)
return string.format('(arg%d = luaT_toudata(L, %d, "torch.LongTensor"))', arg.i, idx)
end,
read = function(arg, idx)
local txt = {}
if not arg.noreadadd then
table.insert(txt, string.format("THLongTensor_add(arg%d, arg%d, -1);", arg.i, arg.i));
end
if arg.returned then
table.insert(txt, string.format("arg%d_idx = %d;", arg.i, idx))
end
return table.concat(txt, '\n')
end,
init = function(arg)
return string.format('arg%d = THLongTensor_new();', arg.i)
end,
carg = function(arg)
return string.format('arg%d', arg.i)
end,
creturn = function(arg)
return string.format('arg%d', arg.i)
end,
precall = function(arg)
local txt = {}
if arg.default and arg.returned then
table.insert(txt, string.format('if(arg%d_idx)', arg.i)) -- means it was passed as arg
table.insert(txt, string.format('lua_pushvalue(L, arg%d_idx);', arg.i))
table.insert(txt, string.format('else')) -- means we did a new()
table.insert(txt, string.format('luaT_pushudata(L, arg%d, "torch.LongTensor");', arg.i))
elseif arg.default then
error('a tensor cannot be optional if not returned')
elseif arg.returned then
table.insert(txt, string.format('lua_pushvalue(L, arg%d_idx);', arg.i))
end
return table.concat(txt, '\n')
end,
postcall = function(arg)
local txt = {}
if arg.creturned or arg.returned then
table.insert(txt, string.format("THLongTensor_add(arg%d, arg%d, 1);", arg.i, arg.i));
end
if arg.creturned then
-- this next line is actually debatable
table.insert(txt, string.format('THLongTensor_retain(arg%d);', arg.i))
table.insert(txt, string.format('luaT_pushudata(L, arg%d, "torch.LongTensor");', arg.i))
end
return table.concat(txt, '\n')
end
}
for _,typename in ipairs({"ByteTensor", "CharTensor", "ShortTensor", "IntTensor", "LongTensor",
"FloatTensor", "DoubleTensor"}) do
types[typename] = {
helpname = function(arg)
if arg.dim then
return string.format('%s~%dD', typename, arg.dim)
else
return typename
end
end,
declare = function(arg)
local txt = {}
table.insert(txt, string.format("TH%s *arg%d = NULL;", typename, arg.i))
if arg.returned then
table.insert(txt, string.format("int arg%d_idx = 0;", arg.i));
end
return table.concat(txt, '\n')
end,
check = function(arg, idx)
if arg.dim then
return string.format('(arg%d = luaT_toudata(L, %d, "torch.%s")) && (arg%d->nDimension == %d)', arg.i, idx, typename, arg.i, arg.dim)
else
return string.format('(arg%d = luaT_toudata(L, %d, "torch.%s"))', arg.i, idx, typename)
end
end,
read = function(arg, idx)
if arg.returned then
return string.format("arg%d_idx = %d;", arg.i, idx)
end
end,
init = function(arg)
if type(arg.default) == 'boolean' then
return string.format('arg%d = TH%s_new();', arg.i, typename)
elseif type(arg.default) == 'number' then
return string.format('arg%d = %s;', arg.i, arg.args[arg.default]:carg())
else
error('unknown default tensor type value')
end
end,
carg = function(arg)
return string.format('arg%d', arg.i)
end,
creturn = function(arg)
return string.format('arg%d', arg.i)
end,
precall = function(arg)
local txt = {}
if arg.default and arg.returned then
table.insert(txt, string.format('if(arg%d_idx)', arg.i)) -- means it was passed as arg
table.insert(txt, string.format('lua_pushvalue(L, arg%d_idx);', arg.i))
table.insert(txt, string.format('else'))
if type(arg.default) == 'boolean' then -- boolean: we did a new()
table.insert(txt, string.format('luaT_pushudata(L, arg%d, "torch.%s");', arg.i, typename))
else -- otherwise: point on default tensor --> retain
table.insert(txt, string.format('{'))
table.insert(txt, string.format('TH%s_retain(arg%d);', typename, arg.i)) -- so we need a retain
table.insert(txt, string.format('luaT_pushudata(L, arg%d, "torch.%s");', arg.i, typename))
table.insert(txt, string.format('}'))
end
elseif arg.default then
-- we would have to deallocate the beast later if we did a new
-- unlikely anyways, so i do not support it for now
if type(arg.default) == 'boolean' then
error('a tensor cannot be optional if not returned')
end
elseif arg.returned then
table.insert(txt, string.format('lua_pushvalue(L, arg%d_idx);', arg.i))
end
return table.concat(txt, '\n')
end,
postcall = function(arg)
local txt = {}
if arg.creturned then
-- this next line is actually debatable
table.insert(txt, string.format('TH%s_retain(arg%d);', typename, arg.i))
table.insert(txt, string.format('luaT_pushudata(L, arg%d, "torch.%s");', arg.i, typename))
end
return table.concat(txt, '\n')
end
}
end
types.LongArg = {
vararg = true,
helpname = function(arg)
return "(LongStorage | dim1 [dim2...])"
end,
declare = function(arg)
return string.format("THLongStorage *arg%d = NULL;", arg.i)
end,
init = function(arg)
if arg.default then
error('LongArg cannot have a default value')
end
end,
check = function(arg, idx)
return string.format("torch_islongargs(L, %d)", idx)
end,
read = function(arg, idx)
return string.format("arg%d = torch_checklongargs(L, %d);", arg.i, idx)
end,
carg = function(arg, idx)
return string.format('arg%d', arg.i)
end,
creturn = function(arg, idx)
return string.format('arg%d', arg.i)
end,
precall = function(arg)
local txt = {}
if arg.returned then
table.insert(txt, string.format('luaT_pushudata(L, arg%d, "torch.LongStorage");', arg.i))
end
return table.concat(txt, '\n')
end,
postcall = function(arg)
local txt = {}
if arg.creturned then
-- this next line is actually debatable
table.insert(txt, string.format('THLongStorage_retain(arg%d);', arg.i))
table.insert(txt, string.format('luaT_pushudata(L, arg%d, "torch.LongStorage");', arg.i))
end
if not arg.returned and not arg.creturned then
table.insert(txt, string.format('THLongStorage_free(arg%d);', arg.i))
end
return table.concat(txt, '\n')
end
}
types.charoption = {
helpname = function(arg)
if arg.values then
return "(" .. table.concat(arg.values, '|') .. ")"
end
end,
declare = function(arg)
local txt = {}
table.insert(txt, string.format("const char *arg%d = NULL;", arg.i))
if arg.default then
table.insert(txt, string.format("char arg%d_default = '%s';", arg.i, arg.default))
end
return table.concat(txt, '\n')
end,
init = function(arg)
return string.format("arg%d = &arg%d_default;", arg.i, arg.i)
end,
check = function(arg, idx)
local txt = {}
local txtv = {}
table.insert(txt, string.format('(arg%d = lua_tostring(L, %d)) && (', arg.i, idx))
for _,value in ipairs(arg.values) do
table.insert(txtv, string.format("*arg%d == '%s'", arg.i, value))
end
table.insert(txt, table.concat(txtv, ' || '))
table.insert(txt, ')')
return table.concat(txt, '')
end,
read = function(arg, idx)
end,
carg = function(arg, idx)
return string.format('arg%d', arg.i)
end,
creturn = function(arg, idx)
end,
precall = function(arg)
end,
postcall = function(arg)
end
}
| bsd-3-clause |
ElectroDuk/QuackWars | garrysmod/gamemodes/Basewars/entities(maybe_outdated)/weapons/spiderman_swep/shared.lua | 2 | 5110 | SWEP.Author = "GigaJew and Paranoid*"
SWEP.Contact = "jaack_harrison@hotmail.co.uk"
SWEP.Purpose = "Go spidey all over the map lulz"
SWEP.Instructions = "Left click to throw web"
SWEP.Spawnable = false
SWEP.AdminSpawnable = true
SWEP.PrintName = "SpiderSwep"
SWEP.Slot = 2
SWEP.SlotPos = 0
SWEP.DrawAmmo = false
SWEP.DrawCrosshair = true
SWEP.ViewModel = "models/weapons/v_pistol.mdl"
SWEP.WorldModel = "models/weapons/w_pistol.mdl"
local sndPowerUp = Sound("Landing1.wav")
local sndPowerDown = Sound("StandingFire2.wav")
local sndTooFar = Sound("Whoosh2.wav")
//local sndShot = Sound("WebFire3.wav")
function SWEP:Initialize()
nextshottime = CurTime()
self:SetWeaponHoldType( "smg" )
end
function SWEP:Think()
if (!self.Owner || self.Owner == NULL) then return end
if ( self.Owner:KeyPressed( IN_ATTACK ) ) then
self:StartAttack()
elseif ( self.Owner:KeyDown( IN_ATTACK ) && inRange ) then
self:UpdateAttack()
elseif ( self.Owner:KeyReleased( IN_ATTACK ) && inRange ) then
self:EndAttack( true )
end
//Changed from KeyDown to prevent random stuck-in-zoom bug.
if ( self.Owner:KeyPressed( IN_ATTACK2 ) ) then
self:Attack2()
end
end
function SWEP:DoTrace( endpos )
local trace = {}
trace.start = self.Owner:GetShootPos()
trace.endpos = trace.start + (self.Owner:GetAimVector() * 14096) //14096 is length modifier.
if(endpos) then trace.endpos = (endpos - self.Tr.HitNormal * 7) end
trace.filter = { self.Owner, self.Weapon }
self.Tr = nil
self.Tr = util.TraceLine( trace )
end
function SWEP:StartAttack()
self.Weapon:SendWeaponAnim(ACT_VM_PRIMARYATTACK) --plays the shoot animation.
//Get begining and end poins of trace.
local gunPos = self.Owner:GetShootPos() //Start of distance trace.
local disTrace = self.Owner:GetEyeTrace() //Store all results of a trace in disTrace.
local hitPos = disTrace.HitPos //Stores Hit Position of disTrace.
//Calculate Distance
//Thanks to rgovostes for this code.
local x = (gunPos.x - hitPos.x)^2;
local y = (gunPos.y - hitPos.y)^2;
local z = (gunPos.z - hitPos.z)^2;
local distance = math.sqrt(x + y + z);
self.Weapon:SendWeaponAnim(ACT_VM_HAULBACK) --plays the grab animation
//Only latches if distance is less than distance CVAR
local distanceCvar = GetConVarNumber("grapple_distance")
inRange = false
if distance <= distanceCvar then
inRange = true
end
if inRange then
if (SERVER) then
if (!self.Beam) then //If the beam does not exist, draw the beam.
//grapple_beam
self.Beam = ents.Create( "trace1" )
self.Beam:SetPos( self.Owner:GetShootPos() )
self.Beam:Spawn()
end
self.Beam:SetParent( self.Owner )
self.Beam:SetOwner( self.Owner )
end
self:DoTrace()
self.speed = 10000 //Rope latch speed. Was 3000.
self.startTime = CurTime()
self.endTime = CurTime() + self.speed
self.dt = -1
if (SERVER && self.Beam) then
self.Beam:GetTable():SetEndPos( self.Tr.HitPos )
end
self:UpdateAttack()
self.Weapon:EmitSound( sndPowerDown )
else
//Play A Sound
self.Weapon:EmitSound( sndTooFar )
end
end
function SWEP:UpdateAttack()
self.Owner:LagCompensation( true )
if (!endpos) then endpos = self.Tr.HitPos end
if (SERVER && self.Beam) then
self.Beam:GetTable():SetEndPos( endpos )
end
lastpos = endpos
if ( self.Tr.Entity:IsValid() ) then
endpos = self.Tr.Entity:GetPos()
if ( SERVER ) then
self.Beam:GetTable():SetEndPos( endpos )
end
end
local vVel = (endpos - self.Owner:GetPos())
local Distance = endpos:Distance(self.Owner:GetPos())
local et = (self.startTime + (Distance/self.speed))
if(self.dt != 0) then
self.dt = (et - CurTime()) / (et - self.startTime)
end
if(self.dt < 0) then
self.Weapon:EmitSound( sndPowerUp )
self.dt = 0
end
if(self.dt == 0) then
zVel = self.Owner:GetVelocity().z
vVel = vVel:GetNormalized()*(math.Clamp(Distance,0,7))
if( SERVER ) then
local gravity = GetConVarNumber("sv_Gravity")
vVel:Add(Vector(0,0,(gravity/100)*1.5)) //Player speed. DO NOT MESS WITH THIS VALUE!
if(zVel < 0) then
vVel:Sub(Vector(0,0,zVel/100))
end
self.Owner:SetVelocity(vVel)
end
end
endpos = nil
self.Owner:LagCompensation( false )
end
function SWEP:EndAttack( shutdownsound )
if ( CLIENT ) then return end
if ( !self.Beam ) then return end
self.Beam:Remove()
self.Beam = nil
self.Weapon:SendWeaponAnim(ACT_VM_IDLE_LOWERED) --plays the hold animation
end
function SWEP:Attack2() //Zoom.
// self.Weapon:EmitSound( self.Secondary.Sound, 50, 100 )
if (CLIENT) then return end
local CF = self.Owner:GetFOV()
if CF == 90 then
self.Owner:SetFOV(30,.3)
elseif CF == 30 then
self.Owner:SetFOV(90,.3)
// self.Scope = true
// elseif CF == 0 then
// self.Owner:SetFOV(90,.3)
end
end
function SWEP:Holster()
self:EndAttack( false )
return true
end
function SWEP:OnRemove()
self:EndAttack( false )
return true
end
function SWEP:PrimaryAttack()
end
function SWEP:SecondaryAttack()
end | mit |
abriasffxi/darkstar | scripts/globals/items/yellow_curry_bun_+1.lua | 17 | 1994 | -----------------------------------------
-- ID: 5763
-- Item: yellow_curry_bun_+1
-- Food Effect: 30minutes, All Races
-----------------------------------------
-- Health Points 30
-- Strength 5
-- Agility 2
-- Vitality 2
-- Intelligence -2
-- Attack 23% (caps @ 80)
-- Ranged Attack 23% (caps @ 80)
-- Resist Sleep
-- Resist Stun
-----------------------------------------
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,5763);
end;
-----------------------------------------
-- onEffectGain Action
-----------------------------------------
function onEffectGain(target,effect)
target:addMod(MOD_HP, 30);
target:addMod(MOD_STR, 5);
target:addMod(MOD_AGI, 2);
target:addMod(MOD_VIT, 2);
target:addMod(MOD_INT, -2);
target:addMod(MOD_FOOD_ATTP, 23);
target:addMod(MOD_FOOD_ATT_CAP, 80);
target:addMod(MOD_FOOD_RATTP, 23);
target:addMod(MOD_FOOD_RATT_CAP, 80);
target:addMod(MOD_SLEEPRES, 5);
target:addMod(MOD_STUNRES, 5);
end;
-----------------------------------------
-- onEffectLose Action
-----------------------------------------
function onEffectLose(target,effect)
target:delMod(MOD_HP, 30);
target:delMod(MOD_STR, 5);
target:delMod(MOD_AGI, 2);
target:delMod(MOD_VIT, 2);
target:delMod(MOD_INT, -2);
target:delMod(MOD_FOOD_ATTP, 23);
target:delMod(MOD_FOOD_ATT_CAP, 80);
target:delMod(MOD_FOOD_RATTP, 23);
target:delMod(MOD_FOOD_RATT_CAP, 80);
target:delMod(MOD_SLEEPRES, 5);
target:delMod(MOD_STUNRES, 5);
end;
| gpl-3.0 |
ifreedom/lgob | examples/Printing.lua | 1 | 2503 | #! /usr/bin/env lua
-- Printing example.
require("lgob.gtk")
require("lgob.cairo")
require("lgob.pango")
require("lgob.pangocairo")
-- Create the widgets
local window = gtk.Window.new()
local button = gtk.Button.new_with_mnemonic("Print test")
function beginPrint(ud, context)
local operation, data = unpack(ud)
local width, height = context:get_size()
-- Read the file
file = io.open(data.fileName)
data.lineCount = 0
data.text = {}
-- Read the file and get the line count
while true do
local line = file:read("*line")
if not line then break end
data.lineCount = data.lineCount + 1
data.text[data.lineCount] = line
end
-- Calculate the number of pages
data.fontHeight = data.fontSize / 2
data.linesPerPage = math.floor(height / data.fontHeight)
data.pageCount = math.ceil(data.lineCount / data.linesPerPage)
operation:set("n-pages", data.pageCount)
end
function drawPage(ud, context, page)
local operation, data = unpack(ud)
local cr = context:get_cairo_context()
local width, height = context:get_size()
local layout = context:create_pango_layout()
local desc = pango.FontDescription.from_string("mono " .. data.fontSize)
layout:set_font_description(desc)
-- Draw!
cr:move_to(0, 0)
cr:set_source_rgb(0, 0, 1)
local line = ((data.linesPerPage + 1) * page) + 1
for i = 0, data.linesPerPage do
if line > data.lineCount then break end
layout:set_text(data.text[line], -1)
pangocairo.show_layout(cr, layout)
cr:rel_move_to(0, data.fontHeight)
line = line + 1
end
end
function printTest()
local op = gtk.PrintOperation.new()
op:set("unit", gtk.UNIT_MM)
-- Set print settings
local ps = gtk.PrintSettings.new()
-- Page Setup
local st = gtk.PageSetup.new()
local st2 = gtk.print_run_page_setup_dialog(window, st, ps)
op:set("default-page-setup", st2, "print-settings", ps)
-- Some info for the printing
data = {
fileName = "Printing.lua",
fontSize = 10
}
-- Add example widget
op:set("custom-tab-label", "My custom tab")
op:connect("create-custom-widget",
function()
local label = gtk.Label.new("Hello world!")
label:show()
return label
end
)
op:connect("draw-page", drawPage, {op, data})
op:connect("begin-print", beginPrint, {op, data})
op:run(gtk.PRINT_OPERATION_ACTION_PRINT_DIALOG, window)
end
window:add(button)
window:set("title", "Print test", "window-position", gtk.WIN_POS_CENTER)
window:connect("delete-event", gtk.main_quit)
button:connect("clicked", printTest)
window:show_all()
gtk.main()
| lgpl-3.0 |
Armyluix/darkstar | scripts/globals/effects/fan_dance.lua | 18 | 1201 | -----------------------------------
--
-- EFFECT_FAN_DANCE
--
-----------------------------------
require("scripts/globals/settings");
require("scripts/globals/status");
-----------------------------------
-- onEffectGain Action
-----------------------------------
function onEffectGain(target,effect)
local fanDanceMerits = target:getMerit(MERIT_FAN_DANCE);
if (fanDanceMerits >5) then
target:addMod(MOD_WALTZ_RECAST, (fanDanceMerits-5));
end
target:delStatusEffect(EFFECT_HASTE_SAMBA);
target:delStatusEffect(EFFECT_ASPIR_SAMBA);
target:delStatusEffect(EFFECT_DRAIN_SAMBA);
target:delStatusEffect(EFFECT_SABER_DANCE);
target:addMod(MOD_ENMITY, 15);
end;
-----------------------------------
-- onEffectTick Action
-----------------------------------
function onEffectTick(target,effect)
end;
-----------------------------------
-- onEffectLose Action
-----------------------------------
function onEffectLose(target,effect)
local fanDanceMerits = target:getMerit(MERIT_FAN_DANCE);
if (fanDanceMerits >5) then
target:delMod(MOD_WALTZ_RECAST, (fanDanceMerits-5));
end
target:delMod(MOD_ENMITY, 15);
end; | gpl-3.0 |
dios-game/dios-cocos | src/oslibs/cocos/cocos-src/tests/lua-tests/src/PerformanceTest/PerformanceSpriteTest.lua | 14 | 16145 | local kMaxNodes = 50000
local kBasicZOrder = 10
local kNodesIncrease = 250
local TEST_COUNT = 7
local s = cc.Director:getInstance():getWinSize()
-----------------------------------
-- For test functions
-----------------------------------
local function performanceActions(sprite)
sprite:setPosition(cc.p(math.mod(math.random(1, 99999999), s.width), math.mod(math.random(1, 99999999), s.height)))
local period = 0.5 + math.mod(math.random(1, 99999999), 1000) / 500.0
local rot = cc.RotateBy:create(period, 360.0 * math.random())
local rot = cc.RotateBy:create(period, 360.0 * math.random())
local permanentRotation = cc.RepeatForever:create(cc.Sequence:createWithTwoActions(rot, rot:reverse()))
sprite:runAction(permanentRotation)
local growDuration = 0.5 + math.mod(math.random(1, 99999999), 1000) / 500.0
local grow = cc.ScaleBy:create(growDuration, 0.5, 0.5)
local permanentScaleLoop = cc.RepeatForever:create(cc.Sequence:createWithTwoActions(grow, grow:reverse()))
sprite:runAction(permanentScaleLoop)
end
local function performanceActions20(sprite)
if math.random() < 0.2 then
sprite:setPosition(cc.p(math.mod(math.random(1, 99999999), s.width), math.mod(math.random(1, 99999999), s.height)))
else
sprite:setPosition(cc.p(-1000, -1000))
end
local period = 0.5 + math.mod(math.random(1, 99999999), 1000) / 500.0
local rot = cc.RotateBy:create(period, 360.0 * math.random())
local permanentRotation = cc.RepeatForever:create(cc.Sequence:createWithTwoActions(rot, rot:reverse()))
sprite:runAction(permanentRotation)
local growDuration = 0.5 + math.mod(math.random(1, 99999999), 1000) / 500.0
local grow = cc.ScaleBy:create(growDuration, 0.5, 0.5)
local permanentScaleLoop = cc.RepeatForever:create(cc.Sequence:createWithTwoActions(grow, grow:reverse()))
sprite:runAction(permanentScaleLoop)
end
local function performanceRotationScale(sprite)
sprite:setPosition(cc.p(math.mod(math.random(1, 99999999), s.width), math.mod(math.random(1, 99999999), s.height)))
sprite:setRotation(math.random() * 360)
sprite:setScale(math.random() * 2)
end
local function performancePosition(sprite)
sprite:setPosition(cc.p(math.mod(math.random(1, 99999999), s.width), math.mod(math.random(1, 99999999), s.height)))
end
local function performanceout20(sprite)
if math.random() < 0.2 then
sprite:setPosition(cc.p(math.mod(math.random(1, 99999999), s.width), math.mod(math.random(1, 99999999), s.height)))
else
sprite:setPosition(cc.p(-1000, -1000))
end
end
local function performanceOut100(sprite)
sprite:setPosition(cc.p( -1000, -1000))
end
local function performanceScale(sprite)
sprite:setPosition(cc.p(math.mod(math.random(1, 99999999), s.width), math.mod(math.random(1, 99999999), s.height)))
sprite:setScale(math.random() * 100 / 50)
end
-----------------------------------
-- Subtest
-----------------------------------
local subtestNumber = 1
local batchNode = nil -- cc.SpriteBatchNode
local parent = nil -- cc.Node
local function initWithSubTest(nSubTest, p)
subtestNumber = nSubTest
parent = p
batchNode = nil
local mgr = cc.Director:getInstance():getTextureCache()
-- remove all texture
mgr:removeTexture(mgr:addImage("Images/grossinis_sister1.png"))
mgr:removeTexture(mgr:addImage("Images/grossini_dance_atlas.png"))
mgr:removeTexture(mgr:addImage("Images/spritesheet1.png"))
if subtestNumber == 2 then
cc.Texture2D:setDefaultAlphaPixelFormat(cc.TEXTURE2_D_PIXEL_FORMAT_RGB_A8888)
batchNode = cc.SpriteBatchNode:create("Images/grossinis_sister1.png", 100)
p:addChild(batchNode, 0)
elseif subtestNumber == 3 then
cc.Texture2D:setDefaultAlphaPixelFormat(cc.TEXTURE2_D_PIXEL_FORMAT_RGB_A4444)
batchNode = cc.SpriteBatchNode:create("Images/grossinis_sister1.png", 100)
p:addChild(batchNode, 0)
elseif subtestNumber == 5 then
cc.Texture2D:setDefaultAlphaPixelFormat(cc.TEXTURE2_D_PIXEL_FORMAT_RGB_A8888)
batchNode = cc.SpriteBatchNode:create("Images/grossini_dance_atlas.png", 100)
p:addChild(batchNode, 0)
elseif subtestNumber == 6 then
cc.Texture2D:setDefaultAlphaPixelFormat(cc.TEXTURE2_D_PIXEL_FORMAT_RGB_A4444)
batchNode = cc.SpriteBatchNode:create("Images/grossini_dance_atlas.png", 100)
p:addChild(batchNode, 0)
elseif subtestNumber == 8 then
cc.Texture2D:setDefaultAlphaPixelFormat(cc.TEXTURE2_D_PIXEL_FORMAT_RGB_A8888)
batchNode = cc.SpriteBatchNode:create("Images/spritesheet1.png", 100)
p:addChild(batchNode, 0)
elseif subtestNumber == 9 then
cc.Texture2D:setDefaultAlphaPixelFormat(cc.TEXTURE2_D_PIXEL_FORMAT_RGB_A4444)
batchNode = cc.SpriteBatchNode:create("Images/spritesheet1.png", 100)
p:addChild(batchNode, 0)
end
-- todo
if batchNode ~= nil then
batchNode:retain()
end
cc.Texture2D:setDefaultAlphaPixelFormat(cc.TEXTURE_PIXELFORMAT_DEFAULT)
end
local function createSpriteWithTag(tag)
cc.Texture2D:setDefaultAlphaPixelFormat(cc.TEXTURE2_D_PIXEL_FORMAT_RGB_A8888)
local sprite = nil
if subtestNumber == 1 then
sprite = cc.Sprite:create("Images/grossinis_sister1.png")
parent:addChild(sprite, -1, tag + 100)
elseif subtestNumber == 2 then
sprite = cc.Sprite:createWithTexture(batchNode:getTexture(), cc.rect(0, 0, 52, 139))
batchNode:addChild(sprite, 0, tag + 100)
elseif subtestNumber == 3 then
sprite = cc.Sprite:createWithTexture(batchNode:getTexture(), cc.rect(0, 0, 52, 139))
batchNode:addChild(sprite, 0, tag + 100)
elseif subtestNumber == 4 then
local idx = math.floor((math.random() * 1400 / 100)) + 1
local num
if idx < 10 then
num = "0" .. idx
else
num = idx
end
local str = "Images/grossini_dance_" .. num .. ".png"
sprite = cc.Sprite:create(str)
parent:addChild(sprite, -1, tag + 100)
elseif subtestNumber == 5 then
local y, x
local r = math.floor(math.random() * 1400 / 100)
y = math.floor(r / 5)
x = math.mod(r, 5)
x = x * 85
y = y * 121
sprite = cc.Sprite:createWithTexture(batchNode:getTexture(), cc.rect(x, y, 85, 121))
batchNode:addChild(sprite, 0, tag + 100)
elseif subtestNumber == 6 then
local y, x
local r = math.floor(math.random() * 1400 / 100)
y = math.floor(r / 5)
x = math.mod(r, 5)
x = x * 85
y = y * 121
sprite = cc.Sprite:createWithTexture(batchNode:getTexture(), cc.rect(x, y, 85, 121))
batchNode:addChild(sprite, 0, tag + 100)
elseif subtestNumber == 7 then
local y, x
local r = math.floor(math.random() * 6400 / 100)
y = math.floor(r / 8)
x = math.mod(r, 8)
local str = "Images/sprites_test/sprite-"..x.."-"..y..".png"
sprite = cc.Sprite:create(str)
parent:addChild(sprite, -1, tag + 100)
elseif subtestNumber == 8 then
local y, x
local r = math.floor(math.random() * 6400 / 100)
y = math.floor(r / 8)
x = math.mod(r, 8)
x = x * 32
y = y * 32
sprite = cc.Sprite:createWithTexture(batchNode:getTexture(), cc.rect(x, y, 32, 32))
batchNode:addChild(sprite, 0, tag + 100)
elseif subtestNumber == 9 then
local y, x
local r = math.floor(math.random() * 6400 / 100)
y = math.floor(r / 8)
x = math.mod(r, 8)
x = x * 32
y = y * 32
sprite = cc.Sprite:createWithTexture(batchNode:getTexture(), cc.rect(x, y, 32, 32))
batchNode:addChild(sprite, 0, tag + 100)
end
cc.Texture2D:setDefaultAlphaPixelFormat(cc.TEXTURE_PIXELFORMAT_DEFAULT)
return sprite
end
local function removeByTag(tag)
if subtestNumber == 1 then
parent:removeChildByTag(tag + 100, true)
elseif subtestNumber == 4 then
parent:removeChildByTag(tag + 100, true)
elseif subtestNumber == 7 then
parent:removeChildByTag(tag + 100, true)
else
batchNode:removeChildAtIndex(tag, true)
end
end
-----------------------------------
-- PerformBasicLayer
-----------------------------------
local curCase = 0
local maxCases = 7
local function showThisTest()
local scene = CreateSpriteTestScene()
cc.Director:getInstance():replaceScene(scene)
end
local function backCallback(sender)
subtestNumber = 1
curCase = curCase - 1
if curCase < 0 then
curCase = curCase + maxCases
end
showThisTest()
end
local function restartCallback(sender)
subtestNumber = 1
showThisTest()
end
local function nextCallback(sender)
subtestNumber = 1
curCase = curCase + 1
curCase = math.mod(curCase, maxCases)
showThisTest()
end
local function toPerformanceMainLayer(sender)
cc.Director:getInstance():replaceScene(PerformanceTest())
end
local function initWithLayer(layer, controlMenuVisible)
cc.MenuItemFont:setFontName("Arial")
cc.MenuItemFont:setFontSize(24)
local mainItem = cc.MenuItemFont:create("Back")
mainItem:registerScriptTapHandler(toPerformanceMainLayer)
mainItem:setPosition(s.width - 50, 25)
local menu = cc.Menu:create()
menu:addChild(mainItem)
menu:setPosition(cc.p(0, 0))
if controlMenuVisible == true then
local item1 = cc.MenuItemImage:create(s_pPathB1, s_pPathB2)
local item2 = cc.MenuItemImage:create(s_pPathR1, s_pPathR2)
local item3 = cc.MenuItemImage:create(s_pPathF1, s_pPathF2)
item1:registerScriptTapHandler(backCallback)
item2:registerScriptTapHandler(restartCallback)
item3:registerScriptTapHandler(nextCallback)
item1:setPosition(s.width / 2 - 100, 30)
item2:setPosition(s.width / 2, 30)
item3:setPosition(s.width / 2 + 100, 30)
menu:addChild(item1, kItemTagBasic)
menu:addChild(item2, kItemTagBasic)
menu:addChild(item3, kItemTagBasic)
end
layer:addChild(menu)
end
-----------------------------------
-- SpriteMainScene
-----------------------------------
local lastRenderedCount = nil
local quantityNodes = nil
local infoLabel = nil
local titleLabel = nil
local function testNCallback(tag)
subtestNumber = tag - kBasicZOrder
showThisTest()
end
local function updateNodes()
if quantityNodes ~= lastRenderedCount then
local str = quantityNodes .. " nodes"
infoLabel:setString(str)
lastRenderedCount = quantityNodes
end
end
local function onDecrease(sender)
if quantityNodes <= 0 then
return
end
for i = 0, kNodesIncrease - 1 do
quantityNodes = quantityNodes - 1
removeByTag(quantityNodes)
end
updateNodes()
end
local function onIncrease(sender)
if quantityNodes >= kMaxNodes then
return
end
for i = 0, kNodesIncrease - 1 do
local sprite = createSpriteWithTag(quantityNodes)
if curCase == 0 then
doPerformSpriteTest1(sprite)
elseif curCase == 1 then
doPerformSpriteTest2(sprite)
elseif curCase == 2 then
doPerformSpriteTest3(sprite)
elseif curCase == 3 then
doPerformSpriteTest4(sprite)
elseif curCase == 4 then
doPerformSpriteTest5(sprite)
elseif curCase == 5 then
doPerformSpriteTest6(sprite)
elseif curCase == 6 then
doPerformSpriteTest7(sprite)
end
quantityNodes = quantityNodes + 1
end
updateNodes()
end
local function initWithMainTest(scene, asubtest, nNodes)
subtestNumber = asubtest
initWithSubTest(asubtest, scene)
lastRenderedCount = 0
quantityNodes = 0
cc.MenuItemFont:setFontSize(65)
local decrease = cc.MenuItemFont:create(" - ")
decrease:registerScriptTapHandler(onDecrease)
decrease:setColor(cc.c3b(0, 200, 20))
local increase = cc.MenuItemFont:create(" + ")
increase:registerScriptTapHandler(onIncrease)
increase:setColor(cc.c3b(0, 200, 20))
local menu = cc.Menu:create()
menu:addChild(decrease)
menu:addChild(increase)
menu:alignItemsHorizontally()
menu:setPosition(s.width / 2, s.height - 65)
scene:addChild(menu, 1)
infoLabel = cc.Label:createWithTTF("0 nodes", s_markerFeltFontPath, 30)
infoLabel:setColor(cc.c3b(0, 200, 20))
infoLabel:setAnchorPoint(cc.p(0.5, 0.5))
infoLabel:setPosition(s.width / 2, s.height - 90)
scene:addChild(infoLabel, 1)
maxCases = TEST_COUNT
-- Sub Tests
cc.MenuItemFont:setFontSize(32)
subMenu = cc.Menu:create()
for i = 1, 9 do
local str = i .. " "
local itemFont = cc.MenuItemFont:create(str)
itemFont:registerScriptTapHandler(testNCallback)
--itemFont:setTag(i)
subMenu:addChild(itemFont, kBasicZOrder + i, kBasicZOrder + i)
if i <= 3 then
itemFont:setColor(cc.c3b(200, 20, 20))
elseif i <= 6 then
itemFont:setColor(cc.c3b(0, 200, 20))
else
itemFont:setColor(cc.c3b(0, 20, 200))
end
end
subMenu:alignItemsHorizontally()
subMenu:setPosition(cc.p(s.width / 2, 80))
scene:addChild(subMenu, 1)
-- add title label
titleLabel = cc.Label:createWithTTF("No title", s_arialPath, 40)
scene:addChild(titleLabel, 1)
titleLabel:setAnchorPoint(cc.p(0.5, 0.5))
titleLabel:setPosition(s.width / 2, s.height - 32)
titleLabel:setColor(cc.c3b(255, 255, 40))
while quantityNodes < nNodes do
onIncrease()
end
end
-----------------------------------
-- SpritePerformTest1
-----------------------------------
function doPerformSpriteTest1(sprite)
performancePosition(sprite)
end
local function SpriteTestLayer1()
local layer = cc.Layer:create()
initWithLayer(layer, true)
local str = "A (" .. subtestNumber .. ") position"
titleLabel:setString(str)
return layer
end
-----------------------------------
-- SpritePerformTest2
-----------------------------------
function doPerformSpriteTest2(sprite)
performanceScale(sprite)
end
local function SpriteTestLayer2()
local layer = cc.Layer:create()
initWithLayer(layer, true)
local str = "B (" .. subtestNumber .. ") scale"
titleLabel:setString(str)
return layer
end
-----------------------------------
-- SpritePerformTest3
-----------------------------------
function doPerformSpriteTest3(sprite)
performanceRotationScale(sprite)
end
local function SpriteTestLayer3()
local layer = cc.Layer:create()
initWithLayer(layer, true)
local str = "C (" .. subtestNumber .. ") scale + rot"
titleLabel:setString(str)
return layer
end
-----------------------------------
-- SpritePerformTest4
-----------------------------------
function doPerformSpriteTest4(sprite)
performanceOut100(sprite)
end
local function SpriteTestLayer4()
local layer = cc.Layer:create()
initWithLayer(layer, true)
local str = "D (" .. subtestNumber .. ") 100% out"
titleLabel:setString(str)
return layer
end
-----------------------------------
-- SpritePerformTest5
-----------------------------------
function doPerformSpriteTest5(sprite)
performanceout20(sprite)
end
local function SpriteTestLayer5()
local layer = cc.Layer:create()
initWithLayer(layer, true)
local str = "E (" .. subtestNumber .. ") 80% out"
titleLabel:setString(str)
return layer
end
-----------------------------------
-- SpritePerformTest6
-----------------------------------
function doPerformSpriteTest6(sprite)
performanceActions(sprite)
end
local function SpriteTestLayer6()
local layer = cc.Layer:create()
initWithLayer(layer, true)
local str = "F (" .. subtestNumber .. ") actions"
titleLabel:setString(str)
return layer
end
-----------------------------------
-- SpritePerformTest7
-----------------------------------
function doPerformSpriteTest7(sprite)
performanceActions20(sprite)
end
local function SpriteTestLayer7()
local layer = cc.Layer:create()
initWithLayer(layer, true)
local str = "G (" .. subtestNumber .. ") actions 80% out"
titleLabel:setString(str)
return layer
end
-----------------------------------
-- PerformanceSpriteTest
-----------------------------------
function CreateSpriteTestScene()
local scene = cc.Scene:create()
initWithMainTest(scene, subtestNumber, kNodesIncrease)
if curCase == 0 then
scene:addChild(SpriteTestLayer1())
elseif curCase == 1 then
scene:addChild(SpriteTestLayer2())
elseif curCase == 2 then
scene:addChild(SpriteTestLayer3())
elseif curCase == 3 then
scene:addChild(SpriteTestLayer4())
elseif curCase == 4 then
scene:addChild(SpriteTestLayer5())
elseif curCase == 5 then
scene:addChild(SpriteTestLayer6())
elseif curCase == 6 then
scene:addChild(SpriteTestLayer7())
end
return scene
end
function PerformanceSpriteTest()
curCase = 0
return CreateSpriteTestScene()
end
| mit |
abriasffxi/darkstar | scripts/zones/Beaucedine_Glacier/npcs/Luck_Rune.lua | 14 | 1069 | -----------------------------------
-- Area: Beaucedine Glacier
-- NPC: Luck Rune
-- Involved in Quest: Mhaura Fortune
-- @pos 70.736 -37.778 149.624 111
-----------------------------------
package.loaded["scripts/zones/Beaucedine_Glacier/TextIDs"] = nil;
-------------------------------------
require("scripts/zones/Beaucedine_Glacier/TextIDs");
-----------------------------------
-- onTrade
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger
-----------------------------------
function onTrigger(player,npc)
player:messageSpecial(NOTHING_OUT_OF_THE_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);
end; | gpl-3.0 |
abriasffxi/darkstar | scripts/globals/weaponskills/steel_cyclone.lua | 26 | 1617 | -----------------------------------
-- Steel Cyclone
-- Great Axe weapon skill
-- Skill level: 240
-- Delivers a single-hit attack. Damage varies with TP.
-- In order to obtain Steel Cyclone, the quest The Weight of Your Limits must be completed.
-- Will stack with Sneak Attack.
-- Aligned with the Breeze Gorget, Aqua Gorget & Snow Gorget.
-- Aligned with the Breeze Belt, Aqua Belt & Snow Belt.
-- Element: None
-- Modifiers: STR:60% ; VIT:60%
-- 100%TP 200%TP 300%TP
-- 1.50 2.5 4.00
-----------------------------------
require("scripts/globals/status");
require("scripts/globals/settings");
require("scripts/globals/weaponskills");
-----------------------------------
function onUseWeaponSkill(player, target, wsID, tp, primary, action, taChar)
local params = {};
params.numHits = 1;
params.ftp100 = 1.5; params.ftp200 = 1.75; params.ftp300 = 3;
params.str_wsc = 0.5; 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;
params.crit100 = 0.0; params.crit200 = 0.0; params.crit300 = 0.0;
params.canCrit = false;
params.acc100 = 0.0; params.acc200= 0.0; params.acc300= 0.0;
params.atkmulti = 1.66;
if (USE_ADOULIN_WEAPON_SKILL_CHANGES == true) then
params.ftp200 = 2.5; params.ftp300 = 4;
params.str_wsc = 0.6; params.vit_wsc = 0.6;
params.atkmulti = 1.5;
end
local damage, criticalHit, tpHits, extraHits = doPhysicalWeaponskill(player, target, wsID, tp, primary, action, taChar, params);
return tpHits, extraHits, criticalHit, damage;
end
| gpl-3.0 |
Armyluix/darkstar | scripts/globals/effects/auspice.lua | 18 | 1827 | --------------------------------------
--
-- EFFECT_AUSPICE
--
-- Power: Used for Enspell Effect
-- SubPower: Tracks Subtle Blow Bonus
-- Tier: Used for Enspell Calculation
--
--------------------------------------
-----------------------------------
-- onEffectGain Action
-----------------------------------
function onEffectGain(target,effect)
--Auspice Reduces TP via adding to your Subtle Blow Mod
local subtleBlowBonus = 10 + target:getMod(MOD_AUSPICE_EFFECT);
--printf("AUSPICE: Adding Subtle Blow +%d!", subtleBlowBonus);
effect:setSubPower(subtleBlowBonus);
target:addMod(MOD_SUBTLE_BLOW, subtleBlowBonus);
--Afflatus Misery Bonuses
if (target:hasStatusEffect(EFFECT_AFFLATUS_MISERY)) then
target:getStatusEffect(EFFECT_AFFLATUS_MISERY):setSubPower(0);
target:addMod(MOD_ENSPELL,18);
target:addMod(MOD_ENSPELL_DMG,effect:getPower());
end
end;
-----------------------------------
-- onEffectTick Action
-----------------------------------
function onEffectTick(target,effect)
end;
-----------------------------------
-- onEffectLose Action
-----------------------------------
function onEffectLose(target,effect)
local subtleBlow = effect:getSubPower();
--printf("AUSPICE: Removing Subtle Blow +%d!", subtleBlow);
target:delMod(MOD_SUBTLE_BLOW, subtleBlow);
--Clean Up Any Bonuses That From Afflatus Misery Combo
if (target:hasStatusEffect(EFFECT_AFFLATUS_MISERY)) then
local accuracyBonus = target:getStatusEffect(EFFECT_AFFLATUS_MISERY):getSubPower();
--printf("AUSPICE: Removing Accuracy Bonus +%d!", accuracyBonus);
target:delMod(MOD_ACC, accuracyBonus);
local accuracyBonus = target:getStatusEffect(EFFECT_AFFLATUS_MISERY):setSubPower(0);
target:setMod(MOD_ENSPELL_DMG,0);
target:setMod(MOD_ENSPELL,0);
end
end; | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.