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 haven't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. Fill your cup and take your pick among the maps best suited for this year's Hive Cup. The 6th Melee Mapping Contest Poll is up!
    Dismiss Notice
  4. Shoot to thrill, play to kill. Sate your hunger with the 33rd Modeling Contest!
    Dismiss Notice
  5. Do you hear boss music? It's the 17th Mini Mapping Contest!
    Dismiss Notice
  6. 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.