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.
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
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.
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...
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.
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.