HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Adding triggers to items.

03-01-2003, 11:25 AM#1
Tapek
Basically I have an item, called Mystery Brew. When used, it randomly;

- Gives the hero Bloodlust and Unholy Frenzy (95% chance)

or

- Kills the hero instantly(5% chance)

Any ideas on how to implement this?
03-01-2003, 01:49 PM#2
rwxr-xr-x
You will have to fake the precentage chance, which is easy to do. The following example assumes that your item has the unit abilities of Bloodlust and Unholy Frenzy.

EVENTS
Unit - A unit owned by Player 1 Uses an item
<continue for all players>
CONDITIONS
(Item-type of (Item being manipulated)) Equal to Mystery Brew
ACTIONS
If ((Random integer number between 1 and 100) Greater than 95) then do (Unit - Kill (Triggering unit)) else do (Do nothing)

In this case, whenever a hero uses said item, a random number is generated between 1 and 100. To give the 5% chance to kill the unit, a check is done with a randomly generated number to see if it is greater than 95. If it is, the unit is killed, otherwise it does nothing, and the buffs that the item contains are applied. You could also reverse it if you like and check to see if the random number is less than 6.
03-02-2003, 10:51 AM#3
Guest
You can also make the item summon something, and remove it instantly with a unit summoned trigger: Then just add the percentages and both effects to the trigger.
03-03-2003, 08:19 AM#4
Tapek
Thanks for that; I'll test it on the weekend. :)
03-04-2003, 10:26 AM#5
Tapek
I've had this problem before.

The event "When unit uses item" Doesn't work.

I had a similar problem where the event "unit aquires an item" didnt work and I fixed it by adding a short Wait command in as the first action. Would this fix the 'uses item' as well?

Sorry but I cant afford to run multiple tests for the trigger since the map is so large and files need to be added via WINMPQ every time I want to test.
03-04-2003, 10:56 AM#6
Fragmentation
wait makes alot of stuff work that usually dont work

i had a trigger where i had to kill all infernals that entered playable map area, i tried wait .50 etc. but the damage the comet does doesnt implement until the infernal actually appears so i had to wait for 1 second so the infernal appears immediately dies and the dmg is dealt

though i was trying .25 and .50 etc. so i could see if i can kill or remove the infernal before it spawns to show that there is only a comet, woulda been cool