repo_name
stringlengths
6
78
path
stringlengths
4
206
copies
stringclasses
281 values
size
stringlengths
4
7
content
stringlengths
625
1.05M
license
stringclasses
15 values
Whitechaser/darkstar
scripts/globals/weaponskills/smash_axe.lua
2
1607
----------------------------------- -- Smash Axe -- Axe weapon skill -- Skill level: 40 -- Stuns enemy. Duration of stun varies with TP. -- Will stack with Sneak Attack. -- Aligned with the Snow Gorget & Aqua Gorget. -- Aligned with the Snow Belt & Aqua Belt. -- Element: None -- Modifiers: STR:100% -- 100%TP 200%TP 300%TP -- 1.00 1.00 1.00 ----------------------------------- require("scripts/globals/status"); require("scripts/globals/settings"); require("scripts/globals/weaponskills"); ----------------------------------- function onUseWeaponSkill(player, target, wsID, tp, primary, action, taChar) local params = {}; params.numHits = 1; params.ftp100 = 1; params.ftp200 = 1; params.ftp300 = 1; params.str_wsc = 0.3; params.dex_wsc = 0.0; params.vit_wsc = 0.0; params.agi_wsc = 0.0; params.int_wsc = 0.0; params.mnd_wsc = 0.0; params.chr_wsc = 0.0; params.crit100 = 0.0; params.crit200 = 0.0; params.crit300 = 0.0; params.canCrit = false; params.acc100 = 0.0; params.acc200= 0.0; params.acc300= 0.0; params.atkmulti = 1; if (USE_ADOULIN_WEAPON_SKILL_CHANGES == true) then params.str_wsc = 1.0; end local damage, criticalHit, tpHits, extraHits = doPhysicalWeaponskill(player, target, wsID, tp, primary, action, taChar, params); if (damage > 0 and target:hasStatusEffect(dsp.effects.STUN) == false) then local duration = (tp/500) * applyResistanceAddEffect(player,target,ELE_LIGHTNING,0); target:addStatusEffect(dsp.effects.STUN, 1, 0, duration); end return tpHits, extraHits, criticalHit, damage; end
gpl-3.0
lasko2112/legend-of-hondo
MMOCoreORB/bin/scripts/screenplays/caves/tatooine_hutt_hideout.lua
3
6260
HuttHideoutScreenPlay = ScreenPlay:new { numberOfActs = 1, screenplayName = "HuttHideoutScreenPlay", lootContainers = { 134411, 8496263, 8496262, 8496261, 8496260 }, lootLevel = 26, lootGroups = { { groups = { {group = "color_crystals", chance = 200000}, {group = "junk", chance = 7600000}, {group = "heavy_weapons_consumable", chance = 500000}, {group = "rifles", chance = 500000}, {group = "carbines", chance = 500000}, {group = "pistols", chance = 500000}, {group = "clothing_attachments", chance = 100000}, {group = "armor_attachments", chance = 100000} }, lootChance = 8000000 } }, lootContainerRespawn = 1800 -- 30 minutes } registerScreenPlay("HuttHideoutScreenPlay", true) function HuttHideoutScreenPlay:start() if (isZoneEnabled("tatooine")) then self:spawnMobiles() self:initializeLootContainers() end end function HuttHideoutScreenPlay:spawnMobiles() spawnMobile("tatooine", "jabba_enforcer", 300, -3.5, -12.7, -6.7, 24, 4235585) spawnMobile("tatooine", "jabba_henchman", 300, 1.1, -14.4, -9.3, 15, 4235585) spawnMobile("tatooine", "jabba_compound_guard", 300, -12.1, -32.2, -34, 19, 4235586) spawnMobile("tatooine", "jabba_enforcer", 300, -10.5, -40.4, -81.3, -178, 4235587) spawnMobile("tatooine", "jabba_henchman", 300, 5.8, -40.9, -79.6, -37, 4235587) spawnMobile("tatooine", "jabba_enforcer", 300, 14.5, -40.5, -74.2, -131, 4235587) spawnMobile("tatooine", "jabba_enforcer", 300, 20, -39.6, -77.9, -50, 4235587) spawnMobile("tatooine", "jabba_henchman", 300, 10.7, -41.1, -60.3, -124, 4235587) spawnMobile("tatooine", "jabba_henchman", 300, 47, -46.7, -50.8, -163, 4235588) spawnMobile("tatooine", "jabba_henchman", 300, 50.4, -46.8, -58.6, -19, 4235588) spawnMobile("tatooine", "jabba_henchman", 300, 51.6, -46, -91.6, -126, 4235588) spawnMobile("tatooine", "jabba_enforcer", 300, 47.1, -46.2, -96.3, 46, 4235588) spawnMobile("tatooine", "jabba_compound_guard", 300, 44.9, -46.2, -102.8, -41, 4235588) spawnMobile("tatooine", "jabba_henchman", 300, 13.9, -45, -121.1, 30, 4235589) spawnMobile("tatooine", "jabba_enforcer", 300, 1.5, -45, -141.6, 117, 4235589) spawnMobile("tatooine", "jabba_henchman", 300, -10, -45.6, -148, 26, 4235589) spawnMobile("tatooine", "jabba_henchman", 300, -12.4, -45, -130.8, 125, 4235589) spawnMobile("tatooine", "jabba_henchman", 300, 58.8, -47.1, -124.6, -21, 4235589) spawnMobile("tatooine", "jabba_henchman", 300, 73.5, -52.9, -144.7, -178, 4235589) spawnMobile("tatooine", "jabba_enforcer", 300, 72.5, -54.4, -151.6, -20, 4235589) spawnMobile("tatooine", "jabba_enforcer", 300, 38.2, -55.7, -155.4, -78, 4235589) spawnMobile("tatooine", "jabba_henchman", 300, 36.9, -56.1, -157.2, -53, 4235589) spawnMobile("tatooine", "jabba_henchman", 300, 67.5, -57.3, -176.7, 62, 4235589) spawnMobile("tatooine", "jabba_enforcer", 300, 58.6, -57.7, -185.3, -70, 4235589) spawnMobile("tatooine", "jabba_henchman", 300, 53, -57, -185.3, 59, 4235589) spawnMobile("tatooine", "jabba_compound_guard", 300, 58.8, -56.4, -159.5, -60, 4235589) spawnMobile("tatooine", "jabba_compound_guard", 300, 53.3, -56.6, -160.2, 45, 4235589) spawnMobile("tatooine", "jabba_compound_guard", 300, 6, -63.9, -181.8, 90, 4235590) spawnMobile("tatooine", "jabba_compound_guard", 300, -8.1, -65.1, -201.3, -10, 4235590) spawnMobile("tatooine", "jabba_compound_guard", 300, -37.5, -67, -182.8, 91, 4235590) spawnMobile("tatooine", "jabba_henchman", 300, -18.7, -65.5, -210.3, -152, 4235591) spawnMobile("tatooine", "jabba_compound_guard", 300, -22.5, -64.6, -220.2, -131, 4235591) spawnMobile("tatooine", "jabba_henchman", 300, -17.6, -65.4, -216.8, -7, 4235591) spawnMobile("tatooine", "jabba_henchman", 300, -4.8, -64.2, -231.5, 178, 4235591) spawnMobile("tatooine", "jabba_assassin", 300, -1.3, -64.2, -238.5, 88, 4235591) spawnMobile("tatooine", "jabba_compound_guard", 300, -22.4, -65, -249.8, -174, 4235591) spawnMobile("tatooine", "jabba_henchman", 300, -19.3, -62.6, -261.6, 43, 4235591) spawnMobile("tatooine", "jabba_assassin", 300, -10.6, -63.3, -261.2, -77, 4235591) spawnMobile("tatooine", "jabba_henchman", 300, -57.1, -70.2, -193, -70, 4235592) spawnMobile("tatooine", "jabba_compound_guard", 300, -71.8, -68.6, -182.3, 99, 4235592) spawnMobile("tatooine", "jabba_henchman", 300, -59.3, -69.8, -170.9, -53, 4235592) spawnMobile("tatooine", "jabba_enforcer", 300, -71.5, -70, -166.7, 141, 4235592) spawnMobile("tatooine", "jabba_assassin", 300, -98.3, -72.4, -174.9, 72, 4235592) spawnMobile("tatooine", "jabba_henchman", 300, -112.2, -69.1, -119.7, 84, 4235592) spawnMobile("tatooine", "jabba_enforcer", 300, -106.1, -68.6, -112.2, -76, 4235592) spawnMobile("tatooine", "jabba_assassin", 300, -84.2, -70.3, -129.7, 83, 4235592) spawnMobile("tatooine", "jabba_enforcer", 300, -94.9, -102.6, -137.2, 154, 4235592) spawnMobile("tatooine", "jabba_enforcer", 300, -95.6, -102.1, -140.6, 0, 4235592) spawnMobile("tatooine", "jabba_henchman", 300, -51.4, -68.9, -95.4, 135, 4235593) spawnMobile("tatooine", "jabba_enforcer", 300, -47.6, -69.3, -95.4, -133, 4235593) spawnMobile("tatooine", "jabba_enforcer", 300, -46.3, -69.3, -99, -52, 4235593) spawnMobile("tatooine", "jabba_compound_guard", 300, -59.4, -70.1, -88, -179, 4235593) spawnMobile("tatooine", "jabba_henchman", 300, -69.4, -68.5, -101.7, 110, 4235593) spawnMobile("tatooine", "jabba_compound_guard", 300, -65.6, -68.3, -103.1, -74, 4235593) spawnMobile("tatooine", "jabba_assassin", 300, -8.6, -68.6, -97.1, -162, 4235593) spawnMobile("tatooine", "jabba_compound_guard", 300, -32.1, -80.2, -143.5, 80, 4235594) spawnMobile("tatooine", "jabba_henchman", 300, -19.7, -79.8, -146.9, -59, 4235594) spawnMobile("tatooine", "jabba_henchman", 300, -21.2, -79.6, -143.8, 160, 4235594) spawnMobile("tatooine", "jabba_compound_guard", 300, -78.6, -100.8, -125.9, -124, 4235595) spawnMobile("tatooine", "jabba_assassin", 300, -83.8, -100.6, -106.6, -1, 4235595) spawnMobile("tatooine", "jabba_enforcer", 300, -86.4, -100.5, -103.6, 123, 4235595) spawnMobile("tatooine", "jabba_assassin", 300, -100.4, -99.9, -114.2, 162, 4235595) spawnMobile("tatooine", "jabba_enforcer", 300, -98.3, -100, -105.2, -43, 4235595) end
agpl-3.0
Whitechaser/darkstar
scripts/zones/Attohwa_Chasm/mobs/Tiamat.lua
2
3007
----------------------------------- -- Area: Attohwa Chasm -- MOB: Tiamat ----------------------------------- require("scripts/globals/titles"); require("scripts/globals/status"); ----------------------------------- function onMobInitialize(mob) end; function onMobSpawn(mob) mob:SetMobSkillAttack(0); -- resetting so it doesn't respawn in flight mode. mob:AnimationSub(0); -- subanim 0 is only used when it spawns until first flight. end; function onMobFight(mob,target) -- Gains a large attack boost when health is under 25% which cannot be Dispelled. if (mob:getHP() < ((mob:getMaxHP() / 10) * 2.5)) then if (mob:hasStatusEffect(dsp.effects.ATTACK_BOOST) == false) then mob:addStatusEffect(dsp.effects.ATTACK_BOOST,75,0,0); mob:getStatusEffect(dsp.effects.ATTACK_BOOST):setFlag(32); end; end; if (mob:hasStatusEffect(dsp.effects.MIGHTY_STRIKES) == false and mob:actionQueueEmpty() == true) then local changeTime = mob:getLocalVar("changeTime") local twohourTime = mob:getLocalVar("twohourTime") local changeHP = mob:getLocalVar("changeHP") if (twohourTime == 0) then twohourTime = math.random(8, 14); mob:setLocalVar("twohourTime", twohourTime); end; if (mob:AnimationSub() == 2 and mob:getBattleTime()/15 > twohourTime) then mob:useMobAbility(688); mob:setLocalVar("twohourTime", math.random((mob:getBattleTime()/15)+4, (mob:getBattleTime()/15)+8)); elseif (mob:AnimationSub() == 0 and mob:getBattleTime() - changeTime > 60) then mob:AnimationSub(1); mob:addStatusEffectEx(dsp.effects.ALL_MISS, 0, 1, 0, 0); mob:SetMobSkillAttack(730); --and record the time and HP this phase was started mob:setLocalVar("changeTime", mob:getBattleTime()); mob:setLocalVar("changeHP", mob:getHP()/1000); -- subanimation 1 is flight, so check if she should land elseif (mob:AnimationSub() == 1 and (mob:getHP()/1000 <= changeHP - 10 or mob:getBattleTime() - changeTime > 120)) then mob:useMobAbility(1282); mob:setLocalVar("changeTime", mob:getBattleTime()); mob:setLocalVar("changeHP", mob:getHP()/1000); -- subanimation 2 is grounded mode, so check if she should take off elseif (mob:AnimationSub() == 2 and (mob:getHP()/1000 <= changeHP - 10 or mob:getBattleTime() - changeTime > 120)) then mob:AnimationSub(1); mob:addStatusEffectEx(dsp.effects.ALL_MISS, 0, 1, 0, 0); mob:SetMobSkillAttack(730); mob:setLocalVar("changeTime", mob:getBattleTime()); mob:setLocalVar("changeHP", mob:getHP()/1000); end; end; end; function onMobDeath(mob, player, isKiller) player:addTitle(TIAMAT_TROUNCER); end; function onMobDespawn(mob) mob:setRespawnTime(math.random(259200,432000)); -- 3 to 5 days end;
gpl-3.0
lasko2112/legend-of-hondo
MMOCoreORB/bin/scripts/object/tangible/crafting/serverobjects.lua
3
2357
--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 includeFile("tangible/crafting/base/serverobjects.lua") includeFile("tangible/crafting/station/serverobjects.lua") -- Server Objects includeFile("tangible/crafting/crafting_components_container.lua") includeFile("tangible/crafting/default_draft_not_found.lua") includeFile("tangible/crafting/missing_schematic_substitute.lua")
agpl-3.0
lasko2112/legend-of-hondo
MMOCoreORB/bin/scripts/object/building/military/outpost_cloning_facility.lua
3
3001
--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_outpost_cloning_facility = object_building_military_shared_outpost_cloning_facility:new { planetMapCategory = "cloningfacility", skillMods = { {"private_medical_rating", 100} }, childObjects = { {templateFile = "object/tangible/terminal/terminal_insurance.iff", x = -5.08604, z = 0.125266, y = -3.48717, ox = 0, oy = 0.722557, oz = 0, ow = 0.691312, cellid = 6, containmentType = -1}, {templateFile = "object/tangible/terminal/terminal_cloning.iff", x = 0.0387871, z = 0.125265, y = -6, ox = 0, oy = -0.0595427, oz = 0, ow = 0.998226, cellid = 3, containmentType = -1} }, spawningPoints = { { x = 3.2408, z = 0.125266, y = -3.59732, ow = -0.706572, ox = 0, oz = 0, oy = 0.707641, cellid = 5 } }, -- { x, z, y, ow, ox, oy, oz, cellid } templateType = CLONINGBUILDING } ObjectTemplates:addTemplate(object_building_military_outpost_cloning_facility, "object/building/military/outpost_cloning_facility.iff")
agpl-3.0
ollie27/openwrt_luci
protocols/luci-proto-3g/luasrc/model/cbi/admin_network/proto_3g.lua
52
4346
-- Copyright 2011 Jo-Philipp Wich <jow@openwrt.org> -- Licensed to the public under the Apache License 2.0. local map, section, net = ... local device, apn, service, pincode, username, password, dialnumber local ipv6, maxwait, defaultroute, metric, peerdns, dns, keepalive_failure, keepalive_interval, demand device = section:taboption("general", Value, "device", translate("Modem device")) device.rmempty = false local device_suggestions = nixio.fs.glob("/dev/tty[A-Z]*") or nixio.fs.glob("/dev/tts/*") if device_suggestions then local node for node in device_suggestions do device:value(node) end end service = section:taboption("general", Value, "service", translate("Service Type")) service:value("", translate("-- Please choose --")) service:value("umts", "UMTS/GPRS") service:value("umts_only", translate("UMTS only")) service:value("gprs_only", translate("GPRS only")) service:value("evdo", "CDMA/EV-DO") apn = section:taboption("general", Value, "apn", translate("APN")) pincode = section:taboption("general", Value, "pincode", translate("PIN")) username = section:taboption("general", Value, "username", translate("PAP/CHAP username")) password = section:taboption("general", Value, "password", translate("PAP/CHAP password")) password.password = true dialnumber = section:taboption("general", Value, "dialnumber", translate("Dial number")) dialnumber.placeholder = "*99***1#" if luci.model.network:has_ipv6() then ipv6 = section:taboption("advanced", ListValue, "ipv6") ipv6:value("auto", translate("Automatic")) ipv6:value("0", translate("Disabled")) ipv6:value("1", translate("Manual")) ipv6.default = "auto" end maxwait = section:taboption("advanced", Value, "maxwait", translate("Modem init timeout"), translate("Maximum amount of seconds to wait for the modem to become ready")) maxwait.placeholder = "20" maxwait.datatype = "min(1)" defaultroute = section:taboption("advanced", Flag, "defaultroute", translate("Use default gateway"), translate("If unchecked, no default route is configured")) defaultroute.default = defaultroute.enabled metric = section:taboption("advanced", Value, "metric", translate("Use gateway metric")) metric.placeholder = "0" metric.datatype = "uinteger" metric:depends("defaultroute", defaultroute.enabled) peerdns = section:taboption("advanced", Flag, "peerdns", translate("Use DNS servers advertised by peer"), translate("If unchecked, the advertised DNS server addresses are ignored")) peerdns.default = peerdns.enabled dns = section:taboption("advanced", DynamicList, "dns", translate("Use custom DNS servers")) dns:depends("peerdns", "") dns.datatype = "ipaddr" dns.cast = "string" keepalive_failure = section:taboption("advanced", Value, "_keepalive_failure", translate("LCP echo failure threshold"), translate("Presume peer to be dead after given amount of LCP echo failures, use 0 to ignore failures")) function keepalive_failure.cfgvalue(self, section) local v = m:get(section, "keepalive") if v and #v > 0 then return tonumber(v:match("^(%d+)[ ,]+%d+") or v) end end function keepalive_failure.write() end function keepalive_failure.remove() end keepalive_failure.placeholder = "0" keepalive_failure.datatype = "uinteger" keepalive_interval = section:taboption("advanced", Value, "_keepalive_interval", translate("LCP echo interval"), translate("Send LCP echo requests at the given interval in seconds, only effective in conjunction with failure threshold")) function keepalive_interval.cfgvalue(self, section) local v = m:get(section, "keepalive") if v and #v > 0 then return tonumber(v:match("^%d+[ ,]+(%d+)")) end end function keepalive_interval.write(self, section, value) local f = tonumber(keepalive_failure:formvalue(section)) or 0 local i = tonumber(value) or 5 if i < 1 then i = 1 end if f > 0 then m:set(section, "keepalive", "%d %d" %{ f, i }) else m:del(section, "keepalive") end end keepalive_interval.remove = keepalive_interval.write keepalive_interval.placeholder = "5" keepalive_interval.datatype = "min(1)" demand = section:taboption("advanced", Value, "demand", translate("Inactivity timeout"), translate("Close inactive connection after the given amount of seconds, use 0 to persist connection")) demand.placeholder = "0" demand.datatype = "uinteger"
apache-2.0
lasko2112/legend-of-hondo
MMOCoreORB/bin/scripts/object/tangible/mission/quest_item/nurla_slinthiss_q3_needed.lua
3
2300
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version object_tangible_mission_quest_item_nurla_slinthiss_q3_needed = object_tangible_mission_quest_item_shared_nurla_slinthiss_q3_needed:new { } ObjectTemplates:addTemplate(object_tangible_mission_quest_item_nurla_slinthiss_q3_needed, "object/tangible/mission/quest_item/nurla_slinthiss_q3_needed.iff")
agpl-3.0
Whitechaser/darkstar
scripts/zones/Dynamis-Xarcabard/TextIDs.lua
5
2230
-- Variable TextID Description text -- General Texts ITEM_CANNOT_BE_OBTAINED = 6380; -- You cannot obtain the item <item> come back again after sorting your inventory ITEM_OBTAINED = 6386; -- Obtained: <item> GIL_OBTAINED = 6387; -- Obtained <number> gil KEYITEM_OBTAINED = 6389; -- Obtained key item: <keyitem> ANIMATED_KNUCKLES_DIALOG = 7295; -- I am known as the Fists of Mystics. Come, show me your fighting spirit. ANIMATED_DAGGER_DIALOG = 7327; -- I am called the Ornate Blade. Now, show me your strength. ANIMATED_LONGSWORD_DIALOG = 7359; -- People have named me the Holy Blade. I will try thy resolution. ANIMATED_CLAYMORE_DIALOG = 7391; -- I am the Intricate Blade. Show me the depths of your fury! ANIMATED_TABAR_DIALOG = 7423; -- Me, axe. Runaeic, Axe. You, die ANIMATED_GREATAXE_DIALOG = 7455; -- I have been given the title of Seraphic Axe. Will you attempt to survive my love? ANIMATED_SPEAR_DIALOG = 7487; -- I am the Stellar Spear. It is time to test your courage. ANIMATED_SCYTHE_DIALOG = 7519; -- I am known as the Tenebrous Scythe. Overwhelm me with your greed for power. ANIMATED_KUNAI_DIALOG = 7551; -- I am called the Demoniac Blade. Allow me to witness your technique. ANIMATED_TACHI_DIALOG = 7583; -- I am the Divine Blade. I demand a test of your will. ANIMATED_HAMMER_DIALOG = 7615; -- People have named me the Heavenly Hammer. I will test your might to its very limits. ANIMATED_STAFF_DIALOG = 7647; -- I am called the Celestial Staff. I will glimpse into your mind's eye... ANIMATED_LONGBOW_DIALOG = 7679; -- I am known as the Snarled Bow. I will measure the limits of your determination. ANIMATED_GUN_DIALOG = 7711; -- I am known as the Ethereal Rifle. Do you realize my incredible value? ANIMATED_HORN_DIALOG = 7743; -- I am called the Mysterial Horn. Show me your true intentions. ANIMATED_SHIELD_DIALOG = 7775; -- I am Aegis, the impervious shield of everlasting. PRISON_OF_SOULS_HAS_SET_FREE = 7807; -- prison of souls has set free its captive spirits!?Prompt? -- conquest Base CONQUEST_BASE = 7053; -- Tallying conquest results...
gpl-3.0
Whitechaser/darkstar
scripts/globals/items/marinara_pizza_+1.lua
2
1230
----------------------------------------- -- ID: 5744 -- Item: marinara_pizza +1 -- Food Effect: 4 hours, all Races ----------------------------------------- -- HP +25 -- Attack +21% (cap 55) -- Accuracy +11% (cap 58) -- Undead Killer ----------------------------------------- require("scripts/globals/status"); ----------------------------------------- function onItemCheck(target) local result = 0; if (target:hasStatusEffect(dsp.effects.FOOD) == true or target:hasStatusEffect(dsp.effects.FIELD_SUPPORT_FOOD) == true) then result = 246; end return result; end; function onItemUse(target) target:addStatusEffect(dsp.effects.FOOD,0,0,14400,5744); end; function onEffectGain(target,effect) target:addMod(MOD_HP, 25); target:addMod(MOD_FOOD_ATTP, 21); target:addMod(MOD_FOOD_ATT_CAP, 55); target:addMod(MOD_FOOD_ACCP, 11); target:addMod(MOD_FOOD_ACC_CAP, 58); target:addMod(MOD_UNDEAD_KILLER, 5); end; function onEffectLose(target, effect) target:delMod(MOD_HP, 25); target:delMod(MOD_FOOD_ATTP, 21); target:delMod(MOD_FOOD_ATT_CAP, 55); target:delMod(MOD_FOOD_ACCP, 11); target:delMod(MOD_FOOD_ACC_CAP, 58); target:delMod(MOD_UNDEAD_KILLER, 5); end;
gpl-3.0
AxisAngles/Lua-Bitmap-Writer
source.lua
1
1904
--By Trey Reynolds --Create new canvas with newcanvas(width,height,blanketred,blanketgreen,blanketblue) --Canvas pixels are indexed with canvas[y][x], where y is from 1 to height, and x is from 1 to width --Subpixels are indexed with pixel.r, pixel.g, pixel.b --1,1 pixel is at the bottom left --Save to image with canvas:save() local newcanvas do local char =string.char local byte =string.byte local sub =string.sub local rep =string.rep local concat =table.concat local open =io.open local function tobytes(n) local r0=n%256 n=(n-r0)/256 local r1=n%256 n=(n-r1)/256 local r2=n%256 n=(n-r2)/256 local r3=n%256 return char(r0,r1,r2,r3) end local function save(self,path) path=path or self.path local h=self.h local w=self.w local n=1 local excess=-3*w%4 local bytes=h*(3*w+excess) local lineend=rep('\0',excess) local bmp={ "BM" ..tobytes(54+bytes) .."\0\0\0\0\54\0\0\0\40\0\0\0" ..tobytes(w)..tobytes(h) .."\1\0\24\0\0\0\0\0" ..tobytes(bytes) .."\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" } for i=1,h do local row=self[i] for j=1,w do local pixel=row[j] local r=255*pixel.r+0.5 local g=255*pixel.g+0.5 local b=255*pixel.b+0.5 r=r-r%1 g=g-g%1 b=b-b%1 n=n+1 bmp[n]=char( b~=b and 0 or b<0 and 0 or 255<b and 255 or b, g~=g and 0 or g<0 and 0 or 255<g and 255 or g, r~=r and 0 or r<0 and 0 or 255<r and 255 or r ) end n=n+1 bmp[n]=lineend end local data=concat(bmp) if path then local file=open(path,"wb") file:write(data) file:close() end return data end function newcanvas(w,h,r,g,b) r=r or 0 g=g or 0 b=b or 0 local newcanvas={ w=w; h=h; save=save; } for i=1,h do local row={} for j=1,w do row[j]={ r=r; g=g; b=b; } end newcanvas[i]=row end return newcanvas end end return newcanvas
mit
DailyShana/ygopro-scripts
c12510878.lua
3
2093
--天空勇士ネオパーシアス function c12510878.initial_effect(c) --special summon local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_SPSUMMON_PROC) e1:SetProperty(EFFECT_FLAG_UNCOPYABLE) e1:SetRange(LOCATION_HAND) e1:SetCondition(c12510878.spcon) e1:SetOperation(c12510878.spop) c:RegisterEffect(e1) --draw local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(12510878,0)) e2:SetCategory(CATEGORY_DRAW) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e2:SetCode(EVENT_BATTLE_DAMAGE) e2:SetCondition(c12510878.condition) e2:SetTarget(c12510878.target) e2:SetOperation(c12510878.operation) c:RegisterEffect(e2) --pierce local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE) e3:SetCode(EFFECT_PIERCE) c:RegisterEffect(e3) --update atk,def local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_SINGLE) e4:SetCode(EFFECT_UPDATE_ATTACK) e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e4:SetRange(LOCATION_MZONE) e4:SetValue(c12510878.val) c:RegisterEffect(e4) local e5=e4:Clone() e5:SetCode(EFFECT_UPDATE_DEFENCE) c:RegisterEffect(e5) end function c12510878.spcon(e,c) if c==nil then return true end return Duel.CheckReleaseGroup(c:GetControler(),Card.IsCode,1,nil,18036057) end function c12510878.spop(e,tp,eg,ep,ev,re,r,rp,c) local g=Duel.SelectReleaseGroup(c:GetControler(),Card.IsCode,1,1,nil,18036057) Duel.Release(g,REASON_COST) end function c12510878.condition(e,tp,eg,ep,ev,re,r,rp) return ep~=tp end function c12510878.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetTargetPlayer(tp) Duel.SetTargetParam(1) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) end function c12510878.operation(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) Duel.Draw(p,d,REASON_EFFECT) end function c12510878.val(e,c) if not Duel.IsEnvironment(56433456) then return 0 end local v=Duel.GetLP(c:GetControler())-Duel.GetLP(1-c:GetControler()) if v>0 then return v else return 0 end end
gpl-2.0
lasko2112/legend-of-hondo
MMOCoreORB/bin/scripts/object/tangible/ship/attachment/wing/hutt_medium_wing_s02.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_tangible_ship_attachment_wing_hutt_medium_wing_s02 = object_tangible_ship_attachment_wing_shared_hutt_medium_wing_s02:new { } ObjectTemplates:addTemplate(object_tangible_ship_attachment_wing_hutt_medium_wing_s02, "object/tangible/ship/attachment/wing/hutt_medium_wing_s02.iff")
agpl-3.0
DailyShana/ygopro-scripts
c38815069.lua
3
1282
--ライトロード・シーフ ライニャン function c38815069.initial_effect(c) --flip local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(38815069,0)) e1:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP) e1:SetTarget(c38815069.target) e1:SetOperation(c38815069.operation) c:RegisterEffect(e1) end function c38815069.filter(c) return c:IsSetCard(0x38) and c:IsType(TYPE_MONSTER) and c:IsAbleToDeck() end function c38815069.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c38815069.filter(chkc) end if chk==0 then return true end if Duel.IsExistingTarget(c38815069.filter,tp,LOCATION_GRAVE,0,1,nil) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local g=Duel.SelectTarget(tp,c38815069.filter,tp,LOCATION_GRAVE,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) end end function c38815069.operation(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) then local ct=Duel.SendtoDeck(tc,nil,0,REASON_EFFECT) if ct>0 then Duel.ShuffleDeck(tp) Duel.Draw(tp,1,REASON_EFFECT) end end end
gpl-2.0
lasko2112/legend-of-hondo
MMOCoreORB/bin/scripts/object/draft_schematic/chemistry/med_stimpack_state_intimidated_a.lua
2
3738
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version object_draft_schematic_chemistry_med_stimpack_state_intimidated_a = object_draft_schematic_chemistry_shared_med_stimpack_state_intimidated_a:new { templateType = DRAFTSCHEMATIC, customObjectName = "Intimidated State Stimpack - A", craftingToolTab = 64, -- (See DraftSchemticImplementation.h) complexity = 20, size = 3, xpType = "crafting_medicine_general", xp = 45, assemblySkill = "medicine_assembly", experimentingSkill = "medicine_experimentation", customizationSkill = "medicine_customization", customizationOptions = {}, customizationStringNames = {}, customizationDefaults = {}, ingredientTemplateNames = {"craft_chemical_ingredients_n", "craft_chemical_ingredients_n", "craft_chemical_ingredients_n", "craft_chemical_ingredients_n", "craft_chemical_ingredients_n", "craft_chemical_ingredients_n"}, ingredientTitleNames = {"body_shell", "organic_element", "inorganic_element", "delivery_medium", "drug_duration_compound", "drug_strength_compound"}, ingredientSlotType = {0, 0, 0, 1, 1, 1}, resourceTypes = {"metal", "organic", "inorganic", "object/tangible/component/chemistry/shared_liquid_delivery_suspension.iff", "object/tangible/component/chemistry/shared_release_mechanism_duration.iff", "object/tangible/component/chemistry/shared_biologic_effect_controller.iff"}, resourceQuantities = {2, 10, 10, 1, 1, 1}, contribution = {100, 100, 100, 100, 100, 100}, targetTemplate = "object/tangible/medicine/crafted/medpack_intimidated_a.iff", additionalTemplates = { } } ObjectTemplates:addTemplate(object_draft_schematic_chemistry_med_stimpack_state_intimidated_a, "object/draft_schematic/chemistry/med_stimpack_state_intimidated_a.iff")
agpl-3.0
Whitechaser/darkstar
scripts/globals/abilities/puppet_roll.lua
2
2877
----------------------------------- -- Ability: Puppet Roll -- Enhances pet magic attack and magic accuracy for party members within area of effect -- Optimal Job: Puppetmaster -- Lucky Number: 3 -- Unlucky Number: 7 -- Level: 52 -- Phantom Roll +1 Value: 3 -- -- Die Roll |No PUP |With PUP -- -------- ------- ---------- -- 1 |+4 |+12 -- 2 |+5 |+13 -- 3 |+18 |+26 -- 4 |+7 |+15 -- 5 |+9 |+17 -- 6 |+10 |+18 -- 7 |+2 |+10 -- 8 |+11 |+19 -- 9 |+13 |+21 -- 10 |+15 |+23 -- 11 |+22 |+30 -- Bust |-8 |-8 ----------------------------------- require("scripts/globals/settings"); require("scripts/globals/ability"); require("scripts/globals/status"); require("scripts/globals/msg"); ----------------------------------- function onAbilityCheck(player,target,ability) local effectID = dsp.effects.PUPPET_ROLL; ability:setRange(ability:getRange() + player:getMod(MOD_ROLL_RANGE)); if (player:hasStatusEffect(effectID)) then return msgBasic.ROLL_ALREADY_ACTIVE,0; elseif atMaxCorsairBusts(player) then return msgBasic.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.effects.PUPPET_ROLL, JOBS.PUP); 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(MERIT_WINNING_STREAK) + caster:getMod(MOD_PHANTOM_DURATION) local effectpowers = {4, 5, 18, 7, 9, 10, 2, 11, 13, 15, 22, 8} local effectpower = effectpowers[total]; if (caster:getLocalVar("corsairRollBonus") == 1 and total < 12) then effectpower = effectpower + 8 end -- Apply Additional Phantom Roll+ Buff local phantomBase = 3; -- Base increment buff local effectpower = effectpower + (phantomBase * phantombuffMultiple(caster)) -- Check if COR Main or Sub if (caster:getMainJob() == JOBS.COR and caster:getMainLvl() < target:getMainLvl()) then effectpower = effectpower * (caster:getMainLvl() / target:getMainLvl()); elseif (caster:getSubJob() == JOBS.COR and caster:getSubLvl() < target:getMainLvl()) then effectpower = effectpower * (caster:getSubLvl() / target:getMainLvl()); end if (target:addCorsairRoll(caster:getMainJob(), caster:getMerit(MERIT_BUST_DURATION), dsp.effects.PUPPET_ROLL, effectpower, 0, duration, caster:getID(), total, MOD_PET_MACC) == false) then ability:setMsg(msgBasic.ROLL_MAIN_FAIL); elseif total > 11 then ability:setMsg(msgBasic.DOUBLEUP_BUST); end return total; end
gpl-3.0
lasko2112/legend-of-hondo
MMOCoreORB/bin/scripts/object/static/particle/pt_survey.lua
3
2188
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version object_static_particle_pt_survey = object_static_particle_shared_pt_survey:new { } ObjectTemplates:addTemplate(object_static_particle_pt_survey, "object/static/particle/pt_survey.iff")
agpl-3.0
lasko2112/legend-of-hondo
MMOCoreORB/bin/scripts/object/tangible/medicine/crafted/medpack_disease_area_willpower_b.lua
2
3391
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version object_tangible_medicine_crafted_medpack_disease_area_willpower_b = object_tangible_medicine_crafted_shared_medpack_disease_area_willpower_b:new { gameObjectType = 8240, templateType = DOTPACK, useCount = 10, medicineUse = 5, effectiveness = 100, duration = 300, range = 8, rangeMod = 0.6, pool = 8, dotType = DISEASED, potency = 250, commandToExecute = "applydisease", area = 10, numberExperimentalProperties = {1, 1, 2, 2, 2, 2, 2, 2, 2, 1}, experimentalProperties = {"XX", "XX", "OQ", "PE", "OQ", "UT", "CD", "OQ", "CD", "OQ", "OQ", "PE", "OQ", "PE", "DR", "OQ", "XX"}, experimentalWeights = {1, 1, 2, 1, 2, 1, 1, 2, 1, 2, 2, 1, 2, 1, 1, 1, 1}, experimentalGroupTitles = {"null", "null", "exp_effectiveness", "exp_charges", "exp_charges", "exp_effectiveness", "expEaseOfUse", "expEaseOfUse", "exp_effectiveness", "null"}, experimentalSubGroupTitles = {"null", "null", "power", "charges", "range", "area", "skillmodmin", "potency", "duration", "hitpoints"}, experimentalMin = {0, 0, 10, 10, 15, 5, 90, 25, 120, 1000}, experimentalMax = {0, 0, 30, 25, 30, 15, 60, 100, 800, 1000}, experimentalPrecision = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, experimentalCombineType = {0, 0, 1, 1, 1, 1, 1, 1, 1, 4}, } ObjectTemplates:addTemplate(object_tangible_medicine_crafted_medpack_disease_area_willpower_b, "object/tangible/medicine/crafted/medpack_disease_area_willpower_b.iff")
agpl-3.0
DailyShana/ygopro-scripts
c8967776.lua
3
2464
--究極時械神セフィロン function c8967776.initial_effect(c) c:EnableReviveLimit() --cannot special summon local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetCode(EFFECT_SPSUMMON_CONDITION) e1:SetValue(aux.FALSE) c:RegisterEffect(e1) --spsummon local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_SPSUMMON_PROC) e2:SetProperty(EFFECT_FLAG_UNCOPYABLE) e2:SetRange(LOCATION_HAND) e2:SetCondition(c8967776.spcon) c:RegisterEffect(e2) --spsummon local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(8967776,0)) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetCountLimit(1) e3:SetRange(LOCATION_MZONE) e3:SetTarget(c8967776.sptg) e3:SetOperation(c8967776.spop) c:RegisterEffect(e3) end function c8967776.spcon(e,c) if c==nil then return true end return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(Card.IsType,c:GetControler(),LOCATION_GRAVE,0,10,nil,TYPE_MONSTER) end function c8967776.filter(c,e,tp) return c:IsRace(RACE_FAIRY) and c:GetLevel()>=8 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and not c:IsHasEffect(EFFECT_NECRO_VALLEY) end function c8967776.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c8967776.filter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE+LOCATION_HAND) end function c8967776.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,c8967776.filter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,1,nil,e,tp) local c=e:GetHandler() local tc=g:GetFirst() if not tc then return end local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_DISABLE) e1:SetReset(RESET_EVENT+0xfe0000) tc:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetReset(RESET_EVENT+0xfe0000) tc:RegisterEffect(e2) local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE) e3:SetCode(EFFECT_SET_ATTACK) e3:SetValue(4000) e3:SetReset(RESET_EVENT+0xfe0000) tc:RegisterEffect(e3) Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end
gpl-2.0
lasko2112/legend-of-hondo
MMOCoreORB/bin/scripts/object/tangible/loot/collectible/collectible_parts/orange_rug_thread_02.lua
3
2344
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version object_tangible_loot_collectible_collectible_parts_orange_rug_thread_02 = object_tangible_loot_collectible_collectible_parts_shared_orange_rug_thread_02:new { } ObjectTemplates:addTemplate(object_tangible_loot_collectible_collectible_parts_orange_rug_thread_02, "object/tangible/loot/collectible/collectible_parts/orange_rug_thread_02.iff")
agpl-3.0
DailyShana/ygopro-scripts
c26493435.lua
3
2549
--希望郷-オノマトピア- function c26493435.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) c:RegisterEffect(e1) --add counter local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetRange(LOCATION_SZONE) e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetCondition(c26493435.ctcon) e2:SetOperation(c26493435.ctop) c:RegisterEffect(e2) --atk/def local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_FIELD) e3:SetCode(EFFECT_UPDATE_ATTACK) e3:SetRange(LOCATION_SZONE) e3:SetTargetRange(LOCATION_MZONE,0) e3:SetValue(c26493435.val) c:RegisterEffect(e3) local e4=e3:Clone() e4:SetCode(EFFECT_UPDATE_DEFENCE) c:RegisterEffect(e4) --special summon local e5=Effect.CreateEffect(c) e5:SetDescription(aux.Stringid(26493435,0)) e5:SetCategory(CATEGORY_SPECIAL_SUMMON) e5:SetType(EFFECT_TYPE_IGNITION) e5:SetRange(LOCATION_SZONE) e5:SetCountLimit(1) e5:SetCost(c26493435.spcost) e5:SetTarget(c26493435.sptg) e5:SetOperation(c26493435.spop) c:RegisterEffect(e5) end function c26493435.ctfilter(c,tp) return c:IsFaceup() and c:IsSetCard(0x7f) and c:IsControler(tp) end function c26493435.ctcon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(c26493435.ctfilter,1,nil,tp) end function c26493435.ctop(e,tp,eg,ep,ev,re,r,rp) e:GetHandler():AddCounter(0x30,1) end function c26493435.val(e,c) return e:GetHandler():GetCounter(0x30)*200 end function c26493435.spcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsCanRemoveCounter(tp,0x30,2,REASON_COST) end e:GetHandler():RemoveCounter(tp,0x30,2,REASON_COST) end function c26493435.filter(c,e,tp) return (c:IsSetCard(0x8f) or c:IsSetCard(0x54) or c:IsSetCard(0x59) or c:IsSetCard(0x82)) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function c26493435.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c26493435.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) end function c26493435.spop(e,tp,eg,ep,ev,re,r,rp) if not e:GetHandler():IsRelateToEffect(e) then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,c26493435.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp) if g:GetCount()>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end
gpl-2.0
lasko2112/legend-of-hondo
MMOCoreORB/bin/scripts/object/tangible/loot/loot_schematic/corellian_corvette_rifle_berserker_schematic.lua
2
2681
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version object_tangible_loot_loot_schematic_corellian_corvette_rifle_berserker_schematic = object_tangible_loot_loot_schematic_shared_corellian_corvette_rifle_berserker_schematic:new { templateType = LOOTSCHEMATIC, objectMenuComponent = {"cpp", "LootSchematicMenuComponent"}, attributeListComponent = "LootSchematicAttributeListComponent", requiredSkill = "crafting_weaponsmith_master", targetDraftSchematic = "object/draft_schematic/weapon/rifle_berserker.iff", targetUseCount = 5 } ObjectTemplates:addTemplate(object_tangible_loot_loot_schematic_corellian_corvette_rifle_berserker_schematic, "object/tangible/loot/loot_schematic/corellian_corvette_rifle_berserker_schematic.iff")
agpl-3.0
lasko2112/legend-of-hondo
MMOCoreORB/bin/scripts/object/mobile/dressed_imperial_soldier_m.lua
3
2220
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version object_mobile_dressed_imperial_soldier_m = object_mobile_shared_dressed_imperial_soldier_m:new { } ObjectTemplates:addTemplate(object_mobile_dressed_imperial_soldier_m, "object/mobile/dressed_imperial_soldier_m.iff")
agpl-3.0
DailyShana/ygopro-scripts
c63746411.lua
3
2182
--No.106 巨岩掌ジャイアント・ハンド function c63746411.initial_effect(c) --xyz summon aux.AddXyzProcedure(c,nil,4,2) c:EnableReviveLimit() --negate local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(63746411,0)) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetCode(EVENT_CHAINING) e1:SetRange(LOCATION_MZONE) e1:SetCondition(c63746411.condition) e1:SetCost(c63746411.cost) e1:SetTarget(c63746411.target) e1:SetOperation(c63746411.operation) c:RegisterEffect(e1) end c63746411.xyz_number=106 function c63746411.condition(e,tp,eg,ep,ev,re,r,rp) return rp~=tp and re:IsActiveType(TYPE_MONSTER) and Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)==LOCATION_MZONE end function c63746411.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,2,REASON_COST) end e:GetHandler():RemoveOverlayCard(tp,2,2,REASON_COST) end function c63746411.filter(c) return c:IsFaceup() and c:IsType(TYPE_EFFECT) end function c63746411.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c63746411.filter(chkc) end if chk==0 then return Duel.IsExistingTarget(c63746411.filter,tp,0,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) local g=Duel.SelectTarget(tp,c63746411.filter,tp,0,LOCATION_MZONE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0) end function c63746411.operation(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() if c:IsFaceup() and c:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsRelateToEffect(e) and tc:IsType(TYPE_EFFECT) then c:SetCardTarget(tc) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_OWNER_RELATE) e1:SetRange(LOCATION_MZONE) e1:SetCode(EFFECT_DISABLE) e1:SetReset(RESET_EVENT+0x1fe0000) e1:SetCondition(c63746411.rcon) tc:RegisterEffect(e1,true) local e2=e1:Clone() e2:SetCode(EFFECT_CANNOT_CHANGE_POSITION) tc:RegisterEffect(e2,true) end end function c63746411.rcon(e) return e:GetOwner():IsHasCardTarget(e:GetHandler()) end
gpl-2.0
lasko2112/legend-of-hondo
MMOCoreORB/bin/scripts/object/tangible/skill_buff/skill_buff_carbine_accuracy.lua
2
2563
--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_skill_buff_skill_buff_carbine_accuracy = object_tangible_skill_buff_shared_skill_buff_carbine_accuracy:new { templateType = SKILLBUFF, objectMenuComponent = {"cpp", "SkillBuffObjectMenuComponent"}, attributeListComponent = "SkillBuffObjectAttributeListComponent", duration = 300, useCount = 5, modifiers = { "carbine_accuracy", 10 }, buffName = "carbine_accuracy", buffCRC = 0xA996D07E } ObjectTemplates:addTemplate(object_tangible_skill_buff_skill_buff_carbine_accuracy, "object/tangible/skill_buff/skill_buff_carbine_accuracy.iff")
agpl-3.0
ArashEmpix/Empix
plugins/Tools_Manager.lua
1
8623
-- webshot-- local helpers = require "OAuth.helpers" local base = 'https://screenshotmachine.com/' local url = base .. 'processor.php' local function get_webshot_url(param) local response_body = {} local request_constructor = { url = url, method = "GET", sink = ltn12.sink.table(response_body), headers = { referer = base, dnt = "1", origin = base, ["User-Agent"] = "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.101 Safari/537.36" }, redirect = false } local arguments = { urlparam = param, size = "FULL" } request_constructor.url = url .. "?" .. helpers.url_encode_arguments(arguments) local ok, response_code, response_headers, response_status_line = https.request(request_constructor) if not ok or response_code ~= 200 then return nil end local response = table.concat(response_body) return string.match(response, "href='(.-)'") end --set-- local function save_value(msg, name, value) if (not name or not value) then return end local hash = nil if msg.to.type == 'channel' then hash = 'chat:'..msg.to.id..':variables' end if msg.to.type == 'chat' then hash = 'chat:'..msg.to.id..':variables' end if msg.to.type == 'user' then hash = 'user:'..msg.from.id..':variables' end if hash then redis:hset(hash, name, value) return "Saved "..name.." 👉 "..value end end --get-- local function get_variables_hash(msg) if msg.to.type == 'channel' then return 'chat:'..msg.to.id..':variables' end if msg.to.type == 'chat' then return 'chat:'..msg.to.id..':variables' end if msg.to.type == 'user' then return 'user:'..msg.from.id..':variables' end end local function list_variables(msg) local hash = get_variables_hash(msg) if hash then local names = redis:hkeys(hash) local text = '' for i=1, #names do text = text..names[i]..'\n' end return text end end local function get_value(msg, var_name) local hash = get_variables_hash(msg) if hash then local value = redis:hget(hash, var_name) if not value then return else return value end end end --insta-- local access_token = "3084249803.280d5d7.999310365c8248f8948ee0f6929c2f02" 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.."Username: "..user.data.username:upper().."\n\n" else text = text.."Username: "..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.."Name: "..user.data.full_name.."\n" end text = text.."Media Count: "..user.data.counts.media.."\n" text = text.."Following: "..user.data.counts.follows.."\n" text = text.."Followers: "..user.data.counts.followed_by.."\n" if user.data.website ~= '' then text = text.."Website: "..user.data.website.."\n" end text = text 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.."Username: "..data.from.username:upper().."\n\n" text = text..data.from.full_name.."\n\n" text = text..data.text.."\n\n" text = text.."Like Count: "..jdat.data.likes.count.."\n" else text = text.."Username: "..jdat.data.user.username:upper().."\n" text = text.."Name: "..jdat.data.user.full_name.."\n" text = text.."Like Count: "..jdat.data.likes.count.."\n" end text = text send_msg(receiver,text,ok_cb,false) end --google-- local function googlethat(query) local api = "http://ajax.googleapis.com/ajax/services/search/web?v=1.0&" local parameters = "q=".. (URL.escape(query) or "") -- Do the request local res, code = https.request(api..parameters) if code ~=200 then return nil end local data = json:decode(res) local results = {} for key,result in ipairs(data.responseData.results) do table.insert(results, { result.titleNoFormatting, result.unescapedUrl or result.url }) end return results end local function stringlinks(results) local stringresults="" for key,val in ipairs(results) do stringresults=stringresults..val[1].." - "..val[2].."\n" end return stringresults end local function run(msg, matches) if matches[1] == 'google' and is_sudo(msg) then local results = googlethat(matches[1]) return 'نتایج جستجو\n\n'..stringlinks(results) end if matches[1] == 'webshot' and is_sudo(msg) then local find = get_webshot_url(matches[2]) if find then local imgurl = base .. find local receiver = get_receiver(msg) send_photo_from_url(receiver, imgurl) end end if matches[1] == 'sticker' and is_sudo(msg) then local texturl = "http://latex.codecogs.com/png.download?".."\\dpi{800}%20\\LARGE%20"..URL.escape(matches[2]) local receiver = get_receiver(msg) local file = download_to_file(texturl,'text.webp') send_document('chat#id'..msg.to.id, file, ok_cb , false) send_document('channel#id'..msg.to.id, file, ok_cb , false) end if matches[1] == 'voice' and is_sudo(msg) then local voiceapi = "http://tts.baidu.com/text2audio?lan=en&ie=UTF-8&text="..URL.escape(matches[2]) local receiver = get_receiver(msg) local file = download_to_file(voiceapi,'text.ogg') send_audio('channel#id'..msg.to.id, file, ok_cb , false) send_audio('chat#id'..msg.to.id, file, ok_cb , false) end if matches[1] == "insta" and not matches[3] and is_sudo(msg) then return instagramUser(msg,matches[2]) end if matches[1] == "insta" and matches[3] and is_sudo(msg) then local media = matches[3] if string.match(media , '/') then media = media:gsub("/", "") end return instagramMedia(msg,media) end if matches[1] == 'set' and is_sudo(msg) then local name = string.sub(matches[2], 1, 50) local value = string.sub(matches[3], 1, 1000) local text = save_value(msg, name, value) return text end if matches[1] == 'get' and is_sudo(msg) then if matches[2] then return get_value(msg, matches[2]) else return list_variables(msg) end end end return { description = "funny plugin", usage = "see commands in patterns", patterns = { "^[#/](google) (.*)$", "^[#/](webshot) (https?://[%w-_%.%?%.:/%+=&]+)$", "^[#/](voice) (.+)$", "^[#/](insta) ([Hh]ttps://www.instagram.com/p/)([^%s]+)$", "^[#/](insta) ([Hh]ttps://instagram.com/p/)([^%s]+)$", "^[#/](insta) ([Hh]ttp://www.instagram.com/p/)([^%s]+)$", "^[#/](insta) ([Hh]ttp://instagram.com/p/)([^%s]+)$", "^[#/](insta) (.*)$", "^[#/](set) ([^%s]+) (.*)$", "^[#/](get) (.*)$", "^[#/](sticker) (.*)$", }, run = run }
mit
lasko2112/legend-of-hondo
MMOCoreORB/bin/scripts/object/draft_schematic/space/armor/mass_reduction_kit_mk2.lua
2
3294
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version object_draft_schematic_space_armor_mass_reduction_kit_mk2 = object_draft_schematic_space_armor_shared_mass_reduction_kit_mk2:new { templateType = DRAFTSCHEMATIC, customObjectName = "Mass Reduction Kit - Mark II", craftingToolTab = 131072, -- (See DraftSchemticImplementation.h) complexity = 23, size = 1, xpType = "shipwright", xp = 63, assemblySkill = "chassis_assembly", experimentingSkill = "chassis_experimentation", customizationSkill = "medicine_customization", customizationOptions = {}, customizationStringNames = {}, customizationDefaults = {}, ingredientTemplateNames = {"craft_item_ingredients_n", "craft_item_ingredients_n"}, ingredientTitleNames = {"lighter_ship_materials", "ultralight_alloy"}, ingredientSlotType = {0, 0}, resourceTypes = {"aluminum", "aluminum_perovskitic"}, resourceQuantities = {175, 75}, contribution = {100, 100}, targetTemplate = "object/tangible/ship/crafted/armor/mass_reduction_kit_mk2.iff", additionalTemplates = { "object/tangible/ship/crafted/armor/shared_mass_reduction_kit_mk2.iff", } } ObjectTemplates:addTemplate(object_draft_schematic_space_armor_mass_reduction_kit_mk2, "object/draft_schematic/space/armor/mass_reduction_kit_mk2.iff")
agpl-3.0
lasko2112/legend-of-hondo
MMOCoreORB/bin/scripts/object/static/item/wp_mle_lance_staff_wood_s02.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_mle_lance_staff_wood_s02 = object_static_item_shared_wp_mle_lance_staff_wood_s02:new { } ObjectTemplates:addTemplate(object_static_item_wp_mle_lance_staff_wood_s02, "object/static/item/wp_mle_lance_staff_wood_s02.iff")
agpl-3.0
lasko2112/legend-of-hondo
MMOCoreORB/bin/scripts/object/draft_schematic/structure/city/theater_tatooine.lua
2
3679
--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_structure_city_theater_tatooine = object_draft_schematic_structure_city_shared_theater_tatooine:new { templateType = DRAFTSCHEMATIC, customObjectName = "Deed for: Tatooine Theater", craftingToolTab = 1024, -- (See DraftSchemticImplementation.h) complexity = 24, size = 14, xpType = "crafting_structure_general", xp = 7250, assemblySkill = "structure_assembly", experimentingSkill = "structure_experimentation", customizationSkill = "structure_customization", customizationOptions = {}, customizationStringNames = {}, customizationDefaults = {}, ingredientTemplateNames = {"craft_structure_ingredients_n", "craft_structure_ingredients_n", "craft_structure_ingredients_n", "craft_structure_ingredients_n", "craft_structure_ingredients_n", "craft_structure_ingredients_n"}, ingredientTitleNames = {"load_bearing_structure_and_shell", "insulation_and_covering", "foundation", "wall_sections", "power_supply_unit", "storage_space"}, ingredientSlotType = {0, 0, 0, 2, 1, 1}, resourceTypes = {"metal", "ore", "ore", "object/tangible/component/structure/shared_wall_module.iff", "object/tangible/component/structure/shared_power_core_unit.iff", "object/tangible/component/structure/shared_structure_storage_section.iff"}, resourceQuantities = {1500, 2000, 300, 8, 1, 3}, contribution = {100, 100, 100, 100, 100, 100}, targetTemplate = "object/tangible/deed/city_deed/theater_tatooine_deed.iff", additionalTemplates = { } } ObjectTemplates:addTemplate(object_draft_schematic_structure_city_theater_tatooine, "object/draft_schematic/structure/city/theater_tatooine.iff")
agpl-3.0
boundary/boundary-plugin-spark
init.lua
2
7109
-- Copyright 2015 BMC Software, Inc. -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. local framework = require('framework.lua') local json = require('json') local Plugin = framework.Plugin local WebRequestDataSource = framework.WebRequestDataSource local PollerCollection = framework.PollerCollection local DataSourcePoller = framework.DataSourcePoller local megaBytesToBytes = framework.util.megaBytesToBytes local isHttpSuccess = framework.util.isHttpSuccess local parseJson = framework.util.parseJson local ipack = framework.util.ipack framework.functional() framework.table() framework.string() local params = framework.boundary.param local function createOptions(config) local options = {} options.host = config.host options.port = config.port options.path = '' return options end local function addPollers(item, pollers) if(item.instance_type == 'master') then --Datasource to poll all the master details. local options = createOptions(item) options.path = '/metrics/master/json/' options.meta = { instance_type = 'master', source = item.source } local ds1 = WebRequestDataSource:new(options) pollers:add(DataSourcePoller:new(item.pollInterval, ds1)) --Datasource to poll active drivers local options1 = createOptions(item) options1.path = '/json/' options1.meta = { instance_type = 'drivers', source = item.source } local ds2 = WebRequestDataSource:new(options1) pollers:add(DataSourcePoller:new(item.pollInterval, ds2)) else --Datasource to poll all the worker application details. item.path = '/metrics/json/' item.meta = { instance_type = 'app', source = item.source } local ds3 = WebRequestDataSource:new(item) pollers:add(DataSourcePoller:new(item.pollInterval, ds3)) end end local function createPollers(items) local pollers = PollerCollection:new() for _, item in ipairs(items) do addPollers(item, pollers) end return pollers end local function getFuzzy(fuzzyKey, map) local predicate = partial(contains, escape(fuzzyKey)) local k = filter(predicate, keys(map))[1] return get(k, map) end local pollers = createPollers(params.items) local plugin = Plugin:new(params, pollers) local getValue = partial(get, 'value') local getFuzzyValue = compose(getFuzzy, getValue) local getFuzzyNumber = compose(getFuzzyValue, tonumber) function plugin:onParseValues(data, extra) if not isHttpSuccess(extra.status_code) then self:emitEvent('error', ('Http Response status code %d instead of OK. Verify your Spark endpoint configuration.'):format(extra.status_code)) return end local success, parsed = parseJson(data) if not success then self:emitEvent('error', 'Can not parse metrics. Verify your Spark endpoint configuration.') return end local result = {} local source = extra.info.source local metric = function (...) ipack(result, ...) end local instance_type = extra.info.instance_type if instance_type == 'master' then metric('SPARK_MASTER_ALIVE_WORKERS_COUNT', getValue(parsed.gauges['master.aliveWorkers']), nil, source) metric('SPARK_MASTER_WORKERS_COUNT', getValue(parsed.gauges['master.workers']), nil, source) local runningApps = getValue(parsed.gauges['master.apps']) local waitingApps = getValue(parsed.gauges['master.waitingApps']) metric('SPARK_MASTER_APPLICATIONS_RUNNING_COUNT', runningApps, nil, source) metric('SPARK_MASTER_APPLICATIONS_WAITING_COUNT', waitingApps, nil, source) if(runningApps == 0 and waitingApps > 0) then metric('SPARK_MASTER_NO_APPLICATIONS_RUNNING', 1, nil, source) else metric('SPARK_MASTER_NO_APPLICATIONS_RUNNING', 0, nil, source) end metric('SPARK_MASTER_JVM_MEMORY_USED', getValue(parsed.gauges['jvm.total.used']), nil, source) metric('SPARK_MASTER_JVM_MEMORY_COMMITTED', getValue(parsed.gauges['jvm.total.committed']), nil, source) metric('SPARK_MASTER_JVM_HEAP_MEMORY_COMMITTED', getValue(parsed.gauges['jvm.heap.committed']), nil, source) metric('SPARK_MASTER_JVM_HEAP_MEMORY_USED', getValue(parsed.gauges['jvm.heap.used']), nil, source) metric('SPARK_MASTER_JVM_HEAP_MEMORY_USAGE', getValue(parsed.gauges['jvm.heap.usage']), nil, source) metric('SPARK_MASTER_JVM_NONHEAP_MEMORY_COMMITTED', getValue(parsed.gauges['jvm.non-heap.committed']), nil, source) metric('SPARK_MASTER_JVM_NONHEAP_MEMORY_USED', getValue(parsed.gauges['jvm.non-heap.used']), nil, source) metric('SPARK_MASTER_JVM_NONHEAP_MEMORY_USAGE', getValue(parsed.gauges['jvm.non-heap.usage']), nil, source) elseif instance_type == 'drivers' then local activeDrivers = parsed.activedrivers if(activeDrivers ~= nil) then metric('SPARK_MASTER_ACTIVE_DRIVERS', table.getn(activeDrivers), nil, source) end elseif instance_type == 'app' then parsed = get('gauges', parsed) metric('SPARK_APP_JOBS_ACTIVE', getFuzzyValue('job.activeJobs', parsed), nil, source) metric('SPARK_APP_JOBS_ALL', getFuzzyValue('job.allJobs', parsed), nil, source) metric('SPARK_APP_STAGES_FAILED', getFuzzyValue('stage.failedStages', parsed), nil, source) metric('SPARK_APP_STAGES_RUNNING', getFuzzyValue('stage.runningStages', parsed), nil, source) metric('SPARK_APP_STAGES_WAITING', getFuzzyValue('stage.waitingStages', parsed), nil, source) metric('SPARK_APP_BLKMGR_DISK_SPACE_USED', megaBytesToBytes(getFuzzyNumber('BlockManager.disk.diskSpaceUsed_MB', parsed)), nil, source) metric('SPARK_APP_BLKMGR_MEMORY_USED', megaBytesToBytes(getFuzzyNumber('BlockManager.memory.memUsed_MB', parsed)), nil, source) metric('SPARK_APP_BLKMGR_MEMORY_FREE', megaBytesToBytes(getFuzzyNumber('BlockManager.memory.remainingMem_MB', parsed)), nil, source) metric('SPARK_APP_JVM_MEMORY_COMMITTED', getFuzzyNumber('jvm.total.committed', parsed), nil, source) metric('SPARK_APP_JVM_MEMORY_USED', getFuzzyNumber('jvm.total.used', parsed), nil, source) metric('SPARK_APP_JVM_HEAP_MEMORY_COMMITTED', getFuzzyNumber('jvm.heap.committed', parsed), nil, source) metric('SPARK_APP_JVM_HEAP_MEMORY_USED', getFuzzyNumber('jvm.heap.used', parsed), nil, source) metric('SPARK_APP_JVM_HEAP_MEMORY_USAGE', getFuzzyNumber('jvm.heap.usage', parsed), nil, source) metric('SPARK_APP_JVM_NONHEAP_MEMORY_COMMITTED', getFuzzyNumber('jvm.non-heap.committed', parsed), nil, source) metric('SPARK_APP_JVM_NONHEAP_MEMORY_USED', getFuzzyNumber('jvm.non-heap.used', parsed), nil, source) metric('SPARK_APP_JVM_NONHEAP_MEMORY_USAGE', getFuzzyNumber('jvm.non-heap.usage', parsed), nil, source) end return result end plugin:run()
apache-2.0
lasko2112/legend-of-hondo
MMOCoreORB/bin/scripts/object/draft_schematic/furniture/furniture_table_dining_modern.lua
2
3219
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version object_draft_schematic_furniture_furniture_table_dining_modern = object_draft_schematic_furniture_shared_furniture_table_dining_modern:new { templateType = DRAFTSCHEMATIC, customObjectName = "Dining Table", craftingToolTab = 512, -- (See DraftSchemticImplementation.h) complexity = 26, size = 2, xpType = "crafting_structure_general", xp = 1000, assemblySkill = "structure_assembly", experimentingSkill = "structure_experimentation", customizationSkill = "structure_customization", customizationOptions = {}, customizationStringNames = {}, customizationDefaults = {}, ingredientTemplateNames = {"craft_furniture_ingredients_n", "craft_furniture_ingredients_n"}, ingredientTitleNames = {"frame", "table_top"}, ingredientSlotType = {0, 0}, resourceTypes = {"metal_nonferrous", "aluminum"}, resourceQuantities = {250, 250}, contribution = {100, 100}, targetTemplate = "object/tangible/furniture/modern/dining_table_modern_style_01.iff", additionalTemplates = { } } ObjectTemplates:addTemplate(object_draft_schematic_furniture_furniture_table_dining_modern, "object/draft_schematic/furniture/furniture_table_dining_modern.iff")
agpl-3.0
lasko2112/legend-of-hondo
MMOCoreORB/bin/scripts/screenplays/dungeon/death_watch_bunker/conversations/deathWatchLutinNightstalkerConvoHandler.lua
1
3328
local ObjectManager = require("managers.object.object_manager") deathWatchLutinNightstalkerConvoHandler = { } function deathWatchLutinNightstalkerConvoHandler:getNextConversationScreen(pConversationTemplate, pPlayer, selectedOption, pConversingNpc) return ObjectManager.withCreatureObject(pPlayer, function(player) local pConversationSession = player:getConversationSession() local pLastConversationScreen = nil if (pConversationSession ~= nil) then local conversationSession = LuaConversationSession(pConversationSession) pLastConversationScreen = conversationSession:getLastConversationScreen() end local conversationTemplate = LuaConversationTemplate(pConversationTemplate) if (pLastConversationScreen ~= nil) then local lastConversationScreen = LuaConversationScreen(pLastConversationScreen) local optionLink = lastConversationScreen:getOptionLink(selectedOption) return conversationTemplate:getScreen(optionLink) end return self:getInitialScreen(pPlayer, pConversingNpc, pConversationTemplate) end) end function deathWatchLutinNightstalkerConvoHandler:getInitialScreen(pPlayer, pNpc, pConversationTemplate) return ObjectManager.withCreatureAndPlayerObject(pPlayer, function(player, playerObject) local convoTemplate = LuaConversationTemplate(pConversationTemplate) if (playerObject:isOnLeave() or not player:isRebel()) then return convoTemplate:getScreen("wrong_faction") elseif (player:hasScreenPlayState(4, "death_watch_bunker_rebel_sidequest")) then return convoTemplate:getScreen("quest_already_completed") elseif (player:hasScreenPlayState(1, "death_watch_bunker_rebel_sidequest")) then return convoTemplate:getScreen("return_intro") else return convoTemplate:getScreen("intro") end end) end function deathWatchLutinNightstalkerConvoHandler:runScreenHandlers(conversationTemplate, conversingPlayer, conversingNPC, selectedOption, conversationScreen) local screen = LuaConversationScreen(conversationScreen) local screenID = screen:getScreenID() return ObjectManager.withCreatureAndPlayerObject(conversingPlayer, function(player, playerObject) local conversationScreen = screen:cloneScreen() local clonedConversation = LuaConversationScreen(conversationScreen) if (screenID == "excellent_travel_to_bunker") then player:setScreenPlayState(1, "death_watch_bunker_rebel_sidequest") elseif (screenID == "return_intro") then if (player:hasScreenPlayState(2, "death_watch_bunker_rebel_sidequest")) then clonedConversation:addOption("@conversation/death_watch_rebel_herald:s_9b06da0", "excellent_reward") end clonedConversation:addOption("@conversation/death_watch_rebel_herald:s_dc839e59", "please_be_quick") clonedConversation:addOption("@conversation/death_watch_rebel_herald:s_6f2c6f44", "more_information") clonedConversation:addOption("@conversation/death_watch_rebel_herald:s_f70821a3", "this_distresses_me") elseif (screenID == "this_distresses_me") then player:removeScreenPlayState(1, "death_watch_bunker_rebel_sidequest") player:removeScreenPlayState(2, "death_watch_bunker_rebel_sidequest") elseif (screenID == "excellent_reward") then playerObject:increaseFactionStanding("rebel", 30) player:setScreenPlayState(4, "death_watch_bunker_rebel_sidequest") end return conversationScreen end) end
agpl-3.0
lasko2112/legend-of-hondo
MMOCoreORB/bin/scripts/object/draft_schematic/bio_engineer/creature/creature_gurreck.lua
1
3379
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version object_draft_schematic_bio_engineer_creature_creature_gurreck = object_draft_schematic_bio_engineer_creature_shared_creature_gurreck:new { templateType = DRAFTSCHEMATIC, disableFactoryRun = true, customObjectName = "Gurreck", craftingToolTab = 256, -- (See DraftSchemticImplementation.h) complexity = 27, size = 1, xpType = "crafting_bio_engineer_creature", xp = 260, assemblySkill = "bio_engineer_assembly", experimentingSkill = "bio_engineer_experimentation", customizationSkill = "bio_engineer_experimentation", customizationOptions = {}, customizationStringNames = {}, customizationDefaults = {}, ingredientTemplateNames = {"craft_creature_ingredients_n", "craft_creature_ingredients_n", "craft_creature_ingredients_n"}, ingredientTitleNames = {"dna_template", "protein_base", "organic_nutrition_materials"}, ingredientSlotType = {1, 0, 0}, resourceTypes = {"object/tangible/component/dna/shared_dna_template_generic.iff", "creature_food", "flora_food"}, resourceQuantities = {1, 70, 70}, contribution = {100, 100, 100}, targetTemplate = "object/tangible/deed/pet_deed/gurreck_deed.iff", additionalTemplates = { } } ObjectTemplates:addTemplate(object_draft_schematic_bio_engineer_creature_creature_gurreck, "object/draft_schematic/bio_engineer/creature/creature_gurreck.iff")
agpl-3.0
rvirding/luerl
examples/benchmark/suites/arguments.lua
5
7401
local select, tostring, assert, type, error = select, tostring, assert, type, error -------------------------------------------------------------------------------- local run_plain_assert = function(a, b, c) assert(type(a) == "number") assert(type(b) == "boolean") assert(type(c) == "string") end -------------------------------------------------------------------------------- local run_assert_is do local make_assert_is = function(typename) return function(v, msg) if type(v) == typename then return v end error( (msg or "assertion failed") .. ": expected `" .. typename .. "', got `" .. type(v) .. "'", 3 ) end end local assert_is_number = make_assert_is("number") local assert_is_boolean = make_assert_is("boolean") local assert_is_string = make_assert_is("string") run_assert_is = function(a, b, c) assert_is_number(a) assert_is_boolean(b) assert_is_string(c) end end -------------------------------------------------------------------------------- local run_arguments_select_simple do local arguments_select = function(...) local nargs = select("#", ...) for i = 1, nargs, 2 do local expected_type, value = select(i, ...) if type(value) ~= expected_type then error( "bad argument #" .. ((i + 1) / 2) .. " type: expected `" .. expected_type .. "', got `" .. type(value) .. "'", 3 ) end end end run_arguments_select_simple = function(a, b, c) arguments_select( "number", a, "boolean", b, "string", c ) end end -------------------------------------------------------------------------------- local run_arguments_recursive_simple do -- Simplified lua-nucleo version, equivalent to the others. local function impl(arg_n, expected_type, value, ...) -- Points error on function, calling function which calls *arguments() if type(value) ~= expected_type then error( "argument #"..arg_n..": expected `"..tostring(expected_type) .. "', got `"..type(value).."'", 3 + arg_n ) end -- If have at least one more type, check it return ((...) ~= nil) and impl(arg_n + 1, ...) or true end local arguments_recursive = function(...) local nargs = select('#', ...) return (nargs > 0) and impl(1, ...) or true end run_arguments_recursive_simple = function(a, b, c) arguments_recursive( "number", a, "boolean", b, "string", c ) end end -------------------------------------------------------------------------------- local run_arguments_recursive_lua_nucleo do -- Taken directly from lua-nucleo local lua51_types = { ["nil"] = true; ["boolean"] = true; ["number"] = true; ["string"] = true; ["table"] = true; ["function"] = true; ["thread"] = true; ["userdata"] = true; } local function impl(is_optional, arg_n, expected_type, value, ...) -- Points error on function, calling function which calls *arguments() if type(value) ~= expected_type then if not lua51_types[expected_type] then error( "argument #"..arg_n..": bad expected type `"..tostring(expected_type).."'", 3 + arg_n ) end if not is_optional or value ~= nil then error( (is_optional and "optional" or "") .. "argument #"..arg_n..": expected `"..tostring(expected_type) .. "', got `"..type(value).."'", 3 + arg_n ) end end -- If have at least one more type, check it return ((...) ~= nil) and impl(is_optional, arg_n + 1, ...) or true end local arguments_recursive = function(...) local nargs = select('#', ...) return (nargs > 0) and ( (nargs % 2 == 0) and impl(false, 1, ...) -- Not optional or error("arguments: bad call, dangling argument detected") ) or true end run_arguments_recursive_lua_nucleo = function(a, b, c) arguments_recursive( "number", a, "boolean", b, "string", c ) end end -------------------------------------------------------------------------------- -- TODO: Add a version with full-blown validation. local run_arguments_unroll_simple do -- TODO: Put a code-generation metatable over cache -- and pre-populate it for cases with (1-10) * 2 arguments. -- If __index sees odd number, it should crash -- with dangling argument error. local arguments_cache = { [6] = function(t1, v1, t2, v2, t3, v3) if type(v1) ~= t1 then error( "argument #1: expected `"..tostring(t1) .. "', got `"..type(v1).."'", 4 ) end if type(v2) ~= t2 then error( "argument #2: expected `"..tostring(t2) .. "', got `"..type(v2).."'", 4 ) end if type(v3) ~= t3 then error( "argument #3: expected `"..tostring(t3) .. "', got `"..type(v3).."'", 4 ) end end; } local arguments = function(...) local n = select("#", ...) -- Assuming cache is pre-populated for all possible use-cases return assert(arguments_cache[n])(...) end run_arguments_unroll_simple = function(a, b, c) arguments( "number", a, "boolean", b, "string", c ) end end -------------------------------------------------------------------------------- local run_arguments_hardcoded_simple do -- Not much real-word meaning, just for comparison with -- run_arguments_unroll_simple. local hardcoded_arguments_6 = function(t1, v1, t2, v2, t3, v3) if type(v1) ~= t1 then error( "argument #1: expected `"..tostring(t1) .. "', got `"..type(v1).."'", 2 ) end if type(v2) ~= t2 then error( "argument #2: expected `"..tostring(t2) .. "', got `"..type(v2).."'", 2 ) end if type(v3) ~= t3 then error( "argument #3: expected `"..tostring(t3) .. "', got `"..type(v3).."'", 2 ) end end run_arguments_hardcoded_simple = function(a, b, c) hardcoded_arguments_6( "number", a, "boolean", b, "string", c ) end end -------------------------------------------------------------------------------- bench = { } bench.plain_assert = function() run_plain_assert(42, true, "aaa") end bench.assert_is = function() run_assert_is(42, true, "aaa") end bench.assert_is_alloc = function() -- Imitating args table allocation. -- Needed to compensate plain Lua interpreter -- compatibility mode. local a, b, c = { }, { }, { } run_assert_is(42, true, "aaa") end bench.args_select_simple = function() run_arguments_select_simple(42, true, "aaa") end bench.args_recursive_simp = function() run_arguments_recursive_simple(42, true, "aaa") end bench.args_recursive_ln = function() run_arguments_recursive_lua_nucleo(42, true, "aaa") end bench.args_unroll_simple = function() run_arguments_unroll_simple(42, true, "aaa") end bench.args_hard_simple = function() run_arguments_hardcoded_simple(42, true, "aaa") end return bench
apache-2.0
lasko2112/legend-of-hondo
MMOCoreORB/bin/scripts/object/tangible/hair/human/hair_human_male_s40.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_s40 = object_tangible_hair_human_shared_hair_human_male_s40:new { } ObjectTemplates:addTemplate(object_tangible_hair_human_hair_human_male_s40, "object/tangible/hair/human/hair_human_male_s40.iff")
agpl-3.0
DailyShana/ygopro-scripts
c7025445.lua
5
2488
--パワー・ジャイアント function c7025445.initial_effect(c) --special summon local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_SPSUMMON_PROC) e1:SetProperty(EFFECT_FLAG_UNCOPYABLE) e1:SetRange(LOCATION_HAND) e1:SetCondition(c7025445.spcon) e1:SetOperation(c7025445.spop) e1:SetValue(1) c:RegisterEffect(e1) --level change local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetCondition(c7025445.lvcon) e2:SetOperation(c7025445.lvop) e2:SetLabelObject(e1) c:RegisterEffect(e2) --dam reduce local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e3:SetCode(EVENT_ATTACK_ANNOUNCE) e3:SetOperation(c7025445.damop) c:RegisterEffect(e3) local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e4:SetCode(EVENT_BE_BATTLE_TARGET) e4:SetOperation(c7025445.damop) c:RegisterEffect(e4) end function c7025445.cfilter(c) return c:IsLevelBelow(4) and c:IsAbleToGraveAsCost() end function c7025445.spcon(e,c) if c==nil then return true end return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c7025445.cfilter,c:GetControler(),LOCATION_HAND,0,1,c) end function c7025445.spop(e,tp,eg,ep,ev,re,r,rp,c) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,c7025445.cfilter,tp,LOCATION_HAND,0,1,1,c) Duel.SendtoGrave(g,REASON_COST) e:SetLabel(g:GetFirst():GetLevel()) end function c7025445.lvcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():GetSummonType()==SUMMON_TYPE_SPECIAL+1 end function c7025445.lvop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_LEVEL) e1:SetValue(-e:GetLabelObject():GetLabel()) e1:SetReset(RESET_EVENT+0x1ff0000) c:RegisterEffect(e1) end function c7025445.damop(e,tp,eg,ep,ev,re,r,rp) local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_CHANGE_DAMAGE) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetTargetRange(1,0) e1:SetValue(c7025445.damval) e1:SetReset(RESET_PHASE+PHASE_DAMAGE) Duel.RegisterEffect(e1,tp) local e2=e1:Clone() e2:SetCode(EFFECT_NO_EFFECT_DAMAGE) e2:SetReset(RESET_PHASE+PHASE_DAMAGE) Duel.RegisterEffect(e2,tp) end function c7025445.damval(e,re,val,r,rp,rc) if bit.band(r,REASON_EFFECT)~=0 then return 0 else return val end end
gpl-2.0
tectronics/crinkle
Core.lua
1
9629
--[[ Copyright 2012, Chris Ho ]]-- --[[ MIT License (Please read the LICENSE file for details) ]]-- -- Crinkle's Persona -- Conventions: always end statements with semicolon -- Global variables are all uppercase -- Functions are CamelCase, with first letter capitalized -- -- To use this as a Homunculus AI, put it in USER_AI and type "/hoai" -- To use this as a Mercenary AI, put it in USER_AI and type "/merai" -- To enable file logging, type "/traceai" (to "TraceAI.txt" in iRO install path) -- -- -- -- -- -- -- -- Use("common/Const"); Use("common/Log"); Use("common/List"); Use("common/Position"); Use("common/Task"); Use("common/Pet"); Use("common/Clique"); Use("tasks/Kill"); Use("tasks/Charge"); Use("tasks/Bombard"); -- Core Version CORE_VERSION = "Crinkle's Persona (Core v2.5)"; -- Maximum Number of Queued Commands CAPACITY = 10; -- Desired Logging Visibility (irrelevant if /traceai is off) LOG_LEVEL = LOG_INFO; --LOG_LEVEL = LOG_DEBUG; -- Default Personality Files PERSONALITY_DEFAULT = PATH .. "Persona.lua"; -- Command Execution Phases (3 Main Sequences) -- Plan -> Command -> Automatic -> Busy -> Idle -- Plan -> Command -> Busy -> Idle -- Plan -> Automatic -> Busy -> Idle PHASE_PLAN = 0; PHASE_AUTOMATIC = 1; PHASE_COMMAND = 2; PHASE_BUSY = 3; PHASE_IDLE = 4; -- -- -- -- -- -- -- -- -- Pet Instance ME = nil; -- List of User Command Records QUEUE = List.new(); -- Request for Tasks PHASE = PHASE_IDLE; -- Actual Task (May Differ from Pet Task!) -- The pet has its own task, but this task takes precedence. TASK = {}; -- Current list of actors: ACTORS = {}; -- -- -- -- -- -- -- -- --[[ Process Commands. Avoid modifying the pet's current task! ]]-- -- Simply convert the command into our task system. -- -- MOVE_CMD changes to program (stopped) mode (if moved to same position) -- STOP_CMD changes pet mode. -- PATROL_CMD changes pet mode. -- HOLD_CMD changes pet mode (defend). -- FOLLOW_CMD changes pet mode (standard escort mode). function Execute(record) Debug("Execute() " .. record[1]); if (record ~= nil) then if (record[1] == MOVE_CMD) then OnMOVE(record) elseif (record[1] == STOP_CMD) then OnSTOP(record) elseif (record[1]== ATTACK_OBJECT_CMD) then OnATTACK_OBJECT(record) elseif (record[1] == ATTACK_AREA_CMD) then OnATTACK_AREA(record) elseif (record[1] == PATROL_CMD) then OnPATROL(record) elseif (record[1] == HOLD_CMD) then OnHOLD(record) elseif (record[1] == SKILL_OBJECT_CMD) then OnSKILL_OBJECT(record) elseif (record[1] == SKILL_AREA_CMD) then OnSKILL_AREA(record) elseif (record[1] == FOLLOW_CMD) then OnFOLLOW(record) else Alert("Execute() ignoring request: " .. record[1]) PHASE = PHASE_IDLE; TASK = Task.Create(ME); end end end --[[ Handle MOVE_CMD ]]-- function OnMOVE(record) Info("OnMOVE()"); -- [2] and [3] are the x and y coordinates. local from = Position.Find(ME.id); local to = Position.Create(record[2], record[3]); if ((ME.mode ~= MODE_STOP) and (to.x == from.x) and (to.y == from.y)) then -- Go into STOP mode. In STOP mode, players can do some in-game -- reprogramming of the pet. When going into STOP mode, we -- autmatically clear out the existing friend list. ME:Behave(MODE_STOP); ME.friends = {}; PHASE = PHASE_AUTOMATIC; else if (ME.mode == MODE_STOP) then -- Make Friends: ME:FindFriends(ACTORS, to) end -- Move normally. TASK = Go.Create(ME, Position.Create(record[2], record[3])); PHASE = PHASE_BUSY; end end --[[ Handle STOP_CMD (switch pet mode to MODE_STOP) ]]-- function OnSTOP(record) Info("OnSTOP()"); -- Just switch to the stop mode. Nothing happens. ME:Behave(MODE_STOP); ME.task = Task.Create(ME); -- Use the pet task. PHASE = PHASE_AUTOMATIC; end --[[ Handle ATTACK_OBJECT_CMD ]]-- function OnATTACK_OBJECT(record) Info("OnATTACK_OBJECT()"); -- [2] is the target ID TASK = Kill.Create(ME, record[2]); PHASE = PHASE_BUSY; end --[[ Handle ATTACK_AREA_CMD]]-- function OnATTACK_AREA(record) Info("OnATTACK_AREA()"); -- [2] and [3] are the x and y coordinates. TASK = Bombard.Create(ME, Position.Create(record[2], record[3])); PHASE = PHASE_BUSY; end --[[ Handle PATROL_CMD(switch pet mode to MODE_PATROL) ]]-- function OnPATROL(record) Info("OnPATROL()"); -- Switch to the patrol mode. [2] and [3] are the x and y coordinates. ME:Behave(MODE_PATROL); ME.destination = Position.Create(record[2], record[3]); ME.task = Patrol.Create(ME, Position.Find(ME.id), ME.destination); -- Use the pet task. PHASE = PHASE_AUTOMATIC; end --[[ Handle HOLD_CMD(switch pet mode to MODE_DEFEND) ]]-- function OnHOLD(record) Info("OnHOLD()"); -- When holding, we stop but can still act. ME:Behave(MODE_DEFEND); ME.task = Task.Create(ME); -- Let the pet automatically respond. PHASE = PHASE_AUTOMATIC; end --[[ Handle SKILL_OBJECT_CMD ]]-- function OnSKILL_OBJECT(record) Info("OnSKILL_OBJECT() (Skill " .. record[3] .. ", level " .. record[2] .. ")"); -- [2] is level, [3] is skill, [4] is target ID TASK = Charge.Create(ME, Skill.Create(ME.id, record[3], record[2]), record[4]); PHASE = PHASE_BUSY; end --[[ Handle SKILL_AREA_CMD ]]-- function OnSKILL_AREA(record) Info("OnSKILL_AREA() (Skill " .. record[3] .. ", level " .. record[2] .. ")"); -- [2] is level, [3] is skill, [4] is x, and [5] is y. TASK = Bombard.Create(ME, Skill.Create(ME.id, record[3], record[2]), Position.Create(record[4], record[5])); PHASE = PHASE_BUSY; end --[[ Handle FOLLOW_CMD (switch pet mode to MODE_ESCORT) ]]-- function OnFOLLOW(record) Debug("OnFOLLOW()"); -- If we were in stop (program) mode, then save the friends list -- before we start escorting. if (ME.mode == MODE_STOP) then Clique.Save(FRIENDS_FILE, ME.friends) end if (ME.mode == MODE_ESCORT) then -- Force the escort state. ME:Behave(MODE_ESCORT); ME.leader = ME.owner.id; -- We were already in escort mode. Assist the owner. ME:Help(ME.leader); -- Execute the result of the help request. TASK = ME.task; PHASE = PHASE_BUSY; else -- We are changing to the owner-escort state. ME:Behave(MODE_ESCORT); ME.leader = ME.owner.id; -- Let the pet decide its task. PHASE = PHASE_AUTOMATIC; end end -- -- -- -- -- -- -- -- --[[ Initialize the pet global ]]-- -- You must provide the pet ID and the persona file name. function Initialize(_id, _filename) -- Create the global pet instance. ME = Pet.Create(_id) -- Load the personality file. local Personify, status = loadfile(_filename); if (Personify == nil) then Alert("Initialize() couldn't load " .. _filename .." (" .. status .. "), trying default."); Personify = loadfile(PERSONALITY_DEFAULT); end -- Install the personality. Personify(ME); -- Report some initialization notes. Info("Initialize() " .. CORE_VERSION .." on '" .. _VERSION .. "' Initilizing (LEASH=" .. LEASH .. ", VISIBILITY=" .. VISIBILITY .. ", CAPACITY=" .. CAPACITY .. ", TRANQUILITY=" .. TRANQUILITY .. ", RESILIENCE=" .. RESILIENCE .. ")"); -- Initialize AI pipeline. PHASE = PHASE_PLAN; TASK = ME.task; end --[[ Gather Information (Read Input and Environment) ]]-- function Survey() -- Interpret incoming messages. local message = GetMsg(ME.id); local reserve = GetResMsg(ME.id); if (message[1] == NONE_CMD) then -- Import any reserve commands. if (reserve[1] ~= NONE_CMD) then if (List.size(QUEUE) < CAPACITY) then List.pushright(QUEUE, reserve); end end else -- When we get a new top level command, reset the queue. List.clear(QUEUE); List.pushright(QUEUE, message); -- Force the planning state to figure out new tasks. -- Unless we come up with an actual task, do nothing. TASK = Task.Create(ME); PHASE = PHASE_PLAN; Info("New Command: " .. message[1]); end -- Cache the current list of actors. ACTORS = GetActors(); end --[[ Decide on a course of action ]]-- function Decide() -- Decide whether to use automatic behavior or player command behavior. if (PHASE == PHASE_PLAN) then if (List.size(QUEUE) == 0) then -- Automatic commands come from the pet's current mode. PHASE = PHASE_AUTOMATIC; else -- Switch to command execution state. PHASE = PHASE_COMMAND; end end -- If we are going to process a command, do it first. The command may put -- us in an automatic phase. if (PHASE == PHASE_COMMAND) then -- Execute the next message directly. Execute(List.popleft(QUEUE)); end -- Process automatic behavior (from pet mode) if necessary. if (PHASE == PHASE_AUTOMATIC) then -- Figure out the current task. ME:Think(); -- We're now executing the current task from the pet mode. TASK = ME.task; PHASE = PHASE_BUSY; end end --[[ Process the current task ]]-- function Act() -- If we have a pending/active task, then process it. if ((TASK.progress == PROGRESS_NEW) or (TASK.progress == PROGRESS_ACTIVE)) then -- Process Pet Tasks. TASK:Execute() -- If we finished the task, go idle. if (TASK.progress == PROGRESS_SUCCESS) then Debug("Act() Task Complete"); PHASE = PHASE_IDLE; elseif (TASK.progress == PROGRESS_FAILURE) then Alert("Act() Task FAILED"); PHASE = PHASE_IDLE; end else -- All tasks complete? PHASE = PHASE_IDLE; end end --[[ Current cycle completes, review and react to the situation ]]-- function Reflect() -- Automatically respond to the current environment. ME:React(); end
mit
lasko2112/legend-of-hondo
MMOCoreORB/bin/scripts/object/building/poi/dathomir_nightsisterpatrol_large2.lua
2
2294
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version object_building_poi_dathomir_nightsisterpatrol_large2 = object_building_poi_shared_dathomir_nightsisterpatrol_large2:new { gameObjectType = 531, } ObjectTemplates:addTemplate(object_building_poi_dathomir_nightsisterpatrol_large2, "object/building/poi/dathomir_nightsisterpatrol_large2.iff")
agpl-3.0
lasko2112/legend-of-hondo
MMOCoreORB/bin/scripts/mobile/spawn/dantooine_world.lua
2
17381
dantooine_world = { lairSpawns = { { lairTemplateName = "dantooine_bol_pigmy_neutral_small", spawnLimit = -1, minDifficulty = 10, maxDifficulty = 14, numberToSpawn = 0, weighting = 15, size = 25 }, { lairTemplateName = "dantooine_bol_pigmy_neutral_none", spawnLimit = -1, minDifficulty = 10, maxDifficulty = 14, numberToSpawn = 0, weighting = 15, size = 25 }, { lairTemplateName = "dantooine_kunga_leader_camp_neutral_large_theater", spawnLimit = -1, minDifficulty = 16, maxDifficulty = 80, numberToSpawn = 0, weighting = 10, size = 30 }, { lairTemplateName = "dantooine_huurton_pack_neutral_none", spawnLimit = -1, minDifficulty = 18, maxDifficulty = 22, numberToSpawn = 0, weighting = 12, size = 25 }, { lairTemplateName = "dantooine_mokk_soothsayer_camp_neutral_medium_theater", spawnLimit = -1, minDifficulty = 20, maxDifficulty = 44, numberToSpawn = 0, weighting = 10, size = 20 }, { lairTemplateName = "dantooine_janta_leader_camp_neutral_large_theater", spawnLimit = -1, minDifficulty = 20, maxDifficulty = 79, numberToSpawn = 0, weighting = 8, size = 30 }, { lairTemplateName = "dantooine_voritor_lizard_neutral_none", spawnLimit = -1, minDifficulty = 22, maxDifficulty = 26, numberToSpawn = 0, weighting = 12, size = 25 }, { lairTemplateName = "dantooine_voritor_lair_neutral_medium", spawnLimit = -1, minDifficulty = 22, maxDifficulty = 26, numberToSpawn = 0, weighting = 12, size = 25 }, { lairTemplateName = "dantooine_abandoned_rebel_camp_rebel_small_theater", spawnLimit = -1, minDifficulty = 22, maxDifficulty = 30, numberToSpawn = 0, weighting = 15, size = 15 }, { lairTemplateName = "dantooine_quenker_pack_neutral_none", spawnLimit = -1, minDifficulty = 23, maxDifficulty = 27, numberToSpawn = 0, weighting = 12, size = 25 }, { lairTemplateName = "dantooine_quenker_lair_neutral_medium", spawnLimit = -1, minDifficulty = 23, maxDifficulty = 27, numberToSpawn = 0, weighting = 12, size = 25 }, { lairTemplateName = "dantooine_dantari_raider_camp_neutral_large_theater", spawnLimit = -1, minDifficulty = 25, maxDifficulty = 29, numberToSpawn = 0, weighting = 20, size = 15 }, { lairTemplateName = "dantooine_huurton_howler_pack_neutral_none", spawnLimit = -1, minDifficulty = 25, maxDifficulty = 29, numberToSpawn = 0, weighting = 12, size = 25 }, { lairTemplateName = "dantooine_huurton_howler_lair_neutral_medium", spawnLimit = -1, minDifficulty = 25, maxDifficulty = 29, numberToSpawn = 0, weighting = 6, size = 25 }, { lairTemplateName = "dantooine_huurton_howler_lair_neutral_medium_boss_01", spawnLimit = -1, minDifficulty = 25, maxDifficulty = 29, numberToSpawn = 0, weighting = 6, size = 25 }, { lairTemplateName = "dantooine_thune_lair_neutral_medium", spawnLimit = -1, minDifficulty = 26, maxDifficulty = 30, numberToSpawn = 0, weighting = 15, size = 25 }, { lairTemplateName = "dantooine_huurton_matron_pack_neutral_none", spawnLimit = -1, minDifficulty = 26, maxDifficulty = 30, numberToSpawn = 0, weighting = 12, size = 25 }, { lairTemplateName = "dantooine_huurton_matron_lair_neutral_medium", spawnLimit = -1, minDifficulty = 26, maxDifficulty = 30, numberToSpawn = 0, weighting = 12, size = 25 }, { lairTemplateName = "dantooine_bol_lair_neutral_medium", spawnLimit = -1, minDifficulty = 26, maxDifficulty = 30, numberToSpawn = 0, weighting = 8, size = 30 }, { lairTemplateName = "dantooine_bol_lair_neutral_medium_boss_01", spawnLimit = -1, minDifficulty = 26, maxDifficulty = 30, numberToSpawn = 0, weighting = 8, size = 30 }, { lairTemplateName = "dantooine_bol_herd_neutral_none", spawnLimit = -1, minDifficulty = 26, maxDifficulty = 30, numberToSpawn = 0, weighting = 15, size = 30 }, { lairTemplateName = "dantooine_thune_herd_neutral_none", spawnLimit = -1, minDifficulty = 26, maxDifficulty = 50, numberToSpawn = 0, weighting = 15, size = 25 }, { lairTemplateName = "dantooine_graul_pack_neutral_none", spawnLimit = -1, minDifficulty = 27, maxDifficulty = 31, numberToSpawn = 0, weighting = 15, size = 30 }, { lairTemplateName = "dantooine_janta_shaman_camp_neutral_medium_theater", spawnLimit = -1, minDifficulty = 27, maxDifficulty = 61, numberToSpawn = 0, weighting = 8, size = 20 }, { lairTemplateName = "dantooine_kunga_rockshaper_camp_neutral_medium_theater", spawnLimit = -1, minDifficulty = 27, maxDifficulty = 76, numberToSpawn = 0, weighting = 10, size = 20 }, { lairTemplateName = "dantooine_quenker_savage_pack_neutral_none", spawnLimit = -1, minDifficulty = 28, maxDifficulty = 32, numberToSpawn = 0, weighting = 12, size = 25 }, { lairTemplateName = "dantooine_quenker_savage_lair_neutral_medium", spawnLimit = -1, minDifficulty = 28, maxDifficulty = 32, numberToSpawn = 0, weighting = 6, size = 25 }, { lairTemplateName = "dantooine_quenker_savage_lair_neutral_medium_boss_01", spawnLimit = -1, minDifficulty = 28, maxDifficulty = 32, numberToSpawn = 0, weighting = 6, size = 25 }, { lairTemplateName = "dantooine_huurton_huntress_pack_neutral_none", spawnLimit = -1, minDifficulty = 28, maxDifficulty = 32, numberToSpawn = 0, weighting = 12, size = 25 }, { lairTemplateName = "dantooine_kunga_warrior_camp_neutral_medium_theater", spawnLimit = -1, minDifficulty = 28, maxDifficulty = 72, numberToSpawn = 0, weighting = 10, size = 20 }, { lairTemplateName = "dantooine_dantari_battlelord_squad_neutral_none", spawnLimit = -1, minDifficulty = 29, maxDifficulty = 38, numberToSpawn = 0, weighting = 10, size = 25 }, { lairTemplateName = "dantooine_dantari_chief_squad_neutral_none", spawnLimit = -1, minDifficulty = 29, maxDifficulty = 43, numberToSpawn = 0, weighting = 10, size = 25 }, { lairTemplateName = "dantooine_voritor_dasher_neutral_none", spawnLimit = -1, minDifficulty = 30, maxDifficulty = 34, numberToSpawn = 0, weighting = 12, size = 25 }, { lairTemplateName = "dantooine_piket_plains_walker_herd_neutral_none", spawnLimit = -1, minDifficulty = 30, maxDifficulty = 34, numberToSpawn = 0, weighting = 15, size = 30 }, { lairTemplateName = "dantooine_graul_lair_neutral_medium", spawnLimit = -1, minDifficulty = 30, maxDifficulty = 34, numberToSpawn = 0, weighting = 15, size = 30 }, { lairTemplateName = "dantooine_piket_longhorn_lair_neutral_medium", spawnLimit = -1, minDifficulty = 30, maxDifficulty = 39, numberToSpawn = 0, weighting = 15, size = 30 }, { lairTemplateName = "dantooine_piket_longhorn_herd_neutral_none", spawnLimit = -1, minDifficulty = 30, maxDifficulty = 39, numberToSpawn = 0, weighting = 15, size = 30 }, { lairTemplateName = "dantooine_graul_mauler_pack_neutral_none", spawnLimit = -1, minDifficulty = 30, maxDifficulty = 39, numberToSpawn = 0, weighting = 12, size = 35 }, { lairTemplateName = "dantooine_huurton_stalker_pack_neutral_none", spawnLimit = -1, minDifficulty = 33, maxDifficulty = 87, numberToSpawn = 0, weighting = 12, size = 25 }, { lairTemplateName = "dantooine_quenker_bile_drenched_pack_neutral_none", spawnLimit = -1, minDifficulty = 34, maxDifficulty = 38, numberToSpawn = 0, weighting = 12, size = 25 }, { lairTemplateName = "dantooine_quenker_bile_drenched_lair_neutral_medium", spawnLimit = -1, minDifficulty = 34, maxDifficulty = 38, numberToSpawn = 0, weighting = 12, size = 25 }, { lairTemplateName = "dantooine_graul_mauler_lair_neutral_large", spawnLimit = -1, minDifficulty = 35, maxDifficulty = 39, numberToSpawn = 0, weighting = 6, size = 35 }, { lairTemplateName = "dantooine_graul_mauler_lair_neutral_large_boss_01", spawnLimit = -1, minDifficulty = 35, maxDifficulty = 39, numberToSpawn = 0, weighting = 6, size = 35 }, { lairTemplateName = "dantooine_kunga_hunter_neutral_none", spawnLimit = -1, minDifficulty = 37, maxDifficulty = 41, numberToSpawn = 0, weighting = 10, size = 25 }, { lairTemplateName = "dantooine_quenker_ravager_pack_neutral_none", spawnLimit = -1, minDifficulty = 38, maxDifficulty = 42, numberToSpawn = 0, weighting = 12, size = 25 }, { lairTemplateName = "dantooine_quenker_ravager_lair_neutral_medium", spawnLimit = -1, minDifficulty = 38, maxDifficulty = 42, numberToSpawn = 0, weighting = 12, size = 25 }, { lairTemplateName = "dantooine_janta_rockshaper_camp_neutral_medium_theater", spawnLimit = -1, minDifficulty = 40, maxDifficulty = 79, numberToSpawn = 0, weighting = 8, size = 20 }, { lairTemplateName = "dantooine_thune_guardian_neutral_none", spawnLimit = -1, minDifficulty = 40, maxDifficulty = 129, numberToSpawn = 0, weighting = 15, size = 25 }, { lairTemplateName = "dantooine_mokk_hunter_neutral_none", spawnLimit = -1, minDifficulty = 42, maxDifficulty = 46, numberToSpawn = 0, weighting = 6, size = 25 }, { lairTemplateName = "dantooine_bol_seething_lair_neutral_medium", spawnLimit = -1, minDifficulty = 44, maxDifficulty = 48, numberToSpawn = 0, weighting = 15, size = 30 }, { lairTemplateName = "dantooine_bol_seething_herd_neutral_none", spawnLimit = -1, minDifficulty = 44, maxDifficulty = 48, numberToSpawn = 0, weighting = 15, size = 30 }, { lairTemplateName = "dantooine_voritor_tracker_neutral_none", spawnLimit = -1, minDifficulty = 45, maxDifficulty = 49, numberToSpawn = 0, weighting = 12, size = 25 }, { lairTemplateName = "dantooine_voritor_tracker_lair_neutral_medium", spawnLimit = -1, minDifficulty = 45, maxDifficulty = 49, numberToSpawn = 0, weighting = 12, size = 25 }, { lairTemplateName = "dantooine_quenker_relic_reaper_pack_neutral_none", spawnLimit = -1, minDifficulty = 45, maxDifficulty = 49, numberToSpawn = 0, weighting = 12, size = 25 }, { lairTemplateName = "dantooine_quenker_relic_reaper_lair_neutral_medium", spawnLimit = -1, minDifficulty = 45, maxDifficulty = 49, numberToSpawn = 0, weighting = 12, size = 25 }, { lairTemplateName = "dantooine_piket_protector_herd_neutral_none", spawnLimit = -1, minDifficulty = 45, maxDifficulty = 49, numberToSpawn = 0, weighting = 15, size = 30 }, { lairTemplateName = "dantooine_piket_protector_herd_neutral_none_boss_01", spawnLimit = -1, minDifficulty = 45, maxDifficulty = 49, numberToSpawn = 0, weighting = 8, size = 30 }, { lairTemplateName = "dantooine_picket_protector_lair_neutral_medium", spawnLimit = -1, minDifficulty = 45, maxDifficulty = 49, numberToSpawn = 0, weighting = 8, size = 30 }, { lairTemplateName = "dantooine_mokk_scout_neutral_none", spawnLimit = -1, minDifficulty = 47, maxDifficulty = 51, numberToSpawn = 0, weighting = 6, size = 25 }, { lairTemplateName = "dantooine_mokk_shaman_camp_neutral_medium_theater", spawnLimit = -1, minDifficulty = 47, maxDifficulty = 61, numberToSpawn = 0, weighting = 10, size = 20 }, { lairTemplateName = "dantooine_mokk_leader_camp_neutral_large_theater", spawnLimit = -1, minDifficulty = 47, maxDifficulty = 76, numberToSpawn = 0, weighting = 10, size = 30 }, { lairTemplateName = "dantooine_kunga_scout_neutral_none", spawnLimit = -1, minDifficulty = 48, maxDifficulty = 52, numberToSpawn = 0, weighting = 10, size = 25 }, { lairTemplateName = "dantooine_janta_hunter_neutral_none", spawnLimit = -1, minDifficulty = 50, maxDifficulty = 54, numberToSpawn = 0, weighting = 10, size = 25 }, { lairTemplateName = "dantooine_graul_ancient_pack_neutral_none", spawnLimit = -1, minDifficulty = 50, maxDifficulty = 54, numberToSpawn = 0, weighting = 5, size = 35 }, { lairTemplateName = "dantooine_graul_ancient_lair_neutral_large", spawnLimit = -1, minDifficulty = 50, maxDifficulty = 54, numberToSpawn = 0, weighting = 5, size = 35 }, { lairTemplateName = "dantooine_janta_scout_neutral_none", spawnLimit = -1, minDifficulty = 51, maxDifficulty = 55, numberToSpawn = 0, weighting = 10, size = 25 }, { lairTemplateName = "dantooine_voritor_vexed_neutral_none", spawnLimit = -1, minDifficulty = 52, maxDifficulty = 56, numberToSpawn = 0, weighting = 12, size = 25 }, { lairTemplateName = "dantooine_voritor_jungle_lizard_neutral_none", spawnLimit = -1, minDifficulty = 53, maxDifficulty = 57, numberToSpawn = 0, weighting = 12, size = 25 }, { lairTemplateName = "dantooine_voritor_jungle_lair_neutral_medium", spawnLimit = -1, minDifficulty = 53, maxDifficulty = 57, numberToSpawn = 0, weighting = 6, size = 25 }, { lairTemplateName = "dantooine_voritor_jungle_lair_neutral_medium_boss_01", spawnLimit = -1, minDifficulty = 53, maxDifficulty = 57, numberToSpawn = 0, weighting = 6, size = 25 }, { lairTemplateName = "dantooine_janta_warrior_camp_neutral_medium_theater", spawnLimit = -1, minDifficulty = 55, maxDifficulty = 74, numberToSpawn = 0, weighting = 8, size = 20 }, { lairTemplateName = "dantooine_graul_frenzied_lair_neutral_large", spawnLimit = 10, minDifficulty = 56, maxDifficulty = 60, numberToSpawn = 0, weighting = 3, size = 35 }, { lairTemplateName = "dantooine_graul_frenzied_pack_neutral_none", spawnLimit = 10, minDifficulty = 56, maxDifficulty = 175, numberToSpawn = 0, weighting = 3, size = 35 }, { lairTemplateName = "dantooine_voritor_hunter_neutral_none", spawnLimit = -1, minDifficulty = 57, maxDifficulty = 61, numberToSpawn = 0, weighting = 12, size = 25 }, { lairTemplateName = "dantooine_voritor_hunter_lair_neutral_medium", spawnLimit = -1, minDifficulty = 57, maxDifficulty = 61, numberToSpawn = 0, weighting = 12, size = 25 }, { lairTemplateName = "dantooine_mokk_shaman_neutral_none", spawnLimit = -1, minDifficulty = 60, maxDifficulty = 64, numberToSpawn = 0, weighting = 6, size = 25 }, { lairTemplateName = "dantooine_force_mystic_neutral_none", spawnLimit = 5, minDifficulty = 60, maxDifficulty = 64, numberToSpawn = 0, weighting = 3, size = 25 }, { lairTemplateName = "dantooine_untrained_dark_side_neutral_none", spawnLimit = 5, minDifficulty = 65, maxDifficulty = 69, numberToSpawn = 0, weighting = 3, size = 25 }, { lairTemplateName = "dantooine_mokk_warrior_neutral_none", spawnLimit = -1, minDifficulty = 70, maxDifficulty = 74, numberToSpawn = 0, weighting = 6, size = 25 }, { lairTemplateName = "dantooine_kunga_warrior_neutral_none", spawnLimit = -1, minDifficulty = 70, maxDifficulty = 74, numberToSpawn = 0, weighting = 10, size = 25 }, { lairTemplateName = "dantooine_janta_warrior_neutral_none", spawnLimit = -1, minDifficulty = 70, maxDifficulty = 74, numberToSpawn = 0, weighting = 10, size = 25 }, { lairTemplateName = "dantooine_mokk_rockshaper_neutral_none", spawnLimit = -1, minDifficulty = 71, maxDifficulty = 75, numberToSpawn = 0, weighting = 6, size = 25 }, { lairTemplateName = "dantooine_dark_side_savage_neutral_none", spawnLimit = 5, minDifficulty = 75, maxDifficulty = 79, numberToSpawn = 0, weighting = 3, size = 25 }, { lairTemplateName = "dantooine_force_renegade_neutral_none", spawnLimit = 10, minDifficulty = 80, maxDifficulty = 84, numberToSpawn = 0, weighting = 6, size = 25 }, { lairTemplateName = "dantooine_force_archaist_neutral_none", spawnLimit = 5, minDifficulty = 90, maxDifficulty = 94, numberToSpawn = 0, weighting = 3, size = 25 }, { lairTemplateName = "dantooine_force_crypt_crawler_neutral_none", spawnLimit = 5, minDifficulty = 95, maxDifficulty = 99, numberToSpawn = 0, weighting = 3, size = 25 }, { lairTemplateName = "dantooine_force_wilder_neutral_none", spawnLimit = 5, minDifficulty = 115, maxDifficulty = 119, numberToSpawn = 0, weighting = 3, size = 25 }, { lairTemplateName = "dantooine_force_crystal_hunter_neutral_none", spawnLimit = 5, minDifficulty = 115, maxDifficulty = 119, numberToSpawn = 0, weighting = 3, size = 25 }, } } addSpawnGroup("dantooine_world", dantooine_world);
agpl-3.0
lasko2112/legend-of-hondo
MMOCoreORB/bin/scripts/object/tangible/deed/harvester_deed/harvester_flora_deed_heavy.lua
1
3020
--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_harvester_deed_harvester_flora_deed_heavy = object_tangible_deed_harvester_deed_shared_harvester_flora_deed_heavy:new { templateType = STRUCTUREDEED, placeStructureComponent = "PlaceStructureComponent", generatedObjectTemplate = "object/installation/mining_organic/mining_organic_flora_farm_heavy.iff", numberExperimentalProperties = {1, 1, 3, 2, 1}, experimentalProperties = {"XX", "XX", "HR", "SR", "UT", "MA", "UT", "XX"}, experimentalWeights = {1, 1, 1, 1, 2, 1, 2, 1}, experimentalGroupTitles = {"null", "null", "expEffeciency", "expStorage", "null"}, experimentalSubGroupTitles = {"null", "null", "extractrate", "hoppersize", "hitpoints"}, experimentalMin = {0, 0, 15, 100000, 1000}, experimentalMax = {0, 0, 25, 500000, 1000}, experimentalPrecision = {0, 0, 0, 0, 0}, experimentalCombineType = {0, 0, 1, 1, 4}, } ObjectTemplates:addTemplate(object_tangible_deed_harvester_deed_harvester_flora_deed_heavy, "object/tangible/deed/harvester_deed/harvester_flora_deed_heavy.iff")
agpl-3.0
DailyShana/ygopro-scripts
c96561011.lua
5
1361
--真紅眼の闇竜 function c96561011.initial_effect(c) c:EnableReviveLimit() --cannot special summon local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetCode(EFFECT_SPSUMMON_CONDITION) c:RegisterEffect(e1) --special summon local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_SPSUMMON_PROC) e2:SetProperty(EFFECT_FLAG_UNCOPYABLE) e2:SetRange(LOCATION_HAND) e2:SetCondition(c96561011.spcon) e2:SetOperation(c96561011.spop) c:RegisterEffect(e2) --atkup local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE) e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e3:SetCode(EFFECT_UPDATE_ATTACK) e3:SetRange(LOCATION_MZONE) e3:SetValue(c96561011.val) c:RegisterEffect(e3) end function c96561011.val(e,c) return Duel.GetMatchingGroupCount(Card.IsRace,c:GetControler(),LOCATION_GRAVE,0,nil,RACE_DRAGON)*300 end function c96561011.rfilter(c) return c:IsCode(74677422) end function c96561011.spcon(e,c) if c==nil then return true end return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>-1 and Duel.CheckReleaseGroup(c:GetControler(),c96561011.rfilter,1,nil) end function c96561011.spop(e,tp,eg,ep,ev,re,r,rp,c) local g=Duel.SelectReleaseGroup(c:GetControler(),c96561011.rfilter,1,1,nil) Duel.Release(g,REASON_COST) end
gpl-2.0
lasko2112/legend-of-hondo
MMOCoreORB/bin/scripts/object/tangible/parrot_cage/parrot_cage.lua
3
2665
--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_parrot_cage_parrot_cage = object_tangible_parrot_cage_shared_parrot_cage:new { numberExperimentalProperties = {1, 1, 1, 1}, experimentalProperties = {"XX", "XX", "UT", "CD"}, experimentalWeights = {1, 1, 1, 1}, experimentalGroupTitles = {"null", "null", "exp_durability", "exp_effectiveness"}, experimentalSubGroupTitles = {"null", "null", "hitpoints", "usemodifier"}, experimentalMin = {0, 0, 100, -15}, experimentalMax = {0, 0, 150, 15}, experimentalPrecision = {0, 0, 0, 0}, experimentalCombineType = {0, 0, 4, 1}, } ObjectTemplates:addTemplate(object_tangible_parrot_cage_parrot_cage, "object/tangible/parrot_cage/parrot_cage.iff")
agpl-3.0
Whitechaser/darkstar
scripts/zones/Hall_of_the_Gods/npcs/Shimmering_Circle.lua
5
1457
----------------------------------- -- Area: Hall of the Gods -- NPC: Shimmering Circle -- Lifts players up to the sky! -- !pos 0 -20 147 251 ----------------------------------- package.loaded["scripts/zones/Hall_of_the_Gods/TextIDs"] = nil; ----------------------------------- require("scripts/globals/keyitems"); require("scripts/globals/missions"); require("scripts/zones/Hall_of_the_Gods/TextIDs"); ----------------------------------- function onTrade(player,npc,trade) end; function onTrigger(player,npc) local ZilartProgress = player:getCurrentMission(ZILART); local ZVar = player:getVar("ZilartStatus"); if (player:getZPos() < 200) then if (ZilartProgress == THE_GATE_OF_THE_GODS and ZVar == 0) then player:startEvent(3); -- First time. elseif (ZilartProgress ~= 255 and ZilartProgress > THE_GATE_OF_THE_GODS or -- If player has not done any ZM, Progress == 255 (ZilartProgress == THE_GATE_OF_THE_GODS and ZVar > 0)) then player:startEvent(10); else player:messageSpecial(NOTHING_OUT_OF_ORDINARY); end else player:startEvent(11); end end; function onEventUpdate(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); end; function onEventFinish(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); if (csid == 3) then player:setVar("ZilartStatus",1); end end;
gpl-3.0
lasko2112/legend-of-hondo
MMOCoreORB/bin/scripts/object/tangible/ship/crafted/weapon/wpn_medium_blaster_green.lua
3
3468
--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_weapon_wpn_medium_blaster_green = object_tangible_ship_crafted_weapon_shared_wpn_medium_blaster_green:new { numberExperimentalProperties = {1, 1, 2, 1, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2}, experimentalProperties = {"XX", "XX", "OQ", "UT", "XX", "OQ", "UT", "OQ", "UT", "XX", "CD", "OQ", "OQ", "PE", "OQ", "PE", "OQ", "PE", "OQ", "PE", "CD", "OQ", "OQ", "PE"}, experimentalWeights = {1, 1, 1, 2, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, experimentalGroupTitles = {"null", "null", "exp_hp_max", "null", "exp_mass", "exp_armorhpmax", "null", "exp_energy_maintenance", "exp_damage_max", "exp_damage_min", "exp_shield_effectiveness", "exp_armor_effectiveness", "exp_energy_per_shot", "exp_refire"}, experimentalSubGroupTitles = {"null", "null", "hitpointsmax", "efficiency", "mass", "armorhpmax", "energy_efficiency", "energy_maintenance", "damage_max", "damage_min", "effective_shields", "effective_armor", "energy_per_shot", "refire_rate"}, experimentalMin = {0, 0, 319, 1, 2419, 160, 1, 2258, 794, 563, 463, 463, 17, 315}, experimentalMax = {0, 0, 371, 1, 2081, 185, 1, 1943, 922, 655, 538, 538, 20, 366}, experimentalPrecision = {0, 0, 10, 0, 10, 10, 0, 10, 10, 10, 10, 10, 10, 10}, experimentalCombineType = {0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, } ObjectTemplates:addTemplate(object_tangible_ship_crafted_weapon_wpn_medium_blaster_green, "object/tangible/ship/crafted/weapon/wpn_medium_blaster_green.iff")
agpl-3.0
lasko2112/legend-of-hondo
MMOCoreORB/bin/scripts/loot/items/wearables/belt/belt_s14.lua
4
1248
belt_s14 = { -- Black Leather Belt minimumLevel = 0, maximumLevel = -1, customObjectName = "", directObjectTemplate = "object/tangible/wearables/belt/belt_s14.iff", craftingValues = {}, skillMods = {}, customizationStringNames = {"/private/index_color_1","/private/index_color_2"}, customizationValues = { {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119}, {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119} }, junkDealerTypeNeeded = JUNKCLOTHESANDJEWELLERY, junkMinValue = 40, junkMaxValue = 80 } addLootItemTemplate("belt_s14", belt_s14)
agpl-3.0
Whitechaser/darkstar
scripts/zones/Valkurm_Dunes/npcs/Medicine_Axe.lua
5
1516
----------------------------------- -- Area: Valkurm Dunes -- NPC: Medicine Axe -- Type: Outpost Vendor -- !pos 144 -7 104 103 ----------------------------------- package.loaded["scripts/zones/Valkurm_Dunes/TextIDs"] = nil; ----------------------------------- require("scripts/globals/shop"); require("scripts/globals/conquest"); require("scripts/zones/Valkurm_Dunes/TextIDs"); local region = ZULKHEIM; local csid = 0x7ff4; function onTrade(player,npc,trade) end; function onTrigger(player,npc) local owner = GetRegionOwner(region); local arg1 = getArg1(owner,player); if (owner == player:getNation()) then nation = 1; elseif (arg1 < 1792) then nation = 2; else nation = 0; end player:startEvent(csid,nation,OP_TeleFee(player,region),0,OP_TeleFee(player,region),player:getCP(),0,0,0); end; function onEventUpdate(player,csid,option) -- printf("CSID: %u",csid); -- printf("OPTION: %u",option); player:updateEvent(player:getGil(),OP_TeleFee(player,region),0,OP_TeleFee(player,region),player:getCP()); end; function onEventFinish(player,csid,option) -- printf("CSID: %u",csid); -- printf("OPTION: %u",option); if (option == 1) then ShowOPVendorShop(player); elseif (option == 2) then if (player:delGil(OP_TeleFee(player,region))) then toHomeNation(player); end elseif (option == 6) then player:delCP(OP_TeleFee(player,region)); toHomeNation(player); end end;
gpl-3.0
lasko2112/legend-of-hondo
MMOCoreORB/bin/scripts/object/tangible/wearables/base/base_dress_poofysleeve_allow_gauntlets.lua
3
2336
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version object_tangible_wearables_base_base_dress_poofysleeve_allow_gauntlets = object_tangible_wearables_base_shared_base_dress_poofysleeve_allow_gauntlets:new { } ObjectTemplates:addTemplate(object_tangible_wearables_base_base_dress_poofysleeve_allow_gauntlets, "object/tangible/wearables/base/base_dress_poofysleeve_allow_gauntlets.iff")
agpl-3.0
lasko2112/legend-of-hondo
MMOCoreORB/bin/scripts/object/tangible/component/item/quest_item/momentum_compensator.lua
3
2308
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version object_tangible_component_item_quest_item_momentum_compensator = object_tangible_component_item_quest_item_shared_momentum_compensator:new { } ObjectTemplates:addTemplate(object_tangible_component_item_quest_item_momentum_compensator, "object/tangible/component/item/quest_item/momentum_compensator.iff")
agpl-3.0
Whitechaser/darkstar
scripts/zones/AlTaieu/mobs/JoL_Qn_hpemde.lua
4
1222
----------------------------------- -- Area: Al'Taieu -- MOB: Qn'hpemde -- Jailor of Love Pet version ----------------------------------- require("scripts/zones/AlTaieu/MobIDs"); ----------------------------------- function onMobSpawn(mob) mob:AnimationSub(6); -- Mouth Closed end; function onMobFight(mob, target) local changeTime = mob:getLocalVar("changeTime"); if (mob:AnimationSub() == 6 and mob:getBattleTime() - changeTime > 30) then mob:AnimationSub(3); -- Mouth Open mob:addMod(MOD_ATTP, 100); mob:addMod(MOD_DEFP, -50); mob:addMod(MOD_DMGMAGIC, -50); mob:setLocalVar("changeTime", mob:getBattleTime()); elseif (mob:AnimationSub() == 3 and mob:getBattleTime() - changeTime > 30) then mob:AnimationSub(6); -- Mouth Closed mob:addMod(MOD_ATTP, -100); mob:addMod(MOD_DEFP, 50); mob:addMod(MOD_DMGMAGIC, 50); mob:setLocalVar("changeTime", mob:getBattleTime()); end end; function onMobDeath(mob, player, isKiller) end; function onMobDespawn(mob) local JoL = GetMobByID(JAILER_OF_LOVE); local HPEMDES = JoL:getLocalVar("JoL_Qn_hpemde_Killed"); JoL:setLocalVar("JoL_Qn_hpemde_Killed", HPEMDES+1); end;
gpl-3.0
DailyShana/ygopro-scripts
c99594764.lua
5
1384
--ドラグニティ-コルセスカ function c99594764.initial_effect(c) --search local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(99594764,0)) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_BATTLE_DESTROYING) e1:SetRange(LOCATION_SZONE) e1:SetCondition(c99594764.thcon) e1:SetTarget(c99594764.thtg) e1:SetOperation(c99594764.thop) c:RegisterEffect(e1) end function c99594764.thcon(e,tp,eg,ep,ev,re,r,rp) return eg:GetCount()==1 and eg:GetFirst()==e:GetHandler():GetEquipTarget() end function c99594764.filter(c,race,att) return c:IsRace(race) and c:IsAttribute(att) and c:GetLevel()<=4 and c:IsAbleToHand() end function c99594764.thtg(e,tp,eg,ep,ev,re,r,rp,chk) local eqc=e:GetHandler():GetEquipTarget() if chk==0 then return Duel.IsExistingMatchingCard(c99594764.filter,tp,LOCATION_DECK,0,1,nil,eqc:GetRace(),eqc:GetAttribute()) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function c99594764.thop(e,tp,eg,ep,ev,re,r,rp) local eqc=e:GetHandler():GetEquipTarget() if not eqc then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,c99594764.filter,tp,LOCATION_DECK,0,1,1,nil,eqc:GetRace(),eqc:GetAttribute()) if g:GetCount()>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end
gpl-2.0
AlexandreCampo/famous3Simulation
subCULTron/aPadRandomWalk/premake4.lua
14
2220
solution "experiment" configurations { "debug", "release" , "profile" } --- ============================= LINUX ================================== if os.is ("linux") then includedirs { "/usr/include/libfamous" } includedirs { "/usr/local/include/libfamous" } includedirs { "/usr/include/bullet" } includedirs { "/usr/include/eigen3" } libdirs { os.findlib("glut"), os.findlib("GL"), os.findlib("GLU"), os.findlib("gsl"), os.findlib("BulletDynamics"), os.findlib("boost_program_options"), os.findlib("tinyxml"), os.findlib("famous")} links { "famous", "BulletDynamics", "BulletCollision", "LinearMath", "gsl", "gslcblas", "glut", "GL", "GLU", "boost_program_options", "tinyxml", "osg", "osgGA", "osgDB", "osgViewer", "osgText"} --- ============================= MACOSX ================================= elseif os.is ("macosx") then includedirs { "/opt/local/include/libfamous" } includedirs { "/opt/local/include/bullet" } includedirs { "/opt/local/include" } libdirs { os.findlib("glut"), os.findlib("GL"), os.findlib("GLU"), os.findlib("gsl"), os.findlib("BulletDynamics"), os.findlib("boost_program_options"), os.findlib("tinyxml")} libdirs { "/opt/local/lib" } links { "famous", "BulletDynamics", "BulletCollision", "LinearMath", "gsl", "gslcblas", "glut", "GL", "GLU", "boost_program_options-mt", "tinyxml"} end --- ============================= GENERIC ================================= project "experiment" kind "ConsoleApp" language "C++" files { "**.h", "**.cpp" } configuration "release" buildoptions {"-std=c++11"} defines { "NDEBUG" } flags { "OptimizeSpeed", "EnableSSE", "EnableSSE2", "FloatFast", "NoFramePointer"} configuration "debug" buildoptions {"-std=c++11"} defines { "DEBUG" } flags { "Symbols" } configuration "profile" buildoptions {"-std=c++11"} defines { "DEBUG" } flags { "Symbols" } buildoptions { "-pg" } linkoptions { "-pg" }
gpl-3.0
AlexandreCampo/famous3Simulation
subCULTron/docking/premake4.lua
14
2220
solution "experiment" configurations { "debug", "release" , "profile" } --- ============================= LINUX ================================== if os.is ("linux") then includedirs { "/usr/include/libfamous" } includedirs { "/usr/local/include/libfamous" } includedirs { "/usr/include/bullet" } includedirs { "/usr/include/eigen3" } libdirs { os.findlib("glut"), os.findlib("GL"), os.findlib("GLU"), os.findlib("gsl"), os.findlib("BulletDynamics"), os.findlib("boost_program_options"), os.findlib("tinyxml"), os.findlib("famous")} links { "famous", "BulletDynamics", "BulletCollision", "LinearMath", "gsl", "gslcblas", "glut", "GL", "GLU", "boost_program_options", "tinyxml", "osg", "osgGA", "osgDB", "osgViewer", "osgText"} --- ============================= MACOSX ================================= elseif os.is ("macosx") then includedirs { "/opt/local/include/libfamous" } includedirs { "/opt/local/include/bullet" } includedirs { "/opt/local/include" } libdirs { os.findlib("glut"), os.findlib("GL"), os.findlib("GLU"), os.findlib("gsl"), os.findlib("BulletDynamics"), os.findlib("boost_program_options"), os.findlib("tinyxml")} libdirs { "/opt/local/lib" } links { "famous", "BulletDynamics", "BulletCollision", "LinearMath", "gsl", "gslcblas", "glut", "GL", "GLU", "boost_program_options-mt", "tinyxml"} end --- ============================= GENERIC ================================= project "experiment" kind "ConsoleApp" language "C++" files { "**.h", "**.cpp" } configuration "release" buildoptions {"-std=c++11"} defines { "NDEBUG" } flags { "OptimizeSpeed", "EnableSSE", "EnableSSE2", "FloatFast", "NoFramePointer"} configuration "debug" buildoptions {"-std=c++11"} defines { "DEBUG" } flags { "Symbols" } configuration "profile" buildoptions {"-std=c++11"} defines { "DEBUG" } flags { "Symbols" } buildoptions { "-pg" } linkoptions { "-pg" }
gpl-3.0
wawi8/TeleNew
plugins/inrealm.lua
850
25085
-- data saved to moderation.json -- check moderation plugin do local function create_group(msg) -- superuser and admins only (because sudo are always has privilege) if is_sudo(msg) or is_realm(msg) and is_admin(msg) then local group_creator = msg.from.print_name create_group_chat (group_creator, group_name, ok_cb, false) return 'Group [ '..string.gsub(group_name, '_', ' ')..' ] has been created.' end end local function create_realm(msg) -- superuser and admins only (because sudo are always has privilege) if is_sudo(msg) or is_realm(msg) and is_admin(msg) then local group_creator = msg.from.print_name create_group_chat (group_creator, group_name, ok_cb, false) return 'Realm [ '..string.gsub(group_name, '_', ' ')..' ] has been created.' end end local function killchat(cb_extra, success, result) local receiver = cb_extra.receiver local chat_id = "chat#id"..result.id local chatname = result.print_name for k,v in pairs(result.members) do kick_user_any(v.id, result.id) end end local function killrealm(cb_extra, success, result) local receiver = cb_extra.receiver local chat_id = "chat#id"..result.id local chatname = result.print_name for k,v in pairs(result.members) do kick_user_any(v.id, result.id) end end local function get_group_type(msg) local data = load_data(_config.moderation.data) if data[tostring(msg.to.id)] then if not data[tostring(msg.to.id)]['group_type'] then return 'No group type available.' end local group_type = data[tostring(msg.to.id)]['group_type'] return group_type else return 'Chat type not found.' end end local function callbackres(extra, success, result) --vardump(result) local user = result.id local name = string.gsub(result.print_name, "_", " ") local chat = 'chat#id'..extra.chatid send_large_msg(chat, user..'\n'..name) return user end local function set_description(msg, data, target, about) if not is_admin(msg) then return "For admins only!" end local data_cat = 'description' data[tostring(target)][data_cat] = about save_data(_config.moderation.data, data) return 'Set group description to:\n'..about end local function set_rules(msg, data, target) if not is_admin(msg) then return "For admins only!" end local data_cat = 'rules' data[tostring(target)][data_cat] = rules save_data(_config.moderation.data, data) return 'Set group rules to:\n'..rules end -- lock/unlock group name. bot automatically change group name when locked local function lock_group_name(msg, data, target) if not is_admin(msg) then return "For admins only!" end local group_name_set = data[tostring(target)]['settings']['set_name'] local group_name_lock = data[tostring(target)]['settings']['lock_name'] if group_name_lock == 'yes' then return 'Group name is already locked' else data[tostring(target)]['settings']['lock_name'] = 'yes' save_data(_config.moderation.data, data) rename_chat('chat#id'..target, group_name_set, ok_cb, false) return 'Group name has been locked' end end local function unlock_group_name(msg, data, target) if not is_admin(msg) then return "For admins only!" end local group_name_set = data[tostring(target)]['settings']['set_name'] local group_name_lock = data[tostring(target)]['settings']['lock_name'] if group_name_lock == 'no' then return 'Group name is already unlocked' else data[tostring(target)]['settings']['lock_name'] = 'no' save_data(_config.moderation.data, data) return 'Group name has been unlocked' end end --lock/unlock group member. bot automatically kick new added user when locked local function lock_group_member(msg, data, target) if not is_admin(msg) then return "For admins only!" end local group_member_lock = data[tostring(target)]['settings']['lock_member'] if group_member_lock == 'yes' then return 'Group members are already locked' else data[tostring(target)]['settings']['lock_member'] = 'yes' save_data(_config.moderation.data, data) end return 'Group members has been locked' end local function unlock_group_member(msg, data, target) if not is_admin(msg) then return "For admins only!" end local group_member_lock = data[tostring(target)]['settings']['lock_member'] if group_member_lock == 'no' then return 'Group members are not locked' else data[tostring(target)]['settings']['lock_member'] = 'no' save_data(_config.moderation.data, data) return 'Group members has been unlocked' end end --lock/unlock group photo. bot automatically keep group photo when locked local function lock_group_photo(msg, data, target) if not is_admin(msg) then return "For admins only!" end local group_photo_lock = data[tostring(target)]['settings']['lock_photo'] if group_photo_lock == 'yes' then return 'Group photo is already locked' else data[tostring(target)]['settings']['set_photo'] = 'waiting' save_data(_config.moderation.data, data) end return 'Please send me the group photo now' end local function unlock_group_photo(msg, data, target) if not is_admin(msg) then return "For admins only!" end local group_photo_lock = data[tostring(target)]['settings']['lock_photo'] if group_photo_lock == 'no' then return 'Group photo is not locked' else data[tostring(target)]['settings']['lock_photo'] = 'no' save_data(_config.moderation.data, data) return 'Group photo has been unlocked' end end local function lock_group_flood(msg, data, target) if not is_admin(msg) then return "For admins only!" end local group_flood_lock = data[tostring(target)]['settings']['flood'] if group_flood_lock == 'yes' then return 'Group flood is locked' else data[tostring(target)]['settings']['flood'] = 'yes' save_data(_config.moderation.data, data) return 'Group flood has been locked' end end local function unlock_group_flood(msg, data, target) if not is_admin(msg) then return "For admins only!" end local group_flood_lock = data[tostring(target)]['settings']['flood'] if group_flood_lock == 'no' then return 'Group flood is not locked' else data[tostring(target)]['settings']['flood'] = 'no' save_data(_config.moderation.data, data) return 'Group flood has been unlocked' end end -- show group settings local function show_group_settings(msg, data, target) local data = load_data(_config.moderation.data, data) if not is_admin(msg) then return "For admins only!" end local settings = data[tostring(target)]['settings'] local text = "Group settings:\nLock group name : "..settings.lock_name.."\nLock group photo : "..settings.lock_photo.."\nLock group member : "..settings.lock_member return text end local function returnids(cb_extra, success, result) local receiver = cb_extra.receiver local chat_id = "chat#id"..result.id local chatname = result.print_name local text = 'Users in '..string.gsub(chatname,"_"," ")..' ('..result.id..'):'..'\n'..'' for k,v in pairs(result.members) do if v.print_name then local username = "" text = text .. "- " .. string.gsub(v.print_name,"_"," ") .. " (" .. v.id .. ") \n" end end send_large_msg(receiver, text) local file = io.open("./groups/lists/"..result.id.."memberlist.txt", "w") file:write(text) file:flush() file:close() end local function returnidsfile(cb_extra, success, result) local receiver = cb_extra.receiver local chat_id = "chat#id"..result.id local chatname = result.print_name local text = 'Users in '..string.gsub(chatname,"_"," ")..' ('..result.id..'):'..'\n'..'' for k,v in pairs(result.members) do if v.print_name then local username = "" text = text .. "- " .. string.gsub(v.print_name,"_"," ") .. " (" .. v.id .. ") \n" end end local file = io.open("./groups/lists/"..result.id.."memberlist.txt", "w") file:write(text) file:flush() file:close() send_document("chat#id"..result.id,"./groups/lists/"..result.id.."memberlist.txt", ok_cb, false) end local function admin_promote(msg, admin_id) if not is_sudo(msg) then return "Access denied!" end local admins = 'admins' if not data[tostring(admins)] then data[tostring(admins)] = {} save_data(_config.moderation.data, data) end if data[tostring(admins)][tostring(admin_id)] then return admin_name..' is already an admin.' end data[tostring(admins)][tostring(admin_id)] = admin_id save_data(_config.moderation.data, data) return admin_id..' has been promoted as admin.' end local function admin_demote(msg, admin_id) if not is_sudo(msg) then return "Access denied!" end local data = load_data(_config.moderation.data) local admins = 'admins' if not data[tostring(admins)] then data[tostring(admins)] = {} save_data(_config.moderation.data, data) end if not data[tostring(admins)][tostring(admin_id)] then return admin_id..' is not an admin.' end data[tostring(admins)][tostring(admin_id)] = nil save_data(_config.moderation.data, data) return admin_id..' has been demoted from admin.' end local function admin_list(msg) local data = load_data(_config.moderation.data) local admins = 'admins' if not data[tostring(admins)] then data[tostring(admins)] = {} save_data(_config.moderation.data, data) end local message = 'List for Realm admins:\n' for k,v in pairs(data[tostring(admins)]) do message = message .. '- (at)' .. v .. ' [' .. k .. '] ' ..'\n' end return message end local function groups_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' for k,v in pairs(data[tostring(groups)]) do local settings = data[tostring(v)]['settings'] for m,n in pairs(settings) do if m == 'set_name' then name = n end end local group_owner = "No owner" if data[tostring(v)]['set_owner'] then group_owner = tostring(data[tostring(v)]['set_owner']) end local group_link = "No link" if data[tostring(v)]['settings']['set_link'] then group_link = data[tostring(v)]['settings']['set_link'] end message = message .. '- '.. name .. ' (' .. v .. ') ['..group_owner..'] \n {'..group_link.."}\n" end local file = io.open("./groups/lists/groups.txt", "w") file:write(message) file:flush() file:close() return message end local function realms_list(msg) local data = load_data(_config.moderation.data) local realms = 'realms' if not data[tostring(realms)] then return 'No Realms at the moment' end local message = 'List of Realms:\n' for k,v in pairs(data[tostring(realms)]) do local settings = data[tostring(v)]['settings'] for m,n in pairs(settings) do if m == 'set_name' then name = n end end local group_owner = "No owner" if data[tostring(v)]['admins_in'] then group_owner = tostring(data[tostring(v)]['admins_in']) end local group_link = "No link" if data[tostring(v)]['settings']['set_link'] then group_link = data[tostring(v)]['settings']['set_link'] end message = message .. '- '.. name .. ' (' .. v .. ') ['..group_owner..'] \n {'..group_link.."}\n" end local file = io.open("./groups/lists/realms.txt", "w") file:write(message) file:flush() file:close() return message end local function admin_user_promote(receiver, member_username, member_id) local data = load_data(_config.moderation.data) if not data['admins'] then data['admins'] = {} save_data(_config.moderation.data, data) end if data['admins'][tostring(member_id)] then return send_large_msg(receiver, member_username..' is already as admin.') end data['admins'][tostring(member_id)] = member_username save_data(_config.moderation.data, data) return send_large_msg(receiver, '@'..member_username..' has been promoted as admin.') end local function admin_user_demote(receiver, member_username, member_id) local data = load_data(_config.moderation.data) if not data['admins'] then data['admins'] = {} save_data(_config.moderation.data, data) end if not data['admins'][tostring(member_id)] then return send_large_msg(receiver, member_username..' is not an admin.') end data['admins'][tostring(member_id)] = nil save_data(_config.moderation.data, data) return send_large_msg(receiver, 'Admin '..member_username..' has been demoted.') end local function username_id(cb_extra, success, result) local mod_cmd = cb_extra.mod_cmd local receiver = cb_extra.receiver local member = cb_extra.member local text = 'No user @'..member..' in this group.' for k,v in pairs(result.members) do vusername = v.username if vusername == member then member_username = member member_id = v.id if mod_cmd == 'addadmin' then return admin_user_promote(receiver, member_username, member_id) elseif mod_cmd == 'removeadmin' then return admin_user_demote(receiver, member_username, member_id) end end end send_large_msg(receiver, text) end local function set_log_group(msg) if not is_admin(msg) then return end local log_group = data[tostring(groups)][tostring(msg.to.id)]['log_group'] if log_group == 'yes' then return 'Log group is already set' else data[tostring(groups)][tostring(msg.to.id)]['log_group'] = 'yes' save_data(_config.moderation.data, data) return 'Log group has been set' end end local function unset_log_group(msg) if not is_admin(msg) then return end local log_group = data[tostring(groups)][tostring(msg.to.id)]['log_group'] if log_group == 'no' then return 'Log group is already disabled' else data[tostring(groups)][tostring(msg.to.id)]['log_group'] = 'no' save_data(_config.moderation.data, data) return 'log group has been disabled' end end local function help() local help_text = tostring(_config.help_text_realm) return help_text end function run(msg, matches) --vardump(msg) local name_log = user_print_name(msg.from) if matches[1] == 'log' and is_owner(msg) then savelog(msg.to.id, "log file created by owner") send_document("chat#id"..msg.to.id,"./groups/"..msg.to.id.."log.txt", ok_cb, false) end if matches[1] == 'who' and is_momod(msg) then local name = user_print_name(msg.from) savelog(msg.to.id, name.." ["..msg.from.id.."] requested member list ") local receiver = get_receiver(msg) chat_info(receiver, returnidsfile, {receiver=receiver}) end if matches[1] == 'wholist' and is_momod(msg) then local name = user_print_name(msg.from) savelog(msg.to.id, name.." ["..msg.from.id.."] requested member list in a file") local receiver = get_receiver(msg) chat_info(receiver, returnids, {receiver=receiver}) end if matches[1] == 'creategroup' and matches[2] then group_name = matches[2] group_type = 'group' return create_group(msg) end if not is_sudo(msg) or not is_admin(msg) and not is_realm(msg) then return --Do nothing end if matches[1] == 'createrealm' and matches[2] then group_name = matches[2] group_type = 'realm' return create_realm(msg) end local data = load_data(_config.moderation.data) local receiver = get_receiver(msg) if matches[2] then if data[tostring(matches[2])] then local settings = data[tostring(matches[2])]['settings'] if matches[1] == 'setabout' and matches[2] then local target = matches[2] local about = matches[3] return set_description(msg, data, target, about) end if matches[1] == 'setrules' then rules = matches[3] local target = matches[2] return set_rules(msg, data, target) end if matches[1] == 'lock' then --group lock * local target = matches[2] if matches[3] == 'name' then return lock_group_name(msg, data, target) end if matches[3] == 'member' then return lock_group_member(msg, data, target) end if matches[3] == 'photo' then return lock_group_photo(msg, data, target) end if matches[3] == 'flood' then return lock_group_flood(msg, data, target) end end if matches[1] == 'unlock' then --group unlock * local target = matches[2] if matches[3] == 'name' then return unlock_group_name(msg, data, target) end if matches[3] == 'member' then return unlock_group_member(msg, data, target) end if matches[3] == 'photo' then return unlock_group_photo(msg, data, target) end if matches[3] == 'flood' then return unlock_group_flood(msg, data, target) end end if matches[1] == 'settings' and data[tostring(matches[2])]['settings'] then local target = matches[2] return show_group_settings(msg, data, target) end if matches[1] == 'setname' and is_realm(msg) then local new_name = string.gsub(matches[2], '_', ' ') data[tostring(msg.to.id)]['settings']['set_name'] = new_name save_data(_config.moderation.data, data) local group_name_set = data[tostring(msg.to.id)]['settings']['set_name'] local to_rename = 'chat#id'..msg.to.id rename_chat(to_rename, group_name_set, ok_cb, false) savelog(msg.to.id, "Realm { "..msg.to.print_name.." } name changed to [ "..new_name.." ] by "..name_log.." ["..msg.from.id.."]") end if matches[1] == 'setgpname' and is_admin(msg) then local new_name = string.gsub(matches[3], '_', ' ') data[tostring(matches[2])]['settings']['set_name'] = new_name save_data(_config.moderation.data, data) local group_name_set = data[tostring(matches[2])]['settings']['set_name'] local to_rename = 'chat#id'..matches[2] rename_chat(to_rename, group_name_set, ok_cb, false) savelog(msg.to.id, "Group { "..msg.to.print_name.." } name changed to [ "..new_name.." ] by "..name_log.." ["..msg.from.id.."]") end end end if matches[1] == 'help' and is_realm(msg) then savelog(msg.to.id, name_log.." ["..msg.from.id.."] Used /help") return help() end if matches[1] == 'set' then if matches[2] == 'loggroup' then savelog(msg.to.id, name_log.." ["..msg.from.id.."] set as log group") return set_log_group(msg) end end if matches[1] == 'kill' and matches[2] == 'chat' then if not is_admin(msg) then return nil end if is_realm(msg) then local receiver = 'chat#id'..matches[3] return modrem(msg), print("Closing Group: "..receiver), chat_info(receiver, killchat, {receiver=receiver}) else return 'Error: Group '..matches[3]..' not found' end end if matches[1] == 'kill' and matches[2] == 'realm' then if not is_admin(msg) then return nil end if is_realm(msg) then local receiver = 'chat#id'..matches[3] return realmrem(msg), print("Closing realm: "..receiver), chat_info(receiver, killrealm, {receiver=receiver}) else return 'Error: Realm '..matches[3]..' not found' end end if matches[1] == 'chat_add_user' then if not msg.service then return "Are you trying to troll me?" end local user = 'user#id'..msg.action.user.id local chat = 'chat#id'..msg.to.id if not is_admin(msg) then chat_del_user(chat, user, ok_cb, true) end end if matches[1] == 'addadmin' then if string.match(matches[2], '^%d+$') then local admin_id = matches[2] print("user "..admin_id.." has been promoted as admin") return admin_promote(msg, admin_id) else local member = string.gsub(matches[2], "@", "") local mod_cmd = "addadmin" chat_info(receiver, username_id, {mod_cmd= mod_cmd, receiver=receiver, member=member}) end end if matches[1] == 'removeadmin' then if string.match(matches[2], '^%d+$') then local admin_id = matches[2] print("user "..admin_id.." has been demoted") return admin_demote(msg, admin_id) else local member = string.gsub(matches[2], "@", "") local mod_cmd = "removeadmin" chat_info(receiver, username_id, {mod_cmd= mod_cmd, receiver=receiver, member=member}) end end if matches[1] == 'type'then local group_type = get_group_type(msg) return group_type end if matches[1] == 'list' and matches[2] == 'admins' then return admin_list(msg) end if matches[1] == 'list' and matches[2] == 'groups' then if msg.to.type == 'chat' then groups_list(msg) send_document("chat#id"..msg.to.id, "./groups/lists/groups.txt", ok_cb, false) return "Group list created" --group_list(msg) elseif msg.to.type == 'user' then groups_list(msg) send_document("user#id"..msg.from.id, "./groups/lists/groups.txt", ok_cb, false) return "Group list created" --group_list(msg) end end if matches[1] == 'list' and matches[2] == 'realms' then if msg.to.type == 'chat' then realms_list(msg) send_document("chat#id"..msg.to.id, "./groups/lists/realms.txt", ok_cb, false) return "Realms list created" --realms_list(msg) elseif msg.to.type == 'user' then realms_list(msg) send_document("user#id"..msg.from.id, "./groups/lists/realms.txt", ok_cb, false) return "Realms list created" --realms_list(msg) end end if matches[1] == 'res' and is_momod(msg) then local cbres_extra = { chatid = msg.to.id } local username = matches[2] local username = username:gsub("@","") savelog(msg.to.id, name_log.." ["..msg.from.id.."] Used /res "..username) return res_user(username, callbackres, cbres_extra) end end return { patterns = { "^[!/](creategroup) (.*)$", "^[!/](createrealm) (.*)$", "^[!/](setabout) (%d+) (.*)$", "^[!/](setrules) (%d+) (.*)$", "^[!/](setname) (.*)$", "^[!/](setgpname) (%d+) (.*)$", "^[!/](setname) (%d+) (.*)$", "^[!/](lock) (%d+) (.*)$", "^[!/](unlock) (%d+) (.*)$", "^[!/](setting) (%d+)$", "^[!/](wholist)$", "^[!/](who)$", "^[!/](type)$", "^[!/](kill) (chat) (%d+)$", "^[!/](kill) (realm) (%d+)$", "^[!/](addadmin) (.*)$", -- sudoers only "^[!/](removeadmin) (.*)$", -- sudoers only "^[!/](list) (.*)$", "^[!/](log)$", "^[!/](help)$", "^!!tgservice (.+)$", }, run = run } end
gpl-2.0
dani-sj/komilss
plugins/inrealm.lua
850
25085
-- data saved to moderation.json -- check moderation plugin do local function create_group(msg) -- superuser and admins only (because sudo are always has privilege) if is_sudo(msg) or is_realm(msg) and is_admin(msg) then local group_creator = msg.from.print_name create_group_chat (group_creator, group_name, ok_cb, false) return 'Group [ '..string.gsub(group_name, '_', ' ')..' ] has been created.' end end local function create_realm(msg) -- superuser and admins only (because sudo are always has privilege) if is_sudo(msg) or is_realm(msg) and is_admin(msg) then local group_creator = msg.from.print_name create_group_chat (group_creator, group_name, ok_cb, false) return 'Realm [ '..string.gsub(group_name, '_', ' ')..' ] has been created.' end end local function killchat(cb_extra, success, result) local receiver = cb_extra.receiver local chat_id = "chat#id"..result.id local chatname = result.print_name for k,v in pairs(result.members) do kick_user_any(v.id, result.id) end end local function killrealm(cb_extra, success, result) local receiver = cb_extra.receiver local chat_id = "chat#id"..result.id local chatname = result.print_name for k,v in pairs(result.members) do kick_user_any(v.id, result.id) end end local function get_group_type(msg) local data = load_data(_config.moderation.data) if data[tostring(msg.to.id)] then if not data[tostring(msg.to.id)]['group_type'] then return 'No group type available.' end local group_type = data[tostring(msg.to.id)]['group_type'] return group_type else return 'Chat type not found.' end end local function callbackres(extra, success, result) --vardump(result) local user = result.id local name = string.gsub(result.print_name, "_", " ") local chat = 'chat#id'..extra.chatid send_large_msg(chat, user..'\n'..name) return user end local function set_description(msg, data, target, about) if not is_admin(msg) then return "For admins only!" end local data_cat = 'description' data[tostring(target)][data_cat] = about save_data(_config.moderation.data, data) return 'Set group description to:\n'..about end local function set_rules(msg, data, target) if not is_admin(msg) then return "For admins only!" end local data_cat = 'rules' data[tostring(target)][data_cat] = rules save_data(_config.moderation.data, data) return 'Set group rules to:\n'..rules end -- lock/unlock group name. bot automatically change group name when locked local function lock_group_name(msg, data, target) if not is_admin(msg) then return "For admins only!" end local group_name_set = data[tostring(target)]['settings']['set_name'] local group_name_lock = data[tostring(target)]['settings']['lock_name'] if group_name_lock == 'yes' then return 'Group name is already locked' else data[tostring(target)]['settings']['lock_name'] = 'yes' save_data(_config.moderation.data, data) rename_chat('chat#id'..target, group_name_set, ok_cb, false) return 'Group name has been locked' end end local function unlock_group_name(msg, data, target) if not is_admin(msg) then return "For admins only!" end local group_name_set = data[tostring(target)]['settings']['set_name'] local group_name_lock = data[tostring(target)]['settings']['lock_name'] if group_name_lock == 'no' then return 'Group name is already unlocked' else data[tostring(target)]['settings']['lock_name'] = 'no' save_data(_config.moderation.data, data) return 'Group name has been unlocked' end end --lock/unlock group member. bot automatically kick new added user when locked local function lock_group_member(msg, data, target) if not is_admin(msg) then return "For admins only!" end local group_member_lock = data[tostring(target)]['settings']['lock_member'] if group_member_lock == 'yes' then return 'Group members are already locked' else data[tostring(target)]['settings']['lock_member'] = 'yes' save_data(_config.moderation.data, data) end return 'Group members has been locked' end local function unlock_group_member(msg, data, target) if not is_admin(msg) then return "For admins only!" end local group_member_lock = data[tostring(target)]['settings']['lock_member'] if group_member_lock == 'no' then return 'Group members are not locked' else data[tostring(target)]['settings']['lock_member'] = 'no' save_data(_config.moderation.data, data) return 'Group members has been unlocked' end end --lock/unlock group photo. bot automatically keep group photo when locked local function lock_group_photo(msg, data, target) if not is_admin(msg) then return "For admins only!" end local group_photo_lock = data[tostring(target)]['settings']['lock_photo'] if group_photo_lock == 'yes' then return 'Group photo is already locked' else data[tostring(target)]['settings']['set_photo'] = 'waiting' save_data(_config.moderation.data, data) end return 'Please send me the group photo now' end local function unlock_group_photo(msg, data, target) if not is_admin(msg) then return "For admins only!" end local group_photo_lock = data[tostring(target)]['settings']['lock_photo'] if group_photo_lock == 'no' then return 'Group photo is not locked' else data[tostring(target)]['settings']['lock_photo'] = 'no' save_data(_config.moderation.data, data) return 'Group photo has been unlocked' end end local function lock_group_flood(msg, data, target) if not is_admin(msg) then return "For admins only!" end local group_flood_lock = data[tostring(target)]['settings']['flood'] if group_flood_lock == 'yes' then return 'Group flood is locked' else data[tostring(target)]['settings']['flood'] = 'yes' save_data(_config.moderation.data, data) return 'Group flood has been locked' end end local function unlock_group_flood(msg, data, target) if not is_admin(msg) then return "For admins only!" end local group_flood_lock = data[tostring(target)]['settings']['flood'] if group_flood_lock == 'no' then return 'Group flood is not locked' else data[tostring(target)]['settings']['flood'] = 'no' save_data(_config.moderation.data, data) return 'Group flood has been unlocked' end end -- show group settings local function show_group_settings(msg, data, target) local data = load_data(_config.moderation.data, data) if not is_admin(msg) then return "For admins only!" end local settings = data[tostring(target)]['settings'] local text = "Group settings:\nLock group name : "..settings.lock_name.."\nLock group photo : "..settings.lock_photo.."\nLock group member : "..settings.lock_member return text end local function returnids(cb_extra, success, result) local receiver = cb_extra.receiver local chat_id = "chat#id"..result.id local chatname = result.print_name local text = 'Users in '..string.gsub(chatname,"_"," ")..' ('..result.id..'):'..'\n'..'' for k,v in pairs(result.members) do if v.print_name then local username = "" text = text .. "- " .. string.gsub(v.print_name,"_"," ") .. " (" .. v.id .. ") \n" end end send_large_msg(receiver, text) local file = io.open("./groups/lists/"..result.id.."memberlist.txt", "w") file:write(text) file:flush() file:close() end local function returnidsfile(cb_extra, success, result) local receiver = cb_extra.receiver local chat_id = "chat#id"..result.id local chatname = result.print_name local text = 'Users in '..string.gsub(chatname,"_"," ")..' ('..result.id..'):'..'\n'..'' for k,v in pairs(result.members) do if v.print_name then local username = "" text = text .. "- " .. string.gsub(v.print_name,"_"," ") .. " (" .. v.id .. ") \n" end end local file = io.open("./groups/lists/"..result.id.."memberlist.txt", "w") file:write(text) file:flush() file:close() send_document("chat#id"..result.id,"./groups/lists/"..result.id.."memberlist.txt", ok_cb, false) end local function admin_promote(msg, admin_id) if not is_sudo(msg) then return "Access denied!" end local admins = 'admins' if not data[tostring(admins)] then data[tostring(admins)] = {} save_data(_config.moderation.data, data) end if data[tostring(admins)][tostring(admin_id)] then return admin_name..' is already an admin.' end data[tostring(admins)][tostring(admin_id)] = admin_id save_data(_config.moderation.data, data) return admin_id..' has been promoted as admin.' end local function admin_demote(msg, admin_id) if not is_sudo(msg) then return "Access denied!" end local data = load_data(_config.moderation.data) local admins = 'admins' if not data[tostring(admins)] then data[tostring(admins)] = {} save_data(_config.moderation.data, data) end if not data[tostring(admins)][tostring(admin_id)] then return admin_id..' is not an admin.' end data[tostring(admins)][tostring(admin_id)] = nil save_data(_config.moderation.data, data) return admin_id..' has been demoted from admin.' end local function admin_list(msg) local data = load_data(_config.moderation.data) local admins = 'admins' if not data[tostring(admins)] then data[tostring(admins)] = {} save_data(_config.moderation.data, data) end local message = 'List for Realm admins:\n' for k,v in pairs(data[tostring(admins)]) do message = message .. '- (at)' .. v .. ' [' .. k .. '] ' ..'\n' end return message end local function groups_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' for k,v in pairs(data[tostring(groups)]) do local settings = data[tostring(v)]['settings'] for m,n in pairs(settings) do if m == 'set_name' then name = n end end local group_owner = "No owner" if data[tostring(v)]['set_owner'] then group_owner = tostring(data[tostring(v)]['set_owner']) end local group_link = "No link" if data[tostring(v)]['settings']['set_link'] then group_link = data[tostring(v)]['settings']['set_link'] end message = message .. '- '.. name .. ' (' .. v .. ') ['..group_owner..'] \n {'..group_link.."}\n" end local file = io.open("./groups/lists/groups.txt", "w") file:write(message) file:flush() file:close() return message end local function realms_list(msg) local data = load_data(_config.moderation.data) local realms = 'realms' if not data[tostring(realms)] then return 'No Realms at the moment' end local message = 'List of Realms:\n' for k,v in pairs(data[tostring(realms)]) do local settings = data[tostring(v)]['settings'] for m,n in pairs(settings) do if m == 'set_name' then name = n end end local group_owner = "No owner" if data[tostring(v)]['admins_in'] then group_owner = tostring(data[tostring(v)]['admins_in']) end local group_link = "No link" if data[tostring(v)]['settings']['set_link'] then group_link = data[tostring(v)]['settings']['set_link'] end message = message .. '- '.. name .. ' (' .. v .. ') ['..group_owner..'] \n {'..group_link.."}\n" end local file = io.open("./groups/lists/realms.txt", "w") file:write(message) file:flush() file:close() return message end local function admin_user_promote(receiver, member_username, member_id) local data = load_data(_config.moderation.data) if not data['admins'] then data['admins'] = {} save_data(_config.moderation.data, data) end if data['admins'][tostring(member_id)] then return send_large_msg(receiver, member_username..' is already as admin.') end data['admins'][tostring(member_id)] = member_username save_data(_config.moderation.data, data) return send_large_msg(receiver, '@'..member_username..' has been promoted as admin.') end local function admin_user_demote(receiver, member_username, member_id) local data = load_data(_config.moderation.data) if not data['admins'] then data['admins'] = {} save_data(_config.moderation.data, data) end if not data['admins'][tostring(member_id)] then return send_large_msg(receiver, member_username..' is not an admin.') end data['admins'][tostring(member_id)] = nil save_data(_config.moderation.data, data) return send_large_msg(receiver, 'Admin '..member_username..' has been demoted.') end local function username_id(cb_extra, success, result) local mod_cmd = cb_extra.mod_cmd local receiver = cb_extra.receiver local member = cb_extra.member local text = 'No user @'..member..' in this group.' for k,v in pairs(result.members) do vusername = v.username if vusername == member then member_username = member member_id = v.id if mod_cmd == 'addadmin' then return admin_user_promote(receiver, member_username, member_id) elseif mod_cmd == 'removeadmin' then return admin_user_demote(receiver, member_username, member_id) end end end send_large_msg(receiver, text) end local function set_log_group(msg) if not is_admin(msg) then return end local log_group = data[tostring(groups)][tostring(msg.to.id)]['log_group'] if log_group == 'yes' then return 'Log group is already set' else data[tostring(groups)][tostring(msg.to.id)]['log_group'] = 'yes' save_data(_config.moderation.data, data) return 'Log group has been set' end end local function unset_log_group(msg) if not is_admin(msg) then return end local log_group = data[tostring(groups)][tostring(msg.to.id)]['log_group'] if log_group == 'no' then return 'Log group is already disabled' else data[tostring(groups)][tostring(msg.to.id)]['log_group'] = 'no' save_data(_config.moderation.data, data) return 'log group has been disabled' end end local function help() local help_text = tostring(_config.help_text_realm) return help_text end function run(msg, matches) --vardump(msg) local name_log = user_print_name(msg.from) if matches[1] == 'log' and is_owner(msg) then savelog(msg.to.id, "log file created by owner") send_document("chat#id"..msg.to.id,"./groups/"..msg.to.id.."log.txt", ok_cb, false) end if matches[1] == 'who' and is_momod(msg) then local name = user_print_name(msg.from) savelog(msg.to.id, name.." ["..msg.from.id.."] requested member list ") local receiver = get_receiver(msg) chat_info(receiver, returnidsfile, {receiver=receiver}) end if matches[1] == 'wholist' and is_momod(msg) then local name = user_print_name(msg.from) savelog(msg.to.id, name.." ["..msg.from.id.."] requested member list in a file") local receiver = get_receiver(msg) chat_info(receiver, returnids, {receiver=receiver}) end if matches[1] == 'creategroup' and matches[2] then group_name = matches[2] group_type = 'group' return create_group(msg) end if not is_sudo(msg) or not is_admin(msg) and not is_realm(msg) then return --Do nothing end if matches[1] == 'createrealm' and matches[2] then group_name = matches[2] group_type = 'realm' return create_realm(msg) end local data = load_data(_config.moderation.data) local receiver = get_receiver(msg) if matches[2] then if data[tostring(matches[2])] then local settings = data[tostring(matches[2])]['settings'] if matches[1] == 'setabout' and matches[2] then local target = matches[2] local about = matches[3] return set_description(msg, data, target, about) end if matches[1] == 'setrules' then rules = matches[3] local target = matches[2] return set_rules(msg, data, target) end if matches[1] == 'lock' then --group lock * local target = matches[2] if matches[3] == 'name' then return lock_group_name(msg, data, target) end if matches[3] == 'member' then return lock_group_member(msg, data, target) end if matches[3] == 'photo' then return lock_group_photo(msg, data, target) end if matches[3] == 'flood' then return lock_group_flood(msg, data, target) end end if matches[1] == 'unlock' then --group unlock * local target = matches[2] if matches[3] == 'name' then return unlock_group_name(msg, data, target) end if matches[3] == 'member' then return unlock_group_member(msg, data, target) end if matches[3] == 'photo' then return unlock_group_photo(msg, data, target) end if matches[3] == 'flood' then return unlock_group_flood(msg, data, target) end end if matches[1] == 'settings' and data[tostring(matches[2])]['settings'] then local target = matches[2] return show_group_settings(msg, data, target) end if matches[1] == 'setname' and is_realm(msg) then local new_name = string.gsub(matches[2], '_', ' ') data[tostring(msg.to.id)]['settings']['set_name'] = new_name save_data(_config.moderation.data, data) local group_name_set = data[tostring(msg.to.id)]['settings']['set_name'] local to_rename = 'chat#id'..msg.to.id rename_chat(to_rename, group_name_set, ok_cb, false) savelog(msg.to.id, "Realm { "..msg.to.print_name.." } name changed to [ "..new_name.." ] by "..name_log.." ["..msg.from.id.."]") end if matches[1] == 'setgpname' and is_admin(msg) then local new_name = string.gsub(matches[3], '_', ' ') data[tostring(matches[2])]['settings']['set_name'] = new_name save_data(_config.moderation.data, data) local group_name_set = data[tostring(matches[2])]['settings']['set_name'] local to_rename = 'chat#id'..matches[2] rename_chat(to_rename, group_name_set, ok_cb, false) savelog(msg.to.id, "Group { "..msg.to.print_name.." } name changed to [ "..new_name.." ] by "..name_log.." ["..msg.from.id.."]") end end end if matches[1] == 'help' and is_realm(msg) then savelog(msg.to.id, name_log.." ["..msg.from.id.."] Used /help") return help() end if matches[1] == 'set' then if matches[2] == 'loggroup' then savelog(msg.to.id, name_log.." ["..msg.from.id.."] set as log group") return set_log_group(msg) end end if matches[1] == 'kill' and matches[2] == 'chat' then if not is_admin(msg) then return nil end if is_realm(msg) then local receiver = 'chat#id'..matches[3] return modrem(msg), print("Closing Group: "..receiver), chat_info(receiver, killchat, {receiver=receiver}) else return 'Error: Group '..matches[3]..' not found' end end if matches[1] == 'kill' and matches[2] == 'realm' then if not is_admin(msg) then return nil end if is_realm(msg) then local receiver = 'chat#id'..matches[3] return realmrem(msg), print("Closing realm: "..receiver), chat_info(receiver, killrealm, {receiver=receiver}) else return 'Error: Realm '..matches[3]..' not found' end end if matches[1] == 'chat_add_user' then if not msg.service then return "Are you trying to troll me?" end local user = 'user#id'..msg.action.user.id local chat = 'chat#id'..msg.to.id if not is_admin(msg) then chat_del_user(chat, user, ok_cb, true) end end if matches[1] == 'addadmin' then if string.match(matches[2], '^%d+$') then local admin_id = matches[2] print("user "..admin_id.." has been promoted as admin") return admin_promote(msg, admin_id) else local member = string.gsub(matches[2], "@", "") local mod_cmd = "addadmin" chat_info(receiver, username_id, {mod_cmd= mod_cmd, receiver=receiver, member=member}) end end if matches[1] == 'removeadmin' then if string.match(matches[2], '^%d+$') then local admin_id = matches[2] print("user "..admin_id.." has been demoted") return admin_demote(msg, admin_id) else local member = string.gsub(matches[2], "@", "") local mod_cmd = "removeadmin" chat_info(receiver, username_id, {mod_cmd= mod_cmd, receiver=receiver, member=member}) end end if matches[1] == 'type'then local group_type = get_group_type(msg) return group_type end if matches[1] == 'list' and matches[2] == 'admins' then return admin_list(msg) end if matches[1] == 'list' and matches[2] == 'groups' then if msg.to.type == 'chat' then groups_list(msg) send_document("chat#id"..msg.to.id, "./groups/lists/groups.txt", ok_cb, false) return "Group list created" --group_list(msg) elseif msg.to.type == 'user' then groups_list(msg) send_document("user#id"..msg.from.id, "./groups/lists/groups.txt", ok_cb, false) return "Group list created" --group_list(msg) end end if matches[1] == 'list' and matches[2] == 'realms' then if msg.to.type == 'chat' then realms_list(msg) send_document("chat#id"..msg.to.id, "./groups/lists/realms.txt", ok_cb, false) return "Realms list created" --realms_list(msg) elseif msg.to.type == 'user' then realms_list(msg) send_document("user#id"..msg.from.id, "./groups/lists/realms.txt", ok_cb, false) return "Realms list created" --realms_list(msg) end end if matches[1] == 'res' and is_momod(msg) then local cbres_extra = { chatid = msg.to.id } local username = matches[2] local username = username:gsub("@","") savelog(msg.to.id, name_log.." ["..msg.from.id.."] Used /res "..username) return res_user(username, callbackres, cbres_extra) end end return { patterns = { "^[!/](creategroup) (.*)$", "^[!/](createrealm) (.*)$", "^[!/](setabout) (%d+) (.*)$", "^[!/](setrules) (%d+) (.*)$", "^[!/](setname) (.*)$", "^[!/](setgpname) (%d+) (.*)$", "^[!/](setname) (%d+) (.*)$", "^[!/](lock) (%d+) (.*)$", "^[!/](unlock) (%d+) (.*)$", "^[!/](setting) (%d+)$", "^[!/](wholist)$", "^[!/](who)$", "^[!/](type)$", "^[!/](kill) (chat) (%d+)$", "^[!/](kill) (realm) (%d+)$", "^[!/](addadmin) (.*)$", -- sudoers only "^[!/](removeadmin) (.*)$", -- sudoers only "^[!/](list) (.*)$", "^[!/](log)$", "^[!/](help)$", "^!!tgservice (.+)$", }, run = run } end
gpl-2.0
Whitechaser/darkstar
scripts/globals/items/porcupine_pie.lua
2
1717
----------------------------------------- -- ID: 5156 -- Item: porcupine_pie -- Food Effect: 30Min, All Races ----------------------------------------- -- HP 55 -- Strength 6 -- Vitality 2 -- Intelligence -3 -- Mind 3 -- HP recovered while healing 2 -- MP recovered while healing 2 -- Accuracy 5 -- Attack % 18 (cap 95) -- Ranged Attack % 18 (cap 95) ----------------------------------------- require("scripts/globals/status"); ----------------------------------------- function onItemCheck(target) local result = 0; if (target:hasStatusEffect(dsp.effects.FOOD) == true or target:hasStatusEffect(dsp.effects.FIELD_SUPPORT_FOOD) == true) then result = 246; end return result; end; function onItemUse(target) target:addStatusEffect(dsp.effects.FOOD,0,0,14400,5156); end; function onEffectGain(target, effect) target:addMod(MOD_HP, 55); target:addMod(MOD_STR, 6); target:addMod(MOD_VIT, 2); target:addMod(MOD_INT, -3); target:addMod(MOD_MND, 3); target:addMod(MOD_HPHEAL, 2); target:addMod(MOD_MPHEAL, 2); target:addMod(MOD_ACC, 5); target:addMod(MOD_FOOD_ATTP, 18); target:addMod(MOD_FOOD_ATT_CAP, 95); target:addMod(MOD_FOOD_RATTP, 18); target:addMod(MOD_FOOD_RATT_CAP, 95); end; function onEffectLose(target, effect) target:delMod(MOD_HP, 55); target:delMod(MOD_STR, 6); target:delMod(MOD_VIT, 2); target:delMod(MOD_INT, -3); target:delMod(MOD_MND, 3); target:delMod(MOD_HPHEAL, 2); target:delMod(MOD_MPHEAL, 2); target:delMod(MOD_ACC, 5); target:delMod(MOD_FOOD_ATTP, 18); target:delMod(MOD_FOOD_ATT_CAP, 95); target:delMod(MOD_FOOD_RATTP, 18); target:delMod(MOD_FOOD_RATT_CAP, 95); end;
gpl-3.0
DailyShana/ygopro-scripts
c19355597.lua
3
2006
--ジェムナイトレディ・ブリリアント・ダイヤ function c19355597.initial_effect(c) c:SetSPSummonOnce(19355597) --fusion material c:EnableReviveLimit() aux.AddFusionProcFunRep(c,aux.FilterBoolFunction(Card.IsSetCard,0x1047),3,false) --spsummon condition local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetCode(EFFECT_SPSUMMON_CONDITION) e1:SetValue(c19355597.splimit) c:RegisterEffect(e1) --spsummon local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOGRAVE) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) e2:SetTarget(c19355597.sptg) e2:SetOperation(c19355597.spop) c:RegisterEffect(e2) end function c19355597.splimit(e,se,sp,st) return not e:GetHandler():IsLocation(LOCATION_EXTRA) or bit.band(st,SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION end function c19355597.tgfilter(c) return c:IsFaceup() and c:IsSetCard(0x1047) end function c19355597.spfilter(c,e,tp) return c:IsSetCard(0x1047) and c:IsType(TYPE_FUSION) and c:IsCanBeSpecialSummoned(e,0,tp,true,false) end function c19355597.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1 and Duel.IsExistingMatchingCard(c19355597.tgfilter,tp,LOCATION_MZONE,0,1,nil) and Duel.IsExistingMatchingCard(c19355597.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) end function c19355597.spop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local tg=Duel.SelectMatchingCard(tp,c19355597.tgfilter,tp,LOCATION_MZONE,0,1,1,nil) local tc=tg:GetFirst() if tc and Duel.SendtoGrave(tc,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_GRAVE) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,c19355597.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp) Duel.SpecialSummon(g,0,tp,tp,true,false,POS_FACEUP) end end
gpl-2.0
VideahGams/thranduil
examples/chatbox/ui/popo/Text.lua
2
21768
local text_path = tostring(...):sub(1, -5) local Text = {} Text.__index = Text require(text_path .. 'utf8-l') local tableContains = function(t, value) for k, v in pairs(t) do if v == value then return true end end end local stringToAny = function(str) return loadstring("return " .. str)() end function Text.new(x, y, text, settings) local self = {} self.x, self.y = x, y local settings = settings or {} for k, v in pairs(settings) do self[k] = v end text = string.gsub(text, '\n', '@n') text = string.gsub(text, '\r', '@n') self.text = text self.config = settings if not self.font then self.font = love.graphics.getFont() end self.font_multiplier = settings.font_multiplier or 1 -- Store modifier names and parameters in m local m = {} local i = 1 while i <= text:utf8len() do local c = text:utf8sub(i, i) local d = text:utf8sub(i+1, i+1) if c == '@' and (d == '[' or d == ']' or d == '(' or d == ')' or d == '@' or d == 'n') then i = i + 1 end if c == '[' then local modifier = {} modifier.init_text_delimiter = i -- Look for pairing ']' local delimiter_ignore = 0 local finding_pair = true local j = 0 while finding_pair do j = j + 1 local d = text:utf8sub(i+j, i+j) local e = text:utf8sub(i+j+1, i+j+1) if d == '@' and (e == '[' or e == ']' or e == '(' or e == ')' or e == '@' or e == 'n') then j = j + 1 end if d == '[' then delimiter_ignore = delimiter_ignore + 1 end -- [ inside [, delimiter_ignore++ to ignore next ] if d == ']' and delimiter_ignore == 0 then finding_pair = false end -- reached the final pairing ], end loop if d == ']' and delimiter_ignore > 0 then delimiter_ignore = delimiter_ignore - 1 end -- ignore ] if delimiter_ignore > 0 end modifier.end_text_delimiter = i+j modifier.text = text:utf8sub(modifier.init_text_delimiter+1, modifier.end_text_delimiter-1) local k = i+j+1 modifier.init_modifier_delimiter = k -- Look for pairing ')' finding_pair = true j = 0 while finding_pair do j = j + 1 local d = text:utf8sub(k+j, k+j) if d == ')' then finding_pair = false end -- reached the final pairing ), end loop end modifier.end_modifier_delimiter = k+j modifier.modifier_text = text:utf8sub(modifier.init_modifier_delimiter+1, modifier.end_modifier_delimiter-1) table.insert(m, modifier) end i = i + 1 end --[[ print(self.text) print() for _, w in ipairs(m) do print(w.text, w.modifier_text) print(w.init_text_delimiter, w.end_text_delimiter, w.init_modifier_delimiter, w.end_modifier_delimiter) print() end print() ]]-- -- Assign correct modifier texts to each word in a manner that respects recursion for i, w in ipairs(m) do if w.text:find('[', 1, true) then local j, k = w.text:find('[', 1, true) if (w.text:utf8sub(j-1, j-1) == '@' and w.text:utf8sub(j-2, j-2) == '@') or (w.text:utf8sub(j-1, j-1) ~= '@') then for j, in_w in ipairs(m) do if in_w.init_text_delimiter > w.init_text_delimiter and in_w.end_text_delimiter < w.end_text_delimiter then in_w.modifier_text = in_w.modifier_text .. '; ' .. w.modifier_text end end end end end --[[ for _, w in ipairs(m) do print(w.text, w.modifier_text) print(w.init_text_delimiter, w.end_text_delimiter, w.init_modifier_delimiter, w.end_modifier_delimiter) print() end print() ]]-- -- Remove extra spaces and @ for i, modifier in ipairs(m) do -- Remove spaces from modifier texts modifier.modifier_text = modifier.modifier_text:gsub(' ', '') -- Remove @ if preceeds []()@ local i, j = 0, 0 while j do i = modifier.text:find('@', j+1, true) if i then j = i local c = modifier.text:utf8sub(i+1, i+1) if c == '(' or c == ')' or c == '[' or c == ']' or c == '@' or c == 'n' then modifier.text = modifier.text:utf8sub(1, i-1) .. modifier.text:utf8sub(i+1) end else j = nil end end end --[[ for _, w in ipairs(m) do print(w.text, w.modifier_text) print() end ]]-- -- Turn modifier_texts into tables for i, w in ipairs(m) do local i, j = 0, 0 w.modifiers = {} while i do i = w.modifier_text:find(';', i+1, true) if i then table.insert(w.modifiers, w.modifier_text:utf8sub(j+1, i-1)) j = i else table.insert(w.modifiers, w.modifier_text:utf8sub(j+1, w.modifier_text:utf8len())) end end end --[[ for _, w in ipairs(m) do print(w.text, w.modifier_text) for _, u in ipairs(w.modifiers) do print(u) end print() end ]]-- -- Turn modifier_texts that have parameters into tables for a, w in ipairs(m) do for b, u in ipairs(w.modifiers) do if u:find(':', 1, true) then local mod_params = {} local i = u:find(':', 1, true) table.insert(mod_params, u:utf8sub(1, i-1)) local params = u:sub(i+1, u:utf8len()) local j, k = 0, 0 while j do j = params:find(',', j+1, true) if j then table.insert(mod_params, params:utf8sub(k+1, j-1)) k = j else table.insert(mod_params, params:utf8sub(k+1, params:utf8len())) end end w.modifiers[b] = mod_params end end end --[[ for _, w in ipairs(m) do print(w.text, w.modifier_text) for _, u in ipairs(w.modifiers) do if type(u) == 'table' then for _, v in ipairs(u) do print(v) end else print(u) end end print() end for _, w in ipairs(m) do print(w.text, w.modifier_text) print(w.init_text_delimiter, w.end_text_delimiter, w.init_modifier_delimiter, w.end_modifier_delimiter) print() end print() ]]-- -- Strip text, removing [], () and everything inside () local n_a_positions = {} local new_line_positions = {} local stripped_text = "" local delimiter = 0 local modifier_delimiter = 0 local i = 1 while i <= text:len() do local c = text:utf8sub(i, i) local d = text:utf8sub(i+1, i+1) if c == '[' then delimiter = delimiter + 1 end if c == ']' then delimiter = delimiter - 1 end if c == '(' then modifier_delimiter = modifier_delimiter + 1 end if c == ')' then modifier_delimiter = modifier_delimiter - 1 end if modifier_delimiter == 0 then if c ~= '[' and c ~= ']' and c ~= '(' and c ~= ')' then if c == '@' and (d == '(' or d == ')' or d == '[' or d == ']' or d == '@') then stripped_text = stripped_text .. d table.insert(n_a_positions, i) i = i + 1 elseif c == '@' and d == 'n' then table.insert(new_line_positions, i) i = i + 1 elseif c == '@' then stripped_text = stripped_text .. c else stripped_text = stripped_text .. c end end end i = i + 1 end -- Recalculate m delimiter positions -- Recalculate @ removal for _, w in ipairs(m) do local witd, wetd = w.init_text_delimiter, w.end_text_delimiter local wimd, wemd = w.init_modifier_delimiter, w.end_modifier_delimiter for _, p in ipairs(n_a_positions) do if w.init_text_delimiter > p then witd = witd - 1 end if w.end_text_delimiter > p then wetd = wetd - 1 end if w.init_modifier_delimiter > p then wimd = wimd - 1 end if w.end_modifier_delimiter > p then wemd = wemd - 1 end end w.init_text_delimiter, w.end_text_delimiter = witd, wetd w.init_modifier_delimiter, w.end_modifier_delimiter = wimd, wemd local witd, wetd = w.init_text_delimiter, w.end_text_delimiter local wimd, wemd = w.init_modifier_delimiter, w.end_modifier_delimiter for _, p in ipairs(new_line_positions) do if w.init_text_delimiter > p then witd = witd - 2 end if w.end_text_delimiter > p then wetd = wetd - 2 end if w.init_modifier_delimiter > p then wimd = wimd - 2 end if w.end_modifier_delimiter > p then wemd = wemd - 2 end end w.init_text_delimiter, w.end_text_delimiter = witd, wetd w.init_modifier_delimiter, w.end_modifier_delimiter = wimd, wemd end for i, p in ipairs(new_line_positions) do for j, q in ipairs(new_line_positions) do if q > p then new_line_positions[j] = new_line_positions[j] - 2 end end end -- Recalculate [ removal for _, w in ipairs(m) do w.end_text_delimiter = w.end_text_delimiter - 1 w.init_modifier_delimiter = w.init_modifier_delimiter - 1 w.end_modifier_delimiter = w.end_modifier_delimiter - 1 for _, u in ipairs(m) do if u.init_text_delimiter > w.init_text_delimiter then u.init_text_delimiter = u.init_text_delimiter - 1 end if u.end_text_delimiter > w.init_text_delimiter then u.end_text_delimiter = u.end_text_delimiter - 1 end if u.init_modifier_delimiter > w.init_text_delimiter then u.init_modifier_delimiter = u.init_modifier_delimiter - 1 u.end_modifier_delimiter = u.end_modifier_delimiter - 1 end end for i, p in ipairs(new_line_positions) do if p > w.init_text_delimiter then new_line_positions[i] = new_line_positions[i] - 1 end end end -- Recalculate ] removal for _, w in ipairs(m) do w.init_modifier_delimiter = w.init_modifier_delimiter - 1 w.end_modifier_delimiter = w.end_modifier_delimiter - 1 for _, u in ipairs(m) do if u.init_text_delimiter > w.end_text_delimiter then u.init_text_delimiter = u.init_text_delimiter - 1 end if u.end_text_delimiter > w.end_text_delimiter then u.end_text_delimiter = u.end_text_delimiter - 1 end if u.init_modifier_delimiter > w.end_text_delimiter then u.init_modifier_delimiter = u.init_modifier_delimiter - 1 u.end_modifier_delimiter = u.end_modifier_delimiter - 1 end end for i, p in ipairs(new_line_positions) do if p > w.end_text_delimiter then new_line_positions[i] = new_line_positions[i] - 1 end end end -- Recalculate (.....) removal for _, w in ipairs(m) do local d = w.end_modifier_delimiter - w.init_modifier_delimiter + 1 for _, u in ipairs(m) do if u.init_text_delimiter > w.init_modifier_delimiter then u.init_text_delimiter = u.init_text_delimiter - d end if u.end_text_delimiter > w.init_modifier_delimiter then u.end_text_delimiter = u.end_text_delimiter - d end if u.init_modifier_delimiter > w.end_modifier_delimiter then u.init_modifier_delimiter = u.init_modifier_delimiter - d u.end_modifier_delimiter = u.end_modifier_delimiter - d end end for i, p in ipairs(new_line_positions) do if p > w.init_modifier_delimiter then new_line_positions[i] = new_line_positions[i] - d end end end -- Add new line positions when over wrap width local str = "" for i = 1, stripped_text:utf8len() do local c = stripped_text:utf8sub(i, i) local new_line_index = nil for _, p in ipairs(new_line_positions) do if i == p-1 then new_line_index = true end end if self.wrap_width then local w0 = self.font:getWidth(str .. stripped_text:utf8sub(i, i))*self.font_multiplier local w = self.font:getWidth(str .. stripped_text:utf8sub(i+1, i+1))*self.font_multiplier local previous_c = stripped_text:utf8sub(i-1, i-1) if previous_c == ' ' then local t = stripped_text:utf8sub(i, stripped_text:utf8len()) local next_word = t:utf8sub(1, t:find(' ')) local tw = self.font:getWidth(str .. next_word)*self.font_multiplier if tw > self.wrap_width then table.insert(new_line_positions, i) str = "" end elseif w0 > self.wrap_width then table.insert(new_line_positions, i) str = "" end end if not new_line_index then str = str .. c else str = "" end end table.sort(new_line_positions, function(a, b) return a < b end) --[[ print(stripped_text) print() for _, w in ipairs(m) do print(w.text, w.modifier_text) print(w.init_text_delimiter, w.end_text_delimiter, w.init_modifier_delimiter, w.end_modifier_delimiter) print() end print() for _, p in ipairs(new_line_positions) do print(p) end print() ]]-- self.str_text = stripped_text self.new_line_positions = new_line_positions self.characters = {} local str = "" local line = 0 for i = 1, stripped_text:utf8len() do local c = stripped_text:utf8sub(i, i) local modifiers = {} for _, w in ipairs(m) do if i >= w.init_text_delimiter and i <= w.end_text_delimiter then modifiers = w.modifiers end end -- Move to new line if got to a @n for j, p in ipairs(new_line_positions) do if i == p and line < j then line = j str = "" end end local text_w = self.font:getWidth(str)*self.font_multiplier text_w = self.font:getWidth(str)*self.font_multiplier local w = self.font:getWidth(c)*self.font_multiplier local char_struct = {position = i, character = c, text = self, str_text = stripped_text, x = text_w, y = 0 + line*(self.line_height or 1)*self.font:getHeight()*self.font_multiplier, modifiers = modifiers, line = line, pivot = {x = 0, y = 0}} table.insert(self.characters, char_struct) str = str .. c end -- Set alignment if self.wrap_width then if self.align_right then for i = 0, line do local s = '' for j, c in ipairs(self.characters) do if c.character == ' ' and self.characters[j+1] and self.characters[j+1].line == i+1 then break end if c.line == i then s = s .. c.character end end local w = self.font:getWidth(s)*self.font_multiplier local add_x = self.wrap_width - w for _, c in ipairs(self.characters) do if c.line == i then c.x = c.x + add_x end end end elseif self.align_center then for i = 0, line do local s = '' for j, c in ipairs(self.characters) do if c.character == ' ' and self.characters[j+1] and self.characters[j+1].line == i+1 then break end if c.line == i then s = s .. c.character end end local w = self.font:getWidth(s)*self.font_multiplier local add_x = (self.wrap_width - w)/2 for _, c in ipairs(self.characters) do if c.line == i then c.x = c.x + add_x end end end elseif self.justify then for i = 0, line do local s = '' local spaces = 0 local lines_end = {} for j, c in ipairs(self.characters) do if i == line and j == #self.characters then lines_end[i] = j; break end if c.character == ' ' and self.characters[j+1] and self.characters[j+1].line == i+1 then lines_end[i] = j; break end if c.line == i then s = s .. c.character end if c.line == i and c.character == ' ' then spaces = spaces + 1 end end local w = self.font:getWidth(s)*self.font_multiplier if i == line then spaces = spaces + 1 end local add_x = (self.wrap_width - w)/spaces for j, c in ipairs(self.characters) do if c.line == i and c.character == ' ' then for k = j+1, lines_end[i] do self.characters[k].x = self.characters[k].x + add_x end end end end end end self.n_lines = #new_line_positions + 1 self.dt = 0 self.custom_draw = false for k, v in pairs(self) do if type(v) == 'function' and k == 'customDraw' then self.custom_draw = v end end -- Call Init functions from TextConfig for k, v in pairs(self) do if type(v) == 'function' then if k:find('Init', 1, true) then for _, c in ipairs(self.characters) do local called_functions = {} for _, modifier in ipairs(c.modifiers) do if type(modifier) == 'table' then local n = k:find('Init', 1, true) local params = {} for i = 2, #modifier do table.insert(params, modifier[i]) end if modifier[1] == k:utf8sub(1, n-1) and not tableContains(called_functions, k) then v(c, unpack(params)) table.insert(called_functions, k) end else local n = k:find('Init', 1, true) if modifier == k:utf8sub(1, n-1) and not tableContains(called_functions, k) then v(c) table.insert(called_functions, k) end end end end end end end return setmetatable(self, Text) end function Text:update(dt) self.dt = dt end function Text:draw(x, y) local font = love.graphics.getFont() love.graphics.setFont(self.font or font) local regular_font = true for _, c in ipairs(self.characters) do -- Call each modifier function regular_font = true local called_functions = {} for _, modifier in ipairs(c.modifiers) do if type(modifier) == 'table' then local params = {} for i = 2, #modifier do table.insert(params, stringToAny(modifier[i])) end if not self[modifier[1]] and not self[modifier[1] .. 'Init'] then error("undefined function: " .. modifier[1]) elseif self[modifier[1]] and not tableContains(called_functions, modifier[1]) then self[modifier[1]](self.dt, c, unpack(params)) table.insert(called_functions, modifier[1]) end else if not self[modifier] and not self[modifier .. 'Init'] then error("undefined function: " .. modifier) elseif self[modifier] and not tableContains(called_functions, modifier) then if type(modifier) == 'function' or type(self[modifier]) == 'function' then self[modifier](self.dt, c) table.insert(called_functions, modifier) else love.graphics.setFont(self[modifier]) regular_font = false end end end end if regular_font then love.graphics.setFont(self.font) end if self.custom_draw then self.custom_draw(x or self.x, y or self.y, c) else love.graphics.print(c.character, (x or self.x) + c.x, (y or self.y) + c.y, c.r or 0, c.sx or 1, c.sy or 1, 0, 0) end end love.graphics.setFont(font) end return setmetatable({new = new}, {__call = function(_, ...) return Text.new(...) end})
mit
lasko2112/legend-of-hondo
MMOCoreORB/bin/scripts/mobile/faction/rebel/senior_specforce_urban_guerrilla.lua
2
1844
senior_specforce_urban_guerrilla = Creature:new { objectName = "@mob/creature_names:senior_specforce_guerrilla", randomNameType = NAME_GENERIC_TAG, socialGroup = "rebel", faction = "rebel", level = 20, chanceHit = 0.33, damageMin = 190, damageMax = 200, baseXp = 1803, baseHAM = 5000, baseHAMmax = 6100, armor = 0, resists = {0,0,0,0,0,0,0,-1,-1}, meatType = "", meatAmount = 0, hideType = "", hideAmount = 0, boneType = "", boneAmount = 0, milk = 0, tamingChance = 0, ferocity = 0, pvpBitmask = ATTACKABLE, creatureBitmask = PACK + KILLER, optionsBitmask = 128, diet = HERBIVORE, templates = {"object/mobile/dressed_rebel_specforce_guerilla_human_male_01.iff", "object/mobile/dressed_rebel_specforce_guerilla_moncal_male_01.iff", "object/mobile/dressed_rebel_specforce_guerrilla_human_female_01.iff", "object/mobile/dressed_rebel_specforce_guerrilla_rodian_female_01.iff", "object/mobile/dressed_rebel_specforce_guerrilla_rodian_male_01.iff", "object/mobile/dressed_rebel_specforce_guerrilla_zabrak_female_01.iff",}, lootGroups = { { groups = { {group = "color_crystals", chance = 100000}, {group = "junk", chance = 4700000}, {group = "rifles", chance = 1000000}, {group = "pistols", chance = 1000000}, {group = "melee_weapons", chance = 1000000}, {group = "carbines", chance = 1000000}, {group = "clothing_attachments", chance = 100000}, {group = "armor_attachments", chance = 100000}, {group = "wearables_common", chance = 1000000} } } }, weapons = {"imperial_weapons_medium"}, conversationTemplate = "", reactionStf = "@npc_reaction/military", personalityStf = "@hireling/hireling_military", attacks = merge(brawlermaster,marksmanmaster) } CreatureTemplates:addCreatureTemplate(senior_specforce_urban_guerrilla, "senior_specforce_urban_guerrilla")
agpl-3.0
lasko2112/legend-of-hondo
MMOCoreORB/bin/scripts/object/building/poi/tatooine_hutt_businessmen_camp_small2.lua
2
2310
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version object_building_poi_tatooine_hutt_businessmen_camp_small2 = object_building_poi_shared_tatooine_hutt_businessmen_camp_small2:new { gameObjectType = 531, } ObjectTemplates:addTemplate(object_building_poi_tatooine_hutt_businessmen_camp_small2, "object/building/poi/tatooine_hutt_businessmen_camp_small2.iff")
agpl-3.0
lasko2112/legend-of-hondo
MMOCoreORB/bin/scripts/managers/planet_manager.lua
1
21650
--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. --Time, in seconds, that a shuttle is away for shuttleportAwayTime = 300 starportAwayTime = 60 --Time, in seconds, that a shuttle takes to land shuttleportLandingTime = 11 starportLandingTime = 14 --Time, in seconds, that a shuttle is landed for shuttleportLandedTime = 120 starportLandedTime = 120 corellia = { weatherEnabled = 1, planetTravelPoints = { {name = "Coronet Shuttle B", x = -329.76605, z = 28, y = -4641.23, interplanetaryTravelAllowed = 0, incomingTravelAllowed = 1}, {name = "Coronet Shuttle A", x = -25.671804, z = 28, y = -4409.7847, interplanetaryTravelAllowed = 0, incomingTravelAllowed = 1}, {name = "Coronet Starport", x = -66.760902, z = 28, y = -4711.3281, interplanetaryTravelAllowed = 1, incomingTravelAllowed = 1}, {name = "Vreni Island Shuttle", x = -5551.9473, z = 15.890146, y = -6059.9673, interplanetaryTravelAllowed = 0, incomingTravelAllowed = 1}, {name = "Tyrena Shuttle B", x = -5600.6367, z = 21, y = -2790.7429, interplanetaryTravelAllowed = 0, incomingTravelAllowed = 1}, {name = "Tyrena Shuttle A", x = -5005.354, z = 21, y = -2386.9819, interplanetaryTravelAllowed = 0, incomingTravelAllowed = 1}, {name = "Tyrena Starport", x = -5003.0649, z = 21, y = -2228.3665, interplanetaryTravelAllowed = 1, incomingTravelAllowed = 1}, {name = "Kor Vella Shuttleport", x = -3775.2546, z = 31, y = 3234.2202, interplanetaryTravelAllowed = 0, incomingTravelAllowed = 1}, {name = "Kor Vella Starport", x = -3157.2834, z = 31, y = 2876.2029, interplanetaryTravelAllowed = 1, incomingTravelAllowed = 1}, {name = "Doaba Guerfel Shuttleport", x = 3085.4963, z = 280, y = 4993.0098, interplanetaryTravelAllowed = 0, incomingTravelAllowed = 1}, {name = "Doaba Guerfel Starport", x = 3349.8933, z = 308, y = 5598.1362, interplanetaryTravelAllowed = 1, incomingTravelAllowed = 1}, {name = "Bela Vistal Shuttleport A", x = 6644.269, z = 330, y = -5922.5225, interplanetaryTravelAllowed = 0, incomingTravelAllowed = 1}, {name = "Bela Vistal Shuttleport B", x = 6930.8042, z = 330, y = -5534.8936, interplanetaryTravelAllowed = 0, incomingTravelAllowed = 1} }, planetObjects = { --{templateFile = "object/tangible/terminal/terminal_character_builder.iff", ox = 0, oy = -0.664289, oz = 0, ow = 0.747476, x = -133.192, z = 28, y = -4711.16, parentid = 0}, --{templateFile = "object/tangible/terminal/terminal_character_builder.iff", ox = 0, oy = 0.346712, oz = 0, ow = 0.937972, x = -5049.64, z = 21, y = -2304.52, parentid = 0}, --{templateFile = "object/tangible/terminal/terminal_character_builder.iff", ox = 0, oy = 0.290803, oz = 0, ow = 0.956783, x = 3330.38, z = 308, y = 5517.14, parentid = 0}, --{templateFile = "object/tangible/terminal/terminal_character_builder.iff", ox = 0, oy = -0.666281, oz = 0, ow = 0.745701, x = -136.437, z = 28, y = -4730.23, parentid = 0} } } dantooine = { weatherEnabled = 1, planetTravelPoints = { {name = "Dantooine Mining Outpost", x = -635.96887, z = 3, y = 2507.0115, interplanetaryTravelAllowed = 1, incomingTravelAllowed = 1}, {name = "Dantooine Imperial Outpost", x = -4208.6602, z = 3, y = -2350.24, interplanetaryTravelAllowed = 1, incomingTravelAllowed = 1}, {name = "Dantooine Agro Outpost", x = 1569.66, z = 4, y = -6415.7598, interplanetaryTravelAllowed = 1, incomingTravelAllowed = 1} }, planetObjects = { --{templateFile = "object/tangible/terminal/terminal_character_builder.iff", ox = 0, oy = 0.695864, oz = 0, ow = 0.718174, x = 1585.68, z = 4, y = -6368.95, parentid = 0}, --{templateFile = "object/tangible/terminal/terminal_character_builder.iff", ox = 0, oy = 0.725999, oz = 0, ow = -0.687696, x = -629.417, z = 3, y = 2481.24, parentid = 0} } } dathomir = { weatherEnabled = 1, planetTravelPoints = { {name = "Trade Outpost", x = 618.89258, z = 6.039608, y = 3092.0142, interplanetaryTravelAllowed = 1, incomingTravelAllowed = 1}, {name = "Science Outpost", x = -49.021923, z = 18, y = -1584.7278, interplanetaryTravelAllowed = 1, incomingTravelAllowed = 1} }, planetObjects = { --{templateFile = "object/tangible/terminal/terminal_character_builder.iff", ox = 0, oy = 0.701463, oz = 0, ow = 0.712705, x = 592.612, z = 6, y = 3089.84, parentid = 0}, --{templateFile = "object/tangible/terminal/terminal_character_builder.iff", ox = 0, oy = 0.314904, oz = 0, ow = 0.949123, x = -67.6585, z = 18, y = -1595.3, parentid = 0}, --{templateFile = "object/tangible/terminal/terminal_character_builder.iff", ox = 0, oy = 0.314904, oz = 0, ow = 0.949123, x = 5289.6, z = 78.5, y = -4146.1, parentid = 0} } } endor = { weatherEnabled = 1, planetTravelPoints = { {name = "Smuggler Outpost", x = -950.59241, z = 73, y = 1553.4125, interplanetaryTravelAllowed = 1, incomingTravelAllowed = 1}, {name = "Research Outpost", x = 3201.6599, z = 24, y = -3499.76, interplanetaryTravelAllowed = 1, incomingTravelAllowed = 1} }, planetObjects = { --{templateFile = "object/tangible/terminal/terminal_character_builder.iff", ox = 0, oy = 0.932952, oz = 0, ow = -0.360002, x = -963.537, z = 73, y = 1556.86, parentid = 0}, --{templateFile = "object/tangible/terminal/terminal_character_builder.iff", ox = 0, oy = 0.723459, oz = 0, ow = -0.690367, x = 3240.5, z = 24, y = -3484.79, parentid = 0}, -- TEMPORARY --{templateFile = "object/tangible/terminal/terminal_character_builder.iff", ox = 0, oy = 0.723459, oz = 0, ow = -0.690367, x = -4676.78, z = 12.9066, y = 4327.25, parentid = 0} } } lok = { weatherEnabled = 1, planetTravelPoints = { {name = "Nym's Stronghold", x = 478.92676, z = 9, y = 5511.9565, interplanetaryTravelAllowed = 1, incomingTravelAllowed = 1} }, planetObjects = { --{templateFile = "object/tangible/terminal/terminal_character_builder.iff", ox = 0, oy = 0.999879, oz = 0, ow = 0.015506, x = 464.677, z = 8.75806, y = 5506.49, parentid = 0} } } naboo = { weatherEnabled = 1, planetTravelPoints = { {name = "Keren Starport", x = 1371.5938, z = 13, y = 2747.9043, interplanetaryTravelAllowed = 1, incomingTravelAllowed = 1}, {name = "Keren Shuttleport South", x = 1567.5193, z = 25, y = 2837.8777, interplanetaryTravelAllowed = 0, incomingTravelAllowed = 1}, {name = "Keren Shuttleport", x = 2021.0026, z = 19, y = 2525.679, interplanetaryTravelAllowed = 0, incomingTravelAllowed = 1}, {name = "Theed Shuttle A", x = -5856.1055, z = 6, y = 4172.1606, interplanetaryTravelAllowed = 0, incomingTravelAllowed = 1}, {name = "Theed Shuttle B", x = -5005, z = 6, y = 4072, interplanetaryTravelAllowed = 0, incomingTravelAllowed = 1}, {name = "Theed Shuttle C", x = -5411.0171, z = 6, y = 4322.3315, interplanetaryTravelAllowed = 0, incomingTravelAllowed = 1}, {name = "Theed Spaceport", x = -4858.834, z = 5.9483199, y = 4164.0679, interplanetaryTravelAllowed = 1, incomingTravelAllowed = 1}, {name = "The Lake Retreat", x = -5494.4224, z = -150, y = -21.837162, interplanetaryTravelAllowed = 0, incomingTravelAllowed = 1}, {name = "Moenia", x = 4731.1743, z = 4.1700001, y = -4677.5439, interplanetaryTravelAllowed = 1, incomingTravelAllowed = 1}, {name = "Moenia Shuttleport", x = 4961.9409, z = 3.75, y = -4892.6997, interplanetaryTravelAllowed = 0, incomingTravelAllowed = 1}, {name = "Dee'ja Peak Shuttleport", x = 5331.9375, z = 327.02765, y = -1576.6733, interplanetaryTravelAllowed = 0, incomingTravelAllowed = 1}, {name = "Kaadara Starport", x = 5280.2002, z = -192, y = 6688.0498, interplanetaryTravelAllowed = 1, incomingTravelAllowed = 1}, {name = "Kaadara Shuttleport", x = 5123.3857, z = -192, y = 6616.0264, interplanetaryTravelAllowed = 0, incomingTravelAllowed = 1} }, planetObjects = { --{templateFile = "object/tangible/terminal/terminal_character_builder.iff", ox = 0, oy = 0.715602, oz = 0, ow = -0.698509, x = 4824.53, z = 4.17, y = -4704.9, parentid = 0}, --{templateFile = "object/tangible/terminal/terminal_character_builder.iff", ox = 0, oy = 0.309582, oz = 0, ow = 0.950873, x = -4876.99, z = 6, y = 4142.12, parentid = 0}, --{templateFile = "object/tangible/terminal/terminal_character_builder.iff", ox = 0, oy = -0.0116238, oz = 0, ow = 0.999932, x = 5193.14, z = -192, y = 6680.25, parentid = 0}, --{templateFile = "object/tangible/terminal/terminal_character_builder.iff", ox = 0, oy = -0.0116238, oz = 0, ow = -0.686427, x = 1445.8, z = 13, y = 2771.98, parentid = 0} } } rori = { weatherEnabled = 1, planetTravelPoints = { {name = "Restuss Starport", x = 5340, z = 80, y = 5734, interplanetaryTravelAllowed = 1, incomingTravelAllowed = 1}, {name = "Restuss Shuttleport", x = 5211, z = 80, y = 5791, interplanetaryTravelAllowed = 0, incomingTravelAllowed = 1}, {name = "Narmle Starport", x = -5374.0718, z = 80, y = -2188.6143, interplanetaryTravelAllowed = 1, incomingTravelAllowed = 1}, {name = "Narmle Shuttleport", x = -5255.4116, z = 80.664185, y = -2161.6274, interplanetaryTravelAllowed = 0, incomingTravelAllowed = 1}, {name = "Rebel Outpost", x = 3691.9023, z = 96, y = -6403.4404, interplanetaryTravelAllowed = 1, incomingTravelAllowed = 1} }, planetObjects = { --{templateFile = "object/tangible/terminal/terminal_character_builder.iff", ox = 0, oy = -0.100263, oz = 0, ow = 0.994961, x = -5307.37, z = 80.1274, y = -2216.91, parentid = 0}, --{templateFile = "object/tangible/terminal/terminal_character_builder.iff", ox = 0, oy = -0.69192, oz = 0, ow = 0.721974, x = 5370.22, z = 80, y = 5666.04, parentid = 0}, --{templateFile = "object/tangible/terminal/terminal_character_builder.iff", ox = 0, oy = -0.0274543, oz = 0, ow = 0.999623, x = 3672.91, z = 96, y = -6441.07, parentid = 0} } } talus = { weatherEnabled = 1, planetTravelPoints = { {name = "Dearic Starport", x = 263.58401, z = 6, y = -2952.1284, interplanetaryTravelAllowed = 1, incomingTravelAllowed = 1}, {name = "Dearic Shuttleport", x = 699.297, z = 6, y = -3041.4199, interplanetaryTravelAllowed = 0, incomingTravelAllowed = 1}, {name = "Talus Imperial Outpost", x = -2226, z = 20, y = 2319, interplanetaryTravelAllowed = 1, incomingTravelAllowed = 1}, {name = "Nashal Shuttleport", x = 4334.5786, z = 9.8999996, y = 5431.0415, interplanetaryTravelAllowed = 0, incomingTravelAllowed = 1}, {name = "Nashal Starport", x = 4453.7212, z = 2, y = 5354.3345, interplanetaryTravelAllowed = 1, incomingTravelAllowed = 1} }, planetObjects = { --{templateFile = "object/tangible/terminal/terminal_character_builder.iff", ox = 0, oy = 0.996369, oz = 0, ow = -0.0851417, x = 4447.08, z = 2, y = 5286.96, parentid = 0}, --{templateFile = "object/tangible/terminal/terminal_character_builder.iff", ox = 0, oy = 0.692641, oz = 0, ow = 0.721282, x = 329.666, z = 6, y = -2924.69, parentid = 0} } } tatooine = { weatherEnabled = 1, planetTravelPoints = { {name = "Mos Eisley Shuttleport", x = 3416.6914, z = 5, y = -4648.1411, interplanetaryTravelAllowed = 0, incomingTravelAllowed = 1}, {name = "Mos Eisley Starport", x = 3599.894, z = 5, y = -4780.4487, interplanetaryTravelAllowed = 1, incomingTravelAllowed = 1}, {name = "Bestine Starport", x = -1361.1917, z = 12, y = -3600.0254, interplanetaryTravelAllowed = 1, incomingTravelAllowed = 1}, {name = "Bestine Shuttleport", x = -1098.4836, z = 12, y = -3563.5342, interplanetaryTravelAllowed = 0, incomingTravelAllowed = 1}, {name = "Mos Espa Shuttleport South", x = -2897.0933, z = 5, y = 1933.4144, interplanetaryTravelAllowed = 0, incomingTravelAllowed = 1}, {name = "Mos Espa Shuttleport West", x = -3112.1296, z = 5, y = 2176.9607, interplanetaryTravelAllowed = 0, incomingTravelAllowed = 1}, {name = "Mos Espa Starport", x = -2833.1609, z = 5, y = 2107.3787, interplanetaryTravelAllowed = 1, incomingTravelAllowed = 1}, {name = "Mos Espa Shuttleport East", x = -2803.511, z = 5, y = 2182.9648, interplanetaryTravelAllowed = 0, incomingTravelAllowed = 1}, {name = "Anchorhead Shuttleport", x = 47.565128, z = 52, y = -5338.9072, interplanetaryTravelAllowed = 0, incomingTravelAllowed = 1}, {name = "Mos Entha Spaceport", x = 1266.0996, z = 7, y = 3065.1392, interplanetaryTravelAllowed = 1, incomingTravelAllowed = 1}, {name = "Mos Entha Shuttle B", x = 1395.447, z = 7, y = 3467.0117, interplanetaryTravelAllowed = 0, incomingTravelAllowed = 1}, {name = "Mos Entha Shuttle A", x = 1730.8828, z = 7, y = 3184.6135, interplanetaryTravelAllowed = 0, incomingTravelAllowed = 1} }, planetObjects = { --{templateFile = "object/tangible/terminal/terminal_character_builder.iff", ox = 0, oy = 0.768226, oz = 0, ow = -0.640178, x = 3533.04, z = 5, y = -4796, parentid = 0}, --{templateFile = "object/tangible/terminal/terminal_character_builder.iff", ox = 0, oy = -0.486657, oz = 0, ow = 0.873593, x = -1271.07, z = 12, y = -3590.22, parentid = 0}, --{templateFile = "object/tangible/terminal/terminal_character_builder.iff", ox = 0, oy = -0.514176, oz = 0, ow = 0.857684, x = -2896.35, z = 5, y = 2130.87, parentid = 0}, --{templateFile = "object/tangible/terminal/terminal_character_builder.iff", ox = 0, oy = 0.989124, oz = 0, ow = -0.147086, x = 1299.08, z = 7, y = 3145.21, parentid = 0} } } yavin4 = { weatherEnabled = 1, planetTravelPoints = { {name = "Yavin IV Labor Outpost", x = -6921.6733, z = 73, y = -5726.5161, interplanetaryTravelAllowed = 1, incomingTravelAllowed = 1}, {name = "Yavin IV Mining Outpost", x = -267.23914, z = 35, y = 4896.3013, interplanetaryTravelAllowed = 1, incomingTravelAllowed = 1}, {name = "Yavin IV Imperial Outpost", x = 4054.1, z = 37, y = -6216.9, interplanetaryTravelAllowed = 1, incomingTravelAllowed = 0}, }, planetObjects = { --{templateFile = "object/tangible/terminal/terminal_character_builder.iff", ox = 0, oy = -0.705623, oz = 0, ow = 0.708587, x = -6917.18, z = 73, y = -5732.25, parentid = 0}, --{templateFile = "object/tangible/terminal/terminal_character_builder.iff", ox = 0, oy = 0.723339, oz = 0, ow = -0.690493, x = 4057.69, z = 37, y = -6217.54, parentid = 0}, --{templateFile = "object/tangible/terminal/terminal_character_builder.iff", ox = 0, oy = 0.00721678, oz = 0, ow = 0.999974, x = -293.367, z = 35, y = 4854.52, parentid = 0} } } space_corellia = { weatherEnabled = 0, planetObjects = { {templateFile = "object/ship/spacestation_rebel.iff", x = -7132.79, z = 2340.4, y = 2013.98, ow = 0.641545, ox = -0.0633626, oy = 0.76035, oz = 0.079203, parentid = 0}, {templateFile = "object/ship/spacestation_neutral.iff", x = -6345.5, z = -5274.5, y = -3957.25, ow = 0.640802, ox = 0.015822, oy = 0.76738, oz = -0.0158223, parentid = 0}, {templateFile = "object/ship/spacestation_rebel.iff", x = -1463.42, z = 318.86, y = -1012.24, ow = 0.759136, ox = -0.0474463, oy = 0.648429, oz = 0.0316307, parentid = 0}, {templateFile = "object/ship/spacestation_neutral.iff", x = 6519.75, z = -5373.75, y = -2600.25, ow = -0.428073, ox = -1.39125e-08, oy = 0.90371, oz = -0.00792732, parentid = 0} } } space_dantooine = { weatherEnabled = 0, planetObjects = { {templateFile = "object/ship/spacestation_imperial.iff", x = -2629.72, z = 3585.8, y = 3269.39, ow = 0.103184, ox = 0.031749, oy = 0.936596, oz = -0.333365, parentid = 0}, {templateFile = "object/ship/spacestation_imperial.iff", x = 178.72, z = -4785.06, y = -6403.03, ow = 0.977105, ox = 0, oy = 0.212757, oz = 0, parentid = 0}, {templateFile = "object/ship/spacestation_neutral.iff", x = 1358.93, z = -741.97, y = -5901.79, ow = 0.907314, ox = 0.110455, oy = 0.394484, oz = -0.0946762, parentid = 0}, {templateFile = "object/ship/spacestation_rebel.iff", x = -4200, z = -3000, y = -6000, ow = 1, ox = 0, oy = 0, oz = 0, parentid = 0}, {templateFile = "object/ship/spacestation_rebel.iff", x = 5522.87, z = 3202, y = 5997.74, ow = -0.236536, ox = -0.031538, oy = 0.954028, oz = -0.181344, parentid = 0}, {templateFile = "object/ship/spacestation_rebel.iff", x = -3979.37, z = 5423.26, y = -4565.81, ow = 0.917577, ox = 0.0791015, oy = 0.387597, oz = -0.0395508, parentid = 0} } } space_dathomir = { weatherEnabled = 0, planetObjects = { {templateFile = "object/ship/spacestation_imperial.iff", x = 4842.19, z = -5316.32, y = -4222.79, ow = 0.849126, ox = -0.277752, oy = -0.428531, oz = -0.134908, parentid = 0}, {templateFile = "object/ship/spacestation_imperial.iff", x = 6092.23, z = 6223.58, y = -6731.9, ow = 0.967128, ox = 0.182327, oy = -0.1744, oz = 0.0317089, parentid = 0}, {templateFile = "object/ship/spacestation_neutral.iff", x = 4000, z = 200, y = -4700, ow = 1, ox = 0, oy = 0, oz = 0, parentid = 0}, {templateFile = "object/ship/spacestation_neutral.iff", x = -7078.75, z = 2879, y = -4293.75, ow = 0.946438, ox = 0.173514, oy = 0.268158, oz = -0.0473218, parentid = 0} } } space_endor = { weatherEnabled = 0, planetObjects = { {templateFile = "object/ship/spacestation_imperial.iff", x = 5773.37, z = -6359.57, y = 6976.04, ow = 0.197218, ox = -0.0157777, oy = 0.978199, oz = 0.0631097, parentid = 0}, {templateFile = "object/ship/spacestation_imperial.iff", x = 6200, z = 5000, y = 6000, ow = 1, ox = 0, oy = 0, oz = 0, parentid = 0}, {templateFile = "object/ship/spacestation_imperial.iff", x = -5716.48, z = 7198.22, y = 2009.09, ow = 0.781614, ox = 0.307908, oy = 0.505286, oz = -0.197377, parentid = 0}, {templateFile = "object/ship/spacestation_neutral.iff", x = -5268.23, z = -1500.23, y = 5209.39, ow = 0.919533, ox = 0.151784, oy = -0.359617, oz = 0.0457911, parentid = 0} } } space_lok = { weatherEnabled = 0, planetObjects = { {templateFile = "object/ship/spacestation_imperial.iff", x = -1798.64, z = 2649.25, y = 400.89, ow = -0.031722, ox = 0.0158608, oy = 0.999245, oz = 0.0158608, parentid = 0}, {templateFile = "object/ship/spacestation_neutral.iff", x = -6235.21, z = -5341.59, y = 113.86, ow = 0.611794, ox = 0.347264, oy = 0.577203, oz = -0.414672, parentid = 0}, {templateFile = "object/ship/spacestation_rebel.iff", x = 1799.13, z = -2458.57, y = -3680.29, ow = 0.989635, ox = -0.13459, oy = 0.0475025, oz = 0.0158343, parentid = 0} } } space_naboo = { weatherEnabled = 0, planetObjects = { {templateFile = "object/ship/spacestation_imperial.iff", x = 3511.83, z = 1774.71, y = 944.36, ow = -0.670707, ox = 0, oy = 0.741723, oz = 0, parentid = 0}, {templateFile = "object/ship/spacestation_neutral.iff", x = -2491.26, z = 905.49, y = -6460.67, ow = 0.201287, ox = -0.00687047, oy = 0.968212, oz = 0.148333, parentid = 0}, {templateFile = "object/ship/spacestation_neutral.iff", x = 6226.22, z = -4450.57, y = 484.75, ow = 0.36384, ox = -0.0206368, oy = 0.924935, oz = 0.108118, parentid = 0} } } space_tatooine = { weatherEnabled = 0, planetObjects = { {templateFile = "object/ship/spacestation_neutral.iff", x = 2311.89, z = -5872.72, y = 1865.29, ow = 0.324318, ox = 0.0734025, oy = 0.94172, oz = -0.0509326, parentid = 0} } } space_yavin4 = { weatherEnabled = 0, planetObjects = { {templateFile = "object/ship/spacestation_imperial.iff", x = -6798.55, z = 4998.69, y = 4760.4, ow = 0.577296, ox = 0.0316324, oy = 0.814541, oz = -0.0474491, parentid = 0}, {templateFile = "object/ship/spacestation_imperial.iff", x = -4190.56, z = 1539.35, y = 4596.82, ow = 0.434352, ox = 0.023692, oy = 0.900293, oz = -0.0157947, parentid = 0}, {templateFile = "object/ship/spacestation_imperial.iff", x = 85.21, z = -342.3, y = -57.62, ow = 0.627024, ox = 0.0158741, oy = 0.777827, oz = -0.039685, parentid = 0}, {templateFile = "object/ship/spacestation_neutral.iff", x = -5570.46, z = -5168, y = -5234.88, ow = 0.994108, ox = 0.105996, oy = -0.0145207, oz = -0.0173906, parentid = 0} } } tutorial = { weatherEnabled = 0, } dungeon1 = { weatherEnabled = 0, }
agpl-3.0
lasko2112/legend-of-hondo
MMOCoreORB/bin/scripts/object/static/particle/particle_test_40.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_40 = object_static_particle_shared_particle_test_40:new { } ObjectTemplates:addTemplate(object_static_particle_particle_test_40, "object/static/particle/particle_test_40.iff")
agpl-3.0
lasko2112/legend-of-hondo
MMOCoreORB/bin/scripts/object/static/particle/particle_test_49.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_49 = object_static_particle_shared_particle_test_49:new { } ObjectTemplates:addTemplate(object_static_particle_particle_test_49, "object/static/particle/particle_test_49.iff")
agpl-3.0
Whitechaser/darkstar
scripts/zones/Port_Jeuno/npcs/Karl.lua
5
2141
----------------------------------- -- Area: Port Jeuno -- NPC: Karl -- Starts and Finishes Quest: Child's Play -- !pos -60 0.1 -8 246 ----------------------------------- package.loaded["scripts/zones/Port_Jeuno/TextIDs"] = nil; ----------------------------------- require("scripts/globals/settings"); require("scripts/globals/titles"); require("scripts/globals/keyitems"); require("scripts/globals/shop"); require("scripts/globals/quests"); require("scripts/zones/Port_Jeuno/TextIDs"); ----------------------------------- function onTrade(player,npc,trade) if (player:getQuestStatus(JEUNO,CHILD_S_PLAY) == QUEST_ACCEPTED and trade:hasItemQty(776,1) == true and trade:getItemCount() == 1) then player:startEvent(1); -- Finish quest end end; function onTrigger(player,npc) local ChildsPlay = player:getQuestStatus(JEUNO,CHILD_S_PLAY); local WildcatJeuno = player:getVar("WildcatJeuno"); if (player:getQuestStatus(JEUNO,LURE_OF_THE_WILDCAT_JEUNO) == QUEST_ACCEPTED and player:getMaskBit(WildcatJeuno,16) == false) then player:startEvent(316); elseif (player:getQuestStatus(JEUNO,THE_WONDER_MAGIC_SET) == QUEST_ACCEPTED and ChildsPlay == QUEST_AVAILABLE) then player:startEvent(0); -- Start quest elseif (ChildsPlay == QUEST_ACCEPTED) then player:startEvent(61); -- mid quest CS else player:startEvent(58); -- Standard dialog end end; function onEventUpdate(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); end; function onEventFinish(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); if (csid == 0) then player:addQuest(JEUNO,CHILD_S_PLAY); elseif (csid == 1) then player:addTitle(TRADER_OF_MYSTERIES); player:addKeyItem(WONDER_MAGIC_SET); player:messageSpecial(KEYITEM_OBTAINED,WONDER_MAGIC_SET); player:addFame(JEUNO, 30); player:tradeComplete(trade); player:completeQuest(JEUNO,CHILD_S_PLAY); elseif (csid == 316) then player:setMaskBit(player:getVar("WildcatJeuno"),"WildcatJeuno",16,true); end end;
gpl-3.0
tectronics/crinkle
common/List.lua
1
1561
--[[ Copyright 2012, Chris Ho ]]-- --[[ MIT License (Please read the LICENSE file for details) ]]-- Use("common/Quicksort"); -- List Utility (from RO's Utility Library) -- By default, we sort using in-place Quicksort. You may define a -- SORTER global to specify an alternate sorting module. List = {} function List.new () return { first = 0, last = -1} end function List.pushleft (list, value) local first = list.first-1 list.first = first list[first] = value; end function List.pushright (list, value) local last = list.last + 1 list.last = last list[last] = value end function List.popleft (list) local first = list.first if first > list.last then return nil end local value = list[first] list[first] = nil -- to allow garbage collection list.first = first+1 return value end function List.popright (list) local last = list.last if list.first > last then return nil end local value = list[last] list[last] = nil list.last = last-1 return value end function List.clear (list) for i,v in ipairs(list) do list[i] = nil end --[[ if List.size(list) == 0 then return end local first = list.first local last = list.last for i=first, last do list[i] = nil end --]] list.first = 0 list.last = -1 end function List.size (list) local size = list.last - list.first + 1 return size end function List.sort(list, _sorter) if (SORTER == nil) then Quicksort.Sort(list, list.first, list.last, _sorter); else SORTER.Sort(list, list.first, list.last, _sorter); end end
mit
DailyShana/ygopro-scripts
c67779172.lua
3
1431
--ブラックフェザー・シュート function c67779172.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_TOGRAVE) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCost(c67779172.cost) e1:SetTarget(c67779172.target) e1:SetOperation(c67779172.activate) c:RegisterEffect(e1) end function c67779172.costfilter(c) return c:IsSetCard(0x33) and c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost() end function c67779172.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(c67779172.costfilter,tp,LOCATION_HAND,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,c67779172.costfilter,tp,LOCATION_HAND,0,1,1,nil) Duel.SendtoGrave(g,REASON_COST) end function c67779172.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsDefencePos() end if chk==0 then return Duel.IsExistingTarget(Card.IsDefencePos,tp,0,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectTarget(tp,Card.IsDefencePos,tp,0,LOCATION_MZONE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0) end function c67779172.activate(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) then Duel.SendtoGrave(tc,REASON_EFFECT) end end
gpl-2.0
DailyShana/ygopro-scripts
c48049769.lua
5
1882
--サンダー・シーホース function c48049769.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(48049769,0)) e1:SetCategory(CATEGORY_SEARCH) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_HAND) e1:SetCountLimit(1,48049769) e1:SetCost(c48049769.cost) e1:SetTarget(c48049769.target) e1:SetOperation(c48049769.operation) c:RegisterEffect(e1) end function c48049769.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetActivityCount(tp,ACTIVITY_SPSUMMON)==0 and e:GetHandler():IsDiscardable() end Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD) --oath effects local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetReset(RESET_PHASE+PHASE_END) e1:SetTargetRange(1,0) Duel.RegisterEffect(e1,tp) end function c48049769.filter(c) return c:IsRace(RACE_THUNDER) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:GetLevel()==4 and c:IsAttackBelow(1600) and c:IsAbleToHand() end function c48049769.filter1(c,g) return g:IsExists(Card.IsCode,1,c,c:GetCode()) end function c48049769.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then local g=Duel.GetMatchingGroup(c48049769.filter,tp,LOCATION_DECK,0,nil) return g:IsExists(c48049769.filter1,1,nil,g) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,2,tp,LOCATION_DECK) end function c48049769.operation(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(c48049769.filter,tp,LOCATION_DECK,0,nil) local sg=g:Filter(c48049769.filter1,nil,g) if sg:GetCount()==0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local hg=sg:Select(tp,1,1,nil) local hc=sg:Filter(Card.IsCode,hg:GetFirst(),hg:GetFirst():GetCode()):GetFirst() hg:AddCard(hc) Duel.SendtoHand(hg,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,hg) end
gpl-2.0
lasko2112/legend-of-hondo
MMOCoreORB/bin/scripts/object/tangible/sign/player/shop_sign_s04.lua
3
2241
--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_sign_player_shop_sign_s04 = object_tangible_sign_player_shared_shop_sign_s04:new { maxCondition = 0 } ObjectTemplates:addTemplate(object_tangible_sign_player_shop_sign_s04, "object/tangible/sign/player/shop_sign_s04.iff")
agpl-3.0
schleichdi2/OPENNFR-6.0-CORE
opennfr-meta-openembedded/meta-gnome/recipes-gnome/devilspie/files/default.lua
40
1194
-- Copyright (c) 2012 Andreas Müller <schnitzeltony@googlemail.com> -- -- this is an example -- * undecorating all windows opened maximized -- * maximizing and undecorating all appplication's windows in apps_list -- for further information see -- http://www.gusnan.se/devilspie2/manual.php wnd_type = get_window_type() if(wnd_type == "WINDOW_TYPE_NORMAL") then -- add only applications you want maximized+undecorated and -- which don't keep maximized state apps_list = { "Terminal", "ristretto", "xarchiver", } app_name = get_application_name() -- to have some informational output, start devilspie2 with --debug -- option and uncomment the following lines: --debug_print ("Window Name: " .. get_window_name()) --debug_print ("Application name: " .. app_name) --debug_print ("window-type: " .. wnd_type) -- undecorate all windows starting maximized if (get_window_is_maximized()) then undecorate_window() -- maximize/undecorate all windows in apps_list -- (unfortunately for some also their settings) else for line, str in ipairs(apps_list) do if (string.find(app_name, str)) then maximize() undecorate_window() break end end end end
gpl-2.0
lasko2112/legend-of-hondo
MMOCoreORB/bin/scripts/object/tangible/ship/attachment/weapon/hutt_heavy_weapon1_s04.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_attachment_weapon_hutt_heavy_weapon1_s04 = object_tangible_ship_attachment_weapon_shared_hutt_heavy_weapon1_s04:new { } ObjectTemplates:addTemplate(object_tangible_ship_attachment_weapon_hutt_heavy_weapon1_s04, "object/tangible/ship/attachment/weapon/hutt_heavy_weapon1_s04.iff")
agpl-3.0
lasko2112/legend-of-hondo
MMOCoreORB/bin/scripts/mobile/mission/bh_singing_mountain_clan_arch_witch.lua
1
2751
bh_singing_mountain_clan_arch_witch = Creature:new { objectName = "@mob/creature_names:singing_mtn_clan_arch_witch", randomNameType = NAME_GENERIC_TAG, socialGroup = "mtn_clan", faction = "mtn_clan", level = 107, chanceHit = 1, damageMin = 645, damageMax = 1000, baseXp = 10174, baseHAM = 24000, baseHAMmax = 30000, armor = 2, resists = {100,35,35,100,100,100,100,100,-1}, meatType = "", meatAmount = 0, hideType = "", hideAmount = 0, boneType = "", boneAmount = 0, milk = 0, tamingChance = 0, ferocity = 0, pvpBitmask = ATTACKABLE, creatureBitmask = PACK + KILLER + HEALER, optionsBitmask = 128, diet = HERBIVORE, templates = {"object/mobile/dressed_dathomir_sing_mt_clan_arch_witch.iff"}, lootGroups = { { groups = { {group = "junk", chance = 2500000}, {group = "tailor_components", chance = 500000}, {group = "loot_kit_parts", chance = 500000}, {group = "color_crystals", chance = 500000}, {group = "crystals_good", chance = 500000}, {group = "crystals_quality", chance = 500000}, {group = "wearables_all", chance = 1000000}, {group = "weapons_all", chance = 1000000}, {group = "armor_all", chance = 1000000}, {group = "clothing_attachments", chance = 1000000}, {group = "armor_attachments", chance = 1000000} }, lootChance = 5140000 }, { groups = { {group = "junk", chance = 2500000}, {group = "tailor_components", chance = 500000}, {group = "loot_kit_parts", chance = 500000}, {group = "color_crystals", chance = 500000}, {group = "crystals_good", chance = 500000}, {group = "crystals_quality", chance = 500000}, {group = "wearables_all", chance = 1000000}, {group = "weapons_all", chance = 1000000}, {group = "armor_all", chance = 1000000}, {group = "clothing_attachments", chance = 1000000}, {group = "armor_attachments", chance = 1000000} }, lootChance = 5140000 }, { groups = { {group = "junk", chance = 2500000}, {group = "tailor_components", chance = 500000}, {group = "loot_kit_parts", chance = 500000}, {group = "color_crystals", chance = 500000}, {group = "crystals_good", chance = 500000}, {group = "crystals_quality", chance = 500000}, {group = "wearables_all", chance = 1000000}, {group = "weapons_all", chance = 1000000}, {group = "armor_all", chance = 1000000}, {group = "clothing_attachments", chance = 1000000}, {group = "armor_attachments", chance = 1000000} }, lootChance = 5140000 } }, weapons = {"mixed_force_weapons"}, conversationTemplate = "", attacks = merge(brawlermaster,pikemanmaster,forcewielder) } CreatureTemplates:addCreatureTemplate(bh_singing_mountain_clan_arch_witch, "bh_singing_mountain_clan_arch_witch")
agpl-3.0
lasko2112/legend-of-hondo
MMOCoreORB/bin/scripts/object/tangible/mission/quest_item/luthin_dlunar_q1_needed.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_tangible_mission_quest_item_luthin_dlunar_q1_needed = object_tangible_mission_quest_item_shared_luthin_dlunar_q1_needed:new { } ObjectTemplates:addTemplate(object_tangible_mission_quest_item_luthin_dlunar_q1_needed, "object/tangible/mission/quest_item/luthin_dlunar_q1_needed.iff")
agpl-3.0
DailyShana/ygopro-scripts
c68875140.lua
7
1432
--押し売りゴブリン function c68875140.initial_effect(c) --activate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) c:RegisterEffect(e1) --todeck local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(68875140,0)) e2:SetCategory(CATEGORY_TOHAND) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetRange(LOCATION_SZONE) e2:SetCode(EVENT_BATTLE_DAMAGE) e2:SetCondition(c68875140.condition) e2:SetTarget(c68875140.target) e2:SetOperation(c68875140.operation) c:RegisterEffect(e2) end function c68875140.condition(e,tp,eg,ep,ev,re,r,rp) return ep~=tp and eg:GetFirst():GetControler()==tp end function c68875140.filter(c) return c:GetSequence()<5 and c:IsAbleToHand() end function c68875140.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_SZONE) and chkc:IsControler(1-tp) and c68875140.filter(chkc) end if chk==0 then return true end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) local g=Duel.SelectTarget(tp,c68875140.filter,tp,0,LOCATION_SZONE,1,1,nil) if g:GetCount()>0 then Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) end end function c68875140.operation(e,tp,eg,ep,ev,re,r,rp) if not e:GetHandler():IsRelateToEffect(e) then return end local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) then Duel.SendtoHand(tc,nil,REASON_EFFECT) end end
gpl-2.0
lasko2112/legend-of-hondo
MMOCoreORB/bin/scripts/object/building/naboo/association_hall_civilian_naboo.lua
2
2629
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version object_building_naboo_association_hall_civilian_naboo = object_building_naboo_shared_association_hall_civilian_naboo:new { childObjects = { {templateFile = "object/tangible/terminal/terminal_elevator_up.iff", x = 0, z = -8.5, y = 13.5, ow = 0, ox = 0, oy = 1, oz = 0, cellid = 9, containmentType = -1}, {templateFile = "object/tangible/terminal/terminal_elevator_down.iff", x = 0, z = 2.75, y = 13.5, ow = 0, ox = 0, oy = 1, oz = 0, cellid = 9, containmentType = -1}, }, } ObjectTemplates:addTemplate(object_building_naboo_association_hall_civilian_naboo, "object/building/naboo/association_hall_civilian_naboo.iff")
agpl-3.0
lasko2112/legend-of-hondo
MMOCoreORB/bin/scripts/object/mobile/wookiee_lifeday_male2.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_wookiee_lifeday_male2 = object_mobile_shared_wookiee_lifeday_male2:new { } ObjectTemplates:addTemplate(object_mobile_wookiee_lifeday_male2, "object/mobile/wookiee_lifeday_male2.iff")
agpl-3.0
wifidog/packages
net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan/rule.lua
80
4829
-- ------ extra functions ------ -- function ruleCheck() -- determine if rules needs a proper protocol configured uci.cursor():foreach("mwan3", "rule", function (section) local sourcePort = ut.trim(sys.exec("uci -p /var/state get mwan3." .. section[".name"] .. ".src_port")) local destPort = ut.trim(sys.exec("uci -p /var/state get mwan3." .. section[".name"] .. ".dest_port")) if sourcePort ~= "" or destPort ~= "" then -- ports configured local protocol = ut.trim(sys.exec("uci -p /var/state get mwan3." .. section[".name"] .. ".proto")) if protocol == "" or protocol == "all" then -- no or improper protocol error_protocol_list = error_protocol_list .. section[".name"] .. " " end end end ) end function ruleWarn() -- display warning messages at the top of the page if error_protocol_list ~= " " then return "<font color=\"ff0000\"><strong>WARNING: some rules have a port configured with no or improper protocol specified! Please configure a specific protocol!</strong></font>" else return "" end end -- ------ rule configuration ------ -- dsp = require "luci.dispatcher" sys = require "luci.sys" ut = require "luci.util" error_protocol_list = " " ruleCheck() m5 = Map("mwan3", translate("MWAN Rule Configuration"), translate(ruleWarn())) m5:append(Template("mwan/config_css")) mwan_rule = m5:section(TypedSection, "rule", translate("Traffic Rules"), translate("Rules specify which traffic will use a particular MWAN policy based on IP address, port or protocol<br />" .. "Rules are matched from top to bottom. Rules below a matching rule are ignored. Traffic not matching any rule is routed using the main routing table<br />" .. "Traffic destined for known (other than default) networks is handled by the main routing table. Traffic matching a rule, but all WAN interfaces for that policy are down will be blackholed<br />" .. "Names may contain characters A-Z, a-z, 0-9, _ and no spaces<br />" .. "Rules may not share the same name as configured interfaces, members or policies")) mwan_rule.addremove = true mwan_rule.anonymous = false mwan_rule.dynamic = false mwan_rule.sectionhead = "Rule" mwan_rule.sortable = true mwan_rule.template = "cbi/tblsection" mwan_rule.extedit = dsp.build_url("admin", "network", "mwan", "configuration", "rule", "%s") function mwan_rule.create(self, section) TypedSection.create(self, section) m5.uci:save("mwan3") luci.http.redirect(dsp.build_url("admin", "network", "mwan", "configuration", "rule", section)) end src_ip = mwan_rule:option(DummyValue, "src_ip", translate("Source address")) src_ip.rawhtml = true function src_ip.cfgvalue(self, s) return self.map:get(s, "src_ip") or "&#8212;" end src_port = mwan_rule:option(DummyValue, "src_port", translate("Source port")) src_port.rawhtml = true function src_port.cfgvalue(self, s) return self.map:get(s, "src_port") or "&#8212;" end dest_ip = mwan_rule:option(DummyValue, "dest_ip", translate("Destination address")) dest_ip.rawhtml = true function dest_ip.cfgvalue(self, s) return self.map:get(s, "dest_ip") or "&#8212;" end dest_port = mwan_rule:option(DummyValue, "dest_port", translate("Destination port")) dest_port.rawhtml = true function dest_port.cfgvalue(self, s) return self.map:get(s, "dest_port") or "&#8212;" end proto = mwan_rule:option(DummyValue, "proto", translate("Protocol")) proto.rawhtml = true function proto.cfgvalue(self, s) return self.map:get(s, "proto") or "all" end sticky = mwan_rule:option(DummyValue, "sticky", translate("Sticky")) sticky.rawhtml = true function sticky.cfgvalue(self, s) if self.map:get(s, "sticky") == "1" then stickied = 1 return "Yes" else stickied = nil return "No" end end timeout = mwan_rule:option(DummyValue, "timeout", translate("Sticky timeout")) timeout.rawhtml = true function timeout.cfgvalue(self, s) if stickied then local timeoutValue = self.map:get(s, "timeout") if timeoutValue then return timeoutValue .. "s" else return "600s" end else return "&#8212;" end end ipset = mwan_rule:option(DummyValue, "ipset", translate("IPset")) ipset.rawhtml = true function ipset.cfgvalue(self, s) return self.map:get(s, "ipset") or "&#8212;" end use_policy = mwan_rule:option(DummyValue, "use_policy", translate("Policy assigned")) use_policy.rawhtml = true function use_policy.cfgvalue(self, s) return self.map:get(s, "use_policy") or "&#8212;" end errors = mwan_rule:option(DummyValue, "errors", translate("Errors")) errors.rawhtml = true function errors.cfgvalue(self, s) if not string.find(error_protocol_list, " " .. s .. " ") then return "" else return "<span title=\"No protocol specified\"><img src=\"/luci-static/resources/cbi/reset.gif\" alt=\"error\"></img></span>" end end return m5
gpl-2.0
lasko2112/legend-of-hondo
MMOCoreORB/bin/scripts/object/installation/battlefield/destructible/bfield_nightsister_target_sith_crystal.lua
3
2392
--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_battlefield_destructible_bfield_nightsister_target_sith_crystal = object_installation_battlefield_destructible_shared_bfield_nightsister_target_sith_crystal:new { } ObjectTemplates:addTemplate(object_installation_battlefield_destructible_bfield_nightsister_target_sith_crystal, "object/installation/battlefield/destructible/bfield_nightsister_target_sith_crystal.iff")
agpl-3.0
lasko2112/legend-of-hondo
MMOCoreORB/bin/scripts/loot/items/wearables/ithorian/ith_necklace_s12.lua
4
1300
ith_necklace_s12 = { -- Ithorian Elegant Gemstone Necklace minimumLevel = 0, maximumLevel = -1, customObjectName = "", directObjectTemplate = "object/tangible/wearables/ithorian/ith_necklace_s12.iff", craftingValues = {}, skillMods = {}, customizationStringNames = {"/private/index_color_1","/private/index_color_2"}, customizationValues = { {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119}, {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119} }, junkDealerTypeNeeded = JUNKCLOTHESANDJEWELLERY, junkMinValue = 45, junkMaxValue = 90 } addLootItemTemplate("ith_necklace_s12", ith_necklace_s12)
agpl-3.0
lasko2112/legend-of-hondo
MMOCoreORB/bin/scripts/object/tangible/crafting/station/clothing_repair.lua
3
2880
--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_crafting_station_clothing_repair = object_tangible_crafting_station_shared_clothing_repair:new { templateType = REPAIRTOOL, canRepairType = 16777216, -- Clothing boostSkill = "crafting_tailor_master", boostSkillMod = "clothing_repair", stationType = 1, factoryCrateSize = 25, numberExperimentalProperties = {1, 1, 1, 1}, experimentalProperties = {"XX", "XX", "UT", "CD"}, experimentalWeights = {1, 1, 1, 1}, experimentalGroupTitles = {"null", "null", "exp_durability", "exp_quality"}, experimentalSubGroupTitles = {"null", "null", "hitpoints", "quality"}, experimentalMin = {0, 0, 1000, 1}, experimentalMax = {0, 0, 1000, 100}, experimentalPrecision = {0, 0, 0, 0}, experimentalCombineType = {0, 0, 4, 1}, } ObjectTemplates:addTemplate(object_tangible_crafting_station_clothing_repair, "object/tangible/crafting/station/clothing_repair.iff")
agpl-3.0
DailyShana/ygopro-scripts
c36736723.lua
3
2516
--ラッシュ・ウォリアー function c36736723.initial_effect(c) --atkup local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(36736723,0)) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetCode(EVENT_PRE_DAMAGE_CALCULATE) e1:SetRange(LOCATION_HAND) e1:SetCountLimit(1,36736723) e1:SetCondition(c36736723.atkcon) e1:SetCost(c36736723.atkcost) e1:SetOperation(c36736723.atkop) c:RegisterEffect(e1) --tohand local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(36736723,1)) e2:SetCategory(CATEGORY_TOHAND) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_GRAVE) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCountLimit(1,36736724) e2:SetCost(c36736723.thcost) e2:SetTarget(c36736723.thtg) e2:SetOperation(c36736723.thop) c:RegisterEffect(e2) end function c36736723.atkcon(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetAttackTarget() if not tc then return false end if tc:IsControler(1-tp) then tc=Duel.GetAttacker() end e:SetLabelObject(tc) return tc and tc:IsRelateToBattle() and tc:IsSetCard(0x66) and tc:IsType(TYPE_SYNCHRO) end function c36736723.atkcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end Duel.SendtoGrave(e:GetHandler(),REASON_COST) end function c36736723.atkop(e,tp,eg,ep,ev,re,r,rp) local tc=e:GetLabelObject() if tc:IsFaceup() and tc:IsRelateToBattle() then local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_SET_ATTACK_FINAL) e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_DAMAGE_CAL) e1:SetValue(tc:GetAttack()*2) tc:RegisterEffect(e1) end end function c36736723.thcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST) end function c36736723.filter(c) return c:IsSetCard(0x17) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() end function c36736723.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c36736723.filter(chkc) end if chk==0 then return Duel.IsExistingTarget(c36736723.filter,tp,LOCATION_GRAVE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectTarget(tp,c36736723.filter,tp,LOCATION_GRAVE,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) end function c36736723.thop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.SendtoHand(tc,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,tc) end end
gpl-2.0
DailyShana/ygopro-scripts
c27918963.lua
3
2983
--修験の妖社 function c27918963.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) c:RegisterEffect(e1) --counter local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetCode(EVENT_SUMMON_SUCCESS) e2:SetRange(LOCATION_SZONE) e2:SetCondition(c27918963.ctcon) e2:SetOperation(c27918963.ctop) c:RegisterEffect(e2) local e3=e2:Clone() e3:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e3) --counter local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(27918963,0)) e4:SetType(EFFECT_TYPE_IGNITION) e4:SetRange(LOCATION_SZONE) e4:SetCountLimit(1,27918963) e4:SetTarget(c27918963.target) e4:SetOperation(c27918963.operation) c:RegisterEffect(e4) end function c27918963.cfilter(c) return c:IsFaceup() and c:IsSetCard(0xb3) end function c27918963.ctcon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(c27918963.cfilter,1,nil) end function c27918963.ctop(e,tp,eg,ep,ev,re,r,rp) e:GetHandler():AddCounter(0x33,1) end function c27918963.filter1(c) return c:IsFaceup() and c:IsSetCard(0xb3) end function c27918963.filter2(c) return c:IsSetCard(0xb3) and c:IsAbleToHand() and not c:IsHasEffect(EFFECT_NECRO_VALLEY) end function c27918963.target(e,tp,eg,ep,ev,re,r,rp,chk) local b1=e:GetHandler():IsCanRemoveCounter(tp,0x33,1,REASON_COST) and Duel.IsExistingMatchingCard(c27918963.filter1,tp,LOCATION_MZONE,0,1,nil) local b2=e:GetHandler():IsCanRemoveCounter(tp,0x33,3,REASON_COST) and Duel.IsExistingMatchingCard(c27918963.filter2,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) if chk==0 then return b1 or b2 end local op=0 if b1 and b2 then op=Duel.SelectOption(tp,aux.Stringid(27918963,1),aux.Stringid(27918963,2)) elseif b1 then op=Duel.SelectOption(tp,aux.Stringid(27918963,1)) else op=Duel.SelectOption(tp,aux.Stringid(27918963,2))+1 end e:SetLabel(op) if op==0 then e:SetCategory(CATEGORY_ATKCHANGE) e:GetHandler():RemoveCounter(tp,0x33,1,REASON_COST) else e:SetCategory(CATEGORY_TOHAND) e:GetHandler():RemoveCounter(tp,0x33,3,REASON_COST) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE) end end function c27918963.operation(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToEffect(e) then return end if e:GetLabel()==0 then local g=Duel.GetMatchingGroup(c27918963.filter1,tp,LOCATION_MZONE,0,nil) local tc=g:GetFirst() while tc do local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetValue(300) e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+RESET_END) tc:RegisterEffect(e1) tc=g:GetNext() end else Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,c27918963.filter2,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil) if g:GetCount()>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end end
gpl-2.0
lasko2112/legend-of-hondo
MMOCoreORB/bin/scripts/object/tangible/ship/components/booster/bst_freitek_outrunner_x1.lua
3
2316
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version object_tangible_ship_components_booster_bst_freitek_outrunner_x1 = object_tangible_ship_components_booster_shared_bst_freitek_outrunner_x1:new { } ObjectTemplates:addTemplate(object_tangible_ship_components_booster_bst_freitek_outrunner_x1, "object/tangible/ship/components/booster/bst_freitek_outrunner_x1.iff")
agpl-3.0
lasko2112/legend-of-hondo
MMOCoreORB/bin/scripts/object/tangible/lair/kima/lair_kima.lua
2
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_lair_kima_lair_kima = object_tangible_lair_kima_shared_lair_kima:new { objectMenuComponent = {"cpp", "LairMenuComponent"}, } ObjectTemplates:addTemplate(object_tangible_lair_kima_lair_kima, "object/tangible/lair/kima/lair_kima.iff")
agpl-3.0
LingJiJian/Tui-x
HelloTuiLua/DeprecatedOpenglEnum.lua
148
11934
-- This is the DeprecatedEnum DeprecatedClass = {} or DeprecatedClass _G.GL_RENDERBUFFER_INTERNAL_FORMAT = gl.RENDERBUFFER_INTERNAL_FORMAT _G.GL_LINE_WIDTH = gl.LINE_WIDTH _G.GL_CONSTANT_ALPHA = gl.CONSTANT_ALPHA _G.GL_BLEND_SRC_ALPHA = gl.BLEND_SRC_ALPHA _G.GL_GREEN_BITS = gl.GREEN_BITS _G.GL_STENCIL_REF = gl.STENCIL_REF _G.GL_ONE_MINUS_SRC_ALPHA = gl.ONE_MINUS_SRC_ALPHA _G.GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE _G.GL_CCW = gl.CCW _G.GL_MAX_TEXTURE_IMAGE_UNITS = gl.MAX_TEXTURE_IMAGE_UNITS _G.GL_BACK = gl.BACK _G.GL_ACTIVE_ATTRIBUTES = gl.ACTIVE_ATTRIBUTES _G.GL_TEXTURE_CUBE_MAP_POSITIVE_X = gl.TEXTURE_CUBE_MAP_POSITIVE_X _G.GL_STENCIL_BACK_VALUE_MASK = gl.STENCIL_BACK_VALUE_MASK _G.GL_TEXTURE_CUBE_MAP_POSITIVE_Z = gl.TEXTURE_CUBE_MAP_POSITIVE_Z _G.GL_ONE = gl.ONE _G.GL_TRUE = gl.TRUE _G.GL_TEXTURE12 = gl.TEXTURE12 _G.GL_LINK_STATUS = gl.LINK_STATUS _G.GL_BLEND = gl.BLEND _G.GL_LESS = gl.LESS _G.GL_TEXTURE16 = gl.TEXTURE16 _G.GL_BOOL_VEC2 = gl.BOOL_VEC2 _G.GL_KEEP = gl.KEEP _G.GL_DST_COLOR = gl.DST_COLOR _G.GL_VERTEX_ATTRIB_ARRAY_ENABLED = gl.VERTEX_ATTRIB_ARRAY_ENABLED _G.GL_EXTENSIONS = gl.EXTENSIONS _G.GL_FRONT = gl.FRONT _G.GL_DST_ALPHA = gl.DST_ALPHA _G.GL_ATTACHED_SHADERS = gl.ATTACHED_SHADERS _G.GL_STENCIL_BACK_FUNC = gl.STENCIL_BACK_FUNC _G.GL_ONE_MINUS_DST_COLOR = gl.ONE_MINUS_DST_COLOR _G.GL_BLEND_EQUATION = gl.BLEND_EQUATION _G.GL_RENDERBUFFER_DEPTH_SIZE = gl.RENDERBUFFER_DEPTH_SIZE _G.GL_PACK_ALIGNMENT = gl.PACK_ALIGNMENT _G.GL_VENDOR = gl.VENDOR _G.GL_NEAREST_MIPMAP_LINEAR = gl.NEAREST_MIPMAP_LINEAR _G.GL_TEXTURE_CUBE_MAP_POSITIVE_Y = gl.TEXTURE_CUBE_MAP_POSITIVE_Y _G.GL_NEAREST = gl.NEAREST _G.GL_RENDERBUFFER_WIDTH = gl.RENDERBUFFER_WIDTH _G.GL_ARRAY_BUFFER_BINDING = gl.ARRAY_BUFFER_BINDING _G.GL_ARRAY_BUFFER = gl.ARRAY_BUFFER _G.GL_LEQUAL = gl.LEQUAL _G.GL_VERSION = gl.VERSION _G.GL_COLOR_CLEAR_VALUE = gl.COLOR_CLEAR_VALUE _G.GL_RENDERER = gl.RENDERER _G.GL_STENCIL_BACK_PASS_DEPTH_PASS = gl.STENCIL_BACK_PASS_DEPTH_PASS _G.GL_STENCIL_BACK_PASS_DEPTH_FAIL = gl.STENCIL_BACK_PASS_DEPTH_FAIL _G.GL_STENCIL_BACK_WRITEMASK = gl.STENCIL_BACK_WRITEMASK _G.GL_BOOL = gl.BOOL _G.GL_VIEWPORT = gl.VIEWPORT _G.GL_FRAGMENT_SHADER = gl.FRAGMENT_SHADER _G.GL_LUMINANCE = gl.LUMINANCE _G.GL_DECR_WRAP = gl.DECR_WRAP _G.GL_FUNC_ADD = gl.FUNC_ADD _G.GL_ONE_MINUS_DST_ALPHA = gl.ONE_MINUS_DST_ALPHA _G.GL_OUT_OF_MEMORY = gl.OUT_OF_MEMORY _G.GL_BOOL_VEC4 = gl.BOOL_VEC4 _G.GL_POLYGON_OFFSET_FACTOR = gl.POLYGON_OFFSET_FACTOR _G.GL_STATIC_DRAW = gl.STATIC_DRAW _G.GL_DITHER = gl.DITHER _G.GL_TEXTURE31 = gl.TEXTURE31 _G.GL_TEXTURE30 = gl.TEXTURE30 _G.GL_UNSIGNED_BYTE = gl.UNSIGNED_BYTE _G.GL_DEPTH_COMPONENT16 = gl.DEPTH_COMPONENT16 _G.GL_TEXTURE23 = gl.TEXTURE23 _G.GL_DEPTH_TEST = gl.DEPTH_TEST _G.GL_STENCIL_PASS_DEPTH_FAIL = gl.STENCIL_PASS_DEPTH_FAIL _G.GL_BOOL_VEC3 = gl.BOOL_VEC3 _G.GL_POLYGON_OFFSET_UNITS = gl.POLYGON_OFFSET_UNITS _G.GL_TEXTURE_BINDING_2D = gl.TEXTURE_BINDING_2D _G.GL_TEXTURE21 = gl.TEXTURE21 _G.GL_UNPACK_ALIGNMENT = gl.UNPACK_ALIGNMENT _G.GL_DONT_CARE = gl.DONT_CARE _G.GL_BUFFER_SIZE = gl.BUFFER_SIZE _G.GL_FLOAT_MAT3 = gl.FLOAT_MAT3 _G.GL_UNSIGNED_SHORT_5_6_5 = gl.UNSIGNED_SHORT_5_6_5 _G.GL_INT_VEC2 = gl.INT_VEC2 _G.GL_UNSIGNED_SHORT_4_4_4_4 = gl.UNSIGNED_SHORT_4_4_4_4 _G.GL_NONE = gl.NONE _G.GL_BLEND_DST_ALPHA = gl.BLEND_DST_ALPHA _G.GL_VERTEX_ATTRIB_ARRAY_SIZE = gl.VERTEX_ATTRIB_ARRAY_SIZE _G.GL_SRC_COLOR = gl.SRC_COLOR _G.GL_COMPRESSED_TEXTURE_FORMATS = gl.COMPRESSED_TEXTURE_FORMATS _G.GL_STENCIL_ATTACHMENT = gl.STENCIL_ATTACHMENT _G.GL_MAX_VERTEX_ATTRIBS = gl.MAX_VERTEX_ATTRIBS _G.GL_NUM_COMPRESSED_TEXTURE_FORMATS = gl.NUM_COMPRESSED_TEXTURE_FORMATS _G.GL_BLEND_EQUATION_RGB = gl.BLEND_EQUATION_RGB _G.GL_TEXTURE = gl.TEXTURE _G.GL_LINEAR_MIPMAP_LINEAR = gl.LINEAR_MIPMAP_LINEAR _G.GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = gl.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING _G.GL_CURRENT_PROGRAM = gl.CURRENT_PROGRAM _G.GL_COLOR_BUFFER_BIT = gl.COLOR_BUFFER_BIT _G.GL_TEXTURE20 = gl.TEXTURE20 _G.GL_ACTIVE_ATTRIBUTE_MAX_LENGTH = gl.ACTIVE_ATTRIBUTE_MAX_LENGTH _G.GL_TEXTURE28 = gl.TEXTURE28 _G.GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = gl.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE _G.GL_TEXTURE22 = gl.TEXTURE22 _G.GL_ELEMENT_ARRAY_BUFFER_BINDING = gl.ELEMENT_ARRAY_BUFFER_BINDING _G.GL_STREAM_DRAW = gl.STREAM_DRAW _G.GL_SCISSOR_BOX = gl.SCISSOR_BOX _G.GL_TEXTURE26 = gl.TEXTURE26 _G.GL_TEXTURE27 = gl.TEXTURE27 _G.GL_TEXTURE24 = gl.TEXTURE24 _G.GL_TEXTURE25 = gl.TEXTURE25 _G.GL_NO_ERROR = gl.NO_ERROR _G.GL_TEXTURE29 = gl.TEXTURE29 _G.GL_FLOAT_MAT4 = gl.FLOAT_MAT4 _G.GL_VERTEX_ATTRIB_ARRAY_NORMALIZED = gl.VERTEX_ATTRIB_ARRAY_NORMALIZED _G.GL_SAMPLE_COVERAGE_INVERT = gl.SAMPLE_COVERAGE_INVERT _G.GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = gl.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL _G.GL_FLOAT_VEC3 = gl.FLOAT_VEC3 _G.GL_STENCIL_CLEAR_VALUE = gl.STENCIL_CLEAR_VALUE _G.GL_UNSIGNED_SHORT_5_5_5_1 = gl.UNSIGNED_SHORT_5_5_5_1 _G.GL_ACTIVE_UNIFORMS = gl.ACTIVE_UNIFORMS _G.GL_INVALID_OPERATION = gl.INVALID_OPERATION _G.GL_DEPTH_ATTACHMENT = gl.DEPTH_ATTACHMENT _G.GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS = gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS _G.GL_FRAMEBUFFER_COMPLETE = gl.FRAMEBUFFER_COMPLETE _G.GL_ONE_MINUS_CONSTANT_COLOR = gl.ONE_MINUS_CONSTANT_COLOR _G.GL_TEXTURE2 = gl.TEXTURE2 _G.GL_TEXTURE1 = gl.TEXTURE1 _G.GL_GEQUAL = gl.GEQUAL _G.GL_TEXTURE7 = gl.TEXTURE7 _G.GL_TEXTURE6 = gl.TEXTURE6 _G.GL_TEXTURE5 = gl.TEXTURE5 _G.GL_TEXTURE4 = gl.TEXTURE4 _G.GL_GENERATE_MIPMAP_HINT = gl.GENERATE_MIPMAP_HINT _G.GL_ONE_MINUS_SRC_COLOR = gl.ONE_MINUS_SRC_COLOR _G.GL_TEXTURE9 = gl.TEXTURE9 _G.GL_STENCIL_TEST = gl.STENCIL_TEST _G.GL_COLOR_WRITEMASK = gl.COLOR_WRITEMASK _G.GL_DEPTH_COMPONENT = gl.DEPTH_COMPONENT _G.GL_STENCIL_INDEX8 = gl.STENCIL_INDEX8 _G.GL_VERTEX_ATTRIB_ARRAY_TYPE = gl.VERTEX_ATTRIB_ARRAY_TYPE _G.GL_FLOAT_VEC2 = gl.FLOAT_VEC2 _G.GL_BLUE_BITS = gl.BLUE_BITS _G.GL_VERTEX_SHADER = gl.VERTEX_SHADER _G.GL_SUBPIXEL_BITS = gl.SUBPIXEL_BITS _G.GL_STENCIL_WRITEMASK = gl.STENCIL_WRITEMASK _G.GL_FLOAT_VEC4 = gl.FLOAT_VEC4 _G.GL_TEXTURE17 = gl.TEXTURE17 _G.GL_ONE_MINUS_CONSTANT_ALPHA = gl.ONE_MINUS_CONSTANT_ALPHA _G.GL_TEXTURE15 = gl.TEXTURE15 _G.GL_TEXTURE14 = gl.TEXTURE14 _G.GL_TEXTURE13 = gl.TEXTURE13 _G.GL_SAMPLES = gl.SAMPLES _G.GL_TEXTURE11 = gl.TEXTURE11 _G.GL_TEXTURE10 = gl.TEXTURE10 _G.GL_FUNC_SUBTRACT = gl.FUNC_SUBTRACT _G.GL_STENCIL_BUFFER_BIT = gl.STENCIL_BUFFER_BIT _G.GL_TEXTURE19 = gl.TEXTURE19 _G.GL_TEXTURE18 = gl.TEXTURE18 _G.GL_NEAREST_MIPMAP_NEAREST = gl.NEAREST_MIPMAP_NEAREST _G.GL_SHORT = gl.SHORT _G.GL_RENDERBUFFER_BINDING = gl.RENDERBUFFER_BINDING _G.GL_REPEAT = gl.REPEAT _G.GL_TEXTURE_MIN_FILTER = gl.TEXTURE_MIN_FILTER _G.GL_RED_BITS = gl.RED_BITS _G.GL_FRONT_FACE = gl.FRONT_FACE _G.GL_BLEND_COLOR = gl.BLEND_COLOR _G.GL_MIRRORED_REPEAT = gl.MIRRORED_REPEAT _G.GL_INT_VEC4 = gl.INT_VEC4 _G.GL_MAX_CUBE_MAP_TEXTURE_SIZE = gl.MAX_CUBE_MAP_TEXTURE_SIZE _G.GL_RENDERBUFFER_BLUE_SIZE = gl.RENDERBUFFER_BLUE_SIZE _G.GL_SAMPLE_COVERAGE = gl.SAMPLE_COVERAGE _G.GL_SRC_ALPHA = gl.SRC_ALPHA _G.GL_FUNC_REVERSE_SUBTRACT = gl.FUNC_REVERSE_SUBTRACT _G.GL_DEPTH_WRITEMASK = gl.DEPTH_WRITEMASK _G.GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT = gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT _G.GL_POLYGON_OFFSET_FILL = gl.POLYGON_OFFSET_FILL _G.GL_STENCIL_FUNC = gl.STENCIL_FUNC _G.GL_REPLACE = gl.REPLACE _G.GL_LUMINANCE_ALPHA = gl.LUMINANCE_ALPHA _G.GL_DEPTH_RANGE = gl.DEPTH_RANGE _G.GL_FASTEST = gl.FASTEST _G.GL_STENCIL_FAIL = gl.STENCIL_FAIL _G.GL_UNSIGNED_SHORT = gl.UNSIGNED_SHORT _G.GL_RENDERBUFFER_HEIGHT = gl.RENDERBUFFER_HEIGHT _G.GL_STENCIL_BACK_FAIL = gl.STENCIL_BACK_FAIL _G.GL_BLEND_SRC_RGB = gl.BLEND_SRC_RGB _G.GL_TEXTURE3 = gl.TEXTURE3 _G.GL_RENDERBUFFER = gl.RENDERBUFFER _G.GL_RGB5_A1 = gl.RGB5_A1 _G.GL_RENDERBUFFER_ALPHA_SIZE = gl.RENDERBUFFER_ALPHA_SIZE _G.GL_RENDERBUFFER_STENCIL_SIZE = gl.RENDERBUFFER_STENCIL_SIZE _G.GL_NOTEQUAL = gl.NOTEQUAL _G.GL_BLEND_DST_RGB = gl.BLEND_DST_RGB _G.GL_FRONT_AND_BACK = gl.FRONT_AND_BACK _G.GL_TEXTURE_BINDING_CUBE_MAP = gl.TEXTURE_BINDING_CUBE_MAP _G.GL_MAX_RENDERBUFFER_SIZE = gl.MAX_RENDERBUFFER_SIZE _G.GL_ZERO = gl.ZERO _G.GL_TEXTURE0 = gl.TEXTURE0 _G.GL_SAMPLE_ALPHA_TO_COVERAGE = gl.SAMPLE_ALPHA_TO_COVERAGE _G.GL_BUFFER_USAGE = gl.BUFFER_USAGE _G.GL_ACTIVE_TEXTURE = gl.ACTIVE_TEXTURE _G.GL_BYTE = gl.BYTE _G.GL_CW = gl.CW _G.GL_DYNAMIC_DRAW = gl.DYNAMIC_DRAW _G.GL_RENDERBUFFER_RED_SIZE = gl.RENDERBUFFER_RED_SIZE _G.GL_FALSE = gl.FALSE _G.GL_GREATER = gl.GREATER _G.GL_RGBA4 = gl.RGBA4 _G.GL_VALIDATE_STATUS = gl.VALIDATE_STATUS _G.GL_STENCIL_BITS = gl.STENCIL_BITS _G.GL_RGB = gl.RGB _G.GL_INT = gl.INT _G.GL_DEPTH_FUNC = gl.DEPTH_FUNC _G.GL_SAMPLER_2D = gl.SAMPLER_2D _G.GL_NICEST = gl.NICEST _G.GL_MAX_VIEWPORT_DIMS = gl.MAX_VIEWPORT_DIMS _G.GL_CULL_FACE = gl.CULL_FACE _G.GL_INT_VEC3 = gl.INT_VEC3 _G.GL_ALIASED_POINT_SIZE_RANGE = gl.ALIASED_POINT_SIZE_RANGE _G.GL_INVALID_ENUM = gl.INVALID_ENUM _G.GL_INVERT = gl.INVERT _G.GL_CULL_FACE_MODE = gl.CULL_FACE_MODE _G.GL_TEXTURE8 = gl.TEXTURE8 _G.GL_VERTEX_ATTRIB_ARRAY_POINTER = gl.VERTEX_ATTRIB_ARRAY_POINTER _G.GL_TEXTURE_WRAP_S = gl.TEXTURE_WRAP_S _G.GL_VERTEX_ATTRIB_ARRAY_STRIDE = gl.VERTEX_ATTRIB_ARRAY_STRIDE _G.GL_LINES = gl.LINES _G.GL_EQUAL = gl.EQUAL _G.GL_LINE_LOOP = gl.LINE_LOOP _G.GL_TEXTURE_WRAP_T = gl.TEXTURE_WRAP_T _G.GL_DEPTH_BUFFER_BIT = gl.DEPTH_BUFFER_BIT _G.GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS = gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS _G.GL_SHADER_TYPE = gl.SHADER_TYPE _G.GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME _G.GL_TEXTURE_CUBE_MAP_NEGATIVE_X = gl.TEXTURE_CUBE_MAP_NEGATIVE_X _G.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y = gl.TEXTURE_CUBE_MAP_NEGATIVE_Y _G.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z = gl.TEXTURE_CUBE_MAP_NEGATIVE_Z _G.GL_DECR = gl.DECR _G.GL_DELETE_STATUS = gl.DELETE_STATUS _G.GL_DEPTH_BITS = gl.DEPTH_BITS _G.GL_INCR = gl.INCR _G.GL_SAMPLE_COVERAGE_VALUE = gl.SAMPLE_COVERAGE_VALUE _G.GL_ALPHA_BITS = gl.ALPHA_BITS _G.GL_FLOAT_MAT2 = gl.FLOAT_MAT2 _G.GL_LINE_STRIP = gl.LINE_STRIP _G.GL_SHADER_SOURCE_LENGTH = gl.SHADER_SOURCE_LENGTH _G.GL_INVALID_VALUE = gl.INVALID_VALUE _G.GL_NEVER = gl.NEVER _G.GL_INCR_WRAP = gl.INCR_WRAP _G.GL_BLEND_EQUATION_ALPHA = gl.BLEND_EQUATION_ALPHA _G.GL_TEXTURE_MAG_FILTER = gl.TEXTURE_MAG_FILTER _G.GL_POINTS = gl.POINTS _G.GL_COLOR_ATTACHMENT0 = gl.COLOR_ATTACHMENT0 _G.GL_RGBA = gl.RGBA _G.GL_SRC_ALPHA_SATURATE = gl.SRC_ALPHA_SATURATE _G.GL_SAMPLER_CUBE = gl.SAMPLER_CUBE _G.GL_FRAMEBUFFER = gl.FRAMEBUFFER _G.GL_TEXTURE_CUBE_MAP = gl.TEXTURE_CUBE_MAP _G.GL_SAMPLE_BUFFERS = gl.SAMPLE_BUFFERS _G.GL_LINEAR = gl.LINEAR _G.GL_LINEAR_MIPMAP_NEAREST = gl.LINEAR_MIPMAP_NEAREST _G.GL_ACTIVE_UNIFORM_MAX_LENGTH = gl.ACTIVE_UNIFORM_MAX_LENGTH _G.GL_STENCIL_BACK_REF = gl.STENCIL_BACK_REF _G.GL_ELEMENT_ARRAY_BUFFER = gl.ELEMENT_ARRAY_BUFFER _G.GL_CLAMP_TO_EDGE = gl.CLAMP_TO_EDGE _G.GL_TRIANGLE_STRIP = gl.TRIANGLE_STRIP _G.GL_CONSTANT_COLOR = gl.CONSTANT_COLOR _G.GL_COMPILE_STATUS = gl.COMPILE_STATUS _G.GL_RENDERBUFFER_GREEN_SIZE = gl.RENDERBUFFER_GREEN_SIZE _G.GL_UNSIGNED_INT = gl.UNSIGNED_INT _G.GL_DEPTH_CLEAR_VALUE = gl.DEPTH_CLEAR_VALUE _G.GL_ALIASED_LINE_WIDTH_RANGE = gl.ALIASED_LINE_WIDTH_RANGE _G.GL_SHADING_LANGUAGE_VERSION = gl.SHADING_LANGUAGE_VERSION _G.GL_FRAMEBUFFER_UNSUPPORTED = gl.FRAMEBUFFER_UNSUPPORTED _G.GL_INFO_LOG_LENGTH = gl.INFO_LOG_LENGTH _G.GL_STENCIL_PASS_DEPTH_PASS = gl.STENCIL_PASS_DEPTH_PASS _G.GL_STENCIL_VALUE_MASK = gl.STENCIL_VALUE_MASK _G.GL_ALWAYS = gl.ALWAYS _G.GL_MAX_TEXTURE_SIZE = gl.MAX_TEXTURE_SIZE _G.GL_FLOAT = gl.FLOAT _G.GL_FRAMEBUFFER_BINDING = gl.FRAMEBUFFER_BINDING _G.GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = gl.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT _G.GL_TRIANGLE_FAN = gl.TRIANGLE_FAN _G.GL_INVALID_FRAMEBUFFER_OPERATION = gl.INVALID_FRAMEBUFFER_OPERATION _G.GL_TEXTURE_2D = gl.TEXTURE_2D _G.GL_ALPHA = gl.ALPHA _G.GL_CURRENT_VERTEX_ATTRIB = gl.CURRENT_VERTEX_ATTRIB _G.GL_SCISSOR_TEST = gl.SCISSOR_TEST _G.GL_TRIANGLES = gl.TRIANGLES
mit
ollie27/openwrt_luci
libs/luci-lib-nixio/docsrc/nixio.File.lua
173
4457
--- Large File Object. -- Large file operations are supported up to 52 bits if the Lua number type is -- double (default). -- @cstyle instance module "nixio.File" --- Write to the file descriptor. -- @class function -- @name File.write -- @usage <strong>Warning:</strong> It is not guaranteed that all data -- in the buffer is written at once especially when dealing with pipes. -- You have to check the return value - the number of bytes actually written - -- or use the safe IO functions in the high-level IO utility module. -- @usage Unlike standard Lua indexing the lowest offset and default is 0. -- @param buffer Buffer holding the data to be written. -- @param offset Offset to start reading the buffer from. (optional) -- @param length Length of chunk to read from the buffer. (optional) -- @return number of bytes written --- Read from a file descriptor. -- @class function -- @name File.read -- @usage <strong>Warning:</strong> It is not guaranteed that all requested data -- is read at once especially when dealing with pipes. -- You have to check the return value - the length of the buffer actually read - -- or use the safe IO functions in the high-level IO utility module. -- @usage The length of the return buffer is limited by the (compile time) -- nixio buffersize which is <em>nixio.const.buffersize</em> (8192 by default). -- Any read request greater than that will be safely truncated to this value. -- @param length Amount of data to read (in Bytes). -- @return buffer containing data successfully read --- Reposition read / write offset of the file descriptor. -- The seek will be done either from the beginning of the file or relative -- to the current position or relative to the end. -- @class function -- @name File.seek -- @usage This function calls lseek(). -- @param offset File Offset -- @param whence Starting point [<strong>"set"</strong>, "cur", "end"] -- @return new (absolute) offset position --- Return the current read / write offset of the file descriptor. -- @class function -- @name File.tell -- @usage This function calls lseek() with offset 0 from the current position. -- @return offset position --- Synchronizes the file with the storage device. -- Returns when the file is successfully written to the disk. -- @class function -- @name File.sync -- @usage This function calls fsync() when data_only equals false -- otherwise fdatasync(), on Windows _commit() is used instead. -- @usage fdatasync() is only supported by Linux and Solaris. For other systems -- the <em>data_only</em> parameter is ignored and fsync() is always called. -- @param data_only Do not synchronize the metadata. (optional, boolean) -- @return true --- Apply or test a lock on the file. -- @class function -- @name File.lock -- @usage This function calls lockf() on POSIX and _locking() on Windows. -- @usage The "lock" command is blocking, "tlock" is non-blocking, -- "ulock" unlocks and "test" only tests for the lock. -- @usage The "test" command is not available on Windows. -- @usage Locks are by default advisory on POSIX, but mandatory on Windows. -- @param command Locking Command ["lock", "tlock", "ulock", "test"] -- @param length Amount of Bytes to lock from current offset (optional) -- @return true --- Get file status and attributes. -- @class function -- @name File.stat -- @param field Only return a specific field, not the whole table (optional) -- @usage This function calls fstat(). -- @return Table containing: <ul> -- <li>atime = Last access timestamp</li> -- <li>blksize = Blocksize (POSIX only)</li> -- <li>blocks = Blocks used (POSIX only)</li> -- <li>ctime = Creation timestamp</li> -- <li>dev = Device ID</li> -- <li>gid = Group ID</li> -- <li>ino = Inode</li> -- <li>modedec = Mode converted into a decimal number</li> -- <li>modestr = Mode as string as returned by `ls -l`</li> -- <li>mtime = Last modification timestamp</li> -- <li>nlink = Number of links</li> -- <li>rdev = Device ID (if special file)</li> -- <li>size = Size in bytes</li> -- <li>type = ["reg", "dir", "chr", "blk", "fifo", "lnk", "sock"]</li> -- <li>uid = User ID</li> -- </ul> --- Close the file descriptor. -- @class function -- @name File.close -- @return true --- Get the number of the filedescriptor. -- @class function -- @name File.fileno -- @return file descriptor number --- (POSIX) Set the blocking mode of the file descriptor. -- @class function -- @name File.setblocking -- @param blocking (boolean) -- @return true
apache-2.0
Whitechaser/darkstar
scripts/zones/Port_San_dOria/npcs/Raqtibahl.lua
5
2976
----------------------------------- -- Area: Port San d'Oria -- NPC: Raqtibahl -- (Corsair's Frac) !pos -59 -4 -39 232 ----------------------------------- package.loaded["scripts/zones/Port_San_dOria/TextIDs"] = nil; ----------------------------------- require("scripts/zones/Port_San_dOria/TextIDs"); require("scripts/globals/settings"); require("scripts/globals/keyitems"); require("scripts/globals/quests"); ----------------------------------- function onTrade(player,npc,trade) local letterRed = player:getVar("LeleroonsLetterRed"); -- magicmart flyer if (player:getQuestStatus(SANDORIA,FLYERS_FOR_REGINE) == QUEST_ACCEPTED and trade:getItemCount() == 1 and trade:hasItemQty(532,1)) then player:messageSpecial(FLYER_REFUSED); -- gold chain, velvet cloth, red grass cloth, sailcloth elseif (letterRed == 2 and trade:getItemCount() == 4 and trade:hasItemQty(761,1) and trade:hasItemQty(828,1) and trade:hasItemQty(1829,1) and trade:hasItemQty(1997,1)) then player:startEvent(755); -- accepts materials, now bring me imperial gold piece -- imperial gold piece elseif (letterRed == 3 and trade:getItemCount() == 1 and trade:hasItemQty(2187,1)) then player:startEvent(760); -- accepts gold piece, now wait for next vana'diel day end end; function onTrigger(player,npc) local letterRed = player:getVar("LeleroonsLetterRed"); if (player:hasKeyItem(LELEROONS_LETTER_RED)) then player:startEvent(753); -- accept letter, now bring me four items elseif (letterRed == 2) then player:startEvent(754); -- i'm waiting for four items elseif (letterRed == 3) then player:startEvent(761); -- i'm waiting for imperial gold piece elseif (letterRed == 4) then if (vanaDay() > player:getVar("corAfSubmitDay")) then player:startEvent(756); -- here's your cor frac else player:startEvent(757); -- patience. need to wait for vana'diel day end; elseif (letterRed == 5) then player:startEvent(758); -- are you caring for your corsair's frac? else player:startEvent(759); -- default dialog end; end; function onEventUpdate(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); end; function onEventFinish(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); if (csid == 753) then player:setVar("LeleroonsLetterRed", 2); player:delKeyItem(LELEROONS_LETTER_RED); elseif (csid == 755) then player:tradeComplete(); player:setVar("LeleroonsLetterRed", 3); elseif (csid == 760) then player:tradeComplete(); player:setVar("LeleroonsLetterRed", 4); player:setVar("corAfSubmitDay", vanaDay()); elseif (csid == 756) then player:setVar("LeleroonsLetterRed", 5); player:addItem(14522); -- corsair's frac player:messageSpecial(ITEM_OBTAINED,14522); end; end;
gpl-3.0
lasko2112/legend-of-hondo
MMOCoreORB/bin/scripts/object/static/structure/general/data_terminal_free_s1.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_static_structure_general_data_terminal_free_s1 = object_static_structure_general_shared_data_terminal_free_s1:new { } ObjectTemplates:addTemplate(object_static_structure_general_data_terminal_free_s1, "object/static/structure/general/data_terminal_free_s1.iff")
agpl-3.0
DailyShana/ygopro-scripts
c29401950.lua
3
2359
--奈落の落とし穴 function c29401950.initial_effect(c) --Activate(summon) local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_DESTROY+CATEGORY_REMOVE) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetTarget(c29401950.target) e1:SetOperation(c29401950.activate) c:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_DESTROY+CATEGORY_REMOVE) e2:SetType(EFFECT_TYPE_ACTIVATE) e2:SetCode(EVENT_FLIP_SUMMON_SUCCESS) e2:SetTarget(c29401950.target) e2:SetOperation(c29401950.activate) c:RegisterEffect(e2) local e3=Effect.CreateEffect(c) e3:SetCategory(CATEGORY_DESTROY+CATEGORY_REMOVE) e3:SetType(EFFECT_TYPE_ACTIVATE) e3:SetCode(EVENT_SPSUMMON_SUCCESS) e3:SetTarget(c29401950.target2) e3:SetOperation(c29401950.activate2) c:RegisterEffect(e3) end function c29401950.filter(c,tp,ep) return c:IsLocation(LOCATION_MZONE) and c:IsFaceup() and c:GetAttack()>=1500 and ep~=tp and c:IsDestructable() and c:IsAbleToRemove() end function c29401950.target(e,tp,eg,ep,ev,re,r,rp,chk) local tc=eg:GetFirst() if chk==0 then return c29401950.filter(tc,tp,ep) end Duel.SetTargetCard(eg) Duel.SetOperationInfo(0,CATEGORY_DESTROY,tc,1,0,0) Duel.SetOperationInfo(0,CATEGORY_REMOVE,tc,1,0,0) end function c29401950.activate(e,tp,eg,ep,ev,re,r,rp) local tc=eg:GetFirst() if tc and tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:GetAttack()>=1500 then Duel.Destroy(tc,REASON_EFFECT,LOCATION_REMOVED) end end function c29401950.filter2(c,tp) return c:IsLocation(LOCATION_MZONE) and c:IsFaceup() and c:GetAttack()>=1500 and c:GetSummonPlayer()~=tp and c:IsDestructable() and c:IsAbleToRemove() end function c29401950.target2(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return eg:IsExists(c29401950.filter2,1,nil,tp) end local g=eg:Filter(c29401950.filter2,nil,tp) Duel.SetTargetCard(eg) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),0,0) end function c29401950.filter3(c,e,tp) return c:IsFaceup() and c:GetAttack()>=1500 and c:GetSummonPlayer()~=tp and c:IsRelateToEffect(e) and c:IsLocation(LOCATION_MZONE) and c:IsDestructable() end function c29401950.activate2(e,tp,eg,ep,ev,re,r,rp) local g=eg:Filter(c29401950.filter3,nil,e,tp) if g:GetCount()>0 then Duel.Destroy(g,REASON_EFFECT,LOCATION_REMOVED) end end
gpl-2.0
lasko2112/legend-of-hondo
MMOCoreORB/bin/scripts/mobile/talus/aakuan_champion.lua
1
1265
aakuan_champion = Creature:new { objectName = "@mob/creature_names:aakuan_champion", randomNameType = NAME_GENERIC_TAG, socialGroup = "aakuans", faction = "aakuans", level = 30, chanceHit = 0.39, damageMin = 290, damageMax = 300, baseXp = 3097, baseHAM = 8400, baseHAMmax = 10200, armor = 0, resists = {30,30,0,0,-1,-1,0,-1,-1}, meatType = "", meatAmount = 0, hideType = "", hideAmount = 0, boneType = "", boneAmount = 0, milk = 0, tamingChance = 0, ferocity = 0, pvpBitmask = ATTACKABLE, creatureBitmask = PACK + KILLER, optionsBitmask = 128, diet = HERBIVORE, templates = { "object/mobile/dressed_aakuan_champion_zabrak_female_01.iff", "object/mobile/dressed_aakuan_champion_zabrak_male_01.iff"}, lootGroups = { { groups = { {group = "junk", chance = 6600000}, {group = "aakuan_common", chance = 2300000}, {group = "armor_attachments", chance = 200000}, {group = "rifles", chance = 300000}, {group = "carbines", chance = 300000}, {group = "pistols", chance = 300000} } } }, weapons = {"melee_weapons"}, conversationTemplate = "", reactionStf = "@npc_reaction/fancy", attacks = merge(brawlermaster,swordsmanmaster) } CreatureTemplates:addCreatureTemplate(aakuan_champion, "aakuan_champion")
agpl-3.0
DailyShana/ygopro-scripts
c27978707.lua
3
2793
--超重武者カゲボウ-C function c27978707.initial_effect(c) --special summon local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(27978707,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,27978707) e1:SetCost(c27978707.spcost) e1:SetTarget(c27978707.sptg) e1:SetOperation(c27978707.spop) c:RegisterEffect(e1) --negate local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(27978707,1)) e2:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_CHAINING) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e2:SetRange(LOCATION_GRAVE) e2:SetCountLimit(1,27978708) e2:SetCondition(c27978707.negcon) e2:SetCost(c27978707.negcost) e2:SetTarget(c27978707.negtg) e2:SetOperation(c27978707.negop) c:RegisterEffect(e2) end function c27978707.spcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsReleasable() end Duel.Release(e:GetHandler(),REASON_COST) end function c27978707.filter(c,e,tp) return c:IsSetCard(0x9a) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function c27978707.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1 and Duel.IsExistingMatchingCard(c27978707.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) end function c27978707.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,c27978707.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp) if g:GetCount()>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end function c27978707.negfilter(c,tp) return c:IsFaceup() and c:IsSetCard(0x9a) and c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) end function c27978707.negcon(e,tp,eg,ep,ev,re,r,rp) if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS) return g and g:IsExists(c27978707.negfilter,1,nil,tp) and Duel.IsChainNegatable(ev) end function c27978707.negcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST) end function c27978707.negtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0) if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0) end end function c27978707.negop(e,tp,eg,ep,ev,re,r,rp) Duel.NegateActivation(ev) if re:GetHandler():IsRelateToEffect(re) then Duel.Destroy(eg,REASON_EFFECT) end end
gpl-2.0
DailyShana/ygopro-scripts
c75425043.lua
3
3916
--PSYフレームギア・α function c75425043.initial_effect(c) c:EnableUnsummonable() --splimit local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetCode(EFFECT_SPSUMMON_CONDITION) e1:SetValue(c75425043.splimit) c:RegisterEffect(e1) --spsummon local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(75425043,0)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND+CATEGORY_SEARCH) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetRange(LOCATION_HAND) e2:SetCode(EVENT_SUMMON_SUCCESS) e2:SetCondition(c75425043.condition) e2:SetTarget(c75425043.target) e2:SetOperation(c75425043.operation) c:RegisterEffect(e2) local e3=e2:Clone() e3:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e3) end function c75425043.splimit(e,se,sp,st) return se:IsHasType(EFFECT_TYPE_ACTIONS) end function c75425043.cfilter(c,tp) return c:GetSummonPlayer()==tp end function c75425043.condition(e,tp,eg,ep,ev,re,r,rp) return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 and eg:IsExists(c75425043.cfilter,1,nil,1-tp) end function c75425043.spfilter1(c,e,tp) return c:IsCode(49036338) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.IsExistingMatchingCard(c75425043.thfilter,tp,LOCATION_DECK,0,1,c) end function c75425043.spfilter2(c,e,tp) return c:IsCode(49036338) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.IsExistingMatchingCard(c75425043.thfilter0,tp,LOCATION_DECK,0,1,c) end function c75425043.thfilter0(c) return c:IsSetCard(0xc1) and not c:IsCode(75425043) end function c75425043.thfilter(c) return c:IsSetCard(0xc1) and not c:IsCode(75425043) and c:IsAbleToHand() end function c75425043.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>1 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.IsExistingMatchingCard(c75425043.spfilter1,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function c75425043.operation(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 or not e:GetHandler():IsRelateToEffect(e) then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,c75425043.spfilter2,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp) if g:FilterCount(aux.nvfilter,nil)==0 then return end local tc=g:GetFirst() local c=e:GetHandler() local fid=c:GetFieldID() Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP) tc:RegisterFlagEffect(75425043,RESET_EVENT+0x1fe0000,0,1,fid) c:RegisterFlagEffect(75425043,RESET_EVENT+0x1fe0000,0,1,fid) Duel.SpecialSummonComplete() g:AddCard(c) g:KeepAlive() local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetCode(EVENT_PHASE+PHASE_END) e1:SetCountLimit(1) e1:SetLabel(fid) e1:SetLabelObject(g) e1:SetCondition(c75425043.rmcon) e1:SetOperation(c75425043.rmop) Duel.RegisterEffect(e1,tp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g2=Duel.SelectMatchingCard(tp,c75425043.thfilter,tp,LOCATION_DECK,0,1,1,nil) if g2:GetCount()>0 then Duel.SendtoHand(g2,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g2) end end function c75425043.rmfilter(c,fid) return c:GetFlagEffectLabel(75425043)==fid end function c75425043.rmcon(e,tp,eg,ep,ev,re,r,rp) local g=e:GetLabelObject() if not g:IsExists(c75425043.rmfilter,1,nil,e:GetLabel()) then g:DeleteGroup() e:Reset() return false else return true end end function c75425043.rmop(e,tp,eg,ep,ev,re,r,rp) local g=e:GetLabelObject() local tg=g:Filter(c75425043.rmfilter,nil,e:GetLabel()) Duel.Remove(tg,POS_FACEUP,REASON_EFFECT) end
gpl-2.0
DailyShana/ygopro-scripts
c3773196.lua
3
1481
--異次元の偵察機 function c3773196.initial_effect(c) --removed local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e1:SetCode(EVENT_REMOVE) e1:SetOperation(c3773196.rmop) c:RegisterEffect(e1) --special summon local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(3773196,0)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e2:SetCode(EVENT_PHASE+PHASE_END) e2:SetRange(LOCATION_REMOVED) e2:SetCondition(c3773196.condition) e2:SetTarget(c3773196.target) e2:SetOperation(c3773196.operation) c:RegisterEffect(e2) end function c3773196.rmop(e,tp,eg,ep,ev,re,r,rp) if e:GetHandler():IsFacedown() then return end e:GetHandler():RegisterFlagEffect(3773196,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1) end function c3773196.condition(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():GetFlagEffect(3773196)~=0 end function c3773196.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():GetFlagEffect(3773197)==0 end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) e:GetHandler():RegisterFlagEffect(3773197,RESET_PHASE+PHASE_END,0,1) end function c3773196.operation(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) then if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then Duel.SendtoGrave(e:GetHandler(),REASON_EFFECT) return end Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP_ATTACK) end end
gpl-2.0
lasko2112/legend-of-hondo
MMOCoreORB/bin/scripts/object/tangible/ship/attachment/weapon/blacksun_medium_weapon1_s03.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_attachment_weapon_blacksun_medium_weapon1_s03 = object_tangible_ship_attachment_weapon_shared_blacksun_medium_weapon1_s03:new { } ObjectTemplates:addTemplate(object_tangible_ship_attachment_weapon_blacksun_medium_weapon1_s03, "object/tangible/ship/attachment/weapon/blacksun_medium_weapon1_s03.iff")
agpl-3.0
zenyd/mpv-scripts
delete_file.lua
1
3392
local utils = require "mp.utils" require 'mp.options' options = {} options.MoveToFolder = false if package.config:sub(1,1) == "/" then options.DeletedFilesPath = utils.join_path(os.getenv("HOME"), "delete_file") ops = "unix" else options.DeletedFilesPath = utils.join_path(os.getenv("USERPROFILE"), "delete_file") ops = "win" end read_options(options) del_list = {} function createDirectory() if not utils.file_info(options.DeletedFilesPath) then if not os.execute(string.format('mkdir "%s"', options.DeletedFilesPath)) then print("failed to create folder") end end end function contains_item(l, i) for k, v in pairs(l) do if v == i then mp.osd_message("undeleting current file") l[k] = nil return true end end mp.osd_message("deleting current file") return false end function mark_delete() local work_dir = mp.get_property_native("working-directory") local file_path = mp.get_property_native("path") local s = file_path:find(work_dir, 0, true) local final_path if s and s == 0 then final_path = file_path else final_path = utils.join_path(work_dir, file_path) end if not contains_item(del_list, final_path) then table.insert(del_list, final_path) end end function delete() if options.MoveToFolder then --create folder if not exists createDirectory() end for i, v in pairs(del_list) do if options.MoveToFolder then print("moving: "..v) local _, file_name = utils.split_path(v) --this loop will add a number to the file name if it already exists in the directory --But limit the number of iterations for i = 1,100 do if i > 1 then if file_name:find("[.].+$") then file_name = file_name:gsub("([.].+)$", string.format("_%d%%1", i)) else file_name = string.format("%s_%d", file_name, i) end end local movedPath = utils.join_path(options.DeletedFilesPath, file_name) local fileInfo = utils.file_info(movedPath) if not fileInfo then os.rename(v, movedPath) break end end else print("deleting: "..v) os.remove(v) end end end function showList() local delString = "Delete Marks:\n" for _,v in pairs(del_list) do local dFile = v:gsub("/","\\") delString = delString..dFile:match("\\*([^\\]*)$").."; " end if delString:find(";") then mp.osd_message(delString) return delString elseif showListTimer then showListTimer:kill() end end showListTimer = mp.add_periodic_timer(1,showList) showListTimer:kill() function list_marks() if showListTimer:is_enabled() then showListTimer:kill() mp.osd_message("",0) else local delString = showList() if delString and delString:find(";") then showListTimer:resume() print(delString) else showListTimer:kill() end end end mp.add_key_binding("ctrl+DEL", "delete_file", mark_delete) mp.add_key_binding("alt+DEL", "list_marks", list_marks) mp.add_key_binding("ctrl+shift+DEL", "clear_list", function() mp.osd_message("Undelete all"); del_list = {}; end) mp.register_event("shutdown", delete)
gpl-3.0
DailyShana/ygopro-scripts
c47120245.lua
3
2288
--聖騎士ボールス function c47120245.initial_effect(c) --Normal monster local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetCode(EFFECT_ADD_TYPE) e1:SetRange(LOCATION_MZONE) e1:SetCondition(c47120245.eqcon1) e1:SetValue(TYPE_NORMAL) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_REMOVE_TYPE) e2:SetValue(TYPE_EFFECT) c:RegisterEffect(e2) --Attribute Dark local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE) e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e3:SetCode(EFFECT_CHANGE_ATTRIBUTE) e3:SetRange(LOCATION_MZONE) e3:SetCondition(c47120245.eqcon2) e3:SetValue(ATTRIBUTE_DARK) c:RegisterEffect(e3) local e4=e3:Clone() e4:SetCode(EFFECT_UPDATE_LEVEL) e4:SetValue(1) c:RegisterEffect(e4) --search local e5=Effect.CreateEffect(c) e5:SetDescription(aux.Stringid(47120245,0)) e5:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e5:SetType(EFFECT_TYPE_IGNITION) e5:SetRange(LOCATION_MZONE) e5:SetCountLimit(1,47120245) e5:SetCondition(c47120245.thcon) e5:SetTarget(c47120245.thtg) e5:SetOperation(c47120245.thop) c:RegisterEffect(e5) end function c47120245.eqcon1(e) return not e:GetHandler():GetEquipGroup():IsExists(Card.IsSetCard,1,nil,0x207a) end function c47120245.eqcon2(e) return e:GetHandler():GetEquipGroup():IsExists(Card.IsSetCard,1,nil,0x207a) end function c47120245.thcon(e,tp,eg,ep,ev,re,r,rp) return c47120245.eqcon2(e) end function c47120245.thfilter(c) return c:IsSetCard(0x207a) and c:IsAbleToHand() end function c47120245.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(c47120245.thfilter,tp,LOCATION_DECK,0,3,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,LOCATION_DECK) end function c47120245.thop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(Card.IsSetCard,tp,LOCATION_DECK,0,nil,0x207a) if g:GetCount()>=3 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local sg=g:Select(tp,3,3,nil) Duel.ConfirmCards(1-tp,sg) Duel.ShuffleDeck(tp) Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_ATOHAND) local tg=sg:Select(1-tp,1,1,nil) local tc=tg:GetFirst() if tc:IsAbleToHand() then Duel.SendtoHand(tc,nil,REASON_EFFECT) sg:RemoveCard(tc) end Duel.SendtoGrave(sg,REASON_EFFECT) end end
gpl-2.0
lasko2112/legend-of-hondo
MMOCoreORB/bin/scripts/object/mobile/dressed_force_trained_archaist.lua
3
2236
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version object_mobile_dressed_force_trained_archaist = object_mobile_shared_dressed_force_trained_archaist:new { } ObjectTemplates:addTemplate(object_mobile_dressed_force_trained_archaist, "object/mobile/dressed_force_trained_archaist.iff")
agpl-3.0
lasko2112/legend-of-hondo
MMOCoreORB/bin/scripts/mobile/faction/imperial/civil_patrol_commander.lua
2
1265
civil_patrol_commander = Creature:new { objectName = "@mob/creature_names:imperial_civil_patrol_commander", randomNameType = NAME_GENERIC_TAG, socialGroup = "imperial", faction = "imperial", level = 10, chanceHit = 0.28, damageMin = 90, damageMax = 110, baseXp = 356, baseHAM = 810, baseHAMmax = 990, armor = 0, resists = {0,0,0,0,0,0,0,-1,-1}, meatType = "", meatAmount = 0, hideType = "", hideAmount = 0, boneType = "", boneAmount = 0, milk = 0, tamingChance = 0, ferocity = 0, pvpBitmask = ATTACKABLE, creatureBitmask = PACK, optionsBitmask = 128, diet = HERBIVORE, templates = {"object/mobile/dressed_imperial_commander_m.iff"}, lootGroups = { { groups = { {group = "junk", chance = 4000000}, {group = "wearables_common", chance = 2000000}, {group = "rifles", chance = 1000000}, {group = "pistols", chance = 1000000}, {group = "melee_weapons", chance = 1000000}, {group = "carbines", chance = 1000000}, } } }, weapons = {"ranged_weapons"}, conversationTemplate = "", reactionStf = "@npc_reaction/military", personalityStf = "@hireling/hireling_military", attacks = merge(marksmannovice,brawlernovice) } CreatureTemplates:addCreatureTemplate(civil_patrol_commander, "civil_patrol_commander")
agpl-3.0
Rdamonster/devmonster
plugins/plugins.lua
1
7325
--[[ ▀▄ ▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀▄▀▄▄▀▀▄▄▀▀▄▄ ▀▄ ▄▀ ▀▄ ▄▀ ▀▄ ▄▀ BY monster ▀▄ ▄▀ ▀▄ ▄▀ (@Reda999) ▀▄ ▄▀ ▀▄ ▄▀ ▀▄ ▄▀ ▀▄ ▄▀ plugin : الملقات ▀▄ ▄▀ ▀▄▀▀▄▄▀▀▄▄▀▄▄▀▀▄▄▀▀▄▄▀▄▄▀▀▄▄▀▀▄▄▀▄▄▀▀▄▄▀ --]] do -- Returns the key (index) in the config.enabled_plugins table local function plugin_enabled( name ) for k,v in pairs(_config.enabled_plugins) do if name == v then return k end end -- If not found return false end -- Returns true if file exists in plugins folder local function plugin_exists( name ) for k,v in pairs(plugins_names()) do if name..'.lua' == v then return true end end return false end local function list_all_plugins(only_enabled) local text = '' local nsum = 0 for k, v in pairs( plugins_names( )) do -- ✅ enabled, 🚫❌ disabled local status = '🚫❌' nsum = nsum+1 nact = 0 -- Check if is enabled for k2, v2 in pairs(_config.enabled_plugins) do if v == v2..'.lua' then status = '✅' end nact = nact+1 end if not only_enabled or status == '✅' then -- get the name v = string.match (v, "(.*)%.lua") text = text..nsum..'. '..v..' '..status..'\n' end end local text = text..'\n آلہٰمہٰلہٰفہٰآتہٰ آلہٰمہٰثہٰبہٰتہٰةة 🔨. '..nsum..'\n آلہٰمہٰلہٰفہٰآتہٰ آلہٰمہٰفہٰعہٰلہٰةة ☑️ .'..nact..'\nآلہٰمہٰلہٰفہٰآتہٰ آلہٰغہٰيہٰر مہٰفہٰعہٰلہٰةة 🚫❌ '..nsum-nact..'' return text end local function list_plugins(only_enabled) local text = '' local nsum = 0 for k, v in pairs( plugins_names( )) do -- ✅ enabled,🚫 ❌ disabled local status = '❌🚫' nsum = nsum+1 nact = 0 -- Check if is enabled for k2, v2 in pairs(_config.enabled_plugins) do if v == v2..'.lua' then status = '☑️' end nact = nact+1 end if not only_enabled or status == '☑️' then -- get the name v = string.match (v, "(.*)%.lua") text = text..v..' '..status..'\n' end end local text = text..'\n'..nact..' plugins enabled from '..nsum..' plugins installed.' return text end local function reload_plugins( ) plugins = {} load_plugins() return list_plugins(true) end local function enable_plugin( plugin_name ) print('checking if '..plugin_name..' exists') -- Check if plugin is enabled if plugin_enabled(plugin_name) then return 'آلہٰملہٰفہٰ 📙 '..plugin_name..' مہٰفہٰعہٰل 🤖☑️' end -- Checks if plugin exists if plugin_exists(plugin_name) then -- Add to the config table table.insert(_config.enabled_plugins, plugin_name) print(plugin_name..' added to _config table') save_config() -- Reload the plugins return reload_plugins( ) else return ''..plugin_name..' لآ يہٰوجہٰد مہٰلہٰف 📓بہٰهہٰذا ألآسہٰم 🤖🍷' end end local function disable_plugin( name, chat ) -- Check if plugins exists if not plugin_exists(name) then return ''..name..' لآ يہٰوجہٰد مہٰلہٰف 📓بہٰهہٰذا ألآسہٰم 🤖🍷 ' end local k = plugin_enabled(name) -- Check if plugin is enabled if not k then return 'آلہٰملہٰفہٰ 🗂 '..name..' غہٰيہٰر مہٰفہٰعہٰل 🖖🏼⁉️❎' end -- Disable and reload table.remove(_config.enabled_plugins, k) save_config( ) return reload_plugins(true) end local function disable_plugin_on_chat(receiver, plugin) if not plugin_exists(plugin) then return "Plugin doesn't exists" end if not _config.disabled_plugin_on_chat then _config.disabled_plugin_on_chat = {} end if not _config.disabled_plugin_on_chat[receiver] then _config.disabled_plugin_on_chat[receiver] = {} end _config.disabled_plugin_on_chat[receiver][plugin] = true save_config() return 'Plugin '..plugin..' disabled on this chat' end local function reenable_plugin_on_chat(receiver, plugin) if not _config.disabled_plugin_on_chat then return 'There aren\'t any disabled plugins' end if not _config.disabled_plugin_on_chat[receiver] then return 'There aren\'t any disabled plugins for this chat' end if not _config.disabled_plugin_on_chat[receiver][plugin] then return 'This plugin is not disabled' end _config.disabled_plugin_on_chat[receiver][plugin] = false save_config() return 'Plugin '..plugin..' is enabled again' end local function ii02ii(msg, matches) -- Show the available plugins if matches[1] == 'الملفات' and is_sudo(msg) then --after changed to moderator mode, set only sudo return list_all_plugins() end -- Re-enable a plugin for this chat if matches[1] == 'تفعيل ملف' and matches[3] == 'chat' then local receiver = get_receiver(msg) local plugin = matches[2] print("enable "..plugin..' on this chat') return reenable_plugin_on_chat(receiver, plugin) end -- Enable a plugin if matches[1] == 'تفعيل ملف' and is_sudo(msg) then --after changed to moderator mode, set only sudo local plugin_name = matches[2] print("enable: "..matches[2]) return enable_plugin(plugin_name) end -- Disable a plugin on a chat if matches[1] == 'تعطيل ملف' and matches[3] == 'chat' then local plugin = matches[2] local receiver = get_receiver(msg) print("disable "..plugin..' on this chat') return disable_plugin_on_chat(receiver, plugin) end -- Disable a plugin if matches[1] == 'تعطيل ملف' and is_sudo(msg) then --after changed to moderator mode, set only sudo if matches[2] == 'plugins' then return 'This plugin can\'t be disabled' end print("disable: "..matches[2]) return disable_plugin(matches[2]) end -- Reload all the plugins! if matches[1] == 'الملفات المفعله' and is_sudo(msg) then --after changed to moderator mode, set only sudo return reload_plugins(true) end end return { description = "Plugin to manage other plugins. Enable, disable or reload.", usage = { moderator = { "!plugins disable [plugin] chat : disable plugin only this chat.", "!plugins enable [plugin] chat : enable plugin only this chat.", }, sudo = { "!plugins : list all plugins.", "!plugins enable [plugin] : enable plugin.", "!plugins disable [plugin] : disable plugin.", "!plugins reload : reloads all plugins." }, }, patterns = { "^الملفات$", "^(تفعيل ملف) ([%w_%.%-]+)$", "^(تعطيل ملف) ([%w_%.%-]+)$", "^(تفعيل ملف) ([%w_%.%-]+) (chat)", "^(تعطيل ملف) ([%w_%.%-]+) (chat)", "^(الملفات المفعله)$" }, run = ii02ii, moderated = true, -- set to moderator mode --privileged = true } end
gpl-2.0
AndyClausen/PNRP_HazG
postnukerp/Gamemode/items/munitions_code/fas2_pistol_rounds/fas2_ammo_380acp.lua
1
1032
local ITEM = {} ITEM.ID = "fas2_ammo_380acp" ITEM.Name = ".380 ACP" ITEM.ClassSpawn = "Engineer" ITEM.Scrap = 20 ITEM.Small_Parts = 2 ITEM.Chemicals = 20 ITEM.Chance = 100 ITEM.Info = "The .380 ACP cartridge was designed for early blowback pistols which lacked a barrel locking mechanism." ITEM.Type = "ammo" ITEM.Remove = true ITEM.Energy = 20 ITEM.Ent = "fas2_ammo_380acp" ITEM.Model = "models/stalker/ammo/357.mdl" ITEM.Script = "" ITEM.Weight = 2 function ITEM.ToolCheck( p ) return true end function ITEM.Use( ply ) local ammoType = ITEM.ID ply:GiveAmmo(ITEM.Energy, ammoType) return true end function ITEM.ToolCheck( p ) return {["intm_Smokelesspowder"]=1, ["intm_Pistolprimers"]=1, ["intm_Munitionspress"]=0, ["intm_ImprovisedMunitionsHandbook"]=0} end function ITEM.Create( ply, class, pos ) local ent = ents.Create(class) ent:SetAngles(Angle(0,0,0)) ent:SetPos(pos) ent:Spawn() ent:SetNetworkedString("Ammo", tostring(ITEM.Energy)) end PNRP.AddItem(ITEM)
gpl-3.0
iamalbert/znn
CrossEntropyCriterion.lua
1
1081
local CrossEntropyCriterion, Criterion = torch.class('znn.CrossEntropyCriterion', 'nn.Criterion') function CrossEntropyCriterion:__init(weights) Criterion.__init(self) self.lsm = nn.LogSoftMax() self.nll = nn.ClassNLLCriterion(weights) end function CrossEntropyCriterion:updateOutput(input, target) if input:dim() > 1 then input = input:view(-1, input:size( input:dim() ) ) end target = type(target) == 'number' and target or target:view(-1) self.lsm:updateOutput(input) self.nll:updateOutput(self.lsm.output, target) self.output = self.nll.output return self.output end function CrossEntropyCriterion:updateGradInput(input, target) local size = input:size() if input:dim() > 1 then input = input:view(-1, input:size( input:dim() ) ) end target = type(target) == 'number' and target or target:view(-1) self.nll:updateGradInput(self.lsm.output, target) self.lsm:updateGradInput(input, self.nll.gradInput) self.gradInput:view(self.lsm.gradInput, size) return self.gradInput end return nn.CrossEntropyCriterion
bsd-3-clause
DailyShana/ygopro-scripts
c52875873.lua
3
2137
--エヴォリューション・バースト function c52875873.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_DESTROY) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCondition(c52875873.condition) e1:SetCost(c52875873.cost) e1:SetTarget(c52875873.target) e1:SetOperation(c52875873.activate) c:RegisterEffect(e1) if not c52875873.global_check then c52875873.global_check=true local ge1=Effect.CreateEffect(c) ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) ge1:SetCode(EVENT_ATTACK_ANNOUNCE) ge1:SetOperation(c52875873.checkop) Duel.RegisterEffect(ge1,0) end end function c52875873.checkop(e,tp,eg,ep,ev,re,r,rp) local tc=eg:GetFirst() if tc:IsCode(70095154) then Duel.RegisterFlagEffect(tc:GetControler(),52875873,RESET_PHASE+PHASE_END,0,1) end end function c52875873.cfilter(c) return c:IsFaceup() and c:IsCode(70095154) end function c52875873.condition(e,tp,eg,ep,ev,re,r,rp) return Duel.IsExistingMatchingCard(c52875873.cfilter,tp,LOCATION_ONFIELD,0,1,nil) end function c52875873.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetFlagEffect(tp,52875873)==0 end local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE) e1:SetProperty(EFFECT_FLAG_OATH) e1:SetTarget(aux.TargetBoolFunction(Card.IsCode,70095154)) e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE) e1:SetReset(RESET_PHASE+RESET_END) Duel.RegisterEffect(e1,tp) end function c52875873.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and chkc:IsDestructable() end if chk==0 then return Duel.IsExistingTarget(Card.IsDestructable,tp,0,LOCATION_ONFIELD,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,Card.IsDestructable,tp,0,LOCATION_ONFIELD,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) end function c52875873.activate(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.Destroy(tc,REASON_EFFECT) end end
gpl-2.0
lasko2112/legend-of-hondo
MMOCoreORB/bin/scripts/object/mobile/dressed_lasha_bindari.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_lasha_bindari = object_mobile_shared_dressed_lasha_bindari:new { } ObjectTemplates:addTemplate(object_mobile_dressed_lasha_bindari, "object/mobile/dressed_lasha_bindari.iff")
agpl-3.0