~How do I do this~

XxShadyxX

I abused the rep system.
Reaction score
81
Is there a way to do this:

A catalog goes like this:

Set Iteminteger = Iteminteger + 1
Set Item_Type[Iteminteger] = potion of healing
Set Item_Level[Iteminteger] = 1

Set Iteminteger = Iteminteger + 1
Set Item_Type[Iteminteger] = potion of mana
Set Item_Level[Iteminteger] = 1

Set Iteminteger = Iteminteger + 1
Set Item_Type[Iteminteger] = claws of atk +5
Set Item_Level[Iteminteger] = 8


And then when a unit of nuetral hostile dies i want a random item which the Item_Level is equal to this formula (HeroLevel)-5 to (HeroLevel)+3
so if its a level 8 hero a item which the Item_Level equals to from 3 - 11 randomly would be created.

So is there a way to make all the items that match the conditions into some sort of group where i can access and randomly pull out a item from that group and create it?
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
how about creating a dummy rect at some un-reachable position in your map creating all items inside (preplacing them as well to reduce ingame lagg) and using an action like this:
Trigger:
  • Item - Create (Item-type of (Random item in (Playable map area) matching ((Item level of (Matching item)) Equal to (Random integer number between ((Hero level of (Triggering unit)) - 5) and ((Hero level of (Triggering unit)) + 3))))) at (Center of (Playable map area))

p.s. i know it leaks but its just an example.
 

XxShadyxX

I abused the rep system.
Reaction score
81
Im not using the actual Object editor level for the items...
I am using a integer array....
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
why not using the actual object editor level for items... would make things much more easier.
 

XxShadyxX

I abused the rep system.
Reaction score
81
would it now? That means I have to go in there and edit ALL the levels of all the items....
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
harder as setting 3 variables for each item in trigger editor? i think setting the items level and preplacing it is much faster as triggering every item.
(of course preplacing items depends on how many items you have. more then 200 items will be hard to preplace)

Edit: instead of preplacing you can also do:
Trigger:
  • Set ItemLevel = (Random integer number between ((Hero level of (Triggering unit)) - 5) and ((Hero level of (Triggering unit)) + 3))
    • Item - Create (Random level ItemLevel item-type) at (Center of (Playable map area))

just remember to add an if/then/else in case of items below level 1.
 

XxShadyxX

I abused the rep system.
Reaction score
81
I don't preplacing really helps here...
Anyway I have to edit ALL the normal items too cuz i don't want to create them in the trigger. There are 273 standard items.... and probably alot more custom...
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top