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?
 

kelogsloops

You can change this now in User CP.
Reaction score
45
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
 

skyblader

You're living only because it's illegal killing.
Reaction score
159
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.
 

Mikazuki

New Member
Reaction score
0
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.
 

Prometheus

Everything is mutable; nothing is sacred
Reaction score
590
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
 

Mikazuki

New Member
Reaction score
0
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?
 

Dmshu

New Member
Reaction score
9
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.
 

Mikazuki

New Member
Reaction score
0
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
  • No one is chatting at the moment.
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top