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.
  • WildTurkey WildTurkey:
    is there a stephen green in the house?
    +1
  • The Helper The Helper:
    What is up WildTurkey?
  • The Helper The Helper:
    Looks like Google fixed whatever mistake that made the recipes on the site go crazy and we are no longer trending towards a recipe site lol - I don't care though because it motivated me to spend alot of time on the site improving it and at least now the content people are looking at is not stupid and embarrassing like it was when I first got back into this like 5 years ago.
  • The Helper The Helper:
    Plus - I have a pretty bad ass recipe collection now! That section of the site is 10 thousand times better than it was before
  • The Helper The Helper:
    We now have a web designer at my job. A legit talented professional! I am going to get him to redesign the site theme. It is time.
  • Varine Varine:
    I got one more day of community service and then I'm free from this nonsense! I polished a cop car today for a funeral or something I guess
  • Varine Varine:
    They also were digging threw old shit at the sheriff's office and I tried to get them to give me the old electronic stuff, but they said no. They can't give it to people because they might use it to impersonate a cop or break into their network or some shit? idk but it was a shame to see them take a whole bunch of radios and shit to get shredded and landfilled
  • The Helper The Helper:
    whatever at least you are free
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • 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 Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top