• 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.

[Trigger] spell target help

Status
Not open for further replies.
Level 3
Joined
Aug 20, 2008
Messages
40
i made ability that has a chance on attack to increase attack speed...
but i found little bug with it created dummy cast spell on random target...
dummy - dummy that cast skill
Shm - hero that learned ability
ability has 16lvl
chance is 5-35%
attack speed increase by 30%
ability learn
  • aspd skill learn
  • Event
    • Unit - A unit learns skill
  • Conditions
    • (Learned hero skill) equal to aspd
    • (Unit-type of (Learning hero)) equal to Shm
  • Actions
    • Set aspdhero = (Learning hero)
    • Set aspdchance = (3+(2x(Real(Level of aspd for aspdhero))))
ability cast
  • aspd skill cast
  • Events
    • Unit - A unit is attacked
  • Conditions
    • (Unit-type of (Attacking unit)) equal to Shm
  • Actions
    • If (All conditions are True) then do (Then actions) else do (Else actions)
      • If - conditions
        • (Random integer number between 1 and 100) less than or equal to (Integer(aspdchance))
      • Then - actions
        • Unit - create 1 dummy for player 11(Dark green) at (Position of aspdhero) facing (Position of aspdhero)
        • Set dummyaspd = (Last created unit)
        • Unit - add aspdskill to dummyaspd
        • Unit - order dummyaspd to Orc shaman - Bloodlust aspdhero
        • Wait 0.01 seconds
        • Unit - remove dummyaspd from the game
      • Else - actions
        • Do nothing
help me to find why dummy casts spell on other target and how to fix that...
 
Level 3
Joined
Aug 20, 2008
Messages
40
Try to remove dummies and use abilities. Like you don't create a dummy to cast a spell, but you give a ability to the hero(like gloves of haste"item") than you can easy modify levels of that ability, and the unit can't be random.
See the point? You don't use any dummies.

so better will add ability to hero at same time interval that spell duration?
 
Level 5
Joined
May 27, 2007
Messages
144
first of all do the the spell in one trigger and optional add in object editor skill, you're addig to the dummy unit. If you donno how tell me i will made it for you! Also wait 0.01 it not enough time. I always set it to 1 sec and the cd of the ability to 2 sec. Also if this is for hero. Set the target of the ability to heroes and player-units. So the dummy can cast it only on your hero
 
Level 12
Joined
Jun 28, 2008
Messages
688
Using the [wait] action messes up alot of things, so to clean up my dummies I always just use the action [Unit - Add Expiration Timer] and make it a 2.00 second generic expiration timer after every dummy that is created, that way I can have multiple dummies at once without having to clean up with variables. This is obviously not the source of your problem, but if your ability is cast multiple times in a row, you will start piling up dummies and it will slow down the game.
 
Level 3
Joined
Aug 20, 2008
Messages
40
first of all do the the spell in one trigger and optional add in object editor skill, you're addig to the dummy unit. If you donno how tell me i will made it for you! Also wait 0.01 it not enough time. I always set it to 1 sec and the cd of the ability to 2 sec. Also if this is for hero. Set the target of the ability to heroes and player-units. So the dummy can cast it only on your hero

i already made it in 1 trigger
before dummy will removed he cast need spell so i think 0.01 sec enough
this skill for my rpg and there will 10 player
now i make all test with all hero classes which is 13 (12+1highclass)
and when the trigger chance works is the hero with ability alone dummy cast on then if he near with other heroes dummy why begin cast spell on random hero and i dont know why is happened
 
Level 3
Joined
Aug 20, 2008
Messages
40
Using the [wait] action messes up alot of things, so to clean up my dummies I always just use the action [Unit - Add Expiration Timer] and make it a 2.00 second generic expiration timer after every dummy that is created, that way I can have multiple dummies at once without having to clean up with variables. This is obviously not the source of your problem, but if your ability is cast multiple times in a row, you will start piling up dummies and it will slow down the game.

ability cast at ones but not on the hero with needed ability
 
Status
Not open for further replies.
Top