- Joined
- Dec 16, 2007
- Messages
- 252
This spell is not made by me. I pmed the creator but got no response.
Can someone tell me or post the new code, where it damages 8-12 damage per seconds and drains 10 mana per second? I know where the drain mana and damage lines are, but I don't know how to change them.
Can someone tell me or post the new code, where it damages 8-12 damage per seconds and drains 10 mana per second? I know where the drain mana and damage lines are, but I don't know how to change them.
JASS:
//TESH.scrollpos=0
//TESH.alwaysfold=0
globals
constant integer ArcticBlastID = 'A001'
constant integer ArcticBoltID = 'n002'
constant real ArcticBlastSpeed = 800
constant integer IceSlowID = 'A000'
constant integer IceSlowDummyID = 'n001'
endglobals
struct arctic
unit caster = null
trigger hit = null
timer move = null
group blast = null
real cx = 0.0
real cy = 0.0
real cost = 0.0
real min = 0.0
real max = 0.0
real dur = 0.0
real dis = 0.0
integer interval = 0
method onDestroy takes nothing returns nothing
if .hit != null then
call FlushHandleLocals(.hit)
call TriggerClearActions(.hit)
call DestroyTrigger(.hit)
endif
if .move != null then
call FlushHandleLocals(.move)
call DestroyTimer(.move)
endif
if .blast != null then
call DestroyGroup(.blast)
endif
endmethod
endstruct
function ArcticBlastH takes nothing returns nothing
local trigger t = GetTriggeringTrigger()
local arctic arc = GetHandleInt(t,"ArcticBlast")
local unit a = GetTriggerUnit()
if not IsUnitAliveBJ(a) or not IsUnitEnemy(a,GetOwningPlayer(arc.caster)) then
return
endif
//when a is alive and a is an enemy, a takes damage (Still need more conditions)
call UnitDamageTarget(arc.caster,a,GetRandomReal(arc.min,arc.max),false,true,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)
call IceSlowUnitTimed(a,arc.dur)
set a = null
endfunction
function ArcticBlastGM takes nothing returns nothing
local unit d = GetEnumUnit()
if IsUnitAliveBJ(d) then
call SetUnitPosition(d, TJGetPPX(GetUnitX(d),ArcticBlastSpeed/25,GetUnitFacing(d)), TJGetPPY(GetUnitY(d),ArcticBlastSpeed/25,GetUnitFacing(d)) )
endif
set d = null
endfunction
function ArcticBlastE takes nothing returns nothing
local timer t = GetExpiredTimer()
local arctic arc = GetHandleInt(t,"ArcticBlast")
local boolean b = true
local string o
local unit d
if GetUnitState(arc.caster,UNIT_STATE_MANA)<arc.cost then
call IssueImmediateOrder(arc.caster,"stop")
endif
set o = OrderId2String(GetUnitCurrentOrder(arc.caster))
if o != "channel" or arc.cx != GetUnitX(arc.caster) or arc.cy != GetUnitY(arc.caster) then
set b = false
call SetHandleInt(arc.caster,"ArcticBlast",0)
endif
if arc.interval > 0 and b then
set arc.interval = arc.interval - 1
elseif arc.interval == 0 and b then
set d = CreateUnit(GetOwningPlayer(arc.caster),ArcticBoltID,TJGetPPX(GetUnitX(arc.caster),50,GetUnitFacing(arc.caster)), TJGetPPY(GetUnitY(arc.caster),50,GetUnitFacing(arc.caster)),GetUnitFacing(arc.caster))
call SetUnitPathing(d,false)
call SetUnitExploded(d,true)
call TJSetUnitHeight(d,75)
call UnitApplyTimedLife(d,'BTLF',arc.dis/ArcticBlastSpeed)
call GroupAddUnit(arc.blast,d)
call TriggerRegisterUnitInRange(arc.hit,d,125,null)
set arc.interval = 2
call SetUnitState(arc.caster,UNIT_STATE_MANA,GetUnitState(arc.caster,UNIT_STATE_MANA)-arc.cost)
endif
if IsUnitGroupDeadBJ(arc.blast) then
call SetHandleInt(arc.caster,"ArcticBlast",0)
call arctic.destroy(arc)
else
call ForGroup(arc.blast,function ArcticBlastGM)
endif
set d = null
endfunction
function ArcticBlast takes unit c, real min, real max, real dis, real dur,real cost returns nothing
local arctic arc = GetHandleInt(c,"ArcticBlast")
if arc == 0 then
set arc = arctic.create()
set arc.hit = CreateTrigger()
call TriggerAddAction(arc.hit,function ArcticBlastH )
set arc.move = CreateTimer()
call TimerStart(arc.move,0.04,true, function ArcticBlastE)
set arc.blast = CreateGroup()
call SetHandleInt(arc.move,"ArcticBlast",arc)
call SetHandleInt(arc.hit,"ArcticBlast",arc)
call SetHandleInt(c,"ArcticBlast",arc)
endif
set arc.cx = GetUnitX(c)
set arc.cy = GetUnitY(c)
set arc.caster = c
set arc.cost = cost
set arc.min = min
set arc.max = max
set arc.dur = dur
set arc.dis = dis
endfunction
function ArcticBlastC takes nothing returns boolean
return GetSpellAbilityId() == ArcticBlastID
endfunction
function ArcticBlastA takes nothing returns nothing
local unit c = GetTriggerUnit()
local integer lvl = GetUnitAbilityLevel(c,ArcticBlastID)
call ArcticBlast(c,lvl*5,lvl*10,400+100*lvl,1,10)
//damage formula: lvl*5*12.5 to lvl*10*12.5
//damage = damage in tooltp / 12.5
set c = null
endfunction
//===========================================================================
function InitTrig_ArcticBlast takes nothing returns nothing
set gg_trg_ArcticBlast = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_ArcticBlast, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_ArcticBlast, Condition( function ArcticBlastC ) )
call TriggerAddAction( gg_trg_ArcticBlast, function ArcticBlastA )
endfunction