• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Fast help needed kinda simple thing for you smart guys

Status
Not open for further replies.

Tan

Tan

Level 3
Joined
Sep 25, 2007
Messages
34
My friend made a spell which is based off Shadow Strike. It's called Holy Defender

He wants it to work that when the Hero has used the spell on an enemy, he gets a buff (the buff part works, the unit gets the buff) but I want it to work that when the enemy tries to cast a spell while the buff is active, he takes damage.
He tried (first time) working with Game Cache, but he couldn't figure it out.. Any tips?

Here's hes 2 triggers:

Holy Prevention
  • Events
  • Unit - A unit Starts the effect of an ability
  • Conditions
  • (Ability being cast) Equal to Holy Prevention
  • Actions
  • Game Cache - Store (Casting unit) as HolyDef of StoredHeroes in HolyDefender
  • Trigger - Turn on Holy Prevention 2 <gen>
Holy Prevention 2

  • Events
  • Unit - A unit Starts the effect of an ability
  • Conditions
  • ((Casting unit) has buff Holy Prevention ) Equal to True
  • Actions
  • Set HolyDefender = (Last created game cache)
  • Unit Group - Pick every unit in (Units of type (Unit-type((Load HolyDef of StoredHeroes from (Last created game cache))))) and do (Actions)
  • Loop - Actions
  • Unit - Cause (Picked unit) to damage (Casting unit), dealing 500.00 damage of attack type Spells and damage type Normal
Both he and me searched the forum but no results...
 
Level 8
Joined
Jun 25, 2007
Messages
165
Don't use game cache... use one trigger to.
  • Spell
  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • ((Casting unit) has buff Holy Prevention ) Equal to True
  • Actions
    • Unit - Cause (Casting unit) to damage (Casting unit), dealing 500.00 damage of attack type Spells and damage type Normal
 

Tan

Tan

Level 3
Joined
Sep 25, 2007
Messages
34
Don't use game cache... use one trigger to.
  • Spell
  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • ((Casting unit) has buff Holy Prevention ) Equal to True
  • Actions
    • Unit - Cause (Casting unit) to damage (Casting unit), dealing 500.00 damage of attack type Spells and damage type Normal

Yeah but than wont the hero who putted the buff on the target get the kill (if it dies when it cast a spell) ..
 
Level 11
Joined
Jun 21, 2007
Messages
505
So, if you want to create a spell which will damage the targeted unit when it casts a spell, you can use, for example, "Drunken Haze" spell, but edit it to make any affects on the unit. And then use this trigger:
  • Events:
    • Unit - A unit finishes casting an ability
  • Conditions:
    • Boolean - Unit has buff Drunken Haze <!!(I recommend you to edit the Drunken Haze buff, change the icon, name and description)!!>
  • Actions:
    • Unit - Set life (of the triggering unit) to ((Life of the triggering unit)-(#))
(And create a special effect !at the position of the unit! to make it look prettier)
I recommend to use the DeathCoilTarget special effect


Or, if you want the hero casting that hyper ability have the targeted unit killed (The hero will simply get experience from kill), you can make a unit with incorrect model path (Example - Custom model path "blablabla.mdl")
so as to make it unable to be seen in the game. +you make that unit have an attack dealing damage equal to damage which should be taken by unit casting a spell. +Make that unit a long attack cooldown so as you can have that unit attacking once with triggers (remove the unit using "Unit - is attacked" event and condition "Unit-Type of the triggering unit equal to Invisible Attacker".
MAKE THE "INVISIABLE ATTACKER"'s Combat - Animation Backswing Point to 0.000 and Combat - Animation Damage Point to 0.000

Then you need 3 triggers and 4 variables and editing units' custom values.
  • Events:
    • Unit - A unit finishes casting an ability
  • Conditions:
    • Ability Comparison - (Ability being cast) equal to Holy Prevention
  • Actions:
    • General - Set variable ((INTEGER))=((INTEGER))+1
    • Unit - Set custom value of (triggering unit) to ((INTEGER))
    • Unit - Set custom value of (target unit of ability being cast) to ((INTEGER))
    • -----this will help to find the Holy Preventer and it's victim-----
  • Events:
    • Unit - A unit begins casting an ability ((If you want the unit to die before it casts an ability)) <<OR>> finishes casting an ability ((If you want to the unit to cast the spell first and then die))
  • Conditions:
    • (Integer Comparison - (Triggering unit)'s custom value not equal to 0) and (Boolean - (Triggering unit) has buff Holy Prevention)
  • Actions:
    • Unit - Create 1 Invisible Attacker for (owner of random unit in (Playable area) matching ((matching unit)'s custom value equal to custom value of (triggering unit))) at position of (triggering unit)
    • Set variable ((REAL1)) to position X of (random unit from (Playable area) matching (matching unit)'s custom value equal to custom value of (triggering unit))
    • Set variable <(!!SAME AS PREVIOUS ACTIONS BUT WITH Y POSITION OF THE UNIT WITH CUSTOM VALUE OF THE TRIGGERING UNIT!!)> ( and use ((REAL2))
    • Set variable ((REAL3)) to (facing angle of (random unit from (Playable area)) matching (matching unit)'s custom value equal to custom value of (triggering unit)
    • If (life of (triggering unit) less than <(!!# of damage that should be taken by victim!!)>) then do (Unit - Move (random unit from (Playable area)) matching (matching unit)'s custom value equal to custom value of (triggering unit) instantly to position of (triggering unit)) else (do nothing)
    • Unit - Issue an order targeting a unit - Order (last created unit) to attack the (triggering unit)
    • Wait 0.01 seconds
    • If (life of (triggering unit) less than <(!!# of damage that should be taken by victim!!)>) then do (Unit - Move (random unit from (Playable area)) matching (matching unit)'s custom value equal to custom value of (triggering unit) instantly to (Conversion - Convert coordinates to point (REAL1,REAL2))) else (do nothing)
    • If (life of (triggering unit) less than <(!!# of damage that should be taken by victim!!)>) then do (Unit - make (random unit from (Playable area)) matching (matching unit)'s custom value equal to custom value of (triggering unit) face angle ((REAL3)) else (do nothing)
  • Events:
    • Unit - A unit is attacked
  • Conditions:
    • Unit-Type of the (triggering unit) equal to INVISIBLE ATTACKER
  • Actions:
    • Unit - Remove (triggering unit) from the game
    • If (life of (attacked unit) equal or less than 0 then) do (Unit - Set custom value of (random unit from (Playable area)) matching (matching unit)'s custom value equal to custom value of (attacked unit) to 0
    • If (life of (attacked unit) equal or less than 0 then) do (Unit - Set custom value of the (attacked unit) to 0
  • Events:
    • Time - Every 2.00 seconds
  • Conditions:
  • Actions:
    • Unit Group - Pick every unit in (Playable area) matching ((matching unit)'s custom value not equal to 0) and (Boolean - unit has buff Holy Prevention equal to false) and do (set (picked unit)'s custom value to 0)
___________
Don't give me rep if you think i helped you
 
Last edited:
Status
Not open for further replies.
Top