• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Backstap

Status
Not open for further replies.

hdm

hdm

Level 9
Joined
Nov 19, 2011
Messages
384
What is the actually tigger of Rikimaru's backstap ?I mean,how to deal bonus damage by the back of the enemy using tiggers?
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
It just sets a varible to (agi x level x X) + (Level x 25) = damage
And where dafuq you get that ?

It deals: (0.25 + (0.25 * AbilityLevel)) * AGI (include bonus)
Damage Type: Physical

I got this from DotA.

The damage is triggered by the event "Unit - A unit Is attacked", meaning you don't need a Damage Detection System for this and yes, you can abuse it by spamming the 'S' button.
 
Level 8
Joined
Mar 22, 2008
Messages
422
And where dafuq you get that ?

It deals: (0.25 + (0.25 * AbilityLevel)) * AGI (include bonus)
Damage Type: Physical

I got this from DotA.

The damage is triggered by the event "Unit - A unit Is attacked", meaning you don't need a Damage Detection System for this and yes, you can abuse it by spamming the 'S' button.

ops lol i was thinking he said the blink strikes damage.
 

hdm

hdm

Level 9
Joined
Nov 19, 2011
Messages
384
I don't want know what damage he deals,and yes,to get units by the back...
 
Last edited:
Level 6
Joined
May 13, 2009
Messages
260
Haven't tried this code because I'm currently running linux, but this should work. Anyway now you know how to do it at least! Good luck :)

JASS:
scope Backstab initalizer InitBackstab
    globals
        constant integer NPLAYERS = 4 //Number of players in game
        constant player array INDEXEDPLAYERS //Make this array of all players who are currently in-game
        constant integer SPELLID = 'A001' //Important with single quotes since they mark the integer conversion
        constant real PRECISION = 30.0 //The degrees amount of precision 
    endglobals

    //Static function because null boolexpr leaks
    function returnNull takes nothing returns boolexpr
        return null
    endfunction

    //Credit: [url]http://www.wc3c.net/showthread.php?p=1103463[/url]
    function IsPointInCone takes real x1, real y1, real x2, real y2, real facingAngle, real angle returns boolean
        return Cos(Atan2(y2-y1,x2-x1)-facingAngle) > Cos(angle)
    endfunction

    function BackstabActions takes nothing returns nothing
        
        if BackstabConditions() then
            call BjDebugMsg("Backstab has been succesfully casted!")
        else
            call BjDebugMsg("You must be behind your enemy when trying to backstab someone!")
        endif

    endfunction

    function BackstabConditions takes nothing returns boolean
        local unit caster = GetTriggerUnit()
        local unit target = GetSpellTargetUnit()
        local real casterFacing = GetUnitFacing(caster)
        local real targetFacing = GetUnitFacing(target)
        local real difFacing = RAbsBj(casterFacing-targetFacing)
        local real x1 = GetWidgetX(caster)
        local real y1 = GetWidgetY(caster)
        local real x2 = GetWidgetX(target)
        local real y2 = GetWidgetY(target)
        local boolean castBackstab = false
    
        //IsPointInCone checks if the caster is behind the target
        //difFacing is for allowing attacks that are near 180 degrees
        if IsPointInCone(x1, y1, x2, y2, casterFacing, PRECISION) and difFacing < PRECISION then
            set castBackstab = true
        endif

        set caster = null
        set target = null

        return castBackstab
    endfunction

    function IsAbilityBackstab takes nothing returns boolean
        if GetSpellAbilityId() == SPELLID then    
            return true
        endif
        return false
    endfunction

    function InitBackstab takes nothing returns nothing
        local trigger backstabTrg = CreateTrigger()
        local integer i = 0

        //Loop through indexed players and add the event that a unit starts the effect of an ability
        for i = 0 to NPLAYERS
            call TriggerRegisterPlayerUnitEvent(backstabTrg, INDEXEDPLAYERS(i), EVENT_PLAYER_UNIT_SPELL_EFFECT, returnNull())
        endfor

        //Check the condition that the ability is backstab
        call TriggerAddCondition(backstabTrg, Condition(function IsAbilityBackstab))

        //Do the actions
        call TriggerAddAction(backstabTrg, function BackstabActions)
    endfunction
endscope
 
Status
Not open for further replies.
Top