Casting from graveyard

Working on a "you may cast _____ from your graveyard" ability (specifically for Skaab Ruinator). What I've come up with so far is basically to give the card a Flashback cost and then use a pre-triggered ability to prevent the exile from happening. It also checks to see if something else is going on while it's on the stack, so if someone casts something like Dissipate on it, it won't prevent that from exiling it. I just wanted to see if anyone had any ideas on whether that would cause other problems or if there is actually a better way to do it altogether. Here's the code:
- Code: Select all
<TRIGGERED_ABILITY internal="1" active_zone="ZONE_STACK">
<TRIGGER value="SPELL_PLAYED">
if Object():GetZone() == ZONE_STACK then
ObjectDC():Set_Int(0, 1)
end
return false
</TRIGGER>
</TRIGGERED_ABILITY>
<TRIGGERED_ABILITY internal="1" active_zone="ZONE_STACK">
<TRIGGER value="ABILITY_PLAYED">
if Object():GetZone() == ZONE_STACK then
ObjectDC():Set_Int(0, 1)
end
return false
</TRIGGER>
</TRIGGERED_ABILITY>
<TRIGGERED_ABILITY internal="1" active_zone="ZONE_STACK">
<TRIGGER value="SPELL_ABOUT_TO_RESOLVE" simple_qualifier="self">
if ObjectDC():Get_Int(0) == 1 then
ObjectDC():Set_Int(0, 0)
end
return false
</TRIGGER>
</TRIGGERED_ABILITY>
<TRIGGERED_ABILITY internal="1" pre_trigger="1" active_zone="ZONE_STACK">
<TRIGGER value="ZONECHANGE_CONSIDERED" simple_qualifier="self" to_zone="ZONE_REMOVED_FROM_GAME"
from_zone="ZONE_STACK">
return ObjectDC():Get_Int(0) ~= 1
</TRIGGER>
</TRIGGERED_ABILITY>