Complicated trigger spell help

Smitty

Member
Reaction score
20
Ok, so here's what I'm trying to do;

Create a spell (castable on enemy heroes) which, when cast, gives the target hero a buff lasting 3 seconds. When this hero goes near another hero to which it is allied, the new hero is zapped, and given the buff also. Essentially what this should result in is the buff spreading by heroes being within X range of each other, until none of them is within that range of each other for 3 seconds. Then no unit will have the buff and the spell ends. Damage will be dealt bla bla bla bla so on.

The problem I have here is this, when I cast the spell on a hero, it duly zaps a hero near it, and then another. All told up to 3 heroes may be zapped at once, though I can't tell if this is going both ways between two units which both have the buff. However, what it ISN'T doing, which is what I'm trying to achieve, is to have all the heroes near each other being constantly zapped every X seconds. Here are the triggers;

Trigger:
  • Soul Shackles Cast
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Soul Shackles
    • Actions
      • Set Shackler = (Triggering unit)
      • Set TempPoint = (Position of (Triggering unit))
      • Unit - Create 1 Dummy 3 for (Owner of (Triggering unit)) at TempPoint facing Default building facing degrees
      • Unit Group - Add (Last created unit) to DummyGroup
      • Set ShackleDummy = (Last created unit)
      • Set Shackleable = (Units in (Playable map area) matching ((((Matching unit) belongs to an ally of (Owner of (Triggering unit))) Equal to False) and (((Matching unit) is A Hero) Equal to True)))
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Trigger - Turn on Soul Shackles Effect <gen>


Trigger:
  • Soul Shackles Buff
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • ((Ability being cast) Equal to Soul Shackles ) or ((Ability being cast) Equal to Soul Shackles Effect )
    • Actions
      • Unit Group - Add (Target unit of ability being cast) to Shackled
      • Unit - Order ShackleDummy to Orc Shaman - Bloodlust (Target unit of ability being cast)


Trigger:
  • Soul Shackles Effect
    • Events
      • Time - Every 0.50 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Remove all units of AlreadyShackled from AlreadyShackled
      • Unit Group - Pick every unit in Shackled and do (Actions)
        • Loop - Actions
          • Set TempUnit = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (TempUnit has buff Shackled Soul ) Equal to True
            • Then - Actions
              • Set TempPoint = (Position of TempUnit)
              • Set TempGroup = (Units within 500.00 of TempPoint matching ((((Matching unit) is in Shackleable) Equal to True) and ((((Matching unit) is in AlreadyShackled) Equal to False) and ((Matching unit) Not equal to TempUnit))))
              • Unit - Create 1 Dummy 3 for (Owner of Shackler) at TempPoint facing Default building facing degrees
              • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
              • Unit Group - Add (Last created unit) to DummyGroup
              • Unit Group - Remove all units of AlreadyShackled from AlreadyShackled
              • Unit Group - Pick every unit in TempGroup and do (Actions)
                • Loop - Actions
                  • Unit - Order (Last created unit) to Orc Far Seer - Chain Lightning (Picked unit)
                  • Unit Group - Add (Picked unit) to AlreadyShackled
                  • Unit - Cause Shackler to damage (Picked unit), dealing 50.00 damage of attack type Spells and damage type Normal
              • Custom script: call RemoveLocation(udg_TempPoint)
              • Unit Group - Remove all units of TempGroup from TempGroup
            • Else - Actions
              • Unit Group - Remove TempUnit from Shackled
          • Set TempUnit = No unit


Bloodlust is the spell which applies the buff, Chain Lightning is the lightning effect for it (called Soul Shackles effect).

Any thoughts please anyone? Thanks in advance :)

EDIT: It seems that while units are having the buff applied by the dummy casting bloodlust, the damage isn't actually being implemented... Wonder what this implies :s

2nd EDIT: Changed the 3rd trigger, now it seems to work a lot closer to what I wanted, but still not perfect, since it doesn't hit every unit every time, works more like a chain lightning, which is not what I want. Edited the trigger. Fixed damage being given, and it seems to be given to all the units it should be, but the spell isn't being cast on all of them. Not cool :( Really stuck at this point. Help me please TH! I need your wisdom!
 

Accname

2D-Graphics enthusiast
Reaction score
1,463
The phoenix fire ability might be what you are looking for.
You cast a dummy ability on an enemy hero, then you add your custom phoenix fire inside a disabled spellbook to the target hero.
You create a custom buff for the ability and make it target only allied heroes. You can set the duration of the buff, missle speed, range and even damage which might be dealt periodically, but isnt neccessary.
Checking when the buff expires is a lot harder. The problem lies within the fact that you cannot know which player has caused the buff opon which enemy.
One possibility to make this ability at least MPI would be to create separate abilitie levels with seperate buffs for each player. This would give the possibility to make it MPI rather easy.
You would need a damage detection system as well to check when a unit is hit by the phoenix fire dummy ability in order to spread it around. Once hit save the units inside a unit group and check periodically through the unit group looking for a unit without the buff.
 

Smitty

Member
Reaction score
20
I have a DD system, but the thing is I want heroes to take more damage when more heroes are near them, so taking X damage per nearby hero, but I don't think this would work for that method, since you can't detect how many different units are applying a buff :/

I just don't understand why my trigger doesn't work :(

Thanks for the input though :)
 

Wratox1

Member
Reaction score
22
may i ask why you have "Trigger - Turn on Soul Shackles Effect <gen>" in your "Soul Shackles Cast"-trigger? this probably doesnt have anything to do with the problem, but if you have another trigger that turns "Soul Shackles Effect" off that would be related as well..
 

Smitty

Member
Reaction score
20
Because there'll be another trigger to turn the spell off when it's no longer applicable, but that's not there yet, because it's currently redundant, since I can't make the rest of the dam spell work how I want it to :/
 

Wratox1

Member
Reaction score
22
ok ok, just wondering :)

perhaps you should make a demo map with the involved spells, units and triggers and upload it here?

that would make it a bit easier to fix the problem since then i can play around with the triggers and see what does what :)
 

Wratox1

Member
Reaction score
22
why not just upload it on the this site? as an attachment..

also i couldnt download it..


Edit:i downloaded it

let me get this straight, should it really be castable on enemy heroes? shouldnt you cast it on an allied heroes?
 

Smitty

Member
Reaction score
20
What? Um, since it deals damage and keeps doing so until they spread apart, it's definitely an offensive spell. Did you find any issues in the triggering? still can't make the dam thing work quite right :/
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
Sorry if im kinda necroing, this is my quick attempt at it, its in jass, idk if you use JNGP but if you do it should be pretty easy and self explanatory to set up:

JASS:
scope StaticShock /* &gt;<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite8" alt=":D" title="Big Grin    :D" loading="lazy" data-shortname=":D" />
    requires
        Timer32
        SpellEffectEvent
        AIDS*/
    
    globals
        private constant real RANGE =               500 //change to your spells range
        private constant real DURATION =              5 //time in seconds for your spell&#039;s debuff
        private constant integer ABIL_ID =       &#039;A000&#039; //change to your spells id
        private constant integer DUMMY_ID =      &#039;hfoo&#039; //change to a dummy unit&#039;s id (should have the same spell as your hero and unlimited mana)
        private constant string ORDER_STRING = &quot;defend&quot; //change to your order string of the spell
    endglobals
    
    private struct Data extends array
        static unit current
        player caster
        timer remove
        integer lagstopper
        
        private static method Static takes nothing returns boolean
            local unit u = GetFilterUnit()
            if IsUnitEnemy(u, GetOwner(current)) and IsUnitType(u, UNIT_TYPE_HERO) then
                call CreateUnit(GetUnitUserData(current).caster, DUMMY_ID, GetUnitX(current), GetUnitY(current), 0)
                call IssueInstantTargetOrder(bj_lastCreatedUnit, ORDER_STRING, u)
                call UnitApplyTimedLife(bj_lastCreatedUnit, 0, 3)
            endif
            return false
        endmethod
        
        private method periodic takes nothing returns nothing
            set current = GetIndexUnit(this)
            local real x = GetUnitX(current)
            local real y = GetUnitY(current)
            if this.lagstopper == 16 then
                set this.lagstopper = 0
                call GroupEnumUnitsInRange(bj_lastCreatedGroup, x, y, RANGE, Filter(function thistype.Static)
            else
                set this.lagstopper = this.lagstopper + 1
            endif
        endmethod
        
        implement T32x
        
        private static method removal takes nothing return nothing
            local thistype this = thistype(0).next
            local timer t = GetExpiredTimer()
            loop
                exitwhen this.remove == t
                set this = this.next
            endloop
            call this.stopPeriodic()
            set t = null
        endmethod
        
        private static method onCast takes nothing returns nothing
            local thistype this = GetUnitId(GetSpellTargetUnit())
            set this.caster = GetOwningPlayer(GetTriggerUnit())
            if not (this.remove == null) then
                call this.startPeriodic()
            endif
            call DestroyTimer(this.remove)
            set this.remove = CreateTimer()
            call TimerStart(this.remove, DURATION, false, function thistype.removal)
        endmethod
        
        private static method onInit takes nothing returns nothing
            call RegisterSpellEffectEvent(ABIL_ID, function onCast)
        endmethod
    endstruct
endscope


DISCLAIMER: I havent compiled this yet, ill do it when i get home.
 

Smitty

Member
Reaction score
20
JNGP? If that's newgen, I tried to get it working before, and couldn't. If this works... I'll actually send you a cake :D
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
yes JNGP is Jass NewGen Package...
i forgot to test it last night
when you install JNGP make sure you update JassHelper or it wont work, its easy to update if you follow the instructions
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
I edited it, the way it was at first it would deal the damage 32x/sec that an enemy hero was in range, i changed it to 2x/sec
 
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