HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Need little Help

11-08-2004, 12:47 PM#1
Terror-Rpger
I want a Item Restriction for my Rpg.

Example: A Unit picks up a Axe, to wear this Axe he needs 20 Strenght but the Hero has only 15 what to do that the Axe cannot be take ? :(

Plz Help, Thx !
11-08-2004, 01:36 PM#2
xxxSpikexxx
without custom scripts you can't make items unpickable. what you can do is drop the item when it's taken and the hero doesn't have enought strengh.
11-08-2004, 02:41 PM#3
Dead-Inside
Well, you can go about this in different ways. Do you want stat restrictions only, or do you want it combined with item classes (Figther, ranged, etc)?

It'll be a bit more complicated if you want both.
11-08-2004, 04:41 PM#4
Guest
Try using triggers. They work perfectly.
Something like:
Event: Generic unit event: Unit accuire item
Condition:-
Action: If/Then/Else multyple functions
---------|||||||||
Condition:
Item Comparision: Picked Item equal to YOUR ITEM HERE
Integer Comparision: Streng of hero (your hero) more that or equal to YOUR NUMBER HERE
--------
Sorry for spelling... I was writing that from memory.
I hope it helps...
11-08-2004, 05:14 PM#5
Dead-Inside
Picked item? It's "Item being manipulated".
11-08-2004, 05:43 PM#6
Guest
Yea I know, when you post something from memory.......
11-08-2004, 07:42 PM#7
Captain Griffen
You can use the item's hp to convey info, and split it up using convert to string and then substrings.
11-08-2004, 07:50 PM#8
Guest
If you know Jass you could do this using a game cache/handle variables type thing. Create a game cache with I2S(itemID) as mission name and "requiredStr", "requiredAgi", "requiredInt" values for each item... then in your get item trigger, get the values back out of the cache and compare with the hero's values, order him to drop it if he doesn't meet them. You can use Lord Vexorian's SimError from wc3sear.ch JASS section to give a "you don't have enough strength"-type error message too.
11-08-2004, 07:57 PM#9
Dead-Inside
My idea is to store the Agil, St, Int or whatever you want to have in the custom value of the unit. Reserve maybe 3 digits of each. Then you can have the class of the item after that. So if the unit has 30 agility, 25 strength and 624 intelligence, and he was picking up a staff, the custom value would look as such;

03002562405 -- Where 05 represents the "Staff" class of items.
11-08-2004, 09:04 PM#10
Captain Griffen
I was under the impression game cache does not work online.
11-08-2004, 09:15 PM#11
Dead-Inside
It doesn't, that's why I typed up what I had in mind.
11-09-2004, 04:38 PM#12
Guest
Game cache DOES work in multiplayer, assuming you only use it to store temporary values.

What it doesn't do in multiplayer is save to disk, like it does in campaigns, but for the "handle variables" and similar things, you don't need it to save.