How to create a spell initating off a 'x' amount of hits

trigger_newb

Active Member
Reaction score
3
I'm trying to create one of those skills where after a certain number of hits, you can release a huge attack. Can I get a general idea on this please? Thanks in advance
 

Moridin

Snow Leopard
Reaction score
144
It's probably an integer variable for every unit/player (depends on MUI/MPI) which counts the number of attacks made. Once the integer variable reaches a certain point, it adds an augmentation to the unit's next attack and then resets itself.
 

Rllulium

New Member
Reaction score
10
To do this flawlessly, I am positive that you'd need an attack detection system.
Unless the unit that will have this spell has no other means of damaging than normal attacks, in which case common damage detection will work.
 

crazyfanatic

New Member
Reaction score
20
Trigger:
  • trig1
    • Events:
      • A unit is attacked
    • Conditions:
      • Attacking unit has buff of type (Buff)
    • Actions:
      • Set (attacker) = Attacking unit
      • Trigger - Add to <trig2_gen> the event: (Triggering unit) takes damage


Trigger:
  • trig2
    • Events:
    • Conditions:
      • (damage taken) greater than or equal to 1.00
    • Actions:
      • If (hits) less than 10
      • Then - actions:
        • Set (hits) = ((hits) + 1)
      • Else- actions:
        • Unit - remove (buff) from (attacker)
 

crazyfanatic

New Member
Reaction score
20
problem is that i work from my phone and try to give just the base, so that you can easily continue, understand that for me even the easiest triggers are really hard to handwrite.
 

Jesus4Lyf

Good Idea™
Reaction score
397
This unleashes a crit every 5 attacks to triple damage. It is fully MUI/MPI, gains a bonus from a perfect Damage implementation (but can kinda do without it) and will not gain hits tracked from fake attacks (hitting stop when attacking).
JASS:
struct BamBamCritz extends array
    private constant integer HITS_TO_CRIT=5
    private method onCrit takes nothing returns nothing
        // Adds 2x dmg.
        call Damage_Pure(GetEventDamageSource(),GetTriggerUnit(),GetEventDamage()*2)
    endmethod
    private static constant boolean I_HAVE_A_PERFECT_DAMAGE_IMPLEMENTATION=false
    integer hits
    boolean attacking
    private method AIDS_onCreate takes nothing returns nothing
        set this.hits=0
    endmethod
    private static method AIDS_onInit takes nothing returns nothing
        local trigger t=CreateTrigger()
        call TriggerAddCondition(t,Filter(function thistype.onDamage))
        call Damage_RegisterEvent(t)
        set t=CreateTrigger()
        call TriggerAddCondition(t,Filter(function thistype.onAttack))
        call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_ATTACKED)
    endmethod
    //! runtextmacro AIDS()
    private static method onDamage takes nothing returns boolean
        local thistype this=thistype[GetEventDamageSource()]
        static if thistype.I_HAVE_A_PERFECT_DAMAGE_IMPLEMENTATION then
            set this.attacking=Damage_IsAttack()
        endif
        if this.attacking then
            set this.hits=this.hits+1
            if this.hits==HITS_TO_CRIT then
                set this.hits=0
                call this.onCrit()
            endif
        endif
        set this.attacking=false
        return false
    endmethod
    private static method onAttack takes nothing returns boolean
        set this.attacking=true
        return false
    endmethod
endstruct

I love taunting GUI users.
(Hand written, didn't check if it compiles. Requires Damage.)
 

Rllulium

New Member
Reaction score
10
This unleashes a crit every 5 attacks to triple damage. It is fully MUI/MPI, gains a bonus from a perfect Damage implementation (but can kinda do without it) and will not gain hits tracked from fake attacks (hitting stop when attacking).
JASS:

JASS

I love taunting GUI users.
(Hand written, didn't check if it compiles. Requires Damage.)

This looks like THE solution. I'd copy it myself right now if I were using Damage (I probably should be).

However, if there is interest in a GUI solution, I can post one I made a while ago.
 

Tarivol

New Member
Reaction score
2
How difficult is it for a new mapmaker to incorporate the Damage system, and the other things that Damage requires? I've seen alot of people make reference to it, but considering I'm almost entirely inexperienced with Jass, I'm wondering if it wouldn't be more trouble than it's worth, for me?
 

trigger_newb

Active Member
Reaction score
3
necrobump with purpose-

Sorry for the necro, I wasn't able to get on the forums and I'm still curious about this types of skill. Is there a way to do it in GUI? I just started learning JASS and I feel it's inappropriate to try and do it in JASS.
 

HydraRancher

Truth begins in lies
Reaction score
197
You dont need to learn JASS to implement it, my EGUI Core has like 10 triggers of JASS stuff which I cant even read the first 3 lines! (Not counting the little pictures they make with their script).



I Could make one, but it would detect spells too.
Trigger:
  • Initialization
    • Events
      • Map Initialization
    • Conditions
    • Actions
      • Hashtable - Create a Hashtable
      • Set Attacked Hashtable = (Last Created Hashtable)
      • Set Temp_Group = Units in (Playable Map Area)
      • Unit Group - Pick every unit in Temp_Group and do (Actions)
        • Loop - Actions
          • Trigger - Add event to Attacked (Picked Unit) takes damage
      • Custom Script: call DestroyGroup (udg_Temp_Group)


Trigger:
  • Enters
    • Events
      • Unit - A unit enters (Playable Map Area)
    • Conditions
    • Actions
      • Trigger - Add event to Attacked (Triggering Unit) takes damage


Trigger:
  • Attacked
    • Events
    • Conditions
    • Actions
      • Set Integer = Load Integer from 0 of (Key(Damage Source)) + 1
      • Hashtable - Set Integer as 0 of (Key(Damage Source))
        • If (all Conditions are true) then do (Actions) else do (Actions)
          • If - (Conditions)
            • Integer is greater than (>) 9
          • Then - (Actions)
            • Unit - Cause (Damage Source) to damage (Triggering Unit) dealing (Damage Taken) x 4.00 of type Normal type Universal
            • Set Integer = 0
          • Else - (Actions)
 

trigger_newb

Active Member
Reaction score
3
=]

I think that might do just fine, let me try it real quick and get back to you asap. Plus rep :D

Edit: sorry but can you list the variables? I'm especially confused about the damage source, I get it when you're using it to add damage to the unit that caused damage, but how can u load it from the hash tables?
 

trigger_newb

Active Member
Reaction score
3
You dont need to learn JASS to implement it, my EGUI Core has like 10 triggers of JASS stuff which I cant even read the first 3 lines! (Not counting the little pictures they make with their script).



I Could make one, but it would detect spells too.
Trigger:
  • rawr<div class="bbCodeBlock bbCodeBlock--screenLimited bbCodeBlock--code"><div class="bbCodeBlock-title">Trigger:</div><div class="wc3trigger"><ul class="wc3" id="wc3_6">
    • </ul>
    • </div></div>
Trigger:
  • <div class="bbCodeBlock bbCodeBlock--screenLimited bbCodeBlock--code"><div class="bbCodeBlock-title">Trigger:</div><div class="wc3trigger"><ul class="wc3" id="wc3_8">
    • <li class="lasttree"><span class="default">btw is this mui?</span></li>
    • </ul>
    • </div></div>
 
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

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top