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

[Trigger] Hero level requirement for items

Status
Not open for further replies.
Level 2
Joined
Apr 30, 2009
Messages
8
I'm just working on something and I was wondering how exactly you could create a trigger that would allow for a hero level requirement for an item. For example, you need to have a hero level 5 to wield a specific sword. Thanks if you can help.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,199
Hard and unefficent way is to use multiple selection appon picking the item up. Using if statments and stuff you get the item type and its level needed and if the hero is too low then you simply drop or remove the item.

The easy way is to make a jass database system that from the item type ID you can get the position of the corosponding stats for that item from an array system, of which one could be level required. This method also lets you build more functionality onto items as with the same system you could make it that only one type of item can by carried at a time by giving each item a type number and checking if a hero has 2 items with the same type number.
 
Level 3
Joined
May 15, 2007
Messages
20
Hey m8 i got a Quite a Simple way to do it But it Requiers a Trigger for each Item

Events
Unit - A unit Acquires an item

Conditions
(Item-type of (Item carried by (Hero manipulating item) of type Spike Helmet)) Equal to Spike Helmet

Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Hero level of (Hero manipulating item)) Less than 3 "(the hero level requierd)"
Then - Actions
Hero - Drop (Item being manipulated) from (Hero manipulating item)
Else - Actions
"(Empty)"


You just have to Copy The trigger On Each Item And Change the " level Number " And the items on the conditions Both Items To the same Choosen item.

Hope it Helps... =) any Questions Pm me
 
Level 6
Joined
May 1, 2009
Messages
215
That can be done way more efficiently. Rather than forcing him to make a trigger for every item you can do:

Event
Generic Event ((Unit Acquires an Item))
Condition
Triggering Unit Hero's Level < Level of Item Being Manipulated
Action
Hero - Drop Item Being Manipulated

Then in the object editor, make sure all of your items have proper item levels (for instance, give weak healing potions level 0, super strong armor level 55; it corresponds with your required level). You can also add a 'display text to user' in the same trigger if you want to tell them they're too low.

I attached the crude idea in map format if you're lazy :p, though I set it to ≠ and not >.
 

Attachments

  • TRIGGER_DROPITEM.w3x
    17.2 KB · Views: 45
Level 13
Joined
Mar 16, 2008
Messages
941
There is a much neater way, it takes some time but looks impressive ingame and is only MPI:p
Create a unit for every level and name it "level 1", "level 2" and so on.
Then, whenever your hero reaches a new level, create a unit of the same level in a corner of the game. For example the hero reaches level 20, then you create a "level 20" for this player. This unit shouldn't use food/have no model/no soundset and so on.
The funny thing is, that the items are greyed out if you don't have the required level and the message "You require level 20" is displayed, dunno the exact text.
 
Level 6
Joined
May 1, 2009
Messages
215
There is a much neater way, it takes some time but looks impressive ingame and is only MPI:p
Create a unit for every level and name it "level 1", "level 2" and so on.
Then, whenever your hero reaches a new level, create a unit of the same level in a corner of the game. For example the hero reaches level 20, then you create a "level 20" for this player. This unit shouldn't use food/have no model/no soundset and so on.
The funny thing is, that the items are greyed out if you don't have the required level and the message "You require level 20" is displayed, dunno the exact text.

Oh that is a neat way. Will it really work though? Are passive effects disabled as if the item were a researchable ability?
 
Level 12
Joined
Jul 27, 2008
Messages
1,181
You could disable the effects of the items instead of making them unuseable by giving requirements and with this trigger:
  • Events
    • Unit - A Unit Gains a Level
  • Conditions
  • Actions
    • Game - Set the level of Level Research for (Owning Player of (Leveling Hero)) to (Hero Level of (Leveling Hero))
 
Status
Not open for further replies.
Top