1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. The poll for Hive's 12th Concept Art Contest is up! Go cast your vote for your favourite genie!
    Dismiss Notice
  4. Travel to distant realms and encounter scenes unknown to the common folk. The Greatest of Adventures is upon us with the 8th Cinematic Contest. Join in on a fun ride.
    Dismiss Notice
  5. The 18th Icon Contest is ON! Choose any ingame unit and give him/her Hero abilities. Good luck to all.
    Dismiss Notice
  6. Contestants are to create a scene set in the Stone Age. Come and see what you can come up with. We wish you the best of luck!
    Dismiss Notice
  7. Colour outside the lines! Techtree Contest #13 is a go. The contest is optionally paired.
    Dismiss Notice
  8. Greetings cerebrates, our Swarm needs new spawners that will have numerous children. Join the HIVE's 31st Modeling Contest - Spawners and Spawned! The contest is optionally paired.
    Dismiss Notice
  9. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Spell doesn't work as it should

Discussion in 'Triggers & Scripts' started by biHmapmaker, Jul 24, 2012.

  1. biHmapmaker

    biHmapmaker

    Joined:
    Oct 10, 2009
    Messages:
    99
    Resources:
    0
    Resources:
    0
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Battle Roar
    • Actions
      • Set br_caster = (Casting unit)
      • Set br_aoe = ((Level of Battle Roar for br_caster) x 250)
      • Set br_damage[0] = (((Level of Battle Roar for br_caster) x 50) + ((Agility of br_caster (Include bonuses)) x 2))
      • Special Effect - Create a special effect attached to the chest of br_caster using Abilities\Spells\Orc\WarStomp\WarStompCaster.mdl
      • Special Effect - Create a special effect at (Position of br_caster) using Abilities\Spells\Other\Stampede\StampedeMissile.mdl
      • Set br_sp_effect[0] = (Last created special effect)
      • Special Effect - Destroy br_sp_effect[0]
      • Unit Group - Pick every unit in (Units owned by Player 12 (Brown)) and do (Actions)
        • Loop - Actions
          • Unit - Cause br_caster to damage (Triggering unit), dealing (Real(br_damage[0])) damage of attack type Spells and damage type Magic
          • Special Effect - Create a special effect at (Position of br_caster) using Abilities\Spells\Demon\DarkPortal\DarkPortalTarget.mdl
          • Special Effect - Create a special effect at (Position of br_caster) using Abilities\Spells\Demon\DemonBoltImpact\DemonBoltImpact.mdl


    The point of the ability is to damage enemy units around the casting target and passively increase damage (that's in object editor). However, ability damages only the casting target and not the targets around. There's probably leak somewhere there, but I couldn't figure out where it is.
     
  2. defskull

    defskull

    Joined:
    Mar 27, 2008
    Messages:
    7,978
    Resources:
    17
    Spells:
    17
    Resources:
    17
    Change (Triggering unit) to (Picked unit)

    But this will damage all units owned by Player 12 wherever they are, not only around the caster.

    This will tackle problem;
    • Unit Group - Pick every unit in (Units within br_aoe of (Target point of ability being cast) matching (((Matching unit) belongs to an enemy of (Triggering player)) Equal to True)) and do (Actions)
      • Loop - Actions

    Units In Range Matching Condition

    (Target point of ability being cast) is Point leak, to solve it;
    • Actions
      • Set TargetLoc = (Target point of ability being cast)
      • Unit Group - Pick every unit in (Units within br_aoe of TargetLoc matching (((Matching unit) belongs to an enemy of (Triggering player)) Equal to True)) and do (Actions)
        • Loop - Actions
      • Custom script: call RemoveLocation(udg_TempLoc)


    This will clear the Point leak.
     
  3. biHmapmaker

    biHmapmaker

    Joined:
    Oct 10, 2009
    Messages:
    99
    Resources:
    0
    Resources:
    0
    I used

    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Set br_caster = (Casting unit)
      • Set br_aoe = ((Level of Battle Roar for br_caster) x 250)
      • Set br_damage[0] = (((Level of Battle Roar for br_caster) x 50) + ((Agility of br_caster (Include bonuses)) x 2))
      • Special Effect - Create a special effect attached to the chest of br_caster using Abilities\Spells\Orc\WarStomp\WarStompCaster.mdl
      • Special Effect - Create a special effect at (Position of br_caster) using Abilities\Spells\Other\Stampede\StampedeMissile.mdl
      • Set br_sp_effect[0] = (Last created special effect)
      • Special Effect - Destroy br_sp_effect[0]
      • Unit Group - Pick every unit in (Units owned by Player 12 (Brown)) and do (Actions)
        • Loop - Actions
          • Unit - Cause br_caster to damage (Picked unit), dealing (Real(br_damage[0])) damage of attack type Spells and damage type Magic
          • Special Effect - Create a special effect at (Position of br_caster) using Abilities\Spells\Demon\DarkPortal\DarkPortalTarget.mdl
          • Special Effect - Create a special effect at (Position of br_caster) using Abilities\Spells\Demon\DemonBoltImpact\DemonBoltImpact.mdl


    And it works fine :) So tnx :)
     
  4. defskull

    defskull

    Joined:
    Mar 27, 2008
    Messages:
    7,978
    Resources:
    17
    Spells:
    17
    Resources:
    17
    Since you're setting a variable of br_aoe, and you did not use it, it's kinda useless ?

    I have edited my previous post, you can check a proper usage of br_aoe.
     
  5. biHmapmaker

    biHmapmaker

    Joined:
    Oct 10, 2009
    Messages:
    99
    Resources:
    0
    Resources:
    0
    Yes, noticed just now on testing map that it damages every unit at map. Fixed now, thanks :) Gave you rep :)
     
  6. defskull

    defskull

    Joined:
    Mar 27, 2008
    Messages:
    7,978
    Resources:
    17
    Spells:
    17
    Resources:
    17
    You should change this event to A unit Starts the effect of an ability, because Begins casting an ability could bug out the trigger.