1. Find your way through the deepest dungeon in the 18th Mini Mapping Contest Poll.
    Dismiss Notice
  2. A brave new world lies beyond the seven seas. Join the 34th Modeling Contest today!
    Dismiss Notice
  3. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
Hive 3 Remoosed BETA - NOW LIVE. Go check it out at BETA Hive Workshop! Post your feedback in this new forum BETA Feedback.
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

(GUI) backstab

Discussion in 'Requests' started by Palooo3, Sep 17, 2011.

  1. Palooo3

    Palooo3

    Joined:
    Nov 24, 2010
    Messages:
    544
    Resources:
    2
    Maps:
    2
    Resources:
    2
    Hello everyone I need backstab spell:

    Effect : Damage, slow move speed and attack speed
    Level support: No
    Damage: Easily changeable
    Leakless, MUI (there can be possibly 2+ units to cast it, but it is instant not timed/channeled spell so i think it doesn't metter)

    Other info:
    - spell is active, should be based on cold arrows/ ice nova
    - it affect only when you are in "red zone".
    - if you are in "black zone" it will reset cooldown for spell and gives game massage. No damage/no mana cost/no stun.
    - NOT autocastable

    + rep and credits for creators.

    [​IMG]
     
  2. NeoFight

    NeoFight

    Joined:
    Dec 19, 2004
    Messages:
    108
    Resources:
    0
    Resources:
    0
    If I give you a way to check whether the unit is behind the other unit or not (in the red zone) will you be able to create the rest of the spell? triggering to damage & slow the target etc when in red area // give the mana back, reset cooldown etc when in black area aint hard, is it?
     
  3. Palooo3

    Palooo3

    Joined:
    Nov 24, 2010
    Messages:
    544
    Resources:
    2
    Maps:
    2
    Resources:
    2
    okay sounds fair , i mostly have problem with IF caster in "red zone" than...
    IF caster at "black zone" than...
     
  4. NeoFight

    NeoFight

    Joined:
    Dec 19, 2004
    Messages:
    108
    Resources:
    0
    Resources:
    0
    thats what I thought.

    Ok, so you have the event 'unit starts the effect of an ability' with condition: ability being cast = Backstab, then you do it something like this:

    For each (integer A) from 0 to 90, do:
    - Set BackstabAngle (integer variable) = ((Integer((Facing of (Casting unit)))) + (Integer A))
    - If [BackstabAngle Greater than 360] then do [Set BackstabAngle = (BackstabAngle - 360)]
    - If [BackstabAngle Equal to (Integer((Facing of (Target of ability begin cast))))] then do [Actions that you want (make casting unit damage target etc)

    Then do exactly the same, but instead of + integer A you do - integer A:

    For each (integer A) from 0 to 90, do:
    - Set BackstabAngle (integer variable) = ((Integer((Facing of (Casting unit)))) - (Integer A))
    - If [BackstabAngle Greater than 360] then do [Set BackstabAngle = (BackstabAngle - 360)]
    - If [BackstabAngle Equal to (Integer((Facing of (Target of ability begin cast))))] then do [Actions that you want (make casting unit damage target etc)


    On this way, the ability 'works' when you're behind the target unit in an angle of 180 degrees. (90+90)
     
  5. Erkki2

    Erkki2

    Joined:
    Jun 6, 2007
    Messages:
    382
    Resources:
    7
    Skins:
    6
    Spells:
    1
    Resources:
    7
    That way, a unit with a slow turn rate may not be able to backstab, even if it's actually behind the target (if it's facing away from target when the ability is cast). Here's how I would do it:

    Set CasterPoint = location of casting unit
    Set TargetPoint = location of target unit of ability being cast
    set angle = abs( (angle from CasterPoint to TargetPoint) - facing of target unit of ability being cast unit)
    if (angle < 90) , do your actions
     
  6. Palooo3

    Palooo3

    Joined:
    Nov 24, 2010
    Messages:
    544
    Resources:
    2
    Maps:
    2
    Resources:
    2
    you guys think text really help me?
    demo map please ;/
     
  7. Erkki2

    Erkki2

    Joined:
    Jun 6, 2007
    Messages:
    382
    Resources:
    7
    Skins:
    6
    Spells:
    1
    Resources:
    7
    I hope this is what you need.
     

    Attached Files:

  8. Palooo3

    Palooo3

    Joined:
    Nov 24, 2010
    Messages:
    544
    Resources:
    2
    Maps:
    2
    Resources:
    2
    thx, going check, will post result in sec

    EDIT:

    GREAT! love it + rep and credits ;) <3
     
    Last edited: Sep 18, 2011