• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

How do i make a Random item Trigger??

Status
Not open for further replies.
Level 3
Joined
Sep 29, 2005
Messages
39
Hi
i need some help ok. i need a trigger for making random items. ok is like this.ok i need a trigger that shows how to make a random item just like the diablo2 horadric cube, but i want is differnt, is when it combines, it has differnt kind of items. okok is liek this i have 2 items i combine them they give me a new 1 item.again i have 2 same kind of items i combine them they give me a differnt new items. thats wat i want jsut the trigger also give me the varibles .
 
Level 9
Joined
Jun 28, 2005
Messages
633
its easy all you do in the map editor is click on object propitiers (this little gray box) and somewere it says about having item groups i dont exactly understand variable triggers so i cant realy help there
 
Level 3
Joined
Sep 29, 2005
Messages
39
err i mean not clicking on the random items i want it to be clicked as an icon, is not u place the random items on the editor then click on the random item then select wat u want, not that meaning. i want is click on icon then it gives me a random item
 
Level 16
Joined
Oct 30, 2004
Messages
1,277
Well i'll just say that,ok, the reason why,ok, i didnt answer ur original post,ok, is because,ok, it pissed the hell out of me,ok?

Good that u dropped that out of ur future posts, i guess i can help u now :)

First of all u need to do a item type variable. Check the box "array" and put there a number on how many items u want to include in the random items. Name it for example: "randomitem"

After u have done that, set a trigger that goes like this:

Event - Map inizialation
Condition - None
Actions:
-Set variable "randomitem [1]" = "item type of what u want to be in the random item selection"
-Set variable "randomitem [2]" = "item type of what u want to be in the random item selection"
-Set variable "randomitem [3]" = "item type of what u want to be in the random item selection"
-Set variable "randomitem [4]" = "item type of what u want to be in the random item selection"

And so on and so on setting as many items as u want, remember that the limit is on what array number u put for the variable. You can always change it.
Okay, then u make another trigger, u say u want it to give u random item when u click on an icon. Do u mean a skill u use? Or u could buy this from a shop? I shall presume its something u buy from a shop and not a skill u use. Now comes choises, there are more than one way to go from here, i'll tell u one way; make a fake item, base it on a book. Remove all the benifits the book gives, so it will give nothing when used. Then make a trigger like this:

Event - Unit accuires an item
Condition - Item type equal to "fakebookitem"
Actions:
-create "randomitem [random number between 1 to 4]" and give it to "unit manipulating item"

The random number should be between how many arrays u configured in the first trigger. I configured in the example only 4 items, so i put it between 1 and 4. And there u have it, hope this helped.
 
Status
Not open for further replies.
Top