How can I make a hero to sell items?

fine93

New Member
Reaction score
0
Something like the spell book ability.
When my hero starts the ability all the items show up in his ability slots.
I also want to make the ability to have 4 levels. At first level 2 item; second level 3 items; third level 4 items; forth level 5 items. Like im opening a different page.
 

mapguy

New Member
Reaction score
46
you could create a unit with 0 visibility radius somewhere in the map, and when the hero uses his ability that unit is selected.
The unit works like the human/orc/elf/undead item shop, and when an item is bought from that unit you trigger something.

-you can select units even if you cant see them.
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
do something like this:
Trigger:
  • Item system
    • Events
      • A unit starts the effect of an ability
    • Conditions
      • Ability used is equal to (your "inventory" ability)
    • Actions
      • If Then Else
        • If (Conditions)
          • BooleanVariable is true
        • Then
          • Loop for each integer A from 1 to 6 do actions
            • Hashtable - Save item (Item in Slot Integer A for triggering unit) as (Key (Triggering unit)) of Integer A in Item_Hashtable (created at init or using another hashtable)
            • Hero - Give (Triggering unit) 1 (Hashtable - Load Item saved in (Key (Triggering unit)) of (Integer A + 6) in Item_Hashtable)
            • Set BoolVariable = False
          • Else
            • Hashtable - Save item (Item in Slot Integer A for triggering unit) as (Key (Triggering unit)) of (Integer A + 6) in Item_Hashtable (created at init or using another hashtable)
            • Hero - Give (Triggering unit) 1 (Hashtable - Load Item saved in (Key (Triggering unit)) of Integer A in Item_Hashtable)
            • Set BoolVariable = True


Trigger:
  • Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Item_Hashtable = Whatever hashtable you want it to be


Trigger:
  • Item Restrictions
    • Events
      • A unit learns an ability
    • Conditions
      • Ability Learned is equal to (your inventory ability)
    • Actions
      • Loop for each Integer A from 1 to 4 do actions
        • Hashtable - Save item (item type of an item that cant be removed and does nothing)


Trigger:
  • Lift Restrictions Per Level
    • Events
      • Hero - A unit increases the level of an ability
    • Conditions
    • Actions
      • If then else
        • BoolVariable is true (same variable from trigger 1)
      • Then
        • Hashtable - Save Item (no item) as (Key (Triggering unit) of (6 - Level of (Your Ability) for (Triggering unit)) in Item_Hashtable
      • Else
        • Hero - Remove Item in Slot (6 - Level of (Your Ability) for (Triggering unit)) in Item_Hashtable
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top