• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Some Spells From me

Status
Not open for further replies.
Level 19
Joined
Aug 24, 2007
Messages
2,888
Hello Everyone I just wanted to share some abilities I made they are simple but usefull

You need a global -Unit Group- variable named "locusts"
to use "Thunder Strike"


First you will need some functions for them in you map header


This is Unit Damage Area function made by PurplePoot and I added exploding to it
Used in "Thunder Strike"
JASS:
function DamageArea takes unit attacker, location point, real area, real damage returns nothing
    local unit u
    local group g = CreateGroup()
    local player p = GetOwningPlayer(attacker)
    call GroupEnumUnitsInRange(g,GetLocationX(point),GetLocationY(point),area,Filter(null))
    loop
        set u = FirstOfGroup(g)
        exitwhen u == null
        if IsUnitEnemy(u,p) and GetWidgetLife(u) > 0 and not (IsUnitType(u,UNIT_TYPE_MAGIC_IMMUNE) or IsUnitType(u,UNIT_TYPE_STRUCTURE)) then
            call SetUnitExploded(u,true)
            call UnitDamageTarget(attacker,u,damage,true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,null)
            call SetUnitExploded(u,false)
        endif
        call GroupRemoveUnit(g,u)
    endloop
    call DestroyGroup(g)
    set g = null
    set p = null
    set attacker = null
    set point = null
endfunction
This Function Creates a Thunder coming up from sky with a little random angle
Used in "Thunder Strike"
JASS:
function thunder takes location pos returns nothing
local effect spec
local lightning light
local real x = GetLocationX(pos)
local real y = GetLocationY(pos)
set light = AddLightningEx("CLPB",true,GetRandomReal(x-400,x+400),GetRandomReal(y-400,y+400),1000,x,y,0)
set spec = AddSpecialEffect("Abilities\\Weapons\\Bolt\\BoltImpact.mdl",x,y)
call DestroyEffect(spec)
call TriggerSleepAction(0.1)
call DestroyLightning(light)
set light = null
set spec = null
endfunction
This is same as thunder but without any angle (not needed if you are pro)
Used in "Thunderportation"
JASS:
function thundertrue takes location pos returns nothing
local effect spec
local lightning light
local real x = GetLocationX(pos)
local real y = GetLocationY(pos)
set light = AddLightningEx("CLPB",true,x,y,1000,x,y,0)
set spec = AddSpecialEffect("Abilities\\Weapons\\Bolt\\BoltImpact.mdl",x,y)
call DestroyEffect(spec)
call TriggerSleepAction(0.1)
call DestroyLightning(light)
set light = null
set spec = null
endfunction
This is a fingerofdeath shaped thunder with a explosion effect used in "Thunder Strike"
JASS:
function redthunder takes location pos returns nothing
local effect spec
local lightning light
local real x = GetLocationX(pos)
local real y = GetLocationY(pos)
set light = AddLightningEx("AFOD",true,x,y,1000,x,y,0)
set spec = AddSpecialEffect("buildings\\other\\MageTower\\MageTower.mdl",x,y)
call DestroyEffect(spec)
call TriggerSleepAction(0.5)
call DestroyLightning(light)
set light = null
set spec = null
endfunction
The functions you see here are two spell cast functions first is targerted 2nd is without target
You need to change <Unit Type> to a dummy spell caster with locust ability

Used in "Thunderportation" and "Curse Aura"
JASS:
function spellcaster takes player owner, integer spell,integer level,string spellorder, unit target returns nothing
local unit caster
local real x
local real y
set x = GetUnitX(target)
set y = GetUnitY(target)
set caster = CreateUnitAtLoc(owner,<Unit Type>,Location(x,y),bj_UNIT_FACING)
call UnitAddAbility(caster,spell)
call SetUnitAbilityLevel(caster,spell,level)
call IssueTargetOrder(caster,spellorder,target)
call UnitApplyTimedLife(caster,'BTLF',1)
set caster = null
set target = null
endfunction
JASS:
function spellnotarget takes unit mr, integer spell,integer level,string spellorder returns nothing
local unit caster
set caster = CreateUnitAtLoc(GetOwningPlayer(mr),<Unit Type>,GetUnitLoc(mr),bj_UNIT_FACING)
call UnitAddAbility(caster,spell)
call SetUnitAbilityLevel(caster,spell,level)
call IssueImmediateOrder(caster,spellorder)
call UnitApplyTimedLife(caster,'BTLF',1)
set caster = null
set mr = null
endfunction

This is all of functions lets come to Spells


This Spell Bombards selected area with many thunders each thunder does damage to an area and it ends with a more powerful thunder that does damage to whole area
Requirements:
1- A dummy effect unit with "Abilities\Spells\Human\FlameStrike\FlameStrikeTarget.mdl" model and with locust
2- You need to change <Ability Code> to your ability and <Effect Dummy> to the dummy effect unit you created
3- Also you need the things I determined on top
JASS:
function strikeac takes nothing returns nothing
local group g = CreateGroup()
local unit u
local location tar
local rect reg
call GroupAddGroup(udg_locusts,g)
loop
set u = FirstOfGroup(g)
exitwhen u == null
if GetUnitTypeId(u) == <Effect Dummy> then
set reg = RectFromCenterSizeBJ(GetUnitLoc(u), 450.00, 450.00)
set tar = GetRandomLocInRect(reg)
call DamageArea(u,tar,100,80)
call thunder(tar)
endif
call GroupRemoveUnit(g,u)
endloop
call DestroyGroup(g)
set g = null
call RemoveLocation(tar)
set tar = null
call RemoveRect(reg)
set reg = null
endfunction

function dummyac takes nothing returns nothing
local unit dummyu
local unit caster = GetTriggerUnit()
local location pos = GetSpellTargetLoc()
if  ( GetSpellAbilityId() == <Ability Code>)  then
set dummyu = CreateUnitAtLoc(GetOwningPlayer(caster),<Effect Dummy>,pos,bj_UNIT_FACING)
call DamageArea(caster,pos,300,0)
call SetUnitAnimation(dummyu,"birth")
call GroupAddUnit(udg_locusts,dummyu)
call TriggerSleepAction(3)
call GroupRemoveUnit(udg_locusts,dummyu)
call TriggerSleepAction(0.5)
call DamageArea(dummyu,pos,300,150)
call redthunder(pos)
call KillUnit(dummyu)
set dummyu = null
call RemoveLocation(pos)
set caster = null
endif
endfunction

//===========================================================================
function InitTrig_Thunder_Strike takes nothing returns nothing
    local trigger strike
    local trigger dummy
    set  dummy = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( dummy, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddAction( dummy, function dummyac )
    set  strike = CreateTrigger(  )
    call TriggerRegisterTimerEventPeriodic( strike, 0.05 )
    call TriggerAddAction( strike, function strikeac )
endfunction

This Ability creates a thunder upon caster hides it and moves it to casted area with another thunder unhides it, does damage and stuns nearby enemies
Requirements:
1- Some of functions I gave on top
2- You need to change <Main Ability> to ability you cast, <Storm Bolt based ability> to a dummy ability based on Storm Bolt which has 4 levels and unit ability no manacost etc (detects damage and stun time)
JASS:
function tportac takes nothing returns nothing
local unit caster
local location pos
local group g
local unit cu
local integer level
local unit dummy
if GetSpellAbilityId() == <Main Ability> then
set caster = GetTriggerUnit()
set level = GetUnitAbilityLevel(caster,<Main Ability>)
set pos = GetSpellTargetLoc()
set dummy = CreateUnitAtLoc(GetOwningPlayer(caster),<any invisible dummy unit>,pos,bj_UNIT_FACING)
call UnitApplyTimedLife(dummy,'BTLF',1)
set dummy = CreateUnitAtLoc(GetOwningPlayer(caster),<any invisible dummy unit>,GetUnitLoc(caster),bj_UNIT_FACING)
call UnitApplyTimedLife(dummy,'BTLF',1)
set dummy = null
call TriggerSleepAction(0.3)
call thundertrue(GetUnitLoc(caster))
call ShowUnitHide(caster)
call SetUnitPositionLoc(caster,pos)
call TriggerSleepAction(0.3)
    set g = GetUnitsInRangeOfLocAll(225.00, GetUnitLoc(caster))
        loop
            set cu = FirstOfGroup(g)
            exitwhen cu == null
            if ((IsUnitType(cu, UNIT_TYPE_MAGIC_IMMUNE) == false ) and ( IsUnitType(cu, UNIT_TYPE_STRUCTURE) == false ) and ( IsPlayerEnemy(GetOwningPlayer(GetTriggerUnit()),GetOwningPlayer(cu)) == true  )) then
            call spellcaster(GetOwningPlayer(caster),<Storm Bolt Based Ability>,level,"thunderbolt",cu)
            endif
            call GroupRemoveUnit(g,cu)
        endloop
    call DestroyGroup(g)
call TriggerSleepAction(0.2)
call thunder(pos)
call ShowUnitShow(caster)
call SelectUnitForPlayerSingle( caster, GetOwningPlayer(caster) )
endif
set caster = null
call RemoveLocation(pos)
set cu = null
endfunction

function InitTrig_Thunderportation takes nothing returns nothing
    local trigger tport
    set  tport = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( tport, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddAction( tport, function tportac )
endfunction
This is an on/off mana draining aura which reduces attack damage of nearby enemies
Requirements:
1- A function I determined on top
2- An ability based on immolation with <custom caster buff>
3- You need to make a dummy ability based on howl of terror with 4 levels no manacost etc (which detects damage reduction)
4- Change <Immolation> to immolation based ability and <HowlofTerror> to Howl of Terror Based Ability
JASS:
function addauraac takes nothing returns nothing
local unit u
local group g
set g = GetUnitsInRectAll(GetWorldBounds())
loop
set u = FirstOfGroup(g)
exitwhen u == null
 if ( UnitHasBuffBJ(u, <custom caster buff>) == true ) and ((GetUnitAbilityLevel(u,<Immolation>) > 0) == false) then
 call spellnotarget(u,<Immolation>,GetUnitAbilityLevel(u,<HowlofTerror>),"howlofterror")
 endif
call GroupRemoveUnit(g,u)
endloop
call DestroyGroup(g)
set g = null
set u = null
endfunction


function InitTrig_Curse_Aura takes nothing returns nothing
    local trigger addaura
    set addaura = CreateTrigger(  )
    call TriggerRegisterTimerEventPeriodic( addaura, 1 )
    call TriggerAddAction( addaura, function addauraac )
endfunction
 
Last edited:
Level 19
Joined
Aug 24, 2007
Messages
2,888
:p I just wanted to show how to make a lightning bombardment at all I really love that spell
foşş fuşş foşş fuşş foşş fuşş .... then booom :grin:
 
Status
Not open for further replies.
Top