Percentage Trigger Help

For fulfilled maps that most likely don't work on the latest patch (1.24 or later).

Moderator: Cheaters

User avatar
Masterstitch
Senior Member
Posts: 173
Joined: December 14th, 2007, 9:56 am
Title: Naruto Addict

Percentage Trigger Help

Post by Masterstitch »

i am trying to make a trigger like the one for Sniper's ability in Enfo's Team Survival that gives a percent chance each attack to instantly kill the attacked unit and i need help please
User avatar
Xantan
Honorary wc3edit.net Traitor
Posts: 2507
Joined: February 1st, 2007, 4:11 pm
Location: NEVADA

Re: Percentage Trigger Help

Post by Xantan »

blalablablal

make custom ability based on crit strike

1% or less or so, for first level, then increase as you go

instantly do 9999999999x normal damage to unit

etcetc ;-)
Arabidnun
Forum Staff
Posts: 506
Joined: August 5th, 2007, 1:38 pm
Title: Gui Expert
Location: *Unknown*

Re: Percentage Trigger Help

Post by Arabidnun »

Yah, I mean this one has to be commen sense...

Just copy the critical strike from Object editor, and edit the damage multiplier to 99999999 and the % chance...This will be in decimal form. So instead of 100% chance, it will be 1.00, which = 100% for you kiddies out there =D. Just change this to .01 or less...if you can.

Xantan??? Why did you get demoted....Again?
User avatar
Masterstitch
Senior Member
Posts: 173
Joined: December 14th, 2007, 9:56 am
Title: Naruto Addict

Re: Percentage Trigger Help

Post by Masterstitch »

i wanted it in Trigger form because i don't want the stupid number displayed above your hero's head in red i want to play a sound instead
Arabidnun
Forum Staff
Posts: 506
Joined: August 5th, 2007, 1:38 pm
Title: Gui Expert
Location: *Unknown*

Re: Percentage Trigger Help

Post by Arabidnun »

Code: Select all

One Hit Kill
    Events
        Unit - A unit Is attacked
    Conditions
    Actions
        Set Integer = (Random integer number between 1 and 100)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Integer Equal to 43
            Then - Actions
                Unit - Kill (Attacking unit)
                Game - Display to (All players) the text: HEADSHOT!!!
            Else - Actions
Blah blah blah, there you go. lol
User avatar
Masterstitch
Senior Member
Posts: 173
Joined: December 14th, 2007, 9:56 am
Title: Naruto Addict

Re: Percentage Trigger Help

Post by Masterstitch »

there are 2 things bothering me about that trigger
1) i was talking about the attacker killing his target in 1 hit and it looks like some parts are diff than should be
2) how in the name of god do i set the percentage to what i want?
Arabidnun
Forum Staff
Posts: 506
Joined: August 5th, 2007, 1:38 pm
Title: Gui Expert
Location: *Unknown*

Re: Percentage Trigger Help

Post by Arabidnun »

Don't we know basic Mathmatics? Number/Out of Whole = %....
-Like 5/10 is, thats right kiddies 50%!!
-So if you want a percentage...Do some basic mathmatics....

Solution #2!

Unit - Kill (Attacked unit)

That was hard =D
User avatar
Masterstitch
Senior Member
Posts: 173
Joined: December 14th, 2007, 9:56 am
Title: Naruto Addict

Re: Percentage Trigger Help

Post by Masterstitch »

i know basic mathematics what i dont know is what frickin numbers i change to make the percentage what i want
User avatar
Senethior459
Forum Staff
Posts: 2618
Joined: June 2nd, 2007, 6:53 pm
Title: I Just Lost the Game

Re: Percentage Trigger Help

Post by Senethior459 »

Well, since it chooses a random number between 1 and 100, then I would try setting that thing that checks for a certain number to a range of numbers, to get the right percent. Currently, it only does it if it's 43. That's 1 number out of 100 possibilities, so it's one percent. Set the 43 to a range of numbers. The more numbers you cover, the higher the chance of it happening.
My Warcraft III Tool Collection
If you want to chat/game with me:
Blizzard: Senethior459#1962
Discord: Kyle#7409
Steam: Spacekidkyle
Arabidnun
Forum Staff
Posts: 506
Joined: August 5th, 2007, 1:38 pm
Title: Gui Expert
Location: *Unknown*

Re: Percentage Trigger Help

Post by Arabidnun »

Code: Select all

Headshot Trigger
    Events
        Unit - A unit Is attacked
    Conditions
    Actions
        Set Integer = (Random integer number between 1 and 100)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Or - Any (Conditions) are true
                    Conditions
                        Integer Equal to 1
                        Integer Equal to 2
                        Integer Equal to 3
                        Integer Equal to 4
                        Integer Equal to 5
            Then - Actions
                Unit - Kill (Attacked unit)
                Game - Display to (All players) the text: (Player_Names[(Player number of (Owner of (Attacking unit)))] + (Has HeadShot  + Player_Colors[(Player number of (Owner of (Attacked unit)))]))
            Else - Actions

Code: Select all

            If - Conditions
                Or - Any (Conditions) are true
                    Conditions
                        Integer Equal to 1
                        Integer Equal to 2
                        Integer Equal to 3
                        Integer Equal to 4
                        Integer Equal to 5
YOu see this trigger? The more Integer Equal to (##) you add, the more %'age you have to kill the Attacking Unit. So if you have 10 of those conditions, you have a 10/100 chance to kill the Attacking Unit, or a 10% chance, GOt it now?