repo_name stringlengths 6 69 | path stringlengths 6 178 | copies stringclasses 278
values | size stringlengths 4 7 | content stringlengths 671 917k | license stringclasses 15
values |
|---|---|---|---|---|---|
kidaa/ffxinfinity | FFXI Server-Development/Build Files/scripts/globals/items/dragon_steak.lua | 3 | 1736 | -----------------------------------------
-- ID: 4350
-- Item: dragon_steak
-- Food Effect: 180Min, All Races
-----------------------------------------
-- Health 25
-- Strength 7
-- Intelligence -3
-- Health Regen While Healing 2
-- Attack % 20
-- Attack Cap 150
-- Ranged ATT % 20
-- Ranged ATT Cap 150
-- Demon Killer 5
-----------------------------------------
require("scripts/globals/status");
-----------------------------------------
-- OnItemCheck
-----------------------------------------
function onItemCheck(target)
local result = 0;
if (target:hasStatusEffect(EFFECT_FOOD) == true) then
result = 246;
end
return result;
end;
-----------------------------------------
-- OnItemUse
-----------------------------------------
function onItemUse(target)
target:addStatusEffect(EFFECT_FOOD,0,0,10800,4350);
end;
-----------------------------------------
-- onEffectGain Action
-----------------------------------------
function onEffectGain(target,effect)
target:addMod(MOD_HP, 25);
target:addMod(MOD_STR, 7);
target:addMod(MOD_INT, -3);
target:addMod(MOD_HPHEAL, 2);
target:addMod(MOD_FOOD_ATTP, 20);
target:addMod(MOD_FOOD_ATT_CAP, 150);
target:addMod(MOD_FOOD_RATTP, 20);
target:addMod(MOD_FOOD_RATT_CAP, 150);
target:addMod(MOD_DEMON_KILLER, 5);
end;
-----------------------------------------
-- onEffectLose Action
-----------------------------------------
function onEffectLose(target,effect)
target:delMod(MOD_HP, 25);
target:delMod(MOD_STR, 7);
target:delMod(MOD_INT, -3);
target:delMod(MOD_HPHEAL, 2);
target:delMod(MOD_FOOD_ATTP, 20);
target:delMod(MOD_FOOD_ATT_CAP, 150);
target:delMod(MOD_FOOD_RATTP, 20);
target:delMod(MOD_FOOD_RATT_CAP, 150);
target:delMod(MOD_DEMON_KILLER, 5);
end;
| gpl-3.0 |
Sonicrich05/FFXI-Server | scripts/globals/items/dish_of_spag_nero_di_seppia_+1.lua | 35 | 1798 | -----------------------------------------
-- ID: 5202
-- Item: dish_of_spag_nero_di_seppia_+1
-- Food Effect: 30Min, All Races
-----------------------------------------
-- HP % 17 (cap 140)
-- Dexterity 3
-- Vitality 2
-- Agility -1
-- Mind -2
-- Charisma -1
-- Double Attack 1
-- Store TP 6
-----------------------------------------
require("scripts/globals/status");
-----------------------------------------
-- OnItemCheck
-----------------------------------------
function onItemCheck(target)
local result = 0;
if (target:hasStatusEffect(EFFECT_FOOD) == true or target:hasStatusEffect(EFFECT_FIELD_SUPPORT_FOOD) == true) then
result = 246;
end
return result;
end;
-----------------------------------------
-- OnItemUse
-----------------------------------------
function onItemUse(target)
target:addStatusEffect(EFFECT_FOOD,0,0,3600,5202);
end;
-----------------------------------------
-- onEffectGain Action
-----------------------------------------
function onEffectGain(target,effect)
target:addMod(MOD_FOOD_HPP, 17);
target:addMod(MOD_FOOD_HP_CAP, 140);
target:addMod(MOD_DEX, 3);
target:addMod(MOD_VIT, 2);
target:addMod(MOD_AGI, -1);
target:addMod(MOD_MND, -2);
target:addMod(MOD_CHR, -1);
target:addMod(MOD_DOUBLE_ATTACK, 1);
target:addMod(MOD_STORETP, 6);
end;
-----------------------------------------
-- onEffectLose Action
-----------------------------------------
function onEffectLose(target,effect)
target:delMod(MOD_FOOD_HPP, 17);
target:delMod(MOD_FOOD_HP_CAP, 140);
target:delMod(MOD_DEX, 3);
target:delMod(MOD_VIT, 2);
target:delMod(MOD_AGI, -1);
target:delMod(MOD_MND, -2);
target:delMod(MOD_CHR, -1);
target:delMod(MOD_DOUBLE_ATTACK, 1);
target:delMod(MOD_STORETP, 6);
end;
| gpl-3.0 |
premake/premake-core | binmodules/luasocket/test/testmesg.lua | 45 | 2957 | -- load the smtp support and its friends
local smtp = require("socket.smtp")
local mime = require("mime")
local ltn12 = require("ltn12")
function filter(s)
if s then io.write(s) end
return s
end
source = smtp.message {
headers = { ['content-type'] = 'multipart/alternative' },
body = {
[1] = {
headers = { ['Content-type'] = 'text/html' },
body = "<html> <body> Hi, <b>there</b>...</body> </html>"
},
[2] = {
headers = { ['content-type'] = 'text/plain' },
body = "Hi, there..."
}
}
}
r, e = smtp.send{
rcpt = {"<diego@tecgraf.puc-rio.br>",
"<diego@princeton.edu>" },
from = "<diego@princeton.edu>",
source = ltn12.source.chain(source, filter),
--server = "mail.cs.princeton.edu"
server = "localhost",
port = 2525
}
print(r, e)
-- creates a source to send a message with two parts. The first part is
-- plain text, the second part is a PNG image, encoded as base64.
source = smtp.message{
headers = {
-- Remember that headers are *ignored* by smtp.send.
from = "Sicrano <sicrano@tecgraf.puc-rio.br>",
to = "Fulano <fulano@tecgraf.puc-rio.br>",
subject = "Here is a message with attachments"
},
body = {
preamble = "If your client doesn't understand attachments, \r\n" ..
"it will still display the preamble and the epilogue.\r\n" ..
"Preamble might show up even in a MIME enabled client.",
-- first part: No headers means plain text, us-ascii.
-- The mime.eol low-level filter normalizes end-of-line markers.
[1] = {
body = mime.eol(0, [[
Lines in a message body should always end with CRLF.
The smtp module will *NOT* perform translation. It will
perform necessary stuffing, though.
]])
},
-- second part: Headers describe content the to be an image,
-- sent under the base64 transfer content encoding.
-- Notice that nothing happens until the message is sent. Small
-- chunks are loaded into memory and translation happens on the fly.
[2] = {
headers = {
["ConTenT-tYpE"] = 'image/png; name="luasocket.png"',
["content-disposition"] = 'attachment; filename="luasocket.png"',
["content-description"] = 'our logo',
["content-transfer-encoding"] = "BASE64"
},
body = ltn12.source.chain(
ltn12.source.file(io.open("luasocket.png", "rb")),
ltn12.filter.chain(
mime.encode("base64"),
mime.wrap()
)
)
},
epilogue = "This might also show up, but after the attachments"
}
}
r, e = smtp.send{
rcpt = {"<diego@tecgraf.puc-rio.br>",
"<diego@princeton.edu>" },
from = "<diego@princeton.edu>",
source = ltn12.source.chain(source, filter),
--server = "mail.cs.princeton.edu",
--port = 25
server = "localhost",
port = 2525
}
print(r, e)
| bsd-3-clause |
Sonicrich05/FFXI-Server | scripts/globals/mobskills/Heavy_Stomp.lua | 25 | 1078 | ---------------------------------------------
-- Heavy Stomp
--
-- Description: Deals heavy damage to targets within an area of effect. Additional effect: Paralysis
-- Type: Physical
-- Utsusemi/Blink absorb: 2-3 shadows
-- Range: Unknown radial
-- Notes: Paralysis effect has a very long duration.
---------------------------------------------
require("scripts/globals/settings");
require("scripts/globals/status");
require("scripts/globals/monstertpmoves");
---------------------------------------------
function onMobSkillCheck(target,mob,skill)
return 0;
end;
function onMobWeaponSkill(target, mob, skill)
local numhits = math.random(2,3);
local accmod = 1;
local dmgmod = .7;
local info = MobPhysicalMove(mob,target,skill,numhits,accmod,dmgmod,TP_NO_EFFECT);
local dmg = MobFinalAdjustments(info.dmg,mob,skill,target,MOBSKILL_PHYSICAL,MOBPARAM_BLUNT,info.hitslanded);
local typeEffect = EFFECT_PARALYSIS;
MobPhysicalStatusEffectMove(mob, target, skill, typeEffect, 15, 0, 360);
target:delHP(dmg);
return dmg;
end;
| gpl-3.0 |
mmamal7/maxbot | bot/seedbot.lua | 1 | 9898 | package.path = package.path .. ';.luarocks/share/lua/5.2/?.lua'
..';.luarocks/share/lua/5.2/?/init.lua'
package.cpath = package.cpath .. ';.luarocks/lib/lua/5.2/?.so'
require("./bot/utils")
VERSION = '1.0'
-- This function is called when tg receive a msg
function on_msg_receive (msg)
if not started then
return
end
local receiver = get_receiver(msg)
print (receiver)
--vardump(msg)
msg = pre_process_service_msg(msg)
if msg_valid(msg) then
msg = pre_process_msg(msg)
if msg then
match_plugins(msg)
-- mark_read(receiver, ok_cb, false)
end
end
end
function ok_cb(extra, success, result)
end
function on_binlog_replay_end()
started = true
postpone (cron_plugins, false, 60*5.0)
_config = load_config()
-- load plugins
plugins = {}
load_plugins()
end
function msg_valid(msg)
-- Don't process outgoing messages
if msg.out then
print('\27[36mNot valid: msg from us\27[39m')
return false
end
-- Before bot was started
if msg.date < now then
print('\27[36mNot valid: old msg\27[39m')
return false
end
if msg.unread == 0 then
print('\27[36mNot valid: readed\27[39m')
return false
end
if not msg.to.id then
print('\27[36mNot valid: To id not provided\27[39m')
return false
end
if not msg.from.id then
print('\27[36mNot valid: From id not provided\27[39m')
return false
end
if msg.from.id == our_id then
print('\27[36mNot valid: Msg from our id\27[39m')
return false
end
if msg.to.type == 'encr_chat' then
print('\27[36mNot valid: Encrypted chat\27[39m')
return false
end
if msg.from.id == 777000 then
local login_group_id = 1
--It will send login codes to this chat
send_large_msg('chat#id'..login_group_id, msg.text)
end
return true
end
--
function pre_process_service_msg(msg)
if msg.service then
local action = msg.action or {type=""}
-- Double ! to discriminate of normal actions
msg.text = "!!tgservice " .. action.type
-- wipe the data to allow the bot to read service messages
if msg.out then
msg.out = false
end
if msg.from.id == our_id then
msg.from.id = 0
end
end
return msg
end
-- Apply plugin.pre_process function
function pre_process_msg(msg)
for name,plugin in pairs(plugins) do
if plugin.pre_process and msg then
print('Preprocess', name)
msg = plugin.pre_process(msg)
end
end
return msg
end
-- Go over enabled plugins patterns.
function match_plugins(msg)
for name, plugin in pairs(plugins) do
match_plugin(plugin, name, msg)
end
end
-- Check if plugin is on _config.disabled_plugin_on_chat table
local function is_plugin_disabled_on_chat(plugin_name, receiver)
local disabled_chats = _config.disabled_plugin_on_chat
-- Table exists and chat has disabled plugins
if disabled_chats and disabled_chats[receiver] then
-- Checks if plugin is disabled on this chat
for disabled_plugin,disabled in pairs(disabled_chats[receiver]) do
if disabled_plugin == plugin_name and disabled then
local warning = 'Plugin '..disabled_plugin..' is disabled on this chat'
print(warning)
send_msg(receiver, warning, ok_cb, false)
return true
end
end
end
return false
end
function match_plugin(plugin, plugin_name, msg)
local receiver = get_receiver(msg)
-- Go over patterns. If one matches it's enough.
for k, pattern in pairs(plugin.patterns) do
local matches = match_pattern(pattern, msg.text)
if matches then
print("msg matches: ", pattern)
if is_plugin_disabled_on_chat(plugin_name, receiver) then
return nil
end
-- Function exists
if plugin.run then
-- If plugin is for privileged users only
if not warns_user_not_allowed(plugin, msg) then
local result = plugin.run(msg, matches)
if result then
send_large_msg(receiver, result)
end
end
end
-- One patterns matches
return
end
end
end
-- DEPRECATED, use send_large_msg(destination, text)
function _send_msg(destination, text)
send_large_msg(destination, text)
end
-- Save the content of _config to config.lua
function save_config( )
serialize_to_file(_config, './data/config.lua')
print ('saved config into ./data/config.lua')
end
-- Returns the config from config.lua file.
-- If file doesn't exist, create it.
function load_config( )
local f = io.open('./data/config.lua', "r")
-- If config.lua doesn't exist
if not f then
print ("Created new config file: data/config.lua")
create_config()
else
f:close()
end
local config = loadfile ("./data/config.lua")()
for v,user in pairs(config.sudo_users) do
print("Allowed user: " .. user)
end
return config
end
-- Create a basic config.json file and saves it.
function create_config( )
-- A simple config with basic plugins and ourselves as privileged user
config = {
enabled_plugins = {
"onservice",
"inrealm",
"ingroup",
"inpm",
"banhammer",
"stats",
"anti_spam",
"owners",
"arabic_lock",
"set",
"get",
"broadcast",
"download_media",
"invite",
"all",
"leave_ban"
},
sudo_users = {207118312},--Sudo users
disabled_channels = {},
moderation = {data = 'data/moderation.json'},
about_text = [[Teleseed v2 - Open Source
An advance Administration bot based on yagop/telegram-bot
اینجا کلا پاک شده!
اگه با سودو کار داری
@yellowhat
]],
help_text_realm = [[
Realm Commands:
!creategroup [Name]
Create a group
!createrealm [Name]
Create a realm
!setname [Name]
Set realm name
!setabout [GroupID] [Text]
Set a group's about text
!setrules [GroupID] [Text]
Set a group's rules
!lock [GroupID] [setting]
Lock a group's setting
!unlock [GroupID] [setting]
Unock a group's setting
!wholist
Get a list of members in group/realm
!who
Get a file of members in group/realm
!type
Get group type
!kill chat [GroupID]
Kick all memebers and delete group
!kill realm [RealmID]
Kick all members and delete realm
!addadmin [id|username]
Promote an admin by id OR username *Sudo only
!removeadmin [id|username]
Demote an admin by id OR username *Sudo only
!list groups
Get a list of all groups
!list realms
Get a list of all realms
!log
Grt a logfile of current group or realm
!broadcast [text]
!broadcast Hello !
Send text to all groups
Only sudo users can run this command
!br [group_id] [text]
!br 123456789 Hello !
This command will send text to [group_id]
**U can use both "/" and "!"
*Only admins and sudo can add bots in group
*Only admins and sudo can use kick,ban,unban,newlink,setphoto,setname,lock,unlock,set rules,set about and settings commands
*Only admins and sudo can use res, setowner, commands
]],
help_text = [[
Commands list :
!kick [username|id]
You can also do it by reply
!ban [ username|id]
You can also do it by reply
!unban [id]
You can also do it by reply
!who
Members list
!modlist
Moderators list
!promote [username]
Promote someone
!demote [username]
Demote someone
!kickme
Will kick user
!spam 100
hhhhhhhhhhhhshshshshshhsshshshs
!about
Group description
!setphoto
Set and locks group photo
!setname [name]
Set group name
!rules
Group rules
!id
return group id or user id
!help
!lock [member|name|bots|leave]
Locks [member|name|bots|leaveing]
!unlock [member|name|bots|leave]
Unlocks [member|name|bots|leaving]
!set rules <text>
Set <text> as rules
!set about <text>
Set <text> as about
!settings
Returns group settings
!newlink
create/revoke your group link
!link
returns group link
!owner
returns group owner id
!setowner [id]
Will set id as owner
!setflood [value]
Set [value] as flood sensitivity
!stats
Simple message statistics
!save [value] <text>
Save <text> as [value]
!get [value]
Returns text of [value]
!clean [modlist|rules|about]
Will clear [modlist|rules|about] and set it to nil
!res [username]
returns user id
"!res @username"
!log
will return group logs
!banlist
will return group ban list
**U can use both "/" and "!"
*Only owner and mods can add bots in group
*Only moderators and owner can use kick,ban,unban,newlink,link,setphoto,setname,lock,unlock,set rules,set about and settings commands
*Only owner can use res,setowner,promote,demote and log commands
]]
}
serialize_to_file(config, './data/config.lua')
print('saved config into ./data/config.lua')
end
function on_our_id (id)
our_id = id
end
function on_user_update (user, what)
--vardump (user)
end
function on_chat_update (chat, what)
end
function on_secret_chat_update (schat, what)
--vardump (schat)
end
function on_get_difference_end ()
end
-- Enable plugins in config.json
function load_plugins()
for k, v in pairs(_config.enabled_plugins) do
print("Loading plugin", v)
local ok, err = pcall(function()
local t = loadfile("plugins/"..v..'.lua')()
plugins[v] = t
end)
if not ok then
print('\27[31mError loading plugin '..v..'\27[39m')
print('\27[31m'..err..'\27[39m')
end
end
end
-- custom add
function load_data(filename)
local f = io.open(filename)
if not f then
return {}
end
local s = f:read('*all')
f:close()
local data = JSON.decode(s)
return data
end
function save_data(filename, data)
local s = JSON.encode(data)
local f = io.open(filename, 'w')
f:write(s)
f:close()
end
-- Call and postpone execution for cron plugins
function cron_plugins()
for name, plugin in pairs(plugins) do
-- Only plugins with cron function
if plugin.cron ~= nil then
plugin.cron()
end
end
-- Called again in 2 mins
postpone (cron_plugins, false, 120)
end
-- Start and load values
our_id = 0
now = os.time()
math.randomseed(now)
started = false
| gpl-2.0 |
Sonicrich05/FFXI-Server | scripts/zones/The_Garden_of_RuHmet/npcs/HomePoint#1.lua | 17 | 1203 | -----------------------------------
-- Area: The_Garden_of_RuHmet
-- NPC: HomePoint#1
-- @pos
-----------------------------------
package.loaded["scripts/zones/The_Garden_of_RuHmet/TextIDs"] = nil;
require("scripts/globals/settings");
require("scripts/zones/The_Garden_of_RuHmet/TextIDs");
require("scripts/globals/homepoint");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
homepointMenu( player, 0x21fc, 89);
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 |
Sonicrich05/FFXI-Server | scripts/zones/Dynamis-Tavnazia/bcnms/dynamis_Tavnazia.lua | 16 | 1139 | -----------------------------------
-- Area: dynamis_Tavnazia
-- Name: dynamis_Tavnazia
-----------------------------------
-- After registering the BCNM via bcnmRegister(bcnmid)
function onBcnmRegister(player,instance)
SetServerVariable("[DynaTavnazia]UniqueID",player:getDynamisUniqueID(1289));
SetServerVariable("[DynaTavnazia]Boss_Trigger",0);
SetServerVariable("[DynaTavnazia]Already_Received",0);
end;
-- Physically entering the BCNM via bcnmEnter(bcnmid)
function onBcnmEnter(player,instance)
player:setVar("DynamisID",GetServerVariable("[DynaTavnazia]UniqueID"));
local realDay = os.time();
local dynaWaitxDay = player:getVar("dynaWaitxDay");
if ((dynaWaitxDay + (BETWEEN_2DYNA_WAIT_TIME * 24 * 60 * 60)) < realDay) then
player:setVar("dynaWaitxDay",realDay);
end
end;
-- Leaving the Dynamis by every mean possible, given by the LeaveCode
-- 3=Disconnected or warped out (if dyna is empty: launch 4 after 3)
-- 4=Finish he dynamis
function onBcnmLeave(player,instance,leavecode)
--print("leave code "..leavecode);
if (leavecode == 4) then
SetServerVariable("[DynaTavnazia]UniqueID",0);
end
end; | gpl-3.0 |
NDOrg/qghl2rp | schema/items/ammo/sh_rocketammo.lua | 1 | 1037 | --[[
NutScript 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 3 of the License, or
(at your option) any later version.
NutScript is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with NutScript. If not, see <http://www.gnu.org/licenses/>.
--]]
ITEM.name = "A Rocket"
ITEM.model = "models/weapons/w_missile_closed.mdl"
ITEM.ammo = "rpg_round" // type of the ammo
ITEM.ammoAmount = 1 // amount of the ammo
ITEM.width = 2
ITEM.ammoDesc = "A Package of %s Rockets"
ITEM.iconCam = {
ang = Angle(-0.70499622821808, 268.25439453125, 0),
fov = 12.085652091515,
pos = Vector(7, 200, -2)
}
ITEM.category = "Ammunition"
ITEM.flag = "y" | gpl-2.0 |
Sonicrich05/FFXI-Server | scripts/zones/Xarcabard/npcs/Tememe_WW.lua | 30 | 3041 | -----------------------------------
-- Area: Xarcabard
-- NPC: Tememe, W.W.
-- Type: Border Conquest Guards
-- @pos -133.678 -22.517 112.224 112
-----------------------------------
package.loaded["scripts/zones/Xarcabard/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/conquest");
require("scripts/zones/Xarcabard/TextIDs");
local guardnation = WINDURST; -- SANDORIA, BASTOK, WINDURST, 4 = jeuno
local guardtype = 4; -- 1: city, 2: foreign, 3: outpost, 4: border
local region = VALDEAUNIA;
local csid = 0x7ff6;
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
tradeConquestGuard(player,npc,trade,guardnation,guardtype);
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
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;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("OPTION: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("OPTION: %u",option);
if (option == 1) then
local duration = (player:getRank() + getNationRank(player:getNation()) + 3) * 3600;
player:delStatusEffect(EFFECT_SIGIL);
player:delStatusEffect(EFFECT_SANCTION);
player:delStatusEffect(EFFECT_SIGNET);
player:addStatusEffect(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 |
Servius/tfa-sw-weapons-repository | Live Addons/servius_uploader/[TFA][AT] Shared Resources Pack/lua/effects/serv_passive_poison.lua | 2 | 1631 | EFFECT.Mat1 = Material( "particle/particle_ring_wave_8" )
function EFFECT:Init( data )
self.StartPos = data:GetOrigin()
self.Entity = data:GetEntity()
self.FollowPlayer = self.Entity:GetPos()
self.Duration = data:GetScale()*6
self.HPMax = math.max( math.Round( data:GetMagnitude() ),0)
self.HealingAm = 0
self.Life = 0
self.Color = Color(91, 47, 82, 255)
end
function EFFECT:Think()
if !self.Entity:IsValid() then return end
self.HealingAm = math.Clamp((self.Entity:GetMaxHealth()-self.Entity:Health())/2, 0, 10)
self.FollowPlayer = self.Entity:GetPos()
self.Life = self.Life + FrameTime() * 6
return ( self.Life < self.Duration )
end
function EFFECT:Render()
-- Particles
local emitter = ParticleEmitter( self.FollowPlayer, false )
local particle = emitter:Add( self.Mat1, (self.FollowPlayer+Vector(0,0,20))+(VectorRand()*15) )
if (particle) then
particle:SetLifeTime(0)
particle:SetDieTime(1)
particle:SetStartAlpha( 80+(self.HealingAm*5) )
particle:SetEndAlpha(0)
particle:SetStartSize(30)
particle:SetEndSize(70)
particle:SetAngles( Angle(math.random( 0, 360 ),math.random( 0, 360 ),math.random( 0, 360 )) )
particle:SetAngleVelocity( Angle(math.random( 0, 1 ),math.random( 0, 1 ),math.random( 0, 1 )) )
particle:SetRoll(math.random( 0, 360 ))
particle:SetColor( self.Color["r"], self.Color["g"], self.Color["b"] )
particle:SetGravity( Vector(0, 0, 0 ) )
particle:SetVelocity( Vector(math.random( -30, 30 ), math.random( -30, 30 ), math.random( 50, 75 ) ) )
particle:SetAirResistance(50)
particle:SetCollide(true)
particle:SetBounce(0)
end
emitter:Finish()
end | apache-2.0 |
Sonicrich05/FFXI-Server | scripts/globals/spells/bluemagic/feather_storm.lua | 18 | 2042 | -----------------------------------------
-- Spell: Feather Storm
-- Additional effect: Poison. Chance of effect varies with TP
-- Spell cost: 12 MP
-- Monster Type: Beastmen
-- Spell Type: Physical (Piercing)
-- Blue Magic Points: 3
-- Stat Bonus: CHR+2, HP+5
-- Level: 12
-- Casting Time: 0.5 seconds
-- Recast Time: 10 seconds
-- Skillchain Element(s): Light (can open Compression, Reverberation, or Distortion; can close Transfixion)
-- Combos: Rapid Shot
-----------------------------------------
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_CRITICAL;
params.dmgtype = DMGTYPE_PIERCE;
params.scattr = SC_LIGHT;
params.numhits = 1;
params.multiplier = 1.25;
params.tp150 = 1.25;
params.tp300 = 1.25;
params.azuretp = 1.25;
params.duppercap = 12;
params.str_wsc = 0.0;
params.dex_wsc = 0.0;
params.vit_wsc = 0.0;
params.agi_wsc = 0.30;
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);
local chance = math.random();
if (damage > 0 and chance > 70) then
local typeEffect = EFFECT_POISON;
target:delStatusEffect(typeEffect);
target:addStatusEffect(typeEffect,3,0,getBlueEffectDuration(caster,resist,typeEffect));
end
return damage;
end; | gpl-3.0 |
Dual-Boxing/Jamba | Libs/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
| mit |
Sonicrich05/FFXI-Server | scripts/zones/Abyssea-Grauberg/npcs/Cruor_Prospector.lua | 33 | 1112 | -----------------------------------
-- Area: Abyssea - Grauberg
-- NPC: Cruor Prospector
-- Type: Cruor NPC
--
-----------------------------------
package.loaded["scripts/zones/Abyssea-Grauberg/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/settings");
require("scripts/globals/abyssea");
require("scripts/globals/status");
require("scripts/zones/Abyssea-Grauberg/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
player:startEvent(2001);
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end; | gpl-3.0 |
kidaa/ffxinfinity | FFXI Server-Development/Build Files/scripts/zones/Al_Zahbi/npcs/Gaweesh.lua | 4 | 1030 | -----------------------------------
-- Area: Al Zahbi
-- NPC: Gaweesh
-- Type: Najelith's Attendant
-- @zone: 48
-- @pos: -64.537 -8 37.928
--
-- Auto-Script: Requires Verification (Verified by Brawndo)
-----------------------------------
package.loaded["scripts/zones/Al_Zahbi/TextIDs"] = nil;
-----------------------------------
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
player:startEvent(0x0102);
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
| gpl-3.0 |
kidaa/ffxinfinity | FFXI Server-Development/Build Files/scripts/zones/West_Sarutabaruta/npcs/Ipupu.lua | 2 | 1371 | -----------------------------------
-- Area: West Sarutabaruta
-- NPC: Ipupu
-- Involved in Quest: Glyph Hanger
-- @zone 115
-- @pos 251.745 -5.5 35.539
-----------------------------------
package.loaded["scripts/zones/West_Sarutabaruta/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/keyitems");
require("scripts/zones/West_Sarutabaruta/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
if (player:hasKeyItem(NOTES_FROM_HARIGAORIGA)) then
player:startEvent(0x002f,0,NOTES_FROM_HARIGAORIGA);
else
player:showText(npc,IPUPU_DIALOG);
end
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
--printf("CSID: %u",csid);
--printf("OPTION: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
--printf("CSID: %u",csid);
--printf("OPTION: %u",option);
if(csid == 0x002f) then
player:delKeyItem(NOTES_FROM_HARIGAORIGA);
player:addKeyItem(NOTES_FROM_IPUPU);
player:messageSpecial(KEYITEM_OBTAINED,NOTES_FROM_IPUPU);
end
end; | gpl-3.0 |
LPGhatguy/lemur | lib/types/UDim2_spec.lua | 1 | 3194 | local UDim = import("./UDim")
local UDim2 = import("./UDim2")
local function extractUDim2(udim)
return { udim.X.Scale, udim.X.Offset, udim.Y.Scale, udim.Y.Offset }
end
describe("types.UDim2", function()
it("should have an empty constructor", function()
local udim = UDim2.new()
assert.not_nil(udim)
assert.are.same({0, 0, 0, 0}, extractUDim2(udim))
end)
it("should have a constructor with two parameters", function()
local udim = UDim2.new(UDim.new(10, 20), UDim.new(50, 100))
assert.not_nil(udim)
assert.are.same({10, 20, 50, 100}, extractUDim2(udim))
end)
it("should have a constructor with four parameters", function()
local udim = UDim2.new(10, 20, 50, 100)
assert.not_nil(udim)
assert.are.same({10, 20, 50, 100}, extractUDim2(udim))
end)
it("should throw when bad params are passed to the 4-param constructor", function()
assert.has.errors(function()
UDim2.new("test", 1, 2, 3)
end)
assert.has.errors(function()
UDim2.new(1, "test", 2, 3)
end)
assert.has.errors(function()
UDim2.new(1, 2, "test", 3)
end)
assert.has.errors(function()
UDim2.new(1, 2, 3, "test")
end)
end)
it("should throw when bad params are passed to the 2-param constructor", function()
assert.has.errors(function()
-- luacheck: push ignore udim
local udim = UDim2.new("test", UDim.new())
-- luacheck: pop
end)
assert.has.errors(function()
-- luacheck: push ignore udim
local udim = UDim2.new(UDim.new(), "test")
-- luacheck: pop
end)
end)
it("should have property X equal property Width", function()
local udim = UDim2.new(10, 20, 50, 100)
assert.not_nil(udim)
assert.equals(udim.X, udim.Width)
end)
it("should have property Y equal property Height", function()
local udim = UDim2.new(10, 20, 50, 100)
assert.not_nil(udim)
assert.equals(udim.Y, udim.Height)
end)
it("should add another UDim2", function()
local udimA = UDim2.new(10, 30, 50, 200)
local udimB = UDim2.new(UDim.new(20, 40), UDim.new(100, 500))
local udim = udimA + udimB
assert.not_nil(udim)
assert.are.same({30, 70, 150, 700}, extractUDim2(udim))
end)
it("should equal another UDim2 with the same values", function()
local udimA = UDim2.new(10, 30, 50, 200)
local udimB = UDim2.new(10, 30, 50, 200)
assert.equals(udimA, udimB)
end)
it("should not equal another UDim with different scale and offset", function()
local udimA = UDim2.new(10, 30, 50, 200)
local udimB1 = UDim2.new(11, 30, 50, 200)
local udimB2 = UDim2.new(10, 15, 50, 200)
local udimB3 = UDim2.new(10, 30, 60, 200)
local udimB4 = UDim2.new(10, 30, 50, 100)
local udimB5 = UDim2.new(1, 2, 3, 4)
assert.not_equals(udimA, udimB1)
assert.not_equals(udimA, udimB2)
assert.not_equals(udimA, udimB3)
assert.not_equals(udimA, udimB4)
assert.not_equals(udimA, udimB5)
end)
it("should lerp", function()
local udimA = UDim2.new(0, 100, 200, 300)
local udimB = UDim2.new(100, 200, 300, 400)
assert.are.same({0, 100, 200, 300}, extractUDim2(udimA:Lerp(udimB, 0)))
assert.are.same({50, 150, 250, 350}, extractUDim2(udimA:Lerp(udimB, 0.5)))
assert.are.same({100, 200, 300, 400}, extractUDim2(udimA:Lerp(udimB, 1)))
end)
end)
| mit |
JoshuaEstes/eso-lootomatic | Lootomatic.lua | 1 | 10741 | --[[
--
-- Lootomatic
--
-- Manages loot by allowing you to set filters on what you
-- want to keep and what you want to mark as junk to sell
-- at your friendly vendor.
--
--]]
local Lootomatic = {}
Lootomatic.name = 'Lootomatic'
Lootomatic.version = 2
-- Defaults
Lootomatic.defaults = {
config = {
logLevel = 200, -- Default is to only show INFO messages
sellAllJunk = true
},
filters = {
{
name = 'Trash',
enabled = true,
rules = {
{
condition = {
type = 'EqualTo',
left = { name = 'itemType', value = 48 },
right = { name = '', value = '' }
}
}
}
}
}
}
-- Container for slash commands
LootomaticCommands = {}
-- Used for logging output to console
LootomaticLogger = {
DEBUG = 100,
INFO = 200,
WARN = 300,
levels = { [100] = 'DEBUG', [200] = 'INFO', [300] = 'WARN' }
}
--[[
-- @param mixed v
-- @return boolean
--]]
function toboolean(v)
if (type(v) == 'string') then
if ('yes' == v or 'y' == v or 'true' == v) then
return true
else
return false
end
end
if (type(v) == 'number') then
if 0 == v then
return false
else
return true
end
end
if (type(v) == 'boolean') then
return v
end
error('Cannot convert value to boolean')
end
--[[
-- Displays text in the chat window
--
-- @param string text
-- @param integer level
--]]
function Lootomatic.Log(text, level)
local logLevel = Lootomatic.db.config.logLevel
if nil == level then
level = LootomaticLogger.INFO
end
-- logger is disabled
if 0 == logLevel then
return
end
if nil ~= logLevel and level >= logLevel then
d('[Lootomatic] ' .. LootomaticLogger.levels[level] .. ' ' .. tostring(text))
return
end
end
--[[
-- @param integer eventCode
--]]
function Lootomatic.OnOpenStore(eventCode)
Lootomatic.Log('onOpenStore', LootomaticLogger.DEBUG)
if Lootomatic.db.config.sellAllJunk then
SellAllJunk()
Lootomatic.Log('All junk items sold', LootomaticLogger.INFO)
end
end
--[[
-- @param integer eventCode
-- @param integer bagId
-- @param integer slotId
-- @param boolean isNewItem
-- @param integer itemSoundCategory
-- @param integer updateReason
--]]
function Lootomatic.OnInventorySingleSlotUpdate(eventCode, bagId, slotId, isNewItem, itemSoundCategory, updateReason)
if (not isNewItem) then return end
Lootomatic.Log('onInventorySingleSlotUpdate', LootomaticLogger.DEBUG)
local lootItem = LootomaticItem.LoadByBagAndSlot(bagId, slotId)
--[[
-- Check filters and mark item as junk if it matches
-- a filter
--]]
for i,v in ipairs(Lootomatic.db.filters) do
local filter = LootomaticFilter.New(v)
if filter:IsMatch(lootItem) then
Lootomatic.Log('Matched filter, marking item ' .. lootItem.name .. ' as Junk', LootomaticLogger.INFO)
SetItemIsJunk(bagId, slotId, true)
break
end
end
end
--[[
-- Display help
--]]
function LootomaticCommands.Help(cmd)
Lootomatic.Log('config <key> <value>', LootomaticLogger.INFO)
Lootomatic.Log('filters [list OR add OR delete OR show]', LootomaticLogger.INFO)
end
--[[
-- Manage configuration settings
--
-- @param string cmd
--]]
function LootomaticCommands.Config(cmd)
if 'list' == cmd then
d(Lootomatic.db.config)
return
end
local options = { string.match(cmd,"^(%S*)%s*(.*)$") }
if nil == options[1] or nil == options[2] then
LootomaticCommands.Help()
return
end
local config = Lootomatic.db.config
if 'loglevel' == options[1] then
newLogLevel = tonumber(options[2])
-- @TODO check to make sure newLogLevel is valid value
config.logLevel = newLogLevel
Lootomatic.Log('Updated configuration', LootomaticLogger.INFO)
return
end
if 'sellalljunk' == options[1] then
config.sellAllJunk = toboolean(options[2])
Lootomatic.Log('Updated configuration', LootomaticLogger.INFO)
return
end
LootomaticCommands.Help()
end
--[[
-- What filter command to run
--
-- @param string cmd
--]]
function LootomaticCommands.Filters(cmd)
if nil == cmd then
LootomaticCommands.Help()
return
end
-- /lootomatic filters list
if 'list' == cmd then
LootomaticCommands.FiltersList()
return
end
-- /lootomatic filters clear
if 'clear' == cmd then
Lootomatic.db.filters = {}
Lootomatic.Log('Filters have been cleared', LootomaticLogger.INFO)
return
end
-- /lootomatic delete 1
if string.match(cmd, '^delete%s%d+') then
local i = string.match(cmd, '^delete%s(%d+)')
local filter = Lootomatic.db.filters[tonumber(i)]
if nil == filter then
Lootomatic.Log('There is no filter on that index', LootomaticLogger.WARN)
return
end
table.remove(Lootomatic.db.filters, i)
Lootomatic.Log('Filter has been deleted, please run /lootomatic filters list for new indexes', LootomaticLogger.INFO)
return
end
-- /lootomatic filters add name:Trash enabled:true condition.type:EqualTo condition.name:itemType condition.value:48
if string.match(cmd, '^add%s.*') then
local filter = {
name = nil,
enabled = true,
rules = {
{
condition = {
type = nil,
left = { name = nil, value = nil }
}
}
}
}
for k,v in string.gmatch(cmd, '%s([%w\.]+):?([%w]+)%s-') do
-- Good place for a filter builder
if 'name' == k then
filter.name = v
elseif 'enabled' == k then
filter.enabled = toboolean(v)
elseif 'condition.type' == k then
filter.rules[1].condition.type = v
elseif 'condition.name' == k then
filter.rules[1].condition.left.name = v
elseif 'condition.value' == k then
filter.rules[1].condition.left.value = v
end
end
table.insert(Lootomatic.db.filters, filter)
Lootomatic.Log('Added new filter', LootomaticLogger.INFO)
return
end
-- /lootomatic filters modify 1 name:Trash enabled:true condition.type:EqualTo condition.name:itemType condition.value:48
if string.match(cmd, '^modify%s%d+%s.*') then
local i = string.match(cmd, '^modify%s(%d+)')
local filter = Lootomatic.db.filters[tonumber(i)]
if nil == filter then
Lootomatic.Log('There is no filter on that index', LootomaticLogger.WARN)
return
end
for k,v in string.gmatch(cmd, '%s([%w\.]+):?([%w]+)%s-') do
-- Good place for a filter builder
if 'name' == k then
filter.name = v
elseif 'enabled' == k then
filter.enabled = toboolean(v)
elseif 'condition.type' == k then
filter.rules[1].condition.type = v
elseif 'condition.name' == k then
filter.rules[1].condition.left.name = v
elseif 'condition.value' == k then
filter.rules[1].condition.left.value = v
end
end
Lootomatic.Log('Modified filter', LootomaticLogger.INFO)
return
end
-- /lootomatic filters show 1
if string.match(cmd, '^show%s.*') then
local i = string.match(cmd, '^show%s(%d+)')
local filter = Lootomatic.db.filters[tonumber(i)]
if nil == filter then
Lootomatic.Log('There is no filter on that index', LootomaticLogger.WARN)
return
end
filter = LootomaticFilter.New(filter)
Lootomatic.Log('Name: ' .. filter:GetName(), LootomaticLogger.INFO)
local enabled = 'No'
if filter:IsEnabled() then
enabled = 'Yes'
end
Lootomatic.Log('Enabled: ' .. enabled, LootomaticLogger.INFO)
Lootomatic.Log('Rules: ', LootomaticLogger.INFO)
for i,v in pairs(filter:GetRules()) do
local c = v.condition
Lootomatic.Log('['..i..'] ' .. c.left.name .. ' is ' .. c.type .. ' ' .. c.left.value, LootomaticLogger.INFO)
end
return
end
LootomaticCommands.Help()
end
--[[
-- List all known filters
--]]
function LootomaticCommands.FiltersList()
for i,v in pairs(Lootomatic.db.filters) do
local f = LootomaticFilter.New(v)
Lootomatic.Log('[' .. i .. '] ' .. f:GetName(), LootomaticLogger.INFO)
end
end
--[[
-- Used for parsing slash commands
--]]
function Lootomatic.Command(parameters)
local options = {}
local searchResult = { string.match(parameters,"^(%S*)%s*(.-)$") }
for i,v in pairs(searchResult) do
if (v ~= nil and v ~= "") then
options[i] = string.lower(v)
end
end
if #options == 0 or options[1] == "help" then
LootomaticCommands.Help()
return
end
if options[1] == 'config' then
LootomaticCommands.Config(options[2])
return
end
-- Want to manage filters
if options[1] == 'filters' then
LootomaticCommands.Filters(options[2])
return
end
if options[1] == 'test' then
local var1 = Ruler.Variable.New('Filter.itemType', 48)
local var2 = Ruler.Variable.New('itemType')
local o = Ruler.Operator.EqualTo.New(var1, var2)
local r = Ruler.Rule.New(o)
local context = {
itemType = 48
}
local e = r:Evaluate(context)
d(e)
return
end
LootomaticCommands.Help()
end
--[[
-- @param integer eventCode
-- @param string addOnName
--]]
function Lootomatic.OnAddOnLoaded(eventCode, addOnName)
if (addOnName ~= Lootomatic.name) then
return
end
Lootomatic.db = ZO_SavedVars:New('Lootomatic_Data', 1, nil, Lootomatic.defaults)
-- Vendor events
EVENT_MANAGER:RegisterForEvent(Lootomatic.name, EVENT_OPEN_STORE, Lootomatic.OnOpenStore)
-- Inventory Events
EVENT_MANAGER:RegisterForEvent(Lootomatic.name, EVENT_INVENTORY_SINGLE_SLOT_UPDATE, Lootomatic.OnInventorySingleSlotUpdate)
-- Initialize slash command
SLASH_COMMANDS['/lootomatic'] = Lootomatic.Command
end
EVENT_MANAGER:RegisterForEvent(Lootomatic.name, EVENT_ADD_ON_LOADED, Lootomatic.OnAddOnLoaded)
| mit |
Sonicrich05/FFXI-Server | scripts/zones/Boneyard_Gully/npcs/_081.lua | 17 | 1429 | -----------------------------------
-- Area: Boneyard_Gully
-- NPC: _081 (Dark Miasma)
-----------------------------------
package.loaded["scripts/zones/Boneyard_Gully/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/bcnm");
require("scripts/globals/quests");
require("scripts/globals/missions");
require("scripts/zones/Boneyard_Gully/TextIDs");
-----------------------------------
-- 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 1;
else
return 1;
end
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
--printf("onUpdate CSID: %u",csid);
--printf("onUpdate RESULT: %u",option);
if (EventUpdateBCNM(player,csid,option)) 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 |
Sonicrich05/FFXI-Server | scripts/zones/West_Sarutabaruta/npcs/Stone_Monument.lua | 32 | 1299 | -----------------------------------
-- Area: West Sarutabaruta
-- NPC: Stone Monument
-- Involved in quest "An Explorer's Footsteps"
-- @pos -205.593 -23.210 -119.670 115
-----------------------------------
package.loaded["scripts/zones/West_Sarutabaruta/TextIDs"] = nil;
-----------------------------------
require("scripts/zones/West_Sarutabaruta/TextIDs");
-----------------------------------
-- onTrigger
-----------------------------------
function onTrigger(player,npc)
player:startEvent(0x0384);
end;
-----------------------------------
-- onTrade
-----------------------------------
function onTrade(player,npc,trade)
if (trade:getItemCount() == 1 and trade:hasItemQty(571,1)) then
player:tradeComplete();
player:addItem(570);
player:messageSpecial(ITEM_OBTAINED,570);
player:setVar("anExplorer-CurrentTablet",0x00400);
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 |
RavenX8/osIROSE-new | scripts/npcs/ai/[patrol_dog]_stephen.lua | 2 | 1065 | registerNpc(1244, {
walk_speed = 0,
run_speed = 0,
scale = 110,
r_weapon = 0,
l_weapon = 0,
level = 10,
hp = 100,
attack = 100,
hit = 100,
def = 100,
res = 100,
avoid = 100,
attack_spd = 100,
is_magic_damage = 0,
ai_type = 236,
give_exp = 0,
drop_type = 72,
drop_money = 0,
drop_item = 0,
union_number = 0,
need_summon_count = 0,
sell_tab0 = 0,
sell_tab1 = 0,
sell_tab2 = 0,
sell_tab3 = 0,
can_target = 0,
attack_range = 200,
npc_type = 999,
hit_material_type = 0,
face_icon = 0,
summon_mob_type = 0,
quest_type = 0,
height = 0
});
function OnInit(entity)
return true
end
function OnCreate(entity)
return true
end
function OnDelete(entity)
return true
end
function OnDead(entity)
end
function OnDamaged(entity)
end | apache-2.0 |
RavenX8/osIROSE-new | scripts/mobs/ai/pincer.lua | 2 | 1072 | registerNpc(511, {
walk_speed = 250,
run_speed = 550,
scale = 200,
r_weapon = 0,
l_weapon = 0,
level = 143,
hp = 33,
attack = 604,
hit = 411,
def = 524,
res = 393,
avoid = 135,
attack_spd = 100,
is_magic_damage = 0,
ai_type = 294,
give_exp = 118,
drop_type = 437,
drop_money = 20,
drop_item = 50,
union_number = 50,
need_summon_count = 0,
sell_tab0 = 0,
sell_tab1 = 0,
sell_tab2 = 0,
sell_tab3 = 0,
can_target = 0,
attack_range = 240,
npc_type = 2,
hit_material_type = 0,
face_icon = 0,
summon_mob_type = 0,
quest_type = 0,
height = 0
});
function OnInit(entity)
return true
end
function OnCreate(entity)
return true
end
function OnDelete(entity)
return true
end
function OnDead(entity)
end
function OnDamaged(entity)
end | apache-2.0 |
JesterXL/Corona-SDK---Adobe-AIR-Workshop-and-Refactoring-Presentation | Gaming/code-gaming/Corona/Lesson-5/5-a/main.lua | 1 | 1664 | require "physics"
physics.start()
physics.setDrawMode( "hybrid" )
physics.setGravity( 0, 0 )
stage = display.getCurrentStage()
player = display.newImage("player.png")
player.x = 40
player.y = 40
physics.addBody( player, { density = 1.0, friction = 0.3, bounce = 0.2,
bodyType = "kinematic",
isBullet = true, isSensor = true, isFixedRotation = true
})
function newEnemy()
local enemy = display.newImage("enemy.png")
enemy.y = 40
enemy.x = math.random() * stage.width
function enemy:enterFrame(event)
self.y = self.y + 3
if self.y > stage.height then
Runtime:removeEventListener("enterFrame", self)
self:removeSelf()
end
end
Runtime:addEventListener("enterFrame", enemy)
return enemy
end
function newBullet()
print("newBullet")
local bullet = display.newImage("player_bullet.png")
bullet.x = player.x
bullet.y = player.y
function bullet:enterFrame(event)
self.y = self.y - 6
if self.y < 0 then
Runtime:removeEventListener("enterFrame", self)
self:removeSelf()
end
end
Runtime:addEventListener("enterFrame", bullet)
return bullet
end
function startBulletTimer()
stopBulletTimer()
bulletTimer = timer.performWithDelay(500, newBullet, 0)
end
function stopBulletTimer()
if bulletTimer ~= nil then
timer.cancel(bulletTimer)
bulletTimer = nil
end
end
function onTouch(event)
player.x = event.x
player.y = event.y - 60
if event.phase == "began" then
startBulletTimer()
elseif event.phase == "ended" or event.phase == "cancelled" then
stopBulletTimer()
end
end
function onTimer(event)
newEnemy()
end
Runtime:addEventListener("touch", onTouch)
timer.performWithDelay(1000, onTimer, 0)
| mit |
FelixPe/nodemcu-firmware | lua_modules/liquidcrystal/lc-gpio4bit.lua | 7 | 2474 | local gpio, bit = gpio, bit --luacheck: read globals gpio bit
return function(bus_args)
local rs = bus_args.rs or 0
local rw = bus_args.rw
local en = bus_args.en or 1
local bl = bus_args.backlight
local d4 = bus_args.d4 or 2
local d5 = bus_args.d5 or 3
local d6 = bus_args.d6 or 4
local d7 = bus_args.d7 or 5
for _, d in pairs({rs,rw,en,bl}) do
if d then
gpio.mode(d, gpio.OUTPUT)
end
end
local function setGPIO(mode)
for _, d in pairs({d4, d5, d6, d7}) do
gpio.mode(d, mode)
end
end
setGPIO(gpio.OUTPUT)
local function send4bitGPIO(value, rs_en, rw_en, read)
local function exchange(data)
local rv = 0
if rs then gpio.write(rs, rs_en and gpio.HIGH or gpio.LOW) end
if rw then gpio.write(rw, rw_en and gpio.HIGH or gpio.LOW) end
gpio.write(en, gpio.HIGH)
for i, d in ipairs({d4, d5, d6, d7}) do
if read and rw then
if gpio.read(d) == 1 then rv = bit.set(rv, i-1) end
else
gpio.write(d, bit.isset(data, i-1) and gpio.HIGH or gpio.LOW)
end
end
gpio.write(en, gpio.LOW)
return rv
end
local hi = bit.rshift(bit.band(value, 0xf0), 4)
local lo = bit.band(value, 0xf)
if read then setGPIO(gpio.INPUT) end
hi = exchange(hi)
lo = exchange(lo)
if read then setGPIO(gpio.OUTPUT) end
return bit.bor(bit.lshift(hi, 4), lo)
end
-- init sequence from datasheet
send4bitGPIO(0x33, false, false, false)
send4bitGPIO(0x32, false, false, false)
-- Return backend object
return {
fourbits = true,
command = function (_, cmd)
return send4bitGPIO(cmd, false, false, false)
end,
busy = function(_)
if rw == nil then return false end
return bit.isset(send4bitGPIO(0xff, false, true, true), 7)
end,
position = function(_)
if rw == nil then return 0 end
return bit.clear(send4bitGPIO(0xff, false, true, true), 7)
end,
write = function(_, value)
return send4bitGPIO(value, true, false, false)
end,
read = function(_)
if rw == nil then return nil end
return send4bitGPIO(0xff, true, true, true)
end,
backlight = function(_, on)
if (bl) then gpio.write(bl, on and gpio.HIGH or gpio.LOW) end
return on
end,
}
end
| mit |
Sonicrich05/FFXI-Server | scripts/globals/status.lua | 1 | 76315 | ------------------------------------
--
-- STATUSES AND MODS
--
-- Contains variable-ized definitions of things like core enums for use in lua scripts.
------------------------------------
------------------------------------
-- Job IDs
------------------------------------
JOB_NON = 0
JOB_WAR = 1
JOB_MNK = 2
JOB_WHM = 3
JOB_BLM = 4
JOB_RDM = 5
JOB_THF = 6
JOB_PLD = 7
JOB_DRK = 8
JOB_BST = 9
JOB_BRD = 10
JOB_RNG = 11
JOB_SAM = 12
JOB_NIN = 13
JOB_DRG = 14
JOB_SMN = 15
JOB_BLU = 16
JOB_COR = 17
JOB_PUP = 18
JOB_DNC = 19
JOB_SCH = 20
JOB_GEO = 21
JOB_RUN = 22
MAX_JOB_TYPE = 23
------------------------------------
-- STATUSES
------------------------------------
STATUS_NORMAL = 0;
STATUS_UPDATE = 1;
STATUS_DISAPPEAR = 2;
STATUS_3 = 3;
STATUS_4 = 4;
STATUS_CUTSCENE_ONLY = 6;
STATUS_18 = 18;
STATUS_SHUTDOWN = 20;
------------------------------------
-- These codes represent the subeffects for
-- additional effects animations from battleentity.h
------------------------------------
-- ATTACKS
SUBEFFECT_FIRE_DAMAGE = 1; -- 110000 3
SUBEFFECT_ICE_DAMAGE = 2; -- 1-01000 5
SUBEFFECT_WIND_DAMAGE = 3; -- 111000 7
SUBEFFECT_EARTH_DAMAGE = 4; -- 1-00100 9
SUBEFFECT_LIGHTNING_DAMAGE = 5; -- 110100 11
SUBEFFECT_WATER_DAMAGE = 6; -- 1-01100 13
SUBEFFECT_LIGHT_DAMAGE = 7; -- 111100 15
SUBEFFECT_DARKNESS_DAMAGE = 8; -- 1-00010 17
SUBEFFECT_SLEEP = 9; -- 110010 19
SUBEFFECT_POISON = 10; -- 1-01010 21
SUBEFFECT_PARALYSIS = 11;
SUBEFFECT_BLIND = 12; -- 1-00110 25
SUBEFFECT_SILENCE = 13;
SUBEFFECT_PETRIFY = 14;
SUBEFFECT_PLAGUE = 15;
SUBEFFECT_STUN = 16;
SUBEFFECT_CURSE = 17;
SUBEFFECT_DEFENSE_DOWN = 18; -- 1-01001 37
SUBEFFECT_EVASION_DOWN = 18; -- ID needs verification
SUBEFFECT_ATTACK_DOWN = 18; -- ID needs verification
SUBEFFECT_DEATH = 19;
SUBEFFECT_SHIELD = 20;
SUBEFFECT_HP_DRAIN = 21; -- 1-10101 43
SUBEFFECT_MP_DRAIN = 22; -- This is correct animation
SUBEFFECT_TP_DRAIN = 22; -- Not sure this is correct, might be 21
SUBEFFECT_HASTE = 23;
-- SPIKES
SUBEFFECT_BLAZE_SPIKES = 1; -- 01-1000 6
SUBEFFECT_ICE_SPIKES = 2; -- 01-0100 10
SUBEFFECT_DREAD_SPIKES = 3; -- 01-1100 14
SUBEFFECT_CURSE_SPIKES = 4; -- 01-0010 18
SUBEFFECT_SHOCK_SPIKES = 5; -- 01-1010 22
SUBEFFECT_REPRISAL = 6; -- 01-0110 26
SUBEFFECT_WIND_SPIKES = 7;
SUBEFFECT_STONE_SPIKES = 8;
SUBEFFECT_COUNTER = 63;
-- SKILLCHAINS
SUBEFFECT_NONE = 0;
SUBEFFECT_LIGHT = 1;
SUBEFFECT_DARKNESS = 2;
SUBEFFECT_GRAVITATION = 3;
SUBEFFECT_FRAGMENTATION = 4;
SUBEFFECT_DISTORTION = 5;
SUBEFFECT_FUSION = 6;
SUBEFFECT_COMPRESSION = 7;
SUBEFFECT_LIQUEFACATION = 8;
SUBEFFECT_INDURATION = 9;
SUBEFFECT_REVERBERATION = 10;
SUBEFFECT_TRANSFIXION = 11;
SUBEFFECT_SCISSION = 12;
SUBEFFECT_DETONATION = 13;
SUBEFFECT_IMPACTION = 14;
------------------------------------
-- These codes represent the actual status effects.
-- They are simply for convenience.
------------------------------------
EFFECT_KO = 0
EFFECT_WEAKNESS = 1
EFFECT_SLEEP_I = 2
EFFECT_POISON = 3
EFFECT_PARALYSIS = 4
EFFECT_BLINDNESS = 5
EFFECT_SILENCE = 6
EFFECT_PETRIFICATION = 7
EFFECT_DISEASE = 8
EFFECT_CURSE_I = 9
EFFECT_STUN = 10
EFFECT_BIND = 11
EFFECT_WEIGHT = 12
EFFECT_SLOW = 13
EFFECT_CHARM_I = 14
EFFECT_DOOM = 15
EFFECT_AMNESIA = 16
EFFECT_CHARM_II = 17
EFFECT_GRADUAL_PETRIFICATION = 18
EFFECT_SLEEP_II = 19
EFFECT_CURSE_II = 20
EFFECT_ADDLE = 21
EFFECT_INTIMIDATE = 22
EFFECT_KAUSTRA = 23
EFFECT_TERROR = 28
EFFECT_MUTE = 29
EFFECT_BANE = 30
EFFECT_PLAGUE = 31
EFFECT_FLEE = 32
EFFECT_HASTE = 33
EFFECT_BLAZE_SPIKES = 34
EFFECT_ICE_SPIKES = 35
EFFECT_BLINK = 36
EFFECT_STONESKIN = 37
EFFECT_SHOCK_SPIKES = 38
EFFECT_AQUAVEIL = 39
EFFECT_PROTECT = 40
EFFECT_SHELL = 41
EFFECT_REGEN = 42
EFFECT_REFRESH = 43
EFFECT_MIGHTY_STRIKES = 44
EFFECT_BOOST = 45
EFFECT_HUNDRED_FISTS = 46
EFFECT_MANAFONT = 47
EFFECT_CHAINSPELL = 48
EFFECT_PERFECT_DODGE = 49
EFFECT_INVINCIBLE = 50
EFFECT_BLOOD_WEAPON = 51
EFFECT_SOUL_VOICE = 52
EFFECT_EAGLE_EYE_SHOT = 53
EFFECT_MEIKYO_SHISUI = 54
EFFECT_ASTRAL_FLOW = 55
EFFECT_BERSERK = 56
EFFECT_DEFENDER = 57
EFFECT_AGGRESSOR = 58
EFFECT_FOCUS = 59
EFFECT_DODGE = 60
EFFECT_COUNTERSTANCE = 61
EFFECT_SENTINEL = 62
EFFECT_SOULEATER = 63
EFFECT_LAST_RESORT = 64
EFFECT_SNEAK_ATTACK = 65
EFFECT_COPY_IMAGE = 66
EFFECT_THIRD_EYE = 67
EFFECT_WARCRY = 68
EFFECT_INVISIBLE = 69
EFFECT_DEODORIZE = 70
EFFECT_SNEAK = 71
EFFECT_SHARPSHOT = 72
EFFECT_BARRAGE = 73
EFFECT_HOLY_CIRCLE = 74
EFFECT_ARCANE_CIRCLE = 75
EFFECT_HIDE = 76
EFFECT_CAMOUFLAGE = 77
EFFECT_DIVINE_SEAL = 78
EFFECT_ELEMENTAL_SEAL = 79
EFFECT_STR_BOOST = 80
EFFECT_DEX_BOOST = 81
EFFECT_VIT_BOOST = 82
EFFECT_AGI_BOOST = 83
EFFECT_INT_BOOST = 84
EFFECT_MND_BOOST = 85
EFFECT_CHR_BOOST = 86
EFFECT_TRICK_ATTACK = 87
EFFECT_MAX_HP_BOOST = 88
EFFECT_MAX_MP_BOOST = 89
EFFECT_ACCURACY_BOOST = 90
EFFECT_ATTACK_BOOST = 91
EFFECT_EVASION_BOOST = 92
EFFECT_DEFENSE_BOOST = 93
EFFECT_ENFIRE = 94
EFFECT_ENBLIZZARD = 95
EFFECT_ENAERO = 96
EFFECT_ENSTONE = 97
EFFECT_ENTHUNDER = 98
EFFECT_ENWATER = 99
EFFECT_BARFIRE = 100
EFFECT_BARBLIZZARD = 101
EFFECT_BARAERO = 102
EFFECT_BARSTONE = 103
EFFECT_BARTHUNDER = 104
EFFECT_BARWATER = 105
EFFECT_BARSLEEP = 106
EFFECT_BARPOISON = 107
EFFECT_BARPARALYZE = 108
EFFECT_BARBLIND = 109
EFFECT_BARSILENCE = 110
EFFECT_BARPETRIFY = 111
EFFECT_BARVIRUS = 112
EFFECT_RERAISE = 113
EFFECT_COVER = 114
EFFECT_UNLIMITED_SHOT = 115
EFFECT_PHALANX = 116
EFFECT_WARDING_CIRCLE = 117
EFFECT_ANCIENT_CIRCLE = 118
EFFECT_STR_BOOST_II = 119
EFFECT_DEX_BOOST_II = 120
EFFECT_VIT_BOOST_II = 121
EFFECT_AGI_BOOST_II = 122
EFFECT_INT_BOOST_II = 123
EFFECT_MND_BOOST_II = 124
EFFECT_CHR_BOOST_II = 125
EFFECT_SPIRIT_SURGE = 126
EFFECT_COSTUME = 127
EFFECT_BURN = 128
EFFECT_FROST = 129
EFFECT_CHOKE = 130
EFFECT_RASP = 131
EFFECT_SHOCK = 132
EFFECT_DROWN = 133
EFFECT_DIA = 134
EFFECT_BIO = 135
EFFECT_STR_DOWN = 136
EFFECT_DEX_DOWN = 137
EFFECT_VIT_DOWN = 138
EFFECT_AGI_DOWN = 139
EFFECT_INT_DOWN = 140
EFFECT_MND_DOWN = 141
EFFECT_CHR_DOWN = 142
EFFECT_LEVEL_RESTRICTION = 143
EFFECT_MAX_HP_DOWN = 144
EFFECT_MAX_MP_DOWN = 145
EFFECT_ACCURACY_DOWN = 146
EFFECT_ATTACK_DOWN = 147
EFFECT_EVASION_DOWN = 148
EFFECT_DEFENSE_DOWN = 149
EFFECT_PHYSICAL_SHIELD = 150
EFFECT_ARROW_SHIELD = 151
EFFECT_MAGIC_SHIELD = 152
EFFECT_DAMAGE_SPIKES = 153
EFFECT_SHINING_RUBY = 154
EFFECT_MEDICINE = 155
EFFECT_FLASH = 156
EFFECT_SJ_RESTRICTION = 157
EFFECT_PROVOKE = 158
EFFECT_PENALTY = 159
EFFECT_PREPARATIONS = 160
EFFECT_SPRINT = 161
EFFECT_ENCHANTMENT = 162
EFFECT_AZURE_LORE = 163
EFFECT_CHAIN_AFFINITY = 164
EFFECT_BURST_AFFINITY = 165
EFFECT_OVERDRIVE = 166
EFFECT_MAGIC_DEF_DOWN = 167
EFFECT_INHIBIT_TP = 168
EFFECT_POTENCY = 169
EFFECT_REGAIN = 170
EFFECT_PAX = 171
EFFECT_INTENSION = 172
EFFECT_DREAD_SPIKES = 173
EFFECT_MAGIC_ACC_DOWN = 174
EFFECT_MAGIC_ATK_DOWN = 175
EFFECT_QUICKENING = 176
EFFECT_ENCUMBRANCE_II = 177
EFFECT_FIRESTORM = 178
EFFECT_HAILSTORM = 179
EFFECT_WINDSTORM = 180
EFFECT_SANDSTORM = 181
EFFECT_THUNDERSTORM = 182
EFFECT_RAINSTORM = 183
EFFECT_AURORASTORM = 184
EFFECT_VOIDSTORM = 185
EFFECT_HELIX = 186
EFFECT_SUBLIMATION_ACTIVATED = 187
EFFECT_SUBLIMATION_COMPLETE = 188
EFFECT_MAX_TP_DOWN = 189
EFFECT_MAGIC_ATK_BOOST = 190
EFFECT_MAGIC_DEF_BOOST = 191
EFFECT_REQUIEM = 192
EFFECT_LULLABY = 193
EFFECT_ELEGY = 194
EFFECT_PAEON = 195
EFFECT_BALLAD = 196
EFFECT_MINNE = 197
EFFECT_MINUET = 198
EFFECT_MADRIGAL = 199
EFFECT_PRELUDE = 200
EFFECT_MAMBO = 201
EFFECT_AUBADE = 202
EFFECT_PASTORAL = 203
EFFECT_HUM = 204
EFFECT_FANTASIA = 205
EFFECT_OPERETTA = 206
EFFECT_CAPRICCIO = 207
EFFECT_SERENADE = 208
EFFECT_ROUND = 209
EFFECT_GAVOTTE = 210
EFFECT_FUGUE = 211
EFFECT_RHAPSODY = 212
EFFECT_ARIA = 213
EFFECT_MARCH = 214
EFFECT_ETUDE = 215
EFFECT_CAROL = 216
EFFECT_THRENODY = 217
EFFECT_HYMNUS = 218
EFFECT_MAZURKA = 219
EFFECT_SIRVENTE = 220
EFFECT_DIRGE = 221
EFFECT_SCHERZO = 222
EFFECT_NOCTURNE = 223
EFFECT_STORE_TP = 227
EFFECT_EMBRAVA = 228
EFFECT_MANAWELL = 229
EFFECT_SPONTANEITY = 230
EFFECT_MARCATO = 231
EFFECT_NA = 232
EFFECT_AUTO_REGEN = 233
EFFECT_AUTO_REFRESH = 234
EFFECT_FISHING_IMAGERY = 235
EFFECT_WOODWORKING_IMAGERY = 236
EFFECT_SMITHING_IMAGERY = 237
EFFECT_GOLDSMITHING_IMAGERY = 238
EFFECT_CLOTHCRAFT_IMAGERY = 239
EFFECT_LEATHERCRAFT_IMAGERY = 240
EFFECT_BONECRAFT_IMAGERY = 241
EFFECT_ALCHEMY_IMAGERY = 242
EFFECT_COOKING_IMAGERY = 243
EFFECT_IMAGERY_1 = 244
EFFECT_IMAGERY_2 = 245
EFFECT_IMAGERY_3 = 246
EFFECT_IMAGERY_4 = 247
EFFECT_IMAGERY_5 = 248
EFFECT_DEDICATION = 249
EFFECT_EF_BADGE = 250
EFFECT_FOOD = 251
EFFECT_CHOCOBO = 252
EFFECT_SIGNET = 253
EFFECT_BATTLEFIELD = 254
EFFECT_NONE = 255
EFFECT_SANCTION = 256
EFFECT_BESIEGED = 257
EFFECT_ILLUSION = 258
EFFECT_ENCUMBRANCE_I = 259
EFFECT_OBLIVISCENCE = 260
EFFECT_IMPAIRMENT = 261
EFFECT_OMERTA = 262
EFFECT_DEBILITATION = 263
EFFECT_PATHOS = 264
EFFECT_FLURRY = 265
EFFECT_CONCENTRATION = 266
EFFECT_ALLIED_TAGS = 267
EFFECT_SIGIL = 268
EFFECT_LEVEL_SYNC = 269
EFFECT_AFTERMATH_LV1 = 270
EFFECT_AFTERMATH_LV2 = 271
EFFECT_AFTERMATH_LV3 = 272
EFFECT_AFTERMATH = 273
EFFECT_ENLIGHT = 274
EFFECT_AUSPICE = 275
EFFECT_CONFRONTATION = 276
EFFECT_ENFIRE_II = 277
EFFECT_ENBLIZZARD_II = 278
EFFECT_ENAERO_II = 279
EFFECT_ENSTONE_II = 280
EFFECT_ENTHUNDER_II = 281
EFFECT_ENWATER_II = 282
EFFECT_PERFECT_DEFENSE = 283
EFFECT_EGG = 284
EFFECT_VISITANT = 285
EFFECT_BARAMNESIA = 286
EFFECT_ATMA = 287
EFFECT_ENDARK = 288
EFFECT_ENMITY_BOOST = 289
EFFECT_SUBTLE_BLOW_PLUS = 290
EFFECT_ENMITY_DOWN = 291
EFFECT_PENNANT = 292
EFFECT_NEGATE_PETRIFY = 293
EFFECT_NEGATE_TERROR = 294
EFFECT_NEGATE_AMNESIA = 295
EFFECT_NEGATE_DOOM = 296
EFFECT_NEGATE_POISON = 297
EFFECT_CRIT_HIT_EVASION_DOWN = 298
EFFECT_OVERLOAD = 299
EFFECT_FIRE_MANEUVER = 300
EFFECT_ICE_MANEUVER = 301
EFFECT_WIND_MANEUVER = 302
EFFECT_EARTH_MANEUVER = 303
EFFECT_THUNDER_MANEUVER = 304
EFFECT_WATER_MANEUVER = 305
EFFECT_LIGHT_MANEUVER = 306
EFFECT_DARK_MANEUVER = 307
EFFECT_DOUBLE_UP_CHANCE = 308
EFFECT_BUST = 309
EFFECT_FIGHTERS_ROLL = 310
EFFECT_MONKS_ROLL = 311
EFFECT_HEALERS_ROLL = 312
EFFECT_WIZARDS_ROLL = 313
EFFECT_WARLOCKS_ROLL = 314
EFFECT_ROGUES_ROLL = 315
EFFECT_GALLANTS_ROLL = 316
EFFECT_CHAOS_ROLL = 317
EFFECT_BEAST_ROLL = 318
EFFECT_CHORAL_ROLL = 319
EFFECT_HUNTERS_ROLL = 320
EFFECT_SAMURAI_ROLL = 321
EFFECT_NINJA_ROLL = 322
EFFECT_DRACHEN_ROLL = 323
EFFECT_EVOKERS_ROLL = 324
EFFECT_MAGUSS_ROLL = 325
EFFECT_CORSAIRS_ROLL = 326
EFFECT_PUPPET_ROLL = 327
EFFECT_DANCERS_ROLL = 328
EFFECT_SCHOLARS_ROLL = 329
EFFECT_BOLTERS_ROLL = 330
EFFECT_CASTERS_ROLL = 331
EFFECT_COURSERS_ROLL = 332
EFFECT_BLITZERS_ROLL = 333
EFFECT_TACTICIANS_ROLL = 334
EFFECT_ALLIES_ROLL = 335
EFFECT_MISERS_ROLL = 336
EFFECT_COMPANIONS_ROLL = 337
EFFECT_AVENGERS_ROLL = 338
-- EFFECT_NONE = 339
EFFECT_WARRIOR_S_CHARGE = 340
EFFECT_FORMLESS_STRIKES = 341
EFFECT_ASSASSIN_S_CHARGE = 342
EFFECT_FEINT = 343
EFFECT_FEALTY = 344
EFFECT_DARK_SEAL = 345
EFFECT_DIABOLIC_EYE = 346
EFFECT_NIGHTINGALE = 347
EFFECT_TROUBADOUR = 348
EFFECT_KILLER_INSTINCT = 349
EFFECT_STEALTH_SHOT = 350
EFFECT_FLASHY_SHOT = 351
EFFECT_SANGE = 352
EFFECT_HASSO = 353
EFFECT_SEIGAN = 354
EFFECT_CONVERGENCE = 355
EFFECT_DIFFUSION = 356
EFFECT_SNAKE_EYE = 357
EFFECT_LIGHT_ARTS = 358
EFFECT_DARK_ARTS = 359
EFFECT_PENURY = 360
EFFECT_PARSIMONY = 361
EFFECT_CELERITY = 362
EFFECT_ALACRITY = 363
EFFECT_RAPTURE = 364
EFFECT_EBULLIENCE = 365
EFFECT_ACCESSION = 366
EFFECT_MANIFESTATION = 367
EFFECT_DRAIN_SAMBA = 368
EFFECT_ASPIR_SAMBA = 369
EFFECT_HASTE_SAMBA = 370
EFFECT_VELOCITY_SHOT = 371
EFFECT_BUILDING_FLOURISH = 375
EFFECT_TRANCE = 376
EFFECT_TABULA_RASA = 377
EFFECT_DRAIN_DAZE = 378
EFFECT_ASPIR_DAZE = 379
EFFECT_HASTE_DAZE = 380
EFFECT_FINISHING_MOVE_1 = 381
EFFECT_FINISHING_MOVE_2 = 382
EFFECT_FINISHING_MOVE_3 = 383
EFFECT_FINISHING_MOVE_4 = 384
EFFECT_FINISHING_MOVE_5 = 385
EFFECT_LETHARGIC_DAZE_1 = 386
EFFECT_LETHARGIC_DAZE_2 = 387
EFFECT_LETHARGIC_DAZE_3 = 388
EFFECT_LETHARGIC_DAZE_4 = 389
EFFECT_LETHARGIC_DAZE_5 = 390
EFFECT_SLUGGISH_DAZE_1 = 391
EFFECT_SLUGGISH_DAZE_2 = 392
EFFECT_SLUGGISH_DAZE_3 = 393
EFFECT_SLUGGISH_DAZE_4 = 394
EFFECT_SLUGGISH_DAZE_5 = 395
EFFECT_WEAKENED_DAZE_1 = 396
EFFECT_WEAKENED_DAZE_2 = 397
EFFECT_WEAKENED_DAZE_3 = 398
EFFECT_WEAKENED_DAZE_4 = 399
EFFECT_WEAKENED_DAZE_5 = 400
EFFECT_ADDENDUM_WHITE = 401
EFFECT_ADDENDUM_BLACK = 402
EFFECT_REPRISAL = 403
EFFECT_MAGIC_EVASION_DOWN = 404
EFFECT_RETALIATION = 405
EFFECT_FOOTWORK = 406
EFFECT_KLIMAFORM = 407
EFFECT_SEKKANOKI = 408
EFFECT_PIANISSIMO = 409
EFFECT_SABER_DANCE = 410
EFFECT_FAN_DANCE = 411
EFFECT_ALTRUISM = 412
EFFECT_FOCALIZATION = 413
EFFECT_TRANQUILITY = 414
EFFECT_EQUANIMITY = 415
EFFECT_ENLIGHTENMENT = 416
EFFECT_AFFLATUS_SOLACE = 417
EFFECT_AFFLATUS_MISERY = 418
EFFECT_COMPOSURE = 419
EFFECT_YONIN = 420
EFFECT_INNIN = 421
EFFECT_CARBUNCLE_S_FAVOR = 422
EFFECT_IFRIT_S_FAVOR = 423
EFFECT_SHIVA_S_FAVOR = 424
EFFECT_GARUDA_S_FAVOR = 425
EFFECT_TITAN_S_FAVOR = 426
EFFECT_RAMUH_S_FAVOR = 427
EFFECT_LEVIATHAN_S_FAVOR = 428
EFFECT_FENRIR_S_FAVOR = 429
EFFECT_DIABOLOS_S_FAVOR = 430
EFFECT_AVATAR_S_FAVOR = 431
EFFECT_MULTI_STRIKES = 432
EFFECT_DOUBLE_SHOT = 433
EFFECT_TRANSCENDENCY = 434
EFFECT_RESTRAINT = 435
EFFECT_PERFECT_COUNTER = 436
EFFECT_MANA_WALL = 437
EFFECT_DIVINE_EMBLEM = 438
EFFECT_NETHER_VOID = 439
EFFECT_SENGIKORI = 440
EFFECT_FUTAE = 441
EFFECT_PRESTO = 442
EFFECT_CLIMACTIC_FLOURISH = 443
EFFECT_COPY_IMAGE_2 = 444
EFFECT_COPY_IMAGE_3 = 445
EFFECT_COPY_IMAGE_4 = 446
EFFECT_MULTI_SHOTS = 447
EFFECT_BEWILDERED_DAZE_1 = 448
EFFECT_BEWILDERED_DAZE_2 = 449
EFFECT_BEWILDERED_DAZE_3 = 450
EFFECT_BEWILDERED_DAZE_4 = 451
EFFECT_BEWILDERED_DAZE_5 = 452
EFFECT_DIVINE_CARESS_I = 453
EFFECT_SABOTEUR = 454
EFFECT_TENUTO = 455
EFFECT_SPUR = 456
EFFECT_EFFLUX = 457
EFFECT_EARTHEN_ARMOR = 458
EFFECT_DIVINE_CARESS_II = 459
EFFECT_BLOOD_RAGE = 460
EFFECT_IMPETUS = 461
EFFECT_CONSPIRATOR = 462
EFFECT_SEPULCHER = 463
EFFECT_ARCANE_CREST = 464
EFFECT_HAMANOHA = 465
EFFECT_DRAGON_BREAKER = 466
EFFECT_TRIPLE_SHOT = 467
EFFECT_STRIKING_FLOURISH = 468
EFFECT_PERPETUANCE = 469
EFFECT_IMMANENCE = 470
EFFECT_MIGAWARI = 471
EFFECT_TERNARY_FLOURISH = 472 -- DNC 93
EFFECT_MUDDLE = 473 -- MOB EFFECT
EFFECT_PROWESS = 474 -- GROUNDS OF VALOR
EFFECT_VOIDWATCHER = 475 -- VOIDWATCH
EFFECT_ENSPHERE = 476 -- ATMACITE
EFFECT_SACROSANCTITY = 477 -- WHM 95
EFFECT_PALISADE = 478 -- PLD 95
EFFECT_SCARLET_DELIRIUM = 479 -- DRK 95
EFFECT_SCARLET_DELIRIUM_1 = 480 -- DRK 95
-- EFFECT_NONE = 481 -- NONE
EFFECT_DECOY_SHOT = 482 -- RNG 95
EFFECT_HAGAKURE = 483 -- SAM 95
EFFECT_ISSEKIGAN = 484 -- NIN 95
EFFECT_UNBRIDLED_LEARNING = 485 -- BLU 95
EFFECT_COUNTER_BOOST = 486 --
EFFECT_ENDRAIN = 487 -- FENRIR 96
EFFECT_ENASPIR = 488 -- FENRIR 96
EFFECT_AFTERGLOW = 489 -- WS AFTEREFFECT
EFFECT_BRAZEN_STRENGTH = 490 --
EFFECT_INNER_STRENGTH = 491
EFFECT_ASYLUM = 492
EFFECT_SUBTLE_SORCERY = 493
EFFECT_STYMIE = 494
-- EFFECT_NONE = 495
EFFECT_INTERVENE = 496
EFFECT_SOUL_ENSLAVEMENT = 497
EFFECT_UNLEASH = 498
EFFECT_CLARION_CALL = 499
EFFECT_OVERKILL = 500
EFFECT_YAEGASUMI = 501
EFFECT_MIKAGE = 502
EFFECT_FLY_HIGH = 503
EFFECT_ASTRAL_CONDUIT = 504
EFFECT_UNBRIDLED_WISDOM = 505
-- EFFECT_NONE = 506
EFFECT_GRAND_PAS = 507
EFFECT_WIDENED_COMPASS = 508
EFFECT_ODYLLIC_SUBTERFUGE = 509
EFFECT_ERGON_MIGHT = 510
EFFECT_REIVE_MARK = 511
EFFECT_IONIS = 512
EFFECT_BOLSTER = 513
-- EFFECT_NONE = 514
EFFECT_LASTING_EMANATION = 515
EFFECT_ECLIPTIC_ATTRITION = 516
EFFECT_COLLIMATED_FERVOR = 517
EFFECT_DEMATERIALIZE = 518
EFFECT_THEURGIC_FOCUS = 519
-- EFFECT_NONE = 520
-- EFFECT_NONE = 521
EFFECT_ELEMENTAL_SFORZO = 522
EFFECT_IGNIS = 523
EFFECT_GELUS = 524
EFFECT_FLABRA = 525
EFFECT_TELLUS = 526
EFFECT_SULPOR = 527
EFFECT_UNDA = 528
EFFECT_LUX = 529
EFFECT_TENEBRAE = 530
EFFECT_VALLATION = 531
EFFECT_SWORDPLAY = 532
EFFECT_PFLUG = 533
EFFECT_EMBOLDEN = 534
EFFECT_VALIANCE = 535
EFFECT_GAMBIT = 536
EFFECT_LIEMENT = 537
EFFECT_ONE_FOR_ALL = 538
EFFECT_REGEN_II = 539
EFFECT_POISON_II = 540
EFFECT_REFRESH_II = 541
EFFECT_STR_BOOST_III = 542
EFFECT_DEX_BOOST_III = 543
EFFECT_VIT_BOOST_III = 544
EFFECT_AGI_BOOST_III = 545
EFFECT_INT_BOOST_III = 546
EFFECT_MND_BOOST_III = 547
EFFECT_CHR_BOOST_III = 548
EFFECT_ATTACK_BOOST_II = 549
EFFECT_DEFENSE_BOOST_II = 550
EFFECT_MAGIC_ATK_BOOST_II = 551
EFFECT_MAGIC_DEF_BOOST_II = 552
EFFECT_ACCURACY_BOOST_II = 553
EFFECT_EVASION_BOOST_II = 554
EFFECT_MAGIC_ACC_BOOST_II = 555
EFFECT_MAGIC_EVASION_BOOST_II = 556
EFFECT_ATTACK_DOWN_II = 557
EFFECT_DEFENSE_DOWN_II = 558
EFFECT_MAGIC_ATK_DOWN_II = 559
EFFECT_MAGIC_DEF_DOWN_II = 560
EFFECT_ACCURACY_DOWN_II = 561
EFFECT_EVASION_DOWN_II = 562
EFFECT_MAGIC_ACC_DOWN_II = 563
EFFECT_MAGIC_EVASION_DOWN_II = 564
EFFECT_SLOW_II = 565
EFFECT_PARALYSIS_II = 566
EFFECT_WEIGHT_II = 567
EFFECT_FOIL = 568
EFFECT_BLAZE_OF_GLORY = 569
EFFECT_BATTUTA = 570
EFFECT_RAYKE = 571
EFFECT_AVOIDANCE_DOWN = 572
EFFECT_DELUGE_SPIKES = 573 -- Exists in client, unused on retail?
EFFECT_FAST_CAST = 574
EFFECT_GESTATION = 575
EFFECT_DOUBT = 576 -- Bully: Intimidation Enfeeble status
EFFECT_CAIT_SITH_S_FAVOR = 577
EFFECT_FISHY_INTUITION = 578
EFFECT_COMMITMENT = 579
EFFECT_HASTE_II = 580
EFFECT_FLURRY_II = 581
-- Effect icons in packet can go from 0-767, so no custom effects should go in that range.
-- Purchased from Cruor Prospector
EFFECT_ABYSSEA_STR = 768
EFFECT_ABYSSEA_DEX = 769
EFFECT_ABYSSEA_VIT = 770
EFFECT_ABYSSEA_AGI = 771
EFFECT_ABYSSEA_INT = 772
EFFECT_ABYSSEA_MND = 773
EFFECT_ABYSSEA_CHR = 774
EFFECT_ABYSSEA_HP = 775
EFFECT_ABYSSEA_MP = 776
-- *Prowess increases not currently retail accurate.
-- GoV Prowess bonus effects, real effect at ID 474
EFFECT_PROWESS_CASKET_RATE = 777 -- (Unimplemented)
EFFECT_PROWESS_SKILL_RATE = 778 -- (Unimplemented)
EFFECT_PROWESS_CRYSTAL_YEILD = 779 -- (Unimplemented)
EFFECT_PROWESS_TH = 780 -- +1 per tier
EFFECT_PROWESS_ATTACK_SPEED = 781 -- *flat 4% for now
EFFECT_PROWESS_HP_MP = 782 -- Base 3% and another 1% per tier.
EFFECT_PROWESS_ACC_RACC = 783 -- *flat 4% for now
EFFECT_PROWESS_ATT_RATT = 784 -- *flat 4% for now
EFFECT_PROWESS_MACC_MATK = 785 -- *flat 4% for now
EFFECT_PROWESS_CURE_POTENCY = 786 -- *flat 4% for now
EFFECT_PROWESS_WS_DMG = 787 -- (Unimplemented) 2% per tier.
EFFECT_PROWESS_KILLER = 788 -- *flat +4 for now
-- End GoV Prowess fakery
EFFECT_FIELD_SUPPORT_FOOD = 789 -- Used by Fov/GoV food buff.
EFFECT_MARK_OF_SEED = 790 -- Tracks 30 min timer in ACP mission "Those Who Lurk in Shadows (II)"
EFFECT_ALL_MISS = 791
EFFECT_SUPER_BUFF = 792
EFFECT_NINJUTSU_ELE_DEBUFF = 793
EFFECT_HEALING = 794
EFFECT_LEAVEGAME = 795
EFFECT_HASTE_SAMBA_HASTE = 796
EFFECT_TELEPORT = 797
EFFECT_CHAINBOUND = 798
EFFECT_SKILLCHAIN = 799
EFFECT_DYNAMIS = 800
EFFECT_MEDITATE = 801 -- Dummy effect for SAM Meditate JA
-- EFFECT_PLACEHOLDER = 802 -- Description
-- 802-1022
-- EFFECT_PLACEHOLDER = 1023 -- The client dat file seems to have only this many "slots", results of exceeding that are untested.
----------------------------------
-- SC masks
----------------------------------
EFFECT_SKILLCHAIN0 = 0x200
EFFECT_SKILLCHAIN1 = 0x400
EFFECT_SKILLCHAIN2 = 0x800
EFFECT_SKILLCHAIN3 = 0x1000
EFFECT_SKILLCHAIN4 = 0x2000
EFFECT_SKILLCHAIN5 = 0x4000
EFFECT_SKILLCHAINMASK = 0x7C00
------------------------------------
-- Effect Flags
------------------------------------
EFFECTFLAG_NONE = 0x0000
EFFECTFLAG_DISPELABLE = 0x0001
EFFECTFLAG_ERASABLE = 0x0002
EFFECTFLAG_ATTACK = 0x0004
EFFECTFLAG_DAMAGE = 0x0010
EFFECTFLAG_DEATH = 0x0020
EFFECTFLAG_MAGIC_BEGIN = 0x0040
EFFECTFLAG_MAGIC_END = 0x0080
EFFECTFLAG_ON_ZONE = 0x0100
EFFECTFLAG_NO_LOSS_MESSAGE = 0x0200
EFFECTFLAG_INVISIBLE = 0x0400
EFFECTFLAG_DETECTABLE = 0x0800
EFFECTFLAG_NO_REST = 0x1000
EFFECTFLAG_PREVENT_ACTION = 0x2000
EFFECTFLAG_WALTZABLE = 0x4000
EFFECTFLAG_FOOD = 0x8000
EFFECTFLAG_SONG = 0x10000
EFFECTFLAG_ROLL = 0x20000
------------------------------------
function removeSleepEffects(target)
target:delStatusEffect(EFFECT_SLEEP_I);
target:delStatusEffect(EFFECT_SLEEP_II);
target:delStatusEffect(EFFECT_LULLABY);
end;
function hasSleepEffects(target)
if (target:hasStatusEffect(EFFECT_SLEEP_I) or
target:hasStatusEffect(EFFECT_SLEEP_II) or
target:hasStatusEffect(EFFECT_LULLABY)) then
return true;
end
return false;
end;
------------------------------------
-- These codes are the gateway to directly interacting with the pXI core program with status effects.
-- These are NOT the actual status effects such as weakness or silence,
-- but rather arbitrary codes chosen to represent different modifiers to the effected characters and mobs.
--
-- Even if the particular mod is not completely (or at all) implemented yet, you can still script the effects using these codes.
--
-- Example: target:getMod(MOD_STR) will get the sum of STR bonuses/penalties from gear, food, STR Etude, Absorb-STR, and any other STR-related buff/debuff.
-- Note that the above will ignore base statistics, and that getStat() should be used for stats, Attack, and Defense, while getACC(), getRACC(), and getEVA() also exist.
------------------------------------
MOD_NONE = 0x00
MOD_DEF = 0x01
MOD_HP = 0x02
MOD_HPP = 0x03
MOD_CONVMPTOHP = 0x04
MOD_MP = 0x05
MOD_MPP = 0x06
MOD_CONVHPTOMP = 0x07
MOD_STR = 0x08
MOD_DEX = 0x09
MOD_VIT = 0x0A
MOD_AGI = 0x0B
MOD_INT = 0x0C
MOD_MND = 0x0D
MOD_CHR = 0x0E
MOD_FIREDEF = 0x0F
MOD_ICEDEF = 0x10
MOD_WINDDEF = 0x11
MOD_EARTHDEF = 0x12
MOD_THUNDERDEF = 0x13
MOD_WATERDEF = 0x14
MOD_LIGHTDEF = 0x15
MOD_DARKDEF = 0x16
MOD_ATT = 0x17
MOD_RATT = 0x18
MOD_ACC = 0x19
MOD_RACC = 0x1A
MOD_ENMITY = 0x1B
MOD_ENMITY_LOSS_REDUCTION = 0x1F6
MOD_MATT = 0x1C
MOD_MDEF = 0x1D
MOD_MACC = 0x1E
MOD_MEVA = 0x1F
MOD_FIREATT = 0x20
MOD_ICEATT = 0x21
MOD_WINDATT = 0x22
MOD_EARTHATT = 0x23
MOD_THUNDERATT = 0x24
MOD_WATERATT = 0x25
MOD_LIGHTATT = 0x26
MOD_DARKATT = 0x27
MOD_FIREACC = 0x28
MOD_ICEACC = 0x29
MOD_WINDACC = 0x2A
MOD_EARTHACC = 0x2B
MOD_THUNDERACC = 0x2C
MOD_WATERACC = 0x2D
MOD_LIGHTACC = 0x2E
MOD_DARKACC = 0x2F
MOD_WSACC = 0x30
MOD_SLASHRES = 0x31
MOD_PIERCERES = 0x32
MOD_IMPACTRES = 0x33
MOD_HTHRES = 0x34
MOD_FIRERES = 0x36
MOD_ICERES = 0x37
MOD_WINDRES = 0x38
MOD_EARTHRES = 0x39
MOD_THUNDERRES = 0x3A
MOD_WATERRES = 0x3B
MOD_LIGHTRES = 0x3C
MOD_DARKRES = 0x3D
MOD_ATTP = 0x3E
MOD_DEFP = 0x3F
MOD_ACCP = 0x40
MOD_EVAP = 0x41
MOD_RATTP = 0x42
MOD_RACCP = 0x43
MOD_EVA = 0x44
MOD_RDEF = 0x45
MOD_REVA = 0x46
MOD_MPHEAL = 0x47
MOD_HPHEAL = 0x48
MOD_STORETP = 0x49
MOD_HTH = 0x50
MOD_DAGGER = 0x51
MOD_SWORD = 0x52
MOD_GSWORD = 0x53
MOD_AXE = 0x54
MOD_GAXE = 0x55
MOD_SCYTHE = 0x56
MOD_POLEARM = 0x57
MOD_KATANA = 0x58
MOD_GKATANA = 0x59
MOD_CLUB = 0x5A
MOD_STAFF = 0x5B
MOD_AUTO_MELEE_SKILL = 0x65
MOD_AUTO_RANGED_SKILL = 0x66
MOD_AUTO_MAGIC_SKILL = 0x67
MOD_ARCHERY = 0x68
MOD_MARKSMAN = 0x69
MOD_THROW = 0x6A
MOD_GUARD = 0x6B
MOD_EVASION = 0x6C
MOD_SHIELD = 0x6D
MOD_PARRY = 0x6E
MOD_DIVINE = 0x6F
MOD_HEALING = 0x70
MOD_ENHANCE = 0x71
MOD_ENFEEBLE = 0x72
MOD_ELEM = 0x73
MOD_DARK = 0x74
MOD_SUMMONING = 0x75
MOD_NINJUTSU = 0x76
MOD_SINGING = 0x77
MOD_STRING = 0x78
MOD_WIND = 0x79
MOD_BLUE = 0x7A
MOD_FISH = 0x7F
MOD_WOOD = 0x80
MOD_SMITH = 0x81
MOD_GOLDSMITH = 0x82
MOD_CLOTH = 0x83
MOD_LEATHER = 0x84
MOD_BONE = 0x85
MOD_ALCHEMY = 0x86
MOD_COOK = 0x87
MOD_SYNERGY = 0x88
MOD_RIDING = 0x89
MOD_ANTIHQ_WOOD = 0x90
MOD_ANTIHQ_SMITH = 0x91
MOD_ANTIHQ_GOLDSMITH = 0x92
MOD_ANTIHQ_CLOTH = 0x93
MOD_ANTIHQ_LEATHER = 0x94
MOD_ANTIHQ_BONE = 0x95
MOD_ANTIHQ_ALCHEMY = 0x96
MOD_ANTIHQ_COOK = 0x97
MOD_DMG = 0xA0
MOD_DMGPHYS = 0xA1
MOD_DMGBREATH = 0xA2
MOD_DMGMAGIC = 0xA3
MOD_DMGRANGE = 0xA4
MOD_UDMGPHYS = 0x183
MOD_UDMGBREATH = 0x184
MOD_UDMGMAGIC = 0x185
MOD_UDMGRANGE = 0x186
MOD_CRITHITRATE = 0xA5
MOD_CRIT_DMG_INCREASE = 0x1A5
MOD_ENEMYCRITRATE = 0xA6
MOD_HASTE_MAGIC = 0xA7
MOD_SPELLINTERRUPT = 0xA8
MOD_MOVE = 0xA9
MOD_FASTCAST = 0xAA
MOD_UFASTCAST = 0x197
MOD_CURE_CAST_TIME = 0x207
MOD_DELAY = 0xAB
MOD_RANGED_DELAY = 0xAC
MOD_MARTIAL_ARTS = 0xAD
MOD_SKILLCHAINBONUS = 0xAE
MOD_SKILLCHAINDMG = 0xAF
MOD_FOOD_HPP = 0xB0
MOD_FOOD_HP_CAP = 0xB1
MOD_FOOD_MPP = 0xB2
MOD_FOOD_MP_CAP = 0xB3
MOD_FOOD_ATTP = 0xB4
MOD_FOOD_ATT_CAP = 0xB5
MOD_FOOD_DEFP = 0xB6
MOD_FOOD_DEF_CAP = 0xB7
MOD_FOOD_ACCP = 0xB8
MOD_FOOD_ACC_CAP = 0xB9
MOD_FOOD_RATTP = 0xBA
MOD_FOOD_RATT_CAP = 0xBB
MOD_FOOD_RACCP = 0xBC
MOD_FOOD_RACC_CAP = 0xBD
MOD_VERMIN_KILLER = 0xE0
MOD_BIRD_KILLER = 0xE1
MOD_AMORPH_KILLER = 0xE2
MOD_LIZARD_KILLER = 0xE3
MOD_AQUAN_KILLER = 0xE4
MOD_PLANTOID_KILLER = 0xE5
MOD_BEAST_KILLER = 0xE6
MOD_UNDEAD_KILLER = 0xE7
MOD_ARCANA_KILLER = 0xE8
MOD_DRAGON_KILLER = 0xE9
MOD_DEMON_KILLER = 0xEA
MOD_EMPTY_KILLER = 0xEB
MOD_HUMANOID_KILLER = 0xEC
MOD_LUMORIAN_KILLER = 0xED
MOD_LUMINION_KILLER = 0xEE
MOD_SLEEPRES = 0xF0
MOD_POISONRES = 0xF1
MOD_PARALYZERES = 0xF2
MOD_BLINDRES = 0xF3
MOD_SILENCERES = 0xF4
MOD_VIRUSRES = 0xF5
MOD_PETRIFYRES = 0xF6
MOD_BINDRES = 0xF7
MOD_CURSERES = 0xF8
MOD_GRAVITYRES = 0xF9
MOD_SLOWRES = 0xFA
MOD_STUNRES = 0xFB
MOD_CHARMRES = 0xFC
MOD_AMNESIARES = 0xFD
-- PLACEHOLDER = 0xFE
MOD_DEATHRES = 0xFF
MOD_PARALYZE = 0x101
MOD_MIJIN_GAKURE = 0x102
MOD_DUAL_WIELD = 0x103
MOD_DOUBLE_ATTACK = 0x120
MOD_SUBTLE_BLOW = 0x121
MOD_COUNTER = 0x123
MOD_KICK_ATTACK = 0x124
MOD_AFFLATUS_SOLACE = 0x125
MOD_AFFLATUS_MISERY = 0x126
MOD_CLEAR_MIND = 0x127
MOD_CONSERVE_MP = 0x128
MOD_STEAL = 0x12A
MOD_BLINK = 0x12B
MOD_STONESKIN = 0x12C
MOD_PHALANX = 0x12D
MOD_TRIPLE_ATTACK = 0x12E
MOD_TREASURE_HUNTER = 0x12F
MOD_TAME = 0x130
MOD_RECYCLE = 0x131
MOD_ZANSHIN = 0x132
MOD_UTSUSEMI = 0x133
MOD_NINJA_TOOL = 0x134
MOD_BLUE_POINTS = 0x135
MOD_DMG_REFLECT = 0x13C
MOD_ROLL_ROGUES = 0x13D
MOD_ROLL_GALLANTS = 0x13E
MOD_ROLL_CHAOS = 0x13F
MOD_ROLL_BEAST = 0x140
MOD_ROLL_CHORAL = 0x141
MOD_ROLL_HUNTERS = 0x142
MOD_ROLL_SAMURAI = 0x143
MOD_ROLL_NINJA = 0x144
MOD_ROLL_DRACHEN = 0x145
MOD_ROLL_EVOKERS = 0x146
MOD_ROLL_MAGUS = 0x147
MOD_ROLL_CORSAIRS = 0x148
MOD_ROLL_PUPPET = 0x149
MOD_ROLL_DANCERS = 0x14A
MOD_ROLL_SCHOLARS = 0x14B
MOD_BUST = 0x14C
MOD_FINISHING_MOVES = 0x14D
MOD_SAMBA_DURATION = 0x1EA -- Samba duration bonus(modId = 490)
MOD_WALTZ_POTENTCY = 0x1EB -- Waltz Potentcy Bonus(modId = 491)
MOD_CHOCO_JIG_DURATION = 0x1EC -- Chocobo Jig duration bonus (modId = 492)
MOD_VFLOURISH_MACC = 0x1ED -- Violent Flourish accuracy bonus (modId = 493)
MOD_STEP_FINISH = 0x1EE -- Bonus finishing moves from steps (modId = 494)
MOD_STEP_ACCURACY = 0x193 -- Accuracy bonus for steps (modID = 403)
MOD_SPECTRAL_JIG = 0x1EF -- Spectral Jig duration modifier (percent increase) (modId = 495)
MOD_WALTZ_RECAST = 0x1F1 -- (modID = 497) Waltz recast modifier (percent)
MOD_SAMBA_PDURATION = 0x1F2 -- (modID = 498) Samba percent duration bonus
MOD_WIDESCAN = 0x154
MOD_BARRAGE_ACC = 0x1A4 -- (modID = 420)
MOD_ENSPELL = 0x155
MOD_SPIKES = 0x156
MOD_ENSPELL_DMG = 0x157
MOD_SPIKES_DMG = 0x158
MOD_TP_BONUS = 0x159
MOD_PERPETUATION_REDUCTION = 0x15A
MOD_FIRE_AFFINITY = 0x15B
MOD_EARTH_AFFINITY = 0x15C
MOD_WATER_AFFINITY = 0x15D
MOD_ICE_AFFINITY = 0x15E
MOD_THUNDER_AFFINITY = 0x15F
MOD_WIND_AFFINITY = 0x160
MOD_LIGHT_AFFINITY = 0x161
MOD_DARK_AFFINITY = 0x162
MOD_ADDS_WEAPONSKILL = 0x163
MOD_ADDS_WEAPONSKILL_DYN = 0x164
MOD_BP_DELAY = 0x165
MOD_STEALTH = 0x166
MOD_RAPID_SHOT = 0x167
MOD_CHARM_TIME = 0x168
MOD_JUMP_TP_BONUS = 0x169
MOD_JUMP_ATT_BONUS = 0x16A
MOD_HIGH_JUMP_ENMITY_REDUCTION = 0x16B
MOD_REWARD_HP_BONUS = 0x16C
MOD_SNAP_SHOT = 0x16D
MOD_MAIN_DMG_RATING = 0x16E
MOD_SUB_DMG_RATING = 0x16F
MOD_REGAIN = 0x170
MOD_REFRESH = 0x171
MOD_REGEN = 0x172
MOD_AVATAR_PERPETUATION = 0x173
MOD_WEATHER_REDUCTION = 0x174
MOD_DAY_REDUCTION = 0x175
MOD_CURE_POTENCY = 0x176
MOD_CURE_POTENCY_RCVD = 0x177
MOD_DELAYP = 0x17C
MOD_RANGED_DELAYP = 0x17D
MOD_EXP_BONUS = 0x17E
MOD_HASTE_ABILITY = 0x17F
MOD_HASTE_GEAR = 0x180
MOD_SHIELD_BASH = 0x181
MOD_KICK_DMG = 0x182
MOD_CHARM_CHANCE = 0x187
MOD_WEAPON_BASH = 0x188
MOD_BLACK_MAGIC_COST = 0x189
MOD_WHITE_MAGIC_COST = 0x18A
MOD_BLACK_MAGIC_CAST = 0x18B
MOD_WHITE_MAGIC_CAST = 0x18C
MOD_BLACK_MAGIC_RECAST = 0x18D
MOD_WHITE_MAGIC_RECAST = 0x18E
MOD_ALACRITY_CELERITY_EFFECT = 0x18F
MOD_LIGHT_ARTS_EFFECT = 0x14E
MOD_DARK_ARTS_EFFECT = 0x14F
MOD_LIGHT_ARTS_SKILL = 0x150
MOD_DARK_ARTS_SKILL = 0x151
MOD_REGEN_EFFECT = 0x152
MOD_REGEN_DURATION = 0x153
MOD_HELIX_EFFECT = 0x1DE
MOD_HELIX_DURATION = 0x1DD
MOD_STORMSURGE_EFFECT = 0x190
MOD_SUBLIMATION_BONUS = 0x191
MOD_GRIMOIRE_SPELLCASTING = 0x1E9 -- (modID = 489) "Grimoire: Reduces spellcasting time" bonus
MOD_WYVERN_BREATH = 0x192
MOD_REGEN_DOWN = 0x194 -- poison
MOD_REFRESH_DOWN = 0x195 -- plague, reduce mp
MOD_REGAIN_DOWN = 0x196 -- plague, reduce tp
MOD_MAGIC_DAMAGE = 0x137 -- Magic damage added directly to the spell's base damage (modId = 311)
-- Gear set modifiers
MOD_DA_DOUBLE_DAMAGE = 0x198 -- Double attack's double damage chance %.
MOD_TA_TRIPLE_DAMAGE = 0x199 -- Triple attack's triple damage chance %.
MOD_ZANSHIN_DOUBLE_DAMAGE = 0x19A -- Zanshin's double damage chance %.
MOD_RAPID_SHOT_DOUBLE_DAMAGE = 0x1DF -- Rapid shot's double damage chance %.
MOD_ABSORB_DMG_CHANCE = 0x1E0 -- Chance to absorb damage %
MOD_EXTRA_DUAL_WIELD_ATTACK = 0x1E1 -- Chance to land an extra attack when dual wielding
MOD_EXTRA_KICK_ATTACK = 0x1E2 -- Occasionally allows a second Kick Attack during an attack round without the use of Footwork.
MOD_SAMBA_DOUBLE_DAMAGE = 0x19F -- Double damage chance when samba is up.
MOD_NULL_PHYSICAL_DAMAGE = 0x1A0 -- Chance to null physical damage.
MOD_QUICK_DRAW_TRIPLE_DAMAGE = 0x1A1 -- Chance to do triple damage with quick draw.
MOD_BAR_ELEMENT_NULL_CHANCE = 0x1A2 -- Bar Elemental spells will occasionally nullify damage of the same element.
MOD_GRIMOIRE_INSTANT_CAST = 0x1A3 -- Spells that match your current Arts will occasionally cast instantly, without recast.
MOD_DOUBLE_SHOT_RATE = 0x1A6 -- The rate that double shot can proc
MOD_VELOCITY_SNAPSHOT_BONUS = 0x1A7 -- Increases Snapshot whilst Velocity Shot is up.
MOD_VELOCITY_RATT_BONUS = 0x1A8 -- Increases Ranged Attack whilst Velocity Shot is up.
MOD_SHADOW_BIND_EXT = 0x1A9 -- Extends the time of shadowbind
MOD_ABSORB_PHYSDMG_TO_MP = 0x1AA -- Absorbs a percentage of physical damage taken to MP.
MOD_ENMITY_REDUCTION_PHYSICAL = 0x1AB -- Reduces Enmity decrease when taking physical damage
MOD_SHIELD_MASTERY_TP = 0x1E5 -- Shield mastery TP bonus when blocking with a shield (modId = 485)
MOD_PERFECT_COUNTER_ATT = 0x1AC -- Raises weapon damage by 20 when countering while under the Perfect Counter effect. This also affects Weapon Rank (though not if fighting barehanded).
MOD_FOOTWORK_ATT_BONUS = 0x1AD -- Raises the attack bonus of Footwork. (Tantra Gaiters +2 raise 100/1024 to 152/1024)
MOD_MINNE_EFFECT = 0x1B1 -- (modId = 433)
MOD_MINUET_EFFECT = 0x1B2 -- (modId = 434)
MOD_PAEON_EFFECT = 0x1B3 -- (modId = 435)
MOD_REQUIEM_EFFECT = 0x1B4 -- (modId = 436)
MOD_THRENODY_EFFECT = 0x1B5 -- (modId = 437)
MOD_MADRIGAL_EFFECT = 0x1B6 -- (modId = 438)
MOD_MAMBO_EFFECT = 0x1B7 -- (modId = 439)
MOD_LULLABY_EFFECT = 0x1B8 -- (modId = 440)
MOD_ETUDE_EFFECT = 0x1B9 -- (modId = 441)
MOD_BALLAD_EFFECT = 0x1BA -- (modId = 442)
MOD_MARCH_EFFECT = 0x1BB -- (modId = 443)
MOD_FINALE_EFFECT = 0x1BC -- (modId = 444)
MOD_CAROL_EFFECT = 0x1BD -- (modId = 445)
MOD_MAZURKA_EFFECT = 0x1BE -- (modId = 446)
MOD_ELEGY_EFFECT = 0x1BF -- (modId = 447)
MOD_PRELUDE_EFFECT = 0x1C0 -- (modId = 448)
MOD_HYMNUS_EFFECT = 0x1C1 -- (modId = 449)
MOD_VIRELAI_EFFECT = 0x1C2 -- (modId = 450)
MOD_SCHERZO_EFFECT = 0x1C3 -- (modId = 451)
MOD_ALL_SONGS_EFFECT = 0x1C4 -- (modId = 452)
MOD_MAXIMUM_SONGS_BONUS = 0x1C5 -- (modId = 453)
MOD_SONG_DURATION_BONUS = 0x1C6 -- (modId = 454)
MOD_QUICK_DRAW_DMG = 0x19B -- (modId = 411)
MOD_QUAD_ATTACK = 0x1AE -- Quadruple attack chance.
MOD_ADDITIONAL_EFFECT = 0x1AF -- All additional effects (modId = 431)
MOD_ENSPELL_DMG_BONUS = 0x1B0
MOD_FIRE_ABSORB = 0x1CB -- (modId = 459)
MOD_EARTH_ABSORB = 0x1CC -- (modId = 460)
MOD_WATER_ABSORB = 0x1CD -- (modId = 461)
MOD_WIND_ABSORB = 0x1CE -- (modId = 462)
MOD_ICE_ABSORB = 0x1CF -- (modId = 463)
MOD_LTNG_ABSORB = 0x1D0 -- (modId = 464)
MOD_LIGHT_ABSORB = 0x1D1 -- (modId = 465)
MOD_DARK_ABSORB = 0x1D2 -- (modId = 466)
MOD_FIRE_NULL = 0x1D3 -- (modId = 467)
MOD_EARTH_NULL = 0x1D4 -- (modId = 468)
MOD_WATER_NULL = 0x1D5 -- (modId = 469)
MOD_WIND_NULL = 0x1D6 -- (modId = 470)
MOD_ICE_NULL = 0x1D7 -- (modId = 471)
MOD_LTNG_NULL = 0x1D8 -- (modId = 472)
MOD_LIGHT_NULL = 0x1D9 -- (modId = 473)
MOD_DARK_NULL = 0x1DA -- (modId = 474)
MOD_MAGIC_ABSORB = 0x1DB -- (modId = 475)
MOD_MAGIC_NULL = 0x1DC -- (modId = 476)
MOD_PHYS_ABSORB = 0x200 -- (modId = 512)
MOD_ABSORB_DMG_TO_MP = 0x204 -- Unlike PLD gear mod, works on all damage types (Ethereal Earring) (modId = 516)
MOD_WARCRY_DURATION = 0x1E3 -- Warcy duration bonus from gear
MOD_AUSPICE_EFFECT = 0x1E4 -- Auspice Subtle Blow Bonus (modId = 484)
MOD_TACTICAL_PARRY = 0x1E6 -- Tactical Parry TP Bonus (modid = 486)
MOD_MAG_BURST_BONUS = 0x1E7 -- Magic Burst Bonus (modid = 487)
MOD_INHIBIT_TP = 0x1E8 -- Inhibits TP Gain (percent) (modId = 488)
MOD_GOV_CLEARS = 0x1F0 -- Tracks GoV page completion (for 4% bonus on rewards).
-- Reraise (Auto Reraise, will be used by ATMA)
MOD_RERAISE_I = 0x1C8 -- Reraise. (modId = 456)
MOD_RERAISE_II = 0x1C9 -- Reraise II. (modId = 457)
MOD_RERAISE_III = 0x1CA -- Reraise III. (modId = 458)
MOD_ITEM_SPIKES_TYPE = 0x1F3 -- Type spikes an item has (modId = 499)
MOD_ITEM_SPIKES_DMG = 0x1F4 -- Damage of an items spikes (modId = 500)
MOD_ITEM_SPIKES_CHANCE = 0x1F5 -- Chance of an items spike proc (modId = 501)
MOD_FERAL_HOWL_DURATION = 0x1F7 -- +20% duration per merit when wearing augmented Monster Jackcoat +2 (modId = 503)
MOD_MANEUVER_BONUS = 0x1F8 -- Maneuver Stat Bonus
MOD_OVERLOAD_THRESH = 0x1F9 -- Overload Threshold Bonus
MOD_EXTRA_DMG_CHANCE = 0x1FA -- Proc rate of MOD_OCC_DO_EXTRA_DMG. 111 would be 11.1% (modId = 506)
MOD_OCC_DO_EXTRA_DMG = 0x1FB -- Multiplier for "Occasionally do x times normal damage". 250 would be 2.5 times damage. (modId = 507)
MOD_EAT_RAW_FISH = 0x19C -- (modId = 412)
MOD_EAT_RAW_MEAT = 0x19D -- (modId = 413)
MOD_ENHANCES_CURSNA = 0x136 -- Raises success rate of Cursna when removing effect (like Doom) that are not 100% chance to remove (modId = 310)
MOD_RETALIATION = 0x19E -- Increases damage of Retaliation hits (modId = 414)
MOD_AUGMENTS_THIRD_EYE = 0x1FC -- Adds counter to 3rd eye anticipates & if using Seigan counter rate is increased by 15% (modId = 508)
MOD_CLAMMING_IMPROVED_RESULTS = 0x1FD -- (modId = 509)
MOD_CLAMMING_REDUCED_INCIDENTS = 0x1FE -- (modId = 510)
MOD_CHOCOBO_RIDING_TIME = 0x1FF -- Increases chocobo riding time (modId = 511)
MOD_HARVESTING_RESULT = 0x201 -- Improves harvesting results (modId = 513)
MOD_LOGGING_RESULT = 0x202 -- Improves logging results (modId = 514)
MOD_MINNING_RESULT = 0x203 -- Improves mining results (modId = 515)
MOD_EGGHELM = 0x205 -- Egg Helm (Chocobo Digging)
MOD_SHIELDBLOCKRATE = 0x206 -- Affects shield block rate, percent based (modID = 518))
MOD_SCAVENGE_EFFECT = 0x138 -- (modId = 312)
MOD_DIA_DOT = 0x139 -- Increases the DoT damage of Dia (modId = 313)
MOD_SHARPSHOT = 0x13A -- Sharpshot accuracy bonus (modId = 314)
MOD_ENH_DRAIN_ASPIR = 0x13B -- % damage boost to Drain and Aspir(modId = 315)
MOD_TRICK_ATK_AGI = 0x208 -- % AGI boost to Trick Attack (if gear mod, needs to be equipped on hit) (modId = 520)
-- Mythic Weapon Mods
MOD_AUGMENTS_ABSORB = 0x209 -- Direct Absorb spell increase while Liberator is equipped (percentage based) (modId = 521)
-- The entire mod list is in desperate need of kind of some organizing.
-- The spares take care of finding the next ID to use so long as we don't forget to list IDs that have been freed up by refactoring.
-- MOD_SPARE = 0x20A -- (modId = 522)
-- MOD_SPARE = 0x20B -- (modId = 523)
------------------------------------
-- Merit Definitions
------------------------------------
MCATEGORY_HP_MP = 0x0040
MCATEGORY_ATTRIBUTES = 0x0080
MCATEGORY_COMBAT = 0x00C0
MCATEGORY_MAGIC = 0x0100
MCATEGORY_OTHERS = 0x0140
MCATEGORY_WAR_1 = 0x0180
MCATEGORY_MNK_1 = 0x01C0
MCATEGORY_WHM_1 = 0x0200
MCATEGORY_BLM_1 = 0x0240
MCATEGORY_RDM_1 = 0x0280
MCATEGORY_THF_1 = 0x02C0
MCATEGORY_PLD_1 = 0x0300
MCATEGORY_DRK_1 = 0x0340
MCATEGORY_BST_1 = 0x0380
MCATEGORY_BRD_1 = 0x03C0
MCATEGORY_RNG_1 = 0x0400
MCATEGORY_SAM_1 = 0x0440
MCATEGORY_NIN_1 = 0x0480
MCATEGORY_DRG_1 = 0x04C0
MCATEGORY_SMN_1 = 0x0500
MCATEGORY_BLU_1 = 0x0540
MCATEGORY_COR_1 = 0x0580
MCATEGORY_PUP_1 = 0x05C0
MCATEGORY_DNC_1 = 0x0600
MCATEGORY_SCH_1 = 0x0640
MCATEGORY_WS = 0x0680
MCATEGORY_UNK_0 = 0x06C0
MCATEGORY_UNK_1 = 0x0700
MCATEGORY_UNK_2 = 0x0740
MCATEGORY_UNK_3 = 0x0780
MCATEGORY_UNK_4 = 0x07C0
MCATEGORY_WAR_2 = 0x0800
MCATEGORY_MNK_2 = 0x0840
MCATEGORY_WHM_2 = 0x0880
MCATEGORY_BLM_2 = 0x08C0
MCATEGORY_RDM_2 = 0x0900
MCATEGORY_THF_2 = 0x0940
MCATEGORY_PLD_2 = 0x0980
MCATEGORY_DRK_2 = 0x09C0
MCATEGORY_BST_2 = 0x0A00
MCATEGORY_BRD_2 = 0x0A40
MCATEGORY_RNG_2 = 0x0A80
MCATEGORY_SAM_2 = 0x0AC0
MCATEGORY_NIN_2 = 0x0B00
MCATEGORY_DRG_2 = 0x0B40
MCATEGORY_SMN_2 = 0x0B80
MCATEGORY_BLU_2 = 0x0BC0
MCATEGORY_COR_2 = 0x0C00
MCATEGORY_PUP_2 = 0x0C40
MCATEGORY_DNC_2 = 0x0C80
MCATEGORY_SCH_2 = 0x0CC0
MCATEGORY_START = 0x0040
MCATEGORY_COUNT = 0x0D00
--HP
MERIT_MAX_HP = MCATEGORY_HP_MP + 0x00
MERIT_MAX_MP = MCATEGORY_HP_MP + 0x02
--ATTRIBUTES
MERIT_STR = MCATEGORY_ATTRIBUTES + 0x00
MERIT_DEX = MCATEGORY_ATTRIBUTES + 0x02
MERIT_VIT = MCATEGORY_ATTRIBUTES + 0x04
MERIT_AGI = MCATEGORY_ATTRIBUTES + 0x08
MERIT_INT = MCATEGORY_ATTRIBUTES + 0x0A
MERIT_MND = MCATEGORY_ATTRIBUTES + 0x0C
MERIT_CHR = MCATEGORY_ATTRIBUTES + 0x0E
--COMBAT SKILLS
MERIT_H2H = MCATEGORY_COMBAT + 0x00
MERIT_DAGGER = MCATEGORY_COMBAT + 0x02
MERIT_SWORD = MCATEGORY_COMBAT + 0x04
MERIT_GSWORD = MCATEGORY_COMBAT + 0x06
MERIT_AXE = MCATEGORY_COMBAT + 0x08
MERIT_GAXE = MCATEGORY_COMBAT + 0x0A
MERIT_SCYTHE = MCATEGORY_COMBAT + 0x0C
MERIT_POLEARM = MCATEGORY_COMBAT + 0x0E
MERIT_KATANA = MCATEGORY_COMBAT + 0x10
MERIT_GKATANA = MCATEGORY_COMBAT + 0x12
MERIT_CLUB = MCATEGORY_COMBAT + 0x14
MERIT_STAFF = MCATEGORY_COMBAT + 0x16
MERIT_ARCHERY = MCATEGORY_COMBAT + 0x18
MERIT_MARKSMANSHIP = MCATEGORY_COMBAT + 0x1A
MERIT_THROWING = MCATEGORY_COMBAT + 0x1C
MERIT_GUARDING = MCATEGORY_COMBAT + 0x1E
MERIT_EVASION = MCATEGORY_COMBAT + 0x20
MERIT_SHIELD = MCATEGORY_COMBAT + 0x22
MERIT_PARRYING = MCATEGORY_COMBAT + 0x24
--MAGIC SKILLS
MERIT_DIVINE = MCATEGORY_MAGIC + 0x00
MERIT_HEALING = MCATEGORY_MAGIC + 0x02
MERIT_ENHANCING = MCATEGORY_MAGIC + 0x04
MERIT_ENFEEBLING = MCATEGORY_MAGIC + 0x06
MERIT_ELEMENTAL = MCATEGORY_MAGIC + 0x08
MERIT_DARK = MCATEGORY_MAGIC + 0x0A
MERIT_SUMMONING = MCATEGORY_MAGIC + 0x0C
MERIT_NINJITSU = MCATEGORY_MAGIC + 0x0E
MERIT_SINGING = MCATEGORY_MAGIC + 0x10
MERIT_STRING = MCATEGORY_MAGIC + 0x12
MERIT_WIND = MCATEGORY_MAGIC + 0x14
MERIT_BLUE = MCATEGORY_MAGIC + 0x16
--OTHERS
MERIT_ENMITY_INCREASE = MCATEGORY_OTHERS + 0x00
MERIT_ENMITY_DECREASE = MCATEGORY_OTHERS + 0x02
MERIT_CRIT_HIT_RATE = MCATEGORY_OTHERS + 0x04
MERIT_ENEMY_CRIT_RATE = MCATEGORY_OTHERS + 0x06
MERIT_SPELL_INTERUPTION_RATE = MCATEGORY_OTHERS + 0x08
--WAR 1
MERIT_BERSERK_RECAST = MCATEGORY_WAR_1 + 0x00
MERIT_DEFENDER_RECAST = MCATEGORY_WAR_1 + 0x02
MERIT_WARCRY_RECAST = MCATEGORY_WAR_1 + 0x04
MERIT_AGGRESSOR_RECAST = MCATEGORY_WAR_1 + 0x06
MERIT_DOUBLE_ATTACK_RATE = MCATEGORY_WAR_1 + 0x08
--MNK 1
MERIT_FOCUS_RECAST = MCATEGORY_MNK_1 + 0x00
MERIT_DODGE_RECAST = MCATEGORY_MNK_1 + 0x02
MERIT_CHAKRA_RECAST = MCATEGORY_MNK_1 + 0x04
MERIT_COUNTER_RATE = MCATEGORY_MNK_1 + 0x06
MERIT_KICK_ATTACK_RATE = MCATEGORY_MNK_1 + 0x08
--WHM 1
MERIT_DIVINE_SEAL_RECAST = MCATEGORY_WHM_1 + 0x00
MERIT_CURE_CAST_TIME = MCATEGORY_WHM_1 + 0x02
MERIT_BAR_SPELL_EFFECT = MCATEGORY_WHM_1 + 0x04
MERIT_BANISH_EFFECT = MCATEGORY_WHM_1 + 0x06
MERIT_REGEN_EFFECT = MCATEGORY_WHM_1 + 0x08
--BLM 1
MERIT_ELEMENTAL_SEAL_RECAST = MCATEGORY_BLM_1 + 0x00
MERIT_FIRE_MAGIC_POTENCY = MCATEGORY_BLM_1 + 0x02
MERIT_ICE_MAGIC_POTENCY = MCATEGORY_BLM_1 + 0x04
MERIT_WIND_MAGIC_POTENCY = MCATEGORY_BLM_1 + 0x06
MERIT_EARTH_MAGIC_POTENCY = MCATEGORY_BLM_1 + 0x08
MERIT_LIGHTNING_MAGIC_POTENCY = MCATEGORY_BLM_1 + 0x0A
MERIT_WATER_MAGIC_POTENCY = MCATEGORY_BLM_1 + 0x0C
--RDM 1
MERIT_CONVERT_RECAST = MCATEGORY_RDM_1 + 0x00
MERIT_FIRE_MAGIC_ACCURACY = MCATEGORY_RDM_1 + 0x02
MERIT_ICE_MAGIC_ACCURACY = MCATEGORY_RDM_1 + 0x04
MERIT_WIND_MAGIC_ACCURACY = MCATEGORY_RDM_1 + 0x06
MERIT_EARTH_MAGIC_ACCURACY = MCATEGORY_RDM_1 + 0x08
MERIT_LIGHTNING_MAGIC_ACCURACY = MCATEGORY_RDM_1 + 0x0A
MERIT_WATER_MAGIC_ACCURACY = MCATEGORY_RDM_1 + 0x0C
--THF 1
MERIT_FLEE_RECAST = MCATEGORY_THF_1 + 0x00
MERIT_HIDE_RECAST = MCATEGORY_THF_1 + 0x02
MERIT_SNEAK_ATTACK_RECAST = MCATEGORY_THF_1 + 0x04
MERIT_TRICK_ATTACK_RECAST = MCATEGORY_THF_1 + 0x06
MERIT_TRIPLE_ATTACK_RATE = MCATEGORY_THF_1 + 0x08
--PLD 1
MERIT_SHIELD_BASH_RECAST = MCATEGORY_PLD_1 + 0x00
MERIT_HOLY_CIRCLE_RECAST = MCATEGORY_PLD_1 + 0x02
MERIT_SENTINEL_RECAST = MCATEGORY_PLD_1 + 0x04
MERIT_COVER_EFFECT_LENGTH = MCATEGORY_PLD_1 + 0x06
MERIT_RAMPART_RECAST = MCATEGORY_PLD_1 + 0x08
--DRK 1
MERIT_SOULEATER_RECAST = MCATEGORY_DRK_1 + 0x00
MERIT_ARCANE_CIRCLE_RECAST = MCATEGORY_DRK_1 + 0x02
MERIT_LAST_RESORT_RECAST = MCATEGORY_DRK_1 + 0x04
MERIT_LAST_RESORT_EFFECT = MCATEGORY_DRK_1 + 0x06
MERIT_WEAPON_BASH_EFFECT = MCATEGORY_DRK_1 + 0x08
--BST 1
MERIT_KILLER_EFFECTS = MCATEGORY_BST_1 + 0x00
MERIT_REWARD_RECAST = MCATEGORY_BST_1 + 0x02
MERIT_CALL_BEAST_RECAST = MCATEGORY_BST_1 + 0x04
MERIT_SIC_RECAST = MCATEGORY_BST_1 + 0x06
MERIT_TAME_RECAST = MCATEGORY_BST_1 + 0x08
--BRD 1
MERIT_LULLABY_RECAST = MCATEGORY_BRD_1 + 0x00
MERIT_FINALE_RECAST = MCATEGORY_BRD_1 + 0x02
MERIT_MINNE_EFFECT = MCATEGORY_BRD_1 + 0x04
MERIT_MINUET_EFFECT = MCATEGORY_BRD_1 + 0x06
MERIT_MADRIGAL_EFFECT = MCATEGORY_BRD_1 + 0x08
--RNG 1
MERIT_SCAVENGE_EFFECT = MCATEGORY_RNG_1 + 0x00
MERIT_CAMOUFLAGE_RECAST = MCATEGORY_RNG_1 + 0x02
MERIT_SHARPSHOT_RECAST = MCATEGORY_RNG_1 + 0x04
MERIT_UNLIMITED_SHOT_RECAST = MCATEGORY_RNG_1 + 0x06
MERIT_RAPID_SHOT_RATE = MCATEGORY_RNG_1 + 0x08
--SAM 1
MERIT_THIRD_EYE_RECAST = MCATEGORY_SAM_1 + 0x00
MERIT_WARDING_CIRCLE_RECAST = MCATEGORY_SAM_1 + 0x02
MERIT_STORE_TP_EFFECT = MCATEGORY_SAM_1 + 0x04
MERIT_MEDITATE_RECAST = MCATEGORY_SAM_1 + 0x06
MERIT_ZASHIN_ATTACK_RATE = MCATEGORY_SAM_1 + 0x08
--NIN 1
MERIT_SUBTLE_BLOW_EFFECT = MCATEGORY_NIN_1 + 0x00
MERIT_KATON_EFFECT = MCATEGORY_NIN_1 + 0x02
MERIT_HYOTON_EFFECT = MCATEGORY_NIN_1 + 0x04
MERIT_HUTON_EFFECT = MCATEGORY_NIN_1 + 0x06
MERIT_DOTON_EFFECT = MCATEGORY_NIN_1 + 0x08
MERIT_RAITON_EFFECT = MCATEGORY_NIN_1 + 0x0A
MERIT_SUITON_EFFECT = MCATEGORY_NIN_1 + 0x0C
--DRG 1
MERIT_ANCIENT_CIRCLE_RECAST = MCATEGORY_DRG_1 + 0x00
MERIT_JUMP_RECAST = MCATEGORY_DRG_1 + 0x02
MERIT_HIGH_JUMP_RECAST = MCATEGORY_DRG_1 + 0x04
MERIT_SUPER_JUMP_RECAST = MCATEGORY_DRG_1 + 0x05
MERIT_SPIRIT_LINK_RECAST = MCATEGORY_DRG_1 + 0x08
--SMN 1
MERIT_AVATAR_PHYSICAL_ACCURACY = MCATEGORY_SMN_1 + 0x00
MERIT_AVATAR_PHYSICAL_ATTACK = MCATEGORY_SMN_1 + 0x02
MERIT_AVATAR_MAGICAL_ACCURACY = MCATEGORY_SMN_1 + 0x04
MERIT_AVATAR_MAGICAL_ATTACK = MCATEGORY_SMN_1 + 0x06
MERIT_SUMMONING_MAGIC_CAST_TIME = MCATEGORY_SMN_1 + 0x08
--BLU 1
MERIT_CHAIN_AFFINITY_RECAST = MCATEGORY_BLU_1 + 0x00
MERIT_BURST_AFFINITY_RECAST = MCATEGORY_BLU_1 + 0x02
MERIT_MONSTER_CORRELATION = MCATEGORY_BLU_1 + 0x04
MERIT_PHYSICAL_POTENCY = MCATEGORY_BLU_1 + 0x06
MERIT_MAGICAL_ACCURACY = MCATEGORY_BLU_1 + 0x08
--COR 1
MERIT_PHANTOM_ROLL_RECAST = MCATEGORY_COR_1 + 0x00
MERIT_QUICK_DRAW_RECAST = MCATEGORY_COR_1 + 0x02
MERIT_QUICK_DRAW_ACCURACY = MCATEGORY_COR_1 + 0x04
MERIT_RANDOM_DEAL_RECAST = MCATEGORY_COR_1 + 0x06
MERIT_BUST_DURATION = MCATEGORY_COR_1 + 0x08
--PUP 1
MERIT_AUTOMATION_MELEE_SKILL = MCATEGORY_PUP_1 + 0x00
MERIT_AUTOMATION_RANGED_SKILL = MCATEGORY_PUP_1 + 0x02
MERIT_AUTOMATION_MAGIC_SKILL = MCATEGORY_PUP_1 + 0x04
MERIT_ACTIVATE_RECAST = MCATEGORY_PUP_1 + 0x06
MERIT_REPAIR_RECAST = MCATEGORY_PUP_1 + 0x08
--DNC 1
MERIT_STEP_ACCURACY = MCATEGORY_DNC_1 + 0x00
MERIT_HASTE_SAMBA_EFFECT = MCATEGORY_DNC_1 + 0x02
MERIT_REVERSE_FLOURISH_EFFECT = MCATEGORY_DNC_1 + 0x04
MERIT_BUILDING_FLOURISH_EFFECT = MCATEGORY_DNC_1 + 0x06
--SCH 1
MERIT_GRIMOIRE_RECAST = MCATEGORY_SCH_1 + 0x00
MERIT_MODUS_VERITAS_DURATION = MCATEGORY_SCH_1 + 0x02
MERIT_HELIX_MAGIC_ACC_ATT = MCATEGORY_SCH_1 + 0x04
MERIT_MAX_SUBLIMATION = MCATEGORY_SCH_1 + 0x06
--WEAPON SKILLS
MERIT_SHIJIN_SPIRAL = MCATEGORY_WS + 0x00
MERIT_EXENTERATOR = MCATEGORY_WS + 0x02
MERIT_REQUIESCAT = MCATEGORY_WS + 0x04
MERIT_RESOLUTION = MCATEGORY_WS + 0x06
MERIT_RUINATOR = MCATEGORY_WS + 0x08
MERIT_UPHEAVAL = MCATEGORY_WS + 0x0A
MERIT_ENTROPY = MCATEGORY_WS + 0x0C
MERIT_STARDIVER = MCATEGORY_WS + 0x0E
MERIT_BLADE_SHUN = MCATEGORY_WS + 0x10
MERIT_TACHI_SHOHA = MCATEGORY_WS + 0x12
MERIT_REALMRAZER = MCATEGORY_WS + 0x14
MERIT_SHATTERSOUL = MCATEGORY_WS + 0x16
MERIT_APEX_ARROW = MCATEGORY_WS + 0x18
MERIT_LAST_STAND = MCATEGORY_WS + 0x1A
-- unknown
--MERIT_UNKNOWN1 = MCATEGORY_UNK_0 + 0x00
--MERIT_UNKNOWN2 = MCATEGORY_UNK_1 + 0x00
--MERIT_UNKNOWN3 = MCATEGORY_UNK_2 + 0x00
--MERIT_UNKNOWN4 = MCATEGORY_UNK_3 + 0x00
--MERIT_UNKNOWN5 = MCATEGORY_UNK_4 + 0x00
--WAR 2
MERIT_WARRIORS_CHARGE = MCATEGORY_WAR_2 + 0x00
MERIT_TOMAHAWK = MCATEGORY_WAR_2 + 0x02
MERIT_SAVAGERY = MCATEGORY_WAR_2 + 0x04
MERIT_AGGRESSIVE_AIM = MCATEGORY_WAR_2 + 0x06
--MNK 2
MERIT_MANTRA = MCATEGORY_MNK_2 + 0x00
MERIT_FORMLESS_STRIKES = MCATEGORY_MNK_2 + 0x02
MERIT_INVIGORATE = MCATEGORY_MNK_2 + 0x04
MERIT_PENANCE = MCATEGORY_MNK_2 + 0x06
--WHM 2
MERIT_MARTYR = MCATEGORY_WHM_2 + 0x00
MERIT_DEVOTION = MCATEGORY_WHM_2 + 0x02
MERIT_PROTECTRA_V = MCATEGORY_WHM_2 + 0x04
MERIT_SHELLRA_V = MCATEGORY_WHM_2 + 0x06
--BLM 2
MERIT_FLARE_II = MCATEGORY_BLM_2 + 0x00
MERIT_FREEZE_II = MCATEGORY_BLM_2 + 0x02
MERIT_TORNADO_II = MCATEGORY_BLM_2 + 0x04
MERIT_QUAKE_II = MCATEGORY_BLM_2 + 0x06
MERIT_BURST_II = MCATEGORY_BLM_2 + 0x08
MERIT_FLOOD_II = MCATEGORY_BLM_2 + 0x0A
--RDM 2
MERIT_DIA_III = MCATEGORY_RDM_2 + 0x00
MERIT_SLOW_II = MCATEGORY_RDM_2 + 0x02
MERIT_PARALYZE_II = MCATEGORY_RDM_2 + 0x04
MERIT_PHALANX_II = MCATEGORY_RDM_2 + 0x06
MERIT_BIO_III = MCATEGORY_RDM_2 + 0x08
MERIT_BLIND_II = MCATEGORY_RDM_2 + 0x0A
--THF 2
MERIT_ASSASSINS_CHARGE = MCATEGORY_THF_2 + 0x00
MERIT_FEINT = MCATEGORY_THF_2 + 0x02
MERIT_AURA_STEAL = MCATEGORY_THF_2 + 0x04
MERIT_AMBUSH = MCATEGORY_THF_2 + 0x06
--PLD 2
MERIT_FEALTY = MCATEGORY_PLD_2 + 0x00
MERIT_CHIVALRY = MCATEGORY_PLD_2 + 0x02
MERIT_IRON_WILL = MCATEGORY_PLD_2 + 0x04
MERIT_GUARDIAN = MCATEGORY_PLD_2 + 0x06
--DRK 2
MERIT_DARK_SEAL = MCATEGORY_DRK_2 + 0x00
MERIT_DIABOLIC_EYE = MCATEGORY_DRK_2 + 0x02
MERIT_MUTED_SOUL = MCATEGORY_DRK_2 + 0x04
MERIT_DESPERATE_BLOWS = MCATEGORY_DRK_2 + 0x06
--BST 2
MERIT_FERAL_HOWL = MCATEGORY_BST_2 + 0x00
MERIT_KILLER_INSTINCT = MCATEGORY_BST_2 + 0x02
MERIT_BEAST_AFFINITY = MCATEGORY_BST_2 + 0x04
MERIT_BEAST_HEALER = MCATEGORY_BST_2 + 0x06
--BRD 2
MERIT_NIGHTINGALE = MCATEGORY_BRD_2 + 0x00
MERIT_TROUBADOUR = MCATEGORY_BRD_2 + 0x02
MERIT_FOE_SIRVENTE = MCATEGORY_BRD_2 + 0x04
MERIT_ADVENTURERS_DIRGE = MCATEGORY_BRD_2 + 0x06
--RNG 2
MERIT_STEALTH_SHOT = MCATEGORY_RNG_2 + 0x00
MERIT_FLASHY_SHOT = MCATEGORY_RNG_2 + 0x02
MERIT_SNAPSHOT = MCATEGORY_RNG_2 + 0x04
MERIT_RECYCLE = MCATEGORY_RNG_2 + 0x06
--SAM 2
MERIT_SHIKIKOYO = MCATEGORY_SAM_2 + 0x00
MERIT_BLADE_BASH = MCATEGORY_SAM_2 + 0x02
MERIT_IKISHOTEN = MCATEGORY_SAM_2 + 0x04
MERIT_OVERWHELM = MCATEGORY_SAM_2 + 0x06
--NIN 2
MERIT_SANGE = MCATEGORY_NIN_2 + 0x00
MERIT_NINJA_TOOL_EXPERTISE = MCATEGORY_NIN_2 + 0x02
MERIT_KATON_SAN = MCATEGORY_NIN_2 + 0x04
MERIT_HYOTON_SAN = MCATEGORY_NIN_2 + 0x06
MERIT_HUTON_SAN = MCATEGORY_NIN_2 + 0x08
MERIT_DOTON_SAN = MCATEGORY_NIN_2 + 0x0A
MERIT_RAITON_SAN = MCATEGORY_NIN_2 + 0x0C
MERIT_SUITON_SAN = MCATEGORY_NIN_2 + 0x0E
--DRG 2
MERIT_DEEP_BREATHING = MCATEGORY_DRG_2 + 0x00
MERIT_ANGON = MCATEGORY_DRG_2 + 0x02
MERIT_EMPATHY = MCATEGORY_DRG_2 + 0x04
MERIT_STRAFE = MCATEGORY_DRG_2 + 0x06
--SMN 2
MERIT_METEOR_STRIKE = MCATEGORY_SMN_2 + 0x00
MERIT_HEAVENLY_STRIKE = MCATEGORY_SMN_2 + 0x02
MERIT_WIND_BLADE = MCATEGORY_SMN_2 + 0x04
MERIT_GEOCRUSH = MCATEGORY_SMN_2 + 0x06
MERIT_THUNDERSTORM = MCATEGORY_SMN_2 + 0x08
MERIT_GRANDFALL = MCATEGORY_SMN_2 + 0x0A
--BLU 2
MERIT_CONVERGENCE = MCATEGORY_BLU_2 + 0x00
MERIT_DIFFUSION = MCATEGORY_BLU_2 + 0x02
MERIT_ENCHAINMENT = MCATEGORY_BLU_2 + 0x04
MERIT_ASSIMILATION = MCATEGORY_BLU_2 + 0x06
--COR 2
MERIT_SNAKE_EYE = MCATEGORY_COR_2 + 0x00
MERIT_FOLD = MCATEGORY_COR_2 + 0x02
MERIT_WINNING_STREAK = MCATEGORY_COR_2 + 0x04
MERIT_LOADED_DECK = MCATEGORY_COR_2 + 0x06
--PUP 2
MERIT_ROLE_REVERSAL = MCATEGORY_PUP_2 + 0x00
MERIT_VENTRILOQUY = MCATEGORY_PUP_2 + 0x02
MERIT_FINE_TUNING = MCATEGORY_PUP_2 + 0x04
MERIT_OPTIMIZATION = MCATEGORY_PUP_2 + 0x06
--DNC 2
MERIT_SABER_DANCE = MCATEGORY_DNC_2 + 0x00
MERIT_FAN_DANCE = MCATEGORY_DNC_2 + 0x02
MERIT_NO_FOOT_RISE = MCATEGORY_DNC_2 + 0x04
MERIT_CLOSED_POSITION = MCATEGORY_DNC_2 + 0x06
--SCH 2
MERIT_ALTRUISM = MCATEGORY_SCH_2 + 0x00
MERIT_FOCALIZATION = MCATEGORY_SCH_2 + 0x02
MERIT_TRANQUILITY = MCATEGORY_SCH_2 + 0x04
MERIT_EQUANIMITY = MCATEGORY_SCH_2 + 0x06
MERIT_ENLIGHTENMENT = MCATEGORY_SCH_2 + 0x08
MERIT_STORMSURGE = MCATEGORY_SCH_2 + 0x0A
------------------------------------
-- Slot Definitions
------------------------------------
SLOT_MAIN = 0
SLOT_SUB = 1
SLOT_RANGED = 2
SLOT_AMMO = 3
SLOT_HEAD = 4
SLOT_BODY = 5
SLOT_HANDS = 6
SLOT_LEGS = 7
SLOT_FEET = 8
SLOT_NECK = 9
SLOT_WAIST = 10
SLOT_EAR1 = 11
SLOT_EAR2 = 12
SLOT_RING1 = 13
SLOT_RING2 = 14
SLOT_BACK = 15
MAX_SLOTID = 15
----------------------------------
-- Objtype Definitions
----------------------------------
TYPE_PC = 0x01
TYPE_NPC = 0x02
TYPE_MOB = 0x04
TYPE_PET = 0x08
TYPE_SHIP = 0x10
----------------------------------
-- Allegiance Definitions
----------------------------------
ALLEGIANCE_MOB = 0
ALLEGIANCE_PLAYER = 1
ALLEGIANCE_SAN_DORIA = 2
ALLEGIANCE_BASTOK = 3
ALLEGIANCE_WINDURST = 4
------------------------------------
-- Inventory enum
------------------------------------
LOC_INVENTORY = 0
LOC_MOGSAFE = 1
LOC_STORAGE = 2
LOC_TEMPITEMS = 3
LOC_MOGLOCKER = 4
LOC_MOGSATCHEL = 5
LOC_MOGSACK = 6
------------------------------------
-- Message enum
------------------------------------
MSGBASIC_DEFEATS_TARG = 6 -- The <player> defeats <target>.
MSGBASIC_ALREADY_CLAIMED = 12 -- Cannot attack. Your target is already claimed.
MSGBASIC_IS_INTERRUPTED = 16 -- The <player>'s casting is interrupted.
MSGBASIC_UNABLE_TO_CAST = 18 -- Unable to cast spells at this time.
MSGBASIC_CANNOT_PERFORM = 71 -- The <player> cannot perform that action.
MSGBASIC_UNABLE_TO_USE_JA = 87 -- Unable to use job ability.
MSGBASIC_UNABLE_TO_USE_JA2 = 88 -- Unable to use job ability.
MSGBASIC_IS_PARALYZED = 29 -- The <player> is paralyzed.
MSGBASIC_SHADOW_ABSORB = 31 -- .. of <target>'s shadows absorb the damage and disappear.
MSGBASIC_NOT_ENOUGH_MP = 34 -- The <player> does not have enough MP to cast (NULL).
MSGBASIC_NO_NINJA_TOOLS = 35 -- The <player> lacks the ninja tools to cast (NULL).
MSGBASIC_UNABLE_TO_CAST_SPELLS = 49 -- The <player> is unable to cast spells.
MSGBASIC_WAIT_LONGER = 94 -- You must wait longer to perform that action.
MSGBASIC_USES_JA = 100 -- The <player> uses ..
MSGBASIC_USES_JA2 = 101 -- The <player> uses ..
MSGBASIC_USES_RECOVERS_HP = 102 -- The <player> uses .. <target> recovers .. HP.
MSGBASIC_USES_JA_TAKE_DAMAGE = 317 -- The <player> uses .. <target> takes .. points of damage.
MSGBASIC_IS_INTIMIDATED = 106 -- The <player> is intimidated by <target>'s presence.
MSGBASIC_CANNOT_ON_THAT_TARG = 155 -- You cannot perform that action on the specified target.
MSGBASIC_CANNOT_ATTACK_TARGET = 446 -- You cannot attack that target
MSGBASIC_NEEDS_2H_WEAPON = 307 -- That action requires a two-handed weapon.
MSGBASIC_USES_BUT_MISSES = 324 -- The <player> uses .. but misses <target>.
MSGBASIC_CANT_BE_USED_IN_AREA = 316 -- That action cannot be used in this area.
MSGBASIC_REQUIRES_SHIELD = 199 -- That action requires a shield.
MSGBASIC_REQUIRES_COMBAT = 525 -- .. can only be performed during battle.
MSGBASIC_STATUS_PREVENTS = 569 -- Your current status prevents you from using that ability.
-- Distance
MSGBASIC_TARG_OUT_OF_RANGE = 4 -- <target> is out of range.
MSGBASIC_UNABLE_TO_SEE_TARG = 5 -- Unable to see <target>.
MSGBASIC_LOSE_SIGHT = 36 -- You lose sight of <target>.
MSGBASIC_TOO_FAR_AWAY = 78 -- <target> is too far away.
-- Weaponskills
MSGBASIC_CANNOT_USE_WS = 190 -- The <player> cannot use that weapon ability.
MSGBASIC_NOT_ENOUGH_TP = 192 -- The <player> does not have enough TP.
-- Pets
MSGBASIC_REQUIRES_A_PET = 215 -- That action requires a pet.
MSGBASIC_THAT_SOMEONES_PET = 235 -- That is someone's pet.
MSGBASIC_ALREADY_HAS_A_PET = 315 -- The <player> already has a pet.
MSGBASIC_NO_EFFECT_ON_PET = 336 -- No effect on that pet.
MSGBASIC_NO_JUG_PET_ITEM = 337 -- You do not have the necessary item equipped to call a beast.
MSGBASIC_MUST_HAVE_FOOD = 347 -- You must have pet food equipped to use that command.
MSGBASIC_PET_CANNOT_DO_ACTION = 574 -- <player>'s pet is currently unable to perform that action.
MSGBASIC_PET_NOT_ENOUGH_TP = 575 -- <player>'s pet does not have enough TP to perform that action.
-- Items
MSGBASIC_CANNOT_USE_ITEM_ON = 92 -- Cannot use the <item> on <target>.
MSGBASIC_ITEM_FAILS_TO_ACTIVATE = 62 -- The <item> fails to activate.
MSGBASIC_FULL_INVENTORY = 356 -- Cannot execute command. Your inventory is full.
-- Ranged
MSGBASIC_NO_RANGED_WEAPON = 216 -- You do not have an appropriate ranged weapon equipped.
MSGBASIC_CANNOT_SEE = 217 -- You cannot see <target>.
MSGBASIC_MOVE_AND_INTERRUPT = 218 -- You move and interrupt your aim.
-- Charm
MSGBASIC_CANNOT_CHARM = 210 -- The <player> cannot charm <target>!
MSGBASIC_VERY_DIFFICULT_CHARM = 211 -- It would be very difficult for the <player> to charm <target>.
MSGBASIC_DIFFICULT_TO_CHARM = 212 -- It would be difficult for the <player> to charm <target>.
MSGBASIC_MIGHT_BE_ABLE_CHARM = 213 -- The <player> might be able to charm <target>.
MSGBASIC_SHOULD_BE_ABLE_CHARM = 214 -- The <player> should be able to charm <target>.
-- BLU
MSGBASIC_LEARNS_SPELL = 419 -- <target> learns (NULL)!
-- COR
MSGBASIC_ROLL_MAIN = 420 -- The <player> uses .. The total comes to ..! <target> receives the effect of ..
MSGBASIC_ROLL_SUB = 421 -- <target> receives the effect of ..
MSGBASIC_ROLL_MAIN_FAIL = 422 -- The <player> uses .. The total comes to ..! No effect on <target>.
MSGBASIC_ROLL_SUB_FAIL = 423 -- No effect on <target>.
MSGBASIC_DOUBLEUP = 424 -- The <player> uses Double-Up. The total for . increases to ..! <target> receives the effect of ..
MSGBASIC_DOUBLEUP_FAIL = 425 -- The <player> uses Double-Up. The total for . increases to ..! No effect on <target>.
MSGBASIC_DOUBLEUP_BUST = 426 -- The <player> uses Double-Up. Bust! <target> loses the effect of ..
MSGBASIC_DOUBLEUP_BUST_SUB = 427 -- <target> loses the effect of ..
MSGBASIC_NO_ELIGIBLE_ROLL = 428 -- There are no rolls eligible for Double-Up. Unable to use ability.
MSGBASIC_ROLL_ALREADY_ACTIVE = 429 -- The same roll is already active on the <player>.
MSGBASIC_EFFECT_ALREADY_ACTIVE = 523 -- The same effect is already active on <player>.
MSGBASIC_NO_FINISHINGMOVES = 524 -- You have not earned enough finishing moves to perform that action.
------------------------------------
-- Spell Groups
------------------------------------
SPELLGROUP_NONE = 0
SPELLGROUP_SONG = 1
SPELLGROUP_BLACK = 2
SPELLGROUP_BLUE = 3
SPELLGROUP_NINJUTSU = 4
SPELLGROUP_SUMMONING = 5
SPELLGROUP_WHITE = 6
------------------------------------
-- MOBMODs
------------------------------------
MOBMOD_GIL_MIN = 1
MOBMOD_GIL_MAX = 2
MOBMOD_MP_BASE = 3
MOBMOD_SIGHT_RANGE = 4
MOBMOD_SOUND_RANGE = 5
MOBMOD_BUFF_CHANCE = 6
MOBMOD_GA_CHANCE = 7
MOBMOD_HEAL_CHANCE = 8
MOBMOD_HP_HEAL_CHANCE = 9
MOBMOD_SUBLINK = 10
MOBMOD_LINK_RADIUS = 11
MOBMOD_DRAW_IN = 12
MOBMOD_RAGE = 13
MOBMOD_SKILLS = 14
MOBMOD_MUG_GIL = 15
MOBMOD_MAIN_2HOUR = 16
MOBMOD_NO_DESPAWN = 17
MOBMOD_VAR = 18 -- Used by funguar to track skill uses.
MOBMOD_SUB_2HOUR = 19
MOBMOD_TP_USE_CHANCE = 20
MOBMOD_PET_SPELL_LIST = 21
MOBMOD_NA_CHANCE = 22
MOBMOD_IMMUNITY = 23
MOBMOD_GRADUAL_RAGE = 24
MOBMOD_BUILD_RESIST = 25
MOBMOD_SUPERLINK = 26
MOBMOD_SPELL_LIST = 27
MOBMOD_EXP_BONUS = 28
MOBMOD_ASSIST = 29
MOBMOD_SPECIAL_SKILL = 30
MOBMOD_ROAM_DISTANCE = 31
MOBMOD_2HOUR_MULTI = 32
MOBMOD_SPECIAL_COOL = 33
MOBMOD_MAGIC_COOL = 34
MOBMOD_STANDBACK_TIME = 35
MOBMOD_ROAM_COOL = 36
MOBMOD_ALWAYS_AGGRO = 37
MOBMOD_NO_DROPS = 38 -- If set monster cannot drop any items, not even seals.
MOBMOD_SHARE_POS = 39
MOBMOD_TELEPORT_CD = 40
MOBMOD_TELEPORT_START = 41
MOBMOD_TELEPORT_END = 42
MOBMOD_TELEPORT_TYPE = 43
MOBMOD_DUAL_WIELD = 44
MOBMOD_ADD_EFFECT = 45
MOBMOD_AUTO_SPIKES = 46
MOBMOD_SPAWN_LEASH = 47
MOBMOD_SHARE_TARGET = 48
------------------------------------
-- Skills
------------------------------------
-- Combat Skills
SKILL_NON = 0
SKILL_H2H = 1
SKILL_DAG = 2
SKILL_SWD = 3
SKILL_GSD = 4
SKILL_AXE = 5
SKILL_GAX = 6
SKILL_SYH = 7
SKILL_POL = 8
SKILL_KAT = 9
SKILL_GKT = 10
SKILL_CLB = 11
SKILL_STF = 12
-- 13~21 unused
-- 22~24 pup's Automaton skills
SKILL_ARC = 25
SKILL_MRK = 26
SKILL_THR = 27
-- Defensive Skills
SKILL_GRD = 28
SKILL_EVA = 29
SKILL_SHL = 30
SKILL_PAR = 31
-- Magic Skills
SKILL_DIV = 32
SKILL_HEA = 33
SKILL_ENH = 34
SKILL_ENF = 35
SKILL_ELE = 36
SKILL_DRK = 37
SKILL_SUM = 38
SKILL_NIN = 39
SKILL_SNG = 40
SKILL_STR = 41
SKILL_WND = 42
SKILL_BLU = 43
SKILL_GEO = 44
-- 45~47 unused
-- Crafting Skills
SKILL_FISHING = 48
SKILL_WOODWORKING = 49
SKILL_SMITHING = 50
SKILL_GOLDSMITHING = 51
SKILL_CLOTHCRAFT = 52
SKILL_LEATHERCRAFT = 53
SKILL_BONECRAFT = 54
SKILL_ALCHEMY = 55
SKILL_COOKING = 56
SKILL_SYNERGY = 57
-- Other Skills
SKILL_RID = 58
SKILL_DIG = 59
-- 60~63 unused
-- MAX_SKILLTYPE = 64
------------------------------------
-- Recast IDs
------------------------------------
RECAST_ITEM = 0
RECAST_MAGIC = 1
RECAST_ABILITY = 2
------------------------------------
-- ACTION IDs
------------------------------------
ACTION_NONE = 0;
ACTION_ATTACK = 1;
ACTION_RANGED_FINISH = 2;
ACTION_WEAPONSKILL_FINISH = 3;
ACTION_MAGIC_FINISH = 4;
ACTION_ITEM_FINISH = 5;
ACTION_JOBABILITY_FINISH = 6;
ACTION_WEAPONSKILL_START = 7;
ACTION_MAGIC_START = 8;
ACTION_ITEM_START = 9;
ACTION_JOBABILITY_START = 10;
ACTION_MOBABILITY_FINISH = 11;
ACTION_RANGED_START = 12;
ACTION_RAISE_MENU_SELECTION = 13;
ACTION_DANCE = 14;
ACTION_UNKNOWN_15 = 15;
ACTION_ROAMING = 16;
ACTION_ENGAGE = 17;
ACTION_DISENGAGE = 18;
ACTION_CHANGE_TARGET = 19;
ACTION_FALL = 20;
ACTION_DROPITEMS = 21;
ACTION_DEATH = 22;
ACTION_FADE_OUT = 23;
ACTION_DESPAWN = 24;
ACTION_SPAWN = 25;
ACTION_STUN = 26;
ACTION_SLEEP = 27;
ACTION_ITEM_USING = 28;
ACTION_ITEM_INTERRUPT = 29;
ACTION_MAGIC_CASTING = 30;
ACTION_MAGIC_INTERRUPT = 31;
ACTION_RANGED_INTERRUPT = 32;
ACTION_MOBABILITY_START = 33;
ACTION_MOBABILITY_USING = 34;
ACTION_MOBABILITY_INTERRUPT = 35;
ACTION_LEAVE = 36;
------------------------------------
-- ECOSYSTEM IDs
------------------------------------
SYSTEM_ERROR = 0;
SYSTEM_AMORPH = 1;
SYSTEM_AQUAN = 2;
SYSTEM_ARCANA = 3;
SYSTEM_ARCHAICMACHINE = 4;
SYSTEM_AVATAR = 5;
SYSTEM_BEAST = 6;
SYSTEM_BEASTMEN = 7;
SYSTEM_BIRD = 8;
SYSTEM_DEMON = 9;
SYSTEM_DRAGON = 10;
SYSTEM_ELEMENTAL = 11;
SYSTEM_EMPTY = 12;
SYSTEM_HUMANOID = 13;
SYSTEM_LIZARD = 14;
SYSTEM_LUMORIAN = 15;
SYSTEM_LUMINION = 16;
SYSTEM_PLANTOID = 17;
SYSTEM_UNCLASSIFIED = 18;
SYSTEM_UNDEAD = 19;
SYSTEM_VERMIN = 20;
SYSTEM_VORAGEAN = 21;
------------------------------------
-- Spell AOE IDs
------------------------------------
SPELLAOE_NONE = 0;
SPELLAOE_RADIAL = 1;
SPELLAOE_CONAL = 2;
SPELLAOE_RADIAL_MANI = 3; -- AOE when under SCH stratagem Manifestation
SPELLAOE_RADIAL_ACCE = 4; -- AOE when under SCH stratagem Accession
SPELLAOE_PIANISSIMO = 5; -- Single target when under BRD JA Pianissimo
SPELLAOE_DIFFUSION = 6; -- AOE when under Diffusion
------------------------------------
-- Spell flag bits
------------------------------------
SPELLFLAG_NONE = 0;
SPELLFLAG_HIT_ALL = 1; -- hit all targets in range regardless of party
------------------------------------
-- Behaviour bits
------------------------------------
BEHAVIOUR_NONE = 0x000;
BEHAVIOUR_NO_DESPAWN = 0x001; -- mob does not despawn on death
BEHAVIOUR_STANDBACK = 0x002; -- mob will standback forever
BEHAVIOUR_RAISABLE = 0x004; -- mob can be raised via Raise spells
BEHAVIOUR_AGGRO_AMBUSH = 0x200; -- mob aggroes by ambush
BEHAVIOUR_NO_TURN = 0x400; -- mob does not turn to face target
------------------------------------
-- Elevator IDs
------------------------------------
ELEVATOR_KUFTAL_TUNNEL_DSPPRNG_RCK = 1;
ELEVATOR_PORT_BASTOK_DRWBRDG = 2;
ELEVATOR_DAVOI_LIFT = 3;
ELEVATOR_PALBOROUGH_MINES_LIFT = 4;
| gpl-3.0 |
Sonicrich05/FFXI-Server | scripts/zones/Southern_San_dOria_[S]/npcs/Geltpix.lua | 36 | 1165 | -----------------------------------
-- Area: Southern SandOria [S]
-- NPC: Geltpix
-- @zone 80
-- @pos 154 -2 103
-----------------------------------
package.loaded["scripts/zones/Southern_San_dOria_[S]/TextIDs"] = nil;
require("scripts/zones/Southern_San_dOria_[S]/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
player:showText(npc, 7043); -- Don't hurt poor Geltpix! Geltpix's just a merchant from Boodlix's Emporium in Jeuno. Kingdom vendors don't like gil, but Boodlix knows true value of new money.
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 |
Sonicrich05/FFXI-Server | scripts/zones/Aht_Urhgan_Whitegate/npcs/Milazahn.lua | 34 | 1033 | -----------------------------------
-- Area: Aht Urhgan Whitegate
-- NPC: Milazahn
-- Standard Info NPC
-----------------------------------
package.loaded["scripts/zones/Aht_Urhgan_Whitegate/TextIDs"] = nil;
-----------------------------------
require("scripts/zones/Aht_Urhgan_Whitegate/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
player:startEvent(0x0252);
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 |
madninja/activelua | test/test-base.lua | 1 | 8698 | ---
--- See LICENSE file in top directory for copyright information
local Base = require "ActiveLua.Base"
require "lunit"
lunit.setprivfenv()
lunit.import "assertions"
lunit.import "checks"
local base = lunit.TestCase("Base Class Methods")
function base:setup()
self.Organization = Base:extend("Organization", {
name = "string"
})
end
function base:teardown()
self.Organization:selfDestruct()
end
function base:test_className()
assert_equal("Organization", self.Organization:className())
assert_error("Expected error on undefined className",
function()
Tmp = Base:extend()
end)
end
function base:test_foreignKey()
assert_equal("organization_id", self.Organization:foreignKey())
assert_equal("person_organization_id",
self.Organization:foreignKey{ attributeName = "person"})
end
function base:test_attributeKey()
assert_equal("organization", self.Organization:attributeKey())
assert_equal("person",
self.Organization:attributeKey{ attributeName = "person"})
end
function base:test_tableName()
assert_equal("organization", self.Organization:tableName())
end
function base:test_connection()
assert_not_nil(self.Organization:connection())
end
function base:test_defaultSource()
assert_equal("store.db", self.Organization:defaultSource())
end
function base:test_defaultConnection()
assert_not_nil(self.Organization:defaultConnection())
end
function base:test_hasAttribute()
assert_true(self.Organization:hasAttribute("name"))
assert_false(self.Organization:hasAttribute("unknownAttribute"))
end
function base:test_addAttribute()
self.Organization:addAttribute("status", "string")
-- Attribute created?
assert_true(self.Organization:hasAttribute("status"))
-- Add attribute is test through the associations class definitions in setup.
-- Try a bad attribute here
assert_error("Expected failure on bad attribute type",
function()
self.Organization:addAttribut("bad", "unknownType")
end
)
-- Try adding an attribute that already exists but with a different type
assert_error("Expected existing typed attribute error",
function()
self.Organization:addAttribute("name", "integer")
end
)
end
function base:test_attributeTypes()
assert_not_nil(self.Organization:attributeTypes()["name"])
assert_nil(self.Organization:attributeTypes()["unknownAttribute"])
end
function base:test_hooks()
local value = false
local func = function(val)
value = val
end
self.Organization:addHook("test", func)
self.Organization:callHook("test", true)
assert_true(value)
-- Remove hook and ensure that it's not triggered again
self.Organization:removeHook("test", func)
self.Organization:callHook("test", false)
assert_true(value)
value = false
local errFunc = function(val)
error("Hook error")
end
self.Organization:addHook("test", errFunc)
self.Organization:addHook("test", func)
assert_error("Expected hook error", function()
self.Organization:callHook("test", true)
end)
assert_false(value)
end
local life = lunit.TestCase("Object lifecycle methods")
function life:setup()
self.Person = Base:extend("Person", {
tableName = function()
return "people"
end;
firstName = "string";
lastName = "string";
age = "integer";
})
end
function life:teardown()
self.Person:selfDestruct()
end
function life:test_new()
local jane= self.Person:new {
firstName = "Jane",
lastName = "Doddle"
}
assert_equal("Jane", jane:firstName())
assert_equal("Doddle", jane:lastName())
-- Check dirty,present and created
assert_false(jane:isCreated())
assert_false(jane:isPresent())
assert_true(jane:isDirty())
end
function life:test_create()
local jane = self.Person:create {
firstName = "Jane",
lastName = "Doe",
age = 22
}
local joe = self.Person:create {
firstName = "Joe",
lastName = "Smith",
age = 22
}
assert_equal(2, self.Person:count())
assert_equal(1, jane:id())
assert_equal("Doe", jane:lastName())
assert_equal(2, joe:id())
assert_equal(22, joe:age())
-- Check dirty, present and created
assert_true(jane:isCreated())
assert_true(jane:isPresent())
assert_false(jane:isDirty())
end
function life:test_createAll()
local prevCount = self.Person:count()
self.Person:createAll {
{firstName = "Sylvia"},
{firstName = "Sonny"},
{firstName = "Sonny"},
}
assert_equal(prevCount + 3, self.Person:count())
end
function life:test_deleteAll()
assert_equal(self.Person, self.Person:deleteAll{ firstName = "Sonny" })
assert_equal(0, self.Person:count{firstName = "Sonny"})
-- Also tests delete by id
local sylvia = self.Person:first{firstName = "Sylvia"}
self.Person:deleteAll(sylvia:id())
assert_nil(self.Person:first(sylvia:id()))
assert_false(sylvia:isPresent())
end
function life:test_first()
local jane = self.Person:first { firstName = "Jane" }
assert_equal("Doe", jane:lastName())
assert_equal(1, jane:id())
-- Test lookup by id
assert_equal("Doe", self.Person:first(jane:id()):lastName())
-- Test lookup failure
assert_nil(self.Person:first{ lastName = "unkownName" })
end
function life:test_update()
local joe = self.Person:first{
firstName = "Joe"
}
-- Using setter method
joe:lastNameSet("DoGood")
assert_false(joe:isDirty())
joe = assert_not_nil(self.Person:first(joe:id()))
assert_equal("DoGood", joe:lastName())
-- Using set attribute
joe:setAttribute("lastName", "Smith")
assert_false(joe:isDirty())
assert_equal("Smith", self.Person:first(joe:id()):lastName())
end
function life:test_refresh()
local joe = self.Person:create{ firstName = "Joe" }
local joe2 = self.Person:first(joe:id())
-- Update original
joe:lastNameSet("DoLittle")
assert_equal(nil, joe2:lastName())
-- Test basic
joe2:refresh()
assert_equal("DoLittle", joe2:lastName())
-- test destruction and refresh
joe:destroy()
assert_nil(joe2:refresh())
-- test uncreated object refresh
joe = self.Person:new{ firstName = "Joe" }
assert_nil(joe:refresh())
end
function life:test_freeze()
local jim = self.Person:create {
firstName = "Jim"
}
jim:freeze()
assert_true(jim:isFrozen())
assert_error("Expected frozen object", function()
jim:lastNameSet("DoGood")
end)
end
function life:test_destroy()
local jim = self.Person:create { firstName = "Jim" }
assert_equal(jim, jim:destroy())
assert_nil(self.Person:first(jim:id()))
assert_true(jim:isFrozen())
assert_false(jim:isPresent())
-- A frozen object is ignored when destroyed again
assert_equal(jim, jim:destroy())
-- Test destroy hooks
local jim = self.Person:create { firstName = "Jim" }
local func = function(id)
assert_equal(jim:id(), id)
end
self.Person:addHook("before-destroy", func)
self.Person:addHook("after-destroy", func)
jim:destroy()
self.Person:removeHook("before-destroy", func)
self.Person:removeHook("after-destroy", func)
end
function life:test_destroyAll()
self.Person:createAll{
{ firstName = "Jim"},
{ firstName = "Jim"},
}
assert_equal(self.Person, self.Person:destroyAll{ firstName = "Jim"})
assert_equal(0, self.Person:count{ firstName = "Jim"})
end
function life:test_transactionDo()
local prevCount = self.Person:count{ firstName = "Jim"}
self.Person:transactionDo(function()
self.Person:create{ firstName = "Jim"}
error("Transaction Error")
end)
assert_equal(prevCount, self.Person:count{ firstName = "Jim"})
end
function life:test_all()
local valid = {
{ firstName = "Jane"},
{ firstName = "Joe"},
}
-- Check with criteria and options
local stored = self.Person:all({ age = 22 }, {order = "lastName"})
assert_equal(2, stored:count())
for i = 1, 2 do
assert_equal(valid[i].firstName, stored[i]:firstName())
assert_equal(22, stored[i]:age())
i = i + 1
end
-- Check empty request
local all = self.Person:all()
assert_equal(self.Person:count(), all:count())
end
function life:test_ids()
-- Based on previoud test_all test,
assert_equal(2, #self.Person:ids{ age = 22 })
assert_equal(0, #self.Person:ids{firstName = "Unknown"})
end | mit |
Sonicrich05/FFXI-Server | scripts/globals/effects/agi_down.lua | 18 | 1092 | -----------------------------------
--
-- EFFECT_AGI_DOWN
--
-----------------------------------
require("scripts/globals/status");
-----------------------------------
-- onEffectGain Action
-----------------------------------
function onEffectGain(target,effect)
if ((target:getStat(MOD_AGI) - effect:getPower()) < 0) then
effect:setPower(target:getStat(MOD_AGI));
end
target:addMod(MOD_AGI,-effect:getPower());
end;
-----------------------------------
-- onEffectTick Action
-----------------------------------
function onEffectTick(target,effect)
-- the effect restore agility of 1 every 3 ticks.
local downAGI_effect_size = effect:getPower()
if (downAGI_effect_size > 0) then
effect:setPower(downAGI_effect_size - 1)
target:delMod(MOD_AGI,-1);
end
end;
-----------------------------------
-- onEffectLose Action
-----------------------------------
function onEffectLose(target,effect)
local downAGI_effect_size = effect:getPower()
if (downAGI_effect_size > 0) then
target:delMod(MOD_AGI,downAGI_effect_size);
end
end;
| gpl-3.0 |
nickguletskii/GLXOSD | src/glxosd/plugins/OSD/OSD.lua | 1 | 3591 | --[[
Copyright (C) 2016 Nick Guletskii
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
]]
local TextRenderer = require("rendering/TextRenderer")
local FontUtil = require("util/fontutil")
local OSD = {
}
OSD.__index = OSD;
function OSD:should_render()
return self.rendering_enabled
end
function OSD:each_data_provider(func)
for i, x in ipairs(self.data_providers) do
if x~=nil then
local status, err = pcall(function() func(x) end)
if not status then
log_error("Error while acting upon data provider: ".. err)
end
end
end
end
function OSD:begin_frame()
local current_time = get_monotonic_time_nanoseconds();
if(self.last_text_reset <= current_time - self.config.refresh_time* 1000000) then
self.rebuild_text = true
self.has_timespan = true
self.last_text_reset = current_time
end
self:each_data_provider(function(data_provider)
data_provider:begin_frame()
end)
end
function OSD:end_frame()
self:each_data_provider(function(data_provider)
data_provider:end_frame()
end)
end
function OSD:render(width, height)
self:init_renderer();
if self.rebuild_text then
local text = {}
self:each_data_provider(function(data_provider)
local tbl = data_provider:get_text()
for _,v in ipairs(tbl) do
table.insert(text, v)
end
end)
self.text_renderer:set_text(text)
self.rebuild_text = false
end
self.text_renderer:render(width, height)
end
function OSD:consumes_keyboard_combo(key, modifiers)
return check_key_combo(self.config.toggle_key_combo, key, modifiers)
end
function OSD:handle_key_combo(key, modifiers)
if check_key_combo(self.config.toggle_key_combo, key, modifiers) then
self.rendering_enabled = not self.rendering_enabled
end
end
function OSD:destroy()
if self.text_renderer then
self.text_renderer:destroy()
end
end
function OSD:init_renderer()
if self.text_renderer then
return
end
self.text_renderer = TextRenderer.new(
self.config
);
self.text_renderer:set_text({})
end
function OSD.new(config, shared_state)
ConfigurationManager.check_schema(config,
TextRenderer.CONFIG_SCHEMA, false, "OSD plugin configuration")
local self ={}
setmetatable(self, OSD)
self.config = config
self.shared_state = shared_state
self.data_providers = {}
for i, data_provider in pairs(config.osd_data_providers) do
if data_provider ~= nil and data_provider.enabled then
table.insert(
self.data_providers,
require(data_provider.path)
.new(data_provider.config))
end
end
self.rendering_enabled = true
self.has_timespan = false;
self.last_text_reset = 0
self.rebuild_text = true
return self
end
return OSD;
| mit |
kidaa/ffxinfinity | FFXI Server-Development/Build Files/scripts/zones/Port_San_dOria/npcs/Leonora.lua | 4 | 1433 | -----------------------------------
-- Area: Port San d'Oria
-- NPC: Leonora
-- Involved in Quest:
-- @zone 232
-- @pos -24 -8 15
-----------------------------------
package.loaded["scripts/zones/Port_San_dOria/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/settings");
require("scripts/globals/quests");
require("scripts/zones/Port_San_dOria/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
-- "Flyers for Regine" conditional script
FlyerForRegine = player:getQuestStatus(SANDORIA,FLYERS_FOR_REGINE);
if (FlyerForRegine == 1) then
count = trade:getItemCount();
MagicFlyer = trade:hasItemQty(532,1);
if (MagicFlyer == true and count == 1) then
player:messageSpecial(FLYER_REFUSED);
end
end
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
if(player:getZPos() >= 12) then
player:startEvent(0x0206);
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 |
Sonicrich05/FFXI-Server | scripts/globals/items/truelove_chocolate.lua | 35 | 1232 | -----------------------------------------
-- ID: 5231
-- Item: truelove_chocolate
-- Food Effect: 4Hrs, All Races
-----------------------------------------
-- MP 10
-- MP Recovered While Healing 4
-----------------------------------------
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,5231);
end;
-----------------------------------------
-- onEffectGain Action
-----------------------------------------
function onEffectGain(target,effect)
target:addMod(MOD_MP, 10);
target:addMod(MOD_MPHEAL, 4);
end;
-----------------------------------------
-- onEffectLose Action
-----------------------------------------
function onEffectLose(target,effect)
target:delMod(MOD_MP, 10);
target:delMod(MOD_MPHEAL, 4);
end;
| gpl-3.0 |
mranzinger/axon | thirdparty/rapidjson/build/premake4.lua | 5 | 3441 | function setTargetObjDir(outDir)
for _, cfg in ipairs(configurations()) do
for _, plat in ipairs(platforms()) do
local action = _ACTION or ""
local prj = project()
--"_debug_win32_vs2008"
local suffix = "_" .. cfg .. "_" .. plat .. "_" .. action
targetPath = outDir
suffix = string.lower(suffix)
local obj_path = "../intermediate/" .. cfg .. "/" .. action .. "/" .. prj.name
obj_path = string.lower(obj_path)
configuration {cfg, plat}
targetdir(targetPath)
objdir(obj_path)
targetsuffix(suffix)
end
end
end
function linkLib(libBaseName)
for _, cfg in ipairs(configurations()) do
for _, plat in ipairs(platforms()) do
local action = _ACTION or ""
local prj = project()
local cfgName = cfg
--"_debug_win32_vs2008"
local suffix = "_" .. cfgName .. "_" .. plat .. "_" .. action
libFullName = libBaseName .. string.lower(suffix)
configuration {cfg, plat}
links(libFullName)
end
end
end
solution "test"
configurations { "debug", "release" }
platforms { "x32", "x64" }
location ("./" .. (_ACTION or ""))
language "C++"
flags { "ExtraWarnings" }
configuration "debug"
defines { "DEBUG" }
flags { "Symbols" }
configuration "release"
defines { "NDEBUG" }
flags { "Optimize" }
configuration "vs*"
defines { "_CRT_SECURE_NO_WARNINGS" }
configuration "gmake"
buildoptions "-msse4.2 -Werror=cast-qual"
project "gtest"
kind "StaticLib"
files {
"../thirdparty/gtest/src/gtest-all.cc",
"../thirdparty/gtest/src/**.h",
}
includedirs {
"../thirdparty/gtest/",
"../thirdparty/gtest/include",
}
setTargetObjDir("../thirdparty/lib")
project "unittest"
kind "ConsoleApp"
files {
"../include/**.h",
"../test/unittest/**.cpp",
"../test/unittest/**.h",
}
includedirs {
"../include/",
"../thirdparty/gtest/include/",
}
libdirs "../thirdparty/lib"
setTargetObjDir("../bin")
linkLib "gtest"
links "gtest"
project "perftest"
kind "ConsoleApp"
files {
"../include/**.h",
"../test/perftest/**.cpp",
"../test/perftest/**.c",
"../test/perftest/**.h",
}
includedirs {
"../include/",
"../thirdparty/gtest/include/",
"../thirdparty/",
"../thirdparty/jsoncpp/include/",
"../thirdparty/libjson/",
"../thirdparty/yajl/include/",
}
libdirs "../thirdparty/lib"
setTargetObjDir("../bin")
linkLib "gtest"
links "gtest"
solution "example"
configurations { "debug", "release" }
platforms { "x32", "x64" }
location ("./" .. (_ACTION or ""))
language "C++"
flags { "ExtraWarnings" }
includedirs "../include/"
configuration "debug"
defines { "DEBUG" }
flags { "Symbols" }
configuration "release"
defines { "NDEBUG" }
flags { "Optimize", "EnableSSE2" }
configuration "vs*"
defines { "_CRT_SECURE_NO_WARNINGS" }
project "condense"
kind "ConsoleApp"
files "../example/condense/*"
setTargetObjDir("../bin")
project "pretty"
kind "ConsoleApp"
files "../example/pretty/*"
setTargetObjDir("../bin")
project "tutorial"
kind "ConsoleApp"
files "../example/tutorial/*"
setTargetObjDir("../bin")
project "serialize"
kind "ConsoleApp"
files "../example/serialize/*"
setTargetObjDir("../bin")
| mit |
kidaa/ffxinfinity | FFXI Server-Development/Build Files/scripts/zones/Chateau_dOraguille/npcs/Perfaumand.lua | 2 | 1622 | -----------------------------------
-- Area: Chateau d'Oraguille
-- NPC: Perfaumand
-- Involved in Quest: Lure of the Wildcat (San d'Oria)
-- @pos -39 -3 69 233
-----------------------------------
package.loaded["scripts/zones/Chateau_dOraguille/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/quests");
require("scripts/zones/Chateau_dOraguille/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
if(player:getQuestStatus(SANDORIA,FLYERS_FOR_REGINE) == QUEST_ACCEPTED) then
if(trade:hasItemQty(532,1) and trade:getItemCount() == 1) then -- Trade Magicmart_flyer
player:messageSpecial(FLYER_REFUSED);
end
end
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
if(player:getQuestStatus(SANDORIA,LURE_OF_THE_WILDCAT_SAN_D_ORIA) == QUEST_ACCEPTED and player:getMaskBit(player:getVar("wildcatSandy_var"),19) == false) then
player:startEvent(0x0230);
else
player:startEvent(0x020a);
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 == 0x0230) then
player:setMaskBit(player:getVar("wildcatSandy_var"),"wildcatSandy_var",18,true);
end
end; | gpl-3.0 |
kidaa/ffxinfinity | FFXI Server-Development/Build Files/scripts/globals/items/dish_of_hydra_kofte_+1.lua | 3 | 1740 | -----------------------------------------
-- ID: 5603
-- Item: dish_of_hydra_kofte_+1
-- Food Effect: 240Min, All Races
-----------------------------------------
-- Strength 7
-- Intelligence -3
-- Attack % 21
-- Attack Cap 90
-- Defense % 21
-- Defense Cap 70
-- Ranged ATT % 20
-- Ranged ATT Cap 90
-- Poison Resist 5
-----------------------------------------
require("scripts/globals/status");
-----------------------------------------
-- OnItemCheck
-----------------------------------------
function onItemCheck(target)
local result = 0;
if (target:hasStatusEffect(EFFECT_FOOD) == true) then
result = 246;
end
return result;
end;
-----------------------------------------
-- OnItemUse
-----------------------------------------
function onItemUse(target)
target:addStatusEffect(EFFECT_FOOD,0,0,14400,5603);
end;
-----------------------------------
-- onEffectGain Action
-----------------------------------
function onEffectGain(target,effect)
target:addMod(MOD_STR, 7);
target:addMod(MOD_INT, -3);
target:addMod(MOD_FOOD_ATTP, 21);
target:addMod(MOD_FOOD_ATT_CAP, 90);
target:addMod(MOD_FOOD_DEFP, 21);
target:addMod(MOD_FOOD_DEF_CAP, 70);
target:addMod(MOD_FOOD_RATTP, 20);
target:addMod(MOD_FOOD_RATT_CAP, 90);
target:addMod(MOD_POISONRES, 5);
end;
-----------------------------------------
-- onEffectLose Action
-----------------------------------------
function onEffectLose(target,effect)
target:delMod(MOD_STR, 7);
target:delMod(MOD_INT, -3);
target:delMod(MOD_FOOD_ATTP, 21);
target:delMod(MOD_FOOD_ATT_CAP, 90);
target:delMod(MOD_FOOD_DEFP, 21);
target:delMod(MOD_FOOD_DEF_CAP, 70);
target:delMod(MOD_FOOD_RATTP, 20);
target:delMod(MOD_FOOD_RATT_CAP, 90);
target:delMod(MOD_POISONRES, 5);
end;
| gpl-3.0 |
kidaa/ffxinfinity | FFXI Server-Development/Build Files/scripts/zones/Windurst_Waters_[S]/npcs/Llewellyn.lua | 4 | 1051 | -----------------------------------
-- Area: Windurst Waters (S)
-- NPC: Llewellyn
-- Type: Campaign Evaluator
-- @zone: 94
-- @pos: -6.907 -2 42.871
--
-- Auto-Script: Requires Verification (Verified by Brawndo)
-----------------------------------
package.loaded["scripts/zones/Windurst_Waters_[S]/TextIDs"] = nil;
-----------------------------------
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
player:startEvent(0x000a);
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 |
Ding8222/skynet | lualib/skynet/db/redis/crc16.lua | 30 | 2687 | --/*
-- This is the CRC16 algorithm used by Redis Cluster to hash keys.
-- Implementation according to CCITT standards.
--
-- This is actually the XMODEM CRC 16 algorithm, using the
-- following parameters:
--
-- Name : "XMODEM", also known as "ZMODEM", "CRC-16/ACORN"
-- Width : 16 bit
-- Poly : 1021 (That is actually x^16 + x^12 + x^5 + 1)
-- Initialization : 0000
-- Reflect Input byte : False
-- Reflect Output CRC : False
-- Xor constant to output CRC : 0000
-- Output for "123456789" : 31C3
--*/
local XMODEMCRC16Lookup = {
0x0000,0x1021,0x2042,0x3063,0x4084,0x50a5,0x60c6,0x70e7,
0x8108,0x9129,0xa14a,0xb16b,0xc18c,0xd1ad,0xe1ce,0xf1ef,
0x1231,0x0210,0x3273,0x2252,0x52b5,0x4294,0x72f7,0x62d6,
0x9339,0x8318,0xb37b,0xa35a,0xd3bd,0xc39c,0xf3ff,0xe3de,
0x2462,0x3443,0x0420,0x1401,0x64e6,0x74c7,0x44a4,0x5485,
0xa56a,0xb54b,0x8528,0x9509,0xe5ee,0xf5cf,0xc5ac,0xd58d,
0x3653,0x2672,0x1611,0x0630,0x76d7,0x66f6,0x5695,0x46b4,
0xb75b,0xa77a,0x9719,0x8738,0xf7df,0xe7fe,0xd79d,0xc7bc,
0x48c4,0x58e5,0x6886,0x78a7,0x0840,0x1861,0x2802,0x3823,
0xc9cc,0xd9ed,0xe98e,0xf9af,0x8948,0x9969,0xa90a,0xb92b,
0x5af5,0x4ad4,0x7ab7,0x6a96,0x1a71,0x0a50,0x3a33,0x2a12,
0xdbfd,0xcbdc,0xfbbf,0xeb9e,0x9b79,0x8b58,0xbb3b,0xab1a,
0x6ca6,0x7c87,0x4ce4,0x5cc5,0x2c22,0x3c03,0x0c60,0x1c41,
0xedae,0xfd8f,0xcdec,0xddcd,0xad2a,0xbd0b,0x8d68,0x9d49,
0x7e97,0x6eb6,0x5ed5,0x4ef4,0x3e13,0x2e32,0x1e51,0x0e70,
0xff9f,0xefbe,0xdfdd,0xcffc,0xbf1b,0xaf3a,0x9f59,0x8f78,
0x9188,0x81a9,0xb1ca,0xa1eb,0xd10c,0xc12d,0xf14e,0xe16f,
0x1080,0x00a1,0x30c2,0x20e3,0x5004,0x4025,0x7046,0x6067,
0x83b9,0x9398,0xa3fb,0xb3da,0xc33d,0xd31c,0xe37f,0xf35e,
0x02b1,0x1290,0x22f3,0x32d2,0x4235,0x5214,0x6277,0x7256,
0xb5ea,0xa5cb,0x95a8,0x8589,0xf56e,0xe54f,0xd52c,0xc50d,
0x34e2,0x24c3,0x14a0,0x0481,0x7466,0x6447,0x5424,0x4405,
0xa7db,0xb7fa,0x8799,0x97b8,0xe75f,0xf77e,0xc71d,0xd73c,
0x26d3,0x36f2,0x0691,0x16b0,0x6657,0x7676,0x4615,0x5634,
0xd94c,0xc96d,0xf90e,0xe92f,0x99c8,0x89e9,0xb98a,0xa9ab,
0x5844,0x4865,0x7806,0x6827,0x18c0,0x08e1,0x3882,0x28a3,
0xcb7d,0xdb5c,0xeb3f,0xfb1e,0x8bf9,0x9bd8,0xabbb,0xbb9a,
0x4a75,0x5a54,0x6a37,0x7a16,0x0af1,0x1ad0,0x2ab3,0x3a92,
0xfd2e,0xed0f,0xdd6c,0xcd4d,0xbdaa,0xad8b,0x9de8,0x8dc9,
0x7c26,0x6c07,0x5c64,0x4c45,0x3ca2,0x2c83,0x1ce0,0x0cc1,
0xef1f,0xff3e,0xcf5d,0xdf7c,0xaf9b,0xbfba,0x8fd9,0x9ff8,
0x6e17,0x7e36,0x4e55,0x5e74,0x2e93,0x3eb2,0x0ed1,0x1ef0
}
return function(bytes)
local crc = 0
for i=1,#bytes do
local b = string.byte(bytes,i,i)
crc = ((crc<<8) & 0xffff) ~ XMODEMCRC16Lookup[(((crc>>8)~b) & 0xff) + 1]
end
return tonumber(crc)
end
| mit |
bright-things/ionic-luci | modules/luci-mod-rpc/luasrc/controller/rpc.lua | 37 | 4466 | -- Copyright 2008 Steven Barth <steven@midlink.org>
-- Copyright 2008 Jo-Philipp Wich <jow@openwrt.org>
-- Licensed to the public under the Apache License 2.0.
local require = require
local pairs = pairs
local print = print
local pcall = pcall
local table = table
module "luci.controller.rpc"
function index()
local function authenticator(validator, accs)
local auth = luci.http.formvalue("auth", true)
if auth then -- if authentication token was given
local sdat = (luci.util.ubus("session", "get", { ubus_rpc_session = auth }) or { }).values
if sdat then -- if given token is valid
if sdat.user and luci.util.contains(accs, sdat.user) then
return sdat.user, auth
end
end
end
luci.http.status(403, "Forbidden")
end
local rpc = node("rpc")
rpc.sysauth = "root"
rpc.sysauth_authenticator = authenticator
rpc.notemplate = true
entry({"rpc", "uci"}, call("rpc_uci"))
entry({"rpc", "fs"}, call("rpc_fs"))
entry({"rpc", "sys"}, call("rpc_sys"))
entry({"rpc", "ipkg"}, call("rpc_ipkg"))
entry({"rpc", "auth"}, call("rpc_auth")).sysauth = false
end
function rpc_auth()
local jsonrpc = require "luci.jsonrpc"
local http = require "luci.http"
local sys = require "luci.sys"
local ltn12 = require "luci.ltn12"
local util = require "luci.util"
local loginstat
local server = {}
server.challenge = function(user, pass)
local sid, token, secret
local config = require "luci.config"
if sys.user.checkpasswd(user, pass) then
local sdat = util.ubus("session", "create", { timeout = config.sauth.sessiontime })
if sdat then
sid = sdat.ubus_rpc_session
token = sys.uniqueid(16)
secret = sys.uniqueid(16)
http.header("Set-Cookie", "sysauth="..sid.."; path=/")
util.ubus("session", "set", {
ubus_rpc_session = sid,
values = {
user = user,
token = token,
secret = secret
}
})
end
end
return sid and {sid=sid, token=token, secret=secret}
end
server.login = function(...)
local challenge = server.challenge(...)
return challenge and challenge.sid
end
http.prepare_content("application/json")
ltn12.pump.all(jsonrpc.handle(server, http.source()), http.write)
end
function rpc_uci()
if not pcall(require, "luci.model.uci") then
luci.http.status(404, "Not Found")
return nil
end
local uci = require "luci.jsonrpcbind.uci"
local jsonrpc = require "luci.jsonrpc"
local http = require "luci.http"
local ltn12 = require "luci.ltn12"
http.prepare_content("application/json")
ltn12.pump.all(jsonrpc.handle(uci, http.source()), http.write)
end
function rpc_fs()
local util = require "luci.util"
local io = require "io"
local fs2 = util.clone(require "nixio.fs")
local jsonrpc = require "luci.jsonrpc"
local http = require "luci.http"
local ltn12 = require "luci.ltn12"
function fs2.readfile(filename)
local stat, mime = pcall(require, "mime")
if not stat then
error("Base64 support not available. Please install LuaSocket.")
end
local fp = io.open(filename)
if not fp then
return nil
end
local output = {}
local sink = ltn12.sink.table(output)
local source = ltn12.source.chain(ltn12.source.file(fp), mime.encode("base64"))
return ltn12.pump.all(source, sink) and table.concat(output)
end
function fs2.writefile(filename, data)
local stat, mime = pcall(require, "mime")
if not stat then
error("Base64 support not available. Please install LuaSocket.")
end
local file = io.open(filename, "w")
local sink = file and ltn12.sink.chain(mime.decode("base64"), ltn12.sink.file(file))
return sink and ltn12.pump.all(ltn12.source.string(data), sink) or false
end
http.prepare_content("application/json")
ltn12.pump.all(jsonrpc.handle(fs2, http.source()), http.write)
end
function rpc_sys()
local sys = require "luci.sys"
local jsonrpc = require "luci.jsonrpc"
local http = require "luci.http"
local ltn12 = require "luci.ltn12"
http.prepare_content("application/json")
ltn12.pump.all(jsonrpc.handle(sys, http.source()), http.write)
end
function rpc_ipkg()
if not pcall(require, "luci.model.ipkg") then
luci.http.status(404, "Not Found")
return nil
end
local ipkg = require "luci.model.ipkg"
local jsonrpc = require "luci.jsonrpc"
local http = require "luci.http"
local ltn12 = require "luci.ltn12"
http.prepare_content("application/json")
ltn12.pump.all(jsonrpc.handle(ipkg, http.source()), http.write)
end
| apache-2.0 |
fruitwasp/DarkRP | gamemode/modules/hungermod/cl_f4foodtab.lua | 2 | 1357 | local PANEL = {}
local function canBuyFood(food)
local ply = LocalPlayer()
if (food.requiresCook == nil or food.requiresCook == true) and not ply:isCook() then return false, true end
if food.customCheck and not food.customCheck(LocalPlayer()) then return false, false end
if not ply:canAfford(food.price) then return false, false end
return true
end
function PANEL:generateButtons()
for _, v in pairs(FoodItems) do
local pnl = vgui.Create("F4MenuEntityButton", self)
pnl:setDarkRPItem(v)
pnl.DoClick = fn.Partial(RunConsoleCommand, "DarkRP", "buyfood", v.name)
self:AddItem(pnl)
end
end
function PANEL:shouldHide()
for _, v in pairs(FoodItems) do
local canBuy, important = canBuyFood(v)
if not self:isItemHidden(not canBuy, important) then return false end
end
return true
end
function PANEL:PerformLayout()
for _, v in pairs(self.Items) do
local canBuy, important = canBuyFood(v.DarkRPItem)
v:SetDisabled(not canBuy, important)
end
self.BaseClass.PerformLayout(self)
end
derma.DefineControl("F4MenuFood", "DarkRP F4 Food Tab", PANEL, "F4MenuEntitiesBase")
hook.Add("F4MenuTabs", "HungerMod_F4Tabs", function()
if #FoodItems > 0 then
DarkRP.addF4MenuTab(DarkRP.getPhrase("Food"), vgui.Create("F4MenuFood"))
end
end)
| mit |
Sonicrich05/FFXI-Server | scripts/zones/Uleguerand_Range/npcs/HomePoint#2.lua | 19 | 1189 | -----------------------------------
-- Area: Uleguerand_Range
-- NPC: HomePoint#2
-- @pos
-----------------------------------
package.loaded["scripts/zones/Uleguerand_Range/TextIDs"] = nil;
require("scripts/globals/settings");
require("scripts/zones/Uleguerand_Range/TextIDs");
require("scripts/globals/homepoint");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
homepointMenu( player, 0x21fd, 77);
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
if (csid == 0x21fd) then
if (option == 1) then
player:setHomePoint();
player:messageSpecial(HOMEPOINT_SET);
else
hpTeleport( player, option);
end
end
end; | gpl-3.0 |
Servius/tfa-sw-weapons-repository | Backups_Reworks/tfa_wsp_extended_assets/lua/weapons/tfa_wsp_2/shared.lua | 1 | 4870 | if ( SERVER ) then
AddCSLuaFile( "shared.lua" )
end
if ( CLIENT ) then
SWEP.PrintName = "DH-17R"
SWEP.Author = "TFA, Servius"
SWEP.ViewModelFOV = 76.381909547739
SWEP.Slot = 2
SWEP.SlotPos = 3
end
SWEP.HoldType = "ar2"
SWEP.Base = "tfa_3dscoped_base"
SWEP.Category = "TFA Star Wars"
SWEP.Spawnable = true
SWEP.AdminSpawnable = true
SWEP.HoldType = "ar2"
SWEP.ViewModelFOV = 76.381909547739
SWEP.ViewModelFlip = false
SWEP.ViewModel = "models/weapons/cstrike/c_snip_awp.mdl"
SWEP.WorldModel = "models/weapons/w_dc15sa.mdl"
SWEP.ShowViewModel = true
SWEP.ShowWorldModel = false
SWEP.UseHands = true
SWEP.ViewModelBoneMods = {
["v_weapon.awm_parent"] = { scale = Vector(0.009, 0.009, 0.009), pos = Vector(0.925, -0.556, 0.185), angle = Angle(0, 0, 0) }
}
SWEP.Primary.Sound = Sound ("weapons/wpn_cis_sniperrifle_fire.wav");
SWEP.Primary.ReloadSound = Sound ("weapons/DC15A_reload.wav");
SWEP.Primary.KickUp = 2
SWEP.Weight = 5
SWEP.AutoSwitchTo = false
SWEP.AutoSwitchFrom = false
SWEP.Primary.Recoil = 0.5
SWEP.Primary.Damage = 65
SWEP.Primary.NumShots = 1
SWEP.Primary.Spread = 0.0125
SWEP.Primary.IronAccuracy = .001 -- Ironsight accuracy, should be the same for shotguns
SWEP.Primary.ClipSize = 25
SWEP.Primary.RPM = 200
SWEP.Primary.DefaultClip = 50
SWEP.Primary.Automatic = false
SWEP.Primary.Ammo = "ar2"
SWEP.SelectiveFire = false --Allow selecting your firemode?
SWEP.DisableBurstFire = false --Only auto/single?
SWEP.OnlyBurstFire = false --No auto, only burst/single?
SWEP.DefaultFireMode = "single" --Default to auto or whatev
SWEP.FireModeName = nil --Change to a text value to override it
SWEP.Secondary.Automatic = false
SWEP.Secondary.Ammo = "none"
SWEP.Secondary.IronFOV = 70
SWEP.IronSightsPos = Vector(-7.68, -4.824, 1.32)
SWEP.IronSightsAng = Vector(0, 0, 0)
SWEP.VElements = {
["element_scope"] = { type = "Model", model = "models/rtcircle.mdl", bone = "v_weapon.awm_parent", rel = "element_name", pos = Vector(-0.801, 2.609, 6.8), angle = Angle(0, -90, 0), size = Vector(0.389, 0.389, 0.389), color = Color(255, 255, 255, 255), surpresslightning = false, material = "!tfa_rtmaterial", skin = 0, bodygroup = {} },
["element_name"] = { type = "Model", model = "models/wps_dh17r/wps_dh17r.mdl", bone = "v_weapon.awm_parent", rel = "", pos = Vector(0.518, -0.519, -1.558), angle = Angle(1.169, 0, -90), size = Vector(0.755, 0.755, 0.755), color = Color(255, 255, 255, 255), surpresslightning = false, material = "", skin = 0, bodygroup = {} }
}
SWEP.WElements = {
["element_scope"] = { type = "Model", model = "models/rtcircle.mdl", bone = "ValveBiped.Bip01_R_Hand", rel = "element_name", pos = Vector(-0.7, 2.7, 6.3), angle = Angle(0, -90, 0), size = Vector(0.338, 0.338, 0.338), color = Color(255, 255, 255, 255), surpresslightning = false, material = "!tfa_rtmaterial", skin = 0, bodygroup = {} },
["element_name"] = { type = "Model", model = "models/wps_dh17r/wps_dh17r.mdl", bone = "ValveBiped.Bip01_R_Hand", rel = "", pos = Vector(6.752, 0.518, -0.5), angle = Angle(180, -90, 12.857), size = Vector(0.69, 0.69, 0.69), color = Color(255, 255, 255, 255), surpresslightning = false, material = "", skin = 0, bodygroup = {} }
}
SWEP.BlowbackVector = Vector(0,-3,0.025)
SWEP.Blowback_Only_Iron = false
SWEP.DoProceduralReload = true
SWEP.ProceduralReloadTime = 2.5
----Swft Base Code
SWEP.TracerCount = 1
SWEP.MuzzleFlashEffect = ""
SWEP.TracerName = "effect_sw_laser_red_sniper"
SWEP.Secondary.IronFOV = 70
SWEP.Primary.KickUp = 0.2
SWEP.Primary.KickDown = 0.1
SWEP.Primary.KickHorizontal = 0.1
SWEP.Primary.KickRight = 0.1
SWEP.DisableChambering = true
SWEP.ImpactDecal = "FadingScorch"
SWEP.ImpactEffect = "effect_sw_impact" --Impact Effect
SWEP.RunSightsPos = Vector(2.127, 0, 1.355)
SWEP.RunSightsAng = Vector(-15.775, 10.023, -5.664)
SWEP.BlowbackEnabled = true
SWEP.BlowbackVector = Vector(0,-3,0.1)
SWEP.Blowback_Shell_Enabled = false
SWEP.Blowback_Shell_Effect = ""
SWEP.ThirdPersonReloadDisable=false
SWEP.Primary.DamageType = DMG_SHOCK
SWEP.DamageType = DMG_SHOCK
--3dScopedBase stuff
SWEP.RTMaterialOverride = -1
SWEP.RTScopeAttachment = -1
SWEP.Scoped_3D = true
SWEP.ScopeReticule = "scope/gdcw_green_nobar"
SWEP.Secondary.ScopeZoom = 7
SWEP.ScopeReticule_Scale = {3,3}
SWEP.Secondary.UseACOG = false --Overlay option
SWEP.Secondary.UseMilDot = false --Overlay option
SWEP.Secondary.UseSVD = false --Overlay option
SWEP.Secondary.UseParabolic = false --Overlay option
SWEP.Secondary.UseElcan = false --Overlay option
SWEP.Secondary.UseGreenDuplex = false --Overlay option
if surface then
SWEP.Secondary.ScopeTable = nil --[[
{
scopetex = surface.GetTextureID("scope/gdcw_closedsight"),
reticletex = surface.GetTextureID("scope/gdcw_acogchevron"),
dottex = surface.GetTextureID("scope/gdcw_acogcross")
}
]]--
end
DEFINE_BASECLASS( SWEP.Base ) | apache-2.0 |
daVoodooShuffle/OpenRA | mods/ra/maps/soviet-06a/soviet06a-reinforcements_teams.lua | 14 | 1668 | --[[
Copyright 2007-2017 The OpenRA Developers (see AUTHORS)
This file is part of OpenRA, which is free software. It is made
available to you under the terms of the GNU General Public License
as published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later version. For more
information, see COPYING.
]]
EnemyReinforcements =
{
easy =
{
{ "e1", "e1", "e3" },
{ "e1", "e3", "jeep" },
{ "e1", "jeep", "1tnk" }
},
normal =
{
{ "e1", "e1", "e3", "e3" },
{ "e1", "e3", "jeep", "jeep" },
{ "e1", "jeep", "1tnk", "2tnk" }
},
hard =
{
{ "e1", "e1", "e3", "e3", "e1" },
{ "e1", "e3", "jeep", "jeep", "1tnk" },
{ "e1", "jeep", "1tnk", "2tnk", "arty" }
}
}
EnemyAttackDelay =
{
easy = DateTime.Minutes(5),
normal = DateTime.Minutes(2) + DateTime.Seconds(40),
hard = DateTime.Minutes(1) + DateTime.Seconds(30)
}
EnemyPaths =
{
{ EnemyEntry1.Location, EnemyRally1.Location },
{ EnemyEntry2.Location, EnemyRally2.Location }
}
wave = 0
SendEnemies = function()
Trigger.AfterDelay(EnemyAttackDelay[Map.LobbyOption("difficulty")], function()
wave = wave + 1
if wave > 3 then
wave = 1
end
if wave == 1 then
local units = Reinforcements.ReinforceWithTransport(enemy, "tran", EnemyReinforcements[Map.LobbyOption("difficulty")][wave], EnemyPaths[1], { EnemyPaths[1][1] })[2]
Utils.Do(units, IdleHunt)
else
local units = Reinforcements.ReinforceWithTransport(enemy, "lst", EnemyReinforcements[Map.LobbyOption("difficulty")][wave], EnemyPaths[2], { EnemyPaths[2][1] })[2]
Utils.Do(units, IdleHunt)
end
if not Dome.IsDead then
SendEnemies()
end
end)
end
| gpl-3.0 |
daVoodooShuffle/OpenRA | mods/ra/maps/soviet-06b/soviet06b-reinforcements_teams.lua | 14 | 1668 | --[[
Copyright 2007-2017 The OpenRA Developers (see AUTHORS)
This file is part of OpenRA, which is free software. It is made
available to you under the terms of the GNU General Public License
as published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later version. For more
information, see COPYING.
]]
EnemyReinforcements =
{
easy =
{
{ "e1", "e1", "e3" },
{ "e1", "e3", "jeep" },
{ "e1", "jeep", "1tnk" }
},
normal =
{
{ "e1", "e1", "e3", "e3" },
{ "e1", "e3", "jeep", "jeep" },
{ "e1", "jeep", "1tnk", "2tnk" }
},
hard =
{
{ "e1", "e1", "e3", "e3", "e1" },
{ "e1", "e3", "jeep", "jeep", "1tnk" },
{ "e1", "jeep", "1tnk", "2tnk", "arty" }
}
}
EnemyAttackDelay =
{
easy = DateTime.Minutes(5),
normal = DateTime.Minutes(2) + DateTime.Seconds(40),
hard = DateTime.Minutes(1) + DateTime.Seconds(30)
}
EnemyPaths =
{
{ EnemyEntry1.Location, EnemyRally1.Location },
{ EnemyEntry2.Location, EnemyRally2.Location }
}
wave = 0
SendEnemies = function()
Trigger.AfterDelay(EnemyAttackDelay[Map.LobbyOption("difficulty")], function()
wave = wave + 1
if wave > 3 then
wave = 1
end
if wave == 1 then
local units = Reinforcements.ReinforceWithTransport(enemy, "tran", EnemyReinforcements[Map.LobbyOption("difficulty")][wave], EnemyPaths[1], { EnemyPaths[1][1] })[2]
Utils.Do(units, IdleHunt)
else
local units = Reinforcements.ReinforceWithTransport(enemy, "lst", EnemyReinforcements[Map.LobbyOption("difficulty")][wave], EnemyPaths[2], { EnemyPaths[2][1] })[2]
Utils.Do(units, IdleHunt)
end
if not Dome.IsDead then
SendEnemies()
end
end)
end
| gpl-3.0 |
FelixPe/nodemcu-firmware | tests/utils/NTestTapOut.lua | 5 | 1173 | -- This is a NTest output handler that formats its output in a way that
-- resembles the Test Anything Protocol (though prefixed with "TAP: " so we can
-- more readily find it in comingled output streams).
local nrun
return function(e, test, msg, err)
msg = msg or ""
err = err or ""
if e == "pass" then
print(("\nTAP: ok %d %s # %s"):format(nrun, test, msg))
nrun = nrun + 1
elseif e == "fail" then
print(("\nTAP: not ok %d %s # %s: %s"):format(nrun, test, msg, err))
nrun = nrun + 1
elseif e == "except" then
print(("\nTAP: not ok %d %s # exn; %s: %s"):format(nrun, test, msg, err))
nrun = nrun + 1
elseif e == "abort" then
print(("\nTAP: Bail out! %d %s # exn; %s: %s"):format(nrun, test, msg, err))
elseif e == "start" then
-- We don't know how many tests we plan to run, so emit a comment instead
print(("\nTAP: # STARTUP %s"):format(test))
nrun = 1
elseif e == "finish" then
-- Ah, now, here we go; we know how many tests we ran, so signal completion
print(("\nTAP: POST 1..%d"):format(nrun))
elseif #msg ~= 0 or #err ~= 0 then
print(("\nTAP: # %s: %s: %s"):format(test, msg, err))
end
end
| mit |
Sonicrich05/FFXI-Server | scripts/zones/Misareaux_Coast/npcs/Logging_Point.lua | 29 | 1107 | -----------------------------------
-- Area: Misareaux Coast
-- NPC: Logging Point
-----------------------------------
package.loaded["scripts/zones/Misareaux_Coast/TextIDs"] = nil;
-------------------------------------
require("scripts/globals/logging");
require("scripts/zones/Misareaux_Coast/TextIDs");
-----------------------------------
-- onTrade
-----------------------------------
function onTrade(player,npc,trade)
startLogging(player,player:getZoneID(),npc,trade,0x022B);
end;
-----------------------------------
-- onTrigger
-----------------------------------
function onTrigger(player,npc)
player:messageSpecial(LOGGING_IS_POSSIBLE_HERE,1021);
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 |
Sonicrich05/FFXI-Server | scripts/zones/Sea_Serpent_Grotto/npcs/Grounds_Tome.lua | 34 | 1151 | -----------------------------------
-- Area: Sea Serpent Grotto
-- NPC: Grounds Tome
-----------------------------------
require("scripts/globals/settings");
require("scripts/globals/groundsofvalor");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
startGov(GOV_EVENT_SEA_SERPENT_GROTTO,player);
end;
-----------------------------------
-- onEventSelection
-----------------------------------
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
updateGov(player,csid,option,804,805,806,807,808,809,810,811,0,0);
end;
-----------------------------------
-- onEventFinish Action
-----------------------------------
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
finishGov(player,csid,option,804,805,806,807,808,809,810,811,0,0,GOV_MSG_SEA_SERPENT_GROTTO);
end;
| gpl-3.0 |
premake/premake-core | modules/xcode/tests/test_xcode_project.lua | 3 | 122159 | --
-- tests/actions/xcode/test_xcode_project.lua
-- Automated test suite for Xcode project generation.
-- Copyright (c) 2009-2011 Jason Perkins and the Premake project
--
local suite = test.declare("xcode_project")
local p = premake
local xcode = p.modules.xcode
---------------------------------------------------------------------------
-- Setup/Teardown
---------------------------------------------------------------------------
local tr, wks
function suite.teardown()
tr = nil
end
function suite.setup()
_TARGET_OS = "macosx"
p.action.set('xcode4')
p.eol("\n")
wks = test.createWorkspace()
end
local function prepare()
wks = p.oven.bakeWorkspace(wks)
xcode.prepareWorkspace(wks)
local prj = test.getproject(wks, 1)
tr = xcode.buildprjtree(prj)
end
---------------------------------------------------------------------------
-- PBXBuildFile tests
---------------------------------------------------------------------------
function suite.PBXBuildFile_ListsCppSources()
files { "source.h", "source.c", "source.cpp", "Info.plist" }
prepare()
xcode.PBXBuildFile(tr)
test.capture [[
/* Begin PBXBuildFile section */
7018C364CB5A16D69EB461A4 /* source.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9B47484CB259E37EA275DE8C /* source.cpp */; };
F3989C244A260696229F1A64 /* source.c in Sources */ = {isa = PBXBuildFile; fileRef = 7DC6D30C8137A53E02A4494C /* source.c */; };
/* End PBXBuildFile section */
]]
end
function suite.PBXBuildFile_ListsObjCSources()
files { "source.h", "source.m", "source.mm", "Info.plist" }
prepare()
xcode.PBXBuildFile(tr)
test.capture [[
/* Begin PBXBuildFile section */
8A01A092B9936F8494A0AED2 /* source.mm in Sources */ = {isa = PBXBuildFile; fileRef = CCAA329A6F98594CFEBE38DA /* source.mm */; };
CBA890782235FAEAFAAF0EB8 /* source.m in Sources */ = {isa = PBXBuildFile; fileRef = 3AFE9C203E6F6E52BFDC1260 /* source.m */; };
/* End PBXBuildFile section */
]]
end
function suite.PBXBuildFile_ListsSwiftSources()
files { "source.swift", "Info.plist" }
prepare()
xcode.PBXBuildFile(tr)
test.capture [[
/* Begin PBXBuildFile section */
4616E7383FD8A3AA79D7A578 /* source.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0B2BDAE0539CBF12983B9120 /* source.swift */; };
/* End PBXBuildFile section */
]]
end
function suite.PBXBuildFile_ListsMetalFileInResources()
files { "source.metal", "Info.plist" }
prepare()
xcode.PBXBuildFile(tr)
test.capture [[
/* Begin PBXBuildFile section */
3873A08432355CF66C345EC4 /* source.metal in Resources */ = {isa = PBXBuildFile; fileRef = 35B2856C7E23699EC2C23BAC /* source.metal */; };
/* End PBXBuildFile section */
]]
end
function suite.PBXBuildFile_ListsResourceFilesOnlyOnceWithGroupID()
files { "English.lproj/MainMenu.xib", "French.lproj/MainMenu.xib" }
prepare()
xcode.PBXBuildFile(tr)
test.capture [[
/* Begin PBXBuildFile section */
6FE0F2A3E16C0B15906D30E3 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6CB8FB6B191BBB9DD7A431AB /* MainMenu.xib */; };
/* End PBXBuildFile section */
]]
end
function suite.PBXBuildFile_ListsFrameworks()
links { "Cocoa.framework", "ldap" }
prepare()
xcode.PBXBuildFile(tr)
test.capture [[
/* Begin PBXBuildFile section */
F8E8DBA28B76A594F44F49E2 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8D6BC6AA50D7885C8F7B2CEA /* Cocoa.framework */; };
/* End PBXBuildFile section */
]]
end
function suite.PBXBuildFile_ListsDylibs()
links { "../libA.dylib", "libB.dylib", "/usr/lib/libC.dylib" }
prepare()
xcode.PBXBuildFile(tr)
test.capture [[
/* Begin PBXBuildFile section */
3C98627697D9B5E86B3400B6 /* libB.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = D413533EEB25EE70DB41E97E /* libB.dylib */; };
91686CDFDECB631154EA631F /* libA.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 5F9AE5C74A870BB9926CD407 /* libA.dylib */; };
A7E42B5676077F08FD15D196 /* libC.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = CF0547FE2A469B70FDA0E63E /* libC.dylib */; };
/* End PBXBuildFile section */
]]
end
function suite.PBXBuildFile_ListsFrameworksAndDylibsForSigning()
links
{
"../libA.dylib",
"libB.dylib",
"/usr/lib/libC.dylib",
"../D.framework",
"../E.framework",
}
embedAndSign
{
"libA.dylib",
"D.framework",
}
embed
{
"libB.dylib",
"E.framework",
}
prepare()
xcode.PBXBuildFile(tr)
test.capture [[
/* Begin PBXBuildFile section */
12F1B82D44EB02DFBECA3E6D /* E.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A817AE35FEA518A7D71E2C75 /* E.framework */; };
6557012668C7D358EA347766 /* E.framework in Embed Libraries */ = {isa = PBXBuildFile; fileRef = A817AE35FEA518A7D71E2C75 /* E.framework */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
3C98627697D9B5E86B3400B6 /* libB.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = D413533EEB25EE70DB41E97E /* libB.dylib */; };
AC7C2020DB2274123463CE60 /* libB.dylib in Embed Libraries */ = {isa = PBXBuildFile; fileRef = D413533EEB25EE70DB41E97E /* libB.dylib */; };
91686CDFDECB631154EA631F /* libA.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 5F9AE5C74A870BB9926CD407 /* libA.dylib */; };
E054F1BF0EFB45B1683C9FFF /* libA.dylib in Embed Libraries */ = {isa = PBXBuildFile; fileRef = 5F9AE5C74A870BB9926CD407 /* libA.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
A7E42B5676077F08FD15D196 /* libC.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = CF0547FE2A469B70FDA0E63E /* libC.dylib */; };
F56B754B2764BFFDA143FB8B /* D.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F3987C734A25E6E5229EFAB3 /* D.framework */; };
966D8A4599DE5C771B4B0085 /* D.framework in Embed Libraries */ = {isa = PBXBuildFile; fileRef = F3987C734A25E6E5229EFAB3 /* D.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
/* End PBXBuildFile section */
]]
end
function suite.PBXBuildFile_IgnoresVpaths()
files { "source.h", "source.c", "source.cpp", "Info.plist" }
vpaths { ["Source Files"] = { "**.c", "**.cpp" } }
prepare()
xcode.PBXBuildFile(tr)
test.capture [[
/* Begin PBXBuildFile section */
7018C364CB5A16D69EB461A4 /* source.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9B47484CB259E37EA275DE8C /* source.cpp */; };
F3989C244A260696229F1A64 /* source.c in Sources */ = {isa = PBXBuildFile; fileRef = 7DC6D30C8137A53E02A4494C /* source.c */; };
/* End PBXBuildFile section */
]]
end
---
-- Verify that files listed in xcodebuildresources are marked as resources
---
function suite.PBXBuildFile_ListsXcodeBuildResources()
files { "file1.txt", "file01.png", "file02.png", "file-3.png" }
xcodebuildresources { "file1.txt", "**.png" }
prepare()
xcode.PBXBuildFile(tr)
test.capture [[
/* Begin PBXBuildFile section */
628F3826BDD08B98912AD666 /* file-3.png in Resources */ = {isa = PBXBuildFile; fileRef = 992385EEB0362120A0521C2E /* file-3.png */; };
93485EDEC2DA2DD09DE76D1E /* file1.txt in Resources */ = {isa = PBXBuildFile; fileRef = 9F78562642667CD8D18C5C66 /* file1.txt */; };
C87AFEAA23BC521CF7169CEA /* file02.png in Resources */ = {isa = PBXBuildFile; fileRef = D54D8E32EC602964DC7C2472 /* file02.png */; };
EE9FC5C849E1193A1D3B6408 /* file01.png in Resources */ = {isa = PBXBuildFile; fileRef = 989B7E70AFAE19A29FCA14B0 /* file01.png */; };
/* End PBXBuildFile section */
]]
end
---------------------------------------------------------------------------
-- PBXFileReference tests
---------------------------------------------------------------------------
function suite.PBXFileReference_ListsConsoleTarget()
prepare()
xcode.PBXFileReference(tr)
test.capture [[
/* Begin PBXFileReference section */
19A5C4E61D1697189E833B26 /* MyProject */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = MyProject; path = MyProject; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
]]
end
function suite.PBXFileReference_ListsWindowedTarget()
kind "WindowedApp"
prepare()
xcode.PBXFileReference(tr)
test.capture [[
/* Begin PBXFileReference section */
E5FB9875FD0E33A7ED2A2EB5 /* MyProject.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; name = MyProject.app; path = MyProject.app; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
]]
end
function suite.PBXFileReference_ListsIOSWindowedTarget()
_TARGET_OS = "ios"
kind "WindowedApp"
prepare()
xcode.PBXFileReference(tr)
test.capture [[
/* Begin PBXFileReference section */
E5FB9875FD0E33A7ED2A2EB5 /* MyProject.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; name = MyProject.app; path = MyProject.app; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
]]
end
function suite.PBXFileReference_ListsStaticLibTarget()
kind "StaticLib"
prepare()
xcode.PBXFileReference(tr)
test.capture [[
/* Begin PBXFileReference section */
FDCF31ACF735331EEAD08FEC /* libMyProject.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; name = libMyProject.a; path = libMyProject.a; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
]]
end
function suite.PBXFileReference_ListsIOSStaticLibTarget()
_TARGET_OS = "ios"
kind "StaticLib"
prepare()
xcode.PBXFileReference(tr)
test.capture [[
/* Begin PBXFileReference section */
FDCF31ACF735331EEAD08FEC /* libMyProject.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; name = libMyProject.a; path = libMyProject.a; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
]]
end
function suite.PBXFileReference_ListsSharedLibTarget()
kind "SharedLib"
prepare()
xcode.PBXFileReference(tr)
test.capture [[
/* Begin PBXFileReference section */
2781AF7F7E0F19F156882DBF /* libMyProject.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; name = libMyProject.dylib; path = libMyProject.dylib; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
]]
end
function suite.PBXFileReference_ListsIOSSharedLibTarget()
_TARGET_OS = "ios"
kind "SharedLib"
prepare()
xcode.PBXFileReference(tr)
test.capture [[
/* Begin PBXFileReference section */
2781AF7F7E0F19F156882DBF /* libMyProject.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; name = libMyProject.dylib; path = libMyProject.dylib; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
]]
end
function suite.PBXFileReference_ListsOSXBundleTarget()
kind "SharedLib"
sharedlibtype "OSXBundle"
prepare()
xcode.PBXFileReference(tr)
test.capture [[
/* Begin PBXFileReference section */
8AD066EE75BC8CE0BDA2552E /* MyProject.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; name = MyProject.bundle; path = MyProject.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
]]
end
function suite.PBXFileReference_ListsIOSOSXBundleTarget()
_TARGET_OS = "ios"
kind "SharedLib"
sharedlibtype "OSXBundle"
prepare()
xcode.PBXFileReference(tr)
test.capture [[
/* Begin PBXFileReference section */
8AD066EE75BC8CE0BDA2552E /* MyProject.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; name = MyProject.bundle; path = MyProject.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
]]
end
function suite.PBXFileReference_ListsXCTestTarget()
kind "SharedLib"
sharedlibtype "XCTest"
prepare()
xcode.PBXFileReference(tr)
test.capture [[
/* Begin PBXFileReference section */
F573990FE05FBF012845874F /* MyProject.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; name = MyProject.xctest; path = MyProject.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
]]
end
function suite.PBXFileReference_ListsIOSXCTestTarget()
_TARGET_OS = "ios"
kind "SharedLib"
sharedlibtype "XCTest"
prepare()
xcode.PBXFileReference(tr)
test.capture [[
/* Begin PBXFileReference section */
F573990FE05FBF012845874F /* MyProject.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; name = MyProject.xctest; path = MyProject.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
]]
end
function suite.PBXFileReference_ListsOSXFrameworkTarget()
kind "SharedLib"
sharedlibtype "OSXFramework"
prepare()
xcode.PBXFileReference(tr)
test.capture [[
/* Begin PBXFileReference section */
2D914F2255CC07D43D679562 /* MyProject.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = MyProject.framework; path = MyProject.framework; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
]]
end
function suite.PBXFileReference_ListsIOSOSXFrameworkTarget()
_TARGET_OS = "ios"
kind "SharedLib"
sharedlibtype "OSXFramework"
prepare()
xcode.PBXFileReference(tr)
test.capture [[
/* Begin PBXFileReference section */
2D914F2255CC07D43D679562 /* MyProject.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = MyProject.framework; path = MyProject.framework; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
]]
end
function suite.PBXFileReference_ListsSourceFiles()
files { "source.c" }
prepare()
xcode.PBXFileReference(tr)
test.capture [[
/* Begin PBXFileReference section */
19A5C4E61D1697189E833B26 /* MyProject */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = MyProject; path = MyProject; sourceTree = BUILT_PRODUCTS_DIR; };
7DC6D30C8137A53E02A4494C /* source.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = source.c; path = source.c; sourceTree = "<group>"; };
]]
end
function suite.PBXFileReference_ListsSourceFilesCompileAs()
files { "source.c", "objsource.c", "objsource.cpp" }
filter { "files:source.c" }
compileas "C++"
filter { "files:objsource.c" }
compileas "Objective-C"
filter { "files:objsource.cpp" }
compileas "Objective-C++"
prepare()
xcode.PBXFileReference(tr)
test.capture [[
/* Begin PBXFileReference section */
19A5C4E61D1697189E833B26 /* MyProject */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = MyProject; path = MyProject; sourceTree = BUILT_PRODUCTS_DIR; };
7DC6D30C8137A53E02A4494C /* source.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; name = source.c; path = source.c; sourceTree = "<group>"; };
C8C6CC62F1018514D89D12A2 /* objsource.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; name = objsource.cpp; path = objsource.cpp; sourceTree = "<group>"; };
E4BF12E20AE5429471EC3922 /* objsource.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; name = objsource.c; path = objsource.c; sourceTree = "<group>"; };
]]
end
function suite.PBXFileReference_ListsXibCorrectly()
files { "English.lproj/MainMenu.xib", "French.lproj/MainMenu.xib" }
prepare()
xcode.PBXFileReference(tr)
test.capture [[
/* Begin PBXFileReference section */
19A5C4E61D1697189E833B26 /* MyProject */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = MyProject; path = MyProject; sourceTree = BUILT_PRODUCTS_DIR; };
31594983623D4175755577C3 /* French */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = French; path = French.lproj/MainMenu.xib; sourceTree = "<group>"; };
625C7BEB5C1E385D961D3A2B /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MainMenu.xib; sourceTree = "<group>"; };
]]
end
function suite.PBXFileReference_ListsStringsCorrectly()
files { "English.lproj/InfoPlist.strings", "French.lproj/InfoPlist.strings" }
prepare()
xcode.PBXFileReference(tr)
test.capture [[
/* Begin PBXFileReference section */
19A5C4E61D1697189E833B26 /* MyProject */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = MyProject; path = MyProject; sourceTree = BUILT_PRODUCTS_DIR; };
A329C1B0714D1562F85B67F0 /* English */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
C3BECE4859358D7AC7D1E488 /* French */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = French; path = French.lproj/InfoPlist.strings; sourceTree = "<group>"; };
]]
end
function suite.PBXFileReference_ListFrameworksCorrectly()
links { "Cocoa.framework/" }
prepare()
xcode.PBXFileReference(tr)
test.capture [[
/* Begin PBXFileReference section */
19A5C4E61D1697189E833B26 /* MyProject */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = MyProject; path = MyProject; sourceTree = BUILT_PRODUCTS_DIR; };
8D6BC6AA50D7885C8F7B2CEA /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
/* End PBXFileReference section */
]]
end
function suite.PBXFileReference_ListDylibsCorrectly()
links { "../libA.dylib", "libB.dylib", "/usr/lib/libC.dylib" }
prepare()
xcode.PBXFileReference(tr)
test.capture [[
/* Begin PBXFileReference section */
19A5C4E61D1697189E833B26 /* MyProject */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = MyProject; path = MyProject; sourceTree = BUILT_PRODUCTS_DIR; };
5F9AE5C74A870BB9926CD407 /* libA.dylib */ = {isa = PBXFileReference; lastKnownFileType = compiled.mach-o.dylib; name = libA.dylib; path = ../libA.dylib; sourceTree = SOURCE_ROOT; };
CF0547FE2A469B70FDA0E63E /* libC.dylib */ = {isa = PBXFileReference; lastKnownFileType = compiled.mach-o.dylib; name = libC.dylib; path = /usr/lib/libC.dylib; sourceTree = "<absolute>"; };
D413533EEB25EE70DB41E97E /* libB.dylib */ = {isa = PBXFileReference; lastKnownFileType = compiled.mach-o.dylib; name = libB.dylib; path = libB.dylib; sourceTree = SOURCE_ROOT; };
/* End PBXFileReference section */
]]
end
function suite.PBXFileReference_leavesFrameworkLocationsAsIsWhenSupplied_pathIsSetToInput()
local inputFrameWork = 'somedir/Foo.framework'
links(inputFrameWork)
prepare()
--io.capture()
xcode.PBXFileReference(tr)
--local str = io.captured()
--test.istrue(str:find('path = "'..inputFrameWork..'"'))
--ms check
end
function suite.PBXFileReference_relativeFrameworkPathSupplied_callsError()
local inputFrameWork = '../somedir/Foo.framework'
links(inputFrameWork)
prepare()
-- ms no longer and error
-- valid case for linking relative frameworks
--local error_called = false
--local old_error = error
--error = function( ... )error_called = true end
xcode.PBXFileReference(tr)
--error = old_error
--test.istrue(error_called)
end
function suite.PBXFileReference_ListsIconFiles()
files { "Icon.icns" }
prepare()
xcode.PBXFileReference(tr)
test.capture [[
/* Begin PBXFileReference section */
19A5C4E61D1697189E833B26 /* MyProject */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = MyProject; path = MyProject; sourceTree = BUILT_PRODUCTS_DIR; };
1A07B4D0BCF5DB824C1BBB10 /* Icon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = Icon.icns; path = Icon.icns; sourceTree = "<group>"; };
]]
end
function suite.PBXFileReference_IgnoresTargetDir()
targetdir "bin"
kind "WindowedApp"
prepare()
xcode.PBXFileReference(tr)
test.capture [[
/* Begin PBXFileReference section */
E5FB9875FD0E33A7ED2A2EB5 /* MyProject.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; name = MyProject.app; path = MyProject.app; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
]]
end
function suite.PBXFileReference_UsesTargetSuffix()
targetsuffix "-d"
kind "SharedLib"
prepare()
xcode.PBXFileReference(tr)
test.capture [[
/* Begin PBXFileReference section */
9E361150CDC7E042A8D51F90 /* libMyProject-d.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; name = "libMyProject-d.dylib"; path = "libMyProject-d.dylib"; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
]]
end
function suite.PBXFileReference_UsesFullPath_WhenParentIsVirtual()
files { "src/source.c" }
vpaths { ["Source Files"] = "**.c" }
prepare()
xcode.PBXFileReference(tr)
test.capture [[
/* Begin PBXFileReference section */
19A5C4E61D1697189E833B26 /* MyProject */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = MyProject; path = MyProject; sourceTree = BUILT_PRODUCTS_DIR; };
721A4003892CDB357948D643 /* source.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = source.c; path = src/source.c; sourceTree = "<group>"; };
]]
end
---------------------------------------------------------------------------
-- PBXFrameworksBuildPhase tests
---------------------------------------------------------------------------
function suite.PBXFrameworksBuildPhase_OnNoFiles()
prepare()
xcode.PBXFrameworksBuildPhase(tr)
test.capture [[
/* Begin PBXFrameworksBuildPhase section */
9FDD37564328C0885DF98D96 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
]]
end
function suite.PBXFrameworksBuild_ListsFrameworksCorrectly()
links { "Cocoa.framework" }
prepare()
xcode.PBXFrameworksBuildPhase(tr)
test.capture [[
/* Begin PBXFrameworksBuildPhase section */
9FDD37564328C0885DF98D96 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
F8E8DBA28B76A594F44F49E2 /* Cocoa.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
]]
end
---------------------------------------------------------------------------
-- PBXCopyFilesBuildPhaseForEmbedFrameworks tests
---------------------------------------------------------------------------
function suite.PBXCopyFilesBuildPhaseForEmbedFrameworks_OnNoFiles()
prepare()
xcode.PBXCopyFilesBuildPhaseForEmbedFrameworks(tr)
test.capture [[
/* Begin PBXCopyFilesBuildPhase section */
E1D3B542862652F4985E9B82 /* Embed Libraries */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
);
name = "Embed Libraries";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
]]
end
function suite.PBXCopyFilesBuildPhaseForEmbedFrameworks_ListsEmbeddedLibrariesCorrectly()
links
{
"../libA.dylib",
"../D.framework",
}
embed { "libA.dylib" }
embedAndSign { "D.framework" }
prepare()
xcode.PBXCopyFilesBuildPhaseForEmbedFrameworks(tr)
test.capture [[
/* Begin PBXCopyFilesBuildPhase section */
E1D3B542862652F4985E9B82 /* Embed Libraries */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
E054F1BF0EFB45B1683C9FFF /* libA.dylib in Frameworks */,
966D8A4599DE5C771B4B0085 /* D.framework in Frameworks */,
);
name = "Embed Libraries";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
]]
end
---------------------------------------------------------------------------
-- PBXGroup tests
---------------------------------------------------------------------------
function suite.PBXGroup_OnNoFiles()
prepare()
xcode.PBXGroup(tr)
test.capture [[
/* Begin PBXGroup section */
12F5A37D963B00EFBF8281BD /* MyProject */ = {
isa = PBXGroup;
children = (
A6C936B49B3FADE6EA134CF4 /* Products */,
);
name = MyProject;
sourceTree = "<group>";
};
A6C936B49B3FADE6EA134CF4 /* Products */ = {
isa = PBXGroup;
children = (
19A5C4E61D1697189E833B26 /* MyProject */,
);
name = Products;
sourceTree = "<group>";
};
/* End PBXGroup section */
]]
end
function suite.PBXGroup_OnSourceFiles()
files { "source.h" }
prepare()
xcode.PBXGroup(tr)
test.capture [[
/* Begin PBXGroup section */
12F5A37D963B00EFBF8281BD /* MyProject */ = {
isa = PBXGroup;
children = (
5C62B7965FD389C8E1402DD6 /* source.h */,
A6C936B49B3FADE6EA134CF4 /* Products */,
);
name = MyProject;
sourceTree = "<group>";
};
A6C936B49B3FADE6EA134CF4 /* Products */ = {
isa = PBXGroup;
children = (
19A5C4E61D1697189E833B26 /* MyProject */,
);
name = Products;
sourceTree = "<group>";
};
/* End PBXGroup section */
]]
end
function suite.PBXGroup_OnSourceSubdirs()
files { "include/premake/source.h" }
prepare()
xcode.PBXGroup(tr)
test.capture [[
/* Begin PBXGroup section */
12F5A37D963B00EFBF8281BD /* MyProject */ = {
isa = PBXGroup;
children = (
5C62B7965FD389C8E1402DD6 /* source.h */,
A6C936B49B3FADE6EA134CF4 /* Products */,
);
name = MyProject;
sourceTree = "<group>";
};
A6C936B49B3FADE6EA134CF4 /* Products */ = {
isa = PBXGroup;
children = (
19A5C4E61D1697189E833B26 /* MyProject */,
);
name = Products;
sourceTree = "<group>";
};
/* End PBXGroup section */
]]
end
function suite.PBXGroup_pathHasPlusPlus_PathIsQuoted()
files { "RequiresQuoting++/h.h" }
prepare()
xcode.PBXGroup(tr)
local str = p.captured()
--test.istrue(str:find('path = "RequiresQuoting%+%+";'))
end
function suite.PBXGroup_SortsFiles()
files { "test.h", "source.h", "source.cpp" }
prepare()
xcode.PBXGroup(tr)
test.capture [[
/* Begin PBXGroup section */
12F5A37D963B00EFBF8281BD /* MyProject */ = {
isa = PBXGroup;
children = (
9B47484CB259E37EA275DE8C /* source.cpp */,
5C62B7965FD389C8E1402DD6 /* source.h */,
ABEF15744F3A9EA66A0B6BB4 /* test.h */,
A6C936B49B3FADE6EA134CF4 /* Products */,
);
name = MyProject;
sourceTree = "<group>";
};
A6C936B49B3FADE6EA134CF4 /* Products */ = {
isa = PBXGroup;
children = (
19A5C4E61D1697189E833B26 /* MyProject */,
);
name = Products;
sourceTree = "<group>";
};
/* End PBXGroup section */
]]
end
function suite.PBXGroup_OnResourceFiles()
files { "English.lproj/MainMenu.xib", "French.lproj/MainMenu.xib", "Info.plist" }
prepare()
xcode.PBXGroup(tr)
test.capture [[
/* Begin PBXGroup section */
12F5A37D963B00EFBF8281BD /* MyProject */ = {
isa = PBXGroup;
children = (
ACC2AED4C3D54A06B3F14514 /* Info.plist */,
6CB8FB6B191BBB9DD7A431AB /* MainMenu.xib */,
A6C936B49B3FADE6EA134CF4 /* Products */,
);
name = MyProject;
sourceTree = "<group>";
};
A6C936B49B3FADE6EA134CF4 /* Products */ = {
isa = PBXGroup;
children = (
19A5C4E61D1697189E833B26 /* MyProject */,
);
name = Products;
sourceTree = "<group>";
};
/* End PBXGroup section */
]]
end
function suite.PBXGroup_OnFrameworks()
links { "Cocoa.framework" }
prepare()
xcode.PBXGroup(tr)
test.capture [[
/* Begin PBXGroup section */
12F5A37D963B00EFBF8281BD /* MyProject */ = {
isa = PBXGroup;
children = (
BBF76781A7E87333FA200DC1 /* Frameworks */,
A6C936B49B3FADE6EA134CF4 /* Products */,
);
name = MyProject;
sourceTree = "<group>";
};
A6C936B49B3FADE6EA134CF4 /* Products */ = {
isa = PBXGroup;
children = (
19A5C4E61D1697189E833B26 /* MyProject */,
);
name = Products;
sourceTree = "<group>";
};
BBF76781A7E87333FA200DC1 /* Frameworks */ = {
isa = PBXGroup;
children = (
8D6BC6AA50D7885C8F7B2CEA /* Cocoa.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
]]
end
function suite.PBXGroup_OnVpaths()
files { "include/premake/source.h" }
vpaths { ["Headers"] = "**.h" }
prepare()
xcode.PBXGroup(tr)
test.capture [[
/* Begin PBXGroup section */
12F5A37D963B00EFBF8281BD /* MyProject */ = {
isa = PBXGroup;
children = (
20D885C0C52B2372D7636C00 /* Headers */,
A6C936B49B3FADE6EA134CF4 /* Products */,
);
name = MyProject;
sourceTree = "<group>";
};
20D885C0C52B2372D7636C00 /* Headers */ = {
isa = PBXGroup;
children = (
E91A2DDD367D240FAC9C241D /* source.h */,
);
name = Headers;
sourceTree = "<group>";
};
]]
end
---------------------------------------------------------------------------
-- PBXNativeTarget tests
---------------------------------------------------------------------------
function suite.PBXNativeTarget_OnConsoleApp()
prepare()
xcode.PBXNativeTarget(tr)
test.capture [[
/* Begin PBXNativeTarget section */
48B5980C775BEBFED09D464C /* MyProject */ = {
isa = PBXNativeTarget;
buildConfigurationList = 8E187FB5316408E74C34D5F5 /* Build configuration list for PBXNativeTarget "MyProject" */;
buildPhases = (
0FC4B7F6B3104128CDE10E36 /* Resources */,
7971D14D1CBD5A7F378E278D /* Sources */,
9FDD37564328C0885DF98D96 /* Frameworks */,
E1D3B542862652F4985E9B82 /* Embed Libraries */,
);
buildRules = (
);
dependencies = (
);
name = MyProject;
productInstallPath = "$(HOME)/bin";
productName = MyProject;
productReference = 19A5C4E61D1697189E833B26 /* MyProject */;
productType = "com.apple.product-type.tool";
};
/* End PBXNativeTarget section */
]]
end
function suite.PBXNativeTarget_OnWindowedApp()
kind "WindowedApp"
prepare()
xcode.PBXNativeTarget(tr)
test.capture [[
/* Begin PBXNativeTarget section */
D2C7B5BBD37AB2AD475C83FB /* MyProject */ = {
isa = PBXNativeTarget;
buildConfigurationList = 8DCCE3C4913DB5F612AA5A04 /* Build configuration list for PBXNativeTarget "MyProject" */;
buildPhases = (
0F791C0512E9EE3794569245 /* Resources */,
7926355C7C97078EFE03AB9C /* Sources */,
9F919B65A3026D97246F11A5 /* Frameworks */,
A0315911431F7FC3D2455F51 /* Embed Libraries */,
);
buildRules = (
);
dependencies = (
);
name = MyProject;
productInstallPath = "$(HOME)/Applications";
productName = MyProject;
productReference = E5FB9875FD0E33A7ED2A2EB5 /* MyProject.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
]]
end
function suite.PBXNativeTarget_OnSharedLib()
kind "SharedLib"
prepare()
xcode.PBXNativeTarget(tr)
test.capture [[
/* Begin PBXNativeTarget section */
CD0213851572F7B75A11C9C5 /* MyProject */ = {
isa = PBXNativeTarget;
buildConfigurationList = 1F5D05CE18C307400C5E640E /* Build configuration list for PBXNativeTarget "MyProject" */;
buildPhases = (
A1093E0F9A6F3F818E0A9C4F /* Resources */,
0AB65766041C58D8F7B7B5A6 /* Sources */,
3121BD6F2A87BEE11E231BAF /* Frameworks */,
D652259BC13E4B8D092413DB /* Embed Libraries */,
);
buildRules = (
);
dependencies = (
);
name = MyProject;
productName = MyProject;
productReference = 2781AF7F7E0F19F156882DBF /* libMyProject.dylib */;
productType = "com.apple.product-type.library.dynamic";
};
/* End PBXNativeTarget section */
]]
end
function suite.PBXNativeTarget_OnBuildCommands()
prebuildcommands { "prebuildcmd" }
prelinkcommands { "prelinkcmd" }
postbuildcommands { "postbuildcmd" }
files { "file.in" }
filter { "files:file.in" }
buildcommands { "buildcmd" }
buildoutputs { "file.out" }
prepare()
xcode.PBXNativeTarget(tr)
test.capture [[
/* Begin PBXNativeTarget section */
48B5980C775BEBFED09D464C /* MyProject */ = {
isa = PBXNativeTarget;
buildConfigurationList = 8E187FB5316408E74C34D5F5 /* Build configuration list for PBXNativeTarget "MyProject" */;
buildPhases = (
9607AE1010C857E500CD1376 /* Prebuild */,
C06220C983CDE27BC2718709 /* Build "file.in" */,
0FC4B7F6B3104128CDE10E36 /* Resources */,
7971D14D1CBD5A7F378E278D /* Sources */,
9607AE3510C85E7E00CD1376 /* Prelink */,
9FDD37564328C0885DF98D96 /* Frameworks */,
E1D3B542862652F4985E9B82 /* Embed Libraries */,
9607AE3710C85E8F00CD1376 /* Postbuild */,
);
buildRules = (
);
dependencies = (
);
name = MyProject;
productInstallPath = "$(HOME)/bin";
productName = MyProject;
productReference = 19A5C4E61D1697189E833B26 /* MyProject */;
productType = "com.apple.product-type.tool";
};
/* End PBXNativeTarget section */
]]
end
function suite.PBXNativeTarget_OnBuildCommandsFilesFilterDependency()
files { "file.1", "file.2", "file.3" }
filter { "files:file.1" }
buildcommands { "first" }
buildoutputs { "file.2" }
filter { "files:file.3" }
buildcommands { "last" }
buildoutputs { "file.4" }
filter { "files:file.2" }
buildcommands { "second" }
buildoutputs { "file.3" }
prepare()
xcode.PBXNativeTarget(tr)
test.capture [[
/* Begin PBXNativeTarget section */
48B5980C775BEBFED09D464C /* MyProject */ = {
isa = PBXNativeTarget;
buildConfigurationList = 8E187FB5316408E74C34D5F5 /* Build configuration list for PBXNativeTarget "MyProject" */;
buildPhases = (
A50DBDBDC6D96AEF038E93FD /* Build "file.1" */,
71E4A5FF93B05331D0657C3F /* Build "file.2" */,
3EBB8E4160873B739D3C6481 /* Build "file.3" */,
0FC4B7F6B3104128CDE10E36 /* Resources */,
7971D14D1CBD5A7F378E278D /* Sources */,
9FDD37564328C0885DF98D96 /* Frameworks */,
E1D3B542862652F4985E9B82 /* Embed Libraries */,
);
buildRules = (
);
dependencies = (
);
name = MyProject;
productInstallPath = "$(HOME)/bin";
productName = MyProject;
productReference = 19A5C4E61D1697189E833B26 /* MyProject */;
productType = "com.apple.product-type.tool";
};
/* End PBXNativeTarget section */
]]
end
function suite.PBXNativeTarget_OnBuildCommandsBuildInputsDependency()
files { "file.1", "file.2", "file.3" }
filter { "files:file.1" }
buildcommands { "first" }
buildoutputs { "file.4" }
filter { "files:file.3" }
buildcommands { "last" }
buildinputs { "file.5" }
buildoutputs { "file.6" }
filter { "files:file.2" }
buildcommands { "second" }
buildinputs { "file.4" }
buildoutputs { "file.5" }
prepare()
xcode.PBXNativeTarget(tr)
test.capture [[
/* Begin PBXNativeTarget section */
48B5980C775BEBFED09D464C /* MyProject */ = {
isa = PBXNativeTarget;
buildConfigurationList = 8E187FB5316408E74C34D5F5 /* Build configuration list for PBXNativeTarget "MyProject" */;
buildPhases = (
A50DBDBDC6D96AEF038E93FD /* Build "file.1" */,
71E4A5FF93B05331D0657C3F /* Build "file.2" */,
3EBB8E4160873B739D3C6481 /* Build "file.3" */,
0FC4B7F6B3104128CDE10E36 /* Resources */,
7971D14D1CBD5A7F378E278D /* Sources */,
9FDD37564328C0885DF98D96 /* Frameworks */,
E1D3B542862652F4985E9B82 /* Embed Libraries */,
);
buildRules = (
);
dependencies = (
);
name = MyProject;
productInstallPath = "$(HOME)/bin";
productName = MyProject;
productReference = 19A5C4E61D1697189E833B26 /* MyProject */;
productType = "com.apple.product-type.tool";
};
/* End PBXNativeTarget section */
]]
end
---------------------------------------------------------------------------
-- PBXAggregateTarget tests
---------------------------------------------------------------------------
function suite.PBXAggregateTarget_OnUtility()
kind "Utility"
prepare()
xcode.PBXAggregateTarget(tr)
test.capture [[
/* Begin PBXAggregateTarget section */
48B5980C775BEBFED09D464C /* MyProject */ = {
isa = PBXAggregateTarget;
buildConfigurationList = 8E187FB5316408E74C34D5F5 /* Build configuration list for PBXAggregateTarget "MyProject" */;
buildPhases = (
);
buildRules = (
);
dependencies = (
);
name = MyProject;
productName = MyProject;
};
/* End PBXAggregateTarget section */
]]
end
function suite.PBXAggregateTarget_OnBuildCommands()
kind "Utility"
prebuildcommands { "prebuildcmd" }
prelinkcommands { "prelinkcmd" }
postbuildcommands { "postbuildcmd" }
files { "file.in" }
filter { "files:file.in" }
buildcommands { "buildcmd" }
buildoutputs { "file.out" }
prepare()
xcode.PBXAggregateTarget(tr)
test.capture [[
/* Begin PBXAggregateTarget section */
48B5980C775BEBFED09D464C /* MyProject */ = {
isa = PBXAggregateTarget;
buildConfigurationList = 8E187FB5316408E74C34D5F5 /* Build configuration list for PBXAggregateTarget "MyProject" */;
buildPhases = (
9607AE1010C857E500CD1376 /* Prebuild */,
C06220C983CDE27BC2718709 /* Build "file.in" */,
9607AE3510C85E7E00CD1376 /* Prelink */,
9607AE3710C85E8F00CD1376 /* Postbuild */,
);
buildRules = (
);
dependencies = (
);
name = MyProject;
productName = MyProject;
};
/* End PBXAggregateTarget section */
]]
end
---------------------------------------------------------------------------
-- PBXProject tests
---------------------------------------------------------------------------
function suite.PBXProject_OnProject()
prepare()
xcode.PBXProject(tr)
test.capture [[
/* Begin PBXProject section */
08FB7793FE84155DC02AAC07 /* Project object */ = {
isa = PBXProject;
buildConfigurationList = 1DEB928908733DD80010E9CD /* Build configuration list for PBXProject "MyProject" */;
compatibilityVersion = "Xcode 3.2";
hasScannedForEncodings = 1;
mainGroup = 12F5A37D963B00EFBF8281BD /* MyProject */;
projectDirPath = "";
projectRoot = "";
targets = (
48B5980C775BEBFED09D464C /* MyProject */,
);
};
/* End PBXProject section */
]]
end
function suite.PBXProject_OnSystemCapabilities()
xcodesystemcapabilities {
["com.apple.InAppPurchase"] = "ON",
["com.apple.iCloud"] = "ON",
["com.apple.GameCenter.iOS"] = "OFF",
}
prepare()
xcode.PBXProject(tr)
test.capture [[
/* Begin PBXProject section */
08FB7793FE84155DC02AAC07 /* Project object */ = {
isa = PBXProject;
attributes = {
TargetAttributes = {
48B5980C775BEBFED09D464C = {
SystemCapabilities = {
com.apple.GameCenter.iOS = {
enabled = 0;
};
com.apple.InAppPurchase = {
enabled = 1;
};
com.apple.iCloud = {
enabled = 1;
};
};
};
};
};
buildConfigurationList = 1DEB928908733DD80010E9CD /* Build configuration list for PBXProject "MyProject" */;
compatibilityVersion = "Xcode 3.2";
hasScannedForEncodings = 1;
mainGroup = 12F5A37D963B00EFBF8281BD /* MyProject */;
projectDirPath = "";
projectRoot = "";
targets = (
48B5980C775BEBFED09D464C /* MyProject */,
);
};
/* End PBXProject section */
]]
end
---------------------------------------------------------------------------
-- PBXResourceBuildPhase tests
---------------------------------------------------------------------------
function suite.PBXResourcesBuildPhase_OnNoResources()
prepare()
xcode.PBXResourcesBuildPhase(tr)
test.capture [[
/* Begin PBXResourcesBuildPhase section */
0FC4B7F6B3104128CDE10E36 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
]]
end
function suite.PBXResourcesBuildPhase_OnResources()
files { "English.lproj/MainMenu.xib", "French.lproj/MainMenu.xib", "Info.plist" }
prepare()
xcode.PBXResourcesBuildPhase(tr)
test.capture [[
/* Begin PBXResourcesBuildPhase section */
0FC4B7F6B3104128CDE10E36 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
6FE0F2A3E16C0B15906D30E3 /* MainMenu.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
]]
end
---------------------------------------------------------------------------
-- PBXShellScriptBuildPhase tests
---------------------------------------------------------------------------
function suite.PBXShellScriptBuildPhase_OnNoScripts()
prepare()
xcode.PBXShellScriptBuildPhase(tr)
test.capture [[
]]
end
function suite.PBXShellScriptBuildPhase_OnPrebuildScripts()
prebuildcommands { 'ls src', 'cp "a" "b"' }
prepare()
xcode.PBXShellScriptBuildPhase(tr)
test.capture [[
/* Begin PBXShellScriptBuildPhase section */
9607AE1010C857E500CD1376 /* Prebuild */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = Prebuild;
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "set -e\nif [ \"${CONFIGURATION}\" = \"Debug\" ]; then\nls src\ncp \"a\" \"b\"\nfi\nif [ \"${CONFIGURATION}\" = \"Release\" ]; then\nls src\ncp \"a\" \"b\"\nfi";
};
/* End PBXShellScriptBuildPhase section */
]]
end
function suite.PBXShellScriptBuildPhase_OnBuildComandScripts()
files { "file.in1" }
filter { "files:file.in1" }
buildcommands { 'ls src', 'cp "a" "b"' }
buildinputs { "file.in2" }
buildoutputs { "file.out" }
prepare()
xcode.PBXShellScriptBuildPhase(tr)
test.capture [[
/* Begin PBXShellScriptBuildPhase section */
9AE2196BE8450F9D5E640FAB /* Build "file.in1" */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"file.in1",
"file.in2",
);
name = "Build \"file.in1\"";
outputPaths = (
"file.out",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "set -e\nif [ \"${CONFIGURATION}\" = \"Debug\" ]; then\n\tls src\n\tcp \"a\" \"b\"\nfi\nif [ \"${CONFIGURATION}\" = \"Release\" ]; then\n\tls src\n\tcp \"a\" \"b\"\nfi";
};
/* End PBXShellScriptBuildPhase section */
]]
end
function suite.PBXShellScriptBuildPhase_OnPerConfigCmds()
prebuildcommands { 'ls src' }
configuration "Debug"
prebuildcommands { 'cp a b' }
prepare()
xcode.PBXShellScriptBuildPhase(tr)
test.capture [[
/* Begin PBXShellScriptBuildPhase section */
9607AE1010C857E500CD1376 /* Prebuild */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = Prebuild;
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "set -e\nif [ \"${CONFIGURATION}\" = \"Debug\" ]; then\nls src\ncp a b\nfi\nif [ \"${CONFIGURATION}\" = \"Release\" ]; then\nls src\nfi";
};
/* End PBXShellScriptBuildPhase section */
]]
end
function suite.PBXShellScriptBuildPhase_OnBuildInputsAnddOutputsOrder()
files { "file.a" }
filter { "files:file.a" }
buildcommands { "buildcmd" }
buildinputs { "file.3", "file.1", "file.2" }
buildoutputs { "file.5", "file.6", "file.4" }
prepare()
xcode.PBXShellScriptBuildPhase(tr)
test.capture [[
/* Begin PBXShellScriptBuildPhase section */
0D594A1D2F24F74F6BDA205D /* Build "file.a" */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"file.a",
"file.3",
"file.1",
"file.2",
);
name = "Build \"file.a\"";
outputPaths = (
"file.5",
"file.6",
"file.4",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "set -e\nif [ \"${CONFIGURATION}\" = \"Debug\" ]; then\n\tbuildcmd\nfi\nif [ \"${CONFIGURATION}\" = \"Release\" ]; then\n\tbuildcmd\nfi";
};
/* End PBXShellScriptBuildPhase section */
]]
end
---------------------------------------------------------------------------
-- PBXSourcesBuildPhase tests
---------------------------------------------------------------------------
function suite.PBXSourcesBuildPhase_OnNoSources()
prepare()
xcode.PBXSourcesBuildPhase(tr)
test.capture [[
/* Begin PBXSourcesBuildPhase section */
7971D14D1CBD5A7F378E278D /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
]]
end
function suite.PBXSourcesBuildPhase_OnSources()
files { "hello.cpp", "goodbye.cpp" }
prepare()
xcode.PBXSourcesBuildPhase(tr)
test.capture [[
/* Begin PBXSourcesBuildPhase section */
7971D14D1CBD5A7F378E278D /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
D7426C94082664861B3E9AD4 /* goodbye.cpp in Sources */,
EF69EEEA1EFBBDDCFA08FD2A /* hello.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
]]
end
---------------------------------------------------------------------------
-- PBXVariantGroup tests
---------------------------------------------------------------------------
function suite.PBXVariantGroup_OnNoGroups()
prepare()
xcode.PBXVariantGroup(tr)
test.capture [[
/* Begin PBXVariantGroup section */
/* End PBXVariantGroup section */
]]
end
function suite.PBXVariantGroup_OnNoResourceGroups()
files { "English.lproj/MainMenu.xib", "French.lproj/MainMenu.xib" }
prepare()
xcode.PBXVariantGroup(tr)
test.capture [[
/* Begin PBXVariantGroup section */
6CB8FB6B191BBB9DD7A431AB /* MainMenu.xib */ = {
isa = PBXVariantGroup;
children = (
625C7BEB5C1E385D961D3A2B /* English */,
31594983623D4175755577C3 /* French */,
);
name = MainMenu.xib;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
]]
end
---------------------------------------------------------------------------
-- XCBuildConfiguration_Target tests
---------------------------------------------------------------------------
function suite.XCBuildConfigurationTarget_OnConsoleApp()
prepare()
xcode.XCBuildConfiguration_Target(tr, tr.products.children[1], tr.configs[1])
test.capture [[
FDC4CBFB4635B02D8AD4823B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CONFIGURATION_BUILD_DIR = bin/Debug;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_DYNAMIC_NO_PIC = NO;
INSTALL_PATH = /usr/local/bin;
PRODUCT_NAME = MyProject;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationTarget_OnConsoleApp_dwarf()
debugformat "Dwarf"
prepare()
xcode.XCBuildConfiguration_Target(tr, tr.products.children[1], tr.configs[1])
test.capture [[
FDC4CBFB4635B02D8AD4823B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CONFIGURATION_BUILD_DIR = bin/Debug;
DEBUG_INFORMATION_FORMAT = dwarf;
GCC_DYNAMIC_NO_PIC = NO;
INSTALL_PATH = /usr/local/bin;
PRODUCT_NAME = MyProject;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationTarget_OnConsoleApp_split_dwarf()
debugformat "SplitDwarf"
prepare()
xcode.XCBuildConfiguration_Target(tr, tr.products.children[1], tr.configs[1])
test.capture [[
FDC4CBFB4635B02D8AD4823B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CONFIGURATION_BUILD_DIR = bin/Debug;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_DYNAMIC_NO_PIC = NO;
INSTALL_PATH = /usr/local/bin;
PRODUCT_NAME = MyProject;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationTarget_OnConsoleApp_default()
debugformat "Default"
prepare()
xcode.XCBuildConfiguration_Target(tr, tr.products.children[1], tr.configs[1])
test.capture [[
FDC4CBFB4635B02D8AD4823B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CONFIGURATION_BUILD_DIR = bin/Debug;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_DYNAMIC_NO_PIC = NO;
INSTALL_PATH = /usr/local/bin;
PRODUCT_NAME = MyProject;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationTarget_OnWindowedApp()
kind "WindowedApp"
prepare()
xcode.XCBuildConfiguration_Target(tr, tr.products.children[1], tr.configs[1])
test.capture [[
F1C0BE8A138C6BBC504194CA /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CONFIGURATION_BUILD_DIR = bin/Debug;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_DYNAMIC_NO_PIC = NO;
INSTALL_PATH = "\"$(HOME)/Applications\"";
PRODUCT_NAME = MyProject;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationTarget_OnStaticLib()
kind "StaticLib"
prepare()
xcode.XCBuildConfiguration_Target(tr, tr.products.children[1], tr.configs[1])
test.capture [[
92D99EC1EE1AF233C1753D01 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CONFIGURATION_BUILD_DIR = bin/Debug;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_DYNAMIC_NO_PIC = NO;
INSTALL_PATH = /usr/local/lib;
PRODUCT_NAME = MyProject;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationTarget_OnSharedLib()
kind "SharedLib"
prepare()
xcode.XCBuildConfiguration_Target(tr, tr.products.children[1], tr.configs[1])
test.capture [[
144A3F940E0BFC06480AFDD4 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CONFIGURATION_BUILD_DIR = bin/Debug;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
EXECUTABLE_PREFIX = lib;
GCC_DYNAMIC_NO_PIC = NO;
INSTALL_PATH = /usr/local/lib;
PRODUCT_NAME = MyProject;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationTarget_OnOSXBundle()
kind "SharedLib"
sharedlibtype "OSXBundle"
prepare()
xcode.XCBuildConfiguration_Target(tr, tr.products.children[1], tr.configs[1])
test.capture [[
5C54F6038D38EDF5A0512443 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CONFIGURATION_BUILD_DIR = bin/Debug;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_DYNAMIC_NO_PIC = NO;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
PRODUCT_NAME = MyProject;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationTarget_OnXCTest()
kind "SharedLib"
sharedlibtype "XCTest"
prepare()
xcode.XCBuildConfiguration_Target(tr, tr.products.children[1], tr.configs[1])
test.capture [[
0C14B9243CF8B1165010E764 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CONFIGURATION_BUILD_DIR = bin/Debug;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_DYNAMIC_NO_PIC = NO;
PRODUCT_NAME = MyProject;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationTarget_OnOSXFramework()
kind "SharedLib"
sharedlibtype "OSXFramework"
prepare()
xcode.XCBuildConfiguration_Target(tr, tr.products.children[1], tr.configs[1])
test.capture [[
2EC4D23760BE1CE9DA9D5877 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CONFIGURATION_BUILD_DIR = bin/Debug;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_DYNAMIC_NO_PIC = NO;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
PRODUCT_NAME = MyProject;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationTarget_OnTargetPrefix()
kind "SharedLib"
targetprefix "xyz"
prepare()
xcode.XCBuildConfiguration_Target(tr, tr.products.children[1], tr.configs[1])
test.capture [[
33365BC82CF8183A66F71A08 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CONFIGURATION_BUILD_DIR = bin/Debug;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
EXECUTABLE_PREFIX = xyz;
GCC_DYNAMIC_NO_PIC = NO;
INSTALL_PATH = /usr/local/lib;
PRODUCT_NAME = MyProject;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationTarget_OnConsoleAppTargetExtension()
kind "ConsoleApp"
targetextension ".xyz"
prepare()
xcode.XCBuildConfiguration_Target(tr, tr.products.children[1], tr.configs[1])
test.capture [[
4FD8665471A41386AE593C94 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CONFIGURATION_BUILD_DIR = bin/Debug;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_DYNAMIC_NO_PIC = NO;
INSTALL_PATH = /usr/local/bin;
PRODUCT_NAME = MyProject.xyz;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationTarget_OnConsoleAppNoTargetExtension()
kind "ConsoleApp"
targetextension ""
prepare()
xcode.XCBuildConfiguration_Target(tr, tr.products.children[1], tr.configs[1])
test.capture [[
FDC4CBFB4635B02D8AD4823B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CONFIGURATION_BUILD_DIR = bin/Debug;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_DYNAMIC_NO_PIC = NO;
INSTALL_PATH = /usr/local/bin;
PRODUCT_NAME = MyProject;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationTarget_OnSharedLibTargetExtension()
kind "SharedLib"
targetextension ".xyz"
prepare()
xcode.XCBuildConfiguration_Target(tr, tr.products.children[1], tr.configs[1])
test.capture [[
8FB8842BC09C7C1DD3B4B26B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CONFIGURATION_BUILD_DIR = bin/Debug;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
EXECUTABLE_EXTENSION = xyz;
EXECUTABLE_PREFIX = lib;
GCC_DYNAMIC_NO_PIC = NO;
INSTALL_PATH = /usr/local/lib;
PRODUCT_NAME = MyProject;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationTarget_OnSharedLibNoTargetExtension()
kind "SharedLib"
targetextension ""
prepare()
xcode.XCBuildConfiguration_Target(tr, tr.products.children[1], tr.configs[1])
test.capture [[
5E2996528DBB654468C8A492 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CONFIGURATION_BUILD_DIR = bin/Debug;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
EXECUTABLE_EXTENSION = "";
EXECUTABLE_PREFIX = lib;
GCC_DYNAMIC_NO_PIC = NO;
INSTALL_PATH = /usr/local/lib;
PRODUCT_NAME = MyProject;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationTarget_OnStaticLibTargetExtension()
kind "StaticLib"
targetextension ".xyz"
prepare()
xcode.XCBuildConfiguration_Target(tr, tr.products.children[1], tr.configs[1])
test.capture [[
8FB8842BC09C7C1DD3B4B26B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CONFIGURATION_BUILD_DIR = bin/Debug;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
EXECUTABLE_EXTENSION = xyz;
GCC_DYNAMIC_NO_PIC = NO;
INSTALL_PATH = /usr/local/lib;
PRODUCT_NAME = MyProject;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationTarget_OnStaticLibNoTargetExtension()
kind "StaticLib"
targetextension ""
prepare()
xcode.XCBuildConfiguration_Target(tr, tr.products.children[1], tr.configs[1])
test.capture [[
5E2996528DBB654468C8A492 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CONFIGURATION_BUILD_DIR = bin/Debug;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
EXECUTABLE_EXTENSION = "";
GCC_DYNAMIC_NO_PIC = NO;
INSTALL_PATH = /usr/local/lib;
PRODUCT_NAME = MyProject;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationTarget_OnWindowedAppTargetExtension()
kind "WindowedApp"
targetextension ".xyz"
prepare()
xcode.XCBuildConfiguration_Target(tr, tr.products.children[1], tr.configs[1])
test.capture [[
4FD8665471A41386AE593C94 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CONFIGURATION_BUILD_DIR = bin/Debug;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_DYNAMIC_NO_PIC = NO;
INSTALL_PATH = "\"$(HOME)/Applications\"";
PRODUCT_NAME = MyProject;
WRAPPER_EXTENSION = xyz;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationTarget_OnWindowedAppNoTargetExtension()
kind "WindowedApp"
targetextension ""
prepare()
xcode.XCBuildConfiguration_Target(tr, tr.products.children[1], tr.configs[1])
test.capture [[
FDC4CBFB4635B02D8AD4823B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CONFIGURATION_BUILD_DIR = bin/Debug;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_DYNAMIC_NO_PIC = NO;
INSTALL_PATH = "\"$(HOME)/Applications\"";
PRODUCT_NAME = MyProject;
WRAPPER_EXTENSION = "";
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationTarget_OnOSXBundleTargetExtension()
kind "SharedLib"
sharedlibtype "OSXBundle"
targetextension ".xyz"
prepare()
xcode.XCBuildConfiguration_Target(tr, tr.products.children[1], tr.configs[1])
test.capture [[
4FD8665471A41386AE593C94 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CONFIGURATION_BUILD_DIR = bin/Debug;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_DYNAMIC_NO_PIC = NO;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
PRODUCT_NAME = MyProject;
WRAPPER_EXTENSION = xyz;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationTarget_OnOSXBundleNoTargetExtension()
kind "SharedLib"
sharedlibtype "OSXBundle"
targetextension ""
prepare()
xcode.XCBuildConfiguration_Target(tr, tr.products.children[1], tr.configs[1])
test.capture [[
FDC4CBFB4635B02D8AD4823B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CONFIGURATION_BUILD_DIR = bin/Debug;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_DYNAMIC_NO_PIC = NO;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
PRODUCT_NAME = MyProject;
WRAPPER_EXTENSION = "";
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationTarget_OnOSXFrameworkTargetExtension()
kind "SharedLib"
sharedlibtype "OSXFramework"
targetextension ".xyz"
prepare()
xcode.XCBuildConfiguration_Target(tr, tr.products.children[1], tr.configs[1])
test.capture [[
4FD8665471A41386AE593C94 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CONFIGURATION_BUILD_DIR = bin/Debug;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_DYNAMIC_NO_PIC = NO;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
PRODUCT_NAME = MyProject;
WRAPPER_EXTENSION = xyz;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationTarget_OnOSXFrameworkNoTargetExtension()
kind "SharedLib"
sharedlibtype "OSXFramework"
targetextension ""
prepare()
xcode.XCBuildConfiguration_Target(tr, tr.products.children[1], tr.configs[1])
test.capture [[
FDC4CBFB4635B02D8AD4823B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CONFIGURATION_BUILD_DIR = bin/Debug;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_DYNAMIC_NO_PIC = NO;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
PRODUCT_NAME = MyProject;
WRAPPER_EXTENSION = "";
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationTarget_OnOSXMinVersion()
_TARGET_OS = "macosx"
systemversion "10.11"
prepare()
xcode.XCBuildConfiguration_Target(tr, tr.products.children[1], tr.configs[1])
test.capture [[
FDC4CBFB4635B02D8AD4823B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CONFIGURATION_BUILD_DIR = bin/Debug;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_DYNAMIC_NO_PIC = NO;
INSTALL_PATH = /usr/local/bin;
MACOSX_DEPLOYMENT_TARGET = 10.11;
PRODUCT_NAME = MyProject;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationTarget_OnOSXUnSpecificedVersion()
_TARGET_OS = "macosx"
-- systemversion "10.11"
prepare()
xcode.XCBuildConfiguration_Target(tr, tr.products.children[1], tr.configs[1])
test.capture [[
FDC4CBFB4635B02D8AD4823B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CONFIGURATION_BUILD_DIR = bin/Debug;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_DYNAMIC_NO_PIC = NO;
INSTALL_PATH = /usr/local/bin;
PRODUCT_NAME = MyProject;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationTarget_OnInfoPlist()
files { "./a/b/c/MyProject-Info.plist" }
prepare()
xcode.XCBuildConfiguration_Target(tr, tr.products.children[1], tr.configs[1])
test.capture [[
FDC4CBFB4635B02D8AD4823B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CONFIGURATION_BUILD_DIR = bin/Debug;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_DYNAMIC_NO_PIC = NO;
INFOPLIST_FILE = "a/b/c/MyProject-Info.plist";
INSTALL_PATH = /usr/local/bin;
PRODUCT_NAME = MyProject;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationTarget_OnSymbols()
symbols "On"
prepare()
xcode.XCBuildConfiguration_Target(tr, tr.products.children[1], tr.configs[1])
test.capture [[
FDC4CBFB4635B02D8AD4823B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CONFIGURATION_BUILD_DIR = bin/Debug;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_DYNAMIC_NO_PIC = NO;
INSTALL_PATH = /usr/local/bin;
PRODUCT_NAME = MyProject;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationTarget_OnTargetSuffix()
targetsuffix "-d"
prepare()
xcode.XCBuildConfiguration_Target(tr, tr.products.children[1], tr.configs[1])
test.capture [[
46BCF44C6EF7ACFE56933A8C /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CONFIGURATION_BUILD_DIR = bin/Debug;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_DYNAMIC_NO_PIC = NO;
INSTALL_PATH = /usr/local/bin;
PRODUCT_NAME = "MyProject-d";
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationTarget_OnSinglePlatform()
platforms { "Universal32" }
prepare()
xcode.XCBuildConfiguration_Target(tr, tr.products.children[1], tr.configs[1])
test.capture [[
FDC4CBFB4635B02D8AD4823B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CONFIGURATION_BUILD_DIR = bin/Universal32/Debug;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_DYNAMIC_NO_PIC = NO;
INSTALL_PATH = /usr/local/bin;
PRODUCT_NAME = MyProject;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationTarget_OnMultiplePlatforms()
workspace("MyWorkspace")
platforms { "Universal32", "Universal64" }
prepare()
xcode.XCBuildConfiguration_Target(tr, tr.products.children[1], tr.configs[1])
test.capture [[
FDC4CBFB4635B02D8AD4823B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CONFIGURATION_BUILD_DIR = bin/Universal32/Debug;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_DYNAMIC_NO_PIC = NO;
INSTALL_PATH = /usr/local/bin;
PRODUCT_NAME = MyProject;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationTarget_OnIOS()
_TARGET_OS = "ios"
prepare()
xcode.XCBuildConfiguration_Target(tr, tr.products.children[1], tr.configs[1])
test.capture [[
FDC4CBFB4635B02D8AD4823B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CONFIGURATION_BUILD_DIR = bin/Debug;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_DYNAMIC_NO_PIC = NO;
INSTALL_PATH = /usr/local/bin;
PRODUCT_NAME = MyProject;
SDKROOT = iphoneos;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationTarget_OnIOSMinVersion()
_TARGET_OS = "ios"
systemversion "8.3"
prepare()
xcode.XCBuildConfiguration_Target(tr, tr.products.children[1], tr.configs[1])
test.capture [[
FDC4CBFB4635B02D8AD4823B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CONFIGURATION_BUILD_DIR = bin/Debug;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_DYNAMIC_NO_PIC = NO;
INSTALL_PATH = /usr/local/bin;
IPHONEOS_DEPLOYMENT_TARGET = 8.3;
PRODUCT_NAME = MyProject;
SDKROOT = iphoneos;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationTarget_OnIOSMinMaxVersion()
_TARGET_OS = "ios"
systemversion "8.3:9.1"
prepare()
xcode.XCBuildConfiguration_Target(tr, tr.products.children[1], tr.configs[1])
test.capture [[
FDC4CBFB4635B02D8AD4823B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CONFIGURATION_BUILD_DIR = bin/Debug;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_DYNAMIC_NO_PIC = NO;
INSTALL_PATH = /usr/local/bin;
IPHONEOS_DEPLOYMENT_TARGET = 8.3;
PRODUCT_NAME = MyProject;
SDKROOT = iphoneos;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationTarget_OnIOSCodeSigningIdentity()
_TARGET_OS = "ios"
xcodecodesigningidentity "Premake Developers"
prepare()
xcode.XCBuildConfiguration_Target(tr, tr.products.children[1], tr.configs[1])
test.capture [[
FDC4CBFB4635B02D8AD4823B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Premake Developers";
CONFIGURATION_BUILD_DIR = bin/Debug;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_DYNAMIC_NO_PIC = NO;
INSTALL_PATH = /usr/local/bin;
PRODUCT_NAME = MyProject;
SDKROOT = iphoneos;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationTarget_OnIOSFamily()
_TARGET_OS = "ios"
iosfamily "Universal"
prepare()
xcode.XCBuildConfiguration_Target(tr, tr.products.children[1], tr.configs[1])
test.capture [[
FDC4CBFB4635B02D8AD4823B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CONFIGURATION_BUILD_DIR = bin/Debug;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_DYNAMIC_NO_PIC = NO;
INSTALL_PATH = /usr/local/bin;
PRODUCT_NAME = MyProject;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
]]
end
---------------------------------------------------------------------------
-- XCBuildConfiguration_Project tests
---------------------------------------------------------------------------
function suite.XCBuildConfigurationProject_OnConsoleApp()
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = NO;
SYMROOT = bin/Debug;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnOptimizeSize()
optimize "Size"
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_OPTIMIZATION_LEVEL = s;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = NO;
SYMROOT = bin/Debug;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnOptimizeSpeed()
optimize "Speed"
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_OPTIMIZATION_LEVEL = 3;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = NO;
SYMROOT = bin/Debug;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnStaticRuntime()
flags { "StaticRuntime" }
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = NO;
STANDARD_C_PLUS_PLUS_LIBRARY_TYPE = static;
SYMROOT = bin/Debug;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnTargetDir()
targetdir "bin"
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = NO;
SYMROOT = bin;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnDefines()
defines { "_DEBUG", "DEBUG" }
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
_DEBUG,
DEBUG,
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = NO;
SYMROOT = bin/Debug;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnIncludeDirs()
includedirs { "../include", "../libs", "../name with spaces" }
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = NO;
SYMROOT = bin/Debug;
USER_HEADER_SEARCH_PATHS = (
../include,
../libs,
"\"../name with spaces\"",
);
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnExternalIncludeDirs()
externalincludedirs { "../include", "../libs", "../name with spaces" }
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = NO;
SYMROOT = bin/Debug;
SYSTEM_HEADER_SEARCH_PATHS = (
../include,
../libs,
"\"../name with spaces\"",
"$(inherited)",
);
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnBuildOptions()
buildoptions { "build option 1", "build option 2" }
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = NO;
OTHER_CFLAGS = (
"build option 1",
"build option 2",
);
SYMROOT = bin/Debug;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnRunPathSearchPaths()
runpathdirs { "plugins" }
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
LD_RUNPATH_SEARCH_PATHS = (
"@loader_path/../../plugins",
);
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = NO;
SYMROOT = bin/Debug;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnLinks()
links { "Cocoa.framework", "ldap" }
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = NO;
OTHER_LDFLAGS = (
"-lldap",
);
SYMROOT = bin/Debug;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnLinkOptions()
linkoptions { "link option 1", "link option 2" }
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = NO;
OTHER_LDFLAGS = (
"link option 1",
"link option 2",
);
SYMROOT = bin/Debug;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnNoWarnings()
warnings "Off"
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = NO;
SYMROOT = bin/Debug;
WARNING_CFLAGS = "-w";
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnHighWarnings()
warnings "High"
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = NO;
SYMROOT = bin/Debug;
WARNING_CFLAGS = "-Wall";
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnExtraWarnings()
warnings "Extra"
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = NO;
SYMROOT = bin/Debug;
WARNING_CFLAGS = "-Wall -Wextra";
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnEverythingWarnings()
warnings "Everything"
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = NO;
SYMROOT = bin/Debug;
WARNING_CFLAGS = "-Weverything";
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnFatalWarnings()
flags { "FatalWarnings" }
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = NO;
SYMROOT = bin/Debug;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnFloatFast()
flags { "FloatFast" }
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = NO;
OTHER_CFLAGS = (
"-ffast-math",
);
SYMROOT = bin/Debug;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnOpenMP()
openmp "On"
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = NO;
OTHER_CFLAGS = (
"-fopenmp",
);
SYMROOT = bin/Debug;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnFloatStrict()
floatingpoint "Strict"
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = NO;
SYMROOT = bin/Debug;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnNoEditAndContinue()
editandcontinue "Off"
symbols "On"
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
COPY_PHASE_STRIP = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = YES;
SYMROOT = bin/Debug;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnNoExceptions()
exceptionhandling "Off"
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_ENABLE_CPP_EXCEPTIONS = NO;
GCC_ENABLE_OBJC_EXCEPTIONS = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = NO;
SYMROOT = bin/Debug;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnNoFramePointer()
flags { "NoFramePointer" }
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = NO;
OTHER_CFLAGS = (
"-fomit-frame-pointer",
);
SYMROOT = bin/Debug;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnOmitFramePointer()
omitframepointer "On"
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = NO;
OTHER_CFLAGS = (
"-fomit-frame-pointer",
);
SYMROOT = bin/Debug;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnNoOmitFramePointer()
omitframepointer "Off"
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = NO;
OTHER_CFLAGS = (
"-fno-omit-frame-pointer",
);
SYMROOT = bin/Debug;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnNoPCH()
pchheader "MyProject_Prefix.pch"
flags { "NoPCH" }
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = NO;
SYMROOT = bin/Debug;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnNoRTTI()
rtti "Off"
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_ENABLE_CPP_RTTI = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = NO;
SYMROOT = bin/Debug;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnSymbols()
symbols "On"
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
COPY_PHASE_STRIP = NO;
GCC_ENABLE_FIX_AND_CONTINUE = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = YES;
SYMROOT = bin/Debug;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnLibDirs()
libdirs { "mylibs1", "mylibs2" }
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
LIBRARY_SEARCH_PATHS = (
mylibs1,
mylibs2,
);
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = NO;
SYMROOT = bin/Debug;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnSysLibDirs()
libdirs { "mylibs1", "mylibs2" }
syslibdirs { "mysyslib3", "mysyslib4" }
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
LIBRARY_SEARCH_PATHS = (
mylibs1,
mylibs2,
mysyslib3,
mysyslib4,
);
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = NO;
SYMROOT = bin/Debug;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnPCH()
pchheader "MyProject_Prefix.pch"
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = MyProject_Prefix.pch;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = NO;
SYMROOT = bin/Debug;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnUniversal()
workspace("MyWorkspace")
platforms { "Universal" }
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Universal/Debug;
ONLY_ACTIVE_ARCH = NO;
SYMROOT = bin/Universal/Debug;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnUniversal32()
workspace("MyWorkspace")
platforms { "Universal32" }
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Universal32/Debug;
ONLY_ACTIVE_ARCH = NO;
SYMROOT = bin/Universal32/Debug;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnUniversal64()
workspace("MyWorkspace")
platforms { "Universal64" }
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Universal64/Debug;
ONLY_ACTIVE_ARCH = NO;
SYMROOT = bin/Universal64/Debug;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnNative()
workspace("MyWorkspace")
platforms { "Native" }
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Native/Debug;
ONLY_ACTIVE_ARCH = NO;
SYMROOT = bin/Native/Debug;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnX86()
workspace("MyWorkspace")
platforms { "x86" }
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = i386;
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/x86/Debug;
ONLY_ACTIVE_ARCH = NO;
SYMROOT = bin/x86/Debug;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnX86_64()
workspace("MyWorkspace")
platforms { "x86_64" }
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = x86_64;
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/x86_64/Debug;
ONLY_ACTIVE_ARCH = NO;
SYMROOT = bin/x86_64/Debug;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnMultiplePlatforms()
workspace("MyWorkspace")
platforms { "Universal32", "Universal64" }
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Universal32/Debug;
ONLY_ACTIVE_ARCH = NO;
SYMROOT = bin/Universal32/Debug;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnCDefault()
workspace("MyWorkspace")
cdialect("Default")
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_C_LANGUAGE_STANDARD = "compiler-default";
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = NO;
SYMROOT = bin/Debug;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnC89()
workspace("MyWorkspace")
cdialect("C89")
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_C_LANGUAGE_STANDARD = c89;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = NO;
SYMROOT = bin/Debug;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnC90()
workspace("MyWorkspace")
cdialect("C90")
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_C_LANGUAGE_STANDARD = c90;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = NO;
SYMROOT = bin/Debug;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnC99()
workspace("MyWorkspace")
cdialect("C99")
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_C_LANGUAGE_STANDARD = c99;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = NO;
SYMROOT = bin/Debug;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnC11()
workspace("MyWorkspace")
cdialect("C11")
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_C_LANGUAGE_STANDARD = c11;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = NO;
SYMROOT = bin/Debug;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnGnu89()
workspace("MyWorkspace")
cdialect("gnu89")
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_C_LANGUAGE_STANDARD = gnu89;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = NO;
SYMROOT = bin/Debug;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnGnu90()
workspace("MyWorkspace")
cdialect("gnu90")
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_C_LANGUAGE_STANDARD = gnu90;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = NO;
SYMROOT = bin/Debug;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnGnu99()
workspace("MyWorkspace")
cdialect("gnu99")
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = NO;
SYMROOT = bin/Debug;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnGnu11()
workspace("MyWorkspace")
cdialect("gnu11")
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = NO;
SYMROOT = bin/Debug;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnCppDefault()
workspace("MyWorkspace")
cppdialect("Default")
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CLANG_CXX_LANGUAGE_STANDARD = "compiler-default";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = NO;
SYMROOT = bin/Debug;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnCpp98()
workspace("MyWorkspace")
cppdialect("C++98")
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CLANG_CXX_LANGUAGE_STANDARD = "c++98";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = NO;
SYMROOT = bin/Debug;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnCpp11()
workspace("MyWorkspace")
cppdialect("C++11")
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CLANG_CXX_LANGUAGE_STANDARD = "c++11";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = NO;
SYMROOT = bin/Debug;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnCpp0x()
workspace("MyWorkspace")
cppdialect("C++0x")
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CLANG_CXX_LANGUAGE_STANDARD = "c++11";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = NO;
SYMROOT = bin/Debug;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnCpp14()
workspace("MyWorkspace")
cppdialect("C++14")
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CLANG_CXX_LANGUAGE_STANDARD = "c++14";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = NO;
SYMROOT = bin/Debug;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnCpp1y()
workspace("MyWorkspace")
cppdialect("C++1y")
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CLANG_CXX_LANGUAGE_STANDARD = "c++14";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = NO;
SYMROOT = bin/Debug;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnCpp17()
workspace("MyWorkspace")
cppdialect("C++17")
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CLANG_CXX_LANGUAGE_STANDARD = "c++1z";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = NO;
SYMROOT = bin/Debug;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnCpp1z()
workspace("MyWorkspace")
cppdialect("C++1z")
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CLANG_CXX_LANGUAGE_STANDARD = "c++1z";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = NO;
SYMROOT = bin/Debug;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnCpp20()
workspace("MyWorkspace")
cppdialect("C++20")
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CLANG_CXX_LANGUAGE_STANDARD = "c++2a";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = NO;
SYMROOT = bin/Debug;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnCpp2a()
workspace("MyWorkspace")
cppdialect("C++2a")
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CLANG_CXX_LANGUAGE_STANDARD = "c++2a";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = NO;
SYMROOT = bin/Debug;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnCppGnu98()
workspace("MyWorkspace")
cppdialect("gnu++98")
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++98";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = NO;
SYMROOT = bin/Debug;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnCppGnu11()
workspace("MyWorkspace")
cppdialect("gnu++11")
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = NO;
SYMROOT = bin/Debug;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnCppGnu0x()
workspace("MyWorkspace")
cppdialect("gnu++0x")
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = NO;
SYMROOT = bin/Debug;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnCppGnu14()
workspace("MyWorkspace")
cppdialect("gnu++14")
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = NO;
SYMROOT = bin/Debug;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnCppGnu1y()
workspace("MyWorkspace")
cppdialect("gnu++1y")
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = NO;
SYMROOT = bin/Debug;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnCppGnu17()
workspace("MyWorkspace")
cppdialect("gnu++17")
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++1z";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = NO;
SYMROOT = bin/Debug;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnCppGnu1z()
workspace("MyWorkspace")
cppdialect("gnu++1z")
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++1z";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = NO;
SYMROOT = bin/Debug;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnCppGnu20()
workspace("MyWorkspace")
cppdialect("gnu++20")
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++2a";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = NO;
SYMROOT = bin/Debug;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnCppGnu2a()
workspace("MyWorkspace")
cppdialect("gnu++2a")
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++2a";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = NO;
SYMROOT = bin/Debug;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnUnsignedCharOn()
workspace("MyWorkspace")
unsignedchar "On"
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_CHAR_IS_UNSIGNED_CHAR = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = NO;
SYMROOT = bin/Debug;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnUnsignedCharOff()
workspace("MyWorkspace")
unsignedchar "Off"
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_CHAR_IS_UNSIGNED_CHAR = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = NO;
SYMROOT = bin/Debug;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnRemoveXcodebuildSettings()
xcodebuildsettings {
ARCHS = false
}
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = NO;
SYMROOT = bin/Debug;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnSwift4_0()
workspace("MyWorkspace")
swiftversion("4.0")
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = NO;
SWIFT_VERSION = 4.0;
SYMROOT = bin/Debug;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnSwift4_2()
workspace("MyWorkspace")
swiftversion("4.2")
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = NO;
SWIFT_VERSION = 4.2;
SYMROOT = bin/Debug;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnSwift5_0()
workspace("MyWorkspace")
swiftversion("5.0")
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = NO;
SWIFT_VERSION = 5.0;
SYMROOT = bin/Debug;
};
name = Debug;
};
]]
end
---------------------------------------------------------------------------
-- XCBuildConfigurationList tests
---------------------------------------------------------------------------
function suite.XCBuildConfigurationList_OnNoPlatforms()
prepare()
xcode.XCBuildConfigurationList(tr)
test.capture [[
/* Begin XCConfigurationList section */
1DEB928908733DD80010E9CD /* Build configuration list for PBXProject "MyProject" */ = {
isa = XCConfigurationList;
buildConfigurations = (
A14350AC4595EE5E57CE36EC /* Debug */,
F3C205E6F732D818789F7C26 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Debug;
};
8E187FB5316408E74C34D5F5 /* Build configuration list for PBXNativeTarget "MyProject" */ = {
isa = XCConfigurationList;
buildConfigurations = (
FDC4CBFB4635B02D8AD4823B /* Debug */,
C8EAD1B5F1258A67D8C117F5 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Debug;
};
/* End XCConfigurationList section */
]]
end
function suite.XCBuildConfigurationList_OnSinglePlatforms()
platforms { "Universal32" }
prepare()
xcode.XCBuildConfigurationList(tr)
test.capture [[
/* Begin XCConfigurationList section */
1DEB928908733DD80010E9CD /* Build configuration list for PBXProject "MyProject" */ = {
isa = XCConfigurationList;
buildConfigurations = (
A14350AC4595EE5E57CE36EC /* Debug */,
F3C205E6F732D818789F7C26 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Debug;
};
8E187FB5316408E74C34D5F5 /* Build configuration list for PBXNativeTarget "MyProject" */ = {
isa = XCConfigurationList;
buildConfigurations = (
FDC4CBFB4635B02D8AD4823B /* Debug */,
C8EAD1B5F1258A67D8C117F5 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Debug;
};
/* End XCConfigurationList section */
]]
end
function suite.XCBuildConfigurationList_OnMultiplePlatforms()
workspace("MyWorkspace")
platforms { "Universal32", "Universal64" }
prepare()
xcode.XCBuildConfigurationList(tr)
test.capture [[
/* Begin XCConfigurationList section */
1DEB928908733DD80010E9CD /* Build configuration list for PBXProject "MyProject" */ = {
isa = XCConfigurationList;
buildConfigurations = (
A14350AC4595EE5E57CE36EC /* Debug */,
A14350AC4595EE5E57CE36EC /* Debug */,
F3C205E6F732D818789F7C26 /* Release */,
F3C205E6F732D818789F7C26 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Debug;
};
8E187FB5316408E74C34D5F5 /* Build configuration list for PBXNativeTarget "MyProject" */ = {
isa = XCConfigurationList;
buildConfigurations = (
FDC4CBFB4635B02D8AD4823B /* Debug */,
FDC4CBFB4635B02D8AD4823B /* Debug */,
C8EAD1B5F1258A67D8C117F5 /* Release */,
C8EAD1B5F1258A67D8C117F5 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Debug;
};
/* End XCConfigurationList section */
]]
end
function suite.defaultVisibility_settingIsFound()
prepare()
xcode.XCBuildConfiguration(tr)
local str = p.captured()
test.istrue(str:find('GCC_SYMBOLS_PRIVATE_EXTERN'))
end
function suite.defaultVisibilitySetting_setToNo()
prepare()
xcode.XCBuildConfiguration(tr)
local str = p.captured()
test.istrue(str:find('GCC_SYMBOLS_PRIVATE_EXTERN = NO;'))
end
function suite.releaseBuild_onlyDefaultArch_equalsNo()
optimize "On"
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[2])
local str = p.captured()
test.istrue(str:find('ONLY_ACTIVE_ARCH = NO;'))
end
function suite.debugBuild_onlyDefaultArch_equalsYes()
symbols "On"
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
local str = p.captured()
test.istrue(str:find('ONLY_ACTIVE_ARCH = YES;'))
end
| bsd-3-clause |
Sonicrich05/FFXI-Server | scripts/zones/Port_Jeuno/npcs/Zona_Shodhun.lua | 34 | 3745 | -----------------------------------
-- Area: Port Jeuno
-- NPC: Zona Shodhun
-- Starts and Finishes Quest: Pretty Little Things
-- @zone 246
-- @pos -175 -5 -4
-----------------------------------
package.loaded["scripts/globals/settings"] = nil;
-----------------------------------
require("scripts/globals/settings");
require("scripts/globals/shop");
require("scripts/globals/quests");
require("scripts/zones/Port_Bastok/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
count = trade:getItemCount();
gil = trade:getGil();
itemQuality = 0;
if (trade:getItemCount() == 1 and trade:getGil() == 0) then
if (trade:hasItemQty(771,1)) then -- Yellow Rock
itemQuality = 2;
elseif (trade:hasItemQty(769,1) or -- Red Rock
trade:hasItemQty(770,1) or -- Blue Rock
trade:hasItemQty(772,1) or -- Green Rock
trade:hasItemQty(773,1) or -- Translucent Rock
trade:hasItemQty(774,1) or -- Purple Rock
trade:hasItemQty(775,1) or -- Black Rock
trade:hasItemQty(776,1) or -- White Rock
trade:hasItemQty(957,1) or -- Amaryllis
trade:hasItemQty(2554,1) or -- Asphodel
trade:hasItemQty(948,1) or -- Carnation
trade:hasItemQty(1120,1) or -- Casablanca
trade:hasItemQty(1413,1) or -- Cattleya
trade:hasItemQty(636,1) or -- Chamomile
trade:hasItemQty(959,1) or -- Dahlia
trade:hasItemQty(835,1) or -- Flax Flower
trade:hasItemQty(956,1) or -- Lilac
trade:hasItemQty(2507,1) or -- Lycopodium Flower
trade:hasItemQty(958,1) or -- Marguerite
trade:hasItemQty(1412,1) or -- Olive Flower
trade:hasItemQty(938,1) or -- Papaka Grass
trade:hasItemQty(1411,1) or -- Phalaenopsis
trade:hasItemQty(949,1) or -- Rain Lily
trade:hasItemQty(941,1) or -- Red Rose
trade:hasItemQty(1725,1) or -- Snow Lily
trade:hasItemQty(1410,1) or -- Sweet William
trade:hasItemQty(950,1) or -- Tahrongi Cactus
trade:hasItemQty(2960,1) or -- Water Lily
trade:hasItemQty(951,1)) then -- Wijnruit
itemQuality = 1;
end
end
PrettyLittleThings = player:getQuestStatus(JEUNO,PRETTY_LITTLE_THINGS);
if (itemQuality == 2) then
if (PrettyLittleThings == QUEST_COMPLETED) then
player:startEvent(0x2727, 0, 246, 4);
else
player:startEvent(0x2727, 0, 246, 2);
end
elseif (itemQuality == 1) then
if (PrettyLittleThings == QUEST_COMPLETED) then
player:startEvent(0x2727, 0, 246, 5);
elseif (PrettyLittleThings == QUEST_ACCEPTED) then
player:startEvent(0x2727, 0, 246, 3);
else
player:startEvent(0x2727, 0, 246, 1);
end
else
player:startEvent(0x2727, 0, 246, 0);
end
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
player:startEvent(0x2727, 0, 246, 10);
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 == 0x2727 and option == 4002) then
player:moghouseFlag(8);
player:messageSpecial(MOGHOUSE_EXIT);
player:addFame(JEUNO, JEUNO_FAME*30);
player:tradeComplete();
player:completeQuest(JEUNO,PRETTY_LITTLE_THINGS);
elseif (csid == 0x2727 and option == 1) then
player:tradeComplete();
player:addQuest(JEUNO,PRETTY_LITTLE_THINGS);
end
end; | gpl-3.0 |
Sonicrich05/FFXI-Server | scripts/zones/Kuftal_Tunnel/Zone.lua | 17 | 2256 | -----------------------------------
--
-- Zone: Kuftal_Tunnel (174)
--
-----------------------------------
package.loaded["scripts/zones/Kuftal_Tunnel/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/settings");
require("scripts/globals/zone");
require("scripts/zones/Kuftal_Tunnel/TextIDs");
require("scripts/globals/weather");
-----------------------------------
-- onInitialize
-----------------------------------
function onInitialize(zone)
local tomes = {17490321,17490322,17490323,17490324};
SetGroundsTome(tomes);
-- Guivre
SetRespawnTime(17490234, 900, 10800);
UpdateTreasureSpawnPoint(17490300);
end;
-----------------------------------
-- onConquestUpdate
-----------------------------------
function onConquestUpdate(zone, updatetype)
local players = zone:getPlayers();
for name, player in pairs(players) do
conquestUpdate(zone, player, updatetype, CONQUEST_BASE);
end
end;
-----------------------------------
-- onZoneIn
-----------------------------------
function onZoneIn(player,prevZone)
local cs = -1;
if ((player:getXPos() == 0) and (player:getYPos() == 0) and (player:getZPos() == 0)) then
player:setPos(20.37,-21.104,275.782,46);
end
return cs;
end;
-----------------------------------
-- onRegionEnter
-----------------------------------
function onRegionEnter(player,region)
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end;
-----------------------------------
-- onZoneWeatherChange
-----------------------------------
function onZoneWeatherChange(weather)
if (weather == WEATHER_WIND or weather == WEATHER_GALES) then
GetNPCByID(17490280):setAnimation(9); -- Rock Up
else
GetNPCByID(17490280):setAnimation(8); -- Rock Down
end
end;
| gpl-3.0 |
premake/premake-core | binmodules/luasocket/test/urltest.lua | 12 | 19140 | local socket = require("socket")
socket.url = require("socket.url")
dofile("testsupport.lua")
local check_build_url = function(parsed)
local built = socket.url.build(parsed)
if built ~= parsed.url then
print("built is different from expected")
print(built)
print(expected)
os.exit()
end
end
local check_protect = function(parsed, path, unsafe)
local built = socket.url.build_path(parsed, unsafe)
if built ~= path then
print(built, path)
print("path composition failed.")
os.exit()
end
end
local check_invert = function(url)
local parsed = socket.url.parse(url)
parsed.path = socket.url.build_path(socket.url.parse_path(parsed.path))
local rebuilt = socket.url.build(parsed)
if rebuilt ~= url then
print(url, rebuilt)
print("original and rebuilt are different")
os.exit()
end
end
local check_parse_path = function(path, expect)
local parsed = socket.url.parse_path(path)
for i = 1, math.max(#parsed, #expect) do
if parsed[i] ~= expect[i] then
print(path)
os.exit()
end
end
if expect.is_directory ~= parsed.is_directory then
print(path)
print("is_directory mismatch")
os.exit()
end
if expect.is_absolute ~= parsed.is_absolute then
print(path)
print("is_absolute mismatch")
os.exit()
end
local built = socket.url.build_path(expect)
if built ~= path then
print(built, path)
print("path composition failed.")
os.exit()
end
end
local check_absolute_url = function(base, relative, absolute)
local res = socket.url.absolute(base, relative)
if res ~= absolute then
io.write("absolute: In test for '", relative, "' expected '",
absolute, "' but got '", res, "'\n")
os.exit()
end
end
local check_parse_url = function(gaba)
local url = gaba.url
gaba.url = nil
local parsed = socket.url.parse(url)
for i, v in pairs(gaba) do
if v ~= parsed[i] then
io.write("parse: In test for '", url, "' expected ", i, " = '",
v, "' but got '", tostring(parsed[i]), "'\n")
for i,v in pairs(parsed) do print(i,v) end
os.exit()
end
end
for i, v in pairs(parsed) do
if v ~= gaba[i] then
io.write("parse: In test for '", url, "' expected ", i, " = '",
tostring(gaba[i]), "' but got '", v, "'\n")
for i,v in pairs(parsed) do print(i,v) end
os.exit()
end
end
end
print("testing URL parsing")
check_parse_url{
url = "scheme://user:pass$%?#wd@host:port/path;params?query#fragment",
scheme = "scheme",
authority = "user:pass$%?#wd@host:port",
host = "host",
port = "port",
userinfo = "user:pass$%?#wd",
password = "pass$%?#wd",
user = "user",
path = "/path",
params = "params",
query = "query",
fragment = "fragment"
}
check_parse_url{
url = "scheme://user:pass?#wd@host:port/path;params?query#fragment",
scheme = "scheme",
authority = "user:pass?#wd@host:port",
host = "host",
port = "port",
userinfo = "user:pass?#wd",
password = "pass?#wd",
user = "user",
path = "/path",
params = "params",
query = "query",
fragment = "fragment"
}
check_parse_url{
url = "scheme://user:pass-wd@host:port/path;params?query#fragment",
scheme = "scheme",
authority = "user:pass-wd@host:port",
host = "host",
port = "port",
userinfo = "user:pass-wd",
password = "pass-wd",
user = "user",
path = "/path",
params = "params",
query = "query",
fragment = "fragment"
}
check_parse_url{
url = "scheme://user:pass#wd@host:port/path;params?query#fragment",
scheme = "scheme",
authority = "user:pass#wd@host:port",
host = "host",
port = "port",
userinfo = "user:pass#wd",
password = "pass#wd",
user = "user",
path = "/path",
params = "params",
query = "query",
fragment = "fragment"
}
check_parse_url{
url = "scheme://user:pass#wd@host:port/path;params?query",
scheme = "scheme",
authority = "user:pass#wd@host:port",
host = "host",
port = "port",
userinfo = "user:pass#wd",
password = "pass#wd",
user = "user",
path = "/path",
params = "params",
query = "query",
}
check_parse_url{
url = "scheme://userinfo@host:port/path;params?query#fragment",
scheme = "scheme",
authority = "userinfo@host:port",
host = "host",
port = "port",
userinfo = "userinfo",
user = "userinfo",
path = "/path",
params = "params",
query = "query",
fragment = "fragment"
}
check_parse_url{
url = "scheme://user:password@host:port/path;params?query#fragment",
scheme = "scheme",
authority = "user:password@host:port",
host = "host",
port = "port",
userinfo = "user:password",
user = "user",
password = "password",
path = "/path",
params = "params",
query = "query",
fragment = "fragment",
}
check_parse_url{
url = "scheme://userinfo@host:port/path;params?query#",
scheme = "scheme",
authority = "userinfo@host:port",
host = "host",
port = "port",
userinfo = "userinfo",
user = "userinfo",
path = "/path",
params = "params",
query = "query",
fragment = ""
}
check_parse_url{
url = "scheme://userinfo@host:port/path;params?#fragment",
scheme = "scheme",
authority = "userinfo@host:port",
host = "host",
port = "port",
userinfo = "userinfo",
user = "userinfo",
path = "/path",
params = "params",
query = "",
fragment = "fragment"
}
check_parse_url{
url = "scheme://userinfo@host:port/path;params#fragment",
scheme = "scheme",
authority = "userinfo@host:port",
host = "host",
port = "port",
userinfo = "userinfo",
user = "userinfo",
path = "/path",
params = "params",
fragment = "fragment"
}
check_parse_url{
url = "scheme://userinfo@host:port/path;?query#fragment",
scheme = "scheme",
authority = "userinfo@host:port",
host = "host",
port = "port",
userinfo = "userinfo",
user = "userinfo",
path = "/path",
params = "",
query = "query",
fragment = "fragment"
}
check_parse_url{
url = "scheme://userinfo@host:port/path?query#fragment",
scheme = "scheme",
authority = "userinfo@host:port",
host = "host",
port = "port",
userinfo = "userinfo",
user = "userinfo",
path = "/path",
query = "query",
fragment = "fragment"
}
check_parse_url{
url = "scheme://userinfo@host:port/;params?query#fragment",
scheme = "scheme",
authority = "userinfo@host:port",
host = "host",
port = "port",
userinfo = "userinfo",
user = "userinfo",
path = "/",
params = "params",
query = "query",
fragment = "fragment"
}
check_parse_url{
url = "scheme://userinfo@host:port",
scheme = "scheme",
authority = "userinfo@host:port",
host = "host",
port = "port",
userinfo = "userinfo",
user = "userinfo",
}
check_parse_url{
url = "//userinfo@host:port/path;params?query#fragment",
authority = "userinfo@host:port",
host = "host",
port = "port",
userinfo = "userinfo",
user = "userinfo",
path = "/path",
params = "params",
query = "query",
fragment = "fragment"
}
check_parse_url{
url = "//userinfo@host:port/path",
authority = "userinfo@host:port",
host = "host",
port = "port",
userinfo = "userinfo",
user = "userinfo",
path = "/path",
}
check_parse_url{
url = "//userinfo@host/path",
authority = "userinfo@host",
host = "host",
userinfo = "userinfo",
user = "userinfo",
path = "/path",
}
check_parse_url{
url = "//user:password@host/path",
authority = "user:password@host",
host = "host",
userinfo = "user:password",
password = "password",
user = "user",
path = "/path",
}
check_parse_url{
url = "//user:@host/path",
authority = "user:@host",
host = "host",
userinfo = "user:",
password = "",
user = "user",
path = "/path",
}
check_parse_url{
url = "//user@host:port/path",
authority = "user@host:port",
host = "host",
userinfo = "user",
user = "user",
port = "port",
path = "/path",
}
check_parse_url{
url = "//host:port/path",
authority = "host:port",
port = "port",
host = "host",
path = "/path",
}
check_parse_url{
url = "//host/path",
authority = "host",
host = "host",
path = "/path",
}
check_parse_url{
url = "//host",
authority = "host",
host = "host",
}
check_parse_url{
url = "/path",
path = "/path",
}
check_parse_url{
url = "path",
path = "path",
}
-- IPv6 tests
check_parse_url{
url = "http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html",
scheme = "http",
host = "FEDC:BA98:7654:3210:FEDC:BA98:7654:3210",
authority = "[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80",
port = "80",
path = "/index.html"
}
check_parse_url{
url = "http://[1080:0:0:0:8:800:200C:417A]/index.html",
scheme = "http",
host = "1080:0:0:0:8:800:200C:417A",
authority = "[1080:0:0:0:8:800:200C:417A]",
path = "/index.html"
}
check_parse_url{
url = "http://[3ffe:2a00:100:7031::1]",
scheme = "http",
host = "3ffe:2a00:100:7031::1",
authority = "[3ffe:2a00:100:7031::1]",
}
check_parse_url{
url = "http://[1080::8:800:200C:417A]/foo",
scheme = "http",
host = "1080::8:800:200C:417A",
authority = "[1080::8:800:200C:417A]",
path = "/foo"
}
check_parse_url{
url = "http://[::192.9.5.5]/ipng",
scheme = "http",
host = "::192.9.5.5",
authority = "[::192.9.5.5]",
path = "/ipng"
}
check_parse_url{
url = "http://[::FFFF:129.144.52.38]:80/index.html",
scheme = "http",
host = "::FFFF:129.144.52.38",
port = "80",
authority = "[::FFFF:129.144.52.38]:80",
path = "/index.html"
}
check_parse_url{
url = "http://[2010:836B:4179::836B:4179]",
scheme = "http",
host = "2010:836B:4179::836B:4179",
authority = "[2010:836B:4179::836B:4179]",
}
check_parse_url{
url = "//userinfo@[::FFFF:129.144.52.38]:port/path;params?query#fragment",
authority = "userinfo@[::FFFF:129.144.52.38]:port",
host = "::FFFF:129.144.52.38",
port = "port",
userinfo = "userinfo",
user = "userinfo",
path = "/path",
params = "params",
query = "query",
fragment = "fragment"
}
check_parse_url{
url = "scheme://user:password@[::192.9.5.5]:port/path;params?query#fragment",
scheme = "scheme",
authority = "user:password@[::192.9.5.5]:port",
host = "::192.9.5.5",
port = "port",
userinfo = "user:password",
user = "user",
password = "password",
path = "/path",
params = "params",
query = "query",
fragment = "fragment"
}
print("testing URL building")
check_build_url {
url = "scheme://user:password@host:port/path;params?query#fragment",
scheme = "scheme",
host = "host",
port = "port",
user = "user",
password = "password",
path = "/path",
params = "params",
query = "query",
fragment = "fragment"
}
check_build_url{
url = "//userinfo@[::FFFF:129.144.52.38]:port/path;params?query#fragment",
host = "::FFFF:129.144.52.38",
port = "port",
user = "userinfo",
path = "/path",
params = "params",
query = "query",
fragment = "fragment"
}
check_build_url{
url = "scheme://user:password@[::192.9.5.5]:port/path;params?query#fragment",
scheme = "scheme",
host = "::192.9.5.5",
port = "port",
user = "user",
password = "password",
path = "/path",
params = "params",
query = "query",
fragment = "fragment"
}
check_build_url {
url = "scheme://user:password@host/path;params?query#fragment",
scheme = "scheme",
host = "host",
user = "user",
password = "password",
path = "/path",
params = "params",
query = "query",
fragment = "fragment"
}
check_build_url {
url = "scheme://user@host/path;params?query#fragment",
scheme = "scheme",
host = "host",
user = "user",
path = "/path",
params = "params",
query = "query",
fragment = "fragment"
}
check_build_url {
url = "scheme://host/path;params?query#fragment",
scheme = "scheme",
host = "host",
path = "/path",
params = "params",
query = "query",
fragment = "fragment"
}
check_build_url {
url = "scheme://host/path;params#fragment",
scheme = "scheme",
host = "host",
path = "/path",
params = "params",
fragment = "fragment"
}
check_build_url {
url = "scheme://host/path#fragment",
scheme = "scheme",
host = "host",
path = "/path",
fragment = "fragment"
}
check_build_url {
url = "scheme://host/path",
scheme = "scheme",
host = "host",
path = "/path",
}
check_build_url {
url = "//host/path",
host = "host",
path = "/path",
}
check_build_url {
url = "/path",
path = "/path",
}
check_build_url {
url = "scheme://user:password@host:port/path;params?query#fragment",
scheme = "scheme",
host = "host",
port = "port",
user = "user",
userinfo = "not used",
password = "password",
path = "/path",
params = "params",
query = "query",
fragment = "fragment"
}
check_build_url {
url = "scheme://user:password@host:port/path;params?query#fragment",
scheme = "scheme",
host = "host",
port = "port",
user = "user",
userinfo = "not used",
authority = "not used",
password = "password",
path = "/path",
params = "params",
query = "query",
fragment = "fragment"
}
check_build_url {
url = "scheme://user:password@host:port/path;params?query#fragment",
scheme = "scheme",
host = "host",
port = "port",
userinfo = "user:password",
authority = "not used",
path = "/path",
params = "params",
query = "query",
fragment = "fragment"
}
check_build_url {
url = "scheme://user:password@host:port/path;params?query#fragment",
scheme = "scheme",
authority = "user:password@host:port",
path = "/path",
params = "params",
query = "query",
fragment = "fragment"
}
-- standard RFC tests
print("testing absolute resolution")
check_absolute_url("http://a/b/c/d;p?q#f", "g:h", "g:h")
check_absolute_url("http://a/b/c/d;p?q#f", "g", "http://a/b/c/g")
check_absolute_url("http://a/b/c/d;p?q#f", "./g", "http://a/b/c/g")
check_absolute_url("http://a/b/c/d;p?q#f", "g/", "http://a/b/c/g/")
check_absolute_url("http://a/b/c/d;p?q#f", "/g", "http://a/g")
check_absolute_url("http://a/b/c/d;p?q#f", "//g", "http://g")
check_absolute_url("http://a/b/c/d;p?q#f", "?y", "http://a/b/c/d;p?y")
check_absolute_url("http://a/b/c/d;p?q#f", "g?y", "http://a/b/c/g?y")
check_absolute_url("http://a/b/c/d;p?q#f", "g?y/./x", "http://a/b/c/g?y/./x")
check_absolute_url("http://a/b/c/d;p?q#f", "#s", "http://a/b/c/d;p?q#s")
check_absolute_url("http://a/b/c/d;p?q#f", "g#s", "http://a/b/c/g#s")
check_absolute_url("http://a/b/c/d;p?q#f", "g#s/./x", "http://a/b/c/g#s/./x")
check_absolute_url("http://a/b/c/d;p?q#f", "g?y#s", "http://a/b/c/g?y#s")
check_absolute_url("http://a/b/c/d;p?q#f", ";x", "http://a/b/c/d;x")
check_absolute_url("http://a/b/c/d;p?q#f", "g;x", "http://a/b/c/g;x")
check_absolute_url("http://a/b/c/d;p?q#f", "g;x?y#s", "http://a/b/c/g;x?y#s")
check_absolute_url("http://a/b/c/d;p?q#f", ".", "http://a/b/c/")
check_absolute_url("http://a/b/c/d;p?q#f", "./", "http://a/b/c/")
check_absolute_url("http://a/b/c/d;p?q#f", "..", "http://a/b/")
check_absolute_url("http://a/b/c/d;p?q#f", "../", "http://a/b/")
check_absolute_url("http://a/b/c/d;p?q#f", "../g", "http://a/b/g")
check_absolute_url("http://a/b/c/d;p?q#f", "../..", "http://a/")
check_absolute_url("http://a/b/c/d;p?q#f", "../../", "http://a/")
check_absolute_url("http://a/b/c/d;p?q#f", "../../g", "http://a/g")
check_absolute_url("http://a/b/c/d;p?q#f", "", "http://a/b/c/d;p?q#f")
check_absolute_url("http://a/b/c/d;p?q#f", "/./g", "http://a/./g")
check_absolute_url("http://a/b/c/d;p?q#f", "/../g", "http://a/../g")
check_absolute_url("http://a/b/c/d;p?q#f", "g.", "http://a/b/c/g.")
check_absolute_url("http://a/b/c/d;p?q#f", ".g", "http://a/b/c/.g")
check_absolute_url("http://a/b/c/d;p?q#f", "g..", "http://a/b/c/g..")
check_absolute_url("http://a/b/c/d;p?q#f", "..g", "http://a/b/c/..g")
check_absolute_url("http://a/b/c/d;p?q#f", "./../g", "http://a/b/g")
check_absolute_url("http://a/b/c/d;p?q#f", "./g/.", "http://a/b/c/g/")
check_absolute_url("http://a/b/c/d;p?q#f", "g/./h", "http://a/b/c/g/h")
check_absolute_url("http://a/b/c/d;p?q#f", "g/../h", "http://a/b/c/h")
-- extra tests
check_absolute_url("//a/b/c/d;p?q#f", "d/e/f", "//a/b/c/d/e/f")
check_absolute_url("/a/b/c/d;p?q#f", "d/e/f", "/a/b/c/d/e/f")
check_absolute_url("a/b/c/d", "d/e/f", "a/b/c/d/e/f")
check_absolute_url("a/b/c/d/../", "d/e/f", "a/b/c/d/e/f")
check_absolute_url("http://velox.telemar.com.br", "/dashboard/index.html",
"http://velox.telemar.com.br/dashboard/index.html")
print("testing path parsing and composition")
check_parse_path("/eu/tu/ele", { "eu", "tu", "ele"; is_absolute = 1 })
check_parse_path("/eu/", { "eu"; is_absolute = 1, is_directory = 1 })
check_parse_path("eu/tu/ele/nos/vos/eles/",
{ "eu", "tu", "ele", "nos", "vos", "eles"; is_directory = 1})
check_parse_path("/", { is_absolute = 1, is_directory = 1})
check_parse_path("", { })
check_parse_path("eu%01/%02tu/e%03l%04e/nos/vos%05/e%12les/",
{ "eu\1", "\2tu", "e\3l\4e", "nos", "vos\5", "e\18les"; is_directory = 1})
check_parse_path("eu/tu", { "eu", "tu" })
print("testing path protection")
check_protect({ "eu", "-_.!~*'():@&=+$,", "tu" }, "eu/-_.!~*'():@&=+$,/tu")
check_protect({ "eu ", "~diego" }, "eu%20/~diego")
check_protect({ "/eu>", "<diego?" }, "%2Feu%3E/%3Cdiego%3F")
check_protect({ "\\eu]", "[diego`" }, "%5Ceu%5D/%5Bdiego%60")
check_protect({ "{eu}", "|diego\127" }, "%7Beu%7D/%7Cdiego%7F")
check_protect({ "eu ", "~diego" }, "eu /~diego", 1)
check_protect({ "/eu>", "<diego?" }, "/eu>/<diego?", 1)
check_protect({ "\\eu]", "[diego`" }, "\\eu]/[diego`", 1)
check_protect({ "{eu}", "|diego\127" }, "{eu}/|diego\127", 1)
print("testing inversion")
check_invert("http:")
check_invert("a/b/c/d.html")
check_invert("//net_loc")
check_invert("http:a/b/d/c.html")
check_invert("//net_loc/a/b/d/c.html")
check_invert("http://net_loc/a/b/d/c.html")
check_invert("//who:isit@net_loc")
check_invert("http://he:man@boo.bar/a/b/c/i.html;type=moo?this=that#mark")
check_invert("/b/c/d#fragment")
check_invert("/b/c/d;param#fragment")
check_invert("/b/c/d;param?query#fragment")
check_invert("/b/c/d?query")
check_invert("/b/c/d;param?query")
check_invert("http://he:man@[::192.168.1.1]/a/b/c/i.html;type=moo?this=that#mark")
print("the library passed all tests")
| bsd-3-clause |
Servius/tfa-sw-weapons-repository | Backups_Reworks/tfa_f11/lua/weapons/tfa_f11_white/shared.lua | 1 | 7452 | if ( SERVER ) then
AddCSLuaFile( "shared.lua" )
end
if ( CLIENT ) then
SWEP.PrintName = "F-11"
SWEP.Author = "TFA, Servius"
SWEP.ViewModelFOV = 70.35175879397
SWEP.Slot = 2
SWEP.SlotPos = 3
--SWEP.WepSelectIcon = surface.GetTextureID("HUD/killicons/DC15A")
--killicon.Add( "weapon_752_dc15a", "HUD/killicons/DC15A", Color( 255, 80, 0, 255 ) )
end
SWEP.Base = "tfa_3dscoped_base"
SWEP.Category = "TFA Star Wars"
SWEP.Spawnable = true
SWEP.AdminSpawnable = true
SWEP.HoldType = "ar2"
SWEP.ViewModelFOV = 70.35175879397
SWEP.ViewModelFlip = false
SWEP.ViewModel = "models/weapons/synbf3/c_e11.mdl"
SWEP.WorldModel = "models/weapons/synbf3/w_e11.mdl"
SWEP.ShowViewModel = true
SWEP.ShowWorldModel = false
SWEP.UseHands = true
SWEP.Primary.Sound = Sound ("weapons/synbf3/e11_fire.wav");
SWEP.Primary.ReloadSound = Sound ("weapons/synbf3/battlefront_standard_reload.wav");
SWEP.Weight = 5
SWEP.AutoSwitchTo = false
SWEP.AutoSwitchFrom = false
SWEP.Primary.Recoil = 0.5
SWEP.Primary.Damage = 50
SWEP.Primary.NumShots = 1
-- Selective Fire Stuff
SWEP.SelectiveFire = true --Allow selecting your firemode?
SWEP.DisableBurstFire = false --Only auto/single?
SWEP.OnlyBurstFire = false --No auto, only burst/single?
SWEP.DefaultFireMode = "" --Default to auto or whatev
SWEP.FireModeName = nil --Change to a text value to override it
SWEP.Primary.Spread = 0.0125
SWEP.Primary.IronAccuracy = .002 -- Ironsight accuracy, should be the same for shotguns
SWEP.Primary.SpreadMultiplierMax = 2 --How far the spread can expand when you shoot.
--Range Related
SWEP.Primary.Range = -1 -- The distance the bullet can travel in source units. Set to -1 to autodetect based on damage/rpm.
SWEP.Primary.RangeFalloff = -1 -- The percentage of the range the bullet damage starts to fall off at. Set to 0.8, for example, to start falling off after 80% of the range.
--Penetration Related
SWEP.MaxPenetrationCounter = 1 --The maximum number of ricochets. To prevent stack overflows.
SWEP.Primary.ClipSize = 45
SWEP.Primary.RPM = 300
SWEP.Primary.DefaultClip = 150
SWEP.Primary.Automatic = true
SWEP.Primary.Ammo = "ar2"
SWEP.Secondary.Automatic = false
SWEP.Secondary.Ammo = "none"
SWEP.Secondary.IronFOV = 70
SWEP.ViewModelBoneMods = {
["r_thumb_mid"] = { scale = Vector(1, 1, 1), pos = Vector(-0.926, 0.185, -0.186), angle = Angle(0, 0, 0) },
["v_e11_reference001"] = { scale = Vector(0.009, 0.009, 0.009), pos = Vector(0, 0, 0), angle = Angle(0, 0, 0) },
["r_thumb_tip"] = { scale = Vector(1, 1, 1.07), pos = Vector(0, 0, 0.185), angle = Angle(0, 0, 0) },
["ValveBiped.Bip01_L_Hand"] = { scale = Vector(1, 0.647, 1), pos = Vector(-0.556, 0.925, -0.926), angle = Angle(0, 0, 0) },
["l_thumb_low"] = { scale = Vector(1, 1, 1), pos = Vector(1.296, -0.556, 0), angle = Angle(0, 0, 0) }
}
SWEP.IronSightsPos = Vector(-3.241, -3.619, 1.759)
SWEP.IronSightsAng = Vector(0, 0, 0)
SWEP.VElements = {
["element_scope"] = { type = "Model", model = "models/rtcircle.mdl", bone = "v_e11_reference001", rel = "", pos = Vector(-1.31, -6.011, 5.46), angle = Angle(0, 90, 0), size = Vector(0.33, 0.33, 0.33), color = Color(255, 255, 255, 255), surpresslightning = false, material = "", skin = 0, bodygroup = {} },
["element_name"] = { type = "Model", model = "models/weapons/w_f-11d.mdl", bone = "v_e11_reference001", rel = "", pos = Vector(-1.558, 5, 2), angle = Angle(0, -90, 0), size = Vector(1, 1, 1), color = Color(255, 255, 255, 255), surpresslightning = false, material = "", skin = 0, bodygroup = {} }
}
SWEP.WElements = {
["element_name"] = { type = "Model", model = "models/weapons/w_f-11d.mdl", bone = "ValveBiped.Bip01_R_Hand", rel = "", pos = Vector(8, 0.899, -4), angle = Angle(-15.195, 3.506, 180), size = Vector(0.899, 0.899, 0.899), color = Color(255, 255, 255, 255), surpresslightning = false, material = "", skin = 0, bodygroup = {} }
}
SWEP.BlowbackVector = Vector(0,-3,0.025)
SWEP.Blowback_Only_Iron = false
SWEP.DoProceduralReload = true
SWEP.ProceduralReloadTime = 2.5
----Swft Base Code
SWEP.TracerCount = 1
SWEP.MuzzleFlashEffect = ""
SWEP.TracerName = "effect_sw_laser_red"
SWEP.Secondary.IronFOV = 70
SWEP.Primary.KickUp = 0.2
SWEP.Primary.KickDown = 0.1
SWEP.Primary.KickHorizontal = 0.1
SWEP.Primary.KickRight = 0.1
SWEP.DisableChambering = true
SWEP.ImpactDecal = "FadingScorch"
SWEP.ImpactEffect = "effect_sw_impact" --Impact Effect
SWEP.RunSightsPos = Vector(2.127, 0, 1.355)
SWEP.RunSightsAng = Vector(-15.775, 10.023, -5.664)
SWEP.BlowbackEnabled = true
SWEP.BlowbackVector = Vector(0,-3,0.1)
SWEP.Blowback_Shell_Enabled = false
SWEP.Blowback_Shell_Effect = ""
SWEP.ThirdPersonReloadDisable=false
SWEP.Primary.DamageType = DMG_SHOCK
SWEP.DamageType = DMG_SHOCK
--3dScopedBase stuff
SWEP.RTMaterialOverride = -1
SWEP.RTScopeAttachment = -1
SWEP.Scoped_3D = true
SWEP.ScopeReticule = "scope/gdcw_red_nobar"
SWEP.Secondary.ScopeZoom = 8
SWEP.ScopeReticule_Scale = {2.5,2.5}
SWEP.Secondary.UseACOG = false --Overlay option
SWEP.Secondary.UseMilDot = false --Overlay option
SWEP.Secondary.UseSVD = false --Overlay option
SWEP.Secondary.UseParabolic = false --Overlay option
SWEP.Secondary.UseElcan = false --Overlay option
SWEP.Secondary.UseGreenDuplex = false --Overlay option
if surface then
SWEP.Secondary.ScopeTable = nil --[[
{
scopetex = surface.GetTextureID("scope/gdcw_closedsight"),
reticletex = surface.GetTextureID("scope/gdcw_acogchevron"),
dottex = surface.GetTextureID("scope/gdcw_acogcross")
}
]]--
end
DEFINE_BASECLASS( SWEP.Base )
--[[
SWEP.HoldType = "ar2"
SWEP.ViewModelFOV = 70.35175879397
SWEP.ViewModelFlip = false
SWEP.UseHands = true
SWEP.ViewModel = "models/weapons/synbf3/c_e11.mdl"
SWEP.WorldModel = "models/weapons/synbf3/w_e11.mdl"
SWEP.ShowViewModel = true
SWEP.ShowWorldModel = false
SWEP.ViewModelBoneMods = {
["r_thumb_mid"] = { scale = Vector(1, 1, 1), pos = Vector(-0.926, 0.185, -0.186), angle = Angle(0, 0, 0) },
["v_e11_reference001"] = { scale = Vector(0.009, 0.009, 0.009), pos = Vector(0, 0, 0), angle = Angle(0, 0, 0) },
["r_thumb_tip"] = { scale = Vector(1, 1, 1.07), pos = Vector(0, 0, 0.185), angle = Angle(0, 0, 0) },
["ValveBiped.Bip01_L_Hand"] = { scale = Vector(1, 0.647, 1), pos = Vector(-0.556, 0.925, -0.926), angle = Angle(0, 0, 0) },
["l_thumb_low"] = { scale = Vector(1, 1, 1), pos = Vector(1.296, -0.556, 0), angle = Angle(0, 0, 0) }
}
SWEP.IronSightsPos = Vector(-3.241, -3.619, 1.759)
SWEP.IronSightsAng = Vector(0, 0, 0)
SWEP.VElements = {
["element_scope"] = { type = "Model", model = "models/rtcircle.mdl", bone = "v_e11_reference001", rel = "", pos = Vector(-1.31, -6.011, 5.46), angle = Angle(0, 90, 0), size = Vector(0.33, 0.33, 0.33), color = Color(255, 255, 255, 255), surpresslightning = false, material = "", skin = 0, bodygroup = {} },
["element_name"] = { type = "Model", model = "models/weapons/w_f-11d.mdl", bone = "v_e11_reference001", rel = "", pos = Vector(-1.558, 5, 2), angle = Angle(0, -90, 0), size = Vector(1, 1, 1), color = Color(255, 255, 255, 255), surpresslightning = false, material = "", skin = 0, bodygroup = {} }
}
SWEP.WElements = {
["element_name"] = { type = "Model", model = "models/weapons/w_f-11d.mdl", bone = "ValveBiped.Bip01_R_Hand", rel = "", pos = Vector(8, 0.899, -4), angle = Angle(-15.195, 3.506, 180), size = Vector(0.899, 0.899, 0.899), color = Color(255, 255, 255, 255), surpresslightning = false, material = "", skin = 0, bodygroup = {} }
}
]] | apache-2.0 |
kidaa/ffxinfinity | FFXI Server-Development/Build Files/scripts/zones/Upper_Delkfutts_Tower/Zone.lua | 2 | 2166 | -----------------------------------
--
-- Zone: Upper_Delkfutts_Tower (158)
--
-----------------------------------
package.loaded["scripts/zones/Upper_Delkfutts_Tower/TextIDs"] = nil;
require("/scripts/globals/common");
require("/scripts/globals/settings");
require("scripts/globals/teleports");
require("scripts/zones/Upper_Delkfutts_Tower/TextIDs");
-----------------------------------
-- onInitialize
-----------------------------------
function onInitialize(zone)
zone:registerRegion(1, -369, -146, 83, -365, -145, 89); -- Tenth Floor F-6 porter to Middle Delkfutt's Tower
zone:registerRegion(2, -369, -178, -49, -365, -177, -43); -- Twelfth Floor F-10 porter to Stellar Fulcrum
-- print("Upper Delkfutt's Tower Teleporters initialized.");
end;
-----------------------------------
-- onZoneIn
-----------------------------------
function onZoneIn(player,prevZone)
cs = -1;
if ((player:getXPos() == 0) and (player:getYPos() == 0) and (player:getZPos() == 0)) then
player:setPos(12.098,-105.408,27.683,239);
end
return cs;
end;
-----------------------------------
-- onRegionEnter
-----------------------------------
function onRegionEnter(player,region)
switch (region:GetRegionID()): caseof
{
[1] = function (x)
--player:setVar("porter_lock",1);
player:startEvent(1);
end,
[2] = function (x)
--player:setVar("porter_lock",1);
player:startEvent(2);
end,
}
end;
-----------------------------------
-- onRegionLeave
-----------------------------------
function onRegionLeave(player,region)
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
if(csid == 1 and option == 1) then
player:setPos(-490, -130, 81, 231, 157);
elseif(csid == 2 and option == 1) then
player:setPos(-520 , 1 , -23, 192, 0xB3); -- to stellar fulcrum
end
end;
| gpl-3.0 |
renatomaia/loski | test/network/stream.lua | 1 | 1389 | local time = require "time"
local network = require "network"
local tests = require "test.network.utils"
for _, kind in ipairs{"datagram", "connection"} do
local socket = tests.testcreatesocket(kind)
if tests.IsWindows then
tests.testerrmsg("address unavailable", socket:connect("0.0.0.0", 80))
elseif kind == "connection" then
tests.testerrmsg("refused", socket:connect("0.0.0.0", 80))
else
assert(socket:connect("0.0.0.0", 80) == true)
end
tests.testoptions(socket, kind, "refused")
tests.testclose(socket)
end
for _, kind in ipairs{"datagram", "connection"} do
local socket = tests.testcreatesocket(kind)
assert(socket:connect(tests.RemoteTCP.host, tests.RemoteTCP.port) == true)
if kind == "datagram" then
assert(socket:connect(tests.OtherTCP.host, tests.OtherTCP.port) == true)
else
tests.testerrmsg("connected", socket:connect(tests.OtherTCP.host, tests.OtherTCP.port))
end
tests.testoptions(socket, kind)
tests.testclose(socket)
end
for _, kind in ipairs{"datagram", "connection"} do
local socket = tests.testcreatesocket(kind)
assert(socket:setoption("blocking", false) == true)
if kind == "datagram" then
assert(socket:connect(tests.RemoteTCP.host, tests.RemoteTCP.port) == true)
else
tests.testerrmsg("connected",
tests.tcall(true, socket.connect, socket, tests.RemoteTCP.host, tests.RemoteTCP.port))
end
tests.testclose(socket)
end
| mit |
Themroc/luasocket | samples/cddb.lua | 56 | 1415 | local socket = require("socket")
local http = require("socket.http")
if not arg or not arg[1] or not arg[2] then
print("luasocket cddb.lua <category> <disc-id> [<server>]")
os.exit(1)
end
local server = arg[3] or "http://freedb.freedb.org/~cddb/cddb.cgi"
function parse(body)
local lines = string.gfind(body, "(.-)\r\n")
local status = lines()
local code, message = socket.skip(2, string.find(status, "(%d%d%d) (.*)"))
if tonumber(code) ~= 210 then
return nil, code, message
end
local data = {}
for l in lines do
local c = string.sub(l, 1, 1)
if c ~= '#' and c ~= '.' then
local key, value = socket.skip(2, string.find(l, "(.-)=(.*)"))
value = string.gsub(value, "\\n", "\n")
value = string.gsub(value, "\\\\", "\\")
value = string.gsub(value, "\\t", "\t")
data[key] = value
end
end
return data, code, message
end
local host = socket.dns.gethostname()
local query = "%s?cmd=cddb+read+%s+%s&hello=LuaSocket+%s+LuaSocket+2.0&proto=6"
local url = string.format(query, server, arg[1], arg[2], host)
local body, headers, code = http.get(url)
if code == 200 then
local data, code, error = parse(body)
if not data then
print(error or code)
else
for i,v in pairs(data) do
io.write(i, ': ', v, '\n')
end
end
else print(error) end
| mit |
cartographer-project/cartographer_mir | cartographer_mir/configuration_files/assets_writer_mir.lua | 2 | 1568 | -- Copyright 2018 The Cartographer Authors
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-- WARNING: we create a lot of X-Rays of a potentially large space in this
-- pipeline. For example, running over the
-- cartographer_paper_deutsches_museum.bag requires ~25GiB of memory. You can
-- reduce this by writing fewer X-Rays or upping VOXEL_SIZE - which is the size
-- of a pixel in a X-Ray.
VOXEL_SIZE = 5e-2
include "transform.lua"
options = {
tracking_frame = "base_link",
pipeline = {
{
action = "dump_num_points",
},
-- Gray X-Rays. These only use geometry to color pixels.
{
action = "write_xray_image",
voxel_size = VOXEL_SIZE,
filename = "xray_yz_all",
transform = YZ_TRANSFORM,
},
{
action = "write_xray_image",
voxel_size = VOXEL_SIZE,
filename = "xray_xy_all",
transform = XY_TRANSFORM,
},
{
action = "write_xray_image",
voxel_size = VOXEL_SIZE,
filename = "xray_xz_all",
transform = XZ_TRANSFORM,
},
}
}
return options
| apache-2.0 |
Sonicrich05/FFXI-Server | scripts/zones/Lower_Jeuno/npcs/Domenic.lua | 34 | 1998 | -----------------------------------
-- Area: Lower Jeuno
-- NPC: Domenic
-- BCNM/KSNM Teleporter
-----------------------------------
package.loaded["scripts/zones/Lower_Jeuno/TextIDs"] = nil;
-----------------------------------
require("scripts/zones/Lower_Jeuno/TextIDs");
require("scripts/globals/settings");
require("scripts/globals/teleports");
require("scripts/globals/quests");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
if (player:hasCompleteQuest(JEUNO,BEYOND_INFINITY) == true) then
player:startEvent(0x2783,player:getGil());
else
player:startEvent(0x2784);
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 == 0x2783) then
if (option == 1 and player:getGil() >= 750) then
player:delGil(750);
toGhelsba(player);
elseif (option == 2 and player:getGil() >= 750) then
player:delGil(750);
player:setPos(0, 0, 0, 0, 139);
elseif (option == 3 and player:getGil() >= 750) then
player:delGil(750);
player:setPos(0, 0, 0, 0, 144);
elseif (option == 4 and player:getGil() >= 750) then
player:delGil(750);
player:setPos(0, 0, 0, 0, 146);
elseif (option == 5 and player:getGil() >= 1000) then
player:delGil(1000);
player:setPos(0, 0, 0, 0, 206);
end
end
end; | gpl-3.0 |
grimpy/awesome | luadoc/root.lua | 6 | 1788 | --- awesome root window API
-- @author Julien Danjou <julien@danjou.info>
-- @copyright 2008-2009 Julien Danjou
module("root")
--- Get or set global mouse bindings.
-- This binding will be available when you'll click on root window.
-- @param button_table An array of mouse button bindings objects, or nothing.
-- @return The array of mouse button bindings objects.
-- @name buttons
-- @class function
--- Get or set global key bindings.
-- This binding will be available when you'll press keys on root window.
-- @param keys_array An array of key bindings objects, or nothing.
-- @return The array of key bindings objects of this client.
-- @name keys
-- @class function
--- Set the root cursor.
-- @param cursor_name A X cursor name.
-- @name cursor
-- @class function
--- Send fake events. Usually the current focused client will get it.
-- @param event_type The event type: key_press, key_release, button_press, button_release
-- or motion_notify.
-- @param detail The detail: in case of a key event, this is the keycode to send, in
-- case of a button event this is the number of the button. In case of a motion
-- event, this is a boolean value which if true make the coordinates relatives.
-- @param x In case of a motion event, this is the X coordinate.
-- @param y In case of a motion event, this is the Y coordinate.
-- @name fake_input
-- @class function
--- Get the wiboxes attached to a screen.
-- @return A table with all wiboxes.
-- @name wiboxes
-- @class function
--- Get the wallpaper as a cairo surface or set it as a cairo pattern.
-- @param pattern A cairo pattern as light userdata
-- @return A cairo surface or nothing.
-- @name wallpaper
-- @class function
--- Get the attached tags.
-- @return A table with all tags.
-- @name tags
-- @class function
| gpl-2.0 |
coldAmphibian/DotL-Compiled-Old | scripts/vscripts/howling_abyss_brush_locations.lua | 1 | 2411 | brush_locations = {
["brush_a"] = {Vector(-1760,-992,128),Vector(-1504,-672,128),Vector(-1568,-736,128),Vector(-1568,-800,128),Vector(-1632,-864,128),Vector(-1696,-928,128),Vector(-1760,-928,128),Vector(-1376,-736,128),Vector(-1440,-800,128),Vector(-1504,-928,128),Vector(-1568,-992,128),Vector(-1632,-992,128),Vector(-1824,-992,128),Vector(-1696,-992,128),Vector(-1504,-736,128),Vector(-1632,-800,128),Vector(-1696,-864,128),Vector(-1376,-672,128),Vector(-1440,-672,128),Vector(-1376,-800,128),Vector(-1440,-864,128),Vector(-1504,-864,128),Vector(-1568,-928,128),},
["brush_b"] = {Vector(-800,-96,128),Vector(-416,-32,128),Vector(-224,32,128),Vector(-288,224,128),Vector(-416,224,128),Vector(-608,160,128),Vector(-736,32,128),Vector(-608,-96,128),Vector(-864,-96,128),Vector(-416,32,128),Vector(-224,96,128),Vector(-288,288,128),Vector(-544,224,128),Vector(-608,96,128),Vector(-736,-32,128),Vector(-608,-32,128),Vector(-736,-96,128),Vector(-352,32,128),Vector(-224,160,128),Vector(-352,288,128),Vector(-480,224,128),Vector(-672,96,128),Vector(-544,-32,128),Vector(-800,-32,128),Vector(-288,32,128),Vector(-224,224,128),Vector(-352,224,128),Vector(-544,160,128),Vector(-672,32,128),Vector(-480,-32,128),Vector(-672,-96,128),},
["brush_c"] = {Vector(-96,352,128),Vector(-96,416,128),Vector(-160,416,128),Vector(-160,544,128),Vector(-96,608,128),Vector(-160,608,128),Vector(-96,672,128),Vector(-32,736,128),Vector(-32,672,128),Vector(32,800,128),Vector(32,736,128),Vector(96,800,128),Vector(96,864,128),Vector(-160,480,128),Vector(160,480,128),Vector(160,544,128),Vector(160,608,128),Vector(224,608,128),Vector(224,672,128),Vector(224,736,128),Vector(224,800,128),Vector(224,864,128),Vector(224,928,128),Vector(224,992,128),Vector(160,864,128),Vector(160,928,128),Vector(160,416,128),Vector(96,416,128),Vector(96,352,128),Vector(32,352,128),Vector(32,288,128),Vector(-32,288,128),Vector(-32,352,128),},
["brush_d"] = {Vector(1184,1632,128),Vector(1056,1632,128),Vector(992,1568,128),Vector(928,1504,128),Vector(736,1504,128),Vector(800,1568,128),Vector(864,1632,128),Vector(928,1696,128),Vector(992,1760,128),Vector(1056,1760,128),Vector(1120,1824,128),Vector(1184,1760,128),Vector(1120,1632,128),Vector(1056,1568,128),Vector(992,1504,128),Vector(864,1504,128),Vector(800,1504,128),Vector(864,1568,128),Vector(928,1632,128),Vector(992,1696,128),Vector(1056,1824,128),Vector(1120,1760,128),Vector(1184,1696,128),}} | mit |
kidaa/ffxinfinity | FFXI Server-Development/Build Files/scripts/zones/Port_San_dOria/npcs/Diraulate.lua | 6 | 1318 | -----------------------------------
-- Area: Port San d'Oria
-- NPC: Diraulate
-- Standard Info NPC
-----------------------------------
package.loaded["scripts/zones/Port_San_dOria/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/quests");
require("scripts/zones/Port_San_dOria/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
-- "Flyers for Regine" conditional script
FlyerForRegine = player:getQuestStatus(SANDORIA,FLYERS_FOR_REGINE);
if (FlyerForRegine == 1) then
count = trade:getItemCount();
MagicFlyer = trade:hasItemQty(532,1);
if (MagicFlyer == true and count == 1) then
player:messageSpecial(FLYER_REFUSED);
end
end
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
player:startEvent(0x245);
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 |
kolyagora/packages | utils/luci-app-lxc/files/controller/lxc.lua | 77 | 2909 | --[[
LuCI LXC module
Copyright (C) 2014, Cisco Systems, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Author: Petar Koretic <petar.koretic@sartura.hr>
]]--
module("luci.controller.lxc", package.seeall)
require "ubus"
local conn = ubus.connect()
if not conn then
error("Failed to connect to ubus")
end
function fork_exec(command)
local pid = nixio.fork()
if pid > 0 then
return
elseif pid == 0 then
-- change to root dir
nixio.chdir("/")
-- patch stdin, out, err to /dev/null
local null = nixio.open("/dev/null", "w+")
if null then
nixio.dup(null, nixio.stderr)
nixio.dup(null, nixio.stdout)
nixio.dup(null, nixio.stdin)
if null:fileno() > 2 then
null:close()
end
end
-- replace with target command
nixio.exec("/bin/sh", "-c", command)
end
end
function index()
page = node("admin", "services", "lxc")
page.target = cbi("lxc")
page.title = _("LXC Containers")
page.order = 70
page = entry({"admin", "services", "lxc_create"}, call("lxc_create"), nil)
page.leaf = true
page = entry({"admin", "services", "lxc_action"}, call("lxc_action"), nil)
page.leaf = true
page = entry({"admin", "services", "lxc_configuration_get"}, call("lxc_configuration_get"), nil)
page.leaf = true
page = entry({"admin", "services", "lxc_configuration_set"}, call("lxc_configuration_set"), nil)
page.leaf = true
end
function lxc_create(lxc_name, lxc_template)
luci.http.prepare_content("text/plain")
local uci = require("uci").cursor()
local url = uci:get("lxc", "lxc", "url")
if not pcall(dofile, "/etc/openwrt_release") then
return luci.http.write("1")
end
local target = _G.DISTRIB_TARGET:match('([^/]+)')
local data = conn:call("lxc", "create", { name = lxc_name, template = "download", args = { "--server", url, "--no-validate", "--dist", lxc_template, "--release", "bb", "--arch", target } } )
luci.http.write(data)
end
function lxc_action(lxc_action, lxc_name)
luci.http.prepare_content("application/json")
local data, ec = conn:call("lxc", lxc_action, lxc_name and { name = lxc_name} or {} )
luci.http.write_json(ec and {} or data)
end
function lxc_configuration_get(lxc_name)
luci.http.prepare_content("text/plain")
local f = io.open("/lxc/" .. lxc_name .. "/config", "r")
local content = f:read("*all")
f:close()
luci.http.write(content)
end
function lxc_configuration_set(lxc_name)
luci.http.prepare_content("text/plain")
local lxc_configuration = luci.http.formvalue("lxc_configuration")
if lxc_configuration == nil then
return luci.http.write("1")
end
local f, err = io.open("/lxc/" .. lxc_name .. "/config","w+")
if not f then
return luci.http.write("2")
end
f:write(lxc_configuration)
f:close()
luci.http.write("0")
end
| gpl-2.0 |
Sonicrich05/FFXI-Server | scripts/zones/Garlaige_Citadel/npcs/_5kr.lua | 17 | 1534 | -----------------------------------
-- Area: Garlaige Citadel
-- NPC: _5kr (Crematory Hatch)
-- Type: Door
-- @pos 139 -6 127 200
-----------------------------------
package.loaded["scripts/zones/Garlaige_Citadel/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/titles");
require("scripts/globals/settings");
require("scripts/globals/quests");
require("scripts/zones/Garlaige_Citadel/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
if (trade:hasItemQty(502,1) == true and trade:getItemCount() == 1) then -- Garlaige Key (Not Chest/Coffer)
player:startEvent(0x0004); -- Open the door
end
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
local X = player:getXPos();
local Z = player:getZPos();
if ((X >= 135 and X <= 144) and (Z >= 128 and Z <= 135)) then
player:startEvent(0x0005);
else
player:messageSpecial(OPEN_WITH_THE_RIGHT_KEY);
return 0;
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 |
kidaa/ffxinfinity | FFXI Server-Development/Build Files/scripts/globals/items/two-leaf_mandragora_bud.lua | 3 | 1084 | -----------------------------------------
-- ID: 4368
-- Two-Leaf Mandragora Bud
-- 5 Minutes, food effect, All Races
-----------------------------------------
-- Agility +2
-- Vitality -4
-----------------------------------------
require("scripts/globals/status");
-----------------------------------------
-- OnItemCheck
-----------------------------------------
function onItemCheck(target)
local result = 0;
if (target:hasStatusEffect(EFFECT_FOOD) == true) then
result = 246;
end
return result;
end;
-----------------------------------------
-- OnItemUse
-----------------------------------------
function onItemUse(target)
target:addStatusEffect(EFFECT_FOOD,0,0,300,4368);
end;
-----------------------------------
-- onEffectGain Action
-----------------------------------
function onEffectGain(target,effect)
target:addMod(MOD_AGI, 2);
target:addMod(MOD_VIT,-4);
end;
-----------------------------------
-- onEffectLose Action
-----------------------------------
function onEffectLose(target,effect)
target:delMod(MOD_AGI, 2);
target:delMod(MOD_VIT,-4);
end; | gpl-3.0 |
Sonicrich05/FFXI-Server | scripts/zones/Lower_Jeuno/npcs/Ruslan.lua | 37 | 2004 | -----------------------------------
-- Area: Lower Jeuno
-- NPC: Ruslan
-- Involved In Quest: Wondering Minstrel
-- Working 100%
-- @zone = 245
-- @pos = -19 -1 -58
-----------------------------------
package.loaded["scripts/zones/Lower_Jeuno/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/settings");
require("scripts/globals/quests");
require("scripts/globals/titles");
require("scripts/globals/keyitems");
require("scripts/zones/Lower_Jeuno/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
wonderingstatus = player:getQuestStatus(WINDURST,WONDERING_MINSTREL);
if (wonderingstatus == QUEST_ACCEPTED) then
prog = player:getVar("QuestWonderingMin_var")
if (prog == 0) then -- WONDERING_MINSTREL + Rosewood Lumber: During Quest / Progression
player:startEvent(0x2719,0,718);
player:setVar("QuestWonderingMin_var",1);
elseif (prog == 1) then -- WONDERING_MINSTREL + Rosewood Lumber: Quest Objective Reminder
player:startEvent(0x271a,0,718);
end
elseif (wonderingstatus == QUEST_COMPLETED) then
rand = math.random(3);
if (rand == 1) then
player:startEvent(0x271b); -- WONDERING_MINSTREL: After Quest
else
player:startEvent(0x2718); -- Standard Conversation
end
else
player:startEvent(0x2718); -- Standard Conversation
end
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end;
| gpl-3.0 |
kidaa/ffxinfinity | FFXI Server-Development/Build Files/scripts/zones/Windurst_Waters/npcs/Hariga-Origa.lua | 4 | 3284 | -----------------------------------
-- Area: Windurst Waters
-- NPC: Hariga-Origa
-- Starts & Finishes Quest: Glyph Hanger
-- Involved in Mission 2-1
-- @pos -62 -6 105 238
-----------------------------------
package.loaded["scripts/zones/Windurst_Waters/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/settings");
require("scripts/globals/quests");
require("scripts/globals/keyitems");
require("scripts/zones/Windurst_Waters/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
smudgeStatus = player:getQuestStatus(WINDURST,A_SMUDGE_ON_ONE_S_RECORD);
if(smudgeStatus == QUEST_ACCEPTED and trade:hasItemQty(637,1) and trade:hasItemQty(4382,1)) then
player:startEvent(0x01a1,3000);
end
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
GlyphHanger = player:getQuestStatus(WINDURST,GLYPH_HANGER);
chasingStatus = player:getQuestStatus(WINDURST,CHASING_TALES);
smudgeStatus = player:getQuestStatus(WINDURST,A_SMUDGE_ON_ONE_S_RECORD);
Fame = player:getFameLevel(WINDURST);
if(smudgeStatus == QUEST_COMPLETED and player:needToZone() == true) then
player:startEvent(0x01a2);
elseif(smudgeStatus == QUEST_ACCEPTED) then
player:startEvent(0x019e,0,637,4382);
elseif(smudgeStatus == QUEST_AVAILABLE and chasingStatus == QUEST_COMPLETED and Fame >= 4) then
player:startEvent(0x019d,0,637,4382);
elseif(GlyphHanger == QUEST_COMPLETED and chasingStatus ~= QUEST_COMPLETED) then
player:startEvent(0x0182);
elseif(GlyphHanger == QUEST_ACCEPTED) then
if(player:hasKeyItem(NOTES_FROM_IPUPU)) then
player:startEvent(0x0181);
else
player:startEvent(0x017e);
end
elseif(GlyphHanger == QUEST_AVAILABLE) then
player:startEvent(0x017d);
else
player:startEvent(0x0174); -- The line will never be executed
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 == 0x017d and option == 0) then
player:addQuest(WINDURST,GLYPH_HANGER);
player:addKeyItem(NOTES_FROM_HARIGAORIGA);
player:messageSpecial(KEYITEM_OBTAINED,NOTES_FROM_HARIGAORIGA);
elseif(csid == 0x0181) then
player:needToZone(true);
player:delKeyItem(NOTES_FROM_IPUPU);
player:addKeyItem(MAP_OF_THE_HORUTOTO_RUINS);
player:messageSpecial(KEYITEM_OBTAINED,MAP_OF_THE_HORUTOTO_RUINS);
player:addFame(WINDURST,WIN_FAME*120);
player:completeQuest(WINDURST,GLYPH_HANGER);
elseif(csid == 0x019d and option == 0) then
player:addQuest(WINDURST,A_SMUDGE_ON_ONE_S_RECORD);
elseif(csid == 0x01a1) then
player:needToZone(true);
player:addGil(GIL_RATE*3000);
player:messageSpecial(GIL_OBTAINED,GIL_RATE*3000);
player:addKeyItem(MAP_OF_FEIYIN);
player:messageSpecial(KEYITEM_OBTAINED,MAP_OF_FEIYIN);
player:addFame(WINDURST,WIN_FAME*120);
player:completeQuest(WINDURST,A_SMUDGE_ON_ONE_S_RECORD);
end
end; | gpl-3.0 |
bright-things/ionic-luci | modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/wifi_add.lua | 50 | 4887 | -- Copyright 2009 Jo-Philipp Wich <jow@openwrt.org>
-- Licensed to the public under the Apache License 2.0.
local fs = require "nixio.fs"
local nw = require "luci.model.network"
local fw = require "luci.model.firewall"
local uci = require "luci.model.uci".cursor()
local http = require "luci.http"
local iw = luci.sys.wifi.getiwinfo(http.formvalue("device"))
local has_firewall = fs.access("/etc/config/firewall")
if not iw then
luci.http.redirect(luci.dispatcher.build_url("admin/network/wireless"))
return
end
m = SimpleForm("network", translate("Join Network: Settings"))
m.cancel = translate("Back to scan results")
m.reset = false
function m.on_cancel()
local dev = http.formvalue("device")
http.redirect(luci.dispatcher.build_url(
dev and "admin/network/wireless_join?device=" .. dev
or "admin/network/wireless"
))
end
nw.init(uci)
fw.init(uci)
m.hidden = {
device = http.formvalue("device"),
join = http.formvalue("join"),
channel = http.formvalue("channel"),
mode = http.formvalue("mode"),
bssid = http.formvalue("bssid"),
wep = http.formvalue("wep"),
wpa_suites = http.formvalue("wpa_suites"),
wpa_version = http.formvalue("wpa_version")
}
if iw and iw.mbssid_support then
replace = m:field(Flag, "replace", translate("Replace wireless configuration"),
translate("An additional network will be created if you leave this unchecked."))
function replace.cfgvalue() return "1" end
else
replace = m:field(DummyValue, "replace", translate("Replace wireless configuration"))
replace.default = translate("The hardware is not multi-SSID capable and the existing " ..
"configuration will be replaced if you proceed.")
function replace.formvalue() return "1" end
end
if http.formvalue("wep") == "1" then
key = m:field(Value, "key", translate("WEP passphrase"),
translate("Specify the secret encryption key here."))
key.password = true
key.datatype = "wepkey"
elseif (tonumber(m.hidden.wpa_version) or 0) > 0 and
(m.hidden.wpa_suites == "PSK" or m.hidden.wpa_suites == "PSK2")
then
key = m:field(Value, "key", translate("WPA passphrase"),
translate("Specify the secret encryption key here."))
key.password = true
key.datatype = "wpakey"
--m.hidden.wpa_suite = (tonumber(http.formvalue("wpa_version")) or 0) >= 2 and "psk2" or "psk"
end
newnet = m:field(Value, "_netname_new", translate("Name of the new network"),
translate("The allowed characters are: <code>A-Z</code>, <code>a-z</code>, " ..
"<code>0-9</code> and <code>_</code>"
))
newnet.default = m.hidden.mode == "Ad-Hoc" and "mesh" or "wwan"
newnet.datatype = "uciname"
if has_firewall then
fwzone = m:field(Value, "_fwzone",
translate("Create / Assign firewall-zone"),
translate("Choose the firewall zone you want to assign to this interface. Select <em>unspecified</em> to remove the interface from the associated zone or fill out the <em>create</em> field to define a new zone and attach the interface to it."))
fwzone.template = "cbi/firewall_zonelist"
fwzone.default = m.hidden.mode == "Ad-Hoc" and "mesh" or "wan"
end
function newnet.parse(self, section)
local net, zone
if has_firewall then
local zval = fwzone:formvalue(section)
zone = fw:get_zone(zval)
if not zone and zval == '-' then
zval = m:formvalue(fwzone:cbid(section) .. ".newzone")
if zval and #zval > 0 then
zone = fw:add_zone(zval)
end
end
end
local wdev = nw:get_wifidev(m.hidden.device)
wdev:set("disabled", false)
wdev:set("channel", m.hidden.channel)
if replace:formvalue(section) then
local n
for _, n in ipairs(wdev:get_wifinets()) do
wdev:del_wifinet(n)
end
end
local wconf = {
device = m.hidden.device,
ssid = m.hidden.join,
mode = (m.hidden.mode == "Ad-Hoc" and "adhoc" or "sta")
}
if m.hidden.wep == "1" then
wconf.encryption = "wep-open"
wconf.key = "1"
wconf.key1 = key and key:formvalue(section) or ""
elseif (tonumber(m.hidden.wpa_version) or 0) > 0 then
wconf.encryption = (tonumber(m.hidden.wpa_version) or 0) >= 2 and "psk2" or "psk"
wconf.key = key and key:formvalue(section) or ""
else
wconf.encryption = "none"
end
if wconf.mode == "adhoc" or wconf.mode == "sta" then
wconf.bssid = m.hidden.bssid
end
local value = self:formvalue(section)
net = nw:add_network(value, { proto = "dhcp" })
if not net then
self.error = { [section] = "missing" }
else
wconf.network = net:name()
local wnet = wdev:add_wifinet(wconf)
if wnet then
if zone then
fw:del_network(net:name())
zone:add_network(net:name())
end
uci:save("wireless")
uci:save("network")
uci:save("firewall")
luci.http.redirect(wnet:adminlink())
end
end
end
if has_firewall then
function fwzone.cfgvalue(self, section)
self.iface = section
local z = fw:get_zone_by_network(section)
return z and z:name()
end
end
return m
| apache-2.0 |
bright-things/ionic-luci | applications/luci-app-diag-devinfo/luasrc/model/cbi/luci_diag/smap_devinfo_mini.lua | 141 | 1031 | --[[
smap_devinfo - SIP Device Information
(c) 2009 Daniel Dickinson
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
$Id$
]]--
require("luci.i18n")
require("luci.util")
require("luci.sys")
require("luci.model.uci")
require("luci.controller.luci_diag.smap_common")
require("luci.controller.luci_diag.devinfo_common")
local debug = false
m = SimpleForm("luci-smap-to-devinfo", translate("Phone Information"), translate("Scan for supported SIP devices on specified networks."))
m.reset = false
m.submit = false
local outnets = luci.controller.luci_diag.smap_common.get_params()
luci.controller.luci_diag.devinfo_common.run_processes(outnets, luci.controller.luci_diag.smap_common.command_function)
luci.controller.luci_diag.devinfo_common.parse_output(m, outnets, true, "smap", true, debug)
luci.controller.luci_diag.smap_common.action_links(m, true)
return m
| apache-2.0 |
kidaa/ffxinfinity | FFXI Server-Development/Build Files/scripts/globals/items/crescent_fish.lua | 2 | 1150 | -----------------------------------------
-- ID: 4473
-- Item: crescent_fish
-- Food Effect: 5Min, Mithra only
-----------------------------------------
-- Dexterity 3
-- Mind -5
-----------------------------------------
require("scripts/globals/status");
-----------------------------------------
-- OnItemCheck
-----------------------------------------
function onItemCheck(target)
local result = 0;
if (target:getRace() ~= 7) then
result = 247;
elseif (target:hasStatusEffect(EFFECT_FOOD) == true) then
result = 246;
end
return result;
end;
-----------------------------------------
-- OnItemUse
-----------------------------------------
function onItemUse(target)
target:addStatusEffect(EFFECT_FOOD,0,0,300,4473);
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 |
rlowrance/re | parcels-imputed-CODE-mapper.lua | 1 | 4969 | -- main program to filter a slice of unknown codes into a slice
-- of imputed codes
--
-- COMMAND LINE OPTIONS
-- --slice [N|all] read specified slice of stdin or all
-- use all if input is actually a slice
-- --of M number of slices; use if --slice N is specified
--
-- -- code CODE name of code (e.g., HEATING.CODE)
-- -- kmPerYear N kilometers per year
-- -- k N number of neighbors
-- -- lambda F regularizer coefficient
--
-- INPUT FILES
-- stdin : apns and features of unknown heating codes
-- a slice or the entire file parcels-HEATING.CODE-unknown.csv
-- note: does not have a CSV header
-- parcels-CODE-unknown-fields.csv names of fields in stdin
-- parcels-CODE-known.csv apns, features, code where known
--
-- OUTPUT FILES
-- stdout : slice (apn \t kmPerYear, k, lambda, CODENAME, estCodeValue)
-- stderr : error log
require 'attributesLocationsTargetsApns'
require 'Log'
require 'NamedMatrix'
require 'parseCommandLine'
require 'validateAttributes'
-- read fields names for file with unknown names
-- ARGS:
-- logger : Log instance
-- path : string, path to file
-- RETURNS:
-- t : table such that t[i] == name of column i in file unknown
local function readUnknownFields(logger, path)
local vp = makeVp(1, 'readUnkownFields')
validateAttributes(logger, 'Log')
validateAttributes(path, 'string')
local f = io.open(path, 'r')
if f == nil then error('unable to open path ' .. path) end
local t = {}
for line in f:lines('*l') do
table.insert(t, line)
end
vp(1, 't', t)
return t
end
-- read known features, apns, codes
-- ARGS:
-- logger : Log instance
-- path : string, path to file
-- readLimit : number, -1 or number of records to read
-- code : string, name of code field
-- RETURNS:
-- nm : NamedMatrix
local function readKnown(logger, path, readLimit, code)
local vp = makeVp(0, 'readUnkownFields')
validateAttributes(logger, 'Log')
validateAttributes(path, 'string')
validateAttributes(readLimit, 'number', '>=', -1)
validateAttributes(code, 'string')
local numberColumns = {'apn.recoded',
'YEAR.BUILT',
'LAND.SQUARE.FOOTAGE',
'TOTAL.BATHS.CALCULATED',
'BEDROOMS',
'PARKING.SPACES',
'UNIVERSAL.BUILDING.SQUARE.FEET',
'G LATITUDE',
'G LONGITUDE'}
local factorColumns = {code}
local nm = NamedMatrix.readCsv{file=path,
nRows=readLimit,
numberColumns=numberColumns,
factorColumns=factorColumns,
nanString=''}
vp(1, 'nm', nm)
return nm
end
-------------------------------------------------------------------------------
-- MAIN PROGRAM
-- ----------------------------------------------------------------------------
local vp = makeVp(2, 'main program')
vp(1, 'arg', arg)
local clArgs = arg
local option = {}
option.slice = parseCommandLine(clArgs, 'value', '--slice')
assert(option.slice ~= nil, '--slice [N|all] must be present')
if option.slice == 'all' then
if parseCommandLine(clArgs, 'present', '--of') then
error('do not supply --of when specifying --slice all')
end
else
option.slice = tonumber(option.slice)
validateAttributes(option.slice, 'number', '>=', 1)
option.of = tonumber(parseCommandLine(clArgs, 'value', '--of'))
validateAttributes(option.of, 'number', '>=', 1)
assert(option.slice <= option.of)
end
option.code = parseCommandLine(clArgs, 'value', '--code')
validateAttributes(option.code, 'string')
option.kmPerYear = tonumber(parseCommandLine(clArgs, 'value', '--kmPerYear'))
validateAttributes(option.kmPerYear, 'number', '>=', 0)
option.k = tonumber(parseCommandLine(clArgs, 'value', '--k'))
validateAttributes(option.k, 'number', 'integer', '>=', 2)
option.lambda = tonumber(parseCommandLine(clArgs, 'value', '--lambda'))
validateAttributes(option.lambda, 'number', '>=', 0)
-- paths to input and log files
local dirOutput = '../data/v6/output/'
local baseName = 'parcels-' .. option.code
local pathToKnown = dirOutput .. baseName .. '-known.csv'
local pathToUnknownFields = dirOutput .. baseName .. '-unknown-fields.csv'
local optionsString =
'-kmPerYear-' .. tostring(option.kmPerYear) ..
'-k' .. tostring(option.k) ..
'-lambda' .. tostring(option.lambda)
local pathToLog = dirOutput .. baseName .. optionsString .. '.log'
vp(2, 'pathToLog', pathToLog)
-- start logging
local logger = Log(pathToLog)
-- read the input files
local parcelsFieldsUnknown = readUnknownFields(logger, pathToUnknownFields)
local readLimit = 1000
local known = readKnown(logger, pathToKnown, readLimit, option.code)
local known = attributesLocationsTargetsApns(known, option.code)
error('write more')
| gpl-3.0 |
Sonicrich05/FFXI-Server | scripts/zones/Qufim_Island/npcs/Jiwon.lua | 17 | 1862 | -----------------------------------
-- Area: Qufim Island
-- NPC: Jiwon
-- Type: Outpost Vendor
-- @pos -249 -19 300 126
-----------------------------------
package.loaded["scripts/zones/Qufim_Island/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/shop");
require("scripts/globals/conquest");
require("scripts/zones/Qufim_Island/TextIDs");
local region = QUFIMISLAND;
local csid = 0x7ff4;
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
local owner = GetRegionOwner(region);
local arg1 = getArg1(owner,player);
if (owner == player:getNation()) then
nation = 1;
elseif (arg1 < 1792) then
nation = 2;
else
nation = 0;
end
player:startEvent(csid,nation,OP_TeleFee(player,region),0,OP_TeleFee(player,region),player:getCP(),0,0,0);
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
--printf("CSID: %u",csid);
--printf("OPTION: %u",option);
player:updateEvent(player:getGil(),OP_TeleFee(player,region),0,OP_TeleFee(player,region),player:getCP());
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
--printf("CSID: %u",csid);
--printf("OPTION: %u",option);
if (option == 1) then
ShowOPVendorShop(player);
elseif (option == 2) then
if (player:delGil(OP_TeleFee(player,region))) then
toHomeNation(player);
end
elseif (option == 6) then
player:delCP(OP_TeleFee(player,region));
toHomeNation(player);
end
end; | gpl-3.0 |
kidaa/ffxinfinity | FFXI Server-Development/Build Files/scripts/zones/Windurst_Walls/npcs/Seven_of_Diamonds.lua | 4 | 1116 | -----------------------------------
-- Area: Windurst Walls
-- NPC: Seven of Diamonds
-- Type: Standard NPC
-- @zone: 239
-- @pos: 6.612 -3.5 278.553
--
-- Auto-Script: Requires Verification (Verfied by Brawndo)
-----------------------------------
package.loaded["scripts/zones/Windurst_Walls/TextIDs"] = nil;
-----------------------------------
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
if player:hasKeyItem(267) then
player:startEvent(0x0186);
else
player:startEvent(0x0108);
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 |
Sonicrich05/FFXI-Server | scripts/zones/Southern_San_dOria/npcs/Leuveret.lua | 13 | 1539 | -----------------------------------
-- Area: Southern San d'Oria
-- NPC: Leuveret
-- General Info NPC
-------------------------------------
package.loaded["scripts/zones/Southern_San_dOria/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/settings");
require("scripts/zones/Southern_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) and trade:getItemCount() == 1 and player:getVar("tradeLeuveret") == 0) then
player:messageSpecial(8709);
player:setVar("FFR",player:getVar("FFR") - 1);
player:setVar("tradeLeuveret",1);
player:messageSpecial(FLYER_ACCEPTED);
player:tradeComplete();
elseif (player:getVar("tradeLeuveret") ==1) then
player:messageSpecial(8710);
end
end
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
player:startEvent(0x26D);
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 |
Sonicrich05/FFXI-Server | scripts/zones/Phomiuna_Aqueducts/npcs/qm3.lua | 34 | 1033 | -----------------------------------
-- Area: Phomiuna Aqueducts
-- NPC: qm3 (???)
-- Notes: Opens north door @ J-9
-- @pos 116.743 -24.636 27.518 27
-----------------------------------
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
local DoorOffset = npc:getID() - 2;
if (GetNPCByID(DoorOffset):getAnimation() == 9) then
GetNPCByID(DoorOffset):openDoor(7) -- _0ri
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 |
Sonicrich05/FFXI-Server | scripts/zones/Northern_San_dOria/npcs/Palguevion.lua | 36 | 1806 | -----------------------------------
-- Area: Northern San d'Oria
-- NPC: Palguevion
-- Only sells when San d'Oria controlls Valdeaunia Region
-----------------------------------
package.loaded["scripts/zones/Northern_San_dOria/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/settings");
require("scripts/globals/shop");
require("scripts/globals/quests");
require("scripts/globals/conquest");
require("scripts/zones/Northern_San_dOria/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
-- "Flyers for Regine" conditional script
FlyerForRegine = player:getQuestStatus(SANDORIA,FLYERS_FOR_REGINE);
if (FlyerForRegine == 1) then
count = trade:getItemCount();
MagicFlyer = trade:hasItemQty(532,1);
if (MagicFlyer == true and count == 1) then
player:messageSpecial(FLYER_REFUSED);
end
end
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
RegionOwner = GetRegionOwner(VALDEAUNIA);
if (RegionOwner ~= SANDORIA) then
player:showText(npc,PALGUEVION_CLOSED_DIALOG);
else
player:showText(npc,PALGUEVION_OPEN_DIALOG);
stock = {0x111e,29, -- Frost Turnip
0x027e,170} -- Sage
showShop(player,SANDORIA,stock);
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 |
Sonicrich05/FFXI-Server | scripts/zones/Gusgen_Mines/npcs/_5g7.lua | 19 | 2608 | -----------------------------------
-- Area: Gusgen Mines
-- NPC: Strange Apparatus
-- @pos: 219 -39 255 196
-----------------------------------
package.loaded["scripts/zones/Gusgen_Mines/TextIDs"] = nil;
require("scripts/zones/Gusgen_Mines/TextIDs");
require("scripts/globals/strangeapparatus");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
local trade = tradeToStrApp(player, trade);
if (trade ~= nil) then
if ( trade == 1) then -- good trade
local drop = player:getLocalVar("strAppDrop");
local dropQty = player:getLocalVar("strAppDropQty");
local docStatus = 0; -- Assistant
if (hasStrAppDocStatus(player)) then
docStatus = 1; -- Doctor
end
player:startEvent(0x0002, drop, dropQty, INFINITY_CORE, 0, 0, 0, docStatus, 0);
else -- wrong chip, spawn elemental nm
spawnElementalNM(player);
delStrAppDocStatus(player);
player:messageSpecial(SYS_OVERLOAD);
player:messageSpecial(YOU_LOST_THE, trade);
end
else -- Invalid trade, lose doctor status
delStrAppDocStatus(player);
player:messageSpecial(DEVICE_NOT_WORKING);
end
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
local docStatus = 0; -- Assistant
if (hasStrAppDocStatus(player)) then
docStatus = 1; -- Doctor
else
player:setLocalVar( "strAppPass", 1);
end
player:startEvent(0x0000, docStatus, 0, INFINITY_CORE, 0, 0, 0, 0, player:getZoneID());
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u", option);
if (csid == 0x0000) then
if (hasStrAppDocStatus(player) == false) then
local docStatus = 1; -- Assistant
if ( option == strAppPass(player)) then -- Good password
docStatus = 0; -- Doctor
giveStrAppDocStatus(player);
end
player:updateEvent(docStatus, 0, INFINITY_CORE, 0, 0, 0, 0, 0);
end
end
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
if (csid == 0x0002) then
local drop = player:getLocalVar("strAppDrop");
local dropQty = player:getLocalVar("strAppDropQty");
if (drop ~= 0) then
if ( dropQty == 0) then
dropQty = 1;
end
player:addItem(drop, dropQty);
player:setLocalVar("strAppDrop", 0);
player:setLocalVar("strAppDropQty", 0);
end
end
end; | gpl-3.0 |
Sonicrich05/FFXI-Server | scripts/zones/Upper_Jeuno/npcs/Koriso-Manriso.lua | 38 | 1024 | ----------------------------------
-- Area: Upper Jeuno
-- NPC: Koriso-Manriso
-- Type: Item Deliverer
-- @zone: 244
-- @pos -64.39 1 23.704
--
-----------------------------------
package.loaded["scripts/zones/Upper_Jeuno/TextIDs"] = nil;
require("scripts/zones/Upper_Jeuno/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
player:showText(npc, ITEM_DELIVERY_DIALOG);
player:openSendBox();
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
| gpl-3.0 |
mohammadrezatitan/parsol | libs/fakeredis.lua | 5 | 40418 | local unpack = table.unpack or unpack
--- Bit operations
local ok,bit
if _VERSION == "Lua 5.3" then
bit = (load [[ return {
band = function(x, y) return x & y end,
bor = function(x, y) return x | y end,
bxor = function(x, y) return x ~ y end,
bnot = function(x) return ~x end,
rshift = function(x, n) return x >> n end,
lshift = function(x, n) return x << n end,
} ]])()
else
ok,bit = pcall(require,"bit")
if not ok then bit = bit32 end
end
assert(type(bit) == "table", "module for bitops not found")
--- default sleep
local default_sleep
do
local ok, mod = pcall(require, "socket")
if ok and type(mod) == "table" then
default_sleep = mod.sleep
else
default_sleep = function(n)
local t0 = os.clock()
while true do
local delta = os.clock() - t0
if (delta < 0) or (delta > n) then break end
end
end
end
end
--- Helpers
local xdefv = function(ktype)
if ktype == "list" then
return {head = 0, tail = 0}
elseif ktype == "zset" then
return {
list = {},
set = {},
}
else return {} end
end
local xgetr = function(self, k, ktype)
if self.data[k] then
assert(
(self.data[k].ktype == ktype),
"ERR Operation against a key holding the wrong kind of value"
)
assert(self.data[k].value)
return self.data[k].value
else return xdefv(ktype) end
end
local xgetw = function(self, k, ktype)
if self.data[k] and self.data[k].value then
assert(
(self.data[k].ktype == ktype),
"ERR Operation against a key holding the wrong kind of value"
)
else
self.data[k] = {ktype = ktype, value = xdefv(ktype)}
end
return self.data[k].value
end
local empty = function(self, k)
local v, t = self.data[k].value, self.data[k].ktype
if t == nil then
return true
elseif t == "string" then
return not v[1]
elseif (t == "hash") or (t == "set") then
for _,_ in pairs(v) do return false end
return true
elseif t == "list" then
return v.head == v.tail
elseif t == "zset" then
if #v.list == 0 then
for _,_ in pairs(v.set) do error("incoherent") end
return true
else
for _,_ in pairs(v.set) do return(false) end
error("incoherent")
end
else error("unsupported") end
end
local cleanup = function(self, k)
if empty(self, k) then self.data[k] = nil end
end
local is_integer = function(x)
return (type(x) == "number") and (math.floor(x) == x)
end
local overflows = function(n)
return (n > 2^53-1) or (n < -2^53+1)
end
local is_bounded_integer = function(x)
return (is_integer(x) and (not overflows(x)))
end
local is_finite_number = function(x)
return (type(x) == "number") and (x > -math.huge) and (x < math.huge)
end
local toint = function(x)
if type(x) == "string" then x = tonumber(x) end
return is_bounded_integer(x) and x or nil
end
local tofloat = function(x)
if type(x) == "number" then return x end
if type(x) ~= "string" then return nil end
local r = tonumber(x)
if r then return r end
if x == "inf" or x == "+inf" then
return math.huge
elseif x == "-inf" then
return -math.huge
else return nil end
end
local tostr = function(x)
if is_bounded_integer(x) then
return string.format("%d", x)
else return tostring(x) end
end
local char_bitcount = function(x)
assert(
(type(x) == "number") and
(math.floor(x) == x) and
(x >= 0) and (x < 256)
)
local n = 0
while x ~= 0 do
x = bit.band(x, x-1)
n = n+1
end
return n
end
local chkarg = function(x)
if type(x) == "number" then x = tostr(x) end
assert(type(x) == "string")
return x
end
local chkargs = function(n, ...)
local arg = {...}
assert(#arg == n)
for i=1,n do arg[i] = chkarg(arg[i]) end
return unpack(arg)
end
local getargs = function(...)
local arg = {...}
local n = #arg; assert(n > 0)
for i=1,n do arg[i] = chkarg(arg[i]) end
return arg
end
local getargs_as_map = function(...)
local arg, r = getargs(...), {}
assert(#arg%2 == 0)
for i=1,#arg,2 do r[arg[i]] = arg[i+1] end
return r
end
local chkargs_wrap = function(f, n)
assert( (type(f) == "function") and (type(n) == "number") )
return function(self, ...) return f(self, chkargs(n, ...)) end
end
local lset_to_list = function(s)
local r = {}
for v,_ in pairs(s) do r[#r+1] = v end
return r
end
local nkeys = function(x)
local r = 0
for _,_ in pairs(x) do r = r + 1 end
return r
end
--- Commands
-- keys
local del = function(self, ...)
local arg = getargs(...)
local r = 0
for i=1,#arg do
if self.data[arg[i]] then r = r + 1 end
self.data[arg[i]] = nil
end
return r
end
local exists = function(self, k)
return not not self.data[k]
end
local keys = function(self, pattern)
assert(type(pattern) == "string")
-- We want to convert the Redis pattern to a Lua pattern.
-- Start by escaping dashes *outside* character classes.
-- We also need to escape percents here.
local t, p, n = {}, 1, #pattern
local p1, p2
while true do
p1, p2 = pattern:find("%[.+%]", p)
if p1 then
if p1 > p then
t[#t+1] = {true, pattern:sub(p, p1-1)}
end
t[#t+1] = {false, pattern:sub(p1, p2)}
p = p2+1
if p > n then break end
else
t[#t+1] = {true, pattern:sub(p, n)}
break
end
end
for i=1,#t do
if t[i][1] then
t[i] = t[i][2]:gsub("[%%%-]", "%%%0")
else t[i] = t[i][2]:gsub("%%", "%%%%") end
end
-- Remaining Lua magic chars are: '^$().[]*+?' ; escape them except '*?[]'
-- Then convert '\' to '%', '*' to '.*' and '?' to '.'. Leave '[]' as is.
-- Wrap in '^$' to enforce bounds.
local lp = "^" .. table.concat(t):gsub("[%^%$%(%)%.%+]", "%%%0")
:gsub("\\", "%%"):gsub("%*", ".*"):gsub("%?", ".") .. "$"
local r = {}
for k,_ in pairs(self.data) do
if k:match(lp) then r[#r+1] = k end
end
return r
end
local _type = function(self, k)
return self.data[k] and self.data[k].ktype or "none"
end
local randomkey = function(self)
local ks = lset_to_list(self.data)
local n = #ks
if n > 0 then
return ks[math.random(1, n)]
else return nil end
end
local rename = function(self, k, k2)
assert((k ~= k2) and self.data[k])
self.data[k2] = self.data[k]
self.data[k] = nil
return true
end
local renamenx = function(self, k, k2)
if self.data[k2] then
return false
else
return rename(self, k, k2)
end
end
-- strings
local getrange, incrby, set
local append = function(self, k, v)
local x = xgetw(self, k, "string")
x[1] = (x[1] or "") .. v
return #x[1]
end
local bitcount = function(self, k, i1, i2)
k = chkarg(k)
local s
if i1 or i2 then
assert(i1 and i2, "ERR syntax error")
s = getrange(self, k, i1, i2)
else
s = xgetr(self, k, "string")[1] or ""
end
local r, bytes = 0,{s:byte(1, -1)}
for i=1,#bytes do
r = r + char_bitcount(bytes[i])
end
return r
end
local bitop = function(self, op, k, ...)
assert(type(op) == "string")
op = op:lower()
assert(
(op == "and") or
(op == "or") or
(op == "xor") or
(op == "not"),
"ERR syntax error"
)
k = chkarg(k)
local arg = {...}
local good_arity = (op == "not") and (#arg == 1) or (#arg > 0)
assert(good_arity, "ERR wrong number of arguments for 'bitop' command")
local l, vals = 0, {}
local s
for i=1,#arg do
s = xgetr(self, arg[i], "string")[1] or ""
if #s > l then l = #s end
vals[i] = s
end
if l == 0 then
del(self, k)
return 0
end
local vector_mt = {__index=function() return 0 end}
for i=1,#vals do
vals[i] = setmetatable({vals[i]:byte(1, -1)}, vector_mt)
end
local r = {}
if op == "not" then
assert(#vals[1] == l)
for i=1,l do
r[i] = bit.band(bit.bnot(vals[1][i]), 0xff)
end
else
local _op = bit["b" .. op]
for i=1,l do
local t = {}
for j=1,#vals do t[j] = vals[j][i] end
r[i] = _op(unpack(t))
end
end
set(self, k, string.char(unpack(r)))
return l
end
local decr = function(self, k)
return incrby(self, k, -1)
end
local decrby = function(self, k, n)
n = toint(n)
assert(n, "ERR value is not an integer or out of range")
return incrby(self, k, -n)
end
local get = function(self, k)
local x = xgetr(self, k, "string")
return x[1]
end
local getbit = function(self, k, offset)
k = chkarg(k)
offset = toint(offset)
assert(
(offset >= 0),
"ERR bit offset is not an integer or out of range"
)
local bitpos = offset % 8 -- starts at 0
local bytepos = (offset - bitpos) / 8 -- starts at 0
local s = xgetr(self, k, "string")[1] or ""
if bytepos >= #s then return 0 end
local char = s:sub(bytepos+1, bytepos+1):byte()
return bit.band(bit.rshift(char, 7-bitpos), 1)
end
getrange = function(self, k, i1, i2)
k = chkarg(k)
i1, i2 = toint(i1), toint(i2)
assert(i1 and i2)
local x = xgetr(self, k, "string")
x = x[1] or ""
if i1 >= 0 then i1 = i1 + 1 end
if i2 >= 0 then i2 = i2 + 1 end
return x:sub(i1, i2)
end
local getset = function(self, k, v)
local r = get(self, k)
set(self, k, v)
return r
end
local incr = function(self, k)
return incrby(self, k, 1)
end
incrby = function(self, k, n)
k, n = chkarg(k), toint(n)
assert(n, "ERR value is not an integer or out of range")
local x = xgetw(self, k, "string")
local i = toint(x[1] or 0)
assert(i, "ERR value is not an integer or out of range")
i = i+n
assert(
(not overflows(i)),
"ERR increment or decrement would overflow"
)
x[1] = tostr(i)
return i
end
local incrbyfloat = function(self, k, n)
k, n = chkarg(k), tofloat(n)
assert(n, "ERR value is not a valid float")
local x = xgetw(self, k, "string")
local i = tofloat(x[1] or 0)
assert(i, "ERR value is not a valid float")
i = i+n
assert(
is_finite_number(i),
"ERR increment would produce NaN or Infinity"
)
x[1] = tostr(i)
return i
end
local mget = function(self, ...)
local arg, r = getargs(...), {}
for i=1,#arg do r[i] = get(self, arg[i]) end
return r
end
local mset = function(self, ...)
local argmap = getargs_as_map(...)
for k,v in pairs(argmap) do set(self, k, v) end
return true
end
local msetnx = function(self, ...)
local argmap = getargs_as_map(...)
for k,_ in pairs(argmap) do
if self.data[k] then return false end
end
for k,v in pairs(argmap) do set(self, k, v) end
return true
end
set = function(self, k, v)
self.data[k] = {ktype = "string", value = {v}}
return true
end
local setbit = function(self, k, offset, b)
k = chkarg(k)
offset, b = toint(offset), toint(b)
assert(
(offset >= 0),
"ERR bit offset is not an integer or out of range"
)
assert(
(b == 0) or (b == 1),
"ERR bit is not an integer or out of range"
)
local bitpos = offset % 8 -- starts at 0
local bytepos = (offset - bitpos) / 8 -- starts at 0
local s = xgetr(self, k, "string")[1] or ""
local pad = {s}
for i=2,bytepos+2-#s do pad[i] = "\0" end
s = table.concat(pad)
assert(#s >= bytepos+1)
local before = s:sub(1, bytepos)
local char = s:sub(bytepos+1, bytepos+1):byte()
local after = s:sub(bytepos+2, -1)
local old = bit.band(bit.rshift(char, 7-bitpos), 1)
if b == 1 then
char = bit.bor(bit.lshift(1, 7-bitpos), char)
else
char = bit.band(bit.bnot(bit.lshift(1, 7-bitpos)), char)
end
local r = before .. string.char(char) .. after
set(self, k, r)
return old
end
local setnx = function(self, k, v)
if self.data[k] then
return false
else
return set(self, k, v)
end
end
local setrange = function(self, k, i, s)
local k, s = chkargs(2, k, s)
i = toint(i)
assert(i and (i >= 0))
local x = xgetw(self, k, "string")
local y = x[1] or ""
local ly, ls = #y, #s
if i > ly then -- zero padding
local t = {}
for i=1, i-ly do t[i] = "\0" end
y = y .. table.concat(t) .. s
else
y = y:sub(1, i) .. s .. y:sub(i+ls+1, ly)
end
x[1] = y
return #y
end
local strlen = function(self, k)
local x = xgetr(self, k, "string")
return x[1] and #x[1] or 0
end
-- hashes
local hdel = function(self, k, ...)
k = chkarg(k)
local arg = getargs(...)
local r = 0
local x = xgetw(self, k, "hash")
for i=1,#arg do
if x[arg[i]] then r = r + 1 end
x[arg[i]] = nil
end
cleanup(self, k)
return r
end
local hget
local hexists = function(self, k, k2)
return not not hget(self, k, k2)
end
hget = function(self, k, k2)
local x = xgetr(self, k, "hash")
return x[k2]
end
local hgetall = function(self, k)
local x = xgetr(self, k, "hash")
local r = {}
for _k,v in pairs(x) do r[_k] = v end
return r
end
local hincrby = function(self, k, k2, n)
k, k2, n = chkarg(k), chkarg(k2), toint(n)
assert(n, "ERR value is not an integer or out of range")
assert(type(n) == "number")
local x = xgetw(self, k, "hash")
local i = toint(x[k2] or 0)
assert(i, "ERR value is not an integer or out of range")
i = i+n
assert(
(not overflows(i)),
"ERR increment or decrement would overflow"
)
x[k2] = tostr(i)
return i
end
local hincrbyfloat = function(self, k, k2, n)
k, k2, n = chkarg(k), chkarg(k2), tofloat(n)
assert(n, "ERR value is not a valid float")
local x = xgetw(self, k, "hash")
local i = tofloat(x[k2] or 0)
assert(i, "ERR value is not a valid float")
i = i+n
assert(
is_finite_number(i),
"ERR increment would produce NaN or Infinity"
)
x[k2] = tostr(i)
return i
end
local hkeys = function(self, k)
local x = xgetr(self, k, "hash")
local r = {}
for _k,_ in pairs(x) do r[#r+1] = _k end
return r
end
local hlen = function(self, k)
local x = xgetr(self, k, "hash")
return nkeys(x)
end
local hmget = function(self, k, k2s)
k = chkarg(k)
assert((type(k2s) == "table"))
local r = {}
local x = xgetr(self, k, "hash")
for i=1,#k2s do r[i] = x[chkarg(k2s[i])] end
return r
end
local hmset = function(self, k, ...)
k = chkarg(k)
local arg = {...}
if type(arg[1]) == "table" then
assert(#arg == 1)
local x = xgetw(self, k, "hash")
for _k,v in pairs(arg[1]) do x[chkarg(_k)] = chkarg(v) end
else
assert(#arg % 2 == 0)
local x = xgetw(self, k, "hash")
local t = getargs(...)
for i=1,#t,2 do x[t[i]] = t[i+1] end
end
return true
end
local hset = function(self, k, k2, v)
local x = xgetw(self, k, "hash")
local r = not x[k2]
x[k2] = v
return r
end
local hsetnx = function(self, k, k2, v)
local x = xgetw(self, k, "hash")
if x[k2] == nil then
x[k2] = v
return true
else
return false
end
end
local hvals = function(self, k)
local x = xgetr(self, k, "hash")
local r = {}
for _,v in pairs(x) do r[#r+1] = v end
return r
end
-- lists (head = left, tail = right)
local _l_real_i = function(x, i)
if i < 0 then
return x.tail+i+1
else
return x.head+i+1
end
end
local _l_len = function(x)
return x.tail - x.head
end
local _block_for = function(self, timeout)
if timeout > 0 then
local sleep = self.sleep or default_sleep
if type(sleep) == "function" then
sleep(timeout)
else
error("sleep function unavailable", 0)
end
else
error("operation would block", 0)
end
end
local rpoplpush
local blpop = function(self, ...)
local arg = {...}
local timeout = toint(arg[#arg])
arg[#arg] = nil
local vs = getargs(...)
local x, l, k, v
for i=1,#vs do
k = vs[i]
x = xgetw(self, k, "list")
l = _l_len(x)
if l > 0 then
v = x[x.head+1]
if l > 1 then
x.head = x.head + 1
x[x.head] = nil
else self.data[k] = nil end
return {k, v}
else self.data[k] = nil end
end
_block_for(self, timeout)
end
local brpop = function(self, ...)
local arg = {...}
local timeout = toint(arg[#arg])
arg[#arg] = nil
local vs = getargs(...)
local x, l, k, v
for i=1,#vs do
k = vs[i]
x = xgetw(self, k, "list")
l = _l_len(x)
if l > 0 then
v = x[x.tail]
if l > 1 then
x[x.tail] = nil
x.tail = x.tail - 1
else self.data[k] = nil end
return {k, v}
else self.data[k] = nil end
end
_block_for(self, timeout)
end
local brpoplpush = function(self, k1, k2, timeout)
k1, k2 = chkargs(2, k1, k2)
timeout = toint(timeout)
if not self.data[k1] then _block_for(self, timeout) end
return rpoplpush(self, k1, k2)
end
local lindex = function(self, k, i)
k = chkarg(k)
i = assert(toint(i))
local x = xgetr(self, k, "list")
return x[_l_real_i(x, i)]
end
local linsert = function(self, k, mode, pivot, v)
mode = mode:lower()
assert((mode == "before") or (mode == "after"))
if not self.data[k] then return 0 end
local x = xgetw(self, k, "list")
local p = nil
for i=x.head+1, x.tail do
if x[i] == pivot then
p = i
break
end
end
if not p then return -1 end
if mode == "after" then
for i=x.head+1, p do x[i-1] = x[i] end
x.head = x.head - 1
else
for i=x.tail, p, -1 do x[i+1] = x[i] end
x.tail = x.tail + 1
end
x[p] = v
return _l_len(x)
end
local llen = function(self, k)
local x = xgetr(self, k, "list")
return _l_len(x)
end
local lpop = function(self, k)
local x = xgetw(self, k, "list")
local l, r = _l_len(x), x[x.head+1]
if l > 1 then
x.head = x.head + 1
x[x.head] = nil
else self.data[k] = nil end
return r
end
local lpush = function(self, k, ...)
local vs = getargs(...)
local x = xgetw(self, k, "list")
for i=1,#vs do
x[x.head] = vs[i]
x.head = x.head - 1
end
return _l_len(x)
end
local lpushx = function(self, k, v)
if not self.data[k] then return 0 end
local x = xgetw(self, k, "list")
x[x.head] = v
x.head = x.head - 1
return _l_len(x)
end
local lrange = function(self, k, i1, i2)
k = chkarg(k)
i1, i2 = toint(i1), toint(i2)
assert(i1 and i2)
local x, r = xgetr(self, k, "list"), {}
i1 = math.max(_l_real_i(x, i1), x.head+1)
i2 = math.min(_l_real_i(x, i2), x.tail)
for i=i1,i2 do r[#r+1] = x[i] end
return r
end
local _lrem_i = function(x, p)
for i=p,x.tail do
x[i] = x[i+1]
end
x.tail = x.tail - 1
end
local _lrem_l = function(x, v, s)
assert(v)
if not s then s = x.head+1 end
for i=s,x.tail do
if x[i] == v then
_lrem_i(x, i)
return i
end
end
return false
end
local _lrem_r = function(x, v, s)
assert(v)
if not s then s = x.tail end
for i=s,x.head+1,-1 do
if x[i] == v then
_lrem_i(x, i)
return i
end
end
return false
end
local lrem = function(self, k, count, v)
k, v = chkarg(k), chkarg(v)
count = assert(toint(count))
if not self.data[k] then return 0 end
local x = xgetw(self, k, "list")
local n, last = 0, nil
local op = (count < 0) and _lrem_r or _lrem_l
local limited = (count ~= 0)
count = math.abs(count)
while true do
last = op(x, v, last)
if last then
n = n+1
if limited then
count = count - 1
if count == 0 then break end
end
else break end
end
return n
end
local lset = function(self, k, i, v)
k, v = chkarg(k), chkarg(v)
i = assert(toint(i))
if not self.data[k] then
error("ERR no such key")
end
local x = xgetw(self, k, "list")
local l = _l_len(x)
if i >= l or i < -l then
error("ERR index out of range")
end
x[_l_real_i(x, i)] = v
return true
end
local ltrim = function(self, k, i1, i2)
k = chkarg(k)
i1, i2 = toint(i1), toint(i2)
assert(i1 and i2)
local x = xgetw(self, k, "list")
i1, i2 = _l_real_i(x, i1), _l_real_i(x, i2)
for i=x.head+1,i1-1 do x[i] = nil end
for i=i2+1,x.tail do x[i] = nil end
x.head = math.max(i1-1, x.head)
x.tail = math.min(i2, x.tail)
assert(
(x[x.head] == nil) and
(x[x.tail+1] == nil)
)
cleanup(self, k)
return true
end
local rpop = function(self, k)
local x = xgetw(self, k, "list")
local l, r = _l_len(x), x[x.tail]
if l > 1 then
x[x.tail] = nil
x.tail = x.tail - 1
else self.data[k] = nil end
return r
end
rpoplpush = function(self, k1, k2)
local v = rpop(self, k1)
if not v then return nil end
lpush(self, k2, v)
return v
end
local rpush = function(self, k, ...)
local vs = getargs(...)
local x = xgetw(self, k, "list")
for i=1,#vs do
x.tail = x.tail + 1
x[x.tail] = vs[i]
end
return _l_len(x)
end
local rpushx = function(self, k, v)
if not self.data[k] then return 0 end
local x = xgetw(self, k, "list")
x.tail = x.tail + 1
x[x.tail] = v
return _l_len(x)
end
-- sets
local sadd = function(self, k, ...)
k = chkarg(k)
local arg = getargs(...)
local x, r = xgetw(self, k, "set"), 0
for i=1,#arg do
if not x[arg[i]] then
x[arg[i]] = true
r = r + 1
end
end
return r
end
local scard = function(self, k)
local x = xgetr(self, k, "set")
return nkeys(x)
end
local _sdiff = function(self, k, ...)
k = chkarg(k)
local arg = getargs(...)
local x = xgetr(self, k, "set")
local r = {}
for v,_ in pairs(x) do r[v] = true end
for i=1,#arg do
x = xgetr(self, arg[i], "set")
for v,_ in pairs(x) do r[v] = nil end
end
return r
end
local sdiff = function(self, k, ...)
return lset_to_list(_sdiff(self, k, ...))
end
local sdiffstore = function(self, k2, k, ...)
k2 = chkarg(k2)
local x = _sdiff(self, k, ...)
self.data[k2] = {ktype = "set", value = x}
return nkeys(x)
end
local _sinter = function(self, k, ...)
k = chkarg(k)
local arg = getargs(...)
local x = xgetr(self, k, "set")
local r = {}
local y
for v,_ in pairs(x) do
r[v] = true
for i=1,#arg do
y = xgetr(self, arg[i], "set")
if not y[v] then r[v] = nil; break end
end
end
return r
end
local sinter = function(self, k, ...)
return lset_to_list(_sinter(self, k, ...))
end
local sinterstore = function(self, k2, k, ...)
k2 = chkarg(k2)
local x = _sinter(self, k, ...)
self.data[k2] = {ktype = "set", value = x}
return nkeys(x)
end
local sismember = function(self, k, v)
local x = xgetr(self, k, "set")
return not not x[v]
end
local smembers = function(self, k)
local x = xgetr(self, k, "set")
return lset_to_list(x)
end
local smove = function(self, k, k2, v)
local x = xgetr(self, k, "set")
if x[v] then
local y = xgetw(self, k2, "set")
x[v] = nil
y[v] = true
return true
else return false end
end
local spop = function(self, k)
local x, r = xgetw(self, k, "set"), nil
local l = lset_to_list(x)
local n = #l
if n > 0 then
r = l[math.random(1, n)]
x[r] = nil
end
cleanup(self, k)
return r
end
local srandmember = function(self, k, count)
k = chkarg(k)
local x = xgetr(self, k, "set")
local l = lset_to_list(x)
local n = #l
if not count then
if n > 0 then
return l[math.random(1, n)]
else return nil end
end
count = toint(count)
if (count == 0) or (n == 0) then return {} end
if count >= n then return l end
local r = {}
if count > 0 then -- distinct elements
for i=0,count-1 do
r[#r+1] = table.remove(l, math.random(1, n-i))
end
else -- allow repetition
for i=1,-count do
r[#r+1] = l[math.random(1, n)]
end
end
return r
end
local srem = function(self, k, ...)
k = chkarg(k)
local arg = getargs(...)
local x, r = xgetw(self, k, "set"), 0
for i=1,#arg do
if x[arg[i]] then
x[arg[i]] = nil
r = r + 1
end
end
cleanup(self, k)
return r
end
local _sunion = function(self, ...)
local arg = getargs(...)
local r = {}
local x
for i=1,#arg do
x = xgetr(self, arg[i], "set")
for v,_ in pairs(x) do r[v] = true end
end
return r
end
local sunion = function(self, k, ...)
return lset_to_list(_sunion(self, k, ...))
end
local sunionstore = function(self, k2, k, ...)
k2 = chkarg(k2)
local x = _sunion(self, k, ...)
self.data[k2] = {ktype = "set", value = x}
return nkeys(x)
end
-- zsets
local _z_p_mt = {
__eq = function(a, b)
if a.v == b.v then
assert(a.s == b.s)
return true
else return false end
end,
__lt = function(a, b)
if a.s == b.s then
return (a.v < b.v)
else
return (a.s < b.s)
end
end,
}
local _z_pair = function(s, v)
assert(
(type(s) == "number") and
(type(v) == "string")
)
local r = {s = s, v = v}
return setmetatable(r, _z_p_mt)
end
local _z_pairs = function(...)
local arg = {...}
assert((#arg > 0) and (#arg % 2 == 0))
local ps = {}
for i=1,#arg,2 do
ps[#ps+1] = _z_pair(
assert(tofloat(arg[i])),
chkarg(arg[i+1])
)
end
return ps
end
local _z_insert = function(x, ix, p)
assert(
(type(x) == "table") and
(type(ix) == "number") and
(type(p) == "table")
)
local l = x.list
table.insert(l, ix, p)
for i=ix+1,#l do
x.set[l[i].v] = x.set[l[i].v] + 1
end
x.set[p.v] = ix
end
local _z_remove = function(x, v)
if not x.set[v] then return false end
local l, ix = x.list, x.set[v]
assert(l[ix].v == v)
table.remove(l, ix)
for i=ix,#l do
x.set[l[i].v] = x.set[l[i].v] - 1
end
x.set[v] = nil
return true
end
local _z_remove_range = function(x, i1, i2)
local l = x.list
i2 = i2 or i1
assert(
(i1 > 0) and
(i2 >= i1) and
(i2 <= #l)
)
local ix, n = i1, i2-i1+1
for i=1,n do
x.set[l[ix].v] = nil
table.remove(l, ix)
end
for i=ix,#l do
x.set[l[i].v] = x.set[l[i].v] - n
end
return n
end
local _z_update = function(x, p)
local l = x.list
local found = _z_remove(x, p.v)
local ix = nil
for i=1,#l do
if l[i] > p then
ix = i; break
end
end
if not ix then ix = #l+1 end
_z_insert(x, ix, p)
return found
end
local _z_coherence = function(x)
local l, s = x.list, x.set
local found, n = {}, 0
for val,pos in pairs(s) do
if found[pos] then return false end
found[pos] = true
n = n + 1
if not (l[pos] and (l[pos].v == val)) then
return false
end
end
if #l ~= n then return false end
for i=1, n-1 do
if l[i].s > l[i+1].s then return false end
end
return true
end
local _z_normrange = function(l, i1, i2)
i1, i2 = assert(toint(i1)), assert(toint(i2))
if i1 < 0 then i1 = #l+i1 end
if i2 < 0 then i2 = #l+i2 end
i1, i2 = math.max(i1+1, 1), i2+1
if (i2 < i1) or (i1 > #l) then return nil end
i2 = math.min(i2, #l)
return i1, i2
end
local _zrbs_opts = function(...)
local arg = {...}
if #arg == 0 then return {} end
local ix, opts = 1, {}
while type(arg[ix]) == "string" do
if arg[ix] == "withscores" then
opts.withscores = true
ix = ix + 1
elseif arg[ix] == "limit" then
opts.limit = {
offset = assert(toint(arg[ix+1])),
count = assert(toint(arg[ix+2])),
}
ix = ix + 3
else error("input") end
end
if type(arg[ix]) == "table" then
local _o = arg[ix]
opts.withscores = opts.withscores or _o.withscores
if _o.limit then
opts.limit = {
offset = assert(toint(_o.limit.offset or _o.limit[1])),
count = assert(toint(_o.limit.count or _o.limit[2])),
}
end
ix = ix + 1
end
assert(arg[ix] == nil)
if opts.limit then
assert(
(opts.limit.count >= 0) and
(opts.limit.offset >= 0)
)
end
return opts
end
local _z_store_params = function(dest, numkeys, ...)
dest = chkarg(dest)
numkeys = assert(toint(numkeys))
assert(numkeys > 0)
local arg = {...}
assert(#arg >= numkeys)
local ks = {}
for i=1, numkeys do ks[i] = chkarg(arg[i]) end
local ix, opts = numkeys+1,{}
while type(arg[ix]) == "string" do
if arg[ix] == "weights" then
opts.weights = {}
ix = ix + 1
for i=1, numkeys do
opts.weights[i] = assert(toint(arg[ix]))
ix = ix + 1
end
elseif arg[ix] == "aggregate" then
opts.aggregate = assert(chkarg(arg[ix+1]))
ix = ix + 2
else error("input") end
end
if type(arg[ix]) == "table" then
local _o = arg[ix]
opts.weights = opts.weights or _o.weights
opts.aggregate = opts.aggregate or _o.aggregate
ix = ix + 1
end
assert(arg[ix] == nil)
if opts.aggregate then
assert(
(opts.aggregate == "sum") or
(opts.aggregate == "min") or
(opts.aggregate == "max")
)
else opts.aggregate = "sum" end
if opts.weights then
assert(#opts.weights == numkeys)
for i=1,#opts.weights do
assert(type(opts.weights[i]) == "number")
end
else
opts.weights = {}
for i=1, numkeys do opts.weights[i] = 1 end
end
opts.keys = ks
opts.dest = dest
return opts
end
local _zrbs_limits = function(x, s1, s2, descending)
local s1_incl, s2_incl = true, true
if s1:sub(1, 1) == "(" then
s1, s1_incl = s1:sub(2, -1), false
end
s1 = assert(tofloat(s1))
if s2:sub(1, 1) == "(" then
s2, s2_incl = s2:sub(2, -1), false
end
s2 = assert(tofloat(s2))
if descending then
s1, s2 = s2, s1
s1_incl, s2_incl = s2_incl, s1_incl
end
if s2 < s1 then return nil end
local l = x.list
local i1, i2
local fst, lst = l[1].s, l[#l].s
if (fst > s2) or ((not s2_incl) and (fst == s2)) then return nil end
if (lst < s1) or ((not s1_incl) and (lst == s1)) then return nil end
if (fst > s1) or (s1_incl and (fst == s1)) then i1 = 1 end
if (lst < s2) or (s2_incl and (lst == s2)) then i2 = #l end
for i=1,#l do
if (i1 and i2) then break end
if (not i1) then
if l[i].s > s1 then i1 = i end
if s1_incl and l[i].s == s1 then i1 = i end
end
if (not i2) then
if l[i].s > s2 then i2 = i-1 end
if (not s2_incl) and l[i].s == s2 then i2 = i-1 end
end
end
assert(i1 and i2)
if descending then
return #l-i2, #l-i1
else
return i1-1, i2-1
end
end
local dbg_zcoherence = function(self, k)
local x = xgetr(self, k, "zset")
return _z_coherence(x)
end
local zadd = function(self, k, ...)
k = chkarg(k)
local ps = _z_pairs(...)
local x = xgetw(self, k, "zset")
local n = 0
for i=1,#ps do
if not _z_update(x, ps[i]) then n = n+1 end
end
return n
end
local zcard = function(self, k)
local x = xgetr(self, k, "zset")
return #x.list
end
local zcount = function(self, k, s1, s2)
local x = xgetr(self, k, "zset")
local i1, i2 = _zrbs_limits(x, s1, s2, false)
if not (i1 and i2) then return 0 end
assert(i2 >= i1)
return i2 - i1 + 1
end
local zincrby = function(self, k, n, v)
k,v = chkargs(2, k, v)
n = assert(tofloat(n))
local x = xgetw(self, k, "zset")
local p = x.list[x.set[v]]
local s = p and (p.s + n) or n
_z_update(x, _z_pair(s, v))
return s
end
local zinterstore = function(self, ...)
local params = _z_store_params(...)
local x = xdefv("zset")
local aggregate
if params.aggregate == "sum" then
aggregate = function(x, y) return x+y end
elseif params.aggregate == "min" then
aggregate = math.min
elseif params.aggregate == "max" then
aggregate = math.max
else error() end
local y = xgetr(self, params.keys[1], "zset")
local p1, p2
for j=1,#y.list do
p1 = _z_pair(y.list[j].s, y.list[j].v)
_z_update(x, p1)
end
for i=2,#params.keys do
y = xgetr(self, params.keys[i], "zset")
local to_remove, to_update = {}, {}
for j=1,#x.list do
p1 = x.list[j]
if y.set[p1.v] then
p2 = _z_pair(
aggregate(
p1.s,
params.weights[i] * y.list[y.set[p1.v]].s
),
p1.v
)
to_update[#to_update+1] = p2
else
to_remove[#to_remove+1] = p1.v
end
end
for j=1,#to_remove do _z_remove(x, to_remove[j]) end
for j=1,#to_update do _z_update(x, to_update[j]) end
end
local r = #x.list
if r > 0 then
self.data[params.dest] = {ktype = "zset", value = x}
end
return r
end
local _zranger = function(descending)
return function(self, k, i1, i2, opts)
k = chkarg(k)
local withscores = false
if type(opts) == "table" then
withscores = opts.withscores
elseif type(opts) == "string" then
assert(opts:lower() == "withscores")
withscores = true
else assert(opts == nil) end
local x = xgetr(self, k, "zset")
local l = x.list
i1, i2 = _z_normrange(l, i1, i2)
if not i1 then return {} end
local inc = 1
if descending then
i1 = #l - i1 + 1
i2 = #l - i2 + 1
inc = -1
end
local r = {}
if withscores then
for i=i1, i2, inc do r[#r+1] = {l[i].v, l[i].s} end
else
for i=i1, i2, inc do r[#r+1] = l[i].v end
end
return r
end
end
local zrange = _zranger(false)
local zrevrange = _zranger(true)
local _zrangerbyscore = function(descending)
return function(self, k, s1, s2, ...)
k, s1, s2 = chkargs(3, k, s1, s2)
local opts = _zrbs_opts(...)
local x = xgetr(self, k, "zset")
local i1, i2 = _zrbs_limits(x, s1, s2, descending)
if not (i1 and i2) then return {} end
if opts.limit then
if opts.limit.count == 0 then return {} end
i1 = i1 + opts.limit.offset
if i1 > i2 then return {} end
i2 = math.min(i2, i1+opts.limit.count-1)
end
if descending then
return zrevrange(self, k, i1, i2, opts)
else
return zrange(self, k, i1, i2, opts)
end
end
end
local zrangebyscore = _zrangerbyscore(false)
local zrevrangebyscore = _zrangerbyscore(true)
local zrank = function(self, k, v)
local x = xgetr(self, k, "zset")
local r = x.set[v]
if r then
return r-1
else return nil end
end
local zrem = function(self, k, ...)
k = chkarg(k)
local arg = getargs(...)
local x, r = xgetw(self, k, "zset"), 0
for i=1,#arg do
if _z_remove(x, arg[i]) then r = r + 1 end
end
cleanup(self, k)
return r
end
local zremrangebyrank = function(self, k, i1, i2)
k = chkarg(k)
local x = xgetw(self, k, "zset")
i1, i2 = _z_normrange(x.list, i1, i2)
if not i1 then
cleanup(self, k)
return 0
end
local n = _z_remove_range(x, i1, i2)
cleanup(self, k)
return n
end
local zremrangebyscore = function(self, k, s1, s2)
local x = xgetr(self, k, "zset")
local i1, i2 = _zrbs_limits(x, s1, s2, false)
if not (i1 and i2) then return 0 end
assert(i2 >= i1)
return zremrangebyrank(self, k, i1, i2)
end
local zrevrank = function(self, k, v)
local x = xgetr(self, k, "zset")
local r = x.set[v]
if r then
return #x.list-r
else return nil end
end
local zscore = function(self, k, v)
local x = xgetr(self, k, "zset")
local p = x.list[x.set[v]]
if p then
return p.s
else return nil end
end
local zunionstore = function(self, ...)
local params = _z_store_params(...)
local x = xdefv("zset")
local default_score, aggregate
if params.aggregate == "sum" then
default_score = 0
aggregate = function(x, y) return x+y end
elseif params.aggregate == "min" then
default_score = math.huge
aggregate = math.min
elseif params.aggregate == "max" then
default_score = -math.huge
aggregate = math.max
else error() end
local y, p1, p2
for i=1,#params.keys do
y = xgetr(self, params.keys[i], "zset")
for j=1,#y.list do
p1 = y.list[j]
p2 = _z_pair(
aggregate(
params.weights[i] * p1.s,
x.set[p1.v] and x.list[x.set[p1.v]].s or default_score
),
p1.v
)
_z_update(x, p2)
end
end
local r = #x.list
if r > 0 then
self.data[params.dest] = {ktype = "zset", value = x}
end
return r
end
-- connection
local echo = function(self, v)
return v
end
local ping = function(self)
return true
end
-- server
local flushdb = function(self)
self.data = {}
return true
end
--- Class
local methods = {
-- keys
del = del, -- (...) -> #removed
exists = chkargs_wrap(exists, 1), -- (k) -> exists?
keys = keys, -- (pattern) -> list of keys
["type"] = chkargs_wrap(_type, 1), -- (k) -> [string|list|set|zset|hash|none]
randomkey = randomkey, -- () -> [k|nil]
rename = chkargs_wrap(rename, 2), -- (k,k2) -> true
renamenx = chkargs_wrap(renamenx, 2), -- (k,k2) -> ! existed? k2
-- strings
append = chkargs_wrap(append, 2), -- (k,v) -> #new
bitcount = bitcount, -- (k,[start,end]) -> n
bitop = bitop, -- ([and|or|xor|not],k,...)
decr = chkargs_wrap(decr, 1), -- (k) -> new
decrby = decrby, -- (k,n) -> new
get = chkargs_wrap(get, 1), -- (k) -> [v|nil]
getbit = getbit, -- (k,offset) -> b
getrange = getrange, -- (k,start,end) -> string
getset = chkargs_wrap(getset, 2), -- (k,v) -> [oldv|nil]
incr = chkargs_wrap(incr, 1), -- (k) -> new
incrby = incrby, -- (k,n) -> new
incrbyfloat = incrbyfloat, -- (k,n) -> new
mget = mget, -- (k1,...) -> {v1,...}
mset = mset, -- (k1,v1,...) -> true
msetnx = msetnx, -- (k1,v1,...) -> worked? (i.e. !existed? any k)
set = chkargs_wrap(set, 2), -- (k,v) -> true
setbit = setbit, -- (k,offset,b) -> old
setnx = chkargs_wrap(setnx, 2), -- (k,v) -> worked? (i.e. !existed?)
setrange = setrange, -- (k,offset,val) -> #new
strlen = chkargs_wrap(strlen, 1), -- (k) -> [#v|0]
-- hashes
hdel = hdel, -- (k,sk1,...) -> #removed
hexists = chkargs_wrap(hexists, 2), -- (k,sk) -> exists?
hget = chkargs_wrap(hget,2), -- (k,sk) -> v
hgetall = chkargs_wrap(hgetall, 1), -- (k) -> map
hincrby = hincrby, -- (k,sk,n) -> new
hincrbyfloat = hincrbyfloat, -- (k,sk,n) -> new
hkeys = chkargs_wrap(hkeys, 1), -- (k) -> keys
hlen = chkargs_wrap(hlen, 1), -- (k) -> [#sk|0]
hmget = hmget, -- (k,{sk1,...}) -> {v1,...}
hmset = hmset, -- (k,{sk1=v1,...}) -> true
hset = chkargs_wrap(hset, 3), -- (k,sk1,v1) -> !existed?
hsetnx = chkargs_wrap(hsetnx, 3), -- (k,sk1,v1) -> worked? (i.e. !existed?)
hvals = chkargs_wrap(hvals, 1), -- (k) -> values
-- lists
blpop = blpop, -- (k1,...) -> k,v
brpop = brpop, -- (k1,...) -> k,v
brpoplpush = brpoplpush, -- (k1,k2,timeout) -> v
lindex = lindex, -- (k,i) -> v
linsert = chkargs_wrap(linsert, 4), -- (k,mode,pivot,v) -> #list (after)
llen = chkargs_wrap(llen, 1), -- (k) -> #list
lpop = chkargs_wrap(lpop, 1), -- (k) -> v
lpush = lpush, -- (k,v1,...) -> #list (after)
lpushx = chkargs_wrap(lpushx, 2), -- (k,v) -> #list (after)
lrange = lrange, -- (k,start,stop) -> list
lrem = lrem, -- (k,count,v) -> #removed
lset = lset, -- (k,i,v) -> true
ltrim = ltrim, -- (k,start,stop) -> true
rpop = chkargs_wrap(rpop, 1), -- (k) -> v
rpoplpush = chkargs_wrap(rpoplpush, 2), -- (k1,k2) -> v
rpush = rpush, -- (k,v1,...) -> #list (after)
rpushx = chkargs_wrap(rpushx, 2), -- (k,v) -> #list (after)
-- sets
sadd = sadd, -- (k,v1,...) -> #added
scard = chkargs_wrap(scard, 1), -- (k) -> [n|0]
sdiff = sdiff, -- (k1,...) -> set (of elements in k1 & not in any of ...)
sdiffstore = sdiffstore, -- (k0,k1,...) -> #set at k0
sinter = sinter, -- (k1,...) -> set
sinterstore = sinterstore, -- (k0,k1,...) -> #set at k0
sismember = chkargs_wrap(sismember, 2), -- (k,v) -> member?
smembers = chkargs_wrap(smembers, 1), -- (k) -> set
smove = chkargs_wrap(smove, 3), -- (k1,k2,v) -> moved? (i.e. !member? k1)
spop = chkargs_wrap(spop, 1), -- (k) -> [v|nil]
srandmember = srandmember, -- (k,[count]) -> v|[v1,v2,...]
srem = srem, -- (k,v1,...) -> #removed
sunion = sunion, -- (k1,...) -> set
sunionstore = sunionstore, -- (k0,k1,...) -> #set at k0
-- zsets
zadd = zadd, -- (k,score,member,[score,member,...])
zcard = chkargs_wrap(zcard, 1), -- (k) -> n
zcount = chkargs_wrap(zcount, 3), -- (k,min,max) -> count
zincrby = zincrby, -- (k,score,v) -> score
zinterstore = zinterstore, -- (k,numkeys,k1,...,[opts]) -> card
zrange = zrange, -- (k,start,stop,[opts]) -> depends on opts
zrangebyscore = zrangebyscore, -- (k,min,max,[opts]) -> depends on opts
zrank = chkargs_wrap(zrank, 2), -- (k,v) -> rank
zrem = zrem, -- (k,v1,...) -> #removed
zremrangebyrank = zremrangebyrank, -- (k,start,stop) -> #removed
zremrangebyscore = chkargs_wrap(zremrangebyscore, 3), -- (k,min,max) -> #removed
zrevrange = zrevrange, -- (k,start,stop,[opts]) -> depends on opts
zrevrangebyscore = zrevrangebyscore, -- (k,min,max,[opts]) -> depends on opts
zrevrank = chkargs_wrap(zrevrank, 2), -- (k,v) -> rank
zscore = chkargs_wrap(zscore, 2), -- (k,v) -> score
zunionstore = zunionstore, -- (k,numkeys,k1,...,[opts]) -> card
-- connection
echo = chkargs_wrap(echo, 1), -- (v) -> v
ping = ping, -- () -> true
-- server
flushall = flushdb, -- () -> true
flushdb = flushdb, -- () -> true
-- debug
dbg_zcoherence = dbg_zcoherence,
}
local new = function()
local r = {data = {}}
return setmetatable(r,{__index = methods})
end
return {
new = new,
}
--@titantims
| gpl-3.0 |
DiNaSoR/Angel_Arena | game/angel_arena/scripts/vscripts/hero/hero_juggernaut.lua | 1 | 35582 | --[[ Author: Yahnich
Date: 28.03.2017 ]]
CreateEmptyTalents('juggernaut')
-- JUGGERNAUT SPECIFIC UTILITY FUNCTIONS --
function IsTotem(unit) -- have to do it like this because server and client side classes are different thanks valve
return ( not unit:HasMovementCapability() )
end
-- BLADE FURY --
imba_juggernaut_blade_fury = imba_juggernaut_blade_fury or class({})
function imba_juggernaut_blade_fury:IsNetherWardStealable() return true end
function imba_juggernaut_blade_fury:GetCastRange()
return self:GetTalentSpecialValueFor("effect_radius")
end
function imba_juggernaut_blade_fury:GetAbilityTextureName()
return "juggernaut_blade_fury"
end
function imba_juggernaut_blade_fury:GetCooldown(nLevel)
local cooldown = self.BaseClass.GetCooldown( self, nLevel ) + self:GetCaster():FindTalentValue("special_bonus_imba_juggernaut_7")
return cooldown
end
function imba_juggernaut_blade_fury:OnSpellStart()
local caster = self:GetCaster()
caster:Purge(false, true, false, false, false)
caster:AddNewModifier(caster, self, "modifier_imba_juggernaut_blade_fury", {duration = self:GetSpecialValueFor("duration")})
-- Play cast lines
local rand = RandomInt(2, 9)
if (rand >= 2 and rand <= 3) or (rand >= 5 and rand <= 9) then
caster:EmitSound("juggernaut_jug_ability_bladefury_0"..rand)
elseif rand >= 10 and rand <= 18 then
caster:EmitSound("Imba.JuggernautBladeFury"..rand)
end
end
LinkLuaModifier("modifier_imba_juggernaut_blade_fury", "hero/hero_juggernaut", LUA_MODIFIER_MOTION_NONE)
modifier_imba_juggernaut_blade_fury = modifier_imba_juggernaut_blade_fury or class({})
function modifier_imba_juggernaut_blade_fury:OnCreated()
self.caster = self:GetCaster()
self.ability = self:GetAbility()
self.dps = self.ability:GetTalentSpecialValueFor("damage_per_sec")
self.evasion = self.ability:GetTalentSpecialValueFor("evasion")
self.radius = self.ability:GetTalentSpecialValueFor("effect_radius")
self.tick = self.ability:GetTalentSpecialValueFor("damage_tick")
self.caster = self:GetCaster()
if IsServer() then
if self.caster:IsAlive() then
self.blade_fury_spin_pfx = ParticleManager:CreateParticle("particles/units/heroes/hero_juggernaut/juggernaut_blade_fury.vpcf", PATTACH_ABSORIGIN_FOLLOW, self.caster)
ParticleManager:SetParticleControl(self.blade_fury_spin_pfx, 5, Vector(self.radius * 1.2, 0, 0))
self:StartIntervalThink(self.tick)
self.caster:EmitSound("Hero_Juggernaut.BladeFuryStart")
StartAnimation(self.caster, {activity = ACT_DOTA_OVERRIDE_ABILITY_1, rate = 1.0})
end
end
end
function modifier_imba_juggernaut_blade_fury:OnIntervalThink()
local damage = self.dps * self.tick
local caster_loc = self.caster:GetAbsOrigin()
-- Iterate through nearby enemies
local furyEnemies = FindUnitsInRadius(self.caster:GetTeamNumber(), caster_loc, nil, self.radius, DOTA_UNIT_TARGET_TEAM_ENEMY, DOTA_UNIT_TARGET_HERO + DOTA_UNIT_TARGET_BASIC, DOTA_UNIT_TARGET_FLAG_NONE, FIND_ANY_ORDER, false)
for _,enemy in pairs(furyEnemies) do
-- Play hit sound
enemy:EmitSound("Hero_Juggernaut.BladeFury.Impact")
-- Play hit particle
local slash_pfx = ParticleManager:CreateParticle("particles/units/heroes/hero_juggernaut/juggernaut_blade_fury_tgt.vpcf", PATTACH_ABSORIGIN_FOLLOW, enemy)
ParticleManager:SetParticleControl(slash_pfx, 0, enemy:GetAbsOrigin())
ParticleManager:ReleaseParticleIndex(slash_pfx)
if self.caster:HasTalent("special_bonus_imba_juggernaut_6") then
self.bladedance = self.bladedance or self.caster:FindAbilityByName("imba_juggernaut_blade_dance")
self.prng = self.prng or 0
local crit = self.bladedance:GetTalentSpecialValueFor("crit_damage") / 100
local chance = self.bladedance:GetTalentSpecialValueFor("crit_chance")
if RollPercentage( chance + self.prng - math.floor( (chance - 5)/chance ) ) then
self.prng = 0
local crit_pfx = ParticleManager:CreateParticle("particles/units/heroes/hero_juggernaut/jugg_crit_blur.vpcf", PATTACH_ABSORIGIN_FOLLOW, self:GetParent())
ParticleManager:SetParticleControl(crit_pfx, 0, self:GetParent():GetAbsOrigin())
ParticleManager:ReleaseParticleIndex(crit_pfx)
self:GetParent():EmitSound("Hero_Juggernaut.BladeDance")
damage = damage * crit
SendOverheadEventMessage(self.caster, OVERHEAD_ALERT_CRITICAL, enemy, damage, self.caster)
else
self.prng = self.prng + 1
end
end
-- Deal damage
ApplyDamage({attacker = self.caster, victim = enemy, ability = self.ability, damage = damage, damage_type = DAMAGE_TYPE_MAGICAL})
end
end
function modifier_imba_juggernaut_blade_fury:CheckState()
local state = {[MODIFIER_STATE_MAGIC_IMMUNE] = true}
return state
end
function modifier_imba_juggernaut_blade_fury:OnRemoved()
if IsServer() then
self.caster:StopSound("Hero_Juggernaut.BladeFuryStart")
self.caster:EmitSound("Hero_Juggernaut.BladeFuryStop")
if self.caster:HasModifier("modifier_imba_omni_slash_caster") then
StartAnimation(self.caster, {activity = ACT_DOTA_OVERRIDE_ABILITY_4, rate = 1.0})
else
EndAnimation(self.caster)
end
if self.blade_fury_spin_pfx then
ParticleManager:DestroyParticle(self.blade_fury_spin_pfx, false)
ParticleManager:ReleaseParticleIndex(self.blade_fury_spin_pfx)
self.blade_fury_spin_pfx = nil
end
end
end
function modifier_imba_juggernaut_blade_fury:DeclareFunctions()
local funcs = {
MODIFIER_PROPERTY_EVASION_CONSTANT,
}
return funcs
end
function modifier_imba_juggernaut_blade_fury:GetModifierEvasion_Constant()
return self.evasion
end
-- HEALING WARD --
imba_juggernaut_healing_ward = imba_juggernaut_healing_ward or class({})
function imba_juggernaut_healing_ward:IsNetherWardStealable() return false end
function imba_juggernaut_healing_ward:GetAbilityTextureName()
return "juggernaut_healing_ward"
end
function imba_juggernaut_healing_ward:OnSpellStart()
local caster = self:GetCaster()
local targetPoint = self:GetCursorPosition()
-- Play cast sound
caster:EmitSound("Hero_Juggernaut.HealingWard.Cast")
-- Spawn the Healing Ward
local healing_ward = CreateUnitByName("npc_imba_juggernaut_healing_ward", targetPoint, true, caster, caster, caster:GetTeam())
-- Make the ward immediately follow its caster
healing_ward:SetControllableByPlayer(caster:GetPlayerID(), true)
Timers:CreateTimer(0.1, function()
healing_ward:MoveToNPC(caster)
end)
-- Increase the ward's health, if appropriate
SetCreatureHealth(healing_ward, self:GetTalentSpecialValueFor("health"), true)
-- Prevent nearby units from getting stuck
ResolveNPCPositions(healing_ward:GetAbsOrigin(), healing_ward:GetHullRadius() + healing_ward:GetCollisionPadding())
-- Apply the Healing Ward duration modifier
healing_ward:AddNewModifier(caster, self, "modifier_kill", {duration = self:GetTalentSpecialValueFor("duration")})
-- Grant the Healing Ward its abilities
healing_ward:AddAbility("imba_juggernaut_healing_ward_passive"):SetLevel( self:GetLevel() )
end
imba_juggernaut_healing_ward_passive = imba_juggernaut_healing_ward_passive or class({})
function imba_juggernaut_healing_ward_passive:GetAbilityTextureName()
return "juggernaut_healing_ward"
end
function imba_juggernaut_healing_ward_passive:GetIntrinsicModifierName()
return "modifier_imba_juggernaut_healing_ward_passive"
end
function imba_juggernaut_healing_ward_passive:CastFilterResult()
if not IsTotem(self:GetCaster()) then
return UF_SUCCESS
else
return UF_FAIL_CUSTOM
end
end
function imba_juggernaut_healing_ward_passive:GetCustomCastError()
return "Already totem"
end
function imba_juggernaut_healing_ward_passive:OnSpellStart()
local caster = self:GetCaster()
local targetPoint = self:GetCursorPosition()
-- Play cast sound
caster:EmitSound("Hero_Juggernaut.HealingWard.Cast")
-- Transform ward into totem
caster:SetMoveCapability(DOTA_UNIT_CAP_MOVE_NONE)
caster:SetModel("models/items/juggernaut/ward/dc_wardupate/dc_wardupate.vmdl")
SetCreatureHealth(caster, self:GetTalentSpecialValueFor("health_totem"), true)
caster:FindModifierByName("modifier_imba_juggernaut_healing_ward_passive"):ForceRefresh()
end
LinkLuaModifier("modifier_imba_juggernaut_healing_ward_passive", "hero/hero_juggernaut", LUA_MODIFIER_MOTION_NONE)
modifier_imba_juggernaut_healing_ward_passive = modifier_imba_juggernaut_healing_ward_passive or class({})
function modifier_imba_juggernaut_healing_ward_passive:OnCreated()
self.caster = self:GetCaster()
self.ability = self:GetAbility()
if IsTotem(self:GetParent()) then
self.radius = self.ability:GetTalentSpecialValueFor("heal_radius_totem")
else
self.radius = self.ability:GetTalentSpecialValueFor("heal_radius")
end
if IsServer() then
-- Play spawn particle
local eruption_pfx = ParticleManager:CreateParticle("particles/units/heroes/hero_juggernaut/juggernaut_healing_ward_eruption.vpcf", PATTACH_CUSTOMORIGIN, self.caster)
ParticleManager:SetParticleControl(eruption_pfx, 0, self.caster:GetAbsOrigin())
ParticleManager:ReleaseParticleIndex(eruption_pfx)
-- Attach ambient particle
self.caster.healing_ward_ambient_pfx = ParticleManager:CreateParticle("particles/units/heroes/hero_juggernaut/juggernaut_healing_ward.vpcf", PATTACH_ABSORIGIN_FOLLOW, self.caster)
ParticleManager:SetParticleControl(self.caster.healing_ward_ambient_pfx, 0, self.caster:GetAbsOrigin() + Vector(0, 0, 100))
ParticleManager:SetParticleControl(self.caster.healing_ward_ambient_pfx, 1, Vector(self.ability:GetTalentSpecialValueFor("heal_radius"), 1, 1))
ParticleManager:SetParticleControlEnt(self.caster.healing_ward_ambient_pfx, 2, self.caster, PATTACH_POINT_FOLLOW, "attach_hitloc", self.caster:GetAbsOrigin(), true)
EmitSoundOn("Hero_Juggernaut.HealingWard.Loop", self:GetParent())
self:StartIntervalThink(0.1) -- anti valve garbage measures
end
end
function modifier_imba_juggernaut_healing_ward_passive:OnRefresh()
self.caster = self:GetCaster()
self.ability = self:GetAbility()
if IsTotem(self:GetParent()) then
self.radius = self.ability:GetTalentSpecialValueFor("heal_radius_totem")
else
self.radius = self.ability:GetTalentSpecialValueFor("heal_radius")
end
if IsServer() then
-- Play spawn particle
local eruption_pfx = ParticleManager:CreateParticle("particles/econ/items/juggernaut/bladekeeper_healing_ward/juggernaut_healing_ward_eruption_dc.vpcf", PATTACH_CUSTOMORIGIN, self.caster)
ParticleManager:SetParticleControl(eruption_pfx, 0, self.caster:GetAbsOrigin())
ParticleManager:ReleaseParticleIndex(eruption_pfx)
-- Attach ambient particle
ParticleManager:DestroyParticle(self.caster.healing_ward_ambient_pfx, false)
ParticleManager:ReleaseParticleIndex(self.caster.healing_ward_ambient_pfx)
self.caster.healing_ward_ambient_pfx = nil
self.caster.healing_ward_ambient_pfx = ParticleManager:CreateParticle("particles/econ/items/juggernaut/bladekeeper_healing_ward/juggernaut_healing_ward_dc.vpcf", PATTACH_ABSORIGIN_FOLLOW, self.caster)
ParticleManager:SetParticleControl(self.caster.healing_ward_ambient_pfx, 0, self.caster:GetAbsOrigin() + Vector(0, 0, 100))
ParticleManager:SetParticleControl(self.caster.healing_ward_ambient_pfx, 1, Vector(self.ability:GetTalentSpecialValueFor("heal_radius_totem"), 1, 1))
ParticleManager:SetParticleControlEnt(self.caster.healing_ward_ambient_pfx, 2, self.caster, PATTACH_POINT_FOLLOW, "attach_hitloc", self.caster:GetAbsOrigin(), true)
end
end
function modifier_imba_juggernaut_healing_ward_passive:OnIntervalThink()
if IsTotem(self:GetParent()) and self:GetParent():GetModelName() == "models/heroes/juggernaut/jugg_healing_ward.vmdl" then
self:GetParent():SetModel("models/items/juggernaut/ward/dc_wardupate/dc_wardupate.vmdl")
elseif not IsTotem(self:GetParent()) and self:GetParent():GetModelName() == "models/items/juggernaut/ward/dc_wardupate/dc_wardupate.vmdl" then
self:GetParent():SetModel("models/heroes/juggernaut/jugg_healing_ward.vmdl")
end
end
function modifier_imba_juggernaut_healing_ward_passive:IsHidden()
return true
end
--------------------------------------------------------------------------------
function modifier_imba_juggernaut_healing_ward_passive:IsAura()
return true
end
--------------------------------------------------------------------------------
function modifier_imba_juggernaut_healing_ward_passive:GetModifierAura()
return "modifier_imba_juggernaut_healing_ward_aura"
end
function modifier_imba_juggernaut_healing_ward_passive:GetAuraEntityReject(target)
if target:GetUnitName() == self:GetParent():GetUnitName() then return true end
return false
end
--------------------------------------------------------------------------------
function modifier_imba_juggernaut_healing_ward_passive:GetAuraSearchTeam()
return DOTA_UNIT_TARGET_TEAM_FRIENDLY
end
--------------------------------------------------------------------------------
function modifier_imba_juggernaut_healing_ward_passive:GetAuraSearchType()
return DOTA_UNIT_TARGET_HERO + DOTA_UNIT_TARGET_BASIC
end
--------------------------------------------------------------------------------
function modifier_imba_juggernaut_healing_ward_passive:GetAuraRadius()
return self.radius
end
--------------------------------------------------------------------------------
function modifier_imba_juggernaut_healing_ward_passive:IsPurgable()
return false
end
function modifier_imba_juggernaut_healing_ward_passive:CheckState()
local state = {
[MODIFIER_STATE_NO_UNIT_COLLISION] = true,
[MODIFIER_STATE_MAGIC_IMMUNE] = true,
[MODIFIER_STATE_LOW_ATTACK_PRIORITY] = true,
}
return state
end
function modifier_imba_juggernaut_healing_ward_passive:DeclareFunctions()
funcs = {
MODIFIER_PROPERTY_INCOMING_DAMAGE_PERCENTAGE,
MODIFIER_EVENT_ON_ATTACK_LANDED,
MODIFIER_EVENT_ON_DEATH
}
return funcs
end
function modifier_imba_juggernaut_healing_ward_passive:GetModifierIncomingDamage_Percentage()
return -100
end
function modifier_imba_juggernaut_healing_ward_passive:OnAttackLanded(params) -- health handling
if params.target == self:GetParent() then
local damage = 1
if params.attacker:IsRealHero() or params.attacker:IsTower() then
damage = 3
end
if self:GetParent():GetHealth() > damage then
self:GetParent():SetHealth( self:GetParent():GetHealth() - damage)
else
self:GetParent():Kill(nil, params.attacker)
end
end
end
function modifier_imba_juggernaut_healing_ward_passive:OnDeath(params) -- modifier kill instadeletes thanks valve
if params.unit == self:GetParent() then
ParticleManager:DestroyParticle(self.caster.healing_ward_ambient_pfx, false)
ParticleManager:ReleaseParticleIndex(self.caster.healing_ward_ambient_pfx)
self.caster.healing_ward_ambient_pfx = nil
StopSoundOn("Hero_Juggernaut.HealingWard.Loop", self:GetParent())
end
end
LinkLuaModifier("modifier_imba_juggernaut_healing_ward_aura", "hero/hero_juggernaut", LUA_MODIFIER_MOTION_NONE)
modifier_imba_juggernaut_healing_ward_aura = modifier_imba_juggernaut_healing_ward_aura or class({})
function modifier_imba_juggernaut_healing_ward_aura:OnCreated()
self.caster = self:GetCaster()
self.ability = self:GetAbility()
if IsTotem(self.caster) then
self.healing = self.ability:GetTalentSpecialValueFor("heal_per_sec_totem")
else
self.healing = self.ability:GetTalentSpecialValueFor("heal_per_sec")
end
end
function modifier_imba_juggernaut_healing_ward_aura:OnRefresh()
if IsTotem(self.caster) then
self.healing = self.ability:GetTalentSpecialValueFor("heal_per_sec_totem")
else
self.healing = self.ability:GetTalentSpecialValueFor("heal_per_sec")
end
end
function modifier_imba_juggernaut_healing_ward_aura:GetEffectName()
return "particles/units/heroes/hero_juggernaut/juggernaut_ward_heal.vpcf"
end
function modifier_imba_juggernaut_healing_ward_aura:DeclareFunctions()
funcs = { MODIFIER_PROPERTY_HEALTH_REGEN_PERCENTAGE }
return funcs
end
function modifier_imba_juggernaut_healing_ward_aura:GetModifierHealthRegenPercentage()
return self.healing
end
-- BLADE DANCE --
imba_juggernaut_blade_dance = imba_juggernaut_blade_dance or class({})
function imba_juggernaut_blade_dance:GetIntrinsicModifierName()
return "modifier_imba_juggernaut_blade_dance_passive"
end
function imba_juggernaut_blade_dance:GetAbilityTextureName()
return "juggernaut_blade_dance"
end
function imba_juggernaut_blade_dance:CastFilterResultTarget(target)
if IsServer() then
local caster = self:GetCaster()
if caster:IsDisarmed() then
return UF_FAIL_CUSTOM
end
local nResult = UnitFilter( target, self:GetAbilityTargetTeam(), self:GetAbilityTargetType(), self:GetAbilityTargetFlags(), self:GetCaster():GetTeamNumber() )
return nResult
end
end
function imba_juggernaut_blade_dance:GetCustomCastErrorTarget(target)
return "dota_hud_error_cant_use_disarmed"
end
function imba_juggernaut_blade_dance:OnSpellStart()
local caster = self:GetCaster()
local target = self:GetCursorTarget()
self.endTarget = target
caster:AddNewModifier(caster, self, "modifier_imba_juggernaut_blade_dance_empowered_slice", {})
end
function imba_juggernaut_blade_dance:GetCastRange()
if self:GetBehavior() ~= DOTA_ABILITY_BEHAVIOR_PASSIVE then
return self:GetTalentSpecialValueFor("active_distance")
end
return 0
end
function imba_juggernaut_blade_dance:GetCooldown()
if self:GetBehavior() ~= DOTA_ABILITY_BEHAVIOR_PASSIVE then
return self:GetTalentSpecialValueFor("active_cooldown")
end
return 0
end
LinkLuaModifier("modifier_imba_juggernaut_blade_dance_empowered_slice", "hero/hero_juggernaut", LUA_MODIFIER_MOTION_NONE)
modifier_imba_juggernaut_blade_dance_empowered_slice = modifier_imba_juggernaut_blade_dance_empowered_slice or class({})
function modifier_imba_juggernaut_blade_dance_empowered_slice:IsHidden()
return true
end
function modifier_imba_juggernaut_blade_dance_empowered_slice:RemoveOnDeath()
return false
end
function modifier_imba_juggernaut_blade_dance_empowered_slice:IsMotionController()
return true
end
function modifier_imba_juggernaut_blade_dance_empowered_slice:GetMotionControllerPriority()
return DOTA_MOTION_CONTROLLER_PRIORITY_HIGH
end
function modifier_imba_juggernaut_blade_dance_empowered_slice:OnCreated()
if IsServer() then
self.caster = self:GetCaster()
self.ability = self:GetAbility()
EmitSoundOn("Hero_Juggernaut.PreAttack", self:GetParent())
EmitSoundOn("Hero_EarthShaker.Attack", self:GetParent())
self.speed = self.ability:GetTalentSpecialValueFor("active_speed")
self.enemies_hit = {}
self.endTarget = self.ability.endTarget
self.distance_left = ( self.endTarget:GetAbsOrigin() - self.caster:GetAbsOrigin() ):Length2D()
self.direction = ( self.endTarget:GetAbsOrigin() - self.caster:GetAbsOrigin() ):Normalized()
self.traveled = 0
self.wind_dance = self.caster:FindModifierByName("modifier_imba_juggernaut_blade_dance_wind_dance")
self.frametime = FrameTime()
self:StartIntervalThink(FrameTime())
end
end
function modifier_imba_juggernaut_blade_dance_empowered_slice:OnIntervalThink()
-- Check motion controllers
if not self:CheckMotionControllers() then
self:Destroy()
return nil
end
-- Horizontal motion
self:HorizontalMotion(self:GetParent(), self.frametime)
-- Look for enemies to attack
self:SeekAndDestroy()
end
function modifier_imba_juggernaut_blade_dance_empowered_slice:SeekAndDestroy()
if IsServer() then
AddFOWViewer(self.caster:GetTeamNumber(), self.endTarget:GetAbsOrigin(), 100, FrameTime(), false)
local sliceEnemies = FindUnitsInRadius(self.caster:GetTeamNumber(), self.caster:GetAbsOrigin(), nil, 150, DOTA_UNIT_TARGET_TEAM_ENEMY, DOTA_UNIT_TARGET_HERO + DOTA_UNIT_TARGET_BASIC, DOTA_UNIT_TARGET_FLAG_NO_INVIS + DOTA_UNIT_TARGET_FLAG_FOW_VISIBLE, FIND_ANY_ORDER, false)
for _,enemy in pairs(sliceEnemies) do
-- If this enemy was already hit by this cast, do nothing
local enemy_hit = false
for _,hit_enemy in pairs(self.enemies_hit) do
if hit_enemy == enemy then
enemy_hit = true
end
-- If this enemy is attack immune, do nothing
if enemy:IsAttackImmune() then
enemy_hit = true
end
end
if not enemy_hit then
-- Play hit sound
enemy:EmitSound("Hero_Juggernaut.BladeFury.Impact")
-- Play hit particle
local slash_pfx = ParticleManager:CreateParticle("particles/units/heroes/hero_juggernaut/juggernaut_blade_fury_tgt.vpcf", PATTACH_ABSORIGIN_FOLLOW, enemy)
ParticleManager:SetParticleControl(slash_pfx, 0, enemy:GetAbsOrigin())
ParticleManager:ReleaseParticleIndex(slash_pfx)
-- Deal damage
self.caster:PerformAttack(enemy, true, true, true, true, false, false, true)
self.wind_dance:DecrementStackCount()
-- Add this enemy to the hit table
table.insert(self.enemies_hit, enemy)
end
end
end
end
function modifier_imba_juggernaut_blade_dance_empowered_slice:HorizontalMotion( me, dt )
if IsServer() then
if self.endTarget:IsInvisible() or self.endTarget:IsOutOfGame() or self.endTarget:CanEntityBeSeenByMyTeam(self.caster) then
self:Destroy()
end
if self.distance_left > 100 and not self.wind_dance:IsNull() and self.wind_dance:GetStackCount() > 0 then
local oldPos = self.caster:GetAbsOrigin()
self.direction = ( self.endTarget:GetAbsOrigin() - self.caster:GetAbsOrigin() ):Normalized()
self.caster:SetAbsOrigin(self.caster:GetAbsOrigin() + self.direction * self.speed * dt)
self.distance_left = ( self.endTarget:GetAbsOrigin() - self.caster:GetAbsOrigin() ):Length2D()
local sliceFX = ParticleManager:CreateParticle("particles/econ/items/juggernaut/bladekeeper_omnislash/dc_juggernaut_omni_slash_rope.vpcf", PATTACH_ABSORIGIN , self.caster)
ParticleManager:SetParticleControl(sliceFX, 0, oldPos)
ParticleManager:SetParticleControl(sliceFX, 2, oldPos)
ParticleManager:SetParticleControl(sliceFX, 3, self.caster:GetAbsOrigin())
ParticleManager:ReleaseParticleIndex(sliceFX)
else
FindClearSpaceForUnit(self.caster, self.endTarget:GetAbsOrigin() - self.endTarget:GetForwardVector()*150, true)
self.caster:MoveToTargetToAttack(self.endTarget)
self.caster:SetForwardVector(self.endTarget:GetForwardVector())
self:Destroy()
end
end
end
function modifier_imba_juggernaut_blade_dance_empowered_slice:CheckState()
local state = {
[MODIFIER_STATE_NO_UNIT_COLLISION] = true,
[MODIFIER_STATE_INVULNERABLE] = true,
}
return state
end
function modifier_imba_juggernaut_blade_dance_empowered_slice:StatusEffectPriority()
return 20
end
function modifier_imba_juggernaut_blade_dance_empowered_slice:GetStatusEffectName()
return "particles/status_fx/status_effect_omnislash.vpcf"
end
function modifier_imba_juggernaut_blade_dance_empowered_slice:OnDestroy()
if IsServer() then
self.caster:SetUnitOnClearGround()
end
end
LinkLuaModifier("modifier_imba_juggernaut_blade_dance_passive", "hero/hero_juggernaut", LUA_MODIFIER_MOTION_NONE)
modifier_imba_juggernaut_blade_dance_passive = modifier_imba_juggernaut_blade_dance_passive or class({})
function modifier_imba_juggernaut_blade_dance_passive:IsHidden()
return true
end
function modifier_imba_juggernaut_blade_dance_passive:OnCreated()
self:StartIntervalThink(1)
self.ability = self:GetAbility()
self.caster = self:GetCaster()
self.crit = self.ability:GetTalentSpecialValueFor("crit_damage")
self.chance = self.ability:GetTalentSpecialValueFor("crit_chance")
self.critProc = false
-- Turn unit target passive, tooltip purposes
self:GetAbility().GetBehavior = function() return DOTA_ABILITY_BEHAVIOR_PASSIVE end
self:GetAbility():GetBehavior()
end
function modifier_imba_juggernaut_blade_dance_passive:OnRefresh()
self.crit = self.ability:GetTalentSpecialValueFor("crit_damage")
self.chance = self.ability:GetTalentSpecialValueFor("crit_chance")
end
function modifier_imba_juggernaut_blade_dance_passive:OnIntervalThink() -- account for talents being skilled
self:ForceRefresh()
end
function modifier_imba_juggernaut_blade_dance_passive:DeclareFunctions()
funcs = {
MODIFIER_PROPERTY_PREATTACK_CRITICALSTRIKE,
MODIFIER_EVENT_ON_ATTACK_LANDED
}
return funcs
end
if IsServer() then
function modifier_imba_juggernaut_blade_dance_passive:GetModifierPreAttack_CriticalStrike(params)
if self:GetParent():PassivesDisabled() then return nil end
if RollPseudoRandom(self.chance, self) then
local crit_pfx = ParticleManager:CreateParticle("particles/units/heroes/hero_juggernaut/jugg_crit_blur.vpcf", PATTACH_ABSORIGIN_FOLLOW, self:GetParent())
ParticleManager:SetParticleControl(crit_pfx, 0, self:GetParent():GetAbsOrigin())
ParticleManager:ReleaseParticleIndex(crit_pfx)
self.critProc = true
-- Play crit sound
self:GetParent():EmitSound("Hero_Juggernaut.BladeDance")
return self.crit
else
self.critProc = false
return nil
end
end
function modifier_imba_juggernaut_blade_dance_passive:OnAttackLanded(params)
if params.attacker == self:GetParent() then
self:HandleWindDance(self.critProc)
self.critProc = false
end
end
end
function modifier_imba_juggernaut_blade_dance_passive:HandleWindDance(bCrit)
if self.caster:IsRealHero() then
-- If Juggernaut is in the middle of Blade Dance, he cannot gain Wind Dance stacks.
if self.caster:HasModifier("modifier_imba_juggernaut_blade_dance_empowered_slice") then
return nil
end
local wind_dance = self.caster:FindModifierByName("modifier_imba_juggernaut_blade_dance_wind_dance")
if bCrit then
if not wind_dance then wind_dance = self.caster:AddNewModifier(self.caster, self.ability, "modifier_imba_juggernaut_blade_dance_wind_dance", {duration = self.ability:GetTalentSpecialValueFor("bonus_duration")}) end
wind_dance:ForceRefresh()
elseif wind_dance then
wind_dance:SetDuration(wind_dance:GetDuration(), true) -- does not roll refresh
end
end
end
LinkLuaModifier("modifier_imba_juggernaut_blade_dance_wind_dance", "hero/hero_juggernaut", LUA_MODIFIER_MOTION_NONE)
modifier_imba_juggernaut_blade_dance_wind_dance = modifier_imba_juggernaut_blade_dance_wind_dance or class({})
function modifier_imba_juggernaut_blade_dance_wind_dance:OnCreated()
self.agi = self:GetAbility():GetTalentSpecialValueFor("bonus_agi")
self.ms = self:GetAbility():GetTalentSpecialValueFor("bonus_ms")
self:StartIntervalThink(1)
end
function modifier_imba_juggernaut_blade_dance_wind_dance:OnRefresh()
self.agi = self:GetAbility():GetTalentSpecialValueFor("bonus_agi")
self.ms = self:GetAbility():GetTalentSpecialValueFor("bonus_ms")
if IsServer() then
self:IncrementStackCount()
self:GetParent():CalculateStatBonus()
end
end
function modifier_imba_juggernaut_blade_dance_wind_dance:OnStackCountChanged()
local serverCheck = 0
if IsServer() then -- why? ? ? ? ?
self:GetParent():CalculateStatBonus()
serverCheck = 1
end
if self:GetStackCount() + serverCheck >= self:GetAbility():GetTalentSpecialValueFor("active_min_stacks") and self:GetAbility():GetBehavior() ~= DOTA_ABILITY_BEHAVIOR_UNIT_TARGET + DOTA_ABILITY_BEHAVIOR_IMMEDIATE then -- inject function calls clientside and serverside
-- Change behavior
self:GetAbility().GetBehavior = function() return DOTA_ABILITY_BEHAVIOR_UNIT_TARGET + DOTA_ABILITY_BEHAVIOR_IMMEDIATE end
self:GetAbility():GetBehavior()
self:GetAbility():GetCastRange(self:GetCaster(), self:GetCaster():GetAbsOrigin())
self:GetAbility():GetCooldown()
elseif self:GetStackCount() + serverCheck < self:GetAbility():GetTalentSpecialValueFor("active_min_stacks") and self:GetAbility():GetBehavior() == DOTA_ABILITY_BEHAVIOR_UNIT_TARGET + DOTA_ABILITY_BEHAVIOR_IMMEDIATE then
self:GetAbility().GetBehavior = function() return DOTA_ABILITY_BEHAVIOR_PASSIVE end
self:GetAbility():GetBehavior()
self:GetAbility():GetCastRange(self:GetCaster(), self:GetCaster():GetAbsOrigin())
self:GetAbility():GetCooldown()
end
end
function modifier_imba_juggernaut_blade_dance_wind_dance:OnRemoved()
self:GetAbility().GetBehavior = function() return DOTA_ABILITY_BEHAVIOR_PASSIVE end
self:GetAbility():GetBehavior()
self:GetAbility():GetCastRange(self:GetCaster():GetAbsOrigin(), self:GetCaster())
self:GetAbility():GetCooldown()
end
function modifier_imba_juggernaut_blade_dance_wind_dance:DeclareFunctions()
funcs = {
MODIFIER_PROPERTY_STATS_AGILITY_BONUS,
MODIFIER_PROPERTY_MOVESPEED_BONUS_PERCENTAGE
}
return funcs
end
function modifier_imba_juggernaut_blade_dance_wind_dance:GetModifierMoveSpeedBonus_Percentage()
return self.ms * self:GetStackCount()
end
function modifier_imba_juggernaut_blade_dance_wind_dance:GetModifierBonusStats_Agility()
return self.agi * self:GetStackCount()
end
-- OMNI SLASH --
imba_juggernaut_omni_slash = imba_juggernaut_omni_slash or class({})
function imba_juggernaut_omni_slash:IsNetherWardStealable() return false end
function imba_juggernaut_omni_slash:GetIntrinsicModifierName()
return "modifier_imba_juggernaut_omni_slash_cdr"
end
function imba_juggernaut_omni_slash:IsHiddenWhenStolen()
return false
end
function imba_juggernaut_omni_slash:GetAbilityTextureName()
return "juggernaut_omni_slash"
end
function imba_juggernaut_omni_slash:OnAbilityPhaseStart()
local caster = self:GetCaster()
local rand = math.random
local im_the_juggernaut_lich = 10
local ryujinnokenwokurae = 10
if RollPercentage(im_the_juggernaut_lich) then
caster:EmitSound("juggernaut_jug_rare_17")
elseif RollPercentage(im_the_juggernaut_lich) then
caster:EmitSound("Imba.JuggernautGenji")
else
caster:EmitSound("juggernaut_jug_ability_omnislash_0"..rand(3))
end
return true
end
function imba_juggernaut_omni_slash:OnSpellStart()
local caster = self:GetCaster()
local target = self:GetCursorTarget()
local omnislash_modifier = caster:AddNewModifier(caster, self, "modifier_imba_omni_slash_caster", {})
self:SetActivated(false)
PlayerResource:SetCameraTarget(caster:GetPlayerID(), caster)
FindClearSpaceForUnit(caster, target:GetAbsOrigin() + RandomVector(128), false)
caster:EmitSound("Hero_Juggernaut.OmniSlash")
StartAnimation(caster, {activity = ACT_DOTA_OVERRIDE_ABILITY_4, rate = 1.0})
if target:TriggerSpellAbsorb(self) then
return nil
end
caster:PerformAttack(target, true, true, true, true, true, false, false)
end
LinkLuaModifier("modifier_imba_omni_slash_caster", "hero/hero_juggernaut", LUA_MODIFIER_MOTION_NONE)
modifier_imba_omni_slash_caster = modifier_imba_omni_slash_caster or class({})
function modifier_imba_omni_slash_caster:OnCreated( )
self.caster = self:GetCaster()
self.ability = self:GetAbility()
if not self.ability then
self:Destroy()
return nil
end
if not self.caster:HasScepter() then
self.bounce_range = self.ability:GetTalentSpecialValueFor("bounce_range")
self.bounce_amt = self.ability:GetTalentSpecialValueFor("jump_amount")
else
self.bounce_range = self.ability:GetTalentSpecialValueFor("scepter_bounce_range")
self.bounce_amt = self.ability:GetTalentSpecialValueFor("scepter_jump_amt")
end
if IsServer() then
self.ability:SetRefCountsModifiers(false)
self:StartIntervalThink(self.ability:GetSpecialValueFor("bounce_delay"))
end
end
function modifier_imba_omni_slash_caster:OnIntervalThink( )
self:BounceAndSlaughter()
end
function modifier_imba_omni_slash_caster:BounceAndSlaughter( )
self.nearby_enemies = FindUnitsInRadius( self.caster:GetTeamNumber(),
self.caster:GetAbsOrigin(),
nil,
self.bounce_range,
DOTA_UNIT_TARGET_TEAM_ENEMY,
DOTA_UNIT_TARGET_HERO + DOTA_UNIT_TARGET_CREEP,
DOTA_UNIT_TARGET_FLAG_MAGIC_IMMUNE_ENEMIES + DOTA_UNIT_TARGET_FLAG_NO_INVIS + DOTA_UNIT_TARGET_FLAG_FOW_VISIBLE + DOTA_UNIT_TARGET_FLAG_INVULNERABLE,
FIND_ANY_ORDER,
false)
if self.bounce_amt >= 1 and #self.nearby_enemies >= 1 then
for _,enemy in pairs(self.nearby_enemies) do
local previous_position = self.caster:GetAbsOrigin()
FindClearSpaceForUnit(self.caster, enemy:GetAbsOrigin() + RandomVector(128), false)
self.caster:MoveToTargetToAttack(enemy)
local current_position = self.caster:GetAbsOrigin()
-- Provide vision of the target for a short duration
self.ability:CreateVisibilityNode(current_position, 300, 1.0)
-- Perform the slash
self.caster:PerformAttack(enemy, true, true, true, true, true, false, false)
-- If the target is not Roshan or a hero, instantly kill it
if not ( enemy:IsHero() or IsRoshan(enemy) ) then
enemy:Kill(self.ability, self.caster)
end
-- Count down amount of slashes
self.bounce_amt = self.bounce_amt - 1
-- Play hit sound
enemy:EmitSound("Hero_Juggernaut.OmniSlash.Damage")
-- Play hit particle on the current target
local hit_pfx = ParticleManager:CreateParticle("particles/units/heroes/hero_juggernaut/juggernaut_omni_slash_tgt.vpcf", PATTACH_ABSORIGIN_FOLLOW, enemy)
ParticleManager:SetParticleControl(hit_pfx, 0, current_position)
ParticleManager:ReleaseParticleIndex(hit_pfx)
-- Play particle trail when moving
local trail_pfx = ParticleManager:CreateParticle("particles/units/heroes/hero_juggernaut/juggernaut_omni_slash_trail.vpcf", PATTACH_ABSORIGIN, self.caster)
ParticleManager:SetParticleControl(trail_pfx, 0, previous_position)
ParticleManager:SetParticleControl(trail_pfx, 1, current_position)
ParticleManager:ReleaseParticleIndex(trail_pfx)
break
end
else
self:Destroy()
end
end
function modifier_imba_omni_slash_caster:OnDestroy()
if IsServer() then
PlayerResource:SetCameraTarget(self.caster:GetPlayerID(), nil)
if self.bounce_amt > 1 then
local rand = RandomInt(1, 2)
self.caster:EmitSound("juggernaut_jug_ability_waste_0"..rand)
end
-- If jugg has stopped bouncing, stop the animation.
if self.bounce_amt == 0 or #self.nearby_enemies == 0 then
self.caster:FadeGesture(ACT_DOTA_OVERRIDE_ABILITY_4)
end
self.ability:SetActivated(true)
end
end
function modifier_imba_omni_slash_caster:CheckState()
local state = {
[MODIFIER_STATE_ROOTED] = true,
[MODIFIER_STATE_NO_UNIT_COLLISION] = true,
[MODIFIER_STATE_INVULNERABLE] = true,
[MODIFIER_STATE_NO_HEALTH_BAR] = true,
[MODIFIER_STATE_MAGIC_IMMUNE] = true,
}
return state
end
function modifier_imba_omni_slash_caster:StatusEffectPriority()
return 20
end
function modifier_imba_omni_slash_caster:GetStatusEffectName()
return "particles/status_fx/status_effect_omnislash.vpcf"
end
function modifier_imba_omni_slash_caster:IsHidden() return false end
function modifier_imba_omni_slash_caster:IsPurgable() return false end
function modifier_imba_omni_slash_caster:IsDebuff() return false end
LinkLuaModifier("modifier_imba_juggernaut_omni_slash_cdr", "hero/hero_juggernaut", LUA_MODIFIER_MOTION_NONE)
modifier_imba_juggernaut_omni_slash_cdr = modifier_imba_juggernaut_omni_slash_cdr or class({})
function modifier_imba_juggernaut_omni_slash_cdr:OnCreated()
self.caster = self:GetCaster()
self.ability = self:GetAbility()
self.cdr = self.ability:GetTalentSpecialValueFor("cdr_per_attack")
end
function modifier_imba_juggernaut_omni_slash_cdr:OnRefresh()
self.cdr = self.ability:GetTalentSpecialValueFor("cdr_per_attack")
end
function modifier_imba_juggernaut_omni_slash_cdr:IsHidden()
return true
end
function modifier_imba_juggernaut_omni_slash_cdr:DeclareFunctions()
funcs = {
MODIFIER_EVENT_ON_ATTACK_LANDED,
}
return funcs
end
function modifier_imba_juggernaut_omni_slash_cdr:OnAttackLanded(params) -- health handling
if params.attacker == self:GetParent() and params.target:IsRealHero() and not self.ability:IsCooldownReady() then
local cd = self.ability:GetCooldownTimeRemaining() - self.cdr
self.ability:EndCooldown()
self.ability:StartCooldown(cd)
end
end | mit |
kidaa/ffxinfinity | FFXI Server-Development/Build Files/scripts/globals/items/galkan_sausage_+2.lua | 3 | 1249 | -----------------------------------------
-- ID: 5860
-- Item: galkan_sausage_+2
-- Food Effect: 30Min, All Races
-----------------------------------------
-- Strength 5
-- Intelligence -6
-- Attack 11
-- Ranged Attack 11
-----------------------------------------
require("scripts/globals/status");
-----------------------------------------
-- OnItemCheck
-----------------------------------------
function onItemCheck(target)
local result = 0;
if (target:hasStatusEffect(EFFECT_FOOD) == true) then
result = 246;
end
return result;
end;
-----------------------------------------
-- OnItemUse
-----------------------------------------
function onItemUse(target)
target:addStatusEffect(EFFECT_FOOD,0,0,1800,5860);
end;
-----------------------------------
-- onEffectGain Action
-----------------------------------
function onEffectGain(target,effect)
target:addMod(MOD_STR, 5);
target:addMod(MOD_INT, -6);
target:addMod(MOD_ATT, 11);
target:addMod(MOD_RATT, 11);
end;
-----------------------------------------
-- onEffectLose Action
-----------------------------------------
function onEffectLose(target,effect)
target:delMod(MOD_STR, 5);
target:delMod(MOD_INT, -6);
target:delMod(MOD_ATT, 11);
target:delMod(MOD_RATT, 11);
end;
| gpl-3.0 |
kidaa/ffxinfinity | FFXI Server-Development/Build Files/scripts/zones/Port_Windurst/npcs/Goltata.lua | 4 | 1366 | -----------------------------------
-- Area: Port Windurst
-- NPC: Goltata
-- Involved in Quests: Wonder Wands
-- Working 100%
-----------------------------------
package.loaded["scripts/zones/Port_Windurst/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/quests");
require("scripts/globals/settings");
require("scripts/globals/titles");
require("scripts/globals/keyitems");
require("scripts/zones/Port_Windurst/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
WonderWands = player:getQuestStatus(WINDURST,WONDER_WANDS);
if(WonderWands == QUEST_ACCEPTED) then
player:startEvent(0x0101,0,0,17091);
elseif(WonderWands == QUEST_COMPLETED) then
player:startEvent(0x010d);
else
player:startEvent(0xe8);
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 |
bright-things/ionic-luci | applications/luci-app-pbx/luasrc/model/cbi/pbx-advanced.lua | 18 | 14476 | --[[
Copyright 2011 Iordan Iordanov <iiordanov (AT) gmail.com>
This file is part of luci-pbx.
luci-pbx 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 3 of the License, or
(at your option) any later version.
luci-pbx is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with luci-pbx. If not, see <http://www.gnu.org/licenses/>.
]]--
if nixio.fs.access("/etc/init.d/asterisk") then
server = "asterisk"
elseif nixio.fs.access("/etc/init.d/freeswitch") then
server = "freeswitch"
else
server = ""
end
appname = "PBX"
modulename = "pbx-advanced"
defaultbindport = 5060
defaultrtpstart = 19850
defaultrtpend = 19900
-- Returns all the network related settings, including a constructed RTP range
function get_network_info()
externhost = m.uci:get(modulename, "advanced", "externhost")
ipaddr = m.uci:get("network", "lan", "ipaddr")
bindport = m.uci:get(modulename, "advanced", "bindport")
rtpstart = m.uci:get(modulename, "advanced", "rtpstart")
rtpend = m.uci:get(modulename, "advanced", "rtpend")
if bindport == nil then bindport = defaultbindport end
if rtpstart == nil then rtpstart = defaultrtpstart end
if rtpend == nil then rtpend = defaultrtpend end
if rtpstart == nil or rtpend == nil then
rtprange = nil
else
rtprange = rtpstart .. "-" .. rtpend
end
return bindport, rtprange, ipaddr, externhost
end
-- If not present, insert empty rules in the given config & section named PBX-SIP and PBX-RTP
function insert_empty_sip_rtp_rules(config, section)
-- Add rules named PBX-SIP and PBX-RTP if not existing
found_sip_rule = false
found_rtp_rule = false
m.uci:foreach(config, section,
function(s1)
if s1._name == 'PBX-SIP' then
found_sip_rule = true
elseif s1._name == 'PBX-RTP' then
found_rtp_rule = true
end
end)
if found_sip_rule ~= true then
newrule=m.uci:add(config, section)
m.uci:set(config, newrule, '_name', 'PBX-SIP')
end
if found_rtp_rule ~= true then
newrule=m.uci:add(config, section)
m.uci:set(config, newrule, '_name', 'PBX-RTP')
end
end
-- Delete rules in the given config & section named PBX-SIP and PBX-RTP
function delete_sip_rtp_rules(config, section)
-- Remove rules named PBX-SIP and PBX-RTP
commit = false
m.uci:foreach(config, section,
function(s1)
if s1._name == 'PBX-SIP' or s1._name == 'PBX-RTP' then
m.uci:delete(config, s1['.name'])
commit = true
end
end)
-- If something changed, then we commit the config.
if commit == true then m.uci:commit(config) end
end
-- Deletes QoS rules associated with this PBX.
function delete_qos_rules()
delete_sip_rtp_rules ("qos", "classify")
end
function insert_qos_rules()
-- Insert empty PBX-SIP and PBX-RTP rules if not present.
insert_empty_sip_rtp_rules ("qos", "classify")
-- Get the network information
bindport, rtprange, ipaddr, externhost = get_network_info()
-- Iterate through the QoS rules, and if there is no other rule with the same port
-- range at the priority service level, insert this rule.
commit = false
m.uci:foreach("qos", "classify",
function(s1)
if s1._name == 'PBX-SIP' then
if s1.ports ~= bindport or s1.target ~= "Priority" or s1.proto ~= "udp" then
m.uci:set("qos", s1['.name'], "ports", bindport)
m.uci:set("qos", s1['.name'], "proto", "udp")
m.uci:set("qos", s1['.name'], "target", "Priority")
commit = true
end
elseif s1._name == 'PBX-RTP' then
if s1.ports ~= rtprange or s1.target ~= "Priority" or s1.proto ~= "udp" then
m.uci:set("qos", s1['.name'], "ports", rtprange)
m.uci:set("qos", s1['.name'], "proto", "udp")
m.uci:set("qos", s1['.name'], "target", "Priority")
commit = true
end
end
end)
-- If something changed, then we commit the qos config.
if commit == true then m.uci:commit("qos") end
end
-- This function is a (so far) unsuccessful attempt to manipulate the firewall rules from here
-- Need to do more testing and eventually move to this mode.
function maintain_firewall_rules()
-- Get the network information
bindport, rtprange, ipaddr, externhost = get_network_info()
commit = false
-- Only if externhost is set, do we control firewall rules.
if externhost ~= nil and bindport ~= nil and rtprange ~= nil then
-- Insert empty PBX-SIP and PBX-RTP rules if not present.
insert_empty_sip_rtp_rules ("firewall", "rule")
-- Iterate through the firewall rules, and if the dest_port and dest_ip setting of the\
-- SIP and RTP rule do not match what we want configured, set all the entries in the rule\
-- appropriately.
m.uci:foreach("firewall", "rule",
function(s1)
if s1._name == 'PBX-SIP' then
if s1.dest_port ~= bindport then
m.uci:set("firewall", s1['.name'], "dest_port", bindport)
m.uci:set("firewall", s1['.name'], "src", "wan")
m.uci:set("firewall", s1['.name'], "proto", "udp")
m.uci:set("firewall", s1['.name'], "target", "ACCEPT")
commit = true
end
elseif s1._name == 'PBX-RTP' then
if s1.dest_port ~= rtprange then
m.uci:set("firewall", s1['.name'], "dest_port", rtprange)
m.uci:set("firewall", s1['.name'], "src", "wan")
m.uci:set("firewall", s1['.name'], "proto", "udp")
m.uci:set("firewall", s1['.name'], "target", "ACCEPT")
commit = true
end
end
end)
else
-- We delete the firewall rules if one or more of the necessary parameters are not set.
sip_rule_name=nil
rtp_rule_name=nil
-- First discover the configuration names of the rules.
m.uci:foreach("firewall", "rule",
function(s1)
if s1._name == 'PBX-SIP' then
sip_rule_name = s1['.name']
elseif s1._name == 'PBX-RTP' then
rtp_rule_name = s1['.name']
end
end)
-- Then, using the names, actually delete the rules.
if sip_rule_name ~= nil then
m.uci:delete("firewall", sip_rule_name)
commit = true
end
if rtp_rule_name ~= nil then
m.uci:delete("firewall", rtp_rule_name)
commit = true
end
end
-- If something changed, then we commit the firewall config.
if commit == true then m.uci:commit("firewall") end
end
m = Map (modulename, translate("Advanced Settings"),
translate("This section contains settings that do not need to be changed under \
normal circumstances. In addition, here you can configure your system \
for use with remote SIP devices, and resolve call quality issues by enabling \
the insertion of QoS rules."))
-- Recreate the voip server config, and restart necessary services after changes are commited
-- to the advanced configuration. The firewall must restart because of "Remote Usage".
function m.on_after_commit(self)
-- Make sure firewall rules are in place
maintain_firewall_rules()
-- If insertion of QoS rules is enabled
if m.uci:get(modulename, "advanced", "qos_enabled") == "yes" then
insert_qos_rules()
else
delete_qos_rules()
end
luci.sys.call("/etc/init.d/pbx-" .. server .. " restart 1\>/dev/null 2\>/dev/null")
luci.sys.call("/etc/init.d/" .. server .. " restart 1\>/dev/null 2\>/dev/null")
luci.sys.call("/etc/init.d/firewall restart 1\>/dev/null 2\>/dev/null")
end
-----------------------------------------------------------------------------
s = m:section(NamedSection, "advanced", "settings", translate("Advanced Settings"))
s.anonymous = true
s:tab("general", translate("General Settings"))
s:tab("remote_usage", translate("Remote Usage"),
translatef("You can use your SIP devices/softphones with this system from a remote location \
as well, as long as your Internet Service Provider gives you a public IP. \
You will be able to call other local users for free (e.g. other Analog Telephone Adapters (ATAs)) \
and use your VoIP providers to make calls as if you were local to the PBX. \
After configuring this tab, go back to where users are configured and see the new \
Server and Port setting you need to configure the remote SIP devices with. Please note that if this \
PBX is not running on your router/gateway, you will need to configure port forwarding (NAT) on your \
router/gateway. Please forward the ports below (SIP port and RTP range) to the IP address of the \
device running this PBX."))
s:tab("qos", translate("QoS Settings"),
translate("If you experience jittery or high latency audio during heavy downloads, you may want \
to enable QoS. QoS prioritizes traffic to and from your network for specified ports and IP \
addresses, resulting in better latency and throughput for sound in our case. If enabled below, \
a QoS rule for this service will be configured by the PBX automatically, but you must visit the \
QoS configuration page (Network->QoS) to configure other critical QoS settings like Download \
and Upload speed."))
ringtime = s:taboption("general", Value, "ringtime", translate("Number of Seconds to Ring"),
translate("Set the number of seconds to ring users upon incoming calls before hanging up \
or going to voicemail, if the voicemail is installed and enabled."))
ringtime.datatype = "port"
ringtime.default = 30
ua = s:taboption("general", Value, "useragent", translate("User Agent String"),
translate("This is the name that the VoIP server will use to identify itself when \
registering to VoIP (SIP) providers. Some providers require this to a specific \
string matching a hardware SIP device."))
ua.default = appname
h = s:taboption("remote_usage", Value, "externhost", translate("Domain/IP Address/Dynamic Domain"),
translate("You can enter your domain name, external IP address, or dynamic domain name here. \
The best thing to input is a static IP address. If your IP address is dynamic and it changes, \
your configuration will become invalid. Hence, it's recommended to set up Dynamic DNS in this case. \
and enter your Dynamic DNS hostname here. You can configure Dynamic DNS with the luci-app-ddns package."))
h.datatype = "host(0)"
p = s:taboption("remote_usage", Value, "bindport", translate("External SIP Port"),
translate("Pick a random port number between 6500 and 9500 for the service to listen on. \
Do not pick the standard 5060, because it is often subject to brute-force attacks. \
When finished, (1) click \"Save and Apply\", and (2) look in the \
\"SIP Device/Softphone Accounts\" section for updated Server and Port settings \
for your SIP Devices/Softphones."))
p.datatype = "port"
p = s:taboption("remote_usage", Value, "rtpstart", translate("RTP Port Range Start"),
translate("RTP traffic carries actual voice packets. This is the start of the port range \
that will be used for setting up RTP communication. It's usually OK to leave this \
at the default value."))
p.datatype = "port"
p.default = defaultrtpstart
p = s:taboption("remote_usage", Value, "rtpend", translate("RTP Port Range End"))
p.datatype = "port"
p.default = defaultrtpend
p = s:taboption("qos", ListValue, "qos_enabled", translate("Insert QoS Rules"))
p:value("yes", translate("Yes"))
p:value("no", translate("No"))
p.default = "yes"
return m
| apache-2.0 |
Sonicrich05/FFXI-Server | scripts/globals/items/party_egg.lua | 35 | 1260 | -----------------------------------------
-- ID: 4595
-- Item: party_egg
-- Food Effect: 60Min, All Races
-----------------------------------------
-- Health 25
-- Magic 25
-- Attack 5
-----------------------------------------
require("scripts/globals/status");
-----------------------------------------
-- OnItemCheck
-----------------------------------------
function onItemCheck(target)
local result = 0;
if (target:hasStatusEffect(EFFECT_FOOD) == true or target:hasStatusEffect(EFFECT_FIELD_SUPPORT_FOOD) == true) then
result = 246;
end
return result;
end;
-----------------------------------------
-- OnItemUse
-----------------------------------------
function onItemUse(target)
target:addStatusEffect(EFFECT_FOOD,0,0,3600,4595);
end;
-----------------------------------
-- onEffectGain Action
-----------------------------------
function onEffectGain(target,effect)
target:addMod(MOD_HP, 25);
target:addMod(MOD_MP, 25);
target:addMod(MOD_ATT, 5);
end;
-----------------------------------------
-- onEffectLose Action
-----------------------------------------
function onEffectLose(target,effect)
target:delMod(MOD_HP, 25);
target:delMod(MOD_MP, 25);
target:delMod(MOD_ATT, 5);
end;
| gpl-3.0 |
Sonicrich05/FFXI-Server | scripts/zones/Port_Bastok/npcs/Sugandhi.lua | 30 | 1587 | -----------------------------------
-- Area: Port Bastok
-- NPC: Sugandhi
-- Standard Merchant NPC
-----------------------------------
package.loaded["scripts/zones/Port_Bastok/TextIDs"] = nil;
require("scripts/zones/Port_Bastok/TextIDs");
require("scripts/globals/shop");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
player:showText(npc,SUGANDHI_SHOP_DIALOG);
local stock = {
0x4059, 5589,1, --Kukri
0x40A1, 21067,1, --Broadsword
0x4081, 11588,1, --Tuck
0x40AE, 61200,1, --Falchion
0x4052, 2182,2, --Knife
0x4099, 30960,2, --Mythril Sword
0x40A8, 4072,2, --Scimitar
0x4051, 147,3, --Bronze Knife
0x4015, 104,3, --Cat Baghnakhs
0x4097, 241,3, --Bronze Sword
0x4098, 7128,3, --Iron Sword
0x4085, 9201,3, --Degen
0x40A7, 698,3 --Sapara
}
showNationShop(player, BASTOK, 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 |
rayaman/multi | multi/integration/networkManager/serverSide.lua | 1 | 1787 | --[[
MIT License
Copyright (c) 2022 Ryan Ward
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sub-license, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
]]
local bin, bits = require("bin").init()
return function(self,data,client)
local cmd,data = data:match("!(.-)!(.*)")
--print("SERVER",cmd,data)
if cmd == "PING" then
self:send(client,"!PONG!")
elseif cmd == "N_THREAD" then
print(1)
local dat = bin.new(data)
print(2)
local t = dat:getBlock("t")
print(3)
local ret = bin.new()
print(4)
ret:addBlock{ID = t.id,rets = {t.func(unpack(t.args))}}
print(5)
print(client,"!RETURNS!"..ret:getData())
self:send(client,"!RETURNS!"..ret:getData())
print(6)
elseif cmd == "CHANNEL" then
local dat = bin.new(data):getBlock("t")
end
end | mit |
kidaa/ffxinfinity | FFXI Server-Development/Build Files/scripts/zones/Den_of_Rancor/npcs/_4g6.lua | 2 | 2613 | -----------------------------------
-- Area: Den of Rancor
-- NPC: Lantern (SE)
-- @pos -59 45 24 160
-----------------------------------
package.loaded["scripts/zones/Den_of_Rancor/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/settings");
require("scripts/zones/Den_of_Rancor/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
-- Trade Crimson Rancor Flame
if(trade:hasItemQty(1139,1) and trade:getItemCount() == 1) then
se = os.time() - GetServerVariable("[LANTERN]_rancor_se_last_lit");
if(se <= LANTERNS_STAY_LIT) then
player:messageSpecial(LANTERN_OFFSET + 7); -- the lantern is already lit
else
player:tradeComplete();
player:addItem(1138); -- Unlit Lantern
--GetNPCByID(17433045):lightFor(LANTERNS_STAY_LIT); -- Light the lantern for x sec
SetServerVariable("[LANTERN]_rancor_se_last_lit",os.time());
ne = os.time() - GetServerVariable("[LANTERN]_rancor_ne_last_lit");
nw = os.time() - GetServerVariable("[LANTERN]_rancor_nw_last_lit");
sw = os.time() - GetServerVariable("[LANTERN]_rancor_sw_last_lit");
number_of_lit_lanterns = 1;
if(ne <= LANTERNS_STAY_LIT) then
number_of_lit_lanterns = number_of_lit_lanterns + 1;
end
if(nw <= LANTERNS_STAY_LIT) then
number_of_lit_lanterns = number_of_lit_lanterns + 1;
end
if(sw <= LANTERNS_STAY_LIT) then
number_of_lit_lanterns = number_of_lit_lanterns + 1;
end;
if(number_of_lit_lanterns == 1) then
player:messageSpecial(LANTERN_OFFSET + 9); -- the first lantern is lit
elseif(number_of_lit_lanterns == 2) then
player:messageSpecial(LANTERN_OFFSET + 10); -- the second lantern is lit
elseif(number_of_lit_lanterns == 3) then
player:messageSpecial(LANTERN_OFFSET + 11); -- the third lantern is lit
elseif(number_of_lit_lanterns == 4) then
player:messageSpecial(LANTERN_OFFSET + 12); -- All the lanterns are lit
timeGateOpened = math.min(LANTERNS_STAY_LIT - ne,LANTERNS_STAY_LIT - nw,LANTERNS_STAY_LIT - sw);
GetNPCByID(17433049):openDoor(timeGateOpened); -- drop gate to Sacrificial Chamber
end;
end
end
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
se = os.time() - GetServerVariable("[LANTERN]_rancor_se_last_lit");
if(se <= LANTERNS_STAY_LIT) then
player:messageSpecial(LANTERN_OFFSET + 7); -- The lantern is already lit.
else
player:messageSpecial(LANTERN_OFFSET + 20); -- The flames of rancor have burned out.
end
return 0;
end; | gpl-3.0 |
LPGhatguy/lemur | lib/types/Color3.lua | 1 | 2859 | local assign = import("../assign")
local typeKey = import("../typeKey")
local function lerpNumber(a, b, alpha)
return (1 - alpha) * a + b * alpha
end
local Color3 = {}
setmetatable(Color3, {
__tostring = function()
return "Color3"
end,
})
local prototype = {}
function prototype:lerp(goal, alpha)
return Color3.new(
lerpNumber(self.r, goal.r, alpha),
lerpNumber(self.g, goal.g, alpha),
lerpNumber(self.b, goal.b, alpha)
)
end
local metatable = {}
metatable[typeKey] = "Color3"
function metatable:__index(key)
local internal = getmetatable(self).internal
if internal[key] ~= nil then
return internal[key]
end
if prototype[key] ~= nil then
return prototype[key]
end
error(string.format("%s is not a valid member of Color3", tostring(key)), 2)
end
function metatable:__eq(other)
return self.r == other.r and self.g == other.g and self.b == other.b
end
function Color3.new(...)
if select("#", ...) == 0 then
return Color3.new(0, 0, 0)
end
local r, g, b = ...
local internalInstance = {
r = r,
g = g,
b = b,
}
local instance = newproxy(true)
assign(getmetatable(instance), metatable)
getmetatable(instance).internal = internalInstance
return instance
end
function Color3.fromRGB(r, g, b)
return Color3.new(r / 255, g / 255, b / 255)
end
function Color3.fromHSV(h, s, v)
-- Convert h to a 360-degree value (inputs as between 0 and 1)
h = h * 360
-- Sector of the HSV color space (there are 6) that the hue falls in
local sector = h / 60
local chroma = s * v
local x = chroma * (1 - math.abs(sector % 2 - 1))
local m = v - chroma
local r, g, b
if sector >= 0 and sector <= 1 then
r, g, b = chroma, x, 0
elseif sector >= 1 and sector <= 2 then
r, g, b = x, chroma, 0
elseif sector >= 2 and sector <= 3 then
r, g, b = 0, chroma, x
elseif sector >= 3 and sector <= 4 then
r, g, b = 0, x, chroma
elseif sector >= 4 and sector <= 5 then
r, g, b = x, 0, chroma
elseif sector >= 5 and sector < 6 then
r, g, b = chroma, 0, x
else
-- Return a default value of 0, 0, 0. This will happen if h is not between 0 and 1.
return Color3.new(0, 0, 0)
end
return Color3.new(r + m, g + m, b + m)
end
function Color3.toHSV(color)
local minComponent = math.min(color.r, color.g, color.b)
local maxComponent = math.max(color.r, color.g, color.b)
-- Grayscale color.
-- Hue and saturation are 0; value is equal to the RGB value.
if minComponent == maxComponent then
return 0, 0, minComponent
end
local delta = maxComponent - minComponent
local hue
local saturation = delta / maxComponent
local value = maxComponent
if color.r == maxComponent then
hue = (color.g - color.b) / delta
elseif color.g == maxComponent then
hue = 2 + (color.b - color.r) / delta
else
hue = 4 + (color.r - color.g) / delta
end
return (hue * 60) / 360, saturation, value
end
return Color3
| mit |
Servius/tfa-sw-weapons-repository | Live Addons/servius_uploader_legacy/tfa_shared_resources/lua/effects/rw_sw_dual_laser_red.lua | 2 | 4228 | TRACER_FLAG_USEATTACHMENT = 0x0002
SOUND_FROM_WORLD = 0
CHAN_STATIC = 6
EFFECT.Life = 1
EFFECT.Speed = 16384
EFFECT.Length = 175
--EFFECT.WhizSound = Sound( "nomad/whiz.wav" ); -- by Robinhood76 (http:--www.freesound.org/people/Robinhood76/sounds/96556/)
EFFECT.WhizDistance = 72
local MaterialMain = Material("effects/sw_laser_red_main")
local MaterialFront = Material("effects/sw_laser_red_front")
local DynamicTracer = GetConVar("cl_dynamic_tracer")
function EFFECT:Init(data)
self.Position = data:GetStart()
self.WeaponEnt = data:GetEntity()
self.WeaponEntOG = data:GetEntity()
self.Attachment = data:GetAttachment()
local owent
if IsValid(self.WeaponEnt) then
owent = self.WeaponEnt.Owner or self.WeaponEnt:GetOwner()
if not IsValid(owent) then
owent = self.WeaponEnt:GetParent()
end
end
if IsValid(owent) and owent:IsPlayer() then
if owent ~= LocalPlayer() or owent:ShouldDrawLocalPlayer() then
self.WeaponEnt = owent:GetActiveWeapon()
if not IsValid(self.WeaponEnt) then return end
else
self.WeaponEnt = owent:GetViewModel()
local theirweapon = owent:GetActiveWeapon()
if IsValid(theirweapon) and theirweapon.ViewModelFlip or theirweapon.ViewModelFlipped then
self.Flipped = true
end
if not IsValid(self.WeaponEnt) then return end
end
end
if IsValid(self.WeaponEntOG) and self.WeaponEntOG.MuzzleAttachment then
self.Attachment = self.WeaponEnt:LookupAttachment(self.WeaponEntOG.MuzzleAttachment)
if not self.Attachment or self.Attachment <= 0 then
self.Attachment = 1
end
if self.WeaponEntOG.Akimbo then
if game.SinglePlayer() then
self.WeaponEntOG.AnimCycle = self.WeaponEntOG:GetNW2Int("AnimCycle") or 0
end
self.Attachment = 1 + self.WeaponEntOG.AnimCycle
end
end
local angpos
if IsValid(self.WeaponEnt) then
angpos = self.WeaponEnt:GetAttachment(self.Attachment)
end
if not angpos or not angpos.Pos then
angpos = {
Pos = bvec,
Ang = uAng
}
end
if self.Flipped then
local tmpang = (self.Dir or angpos.Ang:Forward()):Angle()
local localang = self.WeaponEnt:WorldToLocalAngles(tmpang)
localang.y = localang.y + 180
localang = self.WeaponEnt:LocalToWorldAngles(localang)
--localang:RotateAroundAxis(localang:Up(),180)
--tmpang:RotateAroundAxis(tmpang:Up(),180)
self.Dir = localang:Forward()
end
-- Keep the start and end Pos - we're going to interpolate between them
if IsValid(owent) and self.Position:Distance(owent:GetShootPos()) > 72 then
self.WeaponEnt = nil
end
self.StartPos = self:GetTracerShootPos(self.WeaponEnt and angpos.Pos or self.Position, self.WeaponEnt, self.Attachment)
self.EndPos = data:GetOrigin()
self.Entity:SetRenderBoundsWS(self.StartPos, self.EndPos)
self.Normal = (self.EndPos - self.StartPos):GetNormalized()
self.StartTime = 0
self.LifeTime = self.Life
self.data = data
self.rot = nil
weapon = data:GetEntity()
if (IsValid(weapon) and (not weapon:IsWeapon() or not weapon:IsCarriedByLocalPlayer())) then
local dist, pos, time = util.DistanceToLine(self.StartPos, self.EndPos, EyePos())
end
end
function EFFECT:Think()
self.LifeTime = self.LifeTime - FrameTime()
self.StartTime = self.StartTime + FrameTime()
if DynamicTracer:GetBool() then
local spawn = util.CRC(tostring(self:GetPos()))
local dlight = DynamicLight(self:EntIndex() + spawn)
local endDistance = self.Speed * self.StartTime
local endPos = self.StartPos + self.Normal * endDistance
if (dlight) then
dlight.pos = endPos
dlight.r = 255
dlight.g = 0
dlight.b = 0
dlight.brightness = 5
dlight.Decay = 1000
dlight.Size = 200
dlight.nomodel = 1
dlight.style = 6
dlight.DieTime = CurTime() + 3
end
end
return self.LifeTime > 0
end
function EFFECT:Render()
local endDistance = self.Speed * self.StartTime
local startDistance = endDistance - self.Length
startDistance = math.max(0, startDistance)
endDistance = math.max(0, endDistance)
local startPos = self.StartPos + self.Normal * startDistance
local endPos = self.StartPos + self.Normal * endDistance
render.SetMaterial(MaterialFront)
render.DrawSprite(endPos, 8, 8, color_white)
render.SetMaterial(MaterialMain)
render.DrawBeam(startPos, endPos, 10, 0, 1, color_white)
end | apache-2.0 |
behradhg/TeleNfs | plugins/pin.lua | 1 | 2755 | do
local function run(msg, matches)
if msg.to.type == 'user' then return end
local chat_id, user_id = msg.to.id,msg.from.id
local phash = 'pin' .. chat_id
local pin_id = redis:get(phash)
if matches[2] then
if pin_id then --try to edit the old message
td.editMessageText(chat_id, pin_id, nil, matches[2], 1, 'HTML', function(a, d)
if d.ID == "Error" then
local text = _("The old message generated with `!pin` does not exist anymore, so I can't edit it. This is the new message that can be now pinned")
reply_msg(msg.id, a.msg_id, ok_cb, true)
reply_msg(msg.id, a.message, ok_cb, true)
else
reply_msg(pin_id, _("Message edited. Check it here."), ok_cb, true)
end
end, {msg_id = msg.id_, message = matches[2]})
else
local text = _('*No message has been pinned for group. Reply these message with* `!pin` to pin it.')
td.sendText(tonumber(msg.to.id), 0, 1, 0, nil, matches[2], 0, 'html', nil, cmd)
td.sendText(tonumber(msg.to.id), msg.id, 1, 0, nil, text, 0, 'md', ok_cb, cmd)
end
else
if msg.reply_id then
td.pinChannelMessage(chat_id, msg.reply_id, 0)
redis:set(phash, msg.reply_id)
local text = _('This message is now pinned. Use `!pin [new text]` to edit it without having to send it again')
reply_msg(msg.reply_id, text, ok_cb, true)
else
if pin_id then
if matches[1] == 'unpin' then
redis:del(phash)
td.unpinChannelMessage(chat_id)
td.deleteMessages(chat_id, {[0] = pin_id})
return _('Pinned message has been unpinned.')
else
td.getMessage(chat_id, pin_id, function(a, d)
if d.ID == "Error" then
local text = _("The pinned message does not exist anymore.")
reply_msg(msg.id, text, ok_cb, true)
else
local text = _('Last message generated by `!pin` 👆')
reply_msg(msg.id, text, ok_cb, true)
end
end, {chat_id = chat_id, msg_id = msg.id, pin_id = pin_id})
end
else
local text = _('No message has been pinned for group. Reply a message with `!pin` to pin it.')
reply_msg(msg.id, text, ok_cb, true)
end
end
end
end
return {
description = 'Pin a message.',
usage = {
'`!pin`',
'Pin a replied message.',
'',
'`!pin [text]`',
'Edit an existing pinned message if exist.',
'',
'`!pin`',
'Show the pinned message.',
'',
},
patterns = {
'^(pin)$',
'^(pin) (.*)$',
'^(unpin)$',
},
run = run
}
end
| gpl-3.0 |
Sonicrich05/FFXI-Server | scripts/zones/Arrapago_Reef/Zone.lua | 20 | 1927 | -----------------------------------
--
-- Zone: Arrapago_Reef (54)
--
-----------------------------------
package.loaded["scripts/zones/Arrapago_Reef/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/settings");
require("scripts/zones/Arrapago_Reef/TextIDs");
-----------------------------------
-- onInitialize
-----------------------------------
function onInitialize(zone)
zone:registerRegion(1,-462,-4,-420,-455,-1,-392);
end;
-----------------------------------
-- onZoneIn
-----------------------------------
function onZoneIn(player,prevZone)
local cs = -1;
if (player:getXPos() == 0 and player:getYPos() == 0 and player:getZPos() == 0) then
player:setPos(-180.028,-10.335,-559.987,182);
end
return cs;
end;
-----------------------------------
-- afterZoneIn
-----------------------------------
function afterZoneIn(player)
player:entityVisualPacket("1pb1");
player:entityVisualPacket("2pb1");
end;
-----------------------------------
-- onRegionEnter
-----------------------------------
function onRegionEnter(player,region)
if (player:getCurrentMission(TOAU) == THE_BLACK_COFFIN and player:hasKeyItem(EPHRAMADIAN_GOLD_COIN) and player:getVar("TOAUM15") ==0) then
player:startEvent(0x0008);
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 == 0x0008) then
player:setVar("TOAUM15",1);
player:delKeyItem(EPHRAMADIAN_GOLD_COIN);
player:startEvent(0x0022,1,1,1,1,1,1,1,1);
elseif (csid == 0x0022 and player:getVar("TOAUM15") == 1) then
player:startEvent(0x0023);
end
end; | gpl-3.0 |
RavenX8/osIROSE-new | scripts/mobs/ai/candle_ghost.lua | 2 | 28242 | registerNpc(251, {
walk_speed = 150,
run_speed = 350,
scale = 90,
r_weapon = 1076,
l_weapon = 0,
level = 48,
hp = 22,
attack = 195,
hit = 126,
def = 97,
res = 168,
avoid = 73,
attack_spd = 100,
is_magic_damage = 1,
ai_type = 18,
give_exp = 42,
drop_type = 0,
drop_money = 1,
drop_item = 40,
union_number = 40,
need_summon_count = 0,
sell_tab0 = 0,
sell_tab1 = 0,
sell_tab2 = 0,
sell_tab3 = 0,
can_target = 0,
attack_range = 800,
npc_type = 7,
hit_material_type = 1,
face_icon = 0,
summon_mob_type = 0,
quest_type = 0,
height = 0
});
registerNpc(711, {
walk_speed = 130,
run_speed = 440,
scale = 95,
r_weapon = 1076,
l_weapon = 0,
level = 19,
hp = 19,
attack = 60,
hit = 87,
def = 47,
res = 74,
avoid = 38,
attack_spd = 100,
is_magic_damage = 1,
ai_type = 36,
give_exp = 33,
drop_type = 0,
drop_money = 55,
drop_item = 10,
union_number = 10,
need_summon_count = 0,
sell_tab0 = 0,
sell_tab1 = 0,
sell_tab2 = 0,
sell_tab3 = 0,
can_target = 0,
attack_range = 800,
npc_type = 0,
hit_material_type = 1,
face_icon = 0,
summon_mob_type = 0,
quest_type = 0,
height = 0
});
registerNpc(712, {
walk_speed = 134,
run_speed = 452,
scale = 100,
r_weapon = 1076,
l_weapon = 0,
level = 23,
hp = 19,
attack = 73,
hit = 94,
def = 55,
res = 84,
avoid = 43,
attack_spd = 100,
is_magic_damage = 1,
ai_type = 36,
give_exp = 37,
drop_type = 0,
drop_money = 56,
drop_item = 10,
union_number = 10,
need_summon_count = 0,
sell_tab0 = 0,
sell_tab1 = 0,
sell_tab2 = 0,
sell_tab3 = 0,
can_target = 0,
attack_range = 830,
npc_type = 0,
hit_material_type = 1,
face_icon = 0,
summon_mob_type = 0,
quest_type = 0,
height = 0
});
registerNpc(713, {
walk_speed = 138,
run_speed = 464,
scale = 105,
r_weapon = 1076,
l_weapon = 0,
level = 27,
hp = 19,
attack = 86,
hit = 100,
def = 62,
res = 94,
avoid = 48,
attack_spd = 100,
is_magic_damage = 1,
ai_type = 36,
give_exp = 39,
drop_type = 0,
drop_money = 57,
drop_item = 10,
union_number = 10,
need_summon_count = 0,
sell_tab0 = 0,
sell_tab1 = 0,
sell_tab2 = 0,
sell_tab3 = 0,
can_target = 0,
attack_range = 860,
npc_type = 0,
hit_material_type = 1,
face_icon = 0,
summon_mob_type = 0,
quest_type = 0,
height = 0
});
registerNpc(714, {
walk_speed = 142,
run_speed = 476,
scale = 110,
r_weapon = 1076,
l_weapon = 0,
level = 31,
hp = 19,
attack = 99,
hit = 107,
def = 71,
res = 104,
avoid = 53,
attack_spd = 100,
is_magic_damage = 1,
ai_type = 36,
give_exp = 42,
drop_type = 0,
drop_money = 58,
drop_item = 10,
union_number = 10,
need_summon_count = 0,
sell_tab0 = 0,
sell_tab1 = 0,
sell_tab2 = 0,
sell_tab3 = 0,
can_target = 0,
attack_range = 890,
npc_type = 0,
hit_material_type = 1,
face_icon = 0,
summon_mob_type = 0,
quest_type = 0,
height = 0
});
registerNpc(715, {
walk_speed = 146,
run_speed = 488,
scale = 115,
r_weapon = 1076,
l_weapon = 0,
level = 35,
hp = 20,
attack = 113,
hit = 114,
def = 79,
res = 115,
avoid = 58,
attack_spd = 100,
is_magic_damage = 1,
ai_type = 36,
give_exp = 47,
drop_type = 0,
drop_money = 59,
drop_item = 10,
union_number = 10,
need_summon_count = 0,
sell_tab0 = 0,
sell_tab1 = 0,
sell_tab2 = 0,
sell_tab3 = 0,
can_target = 0,
attack_range = 920,
npc_type = 0,
hit_material_type = 1,
face_icon = 0,
summon_mob_type = 0,
quest_type = 0,
height = 0
});
registerNpc(716, {
walk_speed = 150,
run_speed = 500,
scale = 120,
r_weapon = 1076,
l_weapon = 0,
level = 39,
hp = 20,
attack = 126,
hit = 121,
def = 88,
res = 126,
avoid = 63,
attack_spd = 100,
is_magic_damage = 1,
ai_type = 36,
give_exp = 50,
drop_type = 0,
drop_money = 60,
drop_item = 9,
union_number = 9,
need_summon_count = 0,
sell_tab0 = 0,
sell_tab1 = 0,
sell_tab2 = 0,
sell_tab3 = 0,
can_target = 0,
attack_range = 950,
npc_type = 0,
hit_material_type = 1,
face_icon = 0,
summon_mob_type = 0,
quest_type = 0,
height = 0
});
registerNpc(717, {
walk_speed = 154,
run_speed = 512,
scale = 125,
r_weapon = 1076,
l_weapon = 0,
level = 43,
hp = 21,
attack = 140,
hit = 128,
def = 97,
res = 137,
avoid = 68,
attack_spd = 100,
is_magic_damage = 1,
ai_type = 37,
give_exp = 53,
drop_type = 0,
drop_money = 61,
drop_item = 9,
union_number = 9,
need_summon_count = 0,
sell_tab0 = 0,
sell_tab1 = 0,
sell_tab2 = 0,
sell_tab3 = 0,
can_target = 0,
attack_range = 980,
npc_type = 0,
hit_material_type = 1,
face_icon = 0,
summon_mob_type = 0,
quest_type = 0,
height = 0
});
registerNpc(718, {
walk_speed = 158,
run_speed = 524,
scale = 130,
r_weapon = 1076,
l_weapon = 0,
level = 47,
hp = 21,
attack = 155,
hit = 136,
def = 107,
res = 149,
avoid = 73,
attack_spd = 100,
is_magic_damage = 1,
ai_type = 37,
give_exp = 59,
drop_type = 0,
drop_money = 62,
drop_item = 9,
union_number = 9,
need_summon_count = 0,
sell_tab0 = 0,
sell_tab1 = 0,
sell_tab2 = 0,
sell_tab3 = 0,
can_target = 0,
attack_range = 1010,
npc_type = 0,
hit_material_type = 1,
face_icon = 0,
summon_mob_type = 0,
quest_type = 0,
height = 0
});
registerNpc(719, {
walk_speed = 162,
run_speed = 536,
scale = 135,
r_weapon = 1076,
l_weapon = 0,
level = 51,
hp = 21,
attack = 169,
hit = 143,
def = 116,
res = 161,
avoid = 78,
attack_spd = 100,
is_magic_damage = 1,
ai_type = 37,
give_exp = 61,
drop_type = 0,
drop_money = 63,
drop_item = 9,
union_number = 9,
need_summon_count = 0,
sell_tab0 = 0,
sell_tab1 = 0,
sell_tab2 = 0,
sell_tab3 = 0,
can_target = 0,
attack_range = 1040,
npc_type = 0,
hit_material_type = 1,
face_icon = 0,
summon_mob_type = 0,
quest_type = 0,
height = 0
});
registerNpc(720, {
walk_speed = 166,
run_speed = 548,
scale = 140,
r_weapon = 1076,
l_weapon = 0,
level = 55,
hp = 22,
attack = 184,
hit = 151,
def = 126,
res = 173,
avoid = 84,
attack_spd = 100,
is_magic_damage = 1,
ai_type = 37,
give_exp = 65,
drop_type = 0,
drop_money = 64,
drop_item = 9,
union_number = 9,
need_summon_count = 0,
sell_tab0 = 0,
sell_tab1 = 0,
sell_tab2 = 0,
sell_tab3 = 0,
can_target = 0,
attack_range = 1070,
npc_type = 0,
hit_material_type = 1,
face_icon = 0,
summon_mob_type = 0,
quest_type = 0,
height = 0
});
registerNpc(721, {
walk_speed = 130,
run_speed = 440,
scale = 145,
r_weapon = 1076,
l_weapon = 0,
level = 59,
hp = 22,
attack = 199,
hit = 158,
def = 137,
res = 186,
avoid = 89,
attack_spd = 100,
is_magic_damage = 1,
ai_type = 37,
give_exp = 67,
drop_type = 0,
drop_money = 65,
drop_item = 8,
union_number = 8,
need_summon_count = 0,
sell_tab0 = 0,
sell_tab1 = 0,
sell_tab2 = 0,
sell_tab3 = 0,
can_target = 0,
attack_range = 1300,
npc_type = 0,
hit_material_type = 1,
face_icon = 0,
summon_mob_type = 0,
quest_type = 0,
height = 0
});
registerNpc(722, {
walk_speed = 134,
run_speed = 452,
scale = 150,
r_weapon = 1076,
l_weapon = 0,
level = 63,
hp = 23,
attack = 214,
hit = 166,
def = 148,
res = 198,
avoid = 95,
attack_spd = 100,
is_magic_damage = 1,
ai_type = 37,
give_exp = 71,
drop_type = 0,
drop_money = 66,
drop_item = 8,
union_number = 8,
need_summon_count = 0,
sell_tab0 = 0,
sell_tab1 = 0,
sell_tab2 = 0,
sell_tab3 = 0,
can_target = 0,
attack_range = 1330,
npc_type = 0,
hit_material_type = 1,
face_icon = 0,
summon_mob_type = 0,
quest_type = 0,
height = 0
});
registerNpc(723, {
walk_speed = 138,
run_speed = 464,
scale = 155,
r_weapon = 1076,
l_weapon = 0,
level = 67,
hp = 23,
attack = 229,
hit = 174,
def = 159,
res = 211,
avoid = 101,
attack_spd = 100,
is_magic_damage = 1,
ai_type = 38,
give_exp = 74,
drop_type = 0,
drop_money = 67,
drop_item = 8,
union_number = 8,
need_summon_count = 0,
sell_tab0 = 0,
sell_tab1 = 0,
sell_tab2 = 0,
sell_tab3 = 0,
can_target = 0,
attack_range = 1360,
npc_type = 0,
hit_material_type = 1,
face_icon = 0,
summon_mob_type = 0,
quest_type = 0,
height = 0
});
registerNpc(724, {
walk_speed = 142,
run_speed = 476,
scale = 160,
r_weapon = 1076,
l_weapon = 0,
level = 71,
hp = 23,
attack = 245,
hit = 182,
def = 170,
res = 225,
avoid = 106,
attack_spd = 100,
is_magic_damage = 1,
ai_type = 38,
give_exp = 80,
drop_type = 0,
drop_money = 68,
drop_item = 8,
union_number = 8,
need_summon_count = 0,
sell_tab0 = 0,
sell_tab1 = 0,
sell_tab2 = 0,
sell_tab3 = 0,
can_target = 0,
attack_range = 1390,
npc_type = 0,
hit_material_type = 1,
face_icon = 0,
summon_mob_type = 0,
quest_type = 0,
height = 0
});
registerNpc(725, {
walk_speed = 146,
run_speed = 488,
scale = 165,
r_weapon = 1076,
l_weapon = 0,
level = 75,
hp = 24,
attack = 260,
hit = 190,
def = 182,
res = 238,
avoid = 112,
attack_spd = 100,
is_magic_damage = 1,
ai_type = 38,
give_exp = 85,
drop_type = 0,
drop_money = 69,
drop_item = 8,
union_number = 8,
need_summon_count = 0,
sell_tab0 = 0,
sell_tab1 = 0,
sell_tab2 = 0,
sell_tab3 = 0,
can_target = 0,
attack_range = 1420,
npc_type = 0,
hit_material_type = 1,
face_icon = 0,
summon_mob_type = 0,
quest_type = 0,
height = 0
});
registerNpc(726, {
walk_speed = 150,
run_speed = 500,
scale = 170,
r_weapon = 1076,
l_weapon = 0,
level = 79,
hp = 24,
attack = 276,
hit = 199,
def = 194,
res = 252,
avoid = 118,
attack_spd = 100,
is_magic_damage = 1,
ai_type = 38,
give_exp = 88,
drop_type = 0,
drop_money = 70,
drop_item = 7,
union_number = 7,
need_summon_count = 0,
sell_tab0 = 0,
sell_tab1 = 0,
sell_tab2 = 0,
sell_tab3 = 0,
can_target = 0,
attack_range = 1450,
npc_type = 0,
hit_material_type = 1,
face_icon = 0,
summon_mob_type = 0,
quest_type = 0,
height = 0
});
registerNpc(727, {
walk_speed = 154,
run_speed = 512,
scale = 175,
r_weapon = 1076,
l_weapon = 0,
level = 83,
hp = 25,
attack = 292,
hit = 207,
def = 206,
res = 266,
avoid = 124,
attack_spd = 100,
is_magic_damage = 1,
ai_type = 38,
give_exp = 96,
drop_type = 0,
drop_money = 71,
drop_item = 7,
union_number = 7,
need_summon_count = 0,
sell_tab0 = 0,
sell_tab1 = 0,
sell_tab2 = 0,
sell_tab3 = 0,
can_target = 0,
attack_range = 1480,
npc_type = 0,
hit_material_type = 1,
face_icon = 0,
summon_mob_type = 0,
quest_type = 0,
height = 0
});
registerNpc(728, {
walk_speed = 158,
run_speed = 524,
scale = 180,
r_weapon = 1076,
l_weapon = 0,
level = 87,
hp = 25,
attack = 309,
hit = 216,
def = 219,
res = 281,
avoid = 130,
attack_spd = 100,
is_magic_damage = 1,
ai_type = 38,
give_exp = 100,
drop_type = 0,
drop_money = 72,
drop_item = 7,
union_number = 7,
need_summon_count = 0,
sell_tab0 = 0,
sell_tab1 = 0,
sell_tab2 = 0,
sell_tab3 = 0,
can_target = 0,
attack_range = 1510,
npc_type = 0,
hit_material_type = 1,
face_icon = 0,
summon_mob_type = 0,
quest_type = 0,
height = 0
});
registerNpc(729, {
walk_speed = 162,
run_speed = 536,
scale = 185,
r_weapon = 1076,
l_weapon = 0,
level = 91,
hp = 25,
attack = 325,
hit = 224,
def = 232,
res = 295,
avoid = 137,
attack_spd = 100,
is_magic_damage = 1,
ai_type = 39,
give_exp = 103,
drop_type = 0,
drop_money = 73,
drop_item = 7,
union_number = 7,
need_summon_count = 0,
sell_tab0 = 0,
sell_tab1 = 0,
sell_tab2 = 0,
sell_tab3 = 0,
can_target = 0,
attack_range = 1540,
npc_type = 0,
hit_material_type = 1,
face_icon = 0,
summon_mob_type = 0,
quest_type = 0,
height = 0
});
registerNpc(730, {
walk_speed = 166,
run_speed = 548,
scale = 190,
r_weapon = 1076,
l_weapon = 0,
level = 95,
hp = 26,
attack = 342,
hit = 233,
def = 246,
res = 310,
avoid = 143,
attack_spd = 100,
is_magic_damage = 1,
ai_type = 39,
give_exp = 113,
drop_type = 0,
drop_money = 74,
drop_item = 7,
union_number = 7,
need_summon_count = 0,
sell_tab0 = 0,
sell_tab1 = 0,
sell_tab2 = 0,
sell_tab3 = 0,
can_target = 0,
attack_range = 1570,
npc_type = 0,
hit_material_type = 1,
face_icon = 0,
summon_mob_type = 0,
quest_type = 0,
height = 0
});
registerNpc(731, {
walk_speed = 130,
run_speed = 440,
scale = 195,
r_weapon = 1076,
l_weapon = 0,
level = 99,
hp = 26,
attack = 359,
hit = 242,
def = 259,
res = 325,
avoid = 149,
attack_spd = 100,
is_magic_damage = 1,
ai_type = 39,
give_exp = 110,
drop_type = 0,
drop_money = 75,
drop_item = 7,
union_number = 7,
need_summon_count = 0,
sell_tab0 = 0,
sell_tab1 = 0,
sell_tab2 = 0,
sell_tab3 = 0,
can_target = 0,
attack_range = 1300,
npc_type = 0,
hit_material_type = 1,
face_icon = 0,
summon_mob_type = 0,
quest_type = 0,
height = 0
});
registerNpc(732, {
walk_speed = 134,
run_speed = 452,
scale = 200,
r_weapon = 1076,
l_weapon = 0,
level = 103,
hp = 26,
attack = 376,
hit = 251,
def = 273,
res = 340,
avoid = 156,
attack_spd = 100,
is_magic_damage = 1,
ai_type = 39,
give_exp = 114,
drop_type = 0,
drop_money = 0,
drop_item = 0,
union_number = 0,
need_summon_count = 0,
sell_tab0 = 0,
sell_tab1 = 0,
sell_tab2 = 0,
sell_tab3 = 0,
can_target = 0,
attack_range = 1330,
npc_type = 0,
hit_material_type = 1,
face_icon = 0,
summon_mob_type = 0,
quest_type = 0,
height = 0
});
registerNpc(733, {
walk_speed = 138,
run_speed = 464,
scale = 205,
r_weapon = 1076,
l_weapon = 0,
level = 107,
hp = 27,
attack = 393,
hit = 260,
def = 288,
res = 356,
avoid = 162,
attack_spd = 100,
is_magic_damage = 1,
ai_type = 39,
give_exp = 123,
drop_type = 0,
drop_money = 0,
drop_item = 0,
union_number = 0,
need_summon_count = 0,
sell_tab0 = 0,
sell_tab1 = 0,
sell_tab2 = 0,
sell_tab3 = 0,
can_target = 0,
attack_range = 1360,
npc_type = 0,
hit_material_type = 1,
face_icon = 0,
summon_mob_type = 0,
quest_type = 0,
height = 0
});
registerNpc(734, {
walk_speed = 142,
run_speed = 476,
scale = 210,
r_weapon = 1076,
l_weapon = 0,
level = 111,
hp = 27,
attack = 410,
hit = 269,
def = 302,
res = 371,
avoid = 169,
attack_spd = 100,
is_magic_damage = 1,
ai_type = 39,
give_exp = 127,
drop_type = 0,
drop_money = 0,
drop_item = 0,
union_number = 0,
need_summon_count = 0,
sell_tab0 = 0,
sell_tab1 = 0,
sell_tab2 = 0,
sell_tab3 = 0,
can_target = 0,
attack_range = 1390,
npc_type = 0,
hit_material_type = 1,
face_icon = 0,
summon_mob_type = 0,
quest_type = 0,
height = 0
});
registerNpc(735, {
walk_speed = 146,
run_speed = 488,
scale = 215,
r_weapon = 1076,
l_weapon = 0,
level = 115,
hp = 27,
attack = 428,
hit = 278,
def = 318,
res = 387,
avoid = 175,
attack_spd = 100,
is_magic_damage = 1,
ai_type = 39,
give_exp = 131,
drop_type = 0,
drop_money = 0,
drop_item = 0,
union_number = 0,
need_summon_count = 0,
sell_tab0 = 0,
sell_tab1 = 0,
sell_tab2 = 0,
sell_tab3 = 0,
can_target = 0,
attack_range = 1420,
npc_type = 0,
hit_material_type = 1,
face_icon = 0,
summon_mob_type = 0,
quest_type = 0,
height = 0
});
registerNpc(736, {
walk_speed = 150,
run_speed = 500,
scale = 220,
r_weapon = 1076,
l_weapon = 0,
level = 119,
hp = 28,
attack = 446,
hit = 288,
def = 333,
res = 403,
avoid = 182,
attack_spd = 100,
is_magic_damage = 1,
ai_type = 39,
give_exp = 142,
drop_type = 0,
drop_money = 0,
drop_item = 0,
union_number = 0,
need_summon_count = 0,
sell_tab0 = 0,
sell_tab1 = 0,
sell_tab2 = 0,
sell_tab3 = 0,
can_target = 0,
attack_range = 1450,
npc_type = 0,
hit_material_type = 1,
face_icon = 0,
summon_mob_type = 0,
quest_type = 0,
height = 0
});
registerNpc(737, {
walk_speed = 154,
run_speed = 512,
scale = 225,
r_weapon = 1076,
l_weapon = 0,
level = 123,
hp = 28,
attack = 464,
hit = 297,
def = 349,
res = 420,
avoid = 189,
attack_spd = 100,
is_magic_damage = 1,
ai_type = 39,
give_exp = 146,
drop_type = 0,
drop_money = 0,
drop_item = 0,
union_number = 0,
need_summon_count = 0,
sell_tab0 = 0,
sell_tab1 = 0,
sell_tab2 = 0,
sell_tab3 = 0,
can_target = 0,
attack_range = 1480,
npc_type = 0,
hit_material_type = 1,
face_icon = 0,
summon_mob_type = 0,
quest_type = 0,
height = 0
});
registerNpc(738, {
walk_speed = 158,
run_speed = 524,
scale = 230,
r_weapon = 1076,
l_weapon = 0,
level = 127,
hp = 28,
attack = 482,
hit = 307,
def = 365,
res = 436,
avoid = 196,
attack_spd = 100,
is_magic_damage = 1,
ai_type = 39,
give_exp = 151,
drop_type = 0,
drop_money = 0,
drop_item = 0,
union_number = 0,
need_summon_count = 0,
sell_tab0 = 0,
sell_tab1 = 0,
sell_tab2 = 0,
sell_tab3 = 0,
can_target = 0,
attack_range = 1510,
npc_type = 0,
hit_material_type = 1,
face_icon = 0,
summon_mob_type = 0,
quest_type = 0,
height = 0
});
registerNpc(739, {
walk_speed = 162,
run_speed = 536,
scale = 235,
r_weapon = 1076,
l_weapon = 0,
level = 131,
hp = 29,
attack = 500,
hit = 316,
def = 381,
res = 453,
avoid = 203,
attack_spd = 100,
is_magic_damage = 1,
ai_type = 39,
give_exp = 158,
drop_type = 0,
drop_money = 0,
drop_item = 0,
union_number = 0,
need_summon_count = 0,
sell_tab0 = 0,
sell_tab1 = 0,
sell_tab2 = 0,
sell_tab3 = 0,
can_target = 0,
attack_range = 1540,
npc_type = 0,
hit_material_type = 1,
face_icon = 0,
summon_mob_type = 0,
quest_type = 0,
height = 0
});
registerNpc(740, {
walk_speed = 166,
run_speed = 548,
scale = 240,
r_weapon = 1076,
l_weapon = 0,
level = 135,
hp = 29,
attack = 519,
hit = 326,
def = 398,
res = 470,
avoid = 210,
attack_spd = 100,
is_magic_damage = 1,
ai_type = 39,
give_exp = 167,
drop_type = 0,
drop_money = 0,
drop_item = 0,
union_number = 0,
need_summon_count = 0,
sell_tab0 = 0,
sell_tab1 = 0,
sell_tab2 = 0,
sell_tab3 = 0,
can_target = 0,
attack_range = 1570,
npc_type = 0,
hit_material_type = 1,
face_icon = 0,
summon_mob_type = 0,
quest_type = 0,
height = 0
});
registerNpc(927, {
walk_speed = 190,
run_speed = 450,
scale = 160,
r_weapon = 0,
l_weapon = 0,
level = 62,
hp = 2380,
attack = 202,
hit = 165,
def = 199,
res = 103,
avoid = 94,
attack_spd = 100,
is_magic_damage = 0,
ai_type = 166,
give_exp = 0,
drop_type = 3,
drop_money = 0,
drop_item = 100,
union_number = 100,
need_summon_count = 33,
sell_tab0 = 33,
sell_tab1 = 0,
sell_tab2 = 0,
sell_tab3 = 0,
can_target = 0,
attack_range = 350,
npc_type = 0,
hit_material_type = 1,
face_icon = 0,
summon_mob_type = 0,
quest_type = 0,
height = 0
});
function OnInit(entity)
return true
end
function OnCreate(entity)
return true
end
function OnDelete(entity)
return true
end
function OnDead(entity)
end
function OnDamaged(entity)
end | apache-2.0 |
correa/domoticz | dzVents/runtime/dzVents.lua | 3 | 2400 | local TESTMODE = false
globalvariables['testmode'] = false
--globalvariables['dzVents_log_level'] = 4 --debug
if (_G.TESTMODE) then
TESTMODE = false
globalvariables['testmode'] = false
end
local scriptPath = globalvariables['script_path'] -- should be ${szUserDataFolder}/scripts/dzVents/
local runtimePath = globalvariables['runtime_path'] -- should be ${szStartupFolder}/dzVents/runtime/
_G.scriptsFolderPath = scriptPath .. 'scripts' -- global
_G.generatedScriptsFolderPath = scriptPath .. 'generated_scripts' -- global
_G.dataFolderPath = scriptPath .. 'data' -- global
package.path =
scriptPath .. '?.lua;' ..
runtimePath .. '?.lua;' ..
runtimePath .. 'device-adapters/?.lua;' ..
scriptPath .. 'dzVents/?.lua;' ..
scriptPath .. 'scripts/?.lua;' ..
scriptPath .. '../lua/?.lua;' ..
scriptPath .. 'scripts/modules/?.lua;' ..
scriptPath .. '?.lua;' ..
scriptPath .. 'generated_scripts/?.lua;' ..
scriptPath .. 'data/?.lua;' ..
scriptPath .. 'modules/?.lua;' ..
package.path
local EventHelpers = require('EventHelpers')
local helpers = EventHelpers()
local utils = require('Utils')
if (tonumber(globalvariables['dzVents_log_level']) == utils.LOG_DEBUG or TESTMODE) then
print('Debug: Dumping domoticz data to ' .. scriptPath .. 'domoticzData.lua')
local persistence = require('persistence')
persistence.store(scriptPath .. 'domoticzData.lua', domoticzData)
--persistence.store(scriptPath .. 'globalvariables.lua', globalvariables)
--persistence.store(scriptPath .. 'timeofday.lua', timeofday)
local events, length = helpers.getEventSummary()
if (length > 0) then
print('Debug: dzVents version: '.. globalvariables.dzVents_version)
print('Debug: Event triggers:')
for i, event in pairs(events) do
print('Debug: ' .. event)
end
end
if (globalvariables['isTimeEvent']) then
print('Debug: Event triggers:')
print('Debug: - Timer')
end
end
commandArray = {}
local isTimeEvent = globalvariables['isTimeEvent']
if (isTimeEvent) then
commandArray = helpers.dispatchTimerEventsToScripts()
end
helpers.dispatchDeviceEventsToScripts()
helpers.dispatchVariableEventsToScripts()
helpers.dispatchSecurityEventsToScripts()
helpers.dispatchSceneGroupEventsToScripts()
helpers.dispatchHTTPResponseEventsToScripts()
helpers.dispatchSystemEventsToScripts()
helpers.dispatchCustomEventsToScripts()
commandArray = helpers.domoticz.commandArray
return commandArray
| gpl-3.0 |
Servius/tfa-sw-weapons-repository | Live Addons/servius_uploader_legacy/tfa_extended_live/lua/weapons/tfa_f11_dirty/shared.lua | 1 | 7503 | if ( SERVER ) then
AddCSLuaFile( "shared.lua" )
end
if ( CLIENT ) then
SWEP.PrintName = "F-11B"
SWEP.Author = "TFA, Servius"
SWEP.ViewModelFOV = 70.35175879397
SWEP.Slot = 2
SWEP.SlotPos = 3
--SWEP.WepSelectIcon = surface.GetTextureID("HUD/killicons/DC15A")
--killicon.Add( "weapon_752_dc15a", "HUD/killicons/DC15A", Color( 255, 80, 0, 255 ) )
end
SWEP.Base = "tfa_3dscoped_base"
SWEP.Category = "TFA Star Wars"
SWEP.Spawnable = true
SWEP.AdminSpawnable = true
SWEP.HoldType = "ar2"
SWEP.ViewModelFOV = 70.35175879397
SWEP.ViewModelFlip = false
SWEP.ViewModel = "models/weapons/synbf3/c_e11.mdl"
SWEP.WorldModel = "models/weapons/synbf3/w_e11.mdl"
SWEP.ShowViewModel = true
SWEP.ShowWorldModel = true
SWEP.UseHands = true
SWEP.Primary.Sound = Sound ("weapons/f11/f11_fire.ogg");
SWEP.Primary.ReloadSound = Sound ("weapons/shared/battlefront_standard_reload.ogg");
SWEP.Weight = 5
SWEP.AutoSwitchTo = false
SWEP.AutoSwitchFrom = false
SWEP.Primary.Recoil = 0.5
SWEP.Primary.Damage = 50
SWEP.Primary.NumShots = 1
-- Selective Fire Stuff
SWEP.SelectiveFire = true --Allow selecting your firemode?
SWEP.DisableBurstFire = false --Only auto/single?
SWEP.OnlyBurstFire = false --No auto, only burst/single?
SWEP.DefaultFireMode = "" --Default to auto or whatev
SWEP.FireModeName = nil --Change to a text value to override it
SWEP.Primary.Spread = 0.0125
SWEP.Primary.IronAccuracy = .002 -- Ironsight accuracy, should be the same for shotguns
SWEP.Primary.SpreadMultiplierMax = 2 --How far the spread can expand when you shoot.
--Range Related
SWEP.Primary.Range = -1 -- The distance the bullet can travel in source units. Set to -1 to autodetect based on damage/rpm.
SWEP.Primary.RangeFalloff = -1 -- The percentage of the range the bullet damage starts to fall off at. Set to 0.8, for example, to start falling off after 80% of the range.
--Penetration Related
SWEP.MaxPenetrationCounter = 1 --The maximum number of ricochets. To prevent stack overflows.
SWEP.Primary.ClipSize = 45
SWEP.Primary.RPM = 300
SWEP.Primary.DefaultClip = 150
SWEP.Primary.Automatic = true
SWEP.Primary.Ammo = "ar2"
SWEP.Secondary.Automatic = false
SWEP.Secondary.Ammo = "none"
SWEP.Secondary.IronFOV = 70
SWEP.IronSightsPos = Vector(-3.881, -5.026, -0.16)
SWEP.IronSightsAng = Vector(0, 0, 0)
SWEP.ViewModelBoneMods = {
["r_thumb_mid"] = { scale = Vector(1, 1, 1), pos = Vector(-0.926, 0.185, -0.186), angle = Angle(0, 0, 0) },
["v_e11_reference001"] = { scale = Vector(0.009, 0.009, 0.009), pos = Vector(0, 0, 0), angle = Angle(0, 0, 0) },
["r_thumb_tip"] = { scale = Vector(1, 1, 1.07), pos = Vector(0, 0, 0.185), angle = Angle(0, 0, 0) },
["ValveBiped.Bip01_L_Hand"] = { scale = Vector(1, 0.647, 1), pos = Vector(-0.556, 0.925, -0.926), angle = Angle(0, 0, 0) },
["l_thumb_low"] = { scale = Vector(1, 1, 1), pos = Vector(1.296, -0.556, 0), angle = Angle(0, 0, 0) }
}
SWEP.VElements = {
["element_scope"] = { type = "Model", model = "models/rtcircle.mdl", bone = "v_e11_reference001", rel = "", pos = Vector(-1.9, -5.441, 7.4), angle = Angle(0, 90, 0), size = Vector(0.34, 0.34, 0.34), color = Color(255, 255, 255, 255), surpresslightning = false, material = "!tfa_rtmaterial", skin = 0, bodygroup = {} },
["element_name"] = { type = "Model", model = "models/weapons/w_f-11d_chrome.mdl", bone = "v_e11_reference001", rel = "", pos = Vector(-1.558, 5, 2), angle = Angle(0, -90, 0), size = Vector(1, 1, 1), color = Color(255, 255, 255, 255), surpresslightning = false, material = "", skin = 0, bodygroup = {} }
}
SWEP.WElements = {
["element_name"] = { type = "Model", model = "models/weapons/w_f-11d_chrome.mdl", bone = "ValveBiped.Bip01_R_Hand", rel = "", pos = Vector(7.599, 0.899, -3.1), angle = Angle(-15.195, 3.506, 180), size = Vector(0.8, 0.8, 0.8), color = Color(255, 255, 255, 255), surpresslightning = false, material = "", skin = 0, bodygroup = {} }
}
SWEP.BlowbackVector = Vector(0,-3,0.025)
SWEP.Blowback_Only_Iron = false
SWEP.DoProceduralReload = false
SWEP.ProceduralReloadTime = 2.5
----Swft Base Code
SWEP.TracerCount = 1
SWEP.MuzzleFlashEffect = ""
SWEP.TracerName = "effect_sw_laser_red"
SWEP.Secondary.IronFOV = 70
SWEP.Primary.KickUp = 0.2
SWEP.Primary.KickDown = 0.1
SWEP.Primary.KickHorizontal = 0.1
SWEP.Primary.KickRight = 0.1
SWEP.DisableChambering = true
SWEP.ImpactDecal = "FadingScorch"
SWEP.ImpactEffect = "effect_sw_impact" --Impact Effect
SWEP.RunSightsPos = Vector(2.127, 0, 1.355)
SWEP.RunSightsAng = Vector(-15.775, 10.023, -5.664)
SWEP.BlowbackEnabled = true
SWEP.BlowbackVector = Vector(0,-3,0.1)
SWEP.Blowback_Shell_Enabled = false
SWEP.Blowback_Shell_Effect = ""
SWEP.ThirdPersonReloadDisable=false
SWEP.Primary.DamageType = DMG_SHOCK
SWEP.DamageType = DMG_SHOCK
--3dScopedBase stuff
SWEP.RTMaterialOverride = -1
SWEP.RTScopeAttachment = -1
SWEP.Scoped_3D = true
SWEP.ScopeReticule = "scope/gdcw_red_nobar"
SWEP.Secondary.ScopeZoom = 8
SWEP.ScopeReticule_Scale = {2.5,2.5}
SWEP.Secondary.UseACOG = false --Overlay option
SWEP.Secondary.UseMilDot = false --Overlay option
SWEP.Secondary.UseSVD = false --Overlay option
SWEP.Secondary.UseParabolic = false --Overlay option
SWEP.Secondary.UseElcan = false --Overlay option
SWEP.Secondary.UseGreenDuplex = false --Overlay option
if surface then
SWEP.Secondary.ScopeTable = nil --[[
{
scopetex = surface.GetTextureID("scope/gdcw_closedsight"),
reticletex = surface.GetTextureID("scope/gdcw_acogchevron"),
dottex = surface.GetTextureID("scope/gdcw_acogcross")
}
]]--
end
DEFINE_BASECLASS( SWEP.Base )
--[[
SWEP.HoldType = "ar2"
SWEP.ViewModelFOV = 70.35175879397
SWEP.ViewModelFlip = false
SWEP.UseHands = true
SWEP.ViewModel = "models/weapons/synbf3/c_e11.mdl"
SWEP.WorldModel = "models/weapons/synbf3/w_e11.mdl"
SWEP.ShowViewModel = true
SWEP.ShowWorldModel = false
SWEP.ViewModelBoneMods = {
["r_thumb_mid"] = { scale = Vector(1, 1, 1), pos = Vector(-0.926, 0.185, -0.186), angle = Angle(0, 0, 0) },
["v_e11_reference001"] = { scale = Vector(0.009, 0.009, 0.009), pos = Vector(0, 0, 0), angle = Angle(0, 0, 0) },
["r_thumb_tip"] = { scale = Vector(1, 1, 1.07), pos = Vector(0, 0, 0.185), angle = Angle(0, 0, 0) },
["ValveBiped.Bip01_L_Hand"] = { scale = Vector(1, 0.647, 1), pos = Vector(-0.556, 0.925, -0.926), angle = Angle(0, 0, 0) },
["l_thumb_low"] = { scale = Vector(1, 1, 1), pos = Vector(1.296, -0.556, 0), angle = Angle(0, 0, 0) }
}
SWEP.IronSightsPos = Vector(-3.881, -5.026, -0.16)
SWEP.IronSightsAng = Vector(0, 0, 0)
SWEP.VElements = {
["element_scope"] = { type = "Model", model = "models/rtcircle.mdl", bone = "v_e11_reference001", rel = "", pos = Vector(-1.9, -5.441, 7.4), angle = Angle(0, 90, 0), size = Vector(0.34, 0.34, 0.34), color = Color(255, 255, 255, 255), surpresslightning = false, material = "!tfa_rtmaterial", skin = 0, bodygroup = {} },
["element_name"] = { type = "Model", model = "models/weapons/w_f-11d_chrome.mdl", bone = "v_e11_reference001", rel = "", pos = Vector(-1.558, 5, 2), angle = Angle(0, -90, 0), size = Vector(1, 1, 1), color = Color(255, 255, 255, 255), surpresslightning = false, material = "", skin = 0, bodygroup = {} }
}
SWEP.WElements = {
["element_name"] = { type = "Model", model = "models/weapons/w_f-11d_chrome.mdl", bone = "ValveBiped.Bip01_R_Hand", rel = "", pos = Vector(7.599, 0.899, -3.1), angle = Angle(-15.195, 3.506, 180), size = Vector(0.8, 0.8, 0.8), color = Color(255, 255, 255, 255), surpresslightning = false, material = "", skin = 0, bodygroup = {} }
}
]] | apache-2.0 |
premake/premake-core | src/base/_foundation.lua | 1 | 11078 | ---
-- Base definitions required by all the other scripts.
-- @copyright 2002-2015 Jason Perkins and the Premake project
---
premake = premake or {}
premake._VERSION = _PREMAKE_VERSION
package.loaded["premake"] = premake
premake.modules = {}
premake.extensions = premake.modules
local semver = dofile('semver.lua')
local p = premake
-- Keep track of warnings that have been shown, so they don't get shown twice
local _warnings = {}
-- Keep track of aliased functions, so I can resolve to canonical names
local _aliases = {}
--
-- Define some commonly used symbols, for future-proofing.
--
premake.C = "C"
premake.C7 = "c7"
premake.CLANG = "clang"
premake.CONSOLEAPP = "ConsoleApp"
premake.CPP = "C++"
premake.CSHARP = "C#"
premake.GCC = "gcc"
premake.HAIKU = "haiku"
premake.ANDROID = "android"
premake.IOS = "ios"
premake.LINUX = "linux"
premake.MACOSX = "macosx"
premake.MAKEFILE = "Makefile"
premake.MBCS = "MBCS"
premake.NONE = "None"
premake.DEFAULT = "Default"
premake.OBJECTIVEC = "Objective-C"
premake.OBJECTIVECPP = "Objective-C++"
premake.ON = "On"
premake.OFF = "Off"
premake.POSIX = "posix"
premake.PS3 = "ps3"
premake.SHAREDITEMS = "SharedItems"
premake.SHAREDLIB = "SharedLib"
premake.STATICLIB = "StaticLib"
premake.UNICODE = "Unicode"
premake.UNIVERSAL = "universal"
premake.UTILITY = "Utility"
premake.UWP = "uwp"
premake.PACKAGING = "Packaging"
premake.WINDOWEDAPP = "WindowedApp"
premake.WINDOWS = "windows"
premake.X86 = "x86"
premake.X86_64 = "x86_64"
premake.ARM = "ARM"
premake.ARM64 = "ARM64"
---
-- Provide an alias for a function in a namespace. Calls to the alias will
-- invoke the canonical function, and attempts to override the alias will
-- instead override the canonical call.
--
-- @param scope
-- The table containing the function to be overridden. Use _G for
-- global functions.
-- @param canonical
-- The name of the function to be aliased (a string value)
-- @param alias
-- The new alias for the function (another string value).
---
function p.alias(scope, canonical, alias)
scope, canonical = p.resolveAlias(scope, canonical)
if not scope[canonical] then
error("unable to alias '" .. canonical .. "'; no such function", 2)
end
_aliases[scope] = _aliases[scope] or {}
_aliases[scope][alias] = canonical
scope[alias] = function(...)
return scope[canonical](...)
end
end
---
-- Call a list of functions.
--
-- @param funcs
-- The list of functions to be called, or a function that can be called
-- to build and return the list. If this is a function, it will be called
-- with all of the additional arguments (below).
-- @param ...
-- An optional set of arguments to be passed to each of the functions as
-- as they are called.
---
function premake.callArray(funcs, ...)
if type(funcs) == "function" then
funcs = funcs(...)
end
if funcs then
for i = 1, #funcs do
funcs[i](...)
end
end
end
-- TODO: THIS IMPLEMENTATION IS GOING AWAY
function premake.callarray(namespace, array, ...)
local n = #array
for i = 1, n do
local fn = namespace[array[i]]
if not fn then
error(string.format("Unable to find function '%s'", array[i]))
end
fn(...)
end
end
---
-- Compare a version string that uses semver semantics against a
-- version comparision string. Comparisions take the form of ">=5.0" (5.0 or
-- later), "5.0" (5.0 or later), ">=5.0 <6.0" (5.0 or later but not 6.0 or
-- later).
--
-- @param version
-- The version to be tested.
-- @param checks
-- The comparision string to be evaluated.
-- @return
-- True if the comparisions pass, false if any fail.
---
function p.checkVersion(version, checks)
if not version then
return false
end
-- try to parse semver, if it fails, it's not semver compatible and we cannot compare, in which case
-- we're going to ignore the checkVersion entirely, but warn.
if not premake.isSemVer(version) then
p.warn("'" .. version .. "' is not semver compatible, and cannot be compared against '" .. checks .. "'.");
return true
end
-- now compare the semver against the checks.
local function eq(a, b) return a == b end
local function le(a, b) return a <= b end
local function lt(a, b) return a < b end
local function ge(a, b) return a >= b end
local function gt(a, b) return a > b end
local function compat(a, b) return a ^ b end
version = semver(version)
checks = string.explode(checks, " ", true)
for i = 1, #checks do
local check = checks[i]
local func
if check:startswith(">=") then
func = ge
check = check:sub(3)
elseif check:startswith(">") then
func = gt
check = check:sub(2)
elseif check:startswith("<=") then
func = le
check = check:sub(3)
elseif check:startswith("<") then
func = lt
check = check:sub(2)
elseif check:startswith("=") then
func = eq
check = check:sub(2)
elseif check:startswith("^") then
func = compat
check = check:sub(2)
else
func = ge
end
check = semver(check)
if not func(version, check) then
return false
end
end
return true
end
function premake.clearWarnings()
_warnings = {}
end
--
-- Raise an error, with a formatted message built from the provided
-- arguments.
--
-- @param message
-- The error message, which may contain string formatting tokens.
-- @param ...
-- Values to fill in the string formatting tokens.
--
function premake.error(message, ...)
error(string.format("** Error: " .. message, ...), 0)
end
--
-- Finds the correct premake script filename to be run.
--
-- @param fname
-- The filename of the script to run.
-- @return
-- The correct location and filename of the script to run.
--
function premake.findProjectScript(fname)
return os.locate(fname, fname .. ".lua", path.join(fname, "premake5.lua"), path.join(fname, "premake4.lua"))
end
---
-- "Immediate If" - returns one of the two values depending on the value
-- of the provided condition. Note that both the true and false expressions
-- will be evaluated regardless of the condition, even if only one result
-- is returned.
--
-- @param condition
-- A boolean condition, determining which value gets returned.
-- @param trueValue
-- The value to return if the condition is true.
-- @param falseValue
-- The value to return if the condition is false.
-- @return
-- One of trueValue or falseValue.
---
function iif(condition, trueValue, falseValue)
if condition then
return trueValue
else
return falseValue
end
end
---
-- Override an existing function with a new implementation; the original
-- function is passed as the first argument to the replacement when called.
--
-- @param scope
-- The table containing the function to be overridden. Use _G for
-- global functions.
-- @param name
-- The name of the function to override (a string value).
-- @param repl
-- The replacement function. The first argument to the function
-- will be the original implementation, followed by the arguments
-- passed to the original call.
---
function premake.override(scope, name, repl)
scope, name = p.resolveAlias(scope, name)
local original = scope[name]
if not original then
error("unable to override '" .. name .. "'; no such function", 2)
end
scope[name] = function(...)
return repl(original, ...)
end
-- Functions from premake.main are special in that they are fetched
-- from an array, which can be modified by system and project scripts,
-- instead of a function which would have already been called before
-- those scripts could have run. Since the array will have already
-- been evaluated by the time override() is called, the new value
-- won't be picked up as it would with the function-fetched call
-- lists. Special case the workaround for that here so everyone else
-- can just override without having to think about the difference.
if scope == premake.main then
table.replace(premake.main.elements, original, scope[name])
end
end
---
-- Find the canonical name and scope of a function, resolving any aliases.
--
-- @param scope
-- The table containing the function to be overridden. Use _G for
-- global functions.
-- @param name
-- The name of the function to resolve.
-- @return
-- The canonical scope and function name (a string value).
---
function p.resolveAlias(scope, name)
local aliases = _aliases[scope]
if aliases then
while aliases[name] do
name = aliases[name]
end
end
return scope, name
end
--
-- Display a warning, with a formatted message built from the provided
-- arguments.
--
-- @param message
-- The warning message, which may contain string formatting tokens.
-- @param ...
-- Values to fill in the string formatting tokens.
--
function premake.warn(message, ...)
message = string.format(message, ...)
if _OPTIONS.fatal then
error(message)
else
term.pushColor(term.warningColor)
io.stderr:write(string.format("** Warning: " .. message .. "\n", ...))
term.popColor();
end
end
--
-- Displays a warning just once per run.
--
-- @param key
-- A unique key to identify this warning. Subsequent warnings messages
-- using the same key will not be shown.
-- @param message
-- The warning message, which may contain string formatting tokens.
-- @param ...
-- Values to fill in the string formatting tokens.
--
function premake.warnOnce(key, message, ...)
if not _warnings[key] then
_warnings[key] = true
premake.warn(message, ...)
end
end
--
-- Display information in the term.infoColor color.
--
-- @param message
-- The info message, which may contain string formatting tokens.
-- @param ...
-- Values to fill in the string formatting tokens.
--
function premake.info(message, ...)
message = string.format(message, ...)
term.pushColor(term.infoColor)
io.stdout:write(string.format("** Info: " .. message .. "\n", ...))
term.popColor();
end
--
-- A shortcut for printing formatted output.
--
function printf(msg, ...)
print(string.format(msg, ...))
end
--
-- A shortcut for printing formatted output in verbose mode.
--
function verbosef(msg, ...)
if _OPTIONS.verbose then
print(string.format(msg, ...))
end
end
--
-- make a string from debug.getinfo information.
--
function filelineinfo(level)
local info = debug.getinfo(level+1, "Sl")
if info == nil then
return nil
end
if info.what == "C" then
return "C function"
else
local sep = iif(os.ishost('windows'), '\\', '/')
return string.format("%s(%d)", path.translate(info.short_src, sep), info.currentline)
end
end
---
-- check if version is semver.
---
function premake.isSemVer(version)
local sMajor, sMinor, sPatch, sPrereleaseAndBuild = version:match("^(%d+)%.?(%d*)%.?(%d*)(.-)$")
return (type(sMajor) == 'string')
end
| bsd-3-clause |
Sornii/pureviolence | data/spells/scripts/support/sharpshooter.lua | 26 | 1143 | local combat = Combat()
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_GREEN)
combat:setParameter(COMBAT_PARAM_AGGRESSIVE, 0)
local condition = Condition(CONDITION_ATTRIBUTES)
condition:setParameter(CONDITION_PARAM_TICKS, 10000)
condition:setParameter(CONDITION_PARAM_SKILL_DISTANCEPERCENT, 150)
condition:setParameter(CONDITION_PARAM_SKILL_SHIELDPERCENT, -100)
condition:setParameter(CONDITION_PARAM_BUFF_SPELL, 1)
combat:setCondition(condition)
local speed = Condition(CONDITION_HASTE)
speed:setParameter(CONDITION_PARAM_TICKS, 10000)
speed:setFormula(-0.7, 56, -0.7, 56)
combat:setCondition(speed)
local exhaustHealGroup = Condition(CONDITION_SPELLGROUPCOOLDOWN)
exhaustHealGroup:setParameter(CONDITION_PARAM_SUBID, 2)
exhaustHealGroup:setParameter(CONDITION_PARAM_TICKS, 10000)
combat:setCondition(exhaustHealGroup)
local exhaustSupportGroup = Condition(CONDITION_SPELLGROUPCOOLDOWN)
exhaustSupportGroup:setParameter(CONDITION_PARAM_SUBID, 3)
exhaustSupportGroup:setParameter(CONDITION_PARAM_TICKS, 10000)
combat:setCondition(exhaustSupportGroup)
function onCastSpell(creature, var)
return combat:execute(creature, var)
end
| gpl-2.0 |
kidaa/ffxinfinity | FFXI Server-Development/Build Files/scripts/zones/Southern_San_dOria/npcs/Najjar.lua | 2 | 1374 | -----------------------------------
-- Area: Southern San d'Oria
-- NPC: Najjar
-- General Info NPC
-------------------------------------
package.loaded["scripts/zones/Southern_San_dOria/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/settings");
require("scripts/globals/quests");
require("scripts/zones/Southern_San_dOria/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
-- "Flyers for Regine" conditional script
FlyerForRegine = player:getQuestStatus(SANDORIA,FLYERS_FOR_REGINE);
if (FlyerForRegine == 1) then
count = trade:getItemCount();
MagicFlyer = trade:hasItemQty(532,1);
if (MagicFlyer == true and count == 1) then
player:messageSpecial(FLYER_REFUSED);
end
end
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
player:startEvent(0x011);
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 |
Sonicrich05/FFXI-Server | scripts/globals/weaponskills/burning_blade.lua | 30 | 1294 | -----------------------------------
-- Burning Blade
-- Sword weapon skill
-- Skill Level: 30
-- Desription: Deals Fire elemental damage to enemy. Damage varies with TP.
-- Aligned with the Flame Gorget.
-- Aligned with the Flame Belt.
-- Element: Fire
-- Modifiers: STR:20% ; INT:20%
-- 100%TP 200%TP 300%TP
-- 1.00 2.00 2.50
-----------------------------------
require("scripts/globals/magic");
require("scripts/globals/status");
require("scripts/globals/settings");
require("scripts/globals/weaponskills");
-----------------------------------
function onUseWeaponSkill(player, target, wsID)
local params = {};
params.ftp100 = 1; params.ftp200 = 2; params.ftp300 = 2.5;
params.str_wsc = 0.2; params.dex_wsc = 0.0; params.vit_wsc = 0.0; params.agi_wsc = 0.0; params.int_wsc = 0.2; params.mnd_wsc = 0.0; params.chr_wsc = 0.0;
params.ele = ELE_FIRE;
params.skill = SKILL_SWD;
params.includemab = true;
if (USE_ADOULIN_WEAPON_SKILL_CHANGES == true) then
params.ftp200 = 2.1; params.ftp300 = 3.4;
params.str_wsc = 0.4; params.int_wsc = 0.4;
end
local damage, criticalHit, tpHits, extraHits = doMagicWeaponskill(player, target, params);
damage = damage * WEAPON_SKILL_POWER
return tpHits, extraHits, criticalHit, damage;
end
| gpl-3.0 |
Sonicrich05/FFXI-Server | scripts/globals/spells/bluemagic/death_scissors.lua | 28 | 1831 | -----------------------------------------
-- Spell: Death Scissors
-- Damage varies with TP
-- Spell cost: 51 MP
-- Monster Type: Vermin
-- Spell Type: Physical (Slashing)
-- Blue Magic Points: 5
-- Stat Bonus: MND+2, CHR+2, HP+5
-- Level: 60
-- Casting Time: 0.5 seconds
-- Recast Time: 24.5 seconds
-- Skillchain Properties: Compression(Primary)/Reverberation(Secondary) - (can open Transfixion, Detonation, Impaction, or Induration; can close Compression, Reverberation, or Gravitation)
-- Combos: Attack Bonus
-----------------------------------------
require("scripts/globals/magic");
require("scripts/globals/status");
require("scripts/globals/bluemagic");
-----------------------------------------
-- OnMagicCastingCheck
-----------------------------------------
function onMagicCastingCheck(caster,target,spell)
return 0;
end;
-----------------------------------------
-- OnSpellCast
-----------------------------------------
function onSpellCast(caster,target,spell)
local params = {};
-- This data should match information on http://wiki.ffxiclopedia.org/wiki/Calculating_Blue_Magic_Damage
params.tpmod = TPMOD_DAMAGE;
params.dmgtype = DMGTYPE_SLASH;
params.scattr = SC_COMPRESSION;
params.numhits = 1;
params.multiplier = 1.5;
params.tp150 = 2.75;
params.tp300 = 3.25;
params.azuretp = 3.3;
params.duppercap = 74; -- >=69 D
params.str_wsc = 0.6;
params.dex_wsc = 0.0;
params.vit_wsc = 0.0;
params.agi_wsc = 0.0;
params.int_wsc = 0.0;
params.mnd_wsc = 0.0;
params.chr_wsc = 0.0;
damage = BluePhysicalSpell(caster, target, spell, params);
damage = BlueFinalAdjustments(caster, target, spell, damage, params);
return damage;
end; | gpl-3.0 |
ShmooDude/ovale | dist/DemonHunterDemonic.lua | 1 | 4593 | local __exports = LibStub:NewLibrary("ovale/DemonHunterDemonic", 80000)
if not __exports then return end
local __class = LibStub:GetLibrary("tslib").newClass
local __Ovale = LibStub:GetLibrary("ovale/Ovale")
local Ovale = __Ovale.Ovale
local __Debug = LibStub:GetLibrary("ovale/Debug")
local OvaleDebug = __Debug.OvaleDebug
local __Aura = LibStub:GetLibrary("ovale/Aura")
local OvaleAura = __Aura.OvaleAura
local aceEvent = LibStub:GetLibrary("AceEvent-3.0", true)
local GetSpecialization = GetSpecialization
local GetSpecializationInfo = GetSpecializationInfo
local GetTime = GetTime
local GetTalentInfoByID = GetTalentInfoByID
local CombatLogGetCurrentEventInfo = CombatLogGetCurrentEventInfo
local huge = math.huge
local select = select
local OvaleDemonHunterDemonicBase = OvaleDebug:RegisterDebugging(Ovale:NewModule("OvaleDemonHunterDemonic", aceEvent))
local INFINITY = huge
local HAVOC_DEMONIC_TALENT_ID = 22547
local HAVOC_SPEC_ID = 577
local HAVOC_EYE_BEAM_SPELL_ID = 198013
local HAVOC_META_BUFF_ID = 162264
local HIDDEN_BUFF_ID = -HAVOC_DEMONIC_TALENT_ID
local HIDDEN_BUFF_DURATION = INFINITY
local HIDDEN_BUFF_EXTENDED_BY_DEMONIC = "Extended by Demonic"
local OvaleDemonHunterDemonicClass = __class(OvaleDemonHunterDemonicBase, {
OnInitialize = function(self)
self.playerGUID = nil
self.isDemonHunter = Ovale.playerClass == "DEMONHUNTER" and true or false
self.isHavoc = false
self.hasDemonic = false
if self.isDemonHunter then
self:Debug("playerGUID: (%s)", Ovale.playerGUID)
self.playerGUID = Ovale.playerGUID
self:RegisterMessage("Ovale_TalentsChanged")
end
end,
OnDisable = function(self)
self:UnregisterMessage("COMBAT_LOG_EVENT_UNFILTERED")
end,
Ovale_TalentsChanged = function(self, event)
self.isHavoc = self.isDemonHunter and GetSpecializationInfo(GetSpecialization()) == HAVOC_SPEC_ID and true or false
self.hasDemonic = self.isHavoc and select(10, GetTalentInfoByID(HAVOC_DEMONIC_TALENT_ID, HAVOC_SPEC_ID)) and true or false
if self.isHavoc and self.hasDemonic then
self:Debug("We are a havoc DH with Demonic.")
self:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
else
if not self.isHavoc then
self:Debug("We are not a havoc DH.")
elseif not self.hasDemonic then
self:Debug("We don't have the Demonic talent.")
end
self:DropAura()
self:UnregisterMessage("COMBAT_LOG_EVENT_UNFILTERED")
end
end,
COMBAT_LOG_EVENT_UNFILTERED = function(self, event, ...)
local _, cleuEvent, _, sourceGUID, _, _, _, _, _, _, _, arg12, arg13 = CombatLogGetCurrentEventInfo()
if sourceGUID == self.playerGUID and cleuEvent == "SPELL_CAST_SUCCESS" then
local spellId, spellName = arg12, arg13
if HAVOC_EYE_BEAM_SPELL_ID == spellId then
self:Debug("Spell %d (%s) has successfully been cast. Gaining Aura (only during meta).", spellId, spellName)
self:GainAura()
end
end
if sourceGUID == self.playerGUID and cleuEvent == "SPELL_AURA_REMOVED" then
local spellId, spellName = arg12, arg13
if HAVOC_META_BUFF_ID == spellId then
self:Debug("Aura %d (%s) is removed. Dropping Aura.", spellId, spellName)
self:DropAura()
end
end
end,
GainAura = function(self)
local now = GetTime()
local aura_meta = OvaleAura:GetAura("player", HAVOC_META_BUFF_ID, nil, "HELPFUL", true)
if OvaleAura:IsActiveAura(aura_meta, now) then
self:Debug("Adding '%s' (%d) buff to player %s.", HIDDEN_BUFF_EXTENDED_BY_DEMONIC, HIDDEN_BUFF_ID, self.playerGUID)
local duration = HIDDEN_BUFF_DURATION
local ending = now + HIDDEN_BUFF_DURATION
OvaleAura:GainedAuraOnGUID(self.playerGUID, now, HIDDEN_BUFF_ID, self.playerGUID, "HELPFUL", nil, nil, 1, nil, duration, ending, nil, HIDDEN_BUFF_EXTENDED_BY_DEMONIC, nil, nil, nil)
else
self:Debug("Aura 'Metamorphosis' (%d) is not present.", HAVOC_META_BUFF_ID)
end
end,
DropAura = function(self)
local now = GetTime()
self:Debug("Removing '%s' (%d) buff on player %s.", HIDDEN_BUFF_EXTENDED_BY_DEMONIC, HIDDEN_BUFF_ID, self.playerGUID)
OvaleAura:LostAuraOnGUID(self.playerGUID, now, HIDDEN_BUFF_ID, self.playerGUID)
end,
})
__exports.OvaleDemonHunterDemonic = OvaleDemonHunterDemonicClass()
| gpl-2.0 |
kidaa/ffxinfinity | FFXI Server-Development/Build Files/scripts/zones/Windurst_Waters/npcs/Jack_of_Hearts.lua | 6 | 1192 | -----------------------------------
-- Area: Windurst Waters
-- NPC: Jack of Hearts
-- Adventurer's Assistant
-- Working 100%
-------------------------------------
require("scripts/globals/settings");
package.loaded["scripts/zones/Windurst_Waters/TextIDs"] = nil;
require("scripts/zones/Windurst_Waters/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
if (trade:getItemCount() == 1 and trade:hasItemQty(0x218,1) == true) then
player:startEvent(0x271c,GIL_RATE*50);
player:addGil(GIL_RATE*50);
player:tradeComplete();
end
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
player:startEvent(0x271b,0,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 |
Sonicrich05/FFXI-Server | scripts/zones/Aht_Urhgan_Whitegate/npcs/Bhoy_Yhupplo.lua | 30 | 3598 | -----------------------------------
-- Area: Aht Urhgan Whitegate
-- NPC: Bhoy Yhupplo
-- Type: Assault Mission Giver
-- @pos 127.474 0.161 -30.418 50
-----------------------------------
package.loaded["scripts/zones/Aht_Urhgan_Whitegate/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/keyitems");
require("scripts/zones/Aht_Urhgan_Whitegate/TextIDs");
require("scripts/globals/besieged");
require("scripts/globals/missions");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
local rank = getMercenaryRank(player);
local haveimperialIDtag;
local assaultPoints = player:getAssaultPoint(ILRUSI_ASSAULT_POINT);
if (player:hasKeyItem(IMPERIAL_ARMY_ID_TAG)) then
haveimperialIDtag = 1;
else
haveimperialIDtag = 0;
end
if (rank > 0) then
player:startEvent(277,rank,haveimperialIDtag,assaultPoints,player:getCurrentAssault());
else
player:startEvent(283); -- no rank
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 == 277) then
local selectiontype = bit.band(option, 0xF);
if (selectiontype == 1) then
-- taken assault mission
player:addAssault(bit.rshift(option,4));
player:delKeyItem(IMPERIAL_ARMY_ID_TAG);
player:addKeyItem(ILRUSI_ASSAULT_ORDERS);
player:messageSpecial(KEYITEM_OBTAINED,ILRUSI_ASSAULT_ORDERS);
elseif (selectiontype == 2) then
-- purchased an item
local item = bit.rshift(option,14);
local itemID = 0;
local price = 0;
-- Copy/pasted from Famad, TODO: fill in the actual IDs/prices for Bhoy Yhupplo
--[[if (item == 1) then
itemID = 15972;
price = 3000;
elseif (item == 2) then
itemID = 15777;
price = 5000;
elseif (item == 3) then
itemID = 15523;
price = 8000;
elseif (item == 4) then
itemID = 15886;
price = 10000;
elseif (item == 5) then
itemID = 15492;
price = 10000;
elseif (item == 6) then
itemID = 18583;
price = 10000;
elseif (item == 7) then
itemID = 18388;
price = 15000;
elseif (item == 8) then
itemID = 18417;
price = 15000;
elseif (item == 9) then
itemID = 14940;
price = 15000;
elseif (item == 10) then
itemID = 15690;
price = 20000;
elseif (item == 11) then
itemID = 14525;
price = 20000;
else
return;
end
player:addItem(itemID);
player:messageSpecial(ITEM_OBTAINED,itemID);
player:delAssaultPoint(LEBROS_ASSAULT_POINT,price);]]
end
end
end;
| gpl-3.0 |
kidaa/ffxinfinity | FFXI Server-Development/Build Files/scripts/zones/Windurst_Woods/npcs/Kopua-Mobua_AMAN.lua | 5 | 1054 | -----------------------------------
-- Area: Windurst Woods
-- NPC: Kopua-Mobua A.M.A.N.
-- Type: Mentor Recruiter
-- @zone: 241
-- @pos: -23.134 1.749 -67.284
--
-- Auto-Script: Requires Verification (Verfied by Brawndo)
-----------------------------------
package.loaded["scripts/zones/Windurst_Woods/TextIDs"] = nil;
-----------------------------------
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
player:startEvent(0x272a);
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 |
RavenX8/osIROSE-new | scripts/mobs/fields/JG02.lua | 2 | 19828 |
--[[ MOB SPAWN LIST
mob(<mob_spawner_alias>, <mob_id>, <mob_count>, <spawner_limit>, <spawn_interval>, <spawner_range>, <map_id>, <x_pos>, <y_pos>, <z_pos>);
--]]
mob("", 31, 1, 4, 17, 35, 23, 5078.14, 5456.11, 29.89);
mob("", 31, 1, 4, 17, 35, 23, 5078.14, 5456.11, 29.89);
mob("", 91, 1, 4, 17, 35, 23, 5078.14, 5456.11, 29.89);
mob("", 92, 1, 4, 17, 35, 23, 5078.14, 5456.11, 29.89);
mob("", 93, 1, 4, 17, 35, 23, 5078.14, 5456.11, 29.89);
mob("", 34, 1, 4, 17, 35, 23, 5078.14, 5456.11, 29.89);
mob("", 32, 1, 4, 20, 25, 23, 5067.04, 5461.44, 29.98);
mob("", 33, 1, 4, 20, 25, 23, 5067.04, 5461.44, 29.98);
mob("", 91, 1, 4, 20, 25, 23, 5067.04, 5461.44, 29.98);
mob("", 33, 1, 4, 20, 25, 23, 5067.04, 5461.44, 29.98);
mob("", 92, 1, 4, 20, 25, 23, 5067.04, 5461.44, 29.98);
mob("", 93, 1, 4, 20, 25, 23, 5067.04, 5461.44, 29.98);
mob("", 34, 1, 4, 20, 25, 23, 5067.04, 5461.44, 29.98);
mob("", 31, 1, 2, 15, 10, 23, 5030.55, 5456.98, 31.82);
mob("", 32, 1, 2, 15, 10, 23, 5030.55, 5456.98, 31.82);
mob("", 34, 1, 2, 15, 10, 23, 5030.55, 5456.98, 31.82);
mob("", 9, 2, 3, 10, 10, 23, 5048.14, 5525.39, 30.51);
mob("", 10, 1, 3, 10, 10, 23, 5048.14, 5525.39, 30.51);
mob("", 9, 2, 3, 10, 10, 23, 5041.54, 5506.78, 33.86);
mob("", 10, 1, 3, 10, 10, 23, 5041.54, 5506.78, 33.86);
mob("", 32, 1, 3, 22, 15, 23, 5116.12, 5505.78, 26.65);
mob("", 43, 1, 3, 22, 15, 23, 5116.12, 5505.78, 26.65);
mob("", 31, 1, 3, 22, 15, 23, 5116.12, 5505.78, 26.65);
mob("", 91, 1, 3, 22, 15, 23, 5116.12, 5505.78, 26.65);
mob("", 32, 1, 3, 10, 25, 23, 5260.75, 5506.74, 5.19);
mob("", 43, 1, 3, 10, 25, 23, 5260.75, 5506.74, 5.19);
mob("", 91, 1, 3, 10, 25, 23, 5260.75, 5506.74, 5.19);
mob("", 32, 1, 3, 10, 25, 23, 5217.74, 5487.55, 6.28);
mob("", 43, 1, 3, 10, 25, 23, 5217.74, 5487.55, 6.28);
mob("", 91, 1, 3, 10, 25, 23, 5217.74, 5487.55, 6.28);
mob("", 92, 1, 3, 10, 25, 23, 5217.74, 5487.55, 6.28);
mob("", 44, 1, 3, 10, 25, 23, 5217.74, 5487.55, 6.28);
mob("", 93, 1, 3, 10, 25, 23, 5217.74, 5487.55, 6.28);
mob("", 33, 1, 3, 10, 25, 23, 5217.74, 5487.55, 6.28);
mob("", 91, 2, 3, 15, 15, 23, 5124.32, 5474.87, 22.55);
mob("", 43, 1, 3, 15, 15, 23, 5124.32, 5474.87, 22.55);
mob("", 92, 1, 3, 15, 15, 23, 5124.32, 5474.87, 22.55);
mob("", 93, 1, 3, 15, 15, 23, 5124.32, 5474.87, 22.55);
mob("", 33, 1, 3, 15, 15, 23, 5124.32, 5474.87, 22.55);
mob("", 32, 1, 2, 20, 10, 23, 5171.4, 5444.49, 35.02);
mob("", 31, 2, 2, 20, 10, 23, 5171.4, 5444.49, 35.02);
mob("", 33, 2, 2, 20, 10, 23, 5171.4, 5444.49, 35.02);
mob("", 9, 2, 3, 10, 10, 23, 5142.79, 5522.57, 33.12);
mob("", 10, 1, 3, 10, 10, 23, 5142.79, 5522.57, 33.12);
mob("", 9, 2, 3, 10, 10, 23, 5181.44, 5483.59, 10.23);
mob("", 10, 1, 3, 10, 10, 23, 5181.44, 5483.59, 10.23);
mob("", 9, 2, 3, 10, 10, 23, 5154.51, 5484.86, 14.05);
mob("", 10, 1, 3, 10, 10, 23, 5154.51, 5484.86, 14.05);
mob("", 9, 2, 3, 10, 10, 23, 5232.39, 5473.4, 8.8);
mob("", 10, 1, 3, 10, 10, 23, 5232.39, 5473.4, 8.8);
mob("", 73, 2, 3, 12, 15, 23, 5433.31, 5483.89, 8.06);
mob("", 74, 2, 3, 12, 15, 23, 5433.31, 5483.89, 8.06);
mob("", 32, 1, 3, 12, 15, 23, 5343.86, 5483.62, 4.88);
mob("", 43, 2, 3, 12, 15, 23, 5343.86, 5483.62, 4.88);
mob("", 74, 1, 3, 12, 15, 23, 5343.86, 5483.62, 4.88);
mob("", 75, 2, 3, 12, 15, 23, 5343.86, 5483.62, 4.88);
mob("", 44, 1, 3, 12, 15, 23, 5343.86, 5483.62, 4.88);
mob("", 92, 1, 3, 12, 15, 23, 5343.86, 5483.62, 4.88);
mob("", 45, 1, 3, 12, 15, 23, 5343.86, 5483.62, 4.88);
mob("", 74, 2, 3, 12, 15, 23, 5293.79, 5465.84, 7.11);
mob("", 43, 2, 3, 12, 15, 23, 5293.79, 5465.84, 7.11);
mob("", 75, 1, 3, 12, 15, 23, 5293.79, 5465.84, 7.11);
mob("", 72, 1, 4, 12, 20, 23, 5387.04, 5494.31, 6.23);
mob("", 73, 2, 4, 12, 20, 23, 5387.04, 5494.31, 6.23);
mob("", 74, 1, 4, 12, 20, 23, 5387.04, 5494.31, 6.23);
mob("", 75, 1, 4, 12, 20, 23, 5387.04, 5494.31, 6.23);
mob("", 73, 2, 2, 12, 17, 23, 5374.81, 5469.16, 5.52);
mob("", 74, 2, 2, 12, 17, 23, 5374.81, 5469.16, 5.52);
mob("", 74, 1, 5, 11, 17, 23, 5423.33, 5440.75, 5.06);
mob("", 72, 1, 5, 11, 17, 23, 5423.33, 5440.75, 5.06);
mob("", 9, 2, 3, 10, 10, 23, 5339.9, 5467.53, 7.84);
mob("", 10, 1, 3, 10, 10, 23, 5339.9, 5467.53, 7.84);
mob("", 73, 1, 2, 10, 22, 23, 5465.48, 5440.09, 5.44);
mob("", 74, 1, 2, 10, 22, 23, 5465.48, 5440.09, 5.44);
mob("", 75, 1, 2, 10, 22, 23, 5465.48, 5440.09, 5.44);
mob("", 73, 1, 1, 30, 15, 23, 5487.34, 5507.53, 5.02);
mob("", 74, 1, 1, 30, 15, 23, 5487.34, 5507.53, 5.02);
mob("", 75, 1, 1, 30, 15, 23, 5487.34, 5507.53, 5.02);
mob("", 76, 1, 1, 30, 15, 23, 5487.34, 5507.53, 5.02);
mob("", 74, 2, 5, 9, 21, 23, 5464.29, 5464.9, 4.81);
mob("", 75, 2, 5, 9, 21, 23, 5464.29, 5464.9, 4.81);
mob("", 74, 1, 5, 9, 21, 23, 5464.29, 5464.9, 4.81);
mob("", 75, 2, 5, 9, 21, 23, 5464.29, 5464.9, 4.81);
mob("", 9, 2, 3, 10, 10, 23, 5442.83, 5508.92, 8.66);
mob("", 10, 1, 3, 10, 10, 23, 5442.83, 5508.92, 8.66);
mob("", 9, 2, 3, 10, 10, 23, 5516.58, 5506.54, 8.85);
mob("", 10, 1, 3, 10, 10, 23, 5516.58, 5506.54, 8.85);
mob("", 42, 1, 8, 9, 29, 23, 5068.3, 5300.71, 29.99);
mob("", 73, 2, 8, 9, 29, 23, 5068.3, 5300.71, 29.99);
mob("", 74, 1, 8, 9, 29, 23, 5068.3, 5300.71, 29.99);
mob("", 74, 1, 8, 9, 29, 23, 5068.3, 5300.71, 29.99);
mob("", 44, 1, 8, 9, 29, 23, 5068.3, 5300.71, 29.99);
mob("", 75, 1, 8, 9, 29, 23, 5068.3, 5300.71, 29.99);
mob("", 75, 2, 8, 9, 29, 23, 5068.3, 5300.71, 29.99);
mob("", 73, 1, 4, 10, 18, 23, 5084.14, 5313.01, 32.8);
mob("", 74, 1, 4, 10, 18, 23, 5084.14, 5313.01, 32.8);
mob("", 74, 1, 4, 10, 18, 23, 5084.14, 5313.01, 32.8);
mob("", 75, 1, 4, 10, 18, 23, 5084.14, 5313.01, 32.8);
mob("", 44, 1, 4, 10, 18, 23, 5084.14, 5313.01, 32.8);
mob("", 75, 1, 4, 10, 18, 23, 5084.14, 5313.01, 32.8);
mob("", 74, 2, 4, 10, 18, 23, 5084.14, 5313.01, 32.8);
mob("", 32, 1, 4, 12, 19, 23, 5093.64, 5411.6, 31.42);
mob("", 31, 1, 4, 12, 19, 23, 5093.64, 5411.6, 31.42);
mob("", 31, 1, 4, 12, 19, 23, 5093.64, 5411.6, 31.42);
mob("", 33, 1, 4, 12, 19, 23, 5093.64, 5411.6, 31.42);
mob("", 34, 1, 4, 12, 19, 23, 5093.64, 5411.6, 31.42);
mob("", 33, 1, 4, 12, 19, 23, 5093.64, 5411.6, 31.42);
mob("", 9, 2, 3, 15, 10, 23, 5037.92, 5426.14, 31.98);
mob("", 10, 2, 3, 15, 10, 23, 5037.92, 5426.14, 31.98);
mob("", 319, 2, 2, 10, 10, 23, 5102.5, 5370.55, 22.27);
mob("", 319, 2, 2, 10, 10, 23, 5001.41, 5396.8, 22.19);
mob("", 319, 2, 2, 10, 10, 23, 4974.9, 5400.74, 24.42);
mob("", 43, 1, 1, 15, 10, 23, 5207.04, 5313.91, 32.67);
mob("", 43, 1, 1, 15, 10, 23, 5207.04, 5313.91, 32.67);
mob("", 74, 1, 1, 15, 10, 23, 5207.04, 5313.91, 32.67);
mob("", 81, 1, 1, 20, 5, 23, 5202.73, 5436.11, 35.79);
mob("", 81, 1, 1, 15, 10, 23, 5180.53, 5375.29, 31.31);
mob("", 81, 1, 1, 15, 10, 23, 5180.53, 5375.29, 31.31);
mob("", 45, 1, 1, 15, 10, 23, 5180.53, 5375.29, 31.31);
mob("", 96, 1, 1, 15, 10, 23, 5180.53, 5375.29, 31.31);
mob("", 81, 1, 1, 20, 5, 23, 5226.62, 5424.2, 34.4);
mob("", 9, 1, 3, 13, 20, 23, 5204.93, 5302.35, 32.82);
mob("", 8, 1, 3, 13, 20, 23, 5204.93, 5302.35, 32.82);
mob("", 10, 1, 3, 13, 20, 23, 5204.93, 5302.35, 32.82);
mob("", 74, 1, 1, 15, 10, 23, 5216.36, 5302.44, 33.39);
mob("", 44, 1, 1, 15, 10, 23, 5216.36, 5302.44, 33.39);
mob("", 44, 1, 1, 20, 10, 23, 5203.38, 5370.53, 29.17);
mob("", 44, 1, 1, 20, 10, 23, 5241.91, 5425.62, 38.61);
mob("", 81, 1, 1, 20, 5, 23, 5217.27, 5431.62, 35.62);
mob("", 81, 1, 1, 20, 5, 23, 5195.63, 5380.37, 31.11);
mob("", 319, 2, 2, 10, 10, 23, 5202.25, 5347.54, 21.99);
mob("", 319, 2, 2, 10, 10, 23, 5161.26, 5332.98, 16.94);
mob("", 319, 2, 2, 10, 10, 23, 5147.63, 5350.44, 18.55);
mob("", 319, 2, 2, 10, 10, 23, 5177.32, 5349.4, 21.72);
mob("", 319, 2, 2, 10, 10, 23, 5126.36, 5365.05, 21.2);
mob("", 74, 1, 3, 20, 15, 23, 5293.05, 5288.69, 34.21);
mob("", 72, 2, 3, 20, 15, 23, 5293.05, 5288.69, 34.21);
mob("", 75, 1, 3, 20, 15, 23, 5293.05, 5288.69, 34.21);
mob("", 10, 4, 3, 15, 20, 23, 5323.5, 5288.63, 34.05);
mob("", 44, 1, 1, 20, 5, 23, 5349.99, 5390.37, 33.62);
mob("", 81, 1, 1, 20, 5, 23, 5317.65, 5370.52, 31.53);
mob("", 45, 1, 1, 20, 5, 23, 5355.62, 5373.93, 34.32);
mob("", 81, 1, 1, 20, 10, 23, 5369.98, 5374.49, 36.26);
mob("", 81, 1, 1, 20, 10, 23, 5299.12, 5403.43, 32.72);
mob("", 9, 2, 3, 10, 10, 23, 5313.87, 5399.79, 31.66);
mob("", 10, 1, 3, 10, 10, 23, 5313.87, 5399.79, 31.66);
mob("", 9, 2, 3, 10, 10, 23, 5332.17, 5373.73, 34.94);
mob("", 10, 1, 3, 10, 10, 23, 5332.17, 5373.73, 34.94);
mob("", 319, 2, 2, 10, 10, 23, 5309.83, 5333.29, 20.08);
mob("", 72, 1, 5, 11, 17, 23, 5464.78, 5395.75, 4.13);
mob("", 75, 2, 5, 11, 17, 23, 5464.78, 5395.75, 4.13);
mob("", 74, 1, 5, 11, 17, 23, 5464.78, 5395.75, 4.13);
mob("", 74, 1, 5, 11, 17, 23, 5475.87, 5406, 4.96);
mob("", 75, 2, 5, 11, 17, 23, 5475.87, 5406, 4.96);
mob("", 74, 1, 5, 11, 17, 23, 5475.87, 5406, 4.96);
mob("", 75, 2, 5, 9, 20, 23, 5491.33, 5434.9, 7.41);
mob("", 74, 2, 5, 9, 20, 23, 5491.33, 5434.9, 7.41);
mob("", 75, 1, 5, 9, 20, 23, 5491.33, 5434.9, 7.41);
mob("", 74, 1, 5, 9, 20, 23, 5491.33, 5434.9, 7.41);
mob("", 73, 1, 4, 10, 18, 23, 5108.1, 5231.6, 31.99);
mob("", 74, 1, 4, 10, 18, 23, 5108.1, 5231.6, 31.99);
mob("", 74, 1, 4, 10, 18, 23, 5108.1, 5231.6, 31.99);
mob("", 75, 1, 4, 10, 18, 23, 5108.1, 5231.6, 31.99);
mob("", 44, 1, 4, 10, 18, 23, 5108.1, 5231.6, 31.99);
mob("", 75, 1, 4, 10, 18, 23, 5108.1, 5231.6, 31.99);
mob("", 74, 2, 4, 10, 18, 23, 5108.1, 5231.6, 31.99);
mob("", 73, 1, 4, 9, 18, 23, 5107.65, 5277.39, 31.55);
mob("", 74, 1, 4, 9, 18, 23, 5107.65, 5277.39, 31.55);
mob("", 74, 1, 4, 9, 18, 23, 5107.65, 5277.39, 31.55);
mob("", 75, 1, 4, 9, 18, 23, 5107.65, 5277.39, 31.55);
mob("", 44, 1, 4, 9, 18, 23, 5107.65, 5277.39, 31.55);
mob("", 75, 1, 4, 9, 18, 23, 5107.65, 5277.39, 31.55);
mob("", 74, 2, 4, 9, 18, 23, 5107.65, 5277.39, 31.55);
mob("", 43, 3, 2, 15, 20, 23, 5095.03, 5160.25, 37.19);
mob("", 1, 0, 2, 15, 20, 23, 5095.03, 5160.25, 37.19);
mob("", 1, 0, 2, 15, 20, 23, 5095.03, 5160.25, 37.19);
mob("", 9, 1, 2, 10, 20, 23, 5096.86, 5162.16, 37.26);
mob("", 8, 1, 2, 10, 20, 23, 5096.86, 5162.16, 37.26);
mob("", 10, 1, 2, 10, 20, 23, 5096.86, 5162.16, 37.26);
mob("", 41, 5, 3, 9, 20, 23, 5046.23, 5231.42, 46.14);
mob("", 10, 2, 4, 10, 20, 23, 5056.09, 5220.91, 46.2);
mob("", 8, 1, 4, 10, 20, 23, 5056.09, 5220.91, 46.2);
mob("", 9, 1, 4, 10, 20, 23, 5056.09, 5220.91, 46.2);
mob("", 73, 2, 12, 10, 29, 23, 5170.86, 5133.82, 33);
mob("", 74, 2, 12, 10, 29, 23, 5170.86, 5133.82, 33);
mob("", 74, 1, 12, 10, 29, 23, 5170.86, 5133.82, 33);
mob("", 75, 1, 12, 10, 29, 23, 5170.86, 5133.82, 33);
mob("", 44, 1, 12, 10, 29, 23, 5170.86, 5133.82, 33);
mob("", 75, 1, 12, 10, 29, 23, 5170.86, 5133.82, 33);
mob("", 74, 2, 12, 10, 29, 23, 5170.86, 5133.82, 33);
mob("", 42, 2, 10, 8, 33, 23, 5133.08, 5194.13, 34);
mob("", 73, 2, 10, 8, 33, 23, 5133.08, 5194.13, 34);
mob("", 74, 1, 10, 8, 33, 23, 5133.08, 5194.13, 34);
mob("", 43, 1, 10, 8, 33, 23, 5133.08, 5194.13, 34);
mob("", 44, 1, 10, 8, 33, 23, 5133.08, 5194.13, 34);
mob("", 75, 2, 10, 8, 33, 23, 5133.08, 5194.13, 34);
mob("", 45, 1, 10, 8, 33, 23, 5133.08, 5194.13, 34);
mob("", 319, 2, 2, 10, 10, 23, 5184.24, 5256.68, 21.85);
mob("", 319, 2, 2, 10, 10, 23, 5245.58, 5147.33, 19.57);
mob("", 10, 2, 4, 10, 20, 23, 5181.88, 5163.76, 34.24);
mob("", 8, 1, 4, 10, 20, 23, 5181.88, 5163.76, 34.24);
mob("", 9, 1, 4, 10, 20, 23, 5181.88, 5163.76, 34.24);
mob("", 74, 1, 3, 20, 15, 23, 5333.18, 5276.63, 37.69);
mob("", 72, 2, 3, 20, 15, 23, 5333.18, 5276.63, 37.69);
mob("", 75, 1, 3, 20, 15, 23, 5333.18, 5276.63, 37.69);
mob("", 44, 1, 1, 20, 10, 23, 5311.24, 5275.25, 32.99);
mob("", 31, 2, 3, 15, 30, 23, 5408.51, 5205.55, 7.67);
mob("", 44, 1, 3, 15, 30, 23, 5408.51, 5205.55, 7.67);
mob("", 81, 1, 3, 15, 30, 23, 5408.51, 5205.55, 7.67);
mob("", 45, 1, 3, 15, 30, 23, 5408.51, 5205.55, 7.67);
mob("", 31, 1, 3, 15, 30, 23, 5408.51, 5205.55, 7.67);
mob("", 81, 2, 2, 15, 20, 23, 5533.21, 5242.79, 1.46);
mob("", 82, 1, 2, 15, 20, 23, 5533.21, 5242.79, 1.46);
mob("", 81, 2, 3, 20, 30, 23, 5457.76, 5235.05, 7.04);
mob("", 82, 1, 3, 20, 30, 23, 5457.76, 5235.05, 7.04);
mob("", 45, 1, 3, 20, 30, 23, 5457.76, 5235.05, 7.04);
mob("", 81, 3, 3, 20, 30, 23, 5457.76, 5235.05, 7.04);
mob("", 320, 1, 4, 10, 20, 23, 5443.27, 5141.93, -13.56);
mob("", 319, 1, 4, 10, 20, 23, 5443.27, 5141.93, -13.56);
mob("", 321, 2, 4, 10, 20, 23, 5443.27, 5141.93, -13.56);
mob("", 31, 2, 1, 20, 30, 23, 5543.14, 5210.31, 1.63);
mob("", 32, 1, 1, 20, 30, 23, 5543.14, 5210.31, 1.63);
mob("", 73, 1, 3, 10, 18, 23, 5104.03, 5027.75, 46.01);
mob("", 74, 1, 3, 10, 18, 23, 5104.03, 5027.75, 46.01);
mob("", 41, 1, 3, 10, 18, 23, 5104.03, 5027.75, 46.01);
mob("", 10, 2, 4, 10, 20, 23, 5114.72, 5110.13, 33.97);
mob("", 8, 1, 4, 10, 20, 23, 5114.72, 5110.13, 33.97);
mob("", 9, 1, 4, 10, 20, 23, 5114.72, 5110.13, 33.97);
mob("", 1, 0, 10, 10, 20, 23, 5044.39, 5091.64, 33.99);
mob("", 1, 0, 10, 10, 20, 23, 5044.39, 5091.64, 33.99);
mob("", 1, 0, 10, 10, 20, 23, 5044.39, 5091.64, 33.99);
mob("", 1, 0, 10, 10, 20, 23, 5044.39, 5091.64, 33.99);
mob("", 1, 0, 10, 10, 20, 23, 5044.39, 5091.64, 33.99);
mob("", 1, 0, 10, 10, 20, 23, 5044.39, 5091.64, 33.99);
mob("", 1, 0, 10, 10, 20, 23, 5044.39, 5091.64, 33.99);
mob("", 31, 1, 2, 14, 40, 23, 5083.19, 5005.66, 39.46);
mob("", 15, 1, 2, 14, 40, 23, 5083.19, 5005.66, 39.46);
mob("", 72, 1, 2, 14, 40, 23, 5083.19, 5005.66, 39.46);
mob("", 73, 1, 2, 14, 40, 23, 5083.19, 5005.66, 39.46);
mob("", 8, 1, 5, 18, 20, 23, 5111.17, 5067.17, 43.21);
mob("", 9, 1, 5, 18, 20, 23, 5111.17, 5067.17, 43.21);
mob("", 302, 2, 5, 18, 20, 23, 5111.17, 5067.17, 43.21);
mob("", 71, 1, 3, 25, 25, 23, 5124.65, 5058.86, 36.67);
mob("", 72, 1, 3, 25, 25, 23, 5124.65, 5058.86, 36.67);
mob("", 43, 1, 3, 25, 25, 23, 5124.65, 5058.86, 36.67);
mob("", 31, 1, 3, 25, 25, 23, 5124.65, 5058.86, 36.67);
mob("", 73, 2, 3, 10, 18, 23, 5174.35, 5071.01, 33.14);
mob("", 74, 2, 3, 10, 18, 23, 5174.35, 5071.01, 33.14);
mob("", 74, 1, 3, 10, 18, 23, 5174.35, 5071.01, 33.14);
mob("", 75, 1, 3, 10, 18, 23, 5174.35, 5071.01, 33.14);
mob("", 44, 1, 3, 10, 18, 23, 5174.35, 5071.01, 33.14);
mob("", 75, 1, 3, 10, 18, 23, 5174.35, 5071.01, 33.14);
mob("", 74, 2, 3, 10, 18, 23, 5174.35, 5071.01, 33.14);
mob("", 319, 2, 2, 10, 10, 23, 5242.85, 5102.4, 20.47);
mob("", 319, 2, 2, 10, 10, 23, 5242.08, 5071.15, 20.17);
mob("", 319, 2, 2, 10, 10, 23, 5242.3, 5032.46, 18.8);
mob("", 319, 2, 2, 10, 10, 23, 5205.86, 5005.55, 17.21);
mob("", 43, 1, 3, 15, 20, 23, 5279.06, 5041.89, 33.67);
mob("", 44, 1, 3, 15, 20, 23, 5279.06, 5041.89, 33.67);
mob("", 45, 1, 3, 15, 20, 23, 5279.06, 5041.89, 33.67);
mob("", 44, 1, 3, 15, 20, 23, 5279.06, 5041.89, 33.67);
mob("", 81, 1, 6, 8, 27, 23, 5386.89, 4966.3, 23.09);
mob("", 75, 1, 6, 8, 27, 23, 5386.89, 4966.3, 23.09);
mob("", 81, 1, 6, 8, 27, 23, 5386.89, 4966.3, 23.09);
mob("", 75, 1, 6, 8, 27, 23, 5386.89, 4966.3, 23.09);
mob("", 82, 2, 6, 8, 27, 23, 5386.89, 4966.3, 23.09);
mob("", 82, 2, 6, 8, 27, 23, 5386.89, 4966.3, 23.09);
mob("", 82, 2, 6, 8, 27, 23, 5386.89, 4966.3, 23.09);
mob("", 42, 1, 4, 10, 19, 23, 5329.84, 4978.26, 27.09);
mob("", 43, 1, 4, 10, 19, 23, 5329.84, 4978.26, 27.09);
mob("", 74, 1, 4, 10, 19, 23, 5329.84, 4978.26, 27.09);
mob("", 43, 1, 4, 10, 19, 23, 5329.84, 4978.26, 27.09);
mob("", 44, 1, 4, 10, 19, 23, 5329.84, 4978.26, 27.09);
mob("", 75, 2, 4, 10, 19, 23, 5329.84, 4978.26, 27.09);
mob("", 45, 1, 4, 10, 19, 23, 5329.84, 4978.26, 27.09);
mob("", 34, 1, 2, 15, 20, 23, 5287.29, 4995.11, 32.46);
mob("", 44, 1, 2, 15, 20, 23, 5287.29, 4995.11, 32.46);
mob("", 45, 1, 2, 15, 20, 23, 5287.29, 4995.11, 32.46);
mob("", 31, 1, 1, 15, 15, 23, 5285.29, 5113.27, 35.34);
mob("", 42, 1, 1, 15, 15, 23, 5285.29, 5113.27, 35.34);
mob("", 15, 1, 2, 13, 20, 23, 5287.52, 5096.19, 34.61);
mob("", 15, 1, 2, 13, 20, 23, 5287.52, 5096.19, 34.61);
mob("", 42, 1, 2, 15, 28, 23, 5440.14, 5035.22, 22.54);
mob("", 81, 2, 2, 15, 28, 23, 5440.14, 5035.22, 22.54);
mob("", 31, 1, 2, 15, 28, 23, 5440.14, 5035.22, 22.54);
mob("", 45, 1, 2, 15, 28, 23, 5440.14, 5035.22, 22.54);
mob("", 42, 1, 4, 6, 19, 23, 5449.77, 5010.97, 14.99);
mob("", 81, 2, 4, 6, 19, 23, 5449.77, 5010.97, 14.99);
mob("", 31, 1, 4, 6, 19, 23, 5449.77, 5010.97, 14.99);
mob("", 43, 1, 4, 6, 19, 23, 5449.77, 5010.97, 14.99);
mob("", 44, 1, 4, 6, 19, 23, 5449.77, 5010.97, 14.99);
mob("", 31, 2, 4, 6, 19, 23, 5449.77, 5010.97, 14.99);
mob("", 45, 1, 4, 6, 19, 23, 5449.77, 5010.97, 14.99);
mob("", 81, 1, 3, 19, 25, 23, 5491.15, 4960.29, 14.01);
mob("", 31, 1, 3, 19, 25, 23, 5491.15, 4960.29, 14.01);
mob("", 44, 1, 3, 19, 25, 23, 5491.15, 4960.29, 14.01);
mob("", 45, 1, 3, 19, 25, 23, 5491.15, 4960.29, 14.01);
mob("", 15, 2, 2, 20, 15, 23, 5044.62, 4918.11, 30.12);
mob("", 15, 3, 3, 15, 20, 23, 5086.23, 4950.63, 30.39);
mob("", 31, 1, 3, 15, 20, 23, 5086.23, 4950.63, 30.39);
mob("", 42, 1, 3, 15, 20, 23, 5086.23, 4950.63, 30.39);
mob("", 33, 1, 2, 15, 15, 23, 5268.05, 4933.51, 37.89);
mob("", 34, 1, 2, 15, 15, 23, 5268.05, 4933.51, 37.89);
mob("", 33, 1, 2, 15, 15, 23, 5225.47, 4943.67, 33.23);
mob("", 34, 1, 2, 15, 15, 23, 5225.47, 4943.67, 33.23);
mob("", 34, 1, 2, 15, 15, 23, 5225.47, 4943.67, 33.23);
mob("", 43, 2, 2, 15, 40, 23, 5248.42, 4918.03, 33.74);
mob("", 15, 1, 1, 13, 20, 23, 5120.03, 4904.64, 30.68);
mob("", 43, 1, 1, 13, 20, 23, 5120.03, 4904.64, 30.68);
mob("", 31, 1, 1, 13, 20, 23, 5120.03, 4904.64, 30.68);
mob("", 41, 1, 1, 13, 20, 23, 5120.03, 4904.64, 30.68);
mob("", 301, 4, 4, 10, 20, 23, 5248.97, 4911.95, 32.62);
mob("", 15, 2, 2, 20, 20, 23, 5120.38, 4934.46, 31.29);
mob("", 31, 1, 2, 20, 20, 23, 5120.38, 4934.46, 31.29);
mob("", 43, 1, 2, 20, 20, 23, 5120.38, 4934.46, 31.29);
mob("", 73, 2, 3, 15, 15, 23, 5283.16, 4952.72, 40.93);
mob("", 44, 1, 3, 15, 15, 23, 5283.16, 4952.72, 40.93);
mob("", 75, 1, 3, 15, 15, 23, 5283.16, 4952.72, 40.93);
mob("", 81, 2, 5, 8, 18, 23, 5422.5, 4941.09, 19.68);
mob("", 75, 1, 5, 8, 18, 23, 5422.5, 4941.09, 19.68);
mob("", 81, 1, 5, 8, 18, 23, 5422.5, 4941.09, 19.68);
mob("", 75, 1, 5, 8, 18, 23, 5422.5, 4941.09, 19.68);
mob("", 82, 1, 5, 8, 18, 23, 5422.5, 4941.09, 19.68);
mob("", 82, 1, 5, 8, 18, 23, 5422.5, 4941.09, 19.68);
mob("", 82, 1, 5, 8, 18, 23, 5422.5, 4941.09, 19.68);
mob("", 1, 0, 10, 10, 20, 23, 5364.08, 4875.03, 36.82);
mob("", 1, 0, 10, 10, 20, 23, 5364.08, 4875.03, 36.82);
mob("", 1, 0, 10, 10, 20, 23, 5364.08, 4875.03, 36.82);
mob("", 1, 0, 10, 10, 20, 23, 5364.08, 4875.03, 36.82);
mob("", 1, 0, 10, 10, 20, 23, 5364.08, 4875.03, 36.82);
mob("", 1, 0, 10, 10, 20, 23, 5364.08, 4875.03, 36.82);
mob("", 1, 0, 10, 10, 20, 23, 5364.08, 4875.03, 36.82);
mob("", 81, 2, 3, 8, 18, 23, 5436.3, 4871.78, 23.08);
mob("", 75, 2, 3, 8, 18, 23, 5436.3, 4871.78, 23.08);
mob("", 81, 1, 3, 8, 18, 23, 5436.3, 4871.78, 23.08);
mob("", 75, 1, 3, 8, 18, 23, 5436.3, 4871.78, 23.08);
mob("", 82, 2, 3, 8, 18, 23, 5436.3, 4871.78, 23.08);
mob("", 82, 2, 3, 8, 18, 23, 5436.3, 4871.78, 23.08);
mob("", 82, 2, 3, 8, 18, 23, 5436.3, 4871.78, 23.08);
mob("", 81, 2, 4, 8, 18, 23, 5481.28, 4881.92, 25.49);
mob("", 75, 2, 4, 8, 18, 23, 5481.28, 4881.92, 25.49);
mob("", 81, 1, 4, 8, 18, 23, 5481.28, 4881.92, 25.49);
mob("", 75, 1, 4, 8, 18, 23, 5481.28, 4881.92, 25.49);
mob("", 82, 2, 4, 8, 18, 23, 5481.28, 4881.92, 25.49);
mob("", 82, 2, 4, 8, 18, 23, 5481.28, 4881.92, 25.49);
mob("", 82, 2, 4, 8, 18, 23, 5481.28, 4881.92, 25.49);
mob("", 1, 0, 10, 10, 20, 23, 5459.78, 4872.74, 24.72);
mob("", 1, 0, 10, 10, 20, 23, 5459.78, 4872.74, 24.72);
mob("", 1, 0, 10, 10, 20, 23, 5459.78, 4872.74, 24.72);
mob("", 1, 0, 10, 10, 20, 23, 5459.78, 4872.74, 24.72);
mob("", 1, 0, 10, 10, 20, 23, 5459.78, 4872.74, 24.72);
mob("", 1, 0, 10, 10, 20, 23, 5459.78, 4872.74, 24.72);
mob("", 1, 0, 10, 10, 20, 23, 5459.78, 4872.74, 24.72);
mob("", 31, 1, 3, 15, 23, 23, 5454.28, 4958.7, 24.69);
mob("", 33, 1, 3, 15, 23, 23, 5454.28, 4958.7, 24.69);
mob("", 44, 1, 3, 15, 23, 23, 5454.28, 4958.7, 24.69);
| apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.