Certainly! Below is the Lua script for EDOPro and the effect text for the card "Dark Contract with the Overlord" (Card ID: 7777).
Effect Text:
Dark Contract with the Overlord
Quick-Play Spell Card
Effect:
Target 1 "D/D/D" Xyz Monster you control; Special Summon from your Extra Deck, 1 "D/D/D Duo-Dawn King Kali Yuga" by using that monster you control as material. (This is treated as an Xyz Summon. Transfer its materials to the Summoned monster.)
Lua Script (7777.lua):
--Dark Contract with the Overlord
--Scripted by [Your Name]
local s,id=GetID()
function s.initial_effect(c)
--Xyz Summon Kali Yuga
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0)) -- Description reference
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(s.xyztg)
e1:SetOperation(s.xyzop)
c:RegisterEffect(e1)
end
--Filter for "D/D/D" Xyz Monsters
function s.xyzfilter(c)
return c:IsFaceup() and c:IsSetCard(0xae) and c:IsType(TYPE_XYZ) -- 0xae is the set code for "D/D/D"
end
--Filter for "D/D/D Duo-Dawn King Kali Yuga"
function s.kaliyugafilter(c,e,tp)
return c:IsCode(41546) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false)
end
function s.xyztg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.xyzfilter(chkc) end
if chk==0 then
return Duel.GetLocationCountFromEx(tp)>0
and Duel.IsExistingTarget(s.xyzfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(s.kaliyugafilter,tp,LOCATION_EXTRA,0,1,nil,e,tp)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,s.xyzfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function s.xyzop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if not tc or not tc:IsRelateToEffect(e) or tc:IsFacedown() then return end
if Duel.GetLocationCountFromEx(tp)<=0 then return end
if not aux.MustMaterialCheck(tc,tp,EFFECT_MUST_BE_XMATERIAL) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=Duel.GetFirstMatchingCard(s.kaliyugafilter,tp,LOCATION_EXTRA,0,nil,e,tp)
if not sc then return end
local mg=tc:GetOverlayGroup()
if Duel.SpecialSummon(sc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)~=0 then
if mg:GetCount()>0 then
Duel.Overlay(sc,mg)
end
Duel.Overlay(sc,Group.FromCards(tc))
sc:CompleteProcedure()
end
end
Notes:
- The script defines the effect of "Dark Contract with the Overlord" as per your description.
- It targets a face-up "D/D/D" Xyz Monster you control and Special Summons "D/D/D Duo-Dawn King Kali Yuga" from your Extra Deck by using the targeted monster as material.
- The materials attached to the targeted monster are transferred to "Kali Yuga".
- The card ID
7777 is used consistently throughout the script.
Important: Replace [Your Name] with your actual name or username if you wish to credit yourself in the script.
How to Use:
-
Save the Script:
- Create a new file named
7777.lua.
- Copy and paste the Lua script into this file.
-
Add the Card Data:
- In your card database (usually
cards.cdb), add a new entry for "Dark Contract with the Overlord".
- Ensure the following fields are set:
- ID:
7777
- Name:
Dark Contract with the Overlord
- Card Type: Spell Card
- Property: Quick-Play
- Effect Text: (Use the effect text provided above)
- Other relevant fields: Set as appropriate for a Spell Card.
-
Assign the Script:
- Ensure that the ID in the script (
7777) matches the ID in your card database.
- Place the
7777.lua script file in the appropriate script directory for EDOPro.
Testing:
- After adding the card and script, start EDOPro and test the card in a duel.
- Make sure to include "D/D/D" Xyz Monsters and "D/D/D Duo-Dawn King Kali Yuga" in your Deck/Extra Deck for testing.
- Verify that the effect functions correctly:
- You can activate "Dark Contract with the Overlord" during either player's turn if set.
- You can target a face-up "D/D/D" Xyz Monster you control.
- You successfully Special Summon "D/D/D Duo-Dawn King Kali Yuga" by using the targeted monster as material.
- The materials from the targeted monster are transferred to "Kali Yuga".
Disclaimer:
- Ensure that the card codes (
41546 for "D/D/D Duo-Dawn King Kali Yuga") are correct according to your card database.
- If the card code for "Kali Yuga" differs in your database, update it in the script accordingly.
Feel free to adjust any part of the script or effect text to better suit your specific requirements or to match any updates in the game mechanics.