• 🏆 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!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

Ray spell help...

Status
Not open for further replies.
Level 36
Joined
Jul 1, 2007
Messages
6,677
I have a spell that gives a 100% chance to activate on attacks, but can only activate every 10 seconds. I used Pulverize to make the base ability, and it works fine, but I can't figure out what to do next.
I want it so that when the spell triggers, it fires out a line of explosions (holy light graphic) in the direction the hero is facing. The amount of explosions would be 6+(lvl*2).
I also want this spell to be in jass, because although I suck at it, I try to use as little GUI as possible because it's so annoying to use.

Someone please tell me exactly which functions I need to use and I will probably be able to figure out the rest.

Thanks,
~Void~
 
Passive spell with cooldown?
For that you can use the item ability Orb of Lightning (new)
Set the chance to hit to 100% and only change the cooldown of your original spell. Don't change the cooldown of orb of lightning.

However theres a bug with Orb of Lightning (new). It only casts if the unit gets an order to attack. That means if the unit attacks automatically the spell won't be casted.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
Well I made this which fires when you cast a spell (change rawcode) but im not sure if it will fire when a passive ability fires.

JASS:
function Trig_NewTrigger_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'A000'
endfunction
function Trig_NewTrigger_Actions takes nothing returns nothing
    local unit whichUnit = GetTriggerUnit()
    local real angle = GetUnitFacing(whichUnit)
    local real x = GetUnitX(whichUnit)
    local real y = GetUnitY(whichUnit)
    local integer num = GetUnitAbilityLevel(whichUnit, 'A000') * 2 + 6
    local integer i = 0
    local effect e
    loop
        exitwhen i == num
        set x = x + 50 * Cos(angle * bj_DEGTORAD)
        set y = y + 50 * Sin(angle * bj_DEGTORAD)
        set e = AddSpecialEffect("Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl", x, y)
        call DestroyEffect(e)
        call UnitDamagePoint(whichUnit, 0, 25, x, y, 100, true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_UNIVERSAL, WEAPON_TYPE_WHOKNOWS) 
        set i = i + 1
    endloop
    set whichUnit = null
endfunction

//==== Init Trigger NewTrigger ====
function InitTrig_NewTrigger takes nothing returns nothing
    set gg_trg_NewTrigger = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ( gg_trg_NewTrigger, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition(gg_trg_NewTrigger, Condition(function Trig_NewTrigger_Conditions))
    call TriggerAddAction(gg_trg_NewTrigger, function Trig_NewTrigger_Actions)
endfunction


If you need help with changing values and stuff just ask.
 
Status
Not open for further replies.
Top