• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Omnislash(Jass)

Status
Not open for further replies.
OK i have been trying to make this spell work.The special effects and everything works but the whole problem is that when i used it just randomly teleports me to the middle of map and then my hero gets kills for some reason which it shuoldnt do and also it doesnt do any dmg here's the code in JASS

JASS:
function Trig_Omnislash_Copy_Conditions takes nothing returns boolean
    if ( not ( GetSpellAbilityId() == 'A001' ) ) then
        return false
    endif
    return true
endfunction

function Trig_Omnislash_Copy_Actions takes nothing returns nothing
    call DisableTrigger( gg_trg_Teleport_Counter )
    set udg_caster = GetSpellAbilityUnit()
    set udg_target = GetSpellTargetUnit()
    call PauseUnitBJ( true, GetEventTargetUnit() )
    call PauseUnitBJ( true, GetTriggerUnit() )
    call SetUnitPathing( GetTriggerUnit(), false )
    call SetUnitAnimation( GetTriggerUnit(), "slam" )
    call TriggerSleepAction( 0.05 )
    call SetUnitTimeScalePercent( GetTriggerUnit(), 0.00 )
    call AddSpecialEffectTargetUnitBJ( "weapon", GetTriggerUnit(), "Abilities\\Spells\\Human\\Invisibility\\InvisibilityTarget.mdl" )
    call TriggerSleepAction( 2 )
    call SetUnitTimeScalePercent( GetTriggerUnit(), 100.00 )
    call DestroyEffectBJ( GetLastCreatedEffectBJ() )
    call AddSpecialEffectTargetUnitBJ( "weapon", GetTriggerUnit(), "Abilities\\Weapons\\ZigguratMissile\\ZigguratMissile.mdl" )
    set udg_bladetrail = GetLastCreatedEffectBJ()
    call SetUnitTimeScalePercent( GetTriggerUnit(), 200.00 )
    set bj_forLoopAIndex = 1
    set bj_forLoopAIndexEnd = 8
    loop
        exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
        set udg_point = OffsetLocation(GetUnitLoc(GetEventTargetUnit()), 150.00, ( 1 + 1 ))
        set udg_point = GetUnitLoc(GetEventTargetUnit())
        call SetUnitAnimationWithRarity( GetTriggerUnit(), "attack", RARITY_RARE )
        call TriggerSleepAction( 0.15 )
        call SetUnitPositionLocFacingLocBJ( GetTriggerUnit(), GetUnitLoc(GetEventTargetUnit()), GetUnitLoc(GetEventTargetUnit()) )
        call TriggerSleepAction( 0.25 )
        call SetUnitFacingToFaceUnitTimed( GetTriggerUnit(), GetEventTargetUnit(), 0 )
        call SetUnitAnimationWithRarity( GetTriggerUnit(), "attack", RARITY_RARE )
        call TriggerSleepAction( 0.25 )
        call SetUnitFacingToFaceUnitTimed( GetTriggerUnit(), GetEventTargetUnit(), 0 )
        call SetUnitAnimationWithRarity( GetTriggerUnit(), "attack", RARITY_RARE )
        set bj_forLoopAIndex = bj_forLoopAIndex + 1
    endloop
    call SetUnitTimeScalePercent( GetTriggerUnit(), 100.00 )
    call TriggerSleepAction( 0.25 )
    call SetUnitPositionLoc( GetTriggerUnit(), PolarProjectionBJ(GetUnitLoc(GetEventTargetUnit()), 100.00, ( GetUnitFacing(GetTriggerUnit()) + 180.00 )) )
    call SetUnitAnimation( GetTriggerUnit(), "slam" )
    call TriggerSleepAction( 0.30 )
    call SetUnitTimeScalePercent( GetTriggerUnit(), 0.00 )
    call TriggerSleepAction( 0.25 )
    call DestroyEffectBJ( udg_bladetrail )
    call AddSpecialEffectTargetUnitBJ( "weapon", GetTriggerUnit(), "Abilities\\Spells\\Other\\Charm\\CharmTarget.mdl" )
    call TriggerSleepAction( 1.00 )
    call AddSpecialEffectLocBJ( GetUnitLoc(GetEventTargetUnit()), "Abilities\\Spells\\Human\\Thunderclap\\ThunderClapCaster.mdl" )
    call AddSpecialEffectLocBJ( GetUnitLoc(GetEventTargetUnit()), "Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl" )
    call AddSpecialEffectLocBJ( GetUnitLoc(GetEventTargetUnit()), "Objects\\Spawnmodels\\Human\\HumanLargeDeathExplode\\HumanLargeDeathExplode.mdl" )
    call UnitDamageTargetBJ( GetTriggerUnit(), GetEventTargetUnit(), 8000.00, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_ENHANCED )
    call SetUnitTimeScalePercent( GetTriggerUnit(), 50.00 )
    call TriggerSleepAction( 1.00 )
    call SetUnitTimeScalePercent( GetTriggerUnit(), 100.00 )
    call ResetUnitAnimation( GetTriggerUnit() )
    call PauseUnitBJ( false, GetTriggerUnit() )
    call PauseUnitBJ( false, GetTriggerUnit() )
    call SetUnitPathing( GetTriggerUnit(), true )
    call EnableTrigger( GetTriggeringTrigger() )
endfunction

//===========================================================================
function InitTrig_Omnislash_Copy takes nothing returns nothing
    set gg_trg_Omnislash_Copy = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Omnislash_Copy, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Omnislash_Copy, Condition( function Trig_Omnislash_Copy_Conditions ) )
    call TriggerAddAction( gg_trg_Omnislash_Copy, function Trig_Omnislash_Copy_Actions )
endfunction

ill +rep whoever can help me please
found help
 
Last edited:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
THE LEAKS. . . .MY EYES!!!!!!

ok enough of the spongebob like jokes.

You are leaking a lot (so many it is not worth counting) locations per cast that will really hinder preformance in your map late game.
You also use a lot of BJ functions which reduce the efficency of the spell as they could be easilly subsituded with their native equivelents for no pratical difference (but run faster).
Your condition could be optimized to return just the boolean output instead of using an if statement which returns a boolean. This would greatly improve the efficency of the condition which will be noticable, especially since it is checked every time a unit casts a spell.
Avoid using LoopAIndex and rather use a local as it will reduce interfearence with other triggers as well as enable you to run the loop more efficently.

Try avoiding GUI to JASS converts as you endup pretty much having to completly remake the spell in JASS anyway.
 
Level 3
Joined
Jul 24, 2007
Messages
40
Dr. Super Good are you all right? This is like what the A-bombs did to people when they looked at it- their eyes melted

why do you
set udg_point = OffsetLocation(GetUnitLoc(GetEventTargetUnit()), 150.00, ( 1 + 1 ))
then do
set udg_point = GetUnitLoc(GetEventTargetUnit())
right after it?

does doing this twice make it a super cosmic unpausable unit?
call PauseUnitBJ( false, GetTriggerUnit() )
call PauseUnitBJ( false, GetTriggerUnit() )
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
Actually it was a joke from the spongebob movie where the king showed his "thining" head to the populase and everyone was shouting balled at him and someone said "MY EYES!!!" and showed a picture of one of the characters eyes burning.

Anyway, back on topic.

You can also store the triggering unit in a local to improve efficency of the spell drastically again.
 
Status
Not open for further replies.
Top