HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Help with weapon system

11-15-2003, 07:58 PM#1
Redesh
When a hero obtains an item of a certain class the hero will drop any items of that class. It's for a weapon system. How do I do this? I've tried everything and the only possible solution is code but I don't how to do that. Any suggestions for another way to do a weapon system would be helpful
11-15-2003, 08:09 PM#2
Vexorian
The thing you need to do here is, to make each item class have a predetermined hit points value.

Example: make boots have a 74 hit points value, and make sure no item has 74 hit points unless it is a boot.

Then have this trigger:

Events:
Unit- A unit adquires an item
Conditions:
Actions:
set life of (item being manipulated) to 1000000
for each integer A from 1 to 6 do actions:
--if conditions do actions
--- (life of (item in (triggering unit) slot (integer A)) equal to (life of (item beign manipulated)
-----Actions:
.........Drop (item in (triggering unit) slot (integer A)) from (triggering unit)
11-15-2003, 08:20 PM#3
Redesh
Quote:
The thing you need to do here is, to make each item class have a predetermined hit points value.


Wow! Why didn't I think of that? All that time wasted.
11-22-2003, 05:37 AM#4
xein
or you could classified them by level.
11-22-2003, 07:42 PM#5
Vexorian
Quote:
Originally posted by xein
or you could classified them by level.


Did you really have to post that ?

level usually determines the power of the item, I think it is pretty lame to use level because it is easier to use level and tft's item classification for drop tables, hit points are better for that
11-23-2003, 03:02 AM#6
xein
I only give other options available. Plus I can attack the item.

Anyway, let Redesh choose which is suitable for him.
11-24-2003, 03:10 PM#7
Vexorian
Actually the post was old, and with setting the life to 10000 in my trigger you can attack items. anywayz, let this thread rest in peace
11-24-2003, 04:05 PM#8
Cubasis
First of all...no, these items would not be attackable, it's the easiest thing in the world to turn them invulnerable with triggers...

Second of all, while what vex submitted is a very great method and just really smart...it should be built a little differently, but it still carries the general rule. How i do this is as following:

Have HP of a specified item: 1 *class* *type* [and even *cost*, if wanted]. Class is 2 digits (can be 1 if you want), type is also 2 digits (again, may be more or less).

F.ex., a Shining BroadSword might have: 10118 HP

And the trigger reads the second and third letter...finding out that the item is of type sword. Then the trigger would compare to see if the picking up hero "can" hold a sword, if not, throw it away...and such, ofcourse you might not even need the item-type, but i do, and i also need the cost for a certain reason i won't tell here. Anyhow...

EDIT: But if you do need the internal item-type...then you just read the fourth and fifth symbol (18 in the example), and find out it's a "shining" broadsword, and thus you can know it's stats if you want too...

Hope this helped.

Cubasis