• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Spell] 20% chance to summon a bear spell

Status
Not open for further replies.
Level 7
Joined
Aug 8, 2008
Messages
340
Hello fellow members of The Hive, I am trying to make a passive ability for my hero, which gives him a 20% chance to summon a bear on his auto-attacks. But for some reason Orb of Lightning won't work with the summon bear ability. What Am I to do?
 
Level 3
Joined
Feb 13, 2014
Messages
26
Maybe this would help

Im by any way an expert so this might not be the best way. But I got curious and made a system for that based on passive ability bash.

Is not based on an orb but might be helpfull for you.
 

Attachments

  • PassiveSummon.w3x
    17.1 KB · Views: 43
Level 7
Joined
Aug 8, 2008
Messages
340
Okay thanks for the replies guys. I've used the ideas of Hersonrock and Mapas. So far this is what I've got:
  • Events Unit - A unit Is attacked
  • Conditions
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Level of Summon Misha (Rexxar) for (Attacking unit)) Greater than 0
        • (Number of living Misha (Level 1) units owned by (Owner of (Attacking unit))) Less than or equal to 0
      • Then - Actions
        • Set TempInteger = (Random integer number between 1 and 100)
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • TempInteger Greater than or equal to 80
          • Then - Actions
            • Unit - Create 1 Misha (Level 1) for (Owner of (Attacking unit)) at (Position of (Attacking unit)) facing (Position of (Attacked unit))
            • Unit - Order (Last created unit) to Attack (Attacked unit)
          • Else - Actions
      • Else - Actions
This is working just the way I wanted it to, however for some reason Rexxar summons Misha on the first attack he lands every time. What is the problem causing this and is this trigger leaking?
Ps: I will of cause grant +Rep to all of you who helped me make this Ability once it's finished.
 
Level 5
Joined
Jan 27, 2014
Messages
164
> however for some reason...
Go to Terrain Editor > File > Preference > Test map > Uncheck: Fixed random seed.
Then again, don't worry, this fixed thing only happens during test map.
In a real game, it will be randomised naturally.

> is this trigger leaking?
Yeah.
Code:
 Set TempPoint1 = (Position of (Attacking unit))
 Set TempPoint2 = (Position of (Attacked unit))
 Unit - Create 1 Misha (Level 1) for (Owner of (Attacking unit)) at TempPoint1 facing TempPoint2 
 Unit - Order (Last created unit) to Attack (Attacked unit)
 Custom script:   call RemoveLocation (udg_TempPoint1)
 Custom script:   call RemoveLocation (udg_TempPoint2)

This should fix it.
On a related note, you could perhaps transfer your conditions into the primary condition.

  • Events
    • Unit - A unit Is attacked
  • Conditions
    • (Level of Summon Misha (Rexxar) for (Attacking unit)) Greater than 0
    • (Number of living Misha (Level 1) units owned by (Owner of (Attacking unit))) Less than or equal to 0
    • (Random integer number between 1 and 100) Greater than or equal to 80
  • Actions
    • Set TempPoint1 = (Position of (Attacking unit))
    • Set TempPoint2 = (Position of (Attacked unit))
    • Unit - Create 1 Misha (Level 1) for (Owner of (Attacking unit)) at TempPoint1 facing TempPoint2
    • Unit - Order (Last created unit) to Attack (Attacked unit)
    • Custom script: call RemoveLocation (udg_TempPoint1)
    • Custom script: call RemoveLocation (udg_TempPoint2)
 
Level 17
Joined
Jan 18, 2010
Messages
1,122
Also keep in mind attacking unit is unreliable, it triggers the moment the enemy unit starts attacking so it will trigger even if you give a different order cancelling the attack.
You may also want to make a check for whether the target is an enemy of your unit, otherwise it will trigger even with manual attacks towards friendly and passive units.
 
Level 7
Joined
Aug 8, 2008
Messages
340
Thanks vypur85, I've tried doing it the way you suggested, however Script Errors occure for both Custom script: call RemoveLocation (udg_TempPoint1) and Custom script: call RemoveLocation (udg_TempPoint2) (I've made the TempPoint variable a Point Arry (2) )
What gives?

Talavaj I am aware that there always is a better way, but I don't got the trigger skills for most of them. However if you got any ideas, I'm listening. All I wanted was for my hero to have a chance on hit, to summon a bear. Limited to one at the time, but without a timed lifetime.
 
Level 5
Joined
Jan 27, 2014
Messages
164
Means you did something wrong.
Create 2 point variables with the exact same name as I posted.
Otherwise, if you create your own set of variables, make sure you create the custom script according to your own desired name.

call RemoveLocation (udg_YOURVARIABLENAME)

Also, it's always good for you to post your said trigger when you encounter problems.
 
Level 7
Joined
Aug 8, 2008
Messages
340
I wrote it just the way you told me to, this is what I get:
 

Attachments

  • Problem.png
    Problem.png
    52.3 KB · Views: 72
Level 7
Joined
Aug 8, 2008
Messages
340
Ahh I see Thanks a ton. :) But if you diden't use Arrays, than how did you define TempPoint1 and 2? I am unable to pick any numbers, when it ain't an array.
 
Level 5
Joined
Jan 27, 2014
Messages
164
> I am unable to pick any numbers
Really? Impossible. You should be able to.
Then again, you cannot begin a variable name with a number though.
Other than that, it should be alright.
Not sure why yours can't though.
 
Level 7
Joined
Aug 8, 2008
Messages
340
Okay, well nvm. that. ;) Would I be able to use the arrays and temppoints for other spells or do they have to be exclisive to this ability in order to work?
 
Status
Not open for further replies.
Top