repo_name stringlengths 6 69 | path stringlengths 6 178 | copies stringclasses 278 values | size stringlengths 4 7 | content stringlengths 671 917k | license stringclasses 15 values |
|---|---|---|---|---|---|
kidaa/Awakening-Core3 | bin/scripts/object/installation/faction_perk/turret/dish_lg.lua | 1 | 2714 | --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_installation_faction_perk_turret_dish_lg = object_installation_faction_perk_turret_shared_dish_lg:new {
pvpStatusBitmask = 1,
optionsBitmask = 0,
maxCondition = 300000,
zoneComponent = "TurretZoneComponent",
dataObjectComponent = "TurretDataComponent",
-- Damagetypes in WeaponObject
vulnerability = BLAST,
-- LIGHT, MEDIUM, HEAVY
rating = HEAVY,
kinetic = 75,
energy = 95,
electricity = 75,
stun = 100,
blast = -1,
heat = 75,
cold = 75,
acid = 75,
lightSaber =100,
chanceHit = 400,
weapon = "object/weapon/ranged/turret/turret_block_large.iff",
}
ObjectTemplates:addTemplate(object_installation_faction_perk_turret_dish_lg, "object/installation/faction_perk/turret/dish_lg.iff")
| lgpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/object/draft_schematic/item/craftable_bug_habitat.lua | 2 | 3232 | --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_item_craftable_bug_habitat = object_draft_schematic_item_shared_craftable_bug_habitat:new {
templateType = DRAFTSCHEMATIC,
customObjectName = "Creature Habitat",
craftingToolTab = 524288, -- (See DraftSchemticImplementation.h)
complexity = 14,
size = 1,
xpType = "crafting_general",
xp = 60,
assemblySkill = "general_assembly",
experimentingSkill = "general_experimentation",
customizationSkill = "general_customization",
customizationOptions = {},
customizationStringNames = {},
customizationDefaults = {},
ingredientTemplateNames = {"craft_item_ingredients_n", "craft_item_ingredients_n", "craft_item_ingredients_n"},
ingredientTitleNames = {"container", "life_support", "creature_sample"},
ingredientSlotType = {0, 0, 2},
resourceTypes = {"metal", "chemical", "object/tangible/bug_jar/shared_sample_bugs.iff"},
resourceQuantities = {20, 10, 1},
contribution = {100, 100, 100},
targetTemplate = "object/tangible/bug_jar/craftable_bug_habitat.iff",
additionalTemplates = {
}
}
ObjectTemplates:addTemplate(object_draft_schematic_item_craftable_bug_habitat, "object/draft_schematic/item/craftable_bug_habitat.iff")
| lgpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/object/tangible/medicine/crafted/medpack_wound_action_c.lua | 3 | 2973 | --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_wound_action_c = object_tangible_medicine_crafted_shared_medpack_wound_action_c:new {
gameObjectType = 8241,
templateType = WOUNDPACK,
useCount = 10,
medicineUse = 5,
effectiveness = 100,
attribute = 3,
numberExperimentalProperties = {1, 1, 2, 2, 2, 1},
experimentalProperties = {"XX", "XX", "OQ", "PE", "OQ", "UT", "OQ", "PE", "XX"},
experimentalWeights = {1, 1, 2, 1, 2, 1, 2, 1, 1},
experimentalGroupTitles = {"null", "null", "exp_effectiveness", "exp_charges", "expEaseOfUse", "null"},
experimentalSubGroupTitles = {"null", "null", "power", "charges", "skillmodmin", "hitpoints"},
experimentalMin = {0, 0, 30, 20, 55, 1000},
experimentalMax = {0, 0, 120, 40, 35, 1000},
experimentalPrecision = {0, 0, 0, 0, 0, 0},
experimentalCombineType = {0, 0, 1, 1, 1, 4},
}
ObjectTemplates:addTemplate(object_tangible_medicine_crafted_medpack_wound_action_c, "object/tangible/medicine/crafted/medpack_wound_action_c.iff")
| lgpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/object/draft_schematic/clothing/clothing_jacket_field_16.lua | 2 | 3445 | --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_clothing_clothing_jacket_field_16 = object_draft_schematic_clothing_shared_clothing_jacket_field_16:new {
templateType = DRAFTSCHEMATIC,
customObjectName = "Cold Weather Jacket",
craftingToolTab = 8, -- (See DraftSchemticImplementation.h)
complexity = 21,
size = 3,
xpType = "crafting_clothing_general",
xp = 100,
assemblySkill = "clothing_assembly",
experimentingSkill = "clothing_experimentation",
customizationSkill = "clothing_customization",
customizationOptions = {2, 1},
customizationStringNames = {"/private/index_color_1", "/private/index_color_2"},
customizationDefaults = {94, 11},
ingredientTemplateNames = {"craft_clothing_ingredients_n", "craft_clothing_ingredients_n", "craft_clothing_ingredients_n", "craft_clothing_ingredients_n"},
ingredientTitleNames = {"heavy_shell", "binding_and_weatherproofing", "liner", "reinforcement"},
ingredientSlotType = {1, 0, 0, 0},
resourceTypes = {"object/tangible/component/clothing/shared_synthetic_cloth.iff", "petrochem_inert", "fiberplast", "metal"},
resourceQuantities = {1, 10, 15, 20},
contribution = {100, 100, 100, 100},
targetTemplate = "object/tangible/wearables/jacket/jacket_s16.iff",
additionalTemplates = {
}
}
ObjectTemplates:addTemplate(object_draft_schematic_clothing_clothing_jacket_field_16, "object/draft_schematic/clothing/clothing_jacket_field_16.iff")
| lgpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/object/draft_schematic/bio_engineer/dna_template/dna_template_rancor.lua | 3 | 2332 | --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_dna_template_dna_template_rancor = object_draft_schematic_bio_engineer_dna_template_shared_dna_template_rancor:new {
}
ObjectTemplates:addTemplate(object_draft_schematic_bio_engineer_dna_template_dna_template_rancor, "object/draft_schematic/bio_engineer/dna_template/dna_template_rancor.iff")
| lgpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/mobile/spawn/destroy_mission/tatooine_destroy_missions.lua | 1 | 3568 | tatooine_destroy_missions = {
wanderRadius = 10,
commandLevel = 0,
type = LAIR,
destroyMissionSpawns = {
{
lairTemplateName = "tatooine_kreetle_lair_neutral_small",
minDifficulty = 3,
maxDifficulty = 5,
size = 25,
},
{
lairTemplateName = "tatooine_rockmite_swarm_neutral_none",
minDifficulty = 3,
maxDifficulty = 5,
size = 25,
},
{
lairTemplateName = "tatooine_womprat_lair_neutral_small",
minDifficulty = 3,
maxDifficulty = 5,
size = 25,
},
{
lairTemplateName = "tatooine_gorg_herd_neutral_none",
minDifficulty = 5,
maxDifficulty = 7,
size = 25,
},
{
lairTemplateName = "tatooine_eopie_lair_neutral_small",
minDifficulty = 6,
maxDifficulty = 8,
size = 25,
},
{
lairTemplateName = "tatooine_sevorrt_lair_neutral_medium",
minDifficulty = 6,
maxDifficulty = 8,
size = 25,
},
{
lairTemplateName = "tatooine_cu_pa_lair_neutral_medium",
minDifficulty = 9,
maxDifficulty = 13,
size = 25,
},
{
lairTemplateName = "tatooine_bantha_dune_bantha_neutral_medium_boss_01",
minDifficulty = 13,
maxDifficulty = 17,
size = 25,
},
{
lairTemplateName = "tatooine_desert_eopie_lair_neutral_small",
minDifficulty = 14,
maxDifficulty = 18,
size = 25,
},
{
lairTemplateName = "tatooine_dune_bantha_lair_neutral_large",
minDifficulty = 15,
maxDifficulty = 19,
size = 25,
},
{
lairTemplateName = "tatooine_ronto_lair_neutral_large",
minDifficulty = 16,
maxDifficulty = 20,
size = 25,
},
{
lairTemplateName = "tatooine_squill_lair_neutral_small",
minDifficulty = 16,
maxDifficulty = 20,
size = 25,
},
{
lairTemplateName = "tatooine_dune_lizard_lair_neutral_medium",
minDifficulty = 16,
maxDifficulty = 20,
size = 25,
},
{
lairTemplateName = "tatooine_dewback_lair_neutral_large",
minDifficulty = 17,
maxDifficulty = 22,
size = 25,
},
{
lairTemplateName = "tatooine_bull_bantha_lair_neutral_large",
minDifficulty = 18,
maxDifficulty = 23,
size = 25,
},
{
lairTemplateName = "tatooine_desert_squill_lair_neutral_small",
minDifficulty = 18,
maxDifficulty = 23,
size = 25,
},
{
lairTemplateName = "tatooine_bocatt_lair_neutral_medium",
minDifficulty = 19,
maxDifficulty = 25,
size = 25,
},
{
lairTemplateName = "tatooine_tusken_raider_village_neutral_large_theater",
minDifficulty = 21,
maxDifficulty = 31,
size = 25,
},
{
lairTemplateName = "tatooine_dragonet_lair_neutral_medium",
minDifficulty = 24,
maxDifficulty = 34,
size = 25,
},
{
lairTemplateName = "tatooine_evil_settlement_neutral_medium_theater",
minDifficulty = 3,
maxDifficulty = 6,
size = 25,
},
{
lairTemplateName = "tatooine_moisture_settler_neutral_medium_theater",
minDifficulty = 3,
maxDifficulty = 6,
size = 25,
},
{
lairTemplateName = "tatooine_alkhara_bandit_patrol_neutral_none",
minDifficulty = 11,
maxDifficulty = 15,
size = 25,
},
{
lairTemplateName = "valarian_swooper_camp",
minDifficulty = 9,
maxDifficulty = 14,
size = 25,
},
{
lairTemplateName = "valarian_camp",
minDifficulty = 7,
maxDifficulty = 11,
size = 25,
},
{
lairTemplateName = "weequay_tribe_camp",
minDifficulty = 8,
maxDifficulty = 13,
size = 25,
},
{
lairTemplateName = "jabba_swooper_camp",
minDifficulty = 6,
maxDifficulty = 10,
size = 25,
}
}
}
addDestroyMissionGroup("tatooine_destroy_missions", tatooine_destroy_missions);
| lgpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/object/ship/z95_tier4.lua | 3 | 2144 | --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_ship_z95_tier4 = object_ship_shared_z95_tier4:new {
}
ObjectTemplates:addTemplate(object_ship_z95_tier4, "object/ship/z95_tier4.iff")
| lgpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/object/tangible/weather_object/objects.lua | 3 | 3682 | --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_weather_object_shared_weather_object_base = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/weather_object/shared_weather_object_base.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/pt_waypoint_white.prt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 8211,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "string_id_table",
gameObjectType = 8211,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@obj_n:unknown_object",
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 = 638400460,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_weather_object_shared_weather_object_base, "object/tangible/weather_object/shared_weather_object_base.iff")
| lgpl-3.0 |
palmettos/cnLuCI | applications/luci-coovachilli/luasrc/model/cbi/coovachilli_network.lua | 79 | 1639 | --[[
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$
]]--
require("luci.sys")
require("luci.ip")
m = Map("coovachilli")
-- tun
s1 = m:section(TypedSection, "tun")
s1.anonymous = true
s1:option( Flag, "usetap" )
s1:option( Value, "tundev" ).optional = true
s1:option( Value, "txqlen" ).optional = true
net = s1:option( Value, "net" )
for _, route in ipairs(luci.sys.net.routes()) do
if route.device ~= "lo" and route.dest:prefix() < 32 then
net:value( route.dest:string() )
end
end
s1:option( Value, "dynip" ).optional = true
s1:option( Value, "statip" ).optional = true
s1:option( Value, "dns1" ).optional = true
s1:option( Value, "dns2" ).optional = true
s1:option( Value, "domain" ).optional = true
s1:option( Value, "ipup" ).optional = true
s1:option( Value, "ipdown" ).optional = true
s1:option( Value, "conup" ).optional = true
s1:option( Value, "condown" ).optional = true
-- dhcp config
s2 = m:section(TypedSection, "dhcp")
s2.anonymous = true
dif = s2:option( Value, "dhcpif" )
for _, nif in ipairs(luci.sys.net.devices()) do
if nif ~= "lo" then dif:value(nif) end
end
s2:option( Value, "dhcpmac" ).optional = true
s2:option( Value, "lease" ).optional = true
s2:option( Value, "dhcpstart" ).optional = true
s2:option( Value, "dhcpend" ).optional = true
s2:option( Flag, "eapolenable" )
return m
| apache-2.0 |
widelands/widelands | data/tribes/buildings/productionsites/empire/sawmill/init.lua | 1 | 1614 | push_textdomain("tribes")
dirname = path.dirname(__file__)
wl.Descriptions():new_productionsite_type {
name = "empire_sawmill",
-- TRANSLATORS: This is a building name used in lists of buildings
descname = pgettext("empire_building", "Sawmill"),
icon = dirname .. "menu.png",
size = "medium",
buildcost = {
log = 2,
granite = 1,
planks = 1
},
return_on_dismantle = {
log = 1,
granite = 1
},
animation_directory = dirname,
spritesheets = {
idle = {
frames = 1,
columns = 1,
rows = 1,
hotspot = { 48, 62 },
},
working = {
basename = "idle", -- TODO(GunChleoc): No animation yet.
frames = 1,
columns = 1,
rows = 1,
hotspot = { 48, 62 },
},
},
aihints = {
basic_amount = 2,
very_weak_ai_limit = 2,
weak_ai_limit = 2
},
working_positions = {
empire_carpenter = 1
},
inputs = {
{ name = "log", amount = 8 }
},
programs = {
main = {
-- TRANSLATORS: Completed/Skipped/Did not start sawing logs because ...
descname = _("sawing logs"),
actions = {
"return=skipped unless economy needs planks",
"consume=log:2",
"sleep=duration:16s500ms", -- Much faster than barbarians' wood hardener
"playsound=sound/sawmill/sawmill priority:40% allow_multiple",
"animate=working duration:20s", -- Much faster than barbarians' wood hardener
"produce=planks"
}
},
},
}
pop_textdomain()
| gpl-2.0 |
kidaa/Awakening-Core3 | bin/scripts/commands/forceArmor2.lua | 3 | 2126 | --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
ForceArmor2Command = {
name = "forcearmor2",
}
AddCommand(ForceArmor2Command)
| lgpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/object/tangible/ship/crafted/shields/base_shields_subcomponent_mk3.lua | 3 | 2324 | --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_shields_base_shields_subcomponent_mk3 = object_tangible_ship_crafted_shields_shared_base_shields_subcomponent_mk3:new {
}
ObjectTemplates:addTemplate(object_tangible_ship_crafted_shields_base_shields_subcomponent_mk3, "object/tangible/ship/crafted/shields/base_shields_subcomponent_mk3.iff")
| lgpl-3.0 |
widelands/widelands | data/txts/LICENSE.lua | 1 | 2125 | include "scripting/richtext.lua"
push_textdomain("texts")
local r = {
rt(fs_color(
p_font("align=center", "size=28 color=2F9131", _("Licensing information for Widelands")) ..
-- TRANSLATORS: Placeholder is copyright end year
p_font("align=center", "size=14 italic=1 color=D1D1D1", _("Copyright 2002 - %1% by the Widelands Development Team.")):bformat(2022) ..
h2(_("This game is Free and Open Source (FOSS), licensed under the GNU General Public License (GPL) V2.0.")) ..
p(vspace(6) .. _("You can find more information on FOSS and the GPL by visiting the following webpage: %s")):bformat(a("https://www.gnu.org/licenses/old-licenses/gpl-2.0.html", "url", "https://www.gnu.org/licenses/old-licenses/gpl-2.0.html")) ..
p(vspace(6) .. _("You can find the full text of the license there as well as further information about its philosophy and the legal implications.")) ..
p(vspace(6) .. _("We are also shipping the GPL as a text document with Widelands itself.")) ..
p(vspace(6) .. _("On Linux, you can find the file called COPYING in the root of the source or standalone binary package, or in the installation directory (like ‘%1%’).")):bformat(i("/usr/share/games/widelands")) ..
p(vspace(6) .. _("On Windows, you can find the file called COPYING.txt in the installation folder, and the Widelands Start menu entry provides a link to this file.")) ..
p(vspace(6) .. _("On MacOS, you can find the file called COPYING in the archive you downloaded from the website.")) ..
h2(_("This game comes as-is and without any warranty.")) ..
p(_("For more information and support you can find us at %1% (Website, Wiki, Forum for questions or general support), %2% (Bugtracker), and %3% (Translations).")):
bformat(
a("widelands.org", "url", "https://www.widelands.org"),
a("widelands.org/wiki/ReportingBugs", "url", "https://www.widelands.org/wiki/ReportingBugs"),
a("widelands.org/wiki/TranslatingWidelands", "url", "https://www.widelands.org/wiki/TranslatingWidelands"))
))
}
pop_textdomain()
return r
| gpl-2.0 |
kidaa/Awakening-Core3 | bin/scripts/object/mobile/space_greeter_mos_eisley_smuggler_skinny.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_mobile_space_greeter_mos_eisley_smuggler_skinny = object_mobile_shared_space_greeter_mos_eisley_smuggler_skinny:new {
}
ObjectTemplates:addTemplate(object_mobile_space_greeter_mos_eisley_smuggler_skinny, "object/mobile/space_greeter_mos_eisley_smuggler_skinny.iff")
| lgpl-3.0 |
eraffxi/darkstar | scripts/globals/abilities/drachen_roll.lua | 2 | 2901 | -----------------------------------
-- Ability: Drachen Roll
-- Enhances pet accuracy for party members within area of effect
-- Optimal Job: Dragoon
-- Lucky Number: 4
-- Unlucky Number: 8
-- Level: 23
-- Phantom Roll +1 Value: 5
--
-- Die Roll |No DRG |With DRG
-- -------- ------- -----------
-- 1 |+10 |+25
-- 2 |+13 |+28
-- 3 |+15 |+30
-- 4 |+40 |+55
-- 5 |+18 |+33
-- 6 |+20 |+35
-- 7 |+25 |+40
-- 8 |+5 |+20
-- 9 |+28 |+43
-- 10 |+30 |+45
-- 11 |+50 |+65
-- Bust |-15 |-15
-----------------------------------
require("scripts/globals/settings");
require("scripts/globals/ability");
require("scripts/globals/status");
require("scripts/globals/msg");
-----------------------------------
function onAbilityCheck(player,target,ability)
local effectID = dsp.effect.DRACHEN_ROLL
ability:setRange(ability:getRange() + player:getMod(dsp.mod.ROLL_RANGE));
if (player:hasStatusEffect(effectID)) then
return dsp.msg.basic.ROLL_ALREADY_ACTIVE,0;
elseif atMaxCorsairBusts(player) then
return dsp.msg.basic.CANNOT_PERFORM,0;
else
return 0,0;
end
end;
function onUseAbility(caster,target,ability,action)
if (caster:getID() == target:getID()) then
corsairSetup(caster, ability, action, dsp.effect.DRACHEN_ROLL, dsp.job.DRG);
end
local total = caster:getLocalVar("corsairRollTotal")
return applyRoll(caster,target,ability,action,total)
end;
function applyRoll(caster,target,ability,action,total)
local duration = 300 + caster:getMerit(dsp.merit.WINNING_STREAK) + caster:getMod(dsp.mod.PHANTOM_DURATION)
local effectpowers = {10, 13, 15, 40, 18, 20, 25, 5, 28, 30, 50, 15}
local effectpower = effectpowers[total];
if (caster:getLocalVar("corsairRollBonus") == 1 and total < 12) then
effectpower = effectpower + 15
end
-- Apply Additional Phantom Roll+ Buff
local phantomBase = 5; -- Base increment buff
local effectpower = effectpower + (phantomBase * phantombuffMultiple(caster))
-- Check if COR Main or Sub
if (caster:getMainJob() == dsp.job.COR and caster:getMainLvl() < target:getMainLvl()) then
effectpower = effectpower * (caster:getMainLvl() / target:getMainLvl());
elseif (caster:getSubJob() == dsp.job.COR and caster:getSubLvl() < target:getMainLvl()) then
effectpower = effectpower * (caster:getSubLvl() / target:getMainLvl());
end
if (target:addCorsairRoll(caster:getMainJob(), caster:getMerit(dsp.merit.BUST_DURATION), dsp.effect.DRACHEN_ROLL, effectpower, 0, duration, caster:getID(), total, MOD_PET_ACC) == false) then
ability:setMsg(dsp.msg.basic.ROLL_MAIN_FAIL);
elseif total > 11 then
ability:setMsg(dsp.msg.basic.DOUBLEUP_BUST);
end
return total;
end
| gpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/object/static/structure/general/droid_lemedical_powerdown.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_static_structure_general_droid_lemedical_powerdown = object_static_structure_general_shared_droid_lemedical_powerdown:new {
}
ObjectTemplates:addTemplate(object_static_structure_general_droid_lemedical_powerdown, "object/static/structure/general/droid_lemedical_powerdown.iff")
| lgpl-3.0 |
boulzordev/android_external_skia | resources/test.lua | 68 | 1921 |
local r = { left = 10, top = 10, right = 100, bottom = 80 }
local x = 0;
local paint = Sk.newPaint();
paint:setAntiAlias(true);
local image -- = Sk.loadImage('/skia/sailboat.jpg');
function setImageFilename(filename)
image = Sk.loadImage(filename)
end
local color = {a = 1, r = 1, g = 0, b = 0};
function rnd(range)
return math.random() * range;
end
rndX = function () return rnd(640) end
rndY = function () return rnd(480) end
function draw_rand_path(canvas);
if not path_paint then
path_paint = Sk.newPaint();
path_paint:setAntiAlias(true);
end
path_paint:setColor({a = 1, r = math.random(), g = math.random(), b = math.random() });
local path = Sk.newPath();
path:moveTo(rndX(), rndY());
for i = 0, 50 do
path:quadTo(rndX(), rndY(), rndX(), rndY());
end
canvas:drawPath(path, path_paint);
paint:setColor{a=1,r=0,g=0,b=1};
local align = { 'left', 'center', 'right' };
paint:setTextSize(30);
for k, v in next, align do
paint:setTextAlign(v);
canvas:drawText('Hamburgefons', 320, 200 + 30*k, paint);
end
end
function onStartup()
local paint = Sk.newPaint();
paint:setColor{a=1, r=1, g=0, b=0};
if false then
local doc = Sk.newDocumentPDF('/skia/trunk/test.pdf');
local canvas = doc:beginPage(72*8.5, 72*11);
canvas:drawText('Hello Lua', 300, 300, paint);
doc:close();
doc = nil;
end
end
function onDrawContent(canvas)
draw_rand_path(canvas);
color.g = x / 100;
paint:setColor(color)
canvas:translate(x, 0);
canvas:drawOval(r, paint)
x = x + 1;
local r2 = {}
r2.left = x;
r2.top = r.bottom + 50;
r2.right = r2.left + image:width() * 1;
r2.bottom = r2.top + image:height() * 1;
canvas:drawImageRect(image, nil, r2, 0.75);
if x > 200 then x = 0 end;
return true -- so we can animate
end
onStartup()
| bsd-3-clause |
kidaa/Awakening-Core3 | bin/scripts/object/tangible/hair/zabrak/hair_zabrak_female_s05.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_hair_zabrak_hair_zabrak_female_s05 = object_tangible_hair_zabrak_shared_hair_zabrak_female_s05:new {
}
ObjectTemplates:addTemplate(object_tangible_hair_zabrak_hair_zabrak_female_s05, "object/tangible/hair/zabrak/hair_zabrak_female_s05.iff")
| lgpl-3.0 |
eraffxi/darkstar | scripts/globals/weaponskills/steel_cyclone.lua | 26 | 1617 | -----------------------------------
-- Steel Cyclone
-- Great Axe weapon skill
-- Skill level: 240
-- Delivers a single-hit attack. Damage varies with TP.
-- In order to obtain Steel Cyclone, the quest The Weight of Your Limits must be completed.
-- Will stack with Sneak Attack.
-- Aligned with the Breeze Gorget, Aqua Gorget & Snow Gorget.
-- Aligned with the Breeze Belt, Aqua Belt & Snow Belt.
-- Element: None
-- Modifiers: STR:60% ; VIT:60%
-- 100%TP 200%TP 300%TP
-- 1.50 2.5 4.00
-----------------------------------
require("scripts/globals/status");
require("scripts/globals/settings");
require("scripts/globals/weaponskills");
-----------------------------------
function onUseWeaponSkill(player, target, wsID, tp, primary, action, taChar)
local params = {};
params.numHits = 1;
params.ftp100 = 1.5; params.ftp200 = 1.75; params.ftp300 = 3;
params.str_wsc = 0.5; params.dex_wsc = 0.0; params.vit_wsc = 0.5; params.agi_wsc = 0.0; params.int_wsc = 0.0; params.mnd_wsc = 0.0; params.chr_wsc = 0.0;
params.crit100 = 0.0; params.crit200 = 0.0; params.crit300 = 0.0;
params.canCrit = false;
params.acc100 = 0.0; params.acc200= 0.0; params.acc300= 0.0;
params.atkmulti = 1.66;
if (USE_ADOULIN_WEAPON_SKILL_CHANGES == true) then
params.ftp200 = 2.5; params.ftp300 = 4;
params.str_wsc = 0.6; params.vit_wsc = 0.6;
params.atkmulti = 1.5;
end
local damage, criticalHit, tpHits, extraHits = doPhysicalWeaponskill(player, target, wsID, tp, primary, action, taChar, params);
return tpHits, extraHits, criticalHit, damage;
end
| gpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/object/draft_schematic/weapon/rifle_beam.lua | 2 | 3612 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_draft_schematic_weapon_rifle_beam = object_draft_schematic_weapon_shared_rifle_beam:new {
templateType = DRAFTSCHEMATIC,
customObjectName = "Beam Rifle",
craftingToolTab = 1, -- (See DraftSchemticImplementation.h)
complexity = 50,
size = 1,
xpType = "crafting_weapons_general",
xp = 340,
assemblySkill = "weapon_assembly",
experimentingSkill = "weapon_experimentation",
customizationSkill = "weapon_customization",
customizationOptions = {},
customizationStringNames = {},
customizationDefaults = {},
ingredientTemplateNames = {"craft_weapon_ingredients_n", "craft_weapon_ingredients_n", "craft_weapon_ingredients_n", "craft_weapon_ingredients_n", "craft_weapon_ingredients_n", "craft_weapon_ingredients_n", "craft_weapon_ingredients_n"},
ingredientTitleNames = {"frame_assembly", "receiver_assembly", "grip_assembly", "powerhandler", "barrel", "stock", "scope"},
ingredientSlotType = {0, 0, 0, 1, 1, 3, 2},
resourceTypes = {"steel", "iron", "metal", "object/tangible/component/weapon/shared_blaster_power_handler.iff", "object/tangible/component/weapon/shared_blaster_rifle_barrel.iff", "object/tangible/component/weapon/shared_stock.iff", "object/tangible/component/weapon/shared_scope_weapon.iff"},
resourceQuantities = {120, 60, 15, 4, 1, 1, 1},
contribution = {100, 100, 100, 100, 100, 100, 100},
targetTemplate = "object/weapon/ranged/rifle/rifle_beam.iff",
additionalTemplates = {
}
}
ObjectTemplates:addTemplate(object_draft_schematic_weapon_rifle_beam, "object/draft_schematic/weapon/rifle_beam.iff")
| lgpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/object/building/military/military_rebel_tactical_center.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_building_military_military_rebel_tactical_center = object_building_military_shared_military_rebel_tactical_center:new {
}
ObjectTemplates:addTemplate(object_building_military_military_rebel_tactical_center, "object/building/military/military_rebel_tactical_center.iff")
| lgpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/object/tangible/hair/bothan/hair_bothan_male_s11.lua | 3 | 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_tangible_hair_bothan_hair_bothan_male_s11 = object_tangible_hair_bothan_shared_hair_bothan_male_s11:new {
}
ObjectTemplates:addTemplate(object_tangible_hair_bothan_hair_bothan_male_s11, "object/tangible/hair/bothan/hair_bothan_male_s11.iff")
| lgpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/object/tangible/mission/quest_item/oxil_sarban_q1_needed.lua | 3 | 2284 | --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_oxil_sarban_q1_needed = object_tangible_mission_quest_item_shared_oxil_sarban_q1_needed:new {
}
ObjectTemplates:addTemplate(object_tangible_mission_quest_item_oxil_sarban_q1_needed, "object/tangible/mission/quest_item/oxil_sarban_q1_needed.iff")
| lgpl-3.0 |
coinapi/coinapi-sdk | ems-gateway-rest-sdk/lua/openapiclient/model/validation_error.lua | 2 | 3690 | --[[
EMS - REST API
This section will provide necessary information about the `CoinAPI EMS REST API` protocol. <br/> This API is also available in the Postman application: <a href=\"https://postman.coinapi.io/\" target=\"_blank\">https://postman.coinapi.io/</a> <br/><br/> Implemented Standards: * [HTTP1.0](https://datatracker.ietf.org/doc/html/rfc1945) * [HTTP1.1](https://datatracker.ietf.org/doc/html/rfc2616) * [HTTP2.0](https://datatracker.ietf.org/doc/html/rfc7540) ### Endpoints <table> <thead> <tr> <th>Deployment method</th> <th>Environment</th> <th>Url</th> </tr> </thead> <tbody> <tr> <td>Managed Cloud</td> <td>Production</td> <td>Use <a href=\"#ems-docs-sh\">Managed Cloud REST API /v1/locations</a> to get specific endpoints to each server site where your deployments span</td> </tr> <tr> <td>Managed Cloud</td> <td>Sandbox</td> <td><code>https://ems-gateway-aws-eu-central-1-dev.coinapi.io/</code></td> </tr> <tr> <td>Self Hosted</td> <td>Production</td> <td>IP Address of the <code>ems-gateway</code> container/excecutable in the closest server site to the caller location</td> </tr> <tr> <td>Self Hosted</td> <td>Sandbox</td> <td>IP Address of the <code>ems-gateway</code> container/excecutable in the closest server site to the caller location</td> </tr> </tbody> </table> ### Authentication If the software is deployed as `Self-Hosted` then API do not require authentication as inside your infrastructure, your company is responsible for the security and access controls. <br/><br/> If the software is deployed in our `Managed Cloud`, there are 2 methods for authenticating with us, you only need to use one: 1. Custom authorization header named `X-CoinAPI-Key` with the API Key 2. Query string parameter named `apikey` with the API Key 3. <a href=\"#certificate\">TLS Client Certificate</a> from the `Managed Cloud REST API` (/v1/certificate/pem endpoint) while establishing a TLS session with us. #### Custom authorization header You can authorize by providing additional custom header named `X-CoinAPI-Key` and API key as its value. Assuming that your API key is `73034021-THIS-IS-SAMPLE-KEY`, then the authorization header you should send to us will look like: <br/><br/> `X-CoinAPI-Key: 73034021-THIS-IS-SAMPLE-KEY` <aside class=\"success\">This method is recommended by us and you should use it in production environments.</aside> #### Query string authorization parameter You can authorize by providing an additional parameter named `apikey` with a value equal to your API key in the query string of your HTTP request. Assuming that your API key is `73034021-THIS-IS-SAMPLE-KEY` and that you want to request all balances, then your query string should look like this: <br/><br/> `GET /v1/balances?apikey=73034021-THIS-IS-SAMPLE-KEY` <aside class=\"notice\">Query string method may be more practical for development activities.</aside>
The version of the OpenAPI document: v1
Contact: support@coinapi.io
Generated by: https://openapi-generator.tech
]]
-- validation_error class
local validation_error = {}
local validation_error_mt = {
__name = "validation_error";
__index = validation_error;
}
local function cast_validation_error(t)
return setmetatable(t, validation_error_mt)
end
local function new_validation_error(type, title, status, trace_id, errors)
return cast_validation_error({
["type"] = type;
["title"] = title;
["status"] = status;
["traceId"] = trace_id;
["errors"] = errors;
})
end
return {
cast = cast_validation_error;
new = new_validation_error;
}
| mit |
kidaa/Awakening-Core3 | bin/scripts/object/tangible/lair/gurnaset/serverobjects.lua | 3 | 2235 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
--Children folder includes
-- Server Objects
includeFile("tangible/lair/gurnaset/lair_gurnaset.lua")
includeFile("tangible/lair/gurnaset/lair_gurnaset_grassland.lua")
includeFile("tangible/lair/gurnaset/lair_gurnaset_mountain.lua")
| lgpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/commands/creatureAreaPoison.lua | 3 | 2371 | --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
CreatureAreaPoisonCommand = {
name = "creatureareapoison",
combatSpam = "attack",
dotEffects = {
DotEffect(
POISONED_EFFECT,
{ "resistance_poison", "poison_disease_resist" },
HEALTH,
true,
125,
50,
50,
120
)
},
areaRange = 25,
areaAction = true
}
AddCommand(CreatureAreaPoisonCommand)
| lgpl-3.0 |
Codinablack/forgottenserver | data/talkactions/scripts/looktype.lua | 6 | 2426 | -- keep it ordered
local invalidTypes = {
1, 135, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173,
174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188,
189, 190, 191, 411, 415, 424, 439, 440, 468, 469, 474, 475, 476, 477, 478,
479, 480, 481, 482, 483, 484, 485, 501, 518, 519, 520, 524, 525, 536, 543,
549, 576, 581, 582, 597, 616, 623, 625, 638, 639, 640, 641, 642, 643, 645,
646, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 678, 700,
701, 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 713, 715, 718, 719,
722, 723, 737, 741, 742, 743, 744, 748, 751, 752, 753, 754, 755, 756, 757,
758, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777,
778, 779, 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792,
793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807,
808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822,
823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, 835, 836, 837,
838, 839, 840, 841, 847, 864, 865, 866, 867, 871, 872, 880, 891, 892, 893,
894, 895, 896, 897, 898, 911, 912, 917, 930, 941, 942, 946, 953, 954, 983,
995, 996, 997, 998, 999, 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008,
1009, 1010, 1012, 1014, 1015, 1022, 1028, 1074, 1075, 1080, 1081, 1082, 1083,
1084, 1085, 1086, 1087, 1089, 1090, 1096, 1097, 1098, 1099, 1100, 1141, 1145,
1153, 1154, 1155, 1156, 1160, 1170, 1171, 1172, 1176, 1177, 1178, 1182, 1192,
1193, 1194, 1198, 1215, 1216, 1225, 1226, 1227, 1228, 1235, 1236, 1237, 1238,
1239, 1240, 1241, 1242, 1250, 1254, 1263, 1267, 1273, 1274, 1287, 1302, 1318,
1319, 1320, 1327, 1328, 1329, 1330, 1340, 1343, 1345, 1347, 1348, 1349, 1350,
1351, 1352, 1353, 1354, 1355, 1356, 1357, 1358, 1359, 1360, 1361, 1362, 1368,
1369, 1370, 1374, 1375, 1376, 1388, 1392, 1395, 1400, 1402, 1404, 1409, 1410,
1411, 1420, 1421, 1427, 1429, 1432, 1433, 1434, 1435, 1438, 1442, 1443, 1451,
1452, 1458, 1462
}
function onSay(player, words, param)
if not player:getGroup():getAccess() then
return true
end
local lookType = tonumber(param)
if lookType >= 0 and lookType < 1469 and not table.contains(invalidTypes, lookType) then
local playerOutfit = player:getOutfit()
playerOutfit.lookType = lookType
player:setOutfit(playerOutfit)
else
player:sendCancelMessage("A look type with that id does not exist.")
end
return false
end
| gpl-2.0 |
kidaa/Awakening-Core3 | bin/scripts/object/static/particle/particle_test_32.lua | 3 | 2216 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_static_particle_particle_test_32 = object_static_particle_shared_particle_test_32:new {
}
ObjectTemplates:addTemplate(object_static_particle_particle_test_32, "object/static/particle/particle_test_32.iff")
| lgpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/object/tangible/powerup/weapon/objects.lua | 3 | 30805 | --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_powerup_weapon_shared_heavy = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/powerup/weapon/shared_heavy.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/eqp_comp_high_power_module.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 524292,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@powerup_d:weapon_heavy",
gameObjectType = 524292,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@powerup_n:weapon_heavy",
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 = 717357125,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/powerup/base/shared_base.iff", "object/tangible/powerup/base/shared_weapon_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_powerup_weapon_shared_heavy, "object/tangible/powerup/weapon/shared_heavy.iff")
object_tangible_powerup_weapon_shared_melee = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/powerup/weapon/shared_melee.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/eqp_comp_blade_vibro_unit.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 524289,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@powerup_d:weapon_melee",
gameObjectType = 524289,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@powerup_n:weapon_melee",
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 = 1636293712,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/powerup/base/shared_base.iff", "object/tangible/powerup/base/shared_weapon_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_powerup_weapon_shared_melee, "object/tangible/powerup/weapon/shared_melee.iff")
object_tangible_powerup_weapon_shared_melee_generic = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/powerup/weapon/shared_melee_generic.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/eqp_repair_melee_weapon.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 524289,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@powerup_d:weapon_melee",
gameObjectType = 524289,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@powerup_n:weapon_melee_generic",
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 = 1375892401,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/powerup/base/shared_base.iff", "object/tangible/powerup/base/shared_weapon_base.iff", "object/tangible/powerup/weapon/shared_melee.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_powerup_weapon_shared_melee_generic, "object/tangible/powerup/weapon/shared_melee_generic.iff")
object_tangible_powerup_weapon_shared_melee_lightsaber = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/powerup/weapon/shared_melee_lightsaber.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/eqp_repair_melee_weapon_lightsaber.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 524289,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@powerup_d:weapon_melee",
gameObjectType = 524289,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@powerup_n:weapon_melee_lightsaber",
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 = 1890042255,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/powerup/base/shared_base.iff", "object/tangible/powerup/base/shared_weapon_base.iff", "object/tangible/powerup/weapon/shared_melee.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_powerup_weapon_shared_melee_lightsaber, "object/tangible/powerup/weapon/shared_melee_lightsaber.iff")
object_tangible_powerup_weapon_shared_mine = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/powerup/weapon/shared_mine.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/eqp_comp_sensor_package_unit.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 524293,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@powerup_d:weapon_mine",
gameObjectType = 524293,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@powerup_n:weapon_mine",
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 = 2304219525,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/powerup/base/shared_base.iff", "object/tangible/powerup/base/shared_weapon_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_powerup_weapon_shared_mine, "object/tangible/powerup/weapon/shared_mine.iff")
object_tangible_powerup_weapon_shared_mine_explosive = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/powerup/weapon/shared_mine_explosive.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/wp_sp_ppack_bomb.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 524293,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@powerup_d:weapon_mine",
gameObjectType = 524293,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@powerup_n:weapon_mine_explosive",
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 = 3665923080,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/powerup/base/shared_base.iff", "object/tangible/powerup/base/shared_weapon_base.iff", "object/tangible/powerup/weapon/shared_mine.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_powerup_weapon_shared_mine_explosive, "object/tangible/powerup/weapon/shared_mine_explosive.iff")
object_tangible_powerup_weapon_shared_ranged = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/powerup/weapon/shared_ranged.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/eqp_comp_blaster_power_handler.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 524290,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@powerup_d:weapon_ranged",
gameObjectType = 524290,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@powerup_n:weapon_ranged",
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 = 1637218728,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/powerup/base/shared_base.iff", "object/tangible/powerup/base/shared_weapon_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_powerup_weapon_shared_ranged, "object/tangible/powerup/weapon/shared_ranged.iff")
object_tangible_powerup_weapon_shared_ranged_barrel = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/powerup/weapon/shared_ranged_barrel.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/eqp_comp_blaster_rifle_barrel.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 524290,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@powerup_d:weapon_ranged",
gameObjectType = 524290,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@powerup_n:weapon_ranged_barrel",
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 = 137262486,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/powerup/base/shared_base.iff", "object/tangible/powerup/base/shared_weapon_base.iff", "object/tangible/powerup/weapon/shared_ranged.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_powerup_weapon_shared_ranged_barrel, "object/tangible/powerup/weapon/shared_ranged_barrel.iff")
object_tangible_powerup_weapon_shared_ranged_grip = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/powerup/weapon/shared_ranged_grip.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/eqp_comp_blaster_power_handler.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 524290,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@powerup_d:weapon_ranged",
gameObjectType = 524290,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@powerup_n:weapon_ranged_grip",
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 = 1312422379,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/powerup/base/shared_base.iff", "object/tangible/powerup/base/shared_weapon_base.iff", "object/tangible/powerup/weapon/shared_ranged.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_powerup_weapon_shared_ranged_grip, "object/tangible/powerup/weapon/shared_ranged_grip.iff")
object_tangible_powerup_weapon_shared_ranged_muzzle = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/powerup/weapon/shared_ranged_muzzle.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/wp_muzzle_sm_s06.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 524290,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@powerup_d:weapon_ranged",
gameObjectType = 524290,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@powerup_n:weapon_ranged_muzzle",
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 = 555906025,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/powerup/base/shared_base.iff", "object/tangible/powerup/base/shared_weapon_base.iff", "object/tangible/powerup/weapon/shared_ranged.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_powerup_weapon_shared_ranged_muzzle, "object/tangible/powerup/weapon/shared_ranged_muzzle.iff")
object_tangible_powerup_weapon_shared_ranged_power = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/powerup/weapon/shared_ranged_power.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/eqp_comp_blaster_power_handler.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 524290,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@powerup_d:weapon_ranged",
gameObjectType = 524290,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@powerup_n:weapon_ranged_power",
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 = 1622710306,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/powerup/base/shared_base.iff", "object/tangible/powerup/base/shared_weapon_base.iff", "object/tangible/powerup/weapon/shared_ranged.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_powerup_weapon_shared_ranged_power, "object/tangible/powerup/weapon/shared_ranged_power.iff")
object_tangible_powerup_weapon_shared_ranged_scope = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/powerup/weapon/shared_ranged_scope.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/wp_scope_sm_s04.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 524290,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@powerup_d:weapon_ranged",
gameObjectType = 524290,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@powerup_n:weapon_ranged_scope",
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 = 3758199555,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/powerup/base/shared_base.iff", "object/tangible/powerup/base/shared_weapon_base.iff", "object/tangible/powerup/weapon/shared_ranged.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_powerup_weapon_shared_ranged_scope, "object/tangible/powerup/weapon/shared_ranged_scope.iff")
object_tangible_powerup_weapon_shared_ranged_stock = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/powerup/weapon/shared_ranged_stock.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/wp_rifle_laser_stock.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 524290,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@powerup_d:weapon_ranged",
gameObjectType = 524290,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@powerup_n:weapon_ranged_stock",
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 = 2739120425,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/powerup/base/shared_base.iff", "object/tangible/powerup/base/shared_weapon_base.iff", "object/tangible/powerup/weapon/shared_ranged.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_powerup_weapon_shared_ranged_stock, "object/tangible/powerup/weapon/shared_ranged_stock.iff")
object_tangible_powerup_weapon_shared_thrown = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/powerup/weapon/shared_thrown.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/eqp_comp_ammo_projectile.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 524291,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@powerup_d:weapon_thrown",
gameObjectType = 524291,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@powerup_n:weapon_thrown",
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 = 540983335,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/powerup/base/shared_base.iff", "object/tangible/powerup/base/shared_weapon_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_powerup_weapon_shared_thrown, "object/tangible/powerup/weapon/shared_thrown.iff")
object_tangible_powerup_weapon_shared_thrown_explosive = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/powerup/weapon/shared_thrown_explosive.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/wp_sp_ppack_bomb.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 524291,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@powerup_d:weapon_thrown",
gameObjectType = 524291,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@powerup_n:weapon_thrown_explosive",
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 = 2781934180,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/powerup/base/shared_base.iff", "object/tangible/powerup/base/shared_weapon_base.iff", "object/tangible/powerup/weapon/shared_thrown.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_powerup_weapon_shared_thrown_explosive, "object/tangible/powerup/weapon/shared_thrown_explosive.iff")
object_tangible_powerup_weapon_shared_thrown_wiring = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/powerup/weapon/shared_thrown_wiring.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/eqp_tool_computer_toolkit.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 524291,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@powerup_d:weapon_thrown",
gameObjectType = 524291,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@powerup_n:weapon_thrown_wiring",
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 = 569969360,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/powerup/base/shared_base.iff", "object/tangible/powerup/base/shared_weapon_base.iff", "object/tangible/powerup/weapon/shared_thrown.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_powerup_weapon_shared_thrown_wiring, "object/tangible/powerup/weapon/shared_thrown_wiring.iff")
| lgpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/object/tangible/ship/components/weapon/wpn_corvette_turret_sm_s01.lua | 3 | 2320 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_tangible_ship_components_weapon_wpn_corvette_turret_sm_s01 = object_tangible_ship_components_weapon_shared_wpn_corvette_turret_sm_s01:new {
}
ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_wpn_corvette_turret_sm_s01, "object/tangible/ship/components/weapon/wpn_corvette_turret_sm_s01.iff")
| lgpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/object/tangible/transport/objects.lua | 3 | 10546 | --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_transport_shared_door = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/transport/shared_door.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/door.apt",
arrangementDescriptorFilename = "abstract/slot/arrangement/arrangement_door.iff",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 8211,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@item_n:transport_door",
gameObjectType = 8211,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@item_n:transport_door",
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 = 2330152069,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/transport/base/shared_transport_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_transport_shared_door, "object/tangible/transport/shared_door.iff")
object_tangible_transport_shared_strut_a = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/transport/shared_strut_a.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/strut_a.apt",
arrangementDescriptorFilename = "abstract/slot/arrangement/arrangement_strut_a.iff",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 8211,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@item_n:transport_strut_a",
gameObjectType = 8211,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@item_n:transport_strut_a",
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 = 3646229980,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/transport/base/shared_transport_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_transport_shared_strut_a, "object/tangible/transport/shared_strut_a.iff")
object_tangible_transport_shared_strut_b = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/transport/shared_strut_b.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/strut_b.apt",
arrangementDescriptorFilename = "abstract/slot/arrangement/arrangement_strut_b.iff",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 8211,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@item_n:transport_strut_b",
gameObjectType = 8211,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@item_n:transport_strut_b",
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 = 37922123,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/transport/base/shared_transport_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_transport_shared_strut_b, "object/tangible/transport/shared_strut_b.iff")
object_tangible_transport_shared_strut_c = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/transport/shared_strut_c.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/strut_c.apt",
arrangementDescriptorFilename = "abstract/slot/arrangement/arrangement_strut_c.iff",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 8211,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@item_n:transport_strut_c",
gameObjectType = 8211,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@item_n:transport_strut_c",
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 = 1263518406,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/transport/base/shared_transport_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_transport_shared_strut_c, "object/tangible/transport/shared_strut_c.iff")
object_tangible_transport_shared_transport = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/transport/shared_transport.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/transport.apt",
arrangementDescriptorFilename = "abstract/slot/arrangement/arrangement_transport.iff",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 8211,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@item_n:transport",
gameObjectType = 8211,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@item_n:transport",
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 = 3801530659,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/transport/base/shared_transport_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_transport_shared_transport, "object/tangible/transport/shared_transport.iff")
| lgpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/object/mobile/dressed_selonian_m_08.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_08 = object_mobile_shared_dressed_selonian_m_08:new {
}
ObjectTemplates:addTemplate(object_mobile_dressed_selonian_m_08, "object/mobile/dressed_selonian_m_08.iff")
| lgpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/object/tangible/wearables/dress/dress_s09.lua | 3 | 4087 | --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_dress_dress_s09 = object_tangible_wearables_dress_shared_dress_s09:new {
playerRaces = { "object/creature/player/bothan_female.iff",
"object/creature/player/human_female.iff",
"object/creature/player/moncal_female.iff",
"object/creature/player/rodian_female.iff",
"object/creature/player/sullustan_female.iff",
"object/creature/player/trandoshan_female.iff",
"object/creature/player/twilek_female.iff",
"object/creature/player/zabrak_female.iff",
"object/mobile/vendor/aqualish_female.iff",
"object/mobile/vendor/bith_female.iff",
"object/mobile/vendor/bothan_female.iff",
"object/mobile/vendor/human_female.iff",
"object/mobile/vendor/moncal_female.iff",
"object/mobile/vendor/rodian_female.iff",
"object/mobile/vendor/sullustan_female.iff",
"object/mobile/vendor/trandoshan_female.iff",
"object/mobile/vendor/twilek_female.iff",
"object/mobile/vendor/zabrak_female.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_dress_dress_s09, "object/tangible/wearables/dress/dress_s09.iff")
| lgpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/object/tangible/deed/pet_deed/deed_probot_advanced_basic.lua | 1 | 4118 | --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_pet_deed_deed_probot_advanced_basic = object_tangible_deed_pet_deed_shared_deed_probot_advanced_basic:new {
templateType = DROIDDEED,
controlDeviceObjectTemplate = "object/intangible/pet/probot.iff",
generatedObjectTemplate = "object/creature/npc/droid/crafted/imperial_probot_advanced.iff",
mobileTemplate = "probot_crafted_advanced",
numberExperimentalProperties = {1, 1, 3, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
experimentalProperties = {"XX", "XX", "OQ", "SR", "UT", "XX", "XX", "OQ", "SR", "UT", "OQ", "XX", "XX", "XX", "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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
experimentalGroupTitles = {"null", "null", "exp_durability", "null", "null", "exp_quality", "exp_effectiveness", "null", "null", "null", "null", "null", "null", "null", "null", "null", "null", "null", "null", "null", "null", "null", "null", "null", "null", "null"},
experimentalSubGroupTitles = {"null", "null", "decayrate", "armor_toughness", "armorencumbrance", "mechanism_quality", "power_level", "storage_module", "data_module", "personality_module", "medical_module", "crafting_module", "repair_module", "armor_module", "cmbt_module", "armoreffectiveness", "playback_module", "struct_module", "harvest_power", "trap_bonus", "merchant_barker", "bomb_level", "stimpack_capacity", "stimpack_speed", "auto_repair_power", "entertainer_effects"},
experimentalMin = {0, 0, 5, 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
experimentalMax = {0, 0, 15, 0, 0, 100, 100, 0, 0, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
experimentalCombineType = {0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
}
ObjectTemplates:addTemplate(object_tangible_deed_pet_deed_deed_probot_advanced_basic, "object/tangible/deed/pet_deed/deed_probot_advanced_basic.iff")
| lgpl-3.0 |
eraffxi/darkstar | scripts/globals/abilities/pets/attachments/mana_tank_ii.lua | 2 | 1225 | -----------------------------------
-- Attachment: Mana Tank II
-----------------------------------
require("scripts/globals/status");
function onEquip(pet)
pet:addMod(dsp.mod.MPP, 8);
end
function onUnequip(pet)
pet:delMod(dsp.mod.MPP, 8);
end
function onManeuverGain(pet,maneuvers)
local bonus = 0
local frame = pet:getAutomatonFrame()
if (maneuvers == 1) then
if frame == 0x23 then bonus = 2 end
pet:addMod(dsp.mod.REFRESH, 2 + bonus);
elseif (maneuvers == 2) then
if frame == 0x23 then bonus = 1 end
pet:addMod(dsp.mod.REFRESH, 2 + bonus);
elseif (maneuvers == 3) then
if frame == 0x23 then bonus = 1 end
pet:addMod(dsp.mod.REFRESH, 1 + bonus);
end
end
function onManeuverLose(pet,maneuvers)
local bonus = 0
local frame = pet:getAutomatonFrame()
if (maneuvers == 1) then
if frame == 0x23 then bonus = 2 end
pet:delMod(dsp.mod.REFRESH, 2 + bonus);
elseif (maneuvers == 2) then
if frame == 0x23 then bonus = 1 end
pet:delMod(dsp.mod.REFRESH, 2 + bonus);
elseif (maneuvers == 3) then
if frame == 0x23 then bonus = 1 end
pet:delMod(dsp.mod.REFRESH, 1 + bonus);
end
end
| gpl-3.0 |
idekerlab/deep-cell | training/code/Models/Binary_Binary_GO_NN.lua | 1 | 11254 | require 'nn'
require 'nngraph'
require './BinaryLinear'
require './BinarizedNeurons'
require 'cunn'
require 'cudnn'
require 'Utility'
function filter_term(term_state,children_term_map)
result_list ={}
for term_name,state in pairs(term_state) do
if state == 0 then
children_term_list = children_term_map[term_name]
child_all_ready = true
for i,child in pairs(children_term_list) do
if term_state[child] == 0 then child_all_ready = false;break end
end
if child_all_ready == true then table.insert(result_list,term_name) end
end
end
return result_list
end
function get_neuron_num(term_size)
--return math.max(10,math.floor(0.2*term_size))
return 10
end
local BatchNormalization;
--[[
if opt.SBN == true then
require './BatchNormalizationShiftPow2'
BatchNormalization = BatchNormalizationShiftPow2
else
BatchNormalization = nn.BatchNormalization
end
]]
term_list,children_term_map,children_gene_map,term_size_map = load_topo_file(opt.topo)
local term_state = {}
local neuron_size_map = {}
for i,term_name in pairs(term_list) do
term_state[term_name] = 0
neuron_size_map[term_name] = get_neuron_num(term_size_map[term_name])
end
-- Need to use term_map, gene_map, term_size_map, term_list, gene2id as global variables.
local term_node_map = {}
local gene_node_map = {}
local loss_node_map = {}
local mask_node_map = {}
--for gene_name,id in pairs(gene2id) do input = nn.Identity()():annotate{name=gene_name}; gene_node_map[id] = input; end
gene_layer = nn.Identity()()
for i,term_name in pairs(term_list) do
children_gene_list = children_gene_map[term_name]
if #children_gene_list ~= 0 then
local linear_layer = nn.Linear(129,neuron_size_map[term_name])(gene_layer):annotate{name=term_name}
local BatchNorm_layer =nn.BatchNormalization(neuron_size_map[term_name])(linear_layer)
local Tanh_layer = nn.HardTanh()(BatchNorm_layer)
local Binary_layer = BinarizedNeurons(false)(Tanh_layer):annotate{name="binary_"..term_name}
gene_node_map[term_name] = Binary_layer
term_mask = torch.zeros(129,neuron_size_map[term_name])
for j,gene_name in pairs(children_gene_list) do
term_mask[gene2id[gene_name]] = 1
end
mask_node_map[term_name] = term_mask:transpose(1,2)
end
end
print("Constructing NN term --> combine gene --> batch normalization --> hard tanh --> residue --> binary")
--print("gene_node_map size",#gene_node_map)
--local input_layer = nn.JoinTable(2)(gene_node_map)
--L1 = BinarizedNeurons(true)(nn.HardTanh()(BatchNormalization(numHid,true)(BinaryLinear(129, numHid,false)(input_layer))))
--L2 = BinarizedNeurons(true)(nn.HardTanh()(BatchNormalization(numHid,true)(BinaryLinear(numHid, numHid,false)(L1))))
--L3 = nn.Tanh()(nn.Linear(numHid, 1)(L2))
--local L1 = BinarizedNeurons(false)(nn.HardTanh()(BatchNormalization(numHid,true)(BinaryLinear(129, numHid,false)(input_layer))))
--local L2 = BinarizedNeurons(false)(nn.HardTanh()(BatchNormalization(numHid,true)(BinaryLinear(numHid, numHid,false)(L1))))
--[[
a = {}
for i =1,2 do
a[i] = nn.Linear(129,5)(gene_layer):annotate{name='gene_name'..tostring(i)}
end
--local L1 = nn.ConcatTable()(a)
input_layer = nn.Tanh()(nn.JoinTable(2)(a))
]]
--NN_model:add(mlp)
--NN_model:add(nn.JoinTable(2))
--NN_model:add(nn.Linear(10,1))
--NN_model:add(nn.Tanh())
--local L2 = nn.Tanh()(nn.Linear(10,1)(input_layer))
--local L3 = nn.Linear(numHid, 1)(L1)
--local NN_model = nn.gModule(gene_node_map,{L3})
--local NN_model = nn.gModule({input_layer},{L3})
--local NN_model = nn.gModule({gene_layer},{L2})
while true do
ready_term = filter_term(term_state,children_term_map)
if #ready_term == 0 then break end
print("New round selects",#ready_term,"terms")
for i,term_name in pairs(ready_term) do
children_term_list = children_term_map[term_name]
children_gene_list = children_gene_map[term_name]
child_hidden_list = {}
input_size = 0
local input_layer
if #children_term_list > 0 then
for j,child in pairs(children_term_list) do
if term_node_map[child] == nil then print("Logical mistakes happen here",child,"missing!") end
input_size = input_size + neuron_size_map[child]
table.insert(child_hidden_list,term_node_map[child])
end
if #children_gene_list ~=0 then
input_size = input_size + neuron_size_map[term_name]
table.insert(child_hidden_list,gene_node_map[term_name])
end
input_layer = nn.JoinTable(2)(child_hidden_list)
else
input_size = neuron_size_map[term_name]
input_layer = gene_node_map[term_name]
end
-- Combine term hidden and direct gene input
--print(term_name,input_size,neuron_size_map[term_name],#child_hidden_list)
if term_name ~= opt.root then
-- Linear transformation
--linear_layer = BinaryLinear(input_size,neuron_size_map[term_name],true)(input_layer)
linear_layer = nn.Linear(input_size,neuron_size_map[term_name])(input_layer)
-- Batch normalization
--BatchNorm_layer = BatchNormalization(neuron_size_map[term_name],false)(linear_layer)
BatchNorm_layer = nn.BatchNormalization(neuron_size_map[term_name])(linear_layer)
-- Hard tanh
Tanh_layer = nn.HardTanh()(BatchNorm_layer)
--Tanh_layer = nn.Tanh()(BatchNorm_layer)
--Tanh_layer = nn.Tanh()(linear_layer)
-- Residual
--Residue_layer = nn.CAddTable(){Tanh_layer,linear_layerj}
-- Binarize output
-- Binary_layer = BinarizedNeurons(true)(Residue_layer)
Binary_layer = BinarizedNeurons(false)(Tanh_layer):annotate{name="binary_"..term_name}
Dropout_layer = nn.Dropout(0.5)(Binary_layer)
--term_node_map[term_name] = Binary_layer
term_node_map[term_name] = Dropout_layer
--if term_size_map[term_name] > 30 then
--auxillary_linear_layer = nn.Tanh()(nn.Linear(neuron_size_map[term_name],1)(input_layer))
auxillary_linear_layer = nn.Tanh()(nn.Linear(neuron_size_map[term_name],30)(Binary_layer))
--auxillary_linear_layer = nn.Tanh()(nn.Linear(neuron_size_map[term_name],30)(Tanh_layer))
--auxillary_linear_layer = nn.Tanh()(nn.Linear(neuron_size_map[term_name],1)(Dropout_layer))
auxillary_layer = nn.Tanh()(nn.Linear(30,1)(auxillary_linear_layer))
loss_node_map[term_name] = auxillary_layer
--end
else
-- For the root term, we don't binarize anything
--linear_layer = BinaryLinear(input_size,neuron_size_map[term_name],true)(input_layer)
linear_layer = nn.Linear(input_size,neuron_size_map[term_name])(input_layer)
--linear_layer = nn.Linear(input_size,1)(input_layer)
--linear_layer = nn.Linear(input_size,1000)(input_layer)
--BatchNorm_layer = BatchNormalization(neuron_size_map[term_name],false)(linear_layer)
BatchNorm_layer = nn.BatchNormalization(neuron_size_map[term_name])(linear_layer)
Tanh_layer = nn.Tanh()(BatchNorm_layer)
--Tanh_layer = nn.Tanh()(linear_layer)
-- Binary_layer = BinarizedNeurons(false)(Tanh_layer)
Dropout_layer = nn.Dropout(0.5)(Tanh_layer)
--linear_layer2 = nn.Linear(neuron_size_map[term_name],1)(Tanh_layer)
linear_layer2 = nn.Linear(neuron_size_map[term_name],1)(Dropout_layer)
BatchNorm_layer2 = nn.BatchNormalization(1)(linear_layer2)
-- Soft tanh
Tanh_layer3 = nn.Tanh()(BatchNorm_layer2)
--Tanh_layer3 = nn.Tanh()(linear_layer2)
--linear_layer3 = nn.Linear(2000,1)(Tanh_layer3)
--Tanh_layer3 = nn.Tanh()(linear_layer3)
-- Residual
--Residue_layer = nn.CAddTable(){Tanh_layer,linear_layer}
--Dropout_layer = nn.Dropout(0.5)(Residue_layer)
term_node_map[term_name] = Tanh_layer3
loss_node_map[term_name] = Tanh_layer3
end
term_state[term_name] = 1
end
end
output_term_list = {}
--term_list = {}
for term_name,neuron in pairs(loss_node_map) do
table.insert(output_term_list,neuron)
--table.insert(term_list,term_name)
end
--]]
local NN_model = nn.gModule({gene_layer},output_term_list)
--local loss_vector= nn.MSECriterion()
local regression_loss = nn.SmoothL1Criterion()
local loss_vector = nn.ParallelCriterion(true)
for i,term_name in pairs(term_list) do
if term_name == opt.root then
loss_vector:add(regression_loss)
else
loss_vector:add(regression_loss,0.3)
end
end
--[[
local dE, param = NN_model:getParameters()
local weight_size = dE:size(1)
local learningRates = torch.Tensor(weight_size):fill(0)
local clipvector = torch.Tensor(weight_size):fill(0)
local counter = 0
for i, layer in ipairs(NN_model.modules) do
if layer.__typename == 'BinaryLinear' then
local weight_size = layer.weight:size(1)*layer.weight:size(2)
local size_w=layer.weight:size(); GLR=1/torch.sqrt(1.5/(size_w[1]+size_w[2]))
--learningRates[{{counter+1, counter+weight_size}}]:fill(GLR)
clipvector[{{counter+1, counter+weight_size}}]:fill(1)
counter = counter+weight_size
local bias_size = layer.bias:size(1)
--learningRates[{{counter+1, counter+bias_size}}]:fill(GLR)
clipvector[{{counter+1, counter+bias_size}}]:fill(0)
counter = counter+bias_size
elseif layer.__typename == 'BatchNormalizationShiftPow2' then
local weight_size = layer.weight:size(1)
local size_w=layer.weight:size(); GLR=1/torch.sqrt(1.5/(size_w[1]))
--learningRates[{{counter+1, counter+weight_size}}]:fill(GLR)
clipvector[{{counter+1, counter+weight_size}}]:fill(0)
counter = counter+weight_size
local bias_size = layer.bias:size(1)
--learningRates[{{counter+1, counter+bias_size}}]:fill(1)
clipvector[{{counter+1, counter+bias_size}}]:fill(0)
counter = counter+bias_size
elseif layer.__typename == 'nn.BatchNormalization' then
local weight_size = layer.weight:size(1)
local size_w=layer.weight:size(); GLR=1/torch.sqrt(1.5/(size_w[1]))
--learningRates[{{counter+1, counter+weight_size}}]:fill(GLR)
clipvector[{{counter+1, counter+weight_size}}]:fill(0)
counter = counter+weight_size
local bias_size = layer.bias:size(1)
--learningRates[{{counter+1, counter+bias_size}}]:fill(1)
clipvector[{{counter+1, counter+bias_size}}]:fill(0)
counter = counter+bias_size
end
end
]]
return{
model = NN_model,
loss = loss_vector,
term_name_list = term_list,
term_mask = mask_node_map
--lrs = learningRates,
--clipV =clipvector
}
| mit |
kidaa/Awakening-Core3 | bin/scripts/object/tangible/terminal/terminal_dark_enclave_voting.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_terminal_terminal_dark_enclave_voting = object_tangible_terminal_shared_terminal_dark_enclave_voting:new {
}
ObjectTemplates:addTemplate(object_tangible_terminal_terminal_dark_enclave_voting, "object/tangible/terminal/terminal_dark_enclave_voting.iff")
| lgpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/object/tangible/lair/base/poi_all_lair_leaf_small_evil_fire_green.lua | 2 | 2372 | --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_leaf_small_evil_fire_green = object_tangible_lair_base_shared_poi_all_lair_leaf_small_evil_fire_green:new {
objectMenuComponent = {"cpp", "LairMenuComponent"},
}
ObjectTemplates:addTemplate(object_tangible_lair_base_poi_all_lair_leaf_small_evil_fire_green, "object/tangible/lair/base/poi_all_lair_leaf_small_evil_fire_green.iff")
| lgpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/object/tangible/wearables/hat/singing_mountain_clan_hat_s01.lua | 3 | 2684 | --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_hat_singing_mountain_clan_hat_s01 = object_tangible_wearables_hat_shared_singing_mountain_clan_hat_s01:new {
playerRaces = { "object/creature/player/bothan_female.iff",
"object/creature/player/human_female.iff",
"object/creature/player/rodian_female.iff",
"object/creature/player/zabrak_female.iff",
"object/mobile/vendor/bothan_female.iff",
"object/mobile/vendor/human_female.iff",
"object/mobile/vendor/rodian_female.iff",
"object/mobile/vendor/zabrak_female.iff" },
}
ObjectTemplates:addTemplate(object_tangible_wearables_hat_singing_mountain_clan_hat_s01, "object/tangible/wearables/hat/singing_mountain_clan_hat_s01.iff")
| lgpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/object/tangible/lair/horned_krevol/serverobjects.lua | 3 | 2335 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
--Children folder includes
-- Server Objects
includeFile("tangible/lair/horned_krevol/lair_horned_krevol.lua")
includeFile("tangible/lair/horned_krevol/lair_horned_krevol_desert.lua")
includeFile("tangible/lair/horned_krevol/lair_horned_krevol_forest.lua")
includeFile("tangible/lair/horned_krevol/lair_horned_krevol_mountain.lua")
| lgpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/object/mobile/bolle_bol.lua | 3 | 2152 | --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_bolle_bol = object_mobile_shared_bolle_bol:new {
}
ObjectTemplates:addTemplate(object_mobile_bolle_bol, "object/mobile/bolle_bol.iff")
| lgpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/object/mobile/mound_mite.lua | 3 | 2156 | --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_mound_mite = object_mobile_shared_mound_mite:new {
}
ObjectTemplates:addTemplate(object_mobile_mound_mite, "object/mobile/mound_mite.iff")
| lgpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/object/static/firework/fx_10.lua | 3 | 2172 | --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_firework_fx_10 = object_static_firework_shared_fx_10:new {
}
ObjectTemplates:addTemplate(object_static_firework_fx_10, "object/static/firework/fx_10.iff")
| lgpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/mobile/wearables/humanoid_female_outfits.lua | 3 | 3584 | --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.
-- Humanoid_female1
addOutfit(
Outfit(
"Humanoid_female1", -- OutfitName
{"object/tangible/wearables/shirt/shirt_s12.iff", -- Shirt
"object/tangible/wearables/pants/pants_s18.iff", -- Pants
"object/tangible/wearables/shoes/shoes_s08.iff" -- Shoes
}))
-- Humanoid_female2
addOutfit(
Outfit(
"Humanoid_female2", -- OutfitName
{"object/tangible/wearables/shirt/shirt_s12.iff", -- Shirt
"object/tangible/wearables/pants/pants_s18.iff", -- Pants
"object/tangible/wearables/shoes/shoes_s09.iff" -- Shoes
}))
-- Humanoid_female3
addOutfit(
Outfit(
"Humanoid_female3", -- OutfitName
{"object/tangible/wearables/shirt/shirt_s24.iff", -- Shirt
"object/tangible/wearables/pants/pants_s18.iff", -- Pants
"object/tangible/wearables/shoes/shoes_s08.iff" -- Shoes
}))
-- Humanoid_female4
addOutfit(
Outfit(
"Humanoid_female4", -- OutfitName
{"object/tangible/wearables/shirt/shirt_s24.iff", -- Shirt
"object/tangible/wearables/pants/pants_s18.iff", -- Pants
"object/tangible/wearables/shoes/shoes_s09.iff" -- Shoes
}))
-- Humanoid_female5
addOutfit(
Outfit(
"Humanoid_female5", -- OutfitName
{"object/tangible/wearables/shirt/shirt_s28.iff", -- Shirt
"object/tangible/wearables/pants/pants_s18.iff", -- Pants
"object/tangible/wearables/shoes/shoes_s08.iff" -- Shoes
}))
-- Humanoid_female6
addOutfit(
Outfit(
"Humanoid_female6", -- OutfitName
{"object/tangible/wearables/shirt/shirt_s28.iff", -- Shirt
"object/tangible/wearables/pants/pants_s18.iff", -- Pants
"object/tangible/wearables/shoes/shoes_s09.iff" -- Shoes
}))
| lgpl-3.0 |
eraffxi/darkstar | scripts/globals/weather.lua | 14 | 1032 | -----------------------------------
-- Weather Conditions
-----------------------------------
dsp = dsp or {}
dsp.weather =
{
NONE = 0,
SUNSHINE = 1,
CLOUDS = 2,
FOG = 3,
HOT_SPELL = 4,
HEAT_WAVE = 5,
RAIN = 6,
SQUALL = 7,
DUST_STORM = 8,
SAND_STORM = 9,
WIND = 10,
GALES = 11,
SNOW = 12,
BLIZZARDS = 13,
THUNDER = 14,
THUNDERSTORMS = 15,
AURORAS = 16,
STELLAR_GLARE = 17,
GLOOM = 18,
DARKNESS = 19,
}
dsp.day =
{
FIRESDAY = 0,
EARTHSDAY = 1,
WATERSDAY = 2,
WINDSDAY = 3,
ICEDAY = 4,
LIGHTNINGDAY = 5,
LIGHTSDAY = 6,
DARKSDAY = 7,
}
dsp.time =
{
NONE = 0,
MIDNIGHT = 1,
NEW_DAY = 2,
DAWN = 3,
DAY = 4,
DUSK = 5,
EVENING = 6,
NIGHT = 7,
} | gpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/object/mobile/dressed_gran_thug_male_01.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_mobile_dressed_gran_thug_male_01 = object_mobile_shared_dressed_gran_thug_male_01:new {
}
ObjectTemplates:addTemplate(object_mobile_dressed_gran_thug_male_01, "object/mobile/dressed_gran_thug_male_01.iff")
| lgpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/object/weapon/melee/sword/crafted_saber/sword_lightsaber_one_handed_s11.lua | 1 | 6177 | --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_s11 = object_weapon_melee_sword_crafted_saber_shared_sword_lightsaber_one_handed_s11: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_gen1" },
-- 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 = 20,
actionAttackCost = 35,
mindAttackCost = 40,
forceCost = 12,
pointBlankRange = 0,
pointBlankAccuracy = 20,
idealRange = 3,
idealAccuracy = 15,
maxRange = 5,
maxRangeAccuracy = 5,
minDamage = 70,
maxDamage = 160,
attackSpeed = 4.5,
defenderToughnessModifiers = { "lightsaber_toughness" },
childObjects = {
{templateFile = "object/tangible/inventory/lightsaber_inventory_1.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, 70, 160, 4.5, 10, 15, 20, 35, 40},
experimentalMax = {0, 0, 90, 200, 4.2, 20, 12, 15, 25, 25},
experimentalPrecision = {0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
experimentalCombineType = {0, 0, 1, 1, 1, 1, 1, 1, 1, 1},
}
ObjectTemplates:addTemplate(object_weapon_melee_sword_crafted_saber_sword_lightsaber_one_handed_s11, "object/weapon/melee/sword/crafted_saber/sword_lightsaber_one_handed_s11.iff")
| lgpl-3.0 |
widelands/widelands | data/tribes/initialization/atlanteans/starting_conditions/poor_hamlet.lua | 1 | 1960 | -- =======================================================================
-- Minimum (Poor Hamlet) starting conditions for Atlanteans
-- =======================================================================
include "scripting/infrastructure.lua"
push_textdomain("tribes")
init = {
-- TRANSLATORS: This is the name of a starting condition
descname = _("Poor Hamlet"),
-- TRANSLATORS: This is the tooltip for the "Poor Hamlet" (minimum) starting condition
tooltip = _("Start the game with just a warehouse and the bare minimum for bootstrapping an economy. Warning: the AI can’t successfully start from this."),
incompatible_wc = {"scripting/win_conditions/hq_hunter.lua"},
func = function(player, shared_in_start)
local sf = wl.Game().map.player_slots[player.number].starting_field
if shared_in_start then
sf = shared_in_start
else
player:allow_workers("all")
end
prefilled_buildings(player, { "atlanteans_warehouse", sf.x, sf.y,
wares = {
log = 2,
planks = 2,
corn = 3,
hammer = 1,
--Woodcutter, sawyer, toolsmith:
saw = 3,
pick = 1,
shovel =1 ,
milking_tongs = 1,
-- Smelter:
iron = 1,
-- Baker, blackroot farmer, farmer, geologist, 3x miner, smoker:
iron_ore = 8
},
soldiers = {
[{0,0,0,0}] = 1,
}
})
player:reveal_fields(sf:region(10))
player:conquer(sf, 9)
push_textdomain("tribes")
player:send_to_inbox(_("Be careful"), _("You have only one iron for each tool you will need to start your economy. Make sure no unneeded tool is created."))
pop_textdomain()
check_trees_rocks_poor_hamlet(player, sf, "atlanteans_warehouse", {granite = 4, planks = -1}, {log = 1, planks = 1, granite = 1})
end
}
pop_textdomain()
return init
| gpl-2.0 |
kidaa/Awakening-Core3 | bin/scripts/object/tangible/shipcontrol/objects.lua | 3 | 13111 | --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_shipcontrol_shared_pilot_chair = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/shipcontrol/shared_pilot_chair.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_chair_metal_s1.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 8228,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 1,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@space_item:pilot_chair",
gameObjectType = 8228,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@space_item:pilot_chair",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/shipcontrol_pob.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 3541722217,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_shipcontrol_shared_pilot_chair, "object/tangible/shipcontrol/shared_pilot_chair.iff")
object_tangible_shipcontrol_shared_shipcontrol_corvette = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/shipcontrol/shared_shipcontrol_corvette.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_spc_chair_pilot_s02.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 8228,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 1,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@space/space_item:shipcontrol_corvette",
gameObjectType = 8228,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@space/space_item:shipcontrol_corvette",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/ship_pilot_station.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 543526931,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_shipcontrol_shared_shipcontrol_corvette, "object/tangible/shipcontrol/shared_shipcontrol_corvette.iff")
object_tangible_shipcontrol_shared_shipcontrol_falcon = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/shipcontrol/shared_shipcontrol_falcon.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_spc_chair_pilot_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 8228,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 1,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@space/space_item:shipcontrol_falcon",
gameObjectType = 8228,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@space/space_item:shipcontrol_falcon",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/ship_pilot_station.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 362033500,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_shipcontrol_shared_shipcontrol_falcon, "object/tangible/shipcontrol/shared_shipcontrol_falcon.iff")
object_tangible_shipcontrol_shared_shipoperations_falcon = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/shipcontrol/shared_shipoperations_falcon.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_spc_chair_pilot_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 8229,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 1,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@space/space_item:shipoperations_falcon",
gameObjectType = 8229,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@space/space_item:shipoperations_falcon",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/ship_operations_station.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 752872042,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_shipcontrol_shared_shipoperations_falcon, "object/tangible/shipcontrol/shared_shipoperations_falcon.iff")
object_tangible_shipcontrol_shared_turretcontrol_falcon = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/shipcontrol/shared_turretcontrol_falcon.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/yt1300_ladder.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 8230,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 1,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@space/space_item:turretcontrol_falcon",
gameObjectType = 8230,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@space/space_item:turretcontrol_falcon",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/turretcontrol_falcon.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 3238239508,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_shipcontrol_shared_turretcontrol_falcon, "object/tangible/shipcontrol/shared_turretcontrol_falcon.iff")
object_tangible_shipcontrol_shared_turretcontrol_vt49 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/shipcontrol/shared_turretcontrol_vt49.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/vt49_ladder.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 8230,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 1,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@space/space_item:turretcontrol_falcon",
gameObjectType = 8230,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@space/space_item:turretcontrol_falcon",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/turretcontrol_falcon.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 315011154,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_shipcontrol_shared_turretcontrol_vt49, "object/tangible/shipcontrol/shared_turretcontrol_vt49.iff")
| lgpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/object/tangible/wearables/base/base_wrist_r.lua | 3 | 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_tangible_wearables_base_base_wrist_r = object_tangible_wearables_base_shared_base_wrist_r:new {
}
ObjectTemplates:addTemplate(object_tangible_wearables_base_base_wrist_r, "object/tangible/wearables/base/base_wrist_r.iff")
| lgpl-3.0 |
NezzKryptic/Wire | lua/entities/gmod_wire_hologram.lua | 2 | 9786 | AddCSLuaFile()
DEFINE_BASECLASS("base_anim") -- NOTE: Not base_wire_entity! Simpler than that
ENT.PrintName = "Wire Hologram"
ENT.RenderGroup = RENDERGROUP_OPAQUE
ENT.DisableDuplicator = true
function ENT:SetPlayer(ply)
self:SetVar("Founder", ply)
self:SetVar("FounderIndex", ply:UniqueID())
self:SetNWString("FounderName", ply:Nick())
end
function ENT:GetPlayer()
return self:GetVar("Founder", NULL)
end
if CLIENT then
local blocked = {}
local scale_buffer = {}
local bone_scale_buffer = {}
local clip_buffer = {}
local vis_buffer = {}
local player_color_buffer = {}
function ENT:Initialize()
self.bone_scale = {}
self:DoScale()
local ownerid = self:GetNWInt("ownerid")
self.blocked = blocked[ownerid] or false
self.clips = {}
self:DoClip()
self:DoVisible()
self:DoPlayerColor()
end
hook.Add("PlayerBindPress", "wire_hologram_scale_setup", function() -- For initial spawn
for _, ent in pairs(ents.FindByClass("gmod_wire_hologram")) do
if ent:IsValid() and ent.DoScale then
ent:DoScale()
ent:DoClip()
ent:DoVisible()
ent:DoPlayerColor()
end
end
hook.Remove("PlayerBindPress", "wire_hologram_scale_setup")
end)
function ENT:SetupClipping()
if next(self.clips) then
self.oldClipState = render.EnableClipping(true)
for _, clip in pairs(self.clips) do
if clip.enabled and clip.normal and clip.origin then
local norm = clip.normal
local origin = clip.origin
if clip.localentid then
local localent = Entity(clip.localentid)
if localent:IsValid() then
norm = localent:LocalToWorld(norm) - localent:GetPos()
origin = localent:LocalToWorld(origin)
end
end
render.PushCustomClipPlane(norm, norm:Dot(origin))
end
end
end
end
function ENT:FinishClipping()
if next(self.clips) then
for _, clip in pairs(self.clips) do
render.PopCustomClipPlane()
end
render.EnableClipping(self.oldClipState)
end
end
function ENT:Draw()
if self.blocked or self.notvisible then return end
if self:GetColor().a ~= 255 then
self.RenderGroup = RENDERGROUP_BOTH
else
self.RenderGroup = RENDERGROUP_OPAQUE
end
self:SetupClipping()
if self:GetNWBool("disable_shading") then
render.SuppressEngineLighting(true)
self:DrawModel()
render.SuppressEngineLighting(false)
else
self:DrawModel()
end
self:FinishClipping()
end
-- -----------------------------------------------------------------------------
function ENT:DoClip()
local eidx = self:EntIndex()
if clip_buffer[eidx] ~= nil then
table.Merge(self.clips, clip_buffer[eidx])
clip_buffer[eidx] = nil
end
end
local function CheckClip(eidx, cidx)
clip_buffer[eidx] = clip_buffer[eidx] or {}
clip_buffer[eidx][cidx] = clip_buffer[eidx][cidx] or {}
return clip_buffer[eidx][cidx]
end
local function SetClipEnabled(eidx, cidx, enabled)
local clip = CheckClip(eidx, cidx)
clip.enabled = enabled
end
local function SetClip(eidx, cidx, origin, norm, localentid)
local clip = CheckClip(eidx, cidx)
clip.normal = norm
clip.origin = origin
if localentid ~= 0 then
clip.localentid = localentid
else
clip.localentid = nil
end
end
net.Receive("wire_holograms_clip", function(netlen)
local entid = net.ReadUInt(16)
while entid ~= 0 do
local clipid = net.ReadUInt(4)
if net.ReadBit() ~= 0 then
SetClipEnabled(entid, clipid, net.ReadBit() ~= 0)
else
SetClip(entid, clipid, net.ReadVector(), Vector(net.ReadFloat(), net.ReadFloat(), net.ReadFloat()), net.ReadUInt(16))
end
local ent = Entity(entid)
if ent and ent.DoClip then
ent:DoClip()
end
entid = net.ReadUInt(16)
end
end)
-- -----------------------------------------------------------------------------
local function SetScale(entindex, scale)
scale_buffer[entindex] = scale
local ent = Entity(entindex)
if ent and ent.DoScale then
ent:DoScale()
end
end
local function SetBoneScale(entindex, bindex, scale)
if bone_scale_buffer[entindex] == nil then bone_scale_buffer[entindex] = {} end
if bindex == -1 then
bone_scale_buffer[entindex] = nil
else
bone_scale_buffer[entindex][bindex] = scale
end
local ent = Entity(entindex)
if ent and ent.DoScale then
if bindex == -1 then ent.bone_scale = {} end -- reset bone scale
ent:DoScale()
end
end
function ENT:DoScale()
local eidx = self:EntIndex()
if scale_buffer[eidx] ~= nil then
self.scale = scale_buffer[eidx]
scale_buffer[eidx] = nil
end
if bone_scale_buffer[eidx] ~= nil then
for b, s in pairs(bone_scale_buffer[eidx]) do
self.bone_scale[b] = s
end
bone_scale_buffer[eidx] = {}
end
local scale = self.scale or Vector(1, 1, 1)
if self.EnableMatrix then
local mat = Matrix()
mat:Scale(Vector(scale.x, scale.y, scale.z))
self:EnableMatrix("RenderMultiply", mat)
else
-- Some entities, like ragdolls, cannot be resized with EnableMatrix, so lets average the three components to get a float
self:SetModelScale((scale.x + scale.y + scale.z) / 3, 0)
end
if table.Count( self.bone_scale ) > 0 then
local count = self:GetBoneCount() or -1
for i = count, 0, -1 do
local bone_scale = self.bone_scale[i] or Vector(1,1,1)
self:ManipulateBoneScale(i, bone_scale) // Note: Using ManipulateBoneScale currently causes RenderBounds to be reset every frame!
end
end
local propmax = self:OBBMaxs()
local propmin = self:OBBMins()
self:SetRenderBounds(Vector(scale.x * propmin.x, scale.y * propmin.y, scale.z * propmin.z),Vector(scale.x * propmax.x, scale.y * propmax.y, scale.z * propmax.z))
end
net.Receive("wire_holograms_set_scale", function(netlen)
local index = net.ReadUInt(16)
while index ~= 0 do
SetScale(index, Vector(net.ReadFloat(), net.ReadFloat(), net.ReadFloat()))
index = net.ReadUInt(16)
end
end)
net.Receive("wire_holograms_set_bone_scale", function(netlen)
local index = net.ReadUInt(16)
local bindex = net.ReadUInt(16) - 1 -- using -1 to get negative -1 for reset
while index ~= 0 do
SetBoneScale(index, bindex, Vector(net.ReadFloat(), net.ReadFloat(), net.ReadFloat()))
index = net.ReadUInt(16)
bindex = net.ReadUInt(16) - 1
end
end)
-- -----------------------------------------------------------------------------
function ENT:DoVisible()
local eidx = self:EntIndex()
if vis_buffer[eidx] ~= nil then
self.notvisible = vis_buffer[eidx]
vis_buffer[eidx] = nil
end
end
net.Receive("wire_holograms_set_visible", function(netlen)
local index = net.ReadUInt(16)
while index ~= 0 do
local ent = Entity(index)
if ent and ent.DoVisible then
ent.notvisible = net.ReadBit() == 0
else
vis_buffer[index] = net.ReadBit() == 0
end
index = net.ReadUInt(16)
end
end)
-- -----------------------------------------------------------------------------
local function SetPlayerColor(entindex, color)
local ent = Entity(entindex)
-- For reference, here's why this works:
-- https://github.com/garrynewman/garrysmod/blob/master/garrysmod/lua/matproxy/player_color.lua
function ent:GetPlayerColor()
return color
end
end
function ENT:DoPlayerColor()
local eidx = self:EntIndex()
if player_color_buffer[eidx] ~= nil then
SetPlayerColor(eidx, player_color_buffer[eidx])
player_color_buffer[eidx] = nil
end
end
net.Receive("wire_holograms_set_player_color", function(netlen)
local index = net.ReadUInt(16)
while index ~= 0 do
local ent = Entity(index)
if IsValid(ent) and ent.DoPlayerColor then
SetPlayerColor(index, net.ReadVector())
else
player_color_buffer[index] = net.ReadVector()
end
index = net.ReadUInt(16)
end
end)
-- -----------------------------------------------------------------------------
concommand.Add("wire_holograms_block_client",
function(ply, command, args)
local toblock
for _, ply in ipairs(player.GetAll()) do
if ply:Name() == args[1] then
toblock = ply
break
end
end
if not toblock then error("Player not found") end
local id = toblock:UserID()
blocked[id] = true
for _, ent in ipairs(ents.FindByClass("gmod_wire_hologram")) do
if ent:GetNWInt("ownerid") == id then
ent.blocked = true
end
end
end,
function()
local names = {}
for _, ply in ipairs(player.GetAll()) do
table.insert(names, "wire_holograms_block_client \"" .. ply:Name() .. "\"")
end
table.sort(names)
return names
end)
concommand.Add("wire_holograms_unblock_client",
function(ply, command, args)
local toblock
for _, ply in ipairs(player.GetAll()) do
if ply:Name() == args[1] then
toblock = ply
break
end
end
if not toblock then error("Player not found") end
local id = toblock:UserID()
blocked[id] = nil
for _, ent in ipairs(ents.FindByClass("gmod_wire_hologram")) do
if ent:GetNWInt("ownerid") == id then
ent.blocked = false
end
end
end,
function()
local names = {}
for _, ply in ipairs(player.GetAll()) do
if blocked[ply:UserID()] then
table.insert(names, "wire_holograms_unblock_client \"" .. ply:Name() .. "\"")
end
end
table.sort(names)
return names
end)
-- Severe lagspikes can detach the source entity from its lua, so we need to reapply things when its reattached
hook.Add("NetworkEntityCreated", "wire_hologram_rescale", function(ent)
if ent.scale and ent.DoScale then
-- ent.scale isn't present on newly created holograms, only old ones that've been hit by a lagspike
ent:DoScale()
ent:DoClip()
ent:DoVisible()
ent:DoPlayerColor()
end
end)
return -- No more client
end
-- Server
function ENT:Initialize()
self:SetSolid(SOLID_NONE)
self:SetMoveType(MOVETYPE_NONE)
self:DrawShadow(false)
end
| apache-2.0 |
kidaa/Awakening-Core3 | bin/scripts/object/tangible/mission/quest_item/hedon_istee_q3_needed.lua | 3 | 2283 | --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_hedon_istee_q3_needed = object_tangible_mission_quest_item_shared_hedon_istee_q3_needed:new {
}
ObjectTemplates:addTemplate(object_tangible_mission_quest_item_hedon_istee_q3_needed, "object/tangible/mission/quest_item/hedon_istee_q3_needed.iff")
| lgpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/object/static/particle/pt_flocking_frog.lua | 3 | 2216 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_static_particle_pt_flocking_frog = object_static_particle_shared_pt_flocking_frog:new {
}
ObjectTemplates:addTemplate(object_static_particle_pt_flocking_frog, "object/static/particle/pt_flocking_frog.iff")
| lgpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/object/tangible/hair/zabrak/hair_zabrak_female_s10.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_hair_zabrak_hair_zabrak_female_s10 = object_tangible_hair_zabrak_shared_hair_zabrak_female_s10:new {
}
ObjectTemplates:addTemplate(object_tangible_hair_zabrak_hair_zabrak_female_s10, "object/tangible/hair/zabrak/hair_zabrak_female_s10.iff")
| lgpl-3.0 |
eraffxi/darkstar | scripts/zones/Inner_Horutoto_Ruins/npcs/_5cr.lua | 2 | 2100 | -----------------------------------
-- Area: Inner Horutoto Ruins
-- NPC: _5cr (Magical Gizmo) #3
-- Involved In Mission: The Horutoto Ruins Experiment
-----------------------------------
package.loaded["scripts/zones/Inner_Horutoto_Ruins/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/missions");
require("scripts/zones/Inner_Horutoto_Ruins/TextIDs");
-----------------------------------
function onTrade(player,npc,trade)
end;
function onTrigger(player,npc)
-- The Magical Gizmo Number, this number will be compared to the random
-- value created by the mission The Horutoto Ruins Experiment, when you
-- reach the Gizmo Door and have the cutscene
local magical_gizmo_no = 3; -- of the 6
-- Check if we are on Windurst Mission 1-1
if (player:getCurrentMission(WINDURST) == THE_HORUTOTO_RUINS_EXPERIMENT and player:getVar("MissionStatus") == 2) then
-- Check if we found the correct Magical Gizmo or not
if (player:getVar("MissionStatus_rv") == magical_gizmo_no) then
player:startEvent(52);
else
if (player:getVar("MissionStatus_op3") == 2) then
-- We've already examined this
player:messageSpecial(EXAMINED_RECEPTACLE);
else
-- Opened the wrong one
player:startEvent(53);
end
end
end
return 1;
end;
function onEventUpdate(player,csid,option)
end;
function onEventFinish(player,csid,option)
-- If we just finished the cutscene for Windurst Mission 1-1
-- The cutscene that we opened the correct Magical Gizmo
if (csid == 52) then
player:setVar("MissionStatus",3);
player:setVar("MissionStatus_rv", 0);
player:addKeyItem(dsp.ki.CRACKED_MANA_ORBS);
player:messageSpecial(KEYITEM_OBTAINED,dsp.ki.CRACKED_MANA_ORBS);
elseif (csid == 53) then
-- Opened the wrong one
player:setVar("MissionStatus_op3", 2);
-- Give the message that thsi orb is not broken
player:messageSpecial(NOT_BROKEN_ORB);
end
end; | gpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/object/building/tatooine/housing_tatt_style03_small.lua | 3 | 2264 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_building_tatooine_housing_tatt_style03_small = object_building_tatooine_shared_housing_tatt_style03_small:new {
}
ObjectTemplates:addTemplate(object_building_tatooine_housing_tatt_style03_small, "object/building/tatooine/housing_tatt_style03_small.iff")
| lgpl-3.0 |
dlannan/funLuaJit | jit/v.lua | 17 | 5614 | ----------------------------------------------------------------------------
-- Verbose mode of the LuaJIT compiler.
--
-- Copyright (C) 2005-2012 Mike Pall. All rights reserved.
-- Released under the MIT license. See Copyright Notice in luajit.h
----------------------------------------------------------------------------
--
-- This module shows verbose information about the progress of the
-- JIT compiler. It prints one line for each generated trace. This module
-- is useful to see which code has been compiled or where the compiler
-- punts and falls back to the interpreter.
--
-- Example usage:
--
-- luajit -jv -e "for i=1,1000 do for j=1,1000 do end end"
-- luajit -jv=myapp.out myapp.lua
--
-- Default output is to stderr. To redirect the output to a file, pass a
-- filename as an argument (use '-' for stdout) or set the environment
-- variable LUAJIT_VERBOSEFILE. The file is overwritten every time the
-- module is started.
--
-- The output from the first example should look like this:
--
-- [TRACE 1 (command line):1 loop]
-- [TRACE 2 (1/3) (command line):1 -> 1]
--
-- The first number in each line is the internal trace number. Next are
-- the file name ('(command line)') and the line number (':1') where the
-- trace has started. Side traces also show the parent trace number and
-- the exit number where they are attached to in parentheses ('(1/3)').
-- An arrow at the end shows where the trace links to ('-> 1'), unless
-- it loops to itself.
--
-- In this case the inner loop gets hot and is traced first, generating
-- a root trace. Then the last exit from the 1st trace gets hot, too,
-- and triggers generation of the 2nd trace. The side trace follows the
-- path along the outer loop and *around* the inner loop, back to its
-- start, and then links to the 1st trace. Yes, this may seem unusual,
-- if you know how traditional compilers work. Trace compilers are full
-- of surprises like this -- have fun! :-)
--
-- Aborted traces are shown like this:
--
-- [TRACE --- foo.lua:44 -- leaving loop in root trace at foo:lua:50]
--
-- Don't worry -- trace aborts are quite common, even in programs which
-- can be fully compiled. The compiler may retry several times until it
-- finds a suitable trace.
--
-- Of course this doesn't work with features that are not-yet-implemented
-- (NYI error messages). The VM simply falls back to the interpreter. This
-- may not matter at all if the particular trace is not very high up in
-- the CPU usage profile. Oh, and the interpreter is quite fast, too.
--
-- Also check out the -jdump module, which prints all the gory details.
--
------------------------------------------------------------------------------
-- Cache some library functions and objects.
local jit = require("jit")
assert(jit.version_num == 20000, "LuaJIT core/library version mismatch")
local jutil = require("jit.util")
local vmdef = require("jit.vmdef")
local funcinfo, traceinfo = jutil.funcinfo, jutil.traceinfo
local type, format = type, string.format
local stdout, stderr = io.stdout, io.stderr
-- Active flag and output file handle.
local active, out
------------------------------------------------------------------------------
local startloc, startex
local function fmtfunc(func, pc)
local fi = funcinfo(func, pc)
if fi.loc then
return fi.loc
elseif fi.ffid then
return vmdef.ffnames[fi.ffid]
elseif fi.addr then
return format("C:%x", fi.addr)
else
return "(?)"
end
end
-- Format trace error message.
local function fmterr(err, info)
if type(err) == "number" then
if type(info) == "function" then info = fmtfunc(info) end
err = format(vmdef.traceerr[err], info)
end
return err
end
-- Dump trace states.
local function dump_trace(what, tr, func, pc, otr, oex)
if what == "start" then
startloc = fmtfunc(func, pc)
startex = otr and "("..otr.."/"..oex..") " or ""
else
if what == "abort" then
local loc = fmtfunc(func, pc)
if loc ~= startloc then
out:write(format("[TRACE --- %s%s -- %s at %s]\n",
startex, startloc, fmterr(otr, oex), loc))
else
out:write(format("[TRACE --- %s%s -- %s]\n",
startex, startloc, fmterr(otr, oex)))
end
elseif what == "stop" then
local info = traceinfo(tr)
local link, ltype = info.link, info.linktype
if ltype == "interpreter" then
out:write(format("[TRACE %3s %s%s -- fallback to interpreter]\n",
tr, startex, startloc))
elseif link == tr or link == 0 then
out:write(format("[TRACE %3s %s%s %s]\n",
tr, startex, startloc, ltype))
elseif ltype == "root" then
out:write(format("[TRACE %3s %s%s -> %d]\n",
tr, startex, startloc, link))
else
out:write(format("[TRACE %3s %s%s -> %d %s]\n",
tr, startex, startloc, link, ltype))
end
else
out:write(format("[TRACE %s]\n", what))
end
out:flush()
end
end
------------------------------------------------------------------------------
-- Detach dump handlers.
local function dumpoff()
if active then
active = false
jit.attach(dump_trace)
if out and out ~= stdout and out ~= stderr then out:close() end
out = nil
end
end
-- Open the output file and attach dump handlers.
local function dumpon(outfile)
if active then dumpoff() end
if not outfile then outfile = os.getenv("LUAJIT_VERBOSEFILE") end
if outfile then
out = outfile == "-" and stdout or assert(io.open(outfile, "w"))
else
out = stderr
end
jit.attach(dump_trace, "trace")
active = true
end
-- Public module functions.
module(...)
on = dumpon
off = dumpoff
start = dumpon -- For -j command line option.
| mit |
kidaa/Awakening-Core3 | bin/scripts/object/tangible/component/droid/combat_socket_bank.lua | 1 | 3596 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_tangible_component_droid_combat_socket_bank = object_tangible_component_droid_shared_combat_socket_bank:new {
numberExperimentalProperties = {1, 1, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
experimentalProperties = {"XX", "XX", "CD", "OQ", "CD", "OQ", "CD", "OQ", "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, 1, 1, 1, 1, 1, 1, 1, 1},
experimentalGroupTitles = {"null", "null", "exp_durability", "exp_durability", "exp_effectiveness", "null", "null", "null", "null", "null", "null", "null", "null", "null", "null", "null", "null", "null", "null", "null", "null"},
experimentalSubGroupTitles = {"null", "null", "decayrate", "hitpoints", "mechanism_quality", "storage_module", "data_module", "medical_module", "crafting_module", "cmbt_module", "repair_module", "playback_module", "struct_module", "harvest_power", "trap_bonus", "merchant_barker", "bomb_level", "stimpack_capacity", "stimpack_speed", "auto_repair_power", "entertainer_effects"},
experimentalMin = {0, 0, 1, 100, -10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
experimentalMax = {0, 0, 100, 150, 15, 0, 0, 0, 0, 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, 0, 0, 0, 0, 0},
experimentalCombineType = {0, 0, 1, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
}
ObjectTemplates:addTemplate(object_tangible_component_droid_combat_socket_bank, "object/tangible/component/droid/combat_socket_bank.iff")
| lgpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/object/tangible/wearables/armor/kashyyykian_black_mtn/armor_kashyyykian_black_mtn_chest_plate.lua | 1 | 4117 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_tangible_wearables_armor_kashyyykian_black_mtn_armor_kashyyykian_black_mtn_chest_plate = object_tangible_wearables_armor_kashyyykian_black_mtn_shared_armor_kashyyykian_black_mtn_chest_plate:new {
templateType = ARMOROBJECT,
playerRaces = { "object/creature/player/wookiee_male.iff",
"object/creature/player/wookiee_female.iff",
"object/mobile/vendor/wookiee_female.iff",
"object/mobile/vendor/wookiee_male.iff" },
-- Damage types in WeaponObject
vulnerability = HEAT + COLD + STUN + LIGHTSABER,
-- These are default Blue Frog stats
healthEncumbrance = 1,
actionEncumbrance = 1,
mindEncumbrance = 1,
-- LIGHT, MEDIUM, HEAVY
rating = LIGHT,
kinetic = 15,
energy = 15,
electricity = 15,
stun = 15,
blast = 15,
heat = 15,
cold = 15,
acid = 15,
lightSaber = 0,
numberExperimentalProperties = {1, 1, 1, 2, 2, 2, 2, 2, 2, 1, 1, 2, 1},
experimentalProperties = {"XX", "XX", "XX", "OQ", "SR", "OQ", "SR", "OQ", "UT", "MA", "OQ", "MA", "OQ", "MA", "OQ", "XX", "XX", "OQ", "SR", "XX"},
experimentalWeights = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
experimentalGroupTitles = {"null", "null", "null", "exp_durability", "exp_quality", "exp_durability", "exp_durability", "exp_durability", "exp_durability", "null", "null", "exp_resistance", "null"},
experimentalSubGroupTitles = {"null", "null", "sockets", "hit_points", "armor_effectiveness", "armor_integrity", "armor_health_encumbrance", "armor_action_encumbrance", "armor_mind_encumbrance", "armor_rating", "armor_special_type", "armor_special_effectiveness", "armor_special_integrity"},
experimentalMin = {0, 0, 0, 1000, 1, 18750, 233, 142, 370, 1, 1, 1, 18750},
experimentalMax = {0, 0, 0, 1000, 30, 31250, 143, 88, 221, 1, 1, 40, 31250},
experimentalPrecision = {0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0},
experimentalCombineType = {0, 0, 4, 1, 1, 1, 1, 1, 1, 4, 4, 4, 1},
}
ObjectTemplates:addTemplate(object_tangible_wearables_armor_kashyyykian_black_mtn_armor_kashyyykian_black_mtn_chest_plate, "object/tangible/wearables/armor/kashyyykian_black_mtn/armor_kashyyykian_black_mtn_chest_plate.iff")
| lgpl-3.0 |
isdom/kong | kong/plugins/response-ratelimiting/access.lua | 7 | 1718 | local timestamp = require "kong.tools.timestamp"
local responses = require "kong.tools.responses"
local utils = require "kong.tools.utils"
local _M = {}
local function get_identifier()
local identifier
-- Consumer is identified by ip address or authenticated_entity id
if ngx.ctx.authenticated_entity then
identifier = ngx.ctx.authenticated_entity.id
else
identifier = ngx.var.remote_addr
end
return identifier
end
local function get_current_usage(api_id, identifier, current_timestamp, limits)
local usage = {}
for k, v in pairs(limits) do -- Iterate over limit names
for lk, lv in pairs(v) do -- Iterare over periods
local current_metric, err = dao.response_ratelimiting_metrics:find_one(api_id, identifier, current_timestamp, lk, k)
if err then
return responses.send_HTTP_INTERNAL_SERVER_ERROR(err)
end
local current_usage = current_metric and current_metric.value or 0
local remaining = lv - current_usage
if not usage[k] then usage[k] = {} end
if not usage[k][lk] then usage[k][lk] = {} end
usage[k][lk].limit = lv
usage[k][lk].remaining = remaining
end
end
return usage
end
function _M.execute(conf)
if utils.table_size(conf.limits) <= 0 then
return
end
-- Load info
local current_timestamp = timestamp.get_utc()
ngx.ctx.current_timestamp = current_timestamp -- For later use
local api_id = ngx.ctx.api.id
local identifier = get_identifier()
ngx.ctx.identifier = identifier -- For later use
-- Load current metric for configured period
local usage = get_current_usage(api_id, identifier, current_timestamp, conf.limits)
ngx.ctx.usage = usage -- For later use
end
return _M
| apache-2.0 |
kidaa/Awakening-Core3 | bin/scripts/object/tangible/deed/player_house_deed/serverobjects.lua | 3 | 4329 | --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/deed/player_house_deed/corellia_house_large_deed.lua")
includeFile("tangible/deed/player_house_deed/corellia_house_large_style_02_deed.lua")
includeFile("tangible/deed/player_house_deed/corellia_house_medium_deed.lua")
includeFile("tangible/deed/player_house_deed/corellia_house_medium_style_02_deed.lua")
includeFile("tangible/deed/player_house_deed/corellia_house_small_deed.lua")
includeFile("tangible/deed/player_house_deed/corellia_house_small_floor_02_deed.lua")
includeFile("tangible/deed/player_house_deed/corellia_house_small_style_02_deed.lua")
includeFile("tangible/deed/player_house_deed/corellia_house_small_style_02_floor_02_deed.lua")
includeFile("tangible/deed/player_house_deed/generic_house_large_deed.lua")
includeFile("tangible/deed/player_house_deed/generic_house_large_style_02_deed.lua")
includeFile("tangible/deed/player_house_deed/generic_house_medium_deed.lua")
includeFile("tangible/deed/player_house_deed/generic_house_medium_style_02_deed.lua")
includeFile("tangible/deed/player_house_deed/generic_house_small_deed.lua")
includeFile("tangible/deed/player_house_deed/generic_house_small_floor_02_deed.lua")
includeFile("tangible/deed/player_house_deed/generic_house_small_style_02_deed.lua")
includeFile("tangible/deed/player_house_deed/generic_house_small_style_02_floor_02_deed.lua")
includeFile("tangible/deed/player_house_deed/merchant_tent_style_01_deed.lua")
includeFile("tangible/deed/player_house_deed/merchant_tent_style_02_deed.lua")
includeFile("tangible/deed/player_house_deed/merchant_tent_style_03_deed.lua")
includeFile("tangible/deed/player_house_deed/naboo_house_large_deed.lua")
includeFile("tangible/deed/player_house_deed/naboo_house_medium_deed.lua")
includeFile("tangible/deed/player_house_deed/naboo_house_medium_style_02_deed.lua")
includeFile("tangible/deed/player_house_deed/naboo_house_small_deed.lua")
includeFile("tangible/deed/player_house_deed/naboo_house_small_style_02_deed.lua")
includeFile("tangible/deed/player_house_deed/tatooine_house_large_deed.lua")
includeFile("tangible/deed/player_house_deed/tatooine_house_medium_deed.lua")
includeFile("tangible/deed/player_house_deed/tatooine_house_small_deed.lua")
includeFile("tangible/deed/player_house_deed/tatooine_house_small_style_02_deed.lua")
| lgpl-3.0 |
AntonioModer/knife | knife/memoize.lua | 7 | 1961 | local loadstring = _G.loadstring or _G.load
local weakKeys = { __mode = 'k' }
local cache = setmetatable({}, weakKeys)
local resultsKey = {}
local nilKey = {}
local function getMetaCall (callable)
local meta = getmetatable(callable)
return meta and meta.__call
end
local tupleConstructorCache = {}
local function buildTupleConstructor (n)
if tupleConstructorCache[n] then
return tupleConstructorCache[n]
end
local t = {}
for i = 1, n do
t[i] = "a" .. i
end
local args = table.concat(t, ',')
local ctor = loadstring('return function(' .. args ..
') return function() return ' .. args .. ' end end')()
tupleConstructorCache[n] = ctor
return ctor
end
local function tuple (...)
return buildTupleConstructor(select('#', ...))(...)
end
return function (callable)
local metaCall = getMetaCall(callable)
if type(callable) ~= 'function' and not metaCall then
error 'Attempted to memoize a non-callable value.'
end
cache[callable] = setmetatable({}, weakKeys)
local function run (...)
local node = cache[callable]
local argc = select('#', ...)
for i = 1, argc do
local key = select(i, ...)
if key == nil then
key = nilKey
end
if not node[key] then
node[key] = setmetatable({}, weakKeys)
end
node = node[key]
end
if not node[resultsKey] then
node[resultsKey] = tuple(callable(...))
end
return node[resultsKey]()
end
if metaCall then
return function (...)
local call = getMetaCall(callable)
if call ~= metaCall then
cache[callable] = setmetatable({}, weakKeys)
metaCall = call
end
return run(...)
end, cache, resultsKey, nilKey
end
return run, cache, resultsKey, nilKey
end
| mit |
birkett/cuberite | Server/Plugins/APIDump/Hooks/OnBlockToPickups.lua | 36 | 2438 | return
{
HOOK_BLOCK_TO_PICKUPS =
{
CalledWhen = "A block is about to be dug ({{cPlayer|player}}, {{cEntity|entity}} or natural reason), plugins may override what pickups that will produce.",
DefaultFnName = "OnBlockToPickups", -- also used as pagename
Desc = [[
This callback gets called whenever a block is about to be dug. This includes {{cPlayer|players}}
digging blocks, entities causing blocks to disappear ({{cTNTEntity|TNT}}, Endermen) and natural
causes (water washing away a block). Plugins may override the amount and kinds of pickups this
action produces.
]],
Params =
{
{ Name = "World", Type = "{{cWorld}}", Notes = "The world in which the block resides" },
{ Name = "Digger", Type = "{{cEntity}} descendant", Notes = "The entity causing the digging. May be a {{cPlayer}}, {{cTNTEntity}} or even nil (natural causes)" },
{ Name = "BlockX", Type = "number", Notes = "X-coord of the block" },
{ Name = "BlockY", Type = "number", Notes = "Y-coord of the block" },
{ Name = "BlockZ", Type = "number", Notes = "Z-coord of the block" },
{ Name = "BlockType", Type = "BLOCKTYPE", Notes = "Block type of the block" },
{ Name = "BlockMeta", Type = "NIBBLETYPE", Notes = "Block meta of the block" },
{ Name = "Pickups", Type = "{{cItems}}", Notes = "Items that will be spawned as pickups" },
},
Returns = [[
If the function returns false or no value, the next callback in the hook chain will be called. If
the function returns true, no other callbacks in the chain will be called.</p>
<p>
Either way, the server will then spawn pickups specified in the Pickups parameter, so to disable
pickups, you need to Clear the object first, then return true.
]],
CodeExamples =
{
{
Title = "Modify pickups",
Desc = "This example callback function makes tall grass drop diamonds when digged by natural causes (washed away by water).",
Code = [[
function OnBlockToPickups(a_World, a_Digger, a_BlockX, a_BlockY, a_BlockZ, a_BlockType, a_BlockMeta, a_Pickups)
if (a_Digger ~= nil) then
-- Not a natural cause
return false;
end
if (a_BlockType ~= E_BLOCK_TALL_GRASS) then
-- Not a tall grass being washed away
return false;
end
-- Remove all pickups suggested by Cuberite:
a_Pickups:Clear();
-- Drop a diamond:
a_Pickups:Add(cItem(E_ITEM_DIAMOND));
return true;
end;
]],
},
} , -- CodeExamples
}, -- HOOK_BLOCK_TO_PICKUPS
}
| apache-2.0 |
kidaa/Awakening-Core3 | bin/scripts/object/tangible/component/weapon/blaster_barrel_wp_muzzle_sm_s05_lg.lua | 3 | 2328 | --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_weapon_blaster_barrel_wp_muzzle_sm_s05_lg = object_tangible_component_weapon_shared_blaster_barrel_wp_muzzle_sm_s05_lg:new {
}
ObjectTemplates:addTemplate(object_tangible_component_weapon_blaster_barrel_wp_muzzle_sm_s05_lg, "object/tangible/component/weapon/blaster_barrel_wp_muzzle_sm_s05_lg.iff")
| lgpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/object/static/space/asteroid/asteroid_small_02.lua | 3 | 2244 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_static_space_asteroid_asteroid_small_02 = object_static_space_asteroid_shared_asteroid_small_02:new {
}
ObjectTemplates:addTemplate(object_static_space_asteroid_asteroid_small_02, "object/static/space/asteroid/asteroid_small_02.iff")
| lgpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/object/cell/objects.lua | 3 | 3183 | --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_cell_shared_cell = SharedCellObjectTemplate:new {
clientTemplateFileName = "object/cell/shared_cell.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "",
arrangementDescriptorFilename = "",
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 0,
collisionActionBlockFlags = 0,
collisionActionFlags = 0,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 0,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 0,
detailedDescription = "",
gameObjectType = 0,
locationReservationRadius = 0,
lookAtText = "",
noBuildRadius = 0,
objectName = "",
onlyVisibleInTools = 0,
portalLayoutFilename = "",
scale = 0,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "",
snapToTerrain = 0,
surfaceType = 0,
totalCellNumber = 0,
clientObjectCRC = 206832110,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/cell/base/shared_base_cell.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_cell_shared_cell, "object/cell/shared_cell.iff")
| lgpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/object/draft_schematic/armor/component/armor_layer_environmental.lua | 2 | 2316 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_draft_schematic_armor_component_armor_layer_environmental = object_draft_schematic_armor_component_shared_armor_layer_environmental:new {
}
ObjectTemplates:addTemplate(object_draft_schematic_armor_component_armor_layer_environmental, "object/draft_schematic/armor/component/armor_layer_environmental.iff")
| lgpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/object/mobile/skeleton/kaadu.lua | 3 | 2172 | --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_skeleton_kaadu = object_mobile_skeleton_shared_kaadu:new {
}
ObjectTemplates:addTemplate(object_mobile_skeleton_kaadu, "object/mobile/skeleton/kaadu.iff")
| lgpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/object/static/item/wp_rifle_bowcaster_combined.lua | 3 | 2244 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_static_item_wp_rifle_bowcaster_combined = object_static_item_shared_wp_rifle_bowcaster_combined:new {
}
ObjectTemplates:addTemplate(object_static_item_wp_rifle_bowcaster_combined, "object/static/item/wp_rifle_bowcaster_combined.iff")
| lgpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/commands/jediMindTrick.lua | 4 | 2132 | --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
JediMindTrickCommand = {
name = "jedimindtrick",
}
AddCommand(JediMindTrickCommand)
| lgpl-3.0 |
widelands/widelands | test/maps/all_tribes.wmf/scripting/test_atlanteans.lua | 1 | 18917 | -- This script places buildings of all types.
-- Split up into multiple functions to make debugging easier.
-- Main function is on the bottom.
local function init_militarysites(player, sf, total_previous_buildings)
print("============================================")
print("Military")
print("--------------------------------------------")
-- Get some territory
place_initial_militarysites(map, sf, player, "atlanteans_castle")
-- Military small
place_safe_building(player, "atlanteans_scouts_house", sf, 21, 16)
place_safe_building(player, "atlanteans_scouts_house", sf, 13, 18)
place_militarysite(player, "atlanteans_guardhouse", sf, 25, 8)
place_militarysite(player, "atlanteans_guardhouse", sf, 24, -1)
place_militarysite(player, "atlanteans_guardhouse", sf, 19, 500)
place_militarysite(player, "atlanteans_tower_small", sf, 16, 499)
place_militarysite(player, "atlanteans_tower_small", sf, 15, 495)
place_militarysite(player, "atlanteans_tower_small", sf, 24, 501)
-- Military medium
place_militarysite(player, "atlanteans_guardhall", sf, 9, 499)
place_militarysite(player, "atlanteans_guardhall", sf, 6, 28)
place_militarysite(player, "atlanteans_tower", sf, 509, 23)
place_militarysite(player, "atlanteans_tower", sf, 505, 494)
place_militarysite(player, "atlanteans_tower_high", sf, 491, 23)
place_militarysite(player, "atlanteans_tower_high", sf, 23, 12)
-- Military big
place_militarysite(player, "atlanteans_castle", sf, 503, 500)
place_militarysite(player, "atlanteans_castle", sf, 11, 28)
place_militarysite(player, "atlanteans_castle", sf, 507, 26)
return count_buildings(player, total_previous_buildings, 29)
end
local function init_warehouses(player, sf, total_previous_buildings)
print("============================================")
print("Warehouses")
print("--------------------------------------------")
-- Ports and warehouses
place_warehouse(player, "atlanteans_port", sf, 11, 509)
building = place_warehouse(player, "atlanteans_port", sf, 18, 13)
connected_road("normal", player, building.flag, "br,bl,bl|br,bl")
building = place_warehouse(player, "atlanteans_warehouse", sf, 498, 501)
connected_road("normal", player, building.flag, "r,br,r")
building = place_warehouse(player, "atlanteans_warehouse", sf, 24, 10)
connected_road("normal", player, building.flag, "tr,tr|tr,tr|tl,tr")
connected_road("normal", player, building.flag, "bl,bl|bl,bl|bl,bl|bl,bl")
building = place_warehouse(player, "atlanteans_warehouse", sf, 11, 495)
connected_road("normal", player, building.flag, "br,br,br|br,br|br,br|br,br")
return count_buildings(player, total_previous_buildings, 5)
end
local function init_shipconstruction(player, sf, total_previous_buildings)
print("============================================")
print("Ships and ferries")
print("--------------------------------------------")
-- Shipyards and ferry yards
building = place_safe_building(player, "atlanteans_shipyard", sf, 15, 18)
building = place_safe_building(player, "atlanteans_shipyard", sf, 8, 510)
connected_road("normal", player, building.flag, "bl,br")
building = place_safe_building(player, "atlanteans_ferry_yard", sf, 8, 13)
connected_road("normal", player, building.flag, "bl,bl,bl|bl,bl")
building = place_safe_building(player, "atlanteans_ferry_yard", sf, 18, -1)
connected_road("normal", player, building.flag, "tr,r|tr,r")
-- Waterway
connected_road("normal", player, building.flag, "bl,bl")
local flag = get_safe_field(player, sf, 17, 2).immovable
assert_not_nil(flag)
connected_road("waterway", player, flag, "bl,br,br,br,br,br,br,br")
flag = get_safe_field(player, sf, 20, 10).immovable
assert_not_nil(flag)
connected_road("busy", player, flag, "bl,bl,bl,bl")
return count_buildings(player, total_previous_buildings, 4)
end
local function init_buildingmaterials(player, sf, total_previous_buildings)
print("============================================")
print("Buildingmaterials")
print("--------------------------------------------")
-- Building materials small
-- (near rocks)
building = place_safe_building(player, "atlanteans_quarry", sf, 508, 502)
connected_road("normal", player, building.flag, "r,r,r")
connected_road("normal", player, building.flag, "br,br|br,br,r")
building = place_safe_building(player, "atlanteans_quarry", sf, 511, 502)
connected_road("normal", player, building.flag, "r,r,r")
connected_road("normal", player, building.flag, "br,br|br,br|br,bl|br,br|bl,br")
-- (near trees)
building = place_safe_building(player, "atlanteans_woodcutters_house", sf, 2, 502)
connected_road("normal", player, building.flag, "r,r")
building = place_safe_building(player, "atlanteans_foresters_house", sf, 4, 502)
connected_road("normal", player, building.flag, "tr,tr")
building = place_safe_building(player, "atlanteans_woodcutters_house", sf, 5, 500)
connected_road("normal", player, building.flag, "tr,tl")
building = place_safe_building(player, "atlanteans_foresters_house", sf, 5, 498)
connected_road("normal", player, building.flag, "r,r")
building = place_safe_building(player, "atlanteans_gold_spinning_mill", sf, 7, 498)
connected_road("normal", player, building.flag, "tr,r")
building = place_safe_building(player, "atlanteans_gold_spinning_mill", sf, 9, 497)
connected_road("normal", player, building.flag, "tr,tr,r")
-- Building materials medium
building = place_safe_building(player, "atlanteans_sawmill", sf, 7, 502)
connected_road("normal", player, building.flag, "l,l,l")
connected_road("normal", player, building.flag, "tr,tl|tl,tr")
building = place_safe_building(player, "atlanteans_sawmill", sf, 3, 505)
connected_road("normal", player, building.flag, "tr,tr,tr")
connected_road("normal", player, building.flag, "l,bl")
building = place_safe_building(player, "atlanteans_sawmill", sf, 511, 506)
connected_road("normal", player, building.flag, "r,r")
building = place_safe_building(player, "atlanteans_sawmill", sf, 508, 505)
connected_road("normal", player, building.flag, "tr,r")
building = place_safe_building(player, "atlanteans_charcoal_kiln", sf, 511, 509)
connected_road("normal", player, building.flag, "tr,tr,tl")
connected_road("normal", player, building.flag, "bl,bl,br")
building = place_safe_building(player, "atlanteans_charcoal_kiln", sf, 4, 508)
connected_road("normal", player, building.flag, "tr,tr|tl,tr|tl,tl")
connected_road("normal", player, building.flag, "l,l,l")
building = place_safe_building(player, "atlanteans_charcoal_kiln", sf, 1, 508)
building = place_safe_building(player, "atlanteans_charcoal_kiln", sf, 508, 0)
return count_buildings(player, total_previous_buildings, 16)
end
local function init_food_and_transport(player, sf, total_previous_buildings)
print("============================================")
print("Food and transport")
print("--------------------------------------------")
-- Food and transport small
building = place_safe_building(player, "atlanteans_well", sf, 504, 0)
building = place_safe_building(player, "atlanteans_well", sf, 4, 0)
building = place_safe_building(player, "atlanteans_well", sf, 510, 11)
-- (near water)
building = place_safe_building(player, "atlanteans_fishers_house", sf, 3, 3)
connected_road("normal", player, building.flag, "tr,tl,tl")
building = place_safe_building(player, "atlanteans_fishbreeders_house", sf, 2, 5)
connected_road("normal", player, building.flag, "l,l,tl")
building = place_safe_building(player, "atlanteans_fishers_house", sf, 3, 9)
connected_road("normal", player, building.flag, "bl,bl|bl,bl")
building = place_safe_building(player, "atlanteans_fishbreeders_house", sf, 5, 12)
connected_road("normal", player, building.flag, "bl,bl,bl|bl,bl")
-- (near animals)
building = place_safe_building(player, "atlanteans_hunters_house", sf, 506, 502)
connected_road("normal", player, building.flag, "r,r")
building = place_safe_building(player, "atlanteans_hunters_house", sf, 504, 502)
connected_road("normal", player, building.flag, "r,r")
building = place_safe_building(player, "atlanteans_hunters_house", sf, 502, 502)
connected_road("normal", player, building.flag, "r,r")
building = place_safe_building(player, "atlanteans_hunters_house", sf, 500, 502)
connected_road("normal", player, building.flag, "r,r")
-- Food and transport medium
building = place_safe_building(player, "atlanteans_bakery", sf, 510, 14)
connected_road("normal", player, building.flag, "tr,tl,tl")
building = place_safe_building(player, "atlanteans_bakery", sf, 0, 18)
connected_road("normal", player, building.flag, "tr,tl,tl")
building = place_safe_building(player, "atlanteans_smokery", sf, 3, 26)
connected_road("normal", player, building.flag, "l,l")
building = place_safe_building(player, "atlanteans_smokery", sf, 5, 26)
connected_road("normal", player, building.flag, "l,l")
building = place_safe_building(player, "atlanteans_mill", sf, 7, 26)
connected_road("normal", player, building.flag, "l,l")
building = place_safe_building(player, "atlanteans_mill", sf, 9, 26)
connected_road("normal", player, building.flag, "l,l")
building = place_safe_building(player, "atlanteans_bakery", sf, 503, 22)
connected_road("normal", player, building.flag, "r,tr,tr")
building = place_safe_building(player, "atlanteans_smokery", sf, 501, 22)
connected_road("normal", player, building.flag, "r,r")
building = place_safe_building(player, "atlanteans_mill", sf, 499, 22)
connected_road("normal", player, building.flag, "r,r")
building = place_safe_building(player, "atlanteans_bakery", sf, 497, 22)
connected_road("normal", player, building.flag, "r,r")
building = place_safe_building(player, "atlanteans_smokery", sf, 495, 22)
connected_road("normal", player, building.flag, "r,r")
building = place_safe_building(player, "atlanteans_mill", sf, 493, 22)
connected_road("normal", player, building.flag, "r,r")
-- Food and transport big
building = place_safe_building(player, "atlanteans_farm", sf, 505, 20)
connected_road("normal", player, building.flag, "tr,tr|tr,tr")
building = place_safe_building(player, "atlanteans_farm", sf, 507, 16)
connected_road("normal", player, building.flag, "tr,tr|tl,tr")
building = place_safe_building(player, "atlanteans_farm", sf, 509, 21)
connected_road("normal", player, building.flag, "tr,tr|tr,tr")
building = place_safe_building(player, "atlanteans_farm", sf, 511, 17)
connected_road("normal", player, building.flag, "tr,tr|tr,tr")
building = place_safe_building(player, "atlanteans_blackroot_farm", sf, 511, 25)
connected_road("normal", player, building.flag, "tr,tr|tr,tr")
building = place_safe_building(player, "atlanteans_blackroot_farm", sf, 1, 21)
connected_road("normal", player, building.flag, "tr,tr|tr,tr")
building = place_safe_building(player, "atlanteans_spiderfarm", sf, 1, 26)
connected_road("normal", player, building.flag, "tr,tr|tr,tr")
building = place_safe_building(player, "atlanteans_spiderfarm", sf, 3, 22)
connected_road("normal", player, building.flag, "tr,tr|tr,tr")
building = place_safe_building(player, "atlanteans_horsefarm", sf, 7, 21)
connected_road("normal", player, building.flag, "l,l,tl")
building = place_safe_building(player, "atlanteans_horsefarm", sf, 9, 22)
connected_road("normal", player, building.flag, "l,l,tl")
connected_road("normal", player, building.flag, "tr,tr|r,tr")
building = place_safe_building(player, "atlanteans_weaving_mill", sf, 4, 15)
building = place_safe_building(player, "atlanteans_weaving_mill", sf, 2, 11)
return count_buildings(player, total_previous_buildings, 35)
end
local function init_tools_and_training(player, sf, total_previous_buildings)
print("============================================")
print("Tools and training")
print("--------------------------------------------")
-- Tools, weapons and training sites medium
building = place_safe_building(player, "atlanteans_smelting_works", sf, 506, 12)
building = place_safe_building(player, "atlanteans_smelting_works", sf, 508, 12)
building = place_safe_building(player, "atlanteans_toolsmithy", sf, 496, 18)
connected_road("normal", player, building.flag, "tr,tr")
building = place_safe_building(player, "atlanteans_toolsmithy", sf, 497, 16)
connected_road("normal", player, building.flag, "tr,tr")
building = place_safe_building(player, "atlanteans_weaponsmithy", sf, 498, 18)
connected_road("normal", player, building.flag, "tr,tr")
building = place_safe_building(player, "atlanteans_weaponsmithy", sf, 499, 16)
connected_road("normal", player, building.flag, "tr,tr")
building = place_safe_building(player, "atlanteans_armorsmithy", sf, 500, 18)
connected_road("normal", player, building.flag, "tr,tr")
building = place_safe_building(player, "atlanteans_armorsmithy", sf, 501, 16)
connected_road("normal", player, building.flag, "tr,tr")
building = place_safe_building(player, "atlanteans_barracks", sf, 502, 18)
connected_road("normal", player, building.flag, "tr,tr")
building = place_safe_building(player, "atlanteans_barracks", sf, 503, 16)
connected_road("normal", player, building.flag, "tr,tr")
building = place_safe_building(player, "atlanteans_dungeon", sf, 495, 507)
connected_road("normal", player, building.flag, "bl,bl,l")
connected_road("normal", player, building.flag, "tr,tr,tl,tr")
building = place_safe_building(player, "atlanteans_dungeon", sf, 496, 503)
connected_road("normal", player, building.flag, "tr,r,tr")
building = place_safe_building(player, "atlanteans_dungeon", sf, 496, -1)
connected_road("normal", player, building.flag, "tr,r|tr,r")
-- Tools, weapons and training sites big
building = place_safe_building(player, "atlanteans_labyrinth", sf, 493, 509)
connected_road("normal", player, building.flag, "br,br|r,r")
building = place_safe_building(player, "atlanteans_labyrinth", sf, 502, 509)
building = place_safe_building(player, "atlanteans_labyrinth", sf, 502, 506)
connected_road("normal", player, building.flag, "br,bl,bl")
return count_buildings(player, total_previous_buildings, 16)
end
local function init_mines(player, sf, total_previous_buildings)
print("============================================")
print("Mines")
print("--------------------------------------------")
-- Mines
building = place_safe_building(player, "atlanteans_crystalmine", sf, 504, 4)
connected_road("normal", player, building.flag, "tr,tr|tr,tr")
connected_road("normal", player, building.flag, "br,r")
building = place_safe_building(player, "atlanteans_crystalmine", sf, 506, 5)
connected_road("normal", player, building.flag, "tr,tr,tr|tr,tr")
building = place_safe_building(player, "atlanteans_crystalmine", sf, 505, 8)
connected_road("normal", player, building.flag, "tr,tr,tl")
building = place_safe_building(player, "atlanteans_crystalmine", sf, 503, 8)
connected_road("normal", player, building.flag, "r,r")
building = place_safe_building(player, "atlanteans_coalmine", sf, 500, 1)
connected_road("normal", player, building.flag, "tr,tr|tr,tr")
building = place_safe_building(player, "atlanteans_coalmine", sf, 498, 2)
connected_road("normal", player, building.flag, "tr,r")
building = place_safe_building(player, "atlanteans_coalmine", sf, 497, 3)
connected_road("normal", player, building.flag, "r,tr")
building = place_safe_building(player, "atlanteans_coalmine", sf, 502, 3)
connected_road("normal", player, building.flag, "l,tl,tl")
building = place_safe_building(player, "atlanteans_ironmine", sf, 501, 8)
connected_road("normal", player, building.flag, "r,r")
building = place_safe_building(player, "atlanteans_ironmine", sf, 499, 8)
connected_road("normal", player, building.flag, "r,r")
building = place_safe_building(player, "atlanteans_ironmine", sf, 497, 8)
connected_road("normal", player, building.flag, "r,r")
building = place_safe_building(player, "atlanteans_ironmine", sf, 500, 12)
connected_road("normal", player, building.flag, "tr,tr,tr,tl")
connected_road("normal", player, building.flag, "br,bl")
building = place_safe_building(player, "atlanteans_goldmine", sf, 495, 8)
connected_road("normal", player, building.flag, "r,r")
building = place_safe_building(player, "atlanteans_goldmine", sf, 493, 8)
connected_road("normal", player, building.flag, "r,r")
building = place_safe_building(player, "atlanteans_goldmine", sf, 495, 4)
connected_road("normal", player, building.flag, "r,tr")
building = place_safe_building(player, "atlanteans_goldmine", sf, 493, 4)
connected_road("normal", player, building.flag, "r,r")
connected_road("normal", player, building.flag, "l,l,tl")
return count_buildings(player, total_previous_buildings, 16)
end
-- Place buildings for Atlantean tribe
function init_atlanteans(player)
assert_equal("atlanteans", player.tribe.name)
local sf = wl.Game().map.player_slots[player.number].starting_field
map = wl.Game().map
-- Headquarters
place_warehouse(player, "atlanteans_headquarters", sf, 0, 0)
local total_buildings = init_militarysites(player, sf, 1)
total_buildings = init_warehouses(player, sf, total_buildings)
total_buildings = init_shipconstruction(player, sf, total_buildings)
total_buildings = init_buildingmaterials(player, sf, total_buildings)
total_buildings = init_food_and_transport(player, sf, total_buildings)
total_buildings = init_tools_and_training(player, sf, total_buildings)
total_buildings = init_mines(player, sf, total_buildings)
-- Construction
player:place_building("atlanteans_labyrinth", map:get_field((sf.x + 510) % 512, (sf.y + 3) % 512), true, true)
-- Test ships
place_player_ship(player.number)
end
-- Run the tests
run(function()
local playernumber = 3
local expected_number_of_buildings = 122
print("Placing buildings for Player 3")
init_atlanteans(game.players[playernumber])
-- Verify that nothing went wrong with placing the buildings,
-- and that a building of each type has been placed.
verify_buildings(playernumber, expected_number_of_buildings)
-- Sleep a bit so the tribe units can run some programs
sleep_with_fps(30 * 10)
-- Test saveloading and verify the buildings again
stable_save(game, "atlantean_tribe", 1000)
-- Did buildings saveload OK?
verify_buildings(playernumber, expected_number_of_buildings)
print("# All Tests passed.")
mapview:close()
end)
| gpl-2.0 |
hayword/tfatf_epgp | LibGuildStorage-1.2.lua | 3 | 13402 | -- This library handles storing information in officer notes. It
-- streamlines and optimizes access to these notes. It should be noted
-- that the library does not have correct information until
-- PLAYER_ENTERING_WORLD is fired (for Ace authors this is after OnInitialize
-- is called). The API is as follows:
--
-- GetNote(name): Returns the officer note of member 'name'
--
-- SetNote(name, note): Sets the officer note of member 'name' to
-- 'note'
--
-- GetClass(name): Returns the class of member 'name'
--
-- GetGuildInfo(): Returns the guild info text
--
-- IsCurrentState(): Return true if the state of the library is current.
--
-- Snapshot(table) -- DEPRECATED: Write out snapshot in the table
-- provided. table.guild_info will contain the epgp clause in guild
-- info and table.notes a table of {name, class, note}.
--
-- The library also fires the following messages, which you can
-- register for through RegisterCallback and unregister through
-- UnregisterCallback. You can also unregister all messages through
-- UnregisterAllCallbacks.
--
-- GuildInfoChanged(info): Fired when guild info has changed since its
-- previous state. The info is the new guild info.
--
-- GuildNoteChanged(name, note): Fired when a guild note changes. The
-- name is the name of the member of which the note changed and the
-- note is the new note.
--
-- StateChanged(): Fired when the state of the guild storage cache has
-- changed.
--
-- SetOutsidersEnabled(isOutsidersEnabled): Allows developers to enable/
-- disable the outsiders patch, which allows raidleaders to store EPGP
-- data of non-guildies in a lvl 1 character which is in guild.
local MAJOR_VERSION = "LibGuildStorage-1.2"
local MINOR_VERSION = tonumber(("$Revision$"):match("%d+")) or 0
local ADDON_MESSAGE_PREFIX = "GuildStorage10"
RegisterAddonMessagePrefix(ADDON_MESSAGE_PREFIX)
local lib, oldMinor = LibStub:NewLibrary(MAJOR_VERSION, MINOR_VERSION)
if not lib then return end
local Debug = LibStub("LibDebug-1.0")
local GUILDFRAMEVISIBLE = false
local OUTSIDERSENABLED = false
local CallbackHandler = LibStub("CallbackHandler-1.0")
if not lib.callbacks then
lib.callbacks = CallbackHandler:New(lib)
end
local callbacks = lib.callbacks
local AceHook = LibStub("AceHook-3.0")
AceHook:Embed(lib)
lib:UnhookAll()
if lib.frame then
lib.frame:UnregisterAllEvents()
lib.frame:SetScript("OnEvent", nil)
lib.frame:SetScript("OnUpdate", nil)
else
lib.frame = CreateFrame("Frame", MAJOR_VERSION .. "_Frame")
end
local frame = lib.frame
frame:Show()
frame:SetScript("OnEvent",
function(self, event, ...)
lib[event](lib, ...)
end)
local SendAddonMessage = _G.SendAddonMessage
if ChatThrottleLib then
SendAddonMessage = function(...)
ChatThrottleLib:SendAddonMessage(
"ALERT", ADDON_MESSAGE_PREFIX, ...)
end
end
local SetState
-- state of the cache: UNINITIALIZED, STALE,
-- STALE_WAITING_FOR_ROSTER_UPDATE, CURRENT, FLUSHING, REMOTE_FLUSHING
--
-- A complete graph of state changes is found in LibGuildStorage-1.0.dot
local state = "STALE_WAITING_FOR_ROSTER_UPDATE"
local initialized
local index
-- name -> {note=, seen=, class=}
local cache = {}
-- pending notes to write out
local pending_note = {}
local guild_info = ""
function lib:GetNote(name)
local e = cache[name]
if e then return e.note end
end
function lib:SetNote(name, note)
local e = cache[name]
if e then
if pending_note[name] then
DEFAULT_CHAT_FRAME:AddMessage(
string.format("Ignoring attempt to set note before flushing pending "..
"note for %s! "..
"current=[%s] pending=[%s] new[%s]. "..
"Please report this bug along with the actions that "..
"lead to this on http://epgp.googlecode.com",
tostring(name),
tostring(e.note),
tostring(pending_note[name]),
tostring(note)))
else
pending_note[name] = note
SetState("FLUSHING")
end
return e.note
end
end
function lib:GetClass(name)
local e = cache[name]
if e then return e.class end
end
function lib:GetRank(name)
local e = cache[name]
if e then return e.rank end
end
function lib:GetGuildInfo()
return guild_info
end
function lib:IsCurrentState()
return state == "CURRENT"
end
-- This is kept for historical reasons. See:
-- http://code.google.com/p/epgp/issues/detail?id=350.
function lib:Snapshot(t)
assert(type(t) == "table")
t.guild_info = guild_info:match("%-EPGP%-\n(.*)\n\%-EPGP%-")
t.roster_info = {}
for name,info in pairs(cache) do
table.insert(t.roster_info, {name, info.class, info.note})
end
end
-- This function allows users to enable or disable the outsiders patch
function lib:SetOutsidersEnabled(isOutsidersEnabled)
-- Dont do anything if the boolean is the same
if (OUTSIDERSENABLED == isOutsidersEnabled) then
return
end
OUTSIDERSENABLED = isOutsidersEnabled
Debug("outsider changed, now is ", OUTSIDERSENABLED)
-- Force reloading of guildnotes
index = nil
SetState("STALE")
end
--
-- Event handlers
--
frame:RegisterEvent("PLAYER_GUILD_UPDATE")
frame:RegisterEvent("GUILD_ROSTER_UPDATE")
frame:RegisterEvent("CHAT_MSG_ADDON")
frame:RegisterEvent("PLAYER_ENTERING_WORLD")
function lib:CHAT_MSG_ADDON(prefix, msg, type, sender)
Debug("CHAT_MSG_ADDON: %s, %s, %s, %s", prefix, msg, type, sender)
if prefix ~= MAJOR_VERSION or sender == UnitName("player") then return end
if msg == "CHANGES_PENDING" then
SetState("REMOTE_FLUSHING")
elseif msg == "CHANGES_FLUSHED" then
SetState("STALE_WAITING_FOR_ROSTER_UPDATE")
end
end
function lib:PLAYER_GUILD_UPDATE()
if IsInGuild() then
frame:Show()
else
frame:Hide()
end
SetState("STALE_WAITING_FOR_ROSTER_UPDATE")
end
function lib:PLAYER_ENTERING_WORLD()
lib:PLAYER_GUILD_UPDATE()
end
function lib:GUILD_ROSTER_UPDATE(loc)
Debug("GUILD_ROSTER_UPDATE(%s)", tostring(loc))
if loc then
SetState("FLUSHING") -- SetState("STALE_WAITING_FOR_ROSTER_UPDATE")
else
if state ~= "UNINITIALIZED" then
SetState("STALE")
index = nil
end
end
end
--
-- Locally defined functions
--
local valid_transitions = {
UNINITIALIZED = {
CURRENT = true,
},
STALE = {
CURRENT = true,
REMOTE_FLUSHING = true,
STALE_WAITING_FOR_ROSTER_UPDATE = true,
},
STALE_WAITING_FOR_ROSTER_UPDATE = {
STALE = true,
FLUSHING = true,
},
CURRENT = {
FLUSHING = true,
REMOTE_FLUSHING = true,
STALE = true,
},
FLUSHING = {
STALE_WAITING_FOR_ROSTER_UPDATE = true,
},
REMOTE_FLUSHING = {
STALE_WAITING_FOR_ROSTER_UPDATE = true,
},
}
function SetState(new_state)
if state == new_state then return end
if not valid_transitions[state][new_state] then
Debug("Ignoring state change %s -> %s", state, new_state)
return
else
Debug("StateChanged: %s -> %s", state, new_state)
state = new_state
if new_state == FLUSHING then
SendAddonMessage("CHANGES_PENDING", "GUILD")
end
callbacks:Fire("StateChanged")
end
end
local function ForceShowOffline()
-- We need to always show offline members in the roster otherwise this
-- lib won't work.
if GUILDFRAMEVISIBLE then
return true
end
SetGuildRosterShowOffline(true)
return false
end
local function Frame_OnUpdate(self, elapsed)
local startTime = debugprofilestop()
if ForceShowOffline() then
return
end
if state == "CURRENT" then
return
end
if state == "STALE_WAITING_FOR_ROSTER_UPDATE" then
GuildRoster()
return
end
local num_guild_members = GetNumGuildMembers()
-- Sometimes GetNumGuildMembers returns 0. In this case return now,
-- so that we call it again and get a proper value.
if num_guild_members == 0 then return end
if not index or index >= num_guild_members then
index = 1
end
-- Check guild info for changes.
if index == 1 then
local new_guild_info = GetGuildInfoText() or ""
if new_guild_info ~= guild_info then
guild_info = new_guild_info
callbacks:Fire("GuildInfoChanged", guild_info)
end
end
-- Read up to 100 members at a time.
local last_index = math.min(index + 100, num_guild_members)
if not initialized then last_index = num_guild_members end
Debug("Processing from %d to %d members", index, last_index)
for i = index, last_index do
local name, rank, _, _, _, _, pubNote, note, _, _, class = GetGuildRosterInfo(i)
-- strip off the -server portion of roster info
local name = Ambiguate(name, "none")
-- Start of outsiders patch
if OUTSIDERSENABLED then
local extName = strmatch(pubNote, 'ext:%s-(%S+)%s-')
local holder
if extName then
-- the name is now the note and the external name is the new name.
local entry = cache[extName]
if not entry then
entry = {}
cache[extName] = entry
end
local ep_test = EPGP:DecodeNote(note)
if not ep_test then --current character does not contain epgp info in its note, map to the character who contains
holder = note
else
holder = name
end
Debug("Entry " .. holder .. " is " .. extName)
-- Mark this note as seen
entry.seen = true
if entry.note ~= holder then
entry.note = holder
local _, unitClass = UnitClass(extName)
entry.rank = "Outsider("..name..")"
-- instead of using '' when there's no "unitClass", using the "class" of the placeholderalt
-- (don't know if this is needed with resetting "seen"-flag. This was my first good try to avoid
-- a bug : \epgp\ui.lua line 1203: attempt to index local 'c' (a nil value) -- local c = RAID_CLASS_COLORS[EPGP:GetClass(row.name)])
entry.class = unitClass or class
if initialized then
callbacks:Fire("GuildNoteChanged", extName, holder)
end
if entry.pending_note then
callbacks:Fire("InconsistentNote", extName, holder, entry.note, entry.pending_note)
end
end
if entry.pending_note then
GuildRosterSetOfficerNote(i, entry.pending_note)
entry.pending_note = nil
end
end
end -- if OUTSIDERSENABLED
if name then
local entry = cache[name]
local pending = pending_note[name]
if not entry then
entry = {}
cache[name] = entry
end
entry.rank = rank
entry.class = class
-- Mark this note as seen
entry.seen = true
if entry.note ~= note then
entry.note = note
-- We want to delay all GuildNoteChanged calls until we have a
-- complete view of the guild, otherwise alts might not be
-- rejected (we read alts note before we even know about the
-- main).
if initialized then
callbacks:Fire("GuildNoteChanged", name, note)
end
if pending then
callbacks:Fire("InconsistentNote", name, note, entry.note, pending)
end
end
if pending then
GuildRosterSetOfficerNote(i, pending)
pending_note[name] = nil
end
end
end
index = last_index
if index >= num_guild_members then
-- We are done, we need to clear the seen marks and delete the
-- unmarked entries. We also fire events for removed members now.
for name, t in pairs(cache) do
if t.seen then
t.seen = nil
else
cache[name] = nil
callbacks:Fire("GuildNoteDeleted", name)
end
end
if not initialized then
-- Now make all GuildNoteChanged calls because we have a full
-- state.
for name, t in pairs(cache) do
callbacks:Fire("GuildNoteChanged", name, t.note)
end
initialized = true
callbacks:Fire("StateChanged")
end
if state == "STALE" then
SetState("CURRENT")
elseif state == "FLUSHING" then
if not next(pending_note) then
SetState("STALE_WAITING_FOR_ROSTER_UPDATE")
SendAddonMessage("CHANGES_FLUSHED", "GUILD")
end
end
end
Debug(tostring(debugprofilestop() - startTime).."ms for LibGuildStorage:OnUpdate")
end
-- Disable updates when the guild roster is open.
-- This is a temporary hack until we get a better location for data storage
lib:RawHook("GuildFrame_LoadUI", function(...)
SetGuildRosterShowOffline(EPGP.db.profile.blizzard_show_offline)
lib.hooks.GuildFrame_LoadUI(...)
lib:RawHookScript(GuildRosterFrame, "OnShow", function(frame, ...)
GUILDFRAMEVISIBLE = true
if GuildRosterShowOfflineButton then
GuildRosterShowOfflineButton:SetChecked(EPGP.db.profile.blizzard_show_offline)
GuildRosterShowOfflineButton:Enable()
end
SetGuildRosterShowOffline(EPGP.db.profile.blizzard_show_offline)
lib.hooks[frame].OnShow(frame, ...)
end)
lib:RawHookScript(GuildRosterFrame, "OnHide", function(frame, ...)
GUILDFRAMEVISIBLE = false
EPGP.db.profile.blizzard_show_offline = GetGuildRosterShowOffline()
lib.hooks[frame].OnHide(frame, ...)
SetGuildRosterShowOffline(true)
end)
lib:Unhook("GuildFrame_LoadUI")
SetGuildRosterShowOffline(true)
end, true)
ForceShowOffline()
frame:SetScript("OnUpdate", Frame_OnUpdate)
GuildRoster()
| bsd-3-clause |
kidaa/Awakening-Core3 | bin/scripts/object/mobile/dressed_noble_trandoshan_male_01.lua | 3 | 2244 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_mobile_dressed_noble_trandoshan_male_01 = object_mobile_shared_dressed_noble_trandoshan_male_01:new {
}
ObjectTemplates:addTemplate(object_mobile_dressed_noble_trandoshan_male_01, "object/mobile/dressed_noble_trandoshan_male_01.iff")
| lgpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/object/tangible/ship/components/armor/arm_reward_mandal_elite.lua | 3 | 2304 | --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_armor_arm_reward_mandal_elite = object_tangible_ship_components_armor_shared_arm_reward_mandal_elite:new {
}
ObjectTemplates:addTemplate(object_tangible_ship_components_armor_arm_reward_mandal_elite, "object/tangible/ship/components/armor/arm_reward_mandal_elite.iff")
| lgpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/object/draft_schematic/spices/spice_droid_lube.lua | 2 | 3172 | --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_spices_spice_droid_lube = object_draft_schematic_spices_shared_spice_droid_lube:new {
templateType = DRAFTSCHEMATIC,
customObjectName = "Zypolene Droid Lubricant",
craftingToolTab = 4, -- (See DraftSchemticImplementation.h)
complexity = 11,
size = 1,
xpType = "crafting_spice",
xp = 115,
assemblySkill = "spice_assembly",
experimentingSkill = "spice_experimentation",
customizationSkill = "spice_customization",
customizationOptions = {},
customizationStringNames = {},
customizationDefaults = {},
ingredientTemplateNames = {"craft_food_ingredients_n", "craft_food_ingredients_n", "craft_food_ingredients_n"},
ingredientTitleNames = {"xr81_lube", "gas_filter", "delivery_mechanism"},
ingredientSlotType = {0, 0, 0},
resourceTypes = {"chemical", "gas", "metal"},
resourceQuantities = {10, 10, 5},
contribution = {100, 100, 100},
targetTemplate = "object/tangible/food/spice/spice_droid_lube.iff",
additionalTemplates = {
}
}
ObjectTemplates:addTemplate(object_draft_schematic_spices_spice_droid_lube, "object/draft_schematic/spices/spice_droid_lube.iff")
| lgpl-3.0 |
widelands/widelands | data/campaigns/tutorial01_basic_control.wmf/scripting/texts.lua | 1 | 31186 | -- =======================================================================
-- Texts for the tutorial mission
-- =======================================================================
-- ================
-- General messages
-- ================
scold_player = {
title = _("Nice And Easy Does It All the Time"),
body = (
p(_([[I am sorry, but will I have to tear this down again. We might need the space here later on. If I am too slow for you, you might want to play a real game and just find everything out for yourself. Otherwise, please bear with me, I am not the youngest and quickest anymore.]])
)
),
h = 150,
show_instantly = true
}
-- Teaching basic UI controls
-- ==============
-- Starting Infos
-- ==============
initial_message_01 = {
title = _("Welcome to the Widelands Tutorial!"),
body = (
h1(_("Welcome to Widelands!")) ..
li_image("images/logos/wl-ico-64.png",
_([[Widelands is a slow-paced build-up strategy game with an emphasis on construction rather than destruction.]])) ..
li_arrow(_([[You will be guided through this tutorial by objectives.]]))
)
}
obj_initial_close_objectives_window = {
name = "obj_initial_close_objectives_window",
title=_("Objectives and how to handle them"),
number = 1,
body = objective_text(_("Handling of the ‘Objectives’ window"),
li_image("images/wui/menus/objectives.png", _([[You can open and close the ‘Objectives’ window by clicking on the ‘Objectives’ button in the toolbar on the bottom of the screen.]])) ..
li_arrow(_([[Like most other windows, you can also close the window by right-clicking on it.]])) ..
li_arrow(_([[When you have accomplished an objective, it will disappear from the list.]]))
)
}
obj_initial_toggle_building_spaces = {
name = "initial_toggle_building_spaces",
title=_("Show building spaces"),
number = 1,
body = objective_text(_("Show building spaces"),
p(_([[Activate ‘Show Building Spaces’. There are two ways you can do this:]])) ..
li_image("images/wui/menus/showhide.png", _([[Press %s to toggle them, or select ‘Show Building Spaces’ in the ‘Show / Hide’ menu.]]):bformat(wl.ui.get_shortcut("buildhelp"))) ..
li(_([[Show the building spaces now.]]))
)
}
initial_message_02 = {
title = _("Building Spaces"),
position = "topright",
field = sf,
body = (
h1(_("Let’s dive right in!")) ..
li_image("tribes/initialization/barbarians/images/icon.png",
_([[There are five different tribes in Widelands: the Barbarians, the Empire, the Atlanteans, the Frisians and the Amazons. All tribes have different economies, strengths, and weaknesses, but the general gameplay is the same for all. We will play the Barbarians for now.]])) ..
li_object("barbarians_headquarters", _([[You will usually start the game with one headquarters. This is the big building with the blue flag in front of it. The headquarters stores wares, workers and soldiers. Some wares are needed for building houses, others for making other wares. Obviously, the initial wares will not last forever, so you must make sure to replenish them. The most important wares in the early game are the basic construction wares: logs and granite. Let’s make sure that we do not run out of logs. For this, we need a lumberjack and a hut for him to stay in.]]), plr.color) ..
p(_([[We need to find a nice place for the lumberjack’s hut. To make this easier, we can activate ‘Show Building Spaces’.]])) ..
li(_([[I’ll show you where the menu is and where to show and hide the building spaces.]]))
)
}
initial_message_03 = {
title = _("Building Spaces"),
position = "topright",
field = sf,
body = (
h1(_("Let’s dive right in!")) ..
li_image("images/wui/menus/showhide.png", _([[Now that I have shown you where to show and hide the building spaces, please switch them on so that we can place our first building.]]), plr.color)
)
}
-- ==========
-- Lumberjack
-- ==========
lumberjack_message_01 = {
title = _("Lumberjack’s Spot"),
position = "topright",
field = first_lumberjack_field,
body = (
li_object("barbarians_lumberjacks_hut",
_([[There you go. Now, let me show you how to make a lumberjack’s hut and how to connect it with a road. There is a sweet spot for a lumberjack right next to those trees. I’ll describe the steps I will take and then demonstrate them.]]), plr.color)
),
h = 250,
w = 350
}
lumberjack_message_02 = {
title = _("Building the Lumberjack"),
position = "topright",
body = (
li_object("barbarians_lumberjacks_hut",
_([[First, I’ll left-click on the symbol where I want the lumberjack’s hut to be built. A window will appear where I can choose between buildings.]]), plr.color) ..
li_image("images/wui/overlays/small.png", _([[The lumberjack’s hut is a small building, so I will then go on to select the small buildings tab. Then I’ll choose the lumberjack’s hut.]]))
),
h = 300,
w = 350
}
lumberjack_message_03a = {
title = _("Building a Connecting Road"),
position = "topright",
body = (
li_image("images/wui/fieldaction/menu_tab_buildroad.png", _([[That won’t do yet. I still need to connect the lumberjack’s hut to the rest of my road network. After ordering the construction site, I was automatically put into road building mode, so all I have to do is click on the blue flag in front of my headquarters.]]))
),
show_instantly = true,
h = 200,
w = 350
}
lumberjack_message_03b = {
title = _("Building a Connecting Road"),
position = "topright",
body = (
li_image("images/wui/fieldaction/menu_tab_buildroad.png",
_([[That won’t do yet. I still need to connect the lumberjack’s hut to the rest of my road network. You have disabled the option ‘Start building road after placing a flag’ (to change that, choose ‘Options’ in the Widelands main menu). Therefore, I have entered the road building mode manually. I will tell you later how to do that. To build the road, all I have to do now is click on the blue flag in front of my headquarters.]]))
),
show_instantly = true,
h = 250,
w = 350
}
lumberjack_message_04 = {
title = _("Waiting for the Lumberjack to Go Up"),
position = "topright",
body = (
li_object("barbarians_builder",
_([[Now watch closely while a builder leaves the headquarters and goes to the construction site. Also, a carrier will take position in between the two blue flags and carry wares from one blue flag to the other.]]), plr.color)
),
h = 200,
w = 350
}
obj_lumberjack_place_flag = {
name = "obj_lumberjack_place_flag",
title=_("Build a flag to divide the road to the lumberjack"),
number = 1,
body = objective_text(_("Build a Flag on the Road"),
p(_([[The shorter your road segments are, the faster your wares will be transported. You should therefore make sure that your roads have as many flags as possible.]])) ..
li(_([[Build a blue flag now in the middle of the road that connects your headquarters to your lumberjack’s hut.]])) ..
li_image("images/wui/fieldaction/menu_build_flag.png",_([[To build the flag, click on the yellow flag symbol in between the two blue flags we just placed and then click on the build flag symbol.]]))
),
h = 300,
w = 350
}
lumberjack_message_05 = {
title = _("Placing Another Flag"),
position = "topright",
body = (
li_object("barbarians_carrier",
_([[Nice how they are working, isn’t it? But the poor carrier has a very long way to go. We can make it easier for him (and more efficient for us) by placing another blue flag on the road. You try it this time.]]), plr.color)
),
h = 450,
w = 350
}
lumberjack_message_06 = {
title = _("Waiting for the Lumberjack to Go Up"),
position = "topright",
body = (
li_image("images/wui/fieldaction/menu_tab_buildroad.png",
_([[I wanted to teach you how to build new flags, but it seems you have already found out on your own. Well done!]])) ..
p(_([[Now you have split the road in two parts with a carrier each. This means less work for him and higher efficiency for us. You should therefore always place as many flags as possible on your roads.]]))
),
h = 250,
w = 350
}
obj_lumberjack_progress = {
name = "obj_lumberjack_progress",
title=_("Let’s see the progress"),
number = 1,
body = objective_text(_("Let’s see the progress"),
li(_([[Click on the construction site to have a look at it.]]))
),
h = 300,
w = 350
}
lumberjack_message_07a = {
title = _("The Construction Site"),
position = "topright",
body = (
h1(_("Let’s see the progress")) ..
li_object("barbarians_builder", _([[If you click on the construction site, a window will open. You can see the wares that are still missing grayed out. You can also see the progress of this construction site.]]), plr.color)
),
h = 450,
w = 350
}
lumberjack_message_07b = {
title = _("The Construction Site"),
position = "topright",
body = (
li_image("images/wui/buildings/toggle_workarea.png",
_([[This button toggles showing the building’s work area. When the lumberjack leaves the building to look for trees to fell, he will only look for them within this area. Let me show you how perfect this spot is.]])) ..
p(_([[Close the construction site window when you have seen enough.]]))
),
h = 250,
w = 350
}
lumberjack_message_08 = {
title = _("Waiting for the Lumberjack to Go Up"),
position = "topright",
body = (
p(_([[Well done! Let’s wait till the hut is finished.]])) ..
li_image("images/wui/menus/gamespeed.png",
_([[If you want things to go faster, simply use the %1$s key on your keyboard to increase the game speed. You can use %2$s to make the game slower again.]]):bformat(wl.ui.get_shortcut("game_speed_up"), wl.ui.get_shortcut("game_speed_down"))) ..
p(_([[Change is rapid with %1$s/%2$s and smooth with %3$s/%4$s.]]):bformat(wl.ui.get_shortcut("game_speed_up_fast"), wl.ui.get_shortcut("game_speed_down_fast"), wl.ui.get_shortcut("game_speed_up_slow"), wl.ui.get_shortcut("game_speed_down_slow")))
),
h = 200,
w = 350
}
lumberjack_message_09 = {
title = _("The Lumberjack’s Hut is Done"),
position = "topright",
body = (
li_object("barbarians_lumberjacks_hut", _([[Excellent. The lumberjack’s hut is done. A lumberjack will now move in and start chopping down trees, so our log income is secured for now. Now on to the granite.]]), plr.color)
),
h = 200,
w = 350
}
-- ==================
-- Moving the mapview
-- ==================
obj_moving = {
name = "move_view_with_cursor_keys",
title=_("Moving the View"),
number = 1,
body = objective_text(_("Move your view"),
p(_([[Moving your view is essential to get a complete overview of your whole economy. There are three ways to move your view in Widelands.]])) ..
li_arrow(_([[The first one is to use the cursor keys on your keyboard.]])) ..
li_arrow(_([[The second one is the more common and faster one: press-and-hold the right mouse button anywhere on the map, then move your mouse around and you’ll see the view scroll.]])) ..
li_arrow(_([[The third one is to use the minimap. It is especially useful for traveling big distances.]]))
),
}
tell_about_move = {
title = _("Some Rocks Were Found"),
body = (
h1(_("Getting a Quarry Up")) ..
li_object("greenland_rocks6",
_([[Granite can be mined in granite mines, but the easier way is to build a quarry next to some rocks lying around. As it happens, there is a pile of them just to the west (left) of your headquarters. I will teach you now how to move your view over there.]]))
),
h = 450,
}
obj_moving_minimap = {
name = "use_minimap",
title=_("Learn to use the minimap"),
number = 1,
body = objective_text(_("Learn to use the minimap"),
li(_([[Try moving around by clicking on the minimap]])) ..
li(_([[Play around a bit with the different overlays (roads, flags, etc.)]])) ..
li(_([[When you are ready to continue, close the minimap by selecting ‘Hide Minimap’ in the ‘Map View’ menu or by pressing ‘%s’. Of course, a right-click also works.]]):bformat(wl.ui.get_shortcut("minimap")))
),
}
tell_about_minimap_1 = {
title = _("Moving Your View"),
body = (
h1(_("Using the Minimap")) ..
li_image("images/wui/menus/toggle_minimap.png",
p(_([[Very good. And now about the minimap. ]])) ..
-- TRANSLATORS it = the minimap
p(_([[You can open it by selecting the ‘Show Minimap’ entry in the ‘Map View’ menu at the bottom of the screen or simply by using the keyboard shortcut ‘%s’.]]):bformat(wl.ui.get_shortcut("minimap")))) ..
-- TRANSLATORS it = the minimap
li_arrow(_([[I will open it for you.]]))
),
w = 350,
h = 250,
}
tell_about_minimap_2 = {
title = _("Moving Your View"),
body = (
h1(_("Using the Minimap")) ..
li_image("images/wui/menus/toggle_minimap.png",
_([[The minimap shows the complete map in miniature. ]]
.. [[You can directly jump to any field by left-clicking on it. ]]
.. [[You can also toggle buildings, roads, flags and player indicators on and off inside the minimap.]]))
),
h = 450,
}
congratulate_and_on_to_quarry = {
title = _("Onward to the Quarry"),
body = li_object("greenland_rocks6",_([[Great. Now about that quarry…]])),
h = 200,
w = 250
}
-- ======
-- Quarry
-- ======
obj_build_a_quarry = {
name = "build_a_quarry",
title=_("Build a quarry next to the rocks"),
number = 1,
body = objective_text(_("Build a Quarry"),
li(_([[There are some rocks to the west of your headquarters. Build a quarry right next to them.]])) ..
li_image("images/wui/overlays/small.png", _([[The quarry is a small building like the lumberjack’s hut. You can therefore build it on any field that shows a red, yellow or green house when the building spaces symbols are enabled (Press ‘%s’ for that).]]):bformat(wl.ui.get_shortcut("buildhelp"))) ..
li_arrow(_([[Just click on any house symbol next to the rocks, select the small buildings tab in the window that opens up, then click on the quarry symbol.]]))
),
}
order_quarry_recap_how_to_build = {
field = first_quarry_field,
position = "topright",
title = _("How to Build a Quarry"),
body = (
li_object("barbarians_quarry",
p(_([[Build a quarry next to those rocks here. Remember how I did it earlier?]])) ..
p(_([[Make sure that you are showing the building spaces, then just click on the space where you want the building to be, choose it from the window that appears, and it is placed.]])) ..
p(_([[You can build four things on fields in Widelands: flags, small houses, medium houses and big houses. But not every field can hold everything. The build space symbols ease recognition:]])), plr.color) ..
li_image("images/wui/overlays/big.png", _([[Everything can be built on the green house symbol.]])) ..
li_image("images/wui/overlays/medium.png", _([[Everything except for big buildings can be built on a yellow house symbol.]])) ..
li_image("images/wui/overlays/small.png", _([[Red building symbols can only hold small buildings and flags.]])) ..
li_image("images/wui/overlays/set_flag.png", _([[And finally, the yellow flag symbol only allows for flags.]])) ..
p(_([[If you place something on a field, the surrounding fields might have less space for holding buildings, so choose your fields wisely.]]))
)
}
local explain_abort_roadbuilding = li_image("images/wui/menu_abort.png", _([[If you decide you do not want to build a road at this time, you can cancel road building by clicking on the starting flag of the road and selecting the abort symbol.]]))
talk_about_roadbuilding_00a = {
position = "topright",
field = wl.Game().map:get_field(9,12),
title = _("Road Building"),
body = (
li_image("images/wui/fieldaction/menu_tab_buildroad.png", _([[Excellent! Directly after placing the building, you have been switched into road building mode. The new road will start at the flag in front of your newly placed construction site.]])) ..
li_image("images/wui/fieldaction/menu_build_way.png", _([[You can enter road building mode for any flag by left-clicking on a flag and selecting the road building symbol.]])) ..
explain_abort_roadbuilding ..
p(_([[Now, about this road. Remember: we are already in road building mode since you just ordered the quarry. You can either make it longer by one field at a time by left-clicking multiple times on neighboring fields for perfect control over the route the road takes, like so:]]))
),
h = 300,
show_instantly = true
}
talk_about_roadbuilding_00b = {
position = "topright",
field = road_building_field,
title = _("Road Building"),
body = (
li_image("images/wui/fieldaction/menu_build_way.png", _([[Excellent! To enter road building mode for any flag, left-click on a flag and select the road building symbol.]])) ..
explain_abort_roadbuilding ..
p(_([[Now, about this road. I’ll enter the road building mode and then make it longer by one field at a time by left-clicking multiple times on neighboring fields for perfect control over the route the road takes, like so:]]))
),
h = 300,
show_instantly = true
}
talk_about_roadbuilding_01 = {
position = "topright",
field = road_building_field,
title = _("Road Building"),
body = li_object("barbarians_flag", _([[Or, you can directly click the flag where the road should end, like so:]]), plr.color),
h = 200,
w = 250
}
obj_build_road_to_quarry = {
name = "build_road_to_quarry",
title=_("Connect the quarry to the headquarters"),
number = 1,
body = objective_text(_("Connect Your Construction Site"),
li(_([[Connect your quarry construction site to your headquarters with a road.]])) ..
li_arrow(_([[To build a completely new road, just click on the flag in front of your construction site, click on the build road icon and then click on the flag in front of your headquarters. Wait for the completion of the quarry.]])) ..
li_arrow(_([[If you hold Ctrl or Shift+Ctrl while you finish the road, flags are placed automatically.]]))
),
}
talk_about_roadbuilding_02 = {
position = "topright",
title = _("Road Building"),
body = (
li_image("images/wui/fieldaction/menu_tab_buildroad.png", _([[One more thing: around the field where your road would end, you can see different markers. They have the following meaning:]])) ..
li_image("images/wui/overlays/road_building_green.png", _([[The terrain is flat here. Your carriers will be very swift on this terrain.]])) ..
li_image("images/wui/overlays/road_building_yellow.png", _([[There is a small slope to climb to reach this field. This means that your workers will be faster walking downhill than they will be walking uphill.]])) ..
li_image("images/wui/overlays/road_building_red.png", _([[The connection between the fields is extremely steep. The speed increase in one direction is huge while the slowdown in the other is also substantial.]])) ..
p(_([[Keep the slopes in mind while placing roads and use them to your advantage. Also, try to keep roads as short as possible and always remember to place as many flags as you can on road segments to share the load better.]]))
),
h = 450
}
quarry_not_connected = {
title = _("Quarry not Connected"),
body = (
li_object("barbarians_carrier", _([[Your workers do not like to walk across country. You have to build a road from your headquarters to the construction site so that carriers can transport wares.]]), plr.color)
),
w = 350,
h = 250
}
quarry_illegally_destroyed = {
title = _("You Destroyed the Construction Site!"),
body = (
li_object("barbarians_quarry", _([[It seems like you destroyed a construction site for a quarry we wanted to build. Luckily, we still have enough logs left this time, so you can simply build another one.]]), plr.color) ..
li_arrow(_([[You can also reload the game from a previous savegame. Luckily, these are created from time to time. To do so, you will have to go back to the main menu and choose ‘Single Player’ → ‘Load Game’. And please be a bit more careful next time.]]))
),
w = 350,
h = 250
}
obj_build_the_second_quarry = {
name = "build_the_second_quarry",
title=_("Build another quarry"),
number = 1,
body = objective_text(_("Build another quarry"),
li(_([[Build a second quarry near the rocks and connect it to your road network.]])) ..
li_arrow(_([[You can connect the new road to any flag of your existing road network. You can create junctions everywhere, not only in front of buildings.]]))
),
}
build_second_quarry = {
position = "topright",
title = _("Build a second quarry"),
body = (
li_object("barbarians_quarry", _([[When there are many rocks, you can consider building another quarry. This will make the granite production faster.]]), plr.color)
),
h = 300
}
-- ===================
-- Census & Statistics
-- ===================
census_and_statistics_00 = {
title = _("Census and Status"),
body = (
li_image("images/wui/menus/toggle_census.png", _([[While we wait, I’ll quickly show you another useful feature. It is sometimes hard to tell all the buildings apart. Widelands offers a feature to show label texts called the ‘census’ over the buildings.]])) ..
li_arrow(_([[In order to show or hide the building census labels, you can select the ‘Show Census’ / ‘Hide Census’ entry from the ‘Show / Hide’ menu on the bottom, or press the ‘%s’ key on the keyboard.]]):bformat(wl.ui.get_shortcut("game_showhide_census"))) ..
p(_([[Let me enable the census for you.]]))
),
position = "topright",
h = 300,
w = 350
}
obj_show_statistics = {
name = "show_statistics",
title=_("Show the building status"),
number = 1,
body = objective_text(_("Show the building status"),
li_arrow(_([[In order to show or hide the building status labels, you can select the ‘Show Status’ entry from the ‘Show / Hide’ menu on the bottom, or press the ‘%s’ key on the keyboard.]]):bformat(wl.ui.get_shortcut("game_showhide_stats")))
)
}
census_and_statistics_01 = {
title = _("Census and Status"),
body = (
li_image("images/wui/menus/toggle_statistics.png",
p(_([[Now, wouldn’t it be nice to check on our quarries’ progress without having to open their windows?]])) ..
p(_([[In addition to the buildings’ census, you can also activate status labels on them. This will display information about the productivity of buildings or the progress of construction sites.]])))
),
position = "topright",
h = 400,
w = 350
}
census_and_statistics_02 = {
title = _("Census and Status"),
body = (
li_object("barbarians_quarry", _([[Now we know what’s going on. Let’s wait for the quarries to finish.]]), plr.color)
),
position = "topright",
h = 150,
w = 250
}
-- ========
-- Messages
-- ========
obj_archive_all_messages = {
name = "archive_all_messages",
title=_("Archive all messages in your inbox"),
number = 1,
body = objective_text(_("Archive Your Inbox Messages"),
li(_([[Archive all your messages in your inbox now.]])) ..
li_image("images/wui/messages/message_archive.png", _([[Keep clicking the ‘Archive selected message’ button until all messages have been archived and the list is empty.]])) ..
li_arrow(_([[You can also hold down the Ctrl or Shift key to select multiple messages, or press %s to select them all.]]):bformat(wl.ui.get_shortcut("selectall"))) ..
li_arrow(_([[You can toggle the message window by pressing ‘%s’ or clicking the second button from the right at the very bottom of the screen. The newest message will be marked for you automatically.]]):bformat(wl.ui.get_shortcut("game_messages"))) ..
li_arrow(_([[The message window is central to fully controlling your tribe’s fortune. However, you will get a lot of messages in a real game. To keep your head straight, you should try to keep the inbox empty.]]))
)
}
teaching_about_messages = {
popup = true,
title = _("Messages"),
heading = _("Introducing Messages"),
body = (
li_image("images/wui/menus/message_new.png",_([[Hi, it’s me again! This time, I have sent you a message. Messages are sent to you by Widelands to inform you about important events: empty mines, attacks on your tribe, won or lost military buildings, resources found…]])) ..
p(_([[The message window can be toggled by the second button from the right at the bottom of the screen. This button will also change appearance whenever new messages are available, but there is also a bell sound played whenever you receive a new message.]])) ..
p(_([[You have two messages at the moment. This one, which you are currently reading, and the one that informed you that a new headquarters was added to your economy. Let’s learn how to archive messages:]])) ..
new_objectives(obj_archive_all_messages)
)
}
obj_close_message_window = {
name = "close_message_window",
title=_("Close the messages window"),
number = 1,
body = objective_text(_("Close the Messages Window"),
p(_([[All windows in Widelands (except story message windows showing ‘OK’) can be closed by right-clicking into them. Some windows can also be toggled with the buttons and menus at the very bottom of the screen.]])) ..
li(_([[Close the messages window now by right-clicking into it.]]))
)
}
closing_msg_window_00 = {
position = "topright",
field = first_quarry_field,
title = _("Closing Windows"),
body = (
li_image("images/wui/menus/message_old.png",_([[Excellent. Now we need to focus on other things.]]))
),
h = 400,
w = 350
}
closing_msg_window_01 = {
position = "topright",
field = first_quarry_field,
title = _("Closing Windows"),
body = (
li_object("barbarians_quarry", _([[Well done! Let’s see how messages work in a real game, shall we? For this, I’ll take all rocks away from the poor stonemasons in the quarries. They will then send a message each that they can’t find any in their work areas the next time they try to do some work.]]), plr.color)
),
h = 250,
w = 350
}
obj_destroy_quarries = {
name = "destroy_quarries",
title=_("Destroy the two quarries"),
number = 1,
body = objective_text(_("Destroy the Quarries"),
li(_([[Since our quarries are useless now, you can destroy them and reuse the space later on.]])) ..
p(_([[There are two different ways of destroying a building: burning down and dismantling. Try them both out on your quarries.]])) ..
li_image("images/wui/buildings/menu_bld_bulldoze.png", _([[Burning down the quarry: This is the fastest way of clearing the space. While the worker abandons the building, the wares are lost.]])) ..
li_image("images/wui/buildings/menu_bld_dismantle.png", _([[Dismantling the quarry: A builder will walk from the headquarters to dismantle the quarry piece by piece. Thereby, you regain some of the resources you used for the construction.]]))
)
}
destroy_quarries_message = {
position = "topright",
title = _("Messages Arrived!"),
body = (
li_image("images/wui/menus/message_new.png", _([[You received some messages. See how the button at the bottom of the screen has changed appearance?]]))
),
h = 400,
w = 350
}
-- =========
-- Expansion
-- =========
obj_expand_territory = {
name = "expand_territory",
title=_("Expand your territory"),
number = 1,
body = objective_text(_("Make your Territory Grow"),
li(_([[Build a military building on your border. Choose the one you like most.]])) ..
li_arrow(_([[The sentry is the only military site that fits on a small building plot. If your lumberjack has cleared enough space, you can also build a bigger military building.]])) ..
li_arrow(_([[Remember that big buildings (green icon) cannot be built on small (red) or medium (yellow) building plots, but buildings can be built on a building plot that provides more space than they need. You should always keep that in mind when you search for a suitable place.]]))
)
}
introduce_expansion = {
title = _("Expanding Your Territory!"),
body = (
li_object("barbarians_sentry",
p(_([[There is one more thing I’d like to teach you now: Expanding your territory. The place that we started with around our headquarters is barely enough for a basic building infrastructure, and we do not have access to mountains, which we need to mine minerals and coal. So, we have to expand our territory.]])) ..
p(_([[Expanding is as simple as building a military building at the edge of your territory. The Barbarians have a selection of four different military buildings: sentries, barriers, towers and fortresses. The bigger the building, the more expensive it is to build, but the more land it will conquer around itself and the more soldiers can be stationed there. The buildings also vary in their vision range: buildings with a tower see farther than others.]])) ..
p(_([[As soon as a military building is manned, it will extend your land. I will tell you more about military buildings in another tutorial.]])), plr.color)
)
}
military_building_finished = {
title = _("Military Site Occupied"),
body = (
h1(_("Your territory has just grown!")) ..
li_object("barbarians_tower",
p(_([[Great. Do you see how your territory has grown since your soldiers entered your new military building?]])), plr.color)
),
h = 300,
w = 350
}
-- ==========
-- Conclusion
-- ==========
conclude_tutorial = {
title = _("Conclusion"),
body = (
h1(_("Conclusion")) ..
li_image("images/logos/wl-ico-64.png",
p(_([[This concludes the first tutorial. In order to learn more about the game, I suggest to play one of the other tutorials. Each of them covers a different topic.]])) ..
p(_([[However, since you now know how to control Widelands, you can also start a game (or continue this one) and discover more by yourself.]]))) ..
p(_([[To leave this game and return to the main menu:]])) ..
li_image("images/wui/menus/main_menu.png", _([[Click on the ‘Main Menu’ button on the very left at the bottom of the screen.]])) ..
li_image("images/wui/menus/exit.png", _([[Then click on the ‘Exit Game’ entry.]])) ..
p(_([[Thanks for playing this tutorial. Enjoy Widelands and remember to visit us at]])) ..
h1(p("align=center", u("widelands.org")))
),
allow_next_scenario = true,
h = 450
}
| gpl-2.0 |
eraffxi/darkstar | scripts/globals/items/serving_of_cilbir.lua | 2 | 1284 | -----------------------------------------
-- ID: 5642
-- Item: serving_of_cilbir
-- Food Effect: 3Hrs, All Races
-----------------------------------------
-- HP % 5 (cap 150)
-- MP % 5 (cap 100)
-- HP recovered while healing 3
-- MP recovered while healing 3
-----------------------------------------
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,10800,5642);
end;
function onEffectGain(target, effect)
target:addMod(dsp.mod.FOOD_HPP, 5);
target:addMod(dsp.mod.FOOD_HP_CAP, 150);
target:addMod(dsp.mod.FOOD_MPP, 5);
target:addMod(dsp.mod.FOOD_MP_CAP, 100);
target:addMod(dsp.mod.MPHEAL, 3);
target:addMod(dsp.mod.HPHEAL, 3);
end;
function onEffectLose(target, effect)
target:delMod(dsp.mod.FOOD_HPP, 5);
target:delMod(dsp.mod.FOOD_HP_CAP, 150);
target:delMod(dsp.mod.FOOD_MPP, 5);
target:delMod(dsp.mod.FOOD_MP_CAP, 100);
target:delMod(dsp.mod.MPHEAL, 3);
target:delMod(dsp.mod.HPHEAL, 3);
end;
| gpl-3.0 |
millken/tengcdn | lualib/resty/postgres.lua | 1 | 12081 | -- Copyright (C) 2013 Azure Wang(azure1st@gmail.com)
local string = string
local table = table
local bit = bit
local ngx = ngx
local cjson = require "cjson"
local tonumber,tostring = tonumber,tostring
local setmetatable = setmetatable
local error = error
module(...)
_VERSION = '0.2'
local STATE_CONNECTED = 1
local STATE_COMMAND_SENT = 2
local AUTH_REQ_OK = "\00\00\00\00"
local mt = { __index = _M }
local converters = {}
-- INT8OID
converters[20] = tonumber
-- INT2OID
converters[21] = tonumber
-- INT2VECTOROID
converters[22] = tonumber
-- INT4OID
converters[23] = tonumber
-- TEXTOID
--converters[25] = tostring
-- FLOAT4OID
converters[700] = tonumber
-- FLOAT8OID
converters[701] = tonumber
-- NUMERICOID
converters[1700] = tonumber
-- JSONOID
converters[114] = cjson.decode
-- JSONOID
converters[3802] = cjson.decode
function new(self)
local sock, err = ngx.socket.tcp()
if not sock then
return nil, err
end
-- only new connection have env info
return setmetatable({ sock = sock, env = {}}, mt)
end
function set_timeout(self, timeout)
local sock = self.sock
if not sock then
return nil, "not initialized"
end
return sock:settimeout(timeout)
end
local function _get_byte4(data, i)
local a, b, c, d = string.byte(data, i, i+3)
return bit.bor(bit.lshift(a, 24), bit.lshift(b, 16), bit.lshift(c, 8), d), i+4
end
local function _get_byte2(data, i)
local a, b = string.byte(data, i, i+1)
return bit.bor(bit.lshift(a, 8), b), i+2
end
local function _get_data_n(data, len, i)
local d = string.sub(data, i, i+len-1)
return d, i+len
end
local function _set_byte2(n)
return string.char(bit.band(bit.rshift(n, 8), 0xff), bit.band(n, 0xff))
end
local function _set_byte4(n)
return string.char(bit.band(bit.rshift(n, 24), 0xff), bit.band(bit.rshift(n, 16), 0xff),
bit.band(bit.rshift(n, 8), 0xff), bit.band(n, 0xff))
end
local function _from_cstring(data, i)
local last = string.find(data, "\0", i, true)
if not last then
return nil, nil
end
return string.sub(data, i, last - 1), last + 1
end
local function _to_cstring(data)
return {data, "\0"}
end
function _send_packet(self, data, len, typ)
local sock = self.sock
local packet
if typ then
packet = {
typ,
_set_byte4(len),
data
}
else
packet = {
_set_byte4(len),
data
}
end
return sock:send(packet)
end
function _parse_error_packet(packet)
local pos = 1
local flg, value, msg
msg = {}
while true do
flg = string.sub(packet, pos, pos)
if not flg then
return nil, "parse error packet fail"
end
pos = pos + 1
if flg == '\0' then
break
end
-- all flg S/C/M/P/F/L/R
value, pos = _from_cstring(packet, pos)
if not value then
return nil, "parse error packet fail"
end
msg[flg] = value
end
return msg
end
function _recv_packet(self)
-- receive type
local sock = self.sock
local typ, err = sock:receive(1)
if not typ then
return nil, nil, "failed to receive packet type: " .. err
end
-- receive length
local data, err = sock:receive(4)
if not data then
return nil, nil , "failed to read packet length: " .. err
end
local len = _get_byte4(data, 1)
if len <= 4 then
return nil, typ, "empty packet"
end
-- receive data
data, err = sock:receive(len - 4)
if not data then
return nil, nil, "failed to read packet content: " .. err
end
return data, typ
end
function _compute_token(self, user, password, salt)
local token1 = ngx.md5(password .. user)
local token2 = ngx.md5(token1 .. salt)
return "md5" .. token2
end
function connect(self, opts)
local sock = self.sock
if not sock then
return nil, "not initialized"
end
local ok, err
self.compact = opts.compact
local host = opts.host
local database = opts.database or ""
local user = opts.user or ""
local host = opts.host
local pool = opts.pool
local password = opts.password
if host then
local port = opts.port or 5432
if not pool then
pool = table.concat({user, database, host, port}, ":")
end
ok, err = sock:connect(host, port, { pool = pool })
else
local path = opts.path
if not path then
return nil, 'neither "host" nor "path" options are specified'
end
if not pool then
pool = table.concat({user, database, path}, ":")
end
ok, err = sock:connect("unix:" .. path, { pool = pool })
end
if not ok then
return nil, 'failed to connect: ' .. err
end
local reused = sock:getreusedtimes()
-- use pool connection
if reused and reused > 0 then
self.state = STATE_CONNECTED
return 1
end
-- new connection
-- send first packet
local req, req_len
req = {}
-- PG_PROTOCOL 3.0
table.insert(req, {"\00\03","\00\00"})
table.insert(req, _to_cstring("user"))
table.insert(req, _to_cstring(user))
table.insert(req, _to_cstring("database"))
table.insert(req, _to_cstring(database))
table.insert(req, "\00")
-- packet_len + PG_PROTOCOL + user + database + end
-- req_len = 4 + 4 + string.len(user) + 6 + string.len(database) + 10 + 1
req_len = string.len(user) + string.len(database) + 25
local bytes, err = _send_packet(self, req, req_len)
if not bytes then
return nil, "failed to send client authentication packet1: " .. err
end
-- receive salt packet (len + data) no type
local packet, typ
packet, typ, err = _recv_packet(self)
if not packet then
return nil, "handshake error:" .. err
end
if typ ~= 'R' then
return nil, "handshake error, got packet type:" .. typ
end
local auth_type = string.sub(packet, 1, 4)
local salt = string.sub(packet, 5, 8)
-- send passsowrd
req = {_to_cstring(_compute_token(self, user, password, salt))}
req_len = 40
local bytes, err = _send_packet(self, req, req_len, 'p')
if not bytes then
return nil, "failed to send client authentication packet2: " .. err
end
-- receive response
packet, typ, err = _recv_packet(self)
if typ ~= 'R' then
return nil, "auth return type not support"
end
if packet ~= AUTH_REQ_OK then
return nil, "authentication failed"
end
while true do
packet, typ, err = _recv_packet(self)
if not packet then
return nil, "read packet error:" .. err
end
-- env
if typ == 'S' then
local pos = 1
local k, pos = _from_cstring(packet, pos)
local v, pos = _from_cstring(packet, pos)
self.env[k] = v
end
-- secret key
if typ == 'K' then
local pid = _get_byte4(packet, 1)
local secret_key = string.sub(packet, 5, 8)
self.env.secret_key = secret_key
self.env.pid = pid
end
-- error
if typ == 'E' then
local msg = _parse_error_packet(packet)
return nil, "Get error packet:" .. msg.M
end
-- ready for new query
if typ == 'Z' then
self.state = STATE_CONNECTED
return 1
end
end
end
function set_keepalive(self, ...)
local sock = self.sock
if not sock then
return nil, "not initialized"
end
if self.state ~= STATE_CONNECTED then
return nil, "cannot be reused in the current connection state: "
.. (self.state or "nil")
end
self.state = nil
return sock:setkeepalive(...)
end
function get_reused_times(self)
local sock = self.sock
if not sock then
return nil, "not initialized"
end
return sock:getreusedtimes()
end
function close(self)
local sock = self.sock
if not sock then
return nil, "not initialized"
end
self.state = nil
return sock:close()
end
function send_query(self, query)
if self.state ~= STATE_CONNECTED then
return nil, "cannot send query in the current context: "
.. (self.state or "nil")
end
local sock = self.sock
if not sock then
return nil, "not initialized"
end
local typ = 'Q'
local data = _to_cstring(query)
-- packet_len + cstring end(\0) = 5
local len = string.len(query) + 5
local bytes, err = _send_packet(self, data, len, typ)
self.state = STATE_COMMAND_SENT
return bytes, err
end
function read_result(self)
if self.state ~= STATE_COMMAND_SENT then
return nil, "cannot read result in the current context: " .. self.state
end
local sock = self.sock
if not sock then
return nil, "not initialized"
end
-- read data
local res = {}
local fields = {}
local field_ok = false
local packet, typ, err
while true do
packet, typ, err = _recv_packet(self)
if not packet then
return nil, "read result packet error:" .. err
end
-- packet of fields
if typ == 'T' then
local field_num, pos = _get_byte2(packet, 1)
for i=1, field_num do
local field = {}
field.name, pos = _from_cstring(packet, pos)
field.table_id, pos = _get_byte4(packet, pos)
field.field_id, pos = _get_byte2(packet, pos)
field.type_id, pos = _get_byte4(packet, pos)
field.type_len, pos = _get_byte2(packet, pos)
-- pass atttypmod, format
pos = pos + 6
table.insert(fields, field)
end
field_ok = true
end
-- packet of data row
if typ == 'D' then
if not field_ok then
return nil, "not receive fields packet"
end
local row = {}
local row_num, pos = _get_byte2(packet, 1)
-- get row
for i=1, row_num do
local data, len
len, pos = _get_byte4(packet, pos)
if len == -1 then
data = ngx.null
else
data, pos = _get_data_n(packet, len, pos)
end
local field = fields[i]
local conv = converters[field.type_id]
--ngx.log(ngx.ERR, "name=", field.name, "type_id=", field.type_id, "data=", data)
if conv and data ~= ngx.null then
data = conv(data)
end
if self.compact then
table.insert(row, data)
else
local name = field.name
row[name] = data
end
end
table.insert(res, row)
end
if typ == 'E' then
-- error packet
local msg = _parse_error_packet(packet)
err = msg.M
res = nil
break
end
if typ == 'C' then
-- read complete
local sql_type = _from_cstring(packet, 1)
self.env.sql_type = sql_type
err = nil
end
if typ == 'Z' then
self.state = STATE_CONNECTED
break
end
end
return res, err
end
function query(self, query)
local bytes, err = send_query(self, query)
if not bytes then
return nil, "failed to send query: " .. err
end
return read_result(self)
end
function escape_string(str)
local new = string.gsub(str, "['\\]", "%0%0")
return new
end
local class_mt = {
-- to prevent use of casual module global variables
__newindex = function (table, key, val)
error('attempt to write to undeclared variable "' .. key .. '"')
end
}
setmetatable(_M, class_mt)
| mit |
kidaa/Awakening-Core3 | bin/scripts/object/tangible/hair/human/hair_human_male_s08.lua | 3 | 2244 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_tangible_hair_human_hair_human_male_s08 = object_tangible_hair_human_shared_hair_human_male_s08:new {
}
ObjectTemplates:addTemplate(object_tangible_hair_human_hair_human_male_s08, "object/tangible/hair/human/hair_human_male_s08.iff")
| lgpl-3.0 |
takaaptech/Joueur.lua | _creer/games/${lowercase_first(game_name)}/ai.lua | 1 | 2362 | -- ${header}
-- This is where you build your AI for the ${game_name} game.
<%include file="functions.noCreer" />
local class = require("joueur.utilities.class")
local BaseAI = require("joueur.baseAI")
${merge("-- ", "requires", "-- you can add addtional require(s) here")}
--- @class AI: the AI functions for the ${game_name} game.
local AI = class(BaseAI)
-- this is the name you send to the server to play as.
function AI:getName()
${merge(" -- ", "get-name", ' return "' + game_name + ' Lua Player" -- REPLACE THIS WITH YOUR TEAM NAME!')}
end
-- this is called once the game starts and your AI knows its playerID and game. You can initialize your AI here.
function AI:start()
${merge(" -- ", "start", " -- replace with your start logic")}
end
-- this is called when the game's state updates, so if you are tracking anything you can update it here.
function AI:gameUpdated()
${merge(" -- ", "game-updated", " -- replace with your game updated logic")}
end
--- this is called when the game ends, you can clean up your data and dump files here if need be
-- @param {boolean} won == true means you won, won == false means you lost
-- @param {string} reason you won or lost
function AI:ended(won, reason)
${merge(" -- ", "ended", " -- replace with your ended")}
end
--- Game Logic Functions: functions you must fill out to send data to the game server to actually play the game! ---
% for function_name in ai['function_names']:
<% function_parms = ai['functions'][function_name]
%>--- ${function_parms['description']}
% if 'arguments' in function_parms:
% for arg_parms in function_parms['arguments']:
-- @param {${arg_parms['type']}} ${arg_parms['name']}: ${arg_parms['description']}
% endfor
% endif
% if function_parms['returns'] != None:
-- @returns {${shared['lua']['type'](function_parms['returns']['type'])}} ${function_parms['returns']['description']}
% endif
function AI:${function_name}(${", ".join(function_parms['argument_names'])})
${merge(" -- ", function_name,
""" -- Put your game logic here for {0}
return {1}
""".format(function_name, shared['lua']['default'](function_parms['returns']['type'], function_parms['returns']['default']) if function_parms['returns'] else "nil")
)}
end
% endfor
${merge("-- ", "functions", "-- if you need additional functions for your AI you can add them here")}
return AI
| mit |
kidaa/Awakening-Core3 | bin/scripts/object/tangible/component/weapon/lightsaber/lightsaber_module_color.lua | 3 | 2328 | --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_weapon_lightsaber_lightsaber_module_color = object_tangible_component_weapon_lightsaber_shared_lightsaber_module_color:new {
}
ObjectTemplates:addTemplate(object_tangible_component_weapon_lightsaber_lightsaber_module_color, "object/tangible/component/weapon/lightsaber/lightsaber_module_color.iff")
| lgpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/object/tangible/ship/attachment/weapon/xwing_weapon1_pos_s02_0.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_ship_attachment_weapon_xwing_weapon1_pos_s02_0 = object_tangible_ship_attachment_weapon_shared_xwing_weapon1_pos_s02_0:new {
}
ObjectTemplates:addTemplate(object_tangible_ship_attachment_weapon_xwing_weapon1_pos_s02_0, "object/tangible/ship/attachment/weapon/xwing_weapon1_pos_s02_0.iff")
| lgpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/object/tangible/wearables/skirt/skirt_s13.lua | 3 | 5176 | --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_skirt_skirt_s13 = object_tangible_wearables_skirt_shared_skirt_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_skirt_skirt_s13, "object/tangible/wearables/skirt/skirt_s13.iff")
| lgpl-3.0 |
TheWorst1/1 | plugins/insta.lua | 1 | 4067 | --[[
#
# @GPMOD
# @Dragon_Born
#
]]
local access_token = "3084249803.280d5d7.999310365c8248f8948ee0f6929c2f02" -- your api key
local function instagramUser(msg, query)
local receiver = get_receiver(msg)
local url = "https://api.instagram.com/v1/users/search?q="..URL.escape(query).."&access_token="..access_token
local jstr, res = https.request(url)
if res ~= 200 then
return "No Connection"
end
local jdat = json:decode(jstr)
if #jdat.data == 0 then
send_msg(receiver,"#Error\nUsername not found",ok_cb,false)
end
if jdat.meta.error_message then
send_msg(receiver,"#Error\n"..jdat.meta.error_message,ok_cb,false)
end
local id = jdat.data[1].id
local gurl = "https://api.instagram.com/v1/users/"..id.."/?access_token="..access_token
local ress = https.request(gurl)
local user = json:decode(ress)
if user.meta.error_message then
send_msg(receiver,"#Error\n"..user.meta.error_message,ok_cb,false)
end
local text = ''
if user.data.bio ~= '' then
text = text.."🆔 آیدی: "..user.data.username:upper().."\n\n"
else
text = text.."🆔 آیدی: "..user.data.username:upper().."\n"
end
if user.data.bio ~= '' then
text = text..user.data.bio.."\n\n"
end
if user.data.full_name ~= '' then
text = text.."📝 نام: "..user.data.full_name.."\n"
end
text = text.."🌄🛤 پست ها: "..user.data.counts.media.."\n"
text = text.."😜 فالو کرده: "..user.data.counts.follows.."\n"
text = text.."😍 فالوراش: "..user.data.counts.followed_by.."\n"
if user.data.website ~= '' then
text = text.."🌐 وب سایت : "..user.data.website.."\n"
end
text = text.."\n@TelePatch "
local file_path = download_to_file(user.data.profile_picture,"insta.png") -- disable this line if you want to send profile photo as sticker
--local file_path = download_to_file(user.data.profile_picture,"insta.webp") -- enable this line if you want to send profile photo as sticker
local cb_extra = {file_path=file_path}
local mime_type = mimetype.get_content_type_no_sub(ext)
send_photo(receiver, file_path, rmtmp_cb, cb_extra) -- disable this line if you want to send profile photo as sticker
--send_document(receiver, file_path, rmtmp_cb, cb_extra) -- enable this line if you want to send profile photo as sticker
send_msg(receiver,text,ok_cb,false)
end
local function instagramMedia(msg, query)
local receiver = get_receiver(msg)
local url = "https://api.instagram.com/v1/media/shortcode/"..URL.escape(query).."?access_token="..access_token
local jstr, res = https.request(url)
if res ~= 200 then
return "No Connection"
end
local jdat = json:decode(jstr)
if jdat.meta.error_message then
send_msg(receiver,"#Error\n"..jdat.meta.error_type.."\n"..jdat.meta.error_message,ok_cb,false)
end
local text = ''
local data = ''
if jdat.data.caption then
data = jdat.data.caption
text = text.."🆔 آیدی: "..data.from.username:upper().."\n\n"
text = text..data.from.full_name.."\n\n"
text = text..data.text.."\n\n"
text = text.."💛 تعداد لایک: "..jdat.data.likes.count.."\n"
else
text = text.."🆔 آیدی: "..jdat.data.user.username:upper().."\n"
text = text.."📝 نام: "..jdat.data.user.full_name.."\n"
text = text.."💛 تعداد لایک: "..jdat.data.likes.count.."\n"
end
text = text.."\n@TelePatch "
send_msg(receiver,text,ok_cb,false)
end
local function run(msg, matches)
if matches[1] == "اینستا" and not matches[3] then
return instagramUser(msg,matches[2])
end
if matches[1] == "اینستا" and matches[3] then
local media = matches[3]
if string.match(media , '') then media = media:gsub("", "") end
return instagramMedia(msg,media)
end
end
return {
patterns = {
"^(اینستا) ([Hh]ttps://www.instagram.com/p/)([^%s]+)$",
"^(اینستا) ([Hh]ttps://instagram.com/p/)([^%s]+)$",
"^(اینستا) ([Hh]ttp://www.instagram.com/p/)([^%s]+)$",
"^(اینستا) ([Hh]ttp://instagram.com/p/)([^%s]+)$",
"^(اینستا) ([^%s]+)$",
},
run = run
}
| gpl-2.0 |
kidaa/Awakening-Core3 | bin/scripts/object/tangible/ship/components/shield_generator/shd_phased_fullerine_fx92.lua | 3 | 2356 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_tangible_ship_components_shield_generator_shd_phased_fullerine_fx92 = object_tangible_ship_components_shield_generator_shared_shd_phased_fullerine_fx92:new {
}
ObjectTemplates:addTemplate(object_tangible_ship_components_shield_generator_shd_phased_fullerine_fx92, "object/tangible/ship/components/shield_generator/shd_phased_fullerine_fx92.iff")
| lgpl-3.0 |
nagadomi/waifu2x | lib/pairwise_transform_user.lua | 1 | 1895 | local pairwise_utils = require 'pairwise_transform_utils'
local data_augmentation = require 'data_augmentation'
local iproc = require 'iproc'
local gm = {}
gm.Image = require 'graphicsmagick.Image'
local pairwise_transform = {}
function pairwise_transform.user(x, y, size, offset, n, options)
assert(x:size(1) == y:size(1))
local scale_y = y:size(2) / x:size(2)
assert(x:size(3) == y:size(3) / scale_y)
x, y = pairwise_utils.preprocess_user(x, y, scale_y, size, options)
assert(x:size(3) == y:size(3) / scale_y and x:size(2) == y:size(2) / scale_y)
local batch = {}
local lowres_y = nil
local xs ={x}
local ys = {y}
local ls = {}
if options.active_cropping_rate > 0 then
lowres_y = pairwise_utils.low_resolution(y)
end
if options.pairwise_flip and n == 1 then
xs[1], ys[1] = data_augmentation.pairwise_flip(xs[1], ys[1])
elseif options.pairwise_flip then
xs, ys, ls = pairwise_utils.flip_augmentation(x, y, lowres_y)
end
assert(#xs == #ys)
local perm = torch.randperm(#xs)
for i = 1, n do
local t = perm[(i % #xs) + 1]
local xc, yc = pairwise_utils.active_cropping(xs[t], ys[t], ls[t], size, scale_y,
options.active_cropping_rate,
options.active_cropping_tries)
xc = iproc.byte2float(xc)
yc = iproc.byte2float(yc)
if options.rgb then
else
if xc:size(1) > 1 then
yc = iproc.rgb2y(yc)
xc = iproc.rgb2y(xc)
end
end
if options.gcn then
local mean = xc:mean()
local stdv = xc:std()
if stdv > 0 then
xc:add(-mean):div(stdv)
else
xc:add(-mean)
end
end
yc = iproc.crop(yc, offset, offset, size - offset, size - offset)
if options.pairwise_y_binary then
yc[torch.lt(yc, 0.5)] = 0
yc[torch.gt(yc, 0)] = 1
end
table.insert(batch, {xc, yc})
end
return batch
end
return pairwise_transform
| mit |
kidaa/Awakening-Core3 | bin/scripts/object/static/item/item_painting_corellia_style_02.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_static_item_item_painting_corellia_style_02 = object_static_item_shared_item_painting_corellia_style_02:new {
}
ObjectTemplates:addTemplate(object_static_item_item_painting_corellia_style_02, "object/static/item/item_painting_corellia_style_02.iff")
| lgpl-3.0 |
eraffxi/darkstar | scripts/globals/mobskills/gigaflare.lua | 2 | 1700 | ---------------------------------------------
-- Gigaflare
-- Family: Bahamut
-- Description: Deals massive Fire damage to enemies within a fan-shaped area.
-- Type: Magical
-- Utsusemi/Blink absorb: Wipes shadows
-- Range:
-- Notes: Used by Bahamut when at 10% of its HP, and can use anytime afterwards at will.
---------------------------------------------
require("scripts/globals/settings");
require("scripts/globals/status");
require("scripts/globals/monstertpmoves");
---------------------------------------------
function onMobSkillCheck(target,mob,skill)
local mobhp = mob:getHPP();
if (mobhp <= 10) then -- set up Gigaflare for being called by the script again.
mob:setLocalVar("GigaFlare", 0);
mob:SetMobAbilityEnabled(false); -- disable mobskills/spells until Gigaflare is used successfully (don't want to delay it/queue Megaflare)
mob:SetMagicCastingEnabled(false);
end;
return 1;
end;
function onMobWeaponSkill(target, mob, skill)
mob:setLocalVar("GigaFlare", 1); -- When set to 1 the script won't call it.
mob:setLocalVar("tauntShown", 0);
mob:SetMobAbilityEnabled(true); -- enable the spells/other mobskills again
mob:SetMagicCastingEnabled(true);
if (bit.band(mob:getBehaviour(),dsp.behavior.NO_TURN) == 0) then -- re-enable noturn
mob:setBehaviour(bit.bor(mob:getBehaviour(), dsp.behavior.NO_TURN))
end;
local dmgmod = 1;
local info = MobMagicalMove(mob,target,skill,mob:getWeaponDmg()*15,dsp.magic.ele.FIRE,dmgmod,TP_NO_EFFECT);
local dmg = MobFinalAdjustments(info.dmg,mob,skill,target,MOBSKILL_MAGICAL,MOBPARAM_FIRE,MOBPARAM_WIPE_SHADOWS);
target:delHP(dmg);
return dmg;
end;
| gpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/object/tangible/component/armor/armor_segment_chitin_sharnaff.lua | 3 | 2304 | --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_segment_chitin_sharnaff = object_tangible_component_armor_shared_armor_segment_chitin_sharnaff:new {
}
ObjectTemplates:addTemplate(object_tangible_component_armor_armor_segment_chitin_sharnaff, "object/tangible/component/armor/armor_segment_chitin_sharnaff.iff")
| lgpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/object/static/structure/general/prp_junk_s6.lua | 3 | 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_static_structure_general_prp_junk_s6 = object_static_structure_general_shared_prp_junk_s6:new {
}
ObjectTemplates:addTemplate(object_static_structure_general_prp_junk_s6, "object/static/structure/general/prp_junk_s6.iff")
| lgpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/object/tangible/ship/crafted/droid_interface/ddi_mk4.lua | 1 | 3057 | --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_droid_interface_ddi_mk4 = object_tangible_ship_crafted_droid_interface_shared_ddi_mk4:new {
numberExperimentalProperties = {1, 1, 2, 1, 2, 2, 1, 2, 3},
experimentalProperties = {"XX", "XX", "OQ", "UT", "XX", "OQ", "UT", "OQ", "UT", "XX", "CD", "OQ", "CD", "OQ", "SR"},
experimentalWeights = {1, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1},
experimentalGroupTitles = {"null", "null", "exp_hp", "null", "exp_mass", "exp_armorhpmax", "null", "exp_energy_maintenance", "exp_droid_speed"},
experimentalSubGroupTitles = {"null", "null", "hitpointsmax", "efficiency", "mass", "armorhpmax", "energy_efficiency", "energy_maintenance", "droid_command_speed"},
experimentalMin = {0, 0, 794, 1, 7176, 397, 1, 661, 16},
experimentalMax = {0, 0, 1075, 1, 5304, 537, 1, 489, 22},
experimentalPrecision = {0, 0, 0, 0, 0, 0, 0, 0, 2},
experimentalCombineType = {0, 0, 1, 1, 1, 1, 1, 1, 1},
}
ObjectTemplates:addTemplate(object_tangible_ship_crafted_droid_interface_ddi_mk4, "object/tangible/ship/crafted/droid_interface/ddi_mk4.iff")
| lgpl-3.0 |
houqp/koreader | frontend/ui/elements/screen_dpi_menu_table.lua | 1 | 4777 | local _ = require("gettext")
local Device = require("device")
local Screen = Device.screen
local T = require("ffi/util").template
local function isAutoDPI() return Device.screen_dpi_override == nil end
local function dpi() return Screen:getDPI() end
local function custom() return G_reader_settings:readSetting("custom_screen_dpi") end
local function setDPI(_dpi)
local InfoMessage = require("ui/widget/infomessage")
local UIManager = require("ui/uimanager")
UIManager:show(InfoMessage:new{
text = _dpi and T(_("DPI set to %1. This will take effect after restarting."), _dpi)
or _("DPI set to auto. This will take effect after restarting."),
})
G_reader_settings:saveSetting("screen_dpi", _dpi)
Device:setScreenDPI(_dpi)
end
local dpi_auto = Screen.device.screen_dpi
local dpi_small = 120
local dpi_medium = 160
local dpi_large = 240
local dpi_xlarge = 320
local dpi_xxlarge = 480
local dpi_xxxlarge = 640
return {
text = _("Screen DPI"),
sub_item_table = {
{
text = dpi_auto and T(_("Auto DPI (%1)"), dpi_auto) or _("Auto DPI"),
help_text = _("The DPI of your screen is automatically detected so items can be drawn with the right amount of pixels. This will usually display at (roughly) the same size on different devices, while remaining sharp. Increasing the DPI setting will result in larger text and icons, while a lower DPI setting will look smaller on the screen."),
checked_func = isAutoDPI,
callback = function() setDPI() end
},
{
text = T(_("Small (%1)"), dpi_small),
checked_func = function()
if isAutoDPI() then return false end
local _dpi, _custom = dpi(), custom()
return _dpi and _dpi <= 140 and _dpi ~= _custom
end,
callback = function() setDPI(dpi_small) end
},
{
text = T(_("Medium (%1)"), dpi_medium),
checked_func = function()
if isAutoDPI() then return false end
local _dpi, _custom = dpi(), custom()
return _dpi and _dpi > 140 and _dpi <= 200 and _dpi ~= _custom
end,
callback = function() setDPI(dpi_medium) end
},
{
text = T(_("Large (%1)"), dpi_large),
checked_func = function()
if isAutoDPI() then return false end
local _dpi, _custom = dpi(), custom()
return _dpi and _dpi > 200 and _dpi <= 280 and _dpi ~= _custom
end,
callback = function() setDPI(dpi_large) end
},
{
text = T(_("Extra large (%1)"), dpi_xlarge),
checked_func = function()
if isAutoDPI() then return false end
local _dpi, _custom = dpi(), custom()
return _dpi and _dpi > 280 and _dpi <= 400 and _dpi ~= _custom
end,
callback = function() setDPI(dpi_xlarge) end
},
{
text = T(_("Extra-Extra Large (%1)"), dpi_xxlarge),
checked_func = function()
if isAutoDPI() then return false end
local _dpi, _custom = dpi(), custom()
return _dpi and _dpi > 400 and _dpi <= 560 and _dpi ~= _custom
end,
callback = function() setDPI(dpi_xxlarge) end
},
{
text = T(_("Extra-Extra-Extra Large (%1)"), dpi_xxxlarge),
checked_func = function()
if isAutoDPI() then return false end
local _dpi, _custom = dpi(), custom()
return _dpi and _dpi > 560 and _dpi ~= _custom
end,
callback = function() setDPI(dpi_xxxlarge) end
},
{
text_func = function()
return T(_("Custom DPI: %1 (hold to set)"), custom() or dpi_auto)
end,
checked_func = function()
if isAutoDPI() then return false end
local _dpi, _custom = dpi(), custom()
return _custom and _dpi == _custom
end,
callback = function() setDPI(custom() or dpi_auto) end,
hold_input = {
title = _("Enter custom screen DPI"),
type = "number",
hint = "(90 - 900)",
callback = function(input)
local _dpi = tonumber(input)
_dpi = _dpi < 90 and 90 or _dpi
_dpi = _dpi > 900 and 900 or _dpi
G_reader_settings:saveSetting("custom_screen_dpi", _dpi)
setDPI(_dpi)
end,
ok_text = _("Set custom DPI"),
},
},
}
}
| agpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/object/static/structure/tatooine/debris_tatt_pipe_narrow_1.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_static_structure_tatooine_debris_tatt_pipe_narrow_1 = object_static_structure_tatooine_shared_debris_tatt_pipe_narrow_1:new {
}
ObjectTemplates:addTemplate(object_static_structure_tatooine_debris_tatt_pipe_narrow_1, "object/static/structure/tatooine/debris_tatt_pipe_narrow_1.iff")
| lgpl-3.0 |
eraffxi/darkstar | scripts/globals/abilities/pets/grand_fall.lua | 2 | 1361 | ---------------------------------------------------
-- Geocrush
---------------------------------------------------
require("scripts/globals/settings");
require("scripts/globals/status");
require("scripts/globals/monstertpmoves");
require("scripts/globals/magic");
---------------------------------------------------
function onAbilityCheck(player, target, ability)
return 0,0;
end;
function onPetAbility(target, pet, skill)
local dINT = math.floor(pet:getStat(dsp.mod.INT) - target:getStat(dsp.mod.INT));
local tp = skill:getTP() / 10;
local master = pet:getMaster();
local merits = 0;
if (master ~= nil and master:isPC()) then
merits = master:getMerit(dsp.merit.GRANDFALL);
end
tp = tp + (merits - 40);
if (tp > 300) then
tp = 300;
end
--note: this formula is only accurate for level 75 - 76+ may have a different intercept and/or slope
local damage = math.floor(512 + 1.72*(tp+1));
damage = damage + (dINT * 1.5);
damage = MobMagicalMove(pet,target,skill,damage,dsp.magic.ele.WATER,1,TP_NO_EFFECT,0);
damage = mobAddBonuses(pet, nil, target, damage.dmg, dsp.magic.ele.WATER);
damage = AvatarFinalAdjustments(damage,pet,skill,target,MOBSKILL_MAGICAL,MOBPARAM_NONE,1);
target:delHP(damage);
target:updateEnmityFromDamage(pet,damage);
return damage;
end | gpl-3.0 |
lordtg/jalebduni | plugins/inpm.lua | 1114 | 3008 | do
local function pairsByKeys (t, f)
local a = {}
for n in pairs(t) do table.insert(a, n) end
table.sort(a, f)
local i = 0 -- iterator variable
local iter = function () -- iterator function
i = i + 1
if a[i] == nil then return nil
else return a[i], t[a[i]]
end
end
return iter
end
local function chat_list(msg)
local data = load_data(_config.moderation.data)
local groups = 'groups'
if not data[tostring(groups)] then
return 'No groups at the moment'
end
local message = 'List of Groups:\n*Use /join (ID) to join*\n\n '
for k,v in pairs(data[tostring(groups)]) do
local settings = data[tostring(v)]['settings']
for m,n in pairsByKeys(settings) do
if m == 'set_name' then
name = n
end
end
message = message .. '👥 '.. name .. ' (ID: ' .. v .. ')\n\n '
end
local file = io.open("./groups/lists/listed_groups.txt", "w")
file:write(message)
file:flush()
file:close()
return message
end
local function run(msg, matches)
if msg.to.type ~= 'chat' or is_sudo(msg) or is_admin(msg) and is_realm(msg) then
local data = load_data(_config.moderation.data)
if matches[1] == 'join' and data[tostring(matches[2])] then
if is_banned(msg.from.id, matches[2]) then
return 'You are banned.'
end
if is_gbanned(msg.from.id) then
return 'You are globally banned.'
end
if data[tostring(matches[2])]['settings']['lock_member'] == 'yes' and not is_owner2(msg.from.id, matches[2]) then
return 'Group is private.'
end
local chat_id = "chat#id"..matches[2]
local user_id = "user#id"..msg.from.id
chat_add_user(chat_id, user_id, ok_cb, false)
local group_name = data[tostring(matches[2])]['settings']['set_name']
return "Added you to chat:\n\n👥"..group_name.." (ID:"..matches[2]..")"
elseif matches[1] == 'join' and not data[tostring(matches[2])] then
return "Chat not found."
end
if matches[1] == 'chats'then
if is_admin(msg) and msg.to.type == 'chat' then
return chat_list(msg)
elseif msg.to.type ~= 'chat' then
return chat_list(msg)
end
end
if matches[1] == 'chatlist'then
if is_admin(msg) and msg.to.type == 'chat' then
send_document("chat#id"..msg.from.id, "./groups/lists/listed_groups.txt", ok_cb, false)
elseif msg.to.type ~= 'chat' then
send_document("user#id"..msg.from.id, "./groups/lists/listed_groups.txt", ok_cb, false)
end
end
end
end
return {
patterns = {
"^[/!](chats)$",
"^[/!](chatlist)$",
"^[/!](join) (.*)$",
"^[/!](kickme) (.*)$",
"^!!tgservice (chat_add_user)$"
},
run = run,
}
end
| gpl-2.0 |
ViVoTm/sa | plugins/inpm.lua | 1114 | 3008 | do
local function pairsByKeys (t, f)
local a = {}
for n in pairs(t) do table.insert(a, n) end
table.sort(a, f)
local i = 0 -- iterator variable
local iter = function () -- iterator function
i = i + 1
if a[i] == nil then return nil
else return a[i], t[a[i]]
end
end
return iter
end
local function chat_list(msg)
local data = load_data(_config.moderation.data)
local groups = 'groups'
if not data[tostring(groups)] then
return 'No groups at the moment'
end
local message = 'List of Groups:\n*Use /join (ID) to join*\n\n '
for k,v in pairs(data[tostring(groups)]) do
local settings = data[tostring(v)]['settings']
for m,n in pairsByKeys(settings) do
if m == 'set_name' then
name = n
end
end
message = message .. '👥 '.. name .. ' (ID: ' .. v .. ')\n\n '
end
local file = io.open("./groups/lists/listed_groups.txt", "w")
file:write(message)
file:flush()
file:close()
return message
end
local function run(msg, matches)
if msg.to.type ~= 'chat' or is_sudo(msg) or is_admin(msg) and is_realm(msg) then
local data = load_data(_config.moderation.data)
if matches[1] == 'join' and data[tostring(matches[2])] then
if is_banned(msg.from.id, matches[2]) then
return 'You are banned.'
end
if is_gbanned(msg.from.id) then
return 'You are globally banned.'
end
if data[tostring(matches[2])]['settings']['lock_member'] == 'yes' and not is_owner2(msg.from.id, matches[2]) then
return 'Group is private.'
end
local chat_id = "chat#id"..matches[2]
local user_id = "user#id"..msg.from.id
chat_add_user(chat_id, user_id, ok_cb, false)
local group_name = data[tostring(matches[2])]['settings']['set_name']
return "Added you to chat:\n\n👥"..group_name.." (ID:"..matches[2]..")"
elseif matches[1] == 'join' and not data[tostring(matches[2])] then
return "Chat not found."
end
if matches[1] == 'chats'then
if is_admin(msg) and msg.to.type == 'chat' then
return chat_list(msg)
elseif msg.to.type ~= 'chat' then
return chat_list(msg)
end
end
if matches[1] == 'chatlist'then
if is_admin(msg) and msg.to.type == 'chat' then
send_document("chat#id"..msg.from.id, "./groups/lists/listed_groups.txt", ok_cb, false)
elseif msg.to.type ~= 'chat' then
send_document("user#id"..msg.from.id, "./groups/lists/listed_groups.txt", ok_cb, false)
end
end
end
end
return {
patterns = {
"^[/!](chats)$",
"^[/!](chatlist)$",
"^[/!](join) (.*)$",
"^[/!](kickme) (.*)$",
"^!!tgservice (chat_add_user)$"
},
run = run,
}
end
| gpl-2.0 |
kidaa/Awakening-Core3 | bin/scripts/commands/planetwarp.lua | 4 | 2123 | --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
PlanetwarpCommand = {
name = "planetwarp",
}
AddCommand(PlanetwarpCommand)
| lgpl-3.0 |
DeluxeTM/persianTdT | libs/url.lua | 31 | 8003 | -- کد های پایین در ربات نشان داده نمیشوند
-- http://permag.ir
-- @permag_ir
-- @permag_bots
-- @permag
local string = require("string")
local base = _G
local table = require("table")
local Url={}
Url._VERSION = "URL 1.0.2"
function Url.escape(s)
return string.gsub(s, "([^A-Za-z0-9_])", function(c)
return string.format("%%%02x", string.byte(c))
end)
end
local function make_set(t)
local s = {}
for i,v in base.ipairs(t) do
s[t[i]] = 1
end
return s
end
local segment_set = make_set {
"-", "_", ".", "!", "~", "*", "'", "(",
")", ":", "@", "&", "=", "+", "$", ",",
}
local function protect_segment(s)
return string.gsub(s, "([^A-Za-z0-9_])", function (c)
if segment_set[c] then return c
else return string.format("%%%02x", string.byte(c)) end
end)
end
function Url.unescape(s)
return string.gsub(s, "%%(%x%x)", function(hex)
return string.char(base.tonumber(hex, 16))
end)
end
local function absolute_path(base_path, relative_path)
if string.sub(relative_path, 1, 1) == "/" then return relative_path end
local path = string.gsub(base_path, "[^/]*$", "")
path = path .. relative_path
path = string.gsub(path, "([^/]*%./)", function (s)
if s ~= "./" then return s else return "" end
end)
path = string.gsub(path, "/%.$", "/")
local reduced
while reduced ~= path do
reduced = path
path = string.gsub(reduced, "([^/]*/%.%./)", function (s)
if s ~= "../../" then return "" else return s end
end)
end
path = string.gsub(reduced, "([^/]*/%.%.)$", function (s)
if s ~= "../.." then return "" else return s end
end)
return path
end
-----------------------------------------------------------------------------
-- Parses a url and returns a table with all its parts according to RFC 2396
-- The following grammar describes the names given to the URL parts
-- <url> ::= <scheme>://<authority>/<path>;<params>?<query>#<fragment>
-- <authority> ::= <userinfo>@<host>:<port>
-- <userinfo> ::= <user>[:<password>]
-- <path> :: = {<segment>/}<segment>
-- Input
-- url: uniform resource locator of request
-- default: table with default values for each field
-- Returns
-- table with the following fields, where RFC naming conventions have
-- been preserved:
-- scheme, authority, userinfo, user, password, host, port,
-- path, params, query, fragment
-- Obs:
-- the leading '/' in {/<path>} is considered part of <path>
-----------------------------------------------------------------------------
function Url.parse(url, default)
-- initialize default parameters
local parsed = {}
for i,v in base.pairs(default or parsed) do parsed[i] = v end
-- empty url is parsed to nil
if not url or url == "" then return nil, "invalid url" end
-- remove whitespace
-- url = string.gsub(url, "%s", "")
-- get fragment
url = string.gsub(url, "#(.*)$", function(f)
parsed.fragment = f
return ""
end)
-- get scheme
url = string.gsub(url, "^([%w][%w%+%-%.]*)%:",
function(s) parsed.scheme = s; return "" end)
-- get authority
url = string.gsub(url, "^//([^/]*)", function(n)
parsed.authority = n
return ""
end)
-- get query stringing
url = string.gsub(url, "%?(.*)", function(q)
parsed.query = q
return ""
end)
-- get params
url = string.gsub(url, "%;(.*)", function(p)
parsed.params = p
return ""
end)
-- path is whatever was left
if url ~= "" then parsed.path = url end
local authority = parsed.authority
if not authority then return parsed end
authority = string.gsub(authority,"^([^@]*)@",
function(u) parsed.userinfo = u; return "" end)
authority = string.gsub(authority, ":([^:]*)$",
function(p) parsed.port = p; return "" end)
if authority ~= "" then parsed.host = authority end
local userinfo = parsed.userinfo
if not userinfo then return parsed end
userinfo = string.gsub(userinfo, ":([^:]*)$",
function(p) parsed.password = p; return "" end)
parsed.user = userinfo
return parsed
end
-----------------------------------------------------------------------------
-- Rebuilds a parsed URL from its components.
-- Components are protected if any reserved or unallowed characters are found
-- Input
-- parsed: parsed URL, as returned by parse
-- Returns
-- a stringing with the corresponding URL
-----------------------------------------------------------------------------
function Url.build(parsed)
local ppath = Url.parse_path(parsed.path or "")
local url = Url.build_path(ppath)
if parsed.params then url = url .. ";" .. parsed.params end
if parsed.query then url = url .. "?" .. parsed.query end
local authority = parsed.authority
if parsed.host then
authority = parsed.host
if parsed.port then authority = authority .. ":" .. parsed.port end
local userinfo = parsed.userinfo
if parsed.user then
userinfo = parsed.user
if parsed.password then
userinfo = userinfo .. ":" .. parsed.password
end
end
if userinfo then authority = userinfo .. "@" .. authority end
end
if authority then url = "//" .. authority .. url end
if parsed.scheme then url = parsed.scheme .. ":" .. url end
if parsed.fragment then url = url .. "#" .. parsed.fragment end
-- url = string.gsub(url, "%s", "")
return url
end
-- Builds a absolute URL from a base and a relative URL according to RFC 2396
function Url.absolute(base_url, relative_url)
if base.type(base_url) == "table" then
base_parsed = base_url
base_url = Url.build(base_parsed)
else
base_parsed = Url.parse(base_url)
end
local relative_parsed = Url.parse(relative_url)
if not base_parsed then return relative_url
elseif not relative_parsed then return base_url
elseif relative_parsed.scheme then return relative_url
else
relative_parsed.scheme = base_parsed.scheme
if not relative_parsed.authority then
relative_parsed.authority = base_parsed.authority
if not relative_parsed.path then
relative_parsed.path = base_parsed.path
if not relative_parsed.params then
relative_parsed.params = base_parsed.params
if not relative_parsed.query then
relative_parsed.query = base_parsed.query
end
end
else
relative_parsed.path = absolute_path(base_parsed.path or "",
relative_parsed.path)
end
end
return Url.build(relative_parsed)
end
end
-- Breaks a path into its segments, unescaping the segments
function Url.parse_path(path)
local parsed = {}
path = path or ""
--path = string.gsub(path, "%s", "")
string.gsub(path, "([^/]+)", function (s) table.insert(parsed, s) end)
for i = 1, #parsed do
parsed[i] = Url.unescape(parsed[i])
end
if string.sub(path, 1, 1) == "/" then parsed.is_absolute = 1 end
if string.sub(path, -1, -1) == "/" then parsed.is_directory = 1 end
return parsed
end
-- Builds a path component from its segments, escaping protected characters.
function Url.build_path(parsed, unsafe)
local path = ""
local n = #parsed
if unsafe then
for i = 1, n-1 do
path = path .. parsed[i]
path = path .. "/"
end
if n > 0 then
path = path .. parsed[n]
if parsed.is_directory then path = path .. "/" end
end
else
for i = 1, n-1 do
path = path .. protect_segment(parsed[i])
path = path .. "/"
end
if n > 0 then
path = path .. protect_segment(parsed[n])
if parsed.is_directory then path = path .. "/" end
end
end
if parsed.is_absolute then path = "/" .. path end
return path
end
return Url
-- کد های پایین در ربات نشان داده نمیشوند
-- http://permag.ir
-- @permag_ir
-- @permag_bots
-- @permag | gpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/object/installation/faction_perk/minefield/base/minefield_base.lua | 3 | 2309 | --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_installation_faction_perk_minefield_base_minefield_base = object_installation_faction_perk_minefield_base_shared_minefield_base:new {
}
ObjectTemplates:addTemplate(object_installation_faction_perk_minefield_base_minefield_base, "object/installation/faction_perk/minefield/base/minefield_base.iff")
| lgpl-3.0 |
kidaa/Awakening-Core3 | bin/scripts/object/tangible/vendor/vendor_droid_power.lua | 3 | 2224 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_tangible_vendor_vendor_droid_power = object_tangible_vendor_shared_vendor_droid_power:new {
}
ObjectTemplates:addTemplate(object_tangible_vendor_vendor_droid_power, "object/tangible/vendor/vendor_droid_power.iff")
| lgpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.