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

Item Level-Requirement System

Status
Not open for further replies.

CyberDuelX16

C

CyberDuelX16

Hey Guys im making an rpg but im a bit stuck with the items.

See i want to make my items so that you need to be a spefic level to wield them.

Example:

Name:Sword
Description: Bla Bla Bla Requires Level 10

So When you pick it up and you arent level 10 or higher it drops
and if you are
You can pick it up

Thanks,
CyberDuelX16
 
Level 16
Joined
May 1, 2008
Messages
1,605
Seas =)

What about:
  • Check Level
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • (Item-type of (Item being manipulated)) Equal to Claws of Attack +15
              • (Level of (Hero manipulating item)) Less than 10
        • Then - Actions
          • Hero - Drop (Item being manipulated) from (Hero manipulating item)
          • -------- This optional (Massage for the Player that picked up the item) --------
          • Set Temp_Player_Group = (Player group((Owner of (Hero manipulating item))))
          • Game - Display to Temp_Player_Group for 5.00 seconds the text: You need level 10
          • Custom script: call DestroyForce(udg_Temp_Player_Group)
        • Else - Actions
 
Level 9
Joined
Oct 22, 2006
Messages
599
With multiple items it'll look something like this:
  • Check Level
    • Or - Any (Conditions) are true
      • Conditions
        • And - All (Conditions) are true
          • Conditions
            • (Hero level of (Triggering unit)) Less than 10
            • (Item-type of (Item being manipulated)) Equal to Tome of Experience
        • And - All (Conditions) are true
          • Conditions
            • (Hero level of (Triggering unit)) Less than 10
            • (Item-type of (Item being manipulated)) Equal to Gerard's Lost Ledger
        • And - All (Conditions) are true
          • Conditions
            • (Hero level of (Triggering unit)) Less than 25
            • (Item-type of (Item being manipulated)) Equal to Orb of Frost
        • And - All (Conditions) are true
          • Conditions
            • (Hero level of (Triggering unit)) Less than 25
            • (Item-type of (Item being manipulated)) Equal to Orb of Venom
This is inside the If/Then/Else. Just thought it might get a bit complicated and to avoid mistakes and waste of time.:plol:
 
Level 16
Joined
May 1, 2008
Messages
1,605
Seas =)

Ok:
  • Check Level 2
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • (Level of (Hero manipulating item)) Less than 10
              • (Item level of (Item being manipulated)) Equal to or greater than to 0
        • Then - Actions
          • Hero - Drop (Item being manipulated) from (Hero manipulating item)
          • -------- This optional (Massage for the Player that picked up the item) --------
          • Set Temp_Player_Group = (Player group((Owner of (Hero manipulating item))))
          • Game - Display to Temp_Player_Group for 5.00 seconds the text: You need level 10
          • Custom script: call DestroyForce(udg_Temp_Player_Group)
        • Else - Actions
1) You need to set the level of each item in the object editor.
2) If you want set the item level you can hold shift and klick - then you got more then 0 - 8 levels.
3) This is shorter as the other trigger
4) For example you can make:
Item Level 0 = Hero level 0 needed
Item Level 1 = Hero level 10 needed
and so on ...
 
Seas =)

Ok:
  • Check Level 2
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • (Level of (Hero manipulating item)) Less than 10
              • (Item level of (Item being manipulated)) Equal to or greater than to 0
        • Then - Actions
          • Hero - Drop (Item being manipulated) from (Hero manipulating item)
          • -------- This optional (Massage for the Player that picked up the item) --------
          • Set Temp_Player_Group = (Player group((Owner of (Hero manipulating item))))
          • Game - Display to Temp_Player_Group for 5.00 seconds the text: You need level 10
          • Custom script: call DestroyForce(udg_Temp_Player_Group)
        • Else - Actions
1) You need to set the level of each item in the object editor.
2) If you want set the item level you can hold shift and klick - then you got more then 0 - 8 levels.
3) This is shorter as the other trigger
4) For example you can make:
Item Level 0 = Hero level 0 needed
Item Level 1 = Hero level 10 needed
and so on ...

Item level isn't necessary, unless you are lazy and want to half ass your rpg.
If then multiple,
item = sword of x
unit level less than 10
then
drop item from unit
else

and you can do this all in one trigger, I recomend sorting the if then multiple functions with a comment with the name of the item, and alphabetizing them.
 
Level 12
Joined
May 21, 2009
Messages
994
I got a really easy one.. Since i needed this myself once i made it.

go into object editor pick your item set the items "life" to the level that is required and do this trigger:

  • Item lvl require
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of (Triggering unit)) Less than (Integer((Current life of (Item being manipulated))))
        • Then - Actions
          • Hero - Drop (Item being manipulated) from (Triggering unit)
          • Game - Display to (Player group((Owner of (Triggering unit)))) the text: ((Your must be level + (String((Integer((Current life of (Item being manipulated))))))) + for being able to equip this item.)
        • Else - Actions
Easy huh :D
I also got a test map here: View attachment Item require system.w3x

Hope it helps!
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Hm... the above triggers all work perfectly, but if an item is being bought, then it just won't work...
I hate maps where you don't get a refund and the item just drops, though you can't use it.

There are multiple possibilities, one being a pre-set value in the object editor:
Set the item level = level required
Set HP = Gold cost of the item

Here is another possibility (note: with a lot of items, this isn't really good)

  • Setup Items
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set ItemCounter = (ItemCounter + 1)
      • Set ItemType[ItemCounter] = Claws of Attack +15
      • Set ItemCost[ItemCounter] = 500
      • Set ItemLevel[ItemCounter] = 5
      • Set ItemCounter = (ItemCounter + 1)
      • Set ItemType[ItemCounter] = Crown of Kings +5
      • Set ItemCost[ItemCounter] = 1000
      • Set ItemLevel[ItemCounter] = 12
      • Set ItemCounter = (ItemCounter + 1)
      • Set ItemType[ItemCounter] = Mask of Death
      • Set ItemCost[ItemCounter] = 2500
      • Set ItemLevel[ItemCounter] = 20

  • Buy Item
    • Events
      • Unit - A unit Sells an item (from shop)
    • Conditions
    • Actions
      • For each (Integer i) from 1 to ItemCounter, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item-type of (Sold Item)) Equal to ItemType[i]
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Hero level of (Triggering unit)) Less than ItemLevel[i]
                • Then - Actions
                  • Item - Remove (Sold Item)
                  • Player - Add ItemCost[i] to (Owner of (Triggering unit)) Current gold
                  • Game - Display to (All players) for 7.00 seconds the text: (You must be at least level |c00884444 + ((String(ItemLevel[i])) + |r to carry this item.))
                • Else - Actions
            • Else - Actions
Any advantages?
Yes: you can include anything you like (lumber cost, attribute requirement, hero type, you name it).
If you don't need any of the above, use the easiest method ^^
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
The event "A unit acquires an item" refers to picked up, bought, given etc.. And i just tested it and it works for me. If i buy the item with a unit under lvl required it still drops.

That's what I said...
(ohh, just checked my previous post and it isn't what I said, but it's what I meant).

If you read my previous post, though, I say "I hate maps where you don't get a refund and the item just drops, though you can't use it.".
Which is exactly what you said.
 
Level 9
Joined
Oct 22, 2006
Messages
599

Bug Point Out!

Line:
  • (Level of (Triggering unit)) Less than (Integer((Current life of (Item being manipulated))))
Bug:
Current life, u have to either set the units unable to attack items, or replace with Max life (if exists). If you don't when someone attacks a high-level required item, it's level-requirement will drop.
 
Level 12
Joined
May 21, 2009
Messages
994
Think i fixed it... It works for me + i tried it with multiple units at the same time for checking for MUIness...
just add this trigger
  • Hide Unhide
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • (Issued order) Equal to (Order(attack))
    • Actions
      • Item - Hide (Target item of issued order)
      • Wait 0.01 seconds
      • Item - Show (Target item of issued order)
Now it should order the unit to stop
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Catch Ya said:
:D ap0calypse your so cool xD
Trying to be sarcastic ehh? D:

Think i fixed it... It works for me + i tried it with multiple units at the same time for checking for MUIness...
just add this trigger
  • Hide Unhide
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • (Issued order) Equal to (Order(attack))
    • Actions
      • Item - Hide (Target item of issued order)
      • Wait 0.01 seconds
      • Item - Show (Target item of issued order)
Now it should order the unit to stop
Instead of this, why not remove the target "Item" on the units? o_O
 
Level 12
Joined
May 21, 2009
Messages
994
wtf u mean xD with remove items on units ? and i wasnt sarcastic :D i was serious...
Btw RemoveItem you mean remove the item then create a new one at the position ? like this:

  • Remove Create
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • (Issued order) Equal to (Order(attack))
    • Actions
      • Item - Remove (Target item of issued order)
      • Hero - Create (Item-type of (Target item of issued order)) and give it to (Triggering unit)
      • Hero - Drop (Target item of issued order) from (Triggering unit)
if it this you mean then well it doesnt works. Else please explain abit more what you mean with remove items from units ???
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
wtf u mean xD with remove items on units ? and i wasnt sarcastic :D i was serious...
Btw RemoveItem you mean remove the item then create a new one at the position ? like this:

[some trigger]

if it this you mean then well it doesnt works. Else please explain abit more what you mean with remove items from units ???

Oh, no... it's not about the triigger, it's just that you could do it without triggers :)
Go to the object editor, "Combat - Attack 1 Targets" (or something), remove "Items", then the unit just cannot attack items... never.

That's what VergilThazaar (and I) tried to say.
 
Level 9
Joined
Oct 22, 2006
Messages
599
- “And the Lord spake, saying, "First shalt thou take out the Holy Pin. Then shalt thou count to three, no more, no less. Three shall be the number thou shalt count, and the number of the counting shall be three. Four shalt thou not count, neither count thou two, excepting that thou then proceed to three. Five is right out. Once the number three, being the third number, be reached, then lobbest thou thy Holy Hand Grenade of Antioch towards thy foe, who, being naughty in my sight, shall snuff it.”
- Monty Python -
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
:0 dont know what it means really ? but monty python yea i know who he is...

Seriously? Monty Python is not a "he", it's a "them" (or "they", in your sentence -.-)...
It's the quote when the priests introduce the Holy Handgrenade, which is used to kill the killer rabbit ><
(and the game Worms also uses the same idea, if you ever played that ^^)
 

CyberDuelX16

C

CyberDuelX16

Lol...this has become a chatroom rofl!
Anyways thanks guys =) +rep if i can
 
Level 17
Joined
Jun 12, 2007
Messages
1,261
I know that this has already been solved but imo all the options above are annoying.
My main problem is that you can't pick up and just sell the item if you can't use it.
For this I thought of a better solution, and I have one.
It's a lot of work in both making items and triggering, so yeh... You should only use it if you want a pretty system.

Basically you have 2 items, a dummy item and the real item.

The dummy item and the real item are the same, except the dummy item is only an item and has no model attachments or stat enhancers attached to it.
Now with a trigger you will detect when an item is used.
You check what item it is, let's say: Bronze Sword of Extreme Forum Powers
In the description you could put:

Requirements:
- Level 10; Paladin, Mountain King, Blademaster
- 25 Strength
- 18 Agility


Now when that item is used you check if the unit using the item is level 10.
Is either a Paladin, Mountain King or a Blademaster
If the unit Str is 25.
If the unit Agl is 18.

When it meets the requirements you will remove the dummy item and replace it with the real item, which has the stats and model attachment (if it has one).
When it does not meet the requirements just show a friendly message; you suck to much for this item.

Yes it's a lot of work, but imo this is much better for rpg maps etc. Anyway some maps are better without it, while some could use it. But big RPG's should have it lol (Or one of those god complicated Jass inventories that I can't understand.)

EDIT: Same way with removing the item except without the checking for requirement parts. When item is used remove the real item and replace it with the dummy.
For fun sake make the equipped item undroppable and unsellable.
 
Status
Not open for further replies.
Top