• 🏆 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!

[JASS] No random item is created

Status
Not open for further replies.
Level 25
Joined
Feb 2, 2006
Messages
1,695
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 25
Joined
Feb 2, 2006
Messages
1,695
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 39
Joined
Feb 27, 2007
Messages
5,031
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