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.

      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