| 10-11-2003, 12:43 PM | #1 |
Had this idea, but somehow can't implement it even after editing some triggers... Basically this is a divine shield that gives 100% evasion and spell immunity instead of invulnerability. Reason: invul causes attackers to run away. i don't want the attackers to run away so i want to give 100% evasion. anyone has any idea how to go about doing this? i tried to base a skill from evasion with cooldown and mana cost, but somehow it ends up just passive and i can't turn it on or off. :( |
| 10-11-2003, 12:50 PM | #2 |
Event: Unit casts a spell Condition: Spell being cast equal to Divine Shield Action: Add Ability - 100% Evasion to Triggering Unit Add Ability - Spell Immunity to Triggering Unit Wait (game time) (duration of the spell) seconds Remove Ability - 100% Evasion from Triggering Unit Remove Ability - Spell Immunity from Triggering Unit |
| 10-11-2003, 03:28 PM | #3 |
You may want to base that off of Immolation or something that drains mana over time; making yourself invulnerable without the "Enemies (rightly) flee from things they can't hurt" side-effect is awfully cheap. |
| 10-12-2003, 06:42 AM | #4 | |
Quote:
maybe a long cooldown time and heavy mana cost would balance that off? Sagan: in that trigger, i don't seem to understand how it will not give invulnerability. it will give evasion and spell immune, but there is no action to remove invulnerability? |
| 10-12-2003, 07:11 AM | #5 |
You'll probably need a modified copy of Divine Shield or a dummy spell to initiate it. |
| 10-12-2003, 12:10 PM | #6 |
I've done this sort of thing before. Don't worry. Sagan was on the right track, however using the wait command loses track of the identity of triggering unit variables. So you need an array. However you also need to recall the position of the unit in the array so using a wait command can't maintain that either. So you need a timer array as well. Since I'm guessing this is for a hero and not a unit I'm assuming you can't mass produce this kind of unit. Therefore let's say each player can only have one. Here's the idea of the trigger. EVENT: Unit casts ability CONDITION: Ability equals Divine Evasion (Turn on Dummy spell) ACTIONS: Add Evasion to Triggering Unit (100% Evasion) Add Spell Immunity to Triggering Unit Remove Divine Evasion from Triggering Unit Add Divine Evasion Off to Triggering Unit UnitArray(Player number of owner of triggering unit) = Trigger unit Start 10 second timer for TimerArray(Player number of owner of triggering unit) Now you need 12 events each for the different Timers Replicate them like this EVENT: TimerArray(1) expires CONDITION: None ACTIONS: Remove Evasion from UnitArray(1) Remove Spell Immunity from UnitArray(1) Remove Divine Evasion Off from UnitArray(1) Add Divine Evasion to UnitArray(1) Another Event which I won't bother adding works the same as the first but it turns off Divine Evasion prematurely. I suggest you remove that concept from the Divine shield spell, if you wonder why it was there in the first place, it was so that you could turn it off and give the paladin a positive buff or heal him. Since healing can now occur even during invulnarability there's no need for it. However the buff problem remains. Perhaps you can find a way to detect if the ability is used while it's already happening, infact I just did while writing the message but I won't bother typing it out, it simply requires you to have a boolean array as well true when turned on and false when turned off. Simple. The main problem in my opinion would be the clutter of gaining two new abilities. Since you only have 2 free spaces in the control bar for abilities and you should usually counter in for shadowmeld or others, say the stat +1,2,3 etc bonus spell used in the orc campaign? It really depends on how you design the hero. I personally don't know how to remove things like attack move and so forth without deactivating the abilities themselves. Or how to remove the icon of passive skills. Anyway, goodluck with your project. Cheers. |
| 10-12-2003, 09:36 PM | #7 |
here are some additional suggestions. IF you don't mind not being able to shut the effect off while it is running. ie you have to wait the timer length for the skill to stop. Use a base spell like roar, war stomp or thunderclap, and set the stats for such a skill all to zero except cooldown, cooldown should be set to the length of the cooldown after the spell finishes running(the time between when the effect ends and when you want to start it again) A way of using just a normal wait for the spell is to use a small bit of JASS. Create a global variable of type unit(will use Caster as an example). Then the first line of your trigger actions should be Custom script: local unit udg_Caster. Then second line should be set Caster = Casting unit. As far as adding the effect with out adding extra buttons, when the trigger detects the casting, remove the orgional skill using remove ability, add a new ability(ie the 100% evasion) which should be a custom skill with the same button art, and same button location. And then create an invisible unit at caster location with the spell anti-magic shell, and order it to cast it on the Caster, then remove the unit. This will effectively give the unit both effects with only the one starting button. Wait the time of the spell, then remove the evasion ability, dispel the AMS and then add the origional spell. Then one last trick to get the cooldown working add the following little bit: Turn off this trigger order casting unit to order(spellname) {order the unit to cast the spell again} Turn on this trigger This little bit will activate the spell again, but the turn off this trigger turn on this trigger part, prevents this trigger from detecting the activation of the dummy spell so it won't fire again, so all that will happen is it will start the cooldown timer on the spell. If the spell has multiple levels, you will have to include a trigger that detects each time the spell levels up and then(if the only change between levelling up is cooldown and length) modify the above to have wait time multiplied by the level of the spell and if the cooldown between deactivation of the spell and activation of the spell changes, just change the cooldown in the dummy spell. If you have multiple levels, when you add the origional ability back to the hero, you will also have to give the hero skill points and relearn the skill up to its origional level. This little bit of code easily does that: If SpellSkillLevel >1 Then For Each Interger A from 2 to SpellSkill Level Loop Modify skill points of Caster: add 1 skill point Hero - Learn heroskill for Caster {if the spell is a custom spell instead of a modified origional spell you will either have to use the JASS code for this or possibly the base spell will work} |
| 10-12-2003, 09:44 PM | #8 |
Use triggering unit instead of casting unit, and wait won't make the trigger to forget about the unit Event Unit Starts the effect of an ability Conditions Ability being cast equal to (Divine Shield (fake)) ^ use UMSWE Actions: add Evasion (Neutral hostile 100%) to (triggering unit) Add Spell inmunity to (Triggering unit) wait 15 seconds remove Evasion (Neutral hostile 100%) from triggering unit Remove Spell inmunity from triggering unit |
