Strafing Spell

Mikazuki

New Member
Reaction score
0
I'm trying to trigger a strafing spell called 'Insanity Strafing'. What it does is place a buff on the caster for 7 seconds. As long as the unit has the buff, the unit's damage is halved, attack speed quadripled and the unit gains a 50% chance to attack again (shown by a partially transparent image of the unit appearing (on the unit), attacking then disappearing). One problem; I have completely no idea how to do it.

I tried basing the spell off bloodlust for the 4x attack speed, and then having a partially transparent dummy unit appear, do an attack animation, then disappear as damage was dealt. I also made an item skill off Command Aura which was given to the caster then taken away after 7 seconds. But then the bloodlust lasted forever (I did change the duration to 7, but...), and the game would crash as a dummy unit was created. I ended up deleting the hopeless triggers.

I guess you could say this thread is a spell request. Could anyone code the spell for me, or tell me how do I go about coding it, if it isn't too much trouble?
 
Omg

Omg this is so off topic but omg its mika!!!

OK OK

cant the hero have Berserk and when activated trigger to summon a unit with cmmand aura and then the double attack thingy w/e u did O_O
 
Create a skill*. when cast trigers a trigger*. Use bloodlust for the 4x damage. Set the skill* to 7 secs. Use mana shield for the halved damage by editing 0point of mana for 1 point of hp,1.5,2. And set mana reuction of <--- to 0 and damage absorbed to 0.5. Then u create a trigger*.create a dummy,(make it ranged, and attack speed very fast, dmg up to u).
Trigger*:
Code:
Events
    Unit - A unit Begins casting an ability
Conditions
    (Ability being cast) Equal to [U][B]Your Skill[/B][/U]
Actions
    Set [B][U]A variable of type unit group*[/U][/B] = (Units within [B][U]Radius*[/U][/B] of (Position of (Triggering unit)))
    Unit Group - Pick every unit in [B][U]A variable of type unit group*[/U][/B] and do (Actions)
        Loop - Actions
            Unit - Create 1 [B][U]Your Dummy[/U][/B] for (Triggering player) at (Position of (Triggering unit)) facing Default building facing degrees
            (Unit - Create a generic expiration timer 1sec for (Last created unit))}I typed this myself,so it might not be exact
            Unit - Order (Last created unit) to Attack Once (Picked unit)
Oh and this is for exactly what u said, except, when fighting a group of creeps within the Radius*, it will attack a random unit.

So, in conclusion, make the trigger, and to make the spell, right - click on mana shield and create custom ability. Edit it according and under buff, insert bloodlust.
 
Create a skill*. when cast trigers a trigger*. Use bloodlust for the 4x damage. Set the skill* to 7 secs. Use mana shield for the halved damage by editing 0point of mana for 1 point of hp,1.5,2. And set mana reuction of <--- to 0 and damage absorbed to 0.5. Then u create a trigger*.create a dummy,(make it ranged, and attack speed very fast, dmg up to u).
Trigger*:
Code:
Events
    Unit - A unit Begins casting an ability
Conditions
    (Ability being cast) Equal to [U][B]Your Skill[/B][/U]
Actions
    Set [B][U]A variable of type unit group*[/U][/B] = (Units within [B][U]Radius*[/U][/B] of (Position of (Triggering unit)))
    Unit Group - Pick every unit in [B][U]A variable of type unit group*[/U][/B] and do (Actions)
        Loop - Actions
            Unit - Create 1 [B][U]Your Dummy[/U][/B] for (Triggering player) at (Position of (Triggering unit)) facing Default building facing degrees
            (Unit - Create a generic expiration timer 1sec for (Last created unit))}I typed this myself,so it might not be exact
            Unit - Order (Last created unit) to Attack Once (Picked unit)
Oh and this is for exactly what u said, except, when fighting a group of creeps within the Radius*, it will attack a random unit.

So, in conclusion, make the trigger, and to make the spell, right - click on mana shield and create custom ability. Edit it according and under buff, insert bloodlust.

Thanks for the help, but that isn't what I'm looking for. Your trigger just creates a dummy unit that attacks a picked unit for every unit in the caster's radius.

What I wanted was a trigger that works when a unit is attacked, and has a 50% chance of creating a sort of after-image effect on my attacker and firing an extra arrow, dealing damage equal to my casters attack damage.

I can do most of that, but there seems to be no real or integer function for a units' attack damage and, honestly, that would solve everything.
 
This can handle the half damage part. You need NewGen.
To change this to fit your needs simple change "ABID = 'A001'" and replace the A001 with your spell rawcode, same for BFID, obviously the buff id.
PRED is the percent blocked off. Putting a 0.30 there would cause it to heal 30% of the damage done. If you need further instructions on this, feel free to ask. It'd be a simple thing to make a dummy appear but I think an effect would be cooler. For the attack speed, keep it to a spell and not triggers.

JASS:
scope Refraction initializer Init
    globals
        private constant integer ABID = &#039;A001&#039;
        private constant integer BFID = &#039;B001&#039;
        private constant real PRED = 0.50
    endglobals
    
    private function RC takes nothing returns boolean
        return GetSpellAbilityId() == ABID
    endfunction
    
    private function RAC takes nothing returns boolean
        if GetUnitAbilityLevel(GetTriggerUnit(),BFID) &gt; 0 then
            return true
        else
            call DestroyTrigger(GetTriggeringTrigger())
            return false
        endif
    endfunction
    
    private function RAT takes nothing returns nothing
        local real r = GetEventDamage()
        local real h = GetUnitState(GetTriggerUnit(),UNIT_STATE_LIFE)
        call SetUnitState(GetTriggerUnit(),UNIT_STATE_LIFE,h+(r*PRED))
        debug call BJDebugMsg(R2S(r*PRED) + &quot;damage healed out of &quot; + R2S(r))
    endfunction
    
    private function RA takes nothing returns nothing
        local trigger t = CreateTrigger()
        call TriggerRegisterUnitEvent(t,GetTriggerUnit(),EVENT_UNIT_DAMAGED)
        call TriggerAddAction(t, function RAT)
        call TriggerAddCondition(t, Condition(function RAC))
    endfunction
    
    private function Init takes nothing returns nothing
        local trigger t = CreateTrigger()
        local integer i = 0
        loop
        exitwhen i &gt; 15
            call TriggerRegisterPlayerUnitEvent(t,Player(i),EVENT_PLAYER_UNIT_SPELL_EFFECT,Condition(function FailSafe))
            set i = i + 1
        endloop
        call TriggerAddAction(t,function RA)
        call TriggerAddCondition(t,Condition(function RC))
    endfunction
endscope
 
This can handle the half damage part. You need NewGen.
To change this to fit your needs simple change "ABID = 'A001'" and replace the A001 with your spell rawcode, same for BFID, obviously the buff id.
PRED is the percent blocked off. Putting a 0.30 there would cause it to heal 30% of the damage done. If you need further instructions on this, feel free to ask. It'd be a simple thing to make a dummy appear but I think an effect would be cooler. For the attack speed, keep it to a spell and not triggers.

Thank you, but I dont really like using NewGen (not too sure why) or JASS (as long as I hardly understand it), so I thought I would mess around with GUI triggers for abit before deciding to use your trigger.

I figured that it might be easier to add a spellbook containing a customised Command Aura for the damage reduction, and then fiddle around with adding Specific Unit events for taking damage. I ended up with this;

Code:
InsanityStrafing
    Events
        Unit - A unit Is attacked
    Conditions
        ((Attacking unit) has buff Insanity Strafing (Ranger)) Equal to True
    Actions
        Trigger - Add to InsanityStrafing2 <gen> the event (Unit - (Attacked unit) Takes damage)

Code:
InsanityStrafing1
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Insanity Strafing (Ranger)
    Actions
        Unit - Add Insanity Strafing spllbook (Ranger) to (Triggering unit)
        Player - Disable Insanity Strafing spllbook (Ranger) for (Owner of (Triggering unit))
        Wait 6.00 seconds
        Unit - Remove Insanity Strafing spllbook (Ranger) from (Triggering unit)
        Player - Enable Insanity Strafing spllbook (Ranger) for (Owner of (Triggering unit))

Code:
InsanityStrafing2
    Events
    Conditions
        ((Damage source) has buff Insanity Strafing (Ranger)) Equal to True
    Actions
        Set temppoint = (Position of (Damage source))
        Set Integer = (Random integer number between 1 and 100)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Integer Less than or equal to 15
            Then - Actions
                Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) - (Damage taken))
                Unit - Create 1 StrafingDummy for (Owner of (Damage source)) at temppoint facing (Position of (Triggering unit))
                Animation - Change (Last created unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with (Random real number between 60.00 and 90.00)% transparency
                Unit - Order (Last created unit) to Neutral - Firebolt (Triggering unit)
                Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
            Else - Actions
        Custom script:   call RemoveLocation(udg_temppoint)
        Custom script:   set udg_temppoint = null

Code:
InsanityStrafing3
    Events
        Unit - A unit Finishes casting an ability
    Conditions
        (Ability being cast) Equal to Insanity Strafing arrowdummy (Ranger)
    Actions
        Unit - Remove (Triggering unit) from the game

Surprisingly, most of it works. Most of it.
For some reason, the unit my Ranger attacks takes ALOT of damage very quickly. The command aura in the spellbook is working, so I think it's the "Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) - (Damage taken))" part of the trigger. Could anyone shed some light on this?
 
You need to have some logic to add the unit event only once to InsanityStrafing2.

What is happening is that each time you attack with the buff the attacked unit is added to the InsanityStrafing2.

The trigger will only run once on the very first attack. After that InsanityStrafing2 is running once for everytime the unit has been attacked.
 
You need to have some logic to add the unit event only once to InsanityStrafing2.

What is happening is that each time you attack with the buff the attacked unit is added to the InsanityStrafing2.

The trigger will only run once on the very first attack. After that InsanityStrafing2 is running once for everytime the unit has been attacked.

Oh.. Sorry, I lack both logic and common sense ^^

Here's my first trigger again:
Code:
InsanityStrafing
    Events
        Unit - A unit Is attacked
    Conditions
        ((Attacking unit) has buff Insanity Strafing (Ranger)) Equal to True
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Attacked unit) is in InsanityStrafeunits) Equal to False
            Then - Actions
                Unit Group - Add (Attacked unit) to InsanityStrafeunits
                Trigger - Add to InsanityStrafing2 <gen> the event (Unit - (Attacked unit) Takes damage)
            Else - Actions

It works now, thank you, but I can't help but ask; Is there anything wrong with these triggers now?
 
General chit-chat
Help Users
  • The Helper The Helper:
    It is weird seeing a way more realistic users online number
  • The Helper The Helper:
    Happy Tuesday Night!
    +1
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    News portal has been retired. Main page of site goes to Headline News forum now
  • The Helper The Helper:
    I am working on getting access to the old news portal under a different URL for those that would rather use that for news before we get a different news view.
  • Ghan Ghan:
    Easily done
    +1
  • The Helper The Helper:
    https://www.thehelper.net/pages/news/ is a link to the old news portal - i will integrate it into the interface somewhere when i figure it out
  • Ghan Ghan:
    Need to try something
  • Ghan Ghan:
    Hopefully this won't cause problems.
  • Ghan Ghan:
    Hmm
  • Ghan Ghan:
    I have converted the Headline News forum to an Article type forum. It will now show the top 20 threads with more detail of each thread.
  • Ghan Ghan:
    See how we like that.
  • The Helper The Helper:
    I do not see a way to go past the 1st page of posts on the forum though
  • The Helper The Helper:
    It is OK though for the main page to open up on the forum in the view it was before. As long as the portal has its own URL so it can be viewed that way I do want to try it as a regular forum view for a while
  • Ghan Ghan:
    Yeah I'm not sure what the deal is with the pagination.
  • Ghan Ghan:
    It SHOULD be there so I think it might just be an artifact of having an older style.
  • Ghan Ghan:
    I switched it to a "Standard" article forum. This will show the thread list like normal, but the threads themselves will have the first post set up above the rest of the "comments"
  • The Helper The Helper:
    I don't really get that article forum but I think it is because I have never really seen it used on a multi post thread
  • Ghan Ghan:
    RpNation makes more use of it right now as an example: https://www.rpnation.com/news/
  • The Helper The Helper:

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top