[Spell Request] GUI and MUI Upgradeable Toss

junz13

New Member
Reaction score
1
Im in need of a GUI and MUI Upgradeable Toss. (The Toss in DotA where you grab a random nearby unit and toss it at another unit)

By Upgradeable I mean you can increase its damage,range and reduce it's cooldown, through tomes and etc.

I need its damage to depend on your heroes STR. Toss damage is 20*each point of STR.
 

eXirrah

New Member
Reaction score
51
Off Topic: Nice avatar Sooda is it connected to your currente reputation status: "Sooda is a sight to see"? :)

On Topic: Try to create the spell and if you can't do it we can help you. I don't have the nerve to create the whole spell man.
 

junz13

New Member
Reaction score
1
Okay then... well can anyone at least teach me how to edit the JASS Toss trigger to fulfill the role of the toss i requested? here is the code....
Code:
function Trig_Toss_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'A004'        
endfunction

function Toss_Unit_Group takes nothing returns boolean 
 if ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_ANCIENT) == true ) then  
 return false 
 endif 
 if IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) then 
 return false 
 elseif IsUnitType(GetFilterUnit(), UNIT_TYPE_FLYING) then 
 return false 
 elseif GetFilterUnit() == GetSpellAbilityUnit() then 
 return false 
 elseif IsUnitDeadBJ(GetFilterUnit()) then 
 return false 
 endif 
return true
endfunction

function Toss_Destroy_Trees takes nothing returns nothing
    call KillDestructable( GetEnumDestructable() )
endfunction

function TossFX takes nothing returns nothing
local effect f= bj_lastCreatedEffect
call TriggerSleepAction(0.4)
call DestroyEffect(f)
set f=null
endfunction

function Toss_Movement takes nothing returns nothing
local timer t=GetExpiredTimer()
local unit u=GetHandleUnit(t,"t")
local real b=GetHandleReal(t,"r")
local real n=GetHandleReal(t,"n")
local real d=GetHandleReal(t,"d")
local location l=GetHandleLocation(t,"l")
local real x=-d+(d*(b/50))
local location m=PolarProjectionBJ(l,x,n)
local real y=((b-25)*(b-25))
call SetUnitPositionLoc(u,m)
call SetUnitFlyHeight( u, ( 775-y ) , 10000.00 )
if GetRandomInt(1,4)==2 then
call AddSpecialEffectTargetUnitBJ( "origin", u, "Abilities\\Spells\\Undead\\Cripple\\CrippleTarget.mdl" )
call TriggerExecute(gg_trg_DestroyFX)
endif
set b=b+1
call SetHandleReal(t,"r",b)
set t=null
set u=null
set b=0
set n=0
set d=0
set l=null
set x=0
call RemoveLocation(m)
set m=null
set y=0
endfunction

function Trig_Toss_Actions takes nothing returns nothing
local group g=CreateGroup()
local unit c=GetTriggerUnit()
local unit a=null
local location l=GetSpellTargetLoc()
local timer t=null
local real b=1
local real d=0
local real n=0
call GroupEnumUnitsInRange(g,GetUnitX(c),GetUnitY(c),275,Condition(function Toss_Unit_Group))
set a=GroupPickRandomUnit(g)
call GroupClear(g)
if a!=null then    
    call SetUnitAnimationByIndex(c,4)
    call PauseUnitBJ( true, a )
    call SetUnitPathing( a, false )
    call SetUnitFacingToFaceLocTimed( a, l, 0 )
    call UnitAddAbilityBJ( 'A002', a )
    call UnitRemoveAbilityBJ( 'A002', a )    
    set t=CreateTimer()
    call SetHandleHandle(t,"t",a)
    call SetHandleReal(t,"r",b)    
    set d = DistanceBetweenPoints(GetUnitLoc(c), l)
    set n= AngleBetweenPoints(GetUnitLoc(c), l)
    call SetHandleReal(t,"d",d)
    call SetHandleReal(t,"n",n)
    call SetHandleHandle(t,"l",l)   
    call TimerStart(t,0.02,true,function Toss_Movement)
    call TriggerSleepAction(1.0)
    call RemoveLocation(l)
    set l=GetHandleLocation(t,"l")
    call RemoveLocation(l)
    call FlushHandleLocals(t)
    call PauseTimer(t)
    call DestroyTimer(t)
    call SetUnitFlyHeightBJ( a, GetUnitDefaultFlyHeight(a), 10000.00 )
    call PauseUnitBJ( false, a )
    call SetUnitPathing( a, true )    
    set l=GetUnitLoc(a)
    call DestroyEffect(AddSpellEffectByIdLoc('A0BZ', EFFECT_TYPE_TARGET, l))
    call TerrainDeformationRippleBJ( 0.2, true, l, 1.00, 300.00, 96.00, 1, 64.00 )
    call UnitDamageTargetBJ( c, a, 38.00 * I2R(GetUnitAbilityLevelSwapped('A004', c)) , ATTACK_TYPE_NORMAL, DAMAGE_TYPE_DEMOLITION )
    set g = GetUnitsInRangeOfLocAll(300.00, l)
    loop
        set a = FirstOfGroup(g)
        exitwhen a == null
        call GroupRemoveUnit(g,a)
        call UnitDamageTargetBJ( c, a, 75.00 * I2R(GetUnitAbilityLevelSwapped('A004', c)) , ATTACK_TYPE_NORMAL, DAMAGE_TYPE_DEMOLITION )     
    endloop
    call EnumDestructablesInCircleBJ( 300,l , function Toss_Destroy_Trees )
    call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl",GetLocationX(l),GetLocationY(l)))
endif
call DestroyGroup(g)
set g=null
set c=null
set a=null
call RemoveLocation(l)
set l=null
set t=null
set b=0
set n=0
set d=0
endfunction

//===========================================================================
function InitTrig_Toss takes nothing returns nothing
    set gg_trg_Toss = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Toss, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Toss, Condition( function Trig_Toss_Conditions ) )
    call TriggerAddAction( gg_trg_Toss, function Trig_Toss_Actions )
endfunction

this was emjlr3's Toss Trigger in an old DotA Spellpack... I will surely +rep anyone who helps me... :D
 

Sooda

Diversity enchants
Reaction score
318
Projectile takes 20% Toss damage and enemies get bonus damage from hero str (+20 per str point). It uses DotA Toss damage formula, each level deals +75 damage more (level 1 does 75 damage plus str bonus).

Make sure to change ability id with your made, find function 'Trig_Toss_Actions' and change ability id 'A004' to correct id.
JASS:
local real dmg = (GetUnitAbilityLevel(c,'A004')* 75.) + (GetHeroStr(c, true) * 20.)
You need to change ability id in function 'Trig_Toss_Conditions' too.

Toss distance and cooldown are controlled by actual ability on hero (You need to change fields in Object Editor, Ability Tab, Toss ability).

Create new trigger, convert it to custom text (From upper dropdown menu), change trigger name to 'Toss' (without '') and copy paste whole JASS in it. Make sure your map has correct handle variables system in your mapheader (click on your map name in Trigger Editor to access mapheader.) and follow emjlr3 implementation instructions.
JASS:
function Trig_Toss_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'A004'        
endfunction

function Toss_Unit_Group takes nothing returns boolean 
 if ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_ANCIENT) == true ) then  
 return false 
 endif 
 if IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) then 
 return false 
 elseif IsUnitType(GetFilterUnit(), UNIT_TYPE_FLYING) then 
 return false 
 elseif GetFilterUnit() == GetSpellAbilityUnit() then 
 return false 
 elseif IsUnitDeadBJ(GetFilterUnit()) then 
 return false 
 endif 
return true
endfunction

function Toss_Destroy_Trees takes nothing returns nothing
    call KillDestructable( GetEnumDestructable() )
endfunction

function TossFX takes nothing returns nothing
local effect f= bj_lastCreatedEffect
call TriggerSleepAction(0.4)
call DestroyEffect(f)
set f=null
endfunction

function Toss_Movement takes nothing returns nothing
local timer t=GetExpiredTimer()
local unit u=GetHandleUnit(t,"t")
local real b=GetHandleReal(t,"r")
local real n=GetHandleReal(t,"n")
local real d=GetHandleReal(t,"d")
local location l=GetHandleLocation(t,"l")
local real x=-d+(d*(b/50))
local location m=PolarProjectionBJ(l,x,n)
local real y=((b-25)*(b-25))
call SetUnitPositionLoc(u,m)
call SetUnitFlyHeight( u, ( 775-y ) , 10000.00 )
if GetRandomInt(1,4)==2 then
call AddSpecialEffectTargetUnitBJ( "origin", u, "Abilities\\Spells\\Undead\\Cripple\\CrippleTarget.mdl" )
call TriggerExecute(gg_trg_DestroyFX)
endif
set b=b+1
call SetHandleReal(t,"r",b)
set t=null
set u=null
set b=0
set n=0
set d=0
set l=null
set x=0
call RemoveLocation(m)
set m=null
set y=0
endfunction

function Trig_Toss_Actions takes nothing returns nothing
local group g=CreateGroup()
local unit c=GetTriggerUnit()
local unit a=null
local location l=GetSpellTargetLoc()
local timer t=null
local real b=1
local real d=0
local real n=0
local real dmg = (GetUnitAbilityLevel(c,'A004')* 75.) + (GetHeroStr(c, true) * 20.)
call GroupEnumUnitsInRange(g,GetUnitX(c),GetUnitY(c),275,Condition(function Toss_Unit_Group))
set a=GroupPickRandomUnit(g)
call GroupClear(g)
if a!=null then    
    call SetUnitAnimationByIndex(c,4)
    call PauseUnitBJ( true, a )
    call SetUnitPathing( a, false )
    call SetUnitFacingToFaceLocTimed( a, l, 0 )
    call UnitAddAbilityBJ( 'A002', a )
    call UnitRemoveAbilityBJ( 'A002', a )    
    set t=CreateTimer()
    call SetHandleHandle(t,"t",a)
    call SetHandleReal(t,"r",b)    
    set d = DistanceBetweenPoints(GetUnitLoc(c), l)
    set n= AngleBetweenPoints(GetUnitLoc(c), l)
    call SetHandleReal(t,"d",d)
    call SetHandleReal(t,"n",n)
    call SetHandleHandle(t,"l",l)   
    call TimerStart(t,0.02,true,function Toss_Movement)
    call TriggerSleepAction(1.0)
    call RemoveLocation(l)
    set l=GetHandleLocation(t,"l")
    call RemoveLocation(l)
    call FlushHandleLocals(t)
    call PauseTimer(t)
    call DestroyTimer(t)
    call SetUnitFlyHeightBJ( a, GetUnitDefaultFlyHeight(a), 10000.00 )
    call PauseUnitBJ( false, a )
    call SetUnitPathing( a, true )    
    set l=GetUnitLoc(a)
    call DestroyEffect(AddSpellEffectByIdLoc('A0BZ', EFFECT_TYPE_TARGET, l))
    call TerrainDeformationRippleBJ( 0.2, true, l, 1.00, 300.00, 96.00, 1, 64.00 )
    call UnitDamageTargetBJ( c, a,dmg * .2 , ATTACK_TYPE_NORMAL, DAMAGE_TYPE_DEMOLITION )
    set g = GetUnitsInRangeOfLocAll(300.00, l)
    loop
        set a = FirstOfGroup(g)
        exitwhen a == null
        call GroupRemoveUnit(g,a)
        call UnitDamageTargetBJ( c, a,dmg , ATTACK_TYPE_NORMAL, DAMAGE_TYPE_DEMOLITION )     
    endloop
    call EnumDestructablesInCircleBJ( 300,l , function Toss_Destroy_Trees )
    call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl",GetLocationX(l),GetLocationY(l)))
endif
call DestroyGroup(g)
set g=null
set c=null
set a=null
call RemoveLocation(l)
set l=null
set t=null
set b=0
set n=0
set d=0
endfunction

//===========================================================================
function InitTrig_Toss takes nothing returns nothing
    set gg_trg_Toss = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Toss, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Toss, Condition( function Trig_Toss_Conditions ) )
    call TriggerAddAction( gg_trg_Toss, function Trig_Toss_Actions )
endfunction


Off-topic: It's one of my old avatar, avatar gave nice feedback and I'm using it again after long time. I have always used ladies XD avatars. Picture change isn't connected with my reputation, I got reputation boost from someone (or many) which made it go over 700. After new year I had still below 700.
EDIT: My avatar and reputation comment goes pretty well together :p Nice find.
 

junz13

New Member
Reaction score
1
Thanx sooo much soooda!!! +REP i wish i could give you 10000 rep! :)) thanx so much!! ~~obviously im still a noob at this.
 

eXirrah

New Member
Reaction score
51
Off-topic: It's one of my old avatar, avatar gave nice feedback and I'm using it again after long time. I have always used ladies XD avatars. Picture change isn't connected with my reputation, I got reputation boost from someone (or many) which made it go over 700. After new year I had still below 700.
EDIT: My avatar and reputation comment goes pretty well together :p Nice find.

Off Topic: Well I was just curious :). Pretty cool coincidence
 
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

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top