• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Item Requirements

Status
Not open for further replies.
Level 12
Joined
Mar 16, 2006
Messages
992
Hey all! I have sort of a noobish question, but how do I set item level requirements? Like in Defiance's ORPG there's warrior items for level 6 warriors and etc...

Thanks in advance!

Check the top right area. It says Search.

And if you're too lazy to search for "noobish question" answers, I'll just say that it requires a bunch of If/then triggers regarding the heroes level.

When you acquire an item, if hero meets requirement you want, do nothing, else, drop item and display message. If you can't figure it out from there, then I will curse you.
 
Level 11
Joined
Aug 25, 2006
Messages
971
Me and a few friends are building an rpg.

I too needed a requirement system. However, I quickly realized that such a system was rather pointless. First of all, what if your working as a team, and no one uses that type of item? You can't even sell the item. So instead, I created a system (around 1000 lines of jass) to allow me to equip/unequip items. Items don't give bonuses until they are equipped.

However, I'm not planning to release the system at this time. But, if you put some time into learning JASS you'll be able to find theres really little you can't do when you put your mind to it.
 
Level 17
Joined
Apr 13, 2008
Messages
1,608
Oh my nonexistent god. 1000 lines of jass for nothing?

Let's say you have three classes for simplicity's sake. Priest, Warrior, Ranger. Let's say the max level is 90.

Go to item editor. There is a field, called item's hit points.
If an item requires lvl 40 and there is no class restriction then set the item's hp to 40.
If the item requires lvl 40 and is a Priest only item then set its hp: 40+100
If the item requires lvl 20 and is a Ranger only item then set its hp: 20+200
Warrior only item = +300
(I hope you can keep up with the idea, if not then read it over again)

When players chose heroes you set the units custom data like this:
If it's a Priest: Custom data = 1
If it's a Ranger: Custom data = 2
If it's a Warrior: Custom data = 3
(Setting the custom unit data on the heroes is the most easier way in our case, but this part can be solved various other, slightly more complicated ways)

Your trigger:
Events:
Hero picks up an item
Conditions:
If (Picked up item's HP - Triggering Unit's Custom Value*100 - Triggering Unit's Level > 0) and (Picked up item's HP - Triggering Unit's Custom Value*100 - Triggering Unit's Level < -90) and Item's HP > 90
Actions:
Drop item from hero's inventory.

If you don't understand read it over again.
Bomber: if there is noone on your team who can use the item you can just create a pack mule or other backpack unit like many games do. This way you have spared yourself from a few days of coding, bugshooting and stuff like that. Your game will also be faster and smaller this way.
Just create a wisp or a pack horse with inventory.

If you still don't understand don't be afraid to post and ask.
 
Level 11
Joined
Aug 25, 2006
Messages
971
Don't make me laugh. You either didn't read what I said. (But I think you did) Or you don't understand what I meant.

The system doesn't prevent users from picking up item. However say you want to use a shield. You click the shield, and the shield dissapears. (It then adds the armor bonus) The main reason for the size is because its a system. To actually add an item and all its bonuses it takes 4 lines of code. It can add up to 4000 damage/armor/block(coded)/int/str/agi/hp/mp without any modifications. To unequip an item, you open up another menu and click unequip.

Writing 1000 lines of jass just to keep players from picking up items above their level would be foolish.


Heres all I have to do to register items to be equippable (this has nothing to do with picking them up)
JASS:
        call RegItem(VD_SAVE_LOAD_TRADE,'I00C',false,true)
            call SetVirtStats(10,0,0,0,0)
            call SetVirtHeroStats(2,0,0)
        call RegItem(VD_SAVE_LOAD_TRADE,'I00J',false,true)
            call SetVirtStats(20,0,0,0,0)
            call SetVirtHeroStats(4,0,1)
        call RegItem(VD_NO_TRADE,'I00L',false,true)
            call SetVirtStats(40,0,0,0,0)
            call SetVirtHeroStats(6,3,0)
        call RegItem(VD_NO_TRADE,'I00K',false,false)
            call RegThrown(100,700,"Abilities\\Weapons\\BansheeMissile\\BansheeMissile.mdl",.15)
        call RegItem(VD_SAVE_LOAD_TRADE,'I00M',false,false)
            call SetVirtStats(0,40,15,0,15)
            call SetVirtHeroStats(0,5,2) 
        call RegItem(VD_NO_TRADE,'I00R',false,false)
            call SetVirtStats(0,0,0,0,10)
            call SetVirtHeroStats(0,0,7)
        call RegItem(VD_NO_TRADE,'I00S',false,false)
            call SetVirtStats(0,0,0,0,5)
            call SetVirtHeroStats(6,0,0)
        call RegItem(VD_NO_TRADE,'I00B',false,false)
            call SetVirtStats(0,4,50,0,4)
            //call SetVirtHeroStats(0,0,0)
        call RegItem(VD_NO_TRADE,'I00Q',false,false)
            call SetVirtStats(0,25,25,0,12)
            call SetVirtHeroStats(0,4,0)
        call RegItem(VD_NO_TRADE,'I00E',false,false)
            call SetVirtStats(0,0,0,9,0)
            call SetVirtHeroStats(0,1,4)
        call RegItem(VD_NO_TRADE,'I00O',false,false)
            call SetVirtStats(0,0,0,16,0)
            call SetVirtHeroStats(0,0,6)
        call RegItem(VD_SAVE_LOAD_TRADE,'I00D',false,false)
            call SetVirtStats(0,0,0,7,0)
            call SetVirtHeroStats(0,0,2)
        call RegItem(VD_SAVE_LOAD_TRADE,'I00N',false,false)
            call SetVirtStats(0,0,0,11,0)
            call SetVirtHeroStats(0,1,1)
        call RegItem(VD_NO_TRADE,'I00P',false,false)
            call SetVirtStats(0,0,0,18,0)
            call SetVirtHeroStats(0,4,0)
        call RegItem(VD_SAVE_LOAD_TRADE,'I006',false,false)
            call SetVirtStats(0,0,0,8,0)
            //call SetVirtHeroStats(0,0,0)
        call RegItem(VD_NO_TRADE,'I00I',false,false)
            call SetVirtStats(0,0,0,30,0)
            call SetVirtHeroStats(0,4,0)
        call RegItem(VD_NO_TRADE,'I00T',false,false)
            call SetVirtStats(0,0,0,20,0)
            call SetVirtHeroStats(0,0,8)
        call RegItem(VD_NO_TRADE,'I00X',false,false)
            call SetVirtStats(0,0,0,11,0)

The type of the item (which decides whether or not your class can use it) is determined by an ability you add to the item. (The abiltiy used to equip it) The level req. is directly deteremined by the item hp. (Yes you weren't the only one to think of that...)
 
Level 17
Joined
Apr 13, 2008
Messages
1,608
I did read what you wrote and I did understand it, but in my opinion it's too much hassle and
However, I quickly realized that such a system was rather pointless. First of all, what if your working as a team, and no one uses that type of item?
I don't agree on that. I would rather implement a 5 line code for a simple class-check system and polish other areas of my map than focus on the equipment system.

Don't get me wrong, I'm not throwing stones at you or something and I don't want to take away your enthusiasm, coding is fun.
 
Level 12
Joined
Mar 16, 2006
Messages
992
Yeah. Equipping systems are fun.

All you need are dummy items and massive amounts of triggers. And nobody can see what gear you have, unless you allow others to see it via multi-board or whatever you choose to use.

OR

You can just make two sets of items. One that have no bonus, but have a description, and one that has the bonus. Upon buying it, seeing if they met the requirements, and if they did, replacing it with the proper item. If they didn't, set up a watching script for when the hero levels to that level to transfer the item into his inventory.

I prefer the second version.
 
Status
Not open for further replies.
Top