• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

passive mirror image

Status
Not open for further replies.
Level 5
Joined
Oct 30, 2007
Messages
91
well i made this ability but it only does it once, can any one tell me why?
illusion lvl
Events
Unit - A unit Learns a skill
Conditions
(Learned Hero Skill) Equal to [Z] Shed Skin
Actions
Set illusionlvl = (illusionlvl + 1)
Set illusionhero = (Learning Hero)

illusion attack
Events
Unit - A unit Is attacked
Conditions
(Unit-type of (Attacked unit)) Equal to Mesmyr
Actions
Set illusionchance = (Random integer number between 1 and 100)

illusion attacked
Events
Unit - A unit Is attacked
Conditions
And - All (Conditions) are true
Conditions
illusionlvl Equal to 1
(Unit-type of (Attacked unit)) Equal to Mesmyr
Or - Any (Conditions) are true
Conditions
illusionchance Equal to 1
illusionchance Equal to 2
illusionchance Equal to 3
illusionchance Equal to 4
Actions
Unit - Create 1 Peasant for Player 1 (Red) at (Position of illusionhero) facing Default building facing degrees
Set illusiondummy = (Last created unit)
Hero - Create Illusion shed skin and give it to illusiondummy
Set illusionitem = (Last created item)
Hero - Order illusiondummy to use illusionitem on illusionhero
Unit - Add a 1.00 second Generic expiration timer to illusiondummy
 
Level 13
Joined
May 11, 2008
Messages
1,198
well, you have two triggers that are very very similar. the last two. you should combine them. what you would do is put that second trigger's action at the begging of the third trigger's actions and then take away most of those conditions and put them in the actions via if then actions. also instead of using this as your level 1 and having more triggers for the other levels i suggest you take that random number between 1 and 100 and change the 100 to be subtracting a certain ammount depending on what level the ability is. then you'd only need one trigger for every level.

although in my opinion it's easier to add than subtract so if i were doing it the triggered chances would be at the top (integer equal to 97, 98, 99, 100 instead of 1, 2, 3, 4) but it's your trigger so that's not really advice just a little side point.

oh yeah one more thing i don't think it's a good idea to have a condition like it's equal to 1, 2, 3, 4 like 4 conditions like that you should make it say less than 5 instead or something like that so you only have one condition for all that.

let me show you a spell that i worked on i did all 3 levels in just one spell (actually an ultimate).

it's different from yours, but it includes those random numbers and stuff and it'll show you what i'm talking about for that so you'll have an example.

it might be hard to read since it's jass and that trigger of yours is in gui but you can probably just ignore the parts you don't understand.
JASS:
function Trig_DefendAndDeflect_Actions takes nothing returns nothing
local integer i
    if GetUnitAbilityLevelSwapped('A00V', GetTriggerUnit()) == 1 then
    set i =GetRandomInt(1,200)
    else
    if GetUnitAbilityLevelSwapped('A00V', GetTriggerUnit()) == 2 then
    set i =GetRandomInt(31,200)
    else
    if GetUnitAbilityLevelSwapped('A00V', GetTriggerUnit()) == 3 then
    set i =GetRandomInt(61,200)
    else
    return
    endif
    endif
    endif
    if i >= 191 then
    call UnitDamageTarget( GetTriggerUnit(), GetTriggerUnit(), (GetEventDamage() * -1.00), false, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_UNIVERSAL, WEAPON_TYPE_WHOKNOWS )
    else
    if i >= 181 and i < 191 then
    call UnitDamageTarget( GetTriggerUnit(), GetTriggerUnit(), (GetEventDamage() * -0.50), false, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_UNIVERSAL, WEAPON_TYPE_WHOKNOWS )
    else
    if i >= 171 and i < 181 then
    call UnitDamageTarget( GetTriggerUnit(), GetTriggerUnit(), (GetEventDamage() * -1.00), false, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_UNIVERSAL, WEAPON_TYPE_WHOKNOWS )
    call UnitDamageTarget( GetTriggerUnit(), GetEventDamageSource(), (GetEventDamage() * 1.00), false, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_UNIVERSAL, WEAPON_TYPE_WHOKNOWS )
    else
    if i >= 161 and i < 171 then
    call UnitDamageTarget( GetTriggerUnit(), GetTriggerUnit(), (GetEventDamage() * -1.00), false, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_UNIVERSAL, WEAPON_TYPE_WHOKNOWS )
    call UnitDamageTarget( GetTriggerUnit(), GetEventDamageSource(), (GetEventDamage() * 2.00), false, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_UNIVERSAL, WEAPON_TYPE_WHOKNOWS )
    else
    if i >= 151 and i < 161 then
    call UnitDamageTarget( GetTriggerUnit(), GetTriggerUnit(), (GetEventDamage() * -0.75), false, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_UNIVERSAL, WEAPON_TYPE_WHOKNOWS )
    call UnitDamageTarget( GetTriggerUnit(), GetEventDamageSource(), (GetEventDamage() * 3.00), false, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_UNIVERSAL, WEAPON_TYPE_WHOKNOWS )
    else
    if i >= 141 and i < 151 then
    call UnitDamageTarget( GetTriggerUnit(), GetTriggerUnit(), (GetEventDamage() * -1.00), false, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_UNIVERSAL, WEAPON_TYPE_WHOKNOWS )
    call UnitDamageTarget( GetTriggerUnit(), GetEventDamageSource(), (GetEventDamage() * 0.50), false, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_UNIVERSAL, WEAPON_TYPE_WHOKNOWS )
    else
    if i >= 131 and i < 141 then    
    call UnitDamageTarget( GetTriggerUnit(), GetTriggerUnit(), (GetEventDamage() * -0.50), false, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_UNIVERSAL, WEAPON_TYPE_WHOKNOWS )
    call UnitDamageTarget( GetTriggerUnit(), GetEventDamageSource(), (GetEventDamage() * 4.00), false, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_UNIVERSAL, WEAPON_TYPE_WHOKNOWS )
    else
    if i >= 121 and i < 131 then    
    call UnitDamageTarget( GetTriggerUnit(), GetTriggerUnit(), (GetEventDamage() * -0.25), false, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_UNIVERSAL, WEAPON_TYPE_WHOKNOWS )
    else    
    if i >= 111 and i < 121 then    
    call UnitDamageTarget( GetTriggerUnit(), GetTriggerUnit(), (GetEventDamage() * -0.75), false, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_UNIVERSAL, WEAPON_TYPE_WHOKNOWS )
    endif
    endif
    endif
    endif
    endif
    endif
    endif
    endif
    endif
endfunction

//===========================================================================
function InitTrig_DefendAndDeflect takes nothing returns nothing
    set gg_trg_DefendAndDeflect = CreateTrigger(  )
    call TriggerAddAction( gg_trg_DefendAndDeflect, function Trig_DefendAndDeflect_Actions )
endfunction

as you can see my passive is way different than most because it gives a chance to do 9 different things lol...obviously you probably don't need those other 8 if thens. it's actually based off of a passive that has a chance so it actually has a chance to do 10 different things though but obviously you can't see that in this trigger.

edit: actually now that i think about it if you do it less than 5 then 0 would also be less than five. so...you can't do that, better to make it greater than 96 after all.
 
Last edited:
Status
Not open for further replies.
Top