Page 1 of 1

Necromaster Dragon (EDIT: Fixed, working code inside)

PostPosted: 14 Apr 2015, 20:57
by Chakan
Hi everyone, I'm hoping someone can help me get the coding for this card right because I've been trying to get it to work for a long time now, and I've tried everything I could think of to get this card working properly, but I just can't get it going. If anyone has any idea at all, please let me know because I've been going crazy over this thing. Below is my current code that doesn't work.

Code: Select all
  <TRIGGERED_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Whenever Necromaster Dragon deals combat damage to a player, you may pay {2}. If you do, put a 2/2 black zombie creature token onto the battlefield and each opponent puts the top two cards of his or her library into his or her graveyard.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Whenever Necromaster Dragon deals combat damage to a player, you may pay {2}. If you do, put a 2/2 black zombie creature token onto the battlefield and each opponent puts the top two cards of his or her library into his or her graveyard.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Whenever Necromaster Dragon deals combat damage to a player, you may pay {2}. If you do, put a 2/2 black zombie creature token onto the battlefield and each opponent puts the top two cards of his or her library into his or her graveyard.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Whenever Necromaster Dragon deals combat damage to a player, you may pay {2}. If you do, put a 2/2 black zombie creature token onto the battlefield and each opponent puts the top two cards of his or her library into his or her graveyard.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Whenever Necromaster Dragon deals combat damage to a player, you may pay {2}. If you do, put a 2/2 black zombie creature token onto the battlefield and each opponent puts the top two cards of his or her library into his or her graveyard.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Whenever Necromaster Dragon deals combat damage to a player, you may pay {2}. If you do, put a 2/2 black zombie creature token onto the battlefield and each opponent puts the top two cards of his or her library into his or her graveyard.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Whenever Necromaster Dragon deals combat damage to a player, you may pay {2}. If you do, put a 2/2 black zombie creature token onto the battlefield and each opponent puts the top two cards of his or her library into his or her graveyard.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Whenever Necromaster Dragon deals combat damage to a player, you may pay {2}. If you do, put a 2/2 black zombie creature token onto the battlefield and each opponent puts the top two cards of his or her library into his or her graveyard.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Whenever Necromaster Dragon deals combat damage to a player, you may pay {2}. If you do, put a 2/2 black zombie creature token onto the battlefield and each opponent puts the top two cards of his or her library into his or her graveyard.]]></LOCALISED_TEXT>
    <TRIGGER value="SOURCE_DEALS_DAMAGE_TO_PLAYER" simple_qualifier="self" damage_type="combat" />
      <RESOLUTION_TIME_ACTION>
    local player = EffectController()
    if player ~= nil then
      if player:CanPayManaCost("{2}") then
          player:BeginNewMultipleChoice()
         player:AddMultipleChoiceAnswer( "UI_CONDITIONAL_QUESTION_NO" )
         player:AddMultipleChoiceAnswer( "UI_CONDITIONAL_QUESTION_YES" )
         player:AskMultipleChoiceQuestion( "OPTIONAL_ABILITY_QUESTION" )
      end
    end
  </RESOLUTION_TIME_ACTION>
      <RESOLUTION_TIME_ACTION>
    local player = EffectController()
    if player ~= nil then
       local result = player:GetMultipleChoiceResult()
       if result == 1 then
          player:PayManaCost("{2}")
     for i = 0, (1-1) do
              MTG():PutTokensOntoBattlefield( "TOKEN_ZOMBIE_2_2_B_33088177", 1, EffectController() )
          end
      if EffectSource() ~= nil then
       for i=0,MTG():GetNumberOfPlayers()-1 do
         local player = MTG():GetNthPlayer(i)
         if player ~= nil then
           if player:GetTeam() ~= EffectController():GetTeam() then
             player:MillCards( 1 )
      end
    end
</RESOLUTION_TIME_ACTION>
   </TRIGGERED_ABILITY>
Nevermind everyone! I got it working now. Here is the working code for anyone who was wondering.

Code: Select all
  <TRIGGERED_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Whenever Necromaster Dragon deals combat damage to a player, you may pay {2}. If you do, put a 2/2 black zombie creature token onto the battlefield and each opponent puts the top two cards of his or her library into his or her graveyard.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Whenever Necromaster Dragon deals combat damage to a player, you may pay {2}. If you do, put a 2/2 black zombie creature token onto the battlefield and each opponent puts the top two cards of his or her library into his or her graveyard.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Whenever Necromaster Dragon deals combat damage to a player, you may pay {2}. If you do, put a 2/2 black zombie creature token onto the battlefield and each opponent puts the top two cards of his or her library into his or her graveyard.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Whenever Necromaster Dragon deals combat damage to a player, you may pay {2}. If you do, put a 2/2 black zombie creature token onto the battlefield and each opponent puts the top two cards of his or her library into his or her graveyard.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Whenever Necromaster Dragon deals combat damage to a player, you may pay {2}. If you do, put a 2/2 black zombie creature token onto the battlefield and each opponent puts the top two cards of his or her library into his or her graveyard.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Whenever Necromaster Dragon deals combat damage to a player, you may pay {2}. If you do, put a 2/2 black zombie creature token onto the battlefield and each opponent puts the top two cards of his or her library into his or her graveyard.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Whenever Necromaster Dragon deals combat damage to a player, you may pay {2}. If you do, put a 2/2 black zombie creature token onto the battlefield and each opponent puts the top two cards of his or her library into his or her graveyard.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Whenever Necromaster Dragon deals combat damage to a player, you may pay {2}. If you do, put a 2/2 black zombie creature token onto the battlefield and each opponent puts the top two cards of his or her library into his or her graveyard.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Whenever Necromaster Dragon deals combat damage to a player, you may pay {2}. If you do, put a 2/2 black zombie creature token onto the battlefield and each opponent puts the top two cards of his or her library into his or her graveyard.]]></LOCALISED_TEXT>
    <TRIGGER value="SOURCE_DEALS_DAMAGE_TO_PLAYER" simple_qualifier="self" damage_type="combat" />
      <RESOLUTION_TIME_ACTION>
         local controller = EffectController()
         if controller ~= nil and controller:CanPayManaCost("{2}") then
            controller:BeginNewMultipleChoice()
               controller:AddMultipleChoiceAnswer( "UI_CONDITIONAL_QUESTION_YES", controller:CanPayManaCost("{2}") )
               controller:AddMultipleChoiceAnswer("UI_CONDITIONAL_QUESTION_NO")
            controller:AskMultipleChoiceQuestion( "OPTIONAL_ABILITY_QUESTION", Object() )
         end
      </RESOLUTION_TIME_ACTION>
      <RESOLUTION_TIME_ACTION>
         local controller = EffectController()
         if controller ~= nil and controller:CanPayManaCost("{2}") and controller:GetMultipleChoiceResult() == 0 then
            controller:PayManaCost("{2}")
            MTG():PutTokensOntoBattlefield( "TOKEN_ZOMBIE_2_2_B_33088177", 1, EffectController() )
    for i=0,MTG():GetNumberOfPlayers()-1 do
       local player = MTG():GetNthPlayer(i)
       if player ~= nil then
          if player:GetTeam() ~= EffectController():GetTeam() then
           player:MillCards( 2 )
          end
       end
    end
         end
      </RESOLUTION_TIME_ACTION>
   </TRIGGERED_ABILITY>