repo_name
stringlengths
6
78
path
stringlengths
4
206
copies
stringclasses
281 values
size
stringlengths
4
7
content
stringlengths
625
1.05M
license
stringclasses
15 values
kidaa/Awakening-Core3
bin/scripts/object/draft_schematic/chemistry/medpack_poison_health_c.lua
2
3730
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version object_draft_schematic_chemistry_medpack_poison_health_c = object_draft_schematic_chemistry_shared_medpack_poison_health_c:new { templateType = DRAFTSCHEMATIC, customObjectName = "Health Poison Delivery Unit - C", craftingToolTab = 64, -- (See DraftSchemticImplementation.h) complexity = 35, size = 3, xpType = "crafting_medicine_general", xp = 100, assemblySkill = "combat_medicine_assembly", experimentingSkill = "combat_medicine_experimentation", customizationSkill = "medicine_customization", customizationOptions = {}, customizationStringNames = {}, customizationDefaults = {}, ingredientTemplateNames = {"craft_chemical_ingredients_n", "craft_chemical_ingredients_n", "craft_chemical_ingredients_n", "craft_chemical_ingredients_n", "craft_chemical_ingredients_n", "craft_chemical_ingredients_n"}, ingredientTitleNames = {"body_shell", "organic_element", "inorganic_element", "delivery_medium", "drug_duration_compound", "drug_strength_compound"}, ingredientSlotType = {0, 0, 0, 1, 1, 1}, resourceTypes = {"metal_nonferrous", "vegetable_fungi", "fuel_petrochem_liquid", "object/tangible/component/chemistry/shared_dispersal_mechanism.iff", "object/tangible/component/chemistry/shared_resilience_compound.iff", "object/tangible/component/chemistry/shared_infection_amplifier.iff"}, resourceQuantities = {8, 20, 20, 1, 2, 2}, contribution = {100, 100, 100, 100, 100, 100}, targetTemplate = "object/tangible/medicine/crafted/medpack_poison_health_c.iff", additionalTemplates = { } } ObjectTemplates:addTemplate(object_draft_schematic_chemistry_medpack_poison_health_c, "object/draft_schematic/chemistry/medpack_poison_health_c.iff")
lgpl-3.0
kidaa/Awakening-Core3
bin/scripts/object/tangible/component/armor/deflector_shield_ion_feed_unit.lua
3
2308
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version object_tangible_component_armor_deflector_shield_ion_feed_unit = object_tangible_component_armor_shared_deflector_shield_ion_feed_unit:new { } ObjectTemplates:addTemplate(object_tangible_component_armor_deflector_shield_ion_feed_unit, "object/tangible/component/armor/deflector_shield_ion_feed_unit.iff")
lgpl-3.0
kevinmel2000/sl4a
lua/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
apache-2.0
kidaa/Awakening-Core3
bin/scripts/object/draft_schematic/furniture/furniture_lamp_table_s01_on.lua
2
3279
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version object_draft_schematic_furniture_furniture_lamp_table_s01_on = object_draft_schematic_furniture_shared_furniture_lamp_table_s01_on:new { templateType = DRAFTSCHEMATIC, customObjectName = "Table-top Lamp \'Tatooine\'", craftingToolTab = 512, -- (See DraftSchemticImplementation.h) complexity = 16, size = 1, xpType = "crafting_structure_general", xp = 140, assemblySkill = "structure_assembly", experimentingSkill = "structure_experimentation", customizationSkill = "structure_customization", customizationOptions = {}, customizationStringNames = {}, customizationDefaults = {}, ingredientTemplateNames = {"craft_furniture_ingredients_n", "craft_furniture_ingredients_n", "craft_furniture_ingredients_n"}, ingredientTitleNames = {"lamp_body", "lamp_assembly", "shade"}, ingredientSlotType = {0, 0, 0}, resourceTypes = {"metal", "metal", "mineral"}, resourceQuantities = {35, 15, 20}, contribution = {100, 100, 100}, targetTemplate = "object/tangible/furniture/all/frn_all_light_lamp_table_s01.iff", additionalTemplates = { } } ObjectTemplates:addTemplate(object_draft_schematic_furniture_furniture_lamp_table_s01_on, "object/draft_schematic/furniture/furniture_lamp_table_s01_on.iff")
lgpl-3.0
kidaa/Awakening-Core3
bin/scripts/object/building/poi/tatooine_valariangang_large2.lua
1
2252
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version object_building_poi_tatooine_valariangang_large2 = object_building_poi_shared_tatooine_valariangang_large2:new { } ObjectTemplates:addTemplate(object_building_poi_tatooine_valariangang_large2, "object/building/poi/tatooine_valariangang_large2.iff")
lgpl-3.0
kidaa/Awakening-Core3
bin/scripts/object/tangible/poi/objects.lua
165
2016
--Copyright (C) 2009 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version --which carries forward this exception.
lgpl-3.0
kidaa/Awakening-Core3
bin/scripts/object/tangible/deed/naboo/objects.lua
165
2016
--Copyright (C) 2009 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version --which carries forward this exception.
lgpl-3.0
kidaa/Awakening-Core3
bin/scripts/object/tangible/npc/objects.lua
165
2016
--Copyright (C) 2009 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version --which carries forward this exception.
lgpl-3.0
kidaa/Awakening-Core3
bin/scripts/object/building/faction_perk/objects.lua
165
2016
--Copyright (C) 2009 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version --which carries forward this exception.
lgpl-3.0
Fighter19/cuberite
Server/Plugins/APIDump/Classes/Plugins.lua
4
23130
return { cPlugin = { Desc = [[cPlugin describes a Lua plugin. This page is dedicated to new-style plugins and contain their functions. Each plugin has its own Plugin object. ]], Functions = { GetDirectory = { Return = "string", Notes = "<b>OBSOLETE</b>, use GetFolderName() instead!" }, GetFolderName = { Params = "", Return = "string", Notes = "Returns the name of the folder where the plugin's files are. (APIDump)" }, GetLoadError = { Params = "", Return = "string", Notes = "If the plugin failed to load, returns the error message for the failure." }, GetLocalDirectory = { Notes = "<b>OBSOLETE</b>, use GetLocalFolder instead." }, GetLocalFolder = { Return = "string", Notes = "Returns the path where the plugin's files are. (Plugins/APIDump)" }, GetName = { Return = "string", Notes = "Returns the name of the plugin." }, GetStatus = { Params = "", Return = "{{cPluginManager#PluginStatus|PluginStatus}}", Notes = "Returns the status of the plugin (loaded, disabled, unloaded, error, not found)" }, GetVersion = { Return = "number", Notes = "Returns the version of the plugin." }, IsLoaded = { Params = "", Return = "", Notes = "" }, SetName = { Params = "string", Notes = "Sets the name of the Plugin." }, SetVersion = { Params = "number", Notes = "Sets the version of the plugin." }, }, }, -- cPlugin cPluginLua = { Desc = "", Functions = { AddWebTab = { Params = "", Return = "", Notes = "Adds a new webadmin tab" }, }, Inherits = "cPlugin", }, -- cPluginLua cPluginManager = { Desc = [[ This class is used for generic plugin-related functionality. The plugin manager has a list of all plugins, can enable or disable plugins, manages hooks and in-game console commands.</p> <p> Plugins can be identified by either the PluginFolder or PluginName. Note that these two can differ, refer to <a href="https://forum.cuberite.org/thread-1877.html">the forum</a> for detailed discussion. <p> There is one instance of cPluginManager in Cuberite, to get it, call either {{cRoot|cRoot}}:Get():GetPluginManager() or cPluginManager:Get() function.</p> <p> Note that some functions are "static", that means that they are called using a dot operator instead of the colon operator. For example: <pre class="prettyprint lang-lua"> cPluginManager.AddHook(cPluginManager.HOOK_CHAT, OnChatMessage); </pre></p> ]], Functions = { AddHook = { { Params = "{{cPluginManager#Hooks|HookType}}, [HookFunction]", Return = "", Notes = "(STATIC) Informs the plugin manager that it should call the specified function when the specified hook event occurs. If a function is not specified, a default global function name is looked up, based on the hook type" }, { Params = "{{cPlugin|Plugin}}, {{cPluginManager#Hooks|HookType}}, [HookFunction]", Return = "", Notes = "(STATIC, <b>DEPRECATED</b>) Informs the plugin manager that it should call the specified function when the specified hook event occurs. If a function is not specified, a default function name is looked up, based on the hook type. NOTE: This format is deprecated and the server outputs a warning if it is used!" }, }, BindCommand = { { Params = "Command, Permission, Callback, HelpString", Return = "[bool]", Notes = "(STATIC) Binds an in-game command with the specified callback function, permission and help string. By common convention, providing an empty string for HelpString will hide the command from the /help display. Returns true if successful, logs to console and returns no value on error. The callback uses the following signature: <pre class=\"prettyprint lang-lua\">function(Split, {{cPlayer|Player}})</pre> The Split parameter contains an array-table of the words that the player has sent, Player is the {{cPlayer}} object representing the player who sent the command. If the callback returns true, the command is assumed to have executed successfully; in all other cases the server sends a warning to the player that the command is unknown (this is so that subcommands can be implemented)." }, { Params = "Command, Permission, Callback, HelpString", Return = "[bool]", Notes = "Binds an in-game command with the specified callback function, permission and help string. By common convention, providing an empty string for HelpString will hide the command from the /help display. Returns true if successful, logs to console and returns no value on error. The callback uses the following signature: <pre class=\"prettyprint lang-lua\">function(Split, {{cPlayer|Player}})</pre> The Split parameter contains an array-table of the words that the player has sent, Player is the {{cPlayer}} object representing the player who sent the command. If the callback returns true, the command is assumed to have executed successfully; in all other cases the server sends a warning to the player that the command is unknown (this is so that subcommands can be implemented)." }, }, BindConsoleCommand = { { Params = "Command, Callback, HelpString", Return = "[bool]", Notes = "(STATIC) Binds a console command with the specified callback function and help string. By common convention, providing an empty string for HelpString will hide the command from the \"help\" console command. Returns true if successful, logs to console and returns no value on error. The callback uses the following signature: <pre class=\"prettyprint lang-lua\">function(Split)</pre> The Split parameter contains an array-table of the words that the admin has typed. If the callback returns true, the command is assumed to have executed successfully; in all other cases the server issues a warning to the console that the command is unknown (this is so that subcommands can be implemented)." }, { Params = "Command, Callback, HelpString", Return = "[bool]", Notes = "Binds a console command with the specified callback function and help string. By common convention, providing an empty string for HelpString will hide the command from the \"help\" console command. Returns true if successful, logs to console and returns no value on error. The callback uses the following signature: <pre class=\"prettyprint lang-lua\">function(Split)</pre> The Split parameter contains an array-table of the words that the admin has typed. If the callback returns true, the command is assumed to have executed successfully; in all other cases the server issues a warning to the console that the command is unknown (this is so that subcommands can be implemented)." }, }, CallPlugin = { Params = "PluginName, FunctionName, [FunctionArgs...]", Return = "[FunctionRets]", Notes = "(STATIC) Calls the specified function in the specified plugin, passing all the given arguments to it. If it succeeds, it returns all the values returned by that function. If it fails, returns no value at all. Note that only strings, numbers, bools, nils and classes can be used for parameters and return values; tables and functions cannot be copied across plugins." }, DoWithPlugin = { Params = "PluginName, CallbackFn", Return = "bool", Notes = "(STATIC) Calls the CallbackFn for the specified plugin, if found. A plugin can be found even if it is currently unloaded, disabled or errored, the callback should check the plugin status. If the plugin is not found, this function returns false, otherwise it returns the bool value that the callback has returned. The CallbackFn has the following signature: <pre class=\"prettyprint lang-lua\">function ({{cPlugin|Plugin}})</pre>" }, ExecuteCommand = { Params = "{{cPlayer|Player}}, CommandStr", Return = "{{cPluginManager#CommandResult|CommandResult}}", Notes = "Executes the command as if given by the specified Player. Checks permissions." }, ExecuteConsoleCommand = { Params = "CommandStr", Return = "bool, string", Notes = "Executes the console command as if given by the admin on the console. If the command is successfully executed, returns true and the text that would be output to the console normally. On error it returns false and an error message." }, FindPlugins = { Params = "", Return = "", Notes = "<b>OBSOLETE</b>, use RefreshPluginList() instead"}, ForceExecuteCommand = { Params = "{{cPlayer|Player}}, CommandStr", Return = "{{cPluginManager#CommandResult|CommandResult}}", Notes = "Same as ExecuteCommand, but doesn't check permissions" }, ForEachCommand = { Params = "CallbackFn", Return = "bool", Notes = "Calls the CallbackFn function for each command that has been bound using BindCommand(). The CallbackFn has the following signature: <pre class=\"prettyprint lang-lua\">function(Command, Permission, HelpString)</pre> If the callback returns true, the enumeration is aborted and this API function returns false; if it returns false or no value, the enumeration continues with the next command, and the API function returns true." }, ForEachConsoleCommand = { Params = "CallbackFn", Return = "bool", Notes = "Calls the CallbackFn function for each command that has been bound using BindConsoleCommand(). The CallbackFn has the following signature: <pre class=\"prettyprint lang-lua\">function (Command, HelpString)</pre> If the callback returns true, the enumeration is aborted and this API function returns false; if it returns false or no value, the enumeration continues with the next command, and the API function returns true." }, ForEachPlugin = { Params = "CallbackFn", Return = "bool", Notes = "(STATIC) Calls the CallbackFn function for each plugin that is currently discovered by Cuberite (including disabled, unloaded and errrored plugins). The CallbackFn has the following signature: <pre class=\"prettyprint lang-lua\">function ({{cPlugin|Plugin}})</pre> If the callback returns true, the enumeration is aborted and this API function returns false; if it returns false or no value, the enumeration continues with the next command, and the API function returns true." }, Get = { Params = "", Return = "cPluginManager", Notes = "(STATIC) Returns the single instance of the plugin manager" }, GetAllPlugins = { Params = "", Return = "table", Notes = "Returns a table (dictionary) of all plugins, [name => value], where value is a valid {{cPlugin}} if the plugin is loaded, or the bool value false if the plugin is not loaded." }, GetCommandPermission = { Params = "Command", Return = "Permission", Notes = "Returns the permission needed for executing the specified command" }, GetCurrentPlugin = { Params = "", Return = "{{cPlugin}}", Notes = "Returns the {{cPlugin}} object for the calling plugin. This is the same object that the Initialize function receives as the argument." }, GetNumLoadedPlugins = { Params = "", Return = "number", Notes = "Returns the number of loaded plugins (psLoaded only)" }, GetNumPlugins = { Params = "", Return = "number", Notes = "Returns the number of plugins, including the disabled, errored, unloaded and not-found ones" }, GetPlugin = { Params = "PluginName", Return = "{{cPlugin}}", Notes = "(<b>DEPRECATED, UNSAFE</b>) Returns a plugin handle of the specified plugin, or nil if such plugin is not loaded. Note thatdue to multithreading the handle is not guaranteed to be safe for use when stored - a single-plugin reload may have been triggered in the mean time for the requested plugin." }, GetPluginsPath = { Params = "", Return = "string", Notes = "Returns the path where the individual plugin folders are located. Doesn't include the path separator at the end of the returned string." }, IsCommandBound = { Params = "Command", Return = "bool", Notes = "Returns true if in-game Command is already bound (by any plugin)" }, IsConsoleCommandBound = { Params = "Command", Return = "bool", Notes = "Returns true if console Command is already bound (by any plugin)" }, IsPluginLoaded = { Params = "PluginName", Return = "", Notes = "Returns true if the specified plugin is loaded." }, LoadPlugin = { Params = "PluginFolder", Return = "", Notes = "(<b>DEPRECATED</b>) Loads a plugin from the specified folder. NOTE: Loading plugins may be an unsafe operation and may result in a deadlock or a crash. This API is deprecated and might be removed." }, LogStackTrace = { Params = "", Return = "", Notes = "(STATIC) Logs a current stack trace of the Lua engine to the server console log. Same format as is used when the plugin fails." }, RefreshPluginList = { Params = "", Return = "", Notes = "Refreshes the list of plugins to include all folders inside the Plugins folder (potentially new disabled plugins)" }, ReloadPlugins = { Params = "", Return = "", Notes = "Reloads all active plugins" }, UnloadPlugin = { Params = "PluginName", Return = "", Notes = "Queues the specified plugin to be unloaded. To avoid deadlocks, the unloading happens in the main tick thread asynchronously." }, }, ConstantGroups= { CommandResult = { Include = "^cr.*", TextBefore = [[ Results that the (Force)ExecuteCommand return. This gives information if the command is executed or not and the reason. ]], }, }, Constants = { crBlocked = { Notes = "When a plugin stopped the command using the OnExecuteCommand hook" }, crError = { Notes = "When the command handler for the given command results in an error" }, crExecuted = { Notes = "When the command is successfully executed." }, crNoPermission = { Notes = "When the player doesn't have permission to execute the given command." }, crUnknownCommand = { Notes = "When the given command doesn't exist." }, HOOK_BLOCK_SPREAD = { Notes = "Called when a block spreads based on world conditions" }, HOOK_BLOCK_TO_PICKUPS = { Notes = "Called when a block has been dug and is being converted to pickups. The server has provided the default pickups and the plugins may modify them." }, HOOK_BREWING_COMPLETING = { "Called before a brewing stand completes a brewing process." }, HOOK_BREWING_COMPLETED = { "Called when a brewing stand completed a brewing process." }, HOOK_CHAT = { Notes = "Called when a client sends a chat message that is not a command. The plugin may modify the chat message" }, HOOK_CHUNK_AVAILABLE = { Notes = "Called when a chunk is loaded or generated and becomes available in the {{cWorld|world}}." }, HOOK_CHUNK_GENERATED = { Notes = "Called after a chunk is generated. A plugin may do last modifications on the generated chunk before it is handed of to the {{cWorld|world}}." }, HOOK_CHUNK_GENERATING = { Notes = "Called before a chunk is generated. A plugin may override some parts of the generation algorithm." }, HOOK_CHUNK_UNLOADED = { Notes = "Called after a chunk has been unloaded from a {{cWorld|world}}." }, HOOK_CHUNK_UNLOADING = { Notes = "Called before a chunk is unloaded from a {{cWorld|world}}. The chunk has already been saved." }, HOOK_COLLECTING_PICKUP = { Notes = "Called when a player is about to collect a pickup." }, HOOK_CRAFTING_NO_RECIPE = { Notes = "Called when a player has items in the crafting slots and the server cannot locate any recipe. Plugin may provide a recipe." }, HOOK_DISCONNECT = { Notes = "Called after the player has disconnected." }, HOOK_ENTITY_ADD_EFFECT = { Notes = "Called when an effect is being added to an {{cEntity|entity}}. Plugin may refuse the effect." }, HOOK_ENTITY_CHANGED_WORLD = { Notes = "Called after a entity has changed the world." }, HOOK_ENTITY_CHANGING_WORLD = { Notes = "Called before a entity has changed the world. Plugin may disallow a entity to change the world." }, HOOK_ENTITY_TELEPORT = { Notes = "Called when an {{cEntity|entity}} is being teleported. Plugin may refuse the teleportation." }, HOOK_EXECUTE_COMMAND = { Notes = "Called when a client sends a chat message that is recognized as a command, before handing that command to the regular command handler. A plugin may stop the command from being handled. This hook is called even when the player doesn't have permissions for the command." }, HOOK_EXPLODED = { Notes = "Called after an explosion has been processed in a {{cWorld|world}}." }, HOOK_EXPLODING = { Notes = "Called before an explosion is processed in a {{cWorld|world}}. A plugin may alter the explosion parameters or cancel the explosion altogether." }, HOOK_HANDSHAKE = { Notes = "Called when a Handshake packet is received from a client." }, HOOK_HOPPER_PULLING_ITEM = { Notes = "Called when a hopper is pulling an item from the container above it." }, HOOK_HOPPER_PUSHING_ITEM = { Notes = "Called when a hopper is pushing an item into the container it is aimed at." }, HOOK_KILLED = { Notes = "Called when an entity has been killed." }, HOOK_KILLING = { Notes = "Called when an entity has just been killed. A plugin may resurrect the entity by setting its health to above zero." }, HOOK_LOGIN = { Notes = "Called when a Login packet is sent to the client, before the client is queued for authentication." }, HOOK_PLAYER_ANIMATION = { Notes = "Called when a client send the Animation packet." }, HOOK_PLAYER_BREAKING_BLOCK = { Notes = "Called when a player is about to break a block. A plugin may cancel the event." }, HOOK_PLAYER_BROKEN_BLOCK = { Notes = "Called after a player has broken a block." }, HOOK_PLAYER_DESTROYED = { Notes = "Called when the {{cPlayer}} object is destroyed - a player has disconnected." }, HOOK_PLAYER_EATING = { Notes = "Called when the player starts eating a held item. Plugins may abort the eating." }, HOOK_PLAYER_FISHED = { Notes = "Called when the player reels the fishing rod back in, after the server decides the player's fishing reward." }, HOOK_PLAYER_FISHING = { Notes = "Called when the player reels the fishing rod back in, plugins may alter the fishing reward." }, HOOK_PLAYER_FOOD_LEVEL_CHANGE = { Notes = "Called when the player's food level is changing. Plugins may refuse the change." }, HOOK_PLAYER_JOINED = { Notes = "Called when the player entity has been created. It has not yet been fully initialized." }, HOOK_PLAYER_LEFT_CLICK = { Notes = "Called when the client sends the LeftClick packet." }, HOOK_PLAYER_MOVING = { Notes = "Called when the player has moved and the movement is now being applied." }, HOOK_PLAYER_PLACED_BLOCK = { Notes = "Called when the player has just placed a block" }, HOOK_PLAYER_PLACING_BLOCK = { Notes = "Called when the player is about to place a block. A plugin may cancel the event." }, HOOK_PLAYER_RIGHT_CLICK = { Notes = "Called when the client sends the RightClick packet." }, HOOK_PLAYER_RIGHT_CLICKING_ENTITY = { Notes = "Called when the client sends the UseEntity packet." }, HOOK_PLAYER_SHOOTING = { Notes = "Called when the player releases the mouse button to fire their bow." }, HOOK_PLAYER_SPAWNED = { Notes = "Called after the player entity has been created. The entity is fully initialized and is spawning in the {{cWorld|world}}." }, HOOK_PLAYER_TOSSING_ITEM = { Notes = "Called when the player is tossing the held item (keypress Q)" }, HOOK_PLAYER_USED_BLOCK = { Notes = "Called after the player has right-clicked a block" }, HOOK_PLAYER_USED_ITEM = { Notes = "Called after the player has right-clicked with a usable item in their hand." }, HOOK_PLAYER_USING_BLOCK = { Notes = "Called when the player is about to use (right-click) a block" }, HOOK_PLAYER_USING_ITEM = { Notes = "Called when the player is about to right-click with a usable item in their hand." }, HOOK_PLUGINS_LOADED = { Notes = "Called after all plugins have loaded." }, HOOK_PLUGIN_MESSAGE = { Notes = "Called when a PluginMessage packet is received from a client." }, HOOK_POST_CRAFTING = { Notes = "Called after a valid recipe has been chosen for the current contents of the crafting grid. Plugins may modify the recipe." }, HOOK_PRE_CRAFTING = { Notes = "Called before a recipe is searched for the current contents of the crafting grid. Plugins may provide a recipe and cancel the built-in search." }, HOOK_PROJECTILE_HIT_BLOCK = { Notes = "Called when a {{cProjectileEntity|projectile}} hits a block." }, HOOK_PROJECTILE_HIT_ENTITY = { Notes = "Called when a {{cProjectileEntity|projectile}} hits an {{cEntity|entity}}." }, HOOK_SERVER_PING = { Notes = "Called when a client pings the server from the server list. Plugins may change the favicon, server description, players online and maximum players values." }, HOOK_SPAWNED_ENTITY = { Notes = "Called after an entity is spawned in a {{cWorld|world}}. The entity is already part of the world." }, HOOK_SPAWNED_MONSTER = { Notes = "Called after a mob is spawned in a {{cWorld|world}}. The mob is already part of the world." }, HOOK_SPAWNING_ENTITY = { Notes = "Called just before an entity is spawned in a {{cWorld|world}}." }, HOOK_SPAWNING_MONSTER = { Notes = "Called just before a mob is spawned in a {{cWorld|world}}." }, HOOK_TAKE_DAMAGE = { Notes = "Called when an entity is taking any kind of damage. Plugins may modify the damage value, effects, source or cancel the damage." }, HOOK_TICK = { Notes = "Called when the main server thread ticks - 20 times a second." }, HOOK_UPDATED_SIGN = { Notes = "Called after a {{cSignEntity|sign}} text has been updated, either by a player or by any external means." }, HOOK_UPDATING_SIGN = { Notes = "Called before a {{cSignEntity|sign}} text is updated, either by a player or by any external means." }, HOOK_WEATHER_CHANGED = { Notes = "Called after the weather has changed." }, HOOK_WEATHER_CHANGING = { Notes = "Called just before the weather changes" }, HOOK_WORLD_STARTED = { Notes = "Called when a world has been started." }, HOOK_WORLD_TICK = { Notes = "Called in each world's tick thread when the game logic is about to tick (20 times a second)." }, psDisabled = { Notes = "The plugin is not enabled in settings.ini" }, psError = { Notes = "The plugin is enabled in settings.ini, but it has run into an error while loading. Use {{cPlugin}}:GetLoadError() to identify the error." }, psLoaded = { Notes = "The plugin is enabled and loaded." }, psNotFound = { Notes = "The plugin has been loaded, but is no longer present on disk." }, psUnloaded = { Notes = "The plugin is enabled in settings.ini, but it has been unloaded (by a command)." }, }, -- constants ConstantGroups = { Hooks = { Include = {"HOOK_.*"}, TextBefore = [[ These constants identify individual hooks. To register the plugin to receive notifications on hooks, use the cPluginManager:AddHook() function. For detailed description of each hook, see the <a href='index.html#hooks'> hooks reference</a>.]], }, PluginStatus = { Include = {"ps.*"}, TextBefore = [[ These constants are used to report status of individual plugins. Use {{cPlugin}}:GetStatus() to query the status of a plugin; use cPluginManager::ForEachPlugin() to iterate over plugins.]], }, CommandResult = { Include = {"cr.*"}, TextBefore = [[ These constants are returned by the ExecuteCommand() function to identify the exact outcome of the operation.]], }, }, }, -- cPluginManager }
apache-2.0
kidaa/Awakening-Core3
bin/scripts/object/static/item/item_security_scanner.lua
3
2220
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version object_static_item_item_security_scanner = object_static_item_shared_item_security_scanner:new { } ObjectTemplates:addTemplate(object_static_item_item_security_scanner, "object/static/item/item_security_scanner.iff")
lgpl-3.0
kidaa/Awakening-Core3
bin/scripts/object/weapon/ranged/grenade/grenade_fragmentation_light.lua
1
6079
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version object_weapon_ranged_grenade_grenade_fragmentation_light = object_weapon_ranged_grenade_shared_grenade_fragmentation_light:new { objectMenuComponent = {"cpp", "ThrowGrenadeMenuComponent"}, playerRaces = { "object/creature/player/bothan_male.iff", "object/creature/player/bothan_female.iff", "object/creature/player/human_male.iff", "object/creature/player/human_female.iff", "object/creature/player/ithorian_male.iff", "object/creature/player/ithorian_female.iff", "object/creature/player/moncal_male.iff", "object/creature/player/moncal_female.iff", "object/creature/player/rodian_male.iff", "object/creature/player/rodian_female.iff", "object/creature/player/sullustan_male.iff", "object/creature/player/sullustan_female.iff", "object/creature/player/trandoshan_male.iff", "object/creature/player/trandoshan_female.iff", "object/creature/player/twilek_male.iff", "object/creature/player/twilek_female.iff", "object/creature/player/wookiee_male.iff", "object/creature/player/wookiee_female.iff", "object/creature/player/zabrak_male.iff", "object/creature/player/zabrak_female.iff" }, -- RANGEDATTACK, MELEEATTACK, FORCEATTACK, TRAPATTACK, GRENADEATTACK, HEAVYACIDBEAMATTACK, -- HEAVYLIGHTNINGBEAMATTACK, HEAVYPARTICLEBEAMATTACK, HEAVYROCKETLAUNCHERATTACK, HEAVYLAUNCHERATTACK attackType = GENADEATTACK, -- ENERGY, KINETIC, ELECTRICITY, STUN, BLAST, HEAT, COLD, ACID, FORCE, LIGHTSABER damageType = BLAST, -- NONE, LIGHT, MEDIUM, HEAVY armorPiercing = NONE, -- combat_rangedspecialize_bactarifle, combat_rangedspecialize_rifle, combat_rangedspecialize_pistol, combat_rangedspecialize_heavy, combat_rangedspecialize_carbine -- combat_meleespecialize_unarmed, combat_meleespecialize_twohand, combat_meleespecialize_polearm, combat_meleespecialize_onehand, combat_general, -- combat_meleespecialize_twohandlightsaber, combat_meleespecialize_polearmlightsaber, combat_meleespecialize_onehandlightsaber xpType = "combat_general", -- See http://www.ocdsoft.com/files/certifications.xls certificationsRequired = { "cert_grenade_fragmentation_light" }, -- See http://www.ocdsoft.com/files/accuracy.xls creatureAccuracyModifiers = { "thrown_accuracy" }, -- See http://www.ocdsoft.com/files/defense.xls defenderDefenseModifiers = { "ranged_defense" }, -- See http://www.ocdsoft.com/files/speed.xls speedModifiers = { "thrown_speed" }, -- Leave blank for now damageModifiers = { }, useCount = 5, combatSpam = "grenade_frag", healthAttackCost = 50, actionAttackCost = 50, mindAttackCost = 10, pointBlankRange = 0, pointBlankAccuracy = -10, idealRange = 20, idealAccuracy = 15, maxRange = 64, maxRangeAccuracy = -30, minDamage = 50, maxDamage = 150, attackSpeed = 4, woundsRatio = 10, numberExperimentalProperties = {1, 1, 2, 2, 2, 2, 1, 2, 2, 2, 2, 1, 2, 2, 2}, experimentalProperties = {"XX", "XX", "OQ", "SR", "OQ", "SR", "OQ", "SR", "OQ", "SR", "SR", "OQ", "SR", "OQ", "SR", "OQ", "SR", "OQ", "SR", "XX", "OQ", "SR", "OQ", "SR", "OQ", "SR"}, experimentalWeights = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, experimentalGroupTitles = {"null", "null", "expDamage", "expDamage", "expDamage", "expDamage", "null", "expRange", "expRange", "expRange", "expRange", "null", "expEffeciency", "expEffeciency", "expEffeciency"}, experimentalSubGroupTitles = {"null", "null", "mindamage", "maxdamage", "attackspeed", "woundchance", "hitpoints", "zerorangemod", "maxrangemod", "midrangemod", "midrange", "maxrange", "attackhealthcost", "attackactioncost", "attackmindcost"}, experimentalMin = {0, 0, 130, 220, 5.5, 7, 1000, -16, -45, 0, 10, 64, 75, 65, 13}, experimentalMax = {0, 0, 170, 760, 2.5, 13, 1000, 14, 15, 30, 30, 64, 35, 25, 7}, experimentalPrecision = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, experimentalCombineType = {0, 0, 1, 1, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, 1}, } ObjectTemplates:addTemplate(object_weapon_ranged_grenade_grenade_fragmentation_light, "object/weapon/ranged/grenade/grenade_fragmentation_light.iff")
lgpl-3.0
Death15/SuperSwatchTG
plugins/stats.lua
458
4098
-- Saves the number of messages from a user -- Can check the number of messages with !stats do local NUM_MSG_MAX = 5 local TIME_CHECK = 4 -- seconds local function user_print_name(user) if user.print_name then return user.print_name end local text = '' if user.first_name then text = user.last_name..' ' end if user.lastname then text = text..user.last_name end return text end -- Returns a table with `name` and `msgs` local function get_msgs_user_chat(user_id, chat_id) local user_info = {} local uhash = 'user:'..user_id local user = redis:hgetall(uhash) local um_hash = 'msgs:'..user_id..':'..chat_id user_info.msgs = tonumber(redis:get(um_hash) or 0) user_info.name = user_print_name(user)..' ('..user_id..')' return user_info end local function chat_stats(chat_id) -- Users on chat local hash = 'chat:'..chat_id..':users' local users = redis:smembers(hash) local users_info = {} -- Get user info for i = 1, #users do local user_id = users[i] local user_info = get_msgs_user_chat(user_id, chat_id) table.insert(users_info, user_info) end -- Sort users by msgs number table.sort(users_info, function(a, b) if a.msgs and b.msgs then return a.msgs > b.msgs end end) local text = '' for k,user in pairs(users_info) do text = text..user.name..' => '..user.msgs..'\n' end return text end -- Save stats, ban user local function pre_process(msg) -- Ignore service msg if msg.service then print('Service message') return msg end -- Save user on Redis if msg.from.type == 'user' then local hash = 'user:'..msg.from.id print('Saving user', hash) if msg.from.print_name then redis:hset(hash, 'print_name', msg.from.print_name) end if msg.from.first_name then redis:hset(hash, 'first_name', msg.from.first_name) end if msg.from.last_name then redis:hset(hash, 'last_name', msg.from.last_name) end end -- Save stats on Redis if msg.to.type == 'chat' then -- User is on chat local hash = 'chat:'..msg.to.id..':users' redis:sadd(hash, msg.from.id) end -- Total user msgs local hash = 'msgs:'..msg.from.id..':'..msg.to.id redis:incr(hash) -- Check flood if msg.from.type == 'user' then local hash = 'user:'..msg.from.id..':msgs' local msgs = tonumber(redis:get(hash) or 0) if msgs > NUM_MSG_MAX then print('User '..msg.from.id..'is flooding '..msgs) msg = nil end redis:setex(hash, TIME_CHECK, msgs+1) end return msg end local function bot_stats() local redis_scan = [[ local cursor = '0' local count = 0 repeat local r = redis.call("SCAN", cursor, "MATCH", KEYS[1]) cursor = r[1] count = count + #r[2] until cursor == '0' return count]] -- Users local hash = 'msgs:*:'..our_id local r = redis:eval(redis_scan, 1, hash) local text = 'Users: '..r hash = 'chat:*:users' r = redis:eval(redis_scan, 1, hash) text = text..'\nChats: '..r return text end local function run(msg, matches) if matches[1]:lower() == "stats" then if not matches[2] then if msg.to.type == 'chat' then local chat_id = msg.to.id return chat_stats(chat_id) else return 'Stats works only on chats' end end if matches[2] == "bot" then if not is_sudo(msg) then return "Bot stats requires privileged user" else return bot_stats() end end if matches[2] == "chat" then if not is_sudo(msg) then return "This command requires privileged user" else return chat_stats(matches[3]) end end end end return { description = "Plugin to update user stats.", usage = { "!stats: Returns a list of Username [telegram_id]: msg_num", "!stats chat <chat_id>: Show stats for chat_id", "!stats bot: Shows bot stats (sudo users)" }, patterns = { "^!([Ss]tats)$", "^!([Ss]tats) (chat) (%d+)", "^!([Ss]tats) (bot)" }, run = run, pre_process = pre_process } end
gpl-2.0
Whit3Tig3R/telegrambot2
plugins/stats.lua
458
4098
-- Saves the number of messages from a user -- Can check the number of messages with !stats do local NUM_MSG_MAX = 5 local TIME_CHECK = 4 -- seconds local function user_print_name(user) if user.print_name then return user.print_name end local text = '' if user.first_name then text = user.last_name..' ' end if user.lastname then text = text..user.last_name end return text end -- Returns a table with `name` and `msgs` local function get_msgs_user_chat(user_id, chat_id) local user_info = {} local uhash = 'user:'..user_id local user = redis:hgetall(uhash) local um_hash = 'msgs:'..user_id..':'..chat_id user_info.msgs = tonumber(redis:get(um_hash) or 0) user_info.name = user_print_name(user)..' ('..user_id..')' return user_info end local function chat_stats(chat_id) -- Users on chat local hash = 'chat:'..chat_id..':users' local users = redis:smembers(hash) local users_info = {} -- Get user info for i = 1, #users do local user_id = users[i] local user_info = get_msgs_user_chat(user_id, chat_id) table.insert(users_info, user_info) end -- Sort users by msgs number table.sort(users_info, function(a, b) if a.msgs and b.msgs then return a.msgs > b.msgs end end) local text = '' for k,user in pairs(users_info) do text = text..user.name..' => '..user.msgs..'\n' end return text end -- Save stats, ban user local function pre_process(msg) -- Ignore service msg if msg.service then print('Service message') return msg end -- Save user on Redis if msg.from.type == 'user' then local hash = 'user:'..msg.from.id print('Saving user', hash) if msg.from.print_name then redis:hset(hash, 'print_name', msg.from.print_name) end if msg.from.first_name then redis:hset(hash, 'first_name', msg.from.first_name) end if msg.from.last_name then redis:hset(hash, 'last_name', msg.from.last_name) end end -- Save stats on Redis if msg.to.type == 'chat' then -- User is on chat local hash = 'chat:'..msg.to.id..':users' redis:sadd(hash, msg.from.id) end -- Total user msgs local hash = 'msgs:'..msg.from.id..':'..msg.to.id redis:incr(hash) -- Check flood if msg.from.type == 'user' then local hash = 'user:'..msg.from.id..':msgs' local msgs = tonumber(redis:get(hash) or 0) if msgs > NUM_MSG_MAX then print('User '..msg.from.id..'is flooding '..msgs) msg = nil end redis:setex(hash, TIME_CHECK, msgs+1) end return msg end local function bot_stats() local redis_scan = [[ local cursor = '0' local count = 0 repeat local r = redis.call("SCAN", cursor, "MATCH", KEYS[1]) cursor = r[1] count = count + #r[2] until cursor == '0' return count]] -- Users local hash = 'msgs:*:'..our_id local r = redis:eval(redis_scan, 1, hash) local text = 'Users: '..r hash = 'chat:*:users' r = redis:eval(redis_scan, 1, hash) text = text..'\nChats: '..r return text end local function run(msg, matches) if matches[1]:lower() == "stats" then if not matches[2] then if msg.to.type == 'chat' then local chat_id = msg.to.id return chat_stats(chat_id) else return 'Stats works only on chats' end end if matches[2] == "bot" then if not is_sudo(msg) then return "Bot stats requires privileged user" else return bot_stats() end end if matches[2] == "chat" then if not is_sudo(msg) then return "This command requires privileged user" else return chat_stats(matches[3]) end end end end return { description = "Plugin to update user stats.", usage = { "!stats: Returns a list of Username [telegram_id]: msg_num", "!stats chat <chat_id>: Show stats for chat_id", "!stats bot: Shows bot stats (sudo users)" }, patterns = { "^!([Ss]tats)$", "^!([Ss]tats) (chat) (%d+)", "^!([Ss]tats) (bot)" }, run = run, pre_process = pre_process } end
gpl-2.0
assassinbo/assassinboy
plugins/stats.lua
458
4098
-- Saves the number of messages from a user -- Can check the number of messages with !stats do local NUM_MSG_MAX = 5 local TIME_CHECK = 4 -- seconds local function user_print_name(user) if user.print_name then return user.print_name end local text = '' if user.first_name then text = user.last_name..' ' end if user.lastname then text = text..user.last_name end return text end -- Returns a table with `name` and `msgs` local function get_msgs_user_chat(user_id, chat_id) local user_info = {} local uhash = 'user:'..user_id local user = redis:hgetall(uhash) local um_hash = 'msgs:'..user_id..':'..chat_id user_info.msgs = tonumber(redis:get(um_hash) or 0) user_info.name = user_print_name(user)..' ('..user_id..')' return user_info end local function chat_stats(chat_id) -- Users on chat local hash = 'chat:'..chat_id..':users' local users = redis:smembers(hash) local users_info = {} -- Get user info for i = 1, #users do local user_id = users[i] local user_info = get_msgs_user_chat(user_id, chat_id) table.insert(users_info, user_info) end -- Sort users by msgs number table.sort(users_info, function(a, b) if a.msgs and b.msgs then return a.msgs > b.msgs end end) local text = '' for k,user in pairs(users_info) do text = text..user.name..' => '..user.msgs..'\n' end return text end -- Save stats, ban user local function pre_process(msg) -- Ignore service msg if msg.service then print('Service message') return msg end -- Save user on Redis if msg.from.type == 'user' then local hash = 'user:'..msg.from.id print('Saving user', hash) if msg.from.print_name then redis:hset(hash, 'print_name', msg.from.print_name) end if msg.from.first_name then redis:hset(hash, 'first_name', msg.from.first_name) end if msg.from.last_name then redis:hset(hash, 'last_name', msg.from.last_name) end end -- Save stats on Redis if msg.to.type == 'chat' then -- User is on chat local hash = 'chat:'..msg.to.id..':users' redis:sadd(hash, msg.from.id) end -- Total user msgs local hash = 'msgs:'..msg.from.id..':'..msg.to.id redis:incr(hash) -- Check flood if msg.from.type == 'user' then local hash = 'user:'..msg.from.id..':msgs' local msgs = tonumber(redis:get(hash) or 0) if msgs > NUM_MSG_MAX then print('User '..msg.from.id..'is flooding '..msgs) msg = nil end redis:setex(hash, TIME_CHECK, msgs+1) end return msg end local function bot_stats() local redis_scan = [[ local cursor = '0' local count = 0 repeat local r = redis.call("SCAN", cursor, "MATCH", KEYS[1]) cursor = r[1] count = count + #r[2] until cursor == '0' return count]] -- Users local hash = 'msgs:*:'..our_id local r = redis:eval(redis_scan, 1, hash) local text = 'Users: '..r hash = 'chat:*:users' r = redis:eval(redis_scan, 1, hash) text = text..'\nChats: '..r return text end local function run(msg, matches) if matches[1]:lower() == "stats" then if not matches[2] then if msg.to.type == 'chat' then local chat_id = msg.to.id return chat_stats(chat_id) else return 'Stats works only on chats' end end if matches[2] == "bot" then if not is_sudo(msg) then return "Bot stats requires privileged user" else return bot_stats() end end if matches[2] == "chat" then if not is_sudo(msg) then return "This command requires privileged user" else return chat_stats(matches[3]) end end end end return { description = "Plugin to update user stats.", usage = { "!stats: Returns a list of Username [telegram_id]: msg_num", "!stats chat <chat_id>: Show stats for chat_id", "!stats bot: Shows bot stats (sudo users)" }, patterns = { "^!([Ss]tats)$", "^!([Ss]tats) (chat) (%d+)", "^!([Ss]tats) (bot)" }, run = run, pre_process = pre_process } end
gpl-2.0
norman/tlua
tlua/tasks.lua
1
1057
local tablex = require "pl.tablex" module("tlua.tasks", package.seeall) local function print_tasks(descs) local keys = tablex.keys(descs) table.sort(keys) local longest = 0 tablex.foreach(keys, function(v) local len = v:len() if len > longest then longest = len end end) local format = "%-" .. longest + 4 .. "s%s" for _, name in ipairs(keys) do print(string.format(format, name, descs[name])) end end local function list() print("System tasks:") print("-------------") print_tasks(tlua.system_descriptions) print("") print("User tasks:") print("-----------") print_tasks(tlua.descriptions) end local function help() print(string.format("tlua version %s, copyright %s, %s", tlua._version, tlua._author, tlua._year)) print("Released under the MIT License\n") print [[ Tlua is a command-line Lua task runner. The following system-level tasks are available: ]] print_tasks(tlua.system_descriptions) end tlua.system_task("list", "List all tasks", list) tlua.system_task("help", "Show this message", help)
mit
kidaa/Awakening-Core3
bin/scripts/mobile/faction/imperial/coa2_imperial_coordinator.lua
1
1181
coa2_imperial_coordinator = Creature:new { objectName = "@mob/creature_names:coa2_imperial_coordinator", socialGroup = "imperial", pvpFaction = "imperial", faction = "imperial", level = 25, chanceHit = 0.36, damageMin = 240, damageMax = 250, baseXp = 2443, baseHAM = 7200, baseHAMmax = 8800, armor = 0, resists = {0,0,0,0,0,0,0,0,-1}, meatType = "", meatAmount = 0, hideType = "", hideAmount = 0, boneType = "", boneAmount = 0, milk = 0, tamingChance = 0, ferocity = 0, pvpBitmask = NONE, creatureBitmask = NONE, optionsBitmask = 128, diet = HERBIVORE, templates = {"object/mobile/dressed_imperial_officer_m_3.iff"}, lootGroups = { { groups = { {group = "color_crystals", chance = 200000}, {group = "junk", chance = 3600000}, {group = "rifles", chance = 2000000}, {group = "pistols", chance = 2000000}, {group = "clothing_attachments", chance = 1100000}, {group = "armor_attachments", chance = 1100000} }, lootChance = 4000000 } }, weapons = {"imperial_weapons_heavy"}, conversationTemplate = "", attacks = { } } CreatureTemplates:addCreatureTemplate(coa2_imperial_coordinator, "coa2_imperial_coordinator")
lgpl-3.0
kidaa/Awakening-Core3
bin/scripts/object/mobile/dressed_selonian_m_09.lua
3
2200
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version object_mobile_dressed_selonian_m_09 = object_mobile_shared_dressed_selonian_m_09:new { } ObjectTemplates:addTemplate(object_mobile_dressed_selonian_m_09, "object/mobile/dressed_selonian_m_09.iff")
lgpl-3.0
eraffxi/darkstar
scripts/zones/Temenos/mobs/Beli.lua
2
1195
----------------------------------- -- Area: Temenos N T -- NPC: Beli ----------------------------------- package.loaded["scripts/zones/Temenos/TextIDs"] = nil; ----------------------------------- require("scripts/globals/limbus"); require("scripts/zones/Temenos/TextIDs"); ----------------------------------- -- onMobSpawn Action ----------------------------------- function onMobSpawn(mob) end; ----------------------------------- -- onMobEngaged ----------------------------------- function onMobEngaged(mob,target) GetMobByID(16928781):updateEnmity(target); GetMobByID(16928782):updateEnmity(target); end; ----------------------------------- -- onMobDeath ----------------------------------- function onMobDeath(mob, player, isKiller) if (IsMobDead(16928781)==true and IsMobDead(16928782)==true and IsMobDead(16928783)==true ) then GetNPCByID(16928768+19):setPos(200,-82,495); GetNPCByID(16928768+19):setStatus(dsp.status.NORMAL); GetNPCByID(16928768+153):setPos(206,-82,495); GetNPCByID(16928768+153):setStatus(dsp.status.NORMAL); GetNPCByID(16928768+210):setPos(196,-82,495); GetNPCByID(16928768+210):setStatus(dsp.status.NORMAL); end end;
gpl-3.0
kidaa/Awakening-Core3
bin/scripts/object/tangible/wearables/jacket/jacket_s13.lua
3
5184
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version object_tangible_wearables_jacket_jacket_s13 = object_tangible_wearables_jacket_shared_jacket_s13:new { playerRaces = { "object/creature/player/bothan_male.iff", "object/creature/player/bothan_female.iff", "object/creature/player/human_male.iff", "object/creature/player/human_female.iff", "object/creature/player/moncal_male.iff", "object/creature/player/moncal_female.iff", "object/creature/player/rodian_male.iff", "object/creature/player/rodian_female.iff", "object/creature/player/sullustan_male.iff", "object/creature/player/sullustan_female.iff", "object/creature/player/trandoshan_male.iff", "object/creature/player/trandoshan_female.iff", "object/creature/player/twilek_male.iff", "object/creature/player/twilek_female.iff", "object/creature/player/zabrak_male.iff", "object/creature/player/zabrak_female.iff", "object/mobile/vendor/aqualish_female.iff", "object/mobile/vendor/aqualish_male.iff", "object/mobile/vendor/bith_female.iff", "object/mobile/vendor/bith_male.iff", "object/mobile/vendor/bothan_female.iff", "object/mobile/vendor/bothan_male.iff", "object/mobile/vendor/devaronian_male.iff", "object/mobile/vendor/gran_male.iff", "object/mobile/vendor/human_female.iff", "object/mobile/vendor/human_male.iff", "object/mobile/vendor/ishi_tib_male.iff", "object/mobile/vendor/moncal_female.iff", "object/mobile/vendor/moncal_male.iff", "object/mobile/vendor/nikto_male.iff", "object/mobile/vendor/quarren_male.iff", "object/mobile/vendor/rodian_female.iff", "object/mobile/vendor/rodian_male.iff", "object/mobile/vendor/sullustan_female.iff", "object/mobile/vendor/sullustan_male.iff", "object/mobile/vendor/trandoshan_female.iff", "object/mobile/vendor/trandoshan_male.iff", "object/mobile/vendor/twilek_female.iff", "object/mobile/vendor/twilek_male.iff", "object/mobile/vendor/weequay_male.iff", "object/mobile/vendor/zabrak_female.iff", "object/mobile/vendor/zabrak_male.iff" }, numberExperimentalProperties = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, experimentalProperties = {"XX", "XX", "XX", "XX", "XX", "XX", "XX", "XX", "XX", "XX", "XX", "XX", "XX", "XX", "XX", "XX"}, experimentalWeights = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, experimentalGroupTitles = {"null", "null", "null", "null", "null", "null", "null", "null", "null", "null", "null", "null", "null", "null", "null", "null"}, experimentalSubGroupTitles = {"null", "null", "sockets", "hitpoints", "mod_idx_one", "mod_val_one", "mod_idx_two", "mod_val_two", "mod_idx_three", "mod_val_three", "mod_idx_four", "mod_val_four", "mod_idx_five", "mod_val_five", "mod_idx_six", "mod_val_six"}, experimentalMin = {0, 0, 0, 1000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, experimentalMax = {0, 0, 0, 1000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, experimentalPrecision = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, experimentalCombineType = {0, 0, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, } ObjectTemplates:addTemplate(object_tangible_wearables_jacket_jacket_s13, "object/tangible/wearables/jacket/jacket_s13.iff")
lgpl-3.0
RJ/ketama
lua_ketama/test.lua
2
1378
--[[ Copyright (c) 2009, Phoenix Sol - http://github.com/phoenixsol Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ]]-- local ketama = require 'ketama' local ket = ketama.roll('../ketama.servers') --ket:print_continuum() --don't like! local function compare(ket, a, b) --return the greater, or nil if they are equal local result = ket:compare(a,b) if result == 0 then return nil, 'equal' elseif result == 1 then return a else return b end end print("server for 'foo':", ket:get_server('foo')) print("greater of 'foo' and 'bar':", compare(ket, 'foo', 'bar')) print("hashi of 'foo':", ket:hashi('foo')) print("md5 of 'foo':", ket:md5digest('foo')) ket:smoke() print("closed") collectgarbage("collect") print("kthxbye")
bsd-2-clause
kidaa/Awakening-Core3
bin/scripts/object/draft_schematic/bio_engineer/creature/creature_mawgax.lua
1
3343
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version object_draft_schematic_bio_engineer_creature_creature_mawgax = object_draft_schematic_bio_engineer_creature_shared_creature_mawgax:new { templateType = DRAFTSCHEMATIC, customObjectName = "Mawgax", craftingToolTab = 256, -- (See DraftSchemticImplementation.h) complexity = 27, size = 1, xpType = "crafting_bio_engineer_creature", xp = 275, assemblySkill = "bio_engineer_assembly", experimentingSkill = "bio_engineer_experimentation", customizationSkill = "bio_engineer_experimentation", customizationOptions = {}, customizationStringNames = {}, customizationDefaults = {}, ingredientTemplateNames = {"craft_creature_ingredients_n", "craft_creature_ingredients_n", "craft_creature_ingredients_n"}, ingredientTitleNames = {"dna_template", "protein_base", "organic_nutrition_materials"}, ingredientSlotType = {1, 0, 0}, resourceTypes = {"object/tangible/component/dna/shared_dna_template_generic.iff", "creature_food", "flora_food"}, resourceQuantities = {1, 70, 75}, contribution = {100, 100, 100}, targetTemplate = "object/tangible/deed/pet_deed/mawgax_deed.iff", additionalTemplates = { } } ObjectTemplates:addTemplate(object_draft_schematic_bio_engineer_creature_creature_mawgax, "object/draft_schematic/bio_engineer/creature/creature_mawgax.iff")
lgpl-3.0
kidaa/Awakening-Core3
bin/scripts/object/tangible/dungeon/corellian_corvette/corvette_search_rebel_destroy_03.lua
3
2360
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version object_tangible_dungeon_corellian_corvette_corvette_search_rebel_destroy_03 = object_tangible_dungeon_corellian_corvette_shared_corvette_search_rebel_destroy_03:new { } ObjectTemplates:addTemplate(object_tangible_dungeon_corellian_corvette_corvette_search_rebel_destroy_03, "object/tangible/dungeon/corellian_corvette/corvette_search_rebel_destroy_03.iff")
lgpl-3.0
kidaa/Awakening-Core3
bin/scripts/commands/retreat.lua
4
2200
--Copyright (C) 2007 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version --which carries forward this exception. --true = 1, false = 0 RetreatCommand = { name = "retreat", action = "retreat", --actionCRC = action.hashCode(), combatSpam = "retreat_buff", } AddCommand(RetreatCommand)
lgpl-3.0
kidaa/Awakening-Core3
bin/scripts/object/tangible/ship/components/weapon/wpn_subpro_tripleblaster_mark3.lua
3
2336
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version object_tangible_ship_components_weapon_wpn_subpro_tripleblaster_mark3 = object_tangible_ship_components_weapon_shared_wpn_subpro_tripleblaster_mark3:new { } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_wpn_subpro_tripleblaster_mark3, "object/tangible/ship/components/weapon/wpn_subpro_tripleblaster_mark3.iff")
lgpl-3.0
kidaa/Awakening-Core3
bin/scripts/object/draft_schematic/droid/droid_mse.lua
2
3414
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version object_draft_schematic_droid_droid_mse = object_draft_schematic_droid_shared_droid_mse:new { templateType = DRAFTSCHEMATIC, customObjectName = "Deed for: MSE Droid", craftingToolTab = 32, -- (See DraftSchemticImplementation.h) complexity = 15, size = 1, xpType = "crafting_droid_general", xp = 140, assemblySkill = "droid_assembly", experimentingSkill = "droid_experimentation", customizationSkill = "droid_customization", customizationOptions = {}, customizationStringNames = {}, customizationDefaults = {}, ingredientTemplateNames = {"craft_droid_ingredients_n", "craft_droid_ingredients_n", "craft_droid_ingredients_n", "craft_droid_ingredients_n", "craft_droid_ingredients_n", "craft_droid_ingredients_n"}, ingredientTitleNames = {"primary_frame", "body_shell", "droid_brain", "engine_unit", "sensor_suite", "general_droid_module"}, ingredientSlotType = {0, 0, 0, 0, 0, 3}, resourceTypes = {"metal", "chemical", "metal", "metal", "metal", "object/tangible/component/droid/shared_droid_service_module_base.iff"}, resourceQuantities = {20, 15, 12, 15, 6, 1}, contribution = {100, 100, 100, 100, 100, 100}, targetTemplate = "object/tangible/deed/pet_deed/deed_mse_basic.iff", additionalTemplates = { } } ObjectTemplates:addTemplate(object_draft_schematic_droid_droid_mse, "object/draft_schematic/droid/droid_mse.iff")
lgpl-3.0
houqp/koreader
frontend/ui/data/keyboardlayouts/en_keyboard.lua
1
6650
local en_popup = require("ui/data/keyboardlayouts/keypopup/en_popup") local com = en_popup.com -- comma (,) local prd = en_popup.prd -- period (.) local _at = en_popup._at local _eq = en_popup._eq -- equals sign (=) local _A_ = en_popup._A_ local _a_ = en_popup._a_ local _B_ = en_popup._B_ local _b_ = en_popup._b_ local _C_ = en_popup._C_ local _c_ = en_popup._c_ local _D_ = en_popup._D_ local _d_ = en_popup._d_ local _E_ = en_popup._E_ local _e_ = en_popup._e_ local _F_ = en_popup._F_ local _f_ = en_popup._f_ local _G_ = en_popup._G_ local _g_ = en_popup._g_ local _H_ = en_popup._H_ local _h_ = en_popup._h_ local _I_ = en_popup._I_ local _i_ = en_popup._i_ local _J_ = en_popup._J_ local _j_ = en_popup._j_ local _K_ = en_popup._K_ local _k_ = en_popup._k_ local _L_ = en_popup._L_ local _l_ = en_popup._l_ local _M_ = en_popup._M_ local _m_ = en_popup._m_ local _N_ = en_popup._N_ local _n_ = en_popup._n_ local _O_ = en_popup._O_ local _o_ = en_popup._o_ local _P_ = en_popup._P_ local _p_ = en_popup._p_ local _Q_ = en_popup._Q_ local _q_ = en_popup._q_ local _R_ = en_popup._R_ local _r_ = en_popup._r_ local _S_ = en_popup._S_ local _s_ = en_popup._s_ local _T_ = en_popup._T_ local _t_ = en_popup._t_ local _U_ = en_popup._U_ local _u_ = en_popup._u_ local _V_ = en_popup._V_ local _v_ = en_popup._v_ local _W_ = en_popup._W_ local _w_ = en_popup._w_ local _Y_ = en_popup._Y_ local _y_ = en_popup._y_ local _Z_ = en_popup._Z_ local _z_ = en_popup._z_ return { shiftmode_keys = {["Shift"] = true}, symbolmode_keys = {["Sym"] = true, ["ABC"] = true}, utf8mode_keys = {["IM"] = true}, umlautmode_keys = {["Äéß"] = true}, keys = { -- first row { -- 1 2 3 4 5 6 7 8 9 10 11 12 { _Q_, _q_, "„", "0", "Й", "й", "?", "!", "Å", "å", "1", "ª", }, { _W_, _w_, "!", "1", "Ц", "ц", "(", "1", "Ä", "ä", "2", "º", }, { _E_, _e_, _at, "2", "У", "у", ")", "2", "Ö", "ö", "3", "¡", }, { _R_, _r_, "#", "3", "К", "к", "~", "3", "ß", "ß", "4", "¿", }, { _T_, _t_, "+", _eq, "Е", "е", "Ә", "ә", "À", "à", "5", "¼", }, { _Y_, _y_, "€", "(", "Н", "н", "І", "і", "Â", "â", "6", "½", }, { _U_, _u_, "‰", ")", "Г", "г", "Ң", "ң", "Æ", "æ", "7", "¾", }, { _I_, _i_, "|", "\\", "Ш", "ш", "Ғ", "ғ", "Ü", "ü", "8", "©", }, { _O_, _o_, "?", "/", "Щ", "щ", "Х", "х", "È", "è", "9", "®", }, { _P_, _p_, "~", "`", "З", "з", "Ъ", "ъ", "É", "é", "0", "™", }, }, -- second row { -- 1 2 3 4 5 6 7 8 9 10 11 12 { _A_, _a_, "…", _at, "Ф", "ф", "*", "0", "Ê", "ê", "Ş", "ş", }, { _S_, _s_, "$", "4", "Ы", "ы", "+", "4", "Ë", "ë", "İ", "ı", }, { _D_, _d_, "%", "5", "В", "в", "-", "5", "Î", "î", "Ğ", "ğ", }, { _F_, _f_, "^", "6", "А", "а", _eq, "6", "Ï", "ï", "Ć", "ć", }, { _G_, _g_, ":", ";", "П", "п", "Ү", "ү", "Ô", "ô", "Č", "č", }, { _H_, _h_, '"', "'", "Р", "р", "Ұ", "ұ", "Œ", "œ", "Đ", "đ", }, { _J_, _j_, "{", "[", "О", "о", "Қ", "қ", "Ù", "ù", "Š", "š", }, { _K_, _k_, "}", "]", "Л", "л", "Ж", "ж", "Û", "û", "Ž", "ž", }, { _L_, _l_, "_", "-", "Д", "д", "Э", "э", "Ÿ", "ÿ", "Ő", "ő", }, }, -- third row { -- 1 2 3 4 5 6 7 8 9 10 11 12 { label = "Shift", icon = "resources/icons/appbar.arrow.shift.png", width = 1.5 }, { _Z_, _z_, "&", "7", "Я", "я", ":", "7", "Á", "á", "Ű", "ű", }, { "X", "x", "*", "8", "Ч", "ч", ";", "8", "Ø", "ø", "Ã", "ã", }, { _C_, _c_, "£", "9", "С", "с", "'", "9", "Í", "í", "Þ", "þ", }, { _V_, _v_, "<", "‚", "М", "м", "Ө", "ө", "Ñ", "ñ", "Ý", "ý", }, { _B_, _b_, ">", prd, "И", "и", "Һ", "һ", "Ó", "ó", "†", "‡", }, { _N_, _n_, "‘", "↑", "Т", "т", "Б", "б", "Ú", "ú", "–", "—", }, { _M_, _m_, "’", "↓", "Ь", "ь", "Ю", "ю", "Ç", "ç", "…", "¨", }, { label = "Backspace", icon = "resources/icons/appbar.clear.reflect.horizontal.png", width = 1.5 }, }, -- fourth row { { "Sym", "Sym", "ABC", "ABC", "Sym", "Sym", "ABC", "ABC", "Sym", "Sym", "ABC", "ABC", width = 1.5}, { label = "IM", icon = "resources/icons/appbar.globe.wire.png", }, { "Äéß", "Äéß", "Äéß", "Äéß", "Äéß", "Äéß", "Äéß", "Äéß", "Äéß", "Äéß", "Äéß", "Äéß", }, { label = "space", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", width = 3.0}, { com, com, "“", "←", com, com, "Ё", "ё", "Ũ", "ũ", com, com, }, { prd, prd, "”", "→", prd, prd, prd, prd, "Ĩ", "ĩ", prd, prd, }, { label = "Enter", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", icon = "resources/icons/appbar.arrow.enter.png", width = 1.5, }, }, }, }
agpl-3.0
bankiru/nginx-metrix
nginx-metrix/logger.lua
2
1147
local inspect = require 'inspect' local log = function(level, msg, ...) if type(msg) ~= 'string' then msg = inspect(msg) end if length({ ... }) > 0 then msg = msg .. ' :: ' .. inspect({ ... }) end ngx.log(level, '[metrix] ' .. msg) end local stderr = function(...) log(ngx.STDERR, ...) end local emerg = function(...) log(ngx.EMERG, ...) end local alert = function(...) log(ngx.ALERT, ...) end local crit = function(...) log(ngx.CRIT, ...) end local err = function(...) log(ngx.ERR, ...) end local warn = function(...) log(ngx.WARN, ...) end local notice = function(...) log(ngx.NOTICE, ...) end local info = function(...) log(ngx.INFO, ...) end local debug = function(...) log(ngx.DEBUG, ...) end local exports = {} exports.log = log exports.stderr = stderr exports.stderror = stderr exports.emerg = emerg exports.emergency = emerg exports.alert = alert exports.crit = crit exports.critical = crit exports.err = err exports.error = err exports.warn = warn exports.warning = warn exports.notice = notice exports.info = info exports.debug = debug return exports
mit
eraffxi/darkstar
scripts/zones/Castle_Zvahl_Baileys/Zone.lua
1
2887
----------------------------------- -- -- Zone: Castle_Zvahl_Baileys (161) -- ----------------------------------- package.loaded["scripts/zones/Castle_Zvahl_Baileys/TextIDs"] = nil; ----------------------------------- require("scripts/zones/Castle_Zvahl_Baileys/TextIDs"); require("scripts/zones/Castle_Zvahl_Baileys/MobIDs"); require("scripts/globals/conquest"); require("scripts/globals/zone"); ----------------------------------- function onInitialize(zone) zone:registerRegion(1, -90,17,45, -84,19,51); -- map 4 NW porter zone:registerRegion(1, 17,-90,45, -85,18,51); -- map 4 NW porter zone:registerRegion(2, -90,17,-10, -85,18,-5); -- map 4 SW porter zone:registerRegion(3, -34,17,-10, -30,18,-5); -- map 4 SE porter zone:registerRegion(4, -34,17,45, -30,18,51); -- map 4 NE porter UpdateNMSpawnPoint(MARQUIS_ALLOCEN); GetMobByID(MARQUIS_ALLOCEN):setRespawnTime(math.random(900, 10800)); UpdateNMSpawnPoint(MARQUIS_AMON); GetMobByID(MARQUIS_AMON):setRespawnTime(math.random(900, 10800)); UpdateNMSpawnPoint(DUKE_HABORYM); GetMobByID(DUKE_HABORYM):setRespawnTime(math.random(900, 10800)); UpdateNMSpawnPoint(GRAND_DUKE_BATYM); GetMobByID(GRAND_DUKE_BATYM):setRespawnTime(math.random(900, 10800)); UpdateTreasureSpawnPoint(17436997); UpdateTreasureSpawnPoint(17436998); end; function onConquestUpdate(zone, updatetype) local players = zone:getPlayers(); for name, player in pairs(players) do conquestUpdate(zone, player, updatetype, CONQUEST_BASE); end end; function onZoneIn(player,prevZone) local cs = -1; if (player:getXPos() == 0 and player:getYPos() == 0 and player:getZPos() == 0) then player:setPos(-181.969,-35.542,19.995,254); end return cs; end; function onRegionEnter(player,region) switch (region:GetRegionID()): caseof { --------------------------------- [1] = function (x) -- --------------------------------- player:startEvent(3); -- ports player to NW room of map 3 end, --------------------------------- [2] = function (x) -- --------------------------------- player:startEvent(2); -- ports player to SW room of map 3 end, --------------------------------- [3] = function (x) -- --------------------------------- player:startEvent(1); -- ports player to SE room of map 3 end, --------------------------------- [4] = function (x) -- --------------------------------- player:startEvent(0); -- ports player to NE room of map 3 end, default = function (x) --print("default"); end, } end; function onRegionLeave(player,region) end; function onEventUpdate(player,csid,option) end; function onEventFinish(player,csid,option) end;
gpl-3.0
kidaa/Awakening-Core3
bin/scripts/object/tangible/vendor/vendor_terminal_small.lua
3
2236
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version object_tangible_vendor_vendor_terminal_small = object_tangible_vendor_shared_vendor_terminal_small:new { } ObjectTemplates:addTemplate(object_tangible_vendor_vendor_terminal_small, "object/tangible/vendor/vendor_terminal_small.iff")
lgpl-3.0
hartmark/OpenRA
mods/cnc/maps/nod03a/nod03a.lua
3
2082
--[[ Copyright 2007-2020 The OpenRA Developers (see AUTHORS) This file is part of OpenRA, which is free software. It is made available to you under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. For more information, see COPYING. ]] NodUnits = { "bike", "e3", "e1", "bggy", "e1", "e3", "bike", "bggy" } FirstAttackWave = { "e1", "e1", "e1", "e2", } SecondThirdAttackWave = { "e1", "e1", "e2", } SendAttackWave = function(units, spawnPoint) Reinforcements.Reinforce(GDI, units, { spawnPoint }, DateTime.Seconds(1), function(actor) actor.AttackMove(PlayerBase.Location) end) end WorldLoaded = function() Nod = Player.GetPlayer("Nod") GDI = Player.GetPlayer("GDI") InitObjectives(Nod) CapturePrison = Nod.AddObjective("Capture the prison.") DestroyGDI = Nod.AddObjective("Destroy all GDI forces.", "Secondary", false) Trigger.OnCapture(TechCenter, function() Trigger.AfterDelay(DateTime.Seconds(2), function() Nod.MarkCompletedObjective(CapturePrison) end) end) Trigger.OnKilled(TechCenter, function() Nod.MarkFailedObjective(CapturePrison) end) Media.PlaySpeechNotification(Nod, "Reinforce") Reinforcements.Reinforce(Nod, NodUnits, { NodEntry.Location, NodRallyPoint.Location }) Trigger.AfterDelay(DateTime.Seconds(9), function() Reinforcements.Reinforce(Nod, { "mcv" }, { NodEntry.Location, PlayerBase.Location }) end) Trigger.AfterDelay(DateTime.Seconds(20), function() SendAttackWave(FirstAttackWave, AttackWaveSpawnA.Location) end) Trigger.AfterDelay(DateTime.Seconds(50), function() SendAttackWave(SecondThirdAttackWave, AttackWaveSpawnB.Location) end) Trigger.AfterDelay(DateTime.Seconds(100), function() SendAttackWave(SecondThirdAttackWave, AttackWaveSpawnC.Location) end) end Tick = function() if DateTime.GameTime > 2 then if Nod.HasNoRequiredUnits() then Nod.MarkFailedObjective(CapturePrison) end if GDI.HasNoRequiredUnits() then Nod.MarkCompletedObjective(DestroyGDI) end end end
gpl-3.0
kidaa/Awakening-Core3
bin/scripts/object/tangible/terminal/terminal_space.lua
3
2216
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version object_tangible_terminal_terminal_space = object_tangible_terminal_shared_terminal_space:new { } ObjectTemplates:addTemplate(object_tangible_terminal_terminal_space, "object/tangible/terminal/terminal_space.iff")
lgpl-3.0
meshr-net/meshr_tomato-RT-N
usr/lib/lua/luci/model/cbi/luci_statistics/exec.lua
7
2838
--[[ Luci configuration model for statistics - collectd exec plugin configuration (c) 2008 Freifunk Leipzig / Jo-Philipp Wich <xm@leipzig.freifunk.net> 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: exec.lua 7993 2011-11-28 15:19:11Z soma $ ]]-- m = Map("luci_statistics", translate("Exec Plugin Configuration"), translate( "The exec plugin starts external commands to read values " .. "from or to notify external processes when certain threshold " .. "values have been reached." )) -- collectd_exec config section s = m:section( NamedSection, "collectd_exec", "luci_statistics" ) -- collectd_exec.enable enable = s:option( Flag, "enable", translate("Enable this plugin") ) enable.default = 0 -- collectd_exec_input config section (Exec directives) exec = m:section( TypedSection, "collectd_exec_input", translate("Add command for reading values"), translate( "Here you can define external commands which will be " .. "started by collectd in order to read certain values. " .. "The values will be read from stdout." )) exec.addremove = true exec.anonymous = true -- collectd_exec_input.cmdline exec_cmdline = exec:option( Value, "cmdline", translate("Script") ) exec_cmdline.default = "/usr/bin/stat-dhcpusers" -- collectd_exec_input.cmdline exec_cmduser = exec:option( Value, "cmduser", translate("User") ) exec_cmduser.default = "nobody" exec_cmduser.rmempty = true exec_cmduser.optional = true -- collectd_exec_input.cmdline exec_cmdgroup = exec:option( Value, "cmdgroup", translate("Group") ) exec_cmdgroup.default = "nogroup" exec_cmdgroup.rmempty = true exec_cmdgroup.optional = true -- collectd_exec_notify config section (NotifyExec directives) notify = m:section( TypedSection, "collectd_exec_notify", translate("Add notification command"), translate( "Here you can define external commands which will be " .. "started by collectd when certain threshold values have " .. "been reached. The values leading to invokation will be " .. "feeded to the the called programs stdin." )) notify.addremove = true notify.anonymous = true -- collectd_notify_input.cmdline notify_cmdline = notify:option( Value, "cmdline", translate("Script") ) notify_cmdline.default = "/usr/bin/stat-dhcpusers" -- collectd_notify_input.cmdline notify_cmduser = notify:option( Value, "cmduser", translate("User") ) notify_cmduser.default = "nobody" notify_cmduser.rmempty = true notify_cmduser.optional = true -- collectd_notify_input.cmdline notify_cmdgroup = notify:option( Value, "cmdgroup", translate("Group") ) notify_cmdgroup.default = "nogroup" notify_cmdgroup.rmempty = true notify_cmdgroup.optional = true return m
apache-2.0
eraffxi/darkstar
scripts/zones/Qufim_Island/npcs/Tsonga-Hoponga_WW.lua
2
2942
----------------------------------- -- Area: Qufim Island -- NPC: Tsonga-Hoponga, W.W. -- Type: Outpost Conquest Guards -- !pos -245.366 -20.344 299.502 126 ----------------------------------- package.loaded["scripts/zones/Qufim_Island/TextIDs"] = nil; ----------------------------------- require("scripts/globals/conquest"); require("scripts/zones/Qufim_Island/TextIDs"); local guardnation = dsp.nation.WINDURST; -- SANDORIA, BASTOK, WINDURST, 4 = jeuno local guardtype = 3; -- 1: city, 2: foreign, 3: outpost, 4: border local region = dsp.region.QUFIMISLAND; local csid = 0x7ff7; function onTrade(player,npc,trade) tradeConquestGuard(player,npc,trade,guardnation,guardtype); end; function onTrigger(player,npc) if (player:hasKeyItem(getSupplyKey(region)) and player:getNation() == guardnation) then if (supplyRunFresh(player) == 1) then player:startEvent(csid,16,0,0,0,1,0,0,255); -- you have brought us supplies ! else player:showText(npc, CONQUEST - 1); -- "Hmm... These supplies you have brought us are too old to be of any use." player:delKeyItem(getSupplyKey(region)); player:messageSpecial(KEYITEM_OBTAINED + 1, getSupplyKey(region)); player:setVar("supplyQuest_region",0); end else local arg1 = getArg1(guardnation, player) - 1; if (arg1 >= 1792) then -- foreign, non-allied player:startEvent(csid,1808,0,0,0,0,player:getRank(),0,0); else -- citizen or allied player:startEvent(csid,arg1,0,0x3F0000,0,0,getArg6(player),0,0); end end end; function onEventUpdate(player,csid,option) -- printf("OPTION: %u",option); end; function onEventFinish(player,csid,option) -- printf("OPTION: %u",option); if (option == 1) then local duration = (player:getRank() + getNationRank(player:getNation()) + 3) * 3600; player:delStatusEffect(dsp.effect.SIGIL); player:delStatusEffect(dsp.effect.SANCTION); player:delStatusEffect(dsp.effect.SIGNET); player:addStatusEffect(dsp.effect.SIGNET,0,0,duration); -- Grant Signet elseif (option == 2) then player:delKeyItem(getSupplyKey(region)); player:addCP(supplyReward[region + 1]) player:messageSpecial(CONQUEST); -- "You've earned conquest points!" if (hasOutpost(player, region+5) == 0) then local supply_quests = 2^(region+5); player:addNationTeleport(guardnation,supply_quests); player:setVar("supplyQuest_region",0); end elseif (option == 4) then if (player:delGil(giltosetHP(guardnation,player))) then player:setHomePoint(); player:messageSpecial(CONQUEST + 94); -- "Your home point has been set." else player:messageSpecial(CONQUEST + 95); -- "You do not have enough gil to set your home point here." end end end;
gpl-3.0
kidaa/Awakening-Core3
bin/scripts/object/mobile/dressed_noble_fat_human_female_02.lua
3
2248
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version object_mobile_dressed_noble_fat_human_female_02 = object_mobile_shared_dressed_noble_fat_human_female_02:new { } ObjectTemplates:addTemplate(object_mobile_dressed_noble_fat_human_female_02, "object/mobile/dressed_noble_fat_human_female_02.iff")
lgpl-3.0
kidaa/Awakening-Core3
bin/scripts/object/tangible/ship/components/weapon/serverobjects.lua
3
13283
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version --Children folder includes -- Server Objects includeFile("tangible/ship/components/weapon/weapon_incom_disruptor.lua") includeFile("tangible/ship/components/weapon/weapon_slayn_ioncannon.lua") includeFile("tangible/ship/components/weapon/weapon_subpro_tripleblaster.lua") includeFile("tangible/ship/components/weapon/weapon_test.lua") includeFile("tangible/ship/components/weapon/wpn_armek_advanced.lua") includeFile("tangible/ship/components/weapon/wpn_armek_elite.lua") includeFile("tangible/ship/components/weapon/wpn_armek_sw4.lua") includeFile("tangible/ship/components/weapon/wpn_armek_sw6.lua") includeFile("tangible/ship/components/weapon/wpn_armek_sw7.lua") includeFile("tangible/ship/components/weapon/wpn_armek_sw8.lua") includeFile("tangible/ship/components/weapon/wpn_awing_blaster.lua") includeFile("tangible/ship/components/weapon/wpn_borstel_rg9.lua") includeFile("tangible/ship/components/weapon/wpn_bwing_blaster.lua") includeFile("tangible/ship/components/weapon/wpn_capitalship_turret_test.lua") includeFile("tangible/ship/components/weapon/wpn_corellian_1d.lua") includeFile("tangible/ship/components/weapon/wpn_corellian_ag1g_laser.lua") includeFile("tangible/ship/components/weapon/wpn_corellian_ag2g_quad_laser.lua") includeFile("tangible/ship/components/weapon/wpn_corellian_cruiser_grade_blaster_mk1.lua") includeFile("tangible/ship/components/weapon/wpn_corvette_turret_sm_s01.lua") includeFile("tangible/ship/components/weapon/wpn_cygnus_destroyer_mk1.lua") includeFile("tangible/ship/components/weapon/wpn_cygnus_destroyer_mk2.lua") includeFile("tangible/ship/components/weapon/wpn_cygnus_elite.lua") includeFile("tangible/ship/components/weapon/wpn_cygnus_eradicator_1.lua") includeFile("tangible/ship/components/weapon/wpn_freitek_cannoneer_mk1.lua") includeFile("tangible/ship/components/weapon/wpn_generic.lua") includeFile("tangible/ship/components/weapon/wpn_gyrhil_auto_blaster.lua") includeFile("tangible/ship/components/weapon/wpn_gyrhil_r9x.lua") includeFile("tangible/ship/components/weapon/wpn_haor_chall_speedblaster.lua") includeFile("tangible/ship/components/weapon/wpn_hk_modified_scorcher_elite.lua") includeFile("tangible/ship/components/weapon/wpn_hk_scorcher.lua") includeFile("tangible/ship/components/weapon/wpn_hk_scorcher_2.lua") includeFile("tangible/ship/components/weapon/wpn_hk_scorcher_3.lua") includeFile("tangible/ship/components/weapon/wpn_hk_scorcher_advanced.lua") includeFile("tangible/ship/components/weapon/wpn_hk_scorcher_elite.lua") includeFile("tangible/ship/components/weapon/wpn_hk_scorcher_heavy.lua") includeFile("tangible/ship/components/weapon/wpn_incom_advanced_blaster.lua") includeFile("tangible/ship/components/weapon/wpn_incom_blaster.lua") includeFile("tangible/ship/components/weapon/wpn_incom_disruptor.lua") includeFile("tangible/ship/components/weapon/wpn_incom_elite_quad_blaster.lua") includeFile("tangible/ship/components/weapon/wpn_incom_heavy_blaster.lua") includeFile("tangible/ship/components/weapon/wpn_incom_heavy_quad_blaster.lua") includeFile("tangible/ship/components/weapon/wpn_incom_light_blaster.lua") includeFile("tangible/ship/components/weapon/wpn_incom_proton_missile_s01.lua") includeFile("tangible/ship/components/weapon/wpn_incom_quad_blaster.lua") includeFile("tangible/ship/components/weapon/wpn_incom_seismic_missile_s01.lua") includeFile("tangible/ship/components/weapon/wpn_incom_shredder.lua") includeFile("tangible/ship/components/weapon/wpn_incom_tt13.lua") includeFile("tangible/ship/components/weapon/wpn_incom_tt8.lua") includeFile("tangible/ship/components/weapon/wpn_kdy_pounder_mk1.lua") includeFile("tangible/ship/components/weapon/wpn_kessel_imperial_rendili_prototype_x.lua") includeFile("tangible/ship/components/weapon/wpn_kessel_imperial_sds_experimental_secret_ops.lua") includeFile("tangible/ship/components/weapon/wpn_kessel_imperial_sfs_elite_ops.lua") includeFile("tangible/ship/components/weapon/wpn_kessel_rebel_incom_dualcore_flashcannon.lua") includeFile("tangible/ship/components/weapon/wpn_kessel_rebel_riiz_combine_slammer_cannon.lua") includeFile("tangible/ship/components/weapon/wpn_kessel_rebel_unknown_rayslinger.lua") includeFile("tangible/ship/components/weapon/wpn_koensayr_deluxe_ion_accelerator.lua") includeFile("tangible/ship/components/weapon/wpn_koensayr_ion_accelerator.lua") includeFile("tangible/ship/components/weapon/wpn_koensayr_ion_accelerator_2.lua") includeFile("tangible/ship/components/weapon/wpn_koensayr_ion_accelerator_3.lua") includeFile("tangible/ship/components/weapon/wpn_koensayr_ion_accelerator_advanced.lua") includeFile("tangible/ship/components/weapon/wpn_koensayr_light_disruptor.lua") includeFile("tangible/ship/components/weapon/wpn_koensayr_tuned_light_disruptor.lua") includeFile("tangible/ship/components/weapon/wpn_kse_double_blaster.lua") includeFile("tangible/ship/components/weapon/wpn_kse_light_disruptor.lua") includeFile("tangible/ship/components/weapon/wpn_mandal_advanced_annihilator.lua") includeFile("tangible/ship/components/weapon/wpn_mandal_annihilator_mk2.lua") includeFile("tangible/ship/components/weapon/wpn_mandal_annilhator_mk1.lua") includeFile("tangible/ship/components/weapon/wpn_mandal_elite_annihilator.lua") includeFile("tangible/ship/components/weapon/wpn_mandal_enhanced_mangler_mk1.lua") includeFile("tangible/ship/components/weapon/wpn_mandal_heavy_annihilator.lua") includeFile("tangible/ship/components/weapon/wpn_mandal_mangler_mk1.lua") includeFile("tangible/ship/components/weapon/wpn_mandal_qv3_disruptor.lua") includeFile("tangible/ship/components/weapon/wpn_mandal_qv5_disruptor.lua") includeFile("tangible/ship/components/weapon/wpn_mandal_super_mangler.lua") includeFile("tangible/ship/components/weapon/wpn_mission_reward_imperial_cygnus_starblaster.lua") includeFile("tangible/ship/components/weapon/wpn_mission_reward_imperial_sds_boltdriver.lua") includeFile("tangible/ship/components/weapon/wpn_mission_reward_neutral_borstel_disruptor.lua") includeFile("tangible/ship/components/weapon/wpn_mission_reward_neutral_hk_military_blaster.lua") includeFile("tangible/ship/components/weapon/wpn_mission_reward_neutral_mandal_light_blaster.lua") includeFile("tangible/ship/components/weapon/wpn_mission_reward_rebel_incom_tricannon.lua") includeFile("tangible/ship/components/weapon/wpn_mission_reward_rebel_taim_ion_driver.lua") includeFile("tangible/ship/components/weapon/wpn_moncal_light_blaster.lua") includeFile("tangible/ship/components/weapon/wpn_prototype_weapon.lua") includeFile("tangible/ship/components/weapon/wpn_prototype_weapon_tie.lua") includeFile("tangible/ship/components/weapon/wpn_rendili_advanced.lua") includeFile("tangible/ship/components/weapon/wpn_rendili_fr13_disruptor.lua") includeFile("tangible/ship/components/weapon/wpn_rendili_fr9_disruptor.lua") includeFile("tangible/ship/components/weapon/wpn_rendili_sc3_disruptor.lua") includeFile("tangible/ship/components/weapon/wpn_rendili_sc8_disruptor.lua") includeFile("tangible/ship/components/weapon/wpn_reward_incom_elite.lua") includeFile("tangible/ship/components/weapon/wpn_reward_seinar_elite.lua") includeFile("tangible/ship/components/weapon/wpn_reward_slayn_elite.lua") includeFile("tangible/ship/components/weapon/wpn_reward_subpro_elite.lua") includeFile("tangible/ship/components/weapon/wpn_reward_taim_elite.lua") includeFile("tangible/ship/components/weapon/wpn_rss_imperial_cannon.lua") includeFile("tangible/ship/components/weapon/wpn_sds_elite.lua") includeFile("tangible/ship/components/weapon/wpn_sds_heavy_imperial_spc_forces_cannon.lua") includeFile("tangible/ship/components/weapon/wpn_sds_imperial_blaster_1.lua") includeFile("tangible/ship/components/weapon/wpn_sds_imperial_blaster_2.lua") includeFile("tangible/ship/components/weapon/wpn_sds_imperial_special_forces_cannon.lua") includeFile("tangible/ship/components/weapon/wpn_sds_modified_elite.lua") includeFile("tangible/ship/components/weapon/wpn_seinar_concussion_missile_s01.lua") includeFile("tangible/ship/components/weapon/wpn_seinar_disruptor.lua") includeFile("tangible/ship/components/weapon/wpn_seinar_heatseeker_missile_s01.lua") includeFile("tangible/ship/components/weapon/wpn_seinar_ion_cannon.lua") includeFile("tangible/ship/components/weapon/wpn_seinar_linked_cannon.lua") includeFile("tangible/ship/components/weapon/wpn_seinar_ls1.lua") includeFile("tangible/ship/components/weapon/wpn_seinar_ls72.lua") includeFile("tangible/ship/components/weapon/wpn_sfs_elite.lua") includeFile("tangible/ship/components/weapon/wpn_sfs_imperial_blaster_1.lua") includeFile("tangible/ship/components/weapon/wpn_sfs_imperial_blaster_2.lua") includeFile("tangible/ship/components/weapon/wpn_sfs_imperial_blaster_3.lua") includeFile("tangible/ship/components/weapon/wpn_sfs_imperial_blaster_4.lua") includeFile("tangible/ship/components/weapon/wpn_sfs_imperial_special_forces_blaster.lua") includeFile("tangible/ship/components/weapon/wpn_sfs_improved_imperial_blaster_2.lua") includeFile("tangible/ship/components/weapon/wpn_slayn_deluxe_light_ioncannon.lua") includeFile("tangible/ship/components/weapon/wpn_slayn_imagerec_missile_s01.lua") includeFile("tangible/ship/components/weapon/wpn_slayn_ioncannon.lua") includeFile("tangible/ship/components/weapon/wpn_slayn_light_ioncannon.lua") includeFile("tangible/ship/components/weapon/wpn_spacestation_rebel_turret_s01.lua") includeFile("tangible/ship/components/weapon/wpn_spacestation_rebel_turret_s02.lua") includeFile("tangible/ship/components/weapon/wpn_star_destroyer_turret_dome.lua") includeFile("tangible/ship/components/weapon/wpn_star_destroyer_turret_med.lua") includeFile("tangible/ship/components/weapon/wpn_star_destroyer_turret_square.lua") includeFile("tangible/ship/components/weapon/wpn_std_countermeasure.lua") includeFile("tangible/ship/components/weapon/wpn_subpro_advanced_cannon.lua") includeFile("tangible/ship/components/weapon/wpn_subpro_improved_light_ioncannon.lua") includeFile("tangible/ship/components/weapon/wpn_subpro_light_ioncannon.lua") includeFile("tangible/ship/components/weapon/wpn_subpro_modified_tricannon.lua") includeFile("tangible/ship/components/weapon/wpn_subpro_tricannon.lua") includeFile("tangible/ship/components/weapon/wpn_subpro_tripleblaster.lua") includeFile("tangible/ship/components/weapon/wpn_subpro_tripleblaster_mark2.lua") includeFile("tangible/ship/components/weapon/wpn_subpro_tripleblaster_mark3.lua") includeFile("tangible/ship/components/weapon/wpn_taim_elite.lua") includeFile("tangible/ship/components/weapon/wpn_taim_heavy_laser.lua") includeFile("tangible/ship/components/weapon/wpn_taim_ix4.lua") includeFile("tangible/ship/components/weapon/wpn_taim_ix5.lua") includeFile("tangible/ship/components/weapon/wpn_taim_kx5.lua") includeFile("tangible/ship/components/weapon/wpn_taim_kx8.lua") includeFile("tangible/ship/components/weapon/wpn_taim_kx9.lua") includeFile("tangible/ship/components/weapon/wpn_tieadvanced_blaster.lua") includeFile("tangible/ship/components/weapon/wpn_tiefighter_basic.lua") includeFile("tangible/ship/components/weapon/wpn_z95_basic.lua") includeFile("tangible/ship/components/weapon/wpn_z95_blaster.lua") includeFile("tangible/ship/components/weapon/xwing_weapon_s01_test.lua") includeFile("tangible/ship/components/weapon/xwing_weapon_s02_test.lua")
lgpl-3.0
eraffxi/darkstar
scripts/zones/Aht_Urhgan_Whitegate/npcs/Koyol-Futenol.lua
2
4215
----------------------------------- -- Area: Aht Urhgan Whitegate -- NPC: Koyol-Futenol -- Title Change NPC -- !pos -129 2 -20 50 ----------------------------------- require("scripts/globals/titles"); local title2 = { dsp.title.DARK_RESISTANT , dsp.title.BEARER_OF_THE_MARK_OF_ZAHAK , dsp.title.SEAGULL_PHRATRIE_CREW_MEMBER , dsp.title.PROUD_AUTOMATON_OWNER , dsp.title.WILDCAT_PUBLICIST , dsp.title.SCENIC_SNAPSHOTTER , dsp.title.BRANDED_BY_THE_FIVE_SERPENTS , dsp.title.IMMORTAL_LION , dsp.title.PARAGON_OF_BLUE_MAGE_EXCELLENCE , dsp.title.PARAGON_OF_CORSAIR_EXCELLENCE , dsp.title.PARAGON_OF_PUPPETMASTER_EXCELLENCE , dsp.title.MASTER_OF_AMBITION , dsp.title.MASTER_OF_CHANCE , dsp.title.SKYSERPENT_AGGRANDIZER , dsp.title.GALESERPENT_GUARDIAN , dsp.title.STONESERPENT_SHOCKTROOPER , dsp.title.PHOTOPTICATOR_OPERATOR , dsp.title.SPRINGSERPENT_SENTRY , dsp.title.FLAMESERPENT_FACILITATOR , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } local title3 = { dsp.title.PRIVATE_SECOND_CLASS , dsp.title.PRIVATE_FIRST_CLASS , dsp.title.SUPERIOR_PRIVATE , dsp.title.LANCE_CORPORAL , dsp.title.CORPORAL , dsp.title.SERGEANT , dsp.title.SERGEANT_MAJOR , dsp.title.CHIEF_SERGEANT , dsp.title.SECOND_LIEUTENANT , dsp.title.FIRST_LIEUTENANT , dsp.title.AGENT_OF_THE_ALLIED_FORCES , dsp.title.OVJANGS_ERRAND_RUNNER , dsp.title.KARABABAS_TOUR_GUIDE , dsp.title.KARABABAS_BODYGUARD , dsp.title.KARABABAS_SECRET_AGENT , dsp.title.APHMAUS_MERCENARY , dsp.title.NASHMEIRAS_MERCENARY , dsp.title.SALAHEEMS_RISK_ASSESSOR , dsp.title.TREASURE_TROVE_TENDER , dsp.title.GESSHOS_MERCY , dsp.title.EMISSARY_OF_THE_EMPRESS , dsp.title.ENDYMION_PARATROOPER , dsp.title.NAJAS_COMRADEINARMS , dsp.title.NASHMEIRAS_LOYALIST , dsp.title.PREVENTER_OF_RAGNAROK , dsp.title.CHAMPION_OF_AHT_URHGAN , dsp.title.ETERNAL_MERCENARY , dsp.title.CAPTAIN } local title4 = { dsp.title.SUBDUER_OF_THE_MAMOOL_JA , dsp.title.SUBDUER_OF_THE_TROLLS , dsp.title.SUBDUER_OF_THE_UNDEAD_SWARM , dsp.title.CERBERUS_MUZZLER , dsp.title.HYDRA_HEADHUNTER , dsp.title.SHINING_SCALE_RIFLER , dsp.title.TROLL_SUBJUGATOR , dsp.title.GORGONSTONE_SUNDERER , dsp.title.KHIMAIRA_CARVER , dsp.title.ELITE_EINHERJAR , dsp.title.STAR_CHARIOTEER , dsp.title.SUN_CHARIOTEER , dsp.title.COMET_CHARIOTEER , dsp.title.MOON_CHARIOTEER , dsp.title.BLOODY_BERSERKER , dsp.title.THE_SIXTH_SERPENT , dsp.title.OUPIRE_IMPALER , dsp.title.HEIR_OF_THE_BLESSED_RADIANCE , dsp.title.HEIR_OF_THE_BLIGHTED_GLOOM , dsp.title.SWORN_TO_THE_DARK_DIVINITY , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } local title5 = { 0 , dsp.title.SUPERNAL_SAVANT , dsp.title.SOLAR_SAGE , dsp.title.BOLIDE_BARON , dsp.title.MOON_MAVEN , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } local title6 = { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } local title7 = { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } function onTrade(player,npc,trade) end; function onTrigger(player,npc) player:startEvent(644,npcUtil.genTmask(player,title2),npcUtil.genTmask(player,title3),npcUtil.genTmask(player,title4),npcUtil.genTmask(player,title5),npcUtil.genTmask(player,title6),npcUtil.genTmask(player,title7),1 ,player:getGil()); end; function onEventUpdate(player,csid,option) end; function onEventFinish(player,csid,option) if (csid==644) then if (option > 0 and option <29) then if (player:delGil(200)) then player:setTitle( title2[option] ) end elseif (option > 256 and option <285) then if (player:delGil(300)) then player:setTitle( title3[option - 256] ) end elseif (option > 512 and option < 541) then if (player:delGil(400)) then player:setTitle( title4[option - 512] ) end elseif (option > 768 and option <797) then if (player:delGil(500)) then player:setTitle( title5[option - 768] ) end end end end;
gpl-3.0
eraffxi/darkstar
scripts/zones/Bhaflau_Thickets/npcs/Runic_Portal.lua
2
1291
----------------------------------- -- Area: Bhaflau Thickets -- NPC: Runic Portal -- Mamook Ja Teleporter Back to Aht Urgan Whitegate -- !pos -211 -11 -818 52 ----------------------------------- package.loaded["scripts/zones/Bhaflau_Thickets/TextIDs"] = nil; ----------------------------------- require("scripts/zones/Bhaflau_Thickets/TextIDs"); require("scripts/globals/teleports"); require("scripts/globals/missions"); require("scripts/globals/besieged"); function onTrade(player,npc,trade) end; function onTrigger(player,npc) if (player:getCurrentMission(TOAU) == IMMORTAL_SENTRIES and player:getVar("AhtUrganStatus") == 1) then player:startEvent(111); elseif (player:getCurrentMission(TOAU) > IMMORTAL_SENTRIES) then if (hasRunicPortal(player,3) == 1) then player:startEvent(109); else player:startEvent(111); end else player:messageSpecial(RESPONSE); end end; function onEventUpdate(player,csid,option) end; function onEventFinish(player,csid,option) if (csid == 111 and option == 1) then player:addNationTeleport(AHTURHGAN,8); dsp.teleport.toChamberOfPassage(player); elseif (csid == 109 and option == 1) then dsp.teleport.toChamberOfPassage(player); end end;
gpl-3.0
kidaa/Awakening-Core3
bin/scripts/object/draft_schematic/space/chassis/z95_wing_l.lua
3
2248
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version object_draft_schematic_space_chassis_z95_wing_l = object_draft_schematic_space_chassis_shared_z95_wing_l:new { } ObjectTemplates:addTemplate(object_draft_schematic_space_chassis_z95_wing_l, "object/draft_schematic/space/chassis/z95_wing_l.iff")
lgpl-3.0
kidaa/Awakening-Core3
bin/scripts/object/mobile/dressed_commoner_naboo_human_male_03.lua
3
2260
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version object_mobile_dressed_commoner_naboo_human_male_03 = object_mobile_shared_dressed_commoner_naboo_human_male_03:new { } ObjectTemplates:addTemplate(object_mobile_dressed_commoner_naboo_human_male_03, "object/mobile/dressed_commoner_naboo_human_male_03.iff")
lgpl-3.0
kidaa/Awakening-Core3
bin/scripts/object/draft_schematic/furniture/furniture_corellia_flagpole.lua
3
2300
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version object_draft_schematic_furniture_furniture_corellia_flagpole = object_draft_schematic_furniture_shared_furniture_corellia_flagpole:new { } ObjectTemplates:addTemplate(object_draft_schematic_furniture_furniture_corellia_flagpole, "object/draft_schematic/furniture/furniture_corellia_flagpole.iff")
lgpl-3.0
kidaa/Awakening-Core3
bin/scripts/object/building/general/bunker_imperial_prison_01.lua
3
2256
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version object_building_general_bunker_imperial_prison_01 = object_building_general_shared_bunker_imperial_prison_01:new { } ObjectTemplates:addTemplate(object_building_general_bunker_imperial_prison_01, "object/building/general/bunker_imperial_prison_01.iff")
lgpl-3.0
kidaa/Awakening-Core3
bin/scripts/object/building/player/construction/construction_player_house_generic_large_style_02.lua
3
2418
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version object_building_player_construction_construction_player_house_generic_large_style_02 = object_building_player_construction_shared_construction_player_house_generic_large_style_02:new { gameObjectType = 4096 } ObjectTemplates:addTemplate(object_building_player_construction_construction_player_house_generic_large_style_02, "object/building/player/construction/construction_player_house_generic_large_style_02.iff")
lgpl-3.0
widelands/widelands
data/tribes/buildings/productionsites/amazons/gold_digger_dwelling/init.lua
1
1865
push_textdomain("tribes") dirname = path.dirname(__file__) wl.Descriptions():new_productionsite_type { name = "amazons_gold_digger_dwelling", -- TRANSLATORS: This is a building name used in lists of buildings descname = pgettext("amazons_building", "Gold Digger Dwelling"), icon = dirname .. "menu.png", size = "mine", buildcost = { log = 4, rope = 1 }, return_on_dismantle = { log = 2 }, animation_directory = dirname, animations = { idle = {hotspot = {39, 46}}, empty = {hotspot = {39, 46}}, unoccupied = {hotspot = {39, 46}}, }, spritesheets = { working = { hotspot = {39, 46}, fps = 15, frames = 30, columns = 6, rows = 5 } }, aihints = { prohibited_till = 1100 }, working_positions = { amazons_gold_digger = 1 }, inputs = { { name = "ration", amount = 3 }, { name = "water", amount = 10 } }, programs = { main = { -- TRANSLATORS: Completed/Skipped/Did not start mining gold because ... descname = _("mining gold"), actions = { "return=skipped unless economy needs gold_dust", "consume=ration water:5", "sleep=duration:45s", "animate=working duration:20s", "mine=resource_gold radius:1 yield:100% when_empty:5%", "produce=gold_dust" } }, }, out_of_resource_notification = { -- Translators: Short for "Out of ..." for a resource title = _("No Gold"), heading = _("Main Gold Vein Exhausted"), message = pgettext("amazons_building", "This gold digger dwelling’s main vein is exhausted. Expect strongly diminished returns on investment. You should consider dismantling or destroying it."), }, } pop_textdomain()
gpl-2.0
kidaa/Awakening-Core3
bin/scripts/commands/chargeShot2.lua
1
2674
--Copyright (C) 2007 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version --which carries forward this exception. --true = 1, false = 0 ChargeShot2Command = { name = "chargeshot2", damageMultiplier = 2.5, speedMultiplier = 2.0, healthCostMultiplier = 0.5, actionCostMultiplier = 1.5, mindCostMultiplier = 0.5, accuracyBonus = 25, animationCRC = hashCode("charge"), combatSpam = "chargeblast", coneAngle = 15, --JTL PrimaGuide doesn't specify, but all AOE's for carbine are (64x15) coneAction = true, stateEffects = { StateEffect( KNOCKDOWN_EFFECT, { "knockdownRecovery", "lastKnockdown" }, { "knockdown_defense" }, {}, 40, 100, 0 ) }, poolsToDamage = RANDOM_ATTRIBUTE, range = -1 } AddCommand(ChargeShot2Command)
lgpl-3.0
kidaa/Awakening-Core3
bin/scripts/object/tangible/wearables/ithorian/ith_bandolier_s08.lua
3
2474
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version object_tangible_wearables_ithorian_ith_bandolier_s08 = object_tangible_wearables_ithorian_shared_ith_bandolier_s08:new { playerRaces = { "object/creature/player/ithorian_male.iff", "object/creature/player/ithorian_female.iff", "object/mobile/vendor/ithorian_female.iff", "object/mobile/vendor/ithorian_male.iff" }, } ObjectTemplates:addTemplate(object_tangible_wearables_ithorian_ith_bandolier_s08, "object/tangible/wearables/ithorian/ith_bandolier_s08.iff")
lgpl-3.0
kidaa/Awakening-Core3
bin/scripts/object/mobile/dressed_commoner_tatooine_devaronian_male_04.lua
3
2292
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version object_mobile_dressed_commoner_tatooine_devaronian_male_04 = object_mobile_shared_dressed_commoner_tatooine_devaronian_male_04:new { } ObjectTemplates:addTemplate(object_mobile_dressed_commoner_tatooine_devaronian_male_04, "object/mobile/dressed_commoner_tatooine_devaronian_male_04.iff")
lgpl-3.0
NezzKryptic/Wire
lua/entities/gmod_wire_datasocket.lua
3
3005
AddCSLuaFile() DEFINE_BASECLASS( "gmod_wire_socket" ) ENT.PrintName = "Wire Data Socket" ENT.WireDebugName = "Socket" function ENT:GetPlugClass() return "gmod_wire_dataplug" end if CLIENT then hook.Add("HUDPaint","Wire_DataSocket_DrawLinkHelperLine",function() local sockets = ents.FindByClass("gmod_wire_datasocket") for k,self in pairs( sockets ) do local Pos, _ = self:GetLinkPos() local Closest = self:GetClosestPlug() if IsValid(Closest) and self:CanLink(Closest) and Closest:GetNWBool( "PlayerHolding", false ) and Closest:GetClosestSocket() == self then local plugpos = Closest:GetPos():ToScreen() local socketpos = Pos:ToScreen() surface.SetDrawColor(255,255,100,255) surface.DrawLine(plugpos.x, plugpos.y, socketpos.x, socketpos.y) end end end) function ENT:DrawEntityOutline() end -- never draw outline return end function ENT:Initialize() self:PhysicsInit( SOLID_VPHYSICS ) self:SetMoveType( MOVETYPE_VPHYSICS ) self:SetSolid( SOLID_VPHYSICS ) self.Inputs = WireLib.CreateInputs(self, { "Memory" }) self.Outputs = WireLib.CreateOutputs(self, { "Memory" }) WireLib.TriggerOutput(self, "Memory", 0) self.Memory = nil end function ENT:Setup( WeldForce, AttachRange ) self.WeldForce = WeldForce or 5000 self.AttachRange = AttachRange or 5 self:SetNWInt( "AttachRange", self.AttachRange ) end -- Override some functions from gmod_wire_socket function ENT:ResendValues() self:SetMemory(self.Plug.Memory) end function ENT:ResetValues() self.Memory = nil --We're now getting no signal WireLib.TriggerOutput(self, "Memory", 0) end duplicator.RegisterEntityClass( "gmod_wire_datasocket", WireLib.MakeWireEnt, "Data", "WeldForce", "AttachRange" ) function ENT:SetMemory(mement) self.Memory = mement WireLib.TriggerOutput(self, "Memory", 1) end function ENT:ReadCell( Address, infloop ) infloop = infloop or 0 if infloop > 50 then return end Address = math.floor(Address) if (self.Memory) then if (self.Memory.ReadCell) then return self.Memory:ReadCell( Address, infloop + 1 ) else return nil end else return nil end end function ENT:WriteCell( Address, value, infloop ) infloop = infloop or 0 if infloop > 50 then return end Address = math.floor(Address) if (self.Memory) then if (self.Memory.WriteCell) then return self.Memory:WriteCell( Address, value, infloop + 1 ) else return false end else return false end end function ENT:TriggerInput(iname, value, iter) if (iname == "Memory") then self.OwnMemory = self.Inputs.Memory.Src end end -- Override dupeinfo functions from wire plug function ENT:BuildDupeInfo() local info = BaseClass.BuildDupeInfo(self) if info.Socket then info.Socket.ArrayInput = nil end -- this input is not used on this entity return info end function ENT:GetApplyDupeInfoParams(info) return info.Socket.WeldForce, info.Socket.AttachRange end duplicator.RegisterEntityClass("gmod_wire_datasocket", WireLib.MakeWireEnt, "Data", "WeldForce", "AttachRange")
apache-2.0
kidaa/Awakening-Core3
bin/scripts/object/tangible/deed/event_perk/corsec_2x10_honorguard_deed.lua
1
2296
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version object_tangible_deed_event_perk_corsec_2x10_honorguard_deed = object_tangible_deed_event_perk_shared_corsec_2x10_honorguard_deed:new { } ObjectTemplates:addTemplate(object_tangible_deed_event_perk_corsec_2x10_honorguard_deed, "object/tangible/deed/event_perk/corsec_2x10_honorguard_deed.iff")
lgpl-3.0
kidaa/Awakening-Core3
bin/scripts/object/tangible/lair/base/poi_all_lair_mound_small_fog_red.lua
2
2344
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version object_tangible_lair_base_poi_all_lair_mound_small_fog_red = object_tangible_lair_base_shared_poi_all_lair_mound_small_fog_red:new { objectMenuComponent = {"cpp", "LairMenuComponent"}, } ObjectTemplates:addTemplate(object_tangible_lair_base_poi_all_lair_mound_small_fog_red, "object/tangible/lair/base/poi_all_lair_mound_small_fog_red.iff")
lgpl-3.0
tectronics/saitohud
src/SaitoHUD/lua/saitohud/modules/e2_extensions.lua
3
9007
-- SaitoHUD -- Copyright (c) 2009-2010 sk89q <http://www.sk89q.com> -- Copyright (c) 2010 BoJaN -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation, either version 2 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. -- -- $Id$ local e2ExtensionsWindow local readableTypes = { ["n"] = "number", ["xv2"] = "vector2", ["v"] = "vector3", ["xv4"] = "vector4", ["a"] = "angle", ["s"] = "string", ["e"] = "entity", ["r"] = "array", ["t"] = "table", ["xrd"] = "rangerdata", ["b"] = "bone", ["xm2"] = "matrix2", ["m"] = "matrix3", ["xm4"] = "matrix4", ["xwl"] = "wirelink", ["c"] = "complex", ["q"] = "quaternion", ["g"] = "generic", ["xcd"] = "code", ["f"] = "function", } --- Turn the arguments into a list of readable ones. -- @param args -- @Param argNames Table of argument names local function MakeReadableArgs(args, argNames) if args == "..." then return args end argNames = argNames or {} local text = {} local i = 1 local argNameK = 97 while i <= string.len(args) do local char = args:sub(i, i) local dataType if char == "x" then dataType = args:sub(i, i + 2) i = i + 3 elseif char == "." then dataType = args:sub(i, i + 2) i = i + 3 else dataType = char i = i + 1 end if dataType ~= "..." then local argName = argNames[i] if not argName then argName = string.char(argNameK) argNameK = argNameK + 1 end table.insert(text, (readableTypes[dataType] or dataType) .. " " .. argName) else table.insert(text, dataType) end end return string.Implode(", ", text) end --- Writes the standard function list. function SaitoHUD.WriteE2StandardFuncs() local data = "" for signature, _ in pairs(wire_expression2_funcs) do data = data .. signature .. "\n" end file.Write("saitohud/e2_std_funcs.txt", data) end --- Populates the function list. -- @param lst List panel local function PopulateE2ExtensionsList(lst) local data = file.Read("saitohud/e2_std_funcs.txt") local standardFunctions = {} if data then local lines = string.Explode("\n", data) for _, v in pairs(lines) do v = v:Trim() if v ~= "" then standardFunctions[v] = true end end end for signature, info in pairs(wire_expression2_funcs) do local cls, args local func, inner = signature:match("([^%(]+)%((.*)%)") -- Index set function if not func:find("op:") and not standardFunctions[signature] then -- Try to extract the class and arguments if inner:find(":") then local res = string.Explode(":", inner) cls, args = res[1], res[2] else cls = "" args = inner end local text = string.format("%s %s(%s)", info[2] ~= "" and (readableTypes[info[2]] or info[2]) or "", (readableTypes[cls] and readableTypes[cls] .. ":" or cls) .. func, MakeReadableArgs(args, info.argnames)) lst:AddLine(info[2] ~= "" and (readableTypes[info[2]] or info[2]) or "", readableTypes[cls] and readableTypes[cls] .. ":" or cls, func .. "()", MakeReadableArgs(args, info.argnames), signature, text:Trim()) end end end --- Prints the function list. -- @param lst List panel local function DumpE2ExtensionsList(lst) local data = file.Read("saitohud/e2_std_funcs.txt") local standardFunctions = {} if data then local lines = string.Explode("\n", data) for _, v in pairs(lines) do v = v:Trim() if v ~= "" then standardFunctions[v] = true end end end local funcs = {} for signature, info in pairs(wire_expression2_funcs) do local cls, args local func, inner = signature:match("([^%(]+)%((.*)%)") -- Index set function if not func:find("op:") and not standardFunctions[signature] then -- Try to extract the class and arguments if inner:find(":") then local res = string.Explode(":", inner) cls, args = res[1], res[2] else cls = "" args = inner end local text = string.format("%s %s(%s)", info[2] ~= "" and (readableTypes[info[2]] or info[2]) or "", (readableTypes[cls] and readableTypes[cls] .. ":" or cls) .. func, MakeReadableArgs(args, info.argnames)) table.insert(funcs, { info[2] ~= "" and (readableTypes[info[2]] or info[2]) or "void", readableTypes[cls] and readableTypes[cls] .. ":" or cls, func, MakeReadableArgs(args, info.argnames) }) end end table.SortByMember(funcs, 3, function(a, b) return a > b end) local out = "" for _, v in pairs(funcs) do local text = string.format("<tr><td>%s</td><td style=\"text-align: right\">%s</td><td><strong>%s</strong>(%s)</td></tr>\n", v[1], v[2], v[3], v[4] == "" and "" or " " .. v[4] .. " ") out = out .. text end file.Write("saitohud_dump_e2_funcs.txt", out) end --- Opens the E2 extensions window. function SaitoHUD.OpenE2Extensions() if not wire_expression2_funcs then Derma_Message("This server does not have Expression 2.", "Error", "OK") return end if e2ExtensionsWindow then e2ExtensionsWindow:SetVisible(true) e2ExtensionsWindow:MakePopup() e2ExtensionsWindow:InvalidateLayout(true, true) return end local frame = vgui.Create("DFrame") e2ExtensionsWindow = frame frame:SetTitle("Expression 2 Extensions") frame:SetDeleteOnClose(false) frame:SetScreenLock(true) frame:SetSize(math.min(600, ScrW() - 20), ScrH() * 4/5) frame:SetSizable(true) frame:Center() frame:MakePopup() -- Make information box local info = vgui.Create("DLabel", frame) info:SetText("") info:SetWrap(true) info:SetAutoStretchVertical(true) -- Make list view local funcs = vgui.Create("DListView", frame) funcs:SetMultiSelect(false) funcs:AddColumn("Return"):SetFixedWidth(80) funcs:AddColumn("Class"):SetFixedWidth(80) funcs:AddColumn("Function") funcs:AddColumn("Arguments") PopulateE2ExtensionsList(funcs) funcs.OnRowSelected = function(lst, index) local line = lst:GetLine(index) info:SetText(line:GetValue(6)) end funcs.OnRowRightClick = function(lst, index, line) local menu = DermaMenu() menu:AddOption("Copy Function Name", function() local line = lst:GetLine(index) SetClipboardText(line:GetValue(3)) end) menu:AddOption("Copy Signature", function() local line = lst:GetLine(index) SetClipboardText(line:GetValue(6)) end) menu:AddOption("Copy Raw Signature", function() local line = lst:GetLine(index) SetClipboardText(line:GetValue(5)) end) menu:Open() end -- Make divider local divider = vgui.Create("DVerticalDivider", frame) divider:SetTopHeight(ScrH() * 4/5 - 50) divider:SetTop(funcs) divider:SetBottom(info) -- Layout local oldPerform = frame.PerformLayout frame.PerformLayout = function() oldPerform(frame) divider:StretchToParent(10, 28, 10, 10) end frame:InvalidateLayout(true, true) end concommand.Add("e2_extensions", function() SaitoHUD.OpenE2Extensions() end) concommand.Add("dump_e2_extensions", DumpE2ExtensionsList)
gpl-2.0
lordtg/jalebduni
plugins/anti_fosh.lua
14
1450
local function run(msg, matches) if is_owner(msg) then return end local data = load_data(_config.moderation.data) if data[tostring(msg.to.id)] then if data[tostring(msg.to.id)]['settings'] then if data[tostring(msg.to.id)]['settings']['antifosh'] then lock_fosh = data[tostring(msg.to.id)]['settings']['antifosh'] end end end local chat = get_receiver(msg) local user = "user#id"..msg.from.id if lock_fosh == "yes" then send_large_msg(chat, 'بدلیل فحاشی از گروه سیکتیر شدید') chat_del_user(chat, user, ok_cb, true) end end return { patterns = { "کس(.*)", "کون(.*)", "کیر(.*)", "ممه(.*)", "سکس(.*)", "سیکتیر(.*)", "قهبه(.*)", "بسیک(.*)", "بیناموس(.*)", "اوبی(.*)", "کونی(.*)", "بیشرف(.*)", "کس ننه(.*)", "ساک(.*)", "کیری(.*)", "خار کوسه(.*)", "ننه(.*)", "خواهرتو(.*)", "سکسی(.*)", "کسکش(.*)", "سیک تیر(.*)", "گاییدم(.*)", "میگام(.*)", "میگامت(.*)", "بسیک(.*)", "خواهرت(.*)", "خارتو(.*)", "کونت(.*)", "کوست(.*)", "شورت(.*)", "سگ(.*)", "کیری(.*)", "دزد(.*)", "ننت(.*)", "ابمو(.*)", "جق(.*)" }, run = run }
gpl-2.0
eraffxi/darkstar
scripts/zones/Ifrits_Cauldron/Zone.lua
2
1406
----------------------------------- -- -- Zone: Ifrits_Cauldron (205) -- ----------------------------------- package.loaded["scripts/zones/Ifrits_Cauldron/TextIDs"] = nil; ----------------------------------- require("scripts/zones/Ifrits_Cauldron/TextIDs"); require("scripts/zones/Ifrits_Cauldron/MobIDs"); require("scripts/globals/conquest"); ----------------------------------- function onInitialize(zone) UpdateNMSpawnPoint(ASH_DRAGON); GetMobByID(ASH_DRAGON):setRespawnTime(math.random(900, 10800)); UpdateTreasureSpawnPoint(IFRITS_TREASURE_COFFER); end; function onConquestUpdate(zone, updatetype) local players = zone:getPlayers(); for name, player in pairs(players) do conquestUpdate(zone, player, updatetype, CONQUEST_BASE); end end; function onZoneIn(player,prevZone) local cs = -1; if (player:getXPos() == 0 and player:getYPos() == 0 and player:getZPos() == 0) then player:setPos(-60.296,48.884,105.967,69); end return cs; end; function onRegionEnter(player,region) end; function onGameHour(zone) -- Opens flame spouts every 3 hours Vana'diel time. Doors are offset from spouts by 5. if (VanadielHour() % 3 == 0) then for i = 5, 8 do GetNPCByID(FLAME_SPOUT_OFFSET + i):openDoor(90); end end end; function onEventUpdate(player,csid,option) end; function onEventFinish(player,csid,option) end;
gpl-3.0
kidaa/Awakening-Core3
bin/scripts/object/tangible/mission/quest_item/wald_q2_needed.lua
3
2256
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version object_tangible_mission_quest_item_wald_q2_needed = object_tangible_mission_quest_item_shared_wald_q2_needed:new { } ObjectTemplates:addTemplate(object_tangible_mission_quest_item_wald_q2_needed, "object/tangible/mission/quest_item/wald_q2_needed.iff")
lgpl-3.0
eraffxi/darkstar
scripts/zones/Quicksand_Caves/npcs/qm5.lua
2
2079
----------------------------------- -- Area: Quicksand Caves -- NPC: ??? (qm5) -- Involved in Quest: The Missing Piece -- positions: -- 1: !pos 770 0 -419 -- 2: !pos 657 0 -537 -- 3: !pos 749 0 -573 -- 4: !pos 451 -16 -739 -- 5: !pos 787 -16 -819 -- spawn in npc_list is 770 0 -419 ----------------------------------- package.loaded["scripts/zones/Quicksand_Caves/TextIDs"] = nil; ----------------------------------- require("scripts/zones/Quicksand_Caves/TextIDs"); require("scripts/globals/keyitems"); require("scripts/globals/quests"); ----------------------------------- function onTrigger(player,npc) local TheMissingPiece = player:getQuestStatus(OUTLANDS,THE_MISSING_PIECE); local HasAncientFragment = player:hasKeyItem(dsp.ki.ANCIENT_TABLET_FRAGMENT); local HasAncientTablet = player:hasKeyItem(dsp.ki.TABLET_OF_ANCIENT_MAGIC); -- Need to make sure the quest is flagged the player is no further along in the quest if (TheMissingPiece == QUEST_ACCEPTED and not(HasAncientTablet or HasAncientFragment or player:getTitle() == dsp.title.ACQUIRER_OF_ANCIENT_ARCANUM)) then player:addKeyItem(dsp.ki.ANCIENT_TABLET_FRAGMENT); player:messageSpecial(KEYITEM_OBTAINED,dsp.ki.ANCIENT_TABLET_FRAGMENT); -- move the ??? to a random location local i = math.random(0,100); if (i >= 0 and i < 20) then npc:setPos(770,0,-419,0); elseif (i >= 20 and i < 40) then npc:setPos(657,0,-537,0); elseif (i >= 40 and i < 60) then npc:setPos(749,0,-573,0); elseif (i >= 60 and i < 80) then npc:setPos(451,-16,-739,0); elseif (i >= 80 and i <= 100) then npc:setPos(787,-16,-819,0); else npc:setPos(787,-16,-819,0); end else player:messageSpecial(NOTHING_OUT_OF_ORDINARY); end end; function onEventUpdate(player,csid,option) -- print("CSID:",csid); -- print("RESULT:",option); end; function onEventFinish(player,csid,option) -- print("CSID:",csid); -- print("RESULT:",option); end;
gpl-3.0
hayword/tfatf_epgp
modules/loot.lua
4
3125
local mod = EPGP:NewModule("loot", "AceEvent-3.0") local L = LibStub("AceLocale-3.0"):GetLocale("EPGP") local LLN = LibStub("LibLootNotify-1.0") local Coroutine = LibStub("LibCoroutine-1.0") local DLG = LibStub("LibDialog-1.0") local ignored_items = { [20725] = true, -- Nexus Crystal [22450] = true, -- Void Crystal [34057] = true, -- Abyss Crystal [29434] = true, -- Badge of Justice [40752] = true, -- Emblem of Heroism [40753] = true, -- Emblem of Valor [45624] = true, -- Emblem of Conquest [47241] = true, -- Emblem of Triumph [49426] = true, -- Emblem of Frost [30311] = true, -- Warp Slicer [30312] = true, -- Infinity Blade [30313] = true, -- Staff of Disintegration [30314] = true, -- Phaseshift Bulwark [30316] = true, -- Devastation [30317] = true, -- Cosmic Infuser [30318] = true, -- Netherstrand Longbow [30319] = true, -- Nether Spikes [30320] = true, -- Bundle of Nether Spikes [94222] = true, -- Key to the Palace of Lei Shen } local in_combat = false local function ShowPopup(player, item, quantity) while in_combat or DLG:ActiveDialog("EPGP_CONFIRM_GP_CREDIT") do Coroutine:Sleep(0.1) end if EPGP:GetEPGP(player) then local itemName, itemLink, itemRarity, _, _, _, _, _, _, itemTexture = GetItemInfo(item) DLG:Spawn("EPGP_CONFIRM_GP_CREDIT", {name = player, item = itemLink, icon = itemTexture}) end end local function LootReceived(event_name, player, itemLink, quantity) if EPGP:IsRLorML() and CanEditOfficerNote() then local itemID = tonumber(itemLink:match("item:(%d+)") or 0) if not itemID then return end local itemRarity = select(3, GetItemInfo(itemID)) if itemRarity < mod.db.profile.threshold then return end if ignored_items[itemID] then return end Coroutine:RunAsync(ShowPopup, player, itemLink, quantity) end end function mod:PLAYER_REGEN_DISABLED() in_combat = true end function mod:PLAYER_REGEN_ENABLED() in_combat = false end mod.dbDefaults = { profile = { enabled = true, threshold = 4, -- Epic quality items } } function mod:OnInitialize() self.db = EPGP.db:RegisterNamespace("loot", mod.dbDefaults) end mod.optionsName = L["Loot"] mod.optionsDesc = L["Automatic loot tracking"] mod.optionsArgs = { help = { order = 1, type = "description", name = L["Automatic loot tracking by means of a popup to assign GP to the toon that received loot. This option only has effect if you are in a raid and you are either the Raid Leader or the Master Looter."] }, threshold = { order = 10, type = "select", name = L["Loot tracking threshold"], desc = L["Sets loot tracking threshold, to disable the popup on loot below this threshold quality."], values = { [2] = ITEM_QUALITY2_DESC, [3] = ITEM_QUALITY3_DESC, [4] = ITEM_QUALITY4_DESC, [5] = ITEM_QUALITY5_DESC, }, }, } function mod:OnEnable() self:RegisterEvent("PLAYER_REGEN_DISABLED") self:RegisterEvent("PLAYER_REGEN_ENABLED") LLN.RegisterCallback(self, "LootReceived", LootReceived) end function mod:OnDisable() LLN.UnregisterAllCallbacks(self) end
bsd-3-clause
kidaa/Awakening-Core3
bin/scripts/object/mobile/dressed_imperial_red_f.lua
3
2204
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version object_mobile_dressed_imperial_red_f = object_mobile_shared_dressed_imperial_red_f:new { } ObjectTemplates:addTemplate(object_mobile_dressed_imperial_red_f, "object/mobile/dressed_imperial_red_f.iff")
lgpl-3.0
kidaa/Awakening-Core3
bin/scripts/object/building/poi/creature_lair_boar_wolf.lua
1
2232
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version object_building_poi_creature_lair_boar_wolf = object_building_poi_shared_creature_lair_boar_wolf:new { } ObjectTemplates:addTemplate(object_building_poi_creature_lair_boar_wolf, "object/building/poi/creature_lair_boar_wolf.iff")
lgpl-3.0
kidaa/Awakening-Core3
bin/scripts/object/tangible/ship/components/weapon/wpn_generic.lua
3
2260
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version object_tangible_ship_components_weapon_wpn_generic = object_tangible_ship_components_weapon_shared_wpn_generic:new { } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_wpn_generic, "object/tangible/ship/components/weapon/wpn_generic.iff")
lgpl-3.0
kidaa/Awakening-Core3
bin/scripts/object/tangible/furniture/city/streetlamp_large_red_01.lua
3
2329
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version object_tangible_furniture_city_streetlamp_large_red_01 = object_tangible_furniture_city_shared_streetlamp_large_red_01:new { objectMenuComponent = "CityDecorationMenuComponent", } ObjectTemplates:addTemplate(object_tangible_furniture_city_streetlamp_large_red_01, "object/tangible/furniture/city/streetlamp_large_red_01.iff")
lgpl-3.0
kidaa/Awakening-Core3
bin/scripts/object/weapon/melee/2h_sword/crafted_saber/sword_lightsaber_two_handed_s1_gen3.lua
1
6211
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version object_weapon_melee_2h_sword_crafted_saber_sword_lightsaber_two_handed_s1_gen3 = object_weapon_melee_2h_sword_crafted_saber_shared_sword_lightsaber_two_handed_s1_gen3:new { playerRaces = { "object/creature/player/bothan_male.iff", "object/creature/player/bothan_female.iff", "object/creature/player/human_male.iff", "object/creature/player/human_female.iff", "object/creature/player/ithorian_male.iff", "object/creature/player/ithorian_female.iff", "object/creature/player/moncal_male.iff", "object/creature/player/moncal_female.iff", "object/creature/player/rodian_male.iff", "object/creature/player/rodian_female.iff", "object/creature/player/sullustan_male.iff", "object/creature/player/sullustan_female.iff", "object/creature/player/trandoshan_male.iff", "object/creature/player/trandoshan_female.iff", "object/creature/player/twilek_male.iff", "object/creature/player/twilek_female.iff", "object/creature/player/wookiee_male.iff", "object/creature/player/wookiee_female.iff", "object/creature/player/zabrak_male.iff", "object/creature/player/zabrak_female.iff" }, -- RANGEDATTACK, MELEEATTACK, FORCEATTACK, TRAPATTACK, GRENADEATTACK, HEAVYACIDBEAMATTACK, -- HEAVYLIGHTNINGBEAMATTACK, HEAVYPARTICLEBEAMATTACK, HEAVYROCKETLAUNCHERATTACK, HEAVYLAUNCHERATTACK attackType = MELEEATTACK, -- ENERGY, KINETIC, ELECTRICITY, STUN, BLAST, HEAT, COLD, ACID, FORCE, LIGHTSABER damageType = LIGHTSABER, -- NONE, LIGHT, MEDIUM, HEAVY armorPiercing = MEDIUM, -- combat_rangedspecialize_bactarifle, combat_rangedspecialize_rifle, combat_rangedspecialize_pistol, combat_rangedspecialize_heavy, combat_rangedspecialize_carbine -- combat_meleespecialize_unarmed, combat_meleespecialize_twohand, combat_meleespecialize_polearm, combat_meleespecialize_onehand, combat_general, -- jedi_general, combat_meleespecialize_polearmlightsaber, combat_meleespecialize_onehandlightsaber xpType = "jedi_general", -- See http://www.ocdsoft.com/files/certifications.xls certificationsRequired = { "cert_twohandlightsaber_gen3" }, -- See http://www.ocdsoft.com/files/accuracy.xls creatureAccuracyModifiers = { "twohandlightsaber_accuracy" }, -- See http://www.ocdsoft.com/files/defense.xls defenderDefenseModifiers = { "melee_defense" }, -- Leave as "dodge" for now, may have additions later defenderSecondaryDefenseModifiers = { "saber_block" }, -- See http://www.ocdsoft.com/files/speed.xls speedModifiers = { "twohandlightsaber_speed" }, -- Leave blank for now damageModifiers = { }, -- The values below are the default values. To be used for blue frog objects primarily healthAttackCost = 85, actionAttackCost = 50, mindAttackCost = 35, forceCost = 36, pointBlankRange = 0, pointBlankAccuracy = 20, idealRange = 3, idealAccuracy = 15, maxRange = 5, maxRangeAccuracy = 5, minDamage = 175, maxDamage = 255, defenderToughnessModifiers = { "lightsaber_toughness" }, childObjects = { {templateFile = "object/tangible/inventory/lightsaber_inventory_3.iff", x = 0, z = 0, y = 0, ox = 0, oy = 0, oz = 0, ow = 0, cellid = -1, containmentType = 4} }, attackSpeed = 4.8, numberExperimentalProperties = {1, 1, 2, 2, 2, 2, 2, 1, 1, 1}, experimentalProperties = {"XX", "XX", "CD", "OQ", "CD", "OQ", "CD", "OQ", "SR", "UT", "CD", "OQ", "OQ", "OQ", "OQ"}, experimentalWeights = {1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1}, experimentalGroupTitles = {"null", "null", "expDamage", "expDamage", "expDamage", "expDamage", "expEffeciency", "expEffeciency", "expEffeciency", "expEffeciency"}, experimentalSubGroupTitles = {"null", "null", "mindamage", "maxdamage", "attackspeed", "woundchance", "forcecost", "attackhealthcost", "attackactioncost", "attackmindcost"}, experimentalMin = {0, 0, 175, 255, 4.8, 19, 40, 85, 50, 35}, experimentalMax = {0, 0, 185, 295, 4.5, 31, 36, 55, 45, 30}, experimentalPrecision = {0, 0, 0, 0, 1, 0, 0, 0, 0, 0}, experimentalCombineType = {0, 0, 1, 1, 1, 1, 1, 1, 1, 1}, } ObjectTemplates:addTemplate(object_weapon_melee_2h_sword_crafted_saber_sword_lightsaber_two_handed_s1_gen3, "object/weapon/melee/2h_sword/crafted_saber/sword_lightsaber_two_handed_s1_gen3.iff")
lgpl-3.0
kidaa/Awakening-Core3
bin/scripts/object/mobile/dressed_brigade_marine_trandoshan_female_01.lua
3
2288
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version object_mobile_dressed_brigade_marine_trandoshan_female_01 = object_mobile_shared_dressed_brigade_marine_trandoshan_female_01:new { } ObjectTemplates:addTemplate(object_mobile_dressed_brigade_marine_trandoshan_female_01, "object/mobile/dressed_brigade_marine_trandoshan_female_01.iff")
lgpl-3.0
kidaa/Awakening-Core3
bin/scripts/object/mobile/dressed_corvette_imperial_velso.lua
3
2240
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version object_mobile_dressed_corvette_imperial_velso = object_mobile_shared_dressed_corvette_imperial_velso:new { } ObjectTemplates:addTemplate(object_mobile_dressed_corvette_imperial_velso, "object/mobile/dressed_corvette_imperial_velso.iff")
lgpl-3.0
houqp/koreader
plugins/newsdownloader.koplugin/internaldownloadbackend.lua
5
1755
local http = require("socket.http") local https = require("ssl.https") local logger = require("logger") local ltn12 = require("ltn12") local socket = require('socket') local socket_url = require("socket.url") local InternalDownloadBackend = {} local max_redirects = 5; --prevent infinite redirects function InternalDownloadBackend:getResponseAsString(url, redirectCount) if not redirectCount then redirectCount = 0 elseif redirectCount == max_redirects then error("InternalDownloadBackend: reached max redirects: ", redirectCount) end logger.dbg("InternalDownloadBackend: url :", url) local request, sink = {}, {} request['sink'] = ltn12.sink.table(sink) request['url'] = url local parsed = socket_url.parse(url) local httpRequest = parsed.scheme == 'http' and http.request or https.request; local code, headers, status = socket.skip(1, httpRequest(request)) if code ~= 200 then logger.dbg("InternalDownloadBackend: HTTP response code <> 200. Response status: ", status) if code and code > 299 and code < 400 and headers and headers["location"] then -- handle 301, 302... local redirected_url = headers["location"] logger.dbg("InternalDownloadBackend: Redirecting to url: ", redirected_url) return self:getResponseAsString(redirected_url, redirectCount + 1) else error("InternalDownloadBackend: Don't know how to handle HTTP response status: ", status) end end return table.concat(sink) end function InternalDownloadBackend:download(url, path) local response = self:getResponseAsString(url) local file = io.open(path, 'w') file:write(response) file:close() end return InternalDownloadBackend
agpl-3.0
mohammad1212/robot12240
plugins/face.lua
641
3073
local https = require("ssl.https") local ltn12 = require "ltn12" -- Edit data/mashape.lua with your Mashape API key -- http://docs.mashape.com/api-keys local mashape = load_from_file('data/mashape.lua', { api_key = '' }) local function request(imageUrl) local api_key = mashape.api_key if api_key:isempty() then return nil, 'Configure your Mashape API Key' end local api = "https://faceplusplus-faceplusplus.p.mashape.com/detection/detect?" local parameters = "attribute=gender%2Cage%2Crace" parameters = parameters .. "&url="..(URL.escape(imageUrl) or "") local url = api..parameters local headers = { ["X-Mashape-Key"] = api_key, ["Accept"] = "Accept: application/json" } print(url) local respbody = {} local body, code = https.request{ url = url, method = "GET", headers = headers, sink = ltn12.sink.table(respbody), protocol = "tlsv1" } if code ~= 200 then return "", code end local body = table.concat(respbody) return body, code end local function parseData(data) local jsonBody = json:decode(data) local response = "" if jsonBody.error ~= nil then if jsonBody.error == "IMAGE_ERROR_FILE_TOO_LARGE" then response = response .. "The image is too big. Provide a smaller image." elseif jsonBody.error == "IMAGE_ERROR_FAILED_TO_DOWNLOAD" then response = response .. "Is that a valid url for an image?" else response = response .. jsonBody.error end elseif jsonBody.face == nil or #jsonBody.face == 0 then response = response .. "No faces found" else response = response .. #jsonBody.face .." face(s) found:\n\n" for k,face in pairs(jsonBody.face) do local raceP = "" if face.attribute.race.confidence > 85.0 then raceP = face.attribute.race.value:lower() elseif face.attribute.race.confidence > 50.0 then raceP = "(probably "..face.attribute.race.value:lower()..")" else raceP = "(posibly "..face.attribute.race.value:lower()..")" end if face.attribute.gender.confidence > 85.0 then response = response .. "There is a " else response = response .. "There may be a " end response = response .. raceP .. " " .. face.attribute.gender.value:lower() .. " " response = response .. ", " .. face.attribute.age.value .. "(±".. face.attribute.age.range ..") years old \n" end end return response end local function run(msg, matches) --return request('http://www.uni-regensburg.de/Fakultaeten/phil_Fak_II/Psychologie/Psy_II/beautycheck/english/durchschnittsgesichter/m(01-32)_gr.jpg') local data, code = request(matches[1]) if code ~= 200 then return "There was an error. "..code end return parseData(data) end return { description = "Who is in that photo?", usage = { "!face [url]", "!recognise [url]" }, patterns = { "^!face (.*)$", "^!recognise (.*)$" }, run = run }
gpl-2.0
eraffxi/darkstar
scripts/globals/items/chunk_of_homemade_cheese.lua
2
1596
----------------------------------------- -- ID: 5225 -- Item: chunk_of_homemade_cheese -- Food Effect: 30Min, All Races ----------------------------------------- -- Health 10 -- Accuracy +12% (cap 80) -- Attack +10% (cap 40) -- Ranged Accuracy +12% (cap 80) -- Ranged Attack +10% (cap 40) ----------------------------------------- require("scripts/globals/status"); ----------------------------------------- function onItemCheck(target) local result = 0; if (target:hasStatusEffect(dsp.effect.FOOD) == true or target:hasStatusEffect(dsp.effect.FIELD_SUPPORT_FOOD) == true) then result = 246; end return result; end; function onItemUse(target) target:addStatusEffect(dsp.effect.FOOD,0,0,1800,5225); end; function onEffectGain(target, effect) target:addMod(dsp.mod.HP, 10); target:addMod(dsp.mod.FOOD_ACCP, 12); target:addMod(dsp.mod.FOOD_ACC_CAP, 80); target:addMod(dsp.mod.FOOD_ATTP, 10); target:addMod(dsp.mod.FOOD_ATT_CAP, 40); target:addMod(dsp.mod.FOOD_RACCP, 12); target:addMod(dsp.mod.FOOD_RACC_CAP, 80); target:addMod(dsp.mod.FOOD_RATTP, 10); target:addMod(dsp.mod.FOOD_RATT_CAP, 40); end; function onEffectLose(target, effect) target:delMod(dsp.mod.HP, 10); target:delMod(dsp.mod.FOOD_ACCP, 12); target:delMod(dsp.mod.FOOD_ACC_CAP, 80); target:delMod(dsp.mod.FOOD_ATTP, 10); target:delMod(dsp.mod.FOOD_ATT_CAP, 40); target:delMod(dsp.mod.FOOD_RACCP, 12); target:delMod(dsp.mod.FOOD_RACC_CAP, 80); target:delMod(dsp.mod.FOOD_RATTP, 10); target:delMod(dsp.mod.FOOD_RATT_CAP, 40); end;
gpl-3.0
kidaa/Awakening-Core3
bin/scripts/object/draft_schematic/food/dish_exo_protein_wafers.lua
2
3257
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version object_draft_schematic_food_dish_exo_protein_wafers = object_draft_schematic_food_shared_dish_exo_protein_wafers:new { templateType = DRAFTSCHEMATIC, customObjectName = "Exo-Protein Wafers", craftingToolTab = 4, -- (See DraftSchemticImplementation.h) complexity = 3, size = 1, xpType = "crafting_general", xp = 30, assemblySkill = "general_assembly", experimentingSkill = "general_experimentation", customizationSkill = "clothing_customization", customizationOptions = {}, customizationStringNames = {}, customizationDefaults = {}, ingredientTemplateNames = {"craft_food_ingredients_n", "craft_food_ingredients_n", "craft_food_ingredients_n"}, ingredientTitleNames = {"protein_source", "preservative_wrap", "additive"}, ingredientSlotType = {0, 0, 3}, resourceTypes = {"meat", "hide", "object/tangible/food/crafted/additive/shared_additive_light.iff"}, resourceQuantities = {8, 7, 1}, contribution = {100, 100, 100}, targetTemplate = "object/tangible/food/crafted/dish_exo_protein_wafers.iff", additionalTemplates = { } } ObjectTemplates:addTemplate(object_draft_schematic_food_dish_exo_protein_wafers, "object/draft_schematic/food/dish_exo_protein_wafers.iff")
lgpl-3.0
kidaa/Awakening-Core3
bin/scripts/object/battlefield_marker/battlefield_marker_256m.lua
3
2256
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version object_battlefield_marker_battlefield_marker_256m = object_battlefield_marker_shared_battlefield_marker_256m:new { } ObjectTemplates:addTemplate(object_battlefield_marker_battlefield_marker_256m, "object/battlefield_marker/battlefield_marker_256m.iff")
lgpl-3.0
kidaa/Awakening-Core3
bin/scripts/object/tangible/loot/loot_schematic/cantina_chair_schematic.lua
2
2606
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version object_tangible_loot_loot_schematic_cantina_chair_schematic = object_tangible_loot_loot_schematic_shared_cantina_chair_schematic:new { templateType = LOOTSCHEMATIC, objectMenuComponent = {"cpp", "LootSchematicMenuComponent"}, attributeListComponent = "LootSchematicAttributeListComponent", requiredSkill = "crafting_artisan_master", targetDraftSchematic = "object/draft_schematic/furniture/furniture_chair_cantina.iff", targetUseCount = 1, } ObjectTemplates:addTemplate(object_tangible_loot_loot_schematic_cantina_chair_schematic, "object/tangible/loot/loot_schematic/cantina_chair_schematic.iff")
lgpl-3.0
kidaa/Awakening-Core3
bin/scripts/object/intangible/pet/pet_deed.lua
3
2180
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version object_intangible_pet_pet_deed = object_intangible_pet_shared_pet_deed:new { } ObjectTemplates:addTemplate(object_intangible_pet_pet_deed, "object/intangible/pet/pet_deed.iff")
lgpl-3.0
LuaDist2/lrexlib-oniguruma
test/gnu_sets.lua
9
1574
-- See Copyright Notice in the file LICENSE local luatest = require "luatest" local N = luatest.NT local unpack = unpack or table.unpack local function norm(a) return a==nil and N or a end local function set_f_gmatch (lib, flg) local downcase = {} for i = 0, 255 do -- 255 == UCHAR_MAX downcase[i] = string.gsub(string.char (i), ".", function (s) return string.lower(s) end) end -- gmatch (s, p, [cf], [ef], [tr]) local function test_gmatch (subj, patt) local out, guard = {}, 10 for a, b in lib.gmatch (subj, patt, nil, nil, downcase) do table.insert (out, { norm(a), norm(b) }) guard = guard - 1 if guard == 0 then break end end return unpack (out) end return { Name = "Function gmatch", Func = test_gmatch, --{ subj patt results } { {"abA", "a"}, {{"a",N}, {"A",N} } }, } end local function set_f_match (lib, flg) return { Name = "Function match", Func = lib.match, --{subj, patt, st,cf,ef}, { results } { {"abcd", ".+", 5}, { N } }, -- failing st { {"abc", "^abc"}, {"abc" } }, -- anchor { {"abc", "^abc", N,N,flg.not_bol}, { N } }, -- anchor + ef { {"abc", "abc$", N,N,flg.not_eol}, { N } }, -- anchor + ef { {"cabcaab", "ca+b", N,N,flg.backward}, {"caab" } }, -- reverse search } end return function (libname) local lib = require (libname) local flags = lib.flags () return { set_f_match (lib, flags), set_f_gmatch (lib), } end
mit
kidaa/Awakening-Core3
bin/scripts/object/tangible/medicine/crafted/medpack_disease_area_health_c.lua
1
3382
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version object_tangible_medicine_crafted_medpack_disease_area_health_c = object_tangible_medicine_crafted_shared_medpack_disease_area_health_c:new { gameObjectType = 8240, templateType = DOTPACK, useCount = 10, medicineUse = 5, effectiveness = 100, duration = 300, range = 15, rangeMod = 0.3, pool = 0, dotType = DISEASED, potency = 350, commandToExecute = "/applydisease", area = 10, numberExperimentalProperties = {1, 1, 2, 2, 2, 2, 2, 2, 2, 1}, experimentalProperties = {"XX", "XX", "OQ", "PE", "OQ", "UT", "CD", "OQ", "CD", "OQ", "OQ", "PE", "OQ", "PE", "DR", "OQ", "XX"}, experimentalWeights = {1, 1, 2, 1, 2, 1, 1, 2, 1, 2, 2, 1, 2, 1, 1, 1, 1}, experimentalGroupTitles = {"null", "null", "exp_effectiveness", "exp_charges", "exp_charges", "exp_effectiveness", "expEaseOfUse", "expEaseOfUse", "exp_effectiveness", "null"}, experimentalSubGroupTitles = {"null", "null", "power", "charges", "range", "area", "skillmodmin", "potency", "duration", "hitpoints"}, experimentalMin = {0, 0, 5, 15, 15, 5, 100, 25, 120, 1000}, experimentalMax = {0, 0, 50, 35, 30, 20, 70, 150, 1000, 1000}, experimentalPrecision = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, experimentalCombineType = {0, 0, 1, 1, 1, 1, 1, 1, 1, 4}, } ObjectTemplates:addTemplate(object_tangible_medicine_crafted_medpack_disease_area_health_c, "object/tangible/medicine/crafted/medpack_disease_area_health_c.iff")
lgpl-3.0
kidaa/Awakening-Core3
bin/scripts/object/mobile/vrelt.lua
3
2136
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version object_mobile_vrelt = object_mobile_shared_vrelt:new { } ObjectTemplates:addTemplate(object_mobile_vrelt, "object/mobile/vrelt.iff")
lgpl-3.0
houqp/koreader
frontend/ui/data/koptoptions.lua
1
12687
local Device = require("device") local S = require("ui/data/strings") local optionsutil = require("ui/data/optionsutil") local _ = require("gettext") local Screen = Device.screen local KoptOptions = { prefix = 'kopt', needs_redraw_on_change = true, { icon = "resources/icons/appbar.transform.rotate.right.large.png", options = { { name = "screen_mode", name_text = S.SCREEN_MODE, toggle = {S.PORTRAIT, S.LANDSCAPE}, alternate = false, args = {"portrait", "landscape"}, default_arg = "portrait", current_func = function() return Screen:getScreenMode() end, event = "SwapScreenMode", name_text_hold_callback = optionsutil.showValues, } } }, { icon = "resources/icons/appbar.crop.large.png", options = { { name = "trim_page", name_text = S.PAGE_CROP, toggle = {S.MANUAL, S.AUTO, S.SEMIAUTO, S.NONE}, alternate = false, values = {0, 1, 2, 3}, default_value = DKOPTREADER_CONFIG_TRIM_PAGE, enabled_func = Device.isTouchDevice, event = "PageCrop", args = {"manual", "auto", "semi-auto", "none"}, name_text_hold_callback = optionsutil.showValues, } } }, { icon = "resources/icons/appbar.column.two.large.png", options = { { name = "page_scroll", name_text = S.SCROLL_MODE, toggle = {S.ON, S.OFF}, values = {1, 0}, default_value = DSCROLL_MODE, event = "SetScrollMode", args = {true, false}, name_text_hold_callback = optionsutil.showValues, }, { name = "full_screen", name_text = S.PROGRESS_BAR, toggle = {S.OFF, S.ON}, values = {1, 0}, default_value = DFULL_SCREEN, event = "SetFullScreen", args = {true, false}, show = false, name_text_hold_callback = optionsutil.showValues, }, { name = "page_margin", name_text = S.PAGE_MARGIN, toggle = {S.SMALL, S.MEDIUM, S.LARGE}, values = {0.05, 0.10, 0.25}, default_value = DKOPTREADER_CONFIG_PAGE_MARGIN, event = "MarginUpdate", name_text_hold_callback = optionsutil.showValues, }, { name = "line_spacing", name_text = S.LINE_SPACING, toggle = {S.SMALL, S.MEDIUM, S.LARGE}, values = {1.0, 1.2, 1.4}, default_value = DKOPTREADER_CONFIG_LINE_SPACING, advanced = true, name_text_hold_callback = optionsutil.showValues, }, { name = "max_columns", name_text = S.COLUMNS, item_icons = { "resources/icons/appbar.column.one.png", "resources/icons/appbar.column.two.png", "resources/icons/appbar.column.three.png", }, values = {1,2,3}, default_value = DKOPTREADER_CONFIG_MAX_COLUMNS, enabled_func = function(configurable) return optionsutil.enableIfEquals(configurable, "text_wrap", 1) end, name_text_hold_callback = optionsutil.showValues, }, { name = "justification", name_text = S.TEXT_ALIGN, item_icons = { "resources/icons/appbar.align.auto.png", "resources/icons/appbar.align.left.png", "resources/icons/appbar.align.center.png", "resources/icons/appbar.align.right.png", "resources/icons/appbar.align.justify.png", }, values = {-1,0,1,2,3}, default_value = DKOPTREADER_CONFIG_JUSTIFICATION, advanced = true, enabled_func = function(configurable) return optionsutil.enableIfEquals(configurable, "text_wrap", 1) end, labels = {S.AUTO, S.LEFT, S.CENTER, S.RIGHT, S.JUSTIFY}, name_text_hold_callback = optionsutil.showValues, }, } }, { icon = "resources/icons/appbar.text.size.large.png", options = { { name = "font_size", item_text = {"Aa","Aa","Aa","Aa","Aa","Aa","Aa","Aa"}, item_align_center = 1.0, spacing = 15, height = 60, item_font_size = {24,28,32,34,36,38,42,46}, values = {0.2, 0.4, 0.6, 0.8, 1.0, 1.2, 1.6, 2.0}, default_value = DKOPTREADER_CONFIG_FONT_SIZE, event = "FontSizeUpdate", enabled_func = function(configurable) return optionsutil.enableIfEquals(configurable, "text_wrap", 1) end, }, { name = "font_fine_tune", name_text = S.FONTSIZE_FINE_TUNING, toggle = Device:isTouchDevice() and {S.DECREASE, S.INCREASE} or nil, item_text = not Device:isTouchDevice() and {S.DECREASE, S.INCREASE} or nil, values = {-0.05, 0.05}, default_value = 0.05, event = "FineTuningFontSize", args = {-0.05, 0.05}, alternate = false, enabled_func = function(configurable) return optionsutil.enableIfEquals(configurable, "text_wrap", 1) end, name_text_hold_callback = function(configurable, __, prefix) local opt = { name = "font_size", name_text = _("Font Size"), } optionsutil.showValues(configurable, opt, prefix) end } } }, { icon = "resources/icons/appbar.grade.b.large.png", options = { { name = "contrast", name_text = S.CONTRAST, buttonprogress = true, values = {1/0.8, 1/1.0, 1/1.5, 1/2.0, 1/3.0, 1/4.0, 1/6.0, 1/9.0}, default_pos = 2, default_value = DKOPTREADER_CONFIG_CONTRAST, event = "GammaUpdate", args = {0.8, 1.0, 1.5, 2.0, 3.0, 4.0, 6.0, 9.0}, labels = {0.8, 1.0, 1.5, 2.0, 3.0, 4.0, 6.0, 9.0}, name_text_hold_callback = optionsutil.showValues, } } }, { icon = "resources/icons/appbar.settings.large.png", options = { { name = "text_wrap", name_text = S.REFLOW, toggle = {S.ON, S.OFF}, values = {1, 0}, default_value = DKOPTREADER_CONFIG_TEXT_WRAP, events = { { event = "RedrawCurrentPage", }, { event = "RestoreZoomMode", }, { event = "InitScrollPageStates", }, }, name_text_hold_callback = optionsutil.showValues, }, { name = "page_opt", name_text = S.DEWATERMARK, toggle = {S.ON, S.OFF}, values = {1, 0}, default_value = 0, name_text_hold_callback = optionsutil.showValues, help_text = _([[Remove watermarks from the rendered document. This can also be used to remove some gray background or to convert a grayscale or color document to black & white and get more contrast for easier reading.]]), }, { name="doc_language", name_text = S.DOC_LANG, toggle = DKOPTREADER_CONFIG_DOC_LANGS_TEXT, values = DKOPTREADER_CONFIG_DOC_LANGS_CODE, default_value = DKOPTREADER_CONFIG_DOC_DEFAULT_LANG_CODE, event = "DocLangUpdate", args = DKOPTREADER_CONFIG_DOC_LANGS_CODE, name_text_hold_callback = optionsutil.showValues, help_text = _([[(Used by the OCR engine.)]]), }, { name = "word_spacing", name_text = S.WORD_GAP, toggle = {S.SMALL, S.AUTO, S.LARGE}, values = DKOPTREADER_CONFIG_WORD_SPACINGS, default_value = DKOPTREADER_CONFIG_DEFAULT_WORD_SPACING, enabled_func = function(configurable) return optionsutil.enableIfEquals(configurable, "text_wrap", 1) end, name_text_hold_callback = optionsutil.showValues, }, { name = "writing_direction", name_text = S.WRITING_DIR, toggle = {S.LTR, S.RTL, S.TBRTL}, values = {0, 1, 2}, default_value = 0, enabled_func = function(configurable) return optionsutil.enableIfEquals(configurable, "text_wrap", 1) end, name_text_hold_callback = optionsutil.showValues, }, { name = "quality", name_text = S.RENDER_QUALITY, toggle = {S.LOW, S.DEFAULT, S.HIGH}, values={0.5, 1.0, 1.5}, default_value = DKOPTREADER_CONFIG_RENDER_QUALITY, advanced = true, enabled_func = function(configurable) return optionsutil.enableIfEquals(configurable, "text_wrap", 1) end, name_text_hold_callback = optionsutil.showValues, }, { name = "hw_dithering", name_text = S.HW_DITHERING, toggle = {S.ON, S.OFF}, values = {1, 0}, default_value = 0, advanced = true, show = Device:hasEinkScreen() and Device:canHWDither(), name_text_hold_callback = optionsutil.showValues, }, { name = "forced_ocr", name_text = S.FORCED_OCR, toggle = {S.ON, S.OFF}, values = {1, 0}, default_value = 0, advanced = true, name_text_hold_callback = optionsutil.showValues, }, { name = "defect_size", name_text = S.DEFECT_SIZE, toggle = {S.SMALL, S.MEDIUM, S.LARGE}, values = {1.0, 3.0, 5.0}, default_value = DKOPTREADER_CONFIG_DEFECT_SIZE, event = "DefectSizeUpdate", show = false, enabled_func = function(configurable) return optionsutil.enableIfEquals(configurable, "text_wrap", 1) end, name_text_hold_callback = optionsutil.showValues, }, { name = "auto_straighten", name_text = S.AUTO_STRAIGHTEN, toggle = {S.ZERO_DEG, S.FIVE_DEG, S.TEN_DEG}, values = {0, 5, 10}, default_value = DKOPTREADER_CONFIG_AUTO_STRAIGHTEN, show = false, enabled_func = function(configurable) return optionsutil.enableIfEquals(configurable, "text_wrap", 1) end, name_text_hold_callback = optionsutil.showValues, }, { name = "detect_indent", name_text = S.INDENTATION, toggle = {S.ON, S.OFF}, values = {1, 0}, default_value = DKOPTREADER_CONFIG_DETECT_INDENT, show = false, enabled_func = function(configurable) return optionsutil.enableIfEquals(configurable, "text_wrap", 1) end, name_text_hold_callback = optionsutil.showValues, }, } }, } return KoptOptions
agpl-3.0
eraffxi/darkstar
scripts/zones/Aydeewa_Subterrane/npcs/16.lua
2
1146
----------------------------------- -- Area: Aydeewa Subterrane -- NPC: Blank (TOAU-20 Cutscene, TOAU-27 Cutscene) -- !pos -298 36 -38 68 ----------------------------------- package.loaded["scripts/zones/Aydeewa_Subterrane/TextIDs"] = nil; ----------------------------------- require("scripts/globals/missions"); require("scripts/zones/Aydeewa_Subterrane/TextIDs"); ----------------------------------- function onTrade(player,npc,trade) end; function onTrigger(player,npc) if (player:getCurrentMission(TOAU) == TEAHOUSE_TUMULT and player:getVar("AhtUrganStatus") == 1) then player:startEvent(11); elseif (player:getCurrentMission(TOAU) == MISPLACED_NOBILITY) then player:startEvent(12); end end; function onEventUpdate(player,csid,option) end; function onEventFinish(player,csid,option) if (csid == 11) then player:completeMission(TOAU,TEAHOUSE_TUMULT); player:setVar("AhtUrganStatus",0); player:addMission(TOAU,FINDERS_KEEPERS); elseif (csid == 12) then player:completeMission(TOAU,MISPLACED_NOBILITY); player:addMission(TOAU,BASTION_OF_KNOWLEDGE); end end;
gpl-3.0
kidaa/Awakening-Core3
bin/scripts/object/mobile/dressed_aakuan_sentinal_rodian_male_01.lua
3
2268
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version object_mobile_dressed_aakuan_sentinal_rodian_male_01 = object_mobile_shared_dressed_aakuan_sentinal_rodian_male_01:new { } ObjectTemplates:addTemplate(object_mobile_dressed_aakuan_sentinal_rodian_male_01, "object/mobile/dressed_aakuan_sentinal_rodian_male_01.iff")
lgpl-3.0
kidaa/Awakening-Core3
bin/scripts/object/tangible/ship/components/weapon/wpn_mandal_super_mangler.lua
3
2312
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version object_tangible_ship_components_weapon_wpn_mandal_super_mangler = object_tangible_ship_components_weapon_shared_wpn_mandal_super_mangler:new { } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_wpn_mandal_super_mangler, "object/tangible/ship/components/weapon/wpn_mandal_super_mangler.iff")
lgpl-3.0
kidaa/Awakening-Core3
bin/scripts/object/tangible/wearables/wookiee/objects.lua
3
43262
--Copyright (C) 2009 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version --which carries forward this exception. object_tangible_wearables_wookiee_shared_wke_gloves_s01 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/wearables/wookiee/shared_wke_gloves_s01.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/wke_gloves_s01_f.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/gloves_long.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 16777232, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@wearables_detail:wke_gloves_s01", gameObjectType = 16777232, locationReservationRadius = 0, lookAtText = "@wearables_lookat:wke_gloves_s01", noBuildRadius = 0, objectName = "@wearables_name:wke_gloves_s01", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 982220507, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/wearables/base/shared_wearables_base.iff", "object/tangible/wearables/base/shared_base_gloves_long.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_wearables_wookiee_shared_wke_gloves_s01, "object/tangible/wearables/wookiee/shared_wke_gloves_s01.iff") object_tangible_wearables_wookiee_shared_wke_gloves_s02 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/wearables/wookiee/shared_wke_gloves_s02.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/wke_gloves_s02_f.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/gloves_long.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 16777232, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@wearables_detail:wke_gloves_s02", gameObjectType = 16777232, locationReservationRadius = 0, lookAtText = "@wearables_lookat:wke_gloves_s02", noBuildRadius = 0, objectName = "@wearables_name:wke_gloves_s02", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 3785152076, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/wearables/base/shared_wearables_base.iff", "object/tangible/wearables/base/shared_base_gloves_long.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_wearables_wookiee_shared_wke_gloves_s02, "object/tangible/wearables/wookiee/shared_wke_gloves_s02.iff") object_tangible_wearables_wookiee_shared_wke_gloves_s03 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/wearables/wookiee/shared_wke_gloves_s03.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/wke_gloves_s03_f.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/gloves_long.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 16777232, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@wearables_detail:wke_gloves_s03", gameObjectType = 16777232, locationReservationRadius = 0, lookAtText = "@wearables_lookat:wke_gloves_s03", noBuildRadius = 0, objectName = "@wearables_name:wke_gloves_s03", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 2828120513, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/wearables/base/shared_wearables_base.iff", "object/tangible/wearables/base/shared_base_gloves_long.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_wearables_wookiee_shared_wke_gloves_s03, "object/tangible/wearables/wookiee/shared_wke_gloves_s03.iff") object_tangible_wearables_wookiee_shared_wke_gloves_s04 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/wearables/wookiee/shared_wke_gloves_s04.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/wke_gloves_s04_f.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/gloves_long.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 16777232, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@wearables_detail:wke_gloves_s04", gameObjectType = 16777232, locationReservationRadius = 0, lookAtText = "@wearables_lookat:wke_gloves_s04", noBuildRadius = 0, objectName = "@wearables_name:wke_gloves_s04", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 1400019669, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/wearables/base/shared_wearables_base.iff", "object/tangible/wearables/base/shared_base_gloves_long.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_wearables_wookiee_shared_wke_gloves_s04, "object/tangible/wearables/wookiee/shared_wke_gloves_s04.iff") object_tangible_wearables_wookiee_shared_wke_hat_s01 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/wearables/wookiee/shared_wke_hat_s01.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/wke_hat_s01_f.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hat.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 16777232, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@wearables_detail:wke_hat_s01", gameObjectType = 16777232, locationReservationRadius = 0, lookAtText = "@wearables_lookat:wke_hat_s01", noBuildRadius = 0, objectName = "@wearables_name:wke_hat_s01", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 143220595, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/wearables/base/shared_wearables_base.iff", "object/tangible/wearables/base/shared_base_hat.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_wearables_wookiee_shared_wke_hat_s01, "object/tangible/wearables/wookiee/shared_wke_hat_s01.iff") object_tangible_wearables_wookiee_shared_wke_hood_s01 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/wearables/wookiee/shared_wke_hood_s01.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/wke_hood_s01_f.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hat.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 16777232, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@wearables_detail:wke_hood_s01", gameObjectType = 16777232, locationReservationRadius = 0, lookAtText = "@wearables_lookat:wke_hood_s01", noBuildRadius = 0, objectName = "@wearables_name:wke_hood_s01", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 773028987, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/wearables/base/shared_wearables_base.iff", "object/tangible/wearables/base/shared_base_hat.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_wearables_wookiee_shared_wke_hood_s01, "object/tangible/wearables/wookiee/shared_wke_hood_s01.iff") object_tangible_wearables_wookiee_shared_wke_hood_s02 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/wearables/wookiee/shared_wke_hood_s02.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/wke_hood_s02_f.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hat.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 16777232, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@wearables_detail:wke_hood_s02", gameObjectType = 16777232, locationReservationRadius = 0, lookAtText = "@wearables_lookat:wke_hood_s02", noBuildRadius = 0, objectName = "@wearables_name:wke_hood_s02", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 4110734572, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/wearables/base/shared_wearables_base.iff", "object/tangible/wearables/base/shared_base_hat.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_wearables_wookiee_shared_wke_hood_s02, "object/tangible/wearables/wookiee/shared_wke_hood_s02.iff") object_tangible_wearables_wookiee_shared_wke_hood_s03 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/wearables/wookiee/shared_wke_hood_s03.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/wke_hood_s03_f.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hat.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 16777232, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@wearables_detail:wke_hood_s03", gameObjectType = 16777232, locationReservationRadius = 0, lookAtText = "@wearables_lookat:wke_hood_s03", noBuildRadius = 0, objectName = "@wearables_name:wke_hood_s03", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 3154752353, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/wearables/base/shared_wearables_base.iff", "object/tangible/wearables/base/shared_base_hat.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_wearables_wookiee_shared_wke_hood_s03, "object/tangible/wearables/wookiee/shared_wke_hood_s03.iff") object_tangible_wearables_wookiee_shared_wke_lifeday_robe = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/wearables/wookiee/shared_wke_lifeday_robe.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/wke_lifeday_robe_f.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/robe_longsleeve.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 16777232, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@wearables_detail:wke_lifeday_robe", gameObjectType = 16777232, locationReservationRadius = 0, lookAtText = "wearables_lookat", noBuildRadius = 0, objectName = "@wearables_name:wke_lifeday_robe", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 1294873415, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/wearables/base/shared_wearables_base.iff", "object/tangible/wearables/base/shared_base_robe_longsleeve.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_wearables_wookiee_shared_wke_lifeday_robe, "object/tangible/wearables/wookiee/shared_wke_lifeday_robe.iff") object_tangible_wearables_wookiee_shared_wke_lifeday_robe_f = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/wearables/wookiee/shared_wke_lifeday_robe_f.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/wke_lifeday_robe_f.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/robe_longsleeve.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 16777232, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@wearables_detail:wke_lifeday_robe_f", gameObjectType = 16777232, locationReservationRadius = 0, lookAtText = "wearables_lookat", noBuildRadius = 0, objectName = "@wearables_name:wke_lifeday_robe", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 2316465710, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/wearables/base/shared_wearables_base.iff", "object/tangible/wearables/base/shared_base_robe_longsleeve.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_wearables_wookiee_shared_wke_lifeday_robe_f, "object/tangible/wearables/wookiee/shared_wke_lifeday_robe_f.iff") object_tangible_wearables_wookiee_shared_wke_lifeday_robe_m = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/wearables/wookiee/shared_wke_lifeday_robe_m.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/wke_lifeday_robe_m.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/robe_longsleeve.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 16777232, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@wearables_detail:wke_lifeday_robe", gameObjectType = 16777232, locationReservationRadius = 0, lookAtText = "wearables_lookat", noBuildRadius = 0, objectName = "@wearables_name:wke_lifeday_robe", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 283957695, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/wearables/base/shared_wearables_base.iff", "object/tangible/wearables/base/shared_base_robe_longsleeve.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_wearables_wookiee_shared_wke_lifeday_robe_m, "object/tangible/wearables/wookiee/shared_wke_lifeday_robe_m.iff") object_tangible_wearables_wookiee_shared_wke_shirt_s01 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/wearables/wookiee/shared_wke_shirt_s01.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/wke_shirt_s01_f.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/shirt.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 16777232, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@wearables_detail:wke_shirt_s01", gameObjectType = 16777232, locationReservationRadius = 0, lookAtText = "@wearables_lookat:wke_shirt_s01", noBuildRadius = 0, objectName = "@wearables_name:wke_shirt_s01", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 2791438893, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/wearables/base/shared_wearables_base.iff", "object/tangible/wearables/base/shared_base_shirt.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_wearables_wookiee_shared_wke_shirt_s01, "object/tangible/wearables/wookiee/shared_wke_shirt_s01.iff") object_tangible_wearables_wookiee_shared_wke_shirt_s02 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/wearables/wookiee/shared_wke_shirt_s02.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/wke_shirt_s02_f.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/shirt.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 16777232, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@wearables_detail:wke_shirt_s02", gameObjectType = 16777232, locationReservationRadius = 0, lookAtText = "@wearables_lookat:wke_shirt_s02", noBuildRadius = 0, objectName = "@wearables_name:wke_shirt_s02", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 2104906426, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/wearables/base/shared_wearables_base.iff", "object/tangible/wearables/base/shared_base_shirt.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_wearables_wookiee_shared_wke_shirt_s02, "object/tangible/wearables/wookiee/shared_wke_shirt_s02.iff") object_tangible_wearables_wookiee_shared_wke_shirt_s03 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/wearables/wookiee/shared_wke_shirt_s03.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/wke_shirt_s03_f.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/shirt.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 16777232, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@wearables_detail:wke_shirt_s03", gameObjectType = 16777232, locationReservationRadius = 0, lookAtText = "@wearables_lookat:wke_shirt_s03", noBuildRadius = 0, objectName = "@wearables_name:wke_shirt_s03", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 880489783, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/wearables/base/shared_wearables_base.iff", "object/tangible/wearables/base/shared_base_shirt.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_wearables_wookiee_shared_wke_shirt_s03, "object/tangible/wearables/wookiee/shared_wke_shirt_s03.iff") object_tangible_wearables_wookiee_shared_wke_shirt_s04 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/wearables/wookiee/shared_wke_shirt_s04.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/wke_shirt_s04_f.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/shirt.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 16777232, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@wearables_detail:wke_shirt_s04", gameObjectType = 16777232, locationReservationRadius = 0, lookAtText = "@wearables_lookat:wke_shirt_s04", noBuildRadius = 0, objectName = "@wearables_name:wke_shirt_s04", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 3482852899, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/wearables/base/shared_wearables_base.iff", "object/tangible/wearables/base/shared_base_shirt.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_wearables_wookiee_shared_wke_shirt_s04, "object/tangible/wearables/wookiee/shared_wke_shirt_s04.iff") object_tangible_wearables_wookiee_shared_wke_shoulder_pad_s01 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/wearables/wookiee/shared_wke_shoulder_pad_s01.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/wke_shoulder_pad_s01_f.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/shirt.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 16777232, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@wearables_detail:wke_shoulder_pads_s01", gameObjectType = 16777232, locationReservationRadius = 0, lookAtText = "@wearables_lookat:wke_shoulder_pads_s01", noBuildRadius = 0, objectName = "@wearables_name:wke_shoulder_pads_s01", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 1209883613, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/wearables/base/shared_wearables_base.iff", "object/tangible/wearables/base/shared_base_shirt.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_wearables_wookiee_shared_wke_shoulder_pad_s01, "object/tangible/wearables/wookiee/shared_wke_shoulder_pad_s01.iff") object_tangible_wearables_wookiee_shared_wke_shoulder_pad_s02 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/wearables/wookiee/shared_wke_shoulder_pad_s02.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/wke_shoulder_pad_s02_f.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/shirt.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 16777232, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@wearables_detail:wke_shoulder_pads_s02", gameObjectType = 16777232, locationReservationRadius = 0, lookAtText = "@wearables_lookat:wke_shoulder_pads_s02", noBuildRadius = 0, objectName = "@wearables_name:wke_shoulder_pads_s02", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 2466968394, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/wearables/base/shared_wearables_base.iff", "object/tangible/wearables/base/shared_base_shirt.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_wearables_wookiee_shared_wke_shoulder_pad_s02, "object/tangible/wearables/wookiee/shared_wke_shoulder_pad_s02.iff") object_tangible_wearables_wookiee_shared_wke_skirt_s01 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/wearables/wookiee/shared_wke_skirt_s01.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/wke_skirt_s01_f.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/skirt.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 16777232, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@wearables_detail:wke_skirt_s01", gameObjectType = 16777232, locationReservationRadius = 0, lookAtText = "@wearables_lookat:wke_skirt_s01", noBuildRadius = 0, objectName = "@wearables_name:wke_skirt_s01", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 2927288103, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/wearables/base/shared_wearables_base.iff", "object/tangible/wearables/base/shared_base_skirt.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_wearables_wookiee_shared_wke_skirt_s01, "object/tangible/wearables/wookiee/shared_wke_skirt_s01.iff") object_tangible_wearables_wookiee_shared_wke_skirt_s02 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/wearables/wookiee/shared_wke_skirt_s02.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/wke_skirt_s02_f.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/skirt.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 16777232, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@wearables_detail:wke_skirt_s02", gameObjectType = 16777232, locationReservationRadius = 0, lookAtText = "@wearables_lookat:wke_skirt_s02", noBuildRadius = 0, objectName = "@wearables_name:wke_skirt_s02", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 1970108336, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/wearables/base/shared_wearables_base.iff", "object/tangible/wearables/base/shared_base_skirt.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_wearables_wookiee_shared_wke_skirt_s02, "object/tangible/wearables/wookiee/shared_wke_skirt_s02.iff") object_tangible_wearables_wookiee_shared_wke_skirt_s03 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/wearables/wookiee/shared_wke_skirt_s03.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/wke_skirt_s03_f.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/skirt.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 16777232, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@wearables_detail:wke_skirt_s03", gameObjectType = 16777232, locationReservationRadius = 0, lookAtText = "@wearables_lookat:wke_skirt_s03", noBuildRadius = 0, objectName = "@wearables_name:wke_skirt_s03", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 1012928573, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/wearables/base/shared_wearables_base.iff", "object/tangible/wearables/base/shared_base_skirt.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_wearables_wookiee_shared_wke_skirt_s03, "object/tangible/wearables/wookiee/shared_wke_skirt_s03.iff") object_tangible_wearables_wookiee_shared_wke_skirt_s04 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/wearables/wookiee/shared_wke_skirt_s04.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/wke_skirt_s04_f.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/skirt.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 16777232, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@wearables_detail:wke_skirt_s04", gameObjectType = 16777232, locationReservationRadius = 0, lookAtText = "@wearables_lookat:wke_skirt_s04", noBuildRadius = 0, objectName = "@wearables_name:wke_skirt_s04", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 3347266345, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/wearables/base/shared_wearables_base.iff", "object/tangible/wearables/base/shared_base_skirt.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_wearables_wookiee_shared_wke_skirt_s04, "object/tangible/wearables/wookiee/shared_wke_skirt_s04.iff")
lgpl-3.0
kidaa/Awakening-Core3
bin/scripts/commands/eat.lua
4
2102
--Copyright (C) 2007 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version --which carries forward this exception. --true = 1, false = 0 EatCommand = { name = "eat", } AddCommand(EatCommand)
lgpl-3.0
kidaa/Awakening-Core3
bin/scripts/object/static/item/item_tool_droid_toolkit.lua
3
2228
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version object_static_item_item_tool_droid_toolkit = object_static_item_shared_item_tool_droid_toolkit:new { } ObjectTemplates:addTemplate(object_static_item_item_tool_droid_toolkit, "object/static/item/item_tool_droid_toolkit.iff")
lgpl-3.0
eraffxi/darkstar
scripts/zones/Mount_Zhayolm/npcs/_1p3.lua
2
3039
----------------------------------- -- Area: Mount Zhayolm -- Door: Runic Seal -- !pos 703 -18 382 61 ----------------------------------- package.loaded["scripts/zones/Mount_Zhayolm/TextIDs"] = nil; ----------------------------------- require("scripts/globals/keyitems"); require("scripts/globals/missions"); require("scripts/globals/besieged"); require("scripts/zones/Mount_Zhayolm/TextIDs"); ----------------------------------- function onTrade(player,npc,trade) end; function onTrigger(player,npc) if (player:hasKeyItem(dsp.ki.LEBROS_ASSAULT_ORDERS)) then local assaultid = player:getCurrentAssault(); local recommendedLevel = getRecommendedAssaultLevel(assaultid); local armband = 0; if (player:hasKeyItem(dsp.ki.ASSAULT_ARMBAND)) then armband = 1; end player:startEvent(203, assaultid, -4, 0, recommendedLevel, 2, armband); else player:messageSpecial(NOTHING_HAPPENS); end end; function onEventUpdate(player,csid,option,target) local assaultid = player:getCurrentAssault(); local cap = bit.band(option, 0x03); if (cap == 0) then cap = 99; elseif (cap == 1) then cap = 70; elseif (cap == 2) then cap = 60; else cap = 50; end player:setVar("AssaultCap", cap); local party = player:getParty(); if (party ~= nil) then for i,v in ipairs(party) do if (not (v:hasKeyItem(dsp.ki.LEBROS_ASSAULT_ORDERS) and v:getCurrentAssault() == assaultid)) then player:messageText(target,MEMBER_NO_REQS, false); player:instanceEntry(target,1); return; elseif (v:getZoneID() == player:getZoneID() and v:checkDistance(player) > 50) then player:messageText(target,MEMBER_TOO_FAR, false); player:instanceEntry(target,1); return; end end end player:createInstance(player:getCurrentAssault(), 63); end; function onEventFinish(player,csid,option,target) if (csid == 208 or (csid == 203 and option == 4)) then player:setPos(0,0,0,0,63); end end; function onInstanceCreated(player,target,instance) if (instance) then instance:setLevelCap(player:getVar("AssaultCap")); player:setVar("AssaultCap", 0); player:setInstance(instance); player:instanceEntry(target,4); player:delKeyItem(dsp.ki.LEBROS_ASSAULT_ORDERS); player:delKeyItem(dsp.ki.ASSAULT_ARMBAND); local party = player:getParty(); if (party ~= nil) then for i,v in ipairs(party) do if v:getID() ~= player:getID() and v:getZoneID() == player:getZoneID() then v:setInstance(instance); v:startEvent(208, 2); v:delKeyItem(dsp.ki.LEBROS_ASSAULT_ORDERS); end end end else player:messageText(target,CANNOT_ENTER, false); player:instanceEntry(target,3); end end;
gpl-3.0
kidaa/Awakening-Core3
bin/scripts/object/draft_schematic/scout/item_camp_luxury.lua
2
3178
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version object_draft_schematic_scout_item_camp_luxury = object_draft_schematic_scout_shared_item_camp_luxury:new { templateType = DRAFTSCHEMATIC, customObjectName = "High Tech Field Base Kit", craftingToolTab = 524288, -- (See DraftSchemticImplementation.h) complexity = 15, size = 1, xpType = "camp", xp = 230, assemblySkill = "general_assembly", experimentingSkill = "general_experimentation", customizationSkill = "clothing_customization", customizationOptions = {}, customizationStringNames = {}, customizationDefaults = {}, ingredientTemplateNames = {"craft_item_ingredients_n", "craft_item_ingredients_n", "craft_item_ingredients_n"}, ingredientTitleNames = {"shelter_canvas", "shelter_structure", "shelter_reinforcement"}, ingredientSlotType = {0, 0, 0}, resourceTypes = {"hide", "bone", "metal"}, resourceQuantities = {50, 35, 30}, contribution = {100, 100, 100}, targetTemplate = "object/tangible/scout/camp/camp_luxury.iff", additionalTemplates = { } } ObjectTemplates:addTemplate(object_draft_schematic_scout_item_camp_luxury, "object/draft_schematic/scout/item_camp_luxury.iff")
lgpl-3.0
kidaa/Awakening-Core3
bin/scripts/object/tangible/component/armor/armor_layer_restraint.lua
3
2272
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version object_tangible_component_armor_armor_layer_restraint = object_tangible_component_armor_shared_armor_layer_restraint:new { } ObjectTemplates:addTemplate(object_tangible_component_armor_armor_layer_restraint, "object/tangible/component/armor/armor_layer_restraint.iff")
lgpl-3.0
kidaa/Awakening-Core3
bin/scripts/object/tangible/lair/kima/objects.lua
3
7188
--Copyright (C) 2009 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version --which carries forward this exception. object_tangible_lair_kima_shared_lair_kima = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/lair/kima/shared_lair_kima.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/poi_all_lair_trash_dark.apt", arrangementDescriptorFilename = "", certificationsRequired = {}, clearFloraRadius = 25, clientDataFile = "clientdata/client_shared_lair_small.cdf", clientGameObjectType = 4, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@lair_d:kima", gameObjectType = 4, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 64, objectName = "@lair_n:kima", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 3165231595, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/lair/base/shared_lair_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_lair_kima_shared_lair_kima, "object/tangible/lair/kima/shared_lair_kima.iff") object_tangible_lair_kima_shared_lair_kima_grassland = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/lair/kima/shared_lair_kima_grassland.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/poi_all_lair_trash_dark.apt", arrangementDescriptorFilename = "", certificationsRequired = {}, clearFloraRadius = 25, clientDataFile = "clientdata/client_shared_lair_small.cdf", clientGameObjectType = 4, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@lair_d:kima_grassland", gameObjectType = 4, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 64, objectName = "@lair_n:kima_grassland", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 2030650931, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/lair/base/shared_lair_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_lair_kima_shared_lair_kima_grassland, "object/tangible/lair/kima/shared_lair_kima_grassland.iff") object_tangible_lair_kima_shared_lair_kima_mountain = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/lair/kima/shared_lair_kima_mountain.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/poi_all_lair_trash_dark.apt", arrangementDescriptorFilename = "", certificationsRequired = {}, clearFloraRadius = 25, clientDataFile = "clientdata/client_shared_lair_small.cdf", clientGameObjectType = 4, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@lair_d:kima_mountain", gameObjectType = 4, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 64, objectName = "@lair_n:kima_mountain", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 4188775446, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/lair/base/shared_lair_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_lair_kima_shared_lair_kima_mountain, "object/tangible/lair/kima/shared_lair_kima_mountain.iff")
lgpl-3.0
LuaDist2/luasocket
test/ftptest.lua
26
3156
local socket = require("socket") local ftp = require("socket.ftp") local url = require("socket.url") local ltn12 = require("ltn12") -- override protection to make sure we see all errors --socket.protect = function(s) return s end dofile("testsupport.lua") local host, port, index_file, index, back, err, ret local t = socket.gettime() host = host or "localhost" index_file = "index.html" -- a function that returns a directory listing local function nlst(u) local t = {} local p = url.parse(u) p.command = "nlst" p.sink = ltn12.sink.table(t) local r, e = ftp.get(p) return r and table.concat(t), e end -- function that removes a remote file local function dele(u) local p = url.parse(u) p.command = "dele" p.argument = string.gsub(p.path, "^/", "") if p.argumet == "" then p.argument = nil end p.check = 250 return ftp.command(p) end -- read index with CRLF convention index = readfile(index_file) io.write("testing wrong scheme: ") back, err = ftp.get("wrong://banana.com/lixo") assert(not back and err == "wrong scheme 'wrong'", err) print("ok") io.write("testing invalid url: ") back, err = ftp.get("localhost/dir1/index.html;type=i") assert(not back and err) print("ok") io.write("testing anonymous file download: ") back, err = socket.ftp.get("ftp://" .. host .. "/pub/index.html;type=i") assert(not err and back == index, err) print("ok") io.write("erasing before upload: ") ret, err = dele("ftp://luasocket:pedrovian@" .. host .. "/index.up.html") if not ret then print(err) else print("ok") end io.write("testing upload: ") ret, err = ftp.put("ftp://luasocket:pedrovian@" .. host .. "/index.up.html;type=i", index) assert(ret and not err, err) print("ok") io.write("downloading uploaded file: ") back, err = ftp.get("ftp://luasocket:pedrovian@" .. host .. "/index.up.html;type=i") assert(ret and not err and index == back, err) print("ok") io.write("erasing after upload/download: ") ret, err = dele("ftp://luasocket:pedrovian@" .. host .. "/index.up.html") assert(ret and not err, err) print("ok") io.write("testing weird-character translation: ") back, err = ftp.get("ftp://luasocket:pedrovian@" .. host .. "/%23%3f;type=i") assert(not err and back == index, err) print("ok") io.write("testing parameter overriding: ") local back = {} ret, err = ftp.get{ url = "//stupid:mistake@" .. host .. "/index.html", user = "luasocket", password = "pedrovian", type = "i", sink = ltn12.sink.table(back) } assert(ret and not err and table.concat(back) == index, err) print("ok") io.write("testing upload denial: ") ret, err = ftp.put("ftp://" .. host .. "/index.up.html;type=a", index) assert(not ret and err, "should have failed") print(err) io.write("testing authentication failure: ") ret, err = ftp.get("ftp://luasocket:wrong@".. host .. "/index.html;type=a") assert(not ret and err, "should have failed") print(err) io.write("testing wrong file: ") back, err = ftp.get("ftp://".. host .. "/index.wrong.html;type=a") assert(not back and err, "should have failed") print(err) print("passed all tests") print(string.format("done in %.2fs", socket.gettime() - t))
mit
kidaa/Awakening-Core3
bin/scripts/object/static/creature/droids_r2.lua
3
2188
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version object_static_creature_droids_r2 = object_static_creature_shared_droids_r2:new { } ObjectTemplates:addTemplate(object_static_creature_droids_r2, "object/static/creature/droids_r2.iff")
lgpl-3.0
kidaa/Awakening-Core3
bin/scripts/object/tangible/furniture/all/frn_all_decorative_lg_s2.lua
3
2276
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version object_tangible_furniture_all_frn_all_decorative_lg_s2 = object_tangible_furniture_all_shared_frn_all_decorative_lg_s2:new { } ObjectTemplates:addTemplate(object_tangible_furniture_all_frn_all_decorative_lg_s2, "object/tangible/furniture/all/frn_all_decorative_lg_s2.iff")
lgpl-3.0
kidaa/Awakening-Core3
bin/scripts/object/draft_schematic/vehicle/military/starship_impl_tie_b.lua
3
2296
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version object_draft_schematic_vehicle_military_starship_impl_tie_b = object_draft_schematic_vehicle_military_shared_starship_impl_tie_b:new { } ObjectTemplates:addTemplate(object_draft_schematic_vehicle_military_starship_impl_tie_b, "object/draft_schematic/vehicle/military/starship_impl_tie_b.iff")
lgpl-3.0
kidaa/Awakening-Core3
bin/scripts/object/static/test/test_static_sandcrawler.lua
3
2228
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version object_static_test_test_static_sandcrawler = object_static_test_shared_test_static_sandcrawler:new { } ObjectTemplates:addTemplate(object_static_test_test_static_sandcrawler, "object/static/test/test_static_sandcrawler.iff")
lgpl-3.0
kidaa/Awakening-Core3
bin/scripts/object/tangible/ship/crafted/chassis/chassis_z95_wing_l.lua
3
2280
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version object_tangible_ship_crafted_chassis_chassis_z95_wing_l = object_tangible_ship_crafted_chassis_shared_chassis_z95_wing_l:new { } ObjectTemplates:addTemplate(object_tangible_ship_crafted_chassis_chassis_z95_wing_l, "object/tangible/ship/crafted/chassis/chassis_z95_wing_l.iff")
lgpl-3.0
RoMBotCommunity/RoMBot
bot.lua
1
42649
BOT_VERSION = 3.29; local handle = io.popen("SubWCRev \""..getExecutionPath().."\"") local result = handle:read("*a") handle:close() BOT_REVISION = string.match(result,"Updated to revision (%d*)") or "<UNKNOWN>" --[[ BOT_REVISION = "<UNKNOWN>" -- Check version 1.7 style svn folder. local fname = getExecutionPath() .. "/.svn/wc.db" if( fileExists(fname) ) then local file, err = io.open(fname, "rb"); if file then local string = file:read("*a") for ver in string.gmatch(string,"%(svn:wc:ra_dav:version.url %d* %/svn%/!svn%/ver%/(%d*)%/trunk%/rom%)") do if BOT_REVISION == "<UNKNOWN>" or ver > BOT_REVISION then BOT_REVISION = ver end end file:close(); end end -- If not found, try version 1.6 style svn folder. if BOT_REVISION == "<UNKNOWN>" then local fname = getExecutionPath() .. "/.svn/entries" if( fileExists(fname) ) then local dirfound = false for line in io.lines(fname) do if dirfound then BOT_REVISION = line break elseif line == "dir" then dirfound = true end end end end ]] include("addresses.lua"); include("database.lua"); include("functions.lua"); include("classes/player.lua"); include("classes/equipment.lua"); include("classes/inventory.lua"); include("classes/bank.lua"); include("classes/guildbank.lua"); include("classes/cursor.lua"); include("classes/camera.lua"); include("classes/waypoint.lua"); include("classes/waypointlist.lua"); include("classes/waypointlist_wander.lua"); include("classes/node.lua"); include("classes/object.lua"); include("classes/objectlist.lua"); include("classes/eggpet.lua"); include("classes/store.lua"); include("classes/party.lua"); include("classes/itemtypes.lua"); include("classes/pet.lua"); include("settings.lua"); include("macros.lua"); functionBeingLoaded = "romglobal/userfunctions.lua" if( fileExists(getExecutionPath().."/../romglobal/userfunctions.lua") ) then include("../romglobal/userfunctions.lua"); end functionBeingLoaded = "userfunctions.lua" if( fileExists(getExecutionPath().."/userfunctions.lua") ) then include("userfunctions.lua"); end functionBeingLoaded = nil -- In case the user has no userfunctions. -- Allow include to check global and relative folders too if originalInclude == nil then originalInclude = include end function include(file, forceInclude) return originalInclude(findFile(file), forceInclude) end functionBeingLoaded = nil -- In case the user has no userfunctions. printf("Installing userfunctions. ") -- Message to help tell when userfunctions are a problem -- Install bot userfunctions local addondir = getDirectory(getExecutionPath() .. "/userfunctions/"); for i,v in pairs(addondir) do local match = string.match(v, "addon_(.*)%.lua"); if( not match ) then match = string.match(v, "userfunction_(.*)%.lua"); end; if( match ~= nil ) then functionBeingLoaded = match include("userfunctions/" .. v); functionBeingLoaded = nil logMessage("Bot userfunction \'" .. match .. "\' successfully loaded."); end end -- Install global bot userfunctions local globaladdondir = getDirectory(getExecutionPath() .. "/../romglobal/userfunctions/"); if globaladdondir then local localdir = getExecutionPath() .. "/userfunctions/" for i,v in pairs(globaladdondir) do if not(fileExists(localdir .. v)) then -- if not in local 'userfunctions' local match = string.match(v, "addon_(.*)%.lua"); if( not match ) then match = string.match(v, "userfunction_(.*)%.lua"); end; if( match ~= nil ) then functionBeingLoaded = match include("../romglobal/userfunctions/" .. v); functionBeingLoaded = nil logMessage("Global bot userfunction \'" .. match .. "\' successfully loaded."); end end end end printf("\n") -- Return to indicate end of userfunction installation. User wont notice this but -- if error is on same line as "Installing userfunctions" then we know it a userfunction error. -- Check for old userfunction_questbyname if compareQuestnames then error("The QuestByName functions are now part of the bot. The old userfunction is obsolete. Please remove the 'userfunctions_questbyname.lua' file from the userfunctions folder.") end setPriority(priority.high); settings.load(); setStartKey(settings.hotkeys.START_BOT.key); setStopKey(settings.hotkeys.STOP_BOT.key); __WPL = nil; -- Way Point List __RPL = nil; -- Return Point List -- start message text = sprintf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" .. "Welcome to rom bot! press END to quit\n" .. "RoM Bot Version %0.2f, Revision %s\n", BOT_VERSION, BOT_REVISION); printPicture("logo", text, 4); function main() local forcedProfile = nil; local forcedPath = nil; local forcedRetPath = nil; local forcedCharacter = nil; local debug_override = false for i = 2,#args do args[i] = string.lower(args[i]) if( args[i] == "update" ) then include("update.lua"); end if( args[i] == "debug" ) then debug_override = true settings.options.DEBUGGING = true; settings.options.DEBUGGING_MACRO = true; -- adds the numbers to the prints while in debug mode, -- normal language code is in settings.lua if( settings.options.USE_CLIENT_LANGUAGE ) then local hf_language; if( bot.ClientLanguage == "DE" ) then hf_language = "deutsch"; elseif(bot.ClientLanguage == "FR" ) then hf_language = "french"; elseif(bot.ClientLanguage == "RU" ) then hf_language = "russian"; elseif(bot.ClientLanguage == "PL" ) then hf_language = "polish"; else hf_language = "english"; end local function setLanguage(_name) include("/language/" .. _name .. ".lua"); end local lang_base = {}; for i,v in pairs(language) do lang_base[i] = v; end; -- remember current language value to fill gaps with that setLanguage(hf_language); for i,v in pairs(lang_base) do if( language[i] == nil ) then language[i] = "["..i.."] "..v; end end; lang_base = nil; -- Not needed anymore, destroy it. logMessage("Load Language for debugging with numbers"); end end local foundpos = string.find(args[i], ":", 1, true); if( foundpos ) then local var = string.sub(args[i], 1, foundpos-1); local val = string.sub(args[i], foundpos+1); if( var == "profile" ) then forcedProfile = val; elseif( var == "path" ) then forcedPath = val; elseif( var == "retpath" ) then forcedRetPath = val; elseif( var == "character") then forcedCharacter = val; else -- invalid option local msg = sprintf(language[61], args[i]); error(msg, 0 ); end end -- check the options if(not foundpos and args[i] ~= "update" and args[i] ~= "debug" ) then local msg = sprintf(language[61], args[i]); error(msg, 0 ); end; end database.load(); attach(getWin(forcedCharacter)); if( not checkExecutableCompatible() ) then printf("Addresses seem off, trying to update.\n") include("update.lua") if( not checkExecutableCompatible() ) then error("The addresses didn't update, you will have to wait until there is an SVN update that updates the addresses.\n") else cprintf(cli.yellow,"update.lua seems to have worked, addresses.lua has been updated.\n") end end local playerAddress = memoryReadUIntPtr(getProc(), addresses.staticbase_char, addresses.charPtr_offset); if( settings.options.DEBUGGING ) then printf(language[44]); -- Attempt to read playerAddress end if( playerAddress == nil ) then local msg = sprintf(language[48], "playerAddress"); -- pls update to current version error(msg, 0); end; logMessage(sprintf("Using static char address 0x%X, player address 0x%X", tonumber(addresses.staticbase_char), tonumber(playerAddress))); equipment = CEquipment() player = CPlayer.new(); if( settings.options.DEBUGGING ) then -- Player debugging info printf("[DEBUG] playerAddr: 0x%X\n", player.Address); printf("[DEBUG] player classes: %d/%d\n", player.Class1, player.Class2); printf("[DEBUG] player pet: 0x%X\n", player.PetPtr); printf("[DEBUG] Player target: 0x%X\n", player.TargetPtr); if( player.TargetPtr ~= 0 ) then local target = CPawn(player.TargetPtr); printf("[DEBUG] player target type: 0x%X\n", target.Type); printf("[DEBUG] player target attackable: %s\n", target.Attackable); printf("[DEBUG] player target aggressive: %s\n", target.Aggressive); end printf("[DEBUG] player in battle: %s\n", tostring(player.Battling)); end if( settings.options.DEBUGGING ) then -- Mouse pawn debugging info local mousePawn = CPawn( memoryReadUIntPtr(getProc(), addresses.staticbase_char, addresses.mousePtr_offset) ); printf("[DEBUG] mousePawn: 0x%X\n", mousePawn.Address); printf("[DEBUG] mousePawn id: %d\n", mousePawn.Id); end camera = CCamera(); if( settings.options.DEBUGGING ) then printf("[DEBUG] camAddress: 0x%X\n", camera.Address); end if( settings.options.DEBUGGING ) then -- Camera debugging info printf("[DEBUG] Cam X: %0.2f, Y: %0.2f, Z: %0.2f\n", camera.X, camera.Y, camera.Z); printf("[DEBUG] Cam XU: %0.2f, YU: %0.2f, ZU: %0.2f\n", camera.XUVec, camera.YUVec, camera.ZUVec); end cprintf(cli.turquoise, "Game Version is %s\n", getGameVersion()) local hf_x, hf_y, hf_wide, hf_high = windowRect( getWin()); cprintf(cli.turquoise, language[42], hf_wide, hf_high, hf_x, hf_y ); -- RoM windows size -- convert player name to profile name and check if profile exist local load_profile_name; -- name of profile to load if( forcedProfile ) then load_profile_name = convertProfileName(forcedProfile); else load_profile_name = convertProfileName(player.Name); end -- Set window name, install timer to automatically do it once a second local displayname = player.Name if #displayname > 8 then displayname = string.sub(displayname, 1, 7) .. "*"; end setWindowName(getHwnd(), sprintf("RoM Bot %s [%s]", BOT_VERSION, displayname)); settings.loadProfile(load_profile_name); if RoMScript("GC_GetMouseMoveEnable()") == false then cprintf(cli.yellow, language[190],"Click to Move") -- The bot requires 'Click to Move' RoMCode("GC_SetMouseMoveEnable(true)") end if RoMScript("GC_GetSelfCastEnable()") == false then cprintf(cli.yellow, language[190],"Self Cast") -- The bot requires 'Self Cast' RoMCode("GC_SetSelfCastEnable(true)") end if debug_override == true then -- Needs to be after loading profile. --settings.profile.options.DEBUG_INV = true; settings.profile.options.DEBUG_LOOT = true; settings.profile.options.DEBUG_TARGET = true; settings.profile.options.DEBUG_HARVEST = true; settings.profile.options.DEBUG_WAYPOINT = true; settings.profile.options.DEBUG_AUTOSELL = true; end player:update() settingsPrintKeys(); -- print keyboard settings to MM and log registerTimer("timedSetWindowName", secondsToTimer(1), timedSetWindowName, load_profile_name); player.BotStartTime_nr = os.time(); -- remember bot start time no reset player.level_detect_levelup = player.Level; -- remember actual player level store = CStore() if( getTimerFrequency ) then -- Grab the real frequency instead of calculating it, if available bot.GetTimeFrequency = getTimerFrequency().low / 1000; else -- calculate the CPU Frequency / used for manipulation the GetTime() values local calc_start = getTime(); yrest(1000); local calc_end = getTime(); bot.GetTimeFrequency = (calc_end.low - calc_start.low) / 1000; end printf("[DEBUG] CPU Frequency %s\n", bot.GetTimeFrequency); inventory = CInventory(); -- register inventory (needs profile loaded because of maxslot) bank = CBank() guildbank = CGuildbank() cursor = CCursor() LoadItemTypes() -- Needs macros to already be set up. -- list waypoint files and files in folders -- only files with filetype '.xml' are listed -- only folders without '.' are listed -- only 1 level of subfolders will be listed local current_folder = "" local show_subfiles = settings.profile.options.WPL_SHOW_SUBFOLDER_FILES if show_subfiles ~= true then show_subfiles = false end -- default true local function list_waypoint_files() local hf_counter = 0; local pathlist = { } local function read_subdirectory(_folder) local tmpfolder = _folder if current_folder ~= "" then tmpfolder = current_folder .. "/" .. _folder end local subdir = getDirectory(getExecutionPath() .. "/waypoints/" .. tmpfolder) if( not subdir) then return; end if show_subfiles then for i,v in pairs(subdir) do if( string.find (v,".xml",1,true) ) then hf_counter = hf_counter + 1; pathlist[hf_counter] = { }; pathlist[hf_counter].folder = _folder; pathlist[hf_counter].filename = v; end end else hf_counter = hf_counter + 1 pathlist[hf_counter] = { }; pathlist[hf_counter].folder = _folder; end end -- end of: local function read_subdirectory(_folder) local function concat_filename(_i, _folder, _filename) local hf_newname; local hf_folder = ""; local hf_dots = ""; local hf_slash = ""; if _folder then if _filename then if string.len(_folder) > 8 then hf_folder = string.sub(_folder, 1, 6); hf_dots = ".."; hf_slash = "/"; elseif( _folder and string.len(_folder) > 0 ) then hf_folder = _folder; hf_slash = "/"; end else if string.len(_folder) > 20 then hf_folder = string.sub(_folder, 1, 18); hf_dots = ".."; hf_slash = "/"; elseif( _folder and string.len(_folder) > 0 ) then hf_folder = _folder; hf_slash = "/"; end end end hf_newname = sprintf("%s%s%s%s", hf_folder, hf_dots, hf_slash, _filename or ""); hf_nr = sprintf("%3d:", _i); return hf_nr, hf_newname; end -- Get file info from waypoints folder local dir = getDirectory(getExecutionPath() .. "/waypoints/" .. current_folder) -- copy table dir to table pathlist -- select only xml files pathlist[0] = { }; if current_folder == "" then pathlist[0].filename = "wander"; pathlist[1] = { filename = "resume" }; hf_counter = 1 else pathlist[0].folder = ".." end for i,v in pairs(dir) do -- no . means perhaps folder if( not string.find (v,".",1,true) ) then read_subdirectory(v); -- only list files with extension .xml elseif( string.find (v,".xml",1,true) ) then hf_counter = hf_counter + 1; pathlist[hf_counter] = { }; pathlist[hf_counter].filename = v; end end local last_local = hf_counter if current_folder == "" then -- Get file info from global waypoints folder local globdir = getDirectory(getExecutionPath() .. "/../romglobal/waypoints") if globdir then -- copy table dir to table pathlist -- select only xml files for i,v in pairs(globdir) do -- no . means perhaps folder if( not string.find (v,".",1,true) ) then read_subdirectory("../../romglobal/waypoints/"..v); -- only list files with extension .xml elseif( string.find (v,".xml",1,true) ) then hf_counter = hf_counter + 1; pathlist[hf_counter] = { }; pathlist[hf_counter].folder = "../../romglobal/waypoints"; pathlist[hf_counter].filename = v; end end end end -- Print local waypoint files cprintf(cli.green, language[144], getExecutionPath()); -- Waypoint files in %s if current_folder ~= "" then print("Sub folder: "..current_folder) end local inc = math.ceil((last_local+1)/3); for i = 0, inc - 1 do local column1 = ""; local column2 = ""; local column3 = ""; local col1nr = ""; local col2nr = ""; local col3nr = ""; col1nr, column1 = concat_filename(i, pathlist[i].folder, pathlist[i].filename) if ( (i + inc) <= last_local ) then col2nr, column2 = concat_filename(i+inc, pathlist[i+inc].folder, pathlist[i+inc].filename); end if ( (i+inc*2) <= last_local ) then col3nr, column3 = concat_filename(i+inc*2, pathlist[i+inc*2].folder, pathlist[i+inc*2].filename); end cprintf(cli.green,"%s %s %s %s %s %s\n", col1nr, string.sub(column1.." ", 1, 21), col2nr, string.sub(column2.." ", 1, 21), col3nr, string.sub(column3.." ", 1, 20) ); end -- Print global waypoint files if #pathlist > last_local then cprintf(cli.green, language[144], getExecutionPath() .. "/../romglobal"); -- Waypoint files in %s local inc = math.ceil((#pathlist-last_local)/3); for i = last_local + 1, last_local + inc do local column1 = ""; local column2 = ""; local column3 = ""; local col1nr = ""; local col2nr = ""; local col3nr = ""; col1nr, column1 = concat_filename(i, string.gsub(pathlist[i].folder,"%.%./%.%./romglobal/waypoints/*",""), pathlist[i].filename) if ( (i + inc) <= #pathlist ) then col2nr, column2 = concat_filename(i+inc, string.gsub(pathlist[i+inc].folder,"%.%./%.%./romglobal/waypoints/*",""), pathlist[i+inc].filename); end if ( (i+inc*2) <= #pathlist ) then col3nr, column3 = concat_filename(i+inc*2, string.gsub(pathlist[i+inc*2].folder,"%.%./%.%./romglobal/waypoints/*",""), pathlist[i+inc*2].filename); end cprintf(cli.green,"%s %s %s %s %s %s\n", col1nr, string.sub(column1.." ", 1, 21), col2nr, string.sub(column2.." ", 1, 21), col3nr, string.sub(column3.." ", 1, 20) ); end end -- ask for pathname to choose keyboardBufferClear(); io.stdin:flush(); cprintf(cli.green, language[145], getKeyName(_G.key.VK_ENTER) ); -- Enter the number of the path local hf_choose_path_nr = io.stdin:read() if hf_choose_path_nr == "q" then error("Quiting.",0) end hf_choose_path_nr = tonumber(hf_choose_path_nr) if( hf_choose_path_nr and hf_choose_path_nr >= 0 and hf_choose_path_nr <= #pathlist ) then printf(language[146], hf_choose_path_nr ); -- You choose %s\n if pathlist[hf_choose_path_nr].filename then if( pathlist[hf_choose_path_nr].folder ) then wp_to_load = pathlist[hf_choose_path_nr].folder.."/"..pathlist[hf_choose_path_nr].filename; else if current_folder == "" then wp_to_load = pathlist[hf_choose_path_nr].filename; else wp_to_load = current_folder .. "/" .. pathlist[hf_choose_path_nr].filename; end end else if pathlist[hf_choose_path_nr].folder == ".." then current_folder = string.match(current_folder,"(.*)/[^/]*$") or "" if string.lower(current_folder) == "/../../romglobal/waypoints" then current_folder = "" end else current_folder = current_folder .. "/" .. pathlist[hf_choose_path_nr].folder end end return wp_to_load; else local filename = fixSlashes(getOpenFileName(getExecutionPath().."/waypoints/")) if filename == "" then cprintf(cli.yellow, language[147]); -- Wrong selection yrest(3000); return false; else -- Convert to relative path local wpfolder = {} for folder in string.gmatch(getExecutionPath().."/waypoints/","([^/]+)") do table.insert(wpfolder,folder) end local fnfolder = {} for folder in string.gmatch(filename,"([^/]+)") do table.insert(fnfolder,folder) end if fnfolder[1] ~= wpfolder[1] then cprintf(cli.yellow, language[191]); -- The RoMBot currently only supports running waypoint files located on the same drive as MicroMacro. yrest(3000); return false end local fileNameStart = "" local fileNameEnd = table.copy(fnfolder) local changefound = false for k,v in pairs(wpfolder) do if fnfolder[k] == v and changefound == false then table.remove(fileNameEnd,1) else changefound = true fileNameStart = fileNameStart .. "../" end end return fileNameStart .. table.concat(fileNameEnd,"/") end end end -- end of local function list_waypoint_files() -- This logic prevents files from being loaded if wandering was forced local wp_to_load, rp_to_load; -- get wp filename to load if( forcedPath ) then -- waypointfile or 'wander' local filename = getExecutionPath() .. "/waypoints/" .. string.gsub(forcedPath,".xml","") .. ".xml"; local globalfilename = getExecutionPath() .. "/../romglobal/waypoints/" .. string.gsub(forcedPath,".xml","") .. ".xml"; local resumelogname = getExecutionPath() .. "/logs/resumes/"..player.Name..".txt" if fileExists(filename) or ( string.lower(forcedPath) == "wander" ) or ( string.lower(forcedPath) == "resume" and fileExists(resumelogname) ) then wp_to_load = forcedPath; elseif fileExists(globalfilename) then wp_to_load = "../../romglobal/waypoints/"..forcedPath; else cprintf(cli.yellow,language[153], filename ); -- We can't find your waypoint file end; else if( settings.profile.options.WAYPOINTS and __WPL == nil ) then wp_to_load = settings.profile.options.WAYPOINTS; end end -- get rp filename to load if( forcedRetPath ) then rp_to_load = forcedRetPath; else if( settings.profile.options.RETURNPATH and __RPL == nil ) then rp_to_load = settings.profile.options.RETURNPATH; end end -- set wander if defined in profile if( settings.profile.options.PATH_TYPE == "wander") then wp_to_load = "wander"; end -- list the path list? -- if we don't have a wp file to load, list them if( __WPL == nil ) then -- not allready loaded (in onLoad event) while( wp_to_load == nil or wp_to_load == "" or wp_to_load == false or wp_to_load == " " ) do wp_to_load = list_waypoint_files(); end; if( wp_to_load == "wander" ) then cprintf(cli.lightgray,language[187]) keyboardBufferClear(); io.stdin:flush(); local radius = tonumber(io.stdin:read()) if type(radius) ~= "number" or 0 > radius then cprintf(cli.lightgray,"Expecting number more than or equal to 0. Using default value.\n") yrest(2000) else settings.profile.options.WANDER_RADIUS = radius end loadPaths("wander", rp_to_load); else loadPaths(wp_to_load, rp_to_load); -- load the waypoint path / return path end; end; player:updateXYZ() -- update player coords -- special option for use waypoint file from profile in a reverse order / not if forced path if( settings.profile.options.WAYPOINTS_REVERSE == true and not forcedPath ) then __WPL:reverse(); end; -- look for the closest waypoint / return path point to start if( __RPL and __WPL.Mode ~= "wander" ) then -- return path points available ? -- compare closest waypoint with closest returnpath point __WPL:setWaypointIndex( __WPL:getNearestWaypoint(player.X, player.Z, player.Y ) ); local hf_wp = __WPL:getNextWaypoint(); local dist_to_wp = distance(player.X, player.Z, player.Y, hf_wp.X, hf_wp.Z, hf_wp.Y) __RPL:setWaypointIndex( __RPL:getNearestWaypoint(player.X, player.Z, player.Y ) ); local hf_wp = __RPL:getNextWaypoint(); local dist_to_rp = distance(player.X, player.Z, player.Y, hf_wp.X, hf_wp.Z, hf_wp.Y) if( dist_to_rp < dist_to_wp ) then -- returnpoint is closer then next normal wayoiint player.Returning = true; -- then use return path first cprintf(cli.yellow, language[12]); -- Starting with return path else player.Returning = false; -- use normale waypoint path end; else if __WPL.ResumePoint then __WPL:setWaypointIndex(__WPL.ResumePoint) else __WPL:setWaypointIndex( __WPL:getNearestWaypoint(player.X, player.Z, player.Y ) ); end end; -- Update inventory inventory:update(); -- Profile onLoad event -- possibility for users to overwrite profile settings if( type(settings.profile.events.onLoad) == "function" ) then local status,err = pcall(settings.profile.events.onLoad); if( status == false ) then local msg = sprintf("onLoad error: %s", err); error(msg); end end -- Remember login details CurrentLoginAcc = RoMScript("LogID") CurrentLoginChar = RoMScript("CHARACTER_SELECT.selectedIndex") CurrentLoginServer = RoMScript ("GetCurrentRealm()") local function checkClientCrash() if isClientCrashed() then if onClientCrash then print("Client crash detected. Running onClientCrash().") onClientCrash() else error("Client crash detected.") end end end registerTimer("ClientDetection", secondsToTimer(2), checkClientCrash); local distBreakCount = 0; -- If exceedes 3 in a row, unstick. while(true) do while __WPL.DoOnload do __WPL.DoOnload = false __WPL.onLoadEvent() end if __WPL.Mode == "waypoints" and #__WPL.Waypoints == 0 then -- Can't got to 'waypoints' with no waypoints error(language[114],1) -- No waypoints to go to end player:checkAddress() player:logoutCheck(); player.Fighting = false; -- we are now not in the fight routines player:updateAlive() if( not player.Alive ) then player:resetSkillLastCastTime(); -- set last use back, so we can rebuff resurrect(); end -- reloading ammunition if ( settings.profile.options.RELOAD_AMMUNITION ) then local ammo = string.lower(settings.profile.options.RELOAD_AMMUNITION); if ammo == "thrown" and (player.Class1 == CLASS_ROGUE or (player.Class2 == CLASS_ROGUE and player.Level > 11 and player.Level2 > 11)) then if inventory:getAmmunitionCount() == 0 then inventory:reloadAmmunition(ammo); end elseif ammo == "arrow" and (player.Class2 == CLASS_SCOUT or player.Class1 == CLASS_SCOUT) then if inventory:getAmmunitionCount() == 0 then inventory:reloadAmmunition(ammo); end else print("RELOAD_AMMUNITION can only be false, arrow or thrown!"); end end -- go back to sleep, if in sleep mode if( player.Sleeping == true ) then yrest(800); -- wait a little for the aggro flag player:updateBattling(); if( player.Battling == false ) then player:sleep(); end; end; -- go sleeping if sleeping flag is set -- trigger timed inventory update --if( os.difftime(os.time(), player.InventoryLastUpdate) > --settings.profile.options.INV_UPDATE_INTERVAL ) then --player.InventoryDoUpdate = true; --end -- update inventory if update flag is set -- TODO: rolling update while resting? player:updateBattling(); if(player.InventoryDoUpdate == true and not player.Battling ) then player.InventoryDoUpdate = false; player.InventoryLastUpdate = os.time(); -- remember update time inventory:update(); end; -- check if levelup happens / execute after aggro is gone -- we do it here , to be sure, aggro flag is gone -- aggro flag would needs a wait (if no loot), so we don't check it player:updateLevel() if(player.Level > player.level_detect_levelup and not player.Battling ) then player.level_detect_levelup = player.Level; -- check if onLevelup event is used in profile if( type(settings.profile.events.onLevelup) == "function" ) then local status,err = pcall(settings.profile.events.onLevelup); if( status == false ) then local msg = sprintf(language[75], err); error(msg); end end settings.updateSkillsAvailability() -- Also needs macros to already be set up. end -- rest after getting new target and before starting fight -- rest between 50 until 99 sec, at most until full, after that additional rnd(10) if player.Current_waypoint_type ~= WPT_TRAVEL then -- no resting if running waypoin type player:updateHP() player:updateMP() local manaRest, healthRest = false, false; if( player.MaxMana > 0 ) then manaRest = (player.Mana / player.MaxMana * 100) < settings.profile.options.MP_REST; end healthRest = (player.HP / player.MaxHP * 100) < settings.profile.options.HP_REST; if( manaRest or healthRest ) then player:rest( 50, 99, "full", 10 ); -- rest before next fight end end; -- If aggro, look for target local msg_print = false; player:updateBattling() if player.Battling then if( player.Current_waypoint_type == WPT_TRAVEL ) then cprintf(cli.green, language[113]); -- we don't stop and don't fight back else if player:target(player:findEnemy(true,nil,evalTargetDefault)) then cprintf(cli.green, language[35]); -- Got aggro. Attacking aggressive enemies. end yrest(10); end; end if( player.Current_waypoint_type ~= WPT_TRAVEL and player:haveTarget() ) then -- only fight back if it's not a TRAVEL waypoint -- remember players position at fight start local FightStartX = player.X; local FightStartZ = player.Z; -- Other check were done in defaultEvalFunction player:fight(); -- check if we (as melee) can skip a waypoint because we touched it while moving to the fight place -- we do the check for all classes, even mostly only melees are touched by that, because only -- they move within the fightstart/-end local WPLorRPL; -- current WP we want to reach next if( player.Returning ) then WPLorRPL = __RPL; -- we are on a return path waypoint file else WPLorRPL = __WPL; -- we are using a normal waypoint file end; if( WPLorRPL:getMode() ~= "wander" ) then local currentWp = WPLorRPL:getNextWaypoint(); -- get current wp we try to reach -- calculate direction in rad for: fight start postition -> current waypoint local dir_fightstart_to_currentwp = math.atan2(currentWp.Z - FightStartZ, currentWp.X - FightStartX); local dist_fightstart_to_currentwp = distance(FightStartX, FightStartZ, currentWp.X, currentWp.Z); -- calculate direction in rad for: fight start postition -> fight end postition local dir_fightstart_to_fightend = math.atan2(player.Z - FightStartZ, player.X - FightStartX); local dist_fightstart_to_fightend = distance(player.X, player.Z, FightStartX, FightStartZ); -- calculate how much fighstart, wp and fightend are on a line, 0 = one line, local angleDif = angleDifference(dir_fightstart_to_currentwp, dir_fightstart_to_fightend); if (settings.profile.options.DEBUG_WAYPOINT) then printf("[DEBUG] FightStartX %s FightStartZ %s\n", FightStartX, FightStartZ ); printf("[DEBUG] dir_FS->WP rad %.3f dir_FS->FE rad %.3f\n", dir_fightstart_to_currentwp, dir_fightstart_to_fightend ); cprintf(cli.yellow, "[DEBUG] Line FS->WP / FS->FE: angleDif rad %.3f grad %d\n", angleDif, math.deg(angleDif) ); end -- c = Wurzel (a2 + b2 - 2 a b cos (ga)) local a = dist_fightstart_to_currentwp; local b = dist_fightstart_to_currentwp; local ga = angleDif; local dist_to_passed_wp = math.sqrt( math.pow(a,2) + math.pow(b,2) - 2 * a * b * math.cos(ga) ); if (settings.profile.options.DEBUG_WAYPOINT) then cprintf(cli.yellow, "[DEBUG] We (would) pass(ed) wp #%s (dist %.1f) in a dist of %d (skip at %d)\n", currentWp.wpnum, dist_fightstart_to_currentwp, dist_to_passed_wp, settings.profile.options.WAYPOINT_PASS ); end if( dist_to_passed_wp < settings.profile.options.WAYPOINT_PASS and -- default is 100 dist_fightstart_to_fightend >= dist_fightstart_to_currentwp ) then -- check position of the waypoint after the current waypoint we want to reach -- we don't check the closest wp, thats to much effort, we assume the distance between wp is -- as far, that the next one is always the closest local nextWp = WPLorRPL:getNextWaypoint(1); -- get current wp we try to reach +1 local dir_fightend_to_nextwp = math.atan2(nextWp.Z - player.Z, nextWp.X - player.X); local dir_fightend_to_currentwp = math.atan2(currentWp.Z - player.Z, currentWp.X - player.X ); angleDif = angleDifference(dir_fightend_to_currentwp, dir_fightend_to_nextwp); if (settings.profile.options.DEBUG_WAYPOINT) then printf( "[DEBUG] currentWp #%s %s %s, FE->WP rad %.3f\n", currentWp.wpnum,currentWp.X,currentWp.Z,dir_fightend_to_currentwp); printf( "[DEBUG] nextWp #%s %s %s, FE->WP rad %.3f\n", nextWp.wpnum,nextWp.X,nextWp.Z,dir_fightend_to_nextwp); cprintf(cli.yellow, "[DEBUG] FE->wp#%s to FE->wp#%s is in a angle of %d grad (skip at %d)\n", nextWp.wpnum, currentWp.wpnum, math.deg(angleDif), settings.profile.options.WAYPOINT_PASS_DEGR ); end -- if next waypoint is 'in front' of current waypoint if( math.deg(angleDif) > settings.profile.options.WAYPOINT_PASS_DEGR ) then -- default 90 if (settings.profile.options.DEBUG_WAYPOINT) then cprintf(cli.yellow, "[DEBUG] We overrun waypoint #%d, skip it and move on to #%d\n",currentWp.wpnum, nextWp.wpnum); end cprintf(cli.green, "We overrun waypoint #%d, skip it and move on to #%d\n",currentWp.wpnum, nextWp.wpnum); WPLorRPL:advance(); -- set next waypoint -- execute the action from the skiped wp if( currentWp.Action and type(currentWp.Action) == "string" ) then local actionchunk = loadstring(currentWp.Action); assert( actionchunk, sprintf(language[150], WPLorRPL.CurrentWaypoint) ); actionchunk(); end __WPL:updateResume() end end -- end of: check to skip a waypoint end else -- don't fight, move to wp if player.TargetPtr ~= 0 then player:clearTarget(); end -- First check up on eggpet checkEggPets() local wp = nil; local wpnum = nil; if( player.Returning ) then wp = __RPL:getNextWaypoint(); wpnum = __RPL.CurrentWaypoint; wptag = wp.Tag~='' and ' tag: '..wp.Tag or '' cprintf(cli.green, language[13], wpnum, wp.X, wp.Z, wptag); -- Moving to returnpath waypoint else wp = __WPL:getNextWaypoint(); wpnum = __WPL.CurrentWaypoint; wptag = wp.Tag~='' and ' tag: '..wp.Tag or '' cprintf(cli.green, language[6], wpnum, wp.X, wp.Z, wptag); -- Moving to waypoint end; player.Current_waypoint_type = wp.Type; -- remember current waypoint type local success, reason = player:moveTo(wp,nil,true); player:updateMounted() if not player.Mounted then player:checkPotions(); player:checkSkills( ONLY_FRIENDLY ); -- only cast hot spells to ourselfe end if( success ) then -- if we stick directly at a wp the counter would reseted even if we are sticked -- hence we reset the counter only after 3 successfull waypoints player.Success_waypoints = player.Success_waypoints + 1; if( player.Success_waypoints > 3 ) then player.Unstick_counter = 0; -- reset unstick counter end; if( player.Returning ) then -- Completed. Return to normal waypoints. if( __RPL.CurrentWaypoint >= #__RPL.Waypoints ) then __WPL:setWaypointIndex(__WPL:getNearestWaypoint(player.X, player.Z, player.Y)); if( __WPL.Mode == "wander" ) then __WPL.OrigX = player.X; __WPL.OrigZ = player.Z; end player.Returning = false; cprintf(cli.yellow, language[7]); else __RPL:advance(); end -- Execute it's action, if it has one. if( wp.Action and type(wp.Action) == "string" and string.find(wp.Action,"%a") ) then keyboardRelease( settings.hotkeys.MOVE_FORWARD.key ); yrest(200) -- Stop moving local actionchunk = loadstring(wp.Action); assert( actionchunk, sprintf(language[150], __RPL.CurrentWaypoint) ); actionchunk(); end else __WPL:advance(); -- Execute it's action, if it has one. if( wp.Action and type(wp.Action) == "string" and string.find(wp.Action,"%a") ) then keyboardRelease( settings.hotkeys.MOVE_FORWARD.key ); yrest(200) -- Stop moving local actionchunk = loadstring(wp.Action); assert( actionchunk, sprintf(language[150], __WPL.CurrentWaypoint) ); actionchunk(); end end __WPL:updateResume() else if( not reason == WF_TARGET ) then cprintf(cli.red, language[8]); -- Waypoint movement failed end if( reason == WF_COMBAT ) then cprintf(cli.turquoise, language[14]); -- We get aggro. Stop moving to waypoint end; if( reason == WF_DIST ) then distBreakCount = distBreakCount + 1; else if( distBreakCount > 0 ) then distBreakCount = 0; end end if reason == WF_PULLBACK and #__WPL.Waypoints > 2 then __WPL:setWaypointIndex(__WPL:findPulledBeforeWaypoint()) end if( reason == WF_STUCK or distBreakCount > 3 ) then -- Get ourselves unstuck, then! distBreakCount = 0; player:clearTarget(); player.Success_waypoints = 0; -- counter for successfull waypoints in row player.Unstick_counter = player.Unstick_counter + 1; -- count our unstick tries -- Too many tries, logout if( settings.profile.options.MAX_UNSTICK_TRIALS > 0 and player.Unstick_counter > settings.profile.options.MAX_UNSTICK_TRIALS ) or (not isInGame()) then if isInGame() then cprintf(cli.yellow, language[55], player.Unstick_counter, settings.profile.options.MAX_UNSTICK_TRIALS ); -- max unstick reached else cprintf(cli.yellow, language[56]); -- The game has been disconnected end -- check if onUnstickFailure event is used in profile if( type(settings.profile.events.onUnstickFailure) == "function" ) and player.Unstick_counter > settings.profile.options.MAX_UNSTICK_TRIALS then pcall(settings.profile.events.onUnstickFailure); elseif( settings.profile.options.LOGOUT_WHEN_STUCK ) then if settings.profile.options.CLOSE_WHEN_STUCK == false then player:logout() -- doesn't close client else player:logout(nil,true); -- closes client end else -- pause or stop ? player.Sleeping = true; -- go to sleep --stopPE(); -- pause the bot -- we should play a sound ! player.Unstick_counter = 0; end elseif( player.Sleeping ~= true) then -- not when to much trial and we go to sleep -- unstick player und unstick message cprintf(cli.red, language[9], player.X, player.Z, -- unsticking player... at position player.Unstick_counter, settings.profile.options.MAX_UNSTICK_TRIALS); player:unstick(); end end end coroutine.yield(); end end end function resurrect() -- Make sure they aren't still trying to run off keyboardRelease(settings.hotkeys.MOVE_FORWARD.key); keyboardRelease(settings.hotkeys.MOVE_BACKWARD.key); keyboardRelease(settings.hotkeys.ROTATE_LEFT.key); keyboardRelease(settings.hotkeys.ROTATE_RIGHT.key); keyboardRelease(settings.hotkeys.STRAFF_LEFT.key); keyboardRelease(settings.hotkeys.STRAFF_RIGHT.key); player.Death_counter = player.Death_counter + 1; -- Take a screenshot. Only works on MicroMacro 1.0 or newer showWindow(getWin(), sw.show); yrest(500); local sfn = getExecutionPath() .. "/profiles/" .. player.Name .. ".bmp"; saveScreenshot(getWin(), sfn); printf(language[2], sfn); if( type(settings.profile.events.onDeath) == "function" ) then local status,err = pcall(settings.profile.events.onDeath); if( status == false ) then local msg = sprintf("onDeath error: %s", err); error(msg); end end -- msg how to activate automatic resurrection if settings.profile.options.RES_AUTOMATIC_AFTER_DEATH ~= nil then settings.profile.options.RES_AFTER_DEATH = settings.profile.options.RES_AUTOMATIC_AFTER_DEATH end -- backward compatability if( settings.profile.options.RES_AFTER_DEATH == false ) then cprintf(cli.yellow, language[103]); -- If you want to use automatic resurrection end if( settings.profile.options.RES_AFTER_DEATH == true ) then cprintf(cli.red, language[3]); -- Died. Resurrecting player... cprintf(cli.green, language[104]); -- try to resurrect in 5 seconds yrest(5000); -- Try to revive with macro if( not player.Alive ) then cprintf(cli.green, language[107]); -- use the ingame resurrect macro RoMCode("UseSelfRevive();"); -- first try self revive yrest(500); RoMCode("BrithRevive();"); waitForLoadingScreen(30) yrest(settings.profile.options.WAIT_TIME_AFTER_RES); player:update(); end -- death counter message cprintf(cli.green, language[109], -- You have died %s times player.Death_counter, settings.profile.options.MAX_DEATHS); -- check maximal death if automatic mode if( player.Death_counter > settings.profile.options.MAX_DEATHS ) then cprintf(cli.yellow, language[54], player.Death_counter, settings.profile.options.MAX_DEATHS ); -- to much deaths player:logout(); end if( player.Level > 9 and player.Alive ) then -- no wait if resurrect at the place of death / priest / buff cprintf(cli.red, language[4]); -- Returning to waypoints after 1 minute. -- check the first debuff that player has. (it has to be the weakness!) local debuff = RoMScript("GetPlayerBuffLeftTime(GetPlayerBuff(1,'HARMFUL'))"); if(debuff == nil) then debuff = 0; end; debuff = tonumber(debuff); if (debuff == 0 and not settings.profile.options.PK_COUNTS_AS_DEATH) then print("This was a PK or no xp debt death."); player.Death_counter = player.Death_counter - 1; end player:rest(debuff,debuff+15); -- wait off the debuff before going about your path. end end player:updateAlive(); -- pause if still death if( not player.Alive ) then pauseOnDeath(); end -- use/compare return path if defined, if not use normal one and give a warning -- wen need to search the closest, hence we also accept resurrection at the death place player:rest(10); -- give some time to be really sure that loadscreen is gone -- if not it could result in loading NOT the returnpath, becaus we dont hat the new position player.Returning = nil; if( __RPL and __WPL.Mode ~= "wander" ) then -- compare closest waypoint with closest returnpath point __WPL:setWaypointIndex( __WPL:getNearestWaypoint(player.X, player.Z, player.Y ) ); local hf_wp = __WPL:getNextWaypoint(); local dist_to_wp = distance(player.X, player.Z, player.Y, hf_wp.X, hf_wp.Z, hf_wp.Y) __RPL:setWaypointIndex(__RPL:getNearestWaypoint(player.X, player.Z) ); local hf_wp = __RPL:getNextWaypoint(); local dist_to_rp = distance(player.X, player.Z, player.Y, hf_wp.X, hf_wp.Z, hf_wp.Y) if( dist_to_rp < dist_to_wp ) then -- returnpoint is closer then next normal wayoiint player.Returning = true; -- then use return path first cprintf(cli.yellow, language[12]); -- Starting with return path end else cprintf(cli.yellow, language[111], __WPL:getFileName() ); -- don't have a defined return path end if( __RPL and __WPL.Mode == "wander" ) then __RPL:setWaypointIndex(1); player.Returning = true; cprintf(cli.yellow, language[12]); end -- not using returnpath, so we use the normal waypoint path if( player.Returning == nil) then player.Returning = false; __WPL:setWaypointIndex( __WPL:getNearestWaypoint(player.X, player.Z,player.Y ) ); cprintf(cli.green, language[112], -- using normal waypoint file __WPL:getFileName() ); end end startMacro(main,true);
gpl-2.0
eraffxi/darkstar
scripts/zones/Windurst_Woods/npcs/Anillah.lua
2
1376
----------------------------------- -- Area: Windurst Woods -- NPC: Anillah -- Type: Clothcraft Image Support -- !pos -34.800 -2.25 -119.950 241 ----------------------------------- package.loaded["scripts/zones/Windurst_Woods/TextIDs"] = nil; ----------------------------------- require("scripts/globals/status"); require("scripts/globals/crafting"); require("scripts/zones/Windurst_Woods/TextIDs"); ----------------------------------- function onTrade(player,npc,trade) end; function onTrigger(player,npc) local guildMember = isGuildMember(player,3); local SkillCap = getCraftSkillCap(player,dsp.skill.CLOTHCRAFT); local SkillLevel = player:getSkillLevel(dsp.skill.CLOTHCRAFT); if (guildMember == 1) then if (player:hasStatusEffect(dsp.effect.CLOTHCRAFT_IMAGERY) == false) then player:startEvent(10015,SkillCap,SkillLevel,2,511,player:getGil(),0,0,0); -- p1 = skill level else player:startEvent(10015,SkillCap,SkillLevel,2,511,player:getGil(),7108,0,0); end else player:startEvent(10015); -- Standard Dialogue end end; function onEventUpdate(player,csid,option) end; function onEventFinish(player,csid,option) if (csid == 10015 and option == 1) then player:messageSpecial(IMAGE_SUPPORT,0,4,2); player:addStatusEffect(dsp.effect.CLOTHCRAFT_IMAGERY,1,0,120); end end;
gpl-3.0
chpatton013/business-team
libs/hump/timer.lua
27
6224
--[[ Copyright (c) 2010-2013 Matthias Richter 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. Except as contained in this notice, the name(s) of the above copyright holders shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization. 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 Timer = {} Timer.__index = Timer local function _nothing_() end function Timer:update(dt) local to_remove = {} for handle, delay in pairs(self.functions) do delay = delay - dt if delay <= 0 then to_remove[#to_remove+1] = handle end self.functions[handle] = delay handle.func(dt, delay) end for _,handle in ipairs(to_remove) do self.functions[handle] = nil handle.after(handle.after) end end function Timer:do_for(delay, func, after) local handle = {func = func, after = after or _nothing_} self.functions[handle] = delay return handle end function Timer:add(delay, func) return self:do_for(delay, _nothing_, func) end function Timer:addPeriodic(delay, func, count) local count, handle = count or math.huge -- exploit below: math.huge - 1 = math.huge handle = self:add(delay, function(f) if func(func) == false then return end count = count - 1 if count > 0 then self.functions[handle] = delay end end) return handle end function Timer:cancel(handle) self.functions[handle] = nil end function Timer:clear() self.functions = {} end Timer.tween = setmetatable({ -- helper functions out = function(f) -- 'rotates' a function return function(s, ...) return 1 - f(1-s, ...) end end, chain = function(f1, f2) -- concatenates two functions return function(s, ...) return (s < .5 and f1(2*s, ...) or 1 + f2(2*s-1, ...)) * .5 end end, -- useful tweening functions linear = function(s) return s end, quad = function(s) return s*s end, cubic = function(s) return s*s*s end, quart = function(s) return s*s*s*s end, quint = function(s) return s*s*s*s*s end, sine = function(s) return 1-math.cos(s*math.pi/2) end, expo = function(s) return 2^(10*(s-1)) end, circ = function(s) return 1 - math.sqrt(1-s*s) end, back = function(s,bounciness) bounciness = bounciness or 1.70158 return s*s*((bounciness+1)*s - bounciness) end, bounce = function(s) -- magic numbers ahead local a,b = 7.5625, 1/2.75 return math.min(a*s^2, a*(s-1.5*b)^2 + .75, a*(s-2.25*b)^2 + .9375, a*(s-2.625*b)^2 + .984375) end, elastic = function(s, amp, period) amp, period = amp and math.max(1, amp) or 1, period or .3 return (-amp * math.sin(2*math.pi/period * (s-1) - math.asin(1/amp))) * 2^(10*(s-1)) end, }, { -- register new tween __call = function(tween, self, len, subject, target, method, after, ...) -- recursively collects fields that are defined in both subject and target into a flat list local function tween_collect_payload(subject, target, out) for k,v in pairs(target) do local ref = subject[k] assert(type(v) == type(ref), 'Type mismatch in field "'..k..'".') if type(v) == 'table' then tween_collect_payload(ref, v, out) else local ok, delta = pcall(function() return (v-ref)*1 end) assert(ok, 'Field "'..k..'" does not support arithmetic operations') out[#out+1] = {subject, k, delta} end end return out end method = tween[method or 'linear'] -- see __index local payload, t, args = tween_collect_payload(subject, target, {}), 0, {...} local last_s = 0 return self:do_for(len, function(dt) t = t + dt local s = method(math.min(1, t/len), unpack(args)) local ds = s - last_s last_s = s for _, info in ipairs(payload) do local ref, key, delta = unpack(info) ref[key] = ref[key] + delta * ds end end, after) end, -- fetches function and generated compositions for method `key` __index = function(tweens, key) if type(key) == 'function' then return key end assert(type(key) == 'string', 'Method must be function or string.') if rawget(tweens, key) then return rawget(tweens, key) end local function construct(pattern, f) local method = rawget(tweens, key:match(pattern)) if method then return f(method) end return nil end local out, chain = rawget(tweens,'out'), rawget(tweens,'chain') return construct('^in%-([^-]+)$', function(...) return ... end) or construct('^out%-([^-]+)$', out) or construct('^in%-out%-([^-]+)$', function(f) return chain(f, out(f)) end) or construct('^out%-in%-([^-]+)$', function(f) return chain(out(f), f) end) or error('Unknown interpolation method: ' .. key) end}) -- the module local function new() local timer = setmetatable({functions = {}, tween = Timer.tween}, Timer) return setmetatable({ new = new, update = function(...) return timer:update(...) end, do_for = function(...) return timer:do_for(...) end, add = function(...) return timer:add(...) end, addPeriodic = function(...) return timer:addPeriodic(...) end, cancel = function(...) return timer:cancel(...) end, clear = function(...) return timer:clear(...) end, tween = setmetatable({}, { __index = Timer.tween, __newindex = function(_,k,v) Timer.tween[k] = v end, __call = function(t,...) return timer:tween(...) end, }) }, {__call = new}) end return new()
apache-2.0
palmettos/cnLuCI
libs/nixio/docsrc/nixio.bit.lua
171
2044
--- Bitfield operators and mainpulation functions. -- Can be used as a drop-in replacement for bitlib. module "nixio.bit" --- Bitwise OR several numbers. -- @class function -- @name bor -- @param oper1 First Operand -- @param oper2 Second Operand -- @param ... More Operands -- @return number --- Invert given number. -- @class function -- @name bnot -- @param oper Operand -- @return number --- Bitwise AND several numbers. -- @class function -- @name band -- @param oper1 First Operand -- @param oper2 Second Operand -- @param ... More Operands -- @return number --- Bitwise XOR several numbers. -- @class function -- @name bxor -- @param oper1 First Operand -- @param oper2 Second Operand -- @param ... More Operands -- @return number --- Left shift a number. -- @class function -- @name lshift -- @param oper number -- @param shift bits to shift -- @return number --- Right shift a number. -- @class function -- @name rshift -- @param oper number -- @param shift bits to shift -- @return number --- Arithmetically right shift a number. -- @class function -- @name arshift -- @param oper number -- @param shift bits to shift -- @return number --- Integer division of 2 or more numbers. -- @class function -- @name div -- @param oper1 Operand 1 -- @param oper2 Operand 2 -- @param ... More Operands -- @return number --- Cast a number to the bit-operating range. -- @class function -- @name cast -- @param oper number -- @return number --- Sets one or more flags of a bitfield. -- @class function -- @name set -- @param bitfield Bitfield -- @param flag1 First Flag -- @param ... More Flags -- @return altered bitfield --- Unsets one or more flags of a bitfield. -- @class function -- @name unset -- @param bitfield Bitfield -- @param flag1 First Flag -- @param ... More Flags -- @return altered bitfield --- Checks whether given flags are set in a bitfield. -- @class function -- @name check -- @param bitfield Bitfield -- @param flag1 First Flag -- @param ... More Flags -- @return true when all flags are set, otherwise false
apache-2.0
kidaa/Awakening-Core3
bin/scripts/object/weapon/melee/sword/crafted_saber/sword_lightsaber_one_handed_gen3.lua
1
6183
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version object_weapon_melee_sword_crafted_saber_sword_lightsaber_one_handed_gen3 = object_weapon_melee_sword_crafted_saber_shared_sword_lightsaber_one_handed_gen3:new { playerRaces = { "object/creature/player/bothan_male.iff", "object/creature/player/bothan_female.iff", "object/creature/player/human_male.iff", "object/creature/player/human_female.iff", "object/creature/player/ithorian_male.iff", "object/creature/player/ithorian_female.iff", "object/creature/player/moncal_male.iff", "object/creature/player/moncal_female.iff", "object/creature/player/rodian_male.iff", "object/creature/player/rodian_female.iff", "object/creature/player/sullustan_male.iff", "object/creature/player/sullustan_female.iff", "object/creature/player/trandoshan_male.iff", "object/creature/player/trandoshan_female.iff", "object/creature/player/twilek_male.iff", "object/creature/player/twilek_female.iff", "object/creature/player/wookiee_male.iff", "object/creature/player/wookiee_female.iff", "object/creature/player/zabrak_male.iff", "object/creature/player/zabrak_female.iff" }, -- RANGEDATTACK, MELEEATTACK, FORCEATTACK, TRAPATTACK, GRENADEATTACK, HEAVYACIDBEAMATTACK, -- HEAVYLIGHTNINGBEAMATTACK, HEAVYPARTICLEBEAMATTACK, HEAVYROCKETLAUNCHERATTACK, HEAVYLAUNCHERATTACK attackType = MELEEATTACK, -- ENERGY, KINETIC, ELECTRICITY, STUN, BLAST, HEAT, COLD, ACID, FORCE, LIGHTSABER damageType = LIGHTSABER, -- NONE, LIGHT, MEDIUM, HEAVY armorPiercing = MEDIUM, -- combat_rangedspecialize_bactarifle, combat_rangedspecialize_rifle, combat_rangedspecialize_pistol, combat_rangedspecialize_heavy, combat_rangedspecialize_carbine -- combat_meleespecialize_unarmed, combat_meleespecialize_twohand, combat_meleespecialize_polearm, combat_meleespecialize_onehand, combat_general, -- combat_meleespecialize_twohandlightsaber, combat_meleespecialize_polearmlightsaber, jedi_general xpType = "jedi_general", -- See http://www.ocdsoft.com/files/certifications.xls certificationsRequired = { "cert_onehandlightsaber_gen3" }, -- See http://www.ocdsoft.com/files/accuracy.xls creatureAccuracyModifiers = { "onehandlightsaber_accuracy" }, -- See http://www.ocdsoft.com/files/defense.xls defenderDefenseModifiers = { "melee_defense" }, -- Leave as "dodge" for now, may have additions later defenderSecondaryDefenseModifiers = { "saber_block" }, -- See http://www.ocdsoft.com/files/speed.xls speedModifiers = { "onehandlightsaber_speed" }, -- Leave blank for now damageModifiers = { }, -- The values below are the default values. To be used for blue frog objects primarily healthAttackCost = 35, actionAttackCost = 50, mindAttackCost = 85, forceCost = 36, pointBlankRange = 0, pointBlankAccuracy = 20, idealRange = 3, idealAccuracy = 15, maxRange = 5, maxRangeAccuracy = 5, minDamage = 130, maxDamage = 220, attackSpeed = 4.5, defenderToughnessModifiers = { "lightsaber_toughness" }, childObjects = { {templateFile = "object/tangible/inventory/lightsaber_inventory_3.iff", x = 0, z = 0, y = 0, ox = 0, oy = 0, oz = 0, ow = 0, cellid = -1, containmentType = 4} }, numberExperimentalProperties = {1, 1, 2, 2, 2, 2, 2, 1, 1, 1}, experimentalProperties = {"XX", "XX", "CD", "OQ", "CD", "OQ", "CD", "OQ", "SR", "UT", "CD", "OQ", "OQ", "OQ", "OQ"}, experimentalWeights = {1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1}, experimentalGroupTitles = {"null", "null", "expDamage", "expDamage", "expDamage", "expDamage", "expEffeciency", "expEffeciency", "expEffeciency", "expEffeciency"}, experimentalSubGroupTitles = {"null", "null", "mindamage", "maxdamage", "attackspeed", "woundchance", "forcecost", "attackhealthcost", "attackactioncost", "attackmindcost"}, experimentalMin = {0, 0, 130, 220, 4.5, 19, 40, 35, 50, 85}, experimentalMax = {0, 0, 150, 260, 4.2, 31, 36, 30, 45, 55}, experimentalPrecision = {0, 0, 0, 0, 1, 0, 0, 0, 0, 0}, experimentalCombineType = {0, 0, 1, 1, 1, 1, 1, 1, 1, 1}, } ObjectTemplates:addTemplate(object_weapon_melee_sword_crafted_saber_sword_lightsaber_one_handed_gen3, "object/weapon/melee/sword/crafted_saber/sword_lightsaber_one_handed_gen3.iff")
lgpl-3.0
meshr-net/meshr_tomato-RT-N
usr/lib/lua/luci/model/cbi/admin_system/backupfiles.lua
8
2706
--[[ LuCI - Lua Configuration Interface Copyright 2008 Steven Barth <steven@midlink.org> Copyright 2011 Jo-Philipp Wich <xm@subsignal.org> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 $Id: backupfiles.lua 7798 2011-10-26 23:43:04Z jow $ ]]-- if luci.http.formvalue("cbid.luci.1._list") then luci.http.redirect(luci.dispatcher.build_url("admin/system/flashops/backupfiles") .. "?display=list") elseif luci.http.formvalue("cbid.luci.1._edit") then luci.http.redirect(luci.dispatcher.build_url("admin/system/flashops/backupfiles") .. "?display=edit") return end m = SimpleForm("luci", translate("Backup file list")) m:append(Template("admin_system/backupfiles")) if luci.http.formvalue("display") ~= "list" then f = m:section(SimpleSection, nil, translate("This is a list of shell glob patterns for matching files and directories to include during sysupgrade. Modified files in /etc/config/ and certain other configurations are automatically preserved.")) l = f:option(Button, "_list", translate("Show current backup file list")) l.inputtitle = translate("Open list...") l.inputstyle = "apply" c = f:option(TextValue, "_custom") c.rmempty = false c.cols = 70 c.rows = 30 c.cfgvalue = function(self, section) return nixio.fs.readfile("/etc/sysupgrade.conf") end c.write = function(self, section, value) value = value:gsub("\r\n?", "\n") return nixio.fs.writefile("/etc/sysupgrade.conf", value) end else m.submit = false m.reset = false f = m:section(SimpleSection, nil, translate("Below is the determined list of files to backup. It consists of changed configuration files marked by opkg, essential base files and the user defined backup patterns.")) l = f:option(Button, "_edit", translate("Back to configuration")) l.inputtitle = translate("Close list...") l.inputstyle = "link" d = f:option(DummyValue, "_detected") d.rawhtml = true d.cfgvalue = function(s) local list = io.popen( "( find $(sed -ne '/^[[:space:]]*$/d; /^#/d; p' /etc/sysupgrade.conf " .. "/lib/upgrade/keep.d/* 2>/dev/null) -type f 2>/dev/null; " .. "opkg list-changed-conffiles ) | sort -u" ) if list then local files = { "<ul>" } while true do local ln = list:read("*l") if not ln then break else files[#files+1] = "<li>" files[#files+1] = luci.util.pcdata(ln) files[#files+1] = "</li>" end end list:close() files[#files+1] = "</ul>" return table.concat(files, "") end return "<em>" .. translate("No files found") .. "</em>" end end return m
apache-2.0
upsoft/avbot
extension/luascript/libs/lua_libraries/json/encode/output_utility.lua
9
1783
--[[ Licensed according to the included 'LICENSE' document Author: Thomas Harning Jr <harningt@gmail.com> ]] local setmetatable = setmetatable local assert, loadstring = assert, loadstring or load local _ENV = nil -- Key == weak, if main key goes away, then cache cleared local outputCache = setmetatable({}, {__mode = 'k'}) -- TODO: inner tables weak? local function buildFunction(nextValues, innerValue, valueWriter, innerWriter) local putInner = "" if innerValue and innerWriter then -- Prepare the lua-string representation of the separator to put in between values local formattedInnerValue = ("%q"):format(innerValue) -- Fill in the condition %WRITE_INNER% and the %INNER_VALUE% to actually write putInner = innerWriter:gsub("%%WRITE_INNER%%", "%%1"):gsub("%%INNER_VALUE%%", formattedInnerValue) end -- Template-in the value writer (if present) and its conditional argument local functionCode = nextValues:gsub("PUTINNER(%b())", putInner) -- %VALUE% is to be filled in by the value-to-write valueWriter = valueWriter:gsub("%%VALUE%%", "%%1") -- Template-in the value writer with its argument functionCode = functionCode:gsub("PUTVALUE(%b())", valueWriter) functionCode = [[ return function(composite, ret, encode, state) ]] .. functionCode .. [[ end ]] return assert(loadstring(functionCode))() end local function prepareEncoder(cacheKey, nextValues, innerValue, valueWriter, innerWriter) local cache = outputCache[cacheKey] if not cache then cache = {} outputCache[cacheKey] = cache end local fun = cache[nextValues] if not fun then fun = buildFunction(nextValues, innerValue, valueWriter, innerWriter) cache[nextValues] = fun end return fun end local output_utility = { prepareEncoder = prepareEncoder } return output_utility
agpl-3.0
kidaa/Awakening-Core3
bin/scripts/object/draft_schematic/space/reverse_engineering/serverobjects.lua
3
2867
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version --Children folder includes -- Server Objects includeFile("draft_schematic/space/reverse_engineering/analysis_tool.lua") includeFile("draft_schematic/space/reverse_engineering/armor_analysis_tool.lua") includeFile("draft_schematic/space/reverse_engineering/booster_analysis_tool.lua") includeFile("draft_schematic/space/reverse_engineering/capacitor_analysis_tool.lua") includeFile("draft_schematic/space/reverse_engineering/droid_interface_analysis_tool.lua") includeFile("draft_schematic/space/reverse_engineering/engine_analysis_tool.lua") includeFile("draft_schematic/space/reverse_engineering/reactor_analysis_tool.lua") includeFile("draft_schematic/space/reverse_engineering/retrofit_kit.lua") includeFile("draft_schematic/space/reverse_engineering/shields_analysis_tool.lua") includeFile("draft_schematic/space/reverse_engineering/weapon_analysis_tool.lua")
lgpl-3.0
palmettos/cnLuCI
applications/luci-asterisk/luasrc/model/cbi/asterisk-mod-codec.lua
80
2172
--[[ LuCI - Lua Configuration Interface Copyright 2008 Steven Barth <steven@midlink.org> Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net> 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$ ]]-- cbimap = Map("asterisk", "asterisk", "") module = cbimap:section(TypedSection, "module", "Modules", "") module.anonymous = true codec_a_mu = module:option(ListValue, "codec_a_mu", "A-law and Mulaw direct Coder/Decoder", "") codec_a_mu:value("yes", "Load") codec_a_mu:value("no", "Do Not Load") codec_a_mu:value("auto", "Load as Required") codec_a_mu.rmempty = true codec_adpcm = module:option(ListValue, "codec_adpcm", "Adaptive Differential PCM Coder/Decoder", "") codec_adpcm:value("yes", "Load") codec_adpcm:value("no", "Do Not Load") codec_adpcm:value("auto", "Load as Required") codec_adpcm.rmempty = true codec_alaw = module:option(ListValue, "codec_alaw", "A-law Coder/Decoder", "") codec_alaw:value("yes", "Load") codec_alaw:value("no", "Do Not Load") codec_alaw:value("auto", "Load as Required") codec_alaw.rmempty = true codec_g726 = module:option(ListValue, "codec_g726", "ITU G.726-32kbps G726 Transcoder", "") codec_g726:value("yes", "Load") codec_g726:value("no", "Do Not Load") codec_g726:value("auto", "Load as Required") codec_g726.rmempty = true codec_gsm = module:option(ListValue, "codec_gsm", "GSM/PCM16 (signed linear) Codec Translation", "") codec_gsm:value("yes", "Load") codec_gsm:value("no", "Do Not Load") codec_gsm:value("auto", "Load as Required") codec_gsm.rmempty = true codec_speex = module:option(ListValue, "codec_speex", "Speex/PCM16 (signed linear) Codec Translator", "") codec_speex:value("yes", "Load") codec_speex:value("no", "Do Not Load") codec_speex:value("auto", "Load as Required") codec_speex.rmempty = true codec_ulaw = module:option(ListValue, "codec_ulaw", "Mu-law Coder/Decoder", "") codec_ulaw:value("yes", "Load") codec_ulaw:value("no", "Do Not Load") codec_ulaw:value("auto", "Load as Required") codec_ulaw.rmempty = true return cbimap
apache-2.0
ForbiddenJ/minetest_game
mods/vessels/init.lua
3
6178
-- Minetest 0.4 mod: vessels -- See README.txt for licensing and other information. local vessels_shelf_formspec = "size[8,7;]" .. default.gui_bg .. default.gui_bg_img .. default.gui_slots .. "list[context;vessels;0,0.3;8,2;]" .. "list[current_player;main;0,2.85;8,1;]" .. "list[current_player;main;0,4.08;8,3;8]" .. "listring[context;vessels]" .. "listring[current_player;main]" .. default.get_hotbar_bg(0, 2.85) local function get_vessels_shelf_formspec(inv) local formspec = vessels_shelf_formspec local invlist = inv and inv:get_list("vessels") -- Inventory slots overlay local vx, vy = 0, 0.3 for i = 1, 16 do if i == 9 then vx = 0 vy = vy + 1 end if not invlist or invlist[i]:is_empty() then formspec = formspec .. "image[" .. vx .. "," .. vy .. ";1,1;vessels_shelf_slot.png]" end vx = vx + 1 end return formspec end minetest.register_node("vessels:shelf", { description = "Vessels Shelf", tiles = {"default_wood.png", "default_wood.png", "default_wood.png", "default_wood.png", "vessels_shelf.png", "vessels_shelf.png"}, paramtype2 = "facedir", is_ground_content = false, groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3}, sounds = default.node_sound_wood_defaults(), on_construct = function(pos) local meta = minetest.get_meta(pos) meta:set_string("formspec", get_vessels_shelf_formspec(nil)) local inv = meta:get_inventory() inv:set_size("vessels", 8 * 2) end, can_dig = function(pos,player) local inv = minetest.get_meta(pos):get_inventory() return inv:is_empty("vessels") end, allow_metadata_inventory_put = function(pos, listname, index, stack, player) if minetest.get_item_group(stack:get_name(), "vessel") ~= 0 then return stack:get_count() end return 0 end, on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) minetest.log("action", player:get_player_name() .. " moves stuff in vessels shelf at ".. minetest.pos_to_string(pos)) local meta = minetest.get_meta(pos) meta:set_string("formspec", get_vessels_shelf_formspec(meta:get_inventory())) end, on_metadata_inventory_put = function(pos, listname, index, stack, player) minetest.log("action", player:get_player_name() .. " moves stuff to vessels shelf at ".. minetest.pos_to_string(pos)) local meta = minetest.get_meta(pos) meta:set_string("formspec", get_vessels_shelf_formspec(meta:get_inventory())) end, on_metadata_inventory_take = function(pos, listname, index, stack, player) minetest.log("action", player:get_player_name() .. " takes stuff from vessels shelf at ".. minetest.pos_to_string(pos)) local meta = minetest.get_meta(pos) meta:set_string("formspec", get_vessels_shelf_formspec(meta:get_inventory())) end, on_blast = function(pos) local drops = {} default.get_inventory_drops(pos, "vessels", drops) drops[#drops + 1] = "vessels:shelf" minetest.remove_node(pos) return drops end, }) minetest.register_craft({ output = "vessels:shelf", recipe = { {"group:wood", "group:wood", "group:wood"}, {"group:vessel", "group:vessel", "group:vessel"}, {"group:wood", "group:wood", "group:wood"}, } }) minetest.register_node("vessels:glass_bottle", { description = "Empty Glass Bottle", drawtype = "plantlike", tiles = {"vessels_glass_bottle.png"}, inventory_image = "vessels_glass_bottle.png", wield_image = "vessels_glass_bottle.png", paramtype = "light", is_ground_content = false, walkable = false, selection_box = { type = "fixed", fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25} }, groups = {vessel = 1, dig_immediate = 3, attached_node = 1}, sounds = default.node_sound_glass_defaults(), }) minetest.register_craft( { output = "vessels:glass_bottle 10", recipe = { {"default:glass", "", "default:glass"}, {"default:glass", "", "default:glass"}, {"", "default:glass", ""} } }) minetest.register_node("vessels:drinking_glass", { description = "Empty Drinking Glass", drawtype = "plantlike", tiles = {"vessels_drinking_glass.png"}, inventory_image = "vessels_drinking_glass_inv.png", wield_image = "vessels_drinking_glass.png", paramtype = "light", is_ground_content = false, walkable = false, selection_box = { type = "fixed", fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25} }, groups = {vessel = 1, dig_immediate = 3, attached_node = 1}, sounds = default.node_sound_glass_defaults(), }) minetest.register_craft( { output = "vessels:drinking_glass 14", recipe = { {"default:glass", "", "default:glass"}, {"default:glass", "", "default:glass"}, {"default:glass", "default:glass", "default:glass"} } }) minetest.register_node("vessels:steel_bottle", { description = "Empty Heavy Steel Bottle", drawtype = "plantlike", tiles = {"vessels_steel_bottle.png"}, inventory_image = "vessels_steel_bottle.png", wield_image = "vessels_steel_bottle.png", paramtype = "light", is_ground_content = false, walkable = false, selection_box = { type = "fixed", fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25} }, groups = {vessel = 1, dig_immediate = 3, attached_node = 1}, sounds = default.node_sound_defaults(), }) minetest.register_craft( { output = "vessels:steel_bottle 5", recipe = { {"default:steel_ingot", "", "default:steel_ingot"}, {"default:steel_ingot", "", "default:steel_ingot"}, {"", "default:steel_ingot", ""} } }) -- Glass and steel recycling minetest.register_craftitem("vessels:glass_fragments", { description = "Glass Fragments", inventory_image = "vessels_glass_fragments.png", }) minetest.register_craft( { type = "shapeless", output = "vessels:glass_fragments", recipe = { "vessels:glass_bottle", "vessels:glass_bottle", }, }) minetest.register_craft( { type = "shapeless", output = "vessels:glass_fragments", recipe = { "vessels:drinking_glass", "vessels:drinking_glass", }, }) minetest.register_craft({ type = "cooking", output = "default:glass", recipe = "vessels:glass_fragments", }) minetest.register_craft( { type = "cooking", output = "default:steel_ingot", recipe = "vessels:steel_bottle", }) minetest.register_craft({ type = "fuel", recipe = "vessels:shelf", burntime = 30, })
lgpl-2.1