Need help to make this spell

zero9x

Active Member
Reaction score
1
Hi guys, i got a idea for my next spell, but i can only think about it cuz i dont know how to make it, please help me :(

Bloody Strike

Passive

When your Hero attack an object, he gains 10% critical strike for each attack (limit 20/30/40/50% chance). When your Hero dont attack any objects in 1s, the critical chance will become 0%.
 

keychup

Active Member
Reaction score
34
you know how to use a spellbook? put the crit in that and disable the book.
11 levels, 0%+5% chance each.

When you attack a foe add your unit to a unit group.
Increase the level of the crit by 1 (and dont forget to cap it depending on the level: cap is level 5/7/9/11 which is 20/30/40/50%)
You will also need to give the unit a buff. the buff will be applied over and over again whenever you attack.
The buff should expire to signify that you have not attacked for a duration.

Every 0.5 seconds check all units in the unit group check if it has the buff. if it no longer has the buff it means he hasn't attacked for a while so now you can lower the level of crit by 1 every. You can keep lowering the crit by 1 until the unit has the buff again. If crit is at level 1 remove that unit from the group.
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
This is something i worked up, it works by increasing the level of a spellbook (which is disabled) each attack, this spellbook should have the crit ability for that rank that you want it to have
Negatives: Attack-Spam glitch affects this ability, not a ranked ability (could be added but would take some more time), ie: only one rank of the core ability works, but the crit should have multiple ranks
JASS:
scope BloodyStrikeScope/*
    requires
        RegisterUnitEvent by Magtheridon96 (http://www.thehelper.net/forums/showthread.php/168601-RegisterPlayerUnitEvent)
        UnitIndexer by Nestharus (http://www.thehelper.net/forums/showthread.php/153034-Unit-Indexer?highlight=Unit+Indexer+Nestharus)
        OR AIDS by J4L (http://www.thehelper.net/forums/showthread.php/130752-Advanced-Indexing-Data-Storage)*/
    
    globals
        private constant integer BOOK_ID     =    'A000' //ID of the book holding the crit ability
        private constant integer UNIT_ID     =    'hfoo' //ID of the unit-type the ability is for
        private constant integer MAX_INC     =         5 //Maximum increase to the book (book should have a max rank equal to this)
        private constant real TIME_OUT       =         3 //How long they have to not attack for to lose a rank (in seconds)
        private constant boolean USE_AIDS    =      true //This is if you have AIDS and UnitIndexer (idk why you would but i have seen it before)
    endglobals
    
    private struct BS extends array
        unit u
        timer t
        integer rank
        thistype next
        thistype prev
        
        static if USE_AIDS and LIBRARY_AIDS then
            private method AIDS_onCreate takes nothing returns nothing
                local unit u = GetIndexUnit(this)
        else if not USE_AIDS and LIBRARY_AutoIndex then
            private method index takes nothing returns nothing
                local unit u = GetUnitById(this)
        endif
            if GetUnitTypeId(u) == UNIT_ID then
                set this.u = u
                set this.t = CreateTimer()
                set this.rank = 0
                set this.next = this
                set this.prev = this
            endif
        endmethod
        
        static if USE_AIDS and LIBRARY_AIDS then
            private method AIDS_onDestroy takes nothing returns nothing
        else if not USE_AIDS and LIBRARY_AutoIndex then
            private method deindex takes nothing returns nothing
        endif
            call DestroyTimer(this.t)
        endmethod
        
        static if USE_AIDS and LIBRARY_AIDS then
            //! runtextmacro optional AIDS()
        else if not USE_AIDS and LIBRARY_UnitIndexer then
            implement optional UnitIndexStruct
        endif
        
        private static method onTimer takes nothing returns nothing
            local thistype this = thistype[0].next
            call DecUnitAbilityLevel(this.u, BOOK_ID)
            set this.rank = this.rank - 1
            set thistype[0].next = this.next
            set this.next.prev = 0
            if 0 < this.rank then
                set this.next = 0
                set this.prev = thistype[0].prev
                set this.prev.next = this
                set thistype[0].prev = this
            else
                call PauseTimer(this.t)
                set this.next = this
                set this.prev = this
            endif
        endmethod
        
        private static method onAttack takes nothing returns nothing
            local thistype this = GetUnitId(GetAttacker())
            if GetUnitTypeId(this.u) == UNIT_ID then
                call IncUnitAbilityLevel(this.u, BOOK_ID)
                set this.rank = this.rank + 1
                call ResumeTimer(this.t)
                call TimerStart(this.t, TIME_OUT, true, function thistype.onTimer)
                set this.next.prev = this.prev
                set this.prev.next = this.next
                set this.next = 0
                set this.prev = thistype[0].prev
                set this.prev.next = this
                set thistype[0].prev = this
            endif
        endmethod
        
        private static method onInit takes nothing returns nothing
            call RegisterPlayerUnitEvent(EVENT_PLAYER_UNIT_ATTACKED, function thistype.onAttack)
            set thistype[0].next = 0
            set thistype[0].prev = 0
        endmethod
        
    endstruct
endscope
 

zero9x

Active Member
Reaction score
1
Sorry but when i copied all Systems and Death Strike, its have an error like this picture, how can i fix this problem?
8db2935e97d0b5ef9a4eb7c6e2b78493_40653503.error.jpg
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • 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 The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      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