I already answered this:Unit - Kill (Target unit of ability being cast)
But he wants to eat a mushroom and i'm sure mushroom isn't a unit=) Destructible probably.
ap0calypse said:For the mana, you can create a new unit based off a ward (like the Sentry Ward) and turn it into a mushroom.
Indeed!ap0calypse said:Units are far easier to work with.
Woah, yeah... that's not MUI
Aaand it could all be combined into something more efficient (by using "or").
I didn't know you were planning to make it regenerate over time, in that case you'll need a different approach:
Instead of triggering everything, why don't you create a spell based on item scrolls and use that on the unit eating the tree/mushroom?
Item scrolls regenerate mana/health over time, so that would mean there's no need for the second trigger at all: just order the unit to cast that spell (give spell to unit, order unit to cast spell, remove spell from unit).
Yeah order a unit to cast a spell But i'm not sure if it will work for items, or whatever you're trying to do there, ap0calypse said it too!squelch said:and is there a way to code it without using items?
Explain a bit more please...squelch said:now whenever I eat mushrooms it wont eat the ashenvale trees?
You leak a group. Add custom script: set bj_wantDestroyGroup = true before the Unit Group - Order ...
And do you need to order every unit in map to replenish? or just one? If one, the order to cast a spell is under section "Unit"
Explain a bit more please...
said:
- -------- e001 = dummy unit --------
- -------- a007 = replenish mana --------
I fixed what you said it works when I use the first code you gave me for healing mana and health but it doesn't work when I try to get the ability to castYou use the second conditions in If/Then/Else wrong, you use Last Created Destructible but you don't create any! maybe you had in mind Target destructible of ability being cast? but in the 5th If/Then/Else you typed some other raw values into script, maybe that's the problem?
That's not his point.Those are comments they don't do anything accept tell you whats going in the script.
I wasn't trying to say that He just misspelled in the script the war codes! He says to useap0calypse said:But since spells usually start with a capital A, that is most likely not the problem.