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

[JASS] No random item is created

Status
Not open for further replies.
Level 28
Joined
Feb 2, 2006
Messages
1,631
Hi,
I have multiple custom spells which should spawn random items but no item is created:
JASS:
call UnitAddItemByIdSwapped( ChooseRandomItemBJ(1), GetTriggerUnit() )

This is the code converted from a GUI trigger.
Why is not item created? There should be at least one random item type with level 1 right?
It does not work for other levels either.
I have disabled "Include into Random Choice" for some item types but not all and not too many.
 
Level 28
Joined
Feb 2, 2006
Messages
1,631
Yes I am aware and for example tomes I have disabled the "Include into Random Choice" so maybe no item types are left to be included?
Should I use a different function? Which one uses the classified level which seems to be better?

edit:
Found it. I will try this one now:

JASS:
ChooseRandomItemExBJ(1, ITEM_TYPE_ANY)
 
Level 45
Joined
Feb 27, 2007
Messages
5,578
If you want control over randomized item drops, I suggest you learn how to use ItemPools. JASS-only but not hard to work with and very useful.
 
Status
Not open for further replies.
Top