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 |
---|---|---|---|---|---|
abriasffxi/darkstar | scripts/zones/LaLoff_Amphitheater/npcs/qm1_1.lua | 17 | 2451 | -----------------------------------
-- Area: LaLoff_Amphitheater
-- NPC: Shimmering Circle (BCNM Entrances)
-------------------------------------
package.loaded["scripts/zones/LaLoff_Amphitheater/TextIDs"] = nil;
package.loaded["scripts/globals/bcnm"] = nil;
-------------------------------------
require("scripts/globals/bcnm");
require("scripts/globals/titles");
require("scripts/globals/keyitems");
require("scripts/globals/quests");
require("scripts/globals/missions");
require("scripts/zones/LaLoff_Amphitheater/TextIDs");
-- Death cutscenes:
-- player:startEvent(0x7d01,1,instance:getFastestTime(),1,instance:getTimeInside(),1,0,0); -- hume
-- player:startEvent(0x7d01,1,instance:getFastestTime(),1,instance:getTimeInside(),1,1,0); -- taru
-- player:startEvent(0x7d01,1,instance:getFastestTime(),1,instance:getTimeInside(),1,2,0); -- mithra
-- player:startEvent(0x7d01,1,instance:getFastestTime(),1,instance:getTimeInside(),1,3,0); -- elvaan
-- player:startEvent(0x7d01,1,instance:getFastestTime(),1,instance:getTimeInside(),1,4,0); -- galka
-- player:startEvent(0x7d01,1,instance:getFastestTime(),1,instance:getTimeInside(),1,5,0); -- divine might
-- param 1: entrance #
-- param 2: fastest time
-- param 3: unknown
-- param 4: clear time
-- param 5: zoneid
-- param 6: exit cs (0-4 AA, 5 DM, 6-10 neo AA, 11 neo DM)
-- param 7: skip (0 - no skip, 1 - prompt, 2 - force)
-- param 8: 0
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
if (TradeBCNM(player,player:getZoneID(),trade,npc)) then
return;
end
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
if (EventTriggerBCNM(player,npc)) then
return;
end
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
-- printf("onUpdate CSID: %u",csid);
-- printf("onUpdate RESULT: %u",option);
if (EventUpdateBCNM(player,csid,option,1)) then
return;
end
end;
-----------------------------------
-- onEventFinish Action
-----------------------------------
function onEventFinish(player,csid,option)
-- printf("onFinish CSID: %u",csid);
-- printf("onFinish RESULT: %u",option);
if (EventFinishBCNM(player,csid,option)) then
return;
end
end; | gpl-3.0 |
Armyluix/darkstar | scripts/globals/spells/bluemagic/wild_oats.lua | 18 | 1960 | -----------------------------------------
-- Spell: Wild Oats
-- Additional effect: Vitality Down. Duration of effect varies on TP
-- Spell cost: 9 MP
-- Monster Type: Plantoids
-- Spell Type: Physical (Piercing)
-- Blue Magic Points: 3
-- Stat Bonus: CHR+1, HP+10
-- Level: 4
-- Casting Time: 0.5 seconds
-- Recast Time: 7.25 seconds
-- Skillchain Element(s): Light (can open Compression, Reverberation, or Distortion; can close Transfixion)
-- Combos: Beast Killer
-----------------------------------------
require("scripts/globals/magic");
require("scripts/globals/status");
require("scripts/globals/bluemagic");
-----------------------------------------
-- OnMagicCastingCheck
-----------------------------------------
function onMagicCastingCheck(caster,target,spell)
return 0;
end;
-----------------------------------------
-- OnSpellCast
-----------------------------------------
function onSpellCast(caster,target,spell)
local params = {};
-- This data should match information on http://wiki.ffxiclopedia.org/wiki/Calculating_Blue_Magic_Damage
params.tpmod = TPMOD_DURATION;
params.dmgtype = DMGTYPE_PIERCE;
params.scattr = SC_TRANSFIXION;
params.numhits = 1;
params.multiplier = 1.84;
params.tp150 = 1.84;
params.tp300 = 1.84;
params.azuretp = 1.84;
params.duppercap = 11;
params.str_wsc = 0.0;
params.dex_wsc = 0.0;
params.vit_wsc = 0.0;
params.agi_wsc = 0.3;
params.int_wsc = 0.0;
params.mnd_wsc = 0.0;
params.chr_wsc = 0.0;
damage = BluePhysicalSpell(caster, target, spell, params);
damage = BlueFinalAdjustments(caster, target, spell, damage, params);
if (target:hasStatusEffect(EFFECT_VIT_DOWN)) then
spell:setMsg(75); -- no effect
else
target:addStatusEffect(EFFECT_VIT_DOWN,15,0,20);
end
return damage;
end; | gpl-3.0 |
abriasffxi/darkstar | scripts/zones/The_Eldieme_Necropolis/npcs/qm8.lua | 57 | 2181 | -----------------------------------
-- Area: The Eldieme Necropolis
-- NPC: qm8 (??? - Ancient Papyrus Shreds)
-- Involved in Quest: In Defiant Challenge
-- @pos 105.275 -32 92.551 195
-----------------------------------
package.loaded["scripts/zones/The_Eldieme_Necropolis/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/quests");
require("scripts/globals/keyitems");
require("scripts/globals/settings");
require("scripts/zones/The_Eldieme_Necropolis/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
if (OldSchoolG1 == false) then
if (player:hasItem(1088) == false and player:hasKeyItem(ANCIENT_PAPYRUS_SHRED2) == false
and player:getQuestStatus(JEUNO,IN_DEFIANT_CHALLENGE) == QUEST_ACCEPTED) then
player:addKeyItem(ANCIENT_PAPYRUS_SHRED2);
player:messageSpecial(KEYITEM_OBTAINED,ANCIENT_PAPYRUS_SHRED2);
end
if (player:hasKeyItem(ANCIENT_PAPYRUS_SHRED1) and player:hasKeyItem(ANCIENT_PAPYRUS_SHRED2) and player:hasKeyItem(ANCIENT_PAPYRUS_SHRED3)) then
if (player:getFreeSlotsCount() >= 1) then
player:addItem(1088, 1);
player:messageSpecial(ITEM_OBTAINED, 1088);
else
player:messageSpecial(ITEM_CANNOT_BE_OBTAINED, 1088);
end
end
if (player:hasItem(1088)) then
player:delKeyItem(ANCIENT_PAPYRUS_SHRED1);
player:delKeyItem(ANCIENT_PAPYRUS_SHRED2);
player:delKeyItem(ANCIENT_PAPYRUS_SHRED3);
end
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);
end; | gpl-3.0 |
dios-game/dios-cocos | src/oslibs/cocos/cocos-src/cocos/scripting/lua-bindings/auto/api/ArmatureAnimation.lua | 16 | 5581 |
--------------------------------
-- @module ArmatureAnimation
-- @extend ProcessBase
-- @parent_module ccs
--------------------------------
--
-- @function [parent=#ArmatureAnimation] getSpeedScale
-- @param self
-- @return float#float ret (return value: float)
--------------------------------
-- Play animation by animation name.<br>
-- param animationName The animation name you want to play<br>
-- param durationTo The frames between two animation changing-over.<br>
-- It's meaning is changing to this animation need how many frames<br>
-- -1 : use the value from MovementData get from flash design panel<br>
-- param loop Whether the animation is loop<br>
-- loop < 0 : use the value from MovementData get from flash design panel<br>
-- loop = 0 : this animation is not loop<br>
-- loop > 0 : this animation is loop
-- @function [parent=#ArmatureAnimation] play
-- @param self
-- @param #string animationName
-- @param #int durationTo
-- @param #int loop
-- @return ArmatureAnimation#ArmatureAnimation self (return value: ccs.ArmatureAnimation)
--------------------------------
-- Go to specified frame and pause current movement.
-- @function [parent=#ArmatureAnimation] gotoAndPause
-- @param self
-- @param #int frameIndex
-- @return ArmatureAnimation#ArmatureAnimation self (return value: ccs.ArmatureAnimation)
--------------------------------
--
-- @function [parent=#ArmatureAnimation] playWithIndexes
-- @param self
-- @param #array_table movementIndexes
-- @param #int durationTo
-- @param #bool loop
-- @return ArmatureAnimation#ArmatureAnimation self (return value: ccs.ArmatureAnimation)
--------------------------------
--
-- @function [parent=#ArmatureAnimation] setAnimationData
-- @param self
-- @param #ccs.AnimationData data
-- @return ArmatureAnimation#ArmatureAnimation self (return value: ccs.ArmatureAnimation)
--------------------------------
-- Scale animation play speed.<br>
-- param animationScale Scale value
-- @function [parent=#ArmatureAnimation] setSpeedScale
-- @param self
-- @param #float speedScale
-- @return ArmatureAnimation#ArmatureAnimation self (return value: ccs.ArmatureAnimation)
--------------------------------
--
-- @function [parent=#ArmatureAnimation] getAnimationData
-- @param self
-- @return AnimationData#AnimationData ret (return value: ccs.AnimationData)
--------------------------------
-- Go to specified frame and play current movement.<br>
-- You need first switch to the movement you want to play, then call this function.<br>
-- example : playByIndex(0);<br>
-- gotoAndPlay(0);<br>
-- playByIndex(1);<br>
-- gotoAndPlay(0);<br>
-- gotoAndPlay(15);
-- @function [parent=#ArmatureAnimation] gotoAndPlay
-- @param self
-- @param #int frameIndex
-- @return ArmatureAnimation#ArmatureAnimation self (return value: ccs.ArmatureAnimation)
--------------------------------
-- Init with a Armature<br>
-- param armature The Armature ArmatureAnimation will bind to
-- @function [parent=#ArmatureAnimation] init
-- @param self
-- @param #ccs.Armature armature
-- @return bool#bool ret (return value: bool)
--------------------------------
--
-- @function [parent=#ArmatureAnimation] playWithNames
-- @param self
-- @param #array_table movementNames
-- @param #int durationTo
-- @param #bool loop
-- @return ArmatureAnimation#ArmatureAnimation self (return value: ccs.ArmatureAnimation)
--------------------------------
-- Get movement count
-- @function [parent=#ArmatureAnimation] getMovementCount
-- @param self
-- @return long#long ret (return value: long)
--------------------------------
--
-- @function [parent=#ArmatureAnimation] playWithIndex
-- @param self
-- @param #int animationIndex
-- @param #int durationTo
-- @param #int loop
-- @return ArmatureAnimation#ArmatureAnimation self (return value: ccs.ArmatureAnimation)
--------------------------------
-- Get current movementID<br>
-- return The name of current movement
-- @function [parent=#ArmatureAnimation] getCurrentMovementID
-- @param self
-- @return string#string ret (return value: string)
--------------------------------
-- Create with a Armature<br>
-- param armature The Armature ArmatureAnimation will bind to
-- @function [parent=#ArmatureAnimation] create
-- @param self
-- @param #ccs.Armature armature
-- @return ArmatureAnimation#ArmatureAnimation ret (return value: ccs.ArmatureAnimation)
--------------------------------
-- Pause the Process
-- @function [parent=#ArmatureAnimation] pause
-- @param self
-- @return ArmatureAnimation#ArmatureAnimation self (return value: ccs.ArmatureAnimation)
--------------------------------
-- Stop the Process
-- @function [parent=#ArmatureAnimation] stop
-- @param self
-- @return ArmatureAnimation#ArmatureAnimation self (return value: ccs.ArmatureAnimation)
--------------------------------
--
-- @function [parent=#ArmatureAnimation] update
-- @param self
-- @param #float dt
-- @return ArmatureAnimation#ArmatureAnimation self (return value: ccs.ArmatureAnimation)
--------------------------------
-- Resume the Process
-- @function [parent=#ArmatureAnimation] resume
-- @param self
-- @return ArmatureAnimation#ArmatureAnimation self (return value: ccs.ArmatureAnimation)
--------------------------------
-- js ctor
-- @function [parent=#ArmatureAnimation] ArmatureAnimation
-- @param self
-- @return ArmatureAnimation#ArmatureAnimation self (return value: ccs.ArmatureAnimation)
return nil
| mit |
abriasffxi/darkstar | scripts/globals/spells/utsusemi_ni.lua | 15 | 1749 | -----------------------------------------
-- Spell: Utsusemi: Ni
-----------------------------------------
require("scripts/globals/status");
-----------------------------------------
-- OnSpellCast
-----------------------------------------
function onMagicCastingCheck(caster,target,spell)
return 0;
end;
function onSpellCast(caster,target,spell)
local effect = target:getStatusEffect(EFFECT_COPY_IMAGE);
-- Get extras shadows
local bonusShadow = 0;
if caster:getEquipID(SLOT_FEET) == 11156 then
bonusShadow = 1;
end
if (effect == nil) then
if caster:getMainJob() == JOBS.NIN then
target:addStatusEffectEx(EFFECT_COPY_IMAGE,EFFECT_COPY_IMAGE_4, 4 + bonusShadow,0,900);
target:setMod(MOD_UTSUSEMI, 4 + bonusShadow);
spell:setMsg(230);
else
target:addStatusEffectEx(EFFECT_COPY_IMAGE,EFFECT_COPY_IMAGE_3, 3 + bonusShadow,0,900);
target:setMod(MOD_UTSUSEMI, 3 + bonusShadow);
spell:setMsg(230);
end
elseif caster:getMainJob() == JOBS.NIN then
if (effect:getPower() <= 4) then
spell:setMsg(230);
effect:setPower(4);
effect:setIcon(EFFECT_COPY_IMAGE_4);
effect:resetStartTime();
target:setMod(MOD_UTSUSEMI, 4 + bonusShadow);
else
spell:setMsg(75);
end
else
if (effect:getPower() <= 3) then
spell:setMsg(230);
effect:setPower(3);
effect:setIcon(EFFECT_COPY_IMAGE_3);
effect:resetStartTime();
target:setMod(MOD_UTSUSEMI, 3 + bonusShadow);
else
spell:setMsg(75);
end
end
return EFFECT_COPY_IMAGE;
end; | gpl-3.0 |
Armyluix/darkstar | scripts/globals/mobskills/Everyones_Rancor.lua | 55 | 1603 | ---------------------------------------------
-- Everyones Grudge
--
-- Notes: Invokes collective hatred to spite a single target.
-- Damage done is 5x the amount of tonberries you have killed! For NM's using this it is 50 x damage.
---------------------------------------------
require("scripts/globals/settings");
require("scripts/globals/status");
require("scripts/globals/monstertpmoves");
---------------------------------------------
function onMobSkillCheck(target,mob,skill)
if (mob:isMobType(MOBTYPE_NOTORIOUS) and mob:getHP()/mob:getMaxHP() <= 0.25) then
return 0;
end
return 1;
end;
function onMobWeaponSkill(target, mob, skill)
local realDmg = 0;
local mobID = mob:getID();
if (target:getID() > 100000) then
realDmg = 10 * math.random(50,100);
else
realDmg = 10 * target:getVar("EVERYONES_GRUDGE_KILLS"); -- Damage is 5 times the amount you have killed
if (mobID == 17428677 or mobID == 17433008 or mobID == 17433006 or mobID == 17433009 or mobID == 17432994 or mobID == 17433007 or mobID == 17428813 or mobID == 17432659 or mobID == 17432846 or mobID == 17428809) then
realDmg = realDmg * 10; -- Sets the Multiplyer to 50 for NM's
elseif (mobID == 17432799 or mobID == 17428611 or MobID == 17428554 or mobID == 17428751 or mobID == 17432609 or mobID == 16814432 or mobID == 17432624 or mobID == 17285526 or mobID == 17285460) then
realDmg = realDmg * 10; -- Sets the Multiplyer to 50 for NM's , staggered list
end
end
target:delHP(realDmg);
return realDmg;
end; | gpl-3.0 |
abriasffxi/darkstar | scripts/globals/mobskills/Everyones_Rancor.lua | 55 | 1603 | ---------------------------------------------
-- Everyones Grudge
--
-- Notes: Invokes collective hatred to spite a single target.
-- Damage done is 5x the amount of tonberries you have killed! For NM's using this it is 50 x damage.
---------------------------------------------
require("scripts/globals/settings");
require("scripts/globals/status");
require("scripts/globals/monstertpmoves");
---------------------------------------------
function onMobSkillCheck(target,mob,skill)
if (mob:isMobType(MOBTYPE_NOTORIOUS) and mob:getHP()/mob:getMaxHP() <= 0.25) then
return 0;
end
return 1;
end;
function onMobWeaponSkill(target, mob, skill)
local realDmg = 0;
local mobID = mob:getID();
if (target:getID() > 100000) then
realDmg = 10 * math.random(50,100);
else
realDmg = 10 * target:getVar("EVERYONES_GRUDGE_KILLS"); -- Damage is 5 times the amount you have killed
if (mobID == 17428677 or mobID == 17433008 or mobID == 17433006 or mobID == 17433009 or mobID == 17432994 or mobID == 17433007 or mobID == 17428813 or mobID == 17432659 or mobID == 17432846 or mobID == 17428809) then
realDmg = realDmg * 10; -- Sets the Multiplyer to 50 for NM's
elseif (mobID == 17432799 or mobID == 17428611 or MobID == 17428554 or mobID == 17428751 or mobID == 17432609 or mobID == 16814432 or mobID == 17432624 or mobID == 17285526 or mobID == 17285460) then
realDmg = realDmg * 10; -- Sets the Multiplyer to 50 for NM's , staggered list
end
end
target:delHP(realDmg);
return realDmg;
end; | gpl-3.0 |
cjtallman/LDoc | ldoc/builtin/coroutine.lua | 7 | 2180 | --- creating and controlling coroutines.
-- @module coroutine
local coroutine = {}
---
-- Creates a new coroutine, with body `f`. `f` must be a Lua
-- function. Returns this new coroutine, an object with type `"thread"`.
function coroutine.create(f) end
---
-- Starts or continues the execution of coroutine `co`. The first time
-- you resume a coroutine, it starts running its body. The values
-- ... are passed as the arguments to the body function. If the coroutine
-- has yielded, `resume` restarts it; the values ... are passed
-- as the results from the yield.
-- If the coroutine runs without any errors, `resume` returns true plus any
-- values passed to `yield` (if the coroutine yields) or any values returned
-- by the body function (if the coroutine terminates). If there is any error,
-- `resume` returns false plus the error message.
function coroutine.resume(co , ...) end
---
-- Returns the running coroutine. Or nil when called by the main thread.
function coroutine.running() end
---
-- Returns the status of coroutine `co`. Result is a string: `"running"`, if
-- the coroutine is running (that is, it called `status`); `"suspended"`, if
-- the coroutine is suspended in a call to `yield`, or if it has not started
-- running yet; `"normal"` if the coroutine is active but not running (that
-- is, it has resumed another coroutine); and `"dead"` if the coroutine has
-- finished its body function, or if it has stopped with an error.
function coroutine.status(co) end
---
-- Creates a new coroutine, with body `f`. `f` must be a Lua
-- function. Returns a function that resumes the coroutine each time it is
-- called. Any arguments passed to the function behave as the extra arguments to
-- `resume`. Returns the same values returned by `resume`, except the first
-- boolean. In case of error, propagates the error.
function coroutine.wrap(f) end
---
-- Suspends the execution of the calling coroutine. The coroutine cannot
-- be running a C function, a metamethod, or an iterator. Any arguments to
-- `yield` are passed as extra results to `resume`.
function coroutine.yield(...) end
return coroutine
| mit |
isalnikov/Algorithm-Implementations | Levenshtein_distance/Lua/Yonaba/levenshtein.lua | 25 | 1670 | -- Levenshtein distance implementation
-- See: http://en.wikipedia.org/wiki/Levenshtein_distance
-- Iterative matrix-based method
-- See: http://en.wikipedia.org/wiki/Levenshtein_distance#Iterative_with_full_matrix
-- Return the minimum of three elements
local function min(a, b, c)
return math.min(math.min(a, b), c)
end
-- Creates a 2D matrix
local function matrix(row,col)
local m = {}
for i = 1,row do m[i] = {}
for j = 1,col do m[i][j] = 0 end
end
return m
end
-- Calculates the Levenshtein distance between two strings
local function lev_iter_based(strA,strB)
local M = matrix(#strA+1,#strB+1)
local i,j,cost
local row,col = #M,#M[1]
for i = 1,row do M[i][1] = i-1 end
for j = 1,col do M[1][j] = j-1 end
for i = 2,row do
for j = 2,col do
if (strA:sub(i-1,i-1) == strB:sub(j-1,j-1)) then cost = 0
else cost = 1
end
M[i][j] = min(M[i-1][j]+1,M[i][j-1]+1,M[i-1][j-1]+cost)
end
end
return M[row][col]
end
-- Recursive method
-- See: http://en.wikipedia.org/wiki/Levenshtein_distance#Recursive
-- Calculates the Levenshtein distance between two strings
local function lev_recursive_based(strA, strB, s, t)
s, t = s or #strA, t or #strB
if s == 0 then return t end
if t == 0 then return s end
local cost = strA:sub(s,s) == strB:sub(t,t) and 0 or 1
return min(
lev_recursive_based(strA, strB, s - 1, t) + 1,
lev_recursive_based(strA, strB, s, t - 1) + 1,
lev_recursive_based(strA, strB, s - 1, t - 1) + cost
)
end
return {
lev_iter = lev_iter_based,
lev_recursive = function(strA, strB) -- Wrapped to shadow access to s and t args
return lev_recursive_based(strA, strB)
end
}
| mit |
sum2012/mame | 3rdparty/genie/tests/actions/vstudio/cs2005/projectsettings.lua | 47 | 3943 | --
-- tests/actions/vstudio/cs2005/projectsettings.lua
-- Validate generation of root <PropertyGroup/> in Visual Studio 2005+ .csproj
-- Copyright (c) 2009-2011 Jason Perkins and the Premake project
--
T.vstudio_cs2005_projectsettings = { }
local suite = T.vstudio_cs2005_projectsettings
local cs2005 = premake.vstudio.cs2005
--
-- Setup
--
local sln, prj
function suite.setup()
sln = test.createsolution()
language "C#"
uuid "AE61726D-187C-E440-BD07-2556188A6565"
end
local function prepare()
premake.bake.buildconfigs()
prj = premake.solution.getproject(sln, 1)
cs2005.projectsettings(prj)
end
--
-- Version Tests
--
function suite.OnVs2005()
_ACTION = "vs2005"
prepare()
test.capture [[
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{AE61726D-187C-E440-BD07-2556188A6565}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>MyProject</RootNamespace>
<AssemblyName>MyProject</AssemblyName>
</PropertyGroup>
]]
end
function suite.OnVs2008()
_ACTION = "vs2008"
prepare()
test.capture [[
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.21022</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{AE61726D-187C-E440-BD07-2556188A6565}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>MyProject</RootNamespace>
<AssemblyName>MyProject</AssemblyName>
</PropertyGroup>
]]
end
function suite.OnVs2010()
_ACTION = "vs2010"
prepare()
test.capture [[
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{AE61726D-187C-E440-BD07-2556188A6565}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>MyProject</RootNamespace>
<AssemblyName>MyProject</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile></TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
]]
end
function suite.OnVs2012()
_ACTION = "vs2012"
prepare()
test.capture [[
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{AE61726D-187C-E440-BD07-2556188A6565}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>MyProject</RootNamespace>
<AssemblyName>MyProject</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
]]
end
--
-- Framework Tests
--
function suite.OnFrameworkVersion()
_ACTION = "vs2005"
framework "3.0"
prepare()
test.capture [[
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{AE61726D-187C-E440-BD07-2556188A6565}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>MyProject</RootNamespace>
<AssemblyName>MyProject</AssemblyName>
<TargetFrameworkVersion>v3.0</TargetFrameworkVersion>
</PropertyGroup>
]]
end
| gpl-2.0 |
abriasffxi/darkstar | scripts/globals/weaponskills/stardiver.lua | 22 | 1598 | -----------------------------------
-- Stardiver
-- Polearm weapon skill
-- Skill Level: MERIT
-- Delivers a fourfold attack. Damage varies with TP.
-- Will stack with Sneak Attack. reduces params.crit hit evasion by 5%
-- Element: None
-- Modifiers: STR:73~85%
-- 100%TP 200%TP 300%TP
-- 0.75 1.25 1.75
-----------------------------------
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 = 4;
params.ftp100 = 0.75; params.ftp200 = 1.25; params.ftp300 = 1.75;
params.str_wsc = 0.85 + (player:getMerit(MERIT_STARDIVER) / 100); 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.atkmulti = 1;
if (USE_ADOULIN_WEAPON_SKILL_CHANGES == true) then
params.str_wsc = 0.7 + (player:getMerit(MERIT_STARDIVER) / 100);
end
local damage, criticalHit, tpHits, extraHits = doPhysicalWeaponskill(player, target, wsID, tp, primary, action, taChar, params);
if (damage > 0 and target:hasStatusEffect(EFFECT_CRIT_HIT_EVASION_DOWN) == false) then
target:addStatusEffect(EFFECT_CRIT_HIT_EVASION_DOWN, 5, 0, 60);
end
return tpHits, extraHits, criticalHit, damage;
end
| gpl-3.0 |
abriasffxi/darkstar | scripts/zones/East_Ronfaure/TextIDs.lua | 7 | 1411 | -- Variable TextID Description text
-- General Texts
ITEM_CANNOT_BE_OBTAINED = 6401; -- You cannot obtain the item <item> come back again after sorting your inventory.
ITEM_OBTAINED = 6406; -- Obtained: <item>.
GIL_OBTAINED = 6407; -- Obtained <number> gil.
KEYITEM_OBTAINED = 6409; -- Obtained key item: <keyitem>.
FISHING_MESSAGE_OFFSET = 7226; -- You can't fish here.
-- Logging
LOGGING_IS_POSSIBLE_HERE = 7482; -- Logging is possible here if you have
-- General Dialog
RAYOCHINDOT_DIALOG = 7406; -- If you are outmatched, run to the city as quickly as you can.
CROTEILLARD_DIALOG = 7407; -- Sorry, no chatting while I'm on duty.
BLESSED_WATERSKIN = 7451; -- To get water, radethe waterskin you hold with the river.
CHEVAL_RIVER_WATER = 7432; -- You fill your waterskin with water from the river. You now have
NOTHING_OUT_OF_ORDINARY = 6420; -- There is nothing out of the ordinary here.
-- Other Dialog
NOTHING_HAPPENS = 7326; -- Nothing happens...
-- conquest Base
CONQUEST_BASE = 7067; -- Tallying conquest results...
-- chocobo digging
DIG_THROW_AWAY = 7239; -- You dig up ?Possible Special Code: 01??Possible Special Code: 01??Possible Special Code: 01? ?Possible Special Code: 01??Possible Special Code: 05?$?BAD CHAR: 8280??BAD CHAR: 80??BAD CHAR: 80?, but your inventory is full.
FIND_NOTHING = 7241; -- You dig and you dig, but find nothing.
| gpl-3.0 |
Armyluix/darkstar | scripts/zones/AlTaieu/npcs/qm3.lua | 14 | 1611 | -----------------------------------
-- Area: Al'Taieu
-- NPC: ??? (Jailer of Prudence Spawn)
-- Allows players to spawn the Jailer of Prudence by trading the Third Virtue, Deed of Sensibility, and High-Quality Hpemde Organ to a ???.
-- @pos , 706 -1 22
-----------------------------------
package.loaded["scripts/zones/AlTaieu/TextIDs"] = nil;
-----------------------------------
require("scripts/zones/AlTaieu/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
-- Trade the Third Virtue, Deed of Sensibility, and High-Quality Hpemde Organ
--[[if (GetMobAction(16912846) == 0 and GetMobAction(16912847) == 0 and trade:hasItemQty(1856,1) and trade:hasItemQty(1870,1) and
trade:hasItemQty(1871,1) and trade:getItemCount() == 3) then
player:tradeComplete();
SpawnMob(16912846,900):updateClaim(player);-- Spawn Jailer of Prudence 1
SpawnMob(16912847,900):updateClaim(player);-- Spawn Jailer of Prudence 2
end]]
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
--printf("onUpdate CSID: %u",csid);
--printf("onUpdate RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish Action
-----------------------------------
function onEventFinish(player,csid,option)
--printf("onFinish CSID: %u",csid);
--printf("onFinish RESULT: %u",option);
end; | gpl-3.0 |
davek44/Basset | src/batcherT.lua | 1 | 1419 | BatcherT = {}
BatcherT.__index = BatcherT
function BatcherT:__init(X, Y, batch_size, permute)
bat = {}
setmetatable(bat, self)
bat.X = X
bat.Y = Y
bat.num_seqs = (#X)[1]
bat.batch_size = batch_size
bat.permute = permute or false
bat:reset()
return bat
end
function BatcherT:next()
local X_batch = nil
local Y_batch = nil
if self.start <= (#self.X)[1] then
-- allocate Tensors
local blen = self.stop-self.start+1
X_batch = torch.Tensor(blen, 4, 1, (#self.X)[4])
if self.Y ~= nil then
Y_batch = torch.Tensor(blen, (#self.Y)[2])
end
-- copy data
local k = 1
for i = self.start, self.stop do
X_batch[k] = self.X[self.order[i]]
if self.Y ~= nil then
Y_batch[k] = self.Y[self.order[i]]
end
k = k + 1
end
-- update batch indexes for next
self.start = self.start + self.batch_size
self.stop = math.min(self.stop + self.batch_size, (#self.X)[1])
end
return X_batch, Y_batch
end
function BatcherT:reset()
self.start = 1
self.stop = math.min(self.start+self.batch_size-1, (#self.X)[1])
if self.permute then
self.order = torch.randperm((#self.X)[1])
else
self.order = {}
for i = 1,(#self.X)[1] do
self.order[i] = i
end
end
end | mit |
mir3x/freeciv_cmake | data/civ2civ3/script.lua | 1 | 10806 | -- Freeciv - Copyright (C) 2007 - The Freeciv Project
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 2, or (at your option)
-- any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
-- This file is for lua-functionality that is specific to a given
-- ruleset. When freeciv loads a ruleset, it also loads script
-- file called 'default.lua'. The one loaded if your ruleset
-- does not provide an override is default/default.lua.
-- Place Ruins at the location of the destroyed city.
function city_destroyed_callback(city, loser, destroyer)
city.tile:create_extra("Ruins", NIL)
-- continue processing
return false
end
signal.connect("city_destroyed", "city_destroyed_callback")
-- Check if there is certain terrain in ANY CAdjacent tile.
function adjacent_to(tile, terrain_name)
for adj_tile in tile:circle_iterate(1) do
if adj_tile.id ~= tile.id then
local adj_terr = adj_tile.terrain
local adj_name = adj_terr:rule_name()
if adj_name == terrain_name then
return true
end
end
end
return false
end
-- Check if there is certain terrain in ALL CAdjacent tiles.
function surrounded_by(tile, terrain_name)
for adj_tile in tile:circle_iterate(1) do
if adj_tile.id ~= tile.id then
local adj_terr = adj_tile.terrain
local adj_name = adj_terr:rule_name()
if adj_name ~= terrain_name then
return false
end
end
end
return true
end
-- Add random labels to the map.
function place_map_labels()
local rivers = 0
local deeps = 0
local oceans = 0
local lakes = 0
local swamps = 0
local glaciers = 0
local tundras = 0
local deserts = 0
local plains = 0
local grasslands = 0
local jungles = 0
local forests = 0
local hills = 0
local mountains = 0
local selected_river = 0
local selected_deep = 0
local selected_ocean = 0
local selected_lake = 0
local selected_swamp = 0
local selected_glacier = 0
local selected_tundra = 0
local selected_desert = 0
local selected_plain = 0
local selected_grassland = 0
local selected_jungle = 0
local selected_forest = 0
local selected_hill = 0
local selected_mountain = 0
-- Count the tiles that has a terrain type that may get a label.
for place in whole_map_iterate() do
local terr = place.terrain
local tname = terr:rule_name()
if place:has_extra("River") then
rivers = rivers + 1
elseif tname == "Deep Ocean" then
deeps = deeps + 1
elseif tname == "Ocean" then
oceans = oceans + 1
elseif tname == "Lake" then
lakes = lakes + 1
elseif tname == "Swamp" then
swamps = swamps + 1
elseif tname == "Glacier" then
glaciers = glaciers + 1
elseif tname == "Tundra" then
tundras = tundras + 1
elseif tname == "Desert" then
deserts = deserts + 1
elseif tname == "Plains" then
plains = plains + 1
elseif tname == "Grassland" then
grasslands = grasslands + 1
elseif tname == "Jungle" then
jungles = jungles + 1
elseif tname == "Forest" then
forests = forests + 1
elseif tname == "Hills" then
hills = hills + 1
elseif tname == "Mountains" then
mountains = mountains + 1
end
end
-- Decide if a label should be included and, in case it should, where.
if random(1, 100) <= rivers then
selected_river = random(1, rivers)
end
if random(1, 100) <= deeps then
selected_deep = random(1, deeps)
end
if random(1, 100) <= oceans then
selected_ocean = random(1, oceans)
end
if random(1, 100) <= lakes then
selected_lake = random(1, lakes)
end
if random(1, 100) <= swamps then
selected_swamp = random(1, swamps)
end
if random(1, 100) <= glaciers then
selected_glacier = random(1, glaciers)
end
if random(1, 100) <= tundras then
selected_tundra = random(1, tundras)
end
if random(1, 100) <= deserts then
selected_desert = random(1, deserts)
end
if random(1, 100) <= plains then
selected_plain = random(1, plains)
end
if random(1, 100) <= grasslands then
selected_grassland = random(1, grasslands)
end
if random(1, 100) <= jungles then
selected_jungle = random(1, jungles)
end
if random(1, 100) <= forests then
selected_forest = random(1, forests)
end
if random(1, 100) <= hills then
selected_hill = random(1, hills)
end
if random(1, 100) <= mountains then
selected_mountain = random(1, mountains)
end
-- Place the included labels at the location determined above.
for place in whole_map_iterate() do
local terr = place.terrain
local tname = terr:rule_name()
if place:has_extra("River") then
selected_river = selected_river - 1
if selected_river == 0 then
if tname == "Hills" then
place:set_label(_("Grand Canyon"))
elseif tname == "Mountains" then
place:set_label(_("Deep Gorge"))
elseif tname == "Tundra" then
place:set_label(_("Fjords"))
elseif random(1, 100) <= 50 then
place:set_label(_("Waterfalls"))
else
place:set_label(_("Travertine Terraces"))
end
end
elseif tname == "Deep Ocean" then
selected_deep = selected_deep - 1
if selected_deep == 0 then
if random(1, 100) <= 50 then
place:set_label(_("Deep Trench"))
else
place:set_label(_("Thermal Vent"))
end
end
elseif tname == "Ocean" then
selected_ocean = selected_ocean - 1
if selected_ocean == 0 then
if surrounded_by(place, "Ocean") then
place:set_label(_("Atoll Chain"))
elseif adjacent_to(place, "Deep Ocean") then
place:set_label(_("Great Barrier Reef"))
else
-- Coast
place:set_label(_("Great Blue Hole"))
end
end
elseif tname == "Lake" then
selected_lake = selected_lake - 1
if selected_lake == 0 then
if surrounded_by(place, "Lake") then
place:set_label(_("Great Lakes"))
elseif not adjacent_to(place, "Lake") then
-- Isolated
place:set_label(_("Dead Sea"))
else
place:set_label(_("Rift Lake"))
end
end
elseif tname == "Swamp" then
selected_swamp = selected_swamp - 1
if selected_swamp == 0 then
if not adjacent_to(place, "Swamp") then
place:set_label(_("Grand Prismatic Spring"))
elseif adjacent_to(place, "Ocean") then
place:set_label(_("Mangrove Forest"))
else
place:set_label(_("Cenotes"))
end
end
elseif tname == "Glacier" then
selected_glacier = selected_glacier - 1
if selected_glacier == 0 then
if surrounded_by(place, "Glacier") then
place:set_label(_("Ice Sheet"))
elseif not adjacent_to(place, "Glacier") then
place:set_label(_("Frozen Lake"))
elseif adjacent_to(place, "Ocean") then
place:set_label(_("Glacier Bay"))
else
place:set_label(_("Advancing Glacier"))
end
end
elseif tname == "Tundra" then
selected_tundra = selected_tundra - 1
if selected_tundra == 0 then
place:set_label(_("Geothermal Area"))
end
elseif tname == "Desert" then
selected_desert = selected_desert - 1
if selected_desert == 0 then
if surrounded_by(place, "Desert") then
place:set_label(_("Sand Sea"))
elseif not adjacent_to(place, "Desert") then
place:set_label(_("Salt Flat"))
elseif random(1, 100) <= 50 then
place:set_label(_("Singing Dunes"))
else
place:set_label(_("White Desert"))
end
end
elseif tname == "Plains" then
selected_plain = selected_plain - 1
if selected_plain == 0 then
if adjacent_to(place, "Ocean") then
place:set_label(_("Long Beach"))
elseif random(1, 100) <= 50 then
place:set_label(_("Mud Volcanoes"))
else
place:set_label(_("Rock Pillars"))
end
end
elseif tname == "Grassland" then
selected_grassland = selected_grassland - 1
if selected_grassland == 0 then
if adjacent_to(place, "Ocean") then
place:set_label(_("White Cliffs"))
elseif random(1, 100) <= 50 then
place:set_label(_("Giant Cave"))
else
place:set_label(_("Rock Formation"))
end
end
elseif tname == "Jungle" then
selected_jungle = selected_jungle - 1
if selected_jungle == 0 then
if surrounded_by(place, "Jungle") then
place:set_label(_("Rainforest"))
elseif adjacent_to(place, "Ocean") then
place:set_label(_("Subterranean River"))
else
place:set_label(_("Sinkholes"))
end
end
elseif tname == "Forest" then
selected_forest = selected_forest - 1
if selected_forest == 0 then
if adjacent_to(place, "Mountains") then
place:set_label(_("Stone Forest"))
elseif random(1, 100) <= 50 then
place:set_label(_("Sequoia Forest"))
else
place:set_label(_("Millenary Trees"))
end
end
elseif tname == "Hills" then
selected_hill = selected_hill - 1
if selected_hill == 0 then
if not adjacent_to(place, "Hills") then
if adjacent_to(place, "Mountains") then
place:set_label(_("Table Mountain"))
else
place:set_label(_("Inselberg"))
end
elseif random(1, 100) <= 50 then
place:set_label(_("Karst Landscape"))
else
place:set_label(_("Valley of Geysers"))
end
end
elseif tname == "Mountains" then
selected_mountain = selected_mountain - 1
if selected_mountain == 0 then
if surrounded_by(place, "Mountains") then
place:set_label(_("Highest Peak"))
elseif not adjacent_to(place, "Mountains") then
place:set_label(_("Sacred Mount"))
elseif adjacent_to(place, "Ocean") then
place:set_label(_("Cliff Coast"))
elseif random(1, 100) <= 50 then
place:set_label(_("Active Volcano"))
else
place:set_label(_("High Summit"))
end
end
end
end
return false
end
signal.connect("map_generated", "place_map_labels")
| gpl-2.0 |
dios-game/dios-cocos | src/oslibs/cocos/cocos-src/cocos/scripting/lua-bindings/auto/api/Texture2D.lua | 10 | 7978 |
--------------------------------
-- @module Texture2D
-- @extend Ref
-- @parent_module cc
--------------------------------
-- Gets max T.
-- @function [parent=#Texture2D] getMaxT
-- @param self
-- @return float#float ret (return value: float)
--------------------------------
-- Returns the pixel format.<br>
-- since v2.0
-- @function [parent=#Texture2D] getStringForFormat
-- @param self
-- @return char#char ret (return value: char)
--------------------------------
-- @overload self, cc.Image, int
-- @overload self, cc.Image
-- @function [parent=#Texture2D] initWithImage
-- @param self
-- @param #cc.Image image
-- @param #int format
-- @return bool#bool ret (return value: bool)
--------------------------------
-- Gets max S.
-- @function [parent=#Texture2D] getMaxS
-- @param self
-- @return float#float ret (return value: float)
--------------------------------
-- Release only the gl texture.<br>
-- js NA<br>
-- lua NA
-- @function [parent=#Texture2D] releaseGLTexture
-- @param self
-- @return Texture2D#Texture2D self (return value: cc.Texture2D)
--------------------------------
-- Whether or not the texture has their Alpha premultiplied.
-- @function [parent=#Texture2D] hasPremultipliedAlpha
-- @param self
-- @return bool#bool ret (return value: bool)
--------------------------------
-- Gets the height of the texture in pixels.
-- @function [parent=#Texture2D] getPixelsHigh
-- @param self
-- @return int#int ret (return value: int)
--------------------------------
-- @overload self, int
-- @overload self
-- @function [parent=#Texture2D] getBitsPerPixelForFormat
-- @param self
-- @param #int format
-- @return unsigned int#unsigned int ret (return value: unsigned int)
--------------------------------
-- Gets the texture name.
-- @function [parent=#Texture2D] getName
-- @param self
-- @return unsigned int#unsigned int ret (return value: unsigned int)
--------------------------------
-- @overload self, char, cc.FontDefinition
-- @overload self, char, string, float, size_table, int, int
-- @function [parent=#Texture2D] initWithString
-- @param self
-- @param #char text
-- @param #string fontName
-- @param #float fontSize
-- @param #size_table dimensions
-- @param #int hAlignment
-- @param #int vAlignment
-- @return bool#bool ret (return value: bool)
--------------------------------
-- Sets max T.
-- @function [parent=#Texture2D] setMaxT
-- @param self
-- @param #float maxT
-- @return Texture2D#Texture2D self (return value: cc.Texture2D)
--------------------------------
-- Draws a texture inside a rect.
-- @function [parent=#Texture2D] drawInRect
-- @param self
-- @param #rect_table rect
-- @return Texture2D#Texture2D self (return value: cc.Texture2D)
--------------------------------
-- Get the texture content size.
-- @function [parent=#Texture2D] getContentSize
-- @param self
-- @return size_table#size_table ret (return value: size_table)
--------------------------------
-- Sets alias texture parameters:<br>
-- - GL_TEXTURE_MIN_FILTER = GL_NEAREST<br>
-- - GL_TEXTURE_MAG_FILTER = GL_NEAREST<br>
-- warning Calling this method could allocate additional texture memory.<br>
-- since v0.8
-- @function [parent=#Texture2D] setAliasTexParameters
-- @param self
-- @return Texture2D#Texture2D self (return value: cc.Texture2D)
--------------------------------
-- Sets antialias texture parameters:<br>
-- - GL_TEXTURE_MIN_FILTER = GL_LINEAR<br>
-- - GL_TEXTURE_MAG_FILTER = GL_LINEAR<br>
-- warning Calling this method could allocate additional texture memory.<br>
-- since v0.8
-- @function [parent=#Texture2D] setAntiAliasTexParameters
-- @param self
-- @return Texture2D#Texture2D self (return value: cc.Texture2D)
--------------------------------
-- Generates mipmap images for the texture.<br>
-- It only works if the texture size is POT (power of 2).<br>
-- since v0.99.0
-- @function [parent=#Texture2D] generateMipmap
-- @param self
-- @return Texture2D#Texture2D self (return value: cc.Texture2D)
--------------------------------
-- Get texutre name, dimensions and coordinates message by a string.<br>
-- js NA<br>
-- lua NA
-- @function [parent=#Texture2D] getDescription
-- @param self
-- @return string#string ret (return value: string)
--------------------------------
-- Gets the pixel format of the texture.
-- @function [parent=#Texture2D] getPixelFormat
-- @param self
-- @return int#int ret (return value: int)
--------------------------------
-- Set a shader program to the texture.<br>
-- It's used by drawAtPoint and drawInRect
-- @function [parent=#Texture2D] setGLProgram
-- @param self
-- @param #cc.GLProgram program
-- @return Texture2D#Texture2D self (return value: cc.Texture2D)
--------------------------------
-- Get content size.
-- @function [parent=#Texture2D] getContentSizeInPixels
-- @param self
-- @return size_table#size_table ret (return value: size_table)
--------------------------------
-- Gets the width of the texture in pixels.
-- @function [parent=#Texture2D] getPixelsWide
-- @param self
-- @return int#int ret (return value: int)
--------------------------------
-- Drawing extensions to make it easy to draw basic quads using a Texture2D object.<br>
-- These functions require GL_TEXTURE_2D and both GL_VERTEX_ARRAY and GL_TEXTURE_COORD_ARRAY client states to be enabled.<br>
-- Draws a texture at a given point.
-- @function [parent=#Texture2D] drawAtPoint
-- @param self
-- @param #vec2_table point
-- @return Texture2D#Texture2D self (return value: cc.Texture2D)
--------------------------------
-- Get a shader program from the texture.
-- @function [parent=#Texture2D] getGLProgram
-- @param self
-- @return GLProgram#GLProgram ret (return value: cc.GLProgram)
--------------------------------
-- Whether or not the texture has mip maps.
-- @function [parent=#Texture2D] hasMipmaps
-- @param self
-- @return bool#bool ret (return value: bool)
--------------------------------
-- Sets max S.
-- @function [parent=#Texture2D] setMaxS
-- @param self
-- @param #float maxS
-- @return Texture2D#Texture2D self (return value: cc.Texture2D)
--------------------------------
-- sets the default pixel format for UIImagescontains alpha channel.<br>
-- param format<br>
-- If the UIImage contains alpha channel, then the options are:<br>
-- - generate 32-bit textures: Texture2D::PixelFormat::RGBA8888 (default one)<br>
-- - generate 24-bit textures: Texture2D::PixelFormat::RGB888<br>
-- - generate 16-bit textures: Texture2D::PixelFormat::RGBA4444<br>
-- - generate 16-bit textures: Texture2D::PixelFormat::RGB5A1<br>
-- - generate 16-bit textures: Texture2D::PixelFormat::RGB565<br>
-- - generate 8-bit textures: Texture2D::PixelFormat::A8 (only use it if you use just 1 color)<br>
-- How does it work ?<br>
-- - If the image is an RGBA (with Alpha) then the default pixel format will be used (it can be a 8-bit, 16-bit or 32-bit texture)<br>
-- - If the image is an RGB (without Alpha) then: If the default pixel format is RGBA8888 then a RGBA8888 (32-bit) will be used. Otherwise a RGB565 (16-bit texture) will be used.<br>
-- This parameter is not valid for PVR / PVR.CCZ images.<br>
-- since v0.8
-- @function [parent=#Texture2D] setDefaultAlphaPixelFormat
-- @param self
-- @param #int format
-- @return Texture2D#Texture2D self (return value: cc.Texture2D)
--------------------------------
-- Returns the alpha pixel format.<br>
-- since v0.8
-- @function [parent=#Texture2D] getDefaultAlphaPixelFormat
-- @param self
-- @return int#int ret (return value: int)
--------------------------------
-- js ctor
-- @function [parent=#Texture2D] Texture2D
-- @param self
-- @return Texture2D#Texture2D self (return value: cc.Texture2D)
return nil
| mit |
Armyluix/darkstar | scripts/zones/The_Eldieme_Necropolis_[S]/npcs/Layton.lua | 34 | 1914 | -----------------------------------
-- Area: The Eldieme Necropolis (S)
-- NPC: Layton
-- Type: Standard Merchant NPC
-- Note: Available during Campaign battles
-- @pos 382.679 -39.999 3.541 175
-----------------------------------
package.loaded["scripts/zones/The_Eldieme_Necropolis_[S]/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/shop");
require("scripts/zones/The_Eldieme_Necropolis_[S]/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
player:showText(npc,LAYTON_SHOP_DIALOG);
stock = {0x17A1,8060, -- Firestorm Schema
0x17A2,6318, -- Rainstorm Schema
0x17A3,9100, -- Thunderstorm Schema
0x17A4,8580, -- Hailstorm Schema
0x17A5,5200, -- Sandstorm Schema
0x17A6,6786, -- Windstorm Schema
0x17A7,11440, -- Aurorastorm Schema
0x17A8,10725, -- Voidstorm Schema
0x1799,7714, -- Pyrohelix Schema
0x179A,6786, -- Hydrohelix Schema
0x179B,8625, -- Ionohelix Schema
0x179C,7896, -- Cryohelix Schema
0x179D,6591, -- Geohelix Schema
0x179E,6981, -- Anemohelix Schema
0x179F,8940, -- Luminohelix Schema
0x17A0,8790} -- Noctohelix Schema
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/spells/hojo_ni.lua | 27 | 1246 | -----------------------------------------
-- Spell: Hojo:Ni
-- Description: Inflicts Slow on target.
-- Edited from slow.lua
-----------------------------------------
require("scripts/globals/status");
require("scripts/globals/magic");
-----------------------------------------
-- OnSpellCast
-----------------------------------------
function onMagicCastingCheck(caster,target,spell)
return 0;
end;
function onSpellCast(caster,target,spell)
local dINT = (caster:getStat(MOD_INT) - target:getStat(MOD_INT));
--Power for Hojo is a flat 19.5% reduction
local power = 200;
--Duration and Resistance calculation
local duration = 300 * applyResistance(caster,spell,target,dINT,NINJUTSU_SKILL,0);
--Calculates the resist chance from Resist Blind trait
if (math.random(0,100) >= target:getMod(MOD_SLOWRES)) then
-- Spell succeeds if a 1 or 1/2 resist check is achieved
if (duration >= 150) then
if (target:addStatusEffect(EFFECT_SLOW,power,0,duration)) then
spell:setMsg(236);
else
spell:setMsg(75);
end
else
spell:setMsg(85);
end
else
spell:setMsg(284);
end
return EFFECT_SLOW;
end; | gpl-3.0 |
Armyluix/darkstar | scripts/zones/Northern_San_dOria/npcs/Miageau.lua | 17 | 2459 | -----------------------------------
-- Area: Northern San d'Oria
-- NPC: Miageau
-- Type: Quest Giver NPC
-- @zone: 231
-- @pos 115 0 108
--
-- Starts and Finishes: Waters of Cheval
-----------------------------------
package.loaded["scripts/zones/Northern_San_dOria/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/settings");
require("scripts/globals/titles");
require("scripts/globals/quests");
require("scripts/zones/Northern_San_dOria/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
if (player:getQuestStatus(SANDORIA,FLYERS_FOR_REGINE) == QUEST_ACCEPTED) then
if (trade:hasItemQty(532,1) == true and trade:getItemCount() == 1) then
player:messageSpecial(FLYER_REFUSED);
end
end
if (player:getQuestStatus(SANDORIA,WATER_OF_THE_CHEVAL) == QUEST_ACCEPTED) then
if (trade:getItemCount() == 1 and trade:hasItemQty(603, 1)) then
player:startEvent(0x0203);
end;
end;
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
watersOfTheCheval = player:getQuestStatus(SANDORIA,WATER_OF_THE_CHEVAL);
if (watersOfTheCheval == QUEST_ACCEPTED) then
if (player:hasItem(602) == true) then
player:startEvent(0x0200);
else
player:startEvent(0x0207);
end;
elseif (watersOfTheCheval == QUEST_AVAILABLE) then
player:startEvent(0x01f8);
else
player:startEvent(0x0205);
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 == 0x0203) then
if (player:getFreeSlotsCount() == 0) then
player:messageSpecial(ITEM_CANNOT_BE_OBTAINED, 13183);
else
player:tradeComplete();
player:addItem(13183);
player:messageSpecial(ITEM_OBTAINED, 13183);
player:addFame(SANDORIA,SAN_FAME*30);
player:addTitle(THE_PURE_ONE);
player:completeQuest(SANDORIA,WATER_OF_THE_CHEVAL);
end;
elseif (csid == 0x01f8) then
player:addQuest(SANDORIA, WATER_OF_THE_CHEVAL);
end;
end;
| gpl-3.0 |
mohammadclashclash/abi | plugins/ingroup.lua | 527 | 44020 | do
-- Check Member
local function check_member_autorealm(cb_extra, success, result)
local receiver = cb_extra.receiver
local data = cb_extra.data
local msg = cb_extra.msg
for k,v in pairs(result.members) do
local member_id = v.id
if member_id ~= our_id then
-- Group configuration
data[tostring(msg.to.id)] = {
group_type = 'Realm',
settings = {
set_name = string.gsub(msg.to.print_name, '_', ' '),
lock_name = 'yes',
lock_photo = 'no',
lock_member = 'no',
flood = 'yes'
}
}
save_data(_config.moderation.data, data)
local realms = 'realms'
if not data[tostring(realms)] then
data[tostring(realms)] = {}
save_data(_config.moderation.data, data)
end
data[tostring(realms)][tostring(msg.to.id)] = msg.to.id
save_data(_config.moderation.data, data)
return send_large_msg(receiver, 'Welcome to your new realm !')
end
end
end
local function check_member_realm_add(cb_extra, success, result)
local receiver = cb_extra.receiver
local data = cb_extra.data
local msg = cb_extra.msg
for k,v in pairs(result.members) do
local member_id = v.id
if member_id ~= our_id then
-- Group configuration
data[tostring(msg.to.id)] = {
group_type = 'Realm',
settings = {
set_name = string.gsub(msg.to.print_name, '_', ' '),
lock_name = 'yes',
lock_photo = 'no',
lock_member = 'no',
flood = 'yes'
}
}
save_data(_config.moderation.data, data)
local realms = 'realms'
if not data[tostring(realms)] then
data[tostring(realms)] = {}
save_data(_config.moderation.data, data)
end
data[tostring(realms)][tostring(msg.to.id)] = msg.to.id
save_data(_config.moderation.data, data)
return send_large_msg(receiver, 'Realm has been added!')
end
end
end
function check_member_group(cb_extra, success, result)
local receiver = cb_extra.receiver
local data = cb_extra.data
local msg = cb_extra.msg
for k,v in pairs(result.members) do
local member_id = v.id
if member_id ~= our_id then
-- Group configuration
data[tostring(msg.to.id)] = {
group_type = 'Group',
moderators = {},
set_owner = member_id ,
settings = {
set_name = string.gsub(msg.to.print_name, '_', ' '),
lock_name = 'yes',
lock_photo = 'no',
lock_member = 'no',
flood = 'yes',
}
}
save_data(_config.moderation.data, data)
local groups = 'groups'
if not data[tostring(groups)] then
data[tostring(groups)] = {}
save_data(_config.moderation.data, data)
end
data[tostring(groups)][tostring(msg.to.id)] = msg.to.id
save_data(_config.moderation.data, data)
return send_large_msg(receiver, 'You have been promoted as the owner.')
end
end
end
local function check_member_modadd(cb_extra, success, result)
local receiver = cb_extra.receiver
local data = cb_extra.data
local msg = cb_extra.msg
for k,v in pairs(result.members) do
local member_id = v.id
if member_id ~= our_id then
-- Group configuration
data[tostring(msg.to.id)] = {
group_type = 'Group',
moderators = {},
set_owner = member_id ,
settings = {
set_name = string.gsub(msg.to.print_name, '_', ' '),
lock_name = 'yes',
lock_photo = 'no',
lock_member = 'no',
flood = 'yes',
}
}
save_data(_config.moderation.data, data)
local groups = 'groups'
if not data[tostring(groups)] then
data[tostring(groups)] = {}
save_data(_config.moderation.data, data)
end
data[tostring(groups)][tostring(msg.to.id)] = msg.to.id
save_data(_config.moderation.data, data)
return send_large_msg(receiver, 'Group is added and you have been promoted as the owner ')
end
end
end
local function automodadd(msg)
local data = load_data(_config.moderation.data)
if msg.action.type == 'chat_created' then
receiver = get_receiver(msg)
chat_info(receiver, check_member_group,{receiver=receiver, data=data, msg = msg})
end
end
local function autorealmadd(msg)
local data = load_data(_config.moderation.data)
if msg.action.type == 'chat_created' then
receiver = get_receiver(msg)
chat_info(receiver, check_member_autorealm,{receiver=receiver, data=data, msg = msg})
end
end
local function check_member_realmrem(cb_extra, success, result)
local receiver = cb_extra.receiver
local data = cb_extra.data
local msg = cb_extra.msg
for k,v in pairs(result.members) do
local member_id = v.id
if member_id ~= our_id then
-- Realm configuration removal
data[tostring(msg.to.id)] = nil
save_data(_config.moderation.data, data)
local realms = 'realms'
if not data[tostring(realms)] then
data[tostring(realms)] = nil
save_data(_config.moderation.data, data)
end
data[tostring(realms)][tostring(msg.to.id)] = nil
save_data(_config.moderation.data, data)
return send_large_msg(receiver, 'Realm has been removed!')
end
end
end
local function check_member_modrem(cb_extra, success, result)
local receiver = cb_extra.receiver
local data = cb_extra.data
local msg = cb_extra.msg
for k,v in pairs(result.members) do
local member_id = v.id
if member_id ~= our_id then
-- Group configuration removal
data[tostring(msg.to.id)] = nil
save_data(_config.moderation.data, data)
local groups = 'groups'
if not data[tostring(groups)] then
data[tostring(groups)] = nil
save_data(_config.moderation.data, data)
end
data[tostring(groups)][tostring(msg.to.id)] = nil
save_data(_config.moderation.data, data)
return send_large_msg(receiver, 'Group has been removed')
end
end
end
--End Check Member
local function show_group_settingsmod(msg, data, target)
if not is_momod(msg) then
return "For moderators only!"
end
local data = load_data(_config.moderation.data)
if data[tostring(msg.to.id)] then
if data[tostring(msg.to.id)]['settings']['flood_msg_max'] then
NUM_MSG_MAX = tonumber(data[tostring(msg.to.id)]['settings']['flood_msg_max'])
print('custom'..NUM_MSG_MAX)
else
NUM_MSG_MAX = 5
end
end
local bots_protection = "Yes"
if data[tostring(msg.to.id)]['settings']['lock_bots'] then
bots_protection = data[tostring(msg.to.id)]['settings']['lock_bots']
end
local leave_ban = "no"
if data[tostring(msg.to.id)]['settings']['leave_ban'] then
leave_ban = data[tostring(msg.to.id)]['settings']['leave_ban']
end
local settings = data[tostring(target)]['settings']
local text = "Group settings:\nLock group name : "..settings.lock_name.."\nLock group photo : "..settings.lock_photo.."\nLock group member : "..settings.lock_member.."\nLock group leave : "..leave_ban.."\nflood sensitivity : "..NUM_MSG_MAX.."\nBot protection : "..bots_protection--"\nPublic: "..public
return text
end
local function set_descriptionmod(msg, data, target, about)
if not is_momod(msg) then
return "For moderators only!"
end
local data_cat = 'description'
data[tostring(target)][data_cat] = about
save_data(_config.moderation.data, data)
return 'Set group description to:\n'..about
end
local function get_description(msg, data)
local data_cat = 'description'
if not data[tostring(msg.to.id)][data_cat] then
return 'No description available.'
end
local about = data[tostring(msg.to.id)][data_cat]
local about = string.gsub(msg.to.print_name, "_", " ")..':\n\n'..about
return 'About '..about
end
local function lock_group_arabic(msg, data, target)
if not is_momod(msg) then
return "For moderators only!"
end
local group_arabic_lock = data[tostring(target)]['settings']['lock_arabic']
if group_arabic_lock == 'yes' then
return 'Arabic is already locked'
else
data[tostring(target)]['settings']['lock_arabic'] = 'yes'
save_data(_config.moderation.data, data)
return 'Arabic has been locked'
end
end
local function unlock_group_arabic(msg, data, target)
if not is_momod(msg) then
return "For moderators only!"
end
local group_arabic_lock = data[tostring(target)]['settings']['lock_arabic']
if group_arabic_lock == 'no' then
return 'Arabic is already unlocked'
else
data[tostring(target)]['settings']['lock_arabic'] = 'no'
save_data(_config.moderation.data, data)
return 'Arabic has been unlocked'
end
end
local function lock_group_bots(msg, data, target)
if not is_momod(msg) then
return "For moderators only!"
end
local group_bots_lock = data[tostring(target)]['settings']['lock_bots']
if group_bots_lock == 'yes' then
return 'Bots protection is already enabled'
else
data[tostring(target)]['settings']['lock_bots'] = 'yes'
save_data(_config.moderation.data, data)
return 'Bots protection has been enabled'
end
end
local function unlock_group_bots(msg, data, target)
if not is_momod(msg) then
return "For moderators only!"
end
local group_bots_lock = data[tostring(target)]['settings']['lock_bots']
if group_bots_lock == 'no' then
return 'Bots protection is already disabled'
else
data[tostring(target)]['settings']['lock_bots'] = 'no'
save_data(_config.moderation.data, data)
return 'Bots protection has been disabled'
end
end
local function lock_group_namemod(msg, data, target)
if not is_momod(msg) then
return "For moderators only!"
end
local group_name_set = data[tostring(target)]['settings']['set_name']
local group_name_lock = data[tostring(target)]['settings']['lock_name']
if group_name_lock == 'yes' then
return 'Group name is already locked'
else
data[tostring(target)]['settings']['lock_name'] = 'yes'
save_data(_config.moderation.data, data)
rename_chat('chat#id'..target, group_name_set, ok_cb, false)
return 'Group name has been locked'
end
end
local function unlock_group_namemod(msg, data, target)
if not is_momod(msg) then
return "For moderators only!"
end
local group_name_set = data[tostring(target)]['settings']['set_name']
local group_name_lock = data[tostring(target)]['settings']['lock_name']
if group_name_lock == 'no' then
return 'Group name is already unlocked'
else
data[tostring(target)]['settings']['lock_name'] = 'no'
save_data(_config.moderation.data, data)
return 'Group name has been unlocked'
end
end
local function lock_group_floodmod(msg, data, target)
if not is_owner(msg) then
return "Only admins can do it for now"
end
local group_flood_lock = data[tostring(target)]['settings']['flood']
if group_flood_lock == 'yes' then
return 'Group flood is locked'
else
data[tostring(target)]['settings']['flood'] = 'yes'
save_data(_config.moderation.data, data)
return 'Group flood has been locked'
end
end
local function unlock_group_floodmod(msg, data, target)
if not is_owner(msg) then
return "Only admins can do it for now"
end
local group_flood_lock = data[tostring(target)]['settings']['flood']
if group_flood_lock == 'no' then
return 'Group flood is not locked'
else
data[tostring(target)]['settings']['flood'] = 'no'
save_data(_config.moderation.data, data)
return 'Group flood has been unlocked'
end
end
local function lock_group_membermod(msg, data, target)
if not is_momod(msg) then
return "For moderators only!"
end
local group_member_lock = data[tostring(target)]['settings']['lock_member']
if group_member_lock == 'yes' then
return 'Group members are already locked'
else
data[tostring(target)]['settings']['lock_member'] = 'yes'
save_data(_config.moderation.data, data)
end
return 'Group members has been locked'
end
local function unlock_group_membermod(msg, data, target)
if not is_momod(msg) then
return "For moderators only!"
end
local group_member_lock = data[tostring(target)]['settings']['lock_member']
if group_member_lock == 'no' then
return 'Group members are not locked'
else
data[tostring(target)]['settings']['lock_member'] = 'no'
save_data(_config.moderation.data, data)
return 'Group members has been unlocked'
end
end
local function set_public_membermod(msg, data, target)
if not is_momod(msg) then
return "For moderators only!"
end
local group_member_lock = data[tostring(target)]['settings']['public']
if group_member_lock == 'yes' then
return 'Group is already public'
else
data[tostring(target)]['settings']['public'] = 'yes'
save_data(_config.moderation.data, data)
end
return 'Group is now: public'
end
local function unset_public_membermod(msg, data, target)
if not is_momod(msg) then
return "For moderators only!"
end
local group_member_lock = data[tostring(target)]['settings']['public']
if group_member_lock == 'no' then
return 'Group is not public'
else
data[tostring(target)]['settings']['public'] = 'no'
save_data(_config.moderation.data, data)
return 'Group is now: not public'
end
end
local function lock_group_leave(msg, data, target)
if not is_momod(msg) then
return "For moderators only!"
end
local leave_ban = data[tostring(msg.to.id)]['settings']['leave_ban']
if leave_ban == 'yes' then
return 'Leaving users will be banned'
else
data[tostring(msg.to.id)]['settings']['leave_ban'] = 'yes'
save_data(_config.moderation.data, data)
end
return 'Leaving users will be banned'
end
local function unlock_group_leave(msg, data, target)
if not is_momod(msg) then
return "For moderators only!"
end
local leave_ban = data[tostring(msg.to.id)]['settings']['leave_ban']
if leave_ban == 'no' then
return 'Leaving users will not be banned'
else
data[tostring(msg.to.id)]['settings']['leave_ban'] = 'no'
save_data(_config.moderation.data, data)
return 'Leaving users will not be banned'
end
end
local function unlock_group_photomod(msg, data, target)
if not is_momod(msg) then
return "For moderators only!"
end
local group_photo_lock = data[tostring(target)]['settings']['lock_photo']
if group_photo_lock == 'no' then
return 'Group photo is not locked'
else
data[tostring(target)]['settings']['lock_photo'] = 'no'
save_data(_config.moderation.data, data)
return 'Group photo has been unlocked'
end
end
local function set_rulesmod(msg, data, target)
if not is_momod(msg) then
return "For moderators only!"
end
local data_cat = 'rules'
data[tostring(target)][data_cat] = rules
save_data(_config.moderation.data, data)
return 'Set group rules to:\n'..rules
end
local function modadd(msg)
-- superuser and admins only (because sudo are always has privilege)
if not is_admin(msg) then
return "You're not admin"
end
local data = load_data(_config.moderation.data)
if is_group(msg) then
return 'Group is already added.'
end
receiver = get_receiver(msg)
chat_info(receiver, check_member_modadd,{receiver=receiver, data=data, msg = msg})
end
local function realmadd(msg)
-- superuser and admins only (because sudo are always has privilege)
if not is_admin(msg) then
return "You're not admin"
end
local data = load_data(_config.moderation.data)
if is_realm(msg) then
return 'Realm is already added.'
end
receiver = get_receiver(msg)
chat_info(receiver, check_member_realm_add,{receiver=receiver, data=data, msg = msg})
end
-- Global functions
function modrem(msg)
-- superuser and admins only (because sudo are always has privilege)
if not is_admin(msg) then
return "You're not admin"
end
local data = load_data(_config.moderation.data)
if not is_group(msg) then
return 'Group is not added.'
end
receiver = get_receiver(msg)
chat_info(receiver, check_member_modrem,{receiver=receiver, data=data, msg = msg})
end
function realmrem(msg)
-- superuser and admins only (because sudo are always has privilege)
if not is_admin(msg) then
return "You're not admin"
end
local data = load_data(_config.moderation.data)
if not is_realm(msg) then
return 'Realm is not added.'
end
receiver = get_receiver(msg)
chat_info(receiver, check_member_realmrem,{receiver=receiver, data=data, msg = msg})
end
local function get_rules(msg, data)
local data_cat = 'rules'
if not data[tostring(msg.to.id)][data_cat] then
return 'No rules available.'
end
local rules = data[tostring(msg.to.id)][data_cat]
local rules = 'Chat rules:\n'..rules
return rules
end
local function set_group_photo(msg, success, result)
local data = load_data(_config.moderation.data)
local receiver = get_receiver(msg)
if success then
local file = 'data/photos/chat_photo_'..msg.to.id..'.jpg'
print('File downloaded to:', result)
os.rename(result, file)
print('File moved to:', file)
chat_set_photo (receiver, file, ok_cb, false)
data[tostring(msg.to.id)]['settings']['set_photo'] = file
save_data(_config.moderation.data, data)
data[tostring(msg.to.id)]['settings']['lock_photo'] = 'yes'
save_data(_config.moderation.data, data)
send_large_msg(receiver, 'Photo saved!', ok_cb, false)
else
print('Error downloading: '..msg.id)
send_large_msg(receiver, 'Failed, please try again!', ok_cb, false)
end
end
local function promote(receiver, member_username, member_id)
local data = load_data(_config.moderation.data)
local group = string.gsub(receiver, 'chat#id', '')
if not data[group] then
return send_large_msg(receiver, 'Group is not added.')
end
if data[group]['moderators'][tostring(member_id)] then
return send_large_msg(receiver, member_username..' is already a moderator.')
end
data[group]['moderators'][tostring(member_id)] = member_username
save_data(_config.moderation.data, data)
return send_large_msg(receiver, member_username..' has been promoted.')
end
local function promote_by_reply(extra, success, result)
local msg = result
local full_name = (msg.from.first_name or '')..' '..(msg.from.last_name or '')
if msg.from.username then
member_username = '@'.. msg.from.username
else
member_username = full_name
end
local member_id = msg.from.id
if msg.to.type == 'chat' then
return promote(get_receiver(msg), member_username, member_id)
end
end
local function demote(receiver, member_username, member_id)
local data = load_data(_config.moderation.data)
local group = string.gsub(receiver, 'chat#id', '')
if not data[group] then
return send_large_msg(receiver, 'Group is not added.')
end
if not data[group]['moderators'][tostring(member_id)] then
return send_large_msg(receiver, member_username..' is not a moderator.')
end
data[group]['moderators'][tostring(member_id)] = nil
save_data(_config.moderation.data, data)
return send_large_msg(receiver, member_username..' has been demoted.')
end
local function demote_by_reply(extra, success, result)
local msg = result
local full_name = (msg.from.first_name or '')..' '..(msg.from.last_name or '')
if msg.from.username then
member_username = '@'..msg.from.username
else
member_username = full_name
end
local member_id = msg.from.id
if msg.to.type == 'chat' then
return demote(get_receiver(msg), member_username, member_id)
end
end
local function setowner_by_reply(extra, success, result)
local msg = result
local receiver = get_receiver(msg)
local data = load_data(_config.moderation.data)
local name_log = msg.from.print_name:gsub("_", " ")
data[tostring(msg.to.id)]['set_owner'] = tostring(msg.from.id)
save_data(_config.moderation.data, data)
savelog(msg.to.id, name_log.." ["..msg.from.id.."] setted ["..msg.from.id.."] as owner")
local text = msg.from.print_name:gsub("_", " ").." is the owner now"
return send_large_msg(receiver, text)
end
local function promote_demote_res(extra, success, result)
--vardump(result)
--vardump(extra)
local member_id = result.id
local member_username = "@"..result.username
local chat_id = extra.chat_id
local mod_cmd = extra.mod_cmd
local receiver = "chat#id"..chat_id
if mod_cmd == 'promote' then
return promote(receiver, member_username, member_id)
elseif mod_cmd == 'demote' then
return demote(receiver, member_username, member_id)
end
end
local function modlist(msg)
local data = load_data(_config.moderation.data)
local groups = "groups"
if not data[tostring(groups)][tostring(msg.to.id)] then
return 'Group is not added.'
end
-- determine if table is empty
if next(data[tostring(msg.to.id)]['moderators']) == nil then --fix way
return 'No moderator in this group.'
end
local i = 1
local message = '\nList of moderators for ' .. string.gsub(msg.to.print_name, '_', ' ') .. ':\n'
for k,v in pairs(data[tostring(msg.to.id)]['moderators']) do
message = message ..i..' - '..v..' [' ..k.. '] \n'
i = i + 1
end
return message
end
local function callbackres(extra, success, result)
--vardump(result)
local user = result.id
local name = string.gsub(result.print_name, "_", " ")
local chat = 'chat#id'..extra.chatid
send_large_msg(chat, user..'\n'..name)
return user
end
local function help()
local help_text = tostring(_config.help_text)
return help_text
end
local function cleanmember(cb_extra, success, result)
local receiver = cb_extra.receiver
local chat_id = "chat#id"..result.id
local chatname = result.print_name
for k,v in pairs(result.members) do
kick_user(v.id, result.id)
end
end
local function killchat(cb_extra, success, result)
local receiver = cb_extra.receiver
local chat_id = "chat#id"..result.id
local chatname = result.print_name
for k,v in pairs(result.members) do
kick_user_any(v.id, result.id)
end
end
local function killrealm(cb_extra, success, result)
local receiver = cb_extra.receiver
local chat_id = "chat#id"..result.id
local chatname = result.print_name
for k,v in pairs(result.members) do
kick_user_any(v.id, result.id)
end
end
local function user_msgs(user_id, chat_id)
local user_info
local uhash = 'user:'..user_id
local user = redis:hgetall(uhash)
local um_hash = 'msgs:'..user_id..':'..chat_id
user_info = tonumber(redis:get(um_hash) or 0)
return user_info
end
local function kick_zero(cb_extra, success, result)
local chat_id = cb_extra.chat_id
local chat = "chat#id"..chat_id
local ci_user
local re_user
for k,v in pairs(result.members) do
local si = false
ci_user = v.id
local hash = 'chat:'..chat_id..':users'
local users = redis:smembers(hash)
for i = 1, #users do
re_user = users[i]
if tonumber(ci_user) == tonumber(re_user) then
si = true
end
end
if not si then
if ci_user ~= our_id then
if not is_momod2(ci_user, chat_id) then
chat_del_user(chat, 'user#id'..ci_user, ok_cb, true)
end
end
end
end
end
local function kick_inactive(chat_id, num, receiver)
local hash = 'chat:'..chat_id..':users'
local users = redis:smembers(hash)
-- Get user info
for i = 1, #users do
local user_id = users[i]
local user_info = user_msgs(user_id, chat_id)
local nmsg = user_info
if tonumber(nmsg) < tonumber(num) then
if not is_momod2(user_id, chat_id) then
chat_del_user('chat#id'..chat_id, 'user#id'..user_id, ok_cb, true)
end
end
end
return chat_info(receiver, kick_zero, {chat_id = chat_id})
end
local function run(msg, matches)
local data = load_data(_config.moderation.data)
local receiver = get_receiver(msg)
local name_log = user_print_name(msg.from)
local group = msg.to.id
if msg.media then
if msg.media.type == 'photo' and data[tostring(msg.to.id)]['settings']['set_photo'] == 'waiting' and is_chat_msg(msg) and is_momod(msg) then
load_photo(msg.id, set_group_photo, msg)
end
end
if matches[1] == 'add' and not matches[2] then
if is_realm(msg) then
return 'Error: Already a realm.'
end
print("group "..msg.to.print_name.."("..msg.to.id..") added")
return modadd(msg)
end
if matches[1] == 'add' and matches[2] == 'realm' then
if is_group(msg) then
return 'Error: Already a group.'
end
print("group "..msg.to.print_name.."("..msg.to.id..") added as a realm")
return realmadd(msg)
end
if matches[1] == 'rem' and not matches[2] then
print("group "..msg.to.print_name.."("..msg.to.id..") removed")
return modrem(msg)
end
if matches[1] == 'rem' and matches[2] == 'realm' then
print("group "..msg.to.print_name.."("..msg.to.id..") removed as a realm")
return realmrem(msg)
end
if matches[1] == 'chat_created' and msg.from.id == 0 and group_type == "group" then
return automodadd(msg)
end
if matches[1] == 'chat_created' and msg.from.id == 0 and group_type == "realm" then
return autorealmadd(msg)
end
if msg.to.id and data[tostring(msg.to.id)] then
local settings = data[tostring(msg.to.id)]['settings']
if matches[1] == 'chat_add_user' then
if not msg.service then
return "Are you trying to troll me?"
end
local group_member_lock = settings.lock_member
local user = 'user#id'..msg.action.user.id
local chat = 'chat#id'..msg.to.id
if group_member_lock == 'yes' and not is_owner2(msg.action.user.id, msg.to.id) then
chat_del_user(chat, user, ok_cb, true)
elseif group_member_lock == 'yes' and tonumber(msg.from.id) == tonumber(our_id) then
return nil
elseif group_member_lock == 'no' then
return nil
end
end
if matches[1] == 'chat_del_user' then
if not msg.service then
-- return "Are you trying to troll me?"
end
local user = 'user#id'..msg.action.user.id
local chat = 'chat#id'..msg.to.id
savelog(msg.to.id, name_log.." ["..msg.from.id.."] deleted user "..user)
end
if matches[1] == 'chat_delete_photo' then
if not msg.service then
return "Are you trying to troll me?"
end
local group_photo_lock = settings.lock_photo
if group_photo_lock == 'yes' then
local picturehash = 'picture:changed:'..msg.to.id..':'..msg.from.id
redis:incr(picturehash)
---
local picturehash = 'picture:changed:'..msg.to.id..':'..msg.from.id
local picprotectionredis = redis:get(picturehash)
if picprotectionredis then
if tonumber(picprotectionredis) == 4 and not is_owner(msg) then
kick_user(msg.from.id, msg.to.id)
end
if tonumber(picprotectionredis) == 8 and not is_owner(msg) then
ban_user(msg.from.id, msg.to.id)
local picturehash = 'picture:changed:'..msg.to.id..':'..msg.from.id
redis:set(picturehash, 0)
end
end
savelog(msg.to.id, name_log.." ["..msg.from.id.."] tried to deleted picture but failed ")
chat_set_photo(receiver, settings.set_photo, ok_cb, false)
elseif group_photo_lock == 'no' then
return nil
end
end
if matches[1] == 'chat_change_photo' and msg.from.id ~= 0 then
if not msg.service then
return "Are you trying to troll me?"
end
local group_photo_lock = settings.lock_photo
if group_photo_lock == 'yes' then
local picturehash = 'picture:changed:'..msg.to.id..':'..msg.from.id
redis:incr(picturehash)
---
local picturehash = 'picture:changed:'..msg.to.id..':'..msg.from.id
local picprotectionredis = redis:get(picturehash)
if picprotectionredis then
if tonumber(picprotectionredis) == 4 and not is_owner(msg) then
kick_user(msg.from.id, msg.to.id)
end
if tonumber(picprotectionredis) == 8 and not is_owner(msg) then
ban_user(msg.from.id, msg.to.id)
local picturehash = 'picture:changed:'..msg.to.id..':'..msg.from.id
redis:set(picturehash, 0)
end
end
savelog(msg.to.id, name_log.." ["..msg.from.id.."] tried to change picture but failed ")
chat_set_photo(receiver, settings.set_photo, ok_cb, false)
elseif group_photo_lock == 'no' then
return nil
end
end
if matches[1] == 'chat_rename' then
if not msg.service then
return "Are you trying to troll me?"
end
local group_name_set = settings.set_name
local group_name_lock = settings.lock_name
local to_rename = 'chat#id'..msg.to.id
if group_name_lock == 'yes' then
if group_name_set ~= tostring(msg.to.print_name) then
local namehash = 'name:changed:'..msg.to.id..':'..msg.from.id
redis:incr(namehash)
local namehash = 'name:changed:'..msg.to.id..':'..msg.from.id
local nameprotectionredis = redis:get(namehash)
if nameprotectionredis then
if tonumber(nameprotectionredis) == 4 and not is_owner(msg) then
kick_user(msg.from.id, msg.to.id)
end
if tonumber(nameprotectionredis) == 8 and not is_owner(msg) then
ban_user(msg.from.id, msg.to.id)
local namehash = 'name:changed:'..msg.to.id..':'..msg.from.id
redis:set(namehash, 0)
end
end
savelog(msg.to.id, name_log.." ["..msg.from.id.."] tried to change name but failed ")
rename_chat(to_rename, group_name_set, ok_cb, false)
end
elseif group_name_lock == 'no' then
return nil
end
end
if matches[1] == 'setname' and is_momod(msg) then
local new_name = string.gsub(matches[2], '_', ' ')
data[tostring(msg.to.id)]['settings']['set_name'] = new_name
save_data(_config.moderation.data, data)
local group_name_set = data[tostring(msg.to.id)]['settings']['set_name']
local to_rename = 'chat#id'..msg.to.id
rename_chat(to_rename, group_name_set, ok_cb, false)
savelog(msg.to.id, "Group { "..msg.to.print_name.." } name changed to [ "..new_name.." ] by "..name_log.." ["..msg.from.id.."]")
end
if matches[1] == 'setphoto' and is_momod(msg) then
data[tostring(msg.to.id)]['settings']['set_photo'] = 'waiting'
save_data(_config.moderation.data, data)
return 'Please send me new group photo now'
end
if matches[1] == 'promote' and not matches[2] then
if not is_owner(msg) then
return "Only the owner can prmote new moderators"
end
if type(msg.reply_id)~="nil" then
msgr = get_message(msg.reply_id, promote_by_reply, false)
end
end
if matches[1] == 'promote' and matches[2] then
if not is_momod(msg) then
return
end
if not is_owner(msg) then
return "Only owner can promote"
end
local member = matches[2]
savelog(msg.to.id, name_log.." ["..msg.from.id.."] promoted @".. member)
local cbres_extra = {
chat_id = msg.to.id,
mod_cmd = 'promote',
from_id = msg.from.id
}
local username = matches[2]
local username = string.gsub(matches[2], '@', '')
return res_user(username, promote_demote_res, cbres_extra)
end
if matches[1] == 'demote' and not matches[2] then
if not is_owner(msg) then
return "Only the owner can demote moderators"
end
if type(msg.reply_id)~="nil" then
msgr = get_message(msg.reply_id, demote_by_reply, false)
end
end
if matches[1] == 'demote' and matches[2] then
if not is_momod(msg) then
return
end
if not is_owner(msg) then
return "Only owner can demote"
end
if string.gsub(matches[2], "@", "") == msg.from.username and not is_owner(msg) then
return "You can't demote yourself"
end
local member = matches[2]
savelog(msg.to.id, name_log.." ["..msg.from.id.."] demoted @".. member)
local cbres_extra = {
chat_id = msg.to.id,
mod_cmd = 'demote',
from_id = msg.from.id
}
local username = matches[2]
local username = string.gsub(matches[2], '@', '')
return res_user(username, promote_demote_res, cbres_extra)
end
if matches[1] == 'modlist' then
savelog(msg.to.id, name_log.." ["..msg.from.id.."] requested group modlist")
return modlist(msg)
end
if matches[1] == 'about' then
savelog(msg.to.id, name_log.." ["..msg.from.id.."] requested group description")
return get_description(msg, data)
end
if matches[1] == 'rules' then
savelog(msg.to.id, name_log.." ["..msg.from.id.."] requested group rules")
return get_rules(msg, data)
end
if matches[1] == 'set' then
if matches[2] == 'rules' then
rules = matches[3]
local target = msg.to.id
savelog(msg.to.id, name_log.." ["..msg.from.id.."] has changed group rules to ["..matches[3].."]")
return set_rulesmod(msg, data, target)
end
if matches[2] == 'about' then
local data = load_data(_config.moderation.data)
local target = msg.to.id
local about = matches[3]
savelog(msg.to.id, name_log.." ["..msg.from.id.."] has changed group description to ["..matches[3].."]")
return set_descriptionmod(msg, data, target, about)
end
end
if matches[1] == 'lock' then
local target = msg.to.id
if matches[2] == 'name' then
savelog(msg.to.id, name_log.." ["..msg.from.id.."] locked name ")
return lock_group_namemod(msg, data, target)
end
if matches[2] == 'member' then
savelog(msg.to.id, name_log.." ["..msg.from.id.."] locked member ")
return lock_group_membermod(msg, data, target)
end
if matches[2] == 'flood' then
savelog(msg.to.id, name_log.." ["..msg.from.id.."] locked flood ")
return lock_group_floodmod(msg, data, target)
end
if matches[2] == 'arabic' then
savelog(msg.to.id, name_log.." ["..msg.from.id.."] locked arabic ")
return lock_group_arabic(msg, data, target)
end
if matches[2] == 'bots' then
savelog(msg.to.id, name_log.." ["..msg.from.id.."] locked bots ")
return lock_group_bots(msg, data, target)
end
if matches[2] == 'leave' then
savelog(msg.to.id, name_log.." ["..msg.from.id.."] locked leaving ")
return lock_group_leave(msg, data, target)
end
end
if matches[1] == 'unlock' then
local target = msg.to.id
if matches[2] == 'name' then
savelog(msg.to.id, name_log.." ["..msg.from.id.."] unlocked name ")
return unlock_group_namemod(msg, data, target)
end
if matches[2] == 'member' then
savelog(msg.to.id, name_log.." ["..msg.from.id.."] unlocked member ")
return unlock_group_membermod(msg, data, target)
end
if matches[2] == 'photo' then
savelog(msg.to.id, name_log.." ["..msg.from.id.."] unlocked photo ")
return unlock_group_photomod(msg, data, target)
end
if matches[2] == 'flood' then
savelog(msg.to.id, name_log.." ["..msg.from.id.."] unlocked flood ")
return unlock_group_floodmod(msg, data, target)
end
if matches[2] == 'arabic' then
savelog(msg.to.id, name_log.." ["..msg.from.id.."] unlocked arabic ")
return unlock_group_arabic(msg, data, target)
end
if matches[2] == 'bots' then
savelog(msg.to.id, name_log.." ["..msg.from.id.."] unlocked bots ")
return unlock_group_bots(msg, data, target)
end
if matches[2] == 'leave' then
savelog(msg.to.id, name_log.." ["..msg.from.id.."] unlocked leaving ")
return unlock_group_leave(msg, data, target)
end
end
if matches[1] == 'settings' then
local target = msg.to.id
savelog(msg.to.id, name_log.." ["..msg.from.id.."] requested group settings ")
return show_group_settingsmod(msg, data, target)
end
--[[if matches[1] == 'public' then
local target = msg.to.id
if matches[2] == 'yes' then
savelog(msg.to.id, name_log.." ["..msg.from.id.."] set group to: public")
return set_public_membermod(msg, data, target)
end
if matches[2] == 'no' then
savelog(msg.to.id, name_log.." ["..msg.from.id.."] set group to: not public")
return unset_public_membermod(msg, data, target)
end
end]]
if matches[1] == 'newlink' and not is_realm(msg) then
if not is_momod(msg) then
return "For moderators only!"
end
local function callback (extra , success, result)
local receiver = 'chat#'..msg.to.id
if success == 0 then
return send_large_msg(receiver, '*Error: Invite link failed* \nReason: Not creator.')
end
send_large_msg(receiver, "Created a new link")
data[tostring(msg.to.id)]['settings']['set_link'] = result
save_data(_config.moderation.data, data)
end
local receiver = 'chat#'..msg.to.id
savelog(msg.to.id, name_log.." ["..msg.from.id.."] revoked group link ")
return export_chat_link(receiver, callback, true)
end
if matches[1] == 'link' then
if not is_momod(msg) then
return "For moderators only!"
end
local group_link = data[tostring(msg.to.id)]['settings']['set_link']
if not group_link then
return "Create a link using /newlink first !"
end
savelog(msg.to.id, name_log.." ["..msg.from.id.."] requested group link ["..group_link.."]")
return "Group link:\n"..group_link
end
if matches[1] == 'setowner' and matches[2] then
if not is_owner(msg) then
return "For owner only!"
end
data[tostring(msg.to.id)]['set_owner'] = matches[2]
save_data(_config.moderation.data, data)
savelog(msg.to.id, name_log.." ["..msg.from.id.."] set ["..matches[2].."] as owner")
local text = matches[2].." added as owner"
return text
end
if matches[1] == 'setowner' and not matches[2] then
if not is_owner(msg) then
return "only for the owner!"
end
if type(msg.reply_id)~="nil" then
msgr = get_message(msg.reply_id, setowner_by_reply, false)
end
end
if matches[1] == 'owner' then
local group_owner = data[tostring(msg.to.id)]['set_owner']
if not group_owner then
return "no owner,ask admins in support groups to set owner for your group"
end
savelog(msg.to.id, name_log.." ["..msg.from.id.."] used /owner")
return "Group owner is ["..group_owner..']'
end
if matches[1] == 'setgpowner' then
local receiver = "chat#id"..matches[2]
if not is_admin(msg) then
return "For admins only!"
end
data[tostring(matches[2])]['set_owner'] = matches[3]
save_data(_config.moderation.data, data)
local text = matches[3].." added as owner"
send_large_msg(receiver, text)
return
end
if matches[1] == 'setflood' then
if not is_momod(msg) then
return "For moderators only!"
end
if tonumber(matches[2]) < 5 or tonumber(matches[2]) > 20 then
return "Wrong number,range is [5-20]"
end
local flood_max = matches[2]
data[tostring(msg.to.id)]['settings']['flood_msg_max'] = flood_max
save_data(_config.moderation.data, data)
savelog(msg.to.id, name_log.." ["..msg.from.id.."] set flood to ["..matches[2].."]")
return 'Group flood has been set to '..matches[2]
end
if matches[1] == 'clean' then
if not is_owner(msg) then
return "Only owner can clean"
end
if matches[2] == 'member' then
if not is_owner(msg) then
return "Only admins can clean members"
end
local receiver = get_receiver(msg)
chat_info(receiver, cleanmember, {receiver=receiver})
end
if matches[2] == 'modlist' then
if next(data[tostring(msg.to.id)]['moderators']) == nil then --fix way
return 'No moderator in this group.'
end
local message = '\nList of moderators for ' .. string.gsub(msg.to.print_name, '_', ' ') .. ':\n'
for k,v in pairs(data[tostring(msg.to.id)]['moderators']) do
data[tostring(msg.to.id)]['moderators'][tostring(k)] = nil
save_data(_config.moderation.data, data)
end
savelog(msg.to.id, name_log.." ["..msg.from.id.."] cleaned modlist")
end
if matches[2] == 'rules' then
local data_cat = 'rules'
data[tostring(msg.to.id)][data_cat] = nil
save_data(_config.moderation.data, data)
savelog(msg.to.id, name_log.." ["..msg.from.id.."] cleaned rules")
end
if matches[2] == 'about' then
local data_cat = 'description'
data[tostring(msg.to.id)][data_cat] = nil
save_data(_config.moderation.data, data)
savelog(msg.to.id, name_log.." ["..msg.from.id.."] cleaned about")
end
end
if matches[1] == 'kill' and matches[2] == 'chat' then
if not is_admin(msg) then
return nil
end
if not is_realm(msg) then
local receiver = get_receiver(msg)
return modrem(msg),
print("Closing Group..."),
chat_info(receiver, killchat, {receiver=receiver})
else
return 'This is a realm'
end
end
if matches[1] == 'kill' and matches[2] == 'realm' then
if not is_admin(msg) then
return nil
end
if not is_group(msg) then
local receiver = get_receiver(msg)
return realmrem(msg),
print("Closing Realm..."),
chat_info(receiver, killrealm, {receiver=receiver})
else
return 'This is a group'
end
end
if matches[1] == 'help' then
if not is_momod(msg) or is_realm(msg) then
return
end
savelog(msg.to.id, name_log.." ["..msg.from.id.."] Used /help")
return help()
end
if matches[1] == 'res' and is_momod(msg) then
local cbres_extra = {
chatid = msg.to.id
}
local username = matches[2]
local username = username:gsub("@","")
savelog(msg.to.id, name_log.." ["..msg.from.id.."] Used /res "..username)
return res_user(username, callbackres, cbres_extra)
end
if matches[1] == 'kickinactive' then
--send_large_msg('chat#id'..msg.to.id, 'I\'m in matches[1]')
if not is_momod(msg) then
return 'Only a moderator can kick inactive users'
end
local num = 1
if matches[2] then
num = matches[2]
end
local chat_id = msg.to.id
local receiver = get_receiver(msg)
return kick_inactive(chat_id, num, receiver)
end
end
end
return {
patterns = {
"^[!/](add)$",
"^[!/](add) (realm)$",
"^[!/](rem)$",
"^[!/](rem) (realm)$",
"^[!/](rules)$",
"^[!/](about)$",
"^[!/](setname) (.*)$",
"^[!/](setphoto)$",
"^[!/](promote) (.*)$",
"^[!/](promote)",
"^[!/](help)$",
"^[!/](clean) (.*)$",
"^[!/](kill) (chat)$",
"^[!/](kill) (realm)$",
"^[!/](demote) (.*)$",
"^[!/](demote)",
"^[!/](set) ([^%s]+) (.*)$",
"^[!/](lock) (.*)$",
"^[!/](setowner) (%d+)$",
"^[!/](setowner)",
"^[!/](owner)$",
"^[!/](res) (.*)$",
"^[!/](setgpowner) (%d+) (%d+)$",-- (group id) (owner id)
"^[!/](unlock) (.*)$",
"^[!/](setflood) (%d+)$",
"^[!/](settings)$",
-- "^[!/](public) (.*)$",
"^[!/](modlist)$",
"^[!/](newlink)$",
"^[!/](link)$",
"^[!/](kickinactive)$",
"^[!/](kickinactive) (%d+)$",
"%[(photo)%]",
"^!!tgservice (.+)$",
},
run = run
}
end
| gpl-2.0 |
Armyluix/darkstar | scripts/zones/Tavnazian_Safehold/npcs/Morangeart.lua | 38 | 1057 | -----------------------------------
-- Area: Tavnazian Safehold
-- NPC: Morangeart
-- Type: ENM Quest Activator
-- @zone: 26
-- @pos -74.308 -24.782 -28.475
--
-- Auto-Script: Requires Verification (Verified by Brawndo)
-----------------------------------
package.loaded["scripts/zones/Tavnazian_Safehold/TextIDs"] = nil;
-----------------------------------
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
player:startEvent(0x0208);
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/items/cup_of_chamomile_tea.lua | 18 | 1369 | -----------------------------------------
-- ID: 4603
-- Item: cup_of_chamomile_tea
-- Food Effect: 180Min, All Races
-----------------------------------------
-- Magic 8
-- Vitality -2
-- Charisma 2
-- Magic Regen While Healing 1
-----------------------------------------
require("scripts/globals/status");
-----------------------------------------
-- OnItemCheck
-----------------------------------------
function onItemCheck(target)
local result = 0;
if (target:hasStatusEffect(EFFECT_FOOD) == true or target:hasStatusEffect(EFFECT_FIELD_SUPPORT_FOOD) == true) then
result = 246;
end
return result;
end;
-----------------------------------------
-- OnItemUse
-----------------------------------------
function onItemUse(target)
target:addStatusEffect(EFFECT_FOOD,0,0,10800,4603);
end;
-----------------------------------------
-- onEffectGain Action
-----------------------------------------
function onEffectGain(target,effect)
target:addMod(MOD_MP, 8);
target:addMod(MOD_VIT, -2);
target:addMod(MOD_CHR, 2);
target:addMod(MOD_MPHEAL, 1);
end;
-----------------------------------------
-- onEffectLose Action
-----------------------------------------
function onEffectLose(target,effect)
target:delMod(MOD_MP, 8);
target:delMod(MOD_VIT, -2);
target:delMod(MOD_CHR, 2);
target:delMod(MOD_MPHEAL, 1);
end;
| gpl-3.0 |
JKGDevs/JediKnightGalaxies | JKGalaxies/glua/framework/modules/util.lua | 3 | 1748 | --[[ ------------------------------------------------
Ultra Utility Lua Framework
Utility Module
DO NOT MODIFY THIS FILE
This module provides some handy utility functions, such as (de)serialization of tables
--------------------------------------------------]]
-- Locals (for faster access, and because we're about to lose access to the globals)
local pairs = pairs
local pcall = pcall
local print = print
-- Start the util module, all subsequent functions are variables, are stored within the util. table, and access to the global environment is gone
module("util")
--[[----------------------------------------------------------------------------------------
util.SerializeTable
Converts a table into a tokenized string
-------------------------------------------------------------------------------------------]]
local function SerAddToken(s, token) -- Helper function
if s == "" then return token
return s .. " " .. token
end
function SerializeTable(t)
local str = ""
for k, v in pairs( t ) do
if type( k ) == "number" then
SerAddToken(tostring(k))
else
SerAddToken(string.format("%q", tostring(k)))
end
if type( v ) == "table" then
SerAddToken("{") -- Table start token
SerAddToken(SerializeTable( v ))
SerAddToken("}") -- Table end token
elseif type( v ) == "string" then
SerAddToken(string.format( "%q", v))
else
SerAddToken(tostring( v ))
end
end
return str
end
--[[----------------------------------------------------------------------------------------
hook.DeserializeTable
Converts a serialized table (tokenized string) into a table
-------------------------------------------------------------------------------------------]]
function DeserializeTable(str)
end
| gpl-2.0 |
Armyluix/darkstar | scripts/zones/Metalworks/npcs/Mythily.lua | 17 | 2013 | -----------------------------------
-- Area: Metalworks
-- NPC: Mythily
-- Type: Immigration NPC
-- @pos 94 -20 -8 237
-----------------------------------
require("scripts/globals/conquest");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
local new_nation = BASTOK;
local old_nation = player:getNation();
local rank = getNationRank(new_nation);
if (old_nation == new_nation) then
player:startEvent(0x016a,0,0,0,old_nation);
elseif (player:getCurrentMission(old_nation) ~= 255 or player:getVar("MissionStatus") ~= 0) then
player:startEvent(0x0169,0,0,0,new_nation);
elseif (old_nation ~= new_nation) then
local has_gil = 0;
local cost = 0;
if (rank == 1) then
cost = 40000;
elseif (rank == 2) then
cost = 12000;
elseif (rank == 3) then
cost = 4000;
end
if (player:getGil() >= cost) then
has_gil = 1
end
player:startEvent(0x0168,0,1,player:getRank(),new_nation,has_gil,cost);
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 == 0x0168 and option == 1) then
local new_nation = BASTOK;
local rank = getNationRank(new_nation);
local cost = 0;
if (rank == 1) then
cost = 40000;
elseif (rank == 2) then
cost = 12000;
elseif (rank == 3) then
cost = 4000;
end
player:setNation(new_nation)
player:setGil(player:getGil() - cost);
player:setRankPoints(0);
end
end; | gpl-3.0 |
abriasffxi/darkstar | scripts/zones/Toraimarai_Canal/npcs/Tome_of_Magic.lua | 10 | 1859 | -----------------------------------
-- Area: Toraimarai Canal
-- NPC: Tome of Magic ( Needed for Mission )
-- Involved In Windurst Mission 7-1
-- @zone 169
-- @pos 142 13 -13 169 <many>
-----------------------------------
package.loaded["scripts/zones/Toraimarai_Canal/TextIDs"] = nil;
require("scripts/zones/Toraimarai_Canal/TextIDs");
-----------------------------------
require("scripts/globals/settings");
require("scripts/globals/keyitems");
require("scripts/globals/quests");
require("scripts/globals/missions");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
local CurrentMission = player:getCurrentMission(WINDURST);
local npcId = npc:getID();
if (npcId == 17469832) then
if (CurrentMission == THE_SIXTH_MINISTRY and player:getVar("MissionStatus") == 1) then
player:startEvent(0x0045);
end
elseif (npcId == 17469828) then
player:startEvent(0x0041);
elseif (npcId == 17469829) then
player:startEvent(0x0042);
elseif (npcId == 17469830) then
player:startEvent(0x0043);
elseif (npcId == 17469831) then
player:startEvent(0x0044);
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 == 0x0045) then
player:setVar("MissionStatus",2);
end
end; | gpl-3.0 |
abriasffxi/darkstar | scripts/zones/Port_Windurst/npcs/Ryan.lua | 17 | 1762 | -----------------------------------
-- Area: Port Windurst
-- NPC: Ryan
-- Standard Merchant NPC
-----------------------------------
package.loaded["scripts/zones/Port_Windurst/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/shop");
require("scripts/zones/Port_Windurst/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
player:showText(npc,RYAN_SHOP_DIALOG);
stock = {
0x4100, 290, -- Bronze Axe
0x4097, 246, -- Bronze Sword
0x43B8, 5, -- Crossbow Bolt
0x3120, 235, -- Bronze Harness
0x3121, 2286, -- Brass Harness
0x31A0, 128, -- Bronze Mittens
0x31A1, 1255, -- Brass Mittens
0x3220, 191, -- Bronze Subligar
0x3221, 1840, -- Brass Subligar
0x32A0, 117, -- Bronze Leggings
0x32A1, 1140, -- Brass Leggings
0x3128, 1145, -- Kenpogi
0x31A8, 630, -- Tekko
0x3228, 915, -- Sitabaki
0x32A8, 584 -- Kyahan
}
showShop(player, WINDURST, 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 |
imrandomizer/Algorithm-Implementations | Bellman_Ford_Search/Lua/Yonaba/bellmanford.lua | 26 | 3025 | -- Bellman Ford single source shortest path search algorithm implementation
-- See : https://en.wikipedia.org/wiki/Bellman%E2%80%93Ford_algorithm
-- Notes : this is a generic implementation of Bellman Ford search algorithm.
-- It is devised to be used on waypoint graphs.
-- The BellmanFord class expects a handler to be initialized. Roughly said, the handler
-- is an interface between your graph and the search algorithm.
-- The passed-in handler should implement those functions.
-- handler.getNode(...) -> returns a Node (instance of node.lua)
-- handler.getAllNodes() -> returns an array list of all nodes in the graph
-- handler.getAllEdges() -> returns an array list of all edges in the graph
-- See utils/graph.lua for reference
-- The generic Node class provided (see utils/node.lua) should also be implemented
-- through the handler. Basically, it should describe how nodes are labelled
-- and tested for equality for a custom search space.
-- The following functions should be implemented:
-- function Node:initialize(...) -> creates a Node with custom attributes
-- function Node:toString() -> returns a unique string representation of
-- the node, for debug purposes
-- Dependencies
local class = require 'utils.class'
-- Clears nodes data between consecutive path requests.
local function resetForNextSearch(bellmanford)
local nodes = bellmanford.handler.getAllNodes()
for _, node in pairs(nodes) do
node.parent = nil
node.distance = math.huge
end
end
-- Builds and returns the path to the goal node
local function backtrace(node)
local path = {}
repeat
table.insert(path, 1, node)
node = node.parent
until not node
return path
end
-- Initializes Bellman Ford search with a custom handler
local BellmanFord = class()
function BellmanFord:initialize(handler)
self.handler = handler
end
-- Processes the graph for shortest paths
-- source : the starting node from which the search will spread.
-- target : the goal node
-- When done, the shortest path from one node to another can easily
-- backtraced by indexing the parent field of a node.
-- Return : if target supplied, returns the shortest path from source
-- to target.
function BellmanFord:process(source, target)
resetForNextSearch(self)
source.distance = 0
local nodes = self.handler.getAllNodes()
local edges = self.handler.getAllEdges()
-- Relaxing all edges |V| - 1 times
for i = 1, #nodes - 1 do
for i, edge in ipairs(edges) do
local u, v, w = edge.from, edge.to, edge.weight
local tempDistance = u.distance + w
if tempDistance < v.distance then
v.distance, v.parent = tempDistance, u
end
end
end
-- Checking for negative cycles
for i, edge in ipairs(edges) do
local u, v, w = edge.from, edge.to, edge.weight
local tempDistance = u.distance + w
assert(tempDistance >= v.distance, 'Negative cycle found!')
end
if target then return backtrace(target) end
end
return BellmanFord
| mit |
mbmahdiiii/mm | plugins/inpm.lua | 7 | 3232 | do
local function pairsByKeys (t, f)
local a = {}
for n in pairs(t) do table.insert(a, n) end
table.sort(a, f)
local i = 0 -- iterator variable
local iter = function () -- iterator function
i = i + 1
if a[i] == nil then return nil
else return a[i], t[a[i]]
end
end
return iter
end
local function chat_list(msg)
local data = load_data(_config.moderation.data)
local groups = 'groups'
if not data[tostring(groups)] then
return 'هیچ گروهی فعلا وجود ندارد'
end
local message = 'لیست گروه های ربات :\n*Use /join (ID) to join*\n\n '
for k,v in pairs(data[tostring(groups)]) do
local settings = data[tostring(v)]['settings']
for m,n in pairsByKeys(settings) do
if m == 'set_name' then
name = n
end
end
message = message .. '👥 '.. name .. ' (ID: ' .. v .. ')\n\n '
end
local file = io.open("./groups/lists/listed_groups.txt", "w")
file:write(message)
file:flush()
file:close()
return message
end
local function run(msg, matches)
if msg.to.type ~= 'chat' or is_sudo(msg) or is_admin(msg) and is_realm(msg) then
local data = load_data(_config.moderation.data)
if matches[1] == 'جوین' and data[tostring(matches[2])] then
if is_banned(msg.from.id, matches[2]) then
return 'شما از گروهه ا مسدودید.'
end
if is_gbanned(msg.from.id) then
return 'شما مسدود از همه ی گروه ها شدید.'
end
if data[tostring(matches[2])]['settings']['lock_member'] == 'yes' and not is_owner2(msg.from.id, matches[2]) then
return 'این گروه غیر قابل دسترسی هست.'
end
local chat_id = "chat#id"..matches[2]
local user_id = "user#id"..msg.from.id
chat_add_user(chat_id, user_id, ok_cb, false)
local group_name = data[tostring(matches[2])]['settings']['set_name']
return "شما را اضافه کردیم به گروهه:\n\n👥"..group_name.." (ای دی:"..matches[2]..")"
elseif matches[1] == 'جوین' and not data[tostring(matches[2])] then
return "این گروه پیدا نشد."
end
if matches[1] == 'chats'then
if is_admin(msg) and msg.to.type == 'chat' then
return chat_list(msg)
elseif msg.to.type ~= 'chat' then
return chat_list(msg)
end
end
if matches[1] == 'لیست گروه'then
if is_admin(msg) and msg.to.type == 'chat' then
send_document("chat#id"..msg.from.id, "./groups/lists/listed_groups.txt", ok_cb, false)
elseif msg.to.type ~= 'chat' then
send_document("user#id"..msg.from.id, "./groups/lists/listed_groups.txt", ok_cb, false)
end
end
end
end
return {
patterns = {
"^(گروه ها)$",
"^(لیست گروه)$",
"^(جوین) (.*)$",
"^(اخراجم کن) (.*)$",
"^!!tgservice (chat_add_user)$"
},
run = run,
}
end
| gpl-2.0 |
Armyluix/darkstar | scripts/zones/Port_Windurst/npcs/Paytah.lua | 38 | 1029 | -----------------------------------
-- Area: Port Windurst
-- NPC: Paytah
-- Type: Standard NPC
-- @zone: 240
-- @pos 77.550 -6 117.769
--
-- 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(0x0120);
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/zones/Windurst_Waters_[S]/npcs/HomePoint#1.lua | 27 | 1280 | -----------------------------------
-- Area: Windurst_Waters_[S]
-- NPC: HomePoint#1
-- @pos -32 -5 131 94
-----------------------------------
package.loaded["scripts/zones/Windurst_Waters_[S]/TextIDs"] = nil;
require("scripts/globals/settings");
require("scripts/zones/Windurst_Waters_[S]/TextIDs");
require("scripts/globals/homepoint");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
homepointMenu( player, 0x21fc, 70);
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 == 0x21fc) then
if (option == 1) then
player:setHomePoint();
player:messageSpecial(HOMEPOINT_SET);
else
hpTeleport( player, option);
end
end
end; | gpl-3.0 |
abriasffxi/darkstar | scripts/globals/titles.lua | 35 | 45755 | -----------------------------------
--
-- TITLES IDs
--
-----------------------------------
FODDERCHIEF_FLAYER = 1;
WARCHIEF_WRECKER = 2;
DREAD_DRAGON_SLAYER = 3;
OVERLORD_EXECUTIONER = 4;
DARK_DRAGON_SLAYER = 5;
ADAMANTKING_KILLER = 6;
BLACK_DRAGON_SLAYER = 7;
MANIFEST_MAULER = 8;
BEHEMOTHS_BANE = 9;
ARCHMAGE_ASSASSIN = 10;
HELLSBANE = 11;
GIANT_KILLER = 12;
LICH_BANISHER = 13;
JELLYBANE = 14;
BOGEYDOWNER = 15;
BEAKBENDER = 16;
SKULLCRUSHER = 17;
MORBOLBANE = 18;
GOLIATH_KILLER = 19;
MARYS_GUIDE = 20;
SIMURGH_POACHER = 21;
ROC_STAR = 22;
SERKET_BREAKER = 23;
CASSIENOVA = 24;
THE_HORNSPLITTER = 25;
TORTOISE_TORTURER = 26;
MON_CHERRY = 27;
BEHEMOTH_DETHRONER = 28;
THE_VIVISECTOR = 29;
DRAGON_ASHER = 30;
EXPEDITIONARY_TROOPER = 31;
BEARER_OF_THE_WISEWOMANS_HOPE = 32;
BEARER_OF_THE_EIGHT_PRAYERS = 33;
LIGHTWEAVER = 34;
DESTROYER_OF_ANTIQUITY = 35;
SEALER_OF_THE_PORTAL_OF_THE_GODS = 36;
BURIER_OF_THE_ILLUSION = 37;
-- Unused = 38;
FAMILY_COUNSELOR = 39;
-- Unused = 40;
GREAT_GRAPPLER_SCORPIO = 41;
BOND_FIXER = 42;
VAMPIRE_HUNTER_DMINUS = 43;
SHEEPS_MILK_DELIVERER = 44;
BEAN_CUISINE_SALTER = 45;
TOTAL_LOSER = 46;
DOCTOR_SHANTOTTOS_FLAVOR_OF_THE_MONTH = 47;
PILGRIM_TO_HOLLA = 48;
PILGRIM_TO_DEM = 49;
PILGRIM_TO_MEA = 50;
DAYBREAK_GAMBLER = 51;
THE_PIOUS_ONE = 52;
A_MOSS_KIND_PERSON = 53;
ENTRANCE_DENIED = 54;
APIARIST = 55;
RABBITER = 56;
ROYAL_GRAVE_KEEPER = 57;
COURIER_EXTRAORDINAIRE = 58;
RONFAURIAN_RESCUER = 59;
PICKPOCKET_PINCHER = 60;
FANG_FINDER = 61;
FAITH_LIKE_A_CANDLE = 62;
THE_PURE_ONE = 63;
LOST_CHILD_OFFICER = 64;
SILENCER_OF_THE_LAMBS = 65;
LOST_AMP_FOUND_OFFICER = 66;
GREEN_GROCER = 67;
THE_BENEVOLENT_ONE = 68;
KNIGHT_IN_TRAINING = 69;
LIZARD_SKINNER = 70;
BUG_CATCHER = 71;
SPELUNKER = 72;
ARMS_TRADER = 73;
TRAVELING_MEDICINE_MAN = 74;
CAT_SKINNER = 75;
CARP_DIEM = 76;
ADVERTISING_EXECUTIVE = 77;
THIRDRATE_ORGANIZER = 78;
SECONDRATE_ORGANIZER = 79;
FIRSTRATE_ORGANIZER = 80;
BASTOK_WELCOMING_COMMITTEE = 81;
SHELL_OUTER = 82;
BUCKET_FISHER = 83;
PURSUER_OF_THE_PAST = 84;
PURSUER_OF_THE_TRUTH = 85;
MOMMYS_HELPER = 86;
HOT_DOG = 87;
STAMPEDER = 88;
QIJIS_FRIEND = 89;
QIJIS_RIVAL = 90;
CONTEST_RIGGER = 91;
RINGBEARER = 92;
KULATZ_BRIDGE_COMPANION = 93;
BEADEAUX_SURVEYOR = 94;
AVENGER = 95;
TREASURE_SCAVENGER = 96;
AIRSHIP_DENOUNCER = 97;
ZERUHN_SWEEPER = 98;
TEARJERKER = 99;
CRAB_CRUSHER = 100;
STAR_OF_IFRIT = 101;
SORROW_DROWNER = 102;
BRYGIDAPPROVED = 103;
DRACHENFALL_ASCETIC = 104;
STEAMING_SHEEP_REGULAR = 105;
PURPLE_BELT = 106;
GUSTABERG_TOURIST = 107;
SAND_BLASTER = 108;
BLACK_DEATH = 109;
-- Unused = 110;
FRESH_NORTH_WINDS_RECRUIT = 111;
NEW_BEST_OF_THE_WEST_RECRUIT = 112;
NEW_BUUMAS_BOOMERS_RECRUIT = 113;
HEAVENS_TOWER_GATEHOUSE_RECRUIT = 114;
CAT_BURGLAR_GROUPIE = 115;
CRAWLER_CULLER = 116;
SAVIOR_OF_KNOWLEDGE = 117;
STARORDAINED_WARRIOR = 118;
LOWER_THAN_THE_LOWEST_TUNNEL_WORM = 119;
STAR_ONION_BRIGADE_MEMBER = 120;
STAR_ONION_BRIGADIER = 121;
QUICK_FIXER = 122;
FAKEMOUSTACHED_INVESTIGATOR = 123;
HAKKURURINKURUS_BENEFACTOR = 124;
SOB_SUPER_HERO = 125;
EDITORS_HATCHET_MAN = 126;
DOCTOR_SHANTOTTOS_GUINEA_PIG = 127;
SPOILSPORT = 128;
SUPER_MODEL = 129;
GHOSTIE_BUSTER = 130;
NIGHT_SKY_NAVIGATOR = 131;
FAST_FOOD_DELIVERER = 132;
CUPIDS_FLORIST = 133;
TARUTARU_MURDER_SUSPECT = 134;
HEXER_VEXER = 135;
CARDIAN_TUTOR = 136;
DELIVERER_OF_TEARFUL_NEWS = 137;
FOSSILIZED_SEA_FARER = 138;
DOWN_PIPER_PIPEUPPERER = 139;
KISSER_MAKEUPPER = 140;
TIMEKEEPER = 141;
FORTUNETELLER_IN_TRAINING = 142;
TORCHBEARER = 143;
TENSHODO_MEMBER = 144;
CHOCOBO_TRAINER = 145;
BRINGER_OF_BLISS = 146;
ACTIVIST_FOR_KINDNESS = 147;
ENVOY_TO_THE_NORTH = 148;
EXORCIST_IN_TRAINING = 149;
PROFESSIONAL_LOAFER = 150;
CLOCK_TOWER_PRESERVATIONIST = 151;
LIFE_SAVER = 152;
FOOLS_ERRAND_RUNNER = 153;
CARD_COLLECTOR = 154;
RESEARCHER_OF_CLASSICS = 155;
STREET_SWEEPER = 156;
MERCY_ERRAND_RUNNER = 157;
TWOS_COMPANY = 158;
BELIEVER_OF_ALTANA = 159;
TRADER_OF_MYSTERIES = 160;
TRADER_OF_ANTIQUITIES = 161;
TRADER_OF_RENOWN = 162;
BROWN_BELT = 163;
HORIZON_BREAKER = 164;
GOBLINS_EXCLUSIVE_FASHION_MANNEQUIN = 165;
SUMMIT_BREAKER = 166;
SKY_BREAKER = 167;
CLOUD_BREAKER = 168;
STAR_BREAKER = 169;
GREEDALOX = 170;
CERTIFIED_RHINOSTERY_VENTURER = 171;
CORDON_BLEU_FISHER = 172;
ACE_ANGLER = 173;
LU_SHANGLIKE_FISHER_KING = 174;
MATCHMAKER = 175;
ECOLOGIST = 176;
LIL_CUPID = 177;
THE_LOVE_DOCTOR = 178;
SAVIOR_OF_LOVE = 179;
HONORARY_CITIZEN_OF_SELBINA = 180;
PURVEYOR_IN_TRAINING = 181;
ONESTAR_PURVEYOR = 182;
TWOSTAR_PURVEYOR = 183;
THREESTAR_PURVEYOR = 184;
FOURSTAR_PURVEYOR = 185;
FIVESTAR_PURVEYOR = 186;
DOCTOR_YORANORAN_SUPPORTER = 187;
DOCTOR_SHANTOTTO_SUPPORTER = 188;
PROFESSOR_KORUMORU_SUPPORTER = 189;
RAINBOW_WEAVER = 190;
SHADOW_WALKER = 191;
HEIR_TO_THE_HOLY_CREST = 192;
BUSHIDO_BLADE = 193;
-- Unused = 194;
PARAGON_OF_PALADIN_EXCELLENCE = 195;
PARAGON_OF_BEASTMASTER_EXCELLENCE = 196;
PARAGON_OF_RANGER_EXCELLENCE = 197;
PARAGON_OF_DARK_KNIGHT_EXCELLENCE = 198;
PARAGON_OF_BARD_EXCELLENCE = 199;
PARAGON_OF_SAMURAI_EXCELLENCE = 200;
PARAGON_OF_DRAGOON_EXCELLENCE = 201;
PARAGON_OF_NINJA_EXCELLENCE = 202;
PARAGON_OF_SUMMONER_EXCELLENCE = 203;
-- Unused = 204;
-- Unused = 205;
NEW_ADVENTURER = 206;
CERTIFIED_ADVENTURER = 207;
SHADOW_BANISHER = 208;
TRIED_AND_TESTED_KNIGHT = 209;
DARK_SIDER = 210;
THE_FANGED_ONE = 211;
HAVE_WINGS_WILL_FLY = 212;
ANIMAL_TRAINER = 213;
WANDERING_MINSTREL = 214;
MOGS_MASTER = 215;
MOGS_KIND_MASTER = 216;
MOGS_EXCEPTIONALLY_KIND_MASTER = 217;
PARAGON_OF_WARRIOR_EXCELLENCE = 218;
PARAGON_OF_MONK_EXCELLENCE = 219;
PARAGON_OF_RED_MAGE_EXCELLENCE = 220;
PARAGON_OF_THIEF_EXCELLENCE = 221;
PARAGON_OF_BLACK_MAGE_EXCELLENCE = 222;
PARAGON_OF_WHITE_MAGE_EXCELLENCE = 223;
MOGS_LOVING_MASTER = 224;
-- Unused = 225;
ROYAL_ARCHER = 226;
ROYAL_SPEARMAN = 227;
ROYAL_SQUIRE = 228;
ROYAL_SWORDSMAN = 229;
ROYAL_CAVALIER = 230;
ROYAL_GUARD = 231;
GRAND_KNIGHT_OF_THE_REALM = 232;
GRAND_TEMPLE_KNIGHT = 233;
RESERVE_KNIGHT_CAPTAIN = 234;
ELITE_ROYAL_GUARD = 235;
LEGIONNAIRE = 236;
DECURION = 237;
CENTURION = 238;
JUNIOR_MUSKETEER = 239;
SENIOR_MUSKETEER = 240;
MUSKETEER_COMMANDER = 241;
GOLD_MUSKETEER = 242;
PRAEFECTUS = 243;
SENIOR_GOLD_MUSKETEER = 244;
PRAEFECTUS_CASTRORUM = 245;
FREESWORD = 246;
MERCENARY = 247;
MERCENARY_CAPTAIN = 248;
COMBAT_CASTER = 249;
TACTICIAN_MAGICIAN = 250;
WISE_WIZARD = 251;
PATRIARCH_PROTECTOR = 252;
CASTER_CAPTAIN = 253;
MASTER_CASTER = 254;
MERCENARY_MAJOR = 255;
FUGITIVE_MINISTER_BOUNTY_HUNTER = 256;
KING_OF_THE_OPOOPOS = 257;
EXCOMMUNICATE_OF_KAZHAM = 258;
KAZHAM_CALLER = 259;
DREAM_DWELLER = 260;
APPRENTICE_SOMMELIER = 261;
DESERT_HUNTER = 262;
SEEKER_OF_TRUTH = 263;
KUFTAL_TOURIST = 264;
THE_IMMORTAL_FISHER_LU_SHANG = 265;
LOOKS_SUBLIME_IN_A_SUBLIGAR = 266;
LOOKS_GOOD_IN_LEGGINGS = 267;
HONORARY_DOCTORATE_MAJORING_IN_TONBERRIES = 268;
TREASUREHOUSE_RANSACKER = 269;
CRACKER_OF_THE_SECRET_CODE = 270;
BLACK_MARKETEER = 271;
ACQUIRER_OF_ANCIENT_ARCANUM = 272;
YA_DONE_GOOD = 273;
HEIR_OF_THE_GREAT_FIRE = 274;
HEIR_OF_THE_GREAT_EARTH = 275;
HEIR_OF_THE_GREAT_WATER = 276;
HEIR_OF_THE_GREAT_WIND = 277;
HEIR_OF_THE_GREAT_ICE = 278;
HEIR_OF_THE_GREAT_LIGHTNING = 279;
GUIDER_OF_SOULS_TO_THE_SANCTUARY = 280;
BEARER_OF_BONDS_BEYOND_TIME = 281;
FRIEND_OF_THE_OPOOPOS = 282;
HERO_ON_BEHALF_OF_WINDURST = 283;
VICTOR_OF_THE_BALGA_CONTEST = 284;
GULLIBLES_TRAVELS = 285;
EVEN_MORE_GULLIBLES_TRAVELS = 286;
HEIR_OF_THE_NEW_MOON = 287;
ASSASSIN_REJECT = 288;
BLACK_BELT = 289;
VERMILLION_VENTURER = 290;
CERULEAN_SOLDIER = 291;
EMERALD_EXTERMINATOR = 292;
GUIDING_STAR = 293;
VESTAL_CHAMBERLAIN = 294;
SAN_DORIAN_ROYAL_HEIR = 295;
HERO_AMONG_HEROES = 296;
DYNAMISSAN_DORIA_INTERLOPER = 297;
DYNAMISBASTOK_INTERLOPER = 298;
DYNAMISWINDURST_INTERLOPER = 299;
DYNAMISJEUNO_INTERLOPER = 300;
DYNAMISBEAUCEDINE_INTERLOPER = 301;
DYNAMISXARCABARD_INTERLOPER = 302;
DISCERNING_INDIVIDUAL = 303;
VERY_DISCERNING_INDIVIDUAL = 304;
EXTREMELY_DISCERNING_INDIVIDUAL = 305;
ROYAL_WEDDING_PLANNER = 306;
CONSORT_CANDIDATE = 307;
OBSIDIAN_STORM = 308;
PENTACIDE_PERPETRATOR = 309;
WOOD_WORSHIPER = 310;
LUMBER_LATHER = 311;
ACCOMPLISHED_CARPENTER = 312;
ANVIL_ADVOCATE = 313;
FORGE_FANATIC = 314;
ACCOMPLISHED_BLACKSMITH = 315;
TRINKET_TURNER = 316;
SILVER_SMELTER = 317;
ACCOMPLISHED_GOLDSMITH = 318;
KNITTING_KNOWITALL = 319;
LOOM_LUNATIC = 320;
ACCOMPLISHED_WEAVER = 321;
FORMULA_FIDDLER = 322;
POTION_POTENTATE = 323;
ACCOMPLISHED_ALCHEMIST = 324;
BONE_BEAUTIFIER = 325;
SHELL_SCRIMSHANDER = 326;
ACCOMPLISHED_BONEWORKER = 327;
HIDE_HANDLER = 328;
LEATHER_LAUDER = 329;
ACCOMPLISHED_TANNER = 330;
FASTRIVER_FISHER = 331;
COASTLINE_CASTER = 332;
ACCOMPLISHED_ANGLER = 333;
GOURMAND_GRATIFIER = 334;
BANQUET_BESTOWER = 335;
ACCOMPLISHED_CHEF = 336;
FINE_TUNER = 337;
FRIEND_OF_THE_HELMED = 338;
TAVNAZIAN_SQUIRE = 339;
DUCAL_DUPE = 340;
HYPER_ULTRA_SONIC_ADVENTURER = 341;
ROD_RETRIEVER = 342;
DEED_VERIFIER = 343;
CHOCOBO_LOVE_GURU = 344;
PICKUP_ARTIST = 345;
TRASH_COLLECTOR = 346;
ANCIENT_FLAME_FOLLOWER = 347;
TAVNAZIAN_TRAVELER = 348;
TRANSIENT_DREAMER = 349;
THE_LOST_ONE = 350;
TREADER_OF_AN_ICY_PAST = 351;
BRANDED_BY_LIGHTNING = 352;
SEEKER_OF_THE_LIGHT = 353;
DEAD_BODY = 354;
FROZEN_DEAD_BODY = 355;
DREAMBREAKER = 356;
MIST_MELTER = 357;
DELTA_ENFORCER = 358;
OMEGA_OSTRACIZER = 359;
ULTIMA_UNDERTAKER = 360;
ULMIAS_SOULMATE = 361;
TENZENS_ALLY = 362;
COMPANION_OF_LOUVERANCE = 363;
TRUE_COMPANION_OF_LOUVERANCE = 364;
PRISHES_BUDDY = 365;
NAGMOLADAS_UNDERLING = 366;
ESHANTARLS_COMRADE_IN_ARMS = 367;
THE_CHEBUKKIS_WORST_NIGHTMARE = 368;
BROWN_MAGE_GUINEA_PIG = 369;
BROWN_MAGIC_BYPRODUCT = 370;
BASTOKS_SECOND_BEST_DRESSED = 371;
ROOKIE_HERO_INSTRUCTOR = 372;
GOBLIN_IN_DISGUISE = 373;
APOSTATE_FOR_HIRE = 374;
TALKS_WITH_TONBERRIES = 375;
ROOK_BUSTER = 376;
BANNERET = 377;
GOLD_BALLI_STAR = 378;
MYTHRIL_BALLI_STAR = 379;
SILVER_BALLI_STAR = 380;
BRONZE_BALLI_STAR = 381;
SEARING_STAR = 382;
STRIKING_STAR = 383;
SOOTHING_STAR = 384;
SABLE_STAR = 385;
SCARLET_STAR = 386;
SONIC_STAR = 387;
SAINTLY_STAR = 388;
SHADOWY_STAR = 389;
SAVAGE_STAR = 390;
SINGING_STAR = 391;
SNIPING_STAR = 392;
SLICING_STAR = 393;
SNEAKING_STAR = 394;
SPEARING_STAR = 395;
SUMMONING_STAR = 396;
PUTRID_PURVEYOR_OF_PUNGENT_PETALS = 397;
UNQUENCHABLE_LIGHT = 398;
BALLISTAGER = 399;
ULTIMATE_CHAMPION_OF_THE_WORLD = 400;
WARRIOR_OF_THE_CRYSTAL = 401;
INDOMITABLE_FISHER = 402;
AVERTER_OF_THE_APOCALYPSE = 403;
BANISHER_OF_EMPTINESS = 404;
RANDOM_ADVENTURER = 405;
IRRESPONSIBLE_ADVENTURER = 406;
ODOROUS_ADVENTURER = 407;
INSIGNIFICANT_ADVENTURER = 408;
FINAL_BALLI_STAR = 409;
BALLI_STAR_ROYALE = 410;
DESTINED_FELLOW = 411;
ORCISH_SERJEANT = 412;
BRONZE_QUADAV = 413;
YAGUDO_INITIATE = 414;
MOBLIN_KINSMAN = 415;
SIN_HUNTER_HUNTER = 416;
DISCIPLE_OF_JUSTICE = 417;
MONARCH_LINN_PATROL_GUARD = 418;
TEAM_PLAYER = 419;
WORTHY_OF_TRUST = 420;
CONQUEROR_OF_FATE = 421;
BREAKER_OF_THE_CHAINS = 422;
A_FRIEND_INDEED = 423;
HEIR_TO_THE_REALM_OF_DREAMS = 424;
GOLD_HOOK = 425;
MYTHRIL_HOOK = 426;
SILVER_HOOK = 427;
COPPER_HOOK = 428;
-- Unused = 429;
DYNAMISVALKURM_INTERLOPER = 430;
DYNAMISBUBURIMU_INTERLOPER = 431;
DYNAMISQUFIM_INTERLOPER = 432;
DYNAMISTAVNAZIA_INTERLOPER = 433;
CONFRONTER_OF_NIGHTMARES = 434;
DISTURBER_OF_SLUMBER = 435;
INTERRUPTER_OF_DREAMS = 436;
SAPPHIRE_STAR = 437;
SURGING_STAR = 438;
SWAYING_STAR = 439;
DARK_RESISTANT = 440;
BEARER_OF_THE_MARK_OF_ZAHAK = 441;
SEAGULL_PHRATRIE_CREW_MEMBER = 442;
PROUD_AUTOMATON_OWNER = 443;
PRIVATE_SECOND_CLASS = 444;
PRIVATE_FIRST_CLASS = 445;
SUPERIOR_PRIVATE = 446;
WILDCAT_PUBLICIST = 447;
ADAMANTKING_USURPER = 448;
OVERLORD_OVERTHROWER = 449;
DEITY_DEBUNKER = 450;
FAFNIR_SLAYER = 451;
ASPIDOCHELONE_SINKER = 452;
NIDHOGG_SLAYER = 453;
MAAT_MASHER = 454;
KIRIN_CAPTIVATOR = 455;
CACTROT_DESACELERADOR = 456;
LIFTER_OF_SHADOWS = 457;
TIAMAT_TROUNCER = 458;
VRTRA_VANQUISHER = 459;
WORLD_SERPENT_SLAYER = 460;
XOLOTL_XTRAPOLATOR = 461;
BOROKA_BELEAGUERER = 462;
OURYU_OVERWHELMER = 463;
VINEGAR_EVAPORATOR = 464;
VIRTUOUS_SAINT = 465;
BYEBYE_TAISAI = 466;
TEMENOS_LIBERATOR = 467;
APOLLYON_RAVAGER = 468;
WYRM_ASTONISHER = 469;
NIGHTMARE_AWAKENER = 470;
CERBERUS_MUZZLER = 471;
HYDRA_HEADHUNTER = 472;
SHINING_SCALE_RIFLER = 473;
TROLL_SUBJUGATOR = 474;
GORGONSTONE_SUNDERER = 475;
KHIMAIRA_CARVER = 476;
ELITE_EINHERJAR = 477;
STAR_CHARIOTEER = 478;
SUN_CHARIOTEER = 479;
SUBDUER_OF_THE_MAMOOL_JA = 480;
SUBDUER_OF_THE_TROLLS = 481;
SUBDUER_OF_THE_UNDEAD_SWARM = 482;
AGENT_OF_THE_ALLIED_FORCES = 483;
SCENIC_SNAPSHOTTER = 484;
BRANDED_BY_THE_FIVE_SERPENTS = 485;
IMMORTAL_LION = 486;
PARAGON_OF_BLUE_MAGE_EXCELLENCE = 487;
PARAGON_OF_CORSAIR_EXCELLENCE = 488;
PARAGON_OF_PUPPETMASTER_EXCELLENCE = 489;
LANCE_CORPORAL = 490;
CORPORAL = 491;
MASTER_OF_AMBITION = 492;
MASTER_OF_CHANCE = 493;
MASTER_OF_MANIPULATION = 494;
OVJANGS_ERRAND_RUNNER = 495;
SERGEANT = 496;
SERGEANT_MAJOR = 497;
KARABABAS_TOUR_GUIDE = 498;
KARABABAS_BODYGUARD = 499;
KARABABAS_SECRET_AGENT = 500;
SKYSERPENT_AGGRANDIZER = 501;
CHIEF_SERGEANT = 502;
APHMAUS_MERCENARY = 503;
NASHMEIRAS_MERCENARY = 504;
CHOCOROOKIE = 505;
SECOND_LIEUTENANT = 506;
GALESERPENT_GUARDIAN = 507;
STONESERPENT_SHOCKTROOPER = 508;
PHOTOPTICATOR_OPERATOR = 509;
SALAHEEMS_RISK_ASSESSOR = 510;
TREASURE_TROVE_TENDER = 511;
GESSHOS_MERCY = 512;
EMISSARY_OF_THE_EMPRESS = 513;
ENDYMION_PARATROOPER = 514;
NAJAS_COMRADEINARMS = 515;
NASHMEIRAS_LOYALIST = 516;
PREVENTER_OF_RAGNAROK = 517;
CHAMPION_OF_AHT_URHGAN = 518;
FIRST_LIEUTENANT = 519;
CAPTAIN = 520;
CRYSTAL_STAKES_CUPHOLDER = 521;
WINNING_OWNER = 522;
VICTORIOUS_OWNER = 523;
TRIUMPHANT_OWNER = 524;
HIGH_ROLLER = 525;
FORTUNES_FAVORITE = 526;
SUPERHERO = 527;
SUPERHEROINE = 528;
BLOODY_BERSERKER = 529;
THE_SIXTH_SERPENT = 530;
ETERNAL_MERCENARY = 531;
SPRINGSERPENT_SENTRY = 532;
SPRIGHTLY_STAR = 533;
SAGACIOUS_STAR = 534;
SCHULTZ_SCHOLAR = 535;
KNIGHT_OF_THE_IRON_RAM = 536;
FOURTH_DIVISION_SOLDIER = 537;
COBRA_UNIT_MERCENARY = 538;
WINDTALKER = 539;
LADY_KILLER = 540;
TROUPE_BRILIOTH_DANCER = 541;
CAIT_SITHS_ASSISTANT = 542;
AJIDOMARUJIDOS_MINDER = 543;
COMET_CHARIOTEER = 544;
MOON_CHARIOTEER = 545;
SANDWORM_WRANGLER = 546;
IXION_HORNBREAKER = 547;
LAMBTON_WORM_DESEGMENTER = 548;
PANDEMONIUM_QUELLER = 549;
DEBASER_OF_DYNASTIES = 550;
DISPERSER_OF_DARKNESS = 551;
ENDER_OF_IDOLATRY = 552;
LUGH_EXORCIST = 553;
ELATHA_EXORCIST = 554;
ETHNIU_EXORCIST = 555;
TETHRA_EXORCIST = 556;
BUARAINECH_EXORCIST = 557;
OUPIRE_IMPALER = 558;
SCYLLA_SKINNER = 559;
ZIRNITRA_WINGCLIPPER = 560;
DAWON_TRAPPER = 561;
KRABKATOA_STEAMER = 562;
ORCUS_TROPHY_HUNTER = 563;
BLOBDINGNAG_BURSTER = 564;
VERTHANDI_ENSNARER = 565;
RUTHVEN_ENTOMBER = 566;
YILBEGAN_HIDEFLAYER = 567;
TORCHBEARER_OF_THE_1ST_WALK = 568;
TORCHBEARER_OF_THE_2ND_WALK = 569;
TORCHBEARER_OF_THE_3RD_WALK = 570;
TORCHBEARER_OF_THE_4TH_WALK = 571;
TORCHBEARER_OF_THE_5TH_WALK = 572;
TORCHBEARER_OF_THE_6TH_WALK = 573;
TORCHBEARER_OF_THE_7TH_WALK = 574;
TORCHBEARER_OF_THE_8TH_WALK = 575;
FURNITURE_STORE_OWNER = 576;
ARMORY_OWNER = 577;
JEWELRY_STORE_OWNER = 578;
BOUTIQUE_OWNER = 579;
APOTHECARY_OWNER = 580;
CURIOSITY_SHOP_OWNER = 581;
SHOESHOP_OWNER = 582;
FISHMONGER_OWNER = 583;
RESTAURANT_OWNER = 584;
ASSISTANT_DETECTIVE = 585;
PROMISING_DANCER = 586;
STARDUST_DANCER = 587;
ELEGANT_DANCER = 588;
DAZZLING_DANCE_DIVA = 589;
FRIEND_OF_LEHKO_HABHOKA = 590;
SUMMA_CUM_LAUDE = 591;
GRIMOIRE_BEARER = 592;
SEASONING_CONNOISSEUR = 593;
FINE_YOUNG_GRIFFON = 594;
BABBANS_TRAVELING_COMPANION = 595;
FELLOW_FORTIFIER = 596;
CHOCOCHAMPION = 597;
TRAVERSER_OF_TIME = 598;
MYTHRIL_MUSKETEER_NO_6 = 599;
JEWEL_OF_THE_COBRA_UNIT = 600;
KNIGHT_OF_THE_SWIFTWING_GRIFFIN = 601;
WYRMSWORN_PROTECTOR = 602;
FLAMESERPENT_FACILITATOR = 603;
MAZE_WANDERER = 604;
MAZE_NAVIGATOR = 605;
MAZE_SCHOLAR = 606;
MAZE_ARTISAN = 607;
MAZE_OVERLORD = 608;
SWARMINATOR = 609;
BATTLE_OF_JEUNO_VETERAN = 610;
GRAND_GREEDALOX = 611;
KARAHABARUHAS_RESEARCH_ASSISTANT = 612;
HONORARY_KNIGHT_OF_THE_CARDINAL_STAG = 613;
DETECTOR_OF_DECEPTION = 614;
SILENCER_OF_THE_ECHO = 615;
BESTRIDER_OF_FUTURES = 616;
MOG_HOUSE_HANDYPERSON = 617;
PRESIDENTIAL_PROTECTOR = 618;
THE_MOONS_COMPANION = 619;
ARRESTER_OF_THE_ASCENSION = 620;
HOUSE_AURCHIAT_RETAINER = 621;
WANDERER_OF_TIME = 622;
SMITER_OF_THE_SHADOW = 623;
HEIR_OF_THE_BLESSED_RADIANCE = 624;
HEIR_OF_THE_BLIGHTED_GLOOM = 625;
SWORN_TO_THE_DARK_DIVINITY = 626;
TEMPERER_OF_MYTHRIL = 627;
STAR_IN_THE_AZURE_SKY = 628;
FANGMONGER_FORESTALLER = 629;
VISITOR_TO_ABYSSEA = 630;
FRIEND_OF_ABYSSEA = 631;
WARRIOR_OF_ABYSSEA = 632;
STORMER_OF_ABYSSEA = 633;
DEVASTATOR_OF_ABYSSEA = 634;
HERO_OF_ABYSSEA = 635;
CHAMPION_OF_ABYSSEA = 636;
CONQUEROR_OF_ABYSSEA = 637;
SAVIOR_OF_ABYSSEA = 638;
VANQUISHER_OF_SPITE = 639;
HADHAYOSH_HALTERER = 640;
BRIAREUS_FELLER = 641;
KARKINOS_CLAWCRUSHER = 642;
CARABOSSE_QUASHER = 643;
OVNI_OBLITERATOR = 644;
RUMINATOR_CONFOUNDER = 645;
ECCENTRICITY_EXPUNGER = 646;
FISTULE_DRAINER = 647;
KUKULKAN_DEFANGER = 648;
TURUL_GROUNDER = 649;
BLOODEYE_BANISHER = 650;
SATIATOR_DEPRIVER = 651;
IRATHAM_CAPTURER = 652;
LACOVIE_CAPSIZER = 653;
CHLORIS_UPROOTER = 654;
MYRMECOLEON_TAMER = 655;
GLAVOID_STAMPEDER = 656;
USURPER_DEPOSER = 657;
YAANEI_CRASHER = 658;
KUTHAREI_UNHORSER = 659;
SIPPOY_CAPTURER = 660;
TITLACAUAN_DISMEMBERER = 661;
SMOK_DEFOGGER = 662;
AMHULUK_INUNDATER = 663;
PULVERIZER_DISMANTLER = 664;
DURINN_DECEIVER = 665;
KARKADANN_EXOCULATOR = 666;
ULHUADSHI_DESICCATOR = 667;
ITZPAPALOTL_DECLAWER = 668;
SOBEK_MUMMIFIER = 669;
CIREINCROIN_HARPOONER = 670;
BUKHIS_TETHERER = 671;
SEDNA_TUSKBREAKER = 672;
CLEAVER_DISMANTLER = 673;
EXECUTIONER_DISMANTLER = 674;
SEVERER_DISMANTLER = 675;
LUSCA_DEBUNKER = 676;
TRISTITIA_DELIVERER = 677;
KETEA_BEACHER = 678;
RANI_DECROWNER = 679;
ORTHRUS_DECAPITATOR = 680;
DRAGUA_SLAYER = 681;
BENNU_DEPLUMER = 682;
HEDJEDJET_DESTINGER = 683;
CUIJATENDER_DESICCATOR = 684;
BRULO_EXTINGUISHER = 685;
PANTOKRATOR_DISPROVER = 686;
APADEMAK_ANNIHILATOR = 687;
ISGEBIND_DEFROSTER = 688;
RESHEPH_ERADICATOR = 689;
EMPOUSA_EXPURGATOR = 690;
INDRIK_IMMOLATOR = 691;
OGOPOGO_OVERTURNER = 692;
RAJA_REGICIDE = 693;
ALFARD_DETOXIFIER = 694;
AZDAJA_ABOLISHER = 695;
AMPHITRITE_SHUCKER = 696;
FUATH_PURIFIER = 697;
KILLAKRIQ_EXCORIATOR = 698;
MAERE_BESTIRRER = 699;
WYRM_GOD_DEFIER = 700;
HAHAVA_CONDEMNER = 701;
CELAENO_SILENCER = 702;
VOIDWROUGHT_DECONSTRUCTOR = 703;
DEVOURER_OF_SHADOWS = 704;
KAGGEN_CLOBBERER = 705;
AKVAN_ABSTERGER = 706;
PIL_UNFROCKER = 707;
QILIN_CONTRAVENER = 708;
UPTALA_REPROBATOR = 709;
AELLO_ABATOR = 710;
TORCHBEARER_OF_THE_9TH_WALK = 711;
TORCHBEARER_OF_THE_10TH_WALK = 712;
TORCHBEARER_OF_THE_11TH_WALK = 713;
NIGHTMARE_ILLUMINATOR = 714;
GAUNAB_GUTTER = 715;
KALASUTRAX_CREMATOR = 716;
OCYTHOE_OVERRIDER = 717;
IG_ALIMA_INHUMER = 718;
BOTULUS_REX_ENGORGER = 719;
TORCHBEARER_OF_THE_12TH_WALK = 720;
TORCHBEARER_OF_THE_13TH_WALK = 721;
TORCHBEARER_OF_THE_14TH_WALK = 722;
TORCHBEARER_OF_THE_15TH_WALK = 723;
DELVER_OF_THE_DEPTHS = 724;
SUBJUGATOR_OF_THE_LOFTY = 725;
SUBJUGATOR_OF_THE_MIRED = 726;
SUBJUGATOR_OF_THE_SOARING = 727;
SUBJUGATOR_OF_THE_VEILED = 728;
LEGENDARY_LEGIONNAIRE = 729;
WITNESS_TO_PROVENANCE = 730;
BISMARCK_FLENSER = 731;
MORTA_EXTIRPATOR = 732;
UNSUNG_HEROINE = 733;
EPIC_HEROINE = 734;
EPIC_EINHERJAR = 735;
MENDER_OF_WINGS = 736;
CHAMPION_OF_THE_DAWN = 737;
BUSHIN_ASPIRANT = 738;
BUSHIN_RYU_INHERITOR = 739;
TEMENOS_EMANCIPATOR = 740;
APOLLYON_RAZER = 741;
GOLDWING_SQUASHER = 742;
SILAGILITH_DETONATOR = 743;
SURTR_SMOTHERER = 744;
DREYRUK_PREDOMINATOR = 745;
SAMURSK_VITIATOR = 746;
UMAGRHK_MANEMANGLER = 747;
SUPERNAL_SAVANT = 748;
SOLAR_SAGE = 749;
BOLIDE_BARON = 750;
MOON_MAVEN = 751;
IZYX_VEXER = 752;
GRANNUS_GARROTER = 753;
SVAHA_STRIKER = 754;
MELISSEUS_DOMESTICATOR = 755;
WATERWAY_EXEMPLAR = 756;
CAVERN_EXEMPLAR = 757;
MUYINGWA_WINGCRUSHER = 758;
DAKUWAQA_TRAWLER = 759;
TOJIL_DOUSER = 760;
COLKHAB_DETHRONER = 761;
ACHUKA_GLACIATOR = 762;
TCHAKKA_DESICCATOR = 763;
WEALD_EXEMPLAR = 764;
HURKAN_BIRDLIMEIST = 765;
YUMCAX_LOGGER = 766;
COLKHAB_HIVECRUSHER = 767;
ACHUKA_COAGULATOR = 768;
TCHAKKA_FILLETER = 769;
RABBIT_TUSSLER = 770;
HELMINTH_MINCER = 771;
MANDRAGARDENER = 772;
MOPPET_MASSACRER = 773;
RIP_ROARING_LIMBRENDER = 774;
SHELL_SHOCKER = 775;
YAGUDO_COOPKEEPER = 776;
GIGASPLOSION_EXPERT = 777;
BROTHER_IN_ARMS = 778;
ANTICA_HUNTER = 779;
AMPHIBIAN_ADULTERATOR = 780;
TONBERRY_TOPPLER = 781;
BLOODLINE_CORRUPTER = 782;
KUMHAU_ROASTER = 783;
BRILLIANCE_MANIFEST = 784;
QUIETER_OF_ANCIENT_THOUGHTS = 785;
ARK_HUME_HUMILIATOR = 786;
ARK_ELVAAN_EVISCERATOR = 787;
ARK_MITHRA_MALIGNER = 788;
ARK_TARUTARU_TROUNCER = 789;
ARK_GALKA_GOUGER = 790;
PENTARCH_PACIFIER = 791;
DREAM_DISTILLER = 792;
RAKAZNAR_EXEMPLAR = 793;
UTKUX_PELTBURNER = 794;
CAILIMH_PLUMAGEPLUCKER = 795;
WOPKET_TRUNKSPLITTER = 796;
OURYU_OBFUSCATOR = 797;
UNWAVERING_BLAZE = 798;
LANCELORD_DIVESTER = 799;
GESSHO_PINIONER = 800;
SIN_PURGER = 801;
ADUMBRATION_DISPERSER = 802;
QUELLER_OF_OTHERWORLDLY_GALES = 803;
BLAZE_MARSHALLER = 804;
PENITENTES_BLASTER = 805;
SIROCCO_TAMER = 806;
SUCHIAN_FELLER = 807;
OMBIFID_SLAYER = 808;
NILOTICAN_DECIMATOR = 809;
ILLUMINATOR_OF_THE_1ST_WALK = 810;
ILLUMINATOR_OF_THE_2ND_WALK = 811;
ILLUMINATOR_OF_THE_3RD_WALK = 812;
ILLUMINATOR_OF_THE_4TH_WALK = 813;
ILLUMINATOR_OF_THE_5TH_WALK = 814;
ILLUMINATOR_OF_THE_6TH_WALK = 815;
ILLUMINATOR_OF_THE_7TH_WALK = 816;
ILLUMINATOR_OF_THE_8TH_WALK = 817;
ILLUMINATOR_OF_THE_9TH_WALK = 818;
ILLUMINATOR_OF_THE_10TH_WALK = 819;
ILLUMINATOR_OF_THE_11TH_WALK = 820;
ILLUMINATOR_OF_THE_12TH_WALK = 821;
ILLUMINATOR_OF_THE_13TH_WALK = 822;
ILLUMINATOR_OF_THE_14TH_WALK = 823;
ILLUMINATOR_OF_THE_15TH_WALK = 824;
LITHOSPHERE_ANNIHILATOR = 825;
FULMINATION_DISRUPTOR = 826;
BORE_REPULSOR = 827;
-- Unused = 828;
-- Unused = 829;
-- Unused = 830;
-- Unused = 831;
-- Unused = 832;
-- Unused = 833;
-- Unused = 834;
-- Unused = 835;
GEODANCER = 836;
RUNIC_ENGRAVER = 837;
APPRENTICE_TARUTARU_SAUCE_MANAGER = 838;
VEGETABLE_REVOLUTIONARY = 839;
FRIEND_TO_GLUTTONS = 840;
WAYPOINT_WARRIOR = 841;
ULBUKAN_STALWART = 842;
TOXIN_TUSSLER = 843;
SPIRITUAL_STAR = 844;
STIPPLING_STAR = 845;
GEOMANCIPATOR = 846;
TRIALED_AND_TRUE_RUNEIST = 847;
QUEENS_CONFIDANTE = 848;
PRINCESSS_PARTISAN = 849;
POTATION_PATHFINDER = 850;
STORIED_GEOMANCER = 851;
ULTIMATE_RUNEIST = 852;
MOG_GARDEN_SEEDLING = 853;
KIT_EMPATHIZER = 854;
JINGLY_DANGLER = 855;
MOLE_MANIPULATOR = 856;
AGRARIAN_NOVICE = 857;
AGRARIAN_INITIATE = 858;
AGRARIAN_PROFESSIONAL = 859;
AGRARIAN_VIRTUOSO = 860;
AGRARIAN_TUTELAR = 861;
WEED_PRAETOR = 862;
TREE_PRAETOR = 863;
THICKET_PRAETOR = 864;
FOREST_PRAETOR = 865;
JUNGLE_PRAETOR = 866;
COPPER_MATTOCK = 867;
SILVER_MATTOCK = 868;
MYTHRIL_MATTOCK = 869;
GOLD_MATTOCK = 870;
ADAMANTTOCK = 871;
PUDDLE_PATRON = 872;
SWAMP_SAVANT = 873;
POND_PRECEPTOR = 874;
RIVER_REGENT = 875;
MONKE_ONKE_MASTER = 876;
SARDINEOPHYTE = 877;
CALAMAREELER = 878;
OCTOPOTENTATE = 879;
GIANT_SQUIMPERATOR = 880;
LEVIAUTHORITY = 881;
NOVICE_NURSERYMAN = 882;
LESSER_LANDSCAPER = 883;
GREATER_GARDENER = 884;
HONORED_HORTICULTURIST = 885;
MOG_GARDENER = 886;
BRYGIDESQUE_MANAGER = 887;
VEGETABLE_EVOLUTIONARY = 888;
BLADE_ENTHUSIAST = 889;
RUNIC_EMISSARY = 890;
MAESTER_OF_MADDENING = 891;
SUNSHINE_CADET = 892;
QUARTET_CAPTIVATOR = 893;
THE_TRUSTWORTHY = 894;
THE_LOVELORN = 895;
INVENTOR_EXTRAORDINAIRE = 896;
BOOMY_AND_BUSTY = 897;
WEATHERER_OF_BRUMAL_CLIMES = 898;
WHITE_KNIGHT = 899;
LIGHT_OF_DAWN = 900;
OBSERVER_OF_FATEFUL_CUBES = 901;
KNOWER_OF_UNTRUTHS = 902;
ULBUKAN_UNDERSTUDY = 903;
KEEPER_OF_ULBUKA = 904;
RADIANCE_OF_DAYBREAK = 905;
WIBBLY_WOBBLY_WOOZY_WARRIOR = 906;
HEIR_OF_ETERNITY = 907;
PROSPECTIVE_PAMPERER = 908;
NOVICE_NUZZLER = 909;
SERIOUS_SNUGGLER = 910;
CULTIVATED_CODDLER = 911;
RESPECTED_RUFFLER = 912;
DUNG_DISSEMINATOR = 913;
FAUNA_FEEDER = 914;
CONFIDENT_CARETAKER = 915;
GLORIOUS_GROOMER = 916;
TRANSCENDENTAL_TAMER = 917;
BOND_BUILDING_BREEDER = 918;
CLUMSY_CLEAVER = 919;
DISCIPLINED_DISSECTOR = 920;
ESTABLISHED_EXAMINER = 921;
SUBLIME_SLICER = 922;
LIFTER_OF_SPIRITS = 923;
SHEDDER_OF_HARLEQUIN_TEARS = 924;
HOPE_FOR_THE_FUTURE = 925;
THOUSAND_YEAR_TRAVELER = 926;
VANQUISHER_OF_ASHRAKK = 927;
VANQUISHER_OF_DHOKMAK = 928;
PROTECTED_BY_ULBUKAN_SPIRITS = 929;
RECEIVER_OF_SIGILS = 930;
DESTROYER_OF_HADES = 931;
BRINGER_OF_THE_DAWN = 932;
THE_ONE_TRUE_PIONEER = 933;
BRINGER_OF_HOPE = 934;
| gpl-3.0 |
jebenexer/kong | kong/plugins/udp-log/handler.lua | 1 | 1312 | local BasePlugin = require "kong.plugins.base_plugin"
local serializer = require "kong.plugins.log-serializers.basic"
local cjson = require "cjson"
local timer_at = ngx.timer.at
local udp = ngx.socket.udp
local UdpLogHandler = BasePlugin:extend()
UdpLogHandler.PRIORITY = 8
UdpLogHandler.VERSION = "0.1.0"
local function log(premature, conf, str)
if premature then
return
end
local sock = udp()
sock:settimeout(conf.timeout)
local ok, err = sock:setpeername(conf.host, conf.port)
if not ok then
ngx.log(ngx.ERR, "[udp-log] could not connect to ", conf.host, ":", conf.port, ": ", err)
return
end
ok, err = sock:send(str)
if not ok then
ngx.log(ngx.ERR, " [udp-log] could not send data to ", conf.host, ":", conf.port, ": ", err)
else
ngx.log(ngx.DEBUG, "[udp-log] sent: ", str)
end
ok, err = sock:close()
if not ok then
ngx.log(ngx.ERR, "[udp-log] could not close ", conf.host, ":", conf.port, ": ", err)
end
end
function UdpLogHandler:new()
UdpLogHandler.super.new(self, "udp-log")
end
function UdpLogHandler:log(conf)
UdpLogHandler.super.log(self)
local ok, err = timer_at(0, log, conf, cjson.encode(serializer.serialize(ngx)))
if not ok then
ngx.log(ngx.ERR, "[udp-log] could not create timer: ", err)
end
end
return UdpLogHandler
| apache-2.0 |
abriasffxi/darkstar | scripts/zones/Desuetia_Empyreal_Paradox/Zone.lua | 30 | 1470 | -----------------------------------
--
-- Zone: Desuetia Empyreal Paradox (290)
--
-----------------------------------
package.loaded["scripts/zones/Desuetia_Empyreal_Paradox/TextIDs"] = nil;
-----------------------------------
require("scripts/zones/Desuetia_Empyreal_Paradox/TextIDs");
require("scripts/globals/settings");
require("scripts/globals/zone");
-----------------------------------
-- 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(x, y, z, rot);
end
return cs;
end;
-----------------------------------
-- onConquestUpdate
-----------------------------------
function onConquestUpdate(zone, updatetype)
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 |
abriasffxi/darkstar | scripts/globals/items/slice_of_diatryma_meat.lua | 18 | 1342 | -----------------------------------------
-- ID: 5290
-- Item: Slice of Diatryma Meat
-- Effect: 5 Minutes, food effect, Galka Only
-----------------------------------------
-- Strength +3
-- Intelligence -5
-----------------------------------------
require("scripts/globals/status");
-----------------------------------------
-- OnItemCheck
-----------------------------------------
function onItemCheck(target)
result = 0;
if (target:getRace() ~= 8) then
result = 247;
end
if (target:getMod(MOD_EAT_RAW_MEAT) == 1) then
result = 0;
end
if (target:hasStatusEffect(EFFECT_FOOD) == true or target:hasStatusEffect(EFFECT_FIELD_SUPPORT_FOOD) == true) then
result = 246;
end
return result;
end;
-----------------------------------------
-- OnItemUse
-----------------------------------------
function onItemUse(target)
target:addStatusEffect(EFFECT_FOOD,0,0,300,5290);
end;
-----------------------------------------
-- onEffectGain Action
-----------------------------------
function onEffectGain(target,effect)
target:addMod(MOD_STR, 3);
target:addMod(MOD_INT, -5);
end;
-----------------------------------------
-- onEffectLose Action
-----------------------------------
function onEffectLose(target,effect)
target:delMod(MOD_STR, 3);
target:delMod(MOD_INT, -5);
end; | gpl-3.0 |
yuewko/themis | vendor/github.com/apache/thrift/lib/lua/TTransport.lua | 115 | 2800 | --
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you 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.
--
require 'Thrift'
TTransportException = TException:new {
UNKNOWN = 0,
NOT_OPEN = 1,
ALREADY_OPEN = 2,
TIMED_OUT = 3,
END_OF_FILE = 4,
INVALID_FRAME_SIZE = 5,
INVALID_TRANSFORM = 6,
INVALID_CLIENT_TYPE = 7,
errorCode = 0,
__type = 'TTransportException'
}
function TTransportException:__errorCodeToString()
if self.errorCode == self.NOT_OPEN then
return 'Transport not open'
elseif self.errorCode == self.ALREADY_OPEN then
return 'Transport already open'
elseif self.errorCode == self.TIMED_OUT then
return 'Transport timed out'
elseif self.errorCode == self.END_OF_FILE then
return 'End of file'
elseif self.errorCode == self.INVALID_FRAME_SIZE then
return 'Invalid frame size'
elseif self.errorCode == self.INVALID_TRANSFORM then
return 'Invalid transform'
elseif self.errorCode == self.INVALID_CLIENT_TYPE then
return 'Invalid client type'
else
return 'Default (unknown)'
end
end
TTransportBase = __TObject:new{
__type = 'TTransportBase'
}
function TTransportBase:isOpen() end
function TTransportBase:open() end
function TTransportBase:close() end
function TTransportBase:read(len) end
function TTransportBase:readAll(len)
local buf, have, chunk = '', 0
while have < len do
chunk = self:read(len - have)
have = have + string.len(chunk)
buf = buf .. chunk
if string.len(chunk) == 0 then
terror(TTransportException:new{
errorCode = TTransportException.END_OF_FILE
})
end
end
return buf
end
function TTransportBase:write(buf) end
function TTransportBase:flush() end
TServerTransportBase = __TObject:new{
__type = 'TServerTransportBase'
}
function TServerTransportBase:listen() end
function TServerTransportBase:accept() end
function TServerTransportBase:close() end
TTransportFactoryBase = __TObject:new{
__type = 'TTransportFactoryBase'
}
function TTransportFactoryBase:getTransport(trans)
return trans
end
| apache-2.0 |
abriasffxi/darkstar | scripts/globals/spells/enchanting_etude.lua | 27 | 1848 | -----------------------------------------
-- Spell: Enchanting Etude
-- Static CHR Boost, BRD 22
-----------------------------------------
require("scripts/globals/status");
require("scripts/globals/magic");
-----------------------------------------
-- OnSpellCast
-----------------------------------------
function onMagicCastingCheck(caster,target,spell)
return 0;
end;
function onSpellCast(caster,target,spell)
local sLvl = caster:getSkillLevel(SKILL_SNG); -- Gets skill level of Singing
local iLvl = caster:getWeaponSkillLevel(SLOT_RANGED);
local power = 0;
if (sLvl+iLvl <= 181) then
power = 3;
elseif ((sLvl+iLvl >= 182) and (sLvl+iLvl <= 235)) then
power = 4;
elseif ((sLvl+iLvl >= 236) and (sLvl+iLvl <= 288)) then
power = 5;
elseif ((sLvl+iLvl >= 289) and (sLvl+iLvl <= 342)) then
power = 6;
elseif ((sLvl+iLvl >= 343) and (sLvl+iLvl <= 396)) then
power = 7;
elseif ((sLvl+iLvl >= 397) and (sLvl+iLvl <= 449)) then
power = 8;
elseif (sLvl+iLvl >= 450) then
power = 9;
end
local iBoost = caster:getMod(MOD_ETUDE_EFFECT) + caster:getMod(MOD_ALL_SONGS_EFFECT);
power = power + iBoost;
if (caster:hasStatusEffect(EFFECT_SOUL_VOICE)) then
power = power * 2;
elseif (caster:hasStatusEffect(EFFECT_MARCATO)) then
power = power * 1.5;
end
caster:delStatusEffect(EFFECT_MARCATO);
local duration = 120;
duration = duration * ((iBoost * 0.1) + (caster:getMod(MOD_SONG_DURATION_BONUS)/100) + 1);
if (caster:hasStatusEffect(EFFECT_TROUBADOUR)) then
duration = duration * 2;
end
if not (target:addBardSong(caster,EFFECT_ETUDE,power,0,duration,caster:getID(), MOD_CHR, 1)) then
spell:setMsg(75);
end
return EFFECT_ETUDE;
end; | gpl-3.0 |
JKGDevs/JediKnightGalaxies | JKGalaxies/glua/resources/npcs/grenade_merchant.lua | 2 | 1562 | NPC.NPCName = "grenade_merchant"
function NPC:OnInit(spawner)
self.Spawner = spawner
end
function NPC:OnSpawn()
-- Initial setup
-- Prevent the AI from messing things up
self:SetBehaviorState("BS_CINEMATIC")
self.GodMode = true
self.NoKnockback = true
self.LookForEnemies = false
self.ChaseEnemies = false
--vendor setup
self:MakeVendor("grenadevendor")
self:RefreshVendorStock()
self.UseRange = 150 -- make us easier to use
self.TimeToRestock = 1000 * sys.GetCvarInt("jkg_shop_replenish_time") -- how often (milliseconds) to restock?
self.RestockTimer = sys.Time()
self.LastUse = 0
--for advertising wares animation
self.LastAdvertisement = 0
math.randomseed(sys.Time()) --seed random
end
function NPC:OnUse(other, activator)
if sys.Time() - self.LastUse < 500 then
return
end
self.LastUse = sys.Time()
-- Only talk to players, nothin else
if not activator:IsPlayer() then
return
end
local ply = activator:ToPlayer()
self:UseVendor(ply)
end
function NPC:OnTouch(other)
self:SetAnimBoth("BOTH_STAND10TOSTAND1") --if we get bumped into, react
end
function NPC:OnThink(other)
--every 20000 seconds do an advertisement animation
if sys.Time() - self.LastAdvertisement < 20000 then
return
else
self:SetAnimBoth("BOTH_TUSKENTAUNT1")
self.LastAdvertisement = (sys.Time() + math.random(1150,3550))
end
--refresh stocks
if sys.Time() - self.RestockTimer > self.TimeToRestock then
self:RefreshVendorStock()
self.RestockTimer = sys.Time()
end
end
function NPC:OnRemove()
self.Spawner:Use(self, self)
end | gpl-2.0 |
abriasffxi/darkstar | scripts/globals/spells/noctohelix.lua | 26 | 1689 | --------------------------------------
-- Spell: Noctohelix
-- Deals dark damage that gradually reduces
-- a target's HP. Damage dealt is greatly affected by the weather.
--------------------------------------
require("scripts/globals/settings");
require("scripts/globals/status");
require("scripts/globals/magic");
-----------------------------------------
-- OnSpellCast
-----------------------------------------
function onMagicCastingCheck(caster,target,spell)
return 0;
end;
function onSpellCast(caster,target,spell)
-- get helix acc/att merits
local merit = caster:getMerit(MERIT_HELIX_MAGIC_ACC_ATT);
-- calculate raw damage
local dmg = calculateMagicDamage(35,1,caster,spell,target,ELEMENTAL_MAGIC_SKILL,MOD_INT,false);
dmg = dmg + caster:getMod(MOD_HELIX_EFFECT);
-- get resist multiplier (1x if no resist)
local resist = applyResistance(caster,spell,target,caster:getStat(MOD_INT)-target:getStat(MOD_INT),ELEMENTAL_MAGIC_SKILL,merit*3);
-- get the resisted damage
dmg = dmg*resist;
-- add on bonuses (staff/day/weather/jas/mab/etc all go in this function)
dmg = addBonuses(caster,spell,target,dmg,merit*2);
-- add in target adjustment
dmg = adjustForTarget(target,dmg,spell:getElement());
local dot = dmg;
-- add in final adjustments
dmg = finalMagicAdjustments(caster,target,spell,dmg);
-- calculate Damage over time
dot = target:magicDmgTaken(dot);
local duration = getHelixDuration(caster) + caster:getMod(MOD_HELIX_DURATION);
duration = duration * (resist/2);
if (dot > 0) then
target:addStatusEffect(EFFECT_HELIX,dot,3,duration);
end;
return dmg;
end; | gpl-3.0 |
xpol/luainstaller | luarocks/src/luarocks/fetch/git_http.lua | 13 | 1143 |
--- Fetch back-end for retrieving sources from Git repositories
-- that use http:// transport. For example, for fetching a repository
-- that requires the following command line:
-- `git clone http://example.com/foo.git`
-- you can use this in the rockspec:
-- source = { url = "git+http://example.com/foo.git" }
-- Prefer using the normal git:// fetch mode as it is more widely
-- available in older versions of LuaRocks.
local git_http = {}
local git = require("luarocks.fetch.git")
--- Fetch sources for building a rock from a local Git repository.
-- @param rockspec table: The rockspec table
-- @param extract boolean: Unused in this module (required for API purposes.)
-- @param dest_dir string or nil: If set, will extract to the given directory.
-- @return (string, string) or (nil, string): The absolute pathname of
-- the fetched source tarball and the temporary directory created to
-- store it; or nil and an error message.
function git_http.get_sources(rockspec, extract, dest_dir)
rockspec.source.url = rockspec.source.url:gsub("^git.", "")
return git.get_sources(rockspec, extract, dest_dir, "--")
end
return git_http
| mit |
Armyluix/darkstar | scripts/globals/items/blowfish.lua | 18 | 1257 | -----------------------------------------
-- ID: 5812
-- Item: Blowfish
-- Food Effect: 5Min, Mithra only
-----------------------------------------
-- Dexterity 1
-- Mind -3
-----------------------------------------
require("scripts/globals/status");
-----------------------------------------
-- OnItemCheck
-----------------------------------------
function onItemCheck(target)
result = 0
if (target:getRace() ~= 7) then
result = 247;
end
if (target:getMod(MOD_EAT_RAW_FISH) == 1) then
result = 0;
end
if (target:hasStatusEffect(EFFECT_FOOD) == true or target:hasStatusEffect(EFFECT_FIELD_SUPPORT_FOOD) == true) then
result = 246;
end
return result;
end;
-----------------------------------------
-- OnItemUse
-----------------------------------------
function onItemUse(target)
target:addStatusEffect(EFFECT_FOOD,0,0,300,5812);
end;
-----------------------------------
-- onEffectGain Action
-----------------------------------
function onEffectGain(target,effect)
target:addMod(MOD_DEX, 3);
target:addMod(MOD_MND, -5);
end;
-----------------------------------------
-- onEffectLose Action
-----------------------------------------
function onEffectLose(target,effect)
target:delMod(MOD_DEX, 3);
target:delMod(MOD_MND, -5);
end;
| gpl-3.0 |
imrandomizer/Algorithm-Implementations | Golden_Ratio_Algorithms/Lua/Yonaba/lib/newtonraphson.lua | 52 | 1091 | -- Newton (Raphson) root finding algorithm implementation
-- See : http://en.wikipedia.org/wiki/Newton%27s_method
-- Fuzzy equality test
local function fuzzyEqual(a, b, eps)
local eps = eps or 1e-4
return (math.abs(a - b) < eps)
end
-- Evaluates the derivative of function f at x0
-- Uses Newton's centered slope approximation
local function drvMid(f, x0, initStep)
local step = initStep or 0.1
local incr1, incr2 = (f(x0 + step) - f(x0 - step)) / (2 * step)
repeat
incr2 = incr1
step = step / 2
incr1 = (f(x0 + step) - f(x0 - step)) / (2 * step)
until fuzzyEqual(incr1, incr2)
return incr1
end
-- Find a zero for a given function f
-- f : the equation, to be solved (f(x) = 0)
-- initStep : (optional) initial value for iterations
-- eps : (optional) accuracy parameter for convergence
-- returns : a zero for the function f
return function(f, initStep, eps)
local next_x = initStep or 0
local prev_x
repeat
prev_x = next_x
next_x = next_x - (f(next_x) / drvMid(f, next_x))
until fuzzyEqual(next_x, prev_x, eps)
return next_x
end
| mit |
isalnikov/Algorithm-Implementations | Newton_Raphson/Lua/Yonaba/newtonraphson.lua | 52 | 1091 | -- Newton (Raphson) root finding algorithm implementation
-- See : http://en.wikipedia.org/wiki/Newton%27s_method
-- Fuzzy equality test
local function fuzzyEqual(a, b, eps)
local eps = eps or 1e-4
return (math.abs(a - b) < eps)
end
-- Evaluates the derivative of function f at x0
-- Uses Newton's centered slope approximation
local function drvMid(f, x0, initStep)
local step = initStep or 0.1
local incr1, incr2 = (f(x0 + step) - f(x0 - step)) / (2 * step)
repeat
incr2 = incr1
step = step / 2
incr1 = (f(x0 + step) - f(x0 - step)) / (2 * step)
until fuzzyEqual(incr1, incr2)
return incr1
end
-- Find a zero for a given function f
-- f : the equation, to be solved (f(x) = 0)
-- initStep : (optional) initial value for iterations
-- eps : (optional) accuracy parameter for convergence
-- returns : a zero for the function f
return function(f, initStep, eps)
local next_x = initStep or 0
local prev_x
repeat
prev_x = next_x
next_x = next_x - (f(next_x) / drvMid(f, next_x))
until fuzzyEqual(next_x, prev_x, eps)
return next_x
end
| mit |
xpol/luainstaller | lua/versions/luajit-2.0/dynasm/dasm_arm.lua | 11 | 34598 | ------------------------------------------------------------------------------
-- DynASM ARM module.
--
-- Copyright (C) 2005-2017 Mike Pall. All rights reserved.
-- See dynasm.lua for full copyright notice.
------------------------------------------------------------------------------
-- Module information:
local _info = {
arch = "arm",
description = "DynASM ARM module",
version = "1.3.0",
vernum = 10300,
release = "2011-05-05",
author = "Mike Pall",
license = "MIT",
}
-- Exported glue functions for the arch-specific module.
local _M = { _info = _info }
-- Cache library functions.
local type, tonumber, pairs, ipairs = type, tonumber, pairs, ipairs
local assert, setmetatable, rawget = assert, setmetatable, rawget
local _s = string
local sub, format, byte, char = _s.sub, _s.format, _s.byte, _s.char
local match, gmatch, gsub = _s.match, _s.gmatch, _s.gsub
local concat, sort, insert = table.concat, table.sort, table.insert
local bit = bit or require("bit")
local band, shl, shr, sar = bit.band, bit.lshift, bit.rshift, bit.arshift
local ror, tohex = bit.ror, bit.tohex
-- Inherited tables and callbacks.
local g_opt, g_arch
local wline, werror, wfatal, wwarn
-- Action name list.
-- CHECK: Keep this in sync with the C code!
local action_names = {
"STOP", "SECTION", "ESC", "REL_EXT",
"ALIGN", "REL_LG", "LABEL_LG",
"REL_PC", "LABEL_PC", "IMM", "IMM12", "IMM16", "IMML8", "IMML12", "IMMV8",
}
-- Maximum number of section buffer positions for dasm_put().
-- CHECK: Keep this in sync with the C code!
local maxsecpos = 25 -- Keep this low, to avoid excessively long C lines.
-- Action name -> action number.
local map_action = {}
for n,name in ipairs(action_names) do
map_action[name] = n-1
end
-- Action list buffer.
local actlist = {}
-- Argument list for next dasm_put(). Start with offset 0 into action list.
local actargs = { 0 }
-- Current number of section buffer positions for dasm_put().
local secpos = 1
------------------------------------------------------------------------------
-- Dump action names and numbers.
local function dumpactions(out)
out:write("DynASM encoding engine action codes:\n")
for n,name in ipairs(action_names) do
local num = map_action[name]
out:write(format(" %-10s %02X %d\n", name, num, num))
end
out:write("\n")
end
-- Write action list buffer as a huge static C array.
local function writeactions(out, name)
local nn = #actlist
if nn == 0 then nn = 1; actlist[0] = map_action.STOP end
out:write("static const unsigned int ", name, "[", nn, "] = {\n")
for i = 1,nn-1 do
assert(out:write("0x", tohex(actlist[i]), ",\n"))
end
assert(out:write("0x", tohex(actlist[nn]), "\n};\n\n"))
end
------------------------------------------------------------------------------
-- Add word to action list.
local function wputxw(n)
assert(n >= 0 and n <= 0xffffffff and n % 1 == 0, "word out of range")
actlist[#actlist+1] = n
end
-- Add action to list with optional arg. Advance buffer pos, too.
local function waction(action, val, a, num)
local w = assert(map_action[action], "bad action name `"..action.."'")
wputxw(w * 0x10000 + (val or 0))
if a then actargs[#actargs+1] = a end
if a or num then secpos = secpos + (num or 1) end
end
-- Flush action list (intervening C code or buffer pos overflow).
local function wflush(term)
if #actlist == actargs[1] then return end -- Nothing to flush.
if not term then waction("STOP") end -- Terminate action list.
wline(format("dasm_put(Dst, %s);", concat(actargs, ", ")), true)
actargs = { #actlist } -- Actionlist offset is 1st arg to next dasm_put().
secpos = 1 -- The actionlist offset occupies a buffer position, too.
end
-- Put escaped word.
local function wputw(n)
if n <= 0x000fffff then waction("ESC") end
wputxw(n)
end
-- Reserve position for word.
local function wpos()
local pos = #actlist+1
actlist[pos] = ""
return pos
end
-- Store word to reserved position.
local function wputpos(pos, n)
assert(n >= 0 and n <= 0xffffffff and n % 1 == 0, "word out of range")
if n <= 0x000fffff then
insert(actlist, pos+1, n)
n = map_action.ESC * 0x10000
end
actlist[pos] = n
end
------------------------------------------------------------------------------
-- Global label name -> global label number. With auto assignment on 1st use.
local next_global = 20
local map_global = setmetatable({}, { __index = function(t, name)
if not match(name, "^[%a_][%w_]*$") then werror("bad global label") end
local n = next_global
if n > 2047 then werror("too many global labels") end
next_global = n + 1
t[name] = n
return n
end})
-- Dump global labels.
local function dumpglobals(out, lvl)
local t = {}
for name, n in pairs(map_global) do t[n] = name end
out:write("Global labels:\n")
for i=20,next_global-1 do
out:write(format(" %s\n", t[i]))
end
out:write("\n")
end
-- Write global label enum.
local function writeglobals(out, prefix)
local t = {}
for name, n in pairs(map_global) do t[n] = name end
out:write("enum {\n")
for i=20,next_global-1 do
out:write(" ", prefix, t[i], ",\n")
end
out:write(" ", prefix, "_MAX\n};\n")
end
-- Write global label names.
local function writeglobalnames(out, name)
local t = {}
for name, n in pairs(map_global) do t[n] = name end
out:write("static const char *const ", name, "[] = {\n")
for i=20,next_global-1 do
out:write(" \"", t[i], "\",\n")
end
out:write(" (const char *)0\n};\n")
end
------------------------------------------------------------------------------
-- Extern label name -> extern label number. With auto assignment on 1st use.
local next_extern = 0
local map_extern_ = {}
local map_extern = setmetatable({}, { __index = function(t, name)
-- No restrictions on the name for now.
local n = next_extern
if n > 2047 then werror("too many extern labels") end
next_extern = n + 1
t[name] = n
map_extern_[n] = name
return n
end})
-- Dump extern labels.
local function dumpexterns(out, lvl)
out:write("Extern labels:\n")
for i=0,next_extern-1 do
out:write(format(" %s\n", map_extern_[i]))
end
out:write("\n")
end
-- Write extern label names.
local function writeexternnames(out, name)
out:write("static const char *const ", name, "[] = {\n")
for i=0,next_extern-1 do
out:write(" \"", map_extern_[i], "\",\n")
end
out:write(" (const char *)0\n};\n")
end
------------------------------------------------------------------------------
-- Arch-specific maps.
-- Ext. register name -> int. name.
local map_archdef = { sp = "r13", lr = "r14", pc = "r15", }
-- Int. register name -> ext. name.
local map_reg_rev = { r13 = "sp", r14 = "lr", r15 = "pc", }
local map_type = {} -- Type name -> { ctype, reg }
local ctypenum = 0 -- Type number (for Dt... macros).
-- Reverse defines for registers.
function _M.revdef(s)
return map_reg_rev[s] or s
end
local map_shift = { lsl = 0, lsr = 1, asr = 2, ror = 3, }
local map_cond = {
eq = 0, ne = 1, cs = 2, cc = 3, mi = 4, pl = 5, vs = 6, vc = 7,
hi = 8, ls = 9, ge = 10, lt = 11, gt = 12, le = 13, al = 14,
hs = 2, lo = 3,
}
------------------------------------------------------------------------------
-- Template strings for ARM instructions.
local map_op = {
-- Basic data processing instructions.
and_3 = "e0000000DNPs",
eor_3 = "e0200000DNPs",
sub_3 = "e0400000DNPs",
rsb_3 = "e0600000DNPs",
add_3 = "e0800000DNPs",
adc_3 = "e0a00000DNPs",
sbc_3 = "e0c00000DNPs",
rsc_3 = "e0e00000DNPs",
tst_2 = "e1100000NP",
teq_2 = "e1300000NP",
cmp_2 = "e1500000NP",
cmn_2 = "e1700000NP",
orr_3 = "e1800000DNPs",
mov_2 = "e1a00000DPs",
bic_3 = "e1c00000DNPs",
mvn_2 = "e1e00000DPs",
and_4 = "e0000000DNMps",
eor_4 = "e0200000DNMps",
sub_4 = "e0400000DNMps",
rsb_4 = "e0600000DNMps",
add_4 = "e0800000DNMps",
adc_4 = "e0a00000DNMps",
sbc_4 = "e0c00000DNMps",
rsc_4 = "e0e00000DNMps",
tst_3 = "e1100000NMp",
teq_3 = "e1300000NMp",
cmp_3 = "e1500000NMp",
cmn_3 = "e1700000NMp",
orr_4 = "e1800000DNMps",
mov_3 = "e1a00000DMps",
bic_4 = "e1c00000DNMps",
mvn_3 = "e1e00000DMps",
lsl_3 = "e1a00000DMws",
lsr_3 = "e1a00020DMws",
asr_3 = "e1a00040DMws",
ror_3 = "e1a00060DMws",
rrx_2 = "e1a00060DMs",
-- Multiply and multiply-accumulate.
mul_3 = "e0000090NMSs",
mla_4 = "e0200090NMSDs",
umaal_4 = "e0400090DNMSs", -- v6
mls_4 = "e0600090DNMSs", -- v6T2
umull_4 = "e0800090DNMSs",
umlal_4 = "e0a00090DNMSs",
smull_4 = "e0c00090DNMSs",
smlal_4 = "e0e00090DNMSs",
-- Halfword multiply and multiply-accumulate.
smlabb_4 = "e1000080NMSD", -- v5TE
smlatb_4 = "e10000a0NMSD", -- v5TE
smlabt_4 = "e10000c0NMSD", -- v5TE
smlatt_4 = "e10000e0NMSD", -- v5TE
smlawb_4 = "e1200080NMSD", -- v5TE
smulwb_3 = "e12000a0NMS", -- v5TE
smlawt_4 = "e12000c0NMSD", -- v5TE
smulwt_3 = "e12000e0NMS", -- v5TE
smlalbb_4 = "e1400080NMSD", -- v5TE
smlaltb_4 = "e14000a0NMSD", -- v5TE
smlalbt_4 = "e14000c0NMSD", -- v5TE
smlaltt_4 = "e14000e0NMSD", -- v5TE
smulbb_3 = "e1600080NMS", -- v5TE
smultb_3 = "e16000a0NMS", -- v5TE
smulbt_3 = "e16000c0NMS", -- v5TE
smultt_3 = "e16000e0NMS", -- v5TE
-- Miscellaneous data processing instructions.
clz_2 = "e16f0f10DM", -- v5T
rev_2 = "e6bf0f30DM", -- v6
rev16_2 = "e6bf0fb0DM", -- v6
revsh_2 = "e6ff0fb0DM", -- v6
sel_3 = "e6800fb0DNM", -- v6
usad8_3 = "e780f010NMS", -- v6
usada8_4 = "e7800010NMSD", -- v6
rbit_2 = "e6ff0f30DM", -- v6T2
movw_2 = "e3000000DW", -- v6T2
movt_2 = "e3400000DW", -- v6T2
-- Note: the X encodes width-1, not width.
sbfx_4 = "e7a00050DMvX", -- v6T2
ubfx_4 = "e7e00050DMvX", -- v6T2
-- Note: the X encodes the msb field, not the width.
bfc_3 = "e7c0001fDvX", -- v6T2
bfi_4 = "e7c00010DMvX", -- v6T2
-- Packing and unpacking instructions.
pkhbt_3 = "e6800010DNM", pkhbt_4 = "e6800010DNMv", -- v6
pkhtb_3 = "e6800050DNM", pkhtb_4 = "e6800050DNMv", -- v6
sxtab_3 = "e6a00070DNM", sxtab_4 = "e6a00070DNMv", -- v6
sxtab16_3 = "e6800070DNM", sxtab16_4 = "e6800070DNMv", -- v6
sxtah_3 = "e6b00070DNM", sxtah_4 = "e6b00070DNMv", -- v6
sxtb_2 = "e6af0070DM", sxtb_3 = "e6af0070DMv", -- v6
sxtb16_2 = "e68f0070DM", sxtb16_3 = "e68f0070DMv", -- v6
sxth_2 = "e6bf0070DM", sxth_3 = "e6bf0070DMv", -- v6
uxtab_3 = "e6e00070DNM", uxtab_4 = "e6e00070DNMv", -- v6
uxtab16_3 = "e6c00070DNM", uxtab16_4 = "e6c00070DNMv", -- v6
uxtah_3 = "e6f00070DNM", uxtah_4 = "e6f00070DNMv", -- v6
uxtb_2 = "e6ef0070DM", uxtb_3 = "e6ef0070DMv", -- v6
uxtb16_2 = "e6cf0070DM", uxtb16_3 = "e6cf0070DMv", -- v6
uxth_2 = "e6ff0070DM", uxth_3 = "e6ff0070DMv", -- v6
-- Saturating instructions.
qadd_3 = "e1000050DMN", -- v5TE
qsub_3 = "e1200050DMN", -- v5TE
qdadd_3 = "e1400050DMN", -- v5TE
qdsub_3 = "e1600050DMN", -- v5TE
-- Note: the X for ssat* encodes sat_imm-1, not sat_imm.
ssat_3 = "e6a00010DXM", ssat_4 = "e6a00010DXMp", -- v6
usat_3 = "e6e00010DXM", usat_4 = "e6e00010DXMp", -- v6
ssat16_3 = "e6a00f30DXM", -- v6
usat16_3 = "e6e00f30DXM", -- v6
-- Parallel addition and subtraction.
sadd16_3 = "e6100f10DNM", -- v6
sasx_3 = "e6100f30DNM", -- v6
ssax_3 = "e6100f50DNM", -- v6
ssub16_3 = "e6100f70DNM", -- v6
sadd8_3 = "e6100f90DNM", -- v6
ssub8_3 = "e6100ff0DNM", -- v6
qadd16_3 = "e6200f10DNM", -- v6
qasx_3 = "e6200f30DNM", -- v6
qsax_3 = "e6200f50DNM", -- v6
qsub16_3 = "e6200f70DNM", -- v6
qadd8_3 = "e6200f90DNM", -- v6
qsub8_3 = "e6200ff0DNM", -- v6
shadd16_3 = "e6300f10DNM", -- v6
shasx_3 = "e6300f30DNM", -- v6
shsax_3 = "e6300f50DNM", -- v6
shsub16_3 = "e6300f70DNM", -- v6
shadd8_3 = "e6300f90DNM", -- v6
shsub8_3 = "e6300ff0DNM", -- v6
uadd16_3 = "e6500f10DNM", -- v6
uasx_3 = "e6500f30DNM", -- v6
usax_3 = "e6500f50DNM", -- v6
usub16_3 = "e6500f70DNM", -- v6
uadd8_3 = "e6500f90DNM", -- v6
usub8_3 = "e6500ff0DNM", -- v6
uqadd16_3 = "e6600f10DNM", -- v6
uqasx_3 = "e6600f30DNM", -- v6
uqsax_3 = "e6600f50DNM", -- v6
uqsub16_3 = "e6600f70DNM", -- v6
uqadd8_3 = "e6600f90DNM", -- v6
uqsub8_3 = "e6600ff0DNM", -- v6
uhadd16_3 = "e6700f10DNM", -- v6
uhasx_3 = "e6700f30DNM", -- v6
uhsax_3 = "e6700f50DNM", -- v6
uhsub16_3 = "e6700f70DNM", -- v6
uhadd8_3 = "e6700f90DNM", -- v6
uhsub8_3 = "e6700ff0DNM", -- v6
-- Load/store instructions.
str_2 = "e4000000DL", str_3 = "e4000000DL", str_4 = "e4000000DL",
strb_2 = "e4400000DL", strb_3 = "e4400000DL", strb_4 = "e4400000DL",
ldr_2 = "e4100000DL", ldr_3 = "e4100000DL", ldr_4 = "e4100000DL",
ldrb_2 = "e4500000DL", ldrb_3 = "e4500000DL", ldrb_4 = "e4500000DL",
strh_2 = "e00000b0DL", strh_3 = "e00000b0DL",
ldrh_2 = "e01000b0DL", ldrh_3 = "e01000b0DL",
ldrd_2 = "e00000d0DL", ldrd_3 = "e00000d0DL", -- v5TE
ldrsb_2 = "e01000d0DL", ldrsb_3 = "e01000d0DL",
strd_2 = "e00000f0DL", strd_3 = "e00000f0DL", -- v5TE
ldrsh_2 = "e01000f0DL", ldrsh_3 = "e01000f0DL",
ldm_2 = "e8900000oR", ldmia_2 = "e8900000oR", ldmfd_2 = "e8900000oR",
ldmda_2 = "e8100000oR", ldmfa_2 = "e8100000oR",
ldmdb_2 = "e9100000oR", ldmea_2 = "e9100000oR",
ldmib_2 = "e9900000oR", ldmed_2 = "e9900000oR",
stm_2 = "e8800000oR", stmia_2 = "e8800000oR", stmfd_2 = "e8800000oR",
stmda_2 = "e8000000oR", stmfa_2 = "e8000000oR",
stmdb_2 = "e9000000oR", stmea_2 = "e9000000oR",
stmib_2 = "e9800000oR", stmed_2 = "e9800000oR",
pop_1 = "e8bd0000R", push_1 = "e92d0000R",
-- Branch instructions.
b_1 = "ea000000B",
bl_1 = "eb000000B",
blx_1 = "e12fff30C",
bx_1 = "e12fff10M",
-- Miscellaneous instructions.
nop_0 = "e1a00000",
mrs_1 = "e10f0000D",
bkpt_1 = "e1200070K", -- v5T
svc_1 = "ef000000T", swi_1 = "ef000000T",
ud_0 = "e7f001f0",
-- VFP instructions.
["vadd.f32_3"] = "ee300a00dnm",
["vadd.f64_3"] = "ee300b00Gdnm",
["vsub.f32_3"] = "ee300a40dnm",
["vsub.f64_3"] = "ee300b40Gdnm",
["vmul.f32_3"] = "ee200a00dnm",
["vmul.f64_3"] = "ee200b00Gdnm",
["vnmul.f32_3"] = "ee200a40dnm",
["vnmul.f64_3"] = "ee200b40Gdnm",
["vmla.f32_3"] = "ee000a00dnm",
["vmla.f64_3"] = "ee000b00Gdnm",
["vmls.f32_3"] = "ee000a40dnm",
["vmls.f64_3"] = "ee000b40Gdnm",
["vnmla.f32_3"] = "ee100a40dnm",
["vnmla.f64_3"] = "ee100b40Gdnm",
["vnmls.f32_3"] = "ee100a00dnm",
["vnmls.f64_3"] = "ee100b00Gdnm",
["vdiv.f32_3"] = "ee800a00dnm",
["vdiv.f64_3"] = "ee800b00Gdnm",
["vabs.f32_2"] = "eeb00ac0dm",
["vabs.f64_2"] = "eeb00bc0Gdm",
["vneg.f32_2"] = "eeb10a40dm",
["vneg.f64_2"] = "eeb10b40Gdm",
["vsqrt.f32_2"] = "eeb10ac0dm",
["vsqrt.f64_2"] = "eeb10bc0Gdm",
["vcmp.f32_2"] = "eeb40a40dm",
["vcmp.f64_2"] = "eeb40b40Gdm",
["vcmpe.f32_2"] = "eeb40ac0dm",
["vcmpe.f64_2"] = "eeb40bc0Gdm",
["vcmpz.f32_1"] = "eeb50a40d",
["vcmpz.f64_1"] = "eeb50b40Gd",
["vcmpze.f32_1"] = "eeb50ac0d",
["vcmpze.f64_1"] = "eeb50bc0Gd",
vldr_2 = "ed100a00dl|ed100b00Gdl",
vstr_2 = "ed000a00dl|ed000b00Gdl",
vldm_2 = "ec900a00or",
vldmia_2 = "ec900a00or",
vldmdb_2 = "ed100a00or",
vpop_1 = "ecbd0a00r",
vstm_2 = "ec800a00or",
vstmia_2 = "ec800a00or",
vstmdb_2 = "ed000a00or",
vpush_1 = "ed2d0a00r",
["vmov.f32_2"] = "eeb00a40dm|eeb00a00dY", -- #imm is VFPv3 only
["vmov.f64_2"] = "eeb00b40Gdm|eeb00b00GdY", -- #imm is VFPv3 only
vmov_2 = "ee100a10Dn|ee000a10nD",
vmov_3 = "ec500a10DNm|ec400a10mDN|ec500b10GDNm|ec400b10GmDN",
vmrs_0 = "eef1fa10",
vmrs_1 = "eef10a10D",
vmsr_1 = "eee10a10D",
["vcvt.s32.f32_2"] = "eebd0ac0dm",
["vcvt.s32.f64_2"] = "eebd0bc0dGm",
["vcvt.u32.f32_2"] = "eebc0ac0dm",
["vcvt.u32.f64_2"] = "eebc0bc0dGm",
["vcvtr.s32.f32_2"] = "eebd0a40dm",
["vcvtr.s32.f64_2"] = "eebd0b40dGm",
["vcvtr.u32.f32_2"] = "eebc0a40dm",
["vcvtr.u32.f64_2"] = "eebc0b40dGm",
["vcvt.f32.s32_2"] = "eeb80ac0dm",
["vcvt.f64.s32_2"] = "eeb80bc0GdFm",
["vcvt.f32.u32_2"] = "eeb80a40dm",
["vcvt.f64.u32_2"] = "eeb80b40GdFm",
["vcvt.f32.f64_2"] = "eeb70bc0dGm",
["vcvt.f64.f32_2"] = "eeb70ac0GdFm",
-- VFPv4 only:
["vfma.f32_3"] = "eea00a00dnm",
["vfma.f64_3"] = "eea00b00Gdnm",
["vfms.f32_3"] = "eea00a40dnm",
["vfms.f64_3"] = "eea00b40Gdnm",
["vfnma.f32_3"] = "ee900a40dnm",
["vfnma.f64_3"] = "ee900b40Gdnm",
["vfnms.f32_3"] = "ee900a00dnm",
["vfnms.f64_3"] = "ee900b00Gdnm",
-- NYI: Advanced SIMD instructions.
-- NYI: I have no need for these instructions right now:
-- swp, swpb, strex, ldrex, strexd, ldrexd, strexb, ldrexb, strexh, ldrexh
-- msr, nopv6, yield, wfe, wfi, sev, dbg, bxj, smc, srs, rfe
-- cps, setend, pli, pld, pldw, clrex, dsb, dmb, isb
-- stc, ldc, mcr, mcr2, mrc, mrc2, mcrr, mcrr2, mrrc, mrrc2, cdp, cdp2
}
-- Add mnemonics for "s" variants.
do
local t = {}
for k,v in pairs(map_op) do
if sub(v, -1) == "s" then
local v2 = sub(v, 1, 2)..char(byte(v, 3)+1)..sub(v, 4, -2)
t[sub(k, 1, -3).."s"..sub(k, -2)] = v2
end
end
for k,v in pairs(t) do
map_op[k] = v
end
end
------------------------------------------------------------------------------
local function parse_gpr(expr)
local tname, ovreg = match(expr, "^([%w_]+):(r1?[0-9])$")
local tp = map_type[tname or expr]
if tp then
local reg = ovreg or tp.reg
if not reg then
werror("type `"..(tname or expr).."' needs a register override")
end
expr = reg
end
local r = match(expr, "^r(1?[0-9])$")
if r then
r = tonumber(r)
if r <= 15 then return r, tp end
end
werror("bad register name `"..expr.."'")
end
local function parse_gpr_pm(expr)
local pm, expr2 = match(expr, "^([+-]?)(.*)$")
return parse_gpr(expr2), (pm == "-")
end
local function parse_vr(expr, tp)
local t, r = match(expr, "^([sd])([0-9]+)$")
if t == tp then
r = tonumber(r)
if r <= 31 then
if t == "s" then return shr(r, 1), band(r, 1) end
return band(r, 15), shr(r, 4)
end
end
werror("bad register name `"..expr.."'")
end
local function parse_reglist(reglist)
reglist = match(reglist, "^{%s*([^}]*)}$")
if not reglist then werror("register list expected") end
local rr = 0
for p in gmatch(reglist..",", "%s*([^,]*),") do
local rbit = shl(1, parse_gpr(gsub(p, "%s+$", "")))
if band(rr, rbit) ~= 0 then
werror("duplicate register `"..p.."'")
end
rr = rr + rbit
end
return rr
end
local function parse_vrlist(reglist)
local ta, ra, tb, rb = match(reglist,
"^{%s*([sd])([0-9]+)%s*%-%s*([sd])([0-9]+)%s*}$")
ra, rb = tonumber(ra), tonumber(rb)
if ta and ta == tb and ra and rb and ra <= 31 and rb <= 31 and ra <= rb then
local nr = rb+1 - ra
if ta == "s" then
return shl(shr(ra,1),12)+shl(band(ra,1),22) + nr
else
return shl(band(ra,15),12)+shl(shr(ra,4),22) + nr*2 + 0x100
end
end
werror("register list expected")
end
local function parse_imm(imm, bits, shift, scale, signed)
imm = match(imm, "^#(.*)$")
if not imm then werror("expected immediate operand") end
local n = tonumber(imm)
if n then
local m = sar(n, scale)
if shl(m, scale) == n then
if signed then
local s = sar(m, bits-1)
if s == 0 then return shl(m, shift)
elseif s == -1 then return shl(m + shl(1, bits), shift) end
else
if sar(m, bits) == 0 then return shl(m, shift) end
end
end
werror("out of range immediate `"..imm.."'")
else
waction("IMM", (signed and 32768 or 0)+scale*1024+bits*32+shift, imm)
return 0
end
end
local function parse_imm12(imm)
local n = tonumber(imm)
if n then
local m = band(n)
for i=0,-15,-1 do
if shr(m, 8) == 0 then return m + shl(band(i, 15), 8) end
m = ror(m, 2)
end
werror("out of range immediate `"..imm.."'")
else
waction("IMM12", 0, imm)
return 0
end
end
local function parse_imm16(imm)
imm = match(imm, "^#(.*)$")
if not imm then werror("expected immediate operand") end
local n = tonumber(imm)
if n then
if shr(n, 16) == 0 then return band(n, 0x0fff) + shl(band(n, 0xf000), 4) end
werror("out of range immediate `"..imm.."'")
else
waction("IMM16", 32*16, imm)
return 0
end
end
local function parse_imm_load(imm, ext)
local n = tonumber(imm)
if n then
if ext then
if n >= -255 and n <= 255 then
local up = 0x00800000
if n < 0 then n = -n; up = 0 end
return shl(band(n, 0xf0), 4) + band(n, 0x0f) + up
end
else
if n >= -4095 and n <= 4095 then
if n >= 0 then return n+0x00800000 end
return -n
end
end
werror("out of range immediate `"..imm.."'")
else
waction(ext and "IMML8" or "IMML12", 32768 + shl(ext and 8 or 12, 5), imm)
return 0
end
end
local function parse_shift(shift, gprok)
if shift == "rrx" then
return 3 * 32
else
local s, s2 = match(shift, "^(%S+)%s*(.*)$")
s = map_shift[s]
if not s then werror("expected shift operand") end
if sub(s2, 1, 1) == "#" then
return parse_imm(s2, 5, 7, 0, false) + shl(s, 5)
else
if not gprok then werror("expected immediate shift operand") end
return shl(parse_gpr(s2), 8) + shl(s, 5) + 16
end
end
end
local function parse_label(label, def)
local prefix = sub(label, 1, 2)
-- =>label (pc label reference)
if prefix == "=>" then
return "PC", 0, sub(label, 3)
end
-- ->name (global label reference)
if prefix == "->" then
return "LG", map_global[sub(label, 3)]
end
if def then
-- [1-9] (local label definition)
if match(label, "^[1-9]$") then
return "LG", 10+tonumber(label)
end
else
-- [<>][1-9] (local label reference)
local dir, lnum = match(label, "^([<>])([1-9])$")
if dir then -- Fwd: 1-9, Bkwd: 11-19.
return "LG", lnum + (dir == ">" and 0 or 10)
end
-- extern label (extern label reference)
local extname = match(label, "^extern%s+(%S+)$")
if extname then
return "EXT", map_extern[extname]
end
end
werror("bad label `"..label.."'")
end
local function parse_load(params, nparams, n, op)
local oplo = band(op, 255)
local ext, ldrd = (oplo ~= 0), (oplo == 208)
local d
if (ldrd or oplo == 240) then
d = band(shr(op, 12), 15)
if band(d, 1) ~= 0 then werror("odd destination register") end
end
local pn = params[n]
local p1, wb = match(pn, "^%[%s*(.-)%s*%](!?)$")
local p2 = params[n+1]
if not p1 then
if not p2 then
if match(pn, "^[<>=%-]") or match(pn, "^extern%s+") then
local mode, n, s = parse_label(pn, false)
waction("REL_"..mode, n + (ext and 0x1800 or 0x0800), s, 1)
return op + 15 * 65536 + 0x01000000 + (ext and 0x00400000 or 0)
end
local reg, tailr = match(pn, "^([%w_:]+)%s*(.*)$")
if reg and tailr ~= "" then
local d, tp = parse_gpr(reg)
if tp then
waction(ext and "IMML8" or "IMML12", 32768 + 32*(ext and 8 or 12),
format(tp.ctypefmt, tailr))
return op + shl(d, 16) + 0x01000000 + (ext and 0x00400000 or 0)
end
end
end
werror("expected address operand")
end
if wb == "!" then op = op + 0x00200000 end
if p2 then
if wb == "!" then werror("bad use of '!'") end
local p3 = params[n+2]
op = op + shl(parse_gpr(p1), 16)
local imm = match(p2, "^#(.*)$")
if imm then
local m = parse_imm_load(imm, ext)
if p3 then werror("too many parameters") end
op = op + m + (ext and 0x00400000 or 0)
else
local m, neg = parse_gpr_pm(p2)
if ldrd and (m == d or m-1 == d) then werror("register conflict") end
op = op + m + (neg and 0 or 0x00800000) + (ext and 0 or 0x02000000)
if p3 then op = op + parse_shift(p3) end
end
else
local p1a, p2 = match(p1, "^([^,%s]*)%s*(.*)$")
op = op + shl(parse_gpr(p1a), 16) + 0x01000000
if p2 ~= "" then
local imm = match(p2, "^,%s*#(.*)$")
if imm then
local m = parse_imm_load(imm, ext)
op = op + m + (ext and 0x00400000 or 0)
else
local p2a, p3 = match(p2, "^,%s*([^,%s]*)%s*,?%s*(.*)$")
local m, neg = parse_gpr_pm(p2a)
if ldrd and (m == d or m-1 == d) then werror("register conflict") end
op = op + m + (neg and 0 or 0x00800000) + (ext and 0 or 0x02000000)
if p3 ~= "" then
if ext then werror("too many parameters") end
op = op + parse_shift(p3)
end
end
else
if wb == "!" then werror("bad use of '!'") end
op = op + (ext and 0x00c00000 or 0x00800000)
end
end
return op
end
local function parse_vload(q)
local reg, imm = match(q, "^%[%s*([^,%s]*)%s*(.*)%]$")
if reg then
local d = shl(parse_gpr(reg), 16)
if imm == "" then return d end
imm = match(imm, "^,%s*#(.*)$")
if imm then
local n = tonumber(imm)
if n then
if n >= -1020 and n <= 1020 and n%4 == 0 then
return d + (n >= 0 and n/4+0x00800000 or -n/4)
end
werror("out of range immediate `"..imm.."'")
else
waction("IMMV8", 32768 + 32*8, imm)
return d
end
end
else
if match(q, "^[<>=%-]") or match(q, "^extern%s+") then
local mode, n, s = parse_label(q, false)
waction("REL_"..mode, n + 0x2800, s, 1)
return 15 * 65536
end
local reg, tailr = match(q, "^([%w_:]+)%s*(.*)$")
if reg and tailr ~= "" then
local d, tp = parse_gpr(reg)
if tp then
waction("IMMV8", 32768 + 32*8, format(tp.ctypefmt, tailr))
return shl(d, 16)
end
end
end
werror("expected address operand")
end
------------------------------------------------------------------------------
-- Handle opcodes defined with template strings.
local function parse_template(params, template, nparams, pos)
local op = tonumber(sub(template, 1, 8), 16)
local n = 1
local vr = "s"
-- Process each character.
for p in gmatch(sub(template, 9), ".") do
local q = params[n]
if p == "D" then
op = op + shl(parse_gpr(q), 12); n = n + 1
elseif p == "N" then
op = op + shl(parse_gpr(q), 16); n = n + 1
elseif p == "S" then
op = op + shl(parse_gpr(q), 8); n = n + 1
elseif p == "M" then
op = op + parse_gpr(q); n = n + 1
elseif p == "d" then
local r,h = parse_vr(q, vr); op = op+shl(r,12)+shl(h,22); n = n + 1
elseif p == "n" then
local r,h = parse_vr(q, vr); op = op+shl(r,16)+shl(h,7); n = n + 1
elseif p == "m" then
local r,h = parse_vr(q, vr); op = op+r+shl(h,5); n = n + 1
elseif p == "P" then
local imm = match(q, "^#(.*)$")
if imm then
op = op + parse_imm12(imm) + 0x02000000
else
op = op + parse_gpr(q)
end
n = n + 1
elseif p == "p" then
op = op + parse_shift(q, true); n = n + 1
elseif p == "L" then
op = parse_load(params, nparams, n, op)
elseif p == "l" then
op = op + parse_vload(q)
elseif p == "B" then
local mode, n, s = parse_label(q, false)
waction("REL_"..mode, n, s, 1)
elseif p == "C" then -- blx gpr vs. blx label.
if match(q, "^([%w_]+):(r1?[0-9])$") or match(q, "^r(1?[0-9])$") then
op = op + parse_gpr(q)
else
if op < 0xe0000000 then werror("unconditional instruction") end
local mode, n, s = parse_label(q, false)
waction("REL_"..mode, n, s, 1)
op = 0xfa000000
end
elseif p == "F" then
vr = "s"
elseif p == "G" then
vr = "d"
elseif p == "o" then
local r, wb = match(q, "^([^!]*)(!?)$")
op = op + shl(parse_gpr(r), 16) + (wb == "!" and 0x00200000 or 0)
n = n + 1
elseif p == "R" then
op = op + parse_reglist(q); n = n + 1
elseif p == "r" then
op = op + parse_vrlist(q); n = n + 1
elseif p == "W" then
op = op + parse_imm16(q); n = n + 1
elseif p == "v" then
op = op + parse_imm(q, 5, 7, 0, false); n = n + 1
elseif p == "w" then
local imm = match(q, "^#(.*)$")
if imm then
op = op + parse_imm(q, 5, 7, 0, false); n = n + 1
else
op = op + shl(parse_gpr(q), 8) + 16
end
elseif p == "X" then
op = op + parse_imm(q, 5, 16, 0, false); n = n + 1
elseif p == "Y" then
local imm = tonumber(match(q, "^#(.*)$")); n = n + 1
if not imm or shr(imm, 8) ~= 0 then
werror("bad immediate operand")
end
op = op + shl(band(imm, 0xf0), 12) + band(imm, 0x0f)
elseif p == "K" then
local imm = tonumber(match(q, "^#(.*)$")); n = n + 1
if not imm or shr(imm, 16) ~= 0 then
werror("bad immediate operand")
end
op = op + shl(band(imm, 0xfff0), 4) + band(imm, 0x000f)
elseif p == "T" then
op = op + parse_imm(q, 24, 0, 0, false); n = n + 1
elseif p == "s" then
-- Ignored.
else
assert(false)
end
end
wputpos(pos, op)
end
map_op[".template__"] = function(params, template, nparams)
if not params then return template:gsub("%x%x%x%x%x%x%x%x", "") end
-- Limit number of section buffer positions used by a single dasm_put().
-- A single opcode needs a maximum of 3 positions.
if secpos+3 > maxsecpos then wflush() end
local pos = wpos()
local lpos, apos, spos = #actlist, #actargs, secpos
local ok, err
for t in gmatch(template, "[^|]+") do
ok, err = pcall(parse_template, params, t, nparams, pos)
if ok then return end
secpos = spos
actlist[lpos+1] = nil
actlist[lpos+2] = nil
actlist[lpos+3] = nil
actargs[apos+1] = nil
actargs[apos+2] = nil
actargs[apos+3] = nil
end
error(err, 0)
end
------------------------------------------------------------------------------
-- Pseudo-opcode to mark the position where the action list is to be emitted.
map_op[".actionlist_1"] = function(params)
if not params then return "cvar" end
local name = params[1] -- No syntax check. You get to keep the pieces.
wline(function(out) writeactions(out, name) end)
end
-- Pseudo-opcode to mark the position where the global enum is to be emitted.
map_op[".globals_1"] = function(params)
if not params then return "prefix" end
local prefix = params[1] -- No syntax check. You get to keep the pieces.
wline(function(out) writeglobals(out, prefix) end)
end
-- Pseudo-opcode to mark the position where the global names are to be emitted.
map_op[".globalnames_1"] = function(params)
if not params then return "cvar" end
local name = params[1] -- No syntax check. You get to keep the pieces.
wline(function(out) writeglobalnames(out, name) end)
end
-- Pseudo-opcode to mark the position where the extern names are to be emitted.
map_op[".externnames_1"] = function(params)
if not params then return "cvar" end
local name = params[1] -- No syntax check. You get to keep the pieces.
wline(function(out) writeexternnames(out, name) end)
end
------------------------------------------------------------------------------
-- Label pseudo-opcode (converted from trailing colon form).
map_op[".label_1"] = function(params)
if not params then return "[1-9] | ->global | =>pcexpr" end
if secpos+1 > maxsecpos then wflush() end
local mode, n, s = parse_label(params[1], true)
if mode == "EXT" then werror("bad label definition") end
waction("LABEL_"..mode, n, s, 1)
end
------------------------------------------------------------------------------
-- Pseudo-opcodes for data storage.
map_op[".long_*"] = function(params)
if not params then return "imm..." end
for _,p in ipairs(params) do
local n = tonumber(p)
if not n then werror("bad immediate `"..p.."'") end
if n < 0 then n = n + 2^32 end
wputw(n)
if secpos+2 > maxsecpos then wflush() end
end
end
-- Alignment pseudo-opcode.
map_op[".align_1"] = function(params)
if not params then return "numpow2" end
if secpos+1 > maxsecpos then wflush() end
local align = tonumber(params[1])
if align then
local x = align
-- Must be a power of 2 in the range (2 ... 256).
for i=1,8 do
x = x / 2
if x == 1 then
waction("ALIGN", align-1, nil, 1) -- Action byte is 2**n-1.
return
end
end
end
werror("bad alignment")
end
------------------------------------------------------------------------------
-- Pseudo-opcode for (primitive) type definitions (map to C types).
map_op[".type_3"] = function(params, nparams)
if not params then
return nparams == 2 and "name, ctype" or "name, ctype, reg"
end
local name, ctype, reg = params[1], params[2], params[3]
if not match(name, "^[%a_][%w_]*$") then
werror("bad type name `"..name.."'")
end
local tp = map_type[name]
if tp then
werror("duplicate type `"..name.."'")
end
-- Add #type to defines. A bit unclean to put it in map_archdef.
map_archdef["#"..name] = "sizeof("..ctype..")"
-- Add new type and emit shortcut define.
local num = ctypenum + 1
map_type[name] = {
ctype = ctype,
ctypefmt = format("Dt%X(%%s)", num),
reg = reg,
}
wline(format("#define Dt%X(_V) (int)(ptrdiff_t)&(((%s *)0)_V)", num, ctype))
ctypenum = num
end
map_op[".type_2"] = map_op[".type_3"]
-- Dump type definitions.
local function dumptypes(out, lvl)
local t = {}
for name in pairs(map_type) do t[#t+1] = name end
sort(t)
out:write("Type definitions:\n")
for _,name in ipairs(t) do
local tp = map_type[name]
local reg = tp.reg or ""
out:write(format(" %-20s %-20s %s\n", name, tp.ctype, reg))
end
out:write("\n")
end
------------------------------------------------------------------------------
-- Set the current section.
function _M.section(num)
waction("SECTION", num)
wflush(true) -- SECTION is a terminal action.
end
------------------------------------------------------------------------------
-- Dump architecture description.
function _M.dumparch(out)
out:write(format("DynASM %s version %s, released %s\n\n",
_info.arch, _info.version, _info.release))
dumpactions(out)
end
-- Dump all user defined elements.
function _M.dumpdef(out, lvl)
dumptypes(out, lvl)
dumpglobals(out, lvl)
dumpexterns(out, lvl)
end
------------------------------------------------------------------------------
-- Pass callbacks from/to the DynASM core.
function _M.passcb(wl, we, wf, ww)
wline, werror, wfatal, wwarn = wl, we, wf, ww
return wflush
end
-- Setup the arch-specific module.
function _M.setup(arch, opt)
g_arch, g_opt = arch, opt
end
-- Merge the core maps and the arch-specific maps.
function _M.mergemaps(map_coreop, map_def)
setmetatable(map_op, { __index = function(t, k)
local v = map_coreop[k]
if v then return v end
local k1, cc, k2 = match(k, "^(.-)(..)([._].*)$")
local cv = map_cond[cc]
if cv then
local v = rawget(t, k1..k2)
if type(v) == "string" then
local scv = format("%x", cv)
return gsub(scv..sub(v, 2), "|e", "|"..scv)
end
end
end })
setmetatable(map_def, { __index = map_archdef })
return map_op, map_def
end
return _M
------------------------------------------------------------------------------
| mit |
Armyluix/darkstar | scripts/zones/Tahrongi_Canyon/npcs/Telepoint.lua | 17 | 1652 | -----------------------------------
-- Area: Tahrongi Canyon
-- NPC: Telepoint
-- @pos 100.000 35.150 340.000 117
-----------------------------------
package.loaded["scripts/zones/Tahrongi_Canyon/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/keyitems");
require("scripts/zones/Tahrongi_Canyon/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
item = trade:getItem();
if (trade:getItemCount() == 1 and item > 4095 and item < 4104) then
if (player:getFreeSlotsCount() > 0 and player:hasItem(613) == false) then
player:tradeComplete();
player:addItem(613);
player:messageSpecial(ITEM_OBTAINED,613); -- Faded Crystal
else
player:messageSpecial(ITEM_CANNOT_BE_OBTAINED,613); -- Faded Crystal
end
end
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
if (player:hasKeyItem(MEA_GATE_CRYSTAL) == false) then
player:addKeyItem(MEA_GATE_CRYSTAL);
player:messageSpecial(KEYITEM_OBTAINED,MEA_GATE_CRYSTAL);
else
player:messageSpecial(ALREADY_OBTAINED_TELE);
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 |
rdlaitila/LURE | src/__legacy__/lib/loveframes/objects/internal/scrollable/scrollbutton.lua | 14 | 3962 | --[[------------------------------------------------
-- Love Frames - A GUI library for LOVE --
-- Copyright (c) 2012-2014 Kenny Shields --
--]]------------------------------------------------
-- get the current require path
local path = string.sub(..., 1, string.len(...) - string.len(".objects.internal.scrollable.scrollbutton"))
local loveframes = require(path .. ".libraries.common")
-- scrollbutton clas
local newobject = loveframes.NewObject("scrollbutton", "loveframes_object_scrollbutton", true)
--[[---------------------------------------------------------
- func: initialize()
- desc: initializes the object
--]]---------------------------------------------------------
function newobject:initialize(scrolltype)
self.type = "scrollbutton"
self.scrolltype = scrolltype
self.width = 16
self.height = 16
self.down = false
self.internal = true
self.OnClick = function() end
-- apply template properties to the object
loveframes.templates.ApplyToObject(self)
end
--[[---------------------------------------------------------
- func: update(deltatime)
- desc: updates the object
--]]---------------------------------------------------------
function newobject:update(dt)
local visible = self.visible
local alwaysupdate = self.alwaysupdate
if not visible then
if not alwaysupdate then
return
end
end
self:CheckHover()
local hover = self.hover
local parent = self.parent
local base = loveframes.base
local update = self.Update
if not hover then
self.down = false
else
if loveframes.downobject == self then
self.down = true
end
end
if not self.down and loveframes.downobject == self then
self.hover = true
end
-- move to parent if there is a parent
if parent ~= base then
self.x = parent.x + self.staticx
self.y = parent.y + self.staticy
end
if update then
update(self, dt)
end
end
--[[---------------------------------------------------------
- func: draw()
- desc: draws the object
--]]---------------------------------------------------------
function newobject:draw()
local visible = self.visible
if not visible then
return
end
local skins = loveframes.skins.available
local skinindex = loveframes.config["ACTIVESKIN"]
local defaultskin = loveframes.config["DEFAULTSKIN"]
local selfskin = self.skin
local skin = skins[selfskin] or skins[skinindex]
local drawfunc = skin.DrawScrollButton or skins[defaultskin].DrawScrollButton
local draw = self.Draw
local drawcount = loveframes.drawcount
-- set the object's draw order
self:SetDrawOrder()
if draw then
draw(self)
else
drawfunc(self)
end
end
--[[---------------------------------------------------------
- func: mousepressed(x, y, button)
- desc: called when the player presses a mouse button
--]]---------------------------------------------------------
function newobject:mousepressed(x, y, button)
local visible = self.visible
if not visible then
return
end
local hover = self.hover
if hover and button == "l" then
local baseparent = self:GetBaseParent()
if baseparent.type == "frame" then
baseparent:MakeTop()
end
self.down = true
loveframes.downobject = self
end
end
--[[---------------------------------------------------------
- func: mousereleased(x, y, button)
- desc: called when the player releases a mouse button
--]]---------------------------------------------------------
function newobject:mousereleased(x, y, button)
local visible = self.visible
if not visible then
return
end
local hover = self.hover
local down = self.down
local onclick = self.OnClick
if hover and down then
if button == "l" then
onclick(x, y, self)
end
end
self.down = false
end
--[[---------------------------------------------------------
- func: GetScrollType()
- desc: gets the object's scroll type
--]]---------------------------------------------------------
function newobject:GetScrollType()
return self.scrolltype
end
| mit |
abriasffxi/darkstar | scripts/zones/Bastok_Markets/npcs/Loulia.lua | 14 | 1078 | -----------------------------------
-- Area: Bastok Markets
-- NPC: Loulia
-- Type: Room Renters
-- @pos -176.212 -9 -25.049 235
--
-- Auto-Script: Requires Verification. Validated standard dialog - thrydwolf 12/8/2011
-----------------------------------
package.loaded["scripts/zones/Bastok_Markets/TextIDs"] = nil;
require("scripts/zones/Bastok_Markets/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
player:startEvent(0x01e7);
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/items/plate_of_witch_risotto.lua | 18 | 1528 | -----------------------------------------
-- ID: 4330
-- Item: witch_risotto
-- Food Effect: 4hours, All Races
-----------------------------------------
-- Magic Points 35
-- Strength -1
-- Vitality 3
-- Mind 3
-- MP Recovered While Healing 2
-- Enmity -1
-----------------------------------------
require("scripts/globals/status");
-----------------------------------------
-- OnItemCheck
-----------------------------------------
function onItemCheck(target)
local result = 0;
if (target:hasStatusEffect(EFFECT_FOOD) == true or target:hasStatusEffect(EFFECT_FIELD_SUPPORT_FOOD) == true) then
result = 246;
end
return result;
end;
-----------------------------------------
-- OnItemUse
-----------------------------------------
function onItemUse(target)
target:addStatusEffect(EFFECT_FOOD,0,0,14400,4330);
end;
-----------------------------------------
-- onEffectGain Action
-----------------------------------------
function onEffectGain(target,effect)
target:addMod(MOD_MP, 35);
target:addMod(MOD_STR, -1);
target:addMod(MOD_VIT, 3);
target:addMod(MOD_MND, 3);
target:addMod(MOD_MPHEAL, 2);
target:addMod(MOD_ENMITY, -1);
end;
-----------------------------------------
-- onEffectLose Action
-----------------------------------------
function onEffectLose(target,effect)
target:delMod(MOD_MP, 35);
target:delMod(MOD_STR, -1);
target:delMod(MOD_VIT, 3);
target:delMod(MOD_MND, 3);
target:delMod(MOD_MPHEAL, 2);
target:delMod(MOD_ENMITY, -1);
end;
| gpl-3.0 |
abriasffxi/darkstar | scripts/globals/mobskills/Guillotine.lua | 26 | 1058 | ---------------------------------------------
-- Guillotine
--
-- Description: Delivers a four-hit attack. Silences enemy. Duration of effect varies with TP.
-- Type: Physical
-- Number of hits
-- Range: Melee
---------------------------------------------
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)
mob:messageBasic(43, 0, 689+256);
skill:setSkillchain(102);
local numhits = 4;
local accmod = 1;
local dmgmod = 1.2;
local info = MobPhysicalMove(mob,target,skill,numhits,accmod,dmgmod,TP_NO_EFFECT);
local dmg = MobFinalAdjustments(info.dmg,mob,skill,target,MOBSKILL_PHYSICAL,MOBPARAM_SLASH,info.hitslanded);
MobStatusEffectMove(mob, target, EFFECT_SILENCE, 1, 0, (skill:getTP()*30/1000)+30);
-- 242 to a NIN, but shadows ate some hits...
target:delHP(dmg);
return dmg;
end;
| gpl-3.0 |
staroselskii/ardupilot | Tools/CHDK-Scripts/kap_uav.lua | 183 | 28512 | --[[
KAP UAV Exposure Control Script v3.1
-- Released under GPL by waterwingz and wayback/peabody
http://chdk.wikia.com/wiki/KAP_%26_UAV_Exposure_Control_Script
@title KAP UAV 3.1
@param i Shot Interval (sec)
@default i 15
@range i 2 120
@param s Total Shots (0=infinite)
@default s 0
@range s 0 10000
@param j Power off when done?
@default j 0
@range j 0 1
@param e Exposure Comp (stops)
@default e 6
@values e -2.0 -1.66 -1.33 -1.0 -0.66 -0.33 0.0 0.33 0.66 1.00 1.33 1.66 2.00
@param d Start Delay Time (sec)
@default d 0
@range d 0 10000
@param y Tv Min (sec)
@default y 0
@values y None 1/60 1/100 1/200 1/400 1/640
@param t Target Tv (sec)
@default t 5
@values t 1/100 1/200 1/400 1/640 1/800 1/1000 1/1250 1/1600 1/2000
@param x Tv Max (sec)
@default x 3
@values x 1/1000 1/1250 1/1600 1/2000 1/5000 1/10000
@param f Av Low(f-stop)
@default f 4
@values f 1.8 2.0 2.2 2.6 2.8 3.2 3.5 4.0 4.5 5.0 5.6 6.3 7.1 8.0
@param a Av Target (f-stop)
@default a 7
@values a 1.8 2.0 2.2 2.6 2.8 3.2 3.5 4.0 4.5 5.0 5.6 6.3 7.1 8.0
@param m Av Max (f-stop)
@default m 13
@values m 1.8 2.0 2.2 2.6 2.8 3.2 3.5 4.0 4.5 5.0 5.6 6.3 7.1 8.0
@param p ISO Min
@default p 1
@values p 80 100 200 400 800 1250 1600
@param q ISO Max1
@default q 2
@values q 100 200 400 800 1250 1600
@param r ISO Max2
@default r 3
@values r 100 200 400 800 1250 1600
@param n Allow use of ND filter?
@default n 1
@values n No Yes
@param z Zoom position
@default z 0
@values z Off 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%
@param c Focus @ Infinity Mode
@default c 0
@values c None @Shot AFL MF
@param v Video Interleave (shots)
@default v 0
@values v Off 1 5 10 25 50 100
@param w Video Duration (sec)
@default w 10
@range w 5 300
@param u USB Shot Control?
@default u 0
@values u None On/Off OneShot PWM
@param b Backlight Off?
@default b 0
@range b 0 1
@param l Logging
@default l 3
@values l Off Screen SDCard Both
--]]
props=require("propcase")
capmode=require("capmode")
-- convert user parameter to usable variable names and values
tv_table = { -320, 576, 640, 736, 832, 896, 928, 960, 992, 1024, 1056, 1180, 1276}
tv96target = tv_table[t+3]
tv96max = tv_table[x+8]
tv96min = tv_table[y+1]
sv_table = { 381, 411, 507, 603, 699, 761, 795 }
sv96min = sv_table[p+1]
sv96max1 = sv_table[q+2]
sv96max2 = sv_table[r+2]
av_table = { 171, 192, 218, 265, 285, 322, 347, 384, 417, 446, 477, 510, 543, 576 }
av96target = av_table[a+1]
av96minimum = av_table[f+1]
av96max = av_table[m+1]
ec96adjust = (e - 6)*32
video_table = { 0, 1, 5, 10, 25, 50, 100 }
video_mode = video_table[v+1]
video_duration = w
interval = i*1000
max_shots = s
poff_if_done = j
start_delay = d
backlight = b
log_mode= l
focus_mode = c
usb_mode = u
if ( z==0 ) then zoom_setpoint = nil else zoom_setpoint = (z-1)*10 end
-- initial configuration values
nd96offset=3*96 -- ND filter's number of equivalent f-stops (f * 96)
infx = 50000 -- focus lock distance in mm (approximately 55 yards)
shot_count = 0 -- shot counter
blite_timer = 300 -- backlight off delay in 100mSec increments
old_console_timeout = get_config_value( 297 )
shot_request = false -- pwm mode flag to request a shot be taken
-- check camera Av configuration ( variable aperture and/or ND filter )
if n==0 then -- use of nd filter allowed?
if get_nd_present()==1 then -- check for ND filter only
Av_mode = 0 -- 0 = ND disabled and no iris available
else
Av_mode = 1 -- 1 = ND disabled and iris available
end
else
Av_mode = get_nd_present()+1 -- 1 = iris only , 2=ND filter only, 3= both ND & iris
end
function printf(...)
if ( log_mode == 0) then return end
local str=string.format(...)
if (( log_mode == 1) or (log_mode == 3)) then print(str) end
if ( log_mode > 1 ) then
local logname="A/KAP.log"
log=io.open(logname,"a")
log:write(os.date("%Y%b%d %X ")..string.format(...),"\n")
log:close()
end
end
tv_ref = { -- note : tv_ref values set 1/2 way between shutter speed values
-608, -560, -528, -496, -464, -432, -400, -368, -336, -304,
-272, -240, -208, -176, -144, -112, -80, -48, -16, 16,
48, 80, 112, 144, 176, 208, 240, 272, 304, 336,
368, 400, 432, 464, 496, 528, 560, 592, 624, 656,
688, 720, 752, 784, 816, 848, 880, 912, 944, 976,
1008, 1040, 1072, 1096, 1129, 1169, 1192, 1225, 1265, 1376 }
tv_str = {
">64",
"64", "50", "40", "32", "25", "20", "16", "12", "10", "8.0",
"6.0", "5.0", "4.0", "3.2", "2.5", "2.0", "1.6", "1.3", "1.0", "0.8",
"0.6", "0.5", "0.4", "0.3", "1/4", "1/5", "1/6", "1/8", "1/10", "1/13",
"1/15", "1/20", "1/25", "1/30", "1/40", "1/50", "1/60", "1/80", "1/100", "1/125",
"1/160", "1/200", "1/250", "1/320", "1/400", "1/500", "1/640", "1/800", "1/1000","1/1250",
"1/1600","1/2000","1/2500","1/3200","1/4000","1/5000","1/6400","1/8000","1/10000","hi" }
function print_tv(val)
if ( val == nil ) then return("-") end
local i = 1
while (i <= #tv_ref) and (val > tv_ref[i]) do i=i+1 end
return tv_str[i]
end
av_ref = { 160, 176, 208, 243, 275, 304, 336, 368, 400, 432, 464, 480, 496, 512, 544, 592, 624, 656, 688, 720, 752, 784 }
av_str = {"n/a","1.8", "2.0","2.2","2.6","2.8","3.2","3.5","4.0","4.5","5.0","5.6","5.9","6.3","7.1","8.0","9.0","10.0","11.0","13.0","14.0","16.0","hi"}
function print_av(val)
if ( val == nil ) then return("-") end
local i = 1
while (i <= #av_ref) and (val > av_ref[i]) do i=i+1 end
return av_str[i]
end
sv_ref = { 370, 397, 424, 456, 492, 523, 555, 588, 619, 651, 684, 731, 779, 843, 907 }
sv_str = {"n/a","80","100","120","160","200","250","320","400","500","640","800","1250","1600","3200","hi"}
function print_sv(val)
if ( val == nil ) then return("-") end
local i = 1
while (i <= #sv_ref) and (val > sv_ref[i]) do i=i+1 end
return sv_str[i]
end
function pline(message, line) -- print line function
fg = 258 bg=259
end
-- switch between shooting and playback modes
function switch_mode( m )
if ( m == 1 ) then
if ( get_mode() == false ) then
set_record(1) -- switch to shooting mode
while ( get_mode() == false ) do
sleep(100)
end
sleep(1000)
end
else
if ( get_mode() == true ) then
set_record(0) -- switch to playback mode
while ( get_mode() == true ) do
sleep(100)
end
sleep(1000)
end
end
end
-- focus lock and unlock
function lock_focus()
if (focus_mode > 1) then -- focus mode requested ?
if ( focus_mode == 2 ) then -- method 1 : set_aflock() command enables MF
if (chdk_version==120) then
set_aflock(1)
set_prop(props.AF_LOCK,1)
else
set_aflock(1)
end
if (get_prop(props.AF_LOCK) == 1) then printf(" AFL enabled") else printf(" AFL failed ***") end
else -- mf mode requested
if (chdk_version==120) then -- CHDK 1.2.0 : call event proc or levents to try and enable MF mode
if call_event_proc("SS.Create") ~= -1 then
if call_event_proc("SS.MFOn") == -1 then
call_event_proc("PT_MFOn")
end
elseif call_event_proc("RegisterShootSeqEvent") ~= -1 then
if call_event_proc("PT_MFOn") == -1 then
call_event_proc("MFOn")
end
end
if (get_prop(props.FOCUS_MODE) == 0 ) then -- MF not set - try levent PressSw1AndMF
post_levent_for_npt("PressSw1AndMF")
sleep(500)
end
elseif (chdk_version >= 130) then -- CHDK 1.3.0 : set_mf()
if ( set_mf(1) == 0 ) then set_aflock(1) end -- as a fall back, try setting AFL is set_mf fails
end
if (get_prop(props.FOCUS_MODE) == 1) then printf(" MF enabled") else printf(" MF enable failed ***") end
end
sleep(1000)
set_focus(infx)
sleep(1000)
end
end
function unlock_focus()
if (focus_mode > 1) then -- focus mode requested ?
if (focus_mode == 2 ) then -- method 1 : AFL
if (chdk_version==120) then
set_aflock(0)
set_prop(props.AF_LOCK,0)
else
set_aflock(0)
end
if (get_prop(props.AF_LOCK) == 0) then printf(" AFL unlocked") else printf(" AFL unlock failed") end
else -- mf mode requested
if (chdk_version==120) then -- CHDK 1.2.0 : call event proc or levents to try and enable MF mode
if call_event_proc("SS.Create") ~= -1 then
if call_event_proc("SS.MFOff") == -1 then
call_event_proc("PT_MFOff")
end
elseif call_event_proc("RegisterShootSeqEvent") ~= -1 then
if call_event_proc("PT_MFOff") == -1 then
call_event_proc("MFOff")
end
end
if (get_prop(props.FOCUS_MODE) == 1 ) then -- MF not reset - try levent PressSw1AndMF
post_levent_for_npt("PressSw1AndMF")
sleep(500)
end
elseif (chdk_version >= 130) then -- CHDK 1.3.0 : set_mf()
if ( set_mf(0) == 0 ) then set_aflock(0) end -- fall back so reset AFL is set_mf fails
end
if (get_prop(props.FOCUS_MODE) == 0) then printf(" MF disabled") else printf(" MF disable failed") end
end
sleep(100)
end
end
-- zoom position
function update_zoom(zpos)
local count = 0
if(zpos ~= nil) then
zstep=((get_zoom_steps()-1)*zpos)/100
printf("setting zoom to "..zpos.." percent step="..zstep)
sleep(200)
set_zoom(zstep)
sleep(2000)
press("shoot_half")
repeat
sleep(100)
count = count + 1
until (get_shooting() == true ) or (count > 40 )
release("shoot_half")
end
end
-- restore camera settings on shutdown
function restore()
set_config_value(121,0) -- USB remote disable
set_config_value(297,old_console_timeout) -- restore console timeout value
if (backlight==1) then set_lcd_display(1) end -- display on
unlock_focus()
if( zoom_setpoint ~= nil ) then update_zoom(0) end
if( shot_count >= max_shots) and ( max_shots > 1) then
if ( poff_if_done == 1 ) then -- did script ending because # of shots done ?
printf("power off - shot count at limit") -- complete power down
sleep(2000)
post_levent_to_ui('PressPowerButton')
else
set_record(0) end -- just retract lens
end
end
-- Video mode
function check_video(shot)
local capture_mode
if ((video_mode>0) and(shot>0) and (shot%video_mode == 0)) then
unlock_focus()
printf("Video mode started. Button:"..tostring(video_button))
if( video_button ) then
click "video"
else
capture_mode=capmode.get()
capmode.set('VIDEO_STD')
press("shoot_full")
sleep(300)
release("shoot_full")
end
local end_second = get_day_seconds() + video_duration
repeat
wait_click(500)
until (is_key("menu")) or (get_day_seconds() > end_second)
if( video_button ) then
click "video"
else
press("shoot_full")
sleep(300)
release("shoot_full")
capmode.set(capture_mode)
end
printf("Video mode finished.")
sleep(1000)
lock_focus()
return(true)
else
return(false)
end
end
-- PWM USB pulse functions
function ch1up()
printf(" * usb pulse = ch1up")
shot_request = true
end
function ch1mid()
printf(" * usb pulse = ch1mid")
if ( get_mode() == false ) then
switch_mode(1)
lock_focus()
end
end
function ch1down()
printf(" * usb pulse = ch1down")
switch_mode(0)
end
function ch2up()
printf(" * usb pulse = ch2up")
update_zoom(100)
end
function ch2mid()
printf(" * usb pulse = ch2mid")
if ( zoom_setpoint ~= nil ) then update_zoom(zoom_setpoint) else update_zoom(50) end
end
function ch2down()
printf(" * usb pulse = ch2down")
update_zoom(0)
end
function pwm_mode(pulse_width)
if pulse_width > 0 then
if pulse_width < 5 then ch1up()
elseif pulse_width < 8 then ch1mid()
elseif pulse_width < 11 then ch1down()
elseif pulse_width < 14 then ch2up()
elseif pulse_width < 17 then ch2mid()
elseif pulse_width < 20 then ch2down()
else printf(" * usb pulse width error") end
end
end
-- Basic exposure calculation using shutter speed and ISO only
-- called for Tv-only and ND-only cameras (cameras without an iris)
function basic_tv_calc()
tv96setpoint = tv96target
av96setpoint = nil
local min_av = get_prop(props.MIN_AV)
-- calculate required ISO setting
sv96setpoint = tv96setpoint + min_av - bv96meter
-- low ambient light ?
if (sv96setpoint > sv96max2 ) then -- check if required ISO setting is too high
sv96setpoint = sv96max2 -- clamp at max2 ISO if so
tv96setpoint = math.max(bv96meter+sv96setpoint-min_av,tv96min) -- recalculate required shutter speed down to Tv min
-- high ambient light ?
elseif (sv96setpoint < sv96min ) then -- check if required ISO setting is too low
sv96setpoint = sv96min -- clamp at minimum ISO setting if so
tv96setpoint = bv96meter + sv96setpoint - min_av -- recalculate required shutter speed and hope for the best
end
end
-- Basic exposure calculation using shutter speed, iris and ISO
-- called for iris-only and "both" cameras (cameras with an iris & ND filter)
function basic_iris_calc()
tv96setpoint = tv96target
av96setpoint = av96target
-- calculate required ISO setting
sv96setpoint = tv96setpoint + av96setpoint - bv96meter
-- low ambient light ?
if (sv96setpoint > sv96max1 ) then -- check if required ISO setting is too high
sv96setpoint = sv96max1 -- clamp at first ISO limit
av96setpoint = bv96meter + sv96setpoint - tv96setpoint -- calculate new aperture setting
if ( av96setpoint < av96min ) then -- check if new setting is goes below lowest f-stop
av96setpoint = av96min -- clamp at lowest f-stop
sv96setpoint = tv96setpoint + av96setpoint - bv96meter -- recalculate ISO setting
if (sv96setpoint > sv96max2 ) then -- check if the result is above max2 ISO
sv96setpoint = sv96max2 -- clamp at highest ISO setting if so
tv96setpoint = math.max(bv96meter+sv96setpoint-av96setpoint,tv96min) -- recalculate required shutter speed down to tv minimum
end
end
-- high ambient light ?
elseif (sv96setpoint < sv96min ) then -- check if required ISO setting is too low
sv96setpoint = sv96min -- clamp at minimum ISO setting if so
tv96setpoint = bv96meter + sv96setpoint - av96setpoint -- recalculate required shutter speed
if (tv96setpoint > tv96max ) then -- check if shutter speed now too fast
tv96setpoint = tv96max -- clamp at maximum shutter speed if so
av96setpoint = bv96meter + sv96setpoint - tv96setpoint -- calculate new aperture setting
if ( av96setpoint > av96max ) then -- check if new setting is goes above highest f-stop
av96setpoint = av96max -- clamp at highest f-stop
tv96setpoint = bv96meter + sv96setpoint - av96setpoint -- recalculate shutter speed needed and hope for the best
end
end
end
end
-- calculate exposure for cams without adjustable iris or ND filter
function exposure_Tv_only()
insert_ND_filter = nil
basic_tv_calc()
end
-- calculate exposure for cams with ND filter only
function exposure_NDfilter()
insert_ND_filter = false
basic_tv_calc()
if (tv96setpoint > tv96max ) then -- check if shutter speed now too fast
insert_ND_filter = true -- flag the ND filter to be inserted
bv96meter = bv96meter - nd96offset -- adjust meter for ND offset
basic_tv_calc() -- start over, but with new meter value
bv96meter = bv96meter + nd96offset -- restore meter for later logging
end
end
-- calculate exposure for cams with adjustable iris only
function exposure_iris()
insert_ND_filter = nil
basic_iris_calc()
end
-- calculate exposure for cams with both adjustable iris and ND filter
function exposure_both()
insert_ND_filter = false -- NOTE : assume ND filter never used automatically by Canon firmware
basic_iris_calc()
if (tv96setpoint > tv96max ) then -- check if shutter speed now too fast
insert_ND_filter = true -- flag the ND filter to be inserted
bv96meter = bv96meter - nd96offset -- adjust meter for ND offset
basic_iris_calc() -- start over, but with new meter value
bv96meter = bv96meter + nd96offset -- restore meter for later logging
end
end
-- ========================== Main Program =================================
set_console_layout(1 ,1, 45, 14 )
printf("KAP 3.1 started - press MENU to exit")
bi=get_buildinfo()
printf("%s %s-%s %s %s %s", bi.version, bi.build_number, bi.build_revision, bi.platform, bi.platsub, bi.build_date)
chdk_version= tonumber(string.sub(bi.build_number,1,1))*100 + tonumber(string.sub(bi.build_number,3,3))*10 + tonumber(string.sub(bi.build_number,5,5))
if ( tonumber(bi.build_revision) > 0 ) then
build = tonumber(bi.build_revision)
else
build = tonumber(string.match(bi.build_number,'-(%d+)$'))
end
if ((chdk_version<120) or ((chdk_version==120)and(build<3276)) or ((chdk_version==130)and(build<3383))) then
printf("CHDK 1.2.0 build 3276 or higher required")
else
if( props.CONTINUOUS_AF == nil ) then caf=-999 else caf = get_prop(props.CONTINUOUS_AF) end
if( props.SERVO_AF == nil ) then saf=-999 else saf = get_prop(props.SERVO_AF) end
cmode = capmode.get_name()
printf("Mode:%s,Continuous_AF:%d,Servo_AF:%d", cmode,caf,saf)
printf(" Tv:"..print_tv(tv96target).." max:"..print_tv(tv96max).." min:"..print_tv(tv96min).." ecomp:"..(ec96adjust/96).."."..(math.abs(ec96adjust*10/96)%10) )
printf(" Av:"..print_av(av96target).." minAv:"..print_av(av96minimum).." maxAv:"..print_av(av96max) )
printf(" ISOmin:"..print_sv(sv96min).." ISO1:"..print_sv(sv96max1).." ISO2:"..print_sv(sv96max2) )
printf(" MF mode:"..focus_mode.." Video:"..video_mode.." USB:"..usb_mode)
printf(" AvM:"..Av_mode.." int:"..(interval/1000).." Shts:"..max_shots.." Dly:"..start_delay.." B/L:"..backlight)
sleep(500)
if (start_delay > 0 ) then
printf("entering start delay of ".. start_delay.." seconds")
sleep( start_delay*1000 )
end
-- enable USB remote in USB remote moded
if (usb_mode > 0 ) then
set_config_value(121,1) -- make sure USB remote is enabled
if (get_usb_power(1) == 0) then -- can we start ?
printf("waiting on USB signal")
repeat wait_click(20) until ((get_usb_power(1) == 1) or ( is_key("menu")))
else sleep(1000) end
printf("USB signal received")
end
-- switch to shooting mode
switch_mode(1)
-- set zoom position
update_zoom(zoom_setpoint)
-- lock focus at infinity
lock_focus()
-- disable flash and AF assist lamp
set_prop(props.FLASH_MODE, 2) -- flash off
set_prop(props.AF_ASSIST_BEAM,0) -- AF assist off if supported for this camera
set_config_value( 297, 60) -- set console timeout to 60 seconds
if (usb_mode > 2 ) then repeat until (get_usb_power(2) == 0 ) end -- flush pulse buffer
next_shot_time = get_tick_count()
script_exit = false
if( get_video_button() == 1) then video_button = true else video_button = false end
set_console_layout(2 ,0, 45, 4 )
repeat
if( ( (usb_mode < 2 ) and ( next_shot_time <= get_tick_count() ) )
or ( (usb_mode == 2 ) and (get_usb_power(2) > 0 ) )
or ( (usb_mode == 3 ) and (shot_request == true ) ) ) then
-- time to insert a video sequence ?
if( check_video(shot_count) == true) then next_shot_time = get_tick_count() end
-- intervalometer timing
next_shot_time = next_shot_time + interval
-- set focus at infinity ? (maybe redundant for AFL & MF mode but makes sure its set right)
if (focus_mode > 0) then
set_focus(infx)
sleep(100)
end
-- check exposure
local count = 0
local timeout = false
press("shoot_half")
repeat
sleep(50)
count = count + 1
if (count > 40 ) then timeout = true end
until (get_shooting() == true ) or (timeout == true)
-- shoot in auto mode if meter reading invalid, else calculate new desired exposure
if ( timeout == true ) then
release("shoot_half")
repeat sleep(50) until get_shooting() == false
shoot() -- shoot in Canon auto mode if we don't have a valid meter reading
shot_count = shot_count + 1
printf(string.format('IMG_%04d.JPG',get_exp_count()).." : shot in auto mode, meter reading invalid")
else
-- get meter reading values (and add in exposure compensation)
bv96raw=get_bv96()
bv96meter=bv96raw-ec96adjust
tv96meter=get_tv96()
av96meter=get_av96()
sv96meter=get_sv96()
-- set minimum Av to larger of user input or current min for zoom setting
av96min= math.max(av96minimum,get_prop(props.MIN_AV))
if (av96target < av96min) then av96target = av96min end
-- calculate required setting for current ambient light conditions
if (Av_mode == 1) then exposure_iris()
elseif (Av_mode == 2) then exposure_NDfilter()
elseif (Av_mode == 3) then exposure_both()
else exposure_Tv_only()
end
-- set up all exposure overrides
set_tv96_direct(tv96setpoint)
set_sv96(sv96setpoint)
if( av96setpoint ~= nil) then set_av96_direct(av96setpoint) end
if(Av_mode > 1) and (insert_ND_filter == true) then -- ND filter available and needed?
set_nd_filter(1) -- activate the ND filter
nd_string="NDin"
else
set_nd_filter(2) -- make sure the ND filter does not activate
nd_string="NDout"
end
-- and finally shoot the image
press("shoot_full_only")
sleep(100)
release("shoot_full")
repeat sleep(50) until get_shooting() == false
shot_count = shot_count + 1
-- update shooting statistic and log as required
shot_focus=get_focus()
if(shot_focus ~= -1) and (shot_focus < 20000) then
focus_string=" foc:"..(shot_focus/1000).."."..(((shot_focus%1000)+50)/100).."m"
if(focus_mode>0) then
error_string=" **WARNING : focus not at infinity**"
end
else
focus_string=" foc:infinity"
error_string=nil
end
printf(string.format('%d) IMG_%04d.JPG',shot_count,get_exp_count()))
printf(" meter : Tv:".. print_tv(tv96meter) .." Av:".. print_av(av96meter) .." Sv:"..print_sv(sv96meter).." "..bv96raw ..":"..bv96meter)
printf(" actual: Tv:".. print_tv(tv96setpoint).." Av:".. print_av(av96setpoint).." Sv:"..print_sv(sv96setpoint))
printf(" AvMin:".. print_av(av96min).." NDF:"..nd_string..focus_string )
if ((max_shots>0) and (shot_count >= max_shots)) then script_exit = true end
shot_request = false -- reset shot request flag
end
collectgarbage()
end
-- check if USB remote enabled in intervalometer mode and USB power is off -> pause if so
if ((usb_mode == 1 ) and (get_usb_power(1) == 0)) then
printf("waiting on USB signal")
unlock_focus()
switch_mode(0)
repeat wait_click(20) until ((get_usb_power(1) == 1) or ( is_key("menu")))
switch_mode(1)
lock_focus()
if ( is_key("menu")) then script_exit = true end
printf("USB wait finished")
sleep(100)
end
if (usb_mode == 3 ) then pwm_mode(get_usb_power(2)) end
if (blite_timer > 0) then
blite_timer = blite_timer-1
if ((blite_timer==0) and (backlight==1)) then set_lcd_display(0) end
end
if( error_string ~= nil) then
draw_string( 16, 144, string.sub(error_string.." ",0,42), 258, 259)
end
wait_click(100)
if( not( is_key("no_key"))) then
if ((blite_timer==0) and (backlight==1)) then set_lcd_display(1) end
blite_timer=300
if ( is_key("menu") ) then script_exit = true end
end
until (script_exit==true)
printf("script halt requested")
restore()
end
--[[ end of file ]]--
| gpl-3.0 |
Armyluix/darkstar | scripts/zones/Fort_Ghelsba/npcs/Treasure_Chest.lua | 19 | 2565 | -----------------------------------
-- Area: Fort Ghelsba
-- NPC: Treasure Chest
-- @zone 141
-----------------------------------
package.loaded["scripts/zones/Fort_Ghelsba/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/settings");
require("scripts/globals/treasure");
require("scripts/zones/Fort_Ghelsba/TextIDs");
local TreasureType = "Chest";
local TreasureLvL = 53;
local TreasureMinLvL = 43;
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
-- trade:hasItemQty(1024,1); -- Treasure Key
-- trade:hasItemQty(1115,1); -- Skeleton Key
-- trade:hasItemQty(1023,1); -- Living Key
-- trade:hasItemQty(1022,1); -- Thief's Tools
local questItemNeeded = 0;
-- Player traded a key.
if ((trade:hasItemQty(1024,1) or trade:hasItemQty(1115,1) or trade:hasItemQty(1023,1) or trade:hasItemQty(1022,1)) and trade:getItemCount() == 1) then
local zone = player:getZoneID();
local pack = openChance(player,npc,trade,TreasureType,TreasureLvL,TreasureMinLvL,questItemNeeded);
local success = 0;
if (pack[2] ~= nil) then
player:messageSpecial(pack[2]);
success = pack[1];
else
success = pack[1];
end
if (success ~= -2) then
player:tradeComplete();
if (math.random() <= success) then
-- Succeded to open the coffer
player:messageSpecial(CHEST_UNLOCKED);
player:setVar("["..zone.."]".."Treasure_"..TreasureType,os.time() + math.random(CHEST_MIN_ILLUSION_TIME,CHEST_MAX_ILLUSION_TIME));
local loot = chestLoot(zone,npc);
-- print("loot array: "); -- debug
-- print("[1]", loot[1]); -- debug
-- print("[2]", loot[2]); -- debug
if (loot[1]=="gil") then
player:addGil(loot[2]*GIL_RATE);
player:messageSpecial(GIL_OBTAINED,loot[2]*GIL_RATE);
else
-- Item
player:addItem(loot[2]);
player:messageSpecial(ITEM_OBTAINED,loot[2]);
end
UpdateTreasureSpawnPoint(npc:getID());
end
end
end
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
player:messageSpecial(CHEST_LOCKED,1024);
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 |
Armyluix/darkstar | scripts/zones/Tavnazian_Safehold/npcs/Ratonne.lua | 36 | 4452 | -----------------------------------
-- Area: Tavnazian Safehold
-- NPC: Ratonne
-- Armor Storage NPC
-----------------------------------
package.loaded["scripts/zones/Tavnazian_Safehold/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/quests");
require("scripts/globals/armorstorage");
require("scripts/zones/Tavnazian_Safehold/TextIDs");
Deposit = 0x01fe;
Withdrawl = 0x01ff;
ArraySize = table.getn(StorageArray);
G1 = 0;
G2 = 0;
G3 = 0;
G4 = 0;
G5 = 0;
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
for SetId = 1,ArraySize,11 do
TradeCount = trade:getItemCount();
T1 = trade:hasItemQty(StorageArray[SetId + 5],1);
if (T1 == true) then
if (player:hasKeyItem(StorageArray[SetId + 10]) == false) then
if (TradeCount == StorageArray[SetId + 3]) then
T2 = trade:hasItemQty(StorageArray[SetId + 4],1);
T3 = trade:hasItemQty(StorageArray[SetId + 6],1);
T4 = trade:hasItemQty(StorageArray[SetId + 7],1);
T5 = trade:hasItemQty(StorageArray[SetId + 8],1);
if (StorageArray[SetId + 4] == 0) then
T2 = true;
end;
if (StorageArray[SetId + 6] == 0) then
T3 = true;
end;
if (StorageArray[SetId + 7] == 0) then
T4 = true;
end;
if (StorageArray[SetId + 8] == 0) then
T5 = true;
end;
if (T2 == true and T3 == true and T4 == true and T5 == true) then
player:startEvent(Deposit,0,0,0,0,0,StorageArray[SetId + 9]);
player:addKeyItem(StorageArray[SetId + 10]);
player:messageSpecial(KEYITEM_OBTAINED,StorageArray[SetId + 10]);
break;
end;
end;
end;
end;
end;
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
CurrGil = player:getGil();
for KeyItem = 11,ArraySize,11 do
if player:hasKeyItem(StorageArray[KeyItem]) then
if StorageArray[KeyItem - 9] == 1 then
G1 = G1 + StorageArray[KeyItem - 8];
elseif StorageArray[KeyItem - 9] == 2 then
G2 = G2 + StorageArray[KeyItem - 8];
elseif StorageArray[KeyItem - 9] == 3 then
G3 = G3 + StorageArray[KeyItem - 8];
elseif StorageArray[KeyItem - 9] == 4 then
G4 = G4 + StorageArray[KeyItem - 8];
elseif StorageArray[KeyItem - 9] == 6 then
G5 = G5 + StorageArray[KeyItem - 8];
end;
end;
end;
player:startEvent(Withdrawl,G1,G2,G3,G4,CurrGil,G5);
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
if (csid == Withdrawl) then
player:updateEvent(StorageArray[option * 11 - 6],
StorageArray[option * 11 - 5],
StorageArray[option * 11 - 4],
StorageArray[option * 11 - 3],
StorageArray[option * 11 - 2],
StorageArray[option * 11 - 1]);
end;
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
if (csid == Withdrawl) then
if (option > 0 and option <= StorageArray[ArraySize] - 10) then
if (player:getFreeSlotsCount() >= StorageArray[option * 11 - 7]) then
for Item = 2,6,1 do
if (StorageArray[option * 11 - Item] > 0) then
player:addItem(StorageArray[option * 11 - Item],1);
player:messageSpecial(ITEM_OBTAINED,StorageArray[option * 11 - Item]);
end;
end;
player:delKeyItem(StorageArray[option * 11]);
player:setGil(player:getGil() - StorageArray[option * 11 - 1]);
else
for Item = 2,6,1 do
if (StorageArray[option * 11 - Item] > 0) then
player:messageSpecial(ITEM_CANNOT_BE_OBTAINED,StorageArray[option * 11 - Item]);
end;
end;
end;
end;
end;
if (csid == Deposit) then
player:tradeComplete();
end;
end; | gpl-3.0 |
abriasffxi/darkstar | scripts/globals/items/beluga.lua | 41 | 1064 | -----------------------------------------
-- ID: Beluga
-- Beluga
-- Additional Effect: Ice Damage
-----------------------------------------
require("scripts/globals/status");
require("scripts/globals/magic");
-----------------------------------
-- onAdditionalEffect Action
-----------------------------------
function onAdditionalEffect(player,target,damage)
local chance = 10;
if (math.random(0,99) >= chance) then
return 0,0,0;
else
local dmg = math.random(7,21);
local params = {};
params.bonusmab = 0;
params.includemab = false;
dmg = addBonusesAbility(player, ELE_WATER, target, dmg, params);
dmg = dmg * applyResistanceAddEffect(player,target,ELE_WATER,0);
dmg = adjustForTarget(target,dmg,ELE_WATER);
dmg = finalMagicNonSpellAdjustments(player,target,ELE_WATER,dmg);
local message = MSGBASIC_ADD_EFFECT_DMG;
if (dmg < 0) then
message = MSGBASIC_ADD_EFFECT_HEAL;
end
return SUBEFFECT_WATER_DAMAGE,message,dmg;
end
end; | gpl-3.0 |
uspgamedev/backdoor | game/gamestates/open_pack.lua | 1 | 4206 |
-- luacheck: no self
local INPUT = require 'input'
local DIRECTIONALS = require 'infra.dir'
local PROFILE = require 'infra.profile'
local SWITCHER = require 'infra.switcher'
local PLAYSFX = require 'helpers.playsfx'
local PackView = require 'view.packlist'
local CardView = require 'view.consumelist'
local Draw = require "draw"
local state = {}
local _route
local _card_list_view
local _pack
local _leave
local _view
local _status
local _pack_index
function state:init()
end
local function _prev()
_card_list_view:selectPrev()
end
local function _next()
_card_list_view:selectNext()
end
local function _toggle()
_card_list_view:toggleSelected()
end
local function _confirm(which)
if _status == "choosing_pack" then
_status = "choosing_card"
if which == "single" then
local collection = _card_list_view:getChosenPack()
_pack = _route.makePack(collection, _route.getControlledActor())
_pack_index = _card_list_view:getSelection()
elseif which == "all" then
_pack = {}
for _,collection in ipairs(_card_list_view:getAllPacks()) do
for _,card in ipairs(_route.makePack(collection, _route.getControlledActor())) do
table.insert(_pack, card)
end
end
_pack_index = "all"
else
error("Not a valid mode for opening packs: "..which)
end
_card_list_view:close()
_card_list_view = CardView({"CONFIRM"})
_card_list_view:open(_pack)
_card_list_view:register("HUD")
_card_list_view:sendToBackbuffer(_view.backbuffer)
_view.actor:show()
if not PROFILE.getTutorial("consume") then
local GS = require 'gamestates'
_card_list_view:lockHoldbar()
SWITCHER.push(GS.TUTORIAL_HINT, "consume")
return
end
end
end
local function _cancel()
if _status == "choosing_pack" then
_leave = true
else
PLAYSFX('denied')
end
end
local function _consumeCards(consumed)
local count = 0
for _,i in ipairs(consumed) do
table.remove(_pack, i-count)
count = count + 1
end
end
function state:enter(_, view, route, packlist)
_view = view
_view.action_hud.minimap:hide()
_status = "choosing_pack"
_route = route
_pack = nil
_card_list_view = PackView({"UP", "CONFIRM"}, {"DOWN"}, packlist)
if #packlist > 0 then
_card_list_view:register("HUD")
else
_leave = true
end
end
function state:resume()
_card_list_view:unlockHoldbar()
end
function state:leave()
if _card_list_view.getExpGained and _card_list_view:getExpGained() > 0 then
_view.actor:timedHide(1)
else
_view.actor:hide()
end
_view.action_hud.minimap:show()
_leave = false
_card_list_view:close()
_card_list_view = nil
end
function state:update(_)
if not PROFILE.getTutorial("open_pack") then
local GS = require 'gamestates'
_card_list_view:lockHoldbar()
SWITCHER.push(GS.TUTORIAL_HINT, "open_pack")
return
end
if _status == "choosing_pack" and
(_leave or _card_list_view:isPackListEmpty()) then
PLAYSFX('back-menu')
SWITCHER.pop({
consumed = {},
pack = nil,
pack_index = nil,
})
elseif _status == "choosing_card" and
(_leave or _card_list_view:isReadyToLeave()) then
PLAYSFX('back-menu')
local consume_log = _card_list_view:getConsumeLog()
_consumeCards(consume_log)
SWITCHER.pop({
consumed = consume_log,
pack = _pack,
pack_index = _pack_index
})
else
local result, which
if _status == "choosing_pack" then
result, which = _card_list_view:usedHoldbar()
end
if result then
PLAYSFX 'open-pack'
_confirm(which)
elseif DIRECTIONALS.wasDirectionTriggered('LEFT') then
PLAYSFX('select-card')
_prev()
elseif DIRECTIONALS.wasDirectionTriggered('RIGHT') then
PLAYSFX('select-card')
_next()
elseif _status == "choosing_card" and
(DIRECTIONALS.wasDirectionTriggered('UP') or
DIRECTIONALS.wasDirectionTriggered('DOWN')) then
PLAYSFX('toggle-card')
_toggle()
elseif INPUT.wasActionPressed('CANCEL') then
_cancel()
end
end
end
function state:draw()
Draw.allTables()
end
return state
| gpl-3.0 |
ElectroDuk/QuackWars | garrysmod/gamemodes/Basewars(Broken}/entities(maybe_outdated)/entities/ent_mad_rocket/cl_init.lua | 3 | 1622 | ENT.Spawnable = false
ENT.AdminSpawnable = false
include("shared.lua")
language.Add("ent_mad_rocket", "Rocket")
/*---------------------------------------------------------
Name: ENT:Initialize()
---------------------------------------------------------*/
function ENT:Initialize()
self.TimeLeft = CurTime() + 3
local vOffset = self.Entity:LocalToWorld(Vector(0, 0, self.Entity:OBBMins().z))
local vNormal = (vOffset - self.Entity:GetPos()):GetNormalized()
local emitter = ParticleEmitter(vOffset)
// 150 particles per second during 30 seconds
for i = 1, 4500 do
timer.Simple(i / 150, function()
if not self.Entity then return end
local vOffset = self.Entity:LocalToWorld(Vector(0, 0, self.Entity:OBBMins().z))
local vNormal = (vOffset - self.Entity:GetPos()):GetNormalized()
local particle = emitter:Add("particle/particle_smokegrenade", vOffset)
particle:SetVelocity(vNormal * 5)
particle:SetDieTime(10)
particle:SetStartAlpha(255)
particle:SetStartSize(5)
particle:SetEndSize(25)
particle:SetRoll(math.Rand(-5, 5))
particle:SetColor(160, 160, 160)
end)
end
emitter:Finish()
end
/*---------------------------------------------------------
Name: ENT:Think()
---------------------------------------------------------*/
function ENT:Think()
if self.TimeLeft > CurTime() then
local effectdata = EffectData()
effectdata:SetOrigin(self.Entity:LocalToWorld(Vector(0, 0, self.Entity:OBBMins().z)))
effectdata:SetAngle(self.Entity:GetAngles() + Vector(180, 0, 0))
effectdata:SetScale(1.5)
util.Effect("MuzzleEffect", effectdata)
end
end
| mit |
ElectroDuk/QuackWars | garrysmod/gamemodes/Basewars/entities(maybe_outdated)/weapons/weapon_mad_base_sniper/shared.lua | 2 | 12245 | // Variables that are used on both client and server
// The scope code is based on the Realistic Weapons Base made by Teta Bonita
SWEP.Base = "weapon_mad_base"
SWEP.ShellEffect = "effect_mad_shell_rifle" // "effect_mad_shell_pistol" or "effect_mad_shell_rifle" or "effect_mad_shell_shotgun"
SWEP.ShellDelay = 1
SWEP.Pistol = false
SWEP.Rifle = false
SWEP.Shotgun = false
SWEP.Sniper = true
SWEP.Penetration = true
SWEP.Ricochet = true
local sndZoomIn = Sound("Weapon_AR2.Special1")
local sndZoomOut = Sound("Weapon_AR2.Special2")
local sndCycleZoom = Sound("Default.Zoom")
/*---------------------------------------------------------
Name: SWEP:Precache()
Desc: Use this function to precache stuff.
---------------------------------------------------------*/
function SWEP:Precache()
util.PrecacheSound("weapons/sniper/sniper_zoomin.wav")
util.PrecacheSound("weapons/sniper/sniper_zoomout.wav")
util.PrecacheSound("weapons/zoom.wav")
end
/*---------------------------------------------------------
Name: SWEP:Initialize()
Desc: Called when the weapon is first loaded.
---------------------------------------------------------*/
function SWEP:Initialize()
if (SERVER) then
self:SetWeaponHoldType(self.HoldType)
// Fucking NPCs
self:SetNPCMinBurst(30)
self:SetNPCMaxBurst(30)
self:SetNPCFireRate(self.Primary.Delay)
end
if (CLIENT) then
local iScreenWidth = surface.ScreenWidth()
local iScreenHeight = surface.ScreenHeight()
self.ScopeTable = {}
self.ScopeTable.l = iScreenHeight * self.ScopeScale
self.ScopeTable.x1 = 0.5 * (iScreenWidth + self.ScopeTable.l)
self.ScopeTable.y1 = 0.5 * (iScreenHeight - self.ScopeTable.l)
self.ScopeTable.x2 = self.ScopeTable.x1
self.ScopeTable.y2 = 0.5 * (iScreenHeight + self.ScopeTable.l)
self.ScopeTable.x3 = 0.5 * (iScreenWidth - self.ScopeTable.l)
self.ScopeTable.y3 = self.ScopeTable.y2
self.ScopeTable.x4 = self.ScopeTable.x3
self.ScopeTable.y4 = self.ScopeTable.y1
self.ParaScopeTable = {}
self.ParaScopeTable.x = 0.5 * iScreenWidth - self.ScopeTable.l
self.ParaScopeTable.y = 0.5 * iScreenHeight - self.ScopeTable.l
self.ParaScopeTable.w = 2 * self.ScopeTable.l
self.ParaScopeTable.h = 2 * self.ScopeTable.l
self.ScopeTable.l = (iScreenHeight + 1) * self.ScopeScale
self.QuadTable = {}
self.QuadTable.x1 = 0
self.QuadTable.y1 = 0
self.QuadTable.w1 = iScreenWidth
self.QuadTable.h1 = 0.5 * iScreenHeight - self.ScopeTable.l
self.QuadTable.x2 = 0
self.QuadTable.y2 = 0.5 * iScreenHeight + self.ScopeTable.l
self.QuadTable.w2 = self.QuadTable.w1
self.QuadTable.h2 = self.QuadTable.h1
self.QuadTable.x3 = 0
self.QuadTable.y3 = 0
self.QuadTable.w3 = 0.5 * iScreenWidth - self.ScopeTable.l
self.QuadTable.h3 = iScreenHeight
self.QuadTable.x4 = 0.5 * iScreenWidth + self.ScopeTable.l
self.QuadTable.y4 = 0
self.QuadTable.w4 = self.QuadTable.w3
self.QuadTable.h4 = self.QuadTable.h3
self.LensTable = {}
self.LensTable.x = self.QuadTable.w3
self.LensTable.y = self.QuadTable.h1
self.LensTable.w = 2 * self.ScopeTable.l
self.LensTable.h = 2 * self.ScopeTable.l
self.CrossHairTable = {}
self.CrossHairTable.x11 = 0
self.CrossHairTable.y11 = 0.5 * iScreenHeight
self.CrossHairTable.x12 = iScreenWidth
self.CrossHairTable.y12 = self.CrossHairTable.y11
self.CrossHairTable.x21 = 0.5 * iScreenWidth
self.CrossHairTable.y21 = 0
self.CrossHairTable.x22 = 0.5 * iScreenWidth
self.CrossHairTable.y22 = iScreenHeight
end
self.ScopeZooms = self.ScopeZooms or {5}
self.CurScopeZoom = 1
self:ResetVariables()
end
/*---------------------------------------------------------
Name: SWEP:ResetVariables()
Desc: Reset all varibles.
---------------------------------------------------------*/
function SWEP:ResetVariables()
self.bLastIron = false
self.Weapon:SetDTBool(1, false)
self.CurScopeZoom = 1
self.fLastScopeZoom = 1
self.bLastScope = false
self.Weapon:SetDTBool(2, false)
self.Weapon:SetNetworkedFloat("ScopeZoom", self.ScopeZooms[1])
if (self.Owner) then
self.OwnerIsNPC = self.Owner:IsNPC()
end
end
/*---------------------------------------------------------
Name: SWEP:Reload()
Desc: Reload is being pressed.
---------------------------------------------------------*/
function SWEP:Reload()
// When the weapon is already doing an animation, just return end because we don't want to interrupt it
if (self.ActionDelay > CurTime()) then return end
// Need to call the default reload before the real reload animation (don't try to understand my reason)
self.Weapon:DefaultReload(ACT_VM_RELOAD)
if (IsValid(self.Owner) and self.Owner:GetViewModel()) then
self:IdleAnimation(self.Owner:GetViewModel():SequenceDuration())
end
if (self.Weapon:Clip1() < self.Primary.ClipSize) and (self.Owner:GetAmmoCount(self.Primary.Ammo) > 0) then
self:SetIronsights(false)
self:ReloadAnimation()
self:ResetVariables()
if not (CLIENT) then
self.Owner:DrawViewModel(true)
end
end
end
/*---------------------------------------------------------
Name: SWEP:PrimaryAttack()
Desc: +attack1 has been pressed.
---------------------------------------------------------*/
function SWEP:PrimaryAttack()
// Holst/Deploy your fucking weapon
if (not self.Owner:IsNPC() and self.Owner:KeyDown(IN_USE)) then
bHolsted = !self.Weapon:GetDTBool(0)
self:SetHolsted(bHolsted)
self.Weapon:SetNextPrimaryFire(CurTime() + 0.3)
self.Weapon:SetNextSecondaryFire(CurTime() + 0.3)
self:SetIronsights(false)
return
end
if (not self:CanPrimaryAttack()) then return end
self.ActionDelay = (CurTime() + self.Primary.Delay + 0.05)
self.Weapon:SetNextPrimaryFire(CurTime() + self.Primary.Delay)
self.Weapon:SetNextSecondaryFire(CurTime() + self.Primary.Delay)
// If the burst mode is activated, it's going to shoot the three bullets (or more if you're dumb and put 4 or 5 bullets for your burst mode)
if self.Weapon:GetNetworkedBool("Burst") then
self.BurstTimer = CurTime()
self.BurstCounter = self.BurstShots - 1
self.Weapon:SetNextPrimaryFire(CurTime() + 0.5)
end
if (not self.Owner:IsNPC()) and (self.BoltActionSniper) and (self.Weapon:GetDTBool(1)) then
self:ResetVariables()
self.ScopeAfterShoot = true
timer.Simple(self.Primary.Delay, function()
if not self.Owner then return end
if (self.ScopeAfterShoot) and (self.Weapon:Clip1() > 0) then
self.Weapon:SetNextPrimaryFire(CurTime() + 0.2)
self.Weapon:SetNextSecondaryFire(CurTime() + 0.2)
self:SetIronsights(true)
end
end)
end
self.Weapon:EmitSound(self.Primary.Sound)
self:TakePrimaryAmmo(1)
self:ShootBulletInformation()
end
/*---------------------------------------------------------
Name: function SimilarizeAngles()
---------------------------------------------------------*/
local LastViewAng = false
local function SimilarizeAngles(ang1, ang2)
ang1.y = math.fmod (ang1.y, 360)
ang2.y = math.fmod (ang2.y, 360)
if math.abs (ang1.y - ang2.y) > 180 then
if ang1.y - ang2.y < 0 then
ang1.y = ang1.y + 360
else
ang1.y = ang1.y - 360
end
end
end
/*---------------------------------------------------------
Name: function ReduceScopeSensitivity()
---------------------------------------------------------*/
local function ReduceScopeSensitivity(uCmd)
if LocalPlayer():GetActiveWeapon() and LocalPlayer():GetActiveWeapon():IsValid() then
local newAng = uCmd:GetViewAngles()
if LastViewAng then
SimilarizeAngles (LastViewAng, newAng)
local diff = newAng - LastViewAng
diff = diff * (LocalPlayer():GetActiveWeapon().MouseSensitivity or 1)
uCmd:SetViewAngles (LastViewAng + diff)
end
end
LastViewAng = uCmd:GetViewAngles()
end
hook.Add ("CreateMove", "ReduceScopeSensitivity", ReduceScopeSensitivity)
/*---------------------------------------------------------
Name: SWEP:SetIronsights()
---------------------------------------------------------*/
local IRONSIGHT_TIME = 0.2
function SWEP:SetIronsights(b)
if (CLIENT) then return end
if (self.Weapon) then
self.Weapon:SetDTBool(1, b)
end
if (b) then
timer.Simple(IRONSIGHT_TIME, self.SetScope, self, true, player)
else
self:SetScope(false, player)
end
end
/*---------------------------------------------------------
Name: SWEP:SetScope()
---------------------------------------------------------*/
function SWEP:SetScope(b, player)
if CLIENT then return end
local PlaySound = b ~= self.Weapon:GetDTBool(2) // Only play zoom sounds when chaning in/out of scope mode
self.CurScopeZoom = 1 // Just in case
self.Weapon:SetNetworkedFloat("ScopeZoom", self.ScopeZooms[self.CurScopeZoom])
if (b) then
if (PlaySound) then
self.Weapon:EmitSound(sndZoomIn)
end
else
if PlaySound then
self.Weapon:EmitSound(sndZoomOut)
end
end
// Send the scope state to the client, so it can adjust the player's fov/HUD accordingly
self.Weapon:SetDTBool(2, b)
end
/*---------------------------------------------------------
Name: SWEP:Think()
Desc: Called every frame.
---------------------------------------------------------*/
function SWEP:Think()
self:SecondThink()
if self.IdleDelay < CurTime() and self.IdleApply and self.Weapon:Clip1() > 0 then
local WeaponModel = self.Weapon:GetOwner():GetActiveWeapon():GetClass()
if self.Weapon:GetOwner():GetActiveWeapon():GetClass() == WeaponModel and self.Owner:Alive() then
if self.Weapon:GetNetworkedBool("Suppressor") then
self.Weapon:SendWeaponAnim(ACT_VM_IDLE_SILENCED)
else
self.Weapon:SendWeaponAnim(ACT_VM_IDLE)
end
if self.AllowPlaybackRate and not self.Weapon:GetDTBool(1) then
self.Owner:GetViewModel():SetPlaybackRate(1)
else
self.Owner:GetViewModel():SetPlaybackRate(0)
end
end
self.IdleApply = false
elseif self.Weapon:Clip1() <= 0 then
self.IdleApply = false
end
if (self.Weapon:GetDTBool(1) or self.Weapon:GetDTBool(2)) and self.Owner:KeyDown(IN_SPEED) then
self:ResetVariables()
self.Owner:SetFOV(0, 0.2)
end
if (self.BoltActionSniper) and (self.Owner:KeyPressed(IN_ATTACK2) or self.Owner:KeyPressed(IN_RELOAD)) then
self.ScopeAfterShoot = false
end
if self.Owner:KeyDown(IN_SPEED) or self.Weapon:GetDTBool(0) then
if (self.BoltActionSniper) then
self.ScopeAfterShoot = false
end
if self.Rifle or self.Sniper or self.Shotgun then
if (SERVER) then
self:SetWeaponHoldType("passive")
end
elseif self.Pistol then
if (SERVER) then
self:SetWeaponHoldType("normal")
end
end
else
if (SERVER) then
self:SetWeaponHoldType(self.HoldType)
end
end
if self.Weapon:GetNetworkedBool("Burst") then
if self.BurstTimer + self.BurstDelay < CurTime() then
if self.BurstCounter > 0 then
self.BurstCounter = self.BurstCounter - 1
self.BurstTimer = CurTime()
if self:CanPrimaryAttack() then
self.Weapon:EmitSound(self.Primary.Sound)
self:ShootBulletInformation()
self:TakePrimaryAmmo(1)
end
end
end
end
if (CLIENT) and (self.Weapon:GetDTBool(2)) then
self.MouseSensitivity = self.Owner:GetFOV() / 60
else
self.MouseSensitivity = 1
end
if not (CLIENT) and (self.Weapon:GetDTBool(2)) and (self.Weapon:GetDTBool(1)) then
self.Owner:DrawViewModel(false)
elseif not (CLIENT) then
self.Owner:DrawViewModel(true)
end
self:NextThink(CurTime())
end
/*---------------------------------------------------------
Name: SWEP:Holster()
Desc: Weapon wants to holster.
Return true to allow the weapon to holster.
---------------------------------------------------------*/
function SWEP:Holster()
self:ResetVariables()
return true
end
/*---------------------------------------------------------
Name: SWEP:OnRemove()
Desc: Called just before entity is deleted.
---------------------------------------------------------*/
function SWEP:OnRemove()
self:ResetVariables()
return true
end
/*---------------------------------------------------------
Name: SWEP:OwnerChanged()
Desc: When weapon is dropped or picked up by a new player.
---------------------------------------------------------*/
function SWEP:OwnerChanged()
self:ResetVariables()
return true
end | mit |
abriasffxi/darkstar | scripts/zones/South_Gustaberg/npcs/Field_Manual.lua | 29 | 1063 | -----------------------------------
-- Field Manual
-- Area: South Gustaberg
-----------------------------------
require("scripts/globals/settings");
require("scripts/globals/fieldsofvalor");
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
startFov(FOV_EVENT_SOUTH_GUSTABERG,player);
end;
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onEventSelection
-----------------------------------
function onEventUpdate(player,csid,menuchoice)
updateFov(player,csid,menuchoice,76,77,78,79,80);
end;
-----------------------------------
-- onEventFinish Action
-----------------------------------
function onEventFinish(player,csid,option)
finishFov(player,csid,option,76,77,78,79,80,FOV_MSG_SOUTH_GUSTABERG);
end;
| gpl-3.0 |
Armyluix/darkstar | scripts/globals/spells/bluemagic/firespit.lua | 27 | 1478 | -----------------------------------------
-- Spell: Firespit
-- Deals fire damage to an enemy
-- Spell cost: 121 MP
-- Monster Type: Beastmen
-- Spell Type: Magical (Fire)
-- Blue Magic Points: 5
-- Stat Bonus: STR+3
-- Level: 68
-- Casting Time: 6.5 seconds
-- Recast Time: 42.75 seconds
-- Magic Bursts on: Liquefaction, Fusion, and Light
-- Combos: Conserve MP
-----------------------------------------
require("scripts/globals/magic");
require("scripts/globals/status");
require("scripts/globals/bluemagic");
-----------------------------------------
-- OnMagicCastingCheck
-----------------------------------------
function onMagicCastingCheck(caster,target,spell)
return 0;
end;
-----------------------------------------
-- OnSpellCast
-----------------------------------------
function onSpellCast(caster,target,spell)
local params = {};
-- This data should match information on http://wiki.ffxiclopedia.org/wiki/Calculating_Blue_Magic_Damage
params.multiplier = 3.0;
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.2;
params.mnd_wsc = 0.2;
params.chr_wsc = 0.0;
damage = BlueMagicalSpell(caster, target, spell, params, INT_BASED);
damage = BlueFinalAdjustments(caster, target, spell, damage, params);
return damage;
end; | gpl-3.0 |
Armyluix/darkstar | scripts/zones/Temple_of_Uggalepih/npcs/_mf8.lua | 17 | 1403 | -----------------------------------
-- Area: Temple of Uggalepih
-- NPC: _mf8 (Granite Door)
-- Notes: Opens with Prelate Key
-- @pos -11 -8 -99 159
-----------------------------------
package.loaded["scripts/zones/Temple_of_Uggalepih/TextIDs"] = nil;
-----------------------------------
require("scripts/zones/Temple_of_Uggalepih/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
if (trade:hasItemQty(1137,1) and trade:getItemCount() == 1) then -- Trade Prelate Key
player:tradeComplete();
player:messageSpecial(YOUR_KEY_BREAKS,0000,1137);
npc:openDoor(6.5);
end
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
if (player:getXPos() <= -8) then
player:messageSpecial(THE_DOOR_IS_LOCKED,1137);
else
npc:openDoor(11); -- retail timed
end
return 1;
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end; | gpl-3.0 |
Francesco149/lainbot | plugins/vote.lua | 615 | 2128 | do
local _file_votes = './data/votes.lua'
function read_file_votes ()
local f = io.open(_file_votes, "r+")
if f == nil then
print ('Created voting file '.._file_votes)
serialize_to_file({}, _file_votes)
else
print ('Values loaded: '.._file_votes)
f:close()
end
return loadfile (_file_votes)()
end
function clear_votes (chat)
local _votes = read_file_votes ()
_votes [chat] = {}
serialize_to_file(_votes, _file_votes)
end
function votes_result (chat)
local _votes = read_file_votes ()
local results = {}
local result_string = ""
if _votes [chat] == nil then
_votes[chat] = {}
end
for user,vote in pairs (_votes[chat]) do
if (results [vote] == nil) then
results [vote] = user
else
results [vote] = results [vote] .. ", " .. user
end
end
for vote,users in pairs (results) do
result_string = result_string .. vote .. " : " .. users .. "\n"
end
return result_string
end
function save_vote(chat, user, vote)
local _votes = read_file_votes ()
if _votes[chat] == nil then
_votes[chat] = {}
end
_votes[chat][user] = vote
serialize_to_file(_votes, _file_votes)
end
function run(msg, matches)
if (matches[1] == "ing") then
if (matches [2] == "reset") then
clear_votes (tostring(msg.to.id))
return "Voting statistics reset.."
elseif (matches [2] == "stats") then
local votes_result = votes_result (tostring(msg.to.id))
if (votes_result == "") then
votes_result = "[No votes registered]\n"
end
return "Voting statistics :\n" .. votes_result
end
else
save_vote(tostring(msg.to.id), msg.from.print_name, tostring(tonumber(matches[2])))
return "Vote registered : " .. msg.from.print_name .. " " .. tostring(tonumber(matches [2]))
end
end
return {
description = "Plugin for voting in groups.",
usage = {
"!voting reset: Reset all the votes.",
"!vote [number]: Cast the vote.",
"!voting stats: Shows the statistics of voting."
},
patterns = {
"^!vot(ing) (reset)",
"^!vot(ing) (stats)",
"^!vot(e) ([0-9]+)$"
},
run = run
}
end | gpl-2.0 |
kidaa/Awakening-Core3 | bin/scripts/commands/sampleDNA.lua | 4 | 2120 | --Copyright (C) 2007 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
--which carries forward this exception.
--true = 1, false = 0
SampleDNACommand = {
name = "sampledna",
}
AddCommand(SampleDNACommand)
| lgpl-3.0 |
eraffxi/darkstar | scripts/zones/Tahrongi_Canyon/Zone.lua | 2 | 4004 | -----------------------------------
--
-- Zone: Tahrongi_Canyon (117)
--
-----------------------------------
package.loaded["scripts/zones/Tahrongi_Canyon/TextIDs"] = nil;
-----------------------------------
require("scripts/zones/Tahrongi_Canyon/TextIDs");
require("scripts/zones/Tahrongi_Canyon/MobIDs");
require("scripts/globals/icanheararainbow");
require("scripts/globals/chocobo_digging");
require("scripts/globals/weather");
require("scripts/globals/zone");
-----------------------------------
local itemMap =
{
-- itemid, abundance, requirement
{ 880, 224, DIGREQ_NONE },
{ 887, 39, DIGREQ_NONE },
{ 645, 14, DIGREQ_NONE },
{ 893, 105, DIGREQ_NONE },
{ 737, 17, DIGREQ_NONE },
{ 643, 64, DIGREQ_NONE },
{ 17296, 122, DIGREQ_NONE },
{ 942, 6, DIGREQ_NONE },
{ 642, 58, DIGREQ_NONE },
{ 864, 22, DIGREQ_NONE },
{ 843, 4, DIGREQ_NONE },
{ 4096, 100, DIGREQ_NONE }, -- all crystals
{ 1255, 10, DIGREQ_NONE }, -- all ores
{ 656, 95, DIGREQ_BURROW },
{ 749, 26, DIGREQ_BURROW },
{ 751, 33, DIGREQ_BURROW },
{ 750, 89, DIGREQ_BURROW },
{ 902, 6, DIGREQ_BORE },
{ 886, 3, DIGREQ_BORE },
{ 867, 3, DIGREQ_BORE },
{ 1587, 19, DIGREQ_BORE },
{ 888, 25, DIGREQ_BORE },
{ 1586, 8, DIGREQ_BORE },
{ 885, 10, DIGREQ_BORE },
{ 866, 3, DIGREQ_BORE },
{ 4570, 10, DIGREQ_MODIFIER },
{ 4487, 11, DIGREQ_MODIFIER },
{ 4409, 12, DIGREQ_MODIFIER },
{ 1188, 10, DIGREQ_MODIFIER },
{ 4532, 12, DIGREQ_MODIFIER },
};
local messageArray = { DIG_THROW_AWAY, FIND_NOTHING, ITEM_OBTAINED };
function onChocoboDig(player, precheck)
return chocoboDig(player, itemMap, precheck, messageArray);
end;
function onInitialize(zone)
end;
function onZoneIn( player, prevZone)
local cs = -1;
if (player:getXPos() == 0 and player:getYPos() == 0 and player:getZPos() == 0) then
player:setPos( 442.781, -1.641, -40.144, 160);
end
if (triggerLightCutscene(player)) then -- Quest: I Can Hear A Rainbow
cs = 35;
elseif (player:getCurrentMission(WINDURST) == VAIN and player:getVar("MissionStatus") ==1) then
cs = 37;
end
return cs;
end;
function onConquestUpdate(zone, updatetype)
local players = zone:getPlayers();
for name, player in pairs(players) do
conquestUpdate(zone, player, updatetype, CONQUEST_BASE);
end
end;
function onRegionEnter( player, region)
end;
function onEventUpdate( player, csid, option)
if (csid == 35) then
lightCutsceneUpdate(player); -- Quest: I Can Hear A Rainbow
elseif (csid == 37) then
if (player:getPreviousZone() == 116 or player:getPreviousZone() == 118) then
player:updateEvent(0,0,0,0,0,7);
elseif (player:getPreviousZone() == 198) then
player:updateEvent(0,0,0,0,0,6);
end
end
end;
function onEventFinish( player, csid, option)
if (csid == 35) then
lightCutsceneFinish(player); -- Quest: I Can Hear A Rainbow
end
end;
function isHabrokWeather(weather)
return (weather == dsp.weather.DUST_STORM or weather == dsp.weather.SAND_STORM or weather == dsp.weather.WIND or weather == dsp.weather.GALES);
end
function onZoneWeatherChange(weather)
local habrok = GetMobByID(HABROK);
if (habrok:isSpawned() and not isHabrokWeather(weather)) then
DespawnMob(HABROK);
elseif (not habrok:isSpawned() and isHabrokWeather(weather) and os.time() > habrok:getLocalVar("pop")) then
SpawnMob(HABROK);
end
end; | gpl-3.0 |
hayword/tfatf_epgp | libs/LibJSON-1.0/LibStub/LibStub.lua | 184 | 1367 | -- LibStub is a simple versioning stub meant for use in Libraries. http://www.wowace.com/wiki/LibStub for more info
-- LibStub is hereby placed in the Public Domain Credits: Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel, joshborke
local LIBSTUB_MAJOR, LIBSTUB_MINOR = "LibStub", 2 -- NEVER MAKE THIS AN SVN REVISION! IT NEEDS TO BE USABLE IN ALL REPOS!
local LibStub = _G[LIBSTUB_MAJOR]
if not LibStub or LibStub.minor < LIBSTUB_MINOR then
LibStub = LibStub or {libs = {}, minors = {} }
_G[LIBSTUB_MAJOR] = LibStub
LibStub.minor = LIBSTUB_MINOR
function LibStub:NewLibrary(major, minor)
assert(type(major) == "string", "Bad argument #2 to `NewLibrary' (string expected)")
minor = assert(tonumber(strmatch(minor, "%d+")), "Minor version must either be a number or contain a number.")
local oldminor = self.minors[major]
if oldminor and oldminor >= minor then return nil end
self.minors[major], self.libs[major] = minor, self.libs[major] or {}
return self.libs[major], oldminor
end
function LibStub:GetLibrary(major, silent)
if not self.libs[major] and not silent then
error(("Cannot find a library instance of %q."):format(tostring(major)), 2)
end
return self.libs[major], self.minors[major]
end
function LibStub:IterateLibraries() return pairs(self.libs) end
setmetatable(LibStub, { __call = LibStub.GetLibrary })
end
| bsd-3-clause |
ckaotik/ckaosSocial | libs/LibStub.lua | 184 | 1367 | -- LibStub is a simple versioning stub meant for use in Libraries. http://www.wowace.com/wiki/LibStub for more info
-- LibStub is hereby placed in the Public Domain Credits: Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel, joshborke
local LIBSTUB_MAJOR, LIBSTUB_MINOR = "LibStub", 2 -- NEVER MAKE THIS AN SVN REVISION! IT NEEDS TO BE USABLE IN ALL REPOS!
local LibStub = _G[LIBSTUB_MAJOR]
if not LibStub or LibStub.minor < LIBSTUB_MINOR then
LibStub = LibStub or {libs = {}, minors = {} }
_G[LIBSTUB_MAJOR] = LibStub
LibStub.minor = LIBSTUB_MINOR
function LibStub:NewLibrary(major, minor)
assert(type(major) == "string", "Bad argument #2 to `NewLibrary' (string expected)")
minor = assert(tonumber(strmatch(minor, "%d+")), "Minor version must either be a number or contain a number.")
local oldminor = self.minors[major]
if oldminor and oldminor >= minor then return nil end
self.minors[major], self.libs[major] = minor, self.libs[major] or {}
return self.libs[major], oldminor
end
function LibStub:GetLibrary(major, silent)
if not self.libs[major] and not silent then
error(("Cannot find a library instance of %q."):format(tostring(major)), 2)
end
return self.libs[major], self.minors[major]
end
function LibStub:IterateLibraries() return pairs(self.libs) end
setmetatable(LibStub, { __call = LibStub.GetLibrary })
end
| bsd-3-clause |
kidaa/Awakening-Core3 | bin/scripts/object/tangible/loot/collectible/kits/serverobjects.lua | 3 | 2438 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
--Children folder includes
-- Server Objects
includeFile("tangible/loot/collectible/kits/blue_rug_kit.lua")
includeFile("tangible/loot/collectible/kits/fs_tracking_device_kit.lua")
includeFile("tangible/loot/collectible/kits/gong_kit.lua")
includeFile("tangible/loot/collectible/kits/light_table_kit.lua")
includeFile("tangible/loot/collectible/kits/orange_rug_kit.lua")
includeFile("tangible/loot/collectible/kits/sculpture_kit.lua")
| lgpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/object/tangible/lair/eopie/lair_eopie_dune.lua | 2 | 2280 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_tangible_lair_eopie_lair_eopie_dune = object_tangible_lair_eopie_shared_lair_eopie_dune:new {
objectMenuComponent = {"cpp", "LairMenuComponent"},
}
ObjectTemplates:addTemplate(object_tangible_lair_eopie_lair_eopie_dune, "object/tangible/lair/eopie/lair_eopie_dune.iff")
| lgpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/object/tangible/component/droid/droid_storage_compartment.lua | 3 | 2783 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_tangible_component_droid_droid_storage_compartment = object_tangible_component_droid_shared_droid_storage_compartment:new {
numberExperimentalProperties = {1, 1, 1, 1, 1},
experimentalProperties = {"XX", "XX", "DR", "XX", "OQ"},
experimentalWeights = {1, 1, 1, 1, 1},
experimentalGroupTitles = {"null", "null", "exp_durability", "null", "exp_effectiveness"},
experimentalSubGroupTitles = {"null", "null", "decayrate", "hitpoints", "usemodifier"},
experimentalMin = {0, 0, 5, 1000, -5},
experimentalMax = {0, 0, 15, 1000, 5},
experimentalPrecision = {0, 0, 0, 0, 0},
experimentalCombineType = {0, 0, 1, 4, 1},
}
ObjectTemplates:addTemplate(object_tangible_component_droid_droid_storage_compartment, "object/tangible/component/droid/droid_storage_compartment.iff")
| lgpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/object/mobile/dressed_cobral_overlord_human_male_01.lua | 3 | 2264 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_mobile_dressed_cobral_overlord_human_male_01 = object_mobile_shared_dressed_cobral_overlord_human_male_01:new {
}
ObjectTemplates:addTemplate(object_mobile_dressed_cobral_overlord_human_male_01, "object/mobile/dressed_cobral_overlord_human_male_01.iff")
| lgpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/object/tangible/wearables/armor/ithorian_sentinel/ith_armor_s03_leggings.lua | 1 | 4072 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_tangible_wearables_armor_ithorian_sentinel_ith_armor_s03_leggings = object_tangible_wearables_armor_ithorian_sentinel_shared_ith_armor_s03_leggings:new {
templateType = ARMOROBJECT,
playerRaces = { "object/creature/player/ithorian_male.iff",
"object/creature/player/ithorian_female.iff",
"object/mobile/vendor/ithorian_female.iff",
"object/mobile/vendor/ithorian_male.iff" },
-- Damage types in WeaponObject
vulnerability = STUN + LIGHTSABER,
specialResists = ELECTRICITY,
-- These are default Blue Frog stats
healthEncumbrance = 130,
actionEncumbrance = 230,
mindEncumbrance = 85,
maxCondition = 30000,
-- LIGHT, MEDIUM, HEAVY
rating = LIGHT,
kinetic = 50,
energy = 50,
electricity = 75,
stun = 15,
blast = 50,
heat = 50,
cold = 50,
acid = 50,
lightSaber = 0,
numberExperimentalProperties = {1, 1, 1, 2, 2, 2, 2, 2, 2, 1, 1, 2, 1},
experimentalProperties = {"XX", "XX", "XX", "OQ", "SR", "OQ", "SR", "OQ", "UT", "MA", "OQ", "MA", "OQ", "MA", "OQ", "XX", "XX", "OQ", "SR", "XX"},
experimentalWeights = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
experimentalGroupTitles = {"null", "null", "null", "exp_durability", "exp_quality", "exp_resistance", "exp_durability", "exp_durability", "exp_durability", "null", "null", "exp_resistance", "null"},
experimentalSubGroupTitles = {"null", "null", "sockets", "hit_points", "armor_effectiveness", "armor_integrity", "armor_health_encumbrance", "armor_action_encumbrance", "armor_mind_encumbrance", "armor_rating", "armor_special_type", "armor_special_effectiveness", "armor_special_integrity"},
experimentalMin = {0, 0, 0, 1000, 1, 30000, 75, 175, 25, 1, 0, 0, 0},
experimentalMax = {0, 0, 0, 1000, 40, 50000, 45, 105, 15, 1, 0, 0, 0},
experimentalPrecision = {0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0},
experimentalCombineType = {0, 0, 4, 1, 1, 1, 1, 1, 1, 4, 4, 4, 1},
}
ObjectTemplates:addTemplate(object_tangible_wearables_armor_ithorian_sentinel_ith_armor_s03_leggings, "object/tangible/wearables/armor/ithorian_sentinel/ith_armor_s03_leggings.iff")
| lgpl-3.0 |
eraffxi/darkstar | scripts/globals/items/bowl_of_salt_ramen.lua | 2 | 1640 | -----------------------------------------
-- ID: 6462
-- Item: bowl_of_salt_ramen
-- Food Effect: 30Min, All Races
-----------------------------------------
-- DEX +5
-- VIT +5
-- AGI +5
-- Accuracy +5% (cap 90)
-- Ranged Accuracy +5% (cap 90)
-- Evasion +5% (cap 90)
-- Resist Slow +10
-----------------------------------------
require("scripts/globals/status");
-----------------------------------------
function onItemCheck(target)
local result = 0;
if (target:hasStatusEffect(dsp.effect.FOOD) == true or target:hasStatusEffect(dsp.effect.FIELD_SUPPORT_FOOD) == true) then
result = 246;
end
return result;
end;
function onItemUse(target)
target:addStatusEffect(dsp.effect.FOOD,0,0,1800,6462);
end;
function onEffectGain(target,effect)
target:addMod(dsp.mod.DEX, 5);
target:addMod(dsp.mod.VIT, 5);
target:addMod(dsp.mod.AGI, 5);
target:addMod(dsp.mod.FOOD_ACCP, 5);
target:addMod(dsp.mod.FOOD_ACC_CAP, 90);
target:addMod(dsp.mod.FOOD_RACCP, 5);
target:addMod(dsp.mod.FOOD_RACC_CAP, 90);
-- target:addMod(dsp.mod.FOOD_EVAP, 5);
-- target:addMod(dsp.mod.FOOD_EVA_CAP, 90);
target:addMod(dsp.mod.SLOWRES, 10);
end;
function onEffectLose(target, effect)
target:delMod(dsp.mod.DEX, 5);
target:delMod(dsp.mod.VIT, 5);
target:delMod(dsp.mod.AGI, 5);
target:delMod(dsp.mod.FOOD_ACCP, 5);
target:delMod(dsp.mod.FOOD_ACC_CAP, 90);
target:delMod(dsp.mod.FOOD_RACCP, 5);
target:delMod(dsp.mod.FOOD_RACC_CAP, 90);
-- target:delMod(dsp.mod.FOOD_EVAP, 5);
-- target:delMod(dsp.mod.FOOD_EVA_CAP, 90);
target:delMod(dsp.mod.SLOWRES, 10);
end;
| gpl-3.0 |
birkett/cuberite | Server/Plugins/APIDump/Classes/Projectiles.lua | 27 | 6665 | return
{
cArrowEntity =
{
Desc = [[
Represents the arrow when it is shot from the bow. A subclass of the {{cProjectileEntity}}.
]],
Functions =
{
CanPickup = { Params = "{{cPlayer|Player}}", Return = "bool", Notes = "Returns true if the specified player can pick the arrow when it's on the ground" },
GetDamageCoeff = { Params = "", Return = "number", Notes = "Returns the damage coefficient stored within the arrow. The damage dealt by this arrow is multiplied by this coeff" },
GetPickupState = { Params = "", Return = "PickupState", Notes = "Returns the pickup state (one of the psXXX constants, above)" },
IsCritical = { Params = "", Return = "bool", Notes = "Returns true if the arrow should deal critical damage. Based on the bow charge when the arrow was shot." },
SetDamageCoeff = { Params = "number", Return = "", Notes = "Sets the damage coefficient. The damage dealt by this arrow is multiplied by this coeff" },
SetIsCritical = { Params = "bool", Return = "", Notes = "Sets the IsCritical flag on the arrow. Critical arrow deal additional damage" },
SetPickupState = { Params = "PickupState", Return = "", Notes = "Sets the pickup state (one of the psXXX constants, above)" },
},
Constants =
{
psInCreative = { Notes = "The arrow can be picked up only by players in creative gamemode" },
psInSurvivalOrCreative = { Notes = "The arrow can be picked up by players in survival or creative gamemode" },
psNoPickup = { Notes = "The arrow cannot be picked up at all" },
},
ConstantGroups =
{
PickupState =
{
Include = "ps.*",
TextBefore = [[
The following constants are used to signalize whether the arrow, once it lands, can be picked by
players:
]],
},
},
Inherits = "cProjectileEntity",
}, -- cArrowEntity
cExpBottleEntity =
{
Desc = [[
Represents a thrown ExpBottle. A subclass of the {{cProjectileEntity}}.
]],
Functions =
{
},
Inherits = "cProjectileEntity",
}, -- cExpBottleEntity
cFireChargeEntity =
{
Desc = [[
Represents a fire charge that has been shot by a Blaze or a {{cDispenserEntity|Dispenser}}. A subclass
of the {{cProjectileEntity}}.
]],
Functions = {},
Inherits = "cProjectileEntity",
}, -- cFireChargeEntity
cFireworkEntity =
{
Desc = [[
Represents a firework rocket.
]],
Functions =
{
GetItem = { Params = "", Return = "{{cItem}}", Notes = "Returns the item that has been used to create the firework rocket. The item's m_FireworkItem member contains all the firework-related data." },
GetTicksToExplosion = { Params = "", Return = "number", Notes = "Returns the number of ticks left until the firework explodes." },
SetItem = { Params = "{{cItem}}", Return = "", Notes = "Sets a new item to be used for the firework." },
SetTicksToExplosion = { Params = "NumTicks", Return = "", Notes = "Sets the number of ticks left until the firework explodes." },
},
Inherits = "cProjectileEntity",
}, -- cFireworkEntity
cFloater =
{
Desc = "",
Functions = {},
Inherits = "cProjectileEntity",
}, -- cFloater
cGhastFireballEntity =
{
Desc = "",
Functions = {},
Inherits = "cProjectileEntity",
}, -- cGhastFireballEntity
cProjectileEntity =
{
Desc = "",
Functions =
{
GetCreator = { Params = "", Return = "{{cEntity}} descendant", Notes = "Returns the entity who created this projectile. May return nil." },
GetMCAClassName = { Params = "", Return = "string", Notes = "Returns the string that identifies the projectile type (class name) in MCA files" },
GetProjectileKind = { Params = "", Return = "ProjectileKind", Notes = "Returns the kind of this projectile (pkXXX constant)" },
IsInGround = { Params = "", Return = "bool", Notes = "Returns true if this projectile has hit the ground." },
},
Constants =
{
pkArrow = { Notes = "The projectile is an {{cArrowEntity|arrow}}" },
pkEgg = { Notes = "The projectile is a {{cThrownEggEntity|thrown egg}}" },
pkEnderPearl = { Notes = "The projectile is a {{cThrownEnderPearlEntity|thrown enderpearl}}" },
pkExpBottle = { Notes = "The projectile is a {{cExpBottleEntity|thrown exp bottle}}" },
pkFireCharge = { Notes = "The projectile is a {{cFireChargeEntity|fire charge}}" },
pkFirework = { Notes = "The projectile is a (flying) {{cFireworkEntity|firework}}" },
pkFishingFloat = { Notes = "The projectile is a {{cFloater|fishing float}}" },
pkGhastFireball = { Notes = "The projectile is a {{cGhastFireballEntity|ghast fireball}}" },
pkSnowball = { Notes = "The projectile is a {{cThrownSnowballEntity|thrown snowball}}" },
pkSplashPotion = { Notes = "The projectile is a {{cSplashPotionEntity|thrown splash potion}}" },
pkWitherSkull = { Notes = "The projectile is a {{cWitherSkullEntity|wither skull}}" },
},
ConstantGroups =
{
ProjectileKind =
{
Include = "pk.*",
TextBefore = "The following constants are used to distinguish between the different projectile kinds:",
},
},
Inherits = "cEntity",
}, -- cProjectileEntity
cSplashPotionEntity =
{
Desc = [[
Represents a thrown splash potion.
]],
Functions =
{
GetEntityEffect = { Params = "", Return = "{{cEntityEffect}}", Notes = "Returns the entity effect in this potion" },
GetEntityEffectType = { Params = "", Return = "{{cEntityEffect|Entity effect type}}", Notes = "Returns the effect type of this potion" },
GetPotionColor = { Params = "", Return = "number", Notes = "Returns the color index of the particles emitted by this potion" },
SetEntityEffect = { Params = "{{cEntityEffect}}", Return = "", Notes = "Sets the entity effect for this potion" },
SetEntityEffectType = { Params = "{{cEntityEffect|Entity effect type}}", Return = "", Notes = "Sets the effect type of this potion" },
SetPotionColor = { Params = "number", Return = "", Notes = "Sets the color index of the particles for this potion" },
},
Inherits = "cProjectileEntity",
}, -- cSplashPotionEntity
cThrownEggEntity =
{
Desc = [[
Represents a thrown egg.
]],
Functions = {},
Inherits = "cProjectileEntity",
}, -- cThrownEggEntity
cThrownEnderPearlEntity =
{
Desc = "Represents a thrown ender pearl.",
Functions = {},
Inherits = "cProjectileEntity",
}, -- cThrownEnderPearlEntity
cThrownSnowballEntity =
{
Desc = "Represents a thrown snowball.",
Functions = {},
Inherits = "cProjectileEntity",
}, -- cThrownSnowballEntity
cWitherSkullEntity =
{
Desc = "Represents a wither skull being shot.",
Functions = {},
Inherits = "cProjectileEntity",
}, -- cWitherSkullEntity
}
| apache-2.0 |
kidaa/Awakening-Core3 | bin/scripts/object/tangible/loot/tool/recording_rod_broken.lua | 3 | 2244 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_tangible_loot_tool_recording_rod_broken = object_tangible_loot_tool_shared_recording_rod_broken:new {
}
ObjectTemplates:addTemplate(object_tangible_loot_tool_recording_rod_broken, "object/tangible/loot/tool/recording_rod_broken.iff")
| lgpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/commands/unarmedHit2.lua | 1 | 2376 | --Copyright (C) 2007 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
--which carries forward this exception.
--true = 1, false = 0
UnarmedHit2Command = {
name = "unarmedhit2",
damageMultiplier = 3.0,
speedMultiplier = 2.5,
healthCostMultiplier = 1.5,
actionCostMultiplier = 1.5,
mindCostMultiplier = 1.5,
accuracyBonus = 15,
animationCRC = hashCode("combo_3a_light"),
combatSpam = "goraxsmash",
range = -1
}
AddCommand(UnarmedHit2Command)
| lgpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/object/tangible/lair/vynock/lair_vynock_dune.lua | 2 | 2288 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_tangible_lair_vynock_lair_vynock_dune = object_tangible_lair_vynock_shared_lair_vynock_dune:new {
objectMenuComponent = {"cpp", "LairMenuComponent"},
}
ObjectTemplates:addTemplate(object_tangible_lair_vynock_lair_vynock_dune, "object/tangible/lair/vynock/lair_vynock_dune.iff")
| lgpl-3.0 |
eraffxi/darkstar | scripts/zones/Talacca_Cove/Zone.lua | 2 | 1433 | -----------------------------------
--
-- Zone: Talacca_Cove (57)
--
-----------------------------------
package.loaded["scripts/zones/Talacca_Cove/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/keyitems");
require("scripts/globals/missions");
require("scripts/globals/settings");
require("scripts/globals/titles");
require("scripts/zones/Talacca_Cove/TextIDs");
-----------------------------------
function onInitialize(zone)
end;
function onZoneIn(player,prevZone)
local cs = -1;
if (player:getCurrentMission(TOAU) == TESTING_THE_WATERS and player:getVar("AhtUrganStatus") == 1) then
player:setPos(-88.879,-7.318,-109.233,173);
cs = 106;
elseif (player:getXPos() == 0 and player:getYPos() == 0 and player:getZPos() == 0) then
player:setPos(64.007,-9.281,-99.988,88);
end
return cs;
end;
function onRegionEnter(player,region)
end;
function onEventUpdate(player,csid,option)
end;
function onEventFinish(player,csid,option)
if (csid == 106) then
player:completeMission(TOAU,TESTING_THE_WATERS);
player:delKeyItem(dsp.ki.EPHRAMADIAN_GOLD_COIN);
player:addKeyItem(dsp.ki.PERCIPIENT_EYE);
player:messageSpecial(KEYITEM_OBTAINED,dsp.ki.PERCIPIENT_EYE);
player:setTitle(dsp.title.TREASURE_TROVE_TENDER);
player:setVar("AhtUrganStatus", 0);
player:addMission(TOAU,LEGACY_OF_THE_LOST);
end
end;
| gpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/object/tangible/food/crafted/drink_durindfire.lua | 3 | 3328 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_tangible_food_crafted_drink_durindfire = object_tangible_food_crafted_shared_drink_durindfire:new {
templateType = CONSUMABLE,
duration = 10,
filling = 10,
nutrition = 10,
effectType = 4,
fillingMin = 17,
fillingMax = 10,
flavorMin = 720,
flavorMax = 1440,
nutritionMin = 7.5,
nutritionMax = 12,
quantityMin = 6,
quantityMax = 10,
modifiers = { "stun_defense", 0 },
buffName = "food.drink_durindfire",
buffCRC = 0,
speciesRestriction = "",
numberExperimentalProperties = {1, 1, 1, 1, 2, 2, 2, 2, 1},
experimentalProperties = {"XX", "XX", "XX", "XX", "OQ", "PE", "DR", "FL", "DR", "PE", "DR", "OQ", "XX"},
experimentalWeights = {1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 3, 1, 1},
experimentalGroupTitles = {"null", "null", "null", "null", "exp_nutrition", "exp_flavor", "exp_quantity", "exp_filling", "null"},
experimentalSubGroupTitles = {"null", "null", "hitpoints", "quantity_bonus", "nutrition", "flavor", "quantity", "filling", "stomach"},
experimentalMin = {0, 0, 1000, 0, 75, 60, 60, 80, 1},
experimentalMax = {0, 0, 1000, 0, 120, 120, 100, 120, 1},
experimentalPrecision = {0, 0, 0, 0, 10, 10, 10, 10, 0},
experimentalCombineType = {0, 0, 4, 1, 1, 1, 1, 1, 1},
}
ObjectTemplates:addTemplate(object_tangible_food_crafted_drink_durindfire, "object/tangible/food/crafted/drink_durindfire.iff")
| lgpl-3.0 |
Richard857/BadRotations | Rotations/Death Knight/Unholy/THUnholy.lua | 1 | 55947 | local rotationName = "THUnholy" -- Change to name of profile listed in options drop down
---------------
--- Toggles ---
---------------
local function createToggles() -- Define custom toggles
-- Rotation Button
RotationModes = {
[1] = { mode = "Auto", value = 1 , overlay = "Automatic Rotation", tip = "基于范围内的目标数,在单目标和多目标自动切换输出方式.", highlight = 0, icon = br.player.spell.deathAndDecay },
[2] = { mode = "Mult", value = 2 , overlay = "Multiple Target Rotation", tip = "使用多目标方式输出.", highlight = 0, icon = br.player.spell.deathAndDecay },
[3] = { mode = "Sing", value = 3 , overlay = "Single Target Rotation", tip = "使用单目标方式输出.", highlight = 0, icon = br.player.spell.furiousSlash },
[4] = { mode = "Off", value = 4 , overlay = "DPS Rotation Disabled", tip = "禁用DPS输出", highlight = 0, icon = br.player.spell.enragedRegeneration}
};
CreateButton("Rotation",1,0)
-- Cooldown Button
CooldownModes = {
[1] = { mode = "Auto", value = 1 , overlay = "Cooldowns Automated", tip = "自动使用大技能 - 只在BOSS.", highlight = 1, icon = br.player.spell.summonGargoyle },
[2] = { mode = "On", value = 2 , overlay = "Cooldowns Enabled", tip = "不管任何目标都使用大技能.", highlight = 0, icon = br.player.spell.darkArbiter },
[3] = { mode = "Off", value = 3 , overlay = "Cooldowns Disabled", tip = "不使用大技能.", highlight = 0, icon = br.player.spell.battleCry }
};
CreateButton("Cooldown",2,0)
-- Defensive Button
DefensiveModes = {
[1] = { mode = "On", value = 1 , overlay = "Defensive Enabled", tip = "使用保命技能.", highlight = 1, icon = br.player.spell.corpseShield },
[2] = { mode = "Off", value = 2 , overlay = "Defensive Disabled", tip = "不使用保命技能.", highlight = 0, icon = br.player.spell.enragedRegeneration }
};
CreateButton("Defensive",3,0)
-- Interrupt Button
InterruptModes = {
[1] = { mode = "On", value = 1 , overlay = "Interrupts Enabled", tip = "使用打断.", highlight = 1, icon = br.player.spell.mindFreeze },
[2] = { mode = "Off", value = 2 , overlay = "Interrupts Disabled", tip = "不使用打断.", highlight = 0, icon = br.player.spell.pummel }
};
CreateButton("Interrupt",4,0)
end
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
--- local Functions
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Toogle Section
local function uncheck(Value)
if br.data~=nil then
print(Value)
br.data.settings[br.selectedSpec][br.selectedProfile][Value.. "Check"] = false
end
end
-- ObjectCheck
local function GetObjExists(objectID)
for i = 1, ObjectCount() do
local thisUnit = GetObjectWithIndex(i)
if GetObjectExists(thisUnit) and GetObjectID(thisUnit) == objectID then
return true
end
end
return false
end
---------------
--- OPTIONS ---
---------------
local function createOptions()
local optionTable
local function rotationOptions()
-----------------------
--- GENERAL OPTIONS --- -- Define General Options
-----------------------
section = br.ui:createSection(br.ui.window.profile, "一般")
-- Dummy DPS Test
br.ui:createSpinner(section, "DPS测试", 5, 5, 60, 5, "|cffFFFFFF设置为所需的测试的时间(分钟). 最小: 5 / 最大: 60 / 间隔: 5")
-- Remove Spells from queue with CD
br.ui:createSpinner(section, "法术队列清除", 5, 0, 100, 5, "|cffFFBB00如果cd更大,删除法术.")
--Autotarget
br.ui:createCheckbox(section,"自动目标","没有/友好目标在8码内切换到敌人")
-- Debug
br.ui:createCheckbox(section,"调试信息")
br.ui:checkSectionState(section)
------------------------
--- COOLDOWN OPTIONS --- -- Define Cooldown Options
------------------------
section = br.ui:createSection(br.ui.window.profile, "冷却技能")
-- Racial
br.ui:createCheckbox(section,"种族技能")
-- Potion of prolongued Power
br.ui:createCheckbox(section,"药水")
-- Dark Transformation
br.ui:createDropdownWithout(section, "黑暗突变", {"|cff00FF00Units or Boss","|cffFFFF00Cooldowns","|cffFF0000Never"}, 1, "|cffFFFFFFWhen to use Dark Transformation ability.")
br.ui:createSpinnerWithout(section, "黑暗突变目标数量", 1, 1, 10, 1, "|cffFFFFFFSet to desired targets to use Dark Transformation on. Min: 1 / Max: 10 / Interval: 1")
--Death and Decay
br.ui:createSpinnerWithout(section, "枯萎凋零", 1, 1, 10, 1, "|cffFFFFFFSet to desired targets to use Death and Decay on. Min: 1 / Max: 10 / Interval: 1")
br.ui:createSpinnerWithout(section, "DnD Festering Wounds", 1, 0, 8, 1, "|cffFFFFFFSet to Number of Wounds must exists before DnD. Min: 0 / Max: 8")
--Asphyxiate
--br.ui:createCheckbox(section,"Asphyxiate")
--Summon Gargoyle
br.ui:createCheckbox(section,"召唤石像鬼")
br.ui:checkSectionState(section)
------------------------
--- Pet OPTIONS --- --
------------------------
section = br.ui:createSection(br.ui.window.profile, "宠物")
-- Auto Summon
br.ui:createCheckbox(section,"自动召唤")
--Auto Attack
br.ui:createCheckbox(section,"自动攻击")
br.ui:checkSectionState(section)
-------------------------
--- DEFENSIVE OPTIONS --- -- Define Defensive Options
-------------------------
section = br.ui:createSection(br.ui.window.profile, "保命")
-- Healthstone
br.ui:createSpinner(section, "治疗石", 61, 0, 100, 5, "|cffFFBB00多少百分比血量使用.")
-- Anti-Magic Shell
br.ui:createSpinner(section, "反魔法护罩", 75, 0, 100, 5, "|cffFFFFFF多少百分比血量使用")
-- Death Strike
br.ui:createSpinner(section, "灵界打击", 70, 0, 100, 5, "|cffFFFFFF多少百分比血量使用")
-- Icebound Fortitude
br.ui:createSpinner(section, "冰封之韧", 35, 0, 100, 5, "|cffFFFFFF多少百分比血量使用")
-- Corpse Shield
br.ui:createSpinner(section, "血肉之盾", 59, 0, 100, 5, "|cffFFFFFF多少百分比血量使用")
-- Raise Ally
br.ui:createCheckbox(section,"复活盟友")
br.ui:createDropdownWithout(section, "复活盟友 - 目标", {"|cff00FF00目标","|cffFF0000鼠标位置"}, 1, "|cffFFFFFF施放目标")
br.ui:checkSectionState(section)
-------------------------
--- INTERRUPT OPTIONS --- -- Define Interrupt Options
-------------------------
section = br.ui:createSection(br.ui.window.profile, "打断")
-- Leap
br.ui:createCheckbox(section,"跳跃")
-- Mind Freeze
br.ui:createCheckbox(section,"心灵冰冻")
-- Asphyxiate Kick
br.ui:createCheckbox(section,"窒息")
-- DeathGrip
br.ui:createCheckbox(section,"死亡之握")
-- Interrupt Percentage
br.ui:createSpinner(section, "打断", 17, 0, 85, 5, "|cffFFBB00读条百分几打断.")
br.ui:checkSectionState(section)
---------------------
--- PVP Option ---
---------------------
section = br.ui:createSection(br.ui.window.profile, "PVP选项")
-- Necrotic Strike
br.ui:createCheckbox(section,"死疽打击")
-- Chains of Ice
br.ui:createCheckbox(section,"寒冰锁链")
-- Chians of Ice Focus
br.ui:createCheckbox(section,"寒冰锁链 焦点", "Chains focus target")
-- AMS Counter
br.ui:createCheckbox(section,"AMS Counter")
-- Necro Spam
br.ui:createSpinner(section, "Necro Spam", 45, 0, 100, 5, "|cffFFBB00Prefer Necro at X percent dampening.")
--Eye of Leotheras
br.ui:createCheckbox(section, "莱欧瑟拉斯之眼", "Pause CR on Eye of Leotheras Debuff")
br.ui:checkSectionState(section)
----------------------
--- TOGGLE OPTIONS --- -- Degine Toggle Options
----------------------
section = br.ui:createSection(br.ui.window.profile, "快捷键")
-- Single/Multi Toggle
br.ui:createDropdown(section, "Rotation Mode", br.dropOptions.Toggle, 4)
--Cooldown Key Toggle
br.ui:createDropdown(section, "Cooldown Mode", br.dropOptions.Toggle, 3)
--Defensive Key Toggle
br.ui:createDropdown(section, "Defensive Mode", br.dropOptions.Toggle, 6)
-- Interrupts Key Toggle
br.ui:createDropdown(section, "Interrupt Mode", br.dropOptions.Toggle, 6)
-- Pause Toggle
br.ui:createDropdown(section, "暂停模式", br.dropOptions.Toggle, 6)
br.ui:checkSectionState(section)
end
optionTable = {{
[1] = "脚本选项",
[2] = rotationOptions,
}}
return optionTable
end
----------------
--- ROTATION ---
----------------
local function runRotation()
if br.timer:useTimer("debugUnholy", 0.1) then --change "debugFury" to "debugSpec" (IE: debugFire)
--Print("Running: "..rotationName)
---------------
--- Toggles --- -- List toggles here in order to update when pressed
---------------
UpdateToggle("Rotation",0.25)
UpdateToggle("Cooldown",0.25)
UpdateToggle("Defensive",0.25)
UpdateToggle("Interrupt",0.25)
--------------
--- Locals ---
--------------
local lastSpell = lastCast
local bop = UnitBuff("target","Blessing of Protection") ~= nil
local cloak = UnitBuff("target","Cloak of Shadows") ~= nil or UnitBuff("target","Anti-Magic Shell") ~= nil
local immunDS = UnitBuff("target","Divine Shield") ~= nil
local immunIB = UnitBuff("target","Ice Block") ~= nil
local immunAotT = UnitBuff("target","Aspect of the Turtle") ~= nil
local immunCyclone = UnitBuff("target","Cyclone") ~= nil
local immun = immun or immunIB or immunAotT or immunDS or immunCyclone
local attacktar = UnitCanAttack("target", "player")
local buff = br.player.buff
local cast = br.player.cast
local cd = br.player.cd
local charges = br.player.charges
local deadtar = UnitIsDeadOrGhost("target") or isDummy()
local playertar = UnitIsPlayer("target")
local debuff = br.player.debuff
local enemies = enemies or {}
local petMinion = false
local petRisen = false
local gcd = br.player.gcd
local glyph = br.player.glyph
local inCombat = br.player.inCombat
local level = br.player.level
local mode = br.player.mode
local moving = GetUnitSpeed("player")>0
local normalMob = not(useCDs() or playertar)
local php = br.player.health
local power = br.player.power
local pullTimer = br.DBM:getPulltimer()
local racial = br.player.getRacial()
local runicPower = br.player.power.amount.runicPower
local runicPowerDeficit = br.player.power.runicPower.deficit
local runes = br.player.power.runes.frac
local swimming = IsSwimming()
local talent = br.player.talent
local t19_2pc = TierScan("T19") >= 2
local t19_4pc = TierScan("T19") >= 4
local ttd = getTTD
local units = units or {}
units.dyn5 = br.player.units(5)
units.dyn8 = br.player.units(8)
units.dyn30 = br.player.units(30)
enemies.yards8 = br.player.enemies(8)
enemies.yards10 = br.player.enemies(10)
enemies.yards10t = br.player.enemies(10,br.player.units(10,true))
enemies.yards15 = br.player.enemies(15)
enemies.yards30 = br.player.enemies(30)
enemies.yards40 = br.player.enemies(40)
if lastSpell == nil or not inCombat then lastSpell = 0 end
if profileStop == nil then profileStop = false end
if waitfornextVirPlague == nil or objIDLastVirPlagueTarget == nil then
waitfornextVirPlague = GetTime() - 10
objIDLastVirPlagueTarget = 0
end
if waitForPetToAppear == nil then waitForPetToAppear = 0 end
if waitforNextKick == nil then waitforNextKick = 0 end
if waitfornextPrint == nil or printevery2S == nil then
waitfornextPrint = GetTime()
printevery2S = true
elseif waitfornextPrint <= GetTime() -2 then
printevery2S = true
waitfornextPrint = GetTime()
else
printevery2S = false
end
if waitforNextIoC == nil then waitforNextIoC = 0 end
if waitforNextIoCFocus == nil then waitforNextIoCFocus = 0 end
-------------------
--- Raise Pet ---
-------------------
if not inCombat and not IsMounted() and isChecked("自动召唤") and not GetUnitExists("pet") and (UnitIsDead("pet") ~= nil or UnitIsDead("pet") == false) then
if waitForPetToAppear ~= nil and waitForPetToAppear < GetTime() - 2 and onlyOneTry ~= nil and not onlyOneTry then
onlyOneTry = true
if cast.raiseDead() then return end
end
if waitForPetToAppear == nil then
waitForPetToAppear = GetTime()
end
else
onlyOneTry = false
end
--------------------
--- Action Lists ---
--------------------
---------------------------------------------------------------------------------------------------------------------------------
-- Action List - Cooldowns
---------------------------------------------------------------------------------------------------------------------------------
local function actionList_Cooldowns()
if isChecked("调试信息") then Print("actionList_Cooldowns") end
--Racial
if isChecked("种族技能") and (((br.player.race == "Troll" or br.player.race == "Orc"))
or (br.player.race == "BloodElf" and runicPowerDeficit > 20)) and getSpellCD(racial) == 0
and (not talent.soulReaper or (not debuff.soulReaper.exists("target") or buff.soulReaper.stack("player") == 3))
and getDistance("target") < 5
then
if castSpell("player",racial,false,false,false) then return end
end
--Dark Transformation
if (
( getOptionValue("黑暗突变") == 1 --Units or Boss
and #enemies.yards10 >= getOptionValue("黑暗突变目标数量")
or useCDs()
or playertar
)
or
( getOptionValue("黑暗突变") == 2 --Cooldown only
and (
useCDs() or playertar
)
)
)
and not immun
and not bop
and (((hasEquiped(137075) and not (cd.apocalypse < 10)) or playertar) or not hasEquiped(137075))
and getDistance("target") < 5
and (not talent.darkArbiter or (talent.darkArbiter and cd.summonGargoyle > 60))
and (not talent.soulReaper or (not debuff.soulReaper.exists("target") or buff.soulReaper.stack("player") == 3))
and not (buff.soulReaper.stack("player") == 3 and cd.summonGargoyle <= 0)
then
if cast.darkTransformation() then return end
end
--Death and Decay
if #enemies.yards10 >= getOptionValue("枯萎凋零") and debuff.festeringWound.stack("target") >= getOptionValue("DnD Festering Wounds") and not isMoving("player") then
if cast.deathAndDecay("player") then return end
end
--Potion
if useCDs() and isChecked("药水") and getDistance("target") < 15 and not isDummy() and not playertar then
--Old War
if hasItem(127844) and canUse(127844) then
useItem(127844)
end
--Prolongued Power
if hasItem(142117) and canUse(142117) then
useItem(142117)
end
end
--Blighted Runeweapon
if talent.blightedRuneWeapon
and (not talent.soulReaper or (not debuff.soulReaper.exists("target") or buff.soulReaper.stack("player") == 3))
and getDistance("target") < 5
and not immun
and not bop
then
if cast.blightedRuneWeapon() then return end
end
--Summon Gargoyle
if isChecked("召唤石像鬼")
and (useCDs() or playertar)
and (not talent.soulReaper or buff.soulReaper.stack("player") == 3 or (not debuff.soulReaper.exists("target") and cd.soulReaper > 30))
and cd.summonGargoyle <= 0
and (not talent.darkArbiter or runicPowerDeficit <= 10)
then
if cast.summonGargoyle() then return end
end
end
---------------------------------------------------------------------------------------------------------------------------------
-- Action List - Defensive
---------------------------------------------------------------------------------------------------------------------------------
local function actionList_Defensive()
if isChecked("调试信息") then Print("actionList_Defensive") end
if useDefensive() and not IsMounted() and inCombat then
--- AMS Counter
if isChecked("AMS Counter")
and UnitDebuff("player","Soul Reaper") ~= nil
then
if cast.antiMagicShell() then print("AMS Counter - Soul Reaper") return end
end
--Healthstone
if isChecked("治疗石")
and php <= getOptionValue("治疗石")
and hasItem(5512)
then
if canUse(5512) then
useItem(5512)
end
end
-- Death Strike
if isChecked("灵界打击")
and (buff.darkSuccor.exists() and (php < getOptionValue("灵界打击") or buff.darkSuccor.remain() < 2))
or runicPower >= 45
and php < getOptionValue("灵界打击")
and (not talent.darkArbiter or (cd.darkArbiter <= 3 and not (useCDs() or playertar)))
then
-- Death strike everything in reach
if getDistance("target") > 5 or immun or bop then
for i=1, #getEnemies("player",20) do
thisUnit = getEnemies("player",20)[i]
distance = getDistance(thisUnit)
if distance < 5 and getFacing("player",thisUnit) then
if cast.deathStrike(thisUnit) then print("Random Hit Deathstrike") return end
end
end
else
if cast.deathStrike("target") then return end
end
end
-- Icebound Fortitude
if isChecked("冰封之韧")
and php < getOptionValue("冰封之韧")
then
if cast.iceboundFortitude() then return end
end
-- Corpse Shield
if isChecked("血肉之盾")
and php < getOptionValue("血肉之盾")
then
if cast.corpseShield() then return end
end
-- Anti-Magic Shell
if isChecked("反魔法护罩") and php <= getOptionValue("反魔法护罩") then
if cast.antiMagicShell() then return end
end
-- Raise Ally
if isChecked("复活盟友") then
if getOptionValue("复活盟友 - 目标")==1
and UnitIsPlayer("target") and UnitIsDeadOrGhost("target") and UnitIsFriend("target","player")
then
if cast.raiseAlly("target","dead") then return end
end
if getOptionValue("复活盟友 - 目标")==2
and UnitIsPlayer("mouseover") and UnitIsDeadOrGhost("mouseover") and UnitIsFriend("mouseover","player")
then
if cast.raiseAlly("mouseover","dead") then return end
end
end
end
end
---------------------------------------------------------------------------------------------------------------------------------
-- Action List - DebuffReader
---------------------------------------------------------------------------------------------------------------------------------
local function actionList_DebuffReader()
if startDampeningTimer == nil then startDampeningTimer = false end
if printDampeningTimer == nil then printDampeningTimer = true end
if debuff.dampening.exists("player") and not startDampeningTimer then
startDampeningTimer = true
printDampeningTimer = true
dampeningStartTime = GetTime()
elseif not debuff.dampening.exists("player") then
startDampeningTimer = false
end
if startDampeningTimer then
dampeningCount = math.floor((GetTime() - dampeningStartTime) / 10) + 1
else
dampeningCount = 0
end
if isChecked("Necro Spam") and dampeningCount >= getOptionValue("Necro Spam") and printDampeningTimer then
Print("Dampening level reached -> Necro Spam active")
printDampeningTimer = false
end
end
---------------------------------------------------------------------------------------------------------------------------------
-- Action List - Extras
---------------------------------------------------------------------------------------------------------------------------------
local function actionList_Extras()
if isChecked("调试信息") then Print("actionList_Extras") end
-- Dummy Test
if isChecked("DPS测试") then
if GetObjectExists("target") then
if getCombatTime() >= (tonumber(getValue("DPS测试"))*60) and isDummy() then
profileStop = true
StopAttack()
ClearTarget()
PetStopAttack()
PetPassiveMode()
Print(tonumber(getValue("DPS测试")) .." Minute Dummy Test Concluded - Profile Stopped")
return true
end
end
end
-- Chains of Ice
if isChecked("寒冰锁链") then
if waitforNextIoC < GetTime() -1.5 then
if playertar
and (not debuff.chainsOfIce.exists("target"))
and (not talent.soulReaper or not debuff.soulReaper.exists("target") or (buff.soulReaper.stack("player") == 3) or getDistance("target") > 5)
and not (UnitBuff("target","Blessing of Freedom") ~= nil)
and not immun
and not cloak
and isMoving("target")
and getDistance("target") <= 30
and inCombat
then
if cast.chainsOfIce("target","aoe") then waitforNextIoC = GetTime() return end
end
end
end
--Chains of Ice focus
if isChecked("寒冰锁链 焦点") then
if waitforNextIoCFocus < GetTime() -1.5 then
if GetUnitExists("focus")
and (not debuff.chainsOfIce.exists("focus"))
and (not talent.soulReaper or not debuff.soulReaper.exists("target") or (buff.soulReaper.stack("player") == 3))
and not (UnitBuff("focus","Blessing of Freedom") ~= nil)
and not immun
and not cloak
and isMoving("focus")
and getDistance("focus") <= 30
then
if cast.chainsOfIce("focus","aoe") then waitforNextIoCFocus = GetTime() return end
end
end
end
--Virulent Plague
if GetUnitExists("target") and ((objIDLastVirPlagueTarget ~= ObjectID("target")) or (waitfornextVirPlague < GetTime() - 6)) then
if (not debuff.virulentPlague.exists("target")
or debuff.virulentPlague.remain("target") < 1.5)
and not debuff.soulReaper.exists("target")
and not immun
and not cloak
and UnitIsDeadOrGhost("target") ~= nil
then
if cast.outbreak("target","aoe") then
waitfornextVirPlague = GetTime()
objIDLastVirPlagueTarget = ObjectID("target")
return
end
end
for i = 1, #enemies.yards30 do
local thisUnit = enemies.yards30[i]
if not debuff.virulentPlague.exists(thisUnit)
and UnitAffectingCombat(thisUnit)
and not cloak
and not immun
then
if cast.outbreak(thisUnit,"aoe") then
waitfornextVirPlague = GetTime()
return
end
break
end
end
end
end
---------------------------------------------------------------------------------------------------------------------------------
-- Action List - Interrupts
---------------------------------------------------------------------------------------------------------------------------------
local function actionList_Interrupts()
if isChecked("调试信息") then Print("actionList_Interrupts") end
if useInterrupts() then
if waitforNextKick < GetTime() -2 then
if cd.mindFreeze <= 0
or cd.deathGrip <= 0
or cd.asphyxiate <= 0
or (not talent.sludgeBelcher and cd.leap <= 0)
or (talent.sludgeBelcher and cd.hook <= 0)
then
if kickpercent == nil or kickCommited == nil or kickCommited then
kickCommited = false
kickpercent = getOptionValue("打断") + math.random(-5,5)
print("new Kickpercent : ", kickpercent)
end
for i=1, #enemies.yards30 do
thisUnit = enemies.yards30[i]
if inCombat
and (UnitIsPlayer(thisUnit) or not playertar)
and isValidUnit(thisUnit)
and not isDummy(thisUnit)
and canInterrupt(thisUnit,kickpercent)
and not immunDS
and not immunAotT
then
-- Leap Dark Transormation
if getDistance(thisUnit) > 5
and getDistance(thisUnit) < 30
then
if talent.sludgeBelcher then
if cast.hook(thisUnit) then waitforNextKick = GetTime(); print("Hook Kick"); kickCommited = true; return end
elseif buff.darkTransformation.exists("pet")
then
if cast.leap(thisUnit) then waitforNextKick = GetTime(); print("Leap Kick"); kickCommited = true; return end
end
end
-- Mind Freeze
if isChecked("心灵冰冻")
-- and cd.mindFreeze == 0
and getDistance(thisUnit) < 15
and getFacing("player",thisUnit)
then
if cast.mindFreeze(thisUnit) then waitforNextKick = GetTime(); print("Mind Freeze"); kickCommited = true; return end
end
--Asphyxiate
if isChecked("窒息")
and talent.asphyxiate
and getDistance(thisUnit) < 20
and getFacing("player",thisUnit)
then
if cast.asphyxiate(thisUnit) then waitforNextKick = GetTime(); print("Asphyxiate Kick"); kickCommited = true; return end
end
-- DeathGrip
if isChecked("死亡之握")
and getDistance("target") < 5
and getFacing("player",thisUnit)
then
if cast.deathGrip(thisUnit) then waitforNextKick = GetTime(); print ("Grip Kick"); kickCommited = true; return end
end
end
end --endfor
end --Kick auf CD
end --Timer
end -- End Use Interrupts Check
end -- End Action List - Interrupts
---------------------------------------------------------------------------------------------------------------------------------
-- Action List - Pet Management
---------------------------------------------------------------------------------------------------------------------------------
local function actionList_PetManagement()
if isChecked("调试信息") then Print("actionList_PetManagement") end
if not IsMounted() then
--Corpse Shield
if buff.corpseShield.exists() then
if talent.sludgeBelcher then
if cast.protectiveBile() then return end
else
if cast.huddle() then return end
end
end
--PetDismiss
if getHP("pet") < 20
and GetUnitExists("pet")
and not buff.corpseShield.exists()
then
print("Pet Dismiss - Low Health")
PetDismiss()
end
--Auto Summon
if isChecked("自动召唤") and not GetUnitExists("pet") and (UnitIsDead("pet") ~= nil or UnitIsDead("pet") == false) then
if waitForPetToAppear < GetTime() - 2 then
if cast.raiseDead() then waitForPetToAppear = GetTime(); return end
end
end
-- Pet Attack / retreat
if isChecked("自动攻击") then
if inCombat and isValidUnit(units.dyn30) and getDistance(units.dyn30) < 30 then
if not UnitIsUnit("target","pettarget") and attacktar and not IsPetAttackActive() then
PetAttack()
PetAssistMode()
end
else
if IsPetAttackActive() then
PetStopAttack()
PetPassiveMode()
end
end
end
end
end
---------------------------------------------------------------------------------------------------------------------------------
-- Action List - Soul Reaper Debuff
---------------------------------------------------------------------------------------------------------------------------------
local function actionList_SoulReaperDebuff()
--Apocalypse
if cd.apocalypse <= 0
and debuff.festeringWound.stack("target") >= 7
and not immun
and not bop
then
if cast.apocalypse("target") then return end
end
--ScourgeStrike if Soulreaper
if debuff.festeringWound.stack("target") >= 1
and not immun
then
if talent.clawingShadows then
if cast.clawingShadows("target") then return end
else
if cast.scourgeStrike("target") then return end
end
elseif not immun then
if cast.festeringStrike("target") then return end
end
end
---------------------------------------------------------------------------------------------------------------------------------
-- Action List - Soul Reaper
---------------------------------------------------------------------------------------------------------------------------------
local function actionList_SoulReaper()
if isChecked("调试信息") then Print("actionList_SoulReaper") end
if printevery2S then
-- print(runicPowerDeficit, runicPower, runes)
end
--Soul Reaper if artifact == 0 and festeringWound > 6
if debuff.festeringWound.stack("target") >= 7
and cd.apocalypse <= 0
and not immun
and not bop
and not cloak
then
if cast.soulReaper("target") then return end
end
--Apocalypse
if cd.apocalypse <= 0
and cd.soulReaper > 10
and debuff.festeringWound.stack("target") >= 7
and not immun
and not bop
then
if cast.apocalypse("target") then return end
end
--ScourgeStrike spam DnD
if buff.deathAndDecay.exists("player")
and #enemies.yards10 > 2
and runicPowerDeficit > 13
and not immun
and not cloak
then
if playertar and isChecked("Necro Spam") and dampeningCount >= getOptionValue("Necro Spam") then
if cast.necroticStrike("target") then
return
elseif talent.clawingShadows then
if cast.clawingShadows("target") then return end
else
if cast.scourgeStrike("target") then return end
end
elseif talent.clawingShadows then
if cast.clawingShadows("target") then return end
else
if cast.scourgeStrike("target") then return end
end
end
--ScourgeStrike if Scourge of Worlds / Necrosis
if (debuff.scourgeOfWorlds.exists("target") or buff.necrosis.exists("player"))
and debuff.festeringWound.stack("target") > 1
and runicPowerDeficit > 13
and (not (cd.apocalypse == 0) or getDistance("target") > 5 )
and not (cd.soulReaper < 5)
and not immun
and not cloak
then
if playertar and isChecked("Necro Spam") and dampeningCount >= getOptionValue("Necro Spam") then
if cast.necroticStrike("target") then
return
elseif talent.clawingShadows then
if cast.clawingShadows("target") then return end
else
if cast.scourgeStrike("target") then return end
end
elseif talent.clawingShadows then
if cast.clawingShadows("target") then return end
else
if cast.scourgeStrike("target") then return end
end
end
--Death Coil
if (runicPower >= 80
or (buff.suddenDoom.exists() and buff.suddenDoom.remain() < 8))
and (not buff.necrosis.exists("player") or ((not br.player.artifact.doubleDoom or buff.suddenDoom.stack("player") > 1) and buff.suddenDoom.remain() < 2) or runicPowerDeficit <= 20)
and not immun
and not cloak
then
if cast.deathCoil("target") then return end
end
--Festering Strike
if ((debuff.festeringWound.stack("target") < 5)
or (debuff.festeringWound.stack("target") < 8 and cd.apocalypse == 0))
and not immun
and not bop
then
if cast.festeringStrike("target") then return end
end
--Soul Reaper if not artifact== 0
if debuff.festeringWound.stack("target") >= 3
and cd.soulReaper <= 0
and not (cd.apocalypse <= 0)
and runes >= 3.6
and not immun
and not bop
and not cloak
then
if cast.soulReaper("target") then return end
end
--Scourge
if debuff.festeringWound.stack("target") > 3
and (not (cd.soulReaper < 5) or runes > 4)
and runes > 2
and not immun
and not cloak
then
if playertar and isChecked("死疽打击") then
if cast.necroticStrike("target") then
return
elseif talent.clawingShadows then
if cast.clawingShadows("target") then return end
else
if cast.scourgeStrike("target") then return end
end
elseif talent.clawingShadows then
if cast.clawingShadows("target") then return end
else
if cast.scourgeStrike("target") then return end
end
end
--Clawing Shadow is out of range
if talent.clawingShadows
and getDistance("target") > 5
and runes > 2
and not cloak
and not immun
then
if cast.clawingShadows("target") then return end
end
--DeathCoil
if getDistance("target") > 5
and not immun
and not cloak
then
if cast.deathCoil("target") then return end
end
end
---------------------------------------------------------------------------------------------------------------------------------
-- Action List - Dark Arbiter
---------------------------------------------------------------------------------------------------------------------------------
local function actionList_PreDarkArbiter()
--Apocalypse
if cd.apocalypse <= 0
and debuff.festeringWound.stack("target") >= 7
and not immun
and not bop
then
if cast.apocalypse("target") then return end
end
--ScourgeStrike if Scourge of Worlds / Death and Decay
if (debuff.scourgeOfWorlds.exists("target") or buff.deathAndDecay.exists())
and debuff.festeringWound.stack("target") > 1
and runicPower < 90
and (not (cd.apocalypse == 0) or getDistance("target") > 5)
and not immun
and not cloak
then
if playertar and isChecked("Necro Spam") and dampeningCount >= getOptionValue("Necro Spam") then
if cast.necroticStrike("target") then
return
elseif talent.clawingShadows then
if cast.clawingShadows("target") then return end
else
if cast.scourgeStrike("target") then return end
end
elseif talent.clawingShadows then
if cast.clawingShadows("target") then return end
else
if cast.scourgeStrike("target") then return end
end
end
--Death Coil
if normalMob or cd.darkArbiter >= 5 then
if runicPowerDeficit <= 20
or (buff.suddenDoom.exists() and buff.suddenDoom.remain() < 8)
and (not buff.necrosis.exists("player") or buff.suddenDoom.remain() < 2 or runicPowerDeficit < 20)
and not immun
and not cloak
then
if cast.deathCoil("target") then return end
end
end
--Festering Strike
if ((debuff.festeringWound.stack("target") < 5)
or (debuff.festeringWound.stack("target") < 8 and cd.apocalypse == 0))
and not immun
and not bop
then
if cast.festeringStrike("target") then return end
end
--Scourge
if debuff.festeringWound.stack("target") > 3
and runes > 2
and not immun
and not cloak
then
if playertar and isChecked("死疽打击") then
if cast.necroticStrike("target") then
return
elseif talent.clawingShadows then
if cast.clawingShadows("target") then return end
else
if cast.scourgeStrike("target") then return end
end
elseif talent.clawingShadows then
if cast.clawingShadows("target") then return end
else
if cast.scourgeStrike("target") then return end
end
end
--Clawing Shadow is out of range
if talent.clawingShadows
and getDistance("target") > 5
and runes > 2
and not cloak
and not immun
then
if cast.clawingShadows("target") then return end
end
--DeathCoil
if getDistance("target") > 5
and cd.darkArbiter >= 5
and not immun
and not cloak
then
if cast.deathCoil("target") then return end
end
end
---------------------------------------------------------------------------------------------------------------------------------
-- Action List - Dark Arbiter exist
---------------------------------------------------------------------------------------------------------------------------------
local function actionList_DarkArbiter()
--Apocalypse
if cd.apocalypse <= 0
and debuff.festeringWound.stack("target") >= 7
and runicPowerDeficit > 21
and not immun
and not bop
then
if cast.apocalypse("target") then return end
end
--Dark Transformation
if hasEquiped(137075) then
if cast.darkTransformation() then return end
end
--DeathCoil Dump
if not immun and not cloak
then
if cast.deathCoil("target") then return end
end
--Festering Strike
if runes >= 2 and debuff.festeringWound.stack("target") < 5 then
if cast.festeringStrike("target") then return end
end
--Scourge
if playertar and isChecked("Necro Spam") and dampeningCount >= getOptionValue("Necro Spam") then
if cast.necroticStrike("target") then
return
elseif talent.clawingShadows then
if cast.clawingShadows("target") then return end
else
if cast.scourgeStrike("target") then return end
end
elseif talent.clawingShadows then
if cast.clawingShadows("target") then return end
else
if cast.scourgeStrike("target") then return end
end
end
---------------------------------------------------------------------------------------------------------------------------------
-- Action List -Generic
---------------------------------------------------------------------------------------------------------------------------------
local function actionList_Generic()
--ScourgeStrike spam DnD
if buff.deathAndDecay.exists("player")
and #enemies.yards10 > 2
and not immun
and not cloak
then
if playertar and isChecked("Necro Spam") and dampeningCount >= getOptionValue("Necro Spam") then
if cast.necroticStrike("target") then
return
elseif talent.clawingShadows then
if cast.clawingShadows("target") then return end
else
if cast.scourgeStrike("target") then return end
end
elseif talent.clawingShadows then
if cast.clawingShadows("target") then return end
else
if cast.scourgeStrike("target") then return end
end
end
--Death Coil
if (runicPower >= 80
or (buff.suddenDoom.exists() and buff.suddenDoom.remain() < 8))
and ((not buff.necrosis.exists("player") or buff.suddenDoom.remain() < 2) or runicPowerDeficit >= 20)
and not immun
and not cloak
then
if cast.deathCoil("target") then return end
end
--Festering Strike
if ((debuff.festeringWound.stack("target") < 5)
or (debuff.festeringWound.stack("target") < 8 and cd.apocalypse == 0))
and not immun
and not bop
then
if cast.festeringStrike("target") then return end
end
--Scourge
if debuff.festeringWound.stack("target") > 3
and (not (cd.soulReaper < 5) or runes > 4)
and runes > 2
and not immun
and not cloak
then
if playertar and isChecked("死疽打击") then
if cast.necroticStrike("target") then
return
elseif talent.clawingShadows then
if cast.clawingShadows("target") then return end
else
if cast.scourgeStrike("target") then return end
end
elseif talent.clawingShadows then
if cast.clawingShadows("target") then return end
else
if cast.scourgeStrike("target") then return end
end
end
--Clawing Shadow is out of range
if talent.clawingShadows
and getDistance("target") > 5
and runes > 2
and not cloak
and not immun
then
if cast.clawingShadows("target") then return end
end
--DeathCoil
if getDistance("target") > 5
and not immun
and not cloak
then
if cast.deathCoil("target") then return end
end
end
-----------------
--- Rotations ---
-----------------
-- Pause
if pause() or (GetUnitExists("target") and (UnitIsDeadOrGhost("target") or not UnitCanAttack("target", "player"))) or mode.rotation == 4 then
if isChecked("调试信息") then Print("Rotation Pause") end
return true
else
---------------------------------
--- Out Of Combat - Rotations ---
---------------------------------
if not inCombat and GetObjectExists("target") and not UnitIsDeadOrGhost("target") and UnitCanAttack("target", "player") then
if isChecked("调试信息") then Print("OOC") end
startDampeningTimer = false
end -- End Out of Combat Rotation
-----------------------------
--- In Combat - Rotations ---
-----------------------------
if inCombat and not IsMounted() and getBuffRemain("player", 192002 ) < 10 then
if isChecked("调试信息") then Print("inCombat") end
if debuff.dampening ~= nil then
if actionList_DebuffReader() then return end
end
if isChecked("莱欧瑟拉斯之眼") and UnitDebuff("player","莱欧瑟拉斯之眼") ~= nil then
ClearTarget()
Print("Warning : Eye of Leotheras detected")
return
end
if isChecked("自动目标")
and not GetUnitExists("target")
or (not UnitIsEnemy("target", "player") and not UnitIsDeadOrGhost("target"))
then
if #enemies.yards8 > 0 and UnitAffectingCombat(enemies.yards8[1]) then
TargetUnit(enemies.yards8[1])
end
end
---------------------------
--- Queue Casting
---------------------------
if isChecked("Queue Casting") and not UnitChannelInfo("player") then
-- Catch for spells not registering on Combat log
if castQueue() then return end
end
---------------------------
--- SoulReaper ---
---------------------------
if talent.soulReaper and debuff.soulReaper.exists("target") and buff.soulReaper.stack("player") < 3 then
if actionList_SoulReaperDebuff() then return end
else
---------------------------
--- Extras ---
---------------------------
if actionList_Extras() then return end
---------------------------
--- Cooldowns ---
---------------------------
if actionList_Cooldowns() then return end
---------------------------
--- Interrupt ---
---------------------------
if actionList_Interrupts() then return end
---------------------------
--- Pet Logic ---
---------------------------
if actionList_PetManagement() then return end
---------------------------
--- Defensive Rotation ---
---------------------------
if actionList_Defensive() then return end
---------------------------
--- Dark Arbiter Exist ---
---------------------------
if talent.darkArbiter then
if GetObjExists(100876) then
if actionList_DarkArbiter() then return end
else
if actionList_PreDarkArbiter() then return end
end
---------------------------
--- Soul Reaper ---
---------------------------
elseif talent.soulReaper then
if actionList_SoulReaper() then return end
else
if actionList_Generic() then return end
end
---------------------------
--- Queue ---
---------------------------
if #br.player.queue ~= 0 and isChecked("法术队列清除") then
for i = 1, #br.player.queue do
if br.player.queue[i].name == nil then
tremove(br.player.queue,i)
elseif getSpellCD(br.player.queue[i].name) >= getOptionValue("法术队列清除") then
Print("Removed |cFFFF0000"..br.player.queue[i].name.. "|r cause CD")
tremove(br.player.queue,i)
end
end
end
end
if isChecked("调试信息") then uncheck("调试信息") end
end -- End In Combat Rotation
end -- Pause
end -- End Timer
end -- End runRotation
local id = 252 -- Change to the spec id profile is for.
if br.rotations[id] == nil then br.rotations[id] = {} end
tinsert(br.rotations[id],{
name = rotationName,
toggles = createToggles,
options = createOptions,
run = runRotation,
}) | gpl-3.0 |
widelands/widelands | data/tribes/workers/frisians/brewer/init.lua | 1 | 1070 | push_textdomain("tribes")
dirname = path.dirname (__file__)
wl.Descriptions():new_worker_type {
name = "frisians_brewer",
-- TRANSLATORS: This is a worker name used in lists of workers
descname = pgettext ("frisians_worker", "Brewer"),
icon = dirname .. "menu.png",
vision_range = 2,
buildcost = {
frisians_carrier = 1
},
experience = 15,
becomes = "frisians_brewer_master",
ware_hotspot = {0, 20},
spritesheets = {
walk = {
directory = dirname,
basename = "walk",
fps = 15,
frames = 10,
columns = 5,
rows = 2,
directional = true,
hotspot = {10, 23}
},
walkload = {
directory = dirname,
basename = "walkload",
fps = 15,
frames = 10,
columns = 5,
rows = 2,
directional = true,
hotspot = {10, 26}
},
},
animations = {
idle = {
directory = dirname,
basename = "idle",
hotspot = {8, 23}
},
},
}
pop_textdomain()
| gpl-2.0 |
kidaa/Awakening-Core3 | bin/scripts/object/tangible/loot/collectible/collectible_parts/orange_rug_thread_07.lua | 3 | 2344 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_tangible_loot_collectible_collectible_parts_orange_rug_thread_07 = object_tangible_loot_collectible_collectible_parts_shared_orange_rug_thread_07:new {
}
ObjectTemplates:addTemplate(object_tangible_loot_collectible_collectible_parts_orange_rug_thread_07, "object/tangible/loot/collectible/collectible_parts/orange_rug_thread_07.iff")
| lgpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/object/creature/npc/base/ewok_base_male.lua | 3 | 2216 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_creature_npc_base_ewok_base_male = object_creature_npc_base_shared_ewok_base_male:new {
}
ObjectTemplates:addTemplate(object_creature_npc_base_ewok_base_male, "object/creature/npc/base/ewok_base_male.iff")
| lgpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/mobile/corellia/flail_butcher.lua | 1 | 1724 | flail_butcher = Creature:new {
objectName = "@mob/creature_names:flail_butcher",
socialGroup = "flail",
pvpFaction = "flail",
faction = "flail",
level = 22,
chanceHit = 0.350000,
damageMin = 220,
damageMax = 230,
baseXp = 2219,
baseHAM = 6300,
baseHAMmax = 7700,
armor = 0,
resists = {0,0,0,0,0,0,0,-1,-1},
meatType = "",
meatAmount = 0,
hideType = "",
hideAmount = 0,
boneType = "",
boneAmount = 0,
milk = 0,
tamingChance = 0.000000,
ferocity = 0,
pvpBitmask = ATTACKABLE + AGGRESSIVE,
creatureBitmask = PACK + KILLER,
diet = HERBIVORE,
templates = {"object/mobile/dressed_mugger.iff",
"object/mobile/dressed_goon_twk_female_01.iff",
"object/mobile/dressed_goon_twk_male_01.iff",
"object/mobile/dressed_gran_thug_male_01.iff",
"object/mobile/dressed_gran_thug_male_02.iff",
"object/mobile/dressed_ravager_human_female_01.iff",
"object/mobile/dressed_ravager_human_male_01.iff",
"object/mobile/dressed_raider_trandoshan_female_01.iff",
"object/mobile/dressed_raider_trandoshan_male_01.iff",
"object/mobile/dressed_ruffian_zabrak_female_01.iff",
"object/mobile/dressed_ruffian_zabrak_male_01.iff",
"object/mobile/dressed_villain_trandoshan_female_01.iff",
"object/mobile/dressed_villain_trandoshan_male_01.iff"},
lootGroups = {
{
groups = {
{group = "junk", chance = 3500000},
{group = "wearables_common", chance = 3000000},
{group = "rifles", chance = 2000000},
{group = "color_crystals", chance = 1000000},
{group = "flail_common", chance = 500000}
},
lootChance = 3000000
}
},
weapons = {"pirate_weapons_medium"},
attacks = merge(brawlernovice,marksmannovice)
}
CreatureTemplates:addCreatureTemplate(flail_butcher, "flail_butcher")
| lgpl-3.0 |
houqp/koreader | spec/unit/luasettings_spec.lua | 7 | 2854 | describe("luasettings module", function()
local Settings
setup(function()
require("commonrequire")
Settings = require("frontend/luasettings"):open("this-is-not-a-valid-file")
end)
it("should handle undefined keys", function()
Settings:delSetting("abc")
assert.True(Settings:hasNot("abc"))
assert.True(Settings:nilOrTrue("abc"))
assert.False(Settings:isTrue("abc"))
Settings:saveSetting("abc", true)
assert.True(Settings:has("abc"))
assert.True(Settings:nilOrTrue("abc"))
assert.True(Settings:isTrue("abc"))
end)
it("should flip bool values", function()
Settings:delSetting("abc")
assert.True(Settings:hasNot("abc"))
Settings:flipNilOrTrue("abc")
assert.False(Settings:nilOrTrue("abc"))
assert.True(Settings:has("abc"))
assert.False(Settings:isTrue("abc"))
Settings:flipNilOrTrue("abc")
assert.True(Settings:nilOrTrue("abc"))
assert.True(Settings:hasNot("abc"))
assert.False(Settings:isTrue("abc"))
Settings:flipTrue("abc")
assert.True(Settings:has("abc"))
assert.True(Settings:isTrue("abc"))
assert.True(Settings:nilOrTrue("abc"))
Settings:flipTrue("abc")
assert.False(Settings:has("abc"))
assert.False(Settings:isTrue("abc"))
assert.True(Settings:nilOrTrue("abc"))
end)
it("should create child settings", function()
Settings:delSetting("key")
Settings:saveSetting("key", {
a = "b",
c = "true",
d = false,
})
local child = Settings:child("key")
assert.is_not_nil(child)
assert.True(child:has("a"))
assert.are.equal(child:readSetting("a"), "b")
assert.True(child:has("c"))
assert.True(child:isTrue("c"))
assert.True(child:has("d"))
assert.True(child:isFalse("d"))
assert.False(child:isTrue("e"))
child:flipTrue("e")
child:close()
child = Settings:child("key")
assert.True(child:isTrue("e"))
end)
describe("table wrapper", function()
Settings:delSetting("key")
it("should add item to table", function()
Settings:addTableItem("key", 1)
Settings:addTableItem("key", 2)
Settings:addTableItem("key", 3)
assert.are.equal(1, Settings:readSetting("key")[1])
assert.are.equal(2, Settings:readSetting("key")[2])
assert.are.equal(3, Settings:readSetting("key")[3])
end)
it("should remove item from table", function()
Settings:removeTableItem("key", 1)
assert.are.equal(2, Settings:readSetting("key")[1])
assert.are.equal(3, Settings:readSetting("key")[2])
end)
end)
end)
| agpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/object/creature/npc/droid/silver_protocol_base.lua | 1 | 2244 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_creature_npc_droid_silver_protocol_base = object_creature_npc_droid_shared_silver_protocol_base:new {
}
ObjectTemplates:addTemplate(object_creature_npc_droid_silver_protocol_base, "object/creature/npc/droid/silver_protocol_base.iff")
| lgpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/object/building/naboo/guild_university_naboo_style_01.lua | 3 | 2368 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_building_naboo_guild_university_naboo_style_01 = object_building_naboo_shared_guild_university_naboo_style_01:new {
gameObjectType = 527,
planetMapCategory = "guild",
planetMapSubCategory = "guild_university"
}
ObjectTemplates:addTemplate(object_building_naboo_guild_university_naboo_style_01, "object/building/naboo/guild_university_naboo_style_01.iff")
| lgpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/object/tangible/ship/attachment/weapon/blacksun_heavy_weapon3_s05.lua | 3 | 2320 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_tangible_ship_attachment_weapon_blacksun_heavy_weapon3_s05 = object_tangible_ship_attachment_weapon_shared_blacksun_heavy_weapon3_s05:new {
}
ObjectTemplates:addTemplate(object_tangible_ship_attachment_weapon_blacksun_heavy_weapon3_s05, "object/tangible/ship/attachment/weapon/blacksun_heavy_weapon3_s05.iff")
| lgpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/object/static/particle/particle_test_83.lua | 3 | 2216 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_static_particle_particle_test_83 = object_static_particle_shared_particle_test_83:new {
}
ObjectTemplates:addTemplate(object_static_particle_particle_test_83, "object/static/particle/particle_test_83.iff")
| lgpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/mobile/endor/jinda_cub.lua | 1 | 1116 | jinda_cub = Creature:new {
objectName = "@mob/creature_names:jinda_cub",
socialGroup = "jinda_tribe",
pvpFaction = "jinda_tribe",
faction = "",
level = 5,
chanceHit = 0.25,
damageMin = 45,
damageMax = 50,
baseXp = 113,
baseHAM = 135,
baseHAMmax = 165,
armor = 0,
resists = {0,0,0,0,0,0,0,-1,-1},
meatType = "",
meatAmount = 0,
hideType = "",
hideAmount = 0,
boneType = "",
boneAmount = 0,
milk = 0,
tamingChance = 0,
ferocity = 0,
pvpBitmask = ATTACKABLE,
creatureBitmask = PACK + STALKER,
optionsBitmask = 128,
diet = HERBIVORE,
templates = {
"object/mobile/jinda_male.iff",
"object/mobile/jinda_male_01.iff",
"object/mobile/jinda_female.iff",
"object/mobile/jinda_female_01.iff"},
lootGroups = {
{
groups = {
{group = "ewok", chance = 9100000},
{group = "armor_attachments", chance = 450000},
{group = "clothing_attachments", chance = 450000}
},
lootChance = 1200000
}
},
weapons = {"ewok_weapons"},
conversationTemplate = "",
attacks = merge(riflemanmaster,brawlermaster)
}
CreatureTemplates:addCreatureTemplate(jinda_cub, "jinda_cub")
| lgpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/object/draft_schematic/vehicle/component/vehicle_module_advanced.lua | 3 | 2316 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_draft_schematic_vehicle_component_vehicle_module_advanced = object_draft_schematic_vehicle_component_shared_vehicle_module_advanced:new {
}
ObjectTemplates:addTemplate(object_draft_schematic_vehicle_component_vehicle_module_advanced, "object/draft_schematic/vehicle/component/vehicle_module_advanced.iff")
| lgpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/managers/spawn_manager/naboo.lua | 1 | 14573 | JUNKNOTSELLABLE = 0
JUNKGENERIC = 1
JUNKCLOTHESANDJEWELLERY = 2
JUNKWEAPONS = 4
JUNKARMOUR = 8
JUNKTUSKEN = 16
JUNKJEDI = 32
JUNKJAWA = 64
JUNKGUNGAN = 128
JUNKCONVGENERIC = 1
JUNKCONVARMS = 2
JUNKCONVFINARY = 3
JUNKCONVDENDERRORI = 4
JUNKCONVDENDERTHEED = 5
JUNKCONVLILABORVO = 6
JUNKCONVMALIKVISTAL = 7
JUNKCONVNADOWATTOS = 8
JUNKCONVNATHANTAIKE = 9
JUNKCONVOLLOBOJABBAS = 10
JUNKCONVQUICHDANTOOINE = 11
JUNKCONVREGGINYM = 12
JUNKCONVSHEANILAKE = 13
JUNKCONVSNEGVALARIAN = 14
JUNKCONVJAWAGENERIC = 15
JUNKCONVJAWAFINARY = 16
JUNKCONVJAWAARMS = 17
JUNKCONVJAWATUSKEN = 18
-- Generated by SWGEmu Spawn Tool v0.12
-- {"regionName", xCenter, yCenter, radius, tier, spawnConstant, "spawnGroup1", [...]}
-- Tier is a bit mask with the following possible values where each hexadecimal position is one possible configuration.
-- That means that it is not possible to have both a world spawn area and imperial spawn area in the same region, but
-- a dynamic rebel spawn area that is also a no build zone is possible.
UNDEFINEDAREA = 0x0000
WORLDSPAWNAREA = 0x0001
REBELSPAWNAREA = 0x0002
IMPERIALSPAWNAREA = 0x0004
NEUTRALSPAWNAREA = 0x0008
STATICSPAWNAREA = 0x0010
DYNAMICSPAWNAREA = 0x0020
LAIRSPAWNAREA = 0x0040
NOSPAWNAREA = 0x0100
NOBUILDZONEAREA = 0x1000
naboo_regions = {
{"beach_town",0,0,{1,0},UNDEFINEDAREA,1},
{"beachtown_easy_newbie",-5585,-35,{1,1040},LAIRSPAWNAREA + WORLDSPAWNAREA,1,"naboo_starter_creatures"},
{"beachtown_medium_newbie",-5585,-35,{3,960,1920},LAIRSPAWNAREA + WORLDSPAWNAREA,1,"naboo_medium_creatures"},
{"bounty_hunter_camp",5029,4156,{1,30},STATICSPAWNAREA + NOSPAWNAREA + NOBUILDZONEAREA,1},
{"campfire_and_bones",3939,2701,{1,30},STATICSPAWNAREA + NOSPAWNAREA + NOBUILDZONEAREA,1},
{"campfire_and_ruins",-1771,2387,{1,30},STATICSPAWNAREA + NOSPAWNAREA + NOBUILDZONEAREA,1},
{"central_jungle_swamp",0,0,{1,0},UNDEFINEDAREA,1},
{"central_mountain_circle",0,0,{1,0},UNDEFINEDAREA,1},
{"central_mountain_range",0,0,{1,0},UNDEFINEDAREA,1},
{"dead_tree",-675,5203,{1,10},STATICSPAWNAREA + NOSPAWNAREA + NOBUILDZONEAREA,1},
{"debris",-1691,5427,{1,30},STATICSPAWNAREA + NOSPAWNAREA + NOBUILDZONEAREA,1},
{"debris_2",-2957,1699,{1,30},STATICSPAWNAREA + NOSPAWNAREA + NOBUILDZONEAREA,1},
{"debris_3",-2403,563,{1,30},STATICSPAWNAREA + NOSPAWNAREA + NOBUILDZONEAREA,1},
{"deeja_easy_newbie",5060,-1470,{1,1360},LAIRSPAWNAREA + WORLDSPAWNAREA,1,"naboo_starter_creatures"},
{"deeja_medium_newbie",5060,-1470,{3,1240,2200},LAIRSPAWNAREA + WORLDSPAWNAREA,1,"naboo_medium_creatures"},
{"deeja_peak",0,0,{1,0},UNDEFINEDAREA,1},
{"eastern_forest",0,0,{1,0},UNDEFINEDAREA,1},
{"eastern_jungle_swamp",0,0,{1,0},UNDEFINEDAREA,1},
{"eastern_mountains",0,0,{1,0},UNDEFINEDAREA,1},
{"easy_gnort_ne",0,0,{1,0},UNDEFINEDAREA,1},
{"emperors_retreat",2400,-3900,{1,500},STATICSPAWNAREA + NOSPAWNAREA + NOBUILDZONEAREA,1},
{"fence_and_debris",-7575,5043,{1,30},STATICSPAWNAREA + NOSPAWNAREA + NOBUILDZONEAREA,1},
{"fishing_dock",-6314,-5087,{1,30},STATICSPAWNAREA + NOSPAWNAREA + NOBUILDZONEAREA,1},
{"forest_1",0,0,{1,0},UNDEFINEDAREA,1},
{"gallo_forest_1",0,0,{1,0},UNDEFINEDAREA,1},
{"gallo_jungle_1",0,0,{1,0},UNDEFINEDAREA,1},
{"gallo_jungle_2",0,0,{1,0},UNDEFINEDAREA,1},
{"gallo_mountains",0,0,{1,0},UNDEFINEDAREA,1},
{"gallo_mountains_1",0,0,{1,0},UNDEFINEDAREA,1},
{"gallo_mountains_11",0,0,{1,0},UNDEFINEDAREA,1},
{"gallo_mountains_12",0,0,{1,0},UNDEFINEDAREA,1},
{"gallo_mountains_13",0,0,{1,0},UNDEFINEDAREA,1},
{"gallo_mountains_14",0,0,{1,0},UNDEFINEDAREA,1},
{"gallo_mountains_15",0,0,{1,0},UNDEFINEDAREA,1},
{"gallo_mountains_16",0,0,{1,0},UNDEFINEDAREA,1},
{"gallo_mountains_17",0,0,{1,0},UNDEFINEDAREA,1},
{"gallo_mountains_2",0,0,{1,0},UNDEFINEDAREA,1},
{"gallo_mountains_3",0,0,{1,0},UNDEFINEDAREA,1},
{"gallo_mountains_4",0,0,{1,0},UNDEFINEDAREA,1},
{"gallo_mountains_5",0,0,{1,0},UNDEFINEDAREA,1},
{"gallo_mountains_6",0,0,{1,0},UNDEFINEDAREA,1},
{"gardens",1260,4291,{1,30},STATICSPAWNAREA + NOSPAWNAREA + NOBUILDZONEAREA,1},
{"gate_and_columns",-259,-60,{1,30},STATICSPAWNAREA + NOSPAWNAREA + NOBUILDZONEAREA,1},
{"gazebo",1012,-3460,{1,30},STATICSPAWNAREA + NOSPAWNAREA + NOBUILDZONEAREA,1},
{"great_grass_plains_1",0,0,{1,0},UNDEFINEDAREA,1},
{"great_grass_plains_2",0,0,{1,0},UNDEFINEDAREA,1},
{"great_grass_plains_3",0,0,{1,0},UNDEFINEDAREA,1},
{"great_grass_plains_4",0,0,{1,0},UNDEFINEDAREA,1},
{"great_grass_plains_5",0,0,{1,0},UNDEFINEDAREA,1},
{"graveyard",-3603,3119,{1,30},STATICSPAWNAREA + NOSPAWNAREA + NOBUILDZONEAREA,1},
{"gungan_fountain",5556,5531,{1,50},STATICSPAWNAREA + NOSPAWNAREA + NOBUILDZONEAREA,1},
{"gungan_head",1940,6611,{1,50},STATICSPAWNAREA + NOSPAWNAREA + NOBUILDZONEAREA,1},
{"gungan_head_with_walls",-5046,6178,{1,30},STATICSPAWNAREA + NOSPAWNAREA + NOBUILDZONEAREA,1},
{"gungan_monument",-7547,2251,{1,50},STATICSPAWNAREA + NOSPAWNAREA + NOBUILDZONEAREA,1},
{"gungan_ruins",3428,5075,{1,30},STATICSPAWNAREA + NOSPAWNAREA + NOBUILDZONEAREA,1},
{"gungan_sacred_place",-2013,-5453,{1,160},STATICSPAWNAREA + NOSPAWNAREA + NOBUILDZONEAREA,1},
{"gungan_temple",-264,2826,{1,50},STATICSPAWNAREA + NOSPAWNAREA + NOBUILDZONEAREA,1},
{"hard_capper_spineflap_sw",0,0,{1,0},UNDEFINEDAREA,1},
{"hard_gungan_se",0,0,{1,0},UNDEFINEDAREA,1},
{"hard_mauler_nw",0,0,{1,0},UNDEFINEDAREA,1},
{"hard_peko_peko_nw",-1856,6112,{1,2500},LAIRSPAWNAREA + WORLDSPAWNAREA,1,"peko_albatross"},
{"hard_veermok_ne",0,0,{1,0},UNDEFINEDAREA,1},
{"imperial_vs_gungan_poi",4760,3875,{1,125},STATICSPAWNAREA + NOSPAWNAREA + NOBUILDZONEAREA,1},
{"jungle_1",0,0,{1,0},UNDEFINEDAREA,1},
{"jungle_2",0,0,{1,0},UNDEFINEDAREA,1},
{"kaadara_easy_newbie",5150,6680,{1,1360},LAIRSPAWNAREA + WORLDSPAWNAREA,1,"naboo_starter_creatures"},
{"kaadara_medium_newbie",5150,6680,{3,1240,2200},LAIRSPAWNAREA + WORLDSPAWNAREA,1,"naboo_medium_creatures"},
{"kadaara",0,0,{1,0},UNDEFINEDAREA,1},
{"keren",0,0,{1,0},UNDEFINEDAREA,1},
{"keren_easy_newbie",1685,2620,{1,1360},LAIRSPAWNAREA + WORLDSPAWNAREA,1,"naboo_starter_creatures"},
{"keren_medium_newbie",1685,2620,{3,1240,2200},LAIRSPAWNAREA + WORLDSPAWNAREA,1,"naboo_medium_creatures"},
{"lainorm_swamp_2",0,0,{1,0},UNDEFINEDAREA,1},
{"lake_retreat",-5555,-34,{1,400},STATICSPAWNAREA + NOSPAWNAREA + NOBUILDZONEAREA,1},
{"lake_retreat_gazebo",-5637,174,{1,40},STATICSPAWNAREA + NOSPAWNAREA + NOBUILDZONEAREA,1},
{"lasay_swamp",0,0,{1,0},UNDEFINEDAREA,1},
{"lianorm_swamp_1",0,0,{1,0},UNDEFINEDAREA,1},
{"lianorm_swamps",0,0,{1,0},UNDEFINEDAREA,1},
{"mauler_stronghold",2910,1118,{1,200},STATICSPAWNAREA + NOSPAWNAREA + NOBUILDZONEAREA,1},
{"medium_ikopi_ne",0,0,{1,0},UNDEFINEDAREA,1},
{"medium_mountain_ikopi_ne",0,0,{1,0},UNDEFINEDAREA,1},
{"medium_mountain_ikopi_se",0,0,{1,0},UNDEFINEDAREA,1},
{"medium_mountain_krevol_se",0,0,{1,0},UNDEFINEDAREA,1},
{"medium_swamp_cat_se",0,0,{1,0},UNDEFINEDAREA,1},
{"medium_tusk_cat_ne",0,0,{1,0},UNDEFINEDAREA,1},
{"medium_tusk_cat_nw",0,0,{1,0},UNDEFINEDAREA,1},
{"moenia",0,0,{1,0},UNDEFINEDAREA,1},
{"moenia_easy_newbie",4800,-4820,{1,1360},LAIRSPAWNAREA + WORLDSPAWNAREA,1,"naboo_starter_creatures"},
{"moenia_medium_newbie",4800,-4820,{3,1240,2200},LAIRSPAWNAREA + WORLDSPAWNAREA,1,"naboo_medium_creatures"},
{"narglatch_cave",5861,-4650,{1,150},STATICSPAWNAREA + NOSPAWNAREA + NOBUILDZONEAREA,1},
{"north_eastern_jungle_swamp",0,0,{1,0},UNDEFINEDAREA,1},
{"northern_plains",0,0,{1,0},UNDEFINEDAREA,1},
{"paitnnu_wetlands",0,0,{1,0},UNDEFINEDAREA,1},
{"plains_1",0,0,{1,0},UNDEFINEDAREA,1},
{"rainforest_1",0,0,{1,0},UNDEFINEDAREA,1},
{"rainforest_2",0,0,{1,0},UNDEFINEDAREA,1},
{"rainforest_3",0,0,{1,0},UNDEFINEDAREA,1},
{"rebel_outpost",-1499,-1732,{1,100},STATICSPAWNAREA + NOSPAWNAREA + NOBUILDZONEAREA,1},
{"rebel_outpost_2",978,-1332,{1,100},STATICSPAWNAREA + NOSPAWNAREA + NOBUILDZONEAREA,1},
{"ruined_wall",-3603,-876,{1,30},STATICSPAWNAREA + NOSPAWNAREA + NOBUILDZONEAREA,1},
{"ruins",-2547,6787,{1,30},STATICSPAWNAREA + NOSPAWNAREA + NOBUILDZONEAREA,1},
{"ruins_2",-1799,-500,{1,30},STATICSPAWNAREA + NOSPAWNAREA + NOBUILDZONEAREA,1},
{"ruins_3",-7319,-4143,{1,30},STATICSPAWNAREA + NOSPAWNAREA + NOBUILDZONEAREA,1},
{"ruins_4",2148,5427,{1,30},STATICSPAWNAREA + NOSPAWNAREA + NOBUILDZONEAREA,1},
{"ruins_5}",1228,5515,{1,30},STATICSPAWNAREA + NOSPAWNAREA + NOBUILDZONEAREA,1},
{"shield_generator",-1339,6531,{1,30},STATICSPAWNAREA + NOSPAWNAREA + NOBUILDZONEAREA,1},
{"small_garden",-6459,1747,{1,30},STATICSPAWNAREA + NOSPAWNAREA + NOBUILDZONEAREA,1},
{"small_graveyard",-2174,6357,{1,30},STATICSPAWNAREA + NOSPAWNAREA + NOBUILDZONEAREA,1},
{"southeast_swamp",0,0,{1,0},UNDEFINEDAREA,1},
{"southwest_mountain_circle",0,0,{1,0},UNDEFINEDAREA,1},
{"southwest_swamp",0,0,{1,0},UNDEFINEDAREA,1},
{"statues",-1635,-4036,{1,30},STATICSPAWNAREA + NOSPAWNAREA + NOBUILDZONEAREA,1},
{"statues_and_droideka",-2331,5075,{1,30},STATICSPAWNAREA + NOSPAWNAREA + NOBUILDZONEAREA,1},
{"statues_and_torches",-1147,347,{1,30},STATICSPAWNAREA + NOSPAWNAREA + NOBUILDZONEAREA,1},
{"swamp_1",0,0,{1,0},UNDEFINEDAREA,1},
{"swamp_2",0,0,{1,0},UNDEFINEDAREA,1},
{"swamp_3",0,0,{1,0},UNDEFINEDAREA,1},
{"swamp_town",0,0,{1,0},UNDEFINEDAREA,1},
{"theed",-5036,4124,{1,500},STATICSPAWNAREA + NOSPAWNAREA + NOBUILDZONEAREA,0},
{"theed_easy_newbie_1",-5485,4380,{1,1750},LAIRSPAWNAREA + WORLDSPAWNAREA,1,"naboo_starter_creatures"},
{"theed_easy_newbie_2",-4940,4030,{1,1750},LAIRSPAWNAREA + WORLDSPAWNAREA,1,"naboo_starter_creatures"},
{"theed_medium_newbie",-5212,4205,{3,1600,2800},LAIRSPAWNAREA + WORLDSPAWNAREA,1,"naboo_medium_creatures"},
{"tower",-1568,6003,{1,50},STATICSPAWNAREA + NOSPAWNAREA + NOBUILDZONEAREA,1},
{"weapon_development_facility",-6510,-3280,{1,200},STATICSPAWNAREA + NOSPAWNAREA + NOBUILDZONEAREA,1},
{"wreckage",6314,4248,{1,30},STATICSPAWNAREA + NOSPAWNAREA + NOBUILDZONEAREA,1},
{"western_forest",0,0,{1,0},UNDEFINEDAREA,1},
{"world_spawner",0,0,{1,-1},LAIRSPAWNAREA + WORLDSPAWNAREA,1,"naboo_world_creatures"},
}
naboo_static_spawns = {
{"agriculturalist",60,-5827.81,6,4173.98,180.005,0, "conversation", ""},
{"bodyguard",300,11.7898,1.75,-1.89849,180.002,1305892, "conversation", ""},
{"bodyguard",300,-5258.93,6,4187.17,180.005,0, "conversation", ""},
{"bodyguard",300,-29.8622,7.9418,10.8957,180.008,1692104, "conversation", ""},
{"bodyguard",300,-37.5788,7.9418,22.3791,0,1692104, "conversation", ""},
{"brawler",60,19.6394,0.764492,42.4583,354.768,5475485, "conversation", ""},
{"businessman",60,15.5641,1.28309,-2.37071,135.005,1677395, "conversation", ""},
{"businessman",60,-4.2087,0.999986,2.15452,179.993,1677394, "conversation", ""},
{"coa2_imperial_coordinator",0,-5431.8,6,4168.58,145.531,0, "npc_imperial", ""},
{"commoner",60,-17.0001,2.25,17.4832,270.003,1305888, "conversation", ""},
{"commoner",60,-19.0001,2.25,17.4832,90.0053,1305888, "conversation", ""},
{"commoner",60,-24,1.6,-4,77.8869,1697383, "calm", "An Event Promoter"},
{"commoner",60,-5778.43,6,4397.54,180.005,0, "conversation", ""},
{"commoner_technician",60,-22.5486,1.61223,33.2294,354.768,5475485, "conversation", ""},
{"entertainer",60,19.6394,0.664388,43.5491,180.018,5475485, "conversation", ""},
{"etheli_drenel",60,12.4716,2.31216,25.6024,180.001,5475485, "conversation", ""},
{"event_perk_vendor",0,-24,1.6,-4,240.351,1677400, "calm", "Pex (a storyteller vendor)"},
{"explorer",60,3.05224,2.12878,72.5469,180.005,5475487, "conversation", ""},
{"fringer",300,3.05224,2.12878,71.4469,0,5475487, "conversation", ""},
{"gambler",60,4.2931,1,-7.62435,360.011,1677394, "conversation", ""},
{"gambler",60,-11.7266,1.6,-16.4722,0,1677399, "conversation", ""},
{"gungan_guard",300,12.4716,2.41226,24.5116,5.24304,5475485, "conversation", ""},
{"gungan_hermit",300,-22.6115,1.6,-10.3739,179.996,1677400, "conversation", ""},
{"gungan_outcast",300,-5827.81,6,4172.98,0,0, "conversation", ""},
{"junk_dealer",0,-5222.4,6,4217.4,-137,0, "", "",JUNKGENERIC,JUNKCONVGENERIC},
{"junk_sheani",0,-5496,4.2,-71,112,0, "", "Sheani Lake",JUNKCLOTHESANDJEWELLERY+JUNKARMOUR,JUNKCONVSHEANILAKE},
{"junk_dealer",0,1371.6,13,2705.3,177,0, "", "",JUNKGENERIC,JUNKCONVGENERIC},
{"junk_lila",0,4809.5,4.2,-4663,112,0, "", "Lila Rawlkiss",JUNKWEAPONS,JUNKCONVLILABORVO},
{"junk_dealer",0,-5885.3,6,4214.7,83,0, "", "",JUNKGENERIC,JUNKCONVGENERIC},
{"medic",60,-11.5446,2.12878,75.9709,0,5475487, "conversation", ""},
{"mercenary",60,-6.34119,0.6,-9.37965,360.011,5475480, "conversation", ""},
{"miner",60,-5886.59,6,4369.23,180.005,0, "conversation", ""},
{"naboo_holy_man",300,-22.6115,1.6,-11.4739,0,1677400, "conversation", ""},
{"naboo_nomad",300,16.6641,1.28309,-3.47071,360.011,1677395, "conversation", ""},
{"noble",60,-16.4118,1.02908,39.5837,179.999,5475485, "conversation", ""},
{"noble",60,2432.4,292,-3887.3,-125,0, "npc_use_terminal_high", ""},
{"official",300,-5886.59,6,4368.23,0,0, "conversation", ""},
{"philosopher",300,-11.7266,1.6,-15.4722,180.001,1677399, "conversation", ""},
{"rsf_palace_guard",300,18.5394,0.664266,43.5491,134.79,5475485, "conversation", ""},
{"rsf_palace_guard",300,-6.34119,0.6,-8.27965,180.012,5475480, "conversation", ""},
{"rsf_pilot",300,-16.4118,1.12919,38.4929,5.24439,5475485, "conversation", ""},
{"rsf_pilot",300,-22.5486,1.52122,34.221,180.016,5475485, "conversation", ""},
{"rsf_security_guard",300,6.3,1.2,-3.9,-89,1305892, "conversation", ""},
{"rsf_security_officer",300,5.4,1.2,-3.9,87,1305892, "conversation", ""},
{"scoundrel",300,-4.2087,0.999986,1.15452,0,1677394, "conversation", ""},
{"stormtrooper_groupleader",400,-5969.83,6,4246.76,173.432,0, "", "VK-481"},
{"trainer_shipwright",0,4727,4.3,-4649,0,0, "", "a shipwright trainer"},
{"trainer_shipwright",0,1352,13,2768,141,0, "", "a shipwright trainer"},
{"trainer_shipwright",0,0.2,0.7,-71.4,-177,1692101, "", "a shipwright trainer"},
{"trainer_shipwright",0,5.1,0.6,66.6,119,1741539, "", "a shipwright trainer"},
{"vendor",60,-11.5446,2.12878,76.8966,179.996,5475487, "conversation", ""},
{"ysnide_omewror",60,4.2931,1.00001,-6.52435,180.012,1677394, "conversation", ""},
}
naboo_badges = {
{"badge_amidalas_sandy_beach",-5828,-93,10,77},
{"badge_deeja_falls_top",5161,-1627,10,76},
{"badge_gungan_sacred_place",-2000,-5429,10,19},
{"badge_theed_falls_bottom",-4614,4261,10,75},
}
| lgpl-3.0 |
eraffxi/darkstar | scripts/zones/Xarcabard/mobs/Boreal_Tiger.lua | 2 | 1090 | -----------------------------------
-- Area: Xarcabard
-- NM: Boreal Tiger
-- Involved in Quests: Atop the Highest Mountains
-- !pos 341 -29 370 112
-----------------------------------
package.loaded["scripts/zones/Xarcabard/TextIDs"] = nil;
-----------------------------------
require("scripts/zones/Xarcabard/TextIDs");
require("scripts/zones/Xarcabard/MobIDs");
require("scripts/globals/keyitems");
require("scripts/globals/settings");
require("scripts/globals/quests");
function onMobSpawn(mob)
-- Failsafe to make sure NPC is down when NM is up
if (OldSchoolG2) then
GetNPCByID(BOREAL_TIGER_QM):showNPC(0);
end
end;
function onMobDeath(mob, player, isKiller)
if (OldSchoolG2) then
-- show ??? for desired duration
-- notify people on the quest who need the KI
GetNPCByID(BOREAL_TIGER_QM):showNPC(FrigiciteDuration);
if (player:getQuestStatus(JEUNO,ATOP_THE_HIGHEST_MOUNTAINS) == QUEST_ACCEPTED and not player:hasKeyItem(dsp.ki.ROUND_FRIGICITE)) then
player:messageSpecial(BLOCKS_OF_ICE);
end
end
end;
| gpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/object/tangible/lair/mynock/serverobjects.lua | 3 | 2100 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
--Children folder includes
-- Server Objects
includeFile("tangible/lair/mynock/lair_mynock.lua")
| lgpl-3.0 |
Verites/verigraph | tests/GrLang/ReplIntegrationSpec/graph-morphism-rule.lua | 2 | 1318 | require("git-types")
Foo = Graph [[
r1 r2 : Revision
dr1 dr2 : Dependencies
r1 -d1:deps-> dr1
r2 -d2:deps-> dr2
dr2 -d22:dependsOn-> r2
dr2 -d21:dependsOn-> r1
]]
Bar = Graph [[
r1 r2 r3 : Revision
dr1 dr2 dr3 : Dependencies
r1 -d1:deps-> dr1
r2 -d2:deps-> dr2
r3 -d3:deps-> dr3
dr3 -d33:dependsOn-> r3
dr3 -d32:dependsOn-> r2
dr3 -d31:dependsOn-> r1
dr2 -d22:dependsOn-> r2
dr2 -d21:dependsOn-> r1
]]
fb = Morphism(Foo, Bar) [[
r1 -> r1; r2 -> r2
dr1 -> dr1; dr2 -> dr2
d1 -> d1; d2 -> d2
d22 -> d22; d21 -> d21
]]
bf = Morphism(Bar, Foo) [[
r1 -> r1; r2 -> r2; r3 -> r2
dr1 -> dr1; dr2 -> dr2; dr3 -> dr2
d1 -> d1; d2 -> d2; d3 -> d2
d33 -> d22; d32 -> d22; d31 -> d21
d22 -> d22; d21 -> d21
]]
print("Foo == fb:dom()", Foo == fb:dom())
print("Foo ~= fb:cod()", Foo ~= fb:cod())
print("fb .. bf ~= Bar:identity()", fb .. bf ~= Bar:identity())
print("bf .. fb = Foo:identity()", bf .. fb == Foo:identity())
Amend = Rule [[
match {
r1 : Revision
tr1 : Dependencies
r1 -:deps-> tr1
}
forbid {
tr2 : Dependencies
tr2 -:dependsOn-> r1
}
clone r1 as r2
clone tr1 as tr2
create r2 -:deps-> tr2
]]
--[[
rule Bar {
require r1 : Revision
require tr1 : Dependencies
require r1 -:Deps-> tr1
forbid tr1-:dependsOn->r1
}--]] | apache-2.0 |
kidaa/Awakening-Core3 | bin/scripts/object/tangible/wearables/ithorian/ith_pants_s14.lua | 3 | 3451 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_tangible_wearables_ithorian_ith_pants_s14 = object_tangible_wearables_ithorian_shared_ith_pants_s14:new {
playerRaces = { "object/creature/player/ithorian_male.iff",
"object/creature/player/ithorian_female.iff",
"object/mobile/vendor/ithorian_female.iff",
"object/mobile/vendor/ithorian_male.iff" },
numberExperimentalProperties = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
experimentalProperties = {"XX", "XX", "XX", "XX", "XX", "XX", "XX", "XX", "XX", "XX", "XX", "XX", "XX", "XX", "XX", "XX"},
experimentalWeights = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
experimentalGroupTitles = {"null", "null", "null", "null", "null", "null", "null", "null", "null", "null", "null", "null", "null", "null", "null", "null"},
experimentalSubGroupTitles = {"null", "null", "sockets", "hitpoints", "mod_idx_one", "mod_val_one", "mod_idx_two", "mod_val_two", "mod_idx_three", "mod_val_three", "mod_idx_four", "mod_val_four", "mod_idx_five", "mod_val_five", "mod_idx_six", "mod_val_six"},
experimentalMin = {0, 0, 0, 1000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
experimentalMax = {0, 0, 0, 1000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
experimentalPrecision = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
experimentalCombineType = {0, 0, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
}
ObjectTemplates:addTemplate(object_tangible_wearables_ithorian_ith_pants_s14, "object/tangible/wearables/ithorian/ith_pants_s14.iff")
| lgpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/object/draft_schematic/weapon/lightsaber/lightsaber_two_hand_gen1.lua | 2 | 5175 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_draft_schematic_weapon_lightsaber_lightsaber_two_hand_gen1 = object_draft_schematic_weapon_lightsaber_shared_lightsaber_two_hand_gen1:new {
templateType = DRAFTSCHEMATIC,
customObjectName = "Two-Handed First Generation Lightsaber",
craftingToolTab = 2048, -- (See DraftSchemticImplementation.h)
complexity = 16,
size = 1,
xpType = "jedi_general",
xp = 0,
assemblySkill = "jedi_saber_assembly",
experimentingSkill = "jedi_saber_experimentation",
customizationSkill = "jedi_customization",
disableFactoryRun = true,
customizationOptions = {},
customizationStringNames = {},
customizationDefaults = {},
ingredientTemplateNames = {"craft_weapon_ingredients_n", "craft_weapon_ingredients_n", "craft_weapon_ingredients_n", "craft_weapon_ingredients_n", "craft_weapon_ingredients_n", "craft_weapon_ingredients_n", "craft_weapon_ingredients_n"},
ingredientTitleNames = {"emitter_shroud", "primary_crystal", "activator", "handgrip", "focusing_crystals", "power_field_insulator", "energizers"},
ingredientSlotType = {0, 1, 0, 0, 1, 0, 0},
resourceTypes = {"mineral", "object/tangible/component/weapon/lightsaber/shared_lightsaber_refined_crystal_pack.iff", "metal", "chemical", "object/tangible/component/weapon/lightsaber/shared_lightsaber_refined_crystal_pack.iff", "gas", "metal"},
resourceQuantities = {20, 1, 19, 28, 1, 30, 20},
contribution = {100, 100, 100, 100, 100, 100, 100},
targetTemplate = "object/weapon/melee/2h_sword/crafted_saber/sword_lightsaber_two_handed_gen1.iff",
additionalTemplates = {
"object/weapon/melee/2h_sword/crafted_saber/shared_sword_lightsaber_two_handed_s1_gen1.iff",
"object/weapon/melee/2h_sword/crafted_saber/shared_sword_lightsaber_two_handed_s2_gen1.iff",
"object/weapon/melee/2h_sword/crafted_saber/shared_sword_lightsaber_two_handed_s3_gen1.iff",
"object/weapon/melee/2h_sword/crafted_saber/shared_sword_lightsaber_two_handed_s4_gen1.iff",
"object/weapon/melee/2h_sword/crafted_saber/shared_sword_lightsaber_two_handed_s5_gen1.iff",
"object/weapon/melee/2h_sword/crafted_saber/shared_sword_lightsaber_two_handed_s6_gen1.iff",
"object/weapon/melee/2h_sword/crafted_saber/shared_sword_lightsaber_two_handed_s7_gen1.iff",
"object/weapon/melee/2h_sword/crafted_saber/shared_sword_lightsaber_two_handed_s8_gen1.iff",
"object/weapon/melee/2h_sword/crafted_saber/shared_sword_lightsaber_two_handed_s9_gen1.iff",
"object/weapon/melee/2h_sword/crafted_saber/shared_sword_lightsaber_two_handed_s10_gen1.iff",
"object/weapon/melee/2h_sword/crafted_saber/shared_sword_lightsaber_two_handed_s11_gen1.iff",
"object/weapon/melee/2h_sword/crafted_saber/shared_sword_lightsaber_two_handed_s12_gen1.iff",
"object/weapon/melee/2h_sword/crafted_saber/shared_sword_lightsaber_two_handed_s13_gen1.iff",
}
}
ObjectTemplates:addTemplate(object_draft_schematic_weapon_lightsaber_lightsaber_two_hand_gen1, "object/draft_schematic/weapon/lightsaber/lightsaber_two_hand_gen1.iff")
| lgpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/object/draft_schematic/space/chassis/tieaggressor.lua | 2 | 3719 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_draft_schematic_space_chassis_tieaggressor = object_draft_schematic_space_chassis_shared_tieaggressor:new {
templateType = DRAFTSCHEMATIC,
customObjectName = "TIE Aggressor Chassis Blueprints",
craftingToolTab = 131072, -- (See DraftSchemticImplementation.h)
complexity = 39,
size = 1,
xpType = "shipwright",
xp = 20000,
assemblySkill = "chassis_assembly",
experimentingSkill = "chassis_experimentation",
customizationSkill = "medicine_customization",
customizationOptions = {},
customizationStringNames = {},
customizationDefaults = {},
ingredientTemplateNames = {"craft_item_ingredients_n", "craft_item_ingredients_n", "craft_item_ingredients_n", "craft_item_ingredients_n", "craft_item_ingredients_n", "craft_item_ingredients_n", "craft_item_ingredients_n", "craft_item_ingredients_n"},
ingredientTitleNames = {"frame", "advanced_frame_infrastructure", "structural_support", "base_chassis_plating", "basic_heat_shielding", "ship_skin", "shock_absorption_layer", "cockpit_insulation"},
ingredientSlotType = {0, 0, 0, 0, 0, 0, 0, 0},
resourceTypes = {"steel", "steel", "ore", "ore", "petrochem_inert", "aluminum", "iron", "fiberplast"},
resourceQuantities = {24000, 8000, 8000, 8000, 8000, 8000, 8000, 8000},
contribution = {100, 100, 100, 100, 100, 100, 100, 100},
targetTemplate = "object/tangible/ship/components/chassis/tieaggressor_chassis_token.iff",
additionalTemplates = {
"object/tangible/ship/components/chassis/shared_tieaggressor_chassis_token.iff",
}
}
ObjectTemplates:addTemplate(object_draft_schematic_space_chassis_tieaggressor, "object/draft_schematic/space/chassis/tieaggressor.iff")
| lgpl-3.0 |
eraffxi/darkstar | scripts/zones/West_Sarutabaruta/npcs/Slow_Axe_IM.lua | 2 | 2946 | -----------------------------------
-- Area: West Sarutabaruta
-- NPC: Slow Axe, I.M.
-- Type: Border Conquest Guards
-- !pos 399.450 -25.858 727.545 115
-----------------------------------
package.loaded["scripts/zones/West_Sarutabaruta/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/conquest");
require("scripts/zones/West_Sarutabaruta/TextIDs");
local guardnation = dsp.nation.BASTOK; -- SANDORIA, BASTOK, WINDURST, 4 = jeuno
local guardtype = 4; -- 1: city, 2: foreign, 3: outpost, 4: border
local region = dsp.region.SARUTABARUTA;
local csid = 0x7ff8;
function onTrade(player,npc,trade)
tradeConquestGuard(player,npc,trade,guardnation,guardtype);
end;
function onTrigger(player,npc)
if (player:hasKeyItem(getSupplyKey(region)) and player:getNation() == guardnation) then
if (supplyRunFresh(player) == 1) then
player:startEvent(csid,16,0,0,0,1,0,0,255); -- you have brought us supplies !
else
player:showText(npc, CONQUEST - 1); -- "Hmm... These supplies you have brought us are too old to be of any use."
player:delKeyItem(getSupplyKey(region));
player:messageSpecial(KEYITEM_OBTAINED + 1, getSupplyKey(region));
player:setVar("supplyQuest_region",0);
end
else
local arg1 = getArg1(guardnation, player) - 1;
if (arg1 >= 1792) then -- foreign, non-allied
player:startEvent(csid,1808,0,0,0,0,player:getRank(),0,0);
else -- citizen or allied
player:startEvent(csid,arg1,0,0x3F0000,0,0,getArg6(player),0,0);
end
end
end;
function onEventUpdate(player,csid,option)
-- printf("OPTION: %u",option);
end;
function onEventFinish(player,csid,option)
-- printf("OPTION: %u",option);
if (option == 1) then
local duration = (player:getRank() + getNationRank(player:getNation()) + 3) * 3600;
player:delStatusEffect(dsp.effect.SIGIL);
player:delStatusEffect(dsp.effect.SANCTION);
player:delStatusEffect(dsp.effect.SIGNET);
player:addStatusEffect(dsp.effect.SIGNET,0,0,duration); -- Grant Signet
elseif (option == 2) then
player:delKeyItem(getSupplyKey(region));
player:addCP(supplyReward[region + 1])
player:messageSpecial(CONQUEST); -- "You've earned conquest points!"
if (hasOutpost(player, region+5) == 0) then
local supply_quests = 2^(region+5);
player:addNationTeleport(guardnation,supply_quests);
player:setVar("supplyQuest_region",0);
end
elseif (option == 4) then
if (player:delGil(giltosetHP(guardnation,player))) then
player:setHomePoint();
player:messageSpecial(CONQUEST + 94); -- "Your home point has been set."
else
player:messageSpecial(CONQUEST + 95); -- "You do not have enough gil to set your home point here."
end
end
end; | gpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/object/creature/npc/base/rodian_base_male.lua | 3 | 2224 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_creature_npc_base_rodian_base_male = object_creature_npc_base_shared_rodian_base_male:new {
}
ObjectTemplates:addTemplate(object_creature_npc_base_rodian_base_male, "object/creature/npc/base/rodian_base_male.iff")
| lgpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/object/tangible/loot/dungeon/geonosian_mad_bunker/engineering_key.lua | 3 | 2320 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_tangible_loot_dungeon_geonosian_mad_bunker_engineering_key = object_tangible_loot_dungeon_geonosian_mad_bunker_shared_engineering_key:new {
}
ObjectTemplates:addTemplate(object_tangible_loot_dungeon_geonosian_mad_bunker_engineering_key, "object/tangible/loot/dungeon/geonosian_mad_bunker/engineering_key.iff")
| lgpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/object/weapon/melee/sword/crafted_saber/sword_lightsaber_s9_training.lua | 1 | 6236 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_weapon_melee_sword_crafted_saber_sword_lightsaber_s9_training = object_weapon_melee_sword_crafted_saber_shared_sword_lightsaber_s9_training:new {
playerRaces = { "object/creature/player/bothan_male.iff",
"object/creature/player/bothan_female.iff",
"object/creature/player/human_male.iff",
"object/creature/player/human_female.iff",
"object/creature/player/ithorian_male.iff",
"object/creature/player/ithorian_female.iff",
"object/creature/player/moncal_male.iff",
"object/creature/player/moncal_female.iff",
"object/creature/player/rodian_male.iff",
"object/creature/player/rodian_female.iff",
"object/creature/player/sullustan_male.iff",
"object/creature/player/sullustan_female.iff",
"object/creature/player/trandoshan_male.iff",
"object/creature/player/trandoshan_female.iff",
"object/creature/player/twilek_male.iff",
"object/creature/player/twilek_female.iff",
"object/creature/player/wookiee_male.iff",
"object/creature/player/wookiee_female.iff",
"object/creature/player/zabrak_male.iff",
"object/creature/player/zabrak_female.iff" },
-- RANGEDATTACK, MELEEATTACK, FORCEATTACK, TRAPATTACK, GRENADEATTACK, HEAVYACIDBEAMATTACK,
-- HEAVYLIGHTNINGBEAMATTACK, HEAVYPARTICLEBEAMATTACK, HEAVYROCKETLAUNCHERATTACK, HEAVYLAUNCHERATTACK
attackType = MELEEATTACK,
-- ENERGY, KINETIC, ELECTRICITY, STUN, BLAST, HEAT, COLD, ACID, FORCE, LIGHTSABER
damageType = LIGHTSABER,
-- NONE, LIGHT, MEDIUM, HEAVY
armorPiercing = MEDIUM,
-- combat_rangedspecialize_bactarifle, combat_rangedspecialize_rifle, combat_rangedspecialize_pistol, combat_rangedspecialize_heavy, combat_rangedspecialize_carbine
-- combat_meleespecialize_unarmed, combat_meleespecialize_twohand, combat_meleespecialize_polearm, combat_meleespecialize_onehand, combat_general,
-- combat_meleespecialize_twohandlightsaber, combat_meleespecialize_polearmlightsaber, jedi_general
xpType = "jedi_general",
-- See http://www.ocdsoft.com/files/certifications.xls
certificationsRequired = { "cert_onehandlightsaber_training" },
-- See http://www.ocdsoft.com/files/accuracy.xls
creatureAccuracyModifiers = { "onehandlightsaber_accuracy" },
-- See http://www.ocdsoft.com/files/defense.xls
defenderDefenseModifiers = { "melee_defense" },
-- Leave as "dodge" for now, may have additions later
defenderSecondaryDefenseModifiers = { "saber_block" },
-- See http://www.ocdsoft.com/files/speed.xls
speedModifiers = { "onehandlightsaber_speed" },
-- Leave blank for now
damageModifiers = { },
defenderToughnessModifiers = { "lightsaber_toughness" },
-- The values below are the default values. To be used for blue frog objects primarily
healthAttackCost = 20,
actionAttackCost = 35,
mindAttackCost = 40,
forceCost = 15,
pointBlankRange = 0,
pointBlankAccuracy = 20,
idealRange = 3,
idealAccuracy = 15,
maxRange = 5,
maxRangeAccuracy = 5,
minDamage = 50,
maxDamage = 130,
attackSpeed = 4.8,
defenderToughnessModifiers = { "lightsaber_toughness" },
childObjects = {
{templateFile = "object/tangible/inventory/lightsaber_inventory_training.iff", x = 0, z = 0, y = 0, ox = 0, oy = 0, oz = 0, ow = 0, cellid = -1, containmentType = 4}
},
numberExperimentalProperties = {1, 1, 2, 2, 2, 2, 2, 1, 1, 1},
experimentalProperties = {"XX", "XX", "CD", "OQ", "CD", "OQ", "CD", "OQ", "SR", "UT", "CD", "OQ", "OQ", "OQ", "OQ"},
experimentalWeights = {1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1},
experimentalGroupTitles = {"null", "null", "expDamage", "expDamage", "expDamage", "expDamage", "expEffeciency", "expEffeciency", "expEffeciency", "expEffeciency"},
experimentalSubGroupTitles = {"null", "null", "mindamage", "maxdamage", "attackspeed", "woundchance", "forcecost", "attackhealthcost", "attackactioncost", "attackmindcost"},
experimentalMin = {0, 0, 50, 130, 4.8, 2, 18, 20, 35, 40},
experimentalMax = {0, 0, 70, 170, 4.5, 10, 15, 15, 25, 25},
experimentalPrecision = {0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
experimentalCombineType = {0, 0, 1, 1, 1, 1, 1, 1, 1, 1},
}
ObjectTemplates:addTemplate(object_weapon_melee_sword_crafted_saber_sword_lightsaber_s9_training, "object/weapon/melee/sword/crafted_saber/sword_lightsaber_s9_training.iff")
| lgpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/object/tangible/ship/components/shield_generator/shd_sfs_limited_advanced.lua | 3 | 2352 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_tangible_ship_components_shield_generator_shd_sfs_limited_advanced = object_tangible_ship_components_shield_generator_shared_shd_sfs_limited_advanced:new {
}
ObjectTemplates:addTemplate(object_tangible_ship_components_shield_generator_shd_sfs_limited_advanced, "object/tangible/ship/components/shield_generator/shd_sfs_limited_advanced.iff")
| lgpl-3.0 |
ForbiddenJ/minetest_game | mods/xpanes/init.lua | 3 | 4717 |
local function is_pane(pos)
return minetest.get_item_group(minetest.get_node(pos).name, "pane") > 0
end
local function connects_dir(pos, name, dir)
local aside = vector.add(pos, minetest.facedir_to_dir(dir))
if is_pane(aside) then
return true
end
local connects_to = minetest.registered_nodes[name].connects_to
if not connects_to then
return false
end
local list = minetest.find_nodes_in_area(aside, aside, connects_to)
if #list > 0 then
return true
end
return false
end
local function swap(pos, node, name, param2)
if node.name == name and node.param2 == param2 then
return
end
minetest.set_node(pos, {name = name, param2 = param2})
end
local function update_pane(pos)
if not is_pane(pos) then
return
end
local node = minetest.get_node(pos)
local name = node.name
if name:sub(-5) == "_flat" then
name = name:sub(1, -6)
end
local any = node.param2
local c = {}
local count = 0
for dir = 0, 3 do
c[dir] = connects_dir(pos, name, dir)
if c[dir] then
any = dir
count = count + 1
end
end
if count == 0 then
swap(pos, node, name .. "_flat", any)
elseif count == 1 then
swap(pos, node, name .. "_flat", (any + 1) % 4)
elseif count == 2 then
if (c[0] and c[2]) or (c[1] and c[3]) then
swap(pos, node, name .. "_flat", (any + 1) % 4)
else
swap(pos, node, name, 0)
end
else
swap(pos, node, name, 0)
end
end
minetest.register_on_placenode(function(pos, node)
if minetest.get_item_group(node, "pane") then
update_pane(pos)
end
for i = 0, 3 do
local dir = minetest.facedir_to_dir(i)
update_pane(vector.add(pos, dir))
end
end)
minetest.register_on_dignode(function(pos)
for i = 0, 3 do
local dir = minetest.facedir_to_dir(i)
update_pane(vector.add(pos, dir))
end
end)
xpanes = {}
function xpanes.register_pane(name, def)
for i = 1, 15 do
minetest.register_alias("xpanes:" .. name .. "_" .. i, "xpanes:" .. name .. "_flat")
end
local flatgroups = table.copy(def.groups)
flatgroups.pane = 1
minetest.register_node(":xpanes:" .. name .. "_flat", {
description = def.description,
drawtype = "nodebox",
paramtype = "light",
is_ground_content = false,
sunlight_propagates = true,
inventory_image = def.inventory_image,
wield_image = def.wield_image,
paramtype2 = "facedir",
tiles = {def.textures[3], def.textures[3], def.textures[1]},
groups = flatgroups,
drop = "xpanes:" .. name .. "_flat",
sounds = def.sounds,
node_box = {
type = "fixed",
fixed = {{-1/2, -1/2, -1/32, 1/2, 1/2, 1/32}},
},
selection_box = {
type = "fixed",
fixed = {{-1/2, -1/2, -1/32, 1/2, 1/2, 1/32}},
},
connect_sides = { "left", "right" },
})
local groups = table.copy(def.groups)
groups.pane = 1
groups.not_in_creative_inventory = 1
minetest.register_node(":xpanes:" .. name, {
drawtype = "nodebox",
paramtype = "light",
is_ground_content = false,
sunlight_propagates = true,
description = def.description,
tiles = {def.textures[3], def.textures[3], def.textures[1]},
groups = groups,
drop = "xpanes:" .. name .. "_flat",
sounds = def.sounds,
node_box = {
type = "connected",
fixed = {{-1/32, -1/2, -1/32, 1/32, 1/2, 1/32}},
connect_front = {{-1/32, -1/2, -1/2, 1/32, 1/2, -1/32}},
connect_left = {{-1/2, -1/2, -1/32, -1/32, 1/2, 1/32}},
connect_back = {{-1/32, -1/2, 1/32, 1/32, 1/2, 1/2}},
connect_right = {{1/32, -1/2, -1/32, 1/2, 1/2, 1/32}},
},
connects_to = {"group:pane", "group:stone", "group:glass", "group:wood", "group:tree"},
})
minetest.register_craft({
output = "xpanes:" .. name .. "_flat 16",
recipe = def.recipe
})
end
xpanes.register_pane("pane", {
description = "Glass Pane",
textures = {"default_glass.png","xpanes_pane_half.png","xpanes_white.png"},
inventory_image = "default_glass.png",
wield_image = "default_glass.png",
sounds = default.node_sound_glass_defaults(),
groups = {snappy=2, cracky=3, oddly_breakable_by_hand=3},
recipe = {
{"default:glass", "default:glass", "default:glass"},
{"default:glass", "default:glass", "default:glass"}
}
})
xpanes.register_pane("bar", {
description = "Iron Bar",
textures = {"xpanes_bar.png","xpanes_bar.png","xpanes_bar_top.png"},
inventory_image = "xpanes_bar.png",
wield_image = "xpanes_bar.png",
groups = {cracky=2},
sounds = default.node_sound_metal_defaults(),
recipe = {
{"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
{"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"}
}
})
minetest.register_lbm({
name = "xpanes:gen2",
nodenames = {"group:pane"},
action = function(pos, node)
update_pane(pos)
for i = 0, 3 do
local dir = minetest.facedir_to_dir(i)
update_pane(vector.add(pos, dir))
end
end
})
| lgpl-2.1 |