Jump to content
  • 0

Can someone please help me script this card? EDOPro Discord is unhelpful


itachi00XK9

Question

Before you guys go ahead and tell me to go to the EDOPro server, I've tried multiple times to ask for assistance and they either always ignore me or are "too busy helping someone else".  And this has been going on for about a week and a half now.  The only thing I need help with is this card c6850209.  Instead of the Level 8 or higher monster 'going to the graveyard' I want it to be destroyed and the effect proc from that.  That's it. 

--デーモンとの駆け引き
local s,id=GetID()
function s.initial_effect(c)
    --Activate
    local e1=Effect.CreateEffect(c)
    e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
    e1:SetType(EFFECT_TYPE_ACTIVATE)
    e1:SetCode(EVENT_FREE_CHAIN)
    e1:SetTarget(s.target)
    e1:SetOperation(s.activate)
    c:RegisterEffect(e1)
    aux.GlobalCheck(s,function()
        s[0]=false
        s[1]=false
        local ge1=Effect.CreateEffect(c)
        ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
        ge1:SetCode(EVENT_TO_GRAVE)
        ge1:SetOperation(s.checkop)
        Duel.RegisterEffect(ge1,0)
        aux.AddValuesReset(function()
            s[0]=false
            s[1]=false
        end)
    end)
end
s.listed_names={85605684}
function s.checkop(e,tp,eg,ep,ev,re,r,rp)
    local tc=eg:GetFirst()
    for tc in aux.Next(eg) do
        if tc:IsLevelAbove(8) and tc:IsPreviousLocation(LOCATION_MZONE) then
            s[tc:GetPreviousControler()]=true
        end
    end
end
function s.filter(c,e,tp)
    return c:IsCode(85605684) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
    if chk==0 then return s[tp] and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and
        Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK+LOCATION_HAND,0,1,nil,e,tp) end
    Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_HAND)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
    if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
    Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
    local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK+LOCATION_HAND,0,1,1,nil,e,tp)
    if #g>0 then
        Duel.SpecialSummon(g,0,tp,tp,true,false,POS_FACEUP)
    end
end
 

c6850209.lua

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...