• 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.

need a lil help to fix this spell...

Status
Not open for further replies.
Level 3
Joined
Mar 27, 2006
Messages
29
hey i download a spell pack of emjlr3s... forst death... i wanna use it on my map as a lvl 6.. bt the problem is tht wen the hero casts the spell buliding also take damage... m i copied the script here.. can some one tell me hw can i stop it from damaging buildings

//Variable Configuration:
constant function Frost_Death_SpellId takes nothing returns integer
return 'A003' //Rawcode of the ability being cast
endfunction

function Frost_Death_DummyID takes nothing returns integer
return 'u001' //Rawcode for the Frost Death (Dummy) unit
endfunction

constant function Frost_Death_Rings takes integer Level returns integer
return 4 + Level * 1 //Number of nova rings
endfunction

constant function Frost_Death_Amount takes integer Level returns integer
return 8 + Level * 2 //Number of novas per ring
endfunction

constant function Frost_Death_Distance takes integer Level returns integer
return 75 + Level * 0 //Distance between rings
endfunction

constant function Frost_Death_Wait takes integer Level returns real
return .07 - Level * 0 //Wait between each ring
endfunction

constant function Frost_Death_Damage takes real Level returns real
return 100 + Level * 25 //Damage done by each nova
endfunction

constant function Frost_Death_Radius takes real Level returns real
return 100 + Level * 0 //Radius of damage for each nova
endfunction

//Spell:
function Frost_Death_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local unit v
local integer i = GetUnitAbilityLevel(u, Frost_Death_SpellId())
local integer k = Frost_Death_DummyID()
local integer l = Frost_Death_Rings(i)
local integer m = 0
local integer n = 50
local integer o = Frost_Death_Amount(i)
local integer q = 0
local integer r = Frost_Death_Distance(i)
local integer s = 360 / o
local real R = Frost_Death_Damage(i)
local real S = Frost_Death_Radius(i)
local real T = Frost_Death_Wait(i)
local location L = GetUnitLoc(u)
local player p = GetOwningPlayer(u)
loop
set m = m + 1
exitwhen m > l
loop
set q = q + 1
exitwhen q > o
set v = CreateUnitAtLoc(p, k, PolarProjectionBJ(L, n, ( s * I2R(q) )), bj_UNIT_FACING )
call IssueTargetOrder( v, "frostnova", v )
call DamageEnemiesArea(u, S, GetUnitX(v), GetUnitY(v), R, false, true, ATTACK_TYPE_MAGIC, DAMAGE_TYPE_MAGIC, WEAPON_TYPE_AXE_MEDIUM_CHOP)
call UnitApplyTimedLife( v, 'BTLF', 1.00 )
endloop
call TriggerSleepAction( T )
set q = 0
set n = n + r
endloop
set u = null
set v = null
call RemoveLocation(L)
set L = null
set p = null
endfunction

//===========================================================================
function Frost_Death_Conditions takes nothing returns boolean
return GetSpellAbilityId() == Frost_Death_SpellId()
endfunction

function InitTrig_Frost_Death takes nothing returns nothing
set gg_trg_Frost_Death = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Frost_Death, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_Frost_Death, Condition( function Frost_Death_Conditions ) )
call TriggerAddAction( gg_trg_Frost_Death, function Frost_Death_Actions )
endfunction
 
Status
Not open for further replies.
Top