Allez dans le dossier script. Créer un bloc-notes ou on écrit la fonctonnalité de la carte ( un algorithme apparement ) et on l'enregistre puis on modifie l'extension en .lua
http://www.ygopro.co/tabid/95/g/posts/t/281/YGOPro-Card-Editor.aspx#post1132
pour coder tu fait un bloc-notes que tu re-name en .lua c'est comme .bat ou .txt un simple extension
une fois votre carte fini il faut lui créé un script
l'id de votre carte sera par exemple 806000104 ( dans card manager)
ensuite pour un effet ou un ruling il faut lui créé un script
exemple
--??????
function c806000104.initial_effect(c)
--damage
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCategory(CATEGORY_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c806000104.damtg)
e1:SetOperation(c806000104.damop)
c:RegisterEffect(e1)
end
function c806000104.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(7999)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,7999)
end
function c806000104.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)
end
cet effet dit que c'est une carte magie normal qui inflige 7999 dommages a l'adversaire
le fichier script s'appellerais c806000104 ( bref c suivi de l'id de votre carte)
ensuite rennomé se fichier script que vous avez créé avec bloc note en .lua sa donnera donc c806000104.lua
ensuite voilà vous pouvez jouer votre carte et son effet
--????
function c806000105.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c806000105.target)
e1:SetOperation(c806000105.activate)
c:RegisterEffect(e1)
end
function c806000105.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,25) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(25)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,25)
end
function c806000105.activate(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
celle si est pour une carte magie normal qui fait piocher 25 cartes
--????? ??????
function c806000103.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1)
c:EnableReviveLimit()
--remove
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(806000103,0))
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(c806000103.remcon)
e1:SetTarget(c806000103.remtg)
e1:SetOperation(c806000103.remop)
c:RegisterEffect(e1)
end
function c806000103.remcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSummonType()==SUMMON_TYPE_SYNCHRO
end
function c806000103.remtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,0x1e,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,0,0x1e)
end
function c806000103.remop(e,tp,eg,ep,ev,re,r,rp)
local g1=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,nil)
local g2=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,nil)
local g3=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_HAND,nil)
local sg=Group.CreateGroup()
if g1:GetCount()>0 and ((g2:GetCount()==0 and g3:GetCount()==0) or Duel.SelectYesNo(tp,aux.Stringid(806000103,1))) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg1=g1:Select(tp,1,1,nil)
Duel.HintSelection(sg1)
sg:Merge(sg1)
end
if g2:GetCount()>0 and ((sg:GetCount()==0 and g3:GetCount()==0) or Duel.SelectYesNo(tp,aux.Stringid(806000103,2))) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg2=g2:Select(tp,1,1,nil)
Duel.HintSelection(sg2)
sg:Merge(sg2)
end
if g3:GetCount()>0 and (sg:GetCount()==0 or Duel.SelectYesNo(tp,aux.Stringid(806000103,3))) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg3=g3:RandomSelect(tp,1)
sg:Merge(sg3)
end
Duel.Remove(sg,POS_FACEUP,REASON_EFFECT)
end
celle ci pour un monstre synchro 8 ( 1 tuner +1 non tuner (ou plus) )
qui a le même effet que trishula ( ban 1 du terrain 1 du grave et 1 de la main)
ce qui est en gras est important c'est l'effet
on pourrait mettre
local g1=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,nil,10)
local g2=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,nil,10)
local g3=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_HAND,nil,10
afin qu'il retire 10 de chaque zone
dans le code si il n'y a aucun nombre cela veut dire que sa fait 1 ^^ donc rajouter une virgule et un nombre a la suite de "nil" permet d'agrandire l'effet
mais attention si vous faite sa l'effet demandera donc avoir 10 carte en main 10 sur le terrain et 10 au cimetière ( j'ai du mal avec les variables pour l'instant ^^)
voilà un petit screen de ce qu'il faut mettre quand vous créé votre carte
utilisé cardmaker pour créé le skin de la carte avant
bon maintenant pour un xyz
--No.82 ????????
function c31437713.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,aux.XyzFilterFunction(c,4),2)
c:EnableReviveLimit()
--cannot be battle target
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_CANNOT_BE_BATTLE_TARGET)
e1:SetCondition(c31437713.atkcon)
e1:SetValue(1)
c:RegisterEffect(e1)
--direct
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(31437713,0))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c31437713.condition)
e2:SetCost(c31437713.cost)
e2:SetOperation(c31437713.operation)
c:RegisterEffect(e2)
end
c31437713.xyz_number=82
function c31437713.filter(c)
return c:IsFaceup() and c:IsType(TYPE_SPELL)
end
function c31437713.atkcon(e)
return Duel.IsExistingMatchingCard(c31437713.filter,e:GetHandlerPlayer(),LOCATION_ONFIELD,0,1,nil)
end
function c31437713.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 and Duel.GetTurnCount()~=1
and not e:GetHandler():IsHasEffect(EFFECT_DIRECT_ATTACK)
end
function c31437713.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)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetProperty(EFFECT_FLAG_OATH)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(c31437713.ftarget)
e1:SetLabel(e:GetHandler():GetFieldID())
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c31437713.ftarget(e,c)
return e:GetLabel()~=c:GetFieldID()
end
function c31437713.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DIRECT_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
j'ai copié le numéro 82 hearltand draco
oublie pas de change rpatotut dans l'effet ou c'est marqué c31437713 par le numéro id de ta carte ( un numéro id qui est pas encore utilisé)
|