Spell Lasso - The Real Dismember

emjlr3

Change can be a good thing
Reaction score
395
Lasso v1.00

lasso.jpg

Toss a magical rope around the target, grabbing it and holding it close.
.

Why Dismember sucks:
It has screwy casting distances, and neither the caster nor target can move during the spell.​

Why Lasso doesn't suck:
Both the caster and target can move while a unit is lassoed. The user can input a break distance at which point the lasso will snap, a minimum distance required for the lasso to illicit a pull effect, as well as an equation which allows completely unique pulling physics. In other words, this is what Dismember should have been.​

Spell Code
JASS:
scope Lasso initializer Init

private keyword data

globals
    // Configuration Options:
    private integer Abil_ID = 'A000' // Lasso ability rawcode
    private real Interval = .04 // Timer interval
    private real Height = 30. // Height of lightning
    private string Light = "LEAS" // Lightning effect created
    private string Sfx = "Abilities\\Weapons\\AncientProtectorMissile\\AncientProtectorMissile.mdl" // Effect created when a untit is pulled
    
    // Needed Globals:
    public trigger Trig = null
    private timer T = CreateTimer()
    private location L1 = null
    private location L2 = null
    private integer I = 0
    private data array D
endglobals

// Configuration Functions:
private function MaxDur takes integer lvl returns real
    return 10. // Max duration for spell
endfunction
private function PullEq takes integer lvl, real dist returns real
    return dist/50. // Equation for the strength of the pull effect per timer interval
endfunction
private function SlackDist takes integer lvl returns real
    return 200. // Distance at which no pull effect is created (all distances under this value)
endfunction
private function BreakDist takes integer lvl returns real
    return 800. // Distance at which the lasso snaps
endfunction

//***** No Touching Past This Point *****\\
private struct data
    unit u = null
    unit targ = null
    integer lvl
    lightning lasso = null
    real time = 0.
    
    method onDestroy takes nothing returns nothing
        call DestroyLightning(.lasso)
    endmethod
endstruct

private function Update takes nothing returns nothing
    local data d 
    local integer i = 1
    local real dist
    local real ang
    
    loop
        exitwhen i>I
        set d = D<i>
        
        set dist = SquareRoot(Pow(GetUnitX(d.u) - GetUnitX(d.targ), 2) + Pow(GetUnitY(d.u)-GetUnitY(d.targ),2))
        if GetWidgetLife(d.u)&lt;.405 or GetWidgetLife(d.targ)&lt;.405 or d.time&gt;MaxDur(d.lvl) or dist&gt;BreakDist(d.lvl) then
            call d.destroy()
            set D<i> = D<i>
            set I = I - 1
            set i = i - 1
        else    
            if dist&gt;SlackDist(d.lvl) then
                set ang = Atan2(GetUnitY(d.targ) - GetUnitY(d.u), GetUnitX(d.targ) - GetUnitX(d.u))
                call SetUnitX(d.targ,GetUnitX(d.targ)-PullEq(d.lvl,dist)*Cos(ang))
                call SetUnitY(d.targ,GetUnitY(d.targ)-PullEq(d.lvl,dist)*Sin(ang))
                call DestroyEffect(AddSpecialEffectTarget(Sfx,d.targ,&quot;origin&quot;))
            endif
            set L1 = GetUnitLoc(d.u)
            set L2 = GetUnitLoc(d.targ)
            call MoveLightningEx(d.lasso,true,GetUnitX(d.u),GetUnitY(d.u),GetLocationZ(L1)+Height,GetUnitX(d.targ),GetUnitY(d.targ),GetLocationZ(L2)+Height)
            call RemoveLocation(L1)
            call RemoveLocation(L2)
    
            set d.time = d.time + Interval
        endif
        
        set i = i + 1
    endloop
    
    if I==0 then
        call PauseTimer(T)
    endif
endfunction
private function Conds takes nothing returns boolean
    return GetSpellAbilityId()==Abil_ID
endfunction
private function Acts takes nothing returns nothing
    local data d = data.create()
    
    set d.u = GetTriggerUnit()
    set d.targ = GetSpellTargetUnit()
    set d.lvl = GetUnitAbilityLevel(d.u,Abil_ID)
    set L1 = GetUnitLoc(d.u)
    set L2 = GetUnitLoc(d.targ)
    set d.lasso = AddLightningEx(Light,true,GetUnitX(d.u),GetUnitY(d.u),GetLocationZ(L1)+Height,GetUnitX(d.targ),GetUnitY(d.targ),GetLocationZ(L2)+Height)
    
    set I = I + 1
    set D<i> = d
    if I==1 then
        call TimerStart(T,Interval,true,function Update)
    endif
    
    call RemoveLocation(L1)
    call RemoveLocation(L2)
endfunction

private function Init takes nothing returns nothing
    set Trig = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(Trig,EVENT_PLAYER_UNIT_SPELL_EFFECT)
    call TriggerAddCondition(Trig,Condition(function Conds))
    call TriggerAddAction(Trig,function Acts)
endfunction

endscope</i></i></i></i>


Don't mind the other triggers in the map. All you need to look at is what is contained within the Spells folder, specifically the trigger Lasso.​

Enjoy and please comment!
 

Attachments

  • lasso.jpg
    lasso.jpg
    48.6 KB · Views: 467
  • Lasso 1.00.w3x
    205 KB · Views: 732

the_ideal

user title
Reaction score
61
Very nice. I don't know JASS, but looking at it in game, it's a great spell. Good job, +rep.
 

Fluffball

Well-Known Member
Reaction score
35
Blizz should rehire their spell team

and their modelling team for Hatebreeder
 

Darius34

New Member
Reaction score
30
Regarding the comparison with Dismember, why would you be able to move while being bitten and chowed down on? o_O

But nice job. It works very smoothly and everything.
 

Forty

New Member
Reaction score
6
omg i love you and hate you...

i love you because its awesome and well-coded.
but i hate you because i had the same idea just yesterday :/

+rep anyway

@aceheart:

the functions take a level argument, so your data can be more dynamic
 

quraji

zap
Reaction score
144
So people who use this and actually look at the code can base the values on spell level :thup:

I think AceHart was asking "Why not constants?" in light of the fact that at the moment the functions don't actually use the level :p
 

emjlr3

Change can be a good thing
Reaction score
395
its all up to the users discression

Regarding the comparison with Dismember, why would you be able to move while being bitten and chowed down on? o_O

But nice job. It works very smoothly and everything.

if that be the case, then why on earth are they connected by a rope?
 

Mike889

New Member
Reaction score
15
Aha, that's awesomee!!

Increadible! It is actually something I'm going to use on my map.
^^

You rules emjlr3!
It is cool to mix this spell with another one, like Banish for example. I changed the damage type to spell and the result is a ghost trying to run from your rope ^^ And then you can freely cast your channeling spells.
 

Nexor

...
Reaction score
74
I made a very simple first-try JASS spell using lightnings to link to your target and in a few days others make similar spells :S

between good job, I couldn't make something like this
 

Darius34

New Member
Reaction score
30
if that be the case, then why on earth are they connected by a rope?
Uh, really? I don't recall. Dismember is Aerial-Shackles-based, but it doesn't use the Aerial Shackles animation IIRC.
 

emjlr3

Change can be a good thing
Reaction score
395
perhaps I am mistaken then
 
Reaction score
456
> Why not global constants?
It's better if the spell writer leaves some constants to functions, so they can differ from level to level.
 

emjlr3

Change can be a good thing
Reaction score
395
no one seems to hate this or have any problems, so I'll move it
 

wellwish3r

wishes wells.
Reaction score
52
Dismember does not connect the two units with a rope, it just uses a blood animation, instead of the shackle animation :p
 

emjlr3

Change can be a good thing
Reaction score
395
um....this uses a struct stack, no attachment system needed
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    Actually I was just playing with having some kind of mention of the food forum and recipes on the main page to test and see if it would engage some of those people to post something. It is just weird to get so much traffic and no engagement
  • The Helper The Helper:
    So what it really is me trying to implement some kind of better site navigation not change the whole theme of the site
  • Varine Varine:
    How can you tell the difference between real traffic and indexing or AI generation bots?
  • The Helper The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air
  • The Helper The Helper:
    New dessert added to recipes Southern Pecan Praline Cake https://www.thehelper.net/threads/recipe-southern-pecan-praline-cake.193555/
  • The Helper The Helper:
    Another bot invasion 493 members online most of them bots that do not show up on stats
  • Varine Varine:
    I'm looking at a solid 378 guests, but 3 members. Of which two are me and VSNES. The third is unlisted, which makes me think its a ghost.
    +1
  • The Helper The Helper:
    Some members choose invisibility mode
    +1
  • The Helper The Helper:
    I bitch about Xenforo sometimes but it really is full featured you just have to really know what you are doing to get the most out of it.
  • The Helper The Helper:
    It is just not easy to fix styles and customize but it definitely can be done
  • The Helper The Helper:
    I do know this - xenforo dropped the ball by not keeping the vbulletin reputation comments as a feature. The loss of the Reputation comments data when we switched to Xenforo really was the death knell for the site when it came to all the users that left. I know I missed it so much and I got way less interested in the site when that feature was gone and I run the site.
  • Blackveiled Blackveiled:
    People love rep, lol
    +1

      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