ok so im trying to make this spell that reflects targeted spells. heres what i have in my trigger so far:
so everything works except that last line. the order to cast the spell is different then the id of the spell, but i dont know what to use. becuase the order changes depending on what spell was cast on them. if the spell Firebolt was cast, then the order would be "firebolt" if frost nova was cast, then the order would be "frostnova" but i want this to work with all targetted spells. so i try to use the orderbyid function and just use the orderid of the spell... well too bad, that doesnt work. does anyone know of anyway to get the order field out of a spell?
Code:
Magic Mirror
Events
Unit - A unit Starts the effect of an ability
Conditions
((Target unit of ability being cast) has buff Magic Mirror (Anti-magic Shell (Extra))) Equal to True
Actions
Custom script: local unit caster = GetSpellTargetUnit()
Custom script: local location casterloc = GetUnitLoc( caster )
Custom script: local unit target = GetSpellAbilityUnit()
Custom script: local integer spellid = GetSpellAbilityId()
Custom script: local unit dummy
Custom script: local integer level = GetUnitAbilityLevelSwapped( spellid, target )
Custom script: set dummy = CreateUnitAtLoc( GetOwningPlayer( caster ), 'u000', casterloc, bj_UNIT_FACING )
Custom script: call UnitAddAbility( dummy, spellid )
Custom script: call SetUnitAbilityLevelSwapped( spellid, dummy, level )
Custom script: call IssueTargetOrderById( dummy, spellid, target )
so everything works except that last line. the order to cast the spell is different then the id of the spell, but i dont know what to use. becuase the order changes depending on what spell was cast on them. if the spell Firebolt was cast, then the order would be "firebolt" if frost nova was cast, then the order would be "frostnova" but i want this to work with all targetted spells. so i try to use the orderbyid function and just use the orderid of the spell... well too bad, that doesnt work. does anyone know of anyway to get the order field out of a spell?


