Warcraft III resources & community, 2003–2006 · archived

2 Questions

11 posts
#1

2 Questions

1: How do you make a unit cast an item ability without that unit holding that item (or any method of giving some unit that item to cast)?

2: How do you make something always survive with 1 hp remaining to where if its hp should ever go below 1, it'll be returned to the value of 1 hp without dying via triggers.

All attempts to answer my questions are appreciated. And no, the second question isn't for the purpose of making something rigged.
#2
1) Give the unit a single-charged item. ( via Hero - Create Item For Hero )

2) i havent tested this one, but try Unit Takes Damage, if Damage - Health >= 0 then Set Unit Max Life ( function on wc3campaigns/wc3jass ) to 9999999. Next, wait 0.01s, set their life to 1, and their max life back to normal
#3
1. That is not what I'm looking for. I don't want an item created for it. I just want an ability of an item to be casted that the unit has without the use of any item.

2. Hmm, is there possibly a more efficient way of doing it? If not, I may have to test that but only if no better alternative is available.
#4
If you want an item spell, just go to create custom spell, change the category to items. and there ya go.
#5
1) thats the only way i can think of, as most item abils dont respond to orderstrings. you probably wont see the single-charged item anyways ^^

2) you can't prevent damage, so if the damage is > than the units max life, this is the only way.
#6
Well that second thing you suggested worked but it shows the 10000+ hp for a split second which really ruins the whole point. If there is no other way I won't even bother making it into the spell I had intended...
#7
hmm, try using a timer, as since they're accurate, a 0.01 timer probably wont be visible.
#8
hmmm... Poot i dont think adding 999999 hp is THAT necessary..

Some i suggest:

1: Reincarnation with no waits before ressurection(change the casting time to 0.01 i think)

2:
- Create a skill based on Hardened Skin
- Set its Chance to Block and Damage Block to 100%
- Set it's icon to Textures\Black32.blp

Like what poot did; when a unit is attacked (applies before damage), unit's health is bla bla (like purplepoot). Add the skill and kablam no damage. Heck if u want it to block Magic Damage u can always use Magic Damage Reduction from the Item Skill Category. Make it similiar to the Hardened Skin, add both too
After taking damage (wait 0.10) remove it.

It is not really efficient to use Black32 texture, and i suggest u use the "Spellbook" trick to completely hide BOTH skills. But heck u wont really need it anyways cuz ur going to remove it once the unit is damaged.
#9
oh, for the first one, u can add the item to a dummy :P
#10
PurplePoothmm, try using a timer, as since they're accurate, a 0.01 timer probably wont be visible.


Thats what I did. It is very noticeable...
#11
oo wait i think i got a solution to all this:

1) U wanted to make an Item Skill as Unit skill?

Poot solved this; give a dummy an item and order it to use it

2) Give Reincarnation, put it in a spellbook.
Disable the Spellbook using Jass
Reincarnation, 0.01 casting time or watever counts as a revival time there.