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 |
|---|---|---|---|---|---|
davidedmonds/darkstar | scripts/zones/Mine_Shaft_2716/npcs/_0d0.lua | 17 | 1997 | -----------------------------------
-- Area: Mine_Shaft_2716
-- NPC: Shaft entrance
-----------------------------------
package.loaded["scripts/zones/Mine_Shaft_2716/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/bcnm");
require("scripts/globals/quests");
require("scripts/globals/missions");
require("scripts/zones/Mine_Shaft_2716/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
if (player:getCurrentMission(COP) == THREE_PATHS and ( player:getVar("COP_Louverance_s_Path") == 7 or player:getVar("COP_Louverance_s_Path") == 8 )) then
if (trade:getItemCount() == 1 and trade:hasItemQty(1684,1)) then
player:startEvent(0x0003);
end
elseif (TradeBCNM(player,player:getZoneID(),trade,npc)) then
return;
end
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
if (player:getCurrentMission(COP) ==FIRE_IN_THE_EYES_OF_MEN and player:getVar("PromathiaStatus")==0) then
player:startEvent(0x0004);
elseif (EventTriggerBCNM(player,npc)) then
end
return 1;
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
--printf("onUpdate CSID: %u",csid);
--printf("onUpdate RESULT: %u",option);
if (EventUpdateBCNM(player,csid,option)) then
return;
end
end;
-----------------------------------
-- onEventFinish Action
-----------------------------------
function onEventFinish(player,csid,option)
--printf("onFinish CSID: %u",csid);
--printf("onFinish RESULT: %u",option);
if (csid ==0x0003) then
player:setVar("COP_Louverance_s_Path",9);
player:tradeComplete();
elseif (csid ==0x0004) then
player:setVar("PromathiaStatus",1);
elseif (EventFinishBCNM(player,csid,option)) then
return;
end
end; | gpl-3.0 |
davidedmonds/darkstar | scripts/zones/Temenos/bcnms/Central_Temenos_3rd_Floor.lua | 19 | 1076 | -----------------------------------
-- Area: Temenos
-- Name:
-----------------------------------
-- After registering the BCNM via bcnmRegister(bcnmid)
function onBcnmRegister(player,instance)
SetServerVariable("[C_Temenos_3rd]UniqueID",GenerateLimbusKey());
HideArmouryCrates(GetInstanceRegion(1305),TEMENOS);
HideTemenosDoor(GetInstanceRegion(1305));
player:setVar("Limbus_Trade_Item-T",0);
end;
-- Physically entering the BCNM via bcnmEnter(bcnmid)
function onBcnmEnter(player,instance)
player:setVar("limbusbitmap",0);
player:setVar("characterLimbusKey",GetServerVariable("[C_Temenos_3rd]UniqueID"));
player:setVar("LimbusID",1305);
player:delKeyItem(COSMOCLEANSE);
player:delKeyItem(WHITE_CARD);
end;
-- Leaving by every mean possible, given by the LeaveCode
-- 3=Disconnected or warped out (if dyna is empty: launch 4 after 3)
-- 4=Finish he dynamis
function onBcnmLeave(player,instance,leavecode)
--print("leave code "..leavecode);
if (leavecode == 4) then
player:setPos(580,-1.5,4.452,192);
ResetPlayerLimbusVariable(player)
end
end; | gpl-3.0 |
waterlgndx/darkstar | scripts/zones/Port_Jeuno/npcs/_6u8.lua | 2 | 1123 | -----------------------------------
-- Area: Port Jeuno
-- NPC: Door: Departures Exit (for Kahzam)
-- @zone 246
-- !pos -12 8 54
-----------------------------------
package.loaded["scripts/zones/Port_Jeuno/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/settings");
require("scripts/globals/keyitems");
require("scripts/zones/Port_Jeuno/TextIDs");
-----------------------------------
function onTrade(player,npc,trade)
end;
function onTrigger(player,npc)
KazhPass = player:hasKeyItem(dsp.ki.AIRSHIP_PASS_FOR_KAZHAM);
Gil = player:getGil();
if (KazhPass == false) then
player:startEvent(35); -- without pass
elseif (KazhPass == true and Gil < 200) then
player:startEvent(45); -- Pass without money
elseif (KazhPass == true) then
player:startEvent(37); -- Pass with money
end
return 1;
end;
function onEventUpdate(player,csid,option)
end;
function onEventFinish(player,csid,option)
if (csid == 37) then
Z = player:getZPos();
if (Z >= 58 and Z <= 61) then
player:delGil(200);
end
end
end; | gpl-3.0 |
MonokuroInzanaito/ygopro-777DIY | expansions/script/c33700023.lua | 1 | 1341 | --琪比摩斯
function c33700023.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_BEAST),2,2,c33700023.ovfilter,aux.Stringid(33700023,0))
c:EnableReviveLimit()
--chain attack
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(33700023,1))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetCode(EVENT_BATTLE_DESTROYING)
e1:SetCost(c33700023.cost)
e1:SetTarget(c33700023.attg)
e1:SetOperation(c33700023.atop)
c:RegisterEffect(e1)
end
function c33700023.ovfilter(c)
return c:IsFaceup() and c:IsSetCard(0x6440) and c:IsType(TYPE_MONSTER)
end
function c33700023.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c33700023.attg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsChainAttackable(0) end
end
function c33700023.atop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsFaceup() and e:GetHandler():IsRelateToBattle() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(800)
e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END)
e:GetHandler():RegisterEffect(e1)
end
Duel.ChainAttack()
end | gpl-3.0 |
kidaa/darkstar | scripts/globals/weaponskills/skullbreaker.lua | 30 | 1486 | -----------------------------------
-- Skullbreaker
-- Club weapon skill
-- Skill level: 150
-- Lowers enemy's INT. Chance of lowering INT 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)
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;
local damage, criticalHit, tpHits, extraHits = doPhysicalWeaponskill(player, target, params);
if (USE_ADOULIN_WEAPON_SKILL_CHANGES == true) then
params.str_wsc = 1.0;
end
if damage > 0 and (target:hasStatusEffect(EFFECT_INT_DOWN) == false) then
target:addStatusEffect(EFFECT_INT_DOWN, 10, 0, 140);
end
damage = damage * WEAPON_SKILL_POWER
return tpHits, extraHits, criticalHit, damage;
end
| gpl-3.0 |
kidaa/darkstar | scripts/zones/Cloister_of_Gales/mobs/Ogmios.lua | 12 | 1272 | -----------------------------------
-- Area: Cloister of Gales
-- NPC: Ogmios
-- Involved in Quest: Carbuncle Debacle
-----------------------------------
require("scripts/globals/settings");
require("scripts/globals/keyitems");
-----------------------------------
-- OnMobSpawn Action
-----------------------------------
function onMobSpawn(mob)
end;
-----------------------------------
-- OnMobDeath Action
-----------------------------------
function onMobDeath(mob,killer)
killer:setVar("BCNM_Killed",1);
record = 300;
partyMembers = 6;
pZone = killer:getZoneID();
killer:startEvent(0x7d01,0,record,0,(os.time() - killer:getVar("BCNM_Timer")),partyMembers,0,0);
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
--printf("onUpdate CSID: %u",csid);
--printf("onUpdate RESULT: %u",option);
if(csid == 0x7d01) then
player:delStatusEffect(EFFECT_BATTLEFIELD);
end
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
--printf("onFinish CSID: %u",csid);
--printf("onFinish RESULT: %u",option);
if(csid == 0x7d01) then
player:delKeyItem(DAZEBREAKER_CHARM);
end
end;
| gpl-3.0 |
waterlgndx/darkstar | scripts/zones/La_Theine_Plateau/TextIDs.lua | 2 | 2566 | -- Variable TextID Description text
-- General Texts
ITEM_CANNOT_BE_OBTAINED = 6381; -- You cannot obtain the item <item>. Come back after sorting your inventory.
ITEM_OBTAINED = 6387; -- Obtained: <item>.
GIL_OBTAINED = 6388; -- Obtained <number> gil.
KEYITEM_OBTAINED = 6390; -- Obtained key item: <keyitem>.
FISHING_MESSAGE_OFFSET = 7211; -- You can't fish here.
NOTHING_HAPPENS = 119; -- Nothing happens...
-- Other Texts
ALREADY_OBTAINED_TELE = 7207; -- You already possess the gate crystal for this telepoint.
TELEPOINT_HAS_BEEN_SHATTERED = 7750; -- The telepoint has been shattered into a thousand pieces...
CHOCOBO_TRACKS = 7882; -- There are chocobo tracks on the ground here.
-- Quest Dialogs
UNLOCK_SUMMONER = 7570; -- You can now become a summoner.
UNLOCK_CARBUNCLE = 7571; -- You can now summon Carbuncle.
-- Mission Dialogs
RESCUE_DRILL = 7383; -- Rescue drills in progress. Try to stay out of the way.
-- General Dialogs
FAURBELLANT_1 = 7423; -- Greetings. traveler. Sorry, I've little time to chat. I must focus on my prayer.
FAURBELLANT_2 = 7424; -- Thank you for making such a long journey to bring this! May the Gates of Paradise open to all.
FAURBELLANT_3 = 7425; -- Please deliver thatto the high priest in the San d'Oria Cathedral.
FAURBELLANT_4 = 7426; -- My thanks again for your services. May the Gates of Paradise open to all.
-- ZM4 Dialog
CANNOT_REMOVE_FRAG = 7585; -- It is an oddly shaped stone monument. A shining stone is embedded in it, but cannot be removed...
ALREADY_OBTAINED_FRAG = 7586; -- You have already obtained this monument's . Try searching for another.
ALREADY_HAVE_ALL_FRAGS = 7587; -- You have obtained all of the fragments. You must hurry to the ruins of the ancient shrine!
FOUND_ALL_FRAGS = 7588; -- You have obtained ! You now have all 8 fragments of light!
ZILART_MONUMENT = 7589; -- It is an ancient Zilart monument.
-- conquest Base
CONQUEST_BASE = 7048; -- Tallying conquest results...
--chocobo digging
DIG_THROW_AWAY = 7224; -- You dig up$, but your inventory is full. You regretfully throw the # away.
FIND_NOTHING = 7226; -- You dig and you dig, but find nothing.
-- FallenEgg
BROKEN_EGG = 7821; -- There is a broken egg on the ground here. Perhaps there is a nest in the boughs of this tree.
| gpl-3.0 |
davidedmonds/darkstar | scripts/globals/spells/poisonga_iii.lua | 18 | 1103 | -----------------------------------------
-- Spell: Poisonga III
-----------------------------------------
require("scripts/globals/status");
require("scripts/globals/magic");
-----------------------------------------
-- OnSpellCast
-----------------------------------------
function onMagicCastingCheck(caster,target,spell)
return 0;
end;
function onSpellCast(caster,target,spell)
local effect = EFFECT_POISON;
local duration = 180;
local pINT = caster:getStat(MOD_INT);
local mINT = target:getStat(MOD_INT);
local dINT = (pINT - mINT);
local power = caster:getSkillLevel(ENFEEBLING_MAGIC_SKILL) / 10 + 1;
if power > 25 then
power = 25;
end
local resist = applyResistanceEffect(caster,spell,target,dINT,ENFEEBLING_MAGIC_SKILL,0,effect);
if (resist == 1 or resist == 0.5) then -- effect taken
duration = duration * resist;
if (target:addStatusEffect(effect,power,3,duration)) then
spell:setMsg(236);
else
spell:setMsg(75);
end
else -- resist entirely.
spell:setMsg(85);
end
return effect;
end; | gpl-3.0 |
asasasasasasas11/uzzbot | plugins/danbooru.lua | 616 | 1750 | do
local URL = "http://danbooru.donmai.us"
local URL_NEW = "/posts.json"
local URL_POP = "/explore/posts/popular.json"
local scale_day = "?scale=day"
local scale_week = "?scale=week"
local scale_month = "?scale=month"
local function get_post(url)
local b, c, h = http.request(url)
if c ~= 200 then return nil end
local posts = json:decode(b)
return posts[math.random(#posts)]
end
local function run(msg, matches)
local url = URL
if matches[1] == "!danbooru" then
url = url .. URL_NEW
else
url = url .. URL_POP
if matches[1] == "d" then
url = url .. scale_day
elseif matches[1] == "w" then
url = url .. scale_week
elseif matches[1] == "m" then
url = url .. scale_month
end
end
local post = get_post(url)
if post then
vardump(post)
local img = URL .. post.large_file_url
send_photo_from_url(get_receiver(msg), img)
local txt = ''
if post.tag_string_artist ~= '' then
txt = 'Artist: ' .. post.tag_string_artist .. '\n'
end
if post.tag_string_character ~= '' then
txt = txt .. 'Character: ' .. post.tag_string_character .. '\n'
end
if post.file_size ~= '' then
txt = txt .. '[' .. math.ceil(post.file_size/1000) .. 'kb] ' .. URL .. post.file_url
end
return txt
end
end
return {
description = "Gets a random fresh or popular image from Danbooru",
usage = {
"!danbooru - gets a random fresh image from Danbooru 🔞",
"!danboorud - random daily popular image 🔞",
"!danbooruw - random weekly popular image 🔞",
"!danboorum - random monthly popular image 🔞"
},
patterns = {
"^!danbooru$",
"^!danbooru ?(d)$",
"^!danbooru ?(w)$",
"^!danbooru ?(m)$"
},
run = run
}
end | gpl-2.0 |
bamdad1381/TeleSeed | plugins/Danbooru.lua | 616 | 1750 | do
local URL = "http://danbooru.donmai.us"
local URL_NEW = "/posts.json"
local URL_POP = "/explore/posts/popular.json"
local scale_day = "?scale=day"
local scale_week = "?scale=week"
local scale_month = "?scale=month"
local function get_post(url)
local b, c, h = http.request(url)
if c ~= 200 then return nil end
local posts = json:decode(b)
return posts[math.random(#posts)]
end
local function run(msg, matches)
local url = URL
if matches[1] == "!danbooru" then
url = url .. URL_NEW
else
url = url .. URL_POP
if matches[1] == "d" then
url = url .. scale_day
elseif matches[1] == "w" then
url = url .. scale_week
elseif matches[1] == "m" then
url = url .. scale_month
end
end
local post = get_post(url)
if post then
vardump(post)
local img = URL .. post.large_file_url
send_photo_from_url(get_receiver(msg), img)
local txt = ''
if post.tag_string_artist ~= '' then
txt = 'Artist: ' .. post.tag_string_artist .. '\n'
end
if post.tag_string_character ~= '' then
txt = txt .. 'Character: ' .. post.tag_string_character .. '\n'
end
if post.file_size ~= '' then
txt = txt .. '[' .. math.ceil(post.file_size/1000) .. 'kb] ' .. URL .. post.file_url
end
return txt
end
end
return {
description = "Gets a random fresh or popular image from Danbooru",
usage = {
"!danbooru - gets a random fresh image from Danbooru 🔞",
"!danboorud - random daily popular image 🔞",
"!danbooruw - random weekly popular image 🔞",
"!danboorum - random monthly popular image 🔞"
},
patterns = {
"^!danbooru$",
"^!danbooru ?(d)$",
"^!danbooru ?(w)$",
"^!danbooru ?(m)$"
},
run = run
}
end | gpl-2.0 |
elyasgalikeshi/renjer-bot | plugins/danbooru.lua | 616 | 1750 | do
local URL = "http://danbooru.donmai.us"
local URL_NEW = "/posts.json"
local URL_POP = "/explore/posts/popular.json"
local scale_day = "?scale=day"
local scale_week = "?scale=week"
local scale_month = "?scale=month"
local function get_post(url)
local b, c, h = http.request(url)
if c ~= 200 then return nil end
local posts = json:decode(b)
return posts[math.random(#posts)]
end
local function run(msg, matches)
local url = URL
if matches[1] == "!danbooru" then
url = url .. URL_NEW
else
url = url .. URL_POP
if matches[1] == "d" then
url = url .. scale_day
elseif matches[1] == "w" then
url = url .. scale_week
elseif matches[1] == "m" then
url = url .. scale_month
end
end
local post = get_post(url)
if post then
vardump(post)
local img = URL .. post.large_file_url
send_photo_from_url(get_receiver(msg), img)
local txt = ''
if post.tag_string_artist ~= '' then
txt = 'Artist: ' .. post.tag_string_artist .. '\n'
end
if post.tag_string_character ~= '' then
txt = txt .. 'Character: ' .. post.tag_string_character .. '\n'
end
if post.file_size ~= '' then
txt = txt .. '[' .. math.ceil(post.file_size/1000) .. 'kb] ' .. URL .. post.file_url
end
return txt
end
end
return {
description = "Gets a random fresh or popular image from Danbooru",
usage = {
"!danbooru - gets a random fresh image from Danbooru 🔞",
"!danboorud - random daily popular image 🔞",
"!danbooruw - random weekly popular image 🔞",
"!danboorum - random monthly popular image 🔞"
},
patterns = {
"^!danbooru$",
"^!danbooru ?(d)$",
"^!danbooru ?(w)$",
"^!danbooru ?(m)$"
},
run = run
}
end | gpl-2.0 |
will4wachter/Project1 | scripts/globals/spells/sneak.lua | 6 | 1175 | -----------------------------------------
-- Spell: Sneak
-- Lessens chance of being detected by sound
-- Duration is random number between 30 seconds and 5 minutes
-----------------------------------------
require("scripts/globals/settings");
require("scripts/globals/status");
-----------------------------------------
-- OnSpellCast
-----------------------------------------
function OnMagicCastingCheck(caster,target,spell)
return 0;
end;
function onSpellCast(caster,target,spell)
if (target:hasStatusEffect(EFFECT_SNEAK) == false) then
local duration = math.random(30, 300);
if (caster:hasStatusEffect(EFFECT_COMPOSURE) == true and caster:getID() == target:getID()) then
duration = duration * 3;
end
if (target:getMainLvl() < 20) then
duration = duration * target:getMainLvl() / 20; -- level adjustment
end
if (target:getEquipID(SLOT_BACK) == 13692) then -- skulker's cape
duration = duration * 1.5;
end
spell:setMsg(230);
target:addStatusEffect(EFFECT_SNEAK,0,10,(math.floor(duration) * SNEAK_INVIS_DURATION_MULTIPLIER));
else
spell:setMsg(75); -- no effect.
end
return EFFECT_SNEAK;
end;
| gpl-3.0 |
davidedmonds/darkstar | scripts/zones/La_Theine_Plateau/npcs/Augevinne.lua | 17 | 1569 | -----------------------------------
-- Area: La Theine Plateau
-- NPC: Augevinne
-- Involved in Mission: The Rescue Drill
-- @pos -361 39 266 102
-----------------------------------
package.loaded["scripts/zones/La_Theine_Plateau/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/missions");
require("scripts/zones/La_Theine_Plateau/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
if (player:getCurrentMission(SANDORIA) == THE_RESCUE_DRILL) then
local MissionStatus = player:getVar("MissionStatus");
if (MissionStatus >= 5 and MissionStatus <= 7) then
player:startEvent(0x0067);
elseif (MissionStatus == 8) then
player:showText(npc, RESCUE_DRILL + 21);
elseif (MissionStatus >= 9) then
player:showText(npc, RESCUE_DRILL + 26);
else
player:showText(npc, RESCUE_DRILL);
end
else
player:showText(npc, RESCUE_DRILL);
end
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish Action
-----------------------------------
function onEventFinish(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end;
| gpl-3.0 |
davidedmonds/darkstar | scripts/zones/Windurst_Walls/npcs/Tsuaora-Tsuora.lua | 38 | 1043 | -----------------------------------
-- Area: Windurst Walls
-- NPC: Tsuaora-Tsuora
-- Type: Standard NPC
-- @zone: 239
-- @pos 71.489 -3.418 -67.809
--
-- Auto-Script: Requires Verification (Verfied by Brawndo)
-----------------------------------
package.loaded["scripts/zones/Windurst_Walls/TextIDs"] = nil;
-----------------------------------
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
player:startEvent(0x002a);
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
| gpl-3.0 |
lhog/Zero-K | LuaRules/Gadgets/unit_nanoframe_death.lua | 6 | 4602 |
function gadget:GetInfo()
return {
name = "Nano Frame Death Handeling",
desc = "Makes nanoframes explode if above X% completion and makes dying nanoframes leave wrecks.",
author = "Google Frog",
date = "Mar 29, 2009",
license = "GNU GPL, v2 or later",
layer = -10,
enabled = true
}
end
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
if (not gadgetHandler:IsSyncedCode()) then
return false -- no unsynced code
end
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- Speedups
local spGetUnitHealth = Spring.GetUnitHealth
local spGetUnitPosition = Spring.GetUnitPosition
local spGetUnitBuildFacing = Spring.GetUnitBuildFacing
local spSetFeatureHealth = Spring.SetFeatureHealth
local spSetFeatureReclaim = Spring.SetFeatureReclaim
local spGetGroundHeight = Spring.GetGroundHeight
local spCreateFeature = Spring.CreateFeature
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
local unitFromFactory = {}
local isAFactory = {}
function gadget:UnitCreated(unitID,unitDefID,_,builderID)
local ud = UnitDefs[unitDefID]
if ud and ud.isFactory then
isAFactory[unitID] = true
end
if builderID and isAFactory[builderID] then
unitFromFactory[unitID] = true
end
end
local function ScrapUnit(unitID, unitDefID, team, progress, face)
if (unitDefID and UnitDefs[unitDefID] and UnitDefs[unitDefID].wreckName and FeatureDefNames[UnitDefs[unitDefID].wreckName]) then
local wreck = FeatureDefNames[UnitDefs[unitDefID].wreckName].id
if (wreck and FeatureDefs[wreck]) then
local nextWreck = FeatureDefs[wreck].deathFeatureID
if nextWreck and FeatureDefs[nextWreck] then
wreck = FeatureDefs[wreck].deathFeatureID
if progress < 0.5 then
nextWreck = FeatureDefs[wreck].deathFeatureID
if nextWreck and FeatureDefs[nextWreck] then
wreck = FeatureDefs[wreck].deathFeatureID
progress = progress * 2
end
end
end
local x, _, z = spGetUnitPosition(unitID)
local y = spGetGroundHeight(x, z)
if (progress == 0) then
progress = 0.001
end
local allyTeam = select(6, Spring.GetTeamInfo(team, false))
local featureID = spCreateFeature(wreck, x, y, z, face, allyTeam)
if featureID then
Spring.TransferFeature(featureID, team)
local currentMetal = progress * FeatureDefs[wreck].metal
if Spring.SetFeatureResources then -- 103.0 non-dev version compat
Spring.SetFeatureResources(featureID, currentMetal, 0, currentMetal, progress)
else
spSetFeatureReclaim(featureID, progress)
end
spSetFeatureHealth(featureID, progress * FeatureDefs[wreck].maxHealth)
else
Spring.Echo("No featureID", wreck)
end
end
end
end
local spawnProjPos = {1, 2, 3}
local spawnProjTable = {ttl = 1, pos = spawnProjPos}
function gadget:UnitDestroyed(unitID, unitDefID, unitTeam)
local health, _,_,_,progress = spGetUnitHealth(unitID)
if (progress == 1) or (health > 0 and unitFromFactory[unitID]) or GG.wasMorphedTo[unitID] then
isAFactory[unitID] = nil
unitFromFactory[unitID] = nil
return
end
local ud = UnitDefs[unitDefID]
local face = (spGetUnitBuildFacing(unitID) or 1)
local noWreck = Spring.GetUnitRulesParam(unitID, "noWreck") == 1 -- set by api_saveload to clear stuff from factories
if (progress > 0.8 and not noWreck) then
local explodeAs = ud.deathExplosion
if explodeAs then
local wd = WeaponDefNames[explodeAs]
if wd then
local _,_,_,x,y,z = spGetUnitPosition(unitID, true)
spawnProjPos[1] = x
spawnProjPos[2] = y
spawnProjPos[3] = z
local projId = Spring.SpawnProjectile(wd.id, spawnProjTable)
--Spring.SetProjectileCollision(projId) <- in case ttl = 1 does not work
end
end
end
if (progress > 0.05 and not noWreck) then
ScrapUnit(unitID, unitDefID, unitTeam, progress, face)
end
isAFactory[unitID] = nil
unitFromFactory[unitID] = nil
end
function gadget:Initialize()
for _, unitID in ipairs(Spring.GetAllUnits()) do
local unitDefID = Spring.GetUnitDefID(unitID)
local team = Spring.GetUnitTeam(unitID)
gadget:UnitCreated(unitID, unitDefID, team)
end
GG.wasMorphedTo = GG.wasMorphedTo or {}
end
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
| gpl-2.0 |
davidedmonds/darkstar | scripts/zones/Foret_de_Hennetiel/Zone.lua | 34 | 1255 | -----------------------------------
--
-- Zone: Foret de Hennetiel
--
-----------------------------------
require("scripts/globals/settings");
package.loaded["scripts/zones/Foret_de_Hennetiel/TextIDs"] = nil;
require("scripts/zones/Foret_de_Hennetiel/TextIDs");
-----------------------------------
-- onInitialize
-----------------------------------
function onInitialize(zone)
end;
-----------------------------------
-- onZoneIn
-----------------------------------
function onZoneIn(player,prevZone)
cs = -1;
if ((player:getXPos() == 0) and (player:getYPos() == 0) and (player:getZPos() == 0)) then
player:setPos(360,6,455,93);
end
return cs;
end;
-----------------------------------
-- onRegionEnter
-----------------------------------
function onRegionEnter(player,region)
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end;
| gpl-3.0 |
waterlgndx/darkstar | scripts/globals/items/red_curry_bun_+1.lua | 2 | 1898 | -----------------------------------------
-- ID: 5765
-- Item: red_curry_bun_+1
-- Food Effect: 60 Min, All Races
-----------------------------------------
-- TODO: Group effects
-- Health 35
-- Strength 7
-- Agility 3
-- Attack % 25 (cap 150)
-- Ranged Atk % 25 (cap 150)
-- Demon Killer 6
-- Resist Sleep +5
-- HP recovered when healing +6
-- MP recovered when healing +3
-----------------------------------------
require("scripts/globals/status");
-----------------------------------------
function onItemCheck(target)
local result = 0;
if (target:hasStatusEffect(dsp.effect.FOOD) == true or target:hasStatusEffect(dsp.effect.FIELD_SUPPORT_FOOD) == true) then
result = 246;
end
return result;
end;
function onItemUse(target)
target:addStatusEffect(dsp.effect.FOOD,0,0,3600,5765);
end;
-----------------------------------------
-- onEffectGain Action
-----------------------------------------
function onEffectGain(target,effect)
target:addMod(dsp.mod.HP, 35);
target:addMod(dsp.mod.STR, 7);
target:addMod(dsp.mod.AGI, 3);
target:addMod(dsp.mod.FOOD_ATTP, 25);
target:addMod(dsp.mod.FOOD_ATT_CAP, 150);
target:addMod(dsp.mod.FOOD_RATTP, 25);
target:addMod(dsp.mod.FOOD_RATT_CAP, 150);
target:addMod(dsp.mod.DEMON_KILLER, 6);
target:addMod(dsp.mod.SLEEPRES, 5);
target:addMod(dsp.mod.HPHEAL, 6);
target:addMod(dsp.mod.MPHEAL, 3);
end;
function onEffectLose(target, effect)
target:delMod(dsp.mod.HP, 35);
target:delMod(dsp.mod.STR, 7);
target:delMod(dsp.mod.AGI, 3);
target:delMod(dsp.mod.FOOD_ATTP, 25);
target:delMod(dsp.mod.FOOD_ATT_CAP, 150);
target:delMod(dsp.mod.FOOD_RATTP, 25);
target:delMod(dsp.mod.FOOD_RATT_CAP, 150);
target:delMod(dsp.mod.DEMON_KILLER, 6);
target:delMod(dsp.mod.SLEEPRES, 5);
target:delMod(dsp.mod.HPHEAL, 6);
target:delMod(dsp.mod.MPHEAL, 3);
end; | gpl-3.0 |
lhog/Zero-K | LuaRules/Configs/StartBoxes/TheHunters-v3.lua | 17 | 1313 | return {
[0] = {
startpoints = {
{860,451},
},
boxes = {
{
{819,410},
{901,410},
{901,492},
{819,492},
},
},
},
[1] = {
startpoints = {
{7496,7578},
},
boxes = {
{
{7455,7537},
{7537,7537},
{7537,7619},
{7455,7619},
},
},
},
[2] = {
startpoints = {
{7414,532},
},
boxes = {
{
{7373,492},
{7455,492},
{7455,573},
{7373,573},
},
},
},
[3] = {
startpoints = {
{778,7414},
},
boxes = {
{
{737,7373},
{819,7373},
{819,7455},
{737,7455},
},
},
},
[4] = {
startpoints = {
{614,3236},
},
boxes = {
{
{573,3195},
{655,3195},
{655,3277},
{573,3277},
},
},
},
[5] = {
startpoints = {
{7496,5202},
},
boxes = {
{
{7455,5161},
{7537,5161},
{7537,5243},
{7455,5243},
},
},
},
[6] = {
startpoints = {
{4219,7660},
},
boxes = {
{
{4178,7619},
{4260,7619},
{4260,7700},
{4178,7700},
},
},
},
[7] = {
startpoints = {
{4628,614},
},
boxes = {
{
{4588,573},
{4669,573},
{4669,655},
{4588,655},
},
},
},
[8] = {
startpoints = {
{4055,4055},
},
boxes = {
{
{3277,3277},
{4833,3277},
{4833,4833},
{3277,4833},
},
},
},
}
| gpl-2.0 |
kidaa/darkstar | scripts/zones/Qufim_Island/npcs/Trodden_Snow.lua | 13 | 4765 | -----------------------------------
-- Area: Qufim Island
-- NPC: Trodden Snow
-- Mission: ASA - THAT_WHICH_CURDLES_BLOOD
-- Mission: ASA - SUGAR_COATED_DIRECTIVE
-- @zone 126
-- @pos -19 -17 104
-----------------------------------
package.loaded["scripts/zones/Qufim_Island/TextIDs"] = nil;
-------------------------------------
require("scripts/zones/Qufim_Island/TextIDs");
require("scripts/globals/settings");
require("scripts/globals/keyitems");
require("scripts/globals/missions");
-----------------------------------
-- onTrade
-----------------------------------
function onTrade(player,npc,trade)
-- Trade Enfeebling Kit
if (player:getCurrentMission(ASA) == THAT_WHICH_CURDLES_BLOOD) then
local item = 0;
local asaStatus = player:getVar("ASA_Status");
-- TODO: Other Enfeebling Kits
if(asaStatus == 0) then
item = 2779;
else
printf("Error: Unknown ASA Status Encountered <%u>", asaStatus);
end
if(trade:getItemCount() == 1 and trade:hasItemQty(item,1)) then
player:tradeComplete();
player:startEvent(0x002c);
end
end
end;
-----------------------------------
-- onTrigger
-----------------------------------
function onTrigger(player,npc)
--ASA 4 CS: Triggers With At Least 3 Counterseals.
if (player:getCurrentMission(ASA) == SUGAR_COATED_DIRECTIVE) then
local completedSeals = 0;
if(player:hasKeyItem(AMBER_COUNTERSEAL)) then
completedSeals = completedSeals + 1;
end;
if(player:hasKeyItem(AZURE_COUNTERSEAL)) then
completedSeals = completedSeals + 1;
end;
if(player:hasKeyItem(CERULEAN_COUNTERSEAL)) then
completedSeals = completedSeals + 1;
end;
if(player:hasKeyItem(EMERALD_COUNTERSEAL)) then
completedSeals = completedSeals + 1;
end;
if(player:hasKeyItem(SCARLET_COUNTERSEAL)) then
completedSeals = completedSeals + 1;
end;
if(player:hasKeyItem(VIOLET_COUNTERSEAL)) then
completedSeals = completedSeals + 1;
end;
if(completedSeals >= 3) then
player:setVar("ASA_Status", completedSeals);
player:startEvent(0x002d);
end;
end
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
if(csid==0x002c) then
player:addKeyItem(DOMINAS_SCARLET_SEAL);
player:messageSpecial(KEYITEM_OBTAINED,DOMINAS_SCARLET_SEAL);
player:addKeyItem(DOMINAS_CERULEAN_SEAL);
player:messageSpecial(KEYITEM_OBTAINED,DOMINAS_CERULEAN_SEAL);
player:addKeyItem(DOMINAS_EMERALD_SEAL);
player:messageSpecial(KEYITEM_OBTAINED,DOMINAS_EMERALD_SEAL);
player:addKeyItem(DOMINAS_AMBER_SEAL);
player:messageSpecial(KEYITEM_OBTAINED,DOMINAS_AMBER_SEAL);
player:addKeyItem(DOMINAS_VIOLET_SEAL);
player:messageSpecial(KEYITEM_OBTAINED,DOMINAS_VIOLET_SEAL);
player:addKeyItem(DOMINAS_AZURE_SEAL);
player:messageSpecial(KEYITEM_OBTAINED,DOMINAS_AZURE_SEAL);
player:completeMission(ASA,THAT_WHICH_CURDLES_BLOOD);
player:addMission(ASA,SUGAR_COATED_DIRECTIVE);
player:setVar("ASA_Status",0);
player:setVar("ASA4_Amber","0");
player:setVar("ASA4_Azure","0");
player:setVar("ASA4_Cerulean","0");
player:setVar("ASA4_Emerald","0");
player:setVar("ASA4_Scarlet","0");
player:setVar("ASA4_Violet","0");
elseif(csid==0x002d) then
local completedSeals = player:getVar("ASA_Status");
-- Calculate Reward
if(completedSeals == 3) then
player:addGil(GIL_RATE*3000);
elseif(completedSeals == 4) then
player:addGil(GIL_RATE*10000);
elseif(completedSeals == 5) then
player:addGil(GIL_RATE*30000);
elseif(completedSeals == 6) then
player:addGil(GIL_RATE*50000);
end
-- Clean Up Remaining Key Items
player:delKeyItem(DOMINAS_SCARLET_SEAL);
player:delKeyItem(DOMINAS_CERULEAN_SEAL);
player:delKeyItem(DOMINAS_EMERALD_SEAL);
player:delKeyItem(DOMINAS_AMBER_SEAL);
player:delKeyItem(DOMINAS_VIOLET_SEAL);
player:delKeyItem(DOMINAS_AZURE_SEAL);
player:delKeyItem(SCARLET_COUNTERSEAL);
player:delKeyItem(CERULEAN_COUNTERSEAL);
player:delKeyItem(EMERALD_COUNTERSEAL);
player:delKeyItem(AMBER_COUNTERSEAL);
player:delKeyItem(VIOLET_COUNTERSEAL);
player:delKeyItem(AZURE_COUNTERSEAL);
-- Advance Mission
player:completeMission(ASA,SUGAR_COATED_DIRECTIVE);
player:addMission(ASA,ENEMY_OF_THE_EMPIRE_I);
player:setVar("ASA_Status",0);
end
end; | gpl-3.0 |
will4wachter/Project1 | scripts/zones/Windurst_Walls/npcs/Moan-Maon.lua | 38 | 1408 | -----------------------------------
-- Area: Windurst Walls
-- NPC: Moan-Maon
-- Type: Standard NPC
-- @pos 88.244 -6.32 148.912 239
-----------------------------------
package.loaded["scripts/zones/Windurst_Walls/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/quests");
require("scripts/zones/Windurst_Walls/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
local WildcatWindurst = player:getVar("WildcatWindurst");
if (player:getQuestStatus(WINDURST,LURE_OF_THE_WILDCAT_WINDURST) == QUEST_ACCEPTED and player:getMaskBit(WildcatWindurst,7) == false) then
player:startEvent(0x01f1);
else
player:startEvent(0x0133);
end
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
if (csid == 0x01f1) then
player:setMaskBit(player:getVar("WildcatWindurst"),"WildcatWindurst",7,true);
end
end;
| gpl-3.0 |
kidaa/darkstar | scripts/zones/Windurst_Walls/npcs/Moan-Maon.lua | 38 | 1408 | -----------------------------------
-- Area: Windurst Walls
-- NPC: Moan-Maon
-- Type: Standard NPC
-- @pos 88.244 -6.32 148.912 239
-----------------------------------
package.loaded["scripts/zones/Windurst_Walls/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/quests");
require("scripts/zones/Windurst_Walls/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
local WildcatWindurst = player:getVar("WildcatWindurst");
if (player:getQuestStatus(WINDURST,LURE_OF_THE_WILDCAT_WINDURST) == QUEST_ACCEPTED and player:getMaskBit(WildcatWindurst,7) == false) then
player:startEvent(0x01f1);
else
player:startEvent(0x0133);
end
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
if (csid == 0x01f1) then
player:setMaskBit(player:getVar("WildcatWindurst"),"WildcatWindurst",7,true);
end
end;
| gpl-3.0 |
davidedmonds/darkstar | scripts/zones/Batallia_Downs/npcs/Cavernous_Maw.lua | 16 | 2992 | -----------------------------------
-- Area: Batallia Downs
-- NPC: Cavernous Maw
-- @pos -48 0.1 435 105
-- Teleports Players to Batallia Downs [S]
-----------------------------------
package.loaded["scripts/zones/Batallia_Downs/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/settings");
require("scripts/globals/keyitems");
require("scripts/globals/teleports");
require("scripts/globals/missions");
require("scripts/globals/campaign");
require("scripts/zones/Batallia_Downs/TextIDs");
require("scripts/globals/titles");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
if (ENABLE_WOTG == 1 and player:hasKeyItem(PURE_WHITE_FEATHER) == false) then
player:startEvent(500,0);
elseif (ENABLE_WOTG == 1 and hasMawActivated(player,0)) then
if (player:getCurrentMission(WOTG) == BACK_TO_THE_BEGINNING and
(player:getQuestStatus(CRYSTAL_WAR, CLAWS_OF_THE_GRIFFON) == QUEST_COMPLETED or
player:getQuestStatus(CRYSTAL_WAR, THE_TIGRESS_STRIKES) == QUEST_COMPLETED or
player:getQuestStatus(CRYSTAL_WAR, FIRES_OF_DISCONTENT) == QUEST_COMPLETED)) then
player:startEvent(501);
else
player:startEvent(910);
end
else
player:messageSpecial(NOTHING_HAPPENS);
end
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
if (csid == 500) then
local r = math.random(1,3);
player:addKeyItem(PURE_WHITE_FEATHER);
player:messageSpecial(KEYITEM_OBTAINED,PURE_WHITE_FEATHER);
player:completeMission(WOTG,CAVERNOUS_MAWS);
player:addMission(WOTG,BACK_TO_THE_BEGINNING);
if (r == 1) then
player:addNationTeleport(MAW,1);
toMaw(player,1); -- go to Batallia_Downs[S]
elseif (r == 2) then
player:addNationTeleport(MAW,2);
toMaw(player,3); -- go to Rolanberry_Fields_[S]
elseif (r == 3) then
player:addNationTeleport(MAW,4);
toMaw(player,5); -- go to Sauromugue_Champaign_[S]
end;
elseif (csid == 910 and option == 1) then
toMaw(player,1); -- go to Batallia_Downs[S]
elseif (csid == 501) then
player:completeMission(WOTG, BACK_TO_THE_BEGINNING);
player:addMission(WOTG, CAIT_SITH);
player:addTitle(CAIT_SITHS_ASSISTANT);
toMaw(player,1);
end;
end; | gpl-3.0 |
will4wachter/Project1 | scripts/zones/Heavens_Tower/npcs/Rakano-Marukano.lua | 21 | 2031 | -----------------------------------
-- Area: Heavens Tower
-- NPC: Rakano-Marukano
-- Type: Immigration NPC
-- @pos 6.174 -1 32.285 242
-----------------------------------
package.loaded["scripts/zones/Heavens_Tower/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/conquest");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
local new_nation = WINDURST;
local old_nation = player:getNation();
local rank = getNationRank(new_nation);
if(old_nation == new_nation) then
player:startEvent(0x2714,0,0,0,old_nation);
elseif(player:getCurrentMission(old_nation) ~= 255 or player:getVar("MissionStatus") ~= 0) then
player:startEvent(0x2713,0,0,0,new_nation);
elseif(old_nation ~= new_nation) then
local has_gil = 0;
local cost = 0;
if(rank == 1) then
cost = 40000;
elseif(rank == 2) then
cost = 12000;
elseif(rank == 3) then
cost = 4000;
end
if(player:getGil() >= cost) then
has_gil = 1
end
player:startEvent(0x2712,0,1,player:getRank(),new_nation,has_gil,cost);
end
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
if(csid == 0x2712 and option == 1) then
local new_nation = WINDURST;
local rank = getNationRank(new_nation);
local cost = 0;
if(rank == 1) then
cost = 40000;
elseif(rank == 2) then
cost = 12000;
elseif(rank == 3) then
cost = 4000;
end
player:setNation(new_nation)
player:setGil(player:getGil() - cost);
player:setRankPoints(0);
end
end; | gpl-3.0 |
sandalle/minecraft_bigreactor_control | lolmer_bigreactor_startup.lua | 1 | 1700 | --[[
Programmer: Lolmer
Last update: 2014-02-28
Pastebin: http://pastebin.com/ZTMzRLez
GitHub: https://github.com/sandalle/minecraft_bigreactor_control
Description:
This program controls a Big Reactors nuclear reactor
in Minecraft with a Computercraft computer, using Computercraft's
own wired modem connected to the reactors computer control port.
Save this file as "startup" on your computer for it to auto-start on Computer boot.
To easily get this file into your Computercraft Computer, run the following after right-clicking on your Computercraft computer (includes prompts).
> rm startup
> lua
lua> shell.run("pastebin", "get", "ZTMzRLez", "startup")
Requirements:
Advanced Monitor size is X: 29, Y: 12 with a 3x2 size
Computer or Advanced Computer
Modems (not wireless) connecting each of the Computer to both the Advanced Monitor and Reactor Computer Port.
This script is available from:
http://pastebin.com/ZTMzRLez
https://github.com/sandalle/minecraft_bigreactor_control
And is used to control the following script:
http://pastebin.com/fguScPBQ
Other reactor control which I based my program on:
http://pastebin.com/aMAu4X5J (ScatmanJohn)
http://pastebin.com/HjUVNDau (version ScatmanJohn based his on)
A simpler Big Reactor control is available from:
http://pastebin.com/tFkhQLYn (IronClaymore)
Advanced Monitor size is X: 29, Y: 12 with a 3x2 size
]]--
os.setComputerLabel("ReactorControl")
-- Remove any prior, possibly old, versions of "reactorcontrol"
shell.run("rm", "reactorcontrol")
-- Download http://pastebin.com/fguScPBQ and name "reactorcontrol"
shell.run("pastebin", "get", "fguScPBQ", "reactorcontrol")
shell.run("reactorcontrol")
| mit |
will4wachter/Project1 | scripts/zones/Gusgen_Mines/Zone.lua | 2 | 1323 | -----------------------------------
--
-- Zone: Gusgen_Mines (196)
--
-----------------------------------
package.loaded["scripts/zones/Gusgen_Mines/TextIDs"] = nil;
----------------------------------
require("scripts/globals/settings");
require("scripts/zones/Gusgen_Mines/TextIDs");
-----------------------------------
-- onInitialize
-----------------------------------
function onInitialize(zone)
end;
-----------------------------------
-- onZoneIn
-----------------------------------
function onZoneIn(player,prevZone)
local cs = -1;
if ((player:getXPos() == 0) and (player:getYPos() == 0) and (player:getZPos() == 0)) then
player:setPos(100.007,-61.63,-237.441,187);
end
return cs;
end;
-----------------------------------
-- onRegionEnter
-----------------------------------
function onRegionEnter(player,region)
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end;
| gpl-3.0 |
lhog/Zero-K | effects/gaatgun.lua | 25 | 1354 | -- hltradiate0
-- hltradiate
return {
["hltradiate0"] = {
pollute = {
air = true,
class = [[CSimpleParticleSystem]],
count = 1,
ground = true,
water = true,
properties = {
airdrag = 0.5,
colormap = [[1 1 1 1 0 0 0 0.01]],
directional = false,
emitrot = 0,
emitrotspread = 0,
emitvector = [[dir]],
gravity = [[0, 0.5, 0]],
numparticles = 1,
particlelife = 30,
particlelifespread = 0,
particlesize = 2,
particlesizespread = 0,
particlespeed = 7,
particlespeedspread = 0,
pos = [[0, 0, 0]],
sizegrowth = 0.8,
sizemod = 1.0,
texture = [[smokesmall]],
},
},
},
["hltradiate"] = {
boom = {
air = true,
class = [[CExpGenSpawner]],
count = 10,
ground = true,
water = true,
properties = {
delay = [[0 i1]],
explosiongenerator = [[custom:HLTRADIATE_VAPOR]],
pos = [[-0, 0, 0]],
},
},
},
}
| gpl-2.0 |
davidedmonds/darkstar | scripts/globals/spells/dokumori_ichi.lua | 18 | 1202 | -----------------------------------------
-- Spell: Dokumori: Ichi
-----------------------------------------
require("scripts/globals/status");
require("scripts/globals/magic");
-----------------------------------------
-- OnSpellCast
-----------------------------------------
function onMagicCastingCheck(caster,target,spell)
return 0;
end;
function onSpellCast(caster,target,spell)
local effect = EFFECT_POISON;
-- Base Stats
local dINT = (caster:getStat(MOD_INT) - target:getStat(MOD_INT));
--Duration Calculation
local duration = 60 * applyResistance(caster,spell,target,dINT,NINJUTSU_SKILL,0);
local power = 3;
--Calculates resist chanve from Reist Blind
if (target:hasStatusEffect(effect)) then
spell:setMsg(75); -- no effect
return effect;
end
if (math.random(0,100) >= target:getMod(MOD_POISONRES)) then
if (duration >= 30) then
if (target:addStatusEffect(effect,power,3,duration)) then
spell:setMsg(236);
else
spell:setMsg(75);
end
else
spell:setMsg(85);
end
else
spell:setMsg(284);
end
return effect;
end; | gpl-3.0 |
kidaa/darkstar | scripts/zones/Pashhow_Marshlands/npcs/Cavernous_Maw.lua | 29 | 1512 | -----------------------------------
-- Area: Pashhow Marshlands
-- NPC: Cavernous Maw
-- @pos 418 25 27 109
-- Teleports Players to Pashhow Marshlands [S]
-----------------------------------
package.loaded["scripts/zones/Pashhow_Marshlands/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/settings");
require("scripts/globals/keyitems");
require("scripts/globals/teleports");
require("scripts/globals/campaign");
require("scripts/zones/Pashhow_Marshlands/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
if (ENABLE_WOTG == 1 and player:hasKeyItem(PURE_WHITE_FEATHER) and hasMawActivated(player,4)) then
player:startEvent(0x0389);
else
player:messageSpecial(NOTHING_HAPPENS);
end
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish Action
-----------------------------------
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
if (csid == 0x0389 and option == 1) then
toMaw(player,15);
end
end; | gpl-3.0 |
waterlgndx/darkstar | scripts/zones/Temple_of_Uggalepih/npcs/Old_Casket.lua | 2 | 1108 | -----------------------------------
-- Area: Temple of Uggalepih
-- NPC: Old casket
-- Obtaining 'Paintbrush of Souls'
-- !pos 61 0 17 159
-----------------------------------
package.loaded["scripts/zones/Temple_of_Uggalepih/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/keyitems");
require("scripts/zones/Temple_of_Uggalepih/TextIDs");
-----------------------------------
function onTrade(player,npc,trade)
end;
function onTrigger(player,npc)
if (player:hasKeyItem(dsp.ki.OLD_RUSTY_KEY)) then
player:startEvent(64,dsp.ki.OLD_RUSTY_KEY);
elseif (player:hasKeyItem(dsp.ki.PAINTBRUSH_OF_SOULS)) then
player:messageSpecial(NO_REASON_TO_INVESTIGATE);
else
player:messageSpecial(THE_BOX_IS_LOCKED);
end
end;
function onEventUpdate(player,csid,option)
end;
function onEventFinish(player,csid,option)
if (csid == 64 and option == 1) then
player:delKeyItem(dsp.ki.OLD_RUSTY_KEY);
player:addKeyItem(dsp.ki.PAINTBRUSH_OF_SOULS);
player:messageSpecial(KEYITEM_OBTAINED,dsp.ki.PAINTBRUSH_OF_SOULS);
end
end; | gpl-3.0 |
MonokuroInzanaito/ygopro-777DIY | expansions/script/c18706018.lua | 1 | 4684 | --魔人少女 莎姆&莎瑪
function c18706018.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(Card.IsSetCard,0xabb),1)
c:EnableReviveLimit()
--remove
--local e1=Effect.CreateEffect(c)
--e1:SetDescription(aux.Stringid(52687916,0))
--e1:SetCategory(CATEGORY_REMOVE)
--e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
--e1:SetCode(EVENT_SPSUMMON_SUCCESS)
--e1:SetCondition(c18706018.remcon)
--e1:SetCost(c18706018.cost)
--e1:SetTarget(c18706018.remtg)
--e1:SetOperation(c18706018.remop)
--c:RegisterEffect(e1)
--local e3=Effect.CreateEffect(c)
--e3:SetType(EFFECT_TYPE_SINGLE)
--e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
--e3:SetRange(LOCATION_MZONE)
--e3:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
--e3:SetValue(c18706018.efilter)
--c:RegisterEffect(e3)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetValue(c18706018.ind2)
c:RegisterEffect(e1)
--Disable
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e2:SetCategory(CATEGORY_DISABLE)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetTarget(c18706018.damtg)
e2:SetOperation(c18706018.damop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_BE_BATTLE_TARGET)
c:RegisterEffect(e3)
end
function c18706018.mfilter(c)
return c:IsType(TYPE_XYZ) and c:IsFaceup()
end
function c18706018.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(1200)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,1200)
end
function c18706018.damop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
if Duel.IsExistingTarget(c18706018.mfilter,tp,0,LOCATION_MZONE,1,nil) then
Duel.Damage(p,d,REASON_EFFECT)
end
end
function c18706018.remcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSummonType()==SUMMON_TYPE_SYNCHRO
end
function c18706018.costfilter(c)
return c:IsSetCard(0xabb) and not c:IsPublic()
end
function c18706018.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c18706018.costfilter,tp,LOCATION_HAND,0,1,nil,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,c18706018.costfilter,tp,LOCATION_HAND,0,1,1,nil,nil)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
end
function c18706018.remtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(1-tp,1) and Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,0,LOCATION_ONFIELD+LOCATION_HAND,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c18706018.remop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(1-tp,LOCATION_ONFIELD+LOCATION_HAND,0)
if g:GetCount()==0 then return end
local sg=g:RandomSelect(1-tp,1)
Duel.SendtoDeck(sg,nil,2,REASON_EFFECT)
Duel.Draw(1-tp,1,REASON_EFFECT)
end
function c18706018.ind2(e,c)
return c:GetRace()==RACE_WARRIOR or c:GetRace()==RACE_SPELLCASTER or c:GetRace()==RACE_ZOMBIE or c:GetRace()==RACE_MACHINE
or c:GetRace()==RACE_AQUA or c:GetRace()==RACE_PYRO or c:GetRace()==RACE_ROCK or c:GetRace()==RACE_WINDBEAST
or c:GetRace()==RACE_PLANT or c:GetRace()==RACE_INSECT or c:GetRace()==RACE_THUNDER or c:GetRace()==RACE_DRAGON
or c:GetRace()==RACE_BEAST or c:GetRace()==RACE_BEASTWARRIOR or c:GetRace()==RACE_DINOSAUR or c:GetRace()==RACE_FISH
or c:GetRace()==RACE_SEASERPENT or c:GetRace()==RACE_REPTILE or c:GetRace()==RACE_PSYCHO or c:GetRace()==RACE_DEVINE
or c:GetRace()==RACE_CREATORGOD or c:GetRace()==RACE_WYRM
end
function c18706018.efilter(e,re)
return re:IsActiveType(TYPE_SPELL+TYPE_TRAP) or (re:GetHandler():GetRace()==RACE_WARRIOR or re:GetHandler():GetRace()==RACE_SPELLCASTER or re:GetHandler():GetRace()==RACE_ZOMBIE or re:GetHandler():GetRace()==RACE_MACHINE
or re:GetHandler():GetRace()==RACE_AQUA or re:GetHandler():GetRace()==RACE_PYRO or re:GetHandler():GetRace()==RACE_ROCK or re:GetHandler():GetRace()==RACE_WINDBEAST
or re:GetHandler():GetRace()==RACE_PLANT or re:GetHandler():GetRace()==RACE_INSECT or re:GetHandler():GetRace()==RACE_THUNDER or re:GetHandler():GetRace()==RACE_DRAGON
or re:GetHandler():GetRace()==RACE_BEAST or re:GetHandler():GetRace()==RACE_BEASTWARRIOR or re:GetHandler():GetRace()==RACE_DINOSAUR or re:GetHandler():GetRace()==RACE_FISH
or re:GetHandler():GetRace()==RACE_SEASERPENT or re:GetHandler():GetRace()==RACE_REPTILE or re:GetHandler():GetRace()==RACE_PSYCHO or re:GetHandler():GetRace()==RACE_DEVINE
or re:GetHandler():GetRace()==RACE_CREATORGOD or re:GetHandler():GetRace()==RACE_WYRM)
end | gpl-3.0 |
waterlgndx/darkstar | scripts/globals/mobskills/ill_wind.lua | 2 | 1421 | ---------------------------------------------
-- Ill Wind
-- Description: Deals Wind damage to enemies within an area of effect. Additional effect: Dispel
-- Type: Magical
-- Utsusemi/Blink absorb: Wipes Shadows
-- Range: Unknown radial
-- Notes: Only used by Puks in Mamook, Besieged, and the following Notorious Monsters: Vulpangue, Nis Puk, Nguruvilu, Seps , Phantom Puk and Waugyl. Dispels one dsp.effect.
---------------------------------------------
require("scripts/globals/settings");
require("scripts/globals/status");
require("scripts/globals/monstertpmoves");
---------------------------------------------
function onMobSkillCheck(target,mob,skill)
if (mob:getFamily() == 316 and mob:getModelId() == 1746) then
return 0;
else
return 1;
end
end;
function onMobWeaponSkill(target, mob, skill)
local dmgmod = 1;
local info = MobMagicalMove(mob,target,skill,mob:getWeaponDmg()*2.5,dsp.magic.ele.WIND,dmgmod,TP_NO_EFFECT);
local dmg = MobFinalAdjustments(info.dmg,mob,skill,target,MOBSKILL_MAGICAL,MOBPARAM_WIND,MOBPARAM_WIPE_SHADOWS);
target:dispelStatusEffect();
target:delHP(dmg);
--printf("[TP MOVE] Zone: %u Monster: %u Mob lvl: %u TP: %u TP Move: %u Damage: %u on Player: %u Level: %u HP: %u",mob:getZoneID(),mob:getID(),mob:getMainLvl(),skill:getTP(),skill:getID(),dmg,target:getID(),target:getMainLvl(),target:getMaxHP());
return dmg;
end; | gpl-3.0 |
MonokuroInzanaito/ygopro-777DIY | expansions/script/c114005066.lua | 1 | 2043 | --★立ち上がる聖女 はまじ
function c114005066.initial_effect(c)
--defup
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DEFCHANGE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_BATTLE_CONFIRM)
e1:SetCondition(c114005066.defcon)
e1:SetOperation(c114005066.defop)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TODECK)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BATTLE_DAMAGE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCondition(c114005066.tdcon)
e2:SetTarget(c114005066.tdtg)
e2:SetOperation(c114005066.tdop)
c:RegisterEffect(e2)
end
function c114005066.defcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttackTarget()==e:GetHandler() and e:GetHandler():GetBattlePosition()==POS_FACEDOWN_DEFENSE
end
function c114005066.defop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetAttacker()
if not c:IsRelateToBattle() then return end --excluded: tc:IsRelateToBattle() or not
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_DEFENSE)
e1:SetValue(1500)
e1:SetReset(RESET_EVENT+0x1ff0000)
c:RegisterEffect(e1)
end
function c114005066.tdcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler()==Duel.GetAttackTarget()
end
function c114005066.tdfilter(c)
return c:IsAbleToDeck() and not c:IsStatus(STATUS_BATTLE_DESTROYED)
end
function c114005066.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and c114005066.tdfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c114005066.tdfilter,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c114005066.tdfilter,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
end
function c114005066.tdop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.SendtoDeck(tc,nil,2,REASON_EFFECT)
end
end
| gpl-3.0 |
kidaa/darkstar | scripts/globals/items/cup_of_chai_+1.lua | 35 | 1214 | -----------------------------------------
-- ID: 5594
-- Item: cup_of_chai_+1
-- Food Effect: 240Min, All Races
-----------------------------------------
-- Vitality -3
-- Charisma 3
-----------------------------------------
require("scripts/globals/status");
-----------------------------------------
-- OnItemCheck
-----------------------------------------
function onItemCheck(target)
local result = 0;
if (target:hasStatusEffect(EFFECT_FOOD) == true or target:hasStatusEffect(EFFECT_FIELD_SUPPORT_FOOD) == true) then
result = 246;
end
return result;
end;
-----------------------------------------
-- OnItemUse
-----------------------------------------
function onItemUse(target)
target:addStatusEffect(EFFECT_FOOD,0,0,14400,5594);
end;
-----------------------------------------
-- onEffectGain Action
-----------------------------------------
function onEffectGain(target,effect)
target:addMod(MOD_VIT, -3);
target:addMod(MOD_CHR, 3);
end;
-----------------------------------------
-- onEffectLose Action
-----------------------------------------
function onEffectLose(target,effect)
target:delMod(MOD_VIT, -3);
target:delMod(MOD_CHR, 3);
end;
| gpl-3.0 |
nmreis/lua-cjson | tests/bench.lua | 145 | 3247 | #!/usr/bin/env lua
-- This benchmark script measures wall clock time and should be
-- run on an unloaded system.
--
-- Your Mileage May Vary.
--
-- Mark Pulford <mark@kyne.com.au>
local json_module = os.getenv("JSON_MODULE") or "cjson"
require "socket"
local json = require(json_module)
local util = require "cjson.util"
local function find_func(mod, funcnames)
for _, v in ipairs(funcnames) do
if mod[v] then
return mod[v]
end
end
return nil
end
local json_encode = find_func(json, { "encode", "Encode", "to_string", "stringify", "json" })
local json_decode = find_func(json, { "decode", "Decode", "to_value", "parse" })
local function average(t)
local total = 0
for _, v in ipairs(t) do
total = total + v
end
return total / #t
end
function benchmark(tests, seconds, rep)
local function bench(func, iter)
-- Use socket.gettime() to measure microsecond resolution
-- wall clock time.
local t = socket.gettime()
for i = 1, iter do
func(i)
end
t = socket.gettime() - t
-- Don't trust any results when the run lasted for less than a
-- millisecond - return nil.
if t < 0.001 then
return nil
end
return (iter / t)
end
-- Roughly calculate the number of interations required
-- to obtain a particular time period.
local function calc_iter(func, seconds)
local iter = 1
local rate
-- Warm up the bench function first.
func()
while not rate do
rate = bench(func, iter)
iter = iter * 10
end
return math.ceil(seconds * rate)
end
local test_results = {}
for name, func in pairs(tests) do
-- k(number), v(string)
-- k(string), v(function)
-- k(number), v(function)
if type(func) == "string" then
name = func
func = _G[name]
end
local iter = calc_iter(func, seconds)
local result = {}
for i = 1, rep do
result[i] = bench(func, iter)
end
-- Remove the slowest half (round down) of the result set
table.sort(result)
for i = 1, math.floor(#result / 2) do
table.remove(result, 1)
end
test_results[name] = average(result)
end
return test_results
end
function bench_file(filename)
local data_json = util.file_load(filename)
local data_obj = json_decode(data_json)
local function test_encode()
json_encode(data_obj)
end
local function test_decode()
json_decode(data_json)
end
local tests = {}
if json_encode then tests.encode = test_encode end
if json_decode then tests.decode = test_decode end
return benchmark(tests, 0.1, 5)
end
-- Optionally load any custom configuration required for this module
local success, data = pcall(util.file_load, ("bench-%s.lua"):format(json_module))
if success then
util.run_script(data, _G)
configure(json)
end
for i = 1, #arg do
local results = bench_file(arg[i])
for k, v in pairs(results) do
print(("%s\t%s\t%d"):format(arg[i], k, v))
end
end
-- vi:ai et sw=4 ts=4:
| mit |
will4wachter/Project1 | scripts/zones/Port_Bastok/npcs/Tilian.lua | 38 | 1380 | -----------------------------------
-- Area: Port Bastok
-- NPC: Tilian
-- Type: Quest NPC
-- @pos -118.460 4.999 -68.090 236
-----------------------------------
package.loaded["scripts/zones/Port_Bastok/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/quests");
require("scripts/zones/Port_Bastok/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
local WildcatBastok = player:getVar("WildcatBastok");
if (player:getQuestStatus(BASTOK,LURE_OF_THE_WILDCAT_BASTOK) == QUEST_ACCEPTED and player:getMaskBit(WildcatBastok,4) == false) then
player:startEvent(0x0163);
else
player:startEvent(0x0064);
end
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
if (csid == 0x0163) then
player:setMaskBit(player:getVar("WildcatBastok"),"WildcatBastok",4,true);
end
end;
| gpl-3.0 |
kidaa/darkstar | scripts/globals/mobskills/Tail_Crush.lua | 25 | 1026 | ---------------------------------------------
-- Tail Crush
--
-- Description: Smashes a single target with its tail. Additional effect: Poison
-- Type: Physical
-- Utsusemi/Blink absorb: 1 shadow
-- Range: Melee
-- Notes:
---------------------------------------------
require("scripts/globals/settings");
require("scripts/globals/status");
require("scripts/globals/monstertpmoves");
---------------------------------------------
function onMobSkillCheck(target,mob,skill)
return 0;
end;
function onMobWeaponSkill(target, mob, skill)
local numhits = 1;
local accmod = 1;
local dmgmod = 2.5;
local info = MobPhysicalMove(mob,target,skill,numhits,accmod,dmgmod,TP_NO_EFFECT);
local dmg = MobFinalAdjustments(info.dmg,mob,skill,target,MOBSKILL_PHYSICAL,MOBPARAM_SLASH,info.hitslanded);
local typeEffect = EFFECT_POISON;
local power = mob:getMainLvl()/10 + 10;
MobPhysicalStatusEffectMove(mob, target, skill, typeEffect, power, 3, 60);
target:delHP(dmg);
return dmg;
end;
| gpl-3.0 |
will4wachter/Project1 | scripts/globals/items/mushroom_salad.lua | 39 | 1426 | -----------------------------------------
-- ID: 5678
-- Item: Mushroom Salad
-- Food Effect: 3 Hrs, All Races
-----------------------------------------
-- MP 14% Cap 85
-- Agility 6
-- Mind 6
-- Strength -5
-- Vitality -5
-----------------------------------------
require("scripts/globals/status");
-----------------------------------------
-- OnItemCheck
-----------------------------------------
function onItemCheck(target)
result = 0;
if (target:hasStatusEffect(EFFECT_FOOD)) then
result = 246;
end
return result;
end;
-----------------------------------------
-- OnItemUse
-----------------------------------------
function onItemUse(target)
target:addStatusEffect(EFFECT_FOOD,0,0,10800,5678);
end;
-----------------------------------------
-- onEffectGain Action
-----------------------------------------
function onEffectGain(target,effect)
target:addMod(MOD_FOOD_MPP, 14);
target:addMod(MOD_FOOD_MP_CAP, 85);
target:addMod(MOD_AGI, 6);
target:addMod(MOD_MND, 6);
target:addMod(MOD_STR, -5);
target:addMod(MOD_VIT, -5);
end;
-----------------------------------------
-- onEffectLose Action
-----------------------------------------
function onEffectLose(target,effect)
target:delMod(MOD_FOOD_MPP, 14);
target:delMod(MOD_FOOD_MP_CAP, 85);
target:delMod(MOD_AGI, 6);
target:delMod(MOD_MND, 6);
target:delMod(MOD_STR, -5);
target:delMod(MOD_VIT, -5);
end;
| gpl-3.0 |
Leushenko/blue-moon | tests/code.lua | 9 | 4188 | if T==nil then
(Message or print)('\a\n >>> testC not active: skipping opcode tests <<<\n\a')
return
end
print "testing code generation and optimizations"
-- this code gave an error for the code checker
do
local function f (a)
for k,v,w in a do end
end
end
function check (f, ...)
local arg = {...}
local c = T.listcode(f)
for i=1, #arg do
-- print(arg[i], c[i])
assert(string.find(c[i], '- '..arg[i]..' *%d'))
end
assert(c[#arg+2] == nil)
end
function checkequal (a, b)
a = T.listcode(a)
b = T.listcode(b)
for i = 1, #a do
a[i] = string.gsub(a[i], '%b()', '') -- remove line number
b[i] = string.gsub(b[i], '%b()', '') -- remove line number
assert(a[i] == b[i])
end
end
-- some basic instructions
check(function ()
(function () end){f()}
end, 'CLOSURE', 'NEWTABLE', 'GETTABUP', 'CALL', 'SETLIST', 'CALL', 'RETURN')
-- sequence of LOADNILs
check(function ()
local a,b,c
local d; local e;
local f,g,h;
d = nil; d=nil; b=nil; a=nil; c=nil;
end, 'LOADNIL', 'RETURN')
check(function ()
local a,b,c,d = 1,1,1,1
d=nil;c=nil;b=nil;a=nil
end, 'LOADK', 'LOADK', 'LOADK', 'LOADK', 'LOADNIL', 'RETURN')
do
local a,b,c,d = 1,1,1,1
d=nil;c=nil;b=nil;a=nil
assert(a == nil and b == nil and c == nil and d == nil)
end
-- single return
check (function (a,b,c) return a end, 'RETURN')
-- infinite loops
check(function () while true do local a = -1 end end,
'LOADK', 'JMP', 'RETURN')
check(function () while 1 do local a = -1 end end,
'LOADK', 'JMP', 'RETURN')
check(function () repeat local x = 1 until true end,
'LOADK', 'RETURN')
-- concat optimization
check(function (a,b,c,d) return a..b..c..d end,
'MOVE', 'MOVE', 'MOVE', 'MOVE', 'CONCAT', 'RETURN')
-- not
check(function () return not not nil end, 'LOADBOOL', 'RETURN')
check(function () return not not false end, 'LOADBOOL', 'RETURN')
check(function () return not not true end, 'LOADBOOL', 'RETURN')
check(function () return not not 1 end, 'LOADBOOL', 'RETURN')
-- direct access to locals
check(function ()
local a,b,c,d
a = b*2
c[4], a[b] = -((a + d/-20.5 - a[b]) ^ a.x), b
end,
'LOADNIL',
'MUL',
'DIV', 'ADD', 'GETTABLE', 'SUB', 'GETTABLE', 'POW',
'UNM', 'SETTABLE', 'SETTABLE', 'RETURN')
-- direct access to constants
check(function ()
local a,b
a.x = 0
a.x = b
a[b] = 'y'
a = 1 - a
b = 1/a
b = 5+4
a[true] = false
end,
'LOADNIL',
'SETTABLE', 'SETTABLE', 'SETTABLE', 'SUB', 'DIV', 'LOADK',
'SETTABLE', 'RETURN')
-- constant folding
local function f () return -((2^8 + -(-1)) % 8)/2 * 4 - 3 end
check(f, 'LOADK', 'RETURN')
assert(f() == -5)
-- bug in constant folding for 5.1
check(function () return -nil end,
'LOADNIL', 'UNM', 'RETURN')
check(function ()
local a,b,c
b[c], a = c, b
b[a], a = c, b
a, b = c, a
a = a
end,
'LOADNIL',
'MOVE', 'MOVE', 'SETTABLE',
'MOVE', 'MOVE', 'MOVE', 'SETTABLE',
'MOVE', 'MOVE', 'MOVE',
-- no code for a = a
'RETURN')
-- x == nil , x ~= nil
checkequal(function () if (a==nil) then a=1 end; if a~=nil then a=1 end end,
function () if (a==9) then a=1 end; if a~=9 then a=1 end end)
check(function () if a==nil then a=1 end end,
'GETTABUP', 'EQ', 'JMP', 'SETTABUP', 'RETURN')
-- de morgan
checkequal(function () local a; if not (a or b) then b=a end end,
function () local a; if (not a and not b) then b=a end end)
checkequal(function (l) local a; return 0 <= a and a <= l end,
function (l) local a; return not (not(a >= 0) or not(a <= l)) end)
-- if-goto optimizations
check(function (a)
if a == 1 then goto l1
elseif a == 2 then goto l2
elseif a == 3 then goto l2
else if a == 4 then goto l3
else goto l3
end
end
::l1:: ::l2:: ::l3:: ::l4::
end, 'EQ', 'JMP', 'EQ', 'JMP', 'EQ', 'JMP', 'EQ', 'JMP', 'JMP', 'RETURN')
checkequal(
function (a) while a < 10 do a = a + 1 end end,
function (a) ::L2:: if not(a < 10) then goto L1 end; a = a + 1;
goto L2; ::L1:: end
)
checkequal(
function (a) while a < 10 do a = a + 1 end end,
function (a) while true do if not(a < 10) then break end; a = a + 1; end end
)
print 'OK'
| mit |
will4wachter/Project1 | scripts/globals/items/goldsmiths_belt.lua | 5 | 1216 | -----------------------------------------
-- ID: 15446
-- Item: Goldsmith's Belt
-- Enchantment: Synthesis image support
-- 2Min, All Races
-----------------------------------------
-- Enchantment: Synthesis image support
-- Duration: 2Min
-- Goldsmithing Skill +1
-----------------------------------------
require("scripts/globals/status");
-----------------------------------------
-- OnItemCheck
-----------------------------------------
function onItemCheck(target)
local result = 0;
if (target:hasStatusEffect(EFFECT_GOLDSMITHING_IMAGERY) == true) then
result = 238;
end
return result;
end;
-----------------------------------------
-- OnItemUse
-----------------------------------------
function onItemUse(target)
target:addStatusEffect(EFFECT_GOLDSMITHING_IMAGERY,51,0,120);
end;
-----------------------------------------
-- onEffectGain Action
-----------------------------------------
function onEffectGain(target,effect)
target:addMod(MOD_SKILL_GLD, 1);
end;
-----------------------------------------
-- onEffectLose Action
-----------------------------------------
function onEffectLose(target,effect)
target:delMod(MOD_SKILL_GLD, 1);
end; | gpl-3.0 |
iGhibli/FlyingGame | FlyingGame/src/cocos/extension/DeprecatedExtensionEnum.lua | 40 | 1369 |
_G.kCCControlStepperPartMinus = cc.CONTROL_STEPPER_PART_MINUS
_G.kCCControlStepperPartPlus = cc.CONTROL_STEPPER_PART_PLUS
_G.kCCControlStepperPartNone = cc.CONTROL_STEPPER_PART_NONE
_G.CCControlEventTouchDown = cc.CONTROL_EVENTTYPE_TOUCH_DOWN
_G.CCControlEventTouchDragInside = cc.CONTROL_EVENTTYPE_DRAG_INSIDE
_G.CCControlEventTouchDragOutside = cc.CONTROL_EVENTTYPE_DRAG_OUTSIDE
_G.CCControlEventTouchDragEnter = cc.CONTROL_EVENTTYPE_DRAG_ENTER
_G.CCControlEventTouchDragExit = cc.CONTROL_EVENTTYPE_DRAG_EXIT
_G.CCControlEventTouchUpInside = cc.CONTROL_EVENTTYPE_TOUCH_UP_INSIDE
_G.CCControlEventTouchUpOutside = cc.CONTROL_EVENTTYPE_TOUCH_UP_OUTSIDE
_G.CCControlEventTouchCancel = cc.CONTROL_EVENTTYPE_TOUCH_CANCEL
_G.CCControlEventValueChanged = cc.CONTROL_EVENTTYPE_VALUE_CHANGED
_G.CCControlStateNormal = cc.CONTROL_STATE_NORMAL
_G.CCControlStateHighlighted = cc.CONTROL_STATE_HIGH_LIGHTED
_G.CCControlStateDisabled = cc.CONTROL_STATE_DISABLED
_G.CCControlStateSelected = cc.CONTROL_STATE_SELECTED
_G.kCCScrollViewDirectionHorizontal = cc.SCROLLVIEW_DIRECTION_HORIZONTAL
_G.kCCScrollViewDirectionVertical = cc.SCROLLVIEW_DIRECTION_VERTICAL
_G.kCCTableViewFillTopDown = cc.TABLEVIEW_FILL_TOPDOWN
_G.kCCTableViewFillBottomUp = cc.TABLEVIEW_FILL_BOTTOMUP
| gpl-3.0 |
MonokuroInzanaito/ygopro-777DIY | expansions/script/c21520189.lua | 1 | 8536 | --艺形魔-纸死神
function c21520189.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--splimit
local pe1=Effect.CreateEffect(c)
pe1:SetType(EFFECT_TYPE_FIELD)
pe1:SetRange(LOCATION_PZONE)
pe1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
pe1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE)
pe1:SetTargetRange(1,0)
pe1:SetTarget(c21520189.splimit)
c:RegisterEffect(pe1)
--SPECIAL_SUMMON
local pe2=Effect.CreateEffect(c)
pe2:SetDescription(aux.Stringid(21520189,4))
pe2:SetCategory(CATEGORY_SPECIAL_SUMMON)
pe2:SetProperty(EFFECT_FLAG_CARD_TARGET)
pe2:SetType(EFFECT_TYPE_IGNITION)
pe2:SetRange(LOCATION_PZONE)
pe2:SetCountLimit(1)
pe2:SetTarget(c21520189.sptg)
pe2:SetOperation(c21520189.spop)
c:RegisterEffect(pe2)
--deck remove
local pe3=Effect.CreateEffect(c)
pe3:SetDescription(aux.Stringid(21520189,6))
pe3:SetCategory(CATEGORY_REMOVE)
pe3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
pe3:SetProperty(EFFECT_FLAG_DELAY)
pe3:SetRange(LOCATION_PZONE)
pe3:SetCode(EVENT_SPSUMMON_SUCCESS)
pe3:SetCondition(c21520189.dkrcon)
-- pe3:SetTarget(c21520189.dkrtg)
pe3:SetOperation(c21520189.dkrop)
c:RegisterEffect(pe3)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY+CATEGORY_RECOVER)
e1:SetDescription(aux.Stringid(21520189,2))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,21520189)
e1:SetCost(c21520189.sdrcost)
e1:SetTarget(c21520189.sdrtg)
e1:SetOperation(c21520189.sdrop)
c:RegisterEffect(e1)
--to grave
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(21520189,3))
e2:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DECKDES)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,21520189)
e2:SetOperation(c21520189.tgop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
--special summon
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(21520189,5))
e4:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DECKDES+CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_GRAVE)
e4:SetCountLimit(1,21520189)
e4:SetCost(c21520189.sprcost)
e4:SetTarget(c21520189.sprtg)
e4:SetOperation(c21520189.sprop)
c:RegisterEffect(e4)
end
function c21520189.splimit(e,c,sump,sumtype,sumpos,targetp)
if c:IsSetCard(0x490) then return false end
return bit.band(sumtype,SUMMON_TYPE_PENDULUM)==SUMMON_TYPE_PENDULUM
end
function c21520189.spfilter(c,e,tp)
return c:IsSetCard(0x490) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c21520189.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
if chk==0 then return Duel.IsExistingTarget(c21520189.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp)
and Duel.GetLocationCount(tp,LOCATION_MZONE)+Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c21520189.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c21520189.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
local op=2
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 then
op=Duel.SelectOption(tp,aux.Stringid(21520189,0),aux.Stringid(21520189,1))
elseif Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.GetLocationCount(1-tp,LOCATION_MZONE)==0 then
op=0
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(21520189,0))
elseif Duel.GetLocationCount(tp,LOCATION_MZONE)==0 and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 then
op=1
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(21520189,1))
end
if op==0 then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
elseif op==1 then
Duel.SpecialSummon(tc,0,tp,1-tp,false,false,POS_FACEUP)
end
local atk=tc:GetAttack()
Duel.Damage(tc:GetControler(),atk,REASON_EFFECT)
end
end
function c21520189.dkrcon(e,tp,eg,ep,ev,re,r,rp)
return eg:FilterCount(Card.IsSetCard,nil,0x490)>0
end
function c21520189.dkrtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_DECK)
end
function c21520189.dkrfilter(c)
return c:IsFaceup() and c:IsSetCard(0x490)
end
function c21520189.dkrop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if Duel.GetFieldGroupCount(1-tp,0,LOCATION_DECK)==0 then return end
if eg:IsExists(c21520189.dkrfilter,1,nil) then
local g=Duel.GetDecktopGroup(1-tp,1)
Duel.DisableShuffleCheck()
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
end
function c21520189.sdrcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_DISCARD+REASON_COST)
end
function c21520189.sdrtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and c:IsDistruable() end
if chk==0 then return Duel.IsExistingTarget(c21520189.sdrfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,e:GetHandler(),e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c21520189.sdrfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,e:GetHandler(),e,yp)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c21520189.sdrfilter(c,e,tp)
return c:IsSetCard(0x490) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c21520189.sdrop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
local p=tp
if tc:IsRelateToEffect(e) then
local op=2
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 then
op=Duel.SelectOption(tp,aux.Stringid(21520189,0),aux.Stringid(21520189,1))
elseif Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.GetLocationCount(1-tp,LOCATION_MZONE)==0 then
op=0
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(21520189,0))
elseif Duel.GetLocationCount(tp,LOCATION_MZONE)==0 and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 then
op=1
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(21520189,1))
end
if op==1 then
p=1-tp
end
if Duel.SpecialSummon(tc,0,tp,p,false,false,POS_FACEUP)>0 then
local dg=Duel.GetMatchingGroup(Card.IsDestructable,p,LOCATION_MZONE,0,tc,e)
local aval=0
local dc=dg:GetFirst()
while dc do
aval=aval+dc:GetAttack()
dc=dg:GetNext()
end
if Duel.Destroy(dg,REASON_EFFECT)>0 then
Duel.Recover(p,aval,REASON_EFFECT)
end
end
end
end
function c21520189.tgop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetDecktopGroup(tp,6)
Duel.ConfirmDecktop(tp,6)
local tc=g:GetFirst()
local tgg=Group.CreateGroup()
while tc do
if tc:IsType(TYPE_MONSTER) and tc:IsSetCard(0x490) then
tgg:AddCard(tc)
end
tc=g:GetNext()
end
local ct=Duel.SendtoGrave(tgg,REASON_EFFECT)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local otg=Duel.SelectMatchingCard(tp,Card.IsAbleToGrave,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,ct,nil)
Duel.SendtoGrave(otg,REASON_EFFECT)
Duel.ShuffleDeck(tp)
end
function c21520189.sprfilter(c)
return c:IsSetCard(0x490) and c:IsAbleToRemoveAsCost()
end
function c21520189.sprcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c21520189.sprfilter,tp,LOCATION_GRAVE,0,1,e:GetHandler()) and Duel.IsPlayerCanDiscardDeck(tp,2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c21520189.sprfilter,tp,LOCATION_GRAVE,0,1,1,e:GetHandler())
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c21520189.sprtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,2) and Duel.IsPlayerCanSpecialSummon(tp,0,POS_FACEUP,tp,e:GetHandler()) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,2,0,LOCATION_DECK)
end
function c21520189.sprop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<1 or not c:IsRelateToEffect(e)
or not Duel.IsPlayerCanSpecialSummon(tp,0,POS_FACEUP,tp,e:GetHandler()) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
Duel.BreakEffect()
Duel.DiscardDeck(tp,2,REASON_EFFECT)
end
| gpl-3.0 |
will4wachter/Project1 | scripts/zones/Bastok_Mines/npcs/Sodragamm.lua | 38 | 1086 | -----------------------------------
-- Area: Bastok Mines
-- NPC: Sodragamm
-- Type: Item Deliverer
-- @zone: 234
-- @pos -24.741 -1 -64.944
--
-- Auto-Script: Requires Verification (Verified by Brawndo)
-----------------------------------
package.loaded["scripts/zones/Bastok_Mines/TextIDs"] = nil;
require("scripts/zones/Bastok_Mines/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
player:showText(npc, ITEM_DELIVERY_DIALOG);
player:openSendBox();
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
| gpl-3.0 |
DarkWanderer/LuaParser | DW.Lua.UnitTests/Code/Fixtures/db.lua | 4 | 21816 | -- $Id: db.lua,v 1.79 2016/11/07 13:02:34 roberto Exp $
-- See Copyright Notice in file all.lua
-- testing debug library
local debug = require "debug"
local function dostring(s) return assert(load(s))() end
print"testing debug library and debug information"
do
local a=1
end
assert(not debug.gethook())
local testline = 19 -- line where 'test' is defined
function test (s, l, p) -- this must be line 19
collectgarbage() -- avoid gc during trace
local function f (event, line)
assert(event == 'line')
local l = table.remove(l, 1)
if p then print(l, line) end
assert(l == line, "wrong trace!!")
end
debug.sethook(f,"l"); load(s)(); debug.sethook()
assert(#l == 0)
end
do
assert(not pcall(debug.getinfo, print, "X")) -- invalid option
assert(not debug.getinfo(1000)) -- out of range level
assert(not debug.getinfo(-1)) -- out of range level
local a = debug.getinfo(print)
assert(a.what == "C" and a.short_src == "[C]")
a = debug.getinfo(print, "L")
assert(a.activelines == nil)
local b = debug.getinfo(test, "SfL")
assert(b.name == nil and b.what == "Lua" and b.linedefined == testline and
b.lastlinedefined == b.linedefined + 10 and
b.func == test and not string.find(b.short_src, "%["))
assert(b.activelines[b.linedefined + 1] and
b.activelines[b.lastlinedefined])
assert(not b.activelines[b.linedefined] and
not b.activelines[b.lastlinedefined + 1])
end
-- test file and string names truncation
a = "function f () end"
local function dostring (s, x) return load(s, x)() end
dostring(a)
assert(debug.getinfo(f).short_src == string.format('[string "%s"]', a))
dostring(a..string.format("; %s\n=1", string.rep('p', 400)))
assert(string.find(debug.getinfo(f).short_src, '^%[string [^\n]*%.%.%."%]$'))
dostring(a..string.format("; %s=1", string.rep('p', 400)))
assert(string.find(debug.getinfo(f).short_src, '^%[string [^\n]*%.%.%."%]$'))
dostring("\n"..a)
assert(debug.getinfo(f).short_src == '[string "..."]')
dostring(a, "")
assert(debug.getinfo(f).short_src == '[string ""]')
dostring(a, "@xuxu")
assert(debug.getinfo(f).short_src == "xuxu")
dostring(a, "@"..string.rep('p', 1000)..'t')
assert(string.find(debug.getinfo(f).short_src, "^%.%.%.p*t$"))
dostring(a, "=xuxu")
assert(debug.getinfo(f).short_src == "xuxu")
dostring(a, string.format("=%s", string.rep('x', 500)))
assert(string.find(debug.getinfo(f).short_src, "^x*$"))
dostring(a, "=")
assert(debug.getinfo(f).short_src == "")
a = nil; f = nil;
repeat
local g = {x = function ()
local a = debug.getinfo(2)
assert(a.name == 'f' and a.namewhat == 'local')
a = debug.getinfo(1)
assert(a.name == 'x' and a.namewhat == 'field')
return 'xixi'
end}
local f = function () return 1+1 and (not 1 or g.x()) end
assert(f() == 'xixi')
g = debug.getinfo(f)
assert(g.what == "Lua" and g.func == f and g.namewhat == "" and not g.name)
function f (x, name) -- local!
name = name or 'f'
local a = debug.getinfo(1)
assert(a.name == name and a.namewhat == 'local')
return x
end
-- breaks in different conditions
if 3>4 then break end; f()
if 3<4 then a=1 else break end; f()
while 1 do local x=10; break end; f()
local b = 1
if 3>4 then return math.sin(1) end; f()
a = 3<4; f()
a = 3<4 or 1; f()
repeat local x=20; if 4>3 then f() else break end; f() until 1
g = {}
f(g).x = f(2) and f(10)+f(9)
assert(g.x == f(19))
function g(x) if not x then return 3 end return (x('a', 'x')) end
assert(g(f) == 'a')
until 1
test([[if
math.sin(1)
then
a=1
else
a=2
end
]], {2,3,4,7})
test([[--
if nil then
a=1
else
a=2
end
]], {2,5,6})
test([[a=1
repeat
a=a+1
until a==3
]], {1,3,4,3,4})
test([[ do
return
end
]], {2})
test([[local a
a=1
while a<=3 do
a=a+1
end
]], {1,2,3,4,3,4,3,4,3,5})
test([[while math.sin(1) do
if math.sin(1)
then break
end
end
a=1]], {1,2,3,6})
test([[for i=1,3 do
a=i
end
]], {1,2,1,2,1,2,1,3})
test([[for i,v in pairs{'a','b'} do
a=tostring(i) .. v
end
]], {1,2,1,2,1,3})
test([[for i=1,4 do a=1 end]], {1,1,1,1,1})
print'+'
-- invalid levels in [gs]etlocal
assert(not pcall(debug.getlocal, 20, 1))
assert(not pcall(debug.setlocal, -1, 1, 10))
-- parameter names
local function foo (a,b,...) local d, e end
local co = coroutine.create(foo)
assert(debug.getlocal(foo, 1) == 'a')
assert(debug.getlocal(foo, 2) == 'b')
assert(not debug.getlocal(foo, 3))
assert(debug.getlocal(co, foo, 1) == 'a')
assert(debug.getlocal(co, foo, 2) == 'b')
assert(not debug.getlocal(co, foo, 3))
assert(not debug.getlocal(print, 1))
-- varargs
local function foo (a, ...)
local t = table.pack(...)
for i = 1, t.n do
local n, v = debug.getlocal(1, -i)
assert(n == "(*vararg)" and v == t[i])
end
assert(not debug.getlocal(1, -(t.n + 1)))
assert(not debug.setlocal(1, -(t.n + 1), 30))
if t.n > 0 then
(function (x)
assert(debug.setlocal(2, -1, x) == "(*vararg)")
assert(debug.setlocal(2, -t.n, x) == "(*vararg)")
end)(430)
assert(... == 430)
end
end
foo()
foo(print)
foo(200, 3, 4)
local a = {}
for i = 1, (_soft and 100 or 1000) do a[i] = i end
foo(table.unpack(a))
a = nil
-- access to vararg in non-vararg function
local function foo () return debug.getlocal(1, -1) end
assert(not foo(10))
do -- test hook presence in debug info
assert(not debug.gethook())
local count = 0
local function f ()
assert(debug.getinfo(1).namewhat == "hook")
local sndline = string.match(debug.traceback(), "\n(.-)\n")
assert(string.find(sndline, "hook"))
count = count + 1
end
debug.sethook(f, "l")
local a = 0
_ENV.a = a
a = 1
debug.sethook()
assert(count == 4)
end
a = {}; L = nil
local glob = 1
local oldglob = glob
debug.sethook(function (e,l)
collectgarbage() -- force GC during a hook
local f, m, c = debug.gethook()
assert(m == 'crl' and c == 0)
if e == "line" then
if glob ~= oldglob then
L = l-1 -- get the first line where "glob" has changed
oldglob = glob
end
elseif e == "call" then
local f = debug.getinfo(2, "f").func
a[f] = 1
else assert(e == "return")
end
end, "crl")
function f(a,b)
collectgarbage()
local _, x = debug.getlocal(1, 1)
local _, y = debug.getlocal(1, 2)
assert(x == a and y == b)
assert(debug.setlocal(2, 3, "pera") == "AA".."AA")
assert(debug.setlocal(2, 4, "maçã") == "B")
x = debug.getinfo(2)
assert(x.func == g and x.what == "Lua" and x.name == 'g' and
x.nups == 2 and string.find(x.source, "^@.*db%.lua$"))
glob = glob+1
assert(debug.getinfo(1, "l").currentline == L+1)
assert(debug.getinfo(1, "l").currentline == L+2)
end
function foo()
glob = glob+1
assert(debug.getinfo(1, "l").currentline == L+1)
end; foo() -- set L
-- check line counting inside strings and empty lines
_ = 'alo\
alo' .. [[
]]
--[[
]]
assert(debug.getinfo(1, "l").currentline == L+11) -- check count of lines
function g(...)
local arg = {...}
do local a,b,c; a=math.sin(40); end
local feijao
local AAAA,B = "xuxu", "mamão"
f(AAAA,B)
assert(AAAA == "pera" and B == "maçã")
do
local B = 13
local x,y = debug.getlocal(1,5)
assert(x == 'B' and y == 13)
end
end
g()
assert(a[f] and a[g] and a[assert] and a[debug.getlocal] and not a[print])
-- tests for manipulating non-registered locals (C and Lua temporaries)
local n, v = debug.getlocal(0, 1)
assert(v == 0 and n == "(*temporary)")
local n, v = debug.getlocal(0, 2)
assert(v == 2 and n == "(*temporary)")
assert(not debug.getlocal(0, 3))
assert(not debug.getlocal(0, 0))
function f()
assert(select(2, debug.getlocal(2,3)) == 1)
assert(not debug.getlocal(2,4))
debug.setlocal(2, 3, 10)
return 20
end
function g(a,b) return (a+1) + f() end
assert(g(0,0) == 30)
debug.sethook(nil);
assert(debug.gethook() == nil)
-- testing access to function arguments
local function collectlocals (level)
local tab = {}
for i = 1, math.huge do
local n, v = debug.getlocal(level + 1, i)
if not (n and string.find(n, "^[a-zA-Z0-9_]+$")) then
break -- consider only real variables
end
tab[n] = v
end
return tab
end
X = nil
a = {}
function a:f (a, b, ...) local arg = {...}; local c = 13 end
debug.sethook(function (e)
assert(e == "call")
dostring("XX = 12") -- test dostring inside hooks
-- testing errors inside hooks
assert(not pcall(load("a='joao'+1")))
debug.sethook(function (e, l)
assert(debug.getinfo(2, "l").currentline == l)
local f,m,c = debug.gethook()
assert(e == "line")
assert(m == 'l' and c == 0)
debug.sethook(nil) -- hook is called only once
assert(not X) -- check that
X = collectlocals(2)
end, "l")
end, "c")
a:f(1,2,3,4,5)
assert(X.self == a and X.a == 1 and X.b == 2 and X.c == nil)
assert(XX == 12)
assert(debug.gethook() == nil)
-- testing access to local variables in return hook (bug in 5.2)
do
local function foo (a, b)
do local x,y,z end
local c, d = 10, 20
return
end
local function aux ()
if debug.getinfo(2).name == "foo" then
foo = nil -- to signal that it found 'foo'
local tab = {a = 100, b = 200, c = 10, d = 20}
for n, v in pairs(collectlocals(2)) do
assert(tab[n] == v)
tab[n] = nil
end
assert(next(tab) == nil) -- 'tab' must be empty
end
end
debug.sethook(aux, "r"); foo(100, 200); debug.sethook()
assert(foo == nil)
end
-- testing upvalue access
local function getupvalues (f)
local t = {}
local i = 1
while true do
local name, value = debug.getupvalue(f, i)
if not name then break end
assert(not t[name])
t[name] = value
i = i + 1
end
return t
end
local a,b,c = 1,2,3
local function foo1 (a) b = a; return c end
local function foo2 (x) a = x; return c+b end
assert(not debug.getupvalue(foo1, 3))
assert(not debug.getupvalue(foo1, 0))
assert(not debug.setupvalue(foo1, 3, "xuxu"))
local t = getupvalues(foo1)
assert(t.a == nil and t.b == 2 and t.c == 3)
t = getupvalues(foo2)
assert(t.a == 1 and t.b == 2 and t.c == 3)
assert(debug.setupvalue(foo1, 1, "xuxu") == "b")
assert(({debug.getupvalue(foo2, 3)})[2] == "xuxu")
-- upvalues of C functions are allways "called" "" (the empty string)
assert(debug.getupvalue(string.gmatch("x", "x"), 1) == "")
-- testing count hooks
local a=0
debug.sethook(function (e) a=a+1 end, "", 1)
a=0; for i=1,1000 do end; assert(1000 < a and a < 1012)
debug.sethook(function (e) a=a+1 end, "", 4)
a=0; for i=1,1000 do end; assert(250 < a and a < 255)
local f,m,c = debug.gethook()
assert(m == "" and c == 4)
debug.sethook(function (e) a=a+1 end, "", 4000)
a=0; for i=1,1000 do end; assert(a == 0)
do
debug.sethook(print, "", 2^24 - 1) -- count upperbound
local f,m,c = debug.gethook()
assert(({debug.gethook()})[3] == 2^24 - 1)
end
debug.sethook()
-- tests for tail calls
local function f (x)
if x then
assert(debug.getinfo(1, "S").what == "Lua")
assert(debug.getinfo(1, "t").istailcall == true)
local tail = debug.getinfo(2)
assert(tail.func == g1 and tail.istailcall == true)
assert(debug.getinfo(3, "S").what == "main")
print"+"
end
end
function g(x) return f(x) end
function g1(x) g(x) end
local function h (x) local f=g1; return f(x) end
h(true)
local b = {}
debug.sethook(function (e) table.insert(b, e) end, "cr")
h(false)
debug.sethook()
local res = {"return", -- first return (from sethook)
"call", "tail call", "call", "tail call",
"return", "return",
"call", -- last call (to sethook)
}
for i = 1, #res do assert(res[i] == table.remove(b, 1)) end
b = 0
debug.sethook(function (e)
if e == "tail call" then
b = b + 1
assert(debug.getinfo(2, "t").istailcall == true)
else
assert(debug.getinfo(2, "t").istailcall == false)
end
end, "c")
h(false)
debug.sethook()
assert(b == 2) -- two tail calls
lim = _soft and 3000 or 30000
local function foo (x)
if x==0 then
assert(debug.getinfo(2).what == "main")
local info = debug.getinfo(1)
assert(info.istailcall == true and info.func == foo)
else return foo(x-1)
end
end
foo(lim)
print"+"
-- testing local function information
co = load[[
local A = function ()
return x
end
return
]]
local a = 0
-- 'A' should be visible to debugger only after its complete definition
debug.sethook(function (e, l)
if l == 3 then a = a + 1; assert(debug.getlocal(2, 1) == "(*temporary)")
elseif l == 4 then a = a + 1; assert(debug.getlocal(2, 1) == "A")
end
end, "l")
co() -- run local function definition
debug.sethook() -- turn off hook
assert(a == 2) -- ensure all two lines where hooked
-- testing traceback
assert(debug.traceback(print) == print)
assert(debug.traceback(print, 4) == print)
assert(string.find(debug.traceback("hi", 4), "^hi\n"))
assert(string.find(debug.traceback("hi"), "^hi\n"))
assert(not string.find(debug.traceback("hi"), "'debug.traceback'"))
assert(string.find(debug.traceback("hi", 0), "'debug.traceback'"))
assert(string.find(debug.traceback(), "^stack traceback:\n"))
do -- C-function names in traceback
local st, msg = (function () return pcall end)()(debug.traceback)
assert(st == true and string.find(msg, "pcall"))
end
-- testing nparams, nups e isvararg
local t = debug.getinfo(print, "u")
assert(t.isvararg == true and t.nparams == 0 and t.nups == 0)
t = debug.getinfo(function (a,b,c) end, "u")
assert(t.isvararg == false and t.nparams == 3 and t.nups == 0)
t = debug.getinfo(function (a,b,...) return t[a] end, "u")
assert(t.isvararg == true and t.nparams == 2 and t.nups == 1)
t = debug.getinfo(1) -- main
assert(t.isvararg == true and t.nparams == 0 and t.nups == 1 and
debug.getupvalue(t.func, 1) == "_ENV")
-- testing debugging of coroutines
local function checktraceback (co, p, level)
local tb = debug.traceback(co, nil, level)
local i = 0
for l in string.gmatch(tb, "[^\n]+\n?") do
assert(i == 0 or string.find(l, p[i]))
i = i+1
end
assert(p[i] == nil)
end
local function f (n)
if n > 0 then f(n-1)
else coroutine.yield() end
end
local co = coroutine.create(f)
coroutine.resume(co, 3)
checktraceback(co, {"yield", "db.lua", "db.lua", "db.lua", "db.lua"})
checktraceback(co, {"db.lua", "db.lua", "db.lua", "db.lua"}, 1)
checktraceback(co, {"db.lua", "db.lua", "db.lua"}, 2)
checktraceback(co, {"db.lua"}, 4)
checktraceback(co, {}, 40)
co = coroutine.create(function (x)
local a = 1
coroutine.yield(debug.getinfo(1, "l"))
coroutine.yield(debug.getinfo(1, "l").currentline)
return a
end)
local tr = {}
local foo = function (e, l) if l then table.insert(tr, l) end end
debug.sethook(co, foo, "lcr")
local _, l = coroutine.resume(co, 10)
local x = debug.getinfo(co, 1, "lfLS")
assert(x.currentline == l.currentline and x.activelines[x.currentline])
assert(type(x.func) == "function")
for i=x.linedefined + 1, x.lastlinedefined do
assert(x.activelines[i])
x.activelines[i] = nil
end
assert(next(x.activelines) == nil) -- no 'extra' elements
assert(not debug.getinfo(co, 2))
local a,b = debug.getlocal(co, 1, 1)
assert(a == "x" and b == 10)
a,b = debug.getlocal(co, 1, 2)
assert(a == "a" and b == 1)
debug.setlocal(co, 1, 2, "hi")
assert(debug.gethook(co) == foo)
assert(#tr == 2 and
tr[1] == l.currentline-1 and tr[2] == l.currentline)
a,b,c = pcall(coroutine.resume, co)
assert(a and b and c == l.currentline+1)
checktraceback(co, {"yield", "in function <"})
a,b = coroutine.resume(co)
assert(a and b == "hi")
assert(#tr == 4 and tr[4] == l.currentline+2)
assert(debug.gethook(co) == foo)
assert(not debug.gethook())
checktraceback(co, {})
-- check get/setlocal in coroutines
co = coroutine.create(function (x)
local a, b = coroutine.yield(x)
assert(a == 100 and b == nil)
return x
end)
a, b = coroutine.resume(co, 10)
assert(a and b == 10)
a, b = debug.getlocal(co, 1, 1)
assert(a == "x" and b == 10)
assert(not debug.getlocal(co, 1, 5))
assert(debug.setlocal(co, 1, 1, 30) == "x")
assert(not debug.setlocal(co, 1, 5, 40))
a, b = coroutine.resume(co, 100)
assert(a and b == 30)
-- check traceback of suspended (or dead with error) coroutines
function f(i) if i==0 then error(i) else coroutine.yield(); f(i-1) end end
co = coroutine.create(function (x) f(x) end)
a, b = coroutine.resume(co, 3)
t = {"'coroutine.yield'", "'f'", "in function <"}
while coroutine.status(co) == "suspended" do
checktraceback(co, t)
a, b = coroutine.resume(co)
table.insert(t, 2, "'f'") -- one more recursive call to 'f'
end
t[1] = "'error'"
checktraceback(co, t)
-- test acessing line numbers of a coroutine from a resume inside
-- a C function (this is a known bug in Lua 5.0)
local function g(x)
coroutine.yield(x)
end
local function f (i)
debug.sethook(function () end, "l")
for j=1,1000 do
g(i+j)
end
end
local co = coroutine.wrap(f)
co(10)
pcall(co)
pcall(co)
assert(type(debug.getregistry()) == "table")
-- test tagmethod information
local a = {}
local function f (t)
local info = debug.getinfo(1);
assert(info.namewhat == "metamethod")
a.op = info.name
return info.name
end
setmetatable(a, {
__index = f; __add = f; __div = f; __mod = f; __concat = f; __pow = f;
__mul = f; __idiv = f; __unm = f; __len = f; __sub = f;
__shl = f; __shr = f; __bor = f; __bxor = f;
__eq = f; __le = f; __lt = f; __unm = f; __len = f; __band = f;
__bnot = f;
})
local b = setmetatable({}, getmetatable(a))
assert(a[3] == "__index" and a^3 == "__pow" and a..a == "__concat")
assert(a/3 == "__div" and 3%a == "__mod")
assert(a+3 == "__add" and 3-a == "__sub" and a*3 == "__mul" and
-a == "__unm" and #a == "__len" and a&3 == "__band")
assert(a|3 == "__bor" and 3~a == "__bxor" and a<<3 == "__shl" and
a>>1 == "__shr")
assert (a==b and a.op == "__eq")
assert (a>=b and a.op == "__le")
assert (a>b and a.op == "__lt")
assert(~a == "__bnot")
do -- testing for-iterator name
local function f()
assert(debug.getinfo(1).name == "for iterator")
end
for i in f do end
end
do -- testing debug info for finalizers
local name = nil
-- create a piece of garbage with a finalizer
setmetatable({}, {__gc = function ()
local t = debug.getinfo(2) -- get callee information
assert(t.namewhat == "metamethod")
name = t.name
end})
-- repeat until previous finalizer runs (setting 'name')
repeat local a = {} until name
assert(name == "__gc")
end
do
print("testing traceback sizes")
local function countlines (s)
return select(2, string.gsub(s, "\n", ""))
end
local function deep (lvl, n)
if lvl == 0 then
return (debug.traceback("message", n))
else
return (deep(lvl-1, n))
end
end
local function checkdeep (total, start)
local s = deep(total, start)
local rest = string.match(s, "^message\nstack traceback:\n(.*)$")
local cl = countlines(rest)
-- at most 10 lines in first part, 11 in second, plus '...'
assert(cl <= 10 + 11 + 1)
local brk = string.find(rest, "%.%.%.")
if brk then -- does message have '...'?
local rest1 = string.sub(rest, 1, brk)
local rest2 = string.sub(rest, brk, #rest)
assert(countlines(rest1) == 10 and countlines(rest2) == 11)
else
assert(cl == total - start + 2)
end
end
for d = 1, 51, 10 do
for l = 1, d do
-- use coroutines to ensure complete control of the stack
coroutine.wrap(checkdeep)(d, l)
end
end
end
print("testing debug functions on chunk without debug info")
prog = [[-- program to be loaded without debug information
local debug = require'debug'
local a = 12 -- a local variable
local n, v = debug.getlocal(1, 1)
assert(n == "(*temporary)" and v == debug) -- unkown name but known value
n, v = debug.getlocal(1, 2)
assert(n == "(*temporary)" and v == 12) -- unkown name but known value
-- a function with an upvalue
local f = function () local x; return a end
n, v = debug.getupvalue(f, 1)
assert(n == "(*no name)" and v == 12)
assert(debug.setupvalue(f, 1, 13) == "(*no name)")
assert(a == 13)
local t = debug.getinfo(f)
assert(t.name == nil and t.linedefined > 0 and
t.lastlinedefined == t.linedefined and
t.short_src == "?")
assert(debug.getinfo(1).currentline == -1)
t = debug.getinfo(f, "L").activelines
assert(next(t) == nil) -- active lines are empty
-- dump/load a function without debug info
f = load(string.dump(f))
t = debug.getinfo(f)
assert(t.name == nil and t.linedefined > 0 and
t.lastlinedefined == t.linedefined and
t.short_src == "?")
assert(debug.getinfo(1).currentline == -1)
return a
]]
-- load 'prog' without debug info
local f = assert(load(string.dump(load(prog), true)))
assert(f() == 13)
do -- tests for 'source' in binary dumps
local prog = [[
return function (x)
return function (y)
return x + y
end
end
]]
local name = string.rep("x", 1000)
local p = assert(load(prog, name))
-- load 'p' as a binary chunk with debug information
local c = string.dump(p)
assert(#c > 1000 and #c < 2000) -- no repetition of 'source' in dump
local f = assert(load(c))
local g = f()
local h = g(3)
assert(h(5) == 8)
assert(debug.getinfo(f).source == name and -- all functions have 'source'
debug.getinfo(g).source == name and
debug.getinfo(h).source == name)
-- again, without debug info
local c = string.dump(p, true)
assert(#c < 500) -- no 'source' in dump
local f = assert(load(c))
local g = f()
local h = g(30)
assert(h(50) == 80)
assert(debug.getinfo(f).source == '=?' and -- no function has 'source'
debug.getinfo(g).source == '=?' and
debug.getinfo(h).source == '=?')
end
print"OK"
| mit |
davidedmonds/darkstar | scripts/zones/Xarcabard/npcs/Tememe_WW.lua | 30 | 3041 | -----------------------------------
-- Area: Xarcabard
-- NPC: Tememe, W.W.
-- Type: Border Conquest Guards
-- @pos -133.678 -22.517 112.224 112
-----------------------------------
package.loaded["scripts/zones/Xarcabard/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/conquest");
require("scripts/zones/Xarcabard/TextIDs");
local guardnation = WINDURST; -- SANDORIA, BASTOK, WINDURST, 4 = jeuno
local guardtype = 4; -- 1: city, 2: foreign, 3: outpost, 4: border
local region = VALDEAUNIA;
local csid = 0x7ff6;
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
tradeConquestGuard(player,npc,trade,guardnation,guardtype);
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
if (player:hasKeyItem(getSupplyKey(region)) and player:getNation() == guardnation) then
if (supplyRunFresh(player) == 1) then
player:startEvent(csid,16,0,0,0,1,0,0,255); -- you have brought us supplies !
else
player:showText(npc, CONQUEST - 1); -- "Hmm... These supplies you have brought us are too old to be of any use."
player:delKeyItem(getSupplyKey(region));
player:messageSpecial(KEYITEM_OBTAINED + 1, getSupplyKey(region));
player:setVar("supplyQuest_region",0);
end
else
local arg1 = getArg1(guardnation, player) - 1;
if (arg1 >= 1792) then -- foreign, non-allied
player:startEvent(csid,1808,0,0,0,0,player:getRank(),0,0);
else -- citizen or allied
player:startEvent(csid,arg1,0,0x3F0000,0,0,getArg6(player),0,0);
end
end
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("OPTION: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("OPTION: %u",option);
if (option == 1) then
local duration = (player:getRank() + getNationRank(player:getNation()) + 3) * 3600;
player:delStatusEffect(EFFECT_SIGIL);
player:delStatusEffect(EFFECT_SANCTION);
player:delStatusEffect(EFFECT_SIGNET);
player:addStatusEffect(EFFECT_SIGNET,0,0,duration); -- Grant Signet
elseif (option == 2) then
player:delKeyItem(getSupplyKey(region));
player:addCP(supplyReward[region + 1])
player:messageSpecial(CONQUEST); -- "You've earned conquest points!"
if (hasOutpost(player, region+5) == 0) then
local supply_quests = 2^(region+5);
player:addNationTeleport(guardnation,supply_quests);
player:setVar("supplyQuest_region",0);
end
elseif (option == 4) then
if (player:delGil(giltosetHP(guardnation,player))) then
player:setHomePoint();
player:messageSpecial(CONQUEST + 94); -- "Your home point has been set."
else
player:messageSpecial(CONQUEST + 95); -- "You do not have enough gil to set your home point here."
end
end
end; | gpl-3.0 |
unknowntg/unknowntg | plugins/inrealm.lua | 3 | 25139 | -- 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 'گروه [ '..string.gsub(group_name, '_', ' ')..' ] ساخته شد'
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 'ریلم [ '..string.gsub(group_name, '_', ' ')..' ] ساخته شد'
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 'هیچ حالتی برای این گروه به ثبت نرسیده است.'
end
local group_type = data[tostring(msg.to.id)]['group_type']
return group_type
else
return 'چت پیدا نشد.'
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 |
davidedmonds/darkstar | scripts/zones/Southern_San_dOria_[S]/npcs/Raustigne.lua | 16 | 1506 | -----------------------------------
-- Area: Southern SandOria [S]
-- NPC: Raustigne
-- @zone 80
-- @pos 4 -2 44
-----------------------------------
package.loaded["scripts/zones/Southern_San_dOria_[S]/TextIDs"] = nil;
require("scripts/zones/Southern_San_dOria_[S]/TextIDs");
require("scripts/globals/quests");
require("scripts/globals/settings");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
if (player:getQuestStatus(CRYSTAL_WAR, CLAWS_OF_THE_GRIFFON) == QUEST_COMPLETED and player:getVar("BoyAndTheBeast") == 0) then
if (player:getCurrentMission(WOTG) == CAIT_SITH or player:hasCompletedMission(WOTG, CAIT_SITH)) then
player:startEvent(0x0037);
end
else
player:startEvent(0x0025E);
end
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
if (csid == 0x0037) then
player:setVar("BoyAndTheBeast",1);
end
end; | gpl-3.0 |
kidaa/darkstar | scripts/zones/Palborough_Mines/npcs/_3z9.lua | 19 | 1592 | -----------------------------------
-- Area: Palborough Mines
-- NPC: Refiner Lever
-- Involved In Mission: Journey Abroad
-- @zone 143
-- @pos 180 -32 167
-----------------------------------
package.loaded["scripts/zones/Palborough_Mines/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/settings");
require("scripts/zones/Palborough_Mines/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
refiner_output = player:getVar("refiner_output");
if(refiner_output > 0 and player:getFreeSlotsCount() >= 1) then
player:setVar("refiner_output",refiner_output - 1)
player:messageSpecial(SOMETHING_FALLS_OUT_OF_THE_MACHINE);
player:addItem(599);
player:messageSpecial(ITEM_OBTAINED,599,1);
elseif(refiner_output > 0 and player:getFreeSlotsCount() == 0) then
player:messageSpecial(YOU_CANT_CARRY_ANY_MORE_ITEMS);
else
player:messageSpecial(THE_MACHINE_SEEMS_TO_BE_WORKING);
end
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end; | gpl-3.0 |
will4wachter/Project1 | scripts/globals/weaponskills/ascetics_fury.lua | 4 | 4422 | -----------------------------------
-- Ascetics Fury
-- Hand-to-Hand weapon skill
-- Skill Level: N/A
-- Chance of params.critical hit varies with TP. Glanzfaust: Aftermath effect varies with TP.
-- Available only after completing the Unlocking a Myth (Monk) quest.
-- Aligned with the Flame Gorget & Light Gorget.
-- Aligned with the Flame Belt & Light Belt.
-- Element: None
-- Modifiers: STR:50% ; VIT:50%
-- 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)
local params = {};
params.numHits = 1;
params.ftp100 = 1; params.ftp200 = 1; params.ftp300 = 1;
params.str_wsc = 0.5; params.dex_wsc = 0.0; params.vit_wsc = 0.5; params.agi_wsc = 0.0; params.int_wsc = 0.0; params.mnd_wsc = 0.0; params.chr_wsc = 0.0;
params.crit100 = 0.1; params.crit200 = 0.3; params.crit300 = 0.5;
params.canCrit = true;
params.acc100 = 0.0; params.acc200= 0.0; params.acc300= 0.0;
params.atkmulti = 1;
local damage, criticalHit, tpHits, extraHits = doPhysicalWeaponskill(player, target, params);
if((player:getEquipID(SLOT_MAIN) == 18992) and (player:getMainJob() == JOB_MNK)) then
if(damage > 0) then
-- AFTERMATH LEVEL 1
if ((player:getTP() >= 100) and (player:getTP() <= 110)) then
player:addStatusEffect(EFFECT_AFTERMATH_LV1, 10, 0, 180, 0, 1);
elseif ((player:getTP() >= 111) and (player:getTP() <= 120)) then
player:addStatusEffect(EFFECT_AFTERMATH_LV1, 11, 0, 180, 0, 1);
elseif ((player:getTP() >= 121) and (player:getTP() <= 130)) then
player:addStatusEffect(EFFECT_AFTERMATH_LV1, 12, 0, 180, 0, 1);
elseif ((player:getTP() >= 131) and (player:getTP() <= 140)) then
player:addStatusEffect(EFFECT_AFTERMATH_LV1, 13, 0, 180, 0, 1);
elseif ((player:getTP() >= 141) and (player:getTP() <= 150)) then
player:addStatusEffect(EFFECT_AFTERMATH_LV1, 14, 0, 180, 0, 1);
elseif ((player:getTP() >= 151) and (player:getTP() <= 160)) then
player:addStatusEffect(EFFECT_AFTERMATH_LV1, 15, 0, 180, 0, 1);
elseif ((player:getTP() >= 161) and (player:getTP() <= 170)) then
player:addStatusEffect(EFFECT_AFTERMATH_LV1, 16, 0, 180, 0, 1);
elseif ((player:getTP() >= 171) and (player:getTP() <= 180)) then
player:addStatusEffect(EFFECT_AFTERMATH_LV1, 17, 0, 180, 0, 1);
elseif ((player:getTP() >= 181) and (player:getTP() <= 190)) then
player:addStatusEffect(EFFECT_AFTERMATH_LV1, 18, 0, 180, 0, 1);
elseif ((player:getTP() >= 191) and (player:getTP() <= 199)) then
player:addStatusEffect(EFFECT_AFTERMATH_LV1, 19, 0, 180, 0, 1);
-- AFTERMATH LEVEL 2
elseif ((player:getTP() >= 200) and (player:getTP() <= 210)) then
player:addStatusEffect(EFFECT_AFTERMATH_LV2, 24, 0, 180, 0, 1);
elseif ((player:getTP() >= 211) and (player:getTP() <= 219)) then
player:addStatusEffect(EFFECT_AFTERMATH_LV2, 28, 0, 180, 0, 1);
elseif ((player:getTP() >= 221) and (player:getTP() <= 229)) then
player:addStatusEffect(EFFECT_AFTERMATH_LV2, 32, 0, 180, 0, 1);
elseif ((player:getTP() >= 231) and (player:getTP() <= 239)) then
player:addStatusEffect(EFFECT_AFTERMATH_LV2, 36, 0, 180, 0, 1);
elseif ((player:getTP() >= 241) and (player:getTP() <= 249)) then
player:addStatusEffect(EFFECT_AFTERMATH_LV2, 40, 0, 180, 0, 1);
elseif ((player:getTP() >= 251) and (player:getTP() <= 259)) then
player:addStatusEffect(EFFECT_AFTERMATH_LV2, 44, 0, 180, 0, 1);
elseif ((player:getTP() >= 261) and (player:getTP() <= 269)) then
player:addStatusEffect(EFFECT_AFTERMATH_LV2, 48, 0, 180, 0, 1);
elseif ((player:getTP() >= 271) and (player:getTP() <= 279)) then
player:addStatusEffect(EFFECT_AFTERMATH_LV2, 52, 0, 180, 0, 1);
elseif ((player:getTP() >= 281) and (player:getTP() <= 289)) then
player:addStatusEffect(EFFECT_AFTERMATH_LV2, 56, 0, 180, 0, 1);
elseif ((player:getTP() >= 291) and (player:getTP() <= 299)) then
player:addStatusEffect(EFFECT_AFTERMATH_LV2, 59, 0, 180, 0, 1);
-- AFTERMATH LEVEL 3
elseif ((player:getTP() == 300)) then
player:addStatusEffect(EFFECT_AFTERMATH_LV3, 45, 0, 120, 0, 1);
end
end
end
return tpHits, extraHits, criticalHit, damage;
end; | gpl-3.0 |
kidaa/darkstar | scripts/zones/Metalworks/npcs/Udine_AMAN.lua | 32 | 1364 | -----------------------------------
-- Area: Metalworks
-- NPC: Udine A.M.A.N
-- Type: Mentor Recruiter
-----------------------------------
package.loaded["scripts/zones/Metalworks/TextIDs"] = nil;
-----------------------------------
require("scripts/zones/Metalworks/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
local var = 0;
if (player:getMentor() == 0) then
if (player:getMainLvl() >= 30 and player:getPlaytime() >= 648000) then
var = 1;
end
elseif (player:getMentor() >= 1) then
var = 2;
end
player:startEvent(0x033A, var);
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
if (csid == 0X033A and option == 0) then
player:setMentor(1);
end
end;
| gpl-3.0 |
will4wachter/Project1 | scripts/globals/pets.lua | 37 | 36137 | -----------------------------------
--
-- PETS ID
--
-----------------------------------
-----------------------------------
-- PETTYPE
-----------------------------------
PETTYPE_AVATAR = 0;
PETTYPE_WYVERN = 1;
PETTYPE_JUGPET = 2;
PETTYPE_CHARMED_MOB = 3;
PETTYPE_AUTOMATON = 4;
PETTYPE_ADVENTURING_FELLOW= 5;
PETTYPE_CHOCOBO = 6;
-----------------------------------
-- PETNAME
-----------------------------------
PETNAME_AZURE = 1;
PETNAME_CERULEAN = 2;
PETNAME_RYGOR = 3;
PETNAME_FIREWING = 4;
PETNAME_DELPHYNE = 5;
PETNAME_EMBER = 6;
PETNAME_ROVER = 7;
PETNAME_MAX = 8;
PETNAME_BUSTER = 9;
PETNAME_DUKE = 10;
PETNAME_OSCAR = 11;
PETNAME_MAGGIE = 12;
PETNAME_JESSIE = 13;
PETNAME_LADY = 14;
PETNAME_HIEN = 15;
PETNAME_RAIDEN = 16;
PETNAME_LUMIERE = 17;
PETNAME_EISENZAHN = 18;
PETNAME_PFEIL = 19;
PETNAME_WUFFI = 20;
PETNAME_GEORGE = 21;
PETNAME_DONRYU = 22;
PETNAME_QIQIRU = 23;
PETNAME_KARAV_MARAV = 24;
PETNAME_OBORO = 25;
PETNAME_DARUG_BORUG = 26;
PETNAME_MIKAN = 27;
PETNAME_VHIKI = 28;
PETNAME_SASAVI = 29;
PETNAME_TATANG = 30;
PETNAME_NANAJA = 31;
PETNAME_KHOCHA = 32;
PETNAME_DINO = 33;
PETNAME_CHOMPER = 34;
PETNAME_HUFFY = 35;
PETNAME_POUNCER = 36;
PETNAME_FIDO = 37;
PETNAME_LUCY = 38;
PETNAME_JAKE = 39;
PETNAME_ROCKY = 40;
PETNAME_REX = 41;
PETNAME_RUSTY = 42;
PETNAME_HIMMELSKRALLE = 43;
PETNAME_GIZMO = 44;
PETNAME_SPIKE = 45;
PETNAME_SYLVESTER = 46;
PETNAME_MILO = 47;
PETNAME_TOM = 48;
PETNAME_TOBY = 49;
PETNAME_FELIX = 50;
PETNAME_KOMET = 51;
PETNAME_BO = 52;
PETNAME_MOLLY = 53;
PETNAME_UNRYU = 54;
PETNAME_DAISY = 55;
PETNAME_BARON = 56;
PETNAME_GINGER = 57;
PETNAME_MUFFIN = 58;
PETNAME_LUMINEUX = 59;
PETNAME_QUATREVENTS = 60;
PETNAME_TORYU = 61;
PETNAME_TATABA = 62;
PETNAME_ETOILAZUREE = 63;
PETNAME_GRISNUAGE = 64;
PETNAME_BELORAGE = 65;
PETNAME_CENTONNERRE = 66;
PETNAME_NOUVELLUNE = 67;
PETNAME_MISSY = 68;
PETNAME_AMEDEO = 69;
PETNAME_TRANCHEVENT = 70;
PETNAME_SOUFFLEFEU = 71;
PETNAME_ETOILE = 72;
PETNAME_TONNERRE = 73;
PETNAME_NUAGE = 74;
PETNAME_FOUDRE = 75;
PETNAME_HYUH = 76;
PETNAME_ORAGE = 77;
PETNAME_LUNE = 78;
PETNAME_ASTRE = 79;
PETNAME_WAFFENZAHN = 80;
PETNAME_SOLEIL = 81;
PETNAME_COURAGEUX = 82;
PETNAME_KOFFLA_PAFFLA = 83;
PETNAME_VENTEUSE = 84;
PETNAME_LUNAIRE = 85;
PETNAME_TORA = 86;
PETNAME_CELESTE = 87;
PETNAME_GALJA_MOGALJA = 88;
PETNAME_GABOH = 89;
PETNAME_VHYUN = 90;
PETNAME_ORAGEUSE = 91;
PETNAME_STELLAIRE = 92;
PETNAME_SOLAIRE = 93;
PETNAME_WIRBELWIND = 94;
PETNAME_BLUTKRALLE = 95;
PETNAME_BOGEN = 96;
PETNAME_JUNKER = 97;
PETNAME_FLINK = 98;
PETNAME_KNIRPS = 99;
PETNAME_BODO = 100;
PETNAME_SORYU = 101;
PETNAME_WAWARO = 102;
PETNAME_TOTONA = 103;
PETNAME_LEVIAN_MOVIAN = 104;
PETNAME_KAGERO = 105;
PETNAME_JOSEPH = 106;
PETNAME_PAPARAL = 107;
PETNAME_COCO = 108;
PETNAME_RINGO = 109;
PETNAME_NONOMI = 110;
PETNAME_TETER = 111;
PETNAME_GIGIMA = 112;
PETNAME_GOGODAVI = 113;
PETNAME_RURUMO = 114;
PETNAME_TUPAH = 115;
PETNAME_JYUBIH = 116;
PETNAME_MAJHA = 117;
PETNAME_LURON = 118;
PETNAME_DRILLE = 119;
PETNAME_TOURNEFOUX = 120;
PETNAME_CHAFOUIN = 121;
PETNAME_PLAISANTIN = 122;
PETNAME_LOUSTIC = 123;
PETNAME_HISTRION = 124;
PETNAME_BOBECHE = 125;
PETNAME_BOUGRION = 126;
PETNAME_ROULETEAU = 127;
PETNAME_ALLOUETTE = 128;
PETNAME_SERENADE = 129;
PETNAME_FICELETTE = 130;
PETNAME_TOCADIE = 131;
PETNAME_CAPRICE = 132;
PETNAME_FOUCADE = 133;
PETNAME_CAPILLOTTE = 134;
PETNAME_QUENOTTE = 135;
PETNAME_PACOTILLE = 136;
PETNAME_COMEDIE = 137;
PETNAME_KAGEKIYO = 138;
PETNAME_TORAOH = 139;
PETNAME_GENTA = 140;
PETNAME_KINTOKI = 141;
PETNAME_KOUMEI = 142;
PETNAME_PAMAMA = 143;
PETNAME_LOBO = 144;
PETNAME_TSUKUSHI = 145;
PETNAME_ONIWAKA = 146;
PETNAME_KENBISHI = 147;
PETNAME_HANNYA = 148;
PETNAME_MASHIRA = 149;
PETNAME_NADESHIKO = 150;
PETNAME_E100 = 151;
PETNAME_KOUME = 152;
PETNAME_X_32 = 153;
PETNAME_POPPO = 154;
PETNAME_ASUKA = 155;
PETNAME_SAKURA = 156;
PETNAME_TAO = 157;
PETNAME_MAO = 158;
PETNAME_GADGET = 159;
PETNAME_MARION = 160;
PETNAME_WIDGET = 161;
PETNAME_QUIRK = 162;
PETNAME_SPROCKET = 163;
PETNAME_COGETTE = 164;
PETNAME_LECTER = 165;
PETNAME_COPPELIA = 166;
PETNAME_SPARKY = 167;
PETNAME_CLANK = 168;
PETNAME_CALCOBRENA = 169;
PETNAME_CRACKLE = 170;
PETNAME_RICOCHET = 171;
PETNAME_JOSETTE = 172;
PETNAME_FRITZ = 173;
PETNAME_SKIPPY = 174;
PETNAME_PINO = 175;
PETNAME_MANDARIN = 176;
PETNAME_JACKSTRAW = 177;
PETNAME_GUIGNOL = 178;
PETNAME_MOPPET = 179;
PETNAME_NUTCRACKER = 180;
PETNAME_ERWIN = 181;
PETNAME_OTTO = 182;
PETNAME_GUSTAV = 183;
PETNAME_MUFFIN = 184;
PETNAME_XAVER = 185;
PETNAME_TONI = 186;
PETNAME_INA = 187;
PETNAME_GERDA = 188;
PETNAME_PETRA = 189;
PETNAME_VERENA = 190;
PETNAME_ROSI = 191;
PETNAME_SCHATZI = 192;
PETNAME_WARASHI = 193;
PETNAME_KLINGEL = 194;
PETNAME_CLOCHETTE = 195;
PETNAME_CAMPANELLO = 196;
PETNAME_KAISERIN = 197;
PETNAME_PRINCIPESSA = 198;
PETNAME_BUTLER = 199;
PETNAME_GRAF = 200;
PETNAME_CARO = 201;
PETNAME_CARA = 202;
PETNAME_MADEMOISELLE = 203;
PETNAME_HERZOG = 204;
PETNAME_TRAMP = 205;
PETNAME_V_1000 = 206;
PETNAME_HIKOZAEMON = 207;
PETNAME_NINE = 208;
PETNAME_ACHT = 209;
PETNAME_QUATTRO = 210;
PETNAME_ZERO = 211;
PETNAME_DREIZEHN = 212;
PETNAME_SEIZE = 213;
PETNAME_FUKUSUKE = 214;
PETNAME_MATAEMON = 215;
PETNAME_KANSUKE = 216;
PETNAME_POLICHINELLE = 217;
PETNAME_TOBISUKE = 218;
PETNAME_SASUKE = 219;
PETNAME_SHIJIMI = 220;
PETNAME_CHOBI = 221;
PETNAME_AURELIE = 222;
PETNAME_MAGALIE = 223;
PETNAME_AURORE = 224;
PETNAME_CAROLINE = 225;
PETNAME_ANDREA = 226;
PETNAME_MACHINETTE = 227;
PETNAME_CLARINE = 228;
PETNAME_ARMELLE = 229;
PETNAME_REINETTE = 230;
PETNAME_DORLOTE = 231;
PETNAME_TURLUPIN = 232;
PETNAME_KLAXON = 233;
PETNAME_BAMBINO = 234;
PETNAME_POTIRON = 235;
PETNAME_FUSTIGE = 236;
PETNAME_AMIDON = 237;
PETNAME_MACHIN = 238;
PETNAME_BIDULON = 239;
PETNAME_TANDEM = 240;
PETNAME_PRESTIDIGE = 241;
PETNAME_PURUTE_PORUTE = 242;
PETNAME_BITO_RABITO = 243;
PETNAME_COCOA = 244;
PETNAME_TOTOMO = 245;
PETNAME_CENTURION = 246;
PETNAME_A7V = 247;
PETNAME_SCIPIO = 248;
PETNAME_SENTINEL = 249;
PETNAME_PIONEER = 250;
PETNAME_SENESCHAL = 251;
PETNAME_GINJIN = 252;
PETNAME_AMAGATSU = 253;
PETNAME_DOLLY = 254;
PETNAME_FANTOCCINI = 255;
PETNAME_JOE = 256;
PETNAME_KIKIZARU = 257;
PETNAME_WHIPPET = 258;
PETNAME_PUNCHINELLO = 259;
PETNAME_CHARLIE = 260;
PETNAME_MIDGE = 261;
PETNAME_PETROUCHKA = 262;
PETNAME_SCHNEIDER = 263;
PETNAME_USHABTI = 264;
PETNAME_NOEL = 265;
PETNAME_YAJIROBE = 266;
PETNAME_HINA = 267;
PETNAME_NORA = 268;
PETNAME_SHOKI = 269;
PETNAME_KOBINA = 270;
PETNAME_KOKESHI = 271;
PETNAME_MAME = 272;
PETNAME_BISHOP = 273;
PETNAME_MARVIN = 274;
PETNAME_DORA = 275;
PETNAME_DATA = 276;
PETNAME_ROBIN = 277;
PETNAME_ROBBY = 278;
PETNAME_PORLO_MOPERLO = 279;
PETNAME_PAROKO_PURONKO= 280;
PETNAME_PIPIMA = 281;
PETNAME_GAGAJA = 282;
PETNAME_MOBIL = 283;
PETNAME_DONZEL = 284;
PETNAME_ARCHER = 285;
PETNAME_SHOOTER = 286;
PETNAME_STEPHEN = 287;
PETNAME_MK_IV = 288;
PETNAME_CONJURER = 289;
PETNAME_FOOTMAN = 290;
PETNAME_TOKOTOKO = 291;
PETNAME_SANCHO = 292;
PETNAME_SARUMARO = 293;
PETNAME_PICKET = 294;
PETNAME_MUSHROOM = 295;
PETNAME_G = 296;
PETNAME_I = 297;
PETNAME_Q = 298;
PETNAME_V = 299;
PETNAME_X = 300;
PETNAME_Z = 301;
PETNAME_II = 302;
PETNAME_IV = 303;
PETNAME_IX = 304;
PETNAME_OR = 305;
PETNAME_VI = 306;
PETNAME_XI = 307;
PETNAME_ACE = 308;
PETNAME_AIR = 309;
PETNAME_AKI = 310;
PETNAME_AYU = 311;
PETNAME_BAT = 312;
PETNAME_BEC = 313;
PETNAME_BEL = 314;
PETNAME_BIG = 315;
PETNAME_BON = 316;
PETNAME_BOY = 317;
PETNAME_CAP = 318;
PETNAME_COQ = 319;
PETNAME_CRY = 320;
PETNAME_DOM = 321;
PETNAME_DUC = 322;
PETNAME_DUN = 323;
PETNAME_END = 324;
PETNAME_ETE = 325;
PETNAME_EYE = 326;
PETNAME_FAT = 327;
PETNAME_FEE = 328;
PETNAME_FER = 329;
PETNAME_FEU = 330;
PETNAME_FOG = 331;
PETNAME_FOX = 332;
PETNAME_HOT = 333;
PETNAME_ICE = 334;
PETNAME_ICE = 335;
PETNAME_ICY = 336;
PETNAME_III = 337;
PETNAME_JET = 338;
PETNAME_JOY = 339;
PETNAME_LEG = 340;
PETNAME_MAX = 341;
PETNAME_NEO = 342;
PETNAME_ONE = 343;
PETNAME_PUR = 344;
PETNAME_RAY = 345;
PETNAME_RED = 346;
PETNAME_ROI = 347;
PETNAME_SEA = 348;
PETNAME_SKY = 349;
PETNAME_SUI = 350;
PETNAME_SUN = 351;
PETNAME_TEN = 352;
PETNAME_VIF = 353;
PETNAME_VII = 354;
PETNAME_XII = 355;
PETNAME_AILE = 356;
PETNAME_ANGE = 357;
PETNAME_ARDI = 358;
PETNAME_BEAK = 359;
PETNAME_BEAU = 360;
PETNAME_BEST = 361;
PETNAME_BLEU = 362;
PETNAME_BLUE = 363;
PETNAME_BONE = 364;
PETNAME_CART = 365;
PETNAME_CHIC = 366;
PETNAME_CIEL = 367;
PETNAME_CLAW = 368;
PETNAME_COOL = 369;
PETNAME_DAME = 370;
PETNAME_DARK = 371;
PETNAME_DORE = 372;
PETNAME_DRAY = 373;
PETNAME_DUKE = 374;
PETNAME_EASY = 375;
PETNAME_EDEL = 376;
PETNAME_FACE = 377;
PETNAME_FAST = 378;
PETNAME_FIER = 379;
PETNAME_FINE = 380;
PETNAME_FIRE = 381;
PETNAME_FOOT = 382;
PETNAME_FURY = 383;
PETNAME_FUYU = 384;
PETNAME_GALE = 385;
PETNAME_GIRL = 386;
PETNAME_GOER = 387;
PETNAME_GOLD = 388;
PETNAME_GOOD = 389;
PETNAME_GRAF = 390;
PETNAME_GRAY = 391;
PETNAME_GUST = 392;
PETNAME_GUTE = 393;
PETNAME_HAOH = 394;
PETNAME_HARU = 395;
PETNAME_HELD = 396;
PETNAME_HERO = 397;
PETNAME_HOPE = 398;
PETNAME_IDOL = 399;
PETNAME_IRIS = 400;
PETNAME_IRON = 401;
PETNAME_JACK = 402;
PETNAME_JADE = 403;
PETNAME_JOLI = 404;
PETNAME_JUNG = 405;
PETNAME_KIKU = 406;
PETNAME_KING = 407;
PETNAME_KOPF = 408;
PETNAME_LADY = 409;
PETNAME_LAST = 410;
PETNAME_LILI = 411;
PETNAME_LILY = 412;
PETNAME_LINE = 413;
PETNAME_LONG = 414;
PETNAME_LORD = 415;
PETNAME_LUFT = 416;
PETNAME_LUNA = 417;
PETNAME_LUNE = 418;
PETNAME_MAMA = 419;
PETNAME_MARS = 420;
PETNAME_MIEL = 421;
PETNAME_MISS = 422;
PETNAME_MOMO = 423;
PETNAME_MOND = 424;
PETNAME_MOON = 425;
PETNAME_NANA = 426;
PETNAME_NICE = 427;
PETNAME_NOIR = 428;
PETNAME_NONO = 429;
PETNAME_NOVA = 430;
PETNAME_NUIT = 431;
PETNAME_OCRE = 432;
PETNAME_OLLE = 433;
PETNAME_PAPA = 434;
PETNAME_PERS = 435;
PETNAME_PHAR = 436;
PETNAME_PONY = 437;
PETNAME_PURE = 438;
PETNAME_RAIN = 439;
PETNAME_RICE = 440;
PETNAME_RICH = 441;
PETNAME_ROAD = 442;
PETNAME_ROSE = 443;
PETNAME_ROTE = 444;
PETNAME_ROUX = 445;
PETNAME_RUBY = 446;
PETNAME_SAGE = 447;
PETNAME_SNOW = 448;
PETNAME_STAR = 449;
PETNAME_TAIL = 450;
PETNAME_TROT = 451;
PETNAME_VEGA = 452;
PETNAME_VENT = 453;
PETNAME_VERT = 454;
PETNAME_VIII = 455;
PETNAME_VIVE = 456;
PETNAME_WAVE = 457;
PETNAME_WEST = 458;
PETNAME_WILD = 459;
PETNAME_WIND = 460;
PETNAME_WING = 461;
PETNAME_XIII = 462;
PETNAME_ZERO = 463;
PETNAME_ACIER = 464;
PETNAME_AGATE = 465;
PETNAME_AGILE = 466;
PETNAME_AGNES = 467;
PETNAME_AILEE = 468;
PETNAME_ALPHA = 469;
PETNAME_AMBER = 470;
PETNAME_AMBRE = 471;
PETNAME_ANGEL = 472;
PETNAME_ARDIE = 473;
PETNAME_ARKIE = 474;
PETNAME_ARROW = 475;
PETNAME_AVIAN = 476;
PETNAME_AZURE = 477;
PETNAME_BARON = 478;
PETNAME_BELLE = 479;
PETNAME_BERYL = 480;
PETNAME_BLACK = 481;
PETNAME_BLADE = 482;
PETNAME_BLAUE = 483;
PETNAME_BLAZE = 484;
PETNAME_BLEUE = 485;
PETNAME_BLITZ = 486;
PETNAME_BLOND = 487;
PETNAME_BLOOD = 488;
PETNAME_BONNE = 489;
PETNAME_BRAVE = 490;
PETNAME_BRIAN = 491;
PETNAME_BRISE = 492;
PETNAME_BURST = 493;
PETNAME_CALME = 494;
PETNAME_CHAOS = 495;
PETNAME_CLAIR = 496;
PETNAME_CLOUD = 497;
PETNAME_COMET = 498;
PETNAME_COMTE = 499;
PETNAME_COURT = 500;
PETNAME_CRAFT = 501;
PETNAME_CRETE = 502;
PETNAME_CROWN = 503;
PETNAME_DANCE = 504;
PETNAME_DANDY = 505;
PETNAME_DEVIL = 506;
PETNAME_DIANA = 507;
PETNAME_DOREE = 508;
PETNAME_DREAM = 509;
PETNAME_EAGER = 510;
PETNAME_EAGLE = 511;
PETNAME_EBONY = 512;
PETNAME_EISEN = 513;
PETNAME_EMBER = 514;
PETNAME_ENGEL = 515;
PETNAME_FAIRY = 516;
PETNAME_FATTY = 517;
PETNAME_FEDER = 518;
PETNAME_FEUER = 519;
PETNAME_FIERE = 520;
PETNAME_FIERY = 521;
PETNAME_FINAL = 522;
PETNAME_FLARE = 523;
PETNAME_FLEET = 524;
PETNAME_FLEUR = 525;
PETNAME_FLIER = 526;
PETNAME_FLOOD = 527;
PETNAME_FLORA = 528;
PETNAME_FLYER = 529;
PETNAME_FRAIS = 530;
PETNAME_FROST = 531;
PETNAME_FUCHS = 532;
PETNAME_GALOP = 533;
PETNAME_GEIST = 534;
PETNAME_GELBE = 535;
PETNAME_GHOST = 536;
PETNAME_GLORY = 537;
PETNAME_GRAND = 538;
PETNAME_GREAT = 539;
PETNAME_GREEN = 540;
PETNAME_GUTER = 541;
PETNAME_GUTES = 542;
PETNAME_HEART = 543;
PETNAME_HELLE = 544;
PETNAME_HIDEN = 545;
PETNAME_HITEN = 546;
PETNAME_HIVER = 547;
PETNAME_HOBBY = 548;
PETNAME_HYPER = 549;
PETNAME_IVORY = 550;
PETNAME_JAUNE = 551;
PETNAME_JEUNE = 552;
PETNAME_JINPU = 553;
PETNAME_JOLIE = 554;
PETNAME_JOLLY = 555;
PETNAME_KLUGE = 556;
PETNAME_KNIFE = 557;
PETNAME_KOMET = 558;
PETNAME_KUGEL = 559;
PETNAME_LAHME = 560;
PETNAME_LESTE = 561;
PETNAME_LIGHT = 562;
PETNAME_LILAS = 563;
PETNAME_LUCKY = 564;
PETNAME_LUNAR = 565;
PETNAME_LUTIN = 566;
PETNAME_MAGIC = 567;
PETNAME_MERRY = 568;
PETNAME_METAL = 569;
PETNAME_NATSU = 570;
PETNAME_NEDDY = 571;
PETNAME_NIGHT = 572;
PETNAME_NINJA = 573;
PETNAME_NOBLE = 574;
PETNAME_NOIRE = 575;
PETNAME_NUAGE = 576;
PETNAME_OCREE = 577;
PETNAME_OLIVE = 578;
PETNAME_OLLER = 579;
PETNAME_OLLES = 580;
PETNAME_OMEGA = 581;
PETNAME_OPALE = 582;
PETNAME_ORAGE = 583;
PETNAME_PATTE = 584;
PETNAME_PEACE = 585;
PETNAME_PENNE = 586;
PETNAME_PETIT = 587;
PETNAME_PFEIL = 588;
PETNAME_PLUIE = 589;
PETNAME_PLUME = 590;
PETNAME_PLUTO = 591;
PETNAME_POINT = 592;
PETNAME_POMME = 593;
PETNAME_POWER = 594;
PETNAME_QUAKE = 595;
PETNAME_QUEEN = 596;
PETNAME_QUEUE = 597;
PETNAME_REINE = 598;
PETNAME_REPPU = 599;
PETNAME_RICHE = 600;
PETNAME_RIEUR = 601;
PETNAME_ROTER = 602;
PETNAME_ROTES = 603;
PETNAME_ROUGE = 604;
PETNAME_ROYAL = 605;
PETNAME_RUBIN = 606;
PETNAME_RUBIS = 607;
PETNAME_SAURE = 608;
PETNAME_SERRE = 609;
PETNAME_SMALT = 610;
PETNAME_SNOWY = 611;
PETNAME_SOLAR = 612;
PETNAME_SPARK = 613;
PETNAME_SPEED = 614;
PETNAME_STEED = 615;
PETNAME_STERN = 616;
PETNAME_STONE = 617;
PETNAME_STORM = 618;
PETNAME_STURM = 619;
PETNAME_STUTE = 620;
PETNAME_SUPER = 621;
PETNAME_SWEEP = 622;
PETNAME_SWEET = 623;
PETNAME_SWIFT = 624;
PETNAME_TALON = 625;
PETNAME_TEIOH = 626;
PETNAME_TITAN = 627;
PETNAME_TURBO = 628;
PETNAME_ULTRA = 629;
PETNAME_URARA = 630;
PETNAME_VENUS = 631;
PETNAME_VERTE = 632;
PETNAME_VERVE = 633;
PETNAME_VIVID = 634;
PETNAME_VOGEL = 635;
PETNAME_YOUNG = 636;
PETNAME_ZIPPY = 637;
PETNAME_AIRAIN = 638;
PETNAME_AMBREE = 639;
PETNAME_AMIRAL = 640;
PETNAME_ARASHI = 641;
PETNAME_ARCHER = 642;
PETNAME_ARDENT = 643;
PETNAME_ARGENT = 644;
PETNAME_AUDACE = 645;
PETNAME_AUTUMN = 646;
PETNAME_BATTLE = 647;
PETNAME_BEAUTE = 648;
PETNAME_BEAUTY = 649;
PETNAME_BEETLE = 650;
PETNAME_BLAUER = 651;
PETNAME_BLAUES = 652;
PETNAME_BLEUET = 653;
PETNAME_BLONDE = 654;
PETNAME_BONBON = 655;
PETNAME_BREEZE = 656;
PETNAME_BRONZE = 657;
PETNAME_BRUMBY = 658;
PETNAME_BUCKER = 659;
PETNAME_CAESAR = 660;
PETNAME_CARMIN = 661;
PETNAME_CERISE = 662;
PETNAME_CERULE = 663;
PETNAME_CHANCE = 664;
PETNAME_CINDER = 665;
PETNAME_CITRON = 666;
PETNAME_CLAIRE = 667;
PETNAME_COBALT = 668;
PETNAME_CORAIL = 669;
PETNAME_COURTE = 670;
PETNAME_CUIVRE = 671;
PETNAME_DANCER = 672;
PETNAME_DARING = 673;
PETNAME_DESERT = 674;
PETNAME_DOBBIN = 675;
PETNAME_DUNKLE = 676;
PETNAME_ELANCE = 677;
PETNAME_EMBLEM = 678;
PETNAME_ENZIAN = 679;
PETNAME_ESPRIT = 680;
PETNAME_ETOILE = 681;
PETNAME_FILANT = 682;
PETNAME_FLAMME = 683;
PETNAME_FLECHE = 684;
PETNAME_FLIGHT = 685;
PETNAME_FLINKE = 686;
PETNAME_FLOWER = 687;
PETNAME_FLURRY = 688;
PETNAME_FLYING = 689;
PETNAME_FOREST = 690;
PETNAME_FREEZE = 691;
PETNAME_FREUND = 692;
PETNAME_FRIEND = 693;
PETNAME_FROSTY = 694;
PETNAME_FROZEN = 695;
PETNAME_FUBUKI = 696;
PETNAME_GALAXY = 697;
PETNAME_GANGER = 698;
PETNAME_GELBER = 699;
PETNAME_GELBES = 700;
PETNAME_GINGER = 701;
PETNAME_GLOIRE = 702;
PETNAME_GLORIE = 703;
PETNAME_GOEMON = 704;
PETNAME_GRANDE = 705;
PETNAME_GRENAT = 706;
PETNAME_GROOVE = 707;
PETNAME_GROSSE = 708;
PETNAME_GRUENE = 709;
PETNAME_GUSTAV = 710;
PETNAME_HAYATE = 711;
PETNAME_HELDIN = 712;
PETNAME_HELLER = 713;
PETNAME_HELLES = 714;
PETNAME_HENGST = 715;
PETNAME_HERMES = 716;
PETNAME_HERZOG = 717;
PETNAME_HIMMEL = 718;
PETNAME_HUMBLE = 719;
PETNAME_IDATEN = 720;
PETNAME_IMPACT = 721;
PETNAME_INDIGO = 722;
PETNAME_JAGGER = 723;
PETNAME_JASMIN = 724;
PETNAME_JOYEUX = 725;
PETNAME_JUNGLE = 726;
PETNAME_KAISER = 727;
PETNAME_KEFFEL = 728;
PETNAME_KLEINE = 729;
PETNAME_KLUGER = 730;
PETNAME_KLUGES = 731;
PETNAME_KOLOSS = 732;
PETNAME_LAHMER = 733;
PETNAME_LAHMES = 734;
PETNAME_LANCER = 735;
PETNAME_LANDER = 736;
PETNAME_LAUREL = 737;
PETNAME_LEAPER = 738;
PETNAME_LEGEND = 739;
PETNAME_LIMBER = 740;
PETNAME_LONGUE = 741;
PETNAME_MELODY = 742;
PETNAME_METEOR = 743;
PETNAME_MIRAGE = 744;
PETNAME_MISTER = 745;
PETNAME_MOTION = 746;
PETNAME_MUGUET = 747;
PETNAME_NATURE = 748;
PETNAME_NEBULA = 749;
PETNAME_NETHER = 750;
PETNAME_NIMBLE = 751;
PETNAME_OLYMPE = 752;
PETNAME_ORCHID = 753;
PETNAME_OUTLAW = 754;
PETNAME_PASSER = 755;
PETNAME_PASTEL = 756;
PETNAME_PELTER = 757;
PETNAME_PENSEE = 758;
PETNAME_PETITE = 759;
PETNAME_PIMENT = 760;
PETNAME_POETIC = 761;
PETNAME_POULET = 762;
PETNAME_PRESTE = 763;
PETNAME_PRETTY = 764;
PETNAME_PRINCE = 765;
PETNAME_PURETE = 766;
PETNAME_QUARTZ = 767;
PETNAME_QUASAR = 768;
PETNAME_RAFALE = 769;
PETNAME_RAGING = 770;
PETNAME_RAIDEN = 771;
PETNAME_RAMAGE = 772;
PETNAME_RAPIDE = 773;
PETNAME_REICHE = 774;
PETNAME_REMIGE = 775;
PETNAME_RIEUSE = 776;
PETNAME_RISING = 777;
PETNAME_ROBUST = 778;
PETNAME_ROYALE = 779;
PETNAME_RUDOLF = 780;
PETNAME_RUNNER = 781;
PETNAME_SADDLE = 782;
PETNAME_SAFRAN = 783;
PETNAME_SAKURA = 784;
PETNAME_SAPHIR = 785;
PETNAME_SATURN = 786;
PETNAME_SCHUSS = 787;
PETNAME_SEKITO = 788;
PETNAME_SELENE = 789;
PETNAME_SENDEN = 790;
PETNAME_SEREIN = 791;
PETNAME_SHADOW = 792;
PETNAME_SHIDEN = 793;
PETNAME_SHINPU = 794;
PETNAME_SIEGER = 795;
PETNAME_SILBER = 796;
PETNAME_SILENT = 797;
PETNAME_SILVER = 798;
PETNAME_SILVER = 799;
PETNAME_SOLEIL = 800;
PETNAME_SOMBRE = 801;
PETNAME_SORREL = 802;
PETNAME_SPHENE = 803;
PETNAME_SPIRIT = 804;
PETNAME_SPRING = 805;
PETNAME_STREAM = 806;
PETNAME_STRIKE = 807;
PETNAME_SUMMER = 808;
PETNAME_TEKIRO = 809;
PETNAME_TERROR = 810;
PETNAME_TICKET = 811;
PETNAME_TIMIDE = 812;
PETNAME_TOPAZE = 813;
PETNAME_TULIPE = 814;
PETNAME_TYCOON = 815;
PETNAME_ULTIME = 816;
PETNAME_URANUS = 817;
PETNAME_VELOCE = 818;
PETNAME_VELVET = 819;
PETNAME_VICTOR = 820;
PETNAME_VIOLET = 821;
PETNAME_WALKER = 822;
PETNAME_WEISSE = 823;
PETNAME_WINGED = 824;
PETNAME_WINNER = 825;
PETNAME_WINNER = 826;
PETNAME_WINTER = 827;
PETNAME_WONDER = 828;
PETNAME_XANTHE = 829;
PETNAME_YELLOW = 830;
PETNAME_ZEPHYR = 831;
PETNAME_ARDENTE = 832;
PETNAME_AUTOMNE = 833;
PETNAME_AVENGER = 834;
PETNAME_BARONNE = 835;
PETNAME_BATTANT = 836;
PETNAME_BLAZING = 837;
PETNAME_BLITZER = 838;
PETNAME_CAMELIA = 839;
PETNAME_CANDIDE = 840;
PETNAME_CARAMEL = 841;
PETNAME_CELESTE = 842;
PETNAME_CERULEE = 843;
PETNAME_CHARBON = 844;
PETNAME_CHARGER = 845;
PETNAME_CHARIOT = 846;
PETNAME_CLIPPER = 847;
PETNAME_COUREUR = 848;
PETNAME_CRIMSON = 849;
PETNAME_CRISTAL = 850;
PETNAME_CRYSTAL = 851;
PETNAME_CUIVREE = 852;
PETNAME_CYCLONE = 853;
PETNAME_DANCING = 854;
PETNAME_DANSEUR = 855;
PETNAME_DIAMANT = 856;
PETNAME_DIAMOND = 857;
PETNAME_DRAFTER = 858;
PETNAME_DUNKLER = 859;
PETNAME_DUNKLES = 860;
PETNAME_EASTERN = 861;
PETNAME_EINHORN = 862;
PETNAME_ELANCEE = 863;
PETNAME_ELEGANT = 864;
PETNAME_EMPEROR = 865;
PETNAME_EMPRESS = 866;
PETNAME_EXPRESS = 867;
PETNAME_FARCEUR = 868;
PETNAME_FEATHER = 869;
PETNAME_FIGHTER = 870;
PETNAME_FILANTE = 871;
PETNAME_FLINKER = 872;
PETNAME_FLINKES = 873;
PETNAME_FORTUNE = 874;
PETNAME_FRAICHE = 875;
PETNAME_GAGNANT = 876;
PETNAME_GALAXIE = 877;
PETNAME_GALLANT = 878;
PETNAME_GENESIS = 879;
PETNAME_GEOELTE = 880;
PETNAME_GROSSER = 881;
PETNAME_GROSSES = 882;
PETNAME_GRUENER = 883;
PETNAME_GRUENES = 884;
PETNAME_HARMONY = 885;
PETNAME_HEROINE = 886;
PETNAME_IKEZUKI = 887;
PETNAME_IMPULSE = 888;
PETNAME_JAVELIN = 889;
PETNAME_JOYEUSE = 890;
PETNAME_JUMPING = 891;
PETNAME_JUPITER = 892;
PETNAME_JUSTICE = 893;
PETNAME_KLEINER = 894;
PETNAME_KLEINES = 895;
PETNAME_LAVANDE = 896;
PETNAME_LEAPING = 897;
PETNAME_LEGENDE = 898;
PETNAME_LIBERTY = 899;
PETNAME_LICORNE = 900;
PETNAME_MAJESTY = 901;
PETNAME_MARQUIS = 902;
PETNAME_MAXIMAL = 903;
PETNAME_MELODIE = 904;
PETNAME_MERCURY = 905;
PETNAME_MILLION = 906;
PETNAME_MIRACLE = 907;
PETNAME_MUSASHI = 908;
PETNAME_MUSTANG = 909;
PETNAME_NACARAT = 910;
PETNAME_NATURAL = 911;
PETNAME_NEMESIS = 912;
PETNAME_NEPTUNE = 913;
PETNAME_OEILLET = 914;
PETNAME_OPTIMAL = 915;
PETNAME_ORAGEUX = 916;
PETNAME_OURAGAN = 917;
PETNAME_PAPRIKA = 918;
PETNAME_PARFAIT = 919;
PETNAME_PARTNER = 920;
PETNAME_PATIENT = 921;
PETNAME_PATURON = 922;
PETNAME_PEGASUS = 923;
PETNAME_PENSIVE = 924;
PETNAME_PERFECT = 925;
PETNAME_PEUREUX = 926;
PETNAME_PHOENIX = 927;
PETNAME_PLUMAGE = 928;
PETNAME_POURPRE = 929;
PETNAME_POUSSIN = 930;
PETNAME_PRANCER = 931;
PETNAME_PREMIUM = 932;
PETNAME_QUANTUM = 933;
PETNAME_RADIANT = 934;
PETNAME_RAINBOW = 935;
PETNAME_RATTLER = 936;
PETNAME_REICHER = 937;
PETNAME_REICHES = 938;
PETNAME_ROUGHIE = 939;
PETNAME_SAMURAI = 940;
PETNAME_SAUTANT = 941;
PETNAME_SCARLET = 942;
PETNAME_SCHWEIF = 943;
PETNAME_SEREINE = 944;
PETNAME_SERGENT = 945;
PETNAME_SHINDEN = 946;
PETNAME_SHINING = 947;
PETNAME_SHOOTER = 948;
PETNAME_SMOKING = 949;
PETNAME_SOUFFLE = 950;
PETNAME_SPECIAL = 951;
PETNAME_STYLISH = 952;
PETNAME_SUMPTER = 953;
PETNAME_TEMPEST = 954;
PETNAME_TEMPETE = 955;
PETNAME_THUNDER = 956;
PETNAME_TORNADO = 957;
PETNAME_TORPEDO = 958;
PETNAME_TRISTAN = 959;
PETNAME_TROOPER = 960;
PETNAME_TROTTER = 961;
PETNAME_TYPHOON = 962;
PETNAME_UNICORN = 963;
PETNAME_VENGEUR = 964;
PETNAME_VERMEIL = 965;
PETNAME_VICTORY = 966;
PETNAME_WARRIOR = 967;
PETNAME_WEISSER = 968;
PETNAME_WEISSES = 969;
PETNAME_WESTERN = 970;
PETNAME_WHISPER = 971;
PETNAME_WINNING = 972;
PETNAME_ZETSUEI = 973;
PETNAME_ZILLION = 974;
PETNAME_BARONESS = 975;
PETNAME_BATTANTE = 976;
PETNAME_BLIZZARD = 977;
PETNAME_CANNELLE = 978;
PETNAME_CAPUCINE = 979;
PETNAME_CERULEAN = 980;
PETNAME_CHANCEUX = 981;
PETNAME_CHARISMA = 982;
PETNAME_CHARMANT = 983;
PETNAME_CHOCOLAT = 984;
PETNAME_CLAYBANK = 985;
PETNAME_COMTESSE = 986;
PETNAME_COUREUSE = 987;
PETNAME_DANSEUSE = 988;
PETNAME_DUCHESSE = 989;
PETNAME_ECARLATE = 990;
PETNAME_ELEGANTE = 991;
PETNAME_EMERAUDE = 992;
PETNAME_FARCEUSE = 993;
PETNAME_FARFADET = 994;
PETNAME_FRINGANT = 995;
PETNAME_GAGNANTE = 996;
PETNAME_GALLOPER = 997;
PETNAME_GALOPANT = 998;
PETNAME_GEOELTER = 999;
PETNAME_GEOELTES = 1000;
PETNAME_GESCHOSS = 1001;
PETNAME_GORGEOUS = 1002;
PETNAME_HANAKAZE = 1003;
PETNAME_HIGHLAND = 1004;
PETNAME_HYPERION = 1005;
PETNAME_ILLUSION = 1006;
PETNAME_IMMORTAL = 1007;
PETNAME_IMPERIAL = 1008;
PETNAME_INCARNAT = 1009;
PETNAME_INFINITY = 1010;
PETNAME_INNOCENT = 1011;
PETNAME_JACINTHE = 1012;
PETNAME_KAISERIN = 1013;
PETNAME_KRISTALL = 1014;
PETNAME_MAHARAJA = 1015;
PETNAME_MAHARANI = 1016;
PETNAME_MARQUISE = 1017;
PETNAME_MATAEMON = 1018;
PETNAME_MEILLEUR = 1019;
PETNAME_MERCEDES = 1020;
PETNAME_MYOSOTIS = 1021;
PETNAME_NEBULOUS = 1022;
PETNAME_NEGATIVE = 1023;
PETNAME_NENUPHAR = 1024;
PETNAME_NORTHERN = 1025;
PETNAME_NORTHERN = 1026;
PETNAME_OBSIDIAN = 1027;
PETNAME_ORAGEUSE = 1028;
PETNAME_ORCHIDEE = 1029;
PETNAME_PARFAITE = 1030;
PETNAME_PATIENTE = 1031;
PETNAME_PEUREUSE = 1032;
PETNAME_POSITIVE = 1033;
PETNAME_PRINCELY = 1034;
PETNAME_PRINCESS = 1035;
PETNAME_PRODIGUE = 1036;
PETNAME_PUISSANT = 1037;
PETNAME_RESTLESS = 1038;
PETNAME_RHAPSODY = 1039;
PETNAME_ROADSTER = 1040;
PETNAME_RUTILANT = 1041;
PETNAME_SAUTANTE = 1042;
PETNAME_SCHWARZE = 1043;
PETNAME_SHOOTING = 1044;
PETNAME_SILBERNE = 1045;
PETNAME_SOUTHERN = 1046;
PETNAME_SPECIALE = 1047;
PETNAME_STALLION = 1048;
PETNAME_STARDUST = 1049;
PETNAME_SURUSUMI = 1050;
PETNAME_TONNERRE = 1051;
PETNAME_TROTTEUR = 1052;
PETNAME_ULTIMATE = 1053;
PETNAME_UNIVERSE = 1054;
PETNAME_VAILLANT = 1055;
PETNAME_VENGEUSE = 1056;
PETNAME_XANTHOUS = 1057;
PETNAME_ZEPPELIN = 1058;
PETNAME_AMBITIOUS = 1059;
PETNAME_AUDACIEUX = 1060;
PETNAME_BALLISTIC = 1061;
PETNAME_BEAUTIFUL = 1062;
PETNAME_BRILLIANT = 1063;
PETNAME_CAMPANULE = 1064;
PETNAME_CAPITAINE = 1065;
PETNAME_CHANCEUSE = 1066;
PETNAME_CHARMANTE = 1067;
PETNAME_CLEMATITE = 1068;
PETNAME_CLOCHETTE = 1069;
PETNAME_CORIANDRE = 1070;
PETNAME_CRACKLING = 1071;
PETNAME_DESTROYER = 1072;
PETNAME_EXCELLENT = 1073;
PETNAME_FANTASTIC = 1074;
PETNAME_FEATHERED = 1075;
PETNAME_FRINGANTE = 1076;
PETNAME_GALOPANTE = 1077;
PETNAME_GINGEMBRE = 1078;
PETNAME_HURRICANE = 1079;
PETNAME_ICHIMONJI = 1080;
PETNAME_IMPETUEUX = 1081;
PETNAME_INCARNATE = 1082;
PETNAME_LIGHTNING = 1083;
PETNAME_MATSUKAZE = 1084;
PETNAME_MEILLEURE = 1085;
PETNAME_MENESTREL = 1086;
PETNAME_MERCILESS = 1087;
PETNAME_PENDRAGON = 1088;
PETNAME_PRINCESSE = 1089;
PETNAME_PRINTEMPS = 1090;
PETNAME_PUISSANTE = 1091;
PETNAME_QUADRILLE = 1092;
PETNAME_ROSINANTE = 1093;
PETNAME_RUTILANTE = 1094;
PETNAME_SCHWARZER = 1095;
PETNAME_SCHWARZES = 1096;
PETNAME_SILBERNER = 1097;
PETNAME_SILBERNES = 1098;
PETNAME_SPARKLING = 1099;
PETNAME_SPEEDSTER = 1100;
PETNAME_TOURNESOL = 1101;
PETNAME_TRANSIENT = 1102;
PETNAME_TROTTEUSE = 1103;
PETNAME_TURBULENT = 1104;
PETNAME_TWINKLING = 1105;
PETNAME_VAILLANTE = 1106;
PETNAME_VALENTINE = 1107;
PETNAME_VELOCIOUS = 1108;
PETNAME_VERMEILLE = 1109;
PETNAME_WONDERFUL = 1110;
PETNAME_AMATSUKAZE = 1111;
PETNAME_AUDACIEUSE = 1112;
PETNAME_BENEVOLENT = 1113;
PETNAME_BLISTERING = 1114;
PETNAME_BRILLIANCE = 1115;
PETNAME_BUCEPHALUS = 1116;
PETNAME_CHALLENGER = 1117;
PETNAME_EXCELLENTE = 1118;
PETNAME_IMPETUEUSE = 1119;
PETNAME_INVINCIBLE = 1120;
PETNAME_MALEVOLENT = 1121;
PETNAME_MILLENNIUM = 1122;
PETNAME_TRANQUILLE = 1123;
PETNAME_TURBULENTE = 1124;
PETNAME_DESTRUCTION = 1125;
PETNAME_FIRECRACKER = 1126;
-----------------------------------
-- Summoner
-----------------------------------
PET_FIRE_SPIRIT = 0;
PET_ICE_SPIRIT = 1;
PET_AIR_SPIRIT = 2;
PET_EARTH_SPIRIT = 3;
PET_THUNDER_SPIRIT = 4;
PET_WATER_SPIRIT = 5;
PET_LIGHT_SPIRIT = 6;
PET_DARK_SPIRIT = 7;
PET_CARBUNCLE = 8;
PET_FENRIR = 9;
PET_IFRIT = 10;
PET_TITAN = 11;
PET_LEVIATHAN = 12;
PET_GARUDA = 13;
PET_SHIVA = 14;
PET_RAMUH = 15;
PET_DIABOLOS = 16;
PET_ALEXANDER = 17;
PET_ODIN = 18;
PET_ATOMOS = 19;
PET_CAIT_SITH = 20;
PET_AUTOMATON = 69;
PET_WYVERN = 48;
-----------------------------------
-- Beastmaster
-----------------------------------
PET_SHEEP_FAMILIAR = 21;
PET_HARE_FAMILIAR = 22;
PET_CRAB_FAMILIAR = 23;
PET_COURIER_CARRIE = 24;
PET_HOMUNCULUS = 25;
PET_FLYTRAP_FAMILIAR = 26;
PET_TIGER_FAMILIAR = 27;
PET_FLOWERPOT_BILL = 28;
PET_EFT_FAMILIAR = 29;
PET_LIZARD_FAMILIAR = 30;
PET_MAYFLY_FAMILIAR = 31;
PET_FUNGUAR_FAMILIAR = 32;
PET_BEETLE_FAMILIAR = 33;
PET_ANTLION_FAMILIAR = 34;
PET_MITE_FAMILIAR = 35;
PET_LULLABY_MELODIA = 36;
PET_KEENEARED_STEFFI = 37;
PET_FLOWERPOT_BEN = 38;
PET_SABER_SIRAVARDE = 39;
PET_COLDBLOOD_COMO = 40;
PET_SHELLBUSTER_OROB = 41;
PET_VORACIOUS_AUDREY = 42;
PET_AMBUSHER_ALLIE = 43;
PET_LIFEDRINKER_LARS = 44;
PET_PANZER_GALAHAD = 45;
PET_CHOPSUEY_CHUCKY = 46;
PET_AMIGO_SABOTENDER = 47; | gpl-3.0 |
MonokuroInzanaito/ygopro-777DIY | expansions/script/c14141002.lua | 1 | 2617 | --花舞少女·夜弥
local m=14141002
local cm=_G["c"..m]
if not pcall(function() require("expansions/script/c14141006") end) then require("script/c14141006") end
cm.named_with_hana=true
function cm.initial_effect(c)
scorp.hana_common_effect(c)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DISABLE)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e3:SetHintTiming(TIMING_DAMAGE_STEP,TIMING_DAMAGE_STEP+0x1c0)
e3:SetCountLimit(1,m)
e3:SetCondition(cm.condition)
e3:SetTarget(cm.target)
e3:SetOperation(cm.operation)
c:RegisterEffect(e3)
scorp.hana_effect_register(c,e3,m)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated()
end
function cm.filter(c)
return c:IsFaceup() and not (c:GetAttack()==0 and c:IsDisabled())
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and cm.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.filter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,cm.filter,tp,0,LOCATION_MZONE,1,1,nil)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(0)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_DISABLE_EFFECT)
e3:SetValue(RESET_TURN_SET)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e3)
if tc:IsType(TYPE_TRAPMONSTER) then
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e4:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e4)
end
Duel.AdjustInstantly()
return true
end
end | gpl-3.0 |
davidedmonds/darkstar | scripts/zones/Boneyard_Gully/npcs/_081.lua | 17 | 1429 | -----------------------------------
-- Area: Boneyard_Gully
-- NPC: _081 (Dark Miasma)
-----------------------------------
package.loaded["scripts/zones/Boneyard_Gully/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/bcnm");
require("scripts/globals/quests");
require("scripts/globals/missions");
require("scripts/zones/Boneyard_Gully/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
if (TradeBCNM(player,player:getZoneID(),trade,npc)) then
return;
end
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
if (EventTriggerBCNM(player,npc)) then
return 1;
else
return 1;
end
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
--printf("onUpdate CSID: %u",csid);
--printf("onUpdate RESULT: %u",option);
if (EventUpdateBCNM(player,csid,option)) then
return;
end
end;
-----------------------------------
-- onEventFinish Action
-----------------------------------
function onEventFinish(player,csid,option)
--printf("onFinish CSID: %u",csid);
--printf("onFinish RESULT: %u",option);
if (EventFinishBCNM(player,csid,option)) then
return;
end
end; | gpl-3.0 |
davidedmonds/darkstar | scripts/zones/Bastok_Markets/npcs/Shamarhaan.lua | 38 | 1856 | -----------------------------------
-- Area: Bastok Markets
-- NPC: Shamarhaan
-- Type: Quest Starter
-- Involved in quest: No Strings Attached
-- @zone: 235
-- @pos -285.382 -13.021 -84.743
--
-- Auto-Script: Requires Verification. Verified standard dialog - thrydwolf 12/8/2011
-----------------------------------
package.loaded["scripts/zones/Bastok_Markets/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/settings");
require("scripts/globals/quests");
require("scripts/zones/Bastok_Markets/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
local NoStringsAttached = player:getQuestStatus(AHT_URHGAN,NO_STRINGS_ATTACHED);
local NoStringsAttachedProgress = player:getVar("NoStringsAttachedProgress");
if (player:getMainLvl() >= ADVANCED_JOB_LEVEL and NoStringsAttached == QUEST_AVAILABLE) then
player:startEvent(0x01b2); -- initial cs to start the quest, go and see Iruki-Waraki at Whitegate
elseif (NoStringsAttachedProgress == 1) then
player:startEvent(0x01b3); -- reminder to go see Iruki-Waraki at Whitegate
else
player:startEvent(0x01b1);
end;
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
if (csid == 0x01b2) then
player:setVar("NoStringsAttachedProgress",1);
player:addQuest(AHT_URHGAN,NO_STRINGS_ATTACHED);
end;
end;
| gpl-3.0 |
kidaa/darkstar | scripts/zones/The_Garden_of_RuHmet/mobs/Aw_aern.lua | 13 | 3177 | -----------------------------------
-- Area: The Garden of Ru'Hmet
-- NPC: Aw_aern PH (Ix'Aern DRK and DRG)
-----------------------------------
package.loaded["scripts/zones/The_Garden_of_RuHmet/TextIDs"] = nil;
-----------------------------------
require("scripts/zones/The_Garden_of_RuHmet/TextIDs");
require("scripts/zones/The_Garden_of_RuHmet/MobIDs");
-----------------------------------
-- onMobSpawn Action
-----------------------------------
function onMobSpawn(mob)
local IxAernDRG_PH = GetServerVariable("[SEA]IxAernDRG_PH"); -- Should be be the ID of the mob that spawns the actual PH
-- Pick the Ix'Aern (DRG) PH if the server doesn't have one, and the if the actual PH/NM isn't up. Then, set it.
if (GetMobAction(realAwAern_PH) == 0 and GetMobAction(IxAernDRG) == 0 and GetServerVariable("[SEA]IxAernDRG_PH") == 0) then -- This should be cleared when the mob is killed.
IxAernDRG_PH = AwAernGroups[math.random(1, #AwAernGroups)] + math.random(0, 2); -- The 4th mobid in each group is a pet. F that son
SetServerVariable("[SEA]IxAernDRG_PH", IxAernDRG_PH);
end;
end;
-----------------------------------
-- onMobDeath
-----------------------------------
function onMobDeath(mob, killer)
local currentMobID = mob:getID();
-- Ix'Aern (DRG) Placeholder mobs
local IxAernDRG_PH = GetServerVariable("[SEA]IxAernDRG_PH"); -- Should be be the ID of the mob that spawns the actual PH.
-- If the mob killed was the randomized PH spawner, then spawn the PH in it's actual location.
if (IxAernDRG_PH == currentMobID) then
-- Select spawn location based on ID
if (currentMobID >= 16920777 and currentMobID < 16920781) then
GetMobByID(realAwAern_PH):setSpawn(-520, 5, -520, 225); -- Bottom Left
elseif (currentMobID >= 16920781 and currentMobID < 16920785) then
GetMobByID(realAwAern_PH):setSpawn(-520, 5, -359, 30); -- Top Left
elseif (currentMobID >= 16920785 and currentMobID < 16920789) then
GetMobByID(realAwAern_PH):setSpawn(-319, 5, -359, 95); -- Top Right
elseif (currentMobID >= 16920789 and currentMobID < 16920783) then
GetMobByID(realAwAern_PH):setSpawn(-319, 5, -520, 156); -- Bottom Right
end;
SpawnMob(realAwAern_PH);
SetServerVariable("[SEA]IxAernDRG_PH", 0); -- Clear the variable because it is spawned!
-- Spawn the NM if the PH was killed at the PH's location.
elseif (currentMobID == realAwAern_PH) then
GetMobByID(IxAernDRG):setSpawn(mob:getXPos(), mob:getYPos(), mob:getZPos());
SpawnMob(IxAernDRG, 300):updateEnmity(killer);
-- A
GetMobByID(wynavA):setSpawn(mob:getXPos()+4, mob:getYPos(), mob:getZPos());
SpawnMob(wynavA, 300):updateEnmity(killer);
-- B
GetMobByID(wynavB):setSpawn(mob:getXPos()-4, mob:getYPos(), mob:getZPos());
SpawnMob(wynavB, 300):updateEnmity(killer);
-- C
GetMobByID(wynavC):setSpawn(mob:getXPos(), mob:getYPos(), mob:getZPos()+4);
SpawnMob(wynavC, 300):updateEnmity(killer);
end
end; | gpl-3.0 |
davidedmonds/darkstar | scripts/globals/abilities/wild_flourish.lua | 28 | 2168 | -----------------------------------
-- Ability: Wild Flourish
-- Readies target for a skillchain. Requires at least two Finishing Moves.
-- Obtained: Dancer Level 60
-- Finishing Moves Used: 2
-- Recast Time: 0:30
-- Duration: 0:05
-----------------------------------
require("scripts/globals/settings");
require("scripts/globals/status");
require("scripts/globals/weaponskills");
-----------------------------------
-- onAbilityCheck
-----------------------------------
function onAbilityCheck(player,target,ability)
if (player:getAnimation() ~= 1) then
return MSGBASIC_REQUIRES_COMBAT,0;
else
if (player:hasStatusEffect(EFFECT_FINISHING_MOVE_1)) then
return MSGBASIC_NO_FINISHINGMOVES,0;
elseif (player:hasStatusEffect(EFFECT_FINISHING_MOVE_2)) then
player:delStatusEffect(EFFECT_FINISHING_MOVE_2);
return 0,0;
elseif (player:hasStatusEffect(EFFECT_FINISHING_MOVE_3)) then
player:delStatusEffectSilent(EFFECT_FINISHING_MOVE_3);
player:addStatusEffect(EFFECT_FINISHING_MOVE_1,1,0,7200);
return 0,0;
elseif (player:hasStatusEffect(EFFECT_FINISHING_MOVE_4)) then
player:delStatusEffectSilent(EFFECT_FINISHING_MOVE_4);
player:addStatusEffect(EFFECT_FINISHING_MOVE_2,1,0,7200);
return 0,0;
elseif (player:hasStatusEffect(EFFECT_FINISHING_MOVE_5)) then
player:delStatusEffectSilent(EFFECT_FINISHING_MOVE_5);
player:addStatusEffect(EFFECT_FINISHING_MOVE_3,1,0,7200);
return 0,0;
else
return MSGBASIC_NO_FINISHINGMOVES,0;
end
end
end;
-----------------------------------
-- onUseAbility
-----------------------------------
function onUseAbility(player,target,ability)
if (not target:hasStatusEffect(EFFECT_CHAINBOUND, 0) and not target:hasStatusEffect(EFFECT_SKILLCHAIN, 0)) then
target:addStatusEffectEx(EFFECT_CHAINBOUND, 0, 1, 0, 5, 0, 1);
else
ability:setMsg(156);
end
return 0, getFlourishAnimation(player:getWeaponSkillType(SLOT_MAIN)), 1;
end; | gpl-3.0 |
MonokuroInzanaito/ygopro-777DIY | expansions/script/c1000208.lua | 1 | 4154 | --虹纹骑士-红炎
function c1000208.initial_effect(c)
--①
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(1000069,5))
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,6512)
e1:SetTarget(c1000208.target)
e1:SetOperation(c1000208.operation)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_FLIP)
c:RegisterEffect(e2)
--②
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(1000069,6))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetCountLimit(1,6512)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e3:SetCondition(c1000208.condition)
e3:SetTarget(c1000208.sptg)
e3:SetOperation(c1000208.spop)
c:RegisterEffect(e3)
--自己场上有这张卡以外的「虹纹」怪兽存在的场合,这张卡当做调整使用。
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_ADD_TYPE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetRange(LOCATION_MZONE)
e4:SetCondition(c1000208.chcon)
e4:SetValue(TYPE_TUNER)
c:RegisterEffect(e4)
end
function c1000208.condition(e,tp,eg,ep,ev,re,r,rp)
return re and not (re:GetHandler():IsType(TYPE_MONSTER) and re:GetHandler():IsSetCard(0x200))
end
function c1000208.chfilter(c)
return c:IsFaceup() and c:IsSetCard(0x200) and c:IsType(TYPE_MONSTER)
end
function c1000208.chcon(e)
local c=e:GetHandler()
return Duel.IsExistingMatchingCard(c1000208.chfilter,c:GetControler(),LOCATION_MZONE,0,1,e:GetHandler())
end
function c1000208.filter(c)
return c:IsSetCard(0x200) and c:IsAbleToRemove()
end
function c1000208.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c1000208.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_DECK)
end
function c1000208.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c1000208.filter,tp,LOCATION_DECK,0,1,1,nil)
local tg=g:GetFirst()
if tg==nil then return end
Duel.Remove(tg,POS_FACEUP,REASON_EFFECT)
end
function c1000208.spfilter(c,e,tp)
return c:IsSetCard(0x3200) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c1000208.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and c1000208.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c1000208.spfilter,tp,LOCATION_REMOVED,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c1000208.spfilter,tp,LOCATION_REMOVED,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c1000208.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE) then
--local e1=Effect.CreateEffect(c)
--e1:SetType(EFFECT_TYPE_SINGLE)
--e1:SetCode(EFFECT_DISABLE)
--e1:SetReset(RESET_EVENT+0x1fe0000)
--tc:RegisterEffect(e1)
--local e2=Effect.CreateEffect(c)
--e2:SetType(EFFECT_TYPE_SINGLE)
--e2:SetCode(EFFECT_DISABLE_EFFECT)
--e2:SetReset(RESET_EVENT+0x1fe0000)
--tc:RegisterEffect(e2)
--unsynchroable
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetValue(c1000208.splimit)
e3:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e3)
--xyzlimit
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e4:SetValue(c1000208.splimit)
e4:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e4)
Duel.SpecialSummonComplete()
end
end
function c1000208.splimit(e,c)
if not c then return false end
return not c:IsSetCard(0x200)
end
| gpl-3.0 |
failcoder/SVUI_-Core | _options/libs/AceGUI-3.0-SharedMediaWidgets/Libs/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua | 1 | 19796 | --[[-----------------------------------------------------------------------------
TreeGroup Container
Container that uses a tree control to switch between groups.
-------------------------------------------------------------------------------]]
local Type, Version = "TreeGroup", 34
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
-- Lua APIs
local next, pairs, ipairs, assert, type = next, pairs, ipairs, assert, type
local math_min, math_max, floor = math.min, math.max, floor
local select, tremove, unpack, tconcat = select, table.remove, unpack, table.concat
-- WoW APIs
local CreateFrame, UIParent = CreateFrame, UIParent
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
-- List them here for Mikk's FindGlobals script
-- GLOBALS: GameTooltip, FONT_COLOR_CODE_CLOSE
-- Recycling functions
local new, del
do
local pool = setmetatable({},{__mode='k'})
function new()
local t = next(pool)
if t then
pool[t] = nil
return t
else
return {}
end
end
function del(t)
for k in pairs(t) do
t[k] = nil
end
pool[t] = true
end
end
local DEFAULT_TREE_WIDTH = 175
local DEFAULT_TREE_SIZABLE = true
--[[-----------------------------------------------------------------------------
Support functions
-------------------------------------------------------------------------------]]
local function GetButtonUniqueValue(line)
local parent = line.parent
if parent and parent.value then
return GetButtonUniqueValue(parent).."\001"..line.value
else
return line.value
end
end
local function UpdateButton(button, treeline, selected, canExpand, isExpanded)
local self = button.obj
local toggle = button.toggle
local frame = self.frame
local text = treeline.text or ""
local icon = treeline.icon
local iconCoords = treeline.iconCoords
local level = treeline.level
local value = treeline.value
local uniquevalue = treeline.uniquevalue
local disabled = treeline.disabled
button.treeline = treeline
button.value = value
button.uniquevalue = uniquevalue
if selected then
button:LockHighlight()
button.selected = true
else
button:UnlockHighlight()
button.selected = false
end
local normalTexture = button:GetNormalTexture()
local line = button.line
button.level = level
if ( level == 1 ) then
button:SetNormalFontObject("GameFontNormal")
button:SetHighlightFontObject("GameFontHighlight")
button.text:SetPoint("LEFT", (icon and 16 or 0) + 8, 2)
else
button:SetNormalFontObject("GameFontHighlightSmall")
button:SetHighlightFontObject("GameFontHighlightSmall")
button.text:SetPoint("LEFT", (icon and 16 or 0) + 8 * level, 2)
end
if disabled then
button:EnableMouse(false)
button.text:SetText("|cff808080"..text..FONT_COLOR_CODE_CLOSE)
else
button.text:SetText(text)
button:EnableMouse(true)
end
if icon then
button.icon:SetTexture(icon)
button.icon:SetPoint("LEFT", 8 * level, (level == 1) and 0 or 1)
else
button.icon:SetTexture("")
end
if iconCoords then
button.icon:SetTexCoord(unpack(iconCoords))
else
button.icon:SetTexCoord(0, 1, 0, 1)
end
if canExpand then
if not isExpanded then
toggle:SetNormalTexture("Interface\\Buttons\\UI-PlusButton-UP")
toggle:SetPushedTexture("Interface\\Buttons\\UI-PlusButton-DOWN")
else
toggle:SetNormalTexture("Interface\\Buttons\\UI-MinusButton-UP")
toggle:SetPushedTexture("Interface\\Buttons\\UI-MinusButton-DOWN")
end
toggle:Show()
else
toggle:Hide()
end
end
local function ShouldDisplayLevel(tree)
local result = false
for k, v in ipairs(tree) do
if v.children == nil and v.visible ~= false then
result = true
elseif v.children then
result = result or ShouldDisplayLevel(v.children)
end
if result then return result end
end
return false
end
local function addLine(self, v, tree, level, parent)
local line = new()
line.value = v.value
line.text = v.text
line.icon = v.icon
line.iconCoords = v.iconCoords
line.disabled = v.disabled
line.tree = tree
line.level = level
line.parent = parent
line.visible = v.visible
line.uniquevalue = GetButtonUniqueValue(line)
if v.children then
line.hasChildren = true
else
line.hasChildren = nil
end
self.lines[#self.lines+1] = line
return line
end
--fire an update after one frame to catch the treeframes height
local function FirstFrameUpdate(frame)
local self = frame.obj
frame:SetScript("OnUpdate", nil)
self:RefreshTree()
end
local function BuildUniqueValue(...)
local n = select('#', ...)
if n == 1 then
return ...
else
return (...).."\001"..BuildUniqueValue(select(2,...))
end
end
--[[-----------------------------------------------------------------------------
Scripts
-------------------------------------------------------------------------------]]
local function Expand_OnClick(frame)
local button = frame.button
local self = button.obj
local status = (self.status or self.localstatus).groups
status[button.uniquevalue] = not status[button.uniquevalue]
self:RefreshTree()
end
local function Button_OnClick(frame)
local self = frame.obj
self:Fire("OnClick", frame.uniquevalue, frame.selected)
if not frame.selected then
self:SetSelected(frame.uniquevalue)
frame.selected = true
frame:LockHighlight()
self:RefreshTree()
end
AceGUI:ClearFocus()
end
local function Button_OnDoubleClick(button)
local self = button.obj
local status = self.status or self.localstatus
local status = (self.status or self.localstatus).groups
status[button.uniquevalue] = not status[button.uniquevalue]
self:RefreshTree()
end
local function Button_OnEnter(frame)
local self = frame.obj
self:Fire("OnButtonEnter", frame.uniquevalue, frame)
if self.enabletooltips then
GameTooltip:SetOwner(frame, "ANCHOR_NONE")
GameTooltip:SetPoint("LEFT",frame,"RIGHT")
GameTooltip:SetText(frame.text:GetText() or "", 1, .82, 0, 1)
GameTooltip:Show()
end
end
local function Button_OnLeave(frame)
local self = frame.obj
self:Fire("OnButtonLeave", frame.uniquevalue, frame)
if self.enabletooltips then
GameTooltip:Hide()
end
end
local function OnScrollValueChanged(frame, value)
if frame.obj.noupdate then return end
local self = frame.obj
local status = self.status or self.localstatus
status.scrollvalue = value
self:RefreshTree()
AceGUI:ClearFocus()
end
local function Tree_OnSizeChanged(frame)
frame.obj:RefreshTree()
end
local function Tree_OnMouseWheel(frame, delta)
local self = frame.obj
if self.showscroll then
local scrollbar = self.scrollbar
local min, max = scrollbar:GetMinMaxValues()
local value = scrollbar:GetValue()
local newvalue = math_min(max,math_max(min,value - delta))
if value ~= newvalue then
scrollbar:SetValue(newvalue)
end
end
end
local function Dragger_OnLeave(frame)
frame:SetBackdropColor(1, 1, 1, 0)
end
local function Dragger_OnEnter(frame)
frame:SetBackdropColor(1, 1, 1, 0.8)
end
local function Dragger_OnMouseDown(frame)
local treeframe = frame:GetParent()
treeframe:StartSizing("RIGHT")
end
local function Dragger_OnMouseUp(frame)
local treeframe = frame:GetParent()
local self = treeframe.obj
local frame = treeframe:GetParent()
treeframe:StopMovingOrSizing()
--treeframe:SetScript("OnUpdate", nil)
treeframe:SetUserPlaced(false)
--Without this :GetHeight will get stuck on the current height, causing the tree contents to not resize
treeframe:SetHeight(0)
treeframe:SetPoint("TOPLEFT", frame, "TOPLEFT",0,0)
treeframe:SetPoint("BOTTOMLEFT", frame, "BOTTOMLEFT",0,0)
local status = self.status or self.localstatus
status.treewidth = treeframe:GetWidth()
treeframe.obj:Fire("OnTreeResize",treeframe:GetWidth())
-- recalculate the content width
treeframe.obj:OnWidthSet(status.fullwidth)
-- update the layout of the content
treeframe.obj:DoLayout()
end
--[[-----------------------------------------------------------------------------
Methods
-------------------------------------------------------------------------------]]
local methods = {
["OnAcquire"] = function(self)
self:SetTreeWidth(DEFAULT_TREE_WIDTH, DEFAULT_TREE_SIZABLE)
self:EnableButtonTooltips(true)
end,
["OnRelease"] = function(self)
self.status = nil
for k, v in pairs(self.localstatus) do
if k == "groups" then
for k2 in pairs(v) do
v[k2] = nil
end
else
self.localstatus[k] = nil
end
end
self.localstatus.scrollvalue = 0
self.localstatus.treewidth = DEFAULT_TREE_WIDTH
self.localstatus.treesizable = DEFAULT_TREE_SIZABLE
end,
["EnableButtonTooltips"] = function(self, enable)
self.enabletooltips = enable
end,
["CreateButton"] = function(self)
local num = AceGUI:GetNextWidgetNum("TreeGroupButton")
local button = CreateFrame("Button", ("AceGUI30TreeButton%d"):format(num), self.treeframe, "OptionsListButtonTemplate")
button.obj = self
local icon = button:CreateTexture(nil, "OVERLAY")
icon:SetWidth(14)
icon:SetHeight(14)
button.icon = icon
button:SetScript("OnClick",Button_OnClick)
button:SetScript("OnDoubleClick", Button_OnDoubleClick)
button:SetScript("OnEnter",Button_OnEnter)
button:SetScript("OnLeave",Button_OnLeave)
button.toggle.button = button
button.toggle:SetScript("OnClick",Expand_OnClick)
return button
end,
["SetStatusTable"] = function(self, status)
assert(type(status) == "table")
self.status = status
if not status.groups then
status.groups = {}
end
if not status.scrollvalue then
status.scrollvalue = 0
end
if not status.treewidth then
status.treewidth = DEFAULT_TREE_WIDTH
end
if status.treesizable == nil then
status.treesizable = DEFAULT_TREE_SIZABLE
end
self:SetTreeWidth(status.treewidth,status.treesizable)
self:RefreshTree()
end,
--sets the tree to be displayed
["SetTree"] = function(self, tree, filter)
self.filter = filter
if tree then
assert(type(tree) == "table")
end
self.tree = tree
self:RefreshTree()
end,
["BuildLevel"] = function(self, tree, level, parent)
local groups = (self.status or self.localstatus).groups
local hasChildren = self.hasChildren
for i, v in ipairs(tree) do
if v.children then
if not self.filter or ShouldDisplayLevel(v.children) then
local line = addLine(self, v, tree, level, parent)
if groups[line.uniquevalue] then
self:BuildLevel(v.children, level+1, line)
end
end
elseif v.visible ~= false or not self.filter then
addLine(self, v, tree, level, parent)
end
end
end,
["RefreshTree"] = function(self,scrollToSelection)
local buttons = self.buttons
local lines = self.lines
for i, v in ipairs(buttons) do
v:Hide()
end
while lines[1] do
local t = tremove(lines)
for k in pairs(t) do
t[k] = nil
end
del(t)
end
if not self.tree then return end
--Build the list of visible entries from the tree and status tables
local status = self.status or self.localstatus
local groupstatus = status.groups
local tree = self.tree
local treeframe = self.treeframe
status.scrollToSelection = status.scrollToSelection or scrollToSelection -- needs to be cached in case the control hasn't been drawn yet (code bails out below)
self:BuildLevel(tree, 1)
local numlines = #lines
local maxlines = (floor(((self.treeframe:GetHeight()or 0) - 20 ) / 18))
if maxlines <= 0 then return end
local first, last
scrollToSelection = status.scrollToSelection
status.scrollToSelection = nil
if numlines <= maxlines then
--the whole tree fits in the frame
status.scrollvalue = 0
self:ShowScroll(false)
first, last = 1, numlines
else
self:ShowScroll(true)
--scrolling will be needed
self.noupdate = true
self.scrollbar:SetMinMaxValues(0, numlines - maxlines)
--check if we are scrolled down too far
if numlines - status.scrollvalue < maxlines then
status.scrollvalue = numlines - maxlines
end
self.noupdate = nil
first, last = status.scrollvalue+1, status.scrollvalue + maxlines
--show selection?
if scrollToSelection and status.selected then
local show
for i,line in ipairs(lines) do -- find the line number
if line.uniquevalue==status.selected then
show=i
end
end
if not show then
-- selection was deleted or something?
elseif show>=first and show<=last then
-- all good
else
-- scrolling needed!
if show<first then
status.scrollvalue = show-1
else
status.scrollvalue = show-maxlines
end
first, last = status.scrollvalue+1, status.scrollvalue + maxlines
end
end
if self.scrollbar:GetValue() ~= status.scrollvalue then
self.scrollbar:SetValue(status.scrollvalue)
end
end
local buttonnum = 1
for i = first, last do
local line = lines[i]
local button = buttons[buttonnum]
if not button then
button = self:CreateButton()
buttons[buttonnum] = button
button:SetParent(treeframe)
button:SetFrameLevel(treeframe:GetFrameLevel()+1)
button:ClearAllPoints()
if buttonnum == 1 then
if self.showscroll then
button:SetPoint("TOPRIGHT", -22, -10)
button:SetPoint("TOPLEFT", 0, -10)
else
button:SetPoint("TOPRIGHT", 0, -10)
button:SetPoint("TOPLEFT", 0, -10)
end
else
button:SetPoint("TOPRIGHT", buttons[buttonnum-1], "BOTTOMRIGHT",0,0)
button:SetPoint("TOPLEFT", buttons[buttonnum-1], "BOTTOMLEFT",0,0)
end
end
UpdateButton(button, line, status.selected == line.uniquevalue, line.hasChildren, groupstatus[line.uniquevalue] )
button:Show()
buttonnum = buttonnum + 1
end
end,
["SetSelected"] = function(self, value)
local status = self.status or self.localstatus
if status.selected ~= value then
status.selected = value
self:Fire("OnGroupSelected", value)
end
end,
["Select"] = function(self, uniquevalue, ...)
self.filter = false
local status = self.status or self.localstatus
local groups = status.groups
local path = {...}
for i = 1, #path do
groups[tconcat(path, "\001", 1, i)] = true
end
status.selected = uniquevalue
self:RefreshTree(true)
self:Fire("OnGroupSelected", uniquevalue)
end,
["SelectByPath"] = function(self, ...)
self:Select(BuildUniqueValue(...), ...)
end,
["SelectByValue"] = function(self, uniquevalue)
self:Select(uniquevalue, ("\001"):split(uniquevalue))
end,
["ShowScroll"] = function(self, show)
self.showscroll = show
if show then
self.scrollbar:Show()
if self.buttons[1] then
self.buttons[1]:SetPoint("TOPRIGHT", self.treeframe,"TOPRIGHT",-22,-10)
end
else
self.scrollbar:Hide()
if self.buttons[1] then
self.buttons[1]:SetPoint("TOPRIGHT", self.treeframe,"TOPRIGHT",0,-10)
end
end
end,
["OnWidthSet"] = function(self, width)
local content = self.content
local treeframe = self.treeframe
local status = self.status or self.localstatus
status.fullwidth = width
local contentwidth = width - status.treewidth - 20
if contentwidth < 0 then
contentwidth = 0
end
content:SetWidth(contentwidth)
content.width = contentwidth
local maxtreewidth = math_min(400, width - 50)
if maxtreewidth > 100 and status.treewidth > maxtreewidth then
self:SetTreeWidth(maxtreewidth, status.treesizable)
end
treeframe:SetMaxResize(maxtreewidth, 1600)
end,
["OnHeightSet"] = function(self, height)
local content = self.content
local contentheight = height - 20
if contentheight < 0 then
contentheight = 0
end
content:SetHeight(contentheight)
content.height = contentheight
end,
["SetTreeWidth"] = function(self, treewidth, resizable)
if not resizable then
if type(treewidth) == 'number' then
resizable = false
elseif type(treewidth) == 'boolean' then
resizable = treewidth
treewidth = DEFAULT_TREE_WIDTH
else
resizable = false
treewidth = DEFAULT_TREE_WIDTH
end
end
self.treeframe:SetWidth(treewidth)
self.dragger:EnableMouse(resizable)
local status = self.status or self.localstatus
status.treewidth = treewidth
status.treesizable = resizable
-- recalculate the content width
if status.fullwidth then
self:OnWidthSet(status.fullwidth)
end
end,
["GetTreeWidth"] = function(self)
local status = self.status or self.localstatus
return status.treewidth or DEFAULT_TREE_WIDTH
end,
["LayoutFinished"] = function(self, width, height)
if self.noAutoHeight then return end
self:SetHeight((height or 0) + 20)
end
}
--[[-----------------------------------------------------------------------------
Constructor
-------------------------------------------------------------------------------]]
local PaneBackdrop = {
bgFile = "Interface\\ChatFrame\\ChatFrameBackground",
edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border",
tile = true, tileSize = 16, edgeSize = 16,
insets = { left = 3, right = 3, top = 5, bottom = 3 }
}
local DraggerBackdrop = {
bgFile = "Interface\\Tooltips\\UI-Tooltip-Background",
edgeFile = nil,
tile = true, tileSize = 16, edgeSize = 0,
insets = { left = 3, right = 3, top = 7, bottom = 7 }
}
local function Constructor()
local num = AceGUI:GetNextWidgetNum(Type)
local frame = CreateFrame("Frame", nil, UIParent)
local treeframe = CreateFrame("Frame", nil, frame)
treeframe:SetPoint("TOPLEFT")
treeframe:SetPoint("BOTTOMLEFT")
treeframe:SetWidth(DEFAULT_TREE_WIDTH)
treeframe:EnableMouseWheel(true)
treeframe:SetBackdrop(PaneBackdrop)
treeframe:SetBackdropColor(0.1, 0.1, 0.1, 0.5)
treeframe:SetBackdropBorderColor(0.4, 0.4, 0.4)
treeframe:SetResizable(true)
treeframe:SetMinResize(100, 1)
treeframe:SetMaxResize(400, 1600)
treeframe:SetScript("OnUpdate", FirstFrameUpdate)
treeframe:SetScript("OnSizeChanged", Tree_OnSizeChanged)
treeframe:SetScript("OnMouseWheel", Tree_OnMouseWheel)
local dragger = CreateFrame("Frame", nil, treeframe)
dragger:SetWidth(8)
dragger:SetPoint("TOP", treeframe, "TOPRIGHT")
dragger:SetPoint("BOTTOM", treeframe, "BOTTOMRIGHT")
dragger:SetBackdrop(DraggerBackdrop)
dragger:SetBackdropColor(1, 1, 1, 0)
dragger:SetScript("OnEnter", Dragger_OnEnter)
dragger:SetScript("OnLeave", Dragger_OnLeave)
dragger:SetScript("OnMouseDown", Dragger_OnMouseDown)
dragger:SetScript("OnMouseUp", Dragger_OnMouseUp)
local scrollbar = CreateFrame("Slider", ("AceConfigDialogTreeGroup%dScrollBar"):format(num), treeframe, "UIPanelScrollBarTemplate")
scrollbar:SetScript("OnValueChanged", nil)
scrollbar:SetPoint("TOPRIGHT", -10, -26)
scrollbar:SetPoint("BOTTOMRIGHT", -10, 26)
scrollbar:SetMinMaxValues(0,0)
scrollbar:SetValueStep(1)
scrollbar:SetValue(0)
scrollbar:SetWidth(16)
scrollbar:SetScript("OnValueChanged", OnScrollValueChanged)
local scrollbg = scrollbar:CreateTexture(nil, "BACKGROUND")
scrollbg:SetAllPoints(scrollbar)
scrollbg:SetTexture(0,0,0,0.4)
local border = CreateFrame("Frame",nil,frame)
border:SetPoint("TOPLEFT", treeframe, "TOPRIGHT")
border:SetPoint("BOTTOMRIGHT")
border:SetBackdrop(PaneBackdrop)
border:SetBackdropColor(0.1, 0.1, 0.1, 0.5)
border:SetBackdropBorderColor(0.4, 0.4, 0.4)
--Container Support
local content = CreateFrame("Frame", nil, border)
content:SetPoint("TOPLEFT", 10, -10)
content:SetPoint("BOTTOMRIGHT", -10, 10)
local widget = {
frame = frame,
lines = {},
levels = {},
buttons = {},
hasChildren = {},
localstatus = { groups = {}, scrollvalue = 0 },
filter = false,
treeframe = treeframe,
dragger = dragger,
scrollbar = scrollbar,
border = border,
content = content,
type = Type
}
for method, func in pairs(methods) do
widget[method] = func
end
treeframe.obj, dragger.obj, scrollbar.obj = widget, widget, widget
return AceGUI:RegisterAsContainer(widget)
end
AceGUI:RegisterWidgetType(Type, Constructor, Version)
| mit |
MonokuroInzanaito/ygopro-777DIY | expansions/script/c33700126.lua | 1 | 1421 | --霓火匹夫
function c33700126.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(c33700126.spcon)
c:RegisterEffect(e1)
---damage
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DAMAGE)
e2:SetDescription(aux.Stringid(33700126,0))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_TO_HAND)
e2:SetCountLimit(1)
e2:SetCondition(c33700126.condition)
e2:SetTarget(c33700126.target)
e2:SetOperation(c33700126.activate)
c:RegisterEffect(e2)
end
function c33700126.spcon(e,c)
if c==nil then return true end
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
and Duel.GetFieldGroupCount(c:GetControler(),LOCATION_MZONE,0,nil)<Duel.GetFieldGroupCount(c:GetControler(),0,LOCATION_MZONE,nil)
end
function c33700126.cfilter(c,tp)
return c:IsControler(tp) and c:IsPreviousLocation(LOCATION_DECK) and not c:IsReason(REASON_DRAW)
end
function c33700126.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c33700126.cfilter,1,nil,1-tp)
end
function c33700126.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,500)
end
function c33700126.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Damage(1-tp,500,REASON_EFFECT)
end
| gpl-3.0 |
kidaa/darkstar | scripts/globals/weaponskills/raging_fists.lua | 30 | 1402 | -----------------------------------
-- Raging Fists
-- Hand-to-Hand weapon skill
-- Skill Level: 125
-- Delivers a fivefold attack. Damage varies with TP.
-- Will stack with Sneak Attack.
-- Aligned with the Thunder Gorget.
-- Aligned with the Thunder Belt.
-- Element: None
-- Modifiers: STR:30% ; DEX:30%
-- 100%TP 200%TP 300%TP
-- 1.00 4.6 9
-----------------------------------
require("scripts/globals/status");
require("scripts/globals/settings");
require("scripts/globals/weaponskills");
-----------------------------------
function onUseWeaponSkill(player, target, wsID)
local params = {};
params.numHits = 5;
params.ftp100 = 1; params.ftp200 = 1.5; params.ftp300 = 2;
params.str_wsc = 0.2; params.dex_wsc = 0.2; 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.ftp200 = 4.6; params.ftp300 = 9
params.str_wsc = 0.3; params.dex_wsc = 0.3;
end
local damage, criticalHit, tpHits, extraHits = doPhysicalWeaponskill(player, target, params);
damage = damage * WEAPON_SKILL_POWER
return tpHits, extraHits, criticalHit, damage;
end
| gpl-3.0 |
waterlgndx/darkstar | scripts/zones/Port_Bastok/npcs/Argus.lua | 2 | 3215 | -----------------------------------
-- Area: Port Bastok
-- NPC: Argus
-- Type: Mission Giver
-- !pos 132.157 7.496 -2.187 236
-----------------------------------
package.loaded["scripts/zones/Port_Bastok/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/settings");
require("scripts/globals/keyitems");
require("scripts/globals/missions");
require("scripts/zones/Port_Bastok/TextIDs");
-----------------------------------
function onTrade(player,npc,trade)
local CurrentMission = player:getCurrentMission(BASTOK);
local Count = trade:getItemCount();
if (CurrentMission ~= 255) then
if (CurrentMission == FETICHISM and player:hasCompletedMission(BASTOK,FETICHISM) == false and trade:hasItemQty(606,1) and trade:hasItemQty(607,1) and trade:hasItemQty(608,1) and trade:hasItemQty(609,1) and Count == 4) then
player:startEvent(1008); -- Finish Mission "Fetichism" (First Time)
elseif (CurrentMission == FETICHISM and trade:hasItemQty(606,1) and trade:hasItemQty(607,1) and trade:hasItemQty(608,1) and trade:hasItemQty(609,1) and Count == 4) then
player:startEvent(1005); -- Finish Mission "Fetichism" (Repeat)
elseif (CurrentMission == TO_THE_FORSAKEN_MINES and player:hasCompletedMission(BASTOK,TO_THE_FORSAKEN_MINES) == false and trade:hasItemQty(563,1) and Count == 1) then
player:startEvent(1010); -- Finish Mission "To the forsaken mines" (First Time)
elseif (CurrentMission == TO_THE_FORSAKEN_MINES and trade:hasItemQty(563,1) and Count == 1) then
player:startEvent(1006); -- Finish Mission "To the forsaken mines" (Repeat)
end
end
end;
function onTrigger(player,npc)
if (player:getNation() ~= dsp.nation.BASTOK) then
player:startEvent(1003); -- For non-Bastokian
else
local CurrentMission = player:getCurrentMission(BASTOK);
local cs, p, offset = getMissionOffset(player,1,CurrentMission,player:getVar("MissionStatus"));
if (cs ~= 0 or offset ~= 0 or ((CurrentMission == 0 or CurrentMission == 16) and offset == 0)) then
if (CurrentMission <= 15 and cs == 0) then
player:showText(npc,ORIGINAL_MISSION_OFFSET + offset); -- dialog after accepting mission (Rank 1~5)
elseif (CurrentMission > 15 and cs == 0) then
player:showText(npc,EXTENDED_MISSION_OFFSET + offset); -- dialog after accepting mission (Rank 6~10)
else
player:startEvent(cs,p[1],p[2],p[3],p[4],p[5],p[6],p[7],p[8]);
end
elseif (player:getRank() == 1 and player:hasCompletedMission(BASTOK,THE_ZERUHN_REPORT) == false) then
player:startEvent(1000); -- Start First Mission "The Zeruhn Report"
elseif (CurrentMission ~= 255) then
player:startEvent(1002); -- Have mission already activated
else
local flagMission, repeatMission = getMissionMask(player);
player:startEvent(1001,flagMission,0,0,0,0,repeatMission); -- Mission List
end
end
end;
function onEventUpdate(player,csid,option)
end;
function onEventFinish(player,csid,option)
finishMissionTimeline(player,1,csid,option);
end; | gpl-3.0 |
will4wachter/Project1 | scripts/zones/Waughroon_Shrine/bcnms/operation_desert_swarm.lua | 6 | 1778 | -----------------------------------
-- Area: Waughroon_Shrine
-- Name: Operation desert swarm
-----------------------------------
package.loaded["scripts/zones/Waughroon_Shrine/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/titles");
require("scripts/globals/quests");
require("scripts/zones/Waughroon_Shrine/TextIDs");
-----------------------------------
-- EXAMPLE SCRIPT
--
-- What should go here:
-- giving key items, playing ENDING cutscenes
--
-- What should NOT go here:
-- Handling of "battlefield" status, spawning of monsters,
-- putting loot into treasure pool,
-- enforcing ANY rules (SJ/number of people/etc), moving
-- chars around, playing entrance CSes (entrance CSes go in bcnm.lua)
-- After registering the BCNM via bcnmRegister(bcnmid)
function OnBcnmRegister(player,instance)
end;
-- Physically entering the BCNM via bcnmEnter(bcnmid)
function OnBcnmEnter(player,instance)
end;
-- Leaving the BCNM by every mean possible, given by the LeaveCode
-- 1=Select Exit on circle
-- 2=Winning the BC
-- 3=Disconnected or warped out
-- 4=Losing the BC
-- via bcnmLeave(1) or bcnmLeave(2). LeaveCodes 3 and 4 are called
-- from the core when a player disconnects or the time limit is up, etc
function OnBcnmLeave(player,instance,leavecode)
-- print("leave code "..leavecode);
if(leavecode == 2) then -- play end CS. Need time and battle id for record keeping + storage
player:startEvent(0x7d01,1,1,1,instance:getTimeInside(),1,1,0);
elseif(leavecode == 4) then
player:startEvent(0x7d02);
end
end;
function onEventUpdate(player,csid,option)
-- print("bc update csid "..csid.." and option "..option);
end;
function onEventFinish(player,csid,option)
-- print("bc finish csid "..csid.." and option "..option);
end;
| gpl-3.0 |
will4wachter/Project1 | scripts/zones/Windurst_Walls/npcs/Naih_Arihmepp.lua | 38 | 1415 | -----------------------------------
-- Area: Windurst Walls
-- NPC: Naih Arihmepp
-- Type: Standard NPC
-- @pos -64.578 -13.465 202.147 239
-----------------------------------
package.loaded["scripts/zones/Windurst_Walls/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/quests");
require("scripts/zones/Windurst_Walls/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
local WildcatWindurst = player:getVar("WildcatWindurst");
if (player:getQuestStatus(WINDURST,LURE_OF_THE_WILDCAT_WINDURST) == QUEST_ACCEPTED and player:getMaskBit(WildcatWindurst,9) == false) then
player:startEvent(0x01f4);
else
player:startEvent(0x0146);
end
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
if (csid == 0x01f4) then
player:setMaskBit(player:getVar("WildcatWindurst"),"WildcatWindurst",9,true);
end
end;
| gpl-3.0 |
will4wachter/Project1 | scripts/zones/Beaucedine_Glacier/npcs/Luck_Rune.lua | 34 | 1089 | -----------------------------------
-- Area: Beaucedine Glacier
-- NPC: Luck Rune
-- Involved in Quest: Mhaura Fortune
-- @pos 70.736 -37.778 149.624 111
-----------------------------------
package.loaded["scripts/zones/Beaucedine_Glacier/TextIDs"] = nil;
-------------------------------------
require("scripts/zones/Beaucedine_Glacier/TextIDs");
-----------------------------------
-- onTrade
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger
-----------------------------------
function onTrigger(player,npc)
player:messageSpecial(NOTHING_OUT_OF_THE_ORDINARY);
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end; | gpl-3.0 |
kidaa/darkstar | scripts/zones/Beaucedine_Glacier/npcs/Luck_Rune.lua | 34 | 1089 | -----------------------------------
-- Area: Beaucedine Glacier
-- NPC: Luck Rune
-- Involved in Quest: Mhaura Fortune
-- @pos 70.736 -37.778 149.624 111
-----------------------------------
package.loaded["scripts/zones/Beaucedine_Glacier/TextIDs"] = nil;
-------------------------------------
require("scripts/zones/Beaucedine_Glacier/TextIDs");
-----------------------------------
-- onTrade
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger
-----------------------------------
function onTrigger(player,npc)
player:messageSpecial(NOTHING_OUT_OF_THE_ORDINARY);
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end; | gpl-3.0 |
davidedmonds/darkstar | scripts/zones/RuLude_Gardens/npcs/Dugga.lua | 34 | 1074 | ----------------------------------
-- Area: Ru'Lude Gardens
-- NPC: Dugga
-- Type: Item Deliverer
-- @zone: 243
-- @pos -55.429 5.999 1.27
--
-----------------------------------
package.loaded["scripts/zones/RuLude_Gardens/TextIDs"] = nil;
require("scripts/zones/RuLude_Gardens/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
player:showText(npc, ITEM_DELIVERY_DIALOG);
player:openSendBox();
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
| gpl-3.0 |
will4wachter/Project1 | scripts/zones/RuLude_Gardens/npcs/Dugga.lua | 34 | 1074 | ----------------------------------
-- Area: Ru'Lude Gardens
-- NPC: Dugga
-- Type: Item Deliverer
-- @zone: 243
-- @pos -55.429 5.999 1.27
--
-----------------------------------
package.loaded["scripts/zones/RuLude_Gardens/TextIDs"] = nil;
require("scripts/zones/RuLude_Gardens/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
player:showText(npc, ITEM_DELIVERY_DIALOG);
player:openSendBox();
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
| gpl-3.0 |
bitladen/ustl-windows | prj/premake4.lua | 1 | 12578 |
newoption
{
trigger = "without-shared",
description = "Builds the shared library if supported by the OS"
}
newoption
{
trigger = "with-static",
description = "Builds the static library"
}
newoption
{
trigger = "with-debug",
description = "Compile for debugging"
}
newoption
{
trigger = "with-demangler",
description = "Demangle C++ symbols in backtrace"
}
newoption
{
trigger = "without-bounds",
description = "Disable runtime bounds checking on stream reads/writes"
}
newoption
{
trigger = "without-fastcopy",
description = "Disable specializations for copy/fill"
}
newoption
{
trigger = "without-mmx",
description = "Disable use of MMX/SSE/3dNow! instructions"
}
newoption
{
trigger = "force-inline",
description = "Make inline keyword mean always inline, not just a hint"
}
newoption
{
trigger = "with-libstdc++",
description = "Link with libstdc++"
}
PKG_NAME = "ustl"
PKG_VERSTR = "v1.5"
PKG_STRING = PKG_NAME..PKG_VERSTR
PKG_BUGREPORT = "Mike Sharov <msharov@users.sourceforge.net>"
-- generate config.h
newaction
{
trigger = "configure",
description = "configure",
execute = function ()
-- copy files, etc. here
printf("Configuring %s ver %s",PKG_NAME,PKG_VERSTR)
-- read config.h.in
local text = ''
local file = io.open("../config.h.in","r")
local out = io.open("../config.h","w")
if file == nil then
print("File not found config.h.in");
return
end
if out == nil then
print("File not found config.h");
return
end
while true do
local line = file:read("*l")
if line == nil then break end
text = text .. "\n" ..line
end
file:close()
if text == '' then
print("config.h.in is empty ??")
return
end
text = text:gsub("@PKG_NAME@", PKG_NAME)
text = text:gsub("@PKG_VERSTR@", PKG_VERSTR)
text = text:gsub("@PKG_STRING@", PKG_STRING)
text = text:gsub("@PKG_BUGREPORT@", PKG_BUGREPORT)
text = text:gsub("#undef HAVE_ASSERT_H", "#define HAVE_ASSERT_H 1")
text = text:gsub("#undef HAVE_ERRNO_H", "#define HAVE_ERRNO_H 1")
text = text:gsub("#undef HAVE_FLOAT_H", "#define HAVE_FLOAT_H 1")
text = text:gsub("#undef HAVE_LIMITS_H", "#define HAVE_LIMITS_H 1")
text = text:gsub("#undef HAVE_STDDEF_H", "#define HAVE_STDDEF_H 1")
text = text:gsub("#undef HAVE_STDIO_H", "#define HAVE_STDIO_H 1")
text = text:gsub("#undef HAVE_STDLIB_H", "#define HAVE_STDLIB_H 1")
text = text:gsub("#undef HAVE_CTYPE_H", "#define HAVE_CTYPE_H 1")
text = text:gsub("#undef HAVE_LOCALE_H", "#define HAVE_LOCALE_H 1" )
text = text:gsub("#undef HAVE_STRING_H", "#define HAVE_STRING_H 1")
text = text:gsub("#undef HAVE_TIME_H", "#define HAVE_TIME_H 1")
text = text:gsub("#undef HAVE_STDARG_H", "#define HAVE_STDARG_H 1")
text = text:gsub("#undef HAVE_MATH_H", "#define HAVE_MATH_H 1")
text = text:gsub("#undef HAVE_SIGNAL_H", "#define HAVE_SIGNAL_H 1")
text = text:gsub("#undef HAVE_SIGNAL_H", "#define HAVE_SIGNAL_H 0")
text = text:gsub("#undef HAVE_STDINT_H", "#define HAVE_STDINT_H 1")
text = text:gsub("#undef HAVE_INT64_T", "#define HAVE_INT64_T 1")
text = text:gsub("#define HAVE_VA_COPY 1", "#define HAVE_VA_COPY 0")
text = text:gsub("#define HAVE_STRSIGNAL 1", "#define HAVE_STRSIGNAL 0")
text = text:gsub("#define WANT_STREAM_BOUNDS_CHECKING 1", "#define WANT_STREAM_BOUNDS_CHECKING 0")
text = text:gsub("@BYTE_ORDER@", "LITTLE_ENDIAN")
-- generate config.h
out:write(text);
out:close()
end
}
solution "Project"
language "C++"
location ( _ACTION )
flags { "Unicode", "Symbols", "NoMinimalRebuild", "NoEditAndContinue", "NoPCH", "No64BitChecks" }
targetdir ( "../lib/" .. _ACTION )
libdirs { "../lib/", "../lib/" .. _ACTION }
configurations
{
"Release",
"Debug"
}
-- Multithreaded compiling
if _ACTION == "vs2010" or _ACTION=="vs2008" then
buildoptions { "/MP" }
end
configuration "Release"
defines { "NDEBUG" }
flags{ "Optimize", "FloatFast" }
includedirs { "../" }
configuration "Debug"
defines { "_DEBUG" }
includedirs { "../" }
project "uStl"
files { "../*.cc","../*.h"}
kind "StaticLib"
flags { StaticRuntime }
configuration "Release"
targetname( "uStl" )
configuration "Debug"
targetname( "uStlD" )
project "Bench"
files { "../bvt/bench.cc","../bvt/bench.h"}
kind "ConsoleApp"
links { "uStl" }
flags { StaticRuntime }
configuration "Release"
targetname( "Bench" )
configuration "Debug"
targetname( "BenchD" )
project "Bvt00"
files { "../bvt/bvt00.cc","../bvt/stdtest.cc","../bvt/stdtest.h"}
kind "ConsoleApp"
links { "uStl" }
flags { StaticRuntime }
configuration "Release"
targetname( "Bvt00" )
configuration "Debug"
targetname( "Bvt00D" )
project "Bvt01"
files { "../bvt/bvt01.cc","../bvt/stdtest.cc","../bvt/stdtest.h"}
kind "ConsoleApp"
links { "uStl" }
flags { StaticRuntime }
configuration "Release"
targetname( "Bvt01" )
configuration "Debug"
targetname( "Bvt01D" )
project "Bvt02"
files { "../bvt/bvt02.cc","../bvt/stdtest.cc","../bvt/stdtest.h"}
kind "ConsoleApp"
links { "uStl" }
flags { StaticRuntime }
configuration "Release"
targetname( "Bvt02" )
configuration "Debug"
targetname( "Bvt02D" )
project "Bvt03"
files { "../bvt/bvt03.cc","../bvt/stdtest.cc","../bvt/stdtest.h"}
kind "ConsoleApp"
links { "uStl" }
flags { StaticRuntime }
configuration "Release"
targetname( "Bvt03" )
configuration "Debug"
targetname( "Bvt03D" )
project "Bvt04"
files { "../bvt/bvt04.cc","../bvt/stdtest.cc","../bvt/stdtest.h"}
kind "ConsoleApp"
links { "uStl" }
flags { StaticRuntime }
configuration "Release"
targetname( "Bvt04" )
configuration "Debug"
targetname( "Bvt04D" )
project "Bvt05"
files { "../bvt/bvt05.cc","../bvt/stdtest.cc","../bvt/stdtest.h"}
kind "ConsoleApp"
links { "uStl" }
flags { StaticRuntime }
configuration "Release"
targetname( "Bvt05" )
configuration "Debug"
targetname( "Bvt05D" )
project "Bvt06"
files { "../bvt/bvt06.cc","../bvt/stdtest.cc","../bvt/stdtest.h"}
kind "ConsoleApp"
links { "uStl" }
flags { StaticRuntime }
configuration "Release"
targetname( "Bvt06" )
configuration "Debug"
targetname( "Bvt06D" )
project "Bvt06"
files { "../bvt/bvt06.cc","../bvt/stdtest.cc","../bvt/stdtest.h"}
kind "ConsoleApp"
links { "uStl" }
flags { StaticRuntime }
configuration "Release"
targetname( "Bvt06" )
configuration "Debug"
targetname( "Bvt06D" )
project "Bvt07"
files { "../bvt/bvt07.cc","../bvt/stdtest.cc","../bvt/stdtest.h"}
kind "ConsoleApp"
links { "uStl" }
flags { StaticRuntime }
configuration "Release"
targetname( "Bvt07" )
configuration "Debug"
targetname( "Bvt07D" )
project "Bvt08"
files { "../bvt/bvt08.cc","../bvt/stdtest.cc","../bvt/stdtest.h"}
kind "ConsoleApp"
links { "uStl" }
flags { StaticRuntime }
configuration "Release"
targetname( "Bvt08" )
configuration "Debug"
targetname( "Bvt08D" )
project "Bvt09"
files { "../bvt/bvt09.cc","../bvt/stdtest.cc","../bvt/stdtest.h"}
kind "ConsoleApp"
links { "uStl" }
flags { StaticRuntime }
configuration "Release"
targetname( "Bvt09" )
configuration "Debug"
targetname( "Bvt09D" )
project "Bvt10"
files { "../bvt/bvt10.cc","../bvt/stdtest.cc","../bvt/stdtest.h"}
kind "ConsoleApp"
links { "uStl" }
flags { StaticRuntime }
configuration "Release"
targetname( "Bvt10" )
configuration "Debug"
targetname( "Bvt10D" )
project "Bvt11"
files { "../bvt/bvt11.cc","../bvt/stdtest.cc","../bvt/stdtest.h"}
kind "ConsoleApp"
links { "uStl" }
flags { StaticRuntime }
configuration "Release"
targetname( "Bvt11" )
configuration "Debug"
targetname( "Bvt11D" )
project "Bvt12"
files { "../bvt/bvt12.cc","../bvt/stdtest.cc","../bvt/stdtest.h"}
kind "ConsoleApp"
links { "uStl" }
flags { StaticRuntime }
configuration "Release"
targetname( "Bvt12" )
configuration "Debug"
targetname( "Bvt12D" )
project "Bvt13"
files { "../bvt/bvt13.cc","../bvt/stdtest.cc","../bvt/stdtest.h"}
kind "ConsoleApp"
links { "uStl" }
flags { StaticRuntime }
configuration "Release"
targetname( "Bvt13" )
configuration "Debug"
targetname( "Bvt13D" )
project "Bvt14"
files { "../bvt/bvt14.cc","../bvt/stdtest.cc","../bvt/stdtest.h"}
kind "ConsoleApp"
links { "uStl" }
flags { StaticRuntime }
configuration "Release"
targetname( "Bvt14" )
configuration "Debug"
targetname( "Bvt14D" )
project "Bvt15"
files { "../bvt/bvt15.cc","../bvt/stdtest.cc","../bvt/stdtest.h"}
kind "ConsoleApp"
links { "uStl" }
flags { StaticRuntime }
configuration "Release"
targetname( "Bvt15" )
configuration "Debug"
targetname( "Bvt15D" )
project "Bvt16"
files { "../bvt/bvt16.cc","../bvt/stdtest.cc","../bvt/stdtest.h"}
kind "ConsoleApp"
links { "uStl" }
flags { StaticRuntime }
configuration "Release"
targetname( "Bvt16" )
configuration "Debug"
targetname( "Bvt16D" )
project "Bvt17"
files { "../bvt/bvt17.cc","../bvt/stdtest.cc","../bvt/stdtest.h"}
kind "ConsoleApp"
links { "uStl" }
flags { StaticRuntime }
configuration "Release"
targetname( "Bvt17" )
configuration "Debug"
targetname( "Bvt17D" )
project "Bvt18"
files { "../bvt/bvt18.cc","../bvt/stdtest.cc","../bvt/stdtest.h"}
kind "ConsoleApp"
links { "uStl" }
flags { StaticRuntime }
configuration "Release"
targetname( "Bvt18" )
configuration "Debug"
targetname( "Bvt18D" )
project "Bvt19"
files { "../bvt/bvt19.cc","../bvt/stdtest.cc","../bvt/stdtest.h"}
kind "ConsoleApp"
links { "uStl" }
flags { StaticRuntime }
configuration "Release"
targetname( "Bvt19" )
configuration "Debug"
targetname( "Bvt19D" )
project "Bvt00"
files { "../bvt/bvt00.cc","../bvt/stdtest.cc","../bvt/stdtest.h"}
kind "ConsoleApp"
links { "uStl" }
flags { StaticRuntime }
configuration "Release"
targetname( "Bvt00" )
configuration "Debug"
targetname( "Bvt00D" )
project "Bvt20"
files { "../bvt/bvt20.cc","../bvt/stdtest.cc","../bvt/stdtest.h"}
kind "ConsoleApp"
links { "uStl" }
flags { StaticRuntime }
configuration "Release"
targetname( "Bvt20" )
configuration "Debug"
targetname( "Bvt20D" )
project "Bvt21"
files { "../bvt/bvt21.cc","../bvt/stdtest.cc","../bvt/stdtest.h"}
kind "ConsoleApp"
links { "uStl" }
flags { StaticRuntime }
configuration "Release"
targetname( "Bvt21" )
configuration "Debug"
targetname( "Bvt21D" )
project "Bvt22"
files { "../bvt/bvt22.cc","../bvt/stdtest.cc","../bvt/stdtest.h"}
kind "ConsoleApp"
links { "uStl" }
flags { StaticRuntime }
configuration "Release"
targetname( "Bvt22" )
configuration "Debug"
targetname( "Bvt22D" )
project "Bvt23"
files { "../bvt/bvt23.cc","../bvt/stdtest.cc","../bvt/stdtest.h"}
kind "ConsoleApp"
links { "uStl" }
flags { StaticRuntime }
configuration "Release"
targetname( "Bvt23" )
configuration "Debug"
targetname( "Bvt23D" )
project "Bvt24"
files { "../bvt/bvt24.cc","../bvt/stdtest.cc","../bvt/stdtest.h"}
kind "ConsoleApp"
links { "uStl" }
flags { StaticRuntime }
configuration "Release"
targetname( "Bvt24" )
configuration "Debug"
targetname( "Bvt24D" )
project "Bvt25"
files { "../bvt/bvt25.cc","../bvt/stdtest.cc","../bvt/stdtest.h"}
kind "ConsoleApp"
links { "uStl" }
flags { StaticRuntime }
configuration "Release"
targetname( "Bvt25" )
configuration "Debug"
targetname( "Bvt25D" )
project "Bvt26"
files { "../bvt/bvt26.cc","../bvt/stdtest.cc","../bvt/stdtest.h"}
kind "ConsoleApp"
links { "uStl" }
flags { StaticRuntime }
configuration "Release"
targetname( "Bvt26" )
configuration "Debug"
targetname( "Bvt26D" )
project "Bvt27"
files { "../bvt/bvt27.cc","../bvt/stdtest.cc","../bvt/stdtest.h"}
kind "ConsoleApp"
links { "uStl" }
flags { StaticRuntime }
configuration "Release"
targetname( "Bvt27" )
configuration "Debug"
targetname( "Bvt27D" )
| mit |
will4wachter/Project1 | scripts/zones/Lower_Jeuno/npcs/_l08.lua | 36 | 1561 | -----------------------------------
-- Area: Lower Jeuno
-- NPC: Streetlamp
-- Involved in Quests: Community Service
-- @zone 245
-- @pos -32.897 0 -28.521
-----------------------------------
package.loaded["scripts/zones/Lower_Jeuno/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/settings");
require("scripts/globals/quests");
require("scripts/zones/Lower_Jeuno/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
local hour = VanadielHour();
if (hour >= 18 and hour < 21) then
if (player:getQuestStatus(JEUNO,COMMUNITY_SERVICE) == QUEST_ACCEPTED) then
if (player:getVar("cService") == 3) then
player:setVar("cService",4);
end
elseif (hour >= 18 and hour < 21) then
if (player:getQuestStatus(JEUNO,COMMUNITY_SERVICE) == QUEST_COMPLETED) then
if (player:getVar("cService") == 16) then
player:setVar("cService",17);
end
end
end
end
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end; | gpl-3.0 |
kidaa/darkstar | scripts/commands/zone.lua | 24 | 13672 | ---------------------------------------------------------------------------------------------------
-- func: zone
-- desc: Teleports a player to the given zone.
---------------------------------------------------------------------------------------------------
cmdprops =
{
permission = 1,
parameters = "s"
};
---------------------------------------------------------------------------------------------------
-- desc: List of zones with their auto-translated group and message id.
-- note: The format is as follows: groupId, messageId, zoneId
---------------------------------------------------------------------------------------------------
local zone_list =
{
{ 0x14, 0xA9, 1 }, -- Phanauet Channel
{ 0x14, 0xAA, 2 }, -- Carpenters' Landing
{ 0x14, 0x84, 3 }, -- Manaclipper
{ 0x14, 0x85, 4 }, -- Bibiki Bay
{ 0x14, 0x8A, 5 }, -- Uleguerand Range
{ 0x14, 0x8B, 6 }, -- Bearclaw Pinnacle
{ 0x14, 0x86, 7 }, -- Attohwa Chasm
{ 0x14, 0x87, 8 }, -- Boneyard Gully
{ 0x14, 0x88, 9 }, -- Pso'Xja
{ 0x14, 0x89, 10 }, -- The Shrouded Maw
{ 0x14, 0x8C, 11 }, -- Oldton Movalpolos
{ 0x14, 0x8D, 12 }, -- Newton Movalpolos
{ 0x14, 0x8E, 13 }, -- Mine Shaft #2716
{ 0x14, 0xDC, 13 }, -- Mine Shaft #2716
{ 0x14, 0xAB, 14 }, -- Hall of Transference
{ 0x14, 0x9B, 16 }, -- Promyvion - Holla
{ 0x14, 0x9A, 16 }, -- Promyvion - Holla
{ 0x14, 0x9C, 17 }, -- Spire of Holla
{ 0x14, 0x9E, 18 }, -- Promyvion - Dem
{ 0x14, 0x9D, 18 }, -- Promyvion - Dem
{ 0x14, 0x9F, 19 }, -- Spire of Dem
{ 0x14, 0xA0, 20 }, -- Promyvion - Mea
{ 0x14, 0xA1, 20 }, -- Promyvion - Mea
{ 0x14, 0xA2, 21 }, -- Spire of Mea
{ 0x14, 0xA3, 22 }, -- Promyvion - Vahzl
{ 0x14, 0xA4, 22 }, -- Promyvion - Vahzl
{ 0x14, 0xA5, 22 }, -- Promyvion - Vahzl
{ 0x14, 0xA6, 22 }, -- Promyvion - Vahzl
{ 0x14, 0xA7, 23 }, -- Spire of Vahzl
{ 0x14, 0xA8, 23 }, -- Spire of Vahzl
{ 0x14, 0x90, 24 }, -- Lufaise Meadows
{ 0x14, 0x91, 25 }, -- Misareaux Coast
{ 0x14, 0x8F, 26 }, -- Tavnazian Safehold
{ 0x14, 0x93, 27 }, -- Phomiuna Aqueducts
{ 0x14, 0x94, 28 }, -- Sacrarium
{ 0x14, 0x96, 29 }, -- Riverne - Site #B01
{ 0x14, 0x95, 29 }, -- Riverne - Site #B01
{ 0x14, 0x98, 30 }, -- Riverne - Site #A01
{ 0x14, 0x97, 30 }, -- Riverne - Site #A01
{ 0x14, 0x99, 31 }, -- Monarch Linn
{ 0x14, 0x92, 32 }, -- Sealion's Den
{ 0x14, 0xAC, 33 }, -- Al'Taieu
{ 0x14, 0xAD, 34 }, -- Grand Palace of Hu'Xzoi
{ 0x14, 0xAE, 35 }, -- The Garden of Ru'Hmet
{ 0x14, 0xB0, 36 }, -- Empyreal Paradox
{ 0x14, 0xB1, 37 }, -- Temenos
{ 0x14, 0xB2, 38 }, -- Apollyon
{ 0x14, 0xB4, 39 }, -- Dynamis - Valkurm
{ 0x14, 0xB5, 40 }, -- Dynamis - Buburimu
{ 0x14, 0xB6, 41 }, -- Dynamis - Qufim
{ 0x14, 0xB7, 42 }, -- Dynamis - Tavnazia
{ 0x14, 0xAF, 43 }, -- Diorama Abdhaljs-Ghelsba
{ 0x14, 0xB8, 44 }, -- Abdhaljs Isle-Purgonorgo
{ 0x14, 0xB9, 46 }, -- Open sea route to Al Zahbi
{ 0x14, 0xBA, 47 }, -- Open sea route to Mhaura
{ 0x14, 0xBB, 48 }, -- Al Zahbi
{ 0x14, 0xDB, 50 }, -- Aht Urhgan Whitegate
{ 0x14, 0xBC, 50 }, -- Aht Urhgan Whitegate
{ 0x14, 0xBD, 51 }, -- Wajaom Woodlands
{ 0x14, 0xBE, 52 }, -- Bhaflau Thickets
{ 0x14, 0xBF, 53 }, -- Nashmau
{ 0x14, 0xC0, 54 }, -- Arrapago Reef
{ 0x14, 0xC1, 55 }, -- Ilrusi Atoll
{ 0x14, 0xC2, 56 }, -- Periqia
{ 0x14, 0xC3, 57 }, -- Talacca Cove
{ 0x14, 0xC4, 58 }, -- Silver Sea route to Nashmau
{ 0x14, 0xC5, 59 }, -- Silver Sea route to Al Zahbi
{ 0x14, 0xC6, 60 }, -- The Ashu Talif
{ 0x14, 0xC7, 61 }, -- Mount Zhayolm
{ 0x14, 0xC8, 62 }, -- Halvung
{ 0x14, 0xC9, 63 }, -- Lebros Cavern
{ 0x14, 0xCA, 64 }, -- Navukgo Execution Chamber
{ 0x14, 0xCB, 65 }, -- Mamook
{ 0x14, 0xCC, 66 }, -- Mamool Ja Training Grounds
{ 0x14, 0xCD, 67 }, -- Jade Sepulcher
{ 0x14, 0xCE, 68 }, -- Aydeewa Subterrane
{ 0x14, 0xCF, 69 }, -- Leujaoam Sanctum
{ 0x27, 0x0F, 70 }, -- Chocobo Circuit
{ 0x27, 0x10, 71 }, -- The Colosseum
{ 0x14, 0xDD, 72 }, -- Alzadaal Undersea Ruins
{ 0x14, 0xDE, 73 }, -- Zhayolm Remnants
{ 0x14, 0xDF, 74 }, -- Arrapago Remnants
{ 0x14, 0xE0, 75 }, -- Bhaflau Remnants
{ 0x14, 0xE1, 76 }, -- Silver Sea Remnants
{ 0x14, 0xE2, 77 }, -- Nyzul Isle
{ 0x14, 0xDA, 78 }, -- Hazhalm Testing Grounds
{ 0x14, 0xD0, 79 }, -- Caedarva Mire
{ 0x27, 0x11, 80 }, -- Southern San d'Oria [S]
{ 0x27, 0x13, 81 }, -- East Ronfaure [S]
{ 0x27, 0x15, 82 }, -- Jugner Forest [S]
{ 0x27, 0x23, 83 }, -- Vunkerl Inlet [S]
{ 0x27, 0x17, 84 }, -- Batallia Downs [S]
{ 0x27, 0x3E, 85 }, -- La Vaule [S]
{ 0x27, 0x40, 85 }, -- La Vaule [S]
{ 0x27, 0x19, 86 }, -- Everbloom Hollow
{ 0x27, 0x1C, 87 }, -- Bastok Markets [S]
{ 0x27, 0x1E, 88 }, -- North Gustaberg [S]
{ 0x27, 0x20, 89 }, -- Grauberg [S]
{ 0x27, 0x25, 90 }, -- Pashhow Marshlands [S]
{ 0x27, 0x27, 91 }, -- Rolanberry Fields [S]
{ 0x27, 0x42, 92 }, -- Beadeaux [S]
{ 0x27, 0x22, 93 }, -- Ruhotz Silvermines
{ 0x27, 0x2B, 94 }, -- Windurst Waters [S]
{ 0x27, 0x2D, 95 }, -- West Sarutabaruta [S]
{ 0x27, 0x2F, 96 }, -- Fort Karugo-Narugo [S]
{ 0x27, 0x32, 97 }, -- Meriphataud Mountains [S]
{ 0x27, 0x34, 98 }, -- Sauromugue Champaign [S]
{ 0x27, 0x44, 99 }, -- Castle Oztroja [S]
{ 0x14, 0x11, 100 }, -- West Ronfaure
{ 0x14, 0x0F, 101 }, -- East Ronfaure
{ 0x14, 0x51, 102 }, -- La Theine Plateau
{ 0x14, 0x60, 103 }, -- Valkurm Dunes
{ 0x14, 0x01, 104 }, -- Jugner Forest
{ 0x14, 0x02, 105 }, -- Batallia Downs
{ 0x14, 0x64, 106 }, -- North Gustaberg
{ 0x14, 0x63, 107 }, -- South Gustaberg
{ 0x14, 0x69, 108 }, -- Konschtat Highlands
{ 0x14, 0x2B, 109 }, -- Pashhow Marshlands
{ 0x14, 0x07, 110 }, -- Rolanberry Fields
{ 0x14, 0x24, 111 }, -- Beaucedine Glacier
{ 0x14, 0x4D, 112 }, -- Xarcabard
{ 0x14, 0x3D, 113 }, -- Cape Teriggan
{ 0x14, 0x3E, 114 }, -- Eastern Altepa Desert
{ 0x14, 0x18, 115 }, -- West Sarutabaruta
{ 0x14, 0x27, 116 }, -- East Sarutabaruta
{ 0x14, 0x17, 117 }, -- Tahrongi Canyon
{ 0x14, 0x16, 118 }, -- Buburimu Peninsula
{ 0x14, 0x20, 119 }, -- Meriphataud Mountains
{ 0x14, 0x2E, 120 }, -- Sauromugue Champaign
{ 0x14, 0x3F, 121 }, -- The Sanctuary of Zi'Tah
{ 0x14, 0x7D, 122 }, -- Ro'Maeve
{ 0x14, 0x7C, 122 }, -- Ro'Maeve
{ 0x14, 0x40, 123 }, -- Yuhtunga Jungle
{ 0x14, 0x41, 124 }, -- Yhoator Jungle
{ 0x14, 0x42, 125 }, -- Western Altepa Desert
{ 0x14, 0x08, 126 }, -- Qufim Island
{ 0x14, 0x0A, 127 }, -- Behemoth's Dominion
{ 0x14, 0x43, 128 }, -- Valley of Sorrows
{ 0x27, 0x31, 129 }, -- Ghoyu's Reverie
{ 0x14, 0x6F, 130 }, -- Ru'Aun Gardens
{ 0x14, 0x82, 134 }, -- Dynamis - Beaucedine
{ 0x14, 0x83, 135 }, -- Dynamis - Xarcabard
{ 0x27, 0x46, 136 }, -- Beaucedine Glacier [S]
{ 0x27, 0x48, 137 }, -- Xarcabard [S]
{ 0x14, 0x65, 139 }, -- Horlais Peak
{ 0x14, 0x6C, 140 }, -- Ghelsba Outpost
{ 0x14, 0x1F, 141 }, -- Fort Ghelsba
{ 0x14, 0x5E, 142 }, -- Yughott Grotto
{ 0x14, 0x66, 143 }, -- Palborough Mines
{ 0x14, 0x1A, 144 }, -- Waughroon Shrine
{ 0x14, 0x21, 145 }, -- Giddeus
{ 0x14, 0x19, 146 }, -- Balga's Dais
{ 0x14, 0x2A, 147 }, -- Beadeaux
{ 0x14, 0x28, 148 }, -- Qulun Dome
{ 0x14, 0x68, 149 }, -- Davoi
{ 0x14, 0x6D, 150 }, -- Monastic Cavern
{ 0x14, 0x23, 151 }, -- Castle Oztroja
{ 0x14, 0x04, 152 }, -- Altar Room
{ 0x14, 0x44, 153 }, -- The Boyahda Tree
{ 0x14, 0x37, 154 }, -- Dragon's Aery
{ 0x14, 0x0C, 157 }, -- Middle Delkfutt's Tower
{ 0x14, 0x0B, 158 }, -- Upper Delkfutt's Tower
{ 0x14, 0x36, 159 }, -- Temple of Uggalepih
{ 0x14, 0x35, 160 }, -- Den of Rancor
{ 0x14, 0x26, 161 }, -- Castle Zvahl Baileys
{ 0x14, 0x25, 161 }, -- Castle Zvahl Baileys
{ 0x14, 0x50, 162 }, -- Castle Zvahl Keep
{ 0x14, 0x4F, 162 }, -- Castle Zvahl Keep
{ 0x14, 0x39, 163 }, -- Sacrificial Chamber
{ 0x27, 0x36, 164 }, -- Garlaige Citadel [S]
{ 0x14, 0x5D, 165 }, -- Throne Room
{ 0x14, 0x2D, 166 }, -- Ranguemont Pass
{ 0x14, 0x32, 167 }, -- Bostaunieux Oubliette
{ 0x14, 0x3B, 168 }, -- Chamber of Oracles
{ 0x14, 0x1D, 169 }, -- Toraimarai Canal
{ 0x14, 0x5C, 170 }, -- Full Moon Fountain
{ 0x27, 0x29, 171 }, -- Crawlers' Nest [S]
{ 0x14, 0x61, 172 }, -- Zeruhn Mines
{ 0x14, 0x5B, 173 }, -- Korroloka Tunnel
{ 0x14, 0x5A, 174 }, -- Kuftal Tunnel
{ 0x27, 0x1A, 175 }, -- The Eldieme Necropolis [S]
{ 0x14, 0x59, 176 }, -- Sea Serpent Grotto
{ 0x14, 0x71, 177 }, -- Ve'Lugannon Palace
{ 0x14, 0x70, 177 }, -- Ve'Lugannon Palace
{ 0x14, 0x72, 178 }, -- The Shrine of Ru'Avitau
{ 0x14, 0xB3, 179 }, -- Stellar Fulcrum
{ 0x14, 0x73, 180 }, -- La'Loff Amphitheater
{ 0x14, 0x74, 181 }, -- The Celestial Nexus
{ 0x14, 0x0D, 184 }, -- Lower Delkfutt's Tower
{ 0x14, 0x7E, 185 }, -- Dynamis - San d'Oria
{ 0x14, 0x7F, 186 }, -- Dynamis - Bastok
{ 0x14, 0x80, 187 }, -- Dynamis - Windurst
{ 0x14, 0x81, 188 }, -- Dynamis - Jeuno
{ 0x14, 0x6E, 190 }, -- King Ranperre's Tomb
{ 0x14, 0x62, 191 }, -- Dangruf Wadi
{ 0x14, 0x1C, 192 }, -- Inner Horutoto Ruins
{ 0x14, 0x03, 193 }, -- Ordelle's Caves
{ 0x14, 0x1B, 194 }, -- Outer Horutoto Ruins
{ 0x14, 0x6A, 195 }, -- The Eldieme Necropolis
{ 0x14, 0x67, 196 }, -- Gusgen Mines
{ 0x14, 0x2C, 197 }, -- Crawlers' Nest
{ 0x14, 0x15, 198 }, -- Maze of Shakhrami
{ 0x14, 0x14, 200 }, -- Garlaige Citadel
{ 0x14, 0x77, 201 }, -- Cloister of Gales
{ 0x14, 0x75, 202 }, -- Cloister of Storms
{ 0x14, 0x7A, 203 }, -- Cloister of Frost
{ 0x14, 0x4A, 204 }, -- Fei'Yin
{ 0x14, 0x58, 205 }, -- Ifrit's Cauldron
{ 0x14, 0x6B, 206 }, -- Qu'Bia Arena
{ 0x14, 0x78, 207 }, -- Cloister of Flames
{ 0x14, 0x57, 208 }, -- Quicksand Caves
{ 0x14, 0x76, 209 }, -- Cloister of Tremors
{ 0x14, 0x79, 211 }, -- Cloister of Tides
{ 0x14, 0x34, 212 }, -- Gustav Tunnel
{ 0x14, 0x33, 213 }, -- Labyrinth of Onzozo
{ 0x14, 0x4C, 230 }, -- Southern San d'Oria
{ 0x14, 0x30, 231 }, -- Northern San d'Oria
{ 0x14, 0x52, 232 }, -- Port San d'Oria
{ 0x14, 0x22, 233 }, -- Chateau d'Oraguille
{ 0x14, 0x46, 234 }, -- Bastok Mines
{ 0x14, 0x56, 235 }, -- Bastok Markets
{ 0x14, 0x3C, 236 }, -- Port Bastok
{ 0x14, 0x2F, 237 }, -- Metalworks
{ 0x14, 0x3A, 238 }, -- Windurst Waters
{ 0x14, 0x54, 239 }, -- Windurst Walls
{ 0x14, 0x45, 240 }, -- Port Windurst
{ 0x14, 0x38, 241 }, -- Windurst Woods
{ 0x14, 0x55, 242 }, -- Heavens Tower
{ 0x14, 0x13, 243 }, -- Ru'Lude Gardens
{ 0x14, 0x4E, 244 }, -- Upper Jeuno
{ 0x14, 0x0E, 245 }, -- Lower Jeuno
{ 0x14, 0x06, 246 }, -- Port Jeuno
{ 0x14, 0x31, 247 }, -- Rabao
{ 0x14, 0x5F, 248 }, -- Selbina
{ 0x14, 0x1E, 249 }, -- Mhaura
{ 0x14, 0x29, 250 }, -- Kazham
{ 0x14, 0x7B, 251 }, -- Hall of the Gods
{ 0x14, 0x09, 252 }, -- Norg
{ 0x27, 0x4C, 256 }, -- Western Adoulin
{ 0x27, 0x4D, 257 }, -- Eastern Adoulin
{ 0x27, 0x4E, 259 }, -- Rala Waterways [U]
{ 0x27, 0x4F, 260 }, -- Yahse Hunting Grounds
{ 0x27, 0x50, 261 }, -- Ceizak Battlegrounds
{ 0x27, 0x51, 262 }, -- Foret de Hennetiel
{ 0x27, 0x56, 264 }, -- Yorcia Weald [U]
{ 0x27, 0x52, 265 }, -- Morimar Basalt Fields
{ 0x27, 0x57, 266 }, -- Marjami Ravine
{ 0x27, 0x5C, 267 }, -- Kamihr Drifts
{ 0x27, 0x53, 268 }, -- Sih Gates
{ 0x27, 0x54, 269 }, -- Moh Gates
{ 0x27, 0x55, 271 }, -- Cirdas Caverns [U]
{ 0x27, 0x58, 272 }, -- Dho Gates
{ 0x27, 0x5D, 273 }, -- Woh Gates
{ 0x27, 0x12, 275 }, -- Outer Ra'Kaznar [U]
{ 0x27, 0x5A, 280 }, -- Mog Garden
{ 0x27, 0x59, 284 }, -- Celennia Memorial Library
{ 0x27, 0x5B, 285 }, -- Feretory
};
---------------------------------------------------------------------------------------------------
-- func: onTrigger
-- desc: Called when this command is invoked.
---------------------------------------------------------------------------------------------------
function onTrigger(player, zoneId)
local word = "";
local i = 0;
local zone = zoneId;
-- Ensure a zone was given..
if (zoneId == nil) then
player:PrintToPlayer("You must enter a zone id.");
return;
end
-- Was the zone auto-translated..
if (string.sub(zoneId, 1, 2) == '\253\02' and string.byte(zoneId, 5) ~= nil and string.byte(zoneId, 6) == 0xFD) then
-- Pull the group and message id from the translated string..
local groupId = string.byte(zoneId, 4);
local messageId = string.byte(zoneId, 5);
-- Attempt to lookup this zone..
for k, v in pairs(zone_list) do
if (v[1] == groupId and v[2] == messageId) then
player:setPos(0, 0, 0, 0, v[3]);
return;
end
end
-- Zone was not found, allow the user to know..
player:PrintToPlayer('Unknown zone, could not teleport.');
return;
end
player:setPos(0, 0, 0, 0, zoneId);
end
| gpl-3.0 |
lhog/Zero-K | scripts/shieldriot.lua | 1 | 18597 | include 'constants.lua'
local base = piece 'base'
local pelvis = piece 'pelvis'
local torso = piece 'torso'
local emit = piece 'emit'
local fire = piece 'fire'
local lleg = piece 'lleg'
local rleg = piece 'rleg'
local lowerlleg = piece 'lowerlleg'
local lowerrleg = piece 'lowerrleg'
local lfoot = piece 'lfoot'
local rfoot = piece 'rfoot'
local l_gun = piece 'l_gun'
local r_gun = piece 'r_gun'
local smokePiece = {torso}
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- Signal definitions
local SIG_WALK = 1
local SIG_AIM = 2
local SIG_ACTIVATE = 8
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
local spGetUnitWeaponState = Spring.GetUnitWeaponState
local spSetUnitWeaponState = Spring.SetUnitWeaponState
local spGetUnitRulesParam = Spring.GetUnitRulesParam
local spGetGameFrame = Spring.GetGameFrame
local waveWeaponDef = WeaponDefNames["shieldriot_blast"]
local WAVE_RELOAD = math.floor(waveWeaponDef.reload * Game.gameSpeed)
local WAVE_TIMEOUT = math.ceil(waveWeaponDef.damageAreaOfEffect / waveWeaponDef.explosionSpeed)* (1000 / Game.gameSpeed) + 200 -- empirically maximum delay of damage was (damageAreaOfEffect / explosionSpeed) - 4 frames
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- For G:\code\Zero-K-Artwork\blender_animations\outlaw.blend Created by https://github.com/Beherith/Skeletor_S3O V((0, 3, 7))
local ANIM_FRAMES = 4
local walking = false -- prevent script.StartMoving from spamming threads if already walking
local function Walk()
Signal(SIG_WALK)
SetSignalMask(SIG_WALK)
local speedMult, sleepTime = GG.Script.GetSpeedParams(unitID, ANIM_FRAMES)
-- Frame: 5 (first step)
Turn(lfoot, x_axis, -1.005157, 36.441551 * speedMult) -- delta=69.60
Turn(lfoot, z_axis, 0.000000, 0.269081 * speedMult) -- delta=0.51
Turn(lfoot, y_axis, -0.000000, 0.305522 * speedMult) -- delta=0.58
Turn(lleg, x_axis, 0.706633, 16.035916 * speedMult) -- delta=-30.63
Turn(lleg, z_axis, -0.025628, 0.920972 * speedMult) -- delta=-1.76
Turn(lleg, y_axis, 0.216548, 6.711383 * speedMult) -- delta=12.82
Turn(lowerlleg, x_axis, 0.436177, 24.491338 * speedMult) -- delta=-46.78
Turn(lowerlleg, z_axis, 0.000000, 1.131782 * speedMult) -- delta=-2.16
Turn(lowerlleg, y_axis, -0.000000, 6.023916 * speedMult) -- delta=11.50
Turn(lowerrleg, x_axis, 0.054725, 12.527276 * speedMult) -- delta=-23.93
Turn(lowerrleg, z_axis, 0.000000, 0.067490 * speedMult) -- delta=0.13
Turn(lowerrleg, y_axis, -0.000000, 0.312260 * speedMult) -- delta=-0.60
Turn(pelvis, x_axis, 0.122507, 3.675203 * speedMult) -- delta=-7.02
Turn(pelvis, z_axis, -0.014222, 0.426656 * speedMult) -- delta=-0.81
Turn(pelvis, y_axis, -0.247694, 7.430825 * speedMult) -- delta=-14.19
Turn(rfoot, x_axis, 0.666361, 14.462757 * speedMult) -- delta=-27.62
Turn(rfoot, z_axis, 0.000000, 0.089851 * speedMult) -- delta=0.17
Turn(rfoot, y_axis, -0.000000, 0.095897 * speedMult) -- delta=0.18
Turn(rleg, x_axis, -0.843606, 30.666600 * speedMult) -- delta=58.57
Turn(rleg, z_axis, -0.032587, 1.068274 * speedMult) -- delta=-2.04
Turn(rleg, y_axis, 0.242480, 7.343706 * speedMult) -- delta=14.03
Turn(torso, x_axis, 0.002425, 0.072750 * speedMult) -- delta=-0.14
Turn(torso, z_axis, 0.000000, 1.047198 * speedMult) -- delta=2.00
Turn(torso, y_axis, 0.226893, 6.806784 * speedMult) -- delta=13.00
Sleep(sleepTime)
while true do
speedMult, sleepTime = GG.Script.GetSpeedParams(unitID, ANIM_FRAMES)
-- Frame:9
Turn(lfoot, x_axis, -0.251141, 22.620467 * speedMult) -- delta=-43.20
Turn(lleg, x_axis, 1.005390, 8.962684 * speedMult) -- delta=-17.12
Turn(lleg, z_axis, 0.188916, 6.436310 * speedMult) -- delta=12.29
Turn(lleg, y_axis, 0.328514, 3.358976 * speedMult) -- delta=6.42
Turn(lowerlleg, x_axis, -0.266738, 21.087460 * speedMult) -- delta=40.27
Turn(lowerrleg, x_axis, -0.298917, 10.609255 * speedMult) -- delta=20.26
Move(pelvis, y_axis, -0.500000, 38.099999 * speedMult) -- delta=1.27
Turn(pelvis, x_axis, 0.070150, 1.570692 * speedMult) -- delta=3.00
Turn(pelvis, z_axis, -0.115316, 3.032836 * speedMult) -- delta=-5.79
Turn(pelvis, y_axis, -0.180727, 2.009007 * speedMult) -- delta=3.84
Turn(rfoot, x_axis, 0.317229, 10.473948 * speedMult) -- delta=20.00
Turn(rleg, x_axis, -0.107487, 22.083575 * speedMult) -- delta=-42.18
Turn(rleg, z_axis, 0.107260, 4.195432 * speedMult) -- delta=8.01
Turn(rleg, y_axis, 0.170010, 2.174100 * speedMult) -- delta=-4.15
Turn(torso, x_axis, 0.012572, 0.304422 * speedMult) -- delta=-0.58
Turn(torso, z_axis, 0.056303, 1.689084 * speedMult) -- delta=3.23
Turn(torso, y_axis, 0.176278, 1.518438 * speedMult) -- delta=-2.90
Sleep(sleepTime)
-- Frame:13
Turn(lfoot, x_axis, 0.786735, 31.136284 * speedMult) -- delta=-59.47
Turn(lleg, x_axis, -0.646235, 49.548731 * speedMult) -- delta=94.63
Turn(lleg, z_axis, 0.146929, 1.259611 * speedMult) -- delta=-2.41
Turn(lleg, y_axis, -0.098604, 12.813533 * speedMult) -- delta=-24.47
Turn(lowerlleg, x_axis, -0.065542, 6.035895 * speedMult) -- delta=-11.53
Turn(lowerrleg, x_axis, 0.229709, 15.858770 * speedMult) -- delta=-30.29
Move(pelvis, y_axis, 1.652101, 64.563024 * speedMult) -- delta=2.15
Turn(pelvis, x_axis, -0.000000, 2.104511 * speedMult) -- delta=4.02
Turn(pelvis, z_axis, -0.082305, 0.990339 * speedMult) -- delta=1.89
Turn(pelvis, y_axis, -0.000000, 5.421818 * speedMult) -- delta=10.35
Turn(rfoot, x_axis, -0.416225, 22.003623 * speedMult) -- delta=42.02
Turn(rleg, x_axis, 0.185462, 8.788442 * speedMult) -- delta=-16.78
Turn(rleg, z_axis, 0.094637, 0.378714 * speedMult) -- delta=-0.72
Turn(rleg, y_axis, 0.020262, 4.492442 * speedMult) -- delta=-8.58
Turn(torso, x_axis, 0.008382, 0.125724 * speedMult) -- delta=0.24
Turn(torso, z_axis, 0.069813, 0.405311 * speedMult) -- delta=0.77
Turn(torso, y_axis, 0.003491, 5.183626 * speedMult) -- delta=-9.90
Sleep(sleepTime)
-- Frame:17
Turn(lfoot, x_axis, 0.409120, 11.328447 * speedMult) -- delta=21.64
Turn(lleg, x_axis, -1.386774, 22.216178 * speedMult) -- delta=42.43
Turn(lleg, z_axis, -0.037102, 5.520910 * speedMult) -- delta=-10.54
Turn(lleg, y_axis, -0.133782, 1.055339 * speedMult) -- delta=-2.02
Turn(lowerlleg, x_axis, 0.490075, 16.668494 * speedMult) -- delta=-31.83
Turn(lowerrleg, x_axis, 0.574914, 10.356164 * speedMult) -- delta=-19.78
Move(pelvis, y_axis, 0.261050, 41.731514 * speedMult) -- delta=-1.39
Turn(pelvis, x_axis, 0.058467, 1.754012 * speedMult) -- delta=-3.35
Turn(pelvis, z_axis, 0.019272, 3.047312 * speedMult) -- delta=5.82
Turn(pelvis, y_axis, 0.182876, 5.486267 * speedMult) -- delta=10.48
Turn(rfoot, x_axis, -0.989586, 17.200840 * speedMult) -- delta=32.85
Turn(rleg, x_axis, 0.353818, 5.050702 * speedMult) -- delta=-9.65
Turn(rleg, z_axis, -0.022840, 3.524285 * speedMult) -- delta=-6.73
Turn(rleg, y_axis, -0.174735, 5.849882 * speedMult) -- delta=-11.17
Turn(torso, x_axis, 0.004191, 0.125724 * speedMult) -- delta=0.24
Turn(torso, z_axis, 0.033161, 1.099557 * speedMult) -- delta=-2.10
Turn(torso, y_axis, -0.176278, 5.393067 * speedMult) -- delta=-10.30
Sleep(sleepTime)
-- Frame:21
Turn(lfoot, x_axis, 0.655366, 7.387388 * speedMult) -- delta=-14.11
Turn(lleg, x_axis, -0.808922, 17.335550 * speedMult) -- delta=-33.11
Turn(lleg, z_axis, 0.022915, 1.800507 * speedMult) -- delta=3.44
Turn(lleg, y_axis, -0.246012, 3.366888 * speedMult) -- delta=-6.43
Turn(lowerlleg, x_axis, 0.031159, 13.767468 * speedMult) -- delta=26.29
Turn(lowerrleg, x_axis, 0.492353, 2.476824 * speedMult) -- delta=4.73
Move(pelvis, y_axis, -1.770000, 60.931510 * speedMult) -- delta=-2.03
Turn(pelvis, x_axis, 0.122507, 1.921191 * speedMult) -- delta=-3.67
Turn(pelvis, z_axis, 0.014222, 0.151504 * speedMult) -- delta=-0.29
Turn(pelvis, y_axis, 0.247694, 1.944559 * speedMult) -- delta=3.71
Turn(rfoot, x_axis, -1.028214, 1.158838 * speedMult) -- delta=2.21
Turn(rleg, x_axis, 0.673646, 9.594827 * speedMult) -- delta=-18.32
Turn(rleg, z_axis, 0.009465, 0.969130 * speedMult) -- delta=1.85
Turn(rleg, y_axis, -0.220874, 1.384183 * speedMult) -- delta=-2.64
Turn(torso, x_axis, 0.002425, 0.052974 * speedMult) -- delta=0.10
Turn(torso, z_axis, 0.000000, 0.994838 * speedMult) -- delta=-1.90
Turn(torso, y_axis, -0.227120, 1.525266 * speedMult) -- delta=-2.91
Sleep(sleepTime)
-- Frame:25
Turn(lfoot, x_axis, 0.263757, 11.748286 * speedMult) -- delta=22.44
Turn(lleg, x_axis, -0.100336, 21.257606 * speedMult) -- delta=-40.60
Turn(lleg, z_axis, -0.099219, 3.664037 * speedMult) -- delta=-7.00
Turn(lleg, y_axis, -0.163469, 2.476269 * speedMult) -- delta=4.73
Turn(lowerlleg, x_axis, -0.251907, 8.491991 * speedMult) -- delta=16.22
Turn(lowerrleg, x_axis, -0.247002, 22.180654 * speedMult) -- delta=42.36
Move(pelvis, y_axis, -0.500000, 38.099999 * speedMult) -- delta=1.27
Turn(pelvis, x_axis, 0.070150, 1.570692 * speedMult) -- delta=3.00
Turn(pelvis, z_axis, 0.115316, 3.032836 * speedMult) -- delta=5.79
Turn(pelvis, y_axis, 0.180727, 2.009007 * speedMult) -- delta=-3.84
Turn(rfoot, x_axis, -0.254467, 23.212399 * speedMult) -- delta=-44.33
Turn(rleg, x_axis, 0.987347, 9.411042 * speedMult) -- delta=-17.97
Turn(rleg, z_axis, -0.209936, 6.582020 * speedMult) -- delta=-12.57
Turn(rleg, y_axis, -0.341115, 3.607243 * speedMult) -- delta=-6.89
Turn(torso, x_axis, 0.004219, 0.053822 * speedMult) -- delta=-0.10
Turn(torso, z_axis, -0.103338, 3.100140 * speedMult) -- delta=-5.92
Turn(torso, y_axis, -0.195477, 0.949308 * speedMult) -- delta=1.81
Sleep(sleepTime)
-- Frame:29
Turn(lfoot, x_axis, -0.376806, 19.216895 * speedMult) -- delta=36.70
Turn(lleg, x_axis, 0.064771, 4.953183 * speedMult) -- delta=-9.46
Turn(lleg, z_axis, -0.110995, 0.353254 * speedMult) -- delta=-0.67
Turn(lleg, y_axis, -0.027836, 4.069008 * speedMult) -- delta=7.77
Turn(lowerlleg, x_axis, 0.150576, 12.074482 * speedMult) -- delta=-23.06
Turn(lowerrleg, x_axis, -0.049790, 5.916367 * speedMult) -- delta=-11.30
Move(pelvis, y_axis, 1.652101, 64.563024 * speedMult) -- delta=2.15
Turn(pelvis, x_axis, 0.158951, 2.664019 * speedMult) -- delta=-5.09
Turn(pelvis, z_axis, 0.106503, 0.264413 * speedMult) -- delta=-0.50
Turn(pelvis, y_axis, 0.022281, 4.753387 * speedMult) -- delta=-9.08
Turn(rfoot, x_axis, 0.753413, 30.236423 * speedMult) -- delta=-57.75
Turn(rleg, x_axis, -0.793763, 53.433303 * speedMult) -- delta=102.05
Turn(rleg, z_axis, -0.150095, 1.795224 * speedMult) -- delta=3.43
Turn(rleg, y_axis, 0.055340, 11.893670 * speedMult) -- delta=22.72
Turn(torso, x_axis, -0.000000, 0.126572 * speedMult) -- delta=0.24
Turn(torso, z_axis, -0.083776, 0.586866 * speedMult) -- delta=1.12
Turn(torso, y_axis, -0.017453, 5.340707 * speedMult) -- delta=10.20
Sleep(sleepTime)
-- Frame:33
Turn(lfoot, x_axis, -0.986966, 18.304795 * speedMult) -- delta=34.96
Turn(lleg, x_axis, 0.351070, 8.588974 * speedMult) -- delta=-16.40
Turn(lleg, z_axis, -0.010896, 3.002964 * speedMult) -- delta=5.74
Turn(lleg, y_axis, 0.158288, 5.583717 * speedMult) -- delta=10.66
Turn(lowerlleg, x_axis, 0.578171, 12.827866 * speedMult) -- delta=-24.50
Turn(lowerrleg, x_axis, 0.563778, 18.407012 * speedMult) -- delta=-35.15
Move(pelvis, y_axis, 0.261050, 41.731514 * speedMult) -- delta=-1.39
Turn(pelvis, x_axis, 0.058469, 3.014475 * speedMult) -- delta=5.76
Turn(pelvis, z_axis, -0.000000, 3.195079 * speedMult) -- delta=-6.10
Turn(pelvis, y_axis, -0.174533, 5.904419 * speedMult) -- delta=-11.28
Turn(rfoot, x_axis, 0.389044, 10.931070 * speedMult) -- delta=20.88
Turn(rleg, x_axis, -1.436901, 19.294136 * speedMult) -- delta=36.85
Turn(rleg, z_axis, -0.096006, 1.622677 * speedMult) -- delta=3.10
Turn(rleg, y_axis, 0.242815, 5.624240 * speedMult) -- delta=10.74
Turn(torso, x_axis, 0.004191, 0.125724 * speedMult) -- delta=-0.24
Turn(torso, z_axis, -0.033161, 1.518436 * speedMult) -- delta=2.90
Turn(torso, y_axis, 0.175933, 5.801579 * speedMult) -- delta=11.08
Sleep(sleepTime)
-- Frame:37
Turn(lfoot, x_axis, -1.005157, 0.545715 * speedMult) -- delta=1.04
Turn(lleg, x_axis, 0.706633, 10.666913 * speedMult) -- delta=-20.37
Turn(lleg, z_axis, -0.025628, 0.441968 * speedMult) -- delta=-0.84
Turn(lleg, y_axis, 0.216548, 1.747790 * speedMult) -- delta=3.34
Turn(lowerlleg, x_axis, 0.436177, 4.259818 * speedMult) -- delta=8.14
Turn(lowerrleg, x_axis, 0.054725, 15.271580 * speedMult) -- delta=29.17
Move(pelvis, y_axis, -1.770000, 60.931510 * speedMult) -- delta=-2.03
Turn(pelvis, x_axis, 0.122507, 1.921147 * speedMult) -- delta=-3.67
Turn(pelvis, z_axis, -0.014222, 0.426656 * speedMult) -- delta=-0.81
Turn(pelvis, y_axis, -0.247694, 2.194837 * speedMult) -- delta=-4.19
Turn(rfoot, x_axis, 0.666361, 8.319496 * speedMult) -- delta=-15.89
Turn(rleg, x_axis, -0.843606, 17.798851 * speedMult) -- delta=-33.99
Turn(rleg, z_axis, -0.032587, 1.902556 * speedMult) -- delta=3.63
Turn(torso, x_axis, 0.002425, 0.052974 * speedMult) -- delta=0.10
Turn(torso, z_axis, 0.000000, 0.994838 * speedMult) -- delta=1.90
Turn(torso, y_axis, 0.226893, 1.528804 * speedMult) -- delta=2.92
Sleep(sleepTime)
end
end
local function StopWalking()
Signal(SIG_WALK)
SetSignalMask(SIG_WALK)
local speedMult = 0.5 * GG.Script.GetSpeedParams(unitID, ANIM_FRAMES) -- slower restore speed for last step
Move(pelvis, y_axis, -1.852628, 161.407560 * speedMult)
Turn(lfoot, x_axis, 0.209562, 91.103878 * speedMult)
Turn(lfoot, y_axis, -0.010184, 0.763806 * speedMult)
Turn(lfoot, z_axis, -0.008969, 0.672702 * speedMult)
Turn(lleg, x_axis, 0.172103, 123.871829 * speedMult)
Turn(lleg, y_axis, -0.007165, 32.033832 * speedMult)
Turn(lleg, z_axis, 0.005071, 16.090774 * speedMult)
Turn(lowerlleg, x_axis, -0.380201, 61.228345 * speedMult)
Turn(lowerlleg, y_axis, -0.200797, 15.059790 * speedMult)
Turn(lowerlleg, z_axis, 0.037726, 2.829455 * speedMult)
Turn(lowerrleg, x_axis, -0.362851, 55.451636 * speedMult)
Turn(lowerrleg, y_axis, 0.010409, 0.780649 * speedMult)
Turn(lowerrleg, z_axis, -0.002250, 0.168725 * speedMult)
Turn(pelvis, x_axis, 0.000000, 9.188008 * speedMult)
Turn(pelvis, y_axis, 0.000000, 18.577062 * speedMult)
Turn(pelvis, z_axis, 0.000000, 7.987697 * speedMult)
Turn(rfoot, x_axis, 0.184269, 75.591058 * speedMult)
Turn(rfoot, y_axis, -0.003197, 0.239744 * speedMult)
Turn(rfoot, z_axis, -0.002995, 0.224628 * speedMult)
Turn(rleg, x_axis, 0.178614, 133.583258 * speedMult)
Turn(rleg, y_axis, -0.002311, 29.734174 * speedMult)
Turn(rleg, z_axis, 0.003022, 16.455050 * speedMult)
Turn(torso, x_axis, 0.000000, 0.761055 * speedMult)
Turn(torso, y_axis, 0.000000, 17.016960 * speedMult)
Turn(torso, z_axis, -0.034907, 7.750349 * speedMult)
end
function script.StartMoving()
if not walking then
walking = true
StartThread(Walk)
end
end
function script.StopMoving()
walking = false
StartThread(StopWalking)
end
function AutoAttack_Thread()
Signal(SIG_ACTIVATE)
SetSignalMask(SIG_ACTIVATE)
while true do
Sleep(100)
local reloaded = select(2, spGetUnitWeaponState(unitID,3))
if reloaded then
local height = select(5, Spring.GetUnitPosition(unitID, true))
if height > -8 then -- Matches offset of AimFromWeapon position for FAKEGUN2
local gameFrame = spGetGameFrame()
local reloadMult = spGetUnitRulesParam(unitID, "totalReloadSpeedChange") or 1.0
local reloadFrame = gameFrame + WAVE_RELOAD / reloadMult
spSetUnitWeaponState(unitID, 3, {reloadFrame = reloadFrame})
GG.PokeDecloakUnit(unitID, unitDefID)
EmitSfx(emit, GG.Script.UNIT_SFX1)
EmitSfx(emit, GG.Script.DETO_W2)
FireAnim()
end
end
end
end
function script.Create()
StartThread(GG.Script.SmokeUnit, unitID, smokePiece)
end
function FireAnim()
local mspeed = 4
Move (l_gun, x_axis, 2, mspeed*3)
Move (r_gun, x_axis, -2, mspeed*3)
WaitForMove(l_gun, x_axis)
WaitForMove(r_gun, x_axis)
Sleep(1)
Move (l_gun, x_axis, 0, mspeed)
Move (r_gun, x_axis, 0, mspeed)
Sleep(1)
end
function script.Activate()
StartThread(AutoAttack_Thread)
end
function script.Deactivate()
Signal(SIG_ACTIVATE)
end
function script.FireWeapon(num)
if num == 3 then
EmitSfx(emit, GG.Script.UNIT_SFX1)
EmitSfx(emit, GG.Script.DETO_W2)
FireAnim()
end
end
function script.AimFromWeapon(num)
return torso
end
function script.AimWeapon(num, heading, pitch)
return num == 3
end
function script.QueryWeapon(num)
return emit
end
local function Killed(recentDamage, maxHealth)
local severity = recentDamage/maxHealth
if severity <= .25 then
Explode(base, SFX.NONE)
Explode(torso, SFX.NONE)
Explode(rleg, SFX.NONE)
Explode(lleg, SFX.NONE)
Explode(lowerrleg, SFX.NONE)
Explode(lowerlleg, SFX.NONE)
Explode(rfoot, SFX.NONE)
Explode(lfoot, SFX.NONE)
return 1
elseif severity <= .50 then
Explode(base, SFX.NONE)
Explode(torso, SFX.NONE)
Explode(rleg, SFX.NONE)
Explode(lleg, SFX.NONE)
Explode(lowerrleg, SFX.NONE)
Explode(lowerlleg, SFX.NONE)
Explode(rfoot, SFX.NONE)
Explode(lfoot, SFX.NONE)
return 1
elseif severity <= .99 then
Explode(base, SFX.SHATTER + SFX.FIRE + SFX.SMOKE + SFX.EXPLODE_ON_HIT)
Explode(torso, SFX.NONE)
Explode(rleg, SFX.FALL + SFX.FIRE + SFX.SMOKE + SFX.EXPLODE_ON_HIT)
Explode(lleg, SFX.SHATTER + SFX.FIRE + SFX.SMOKE + SFX.EXPLODE_ON_HIT)
Explode(lowerrleg, SFX.NONE)
Explode(lowerlleg, SFX.NONE)
Explode(rfoot, SFX.SHATTER + SFX.FIRE + SFX.SMOKE + SFX.EXPLODE_ON_HIT)
Explode(lfoot, SFX.NONE)
return 2
else
Explode(base, SFX.SHATTER + SFX.FIRE + SFX.SMOKE + SFX.EXPLODE_ON_HIT)
Explode(torso, SFX.NONE)
Explode(rleg, SFX.FALL + SFX.FIRE + SFX.SMOKE + SFX.EXPLODE_ON_HIT)
Explode(lleg, SFX.SHATTER + SFX.FIRE + SFX.SMOKE + SFX.EXPLODE_ON_HIT)
Explode(lowerrleg, SFX.NONE)
Explode(lowerlleg, SFX.NONE)
Explode(rfoot, SFX.SHATTER + SFX.FIRE + SFX.SMOKE + SFX.EXPLODE_ON_HIT)
Explode(lfoot, SFX.NONE)
return 2
end
end
function script.Killed(recentDamage, maxHealth)
Signal(SIG_ACTIVATE) -- prevent pulsing while undead
-- keep the unit technically alive (but hidden) for some time so that any inbound
-- pulses know who their owner is (so that they can do no damage to allies)
return GG.Script.DelayTrueDeath(unitID, unitDefID, recentDamage, maxHealth, Killed, WAVE_TIMEOUT)
end
| gpl-2.0 |
will4wachter/Project1 | scripts/zones/Northern_San_dOria/npcs/_6fc.lua | 21 | 1890 | -----------------------------------
-- Area: Northern San d'Oria
-- NPC: Papal Chambers
-- Finish Mission: The Davoi Report
-- @pos 131 -11 122 231
-----------------------------------
package.loaded["scripts/zones/Northern_San_dOria/TextIDs"] = nil;
package.loaded["scripts/globals/missions"] = nil;
-----------------------------------
require("scripts/globals/missions");
require("scripts/globals/keyitems");
require("scripts/zones/Northern_San_dOria/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
if(player:getCurrentMission(SANDORIA) == THE_DAVOI_REPORT and player:hasKeyItem(TEMPLE_KNIGHTS_DAVOI_REPORT)) then
player:startEvent(0x02b7); -- Finish Mission "The Davoi Report"
elseif(player:getCurrentMission(SANDORIA,PRESTIGE_OF_THE_PAPSQUE) and player:getVar("MissionStatus") == 0)then
player:startEvent(0x0007);
elseif(player:getCurrentMission(SANDORIA,PRESTIGE_OF_THE_PAPSQUE) and player:getVar("MissionStatus") == 1)then
player:startEvent(0x0009);
elseif(player:getCurrentMission(SANDORIA,PRESTIGE_OF_THE_PAPSQUE) and player:hasKeyItem(ANCIENT_SANDORIAN_TABLET))then
player:startEvent(0x0008);
end
return 1;
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
if(csid == 0x02b7 or csid == 0x0007 or csid == 0x0008) then
finishMissionTimeline(player,3,csid,option);
end
end; | gpl-3.0 |
lhog/Zero-K | LuaUI/Widgets/unit_clippy.lua | 6 | 14748 | local playerID = Spring.GetMyPlayerID()
local customkeys = playerID and select(10, Spring.GetPlayerInfo(playerID))
local rank = (customkeys and tonumber(customkeys.level) or 0) or select(9, Spring.GetPlayerInfo(playerID, false))
function widget:GetInfo()
return {
name = "Clippy Comments",
desc = "v0.4 Makes units give tips.",
author = "KingRaptor",
date = "2011.5.6",
license = "Public Domain",
layer = 0,
enabled = false, -- (rank and rank == 1) or true,
}
end
VFS.Include("LuaRules/Configs/constants.lua")
------------------------
-- speedups
local spGetGameSeconds = Spring.GetGameSeconds
local spGetMyTeamID = Spring.GetMyTeamID
local spGetTeamUnitsByDefs = Spring.GetTeamUnitsByDefs
local spGetTeamResources = Spring.GetTeamResources
local spGetTeamRulesParam = Spring.GetTeamRulesParam
local spGetUnitDefID = Spring.GetUnitDefID
local spGetUnitHealth = Spring.GetUnitHealth
------------------------
-- CONFIG
------------------------
options_path = 'Settings/Tips/Clippy Comments'
options = {
rankLimit = {
name = "Rank Limit",
type = 'bool',
value = false,
noHotkey = true,
desc = 'Units make comments only to newbies.',
},
warnExpensiveUnits = {
name = "Warning for Expensive Units",
type = 'bool',
value = true,
noHotkey = true,
desc = 'Units complain about expensive units made early game.',
},
cartoonBubbles = {
name = "Cartoon Bubbles",
type = 'bool',
value = false,
noHotkey = true,
desc = 'Use cartoon bubbles + font instead of a standard panel.',
}
}
VFS.Include("LuaUI/Configs/clippy.lua",nil)
local activeTips = {} -- [unitID] = {stuff for tip being displayed}
local units = {}
local haveFactoryDefIDs = {}
local lastFactoryTime = -100000 -- gameframe
local totalValue = 0
local defenseValue = 0
local airSpotted = false
local nukeSpotted = false
local fontSize = 12
local updateFrequency = 0.2
local myTeam = spGetMyTeamID()
local activeCommand
local currentBuilder
local gameframe = Spring.GetGameFrame()
-----------------------
-- minimum complexity of tips to display
-- 1 = new to RTS
-- 2 = a bit of experience with ZK
-- 3 = up to intermediate
local helpLevel = rank and math.min(rank, 3) or 1
-- Chili classes
local Chili
local Window
local TextBox
local Image
local Font
local Panel
-- Chili instances
local screen0
local font = "LuaUI/Fonts/komtxt__.ttf"
------------------------
------------------------
if VFS.FileExists("mission.lua") then
return
end
--see gui_chili_economy_panel2.lua
local cp = {}
-- note works only in communism mode
local function UpdateCustomParamResourceData()
local teamID = Spring.GetLocalTeamID()
cp.allies = spGetTeamRulesParam(teamID, "OD_allies") or 1
if cp.allies < 1 then
cp.allies = 1
end
cp.team_metalBase = spGetTeamRulesParam(teamID, "OD_team_metalBase") or 0
cp.team_metalOverdrive = spGetTeamRulesParam(teamID, "OD_team_metalOverdrive") or 0
cp.team_metalMisc = spGetTeamRulesParam(teamID, "OD_team_metalMisc") or 0
cp.team_energyIncome = spGetTeamRulesParam(teamID, "OD_team_energyIncome") or 0
cp.team_energyOverdrive = spGetTeamRulesParam(teamID, "OD_team_energyOverdrive") or 0
cp.team_energyWaste = spGetTeamRulesParam(teamID, "OD_team_energyWaste") or 0
cp.metalBase = spGetTeamRulesParam(teamID, "OD_metalBase") or 0
cp.metalOverdrive = spGetTeamRulesParam(teamID, "OD_metalOverdrive") or 0
cp.metalMisc = spGetTeamRulesParam(teamID, "OD_metalMisc") or 0
cp.energyIncome = spGetTeamRulesParam(teamID, "OD_energyIncome") or 0
cp.energyOverdrive = spGetTeamRulesParam(teamID, "OD_energyOverdrive") or 0
cp.energyChange = spGetTeamRulesParam(teamID, "OD_energyChange") or 0
end
local function DisposeTip(unitID)
if not unitID then return end
if activeTips[unitID] and activeTips[unitID].img then
activeTips[unitID].img:Dispose()
end
activeTips[unitID] = nil
end
local function GetTipDimensions(unitID, str, height, invert)
local textHeight, _, numLines = gl.GetTextHeight(str)
local size = fontSize
if not options.cartoonBubbles.value then
size = size + 2
end
textHeight = textHeight*size*numLines
local textWidth = gl.GetTextWidth(str)*size
local ux, uy, uz = Spring.GetUnitPosition(unitID)
uy = uy + height
local x,y,z = Spring.WorldToScreenCoords(ux, uy, uz)
if not invert then
y = screen0.height - y
end
return textWidth, textHeight, x, y, height
end
local function MakeTip(unitID, tip)
if not (unitID and tip) then return end
if (options.rankLimit.value and (rank > RANK_LIMIT)) then
return
end
if Spring.GetUnitIsDead(unitID) then
return
end
DisposeTip(unitID)
local strings = tips[tip].str
local str = strings[math.random(#strings)]
local height = Spring.GetUnitHeight(unitID)
if not height then return end
local textWidth, textHeight, x, y = GetTipDimensions(unitID, str, height)
local img = nil
if not options.cartoonBubbles.value then
--str = str:gsub("\n"," ")
img = Panel:New {
width = textWidth + 4,
height = textHeight + 4 + fontSize,
x = x - (textWidth + 8)/2;
y = y - textHeight - 4 - fontSize;
--file = "LuaUI/Images/speechbubble.png";
--padding = {2,2,2,2},
parent = screen0;
}
else
img = Image:New {
width = textWidth + 4,
height = textHeight + 4 + fontSize,
x = x - (textWidth+8)/2;
y = y - textHeight - 4 - fontSize;
keepAspect = false,
file = "LuaUI/Images/speechbubble.png";
parent = screen0;
}
end
local fontDef = { size = fontSize }
if options.cartoonBubbles.value then
fontDef.font = font
fontDef.color = {0,0,0,1}
fontDef.outlineColor = {0,0,0,0}
end
local textBox = TextBox:New{
parent = img;
text = str,
height = options.cartoonBubbles.value and "100%" or textHeight,
width = options.cartoonBubbles.value and "100%" or textWidth,
x = 4,
y = 4,
valign = "center";
align = "left";
font = fontDef,
}
activeTips[unitID] = {str = str, expire = gameframe + tips[tip].life*30, height = height, img = img, textBox = textBox}
tips[tip].lastUsed = gameframe
end
local function ProcessCommand(unitID, command)
if not (unitID and Spring.ValidUnitID(unitID)) then return end
if -command == NANO_DEF_ID then
if tips.nano_excess.lastUsed > gameframe - tips.nano_excess.cooldown*30 then
return
end
--local _,_,_,metalIncome,metalExpense = spGetTeamResources(myTeam, "metal")
--if (metalIncome - metalExpense) < MIN_PULL_FOR_NANOS then
local metalIncome = select(4, spGetTeamResources(myTeam, "metal"))
local numNanos = #(Spring.GetTeamUnitsByDefs(myTeam, NANO_DEF_ID) or {})
if numNanos > 0 and (metalIncome/numNanos < METAL_PER_NANO) then
MakeTip(unitID, "nano_excess")
end
elseif factories[-command] then
if haveFactoryDefIDs[-command] then
MakeTip(unitID, "factory_duplicate")
return
elseif (gameframe < lastFactoryTime + DELAY_BETWEEN_FACS) and not (Spring.GetUnitRulesParam(unitID, "facplop") == 1) then
MakeTip(unitID, "factory_multiple")
return
end
elseif superweapons[-command] and TIMER_SUPERWEAPON > gameframe/30 then
if tips.superweapon.lastUsed > gameframe - tips.superweapon.cooldown*30 then
return
end
MakeTip(unitID, "superweapon")
return
elseif hyperweapons[-command] and TIMER_HYPERWEAPON > gameframe/30 then
if tips.superweapon.lastUsed > gameframe - tips.superweapon.cooldown*30 then
return
end
MakeTip(unitID, "superweapon")
return
elseif expensive_units[-command] and options.warnExpensiveUnits.value and TIMER_EXPENSIVE_UNITS > gameframe/30 then
if tips.expensive_unit.lastUsed > gameframe - tips.expensive_unit.cooldown*30 then
return
end
local metalIncome = select(4, spGetTeamResources(myTeam, "metal"))
if metalIncome < INCOME_TO_SPLURGE then
MakeTip(currentBuilder, "expensive_unit")
return
end
end
if defenses[-command] then
if tips.defense_excess.lastUsed > gameframe - tips.defense_excess.cooldown*30 then
return
end
if totalValue == 0 then return end
if defenseValue/totalValue > DEFENSE_QUOTA then
MakeTip(unitID, "defense_excess")
return
end
end
if energy[-command] == nil then
if (tips.energy_deficit.lastUsed > gameframe - tips.energy_deficit.cooldown*30) or (tips.metal_excess.lastUsed > gameframe - tips.metal_excess.cooldown*30) then
return
end
end
-- resource tips
local eCurr, eStor, ePull, eInco, eExpe, eShar, eSent, eReci = spGetTeamResources(myTeam, "energy")
local mCurr, mStor, mPull, mInco, mExpe, mShar, mSent, mReci = spGetTeamResources(myTeam, "metal")
UpdateCustomParamResourceData()
local eReclaim = eInco
eInco = eInco + cp.energyIncome - math.max(0, cp.energyChange)
local extraMetalPull = Spring.GetTeamRulesParam(myTeam, "extraMetalPull") or 0
local extraEnergyPull = Spring.GetTeamRulesParam(myTeam, "extraEnergyPull") or 0
mPull = mPull + extraMetalPull
local extraChange = math.min(0, cp.energyChange) - math.min(0, cp.energyOverdrive)
eExpe = eExpe + extraChange
ePull = ePull + extraEnergyPull + extraChange - cp.team_energyWaste/cp.allies
eStor = eStor - HIDDEN_STORAGE
mStor = mStor - HIDDEN_STORAGE
if energy[-command] then
if tips.energy_excess.lastUsed > gameframe - tips.energy_excess.cooldown*30 then
return
end
if (eInco/mInco > ENERGY_TO_METAL_RATIO) and eStor > 0 and (eCurr/eStor > 0.9) then
MakeTip(unitID, "energy_excess")
return
end
end
if ((eInco/mInco < 1) or (eInco - ePull < 0)) and (eCurr < ENERGY_LOW_THRESHOLD) and not energy[-command] then
MakeTip(unitID, "energy_deficit")
elseif mStor > 0 and mCurr/mStor > 0.95 and mInco - mExpe > 0 then
MakeTip(unitID, "metal_excess")
--elseif metalCurrent/metalStorage > 0.05 and metalIncome - metalExpense < 0 then
-- MakeTip(unitID, "metal_deficit")
end
end
------------------------
------------------------
local timer = 0
function widget:Update(dt)
timer = timer + dt
if timer > updateFrequency then
if (Spring.GetSpectatingState() or Spring.IsReplay()) and (not Spring.IsCheatingEnabled()) then
Spring.Echo("<Clippy Comments> Spectator mode or replay. Widget removed.")
widgetHandler:RemoveWidget()
end
myTeam = spGetMyTeamID() -- just refresh for fun
timer = 0
local command = select(2, Spring.GetActiveCommand())
if command and command < 0 and (activeCommand ~= command) then
ProcessCommand(currentBuilder, command)
activeCommand = command
end
end
-- chili code
for unitID, tipData in pairs(activeTips) do
if Spring.IsUnitInView(unitID) then
local textWidth, textHeight, x, y = GetTipDimensions(unitID, tipData.str, tipData.height)
local img = tipData.img
if img.hidden then
screen0:AddChild(img)
img.hidden = false
end
--img.x = x - (textWidth+8)/2
--img.y = y - textHeight - 4 - fontSize
--img:Invalidate()
if options.cartoonBubbles.value then
img:SetPos(x - (textWidth+8)/2, y - textHeight - 4 - fontSize)
else
img:SetPos(x - (textWidth)/4, y - textHeight - 12 - fontSize)
end
elseif not tipData.img.hidden then
screen0:RemoveChild(tipData.img)
tipData.img.hidden = true
end
if tipData.expire < gameframe then
DisposeTip(unitID)
end
end
end
function widget:UnitDestroyed(unitID, unitDefID, unitTeam)
if units[unitID] then
local cost = UnitDefs[unitDefID].metalCost or 0
totalValue = totalValue - cost
if defenses[unitDefID] then
defenseValue = defenseValue - cost
elseif factories[unitDefID] then
haveFactoryDefIDs[unitDefID] = nil
lastFactoryTime = -100000
end
end
DisposeTip(unitID)
end
function widget:UnitFinished(unitID, unitDefID, unitTeam)
if unitTeam == myTeam then
units[unitID] = true
local cost = UnitDefs[unitDefID].metalCost or 0
totalValue = totalValue + cost
if defenses[unitDefID] then
defenseValue = defenseValue + cost
elseif factories[unitDefID] then
haveFactoryDefIDs[unitDefID] = true
lastFactoryTime = gameframe
end
end
end
function widget:UnitGiven(unitID, unitDefID, newTeamID, teamID)
if newTeamID == myTeam then
widget:UnitFinished(unitID, unitDefID, teamID)
elseif teamID == myTeam then
widget:UnitDestroyed(unitID, unitDefID, teamID)
end
end
function widget:GameFrame(n)
gameframe = n
end
function widget:UnitCommand(unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions)
if unitTeam == myTeam and cmdID < 0 then
ProcessCommand(unitID, cmdID)
end
end
-- obscures healthbars
--[[
function widget:UnitDamaged(unitID, unitDefID, unitTeam)
if unitTeam == myTeam and canRetreat[unitDefID] then
if tips.retreat_repair.lastUsed > gameframe - tips.retreat_repair.cooldown*30 then
return
end
local health, maxHealth = spGetUnitHealth(unitID)
if health/maxHealth < 0.5 then
MakeTip(unitID, "retreat_repair")
end
end
end
]]--
function widget:SelectionChanged(newSelection)
--get new selected con, if any
for i=1,#newSelection do
local id = newSelection[i]
local unitDefID = spGetUnitDefID(id)
if unitDefID and UnitDefs[unitDefID] and UnitDefs[unitDefID].isBuilder then
currentBuilder = id
return
end
end
currentBuilder = nil
end
function widget:Initialize()
if VFS.FileExists("mission.lua") then
widgetHandler:RemoveWidget() -- no need for tips in mission
end
local selection = Spring.GetSelectedUnits()
widget:SelectionChanged(selection)
Chili = WG.Chili
TextBox = Chili.TextBox
Image = Chili.Image
Font = Chili.Font
Panel = Chili.Panel
screen0 = Chili.Screen0
-- reload compatibility
local units = Spring.GetTeamUnits(myTeam)
for i=1,#units do
widget:UnitFinished(units[i], Spring.GetUnitDefID(units[i]), myTeam)
end
end
-- non-chili code
--[[
local function DrawUnitFunc(xshift, yshift, text)
gl.Translate(xshift,yshift,0)
gl.Billboard()
gl.Text(text, 0,0, 14, "cs")
end
function widget:DrawScreen()
if Spring.IsGUIHidden() then return end
gl.DepthMask(true)
gl.DepthTest(true)
gl.AlphaTest(GL.GREATER, 0.001)
gl.Texture("LuaUI/Images/speechbubble.png")
for unitID, tipData in pairs(activeTips) do
if Spring.IsUnitInView(unitID) then
gl.PushMatrix()
local textWidth, textHeight, x, y = GetTipDimensions(unitID, tipData.str, tipData.height, true)
gl.Translate(x, y + textHeight + 8, 0)
gl.Color(1,1,1,1)
local bubbleHeight = (textHeight+4)
local bubbleWidth = textWidth+4
gl.TexRect(-bubbleWidth/2, -bubbleHeight, bubbleWidth/2, bubbleHeight)
gl.Color(0,0,0,1)
gl.Translate(0, textHeight/2, 0)
fontHandler.UseFont("LuaUI/Fonts/KOMTXT___16")
--fontHandler.DrawCentered(tipData.str, 0, 0)
gl.Text(tipData.str, 0,0, fontSize, "co")
--gl.DrawFuncAtUnit(unitID, false, DrawUnitFunc,
-- 0, tipData.height, tipData.str)
gl.PopMatrix()
end
if tipData.expire < gameframe then
activeTips[unitID] = nil
end
end
end
]]--
| gpl-2.0 |
failcoder/SVUI_-Core | filtering/class_filters/pets.lua | 1 | 1323 | --[[
##########################################################
S V U I By: Munglunch
##########################################################
LOCALIZED LUA FUNCTIONS
##########################################################
GET ADDON DATA
##########################################################
]]--
local SV = select(2, ...)
--[[ PET FILTERS ]]--
SV.filterdefaults["PetBuffWatch"] = {
["19615"] = {-- Frenzy
["enable"] = true,
["id"] = 19615,
["point"] = "TOPLEFT",
["color"] = {["r"] = 0.89, ["g"] = 0.09, ["b"] = 0.05},
["anyUnit"] = true,
["onlyShowMissing"] = false,
['style'] = 'coloredIcon',
['displayText'] = false,
['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1},
['textThreshold'] = -1,
['xOffset'] = 0,
['yOffset'] = 0
},
["136"] = {-- Mend Pet
["enable"] = true,
["id"] = 136,
["point"] = "TOPRIGHT",
["color"] = {["r"] = 0.2, ["g"] = 0.8, ["b"] = 0.2},
["anyUnit"] = true,
["onlyShowMissing"] = false,
['style'] = 'coloredIcon',
['displayText'] = false,
['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1},
['textThreshold'] = -1,
['xOffset'] = 0,
['yOffset'] = 0
},
}; | mit |
waterlgndx/darkstar | scripts/zones/Outer_Horutoto_Ruins/npcs/_5eg.lua | 2 | 3228 | -----------------------------------
-- Area: Inner Horutoto Ruins
-- NPC: Ancient Magical Gizmo #3 (G out of E, F, G, H, I, J)
-- Involved In Mission: The Heart of the Matter
-----------------------------------
package.loaded["scripts/zones/Outer_Horutoto_Ruins/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/keyitems");
require("scripts/globals/missions");
require("scripts/zones/Outer_Horutoto_Ruins/TextIDs");
-----------------------------------
function onTrade(player,npc,trade)
end;
function onTrigger(player,npc)
-- Check if we are on Windurst Mission 1-2
if (player:getCurrentMission(WINDURST) == THE_HEART_OF_THE_MATTER) then
MissionStatus = player:getVar("MissionStatus");
if (MissionStatus == 2) then
-- Entered a Dark Orb
if (player:getVar("MissionStatus_orb3") == 1) then
player:startEvent(48);
else
player:messageSpecial(ORB_ALREADY_PLACED);
end
elseif (MissionStatus == 4) then
-- Took out a Glowing Orb
if (player:getVar("MissionStatus_orb3") == 2) then
player:startEvent(48);
else
player:messageSpecial(G_ORB_ALREADY_GOTTEN);
end
else
player:messageSpecial(dsp.ki.DARK_MANA_ORB_RECHARGER);
end
else
player:messageSpecial(dsp.ki.DARK_MANA_ORB_RECHARGER);
end
return 1;
end;
function onEventUpdate(player,csid,option)
end;
function onEventFinish(player,csid,option)
if (csid == 48) then
orb_value = player:getVar("MissionStatus_orb3");
if (orb_value == 1) then
player:setVar("MissionStatus_orb3",2);
-- Push the text that the player has placed the orb
player:messageSpecial(THIRD_DARK_ORB_IN_PLACE);
--Delete the key item
player:delKeyItem(dsp.ki.THIRD_DARK_MANA_ORB);
-- Check if all orbs have been placed or not
if (player:getVar("MissionStatus_orb1") == 2 and
player:getVar("MissionStatus_orb2") == 2 and
player:getVar("MissionStatus_orb4") == 2 and
player:getVar("MissionStatus_orb5") == 2 and
player:getVar("MissionStatus_orb6") == 2) then
player:messageSpecial(ALL_DARK_MANA_ORBS_SET);
player:setVar("MissionStatus",3);
end
elseif (orb_value == 2) then
player:setVar("MissionStatus_orb3",3);
-- Time to get the glowing orb out
player:addKeyItem(dsp.ki.THIRD_GLOWING_MANA_ORB);
player:messageSpecial(KEYITEM_OBTAINED,dsp.ki.THIRD_GLOWING_MANA_ORB);
-- Check if all orbs have been placed or not
if (player:getVar("MissionStatus_orb1") == 3 and
player:getVar("MissionStatus_orb2") == 3 and
player:getVar("MissionStatus_orb4") == 3 and
player:getVar("MissionStatus_orb5") == 3 and
player:getVar("MissionStatus_orb6") == 3) then
player:messageSpecial(RETRIEVED_ALL_G_ORBS);
player:setVar("MissionStatus",5);
end
end
end
end; | gpl-3.0 |
davidedmonds/darkstar | scripts/globals/items/truelove_chocolate.lua | 35 | 1232 | -----------------------------------------
-- ID: 5231
-- Item: truelove_chocolate
-- Food Effect: 4Hrs, All Races
-----------------------------------------
-- MP 10
-- MP Recovered While Healing 4
-----------------------------------------
require("scripts/globals/status");
-----------------------------------------
-- OnItemCheck
-----------------------------------------
function onItemCheck(target)
local result = 0;
if (target:hasStatusEffect(EFFECT_FOOD) == true or target:hasStatusEffect(EFFECT_FIELD_SUPPORT_FOOD) == true) then
result = 246;
end
return result;
end;
-----------------------------------------
-- OnItemUse
-----------------------------------------
function onItemUse(target)
target:addStatusEffect(EFFECT_FOOD,0,0,14400,5231);
end;
-----------------------------------------
-- onEffectGain Action
-----------------------------------------
function onEffectGain(target,effect)
target:addMod(MOD_MP, 10);
target:addMod(MOD_MPHEAL, 4);
end;
-----------------------------------------
-- onEffectLose Action
-----------------------------------------
function onEffectLose(target,effect)
target:delMod(MOD_MP, 10);
target:delMod(MOD_MPHEAL, 4);
end;
| gpl-3.0 |
kidaa/darkstar | scripts/globals/items/truelove_chocolate.lua | 35 | 1232 | -----------------------------------------
-- ID: 5231
-- Item: truelove_chocolate
-- Food Effect: 4Hrs, All Races
-----------------------------------------
-- MP 10
-- MP Recovered While Healing 4
-----------------------------------------
require("scripts/globals/status");
-----------------------------------------
-- OnItemCheck
-----------------------------------------
function onItemCheck(target)
local result = 0;
if (target:hasStatusEffect(EFFECT_FOOD) == true or target:hasStatusEffect(EFFECT_FIELD_SUPPORT_FOOD) == true) then
result = 246;
end
return result;
end;
-----------------------------------------
-- OnItemUse
-----------------------------------------
function onItemUse(target)
target:addStatusEffect(EFFECT_FOOD,0,0,14400,5231);
end;
-----------------------------------------
-- onEffectGain Action
-----------------------------------------
function onEffectGain(target,effect)
target:addMod(MOD_MP, 10);
target:addMod(MOD_MPHEAL, 4);
end;
-----------------------------------------
-- onEffectLose Action
-----------------------------------------
function onEffectLose(target,effect)
target:delMod(MOD_MP, 10);
target:delMod(MOD_MPHEAL, 4);
end;
| gpl-3.0 |
will4wachter/Project1 | scripts/zones/Northern_San_dOria/npcs/Jeanvirgaud.lua | 18 | 1838 | -----------------------------------
-- Area: Northern San d'Oria
-- NPC: Jeanvirgaud
-- Outpost Teleporter NPC
-- @pos 45.559 -0.199 26.300 231
-----------------------------------
package.loaded["scripts/zones/Northern_San_dOria/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/conquest");
require("scripts/zones/Northern_San_dOria/TextIDs");
guardnation = SANDORIA;
csid = 0x02cc;
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
if(guardnation == player:getNation()) then
player:startEvent(csid,0,0,0,0,0,0,player:getMainLvl(),1073741823 - player:getNationTeleport(guardnation));
else
player:startEvent(csid,0,0,0,0,0,1,0,0);
end
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
loca = option - 1073741829;
player:updateEvent(player:getGil(),OP_TeleFee(player,loca),player:getCP(),OP_TeleFee(player,loca),player:getCP());
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
if(option >= 5 and option <= 23) then
if (player:delGil(OP_TeleFee(player,option-5))) then
toOutpost(player,option);
end
elseif(option >= 1029 and option <= 1047) then
local cpCost = OP_TeleFee(player,option-1029);
--printf("CP Cost: %u",cpCost);
if (player:getCP()>=cpCost) then
player:delCP(cpCost);
toOutpost(player,option-1024);
end
end
end; | gpl-3.0 |
sdtorresl/my_home_rasp | lib/rapidjson/build/premake4.lua | 5 | 3441 | function setTargetObjDir(outDir)
for _, cfg in ipairs(configurations()) do
for _, plat in ipairs(platforms()) do
local action = _ACTION or ""
local prj = project()
--"_debug_win32_vs2008"
local suffix = "_" .. cfg .. "_" .. plat .. "_" .. action
targetPath = outDir
suffix = string.lower(suffix)
local obj_path = "../intermediate/" .. cfg .. "/" .. action .. "/" .. prj.name
obj_path = string.lower(obj_path)
configuration {cfg, plat}
targetdir(targetPath)
objdir(obj_path)
targetsuffix(suffix)
end
end
end
function linkLib(libBaseName)
for _, cfg in ipairs(configurations()) do
for _, plat in ipairs(platforms()) do
local action = _ACTION or ""
local prj = project()
local cfgName = cfg
--"_debug_win32_vs2008"
local suffix = "_" .. cfgName .. "_" .. plat .. "_" .. action
libFullName = libBaseName .. string.lower(suffix)
configuration {cfg, plat}
links(libFullName)
end
end
end
solution "test"
configurations { "debug", "release" }
platforms { "x32", "x64" }
location ("./" .. (_ACTION or ""))
language "C++"
flags { "ExtraWarnings" }
configuration "debug"
defines { "DEBUG" }
flags { "Symbols" }
configuration "release"
defines { "NDEBUG" }
flags { "Optimize" }
configuration "vs*"
defines { "_CRT_SECURE_NO_WARNINGS" }
configuration "gmake"
buildoptions "-msse4.2 -Werror=cast-qual"
project "gtest"
kind "StaticLib"
files {
"../thirdparty/gtest/src/gtest-all.cc",
"../thirdparty/gtest/src/**.h",
}
includedirs {
"../thirdparty/gtest/",
"../thirdparty/gtest/include",
}
setTargetObjDir("../thirdparty/lib")
project "unittest"
kind "ConsoleApp"
files {
"../include/**.h",
"../test/unittest/**.cpp",
"../test/unittest/**.h",
}
includedirs {
"../include/",
"../thirdparty/gtest/include/",
}
libdirs "../thirdparty/lib"
setTargetObjDir("../bin")
linkLib "gtest"
links "gtest"
project "perftest"
kind "ConsoleApp"
files {
"../include/**.h",
"../test/perftest/**.cpp",
"../test/perftest/**.c",
"../test/perftest/**.h",
}
includedirs {
"../include/",
"../thirdparty/gtest/include/",
"../thirdparty/",
"../thirdparty/jsoncpp/include/",
"../thirdparty/libjson/",
"../thirdparty/yajl/include/",
}
libdirs "../thirdparty/lib"
setTargetObjDir("../bin")
linkLib "gtest"
links "gtest"
solution "example"
configurations { "debug", "release" }
platforms { "x32", "x64" }
location ("./" .. (_ACTION or ""))
language "C++"
flags { "ExtraWarnings" }
includedirs "../include/"
configuration "debug"
defines { "DEBUG" }
flags { "Symbols" }
configuration "release"
defines { "NDEBUG" }
flags { "Optimize", "EnableSSE2" }
configuration "vs*"
defines { "_CRT_SECURE_NO_WARNINGS" }
project "condense"
kind "ConsoleApp"
files "../example/condense/*"
setTargetObjDir("../bin")
project "pretty"
kind "ConsoleApp"
files "../example/pretty/*"
setTargetObjDir("../bin")
project "tutorial"
kind "ConsoleApp"
files "../example/tutorial/*"
setTargetObjDir("../bin")
project "serialize"
kind "ConsoleApp"
files "../example/serialize/*"
setTargetObjDir("../bin")
| gpl-2.0 |
kidaa/darkstar | scripts/zones/Castle_Oztroja/npcs/_m72.lua | 17 | 2267 | -----------------------------------
-- Area: Castle Oztroja
-- NPC: _m72 (Torch Stand)
-- Notes: Opens door _477 when _m72 to _m75 are lit
-- @pos -60 -72 -139 151
-----------------------------------
package.loaded["scripts/zones/Castle_Oztroja/TextIDs"] = nil;
-----------------------------------
require("scripts/zones/Castle_Oztroja/TextIDs");
require("scripts/globals/settings");
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
DoorID = npc:getID() - 2;
Torch1 = npc:getID();
Torch2 = npc:getID() + 1;
Torch3 = npc:getID() + 2;
Torch4 = npc:getID() + 3;
DoorA = GetNPCByID(DoorID):getAnimation();
TorchStand1A = npc:getAnimation();
TorchStand2A = GetNPCByID(Torch2):getAnimation();
TorchStand3A = GetNPCByID(Torch3):getAnimation();
TorchStand4A = GetNPCByID(Torch4):getAnimation();
if(DoorA == 9 and TorchStand1A == 9) then
player:startEvent(0x000a);
else
player:messageSpecial(TORCH_LIT);
end
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish Action
-----------------------------------
function onEventFinish(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
if (option == 1) then
GetNPCByID(Torch1):openDoor(55);
if((DoorA == 9) and (TorchStand2A == 8) and (TorchStand3A == 8) and (TorchStand4A == 8)) then
GetNPCByID(DoorID):openDoor(35); -- confirmed retail tested
-- The lamps shouldn't go off here, but I couldn't get the torches to update animation times without turning them off first
-- They need to be reset to the door open time(35s) + 4s (39 seconds)
GetNPCByID(Torch1):setAnimation(9);
GetNPCByID(Torch2):setAnimation(9);
GetNPCByID(Torch3):setAnimation(9);
GetNPCByID(Torch4):setAnimation(9);
GetNPCByID(Torch1):openDoor(39); -- confirmed retail tested
GetNPCByID(Torch2):openDoor(39);
GetNPCByID(Torch3):openDoor(39);
GetNPCByID(Torch4):openDoor(39);
end
end
end;
| gpl-3.0 |
MonokuroInzanaito/ygopro-777DIY | expansions/script/c21520082.lua | 1 | 6173 | --空间感应者
function c21520082.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcFunFunRep(c,c21520082.fsfilter1,c21520082.fsfilter2,1,99,true)
--spsummon condition
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
e0:SetValue(c21520082.splimit)
c:RegisterEffect(e0)
--special summon rule
local e00=Effect.CreateEffect(c)
e00:SetType(EFFECT_TYPE_FIELD)
e00:SetCode(EFFECT_SPSUMMON_PROC)
e00:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e00:SetRange(LOCATION_EXTRA)
e00:SetCondition(c21520082.sprcon)
e00:SetOperation(c21520082.sprop)
c:RegisterEffect(e00)
--atk & def
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_MATERIAL_CHECK)
e1:SetValue(c21520082.matcheck)
c:RegisterEffect(e1)
--self destroy
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_SELF_DESTROY)
e2:SetCondition(c21520082.sdcon)
c:RegisterEffect(e2)
--to deck and power up
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(21520082,0))
e3:SetCategory(CATEGORY_TODECK+CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetHintTiming(TIMING_DAMAGE_STEP+TIMING_DAMAGE_CAL)
e3:SetRange(LOCATION_MZONE)
e3:SetCost(c21520082.cost)
e3:SetTarget(c21520082.tg)
e3:SetOperation(c21520082.op)
c:RegisterEffect(e3)
end
function c21520082.fsfilter1(c)
return c:IsRace(RACE_SPELLCASTER) and c:IsCanBeFusionMaterial() and c:IsLevelAbove(6) and c:IsType(TYPE_SYNCHRO) and c:IsAttribute(ATTRIBUTE_WIND)
end
function c21520082.fsfilter2(c)
return c:IsRace(RACE_SPELLCASTER) and c:IsCanBeFusionMaterial()
end
function c21520082.spfilter1(c,tp,ft)
if c:IsRace(RACE_SPELLCASTER) and c:IsCanBeFusionMaterial() and c:IsLevelAbove(6) and c:IsType(TYPE_SYNCHRO) and c:IsAttribute(ATTRIBUTE_WIND)
and c:IsReleasable() and (c:IsControler(tp) or c:IsFaceup()) then
if ft>0 or (c:IsControler(tp) and c:IsLocation(LOCATION_MZONE)) then
return Duel.IsExistingMatchingCard(c21520082.spfilter2,tp,LOCATION_MZONE,LOCATION_MZONE,1,c,tp)
else
return Duel.IsExistingMatchingCard(c21520082.spfilter2,tp,LOCATION_MZONE,0,1,c,tp)
end
else return false end
end
function c21520082.spfilter2(c,tp)
return c:IsRace(RACE_SPELLCASTER) and c:IsCanBeFusionMaterial() and c:IsReleasable() and (c:IsControler(tp) or c:IsFaceup())
end
function c21520082.splimit(e,se,sp,st)
return bit.band(st,SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION or se:GetHandler()==e:GetHandler()
end
function c21520082.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
return ft>-1 and Duel.IsExistingMatchingCard(c21520082.spfilter1,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,tp,ft)
end
function c21520082.sprop(e,tp,eg,ep,ev,re,r,rp,c)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g1=Duel.SelectMatchingCard(tp,c21520082.spfilter1,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,tp,ft)
local tc=g1:GetFirst()
local g=Duel.GetMatchingGroup(c21520082.spfilter2,tp,LOCATION_MZONE,LOCATION_MZONE,tc,tp)
local g2=nil
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
if ft>0 or (tc:IsControler(tp) and tc:IsLocation(LOCATION_MZONE)) then
g2=g:Select(tp,1,99,nil)
else
g2=g:FilterSelect(tp,Card.IsControler,1,1,nil,tp)
if g:GetCount()>1 and Duel.SelectYesNo(tp,210) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g3=g:Select(tp,1,99,g2:GetFirst())
g2:Merge(g3)
end
end
g1:Merge(g2)
c:SetMaterial(g1)
Duel.Release(g1,REASON_COST+REASON_MATERIAL+REASON_FUSION)
-- c:CompleteProcedure()
c:RegisterFlagEffect(21520082,RESET_EVENT+0xfc0000,0,1)
end
function c21520082.matcheck(e,c)
local ct=c:GetMaterialCount()
local ae=Effect.CreateEffect(c)
ae:SetType(EFFECT_TYPE_SINGLE)
ae:SetCode(EFFECT_SET_BASE_ATTACK)
ae:SetValue(ct*500)
ae:SetReset(RESET_EVENT+0xff0000)
c:RegisterEffect(ae)
local de=ae:Clone()
de:SetCode(EFFECT_SET_BASE_DEFENSE)
c:RegisterEffect(de)
end
function c21520082.sdcon(e)
return bit.band(e:GetHandler():GetSummonType(),SUMMON_TYPE_FUSION)~=SUMMON_TYPE_FUSION and e:GetHandler():GetFlagEffect(21520082)==0
end
function c21520082.rfliter(c)
return c:IsAbleToRemoveAsCost() and c:IsType(TYPE_SPELL)
end
function c21520082.tdfliter(c)
return c:IsAbleToDeck() and not c:IsStatus(STATUS_DESTROY_CONFIRMED+STATUS_LEAVE_CONFIRMED)
end
function c21520082.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c21520082.rfliter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c21520082.rfliter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c21520082.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsAbleToDeck() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToDeck,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,Card.IsAbleToDeck,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,0,LOCATION_ONFIELD)
Duel.SetOperationInfo(0,CATEGORY_ATKCHANGE,nil,0,0,1000)
Duel.SetOperationInfo(0,CATEGORY_DEFCHANGE,nil,0,0,1000)
end
function c21520082.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) and c:IsRelateToEffect(e) then
if not tc:IsImmuneToEffect(e) then
local op=Duel.SelectOption(tp,aux.Stringid(21520082,1),aux.Stringid(21520082,2))
Duel.SendtoDeck(tc,nil,op,REASON_EFFECT)
end
local ae=Effect.CreateEffect(c)
ae:SetType(EFFECT_TYPE_SINGLE)
ae:SetCode(EFFECT_UPDATE_ATTACK)
ae:SetValue(1000)
ae:SetReset(RESET_EVENT+0xff0000)
c:RegisterEffect(ae)
local de=ae:Clone()
de:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(de)
end
end
| gpl-3.0 |
kidaa/darkstar | scripts/zones/Uleguerand_Range/npcs/HomePoint#2.lua | 12 | 1188 | -----------------------------------
-- Area: Uleguerand_Range
-- NPC: HomePoint#2
-- @pos
-----------------------------------
package.loaded["scripts/zones/Uleguerand_Range/TextIDs"] = nil;
require("scripts/globals/settings");
require("scripts/zones/Uleguerand_Range/TextIDs");
require("scripts/globals/homepoint");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
homepointMenu( player, 0x21fd, 77);
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
if(csid == 0x21fd) then
if (option == 1) then
player:setHomePoint();
player:messageSpecial(HOMEPOINT_SET);
else
hpTeleport( player, option);
end
end
end; | gpl-3.0 |
davidedmonds/darkstar | scripts/zones/Kazham/npcs/Lulupp.lua | 17 | 5995 | -----------------------------------
-- Area: Kazham
-- NPC: Lulupp
-- Type: Standard NPC
-- @zone: 250
-- @pos -26.567 -3.5 -3.544
-----------------------------------
package.loaded["scripts/zones/Kazham/TextIDs"] = nil;
require("scripts/globals/pathfind");
local path = {
-27.457125, -3.043032, -22.057966,
-27.373426, -2.772481, -20.974442,
-27.103289, -2.500000, -17.846378,
-26.864126, -2.500000, -15.667570,
-26.532335, -2.500000, -16.636086,
-26.505196, -2.500000, -15.471632,
-26.509424, -2.500000, -14.359641,
-26.564587, -2.500000, -4.499783,
-26.574417, -2.500000, -5.523735,
-26.580530, -2.500000, -6.591716,
-26.583765, -2.500000, -8.555706,
-26.501217, -2.500000, -16.563267,
-26.504532, -2.500000, -15.427269,
-26.509769, -2.500000, -14.327281,
-26.565643, -2.500000, -4.247434,
-26.573967, -2.500000, -5.299402,
-26.579763, -2.500000, -6.379386,
-26.580465, -2.500000, -8.155381
};
function onSpawn(npc)
npc:initNpcAi();
npc:setPos(pathfind.first(path));
onPath(npc);
end;
function onPath(npc)
pathfind.patrol(npc, path);
end;
-----------------------------------
-- onTrade Action
-----------------------------------
-- item IDs
-- 483 Broken Mithran Fishing Rod
-- 22 Workbench
-- 1008 Ten of Coins
-- 1157 Sands of Silence
-- 1158 Wandering Bulb
-- 904 Giant Fish Bones
-- 4599 Blackened Toad
-- 905 Wyvern Skull
-- 1147 Ancient Salt
-- 4600 Lucky Egg
function onTrade(player,npc,trade)
local OpoOpoAndIStatus = player:getQuestStatus(OUTLANDS, THE_OPO_OPO_AND_I);
local progress = player:getVar("OPO_OPO_PROGRESS");
local failed = player:getVar("OPO_OPO_FAILED");
local goodtrade = trade:hasItemQty(483,1);
local badtrade = (trade:hasItemQty(22,1) or trade:hasItemQty(1008,1) or trade:hasItemQty(1157,1) or trade:hasItemQty(1158,1) or trade:hasItemQty(904,1) or trade:hasItemQty(4599,1) or trade:hasItemQty(905,1) or trade:hasItemQty(1147,1) or trade:hasItemQty(4600,1));
if (OpoOpoAndIStatus == QUEST_ACCEPTED) then
if progress == 0 or failed == 1 then
if goodtrade then -- first or second time trading correctly
player:startEvent(0x00DB);
elseif badtrade then
player:startEvent(0x00E5);
end
end
end
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
local OpoOpoAndIStatus = player:getQuestStatus(OUTLANDS, THE_OPO_OPO_AND_I);
local progress = player:getVar("OPO_OPO_PROGRESS");
local failed = player:getVar("OPO_OPO_FAILED");
local retry = player:getVar("OPO_OPO_RETRY");
if (player:getVar("BathedInScent") == 1 and OpoOpoAndIStatus == QUEST_AVAILABLE) then
player:startEvent(0x00D9, 0, 483) -- 483 broken mithran fishing rod
npc:wait(-1);
elseif (OpoOpoAndIStatus == QUEST_ACCEPTED) then
if retry == 1 then
player:startEvent(0x00EF); -- gave 1st NPC wrong item instead of "Broken Mithran Fishing Rod"
elseif retry == 2 then
player:startEvent(0x00EF, 0, 0, 1); -- gave 2nd NPC wrong item instead of "Workbench"
elseif retry == 3 then
player:startEvent(0x00EF, 0, 0, 2); -- gave 3rd NPC wrong item instead of "Ten of Coins"
elseif retry == 4 then
player:startEvent(0x00EF, 0, 0, 3); -- gave 4th NPC wrong item instead of "Sands of silence"
elseif retry == 5 then
player:startEvent(0x00EF, 0, 0, 4); -- gave 5th NPC wrong item instead of "Wandering Bulb"
elseif retry == 6 then
player:startEvent(0x00EF, 0, 0, 5); -- gave 6th NPC wrong item instead of "Giant Fish Bones"
elseif retry == 7 then
player:startEvent(0x00EF, 0, 0, 6); -- gave 7th NPC wrong item instead of "Blackened Toad"
elseif retry == 8 then
player:startEvent(0x00EF, 0, 0, 7); -- gave 8th NPC wrong item instead of "Wyvern Skull"
elseif retry == 9 then
player:startEvent(0x00EF, 0, 0, 8); -- gave 9th NPC wrong item instead of "Ancient Salt"
elseif retry == 10 then
player:startEvent(0x00EF, 0, 0, 9); -- gave 10th NPC wrong item instead of "Lucky Egg" ... uwot
elseif (progress == 0 or failed == 1) then
player:startEvent(0x00CF); -- asking for rod with Opoppo
elseif (progress >= 1 or failed >= 2) then
player:startEvent(0x00F2); -- happy with rod
end
else
player:startEvent(0x00c5); -- not sure why but this cs has no text
npc:wait(-1);
end
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option,npc)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
if (csid == 0x00D9 and option == 1) then -- Opo Opo and I quest start CS
player:addQuest(OUTLANDS, THE_OPO_OPO_AND_I);
elseif (csid == 0x00DB) then
if (player:getVar("OPO_OPO_PROGRESS") == 0) then
player:tradeComplete();
player:setVar("OPO_OPO_PROGRESS",1);
else
player:setVar("OPO_OPO_FAILED",2);
end
elseif (csid == 0x00E5) then -- Traded wrong item, saving current progress to not take item up to this point
player:setVar("OPO_OPO_RETRY",1);
elseif (csid == 0x00EF and option == 1) then -- Traded wrong to another NPC, give a clue
player:setVar("OPO_OPO_RETRY",0);
player:setVar("OPO_OPO_FAILED",1);
else
npc:wait(0);
end
end;
| gpl-3.0 |
antagon/coroner | src/coroner/bstr.lua | 1 | 2904 | --- Functions for byte string manipulation.
-- These functions were adapted from nmap's nselib. See http://nmap.org/.
-- @module coroner.bstr
local bstr = {}
--- Get an 8-bit integer at a 0-based byte offset in a byte string.
-- @tparam string b a byte string
-- @tparam integer i offset
-- @return An 8-bit integer.
function bstr.u8 (b, i)
return string.byte(b, i+1)
end
--- Get a 16-bit integer at a 0-based byte offset in a byte string.
-- @tparam string b a byte string
-- @tparam integer i offset
-- @return A 16-bit integer.
function bstr.u16 (b, i)
local b1,b2
b1, b2 = string.byte(b, i+1), string.byte(b, i+2)
-- 2^8 2^0
return b1*256 + b2
end
--- Get a 32-bit integer at a 0-based byte offset in a byte string.
-- @tparam string b a byte string
-- @tparam integer i offset
-- @return A 32-bit integer.
function bstr.u32(b,i)
local b1,b2,b3,b4
b1, b2 = string.byte(b, i+1), string.byte(b, i+2)
b3, b4 = string.byte(b, i+3), string.byte(b, i+4)
-- 2^24 2^16 2^8 2^0
return b1*16777216 + b2*65536 + b3*256 + b4
end
-- FIXME: this probably does not work!!!
--- Set an 8-bit integer at a 0-based byte offset in a byte string
-- (big-endian).
-- @tparam string b a byte string.
-- @tparam integer i offset.
-- @tparam integer num integer to store.
function bstr.set_u8(b, i, num)
local s = string.char(bit.band(num, 0xff))
return b:sub(0+1, i+1-1) .. s .. b:sub(i+1+1)
end
-- FIXME: this probably does not work!!!
--- Set a 16-bit integer at a 0-based byte offset in a byte string
-- (big-endian).
-- @param b A byte string.
-- @param i Offset.
-- @param num Integer to store.
function bstr.set_u16(b, i, num)
local s = string.char(bit.band(bit.rshift(num, 8), 0xff)) .. string.char(bit.band(num, 0xff))
return b:sub(0+1, i+1-1) .. s .. b:sub(i+1+2)
end
-- FIXME: this probably does not work!!!
--- Set a 32-bit integer at a 0-based byte offset in a byte string
-- (big-endian).
-- @param b A byte string.
-- @param i Offset.
-- @param num Integer to store.
function bstr.set_u32(b,i, num)
local s = string.char(bit.band(bit.rshift(num,24), 0xff)) ..
string.char(bit.band(bit.rshift(num,16), 0xff)) ..
string.char(bit.band(bit.rshift(num,8), 0xff)) ..
string.char(bit.band(num, 0xff))
return b:sub(0+1, i+1-1) .. s .. b:sub(i+1+4)
end
-- FIXME: this probably does not work!!!
--- Get a 1-byte string from a number.
-- @tparam integer num a number.
function bstr.numtostr8(num)
return string.char(num)
end
-- FIXME: this probably does not work!!!
--- Get a 2-byte string from a number.
-- (big-endian)
-- @tparam integer num a number.
function bstr.numtostr16(num)
return set_u16("..", 0, num)
end
-- FIXME: this probably does not work!!!
--- Get a 4-byte string from a number.
-- (big-endian)
-- @tparam integer num a number.
function bstr.numtostr32(num)
return set_u32("....", 0, num)
end
return bstr
| gpl-2.0 |
kidaa/darkstar | scripts/zones/Ordelles_Caves/npcs/qm3.lua | 19 | 1568 | -----------------------------------
-- Area: Ordelle's Caves
-- NPC: ??? (qm3)
-- Involved in Quest: A Squire's Test II
-- @pos -139 0.1 264 193
-------------------------------------
package.loaded["scripts/zones/Ordelles_Caves/TextIDs"] = nil;
-------------------------------------
require("scripts/globals/settings");
require("scripts/globals/keyitems");
require("scripts/zones/Ordelles_Caves/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
if(os.time() - player:getVar("SquiresTestII") <= 60 and player:hasKeyItem(STALACTITE_DEW) == false) then
player:messageSpecial(A_SQUIRE_S_TEST_II_DIALOG_II);
player:addKeyItem(STALACTITE_DEW);
player:messageSpecial(KEYITEM_OBTAINED, STALACTITE_DEW);
player:setVar("SquiresTestII",0);
elseif(player:hasKeyItem(STALACTITE_DEW))then
player:messageSpecial(A_SQUIRE_S_TEST_II_DIALOG_III);
else
player:messageSpecial(NOTHING_OUT_OF_ORDINARY);
player:setVar("SquiresTestII",0);
end
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end; | gpl-3.0 |
kidaa/darkstar | scripts/zones/Windurst_Woods/npcs/Varun.lua | 19 | 2170 | -----------------------------------
-- Area: Windurst Woods
-- NPC: Varun
-- Type: Standard NPC
-- @zone: 241
-- @pos 7.800 -3.5 -10.064
--
-- Auto-Script: Requires Verification (Verfied by Brawndo)
-----------------------------------
package.loaded["scripts/zones/Windurst_Woods/TextIDs"] = nil;
require("scripts/zones/Windurst_Woods/TextIDs");
require("scripts/globals/settings");
require("scripts/globals/quests");
-----------------------------------
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
RRvar = player:getVar("rockracketeer_sold");
-- Rock Racketeer
if (RRvar == 6) then
if(trade:hasItemQty(598,1) == true and trade:getItemCount() == 1) then -- Sharp Stone
player:startEvent(0x0066,2100); -- finish quest
end
end
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
RRvar = player:getVar("rockracketeer_sold");
-- Rock Racketeer
if(RockRacketeer == QUEST_ACCEPTED and RRvar == 3) then
player:startEvent(0x0064); -- talk about lost stone
elseif(RockRacketeer == QUEST_ACCEPTED and RRvar == 4) then
player:startEvent(0x0065,0,598); -- send player to Palborough Mines
-- standard dialog
else
player:startEvent(0x01b0);
end
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
-- Rock Racketeer
if(csid == 0x0064) then
player:setVar("rockracketeer_sold",4);
elseif(csid == 0x0065) then
player:setVar("rockracketeer_sold",5);
elseif(csid == 0x0066) then
player:tradeComplete();
player:addFame(WINDURST,WIN_FAME*30);
player:addGil(GIL_RATE*2100);
player:completeQuest(WINDURST,ROCK_RACKETTER);
player:setVar("rockracketeer_sold",0); -- finish cleanup of vars
end
end;
| gpl-3.0 |
waterlgndx/darkstar | scripts/zones/West_Sarutabaruta/npcs/Slow_Axe_IM.lua | 2 | 2946 | -----------------------------------
-- Area: West Sarutabaruta
-- NPC: Slow Axe, I.M.
-- Type: Border Conquest Guards
-- !pos 399.450 -25.858 727.545 115
-----------------------------------
package.loaded["scripts/zones/West_Sarutabaruta/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/conquest");
require("scripts/zones/West_Sarutabaruta/TextIDs");
local guardnation = dsp.nation.BASTOK; -- SANDORIA, BASTOK, WINDURST, 4 = jeuno
local guardtype = 4; -- 1: city, 2: foreign, 3: outpost, 4: border
local region = dsp.region.SARUTABARUTA;
local csid = 0x7ff8;
function onTrade(player,npc,trade)
tradeConquestGuard(player,npc,trade,guardnation,guardtype);
end;
function onTrigger(player,npc)
if (player:hasKeyItem(getSupplyKey(region)) and player:getNation() == guardnation) then
if (supplyRunFresh(player) == 1) then
player:startEvent(csid,16,0,0,0,1,0,0,255); -- you have brought us supplies !
else
player:showText(npc, CONQUEST - 1); -- "Hmm... These supplies you have brought us are too old to be of any use."
player:delKeyItem(getSupplyKey(region));
player:messageSpecial(KEYITEM_OBTAINED + 1, getSupplyKey(region));
player:setVar("supplyQuest_region",0);
end
else
local arg1 = getArg1(guardnation, player) - 1;
if (arg1 >= 1792) then -- foreign, non-allied
player:startEvent(csid,1808,0,0,0,0,player:getRank(),0,0);
else -- citizen or allied
player:startEvent(csid,arg1,0,0x3F0000,0,0,getArg6(player),0,0);
end
end
end;
function onEventUpdate(player,csid,option)
-- printf("OPTION: %u",option);
end;
function onEventFinish(player,csid,option)
-- printf("OPTION: %u",option);
if (option == 1) then
local duration = (player:getRank() + getNationRank(player:getNation()) + 3) * 3600;
player:delStatusEffect(dsp.effect.SIGIL);
player:delStatusEffect(dsp.effect.SANCTION);
player:delStatusEffect(dsp.effect.SIGNET);
player:addStatusEffect(dsp.effect.SIGNET,0,0,duration); -- Grant Signet
elseif (option == 2) then
player:delKeyItem(getSupplyKey(region));
player:addCP(supplyReward[region + 1])
player:messageSpecial(CONQUEST); -- "You've earned conquest points!"
if (hasOutpost(player, region+5) == 0) then
local supply_quests = 2^(region+5);
player:addNationTeleport(guardnation,supply_quests);
player:setVar("supplyQuest_region",0);
end
elseif (option == 4) then
if (player:delGil(giltosetHP(guardnation,player))) then
player:setHomePoint();
player:messageSpecial(CONQUEST + 94); -- "Your home point has been set."
else
player:messageSpecial(CONQUEST + 95); -- "You do not have enough gil to set your home point here."
end
end
end; | gpl-3.0 |
NewbProgrammer101/Lord-of-the-Test | mods/lottplants/functions.lua | 2 | 34726 | -- TREE FUNCTIONS
local function check_add_node(pos, name)
local nn = minetest.get_node(pos).name
if nn == "air" or minetest.get_item_group(nn, "sapling") then
minetest.set_node(pos, name)
end
end
-- Alders
function lottplants_aldertree(pos)
local t = 6 + math.random(2) -- trunk height
for j = -2, t do
if j == t or j == t - 2 then
for i = -2, 2 do
for k = -2, 2 do
local absi = math.abs(i)
local absk = math.abs(k)
if math.random() > (absi + absk) / 24 then
check_add_node({x=pos.x+i,y=pos.y+j+math.random(0, 1),z=pos.z+k},{name="lottplants:alderleaf"})
end
end
end
end
check_add_node({x=pos.x,y=pos.y+j,z=pos.z},{name="lottplants:aldertree"})
end
end
-- Apple tree
function lottplants_appletree(pos)
local t = 4 + math.random(2) -- trunk height
for j = -2, t do
if j == t or j == t - 2 then
for i = -2, 2 do
for k = -2, 2 do
local absi = math.abs(i)
local absk = math.abs(k)
if math.random() > (absi + absk) / 24 then
check_add_node({x=pos.x+i,y=pos.y+j+math.random(0, 1),z=pos.z+k},{name="lottplants:appleleaf"})
end
if math.random() > (absi + absk) / 12 then
check_add_node({x=pos.x+i,y=pos.y+j+math.random(0, 1),z=pos.z+k},{name="default:apple"})
end
end
end
end
check_add_node({x=pos.x,y=pos.y+j,z=pos.z},{name="default:tree"})
end
end
-- Birches
function lottplants_birchtree(pos)
local t = 7 + math.random(5) -- trunk height
for j = -3, t do
if j == math.floor(t * 0.7) or j == t then
for i = -2, 2 do
for k = -2, 2 do
local absi = math.abs(i)
local absk = math.abs(k)
if math.random() > (absi + absk) / 24 then
check_add_node({x=pos.x+i,y=pos.y+j+math.random(0, 1),z=pos.z+k},{name="lottplants:birchleaf"})
end
end
end
end
check_add_node({x=pos.x,y=pos.y+j,z=pos.z},{name="lottplants:birchtree"})
end
end
-- Beeches
function lottplants_beechtree(pos)
local t = 10 + math.random(3) -- trunk height
for i = -2, 2 do
for k = -2, 2 do
local absi = math.abs(i)
local absk = math.abs(k)
if absi >= absk then
j = t - absi
else
j = t - absk
end
if math.random() > (absi + absk) / 24 then
check_add_node({x=pos.x+i,y=pos.y+j+7,z=pos.z+k},{name="lottplants:beechleaf"})
check_add_node({x=pos.x+i,y=pos.y+j+4,z=pos.z+k},{name="lottplants:beechleaf"})
check_add_node({x=pos.x+i+2,y=pos.y+j+4,z=pos.z+k},{name="lottplants:beechleaf"})
check_add_node({x=pos.x+i-2,y=pos.y+j+4,z=pos.z+k},{name="lottplants:beechleaf"})
check_add_node({x=pos.x+i,y=pos.y+j+4,z=pos.z+k+2},{name="lottplants:beechleaf"})
check_add_node({x=pos.x+i,y=pos.y+j+4,z=pos.z+k-2},{name="lottplants:beechleaf"})
check_add_node({x=pos.x+i,y=pos.y+j+1,z=pos.z+k},{name="lottplants:beechleaf"})
check_add_node({x=pos.x+i+3,y=pos.y+j+1,z=pos.z+k},{name="lottplants:beechleaf"})
check_add_node({x=pos.x+i-3,y=pos.y+j+1,z=pos.z+k},{name="lottplants:beechleaf"})
check_add_node({x=pos.x+i,y=pos.y+j+1,z=pos.z+k+3},{name="lottplants:beechleaf"})
check_add_node({x=pos.x+i,y=pos.y+j+1,z=pos.z+k-3},{name="lottplants:beechleaf"})
check_add_node({x=pos.x+i,y=pos.y+j-2,z=pos.z+k},{name="lottplants:beechleaf"})
check_add_node({x=pos.x+i+3,y=pos.y+j-2,z=pos.z+k},{name="lottplants:beechleaf"})
check_add_node({x=pos.x+i-3,y=pos.y+j-2,z=pos.z+k},{name="lottplants:beechleaf"})
check_add_node({x=pos.x+i,y=pos.y+j-2,z=pos.z+k+3},{name="lottplants:beechleaf"})
check_add_node({x=pos.x+i,y=pos.y+j-2,z=pos.z+k-3},{name="lottplants:beechleaf"})
check_add_node({x=pos.x+i,y=pos.y+j-5,z=pos.z+k},{name="lottplants:beechleaf"})
check_add_node({x=pos.x+i+4,y=pos.y+j-5,z=pos.z+k},{name="lottplants:beechleaf"})
check_add_node({x=pos.x+i-4,y=pos.y+j-5,z=pos.z+k},{name="lottplants:beechleaf"})
check_add_node({x=pos.x+i,y=pos.y+j-5,z=pos.z+k+4},{name="lottplants:beechleaf"})
check_add_node({x=pos.x+i,y=pos.y+j-5,z=pos.z+k-4},{name="lottplants:beechleaf"})
check_add_node({x=pos.x+i,y=pos.y+j-8,z=pos.z+k},{name="lottplants:beechleaf"})
check_add_node({x=pos.x+i+4,y=pos.y+j-8,z=pos.z+k},{name="lottplants:beechleaf"})
check_add_node({x=pos.x+i-4,y=pos.y+j-8,z=pos.z+k},{name="lottplants:beechleaf"})
check_add_node({x=pos.x+i,y=pos.y+j-8,z=pos.z+k+4},{name="lottplants:beechleaf"})
check_add_node({x=pos.x+i,y=pos.y+j-8,z=pos.z+k-4},{name="lottplants:beechleaf"})
end
end
end
for j = -3, t do
check_add_node({x=pos.x,y=pos.y+j,z=pos.z},{name="default:tree"})
end
end
-- Culumalda
function lottplants_culumaldatree(pos)
local t = 4 + math.random(2) -- trunk height
for j = -2, t do
if j == t or j == t - 2 then
for i = -2, 2 do
for k = -2, 2 do
local absi = math.abs(i)
local absk = math.abs(k)
if math.random() > (absi + absk) / 24 then
check_add_node({x=pos.x+i,y=pos.y+j+math.random(0, 1),z=pos.z+k},{name="lottplants:culumaldaleaf"})
end
if math.random() > (absi + absk) / 12 then
check_add_node({x=pos.x+i,y=pos.y+j+math.random(0, 1),z=pos.z+k},{name="lottplants:yellowflowers"})
end
end
end
end
check_add_node({x=pos.x,y=pos.y+j,z=pos.z},{name="default:tree"})
end
end
-- Elms
function lottplants_elmtree(pos)
local t = 20 + math.random(5) -- trunk height
for j = -3, t do
if j == math.floor(t * 0.7) or j == t then
for i = -2, 2 do
for k = -2, 2 do
local absi = math.abs(i)
local absk = math.abs(k)
if math.random() > (absi + absk) / 24 then
check_add_node({x=pos.x+i,y=pos.y+j+math.random(0, 1),z=pos.z+k},{name="lottplants:elmleaf"})
end
end
end
end
check_add_node({x=pos.x,y=pos.y+j,z=pos.z},{name="default:tree"})
end
end
-- Firs
function lottplants_firtree(pos)
local t = 10 + math.random(3) -- trunk height
for i = -2, 2 do
for k = -2, 2 do
local absi = math.abs(i)
local absk = math.abs(k)
if absi >= absk then
j = t - absi
else
j = t - absk
end
if math.random() > (absi + absk) / 24 then
check_add_node({x=pos.x+i,y=pos.y+j+1,z=pos.z+k},{name="lottplants:firleaf"})
check_add_node({x=pos.x+i,y=pos.y+j-2,z=pos.z+k},{name="lottplants:firleaf"})
check_add_node({x=pos.x+i,y=pos.y+j-5,z=pos.z+k},{name="lottplants:firleaf"})
end
end
end
for j = -3, t do
check_add_node({x=pos.x,y=pos.y+j,z=pos.z},{name="lottplants:pinetree"})
end
end
-- Lebethron
function lottplants_lebethrontree(pos)
local t = 3 + math.random(1) -- trunk height
for j = -3, t do
if j == math.floor(t * 0.7) or j == t then
for i = -2, 2 do
for k = -2, 2 do
local absi = math.abs(i)
local absk = math.abs(k)
if math.random() > (absi + absk) / 24 then
check_add_node({x=pos.x+i,y=pos.y+j+math.random(0, 1),z=pos.z+k},{name="lottplants:lebethronleaf"})
end
end
end
end
check_add_node({x=pos.x,y=pos.y+j,z=pos.z},{name="lottplants:lebethrontree"})
end
end
-- Mallorn
function add_tree_branch_mallorn(pos)
check_add_node(pos, {name="lottplants:mallorntree"})
for i = math.floor(math.random(2)), -math.floor(math.random(2)), -1 do
for k = math.floor(math.random(2)), -math.floor(math.random(2)), -1 do
local p = {x=pos.x+i, y=pos.y, z=pos.z+k}
check_add_node(p, {name="lottplants:mallornleaf"})
local chance = math.abs(i+k)
if (chance < 1) then
p = {x=pos.x+i, y=pos.y+1, z=pos.z+k}
check_add_node(p, {name="lottplants:mallornleaf"})
end
end
end
end
function lottplants_mallorntree(pos)
local height = 25 + math.random(5)
if height < 10 then
for i = height, -2, -1 do
local p = {x=pos.x, y=pos.y+i, z=pos.z}
check_add_node(p, {name="lottplants:mallorntree"})
if i == height then
add_tree_branch_mallorn({x=pos.x, y=pos.y+height+math.random(0, 1), z=pos.z})
add_tree_branch_mallorn({x=pos.x+1, y=pos.y+i-math.random(2), z=pos.z})
add_tree_branch_mallorn({x=pos.x-1, y=pos.y+i-math.random(2), z=pos.z})
add_tree_branch_mallorn({x=pos.x, y=pos.y+i-math.random(2), z=pos.z+1})
add_tree_branch_mallorn({x=pos.x, y=pos.y+i-math.random(2), z=pos.z-1})
end
if i < 0 then
check_add_node({x=pos.x+1, y=pos.y+i-math.random(2), z=pos.z}, {name="lottplants:mallorntree"})
check_add_node({x=pos.x, y=pos.y+i-math.random(2), z=pos.z+1}, {name="lottplants:mallorntree"})
check_add_node({x=pos.x-1, y=pos.y+i-math.random(2), z=pos.z}, {name="lottplants:mallorntree"})
check_add_node({x=pos.x, y=pos.y+i-math.random(2), z=pos.z-1}, {name="lottplants:mallorntree"})
end
if (math.sin(i/height*i) < 0.2 and i > 3 and math.random(0,2) < 1.5) then
local branch_pos = {x=pos.x+math.random(0,1), y=pos.y+i, z=pos.z-math.random(0,1)}
add_tree_branch_mallorn(branch_pos)
end
end
else
for i = height, -5, -1 do
if (math.sin(i/height*i) < 0.2 and i > 3 and math.random(0,2) < 1.5) then
local branch_pos = {x=pos.x+math.random(0,1), y=pos.y+i, z=pos.z-math.random(0,1)}
add_tree_branch_mallorn(branch_pos)
end
if i < math.random(0,1) then
check_add_node({x=pos.x+1, y=pos.y+i, z=pos.z+1}, {name="lottplants:mallorntree"})
check_add_node({x=pos.x+2, y=pos.y+i, z=pos.z-1}, {name="lottplants:mallorntree"})
check_add_node({x=pos.x, y=pos.y+i, z=pos.z-2}, {name="lottplants:mallorntree"})
check_add_node({x=pos.x-1, y=pos.y+i, z=pos.z}, {name="lottplants:mallorntree"})
end
if i == height then
add_tree_branch_mallorn({x=pos.x+1, y=pos.y+i, z=pos.z+1})
add_tree_branch_mallorn({x=pos.x+2, y=pos.y+i, z=pos.z-1})
add_tree_branch_mallorn({x=pos.x, y=pos.y+i, z=pos.z-2})
add_tree_branch_mallorn({x=pos.x-1, y=pos.y+i, z=pos.z})
add_tree_branch_mallorn({x=pos.x+1, y=pos.y+i, z=pos.z+2})
add_tree_branch_mallorn({x=pos.x+3, y=pos.y+i, z=pos.z-1})
add_tree_branch_mallorn({x=pos.x, y=pos.y+i, z=pos.z-3})
add_tree_branch_mallorn({x=pos.x-2, y=pos.y+i, z=pos.z})
add_tree_branch_mallorn({x=pos.x+1, y=pos.y+i, z=pos.z})
add_tree_branch_mallorn({x=pos.x+1, y=pos.y+i, z=pos.z-1})
add_tree_branch_mallorn({x=pos.x, y=pos.y+i, z=pos.z-1})
add_tree_branch_mallorn({x=pos.x, y=pos.y+i, z=pos.z})
else
check_add_node({x=pos.x+1, y=pos.y+i, z=pos.z}, {name="lottplants:mallorntree"})
check_add_node({x=pos.x+1, y=pos.y+i, z=pos.z-1}, {name="lottplants:mallorntree"})
check_add_node({x=pos.x, y=pos.y+i, z=pos.z-1}, {name="lottplants:mallorntree"})
check_add_node({x=pos.x, y=pos.y+i, z=pos.z}, {name="lottplants:mallorntree"})
end
end
end
end
function lottplants_smallmallorntree(pos)
for j = -3, 15 do
if j == 11 or j == 15 then
for i = -2, 2 do
for k = -2, 2 do
local absi = math.abs(i)
local absk = math.abs(k)
if math.random() > (absi + absk) / 24 then
check_add_node({x=pos.x+i,y=pos.y+j+math.random(0, 1),z=pos.z+k},{name="lottplants:mallornleaf"})
end
end
end
end
end
for j = -3, 15 do
check_add_node({x=pos.x,y=pos.y+j,z=pos.z},{name="lottplants:mallorntree"})
if j == 0 then
check_add_node({x=pos.x,y=pos.y+j,z=pos.z},{name="lottplants:mallorntree_grower"})
end
end
end
function lottplants_young_mallorn(pos)
local t = 6 + math.random(1) -- trunk height
for j = 0, t do
if j == t or j == t - 2 then
for i = -1, 1 do
for k = -1, 1 do
local absi = math.abs(i)
local absk = math.abs(k)
if math.random() > (absi + absk) / 24 then
check_add_node({x=pos.x+i,y=pos.y+j+math.random(0, 1),z=pos.z+k},{name="lottplants:mallornleaf"})
end
end
end
end
check_add_node({x=pos.x,y=pos.y+j,z=pos.z},{name="lottplants:mallorntree_young"})
if j == 0 then
check_add_node({x=pos.x,y=pos.y+j,z=pos.z},{name="lottplants:mallorntree_young_grower"})
end
end
end
-- Oaks
function lottplants_oaktree(pos)
local t = 10 + math.random(3) -- trunk height
for i = -2, 2 do
for k = -2, 2 do
local absi = math.abs(i)
local absk = math.abs(k)
if absi >= absk then
j = t - absi
else
j = t - absk
end
if math.random() > (absi + absk) / 24 then
check_add_node({x=pos.x+i,y=pos.y+j+3,z=pos.z+k},{name="lottplants:firleaf"})
check_add_node({x=pos.x+i,y=pos.y+j+1,z=pos.z+k},{name="lottplants:firleaf"})
check_add_node({x=pos.x+i+1,y=pos.y+j-1,z=pos.z+k},{name="lottplants:firleaf"})
check_add_node({x=pos.x+i,y=pos.y+j-2,z=pos.z+k+1},{name="lottplants:firleaf"})
check_add_node({x=pos.x+i,y=pos.y+j-3,z=pos.z+k},{name="lottplants:firleaf"})
check_add_node({x=pos.x+i,y=pos.y+j-4,z=pos.z+k},{name="lottplants:firleaf"})
check_add_node({x=pos.x+i,y=pos.y+j-5,z=pos.z+k},{name="lottplants:firleaf"})
end
end
end
for j = -5, t do
check_add_node({x=pos.x,y=pos.y+j,z=pos.z},{name="lottplants:pinetree"})
end
end
-- Pines
function lottplants_pinetree(pos)
local t = 10 + math.random(3) -- trunk height
for i = -2, 2 do
for k = -2, 2 do
local absi = math.abs(i)
local absk = math.abs(k)
if absi >= absk then
j = t - absi
else
j = t - absk
end
if math.random() > (absi + absk) / 24 then
check_add_node({x=pos.x+i,y=pos.y+j+1,z=pos.z+k},{name="lottplants:pineleaf"})
check_add_node({x=pos.x+i,y=pos.y+j-2,z=pos.z+k},{name="lottplants:pineleaf"})
check_add_node({x=pos.x+i+1,y=pos.y+j-2,z=pos.z+k},{name="lottplants:pineleaf"})
check_add_node({x=pos.x+i-1,y=pos.y+j-2,z=pos.z+k},{name="lottplants:pineleaf"})
check_add_node({x=pos.x+i,y=pos.y+j-2,z=pos.z+k+1},{name="lottplants:pineleaf"})
check_add_node({x=pos.x+i,y=pos.y+j-2,z=pos.z+k-1},{name="lottplants:pineleaf"})
check_add_node({x=pos.x+i,y=pos.y+j-5,z=pos.z+k},{name="lottplants:pineleaf"})
check_add_node({x=pos.x+i+1,y=pos.y+j-5,z=pos.z+k},{name="lottplants:pineleaf"})
check_add_node({x=pos.x+i-1,y=pos.y+j-5,z=pos.z+k},{name="lottplants:pineleaf"})
check_add_node({x=pos.x+i,y=pos.y+j-5,z=pos.z+k+1},{name="lottplants:pineleaf"})
check_add_node({x=pos.x+i,y=pos.y+j-5,z=pos.z+k-1},{name="lottplants:pineleaf"})
check_add_node({x=pos.x+i,y=pos.y+j-8,z=pos.z+k},{name="lottplants:pineleaf"})
check_add_node({x=pos.x+i+2,y=pos.y+j-8,z=pos.z+k},{name="lottplants:pineleaf"})
check_add_node({x=pos.x+i-2,y=pos.y+j-8,z=pos.z+k},{name="lottplants:pineleaf"})
check_add_node({x=pos.x+i,y=pos.y+j-8,z=pos.z+k+2},{name="lottplants:pineleaf"})
check_add_node({x=pos.x+i,y=pos.y+j-8,z=pos.z+k-2},{name="lottplants:pineleaf"})
end
end
end
for j = -3, t do
check_add_node({x=pos.x,y=pos.y+j,z=pos.z},{name="lottplants:pinetree"})
end
end
-- Plum Trees
function lottplants_plumtree(pos)
local t = 3 + math.random(2) -- trunk height
for j = -2, t do
if j == t or j == t - 2 then
for i = -2, 2 do
for k = -2, 2 do
local absi = math.abs(i)
local absk = math.abs(k)
if math.random() > (absi + absk) / 24 then
check_add_node({x=pos.x+i,y=pos.y+j+math.random(0, 1),z=pos.z+k},{name="lottplants:plumleaf"})
end
if math.random() > (absi + absk) / 2 then
check_add_node({x=pos.x+i,y=pos.y+j+math.random(0, 1),z=pos.z+k},{name="lottplants:plum"})
end
end
end
end
if j ~= t then
check_add_node({x=pos.x,y=pos.y+j,z=pos.z},{name="default:tree"})
end
end
end
-- Rowans
function lottplants_rowantree(pos)
local t = 4 + math.random(2) -- trunk height
for j = -2, t do
if j == t or j == t - 2 then
for i = -2, 2 do
for k = -2, 2 do
local absi = math.abs(i)
local absk = math.abs(k)
if math.random() > (absi + absk) / 12 then
check_add_node({x=pos.x+i,y=pos.y+j+math.random(0, 1),z=pos.z+k},{name="lottplants:rowanleaf"})
end
end
end
end
check_add_node({x=pos.x,y=pos.y+j,z=pos.z},{name="default:tree"})
end
end
-- White Tree
function lottplants_whitetree(pos)
local t = 6 + math.random(2) -- trunk height
for j = -2, t do
if j == t or j == t - 2 or j == t - 4 then
for i = -3, 3 do
for k = -3, 3 do
local absi = math.abs(i)
local absk = math.abs(k)
if math.random() > (absi + absk) / 24 then
check_add_node({x=pos.x+i,y=pos.y+j+math.random(0, 1),z=pos.z+k},{name="lottplants:whiteleaf"})
end
end
end
end
if j == t - 1 then
for i = -2, 2 do
for k = -2, 2 do
if i == -1 and k == 0 or i == 1 and k == 0
or k == 1 and i == 0 or k == -1 and i == 0
or i == -2 and k == 0 or i == 2 and k == 0
or k == 2 and i == 0 or k == -2 and i == 0 then
check_add_node({x = pos.x + i, y = pos.y + j, z = pos.z}, {name="default:tree", param2 = 16})
check_add_node({x = pos.x, y = pos.y + j, z = pos.z + k}, {name="default:tree", param2 = 10})
end
end
end
end
check_add_node({x=pos.x,y=pos.y+j,z=pos.z}, {name="default:tree"})
end
end
-- Yavannamire
function lottplants_yavannamiretree(pos)
local t = 4 + math.random(2) -- trunk height
for j = -2, t do
if j == t or j == t - 2 then
for i = -2, 2 do
for k = -2, 2 do
local absi = math.abs(i)
local absk = math.abs(k)
if math.random() > (absi + absk) / 24 then
check_add_node({x=pos.x+i,y=pos.y+j+math.random(0, 1),z=pos.z+k},{name="lottplants:yavannamireleaf"})
end
if math.random() > (absi + absk) / 12 then
check_add_node({x=pos.x+i,y=pos.y+j+math.random(0, 1),z=pos.z+k},{name="lottplants:yavannamirefruit"})
end
end
end
end
check_add_node({x=pos.x,y=pos.y+j,z=pos.z},{name="default:tree"})
end
end
--Mirk large
function add_tree_branch_mirktree(pos)
check_add_node(pos, {name="default:jungletree"})
for i = math.floor(math.random(2)), -math.floor(math.random(2)), -1 do
for k = math.floor(math.random(2)), -math.floor(math.random(2)), -1 do
local p = {x=pos.x+i, y=pos.y, z=pos.z+k}
local n = minetest.get_node(p)
if (n.name=="air") then
check_add_node(p, {name="lottplants:mirkleaf"})
end
local chance = math.abs(i+k)
if (chance < 1) then
p = {x=pos.x+i, y=pos.y+1, z=pos.z+k}
n = minetest.get_node(p)
if (n.name=="air") then
check_add_node(p, {name="lottplants:mirkleaf"})
end
end
end
end
end
function lottplants_mirktree(pos)
local height = 5 + math.random(1)
if height < 1 then
for i = height, -2, -1 do
local p = {x=pos.x, y=pos.y+i, z=pos.z}
check_add_node(p, {name="default:jungletree"})
if i == height then
add_tree_branch_mirktree({x=pos.x, y=pos.y+height+math.random(0, 1), z=pos.z})
add_tree_branch_mirktree({x=pos.x+1, y=pos.y+i-math.random(2), z=pos.z})
add_tree_branch_mirktree({x=pos.x-1, y=pos.y+i-math.random(2), z=pos.z})
add_tree_branch_mirktree({x=pos.x, y=pos.y+i-math.random(2), z=pos.z+1})
add_tree_branch_mirktree({x=pos.x, y=pos.y+i-math.random(2), z=pos.z-1})
end
if i < 0 then
check_add_node({x=pos.x+1, y=pos.y+i-math.random(2), z=pos.z}, {name="default:jungletree"})
check_add_node({x=pos.x, y=pos.y+i-math.random(2), z=pos.z+1}, {name="default:jungletree"})
check_add_node({x=pos.x-1, y=pos.y+i-math.random(2), z=pos.z}, {name="default:jungletree"})
check_add_node({x=pos.x, y=pos.y+i-math.random(2), z=pos.z-1}, {name="default:jungletree"})
end
if (math.sin(i/height*i) < 0.2 and i > 3 and math.random(0,2) < 1.5) then
local branch_pos = {x=pos.x+math.random(0,1), y=pos.y+i, z=pos.z-math.random(0,1)}
add_tree_branch_mirktree(branch_pos)
end
end
else
for i = height, -5, -1 do
if (math.sin(i/height*i) < 0.2 and i > 3 and math.random(0,2) < 1.5) then
local branch_pos = {x=pos.x+math.random(0,1), y=pos.y+i, z=pos.z-math.random(0,1)}
add_tree_branch_mirktree(branch_pos)
end
if i < math.random(0,1) then
check_add_node({x=pos.x+1, y=pos.y+i, z=pos.z+1}, {name="default:jungletree"})
check_add_node({x=pos.x+2, y=pos.y+i, z=pos.z-1}, {name="default:jungletree"})
check_add_node({x=pos.x, y=pos.y+i, z=pos.z-2}, {name="default:jungletree"})
check_add_node({x=pos.x-1, y=pos.y+i, z=pos.z}, {name="default:jungletree"})
end
if i == height then
add_tree_branch_mirktree({x=pos.x+1, y=pos.y+i, z=pos.z+1})
add_tree_branch_mirktree({x=pos.x+2, y=pos.y+i, z=pos.z-1})
add_tree_branch_mirktree({x=pos.x, y=pos.y+i, z=pos.z-2})
add_tree_branch_mirktree({x=pos.x-1, y=pos.y+i, z=pos.z})
add_tree_branch_mirktree({x=pos.x+1, y=pos.y+i, z=pos.z+2})
add_tree_branch_mirktree({x=pos.x+3, y=pos.y+i, z=pos.z-1})
add_tree_branch_mirktree({x=pos.x, y=pos.y+i, z=pos.z-3})
add_tree_branch_mirktree({x=pos.x-2, y=pos.y+i, z=pos.z})
add_tree_branch_mirktree({x=pos.x+1, y=pos.y+i, z=pos.z})
add_tree_branch_mirktree({x=pos.x+1, y=pos.y+i, z=pos.z-1})
add_tree_branch_mirktree({x=pos.x, y=pos.y+i, z=pos.z-1})
add_tree_branch_mirktree({x=pos.x, y=pos.y+i, z=pos.z})
else
check_add_node({x=pos.x+1, y=pos.y+i, z=pos.z}, {name="default:jungletree"})
check_add_node({x=pos.x+1, y=pos.y+i, z=pos.z-1}, {name="default:jungletree"})
check_add_node({x=pos.x, y=pos.y+i, z=pos.z-1}, {name="default:jungletree"})
check_add_node({x=pos.x, y=pos.y+i, z=pos.z}, {name="default:jungletree"})
end
end
end
end
--Mirk Small
function lottplants_smallmirktree(pos)
for j = -3, 7 do
if j == 6 then
for i = -4, 4 do
for k = -4, 4 do
if math.random(20) ~= 10 then
check_add_node({x=pos.x+i,y=pos.y+j+math.random(1, 2),z=pos.z+k},{name="lottplants:mirkleaf"})
end
end
end
for i = -1, 1, 2 do
for k = -1, 1, 2 do
check_add_node({x=pos.x+i,y=pos.y+j,z=pos.z+k},{name="default:jungletree"})
end
end
elseif j == 7 then
for i = -2, 2, 4 do
for k = -2, 2, 4 do
check_add_node({x=pos.x+i,y=pos.y+j,z=pos.z+k},{name="default:jungletree"})
end
end
else
check_add_node({x=pos.x,y=pos.y+j,z=pos.z},{name="default:jungletree"})
end
end
end
-- SAPLINGS
local function can_grow(pos)
local node = minetest.get_node_or_nil({x = pos.x, y = pos.y, z = pos.z})
if not node then
return false
end
local growable_nodes = { "soil", "stone", "sand", "water" }
for i, growable_node in ipairs (growable_nodes) do
if minetest.get_item_group(node.name, growable_node) ~= 0 then
return true
end
end
if "air" == node.name then
return true
end
return false
end
local function large_roots(pos)
for j = -5, 0 do
for i = -1, 2 do
for k = -1, 2 do
if i == 0 and j == 0 and k == 0 then
-- This is the sapling, ignore it
elseif not can_grow({x = pos.x + i, y = pos.y + j, z = pos.z + k}) then
return false
end
end
end
end
return true
end
-- Alders sapling
minetest.register_abm({
nodenames = {"lottplants:aldersapling"},
interval = 67,
chance = 11,
action = function(pos, node, active_object_count, active_object_count_wider)
if can_grow({x = pos.x, y = pos.y - 1, z = pos.z}) and
can_grow({x = pos.x, y = pos.y - 2, z = pos.z}) then
local light_level = minetest.get_node_light(pos)
if not light_level then
return
end
local c = math.ceil(2 * (light_level - 13) ^ 2 + 1)
if light_level > 7 and (math.random(1, c) == 1 or light_level >= 13) then
lottplants_aldertree(pos)
end
end
end,
})
-- Apple Tree sapling
minetest.register_abm({
nodenames = {"lottplants:applesapling"},
interval = 67,
chance = 11,
action = function(pos, node, active_object_count, active_object_count_wider)
if can_grow({x = pos.x, y = pos.y - 1, z = pos.z}) and
can_grow({x = pos.x, y = pos.y - 2, z = pos.z}) then
local light_level = minetest.get_node_light(pos)
if not light_level then
return
end
local c = math.ceil(2 * (light_level - 13) ^ 2 + 1)
if light_level > 7 and (math.random(1, c) == 1 or light_level >= 13) then
lottplants_appletree(pos)
end
end
end,
})
-- Birch sapling
minetest.register_abm({
nodenames = {"lottplants:birchsapling"},
interval = 67,
chance = 11,
action = function(pos, node, active_object_count, active_object_count_wider)
if can_grow({x = pos.x, y = pos.y - 1, z = pos.z}) and
can_grow({x = pos.x, y = pos.y - 2, z = pos.z}) and
can_grow({x = pos.x, y = pos.y - 3, z = pos.z}) then
local light_level = minetest.get_node_light(pos)
if not light_level then
return
end
local c = math.ceil(2 * (light_level - 13) ^ 2 + 1)
if light_level > 7 and (math.random(1, c) == 1 or light_level >= 13) then
lottplants_birchtree(pos)
end
end
end,
})
-- Beech sapling
minetest.register_abm({
nodenames = {"lottplants:beechsapling"},
interval = 67,
chance = 11,
action = function(pos, node, active_object_count, active_object_count_wider)
if can_grow({x = pos.x, y = pos.y - 1, z = pos.z}) and
can_grow({x = pos.x, y = pos.y - 2, z = pos.z}) and
can_grow({x = pos.x, y = pos.y - 3, z = pos.z}) then
local light_level = minetest.get_node_light(pos)
if not light_level then
return
end
local c = math.ceil(2 * (light_level - 13) ^ 2 + 1)
if light_level > 7 and (math.random(1, c) == 1 or light_level >= 13) then
lottplants_beechtree(pos)
end
end
end,
})
-- Culumalda sapling
minetest.register_abm({
nodenames = {"lottplants:culumaldasapling"},
interval = 67,
chance = 11,
action = function(pos, node, active_object_count, active_object_count_wider)
if can_grow({x = pos.x, y = pos.y - 1, z = pos.z}) and
can_grow({x = pos.x, y = pos.y - 2, z = pos.z}) then
local light_level = minetest.get_node_light(pos)
if not light_level then
return
end
local c = math.ceil(2 * (light_level - 13) ^ 2 + 1)
if light_level > 7 and (math.random(1, c) == 1 or light_level >= 13) then
lottplants_culumaldatree(pos)
end
end
end,
})
-- Elm sapling
minetest.register_abm({
nodenames = {"lottplants:elmsapling"},
interval = 67,
chance = 11,
action = function(pos, node, active_object_count, active_object_count_wider)
if can_grow({x = pos.x, y = pos.y - 1, z = pos.z}) and
can_grow({x = pos.x, y = pos.y - 2, z = pos.z}) and
can_grow({x = pos.x, y = pos.y - 3, z = pos.z}) then
local light_level = minetest.get_node_light(pos)
if not light_level then
return
end
local c = math.ceil(2 * (light_level - 13) ^ 2 + 1)
if light_level > 7 and (math.random(1, c) == 1 or light_level >= 13) then
lottplants_elmtree(pos)
end
end
end,
})
-- Fir sapling
minetest.register_abm({
nodenames = {"lottplants:firsapling"},
interval = 67,
chance = 11,
action = function(pos, node, active_object_count, active_object_count_wider)
if can_grow({x = pos.x, y = pos.y - 1, z = pos.z}) and
can_grow({x = pos.x, y = pos.y - 2, z = pos.z}) and
can_grow({x = pos.x, y = pos.y - 3, z = pos.z}) then
local light_level = minetest.get_node_light(pos)
if not light_level then
return
end
local c = math.ceil(2 * (light_level - 13) ^ 2 + 1)
if light_level > 7 and (math.random(1, c) == 1 or light_level >= 13) then
lottplants_firtree(pos)
end
end
end,
})
-- Lebethron sapling
minetest.register_abm({
nodenames = {"lottplants:lebethronsapling"},
interval = 67,
chance = 11,
action = function(pos, node, active_object_count, active_object_count_wider)
if can_grow({x = pos.x, y = pos.y - 1, z = pos.z}) and
can_grow({x = pos.x, y = pos.y - 2, z = pos.z}) and
can_grow({x = pos.x, y = pos.y - 3, z = pos.z}) then
local light_level = minetest.get_node_light(pos)
if not light_level then
return
end
local c = math.ceil(2 * (light_level - 13) ^ 2 + 1)
if light_level > 7 and (math.random(1, c) == 1 or light_level >= 13) then
lottplants_lebethrontree(pos)
end
end
end,
})
-- Mallorn sapling
minetest.register_abm({
nodenames = {"lottplants:mallornsapling"},
interval = 67,
chance = 11,
action = function(pos, node, active_object_count, active_object_count_wider)
local light_level = minetest.get_node_light(pos)
if not light_level then
return
end
local c = math.ceil(2 * (light_level - 13) ^ 2 + 1)
if light_level > 7 and (math.random(1, c) == 1 or light_level >= 13) then
lottplants_young_mallorn(pos)
end
end,
})
minetest.register_abm({
nodenames = {"lottplants:mallorntree_young_grower"},
interval = 67,
chance = 25,
action = function(pos, node, active_object_count, active_object_count_wider)
local na = minetest.get_node_or_nil({x = pos.x, y = pos.y + 1, z = pos.z})
local naa = minetest.get_node_or_nil({x = pos.x, y = pos.y + 2, z = pos.z})
if na and naa and na.name == "lottplants:mallorntree_young" and naa.name == "lottplants:mallorntree_young" then
if can_grow({x = pos.x, y = pos.y - 1, z = pos.z}) and
can_grow({x = pos.x, y = pos.y - 2, z = pos.z}) and
can_grow({x = pos.x, y = pos.y - 3, z = pos.z}) then
local light_level = minetest.get_node_light(pos)
if not light_level then
return
end
local c = math.ceil(2 * (light_level - 13) ^ 2 + 1)
if light_level > 7 and (math.random(1, c) == 1 or light_level >= 13) then
lottplants_smallmallorntree(pos)
end
end
end
end,
})
minetest.register_abm({
nodenames = {"lottplants:mallorntree_grower"},
interval = 67,
chance = 50,
action = function(pos, node, active_object_count, active_object_count_wider)
local na = minetest.get_node_or_nil({x = pos.x, y = pos.y + 1, z = pos.z})
local naa = minetest.get_node_or_nil({x = pos.x, y = pos.y + 2, z = pos.z})
if na and naa and na.name == "lottplants:mallorntree" and naa.name == "lottplants:mallorntree" then
if large_roots(pos) ~= false then
local light_level = minetest.get_node_light(pos)
if not light_level then
return
end
local c = math.ceil(2 * (light_level - 13) ^ 2 + 1)
if light_level > 7 and (math.random(1, c) == 1 or light_level >= 13) then
lottplants_mallorntree(pos)
end
end
end
end,
})
-- Pine sapling
minetest.register_abm({
nodenames = {"lottplants:pinesapling"},
interval = 67,
chance = 11,
action = function(pos, node, active_object_count, active_object_count_wider)
if can_grow({x = pos.x, y = pos.y - 1, z = pos.z}) and
can_grow({x = pos.x, y = pos.y - 2, z = pos.z}) and
can_grow({x = pos.x, y = pos.y - 3, z = pos.z}) then
local light_level = minetest.get_node_light(pos)
if not light_level then
return
end
local c = math.ceil(2 * (light_level - 13) ^ 2 + 1)
if light_level > 7 and (math.random(1, c) == 1 or light_level >= 13) then
lottplants_pinetree(pos)
end
end
end,
})
-- Plum sapling
minetest.register_abm({
nodenames = {"lottplants:plumsapling"},
interval = 67,
chance = 11,
action = function(pos, node, active_object_count, active_object_count_wider)
if can_grow({x = pos.x, y = pos.y - 1, z = pos.z}) and
can_grow({x = pos.x, y = pos.y - 2, z = pos.z}) then
local light_level = minetest.get_node_light(pos)
if not light_level then
return
end
local c = math.ceil(2 * (light_level - 13) ^ 2 + 1)
if light_level > 7 and (math.random(1, c) == 1 or light_level >= 13) then
lottplants_plumtree(pos)
end
end
end,
})
-- Rowan sapling
minetest.register_abm({
nodenames = {"lottplants:rowansapling"},
interval = 67,
chance = 11,
action = function(pos, node, active_object_count, active_object_count_wider)
if can_grow({x = pos.x, y = pos.y - 1, z = pos.z}) and
can_grow({x = pos.x, y = pos.y - 2, z = pos.z}) then
local light_level = minetest.get_node_light(pos)
if not light_level then
return
end
local c = math.ceil(2 * (light_level - 13) ^ 2 + 1)
print(light_level, c)
if light_level > 7 and (math.random(1, c) == 1 or light_level >= 13) then
lottplants_rowantree(pos)
end
end
end,
})
-- White Tree
minetest.register_abm({
nodenames = {"lottplants:whitesapling"},
interval = 67,
chance = 11,
action = function(pos, node, active_object_count, active_object_count_wider)
if can_grow({x = pos.x, y = pos.y - 1, z = pos.z}) and
can_grow({x = pos.x, y = pos.y - 2, z = pos.z}) then
local light_level = minetest.get_node_light(pos)
if not light_level then
return
end
local c = math.ceil(2 * (light_level - 13) ^ 2 + 1)
if light_level > 7 and (math.random(1, c) == 1 or light_level >= 13) then
lottplants_whitetree(pos)
end
end
end,
})
-- Yavannamire Tree
minetest.register_abm({
nodenames = {"lottplants:yavannamiresapling"},
interval = 67,
chance = 11,
action = function(pos, node, active_object_count, active_object_count_wider)
if can_grow({x = pos.x, y = pos.y - 1, z = pos.z}) and
can_grow({x = pos.x, y = pos.y - 2, z = pos.z}) then
local light_level = minetest.get_node_light(pos)
if not light_level then
return
end
local c = math.ceil(2 * (light_level - 13) ^ 2 + 1)
if light_level > 7 and (math.random(1, c) == 1 or light_level >= 13) then
lottplants_yavannamiretree(pos)
end
end
end,
})
--Mirk Tree
minetest.register_abm({
nodenames = {"lottplants:mirksapling"},
interval = 67,
chance = 11,
action = function(pos, node, active_object_count, active_object_count_wider)
if math.random(2) == 1 and large_roots(pos) then
local light_level = minetest.get_node_light(pos)
if not light_level then
return
end
local c = math.ceil(2 * (light_level - 13) ^ 2 + 1)
if light_level > 7 and (math.random(1, c) == 1 or light_level >= 13) then
lottplants_mirktree(pos)
end
else
if can_grow({x = pos.x, y = pos.y - 1, z = pos.z}) and
can_grow({x = pos.x, y = pos.y - 2, z = pos.z}) and
can_grow({x = pos.x, y = pos.y - 3, z = pos.z}) then
local light_level = minetest.get_node_light(pos)
if not light_level then
return
end
local c = math.ceil(2 * (light_level - 13) ^ 2 + 1)
if light_level > 7 and (math.random(1, c) == 1 or light_level >= 13) then
lottplants_smallmirktree(pos)
end
end
end
end,
})
| lgpl-2.1 |
MonokuroInzanaito/ygopro-777DIY | expansions/script/c33700065.lua | 1 | 3245 | --动物朋友 PPP 金图企鹅
function c33700065.initial_effect(c)
--special summon
local e0=Effect.CreateEffect(c)
e0:SetCategory(CATEGORY_SPECIAL_SUMMON)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_TO_HAND)
e0:SetCondition(c33700065.condition)
e0:SetOperation(c33700065.operation)
c:RegisterEffect(e0)
--effect
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(40044918,0))
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCategory(CATEGORY_RECOVER)
e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(c33700065.tg)
e1:SetOperation(c33700065.op)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--pierce
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetCondition(c33700065.con)
e3:SetValue(1)
e3:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x3442))
c:RegisterEffect(e3)
--avoid damage
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetCode(EFFECT_NO_EFFECT_DAMAGE)
e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(1,0)
e4:SetCondition(c33700065.con)
e4:SetValue(c33700065.damval)
c:RegisterEffect(e4)
end
function c33700065.condition(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_EFFECT)~=0 and e:GetHandler():IsPreviousLocation(LOCATION_DECK) and e:GetHandler():GetPreviousControler()==tp and re:GetHandler():IsSetCard(0x442)
end
function c33700065.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) and
Duel.SelectYesNo(tp,aux.Stringid(33700063,0)) then
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
e3:SetValue(1)
e3:SetReset(RESET_EVENT+0x1fe0000)
e:GetHandler():RegisterEffect(e3,true)
local e4=e3:Clone()
e4:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
e:GetHandler():RegisterEffect(e4,true)
local e5=e3:Clone()
e5:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
e:GetHandler():RegisterEffect(e5,true)
end
end
function c33700065.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x3442)
end
function c33700065.con(e)
local g=Duel.GetMatchingGroup(c33700065.cfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,nil)
return g:GetClassCount(Card.GetCode)>=3
end
function c33700065.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local ct=Duel.GetMatchingGroupCount(c33700065.cfilter,tp,LOCATION_MZONE,0,nil)
Duel.SetTargetPlayer(tp)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,ct*800)
end
function c33700065.op(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local ct=Duel.GetMatchingGroupCount(c33700065.cfilter,p,LOCATION_MZONE,0,nil)
if ct>0 then
Duel.Recover(p,ct*800,REASON_EFFECT)
end
end
function c33700065.damval(e,re,val,r,rp,rc)
if bit.band(r,REASON_EFFECT)~=0 then return 0 end
return val
end | gpl-3.0 |
will4wachter/Project1 | scripts/zones/Xarcabard/npcs/Tememe_WW.lua | 8 | 2929 | -----------------------------------
-- Area: Xarcabard
-- NPC: Tememe, W.W.
-- Type: Border Conquest Guards
-- @pos -133.678 -22.517 112.224 112
-----------------------------------
package.loaded["scripts/zones/Xarcabard/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/conquest");
require("scripts/zones/Xarcabard/TextIDs");
local guardnation = WINDURST; -- SANDORIA, BASTOK, WINDURST, 4 = jeuno
local guardtype = 4; -- 1: city, 2: foreign, 3: outpost, 4: border
local region = VALDEAUNIA;
local csid = 0x7ff6;
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
tradeConquestGuard(player,npc,trade,guardnation,guardtype);
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
if(player:hasKeyItem(getSupplyKey(region)) and player:getNation() == guardnation) then
if(supplyRunFresh(player) == 1) then
player:startEvent(csid,16,0,0,0,1,0,0,255); -- you have brought us supplies !
else
player:showText(npc, CONQUEST - 1); -- "Hmm... These supplies you have brought us are too old to be of any use."
player:delKeyItem(getSupplyKey(region));
player:messageSpecial(KEYITEM_OBTAINED + 1, getSupplyKey(region));
player:setVar("supplyQuest_region",0);
end
else
local arg1 = getArg1(guardnation, player) - 1;
if(arg1 >= 1792) then -- foreign, non-allied
player:startEvent(csid,1808,0,0,0,0,player:getRank(),0,0);
else -- citizen or allied
player:startEvent(csid,arg1,0,0x3F0000,0,0,getArg6(player),0,0);
end
end
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
--printf("CSID: %u",csid);
--printf("OPTION: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
--printf("CSID: %u",csid);
--printf("OPTION: %u",option);
if(option == 1) then
local duration = (player:getRank() + getNationRank(player:getNation()) + 3) * 3600;
player:delStatusEffect(EFFECT_SIGNET);
player:addStatusEffect(EFFECT_SIGNET,0,0,duration); -- Grant Signet
elseif(option == 2) then
player:delKeyItem(getSupplyKey(region));
player:addCP(supplyReward[region + 1])
player:messageSpecial(CONQUEST); -- "You've earned conquest points!"
if(hasOutpost(player, region+5) == 0) then
local supply_quests = 2^(region+5);
player:addNationTeleport(guardnation,supply_quests);
player:setVar("supplyQuest_region",0);
end
elseif(option == 4) then
if(player:delGil(giltosetHP(guardnation,player))) then
player:setHomePoint();
player:messageSpecial(CONQUEST + 94); -- "Your home point has been set."
else
player:messageSpecial(CONQUEST + 95); -- "You do not have enough gil to set your home point here."
end
end
end; | gpl-3.0 |
davidedmonds/darkstar | scripts/zones/Vunkerl_Inlet_[S]/npcs/qm7.lua | 45 | 2168 | -----------------------------------
-- Area: Vunkerl Inlet (S) (H-6)
-- NPC: ???
-- Involved in Quests
-- @pos -26 -31 364
-----------------------------------
package.loaded["scripts/zones/Vunkerl_Inlet_[S]/TextIDs"] = nil;
package.loaded["scripts/globals/quests"] = nil;
-----------------------------------
require("scripts/globals/quests");
require("scripts/zones/Vunkerl_Inlet_[S]/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
if (player:getQuestStatus(CRYSTAL_WAR, BOY_AND_THE_BEAST) == QUEST_AVAILABLE and player:getVar("BoyAndTheBeast") == 2) then
player:startEvent(0x0069);
elseif (player:getQuestStatus(CRYSTAL_WAR, BOY_AND_THE_BEAST) == QUEST_ACCEPTED and player:getVar("BoyAndTheBeast") == 3) then
player:startEvent(0x006C);
elseif (player:getQuestStatus(CRYSTAL_WAR, BOY_AND_THE_BEAST) == QUEST_ACCEPTED and player:getVar("BoyAndTheBeast") == 4) then
player:startEvent(0x006D);
end
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
if (csid == 0x0069) then
player:addQuest(CRYSTAL_WAR, BOY_AND_THE_BEAST);
player:addKeyItem(VUNKERL_HERB_MEMO);
player:messageSpecial(KEYITEM_OBTAINED, VUNKERL_HERB_MEMO);
elseif (csid == 0x006C) then
if(player:getFreeSlotsCount() == 0) then
player:messageSpecial(ITEM_CANNOT_BE_OBTAINED,17384); -- Carbon Fishing Rod
else
player:completeQuest(CRYSTAL_WAR, BOY_AND_THE_BEAST);
player:delKeyItem(VUNKERL_HERB_MEMO);
player:delKeyItem(VUNKERL_HERB);
player:addItem(17384);
player:messageSpecial(ITEM_OBTAINED,17384); --Carbon Fishing Rod
end
elseif (csid == 0x006D) then
player:delKeyItem(VUNKERL_HERB);
player:setVar("BoyAndTheBeast",2);
end
end;
| gpl-3.0 |
waterlgndx/darkstar | scripts/globals/mobskills/crystal_weapon.lua | 37 | 1031 | ---------------------------------------------
-- Crystal Weapon
--
-- Description: Invokes the power of a crystal to deal magical damage of a random element to a single target.
-- Type: Magical
-- Utsusemi/Blink absorb: Ignores shadows
-- Range: Unknown
-- Notes: Can be Fire, Earth, Wind, or Water element. Functions even at a distance (outside of melee range).
---------------------------------------------
require("scripts/globals/settings");
require("scripts/globals/status");
require("scripts/globals/monstertpmoves");
---------------------------------------------
function onMobSkillCheck(target,mob,skill)
return 0;
end;
function onMobWeaponSkill(target, mob, skill)
local element = math.random(6,9);
local dmgmod = 1;
local accmod = 1;
local info = MobMagicalMove(mob,target,skill,mob:getWeaponDmg() * 5,accmod,dmgmod,TP_MAB_BONUS,1);
local dmg = MobFinalAdjustments(info.dmg,mob,skill,target,MOBSKILL_MAGICAL,element,MOBPARAM_IGNORE_SHADOWS);
target:delHP(dmg);
return dmg;
end;
| gpl-3.0 |
Murloc992/TBCBackporting | Jamba/Jamba/Libs/AceGUI-3.0/widgets/AceGUIWidget-DropDown-Items.lua | 2 | 10360 | --[[ $Id: AceGUIWidget-DropDown-Items.lua 916 2010-03-15 12:24:36Z nevcairiel $ ]]--
local AceGUI = LibStub("AceGUI-3.0")
-- Lua APIs
local select, assert = select, assert
-- WoW APIs
local PlaySound = PlaySound
local CreateFrame = CreateFrame
local function fixlevels(parent,...)
local i = 1
local child = select(i, ...)
while child do
child:SetFrameLevel(parent:GetFrameLevel()+1)
fixlevels(child, child:GetChildren())
i = i + 1
child = select(i, ...)
end
end
local function fixstrata(strata, parent, ...)
local i = 1
local child = select(i, ...)
parent:SetFrameStrata(strata)
while child do
fixstrata(strata, child, child:GetChildren())
i = i + 1
child = select(i, ...)
end
end
-- ItemBase is the base "class" for all dropdown items.
-- Each item has to use ItemBase.Create(widgetType) to
-- create an initial 'self' value.
-- ItemBase will add common functions and ui event handlers.
-- Be sure to keep basic usage when you override functions.
local ItemBase = {
-- NOTE: The ItemBase version is added to each item's version number
-- to ensure proper updates on ItemBase changes.
-- Use at least 1000er steps.
version = 1000,
counter = 0,
}
function ItemBase.Frame_OnEnter(this)
local self = this.obj
if self.useHighlight then
self.highlight:Show()
end
self:Fire("OnEnter")
if self.specialOnEnter then
self.specialOnEnter(self)
end
end
function ItemBase.Frame_OnLeave(this)
local self = this.obj
self.highlight:Hide()
self:Fire("OnLeave")
if self.specialOnLeave then
self.specialOnLeave(self)
end
end
-- exported, AceGUI callback
function ItemBase.OnAcquire(self)
self.frame:SetToplevel(true)
self.frame:SetFrameStrata("FULLSCREEN_DIALOG")
end
-- exported, AceGUI callback
function ItemBase.OnRelease(self)
self:SetDisabled(false)
self.pullout = nil
self.frame:SetParent(nil)
self.frame:ClearAllPoints()
self.frame:Hide()
end
-- exported
-- NOTE: this is called by a Dropdown-Pullout.
-- Do not call this method directly
function ItemBase.SetPullout(self, pullout)
self.pullout = pullout
self.frame:SetParent(nil)
self.frame:SetParent(pullout.itemFrame)
self.parent = pullout.itemFrame
fixlevels(pullout.itemFrame, pullout.itemFrame:GetChildren())
end
-- exported
function ItemBase.SetText(self, text)
self.text:SetText(text or "")
end
-- exported
function ItemBase.GetText(self)
return self.text:GetText()
end
-- exported
function ItemBase.SetPoint(self, ...)
self.frame:SetPoint(...)
end
-- exported
function ItemBase.Show(self)
self.frame:Show()
end
-- exported
function ItemBase.Hide(self)
self.frame:Hide()
end
-- exported
function ItemBase.SetDisabled(self, disabled)
self.disabled = disabled
if disabled then
self.useHighlight = false
self.text:SetTextColor(.5, .5, .5)
else
self.useHighlight = true
self.text:SetTextColor(1, 1, 1)
end
end
-- exported
-- NOTE: this is called by a Dropdown-Pullout.
-- Do not call this method directly
function ItemBase.SetOnLeave(self, func)
self.specialOnLeave = func
end
-- exported
-- NOTE: this is called by a Dropdown-Pullout.
-- Do not call this method directly
function ItemBase.SetOnEnter(self, func)
self.specialOnEnter = func
end
function ItemBase.Create(type)
-- NOTE: Most of the following code is copied from AceGUI-3.0/Dropdown widget
local count = AceGUI:GetNextWidgetNum(type)
local frame = CreateFrame("Button", "AceGUI30DropDownItem"..count)
local self = {}
self.frame = frame
frame.obj = self
self.type = type
self.useHighlight = true
frame:SetHeight(17)
frame:SetFrameStrata("FULLSCREEN_DIALOG")
local text = frame:CreateFontString(nil,"OVERLAY","GameFontNormalSmall")
text:SetTextColor(1,1,1)
text:SetJustifyH("LEFT")
text:SetPoint("TOPLEFT",frame,"TOPLEFT",18,0)
text:SetPoint("BOTTOMRIGHT",frame,"BOTTOMRIGHT",-8,0)
self.text = text
local highlight = frame:CreateTexture(nil, "OVERLAY")
highlight:SetTexture("Interface\\QuestFrame\\UI-QuestTitleHighlight")
highlight:SetBlendMode("ADD")
highlight:SetHeight(14)
highlight:ClearAllPoints()
highlight:SetPoint("RIGHT",frame,"RIGHT",-3,0)
highlight:SetPoint("LEFT",frame,"LEFT",5,0)
highlight:Hide()
self.highlight = highlight
local check = frame:CreateTexture("OVERLAY")
check:SetWidth(16)
check:SetHeight(16)
check:SetPoint("LEFT",frame,"LEFT",3,-1)
check:SetTexture("Interface\\Buttons\\UI-CheckBox-Check")
check:Hide()
self.check = check
local sub = frame:CreateTexture("OVERLAY")
sub:SetWidth(16)
sub:SetHeight(16)
sub:SetPoint("RIGHT",frame,"RIGHT",-3,-1)
sub:SetTexture("Interface\\ChatFrame\\ChatFrameExpandArrow")
sub:Hide()
self.sub = sub
frame:SetScript("OnEnter", ItemBase.Frame_OnEnter)
frame:SetScript("OnLeave", ItemBase.Frame_OnLeave)
self.OnAcquire = ItemBase.OnAcquire
self.OnRelease = ItemBase.OnRelease
self.SetPullout = ItemBase.SetPullout
self.GetText = ItemBase.GetText
self.SetText = ItemBase.SetText
self.SetDisabled = ItemBase.SetDisabled
self.SetPoint = ItemBase.SetPoint
self.Show = ItemBase.Show
self.Hide = ItemBase.Hide
self.SetOnLeave = ItemBase.SetOnLeave
self.SetOnEnter = ItemBase.SetOnEnter
return self
end
--[[
Template for items:
-- Item:
--
do
local widgetType = "Dropdown-Item-"
local widgetVersion = 1
local function Constructor()
local self = ItemBase.Create(widgetType)
AceGUI:RegisterAsWidget(self)
return self
end
AceGUI:RegisterWidgetType(widgetType, Constructor, widgetVersion + ItemBase.version)
end
--]]
-- Item: Header
-- A single text entry.
-- Special: Different text color and no highlight
do
local widgetType = "Dropdown-Item-Header"
local widgetVersion = 1
local function OnEnter(this)
local self = this.obj
self:Fire("OnEnter")
if self.specialOnEnter then
self.specialOnEnter(self)
end
end
local function OnLeave(this)
local self = this.obj
self:Fire("OnLeave")
if self.specialOnLeave then
self.specialOnLeave(self)
end
end
-- exported, override
local function SetDisabled(self, disabled)
ItemBase.SetDisabled(self, disabled)
if not disabled then
self.text:SetTextColor(1, 1, 0)
end
end
local function Constructor()
local self = ItemBase.Create(widgetType)
self.SetDisabled = SetDisabled
self.frame:SetScript("OnEnter", OnEnter)
self.frame:SetScript("OnLeave", OnLeave)
self.text:SetTextColor(1, 1, 0)
AceGUI:RegisterAsWidget(self)
return self
end
AceGUI:RegisterWidgetType(widgetType, Constructor, widgetVersion + ItemBase.version)
end
-- Item: Execute
-- A simple button
do
local widgetType = "Dropdown-Item-Execute"
local widgetVersion = 1
local function Frame_OnClick(this, button)
local self = this.obj
if self.disabled then return end
self:Fire("OnClick")
if self.pullout then
self.pullout:Close()
end
end
local function Constructor()
local self = ItemBase.Create(widgetType)
self.frame:SetScript("OnClick", Frame_OnClick)
AceGUI:RegisterAsWidget(self)
return self
end
AceGUI:RegisterWidgetType(widgetType, Constructor, widgetVersion + ItemBase.version)
end
-- Item: Toggle
-- Some sort of checkbox for dropdown menus.
-- Does not close the pullout on click.
do
local widgetType = "Dropdown-Item-Toggle"
local widgetVersion = 3
local function UpdateToggle(self)
if self.value then
self.check:Show()
else
self.check:Hide()
end
end
local function OnRelease(self)
ItemBase.OnRelease(self)
self:SetValue(nil)
end
local function Frame_OnClick(this, button)
local self = this.obj
if self.disabled then return end
self.value = not self.value
if self.value then
PlaySound("igMainMenuOptionCheckBoxOn")
else
PlaySound("igMainMenuOptionCheckBoxOff")
end
UpdateToggle(self)
self:Fire("OnValueChanged", self.value)
end
-- exported
local function SetValue(self, value)
self.value = value
UpdateToggle(self)
end
-- exported
local function GetValue(self)
return self.value
end
local function Constructor()
local self = ItemBase.Create(widgetType)
self.frame:SetScript("OnClick", Frame_OnClick)
self.SetValue = SetValue
self.GetValue = GetValue
self.OnRelease = OnRelease
AceGUI:RegisterAsWidget(self)
return self
end
AceGUI:RegisterWidgetType(widgetType, Constructor, widgetVersion + ItemBase.version)
end
-- Item: Menu
-- Shows a submenu on mouse over
-- Does not close the pullout on click
do
local widgetType = "Dropdown-Item-Menu"
local widgetVersion = 2
local function OnEnter(this)
local self = this.obj
self:Fire("OnEnter")
if self.specialOnEnter then
self.specialOnEnter(self)
end
self.highlight:Show()
if not self.disabled and self.submenu then
self.submenu:Open("TOPLEFT", self.frame, "TOPRIGHT", self.pullout:GetRightBorderWidth(), 0, self.frame:GetFrameLevel() + 100)
end
end
local function OnHide(this)
local self = this.obj
if self.submenu then
self.submenu:Close()
end
end
-- exported
local function SetMenu(self, menu)
assert(menu.type == "Dropdown-Pullout")
self.submenu = menu
end
-- exported
local function CloseMenu(self)
self.submenu:Close()
end
local function Constructor()
local self = ItemBase.Create(widgetType)
self.sub:Show()
self.frame:SetScript("OnEnter", OnEnter)
self.frame:SetScript("OnHide", OnHide)
self.SetMenu = SetMenu
self.CloseMenu = CloseMenu
AceGUI:RegisterAsWidget(self)
return self
end
AceGUI:RegisterWidgetType(widgetType, Constructor, widgetVersion + ItemBase.version)
end
-- Item: Separator
-- A single line to separate items
do
local widgetType = "Dropdown-Item-Separator"
local widgetVersion = 1
-- exported, override
local function SetDisabled(self, disabled)
ItemBase.SetDisabled(self, disabled)
self.useHighlight = false
end
local function Constructor()
local self = ItemBase.Create(widgetType)
self.SetDisabled = SetDisabled
local line = self.frame:CreateTexture(nil, "OVERLAY")
line:SetHeight(1)
line:SetTexture(.5, .5, .5)
line:SetPoint("LEFT", self.frame, "LEFT", 10, 0)
line:SetPoint("RIGHT", self.frame, "RIGHT", -10, 0)
self.text:Hide()
self.useHighlight = false
AceGUI:RegisterAsWidget(self)
return self
end
AceGUI:RegisterWidgetType(widgetType, Constructor, widgetVersion + ItemBase.version)
end
| gpl-3.0 |
waterlgndx/darkstar | scripts/zones/Bastok_Markets/npcs/Ciqala.lua | 2 | 1140 | -----------------------------------
-- Area: Bastok Markets
-- NPC: Ciqala
-- Type: Merchant
-- !pos -283.147 -11.319 -143.680 235
-----------------------------------
package.loaded["scripts/zones/Bastok_Markets/TextIDs"] = nil
-----------------------------------
require("scripts/zones/Bastok_Markets/TextIDs")
require("scripts/globals/shop")
function onTrigger(player,npc)
local stock =
{
16392, 4818, 1, -- Metal Knuckles
17044, 6033, 1, -- Warhammer
16390, 224, 3, -- Bronze Knuckles
16391, 828, 3, -- Brass Knuckles
16385, 129, 3, -- Cesti
16407, 1521, 3, -- Brass Baghnakhs
16405, 104, 3, -- Cat Baghnakhs
17042, 312, 3, -- Bronze Hammer
17043, 2083, 3, -- Brass Hammer
17049, 47, 3, -- Maple Wand
17024, 66, 3, -- Ash Club
17059, 90, 3, -- Bronze Rod
17081, 621, 3, -- Brass Rod
17088, 57, 3, -- Ash Staff
17095, 386, 3, -- Ash Pole
}
player:showText(npc, CIQALA_SHOP_DIALOG)
dsp.shop.nation(player, stock, dsp.nation.BASTOK)
end
| gpl-3.0 |
MonokuroInzanaito/ygopro-777DIY | expansions/script/c33700015.lua | 1 | 2714 | --狡猾的献祭
function c33700015.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c33700015.target)
e1:SetOperation(c33700015.operation)
c:RegisterEffect(e1)
--Atk up
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(2000)
c:RegisterEffect(e2)
--Equip limit
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_EQUIP_LIMIT)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetValue(c33700015.eqlimit)
c:RegisterEffect(e3)
--damage
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_DAMAGE+CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_BATTLE_START)
e4:SetRange(LOCATION_SZONE)
e4:SetCondition(c33700015.damcon)
e4:SetTarget(c33700015.damtg)
e4:SetOperation(c33700015.damop)
c:RegisterEffect(e4)
end
function c33700015.eqlimit(e,c)
return c:IsType(TYPE_TOKEN)
end
function c33700015.filter(c)
return c:IsFaceup() and c:IsType(TYPE_TOKEN)
end
function c33700015.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c33700015.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c33700015.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,c33700015.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c33700015.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if e:GetHandler():IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Equip(tp,e:GetHandler(),tc)
end
end
function c33700015.damcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetEquipTarget()
end
function c33700015.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
local ec=e:GetHandler():GetEquipTarget()
if chk==0 then return ec:IsDestructable() and ec:GetAttack()>0 end
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(ec:GetAttack())
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,ec:GetAttack())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,ec,1,0,0)
end
function c33700015.damop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
if Duel.Damage(p,d,REASON_EFFECT)>0 then
Duel.BreakEffect()
if Duel.Destroy(e:GetHandler():GetEquipTarget(),REASON_EFFECT)>0 and
e:GetHandler():IsAbleToHand() then
e:GetHandler():CancelToGrave()
Duel.SendtoHand(e:GetHandler(),nil,REASON_EFFECT)
end
end
end | gpl-3.0 |
davidedmonds/darkstar | scripts/zones/Phomiuna_Aqueducts/npcs/qm1.lua | 34 | 1033 | -----------------------------------
-- Area: Phomiuna Aqueducts
-- NPC: qm1 (???)
-- Notes: Opens east door @ F-7
-- @pos -44.550 -24.601 106.495 27
-----------------------------------
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
local DoorOffset = npc:getID() - 1;
if (GetNPCByID(DoorOffset):getAnimation() == 9) then
GetNPCByID(DoorOffset):openDoor(7) -- _0re
end
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end; | gpl-3.0 |
will4wachter/Project1 | scripts/zones/Northern_San_dOria/npcs/Mevreauche.lua | 12 | 2010 | -----------------------------------
-- Area: Northern San d'Oria
-- NPC: Mevreauche
-- Type: Smithing Guild Master
-- @pos -193.584 10 148.655 231
-----------------------------------
package.loaded["scripts/zones/Northern_San_dOria/TextIDs"] = nil;
-----------------------------------
package.loaded["scripts/globals/crafting"] = nil;
require("scripts/globals/crafting");
require("scripts/zones/Northern_San_dOria/TextIDs");
local SKILLID = 50; -- Smithing
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
local newRank = tradeTestItem(player,npc,trade,SKILLID);
if(newRank ~= 0) then
player:setSkillRank(SKILLID,newRank);
player:startEvent(0x0273,0,0,0,0,newRank);
end
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
local getNewRank = 0;
local craftSkill = player:getSkillLevel(SKILLID);
local testItem = getTestItem(player,npc,SKILLID);
local guildMember = isGuildMember(player,8);
if(guildMember == 1) then guildMember = 150995375; end
if(canGetNewRank(player,craftSkill,SKILLID) == 1) then getNewRank = 100; end
player:startEvent(0x0272,testItem,getNewRank,30,guildMember,44,0,0,0);
end;
-- 0x0272 0x0273 0x0010 0x0000 0x0049 0x004a
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
if(csid == 0x0272 and option == 1) then
if(player:getFreeSlotsCount() == 0) then
player:messageSpecial(ITEM_CANNOT_BE_OBTAINED,4096);
else
player:addItem(4096);
player:messageSpecial(ITEM_OBTAINED,4096); -- Fire Crystal
signupGuild(player,256);
end
end
end; | gpl-3.0 |
kidaa/darkstar | scripts/zones/Pashhow_Marshlands/npcs/Mesachedeau_RK.lua | 30 | 3070 | -----------------------------------
-- Area: Pashhow Marshlands
-- NPC: Mesachedeau, R.K.
-- Type: Outpost Conquest Guards
-- @pos 470.843 23.465 415.520 109
-----------------------------------
package.loaded["scripts/zones/Pashhow_Marshlands/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/conquest");
require("scripts/zones/Pashhow_Marshlands/TextIDs");
local guardnation = SANDORIA; -- SANDORIA, BASTOK, WINDURST, 4 = jeuno
local guardtype = 3; -- 1: city, 2: foreign, 3: outpost, 4: border
local region = DERFLAND;
local csid = 0x7ffb;
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
tradeConquestGuard(player,npc,trade,guardnation,guardtype);
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
if (player:hasKeyItem(getSupplyKey(region)) and player:getNation() == guardnation) then
if (supplyRunFresh(player) == 1) then
player:startEvent(csid,16,0,0,0,1,0,0,255); -- you have brought us supplies !
else
player:showText(npc, CONQUEST - 1); -- "Hmm... These supplies you have brought us are too old to be of any use."
player:delKeyItem(getSupplyKey(region));
player:messageSpecial(KEYITEM_OBTAINED + 1, getSupplyKey(region));
player:setVar("supplyQuest_region",0);
end
else
local arg1 = getArg1(guardnation, player) - 1;
if (arg1 >= 1792) then -- foreign, non-allied
player:startEvent(csid,1808,0,0,0,0,player:getRank(),0,0);
else -- citizen or allied
player:startEvent(csid,arg1,0,0x3F0000,0,0,getArg6(player),0,0);
end
end
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("OPTION: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("OPTION: %u",option);
if (option == 1) then
local duration = (player:getRank() + getNationRank(player:getNation()) + 3) * 3600;
player:delStatusEffect(EFFECT_SIGIL);
player:delStatusEffect(EFFECT_SANCTION);
player:delStatusEffect(EFFECT_SIGNET);
player:addStatusEffect(EFFECT_SIGNET,0,0,duration); -- Grant Signet
elseif (option == 2) then
player:delKeyItem(getSupplyKey(region));
player:addCP(supplyReward[region + 1])
player:messageSpecial(CONQUEST); -- "You've earned conquest points!"
if (hasOutpost(player, region+5) == 0) then
local supply_quests = 2^(region+5);
player:addNationTeleport(guardnation,supply_quests);
player:setVar("supplyQuest_region",0);
end
elseif (option == 4) then
if (player:delGil(giltosetHP(guardnation,player))) then
player:setHomePoint();
player:messageSpecial(CONQUEST + 94); -- "Your home point has been set."
else
player:messageSpecial(CONQUEST + 95); -- "You do not have enough gil to set your home point here."
end
end
end; | gpl-3.0 |
will4wachter/Project1 | scripts/zones/Selbina/npcs/Melyon.lua | 17 | 3574 | -----------------------------------
-- Area: Selbina
-- NPC: Melyon
-- Starts and Finishes Quest: Only the Best (R)
-- Involved in Quest: Riding on the Clouds
-- @pos 25 -6 6 248
-----------------------------------
package.loaded["scripts/zones/Selbina/TextIDs"] = nil;
package.loaded["scripts/globals/settings"] = nil;
-----------------------------------
require("scripts/zones/Selbina/TextIDs");
require("scripts/globals/settings");
require("scripts/globals/keyitems");
require("scripts/globals/quests");
require("scripts/globals/settings");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
if(player:getQuestStatus(OTHER_AREAS,ONLY_THE_BEST) ~= QUEST_AVAILABLE) then
if(trade:hasItemQty(4366,5) == true and trade:getGil() == 0 and trade:getItemCount() == 5) then
player:startEvent(0x003e); -- La Theine Cabbage x5
elseif(trade:hasItemQty(629,3) == true and trade:getGil() == 0 and trade:getItemCount() == 3) then
player:startEvent(0x003f); -- Millioncorn x3
elseif(trade:hasItemQty(919,1) == true and trade:getGil() == 0 and trade:getItemCount() == 1) then
player:startEvent(0x0040); -- Boyahda Moss x1
end
end
if(player:getQuestStatus(JEUNO,RIDING_ON_THE_CLOUDS) == QUEST_ACCEPTED and player:getVar("ridingOnTheClouds_3") == 3) then
if(trade:hasItemQty(1127,1) and trade:getItemCount() == 1) then -- Trade Kindred seal
player:setVar("ridingOnTheClouds_3",0);
player:tradeComplete();
player:addKeyItem(SOMBER_STONE);
player:messageSpecial(KEYITEM_OBTAINED,SOMBER_STONE);
end
end
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
OnlyTheBest = player:getQuestStatus(OTHER_AREAS,ONLY_THE_BEST);
if (OnlyTheBest == QUEST_AVAILABLE) then
player:startEvent(0x003c,4366,629,919); -- Start quest "Only the Best"
elseif(OnlyTheBest ~= QUEST_AVAILABLE) then
player:startEvent(0x003d,4366,629,919); -- During & after completed quest "Only the Best"
end
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
if(csid == 0x003c and option == 10) then
player:addQuest(OTHER_AREAS,ONLY_THE_BEST);
elseif(csid == 0x003e) then
player:tradeComplete();
player:addGil(100);
player:messageSpecial(GIL_OBTAINED,100);
player:addFame(BASTOK, BAS_FAME*10);
player:addFame(SANDORIA,SAN_FAME*10);
player:addFame(JEUNO, JEUNO_FAME*10);
player:completeQuest(OTHER_AREAS,ONLY_THE_BEST);
elseif(csid == 0x003f) then
player:tradeComplete();
player:addGil(120);
player:messageSpecial(GIL_OBTAINED,120);
player:addFame(BASTOK, BAS_FAME*20);
player:addFame(SANDORIA,SAN_FAME*20);
player:addFame(JEUNO, JEUNO_FAME*20);
player:completeQuest(OTHER_AREAS,ONLY_THE_BEST);
elseif(csid == 0x0040) then
player:tradeComplete();
player:addGil(600);
player:messageSpecial(GIL_OBTAINED,600);
player:addFame(BASTOK, BAS_FAME*30);
player:addFame(SANDORIA,SAN_FAME*30);
player:addFame(JEUNO, JEUNO_FAME*30);
player:completeQuest(OTHER_AREAS,ONLY_THE_BEST);
end
end; | gpl-3.0 |
waterlgndx/darkstar | scripts/zones/Kazham/Zone.lua | 2 | 1048 | -----------------------------------
--
-- Zone: Kazham (250)
--
-----------------------------------
package.loaded["scripts/zones/Kazham/TextIDs"] = nil;
-----------------------------------
require("scripts/zones/Kazham/TextIDs");
-----------------------------------
function onInitialize(zone)
end;
function onConquestUpdate(zone, updatetype)
local players = zone:getPlayers();
for name, player in pairs(players) do
conquestUpdate(zone, player, updatetype, CONQUEST_BASE);
end
end;
function onZoneIn(player,prevZone)
local cs = -1;
if (player:getXPos() == 0 and player:getYPos() == 0 and player:getZPos() == 0) then
if (prevZone == 226) then
cs = 0x2712;
end
player:setPos(-4.000, -3.000, 14.000, 66);
end
return cs;
end;
function onTransportEvent(player,transport)
player:startEvent(10000);
end;
function onEventUpdate(player,csid,option)
end;
function onEventFinish(player,csid,option)
if (csid == 10000) then
player:setPos(0,0,0,0,226);
end
end; | gpl-3.0 |
kidaa/darkstar | scripts/zones/Korroloka_Tunnel/MobIDs.lua | 65 | 1094 | -----------------------------------
-- Area: Korroloka Tunnel (173)
-- Comments: -- posX, posY, posZ
-- (Taken from 'mob_spawn_points' table)
-----------------------------------
-- Cargo_Crab_Colin
Cargo_Crab_Colin=17485980;
Cargo_Crab_Colin_PH={
[17486002] = '1', -- -30.384, 1.000, -33.277
[17486095] = '1' -- -85.000, -0.500, -37.000
};
-- Dame_Blanche
Dame_Blanche=17486129;
Dame_Blanche_PH={
[17486128] = '1', -- -345.369, 0.716, 119.486
[17486127] = '1', -- -319.266, -0.244, 130.650
[17486126] = '1', -- -319.225, -0.146, 109.776
[17486124] = '1', -- -296.821, -3.207, 131.239
[17486125] = '1', -- -292.487, -5.993, 141.408
[17486119] = '1', -- -277.338, -9.352, 139.763
[17486118] = '1' -- -276.713, -9.954, 135.353
};
-- Falcatus_Aranei
Falcatus_Aranei=17486031;
Falcatus_Aranei_PH={
[17486033] = '1', -- -68.852, -5.029, 141.069
[17486032] = '1', -- -94.545, -6.095, 136.480
[17486034] = '1', -- -79.827, -6.046, 133.982
[17486027] = '1', -- -25.445, -6.073, 142.192
[17486028] = '1' -- -33.446, -6.038, 141.987
};
| gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.