- Joined
- May 3, 2008
- Messages
- 3,154
Although this spells was working fine and I am 100% sure it was bugless. It would be better to play safe than be sorry. I hope some JASSER could view it and see if there is any part that could use improvement.
JASS:
function Trig_Demonic_Rampage_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A62U'
endfunction
function Trig_Demonic_Rampage_Actions takes nothing returns nothing
local unit caster=GetTriggerUnit()
local unit lastcreated
local location loc=GetSpellTargetLoc()
local effect sfx
local real x1=GetLocationX(loc)
local real y1=GetLocationY(loc)
local real x2
local real y2
local real facingangle
local integer index=1
set lastcreated=CreateUnit(GetOwningPlayer(caster),'n61P',x1,y1,270)
call UnitApplyTimedLife(lastcreated,'BTLF',3)
call IssuePointOrder(lastcreated,"stasistrap",x1,y1)
set lastcreated=null
set sfx=AddSpecialEffect("Abilities\\Spells\\Undead\\DarkRitual\\DarkRitualTarget.mdl",x1,y1)
call DestroyEffect(sfx)
loop
exitwhen index>(GetUnitAbilityLevel(caster,'A62U')*3)
set x2=x1+700*Cos((udg_angle+(120.00/I2R(GetUnitAbilityLevel(caster,'A62U'))))*bj_DEGTORAD)
set y2=y1+700*Sin((udg_angle+(120.00/I2R(GetUnitAbilityLevel(caster,'A62U'))))*bj_DEGTORAD)
set facingangle=bj_RADTODEG*Atan2(y1-y2,x1-x2)
set lastcreated=CreateUnit(GetOwningPlayer(caster),'n61O',x2,y2,facingangle)
call SetUnitTimeScale(lastcreated,1.3)
call UnitApplyTimedLife(lastcreated,'BTLF',6)
set lastcreated=null
set udg_angle=(udg_angle+(120.00/I2R(GetUnitAbilityLevel(caster,'A62U'))))
set index=index+1
endloop
call RemoveLocation(loc)
set udg_angle=0.00
set sfx=null
set caster=null
set loc=null
endfunction
//===========================================================================
constant function DRDF takes nothing returns boolean
return true
endfunction
function InitTrig_Demonic_Rampage takes nothing returns nothing
local trigger T = CreateTrigger()
local integer TI = 0
local filterfunc FF = Filter(function DRDF)
loop
exitwhen (TI >= bj_MAX_PLAYER_SLOTS)
call TriggerRegisterPlayerUnitEvent(T, Player(TI), EVENT_PLAYER_UNIT_SPELL_EFFECT, FF)
set TI = TI + 1
endloop
call DestroyBoolExpr(FF)
call DestroyFilter(FF)
call TriggerAddAction(T,function Trig_Demonic_Rampage_Actions)
call TriggerAddCondition(T,Condition(function Trig_Demonic_Rampage_Conditions))
set FF = null
set T = null
endfunction
JASS:
function Trig_Energy_Greed_Conditions takes nothing returns boolean
return GetUnitAbilityLevel(GetTriggerUnit(),'A62F')>0
endfunction
function Trig_Energy_Greed_Actions takes nothing returns nothing
local unit caster=GetTriggerUnit()
local integer level=GetUnitAbilityLevel(caster,'A62F')
local real manabefore=GetUnitState(caster,UNIT_STATE_MANA)
local real manaafter
local real manaadd
local real x
local real y
local effect sfx=null
call TriggerSleepAction(0.05)
set manaafter=GetUnitState(caster,UNIT_STATE_MANA)
call TriggerSleepAction(0.02)
set manaadd=((manabefore-manaafter)/2)
if GetRandomInt(1,10)<=level then
set x=GetUnitX(caster)
set y=GetUnitY(caster)
call SetUnitState(caster,UNIT_STATE_MANA,(GetUnitState(caster,UNIT_STATE_MANA)+manaadd))
set sfx=AddSpecialEffect("Abilities\\Spells\\Human\\Resurrect\\ResurrectTarget.mdl",x,y)
call TriggerSleepAction(0.01)
call DestroyEffect(sfx)
set sfx=null
endif
set caster=null
endfunction
//===========================================================================
constant function EGDF takes nothing returns boolean
return true
endfunction
function InitTrig_Energy_Greed takes nothing returns nothing
local trigger T = CreateTrigger()
local integer TI = 0
local filterfunc FF = Filter(function EGDF)
loop
exitwhen (TI >= bj_MAX_PLAYER_SLOTS)
call TriggerRegisterPlayerUnitEvent(T, Player(TI), EVENT_PLAYER_UNIT_SPELL_EFFECT, FF)
set TI = TI + 1
endloop
call DestroyBoolExpr(FF)
call DestroyFilter(FF)
call TriggerAddAction(T,function Trig_Energy_Greed_Conditions)
call TriggerAddCondition(T,Condition(function Trig_Energy_Greed_Actions))
set FF = null
set T = null
endfunction
JASS:
function Trig_Massive_Conversion_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A62J'
endfunction
function Boolean takes nothing returns boolean
return (IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE)==false) and (IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE)==false) and (GetWidgetLife(GetFilterUnit())>.415) and (IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO)==false) and (IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit()))==true)
endfunction
function Trig_Massive_Conversion_Actions takes nothing returns nothing
local unit caster=GetTriggerUnit()
local unit target
local effect sfx
local real x1=GetUnitX(caster)
local real y1=GetUnitY(caster)
local real x2
local real y2
call GroupEnumUnitsInRange(udg_MC_Group,x1,y1,500,Condition(function Boolean))
set target=FirstOfGroup(udg_MC_Group)
loop
exitwhen target==null
call SetUnitOwner(target,GetOwningPlayer(caster),true)
set x2=GetUnitX(target)
set y2=GetUnitY(target)
set sfx=AddSpecialEffect("Abilities\\Spells\\Other\\Charm\\CharmTarget.mdl",x2,y2)
call GroupRemoveUnit(udg_MC_Group,target)
set target=FirstOfGroup(udg_MC_Group)
call DestroyEffect(sfx)
set sfx=null
endloop
set caster=null
endfunction
//===========================================================================
constant function MCDF takes nothing returns boolean
return true
endfunction
function InitTrig_Massive_Conversion takes nothing returns nothing
local trigger T = CreateTrigger()
local integer TI = 0
local filterfunc FF = Filter(function MCDF)
loop
exitwhen (TI >= bj_MAX_PLAYER_SLOTS)
call TriggerRegisterPlayerUnitEvent(T, Player(TI), EVENT_PLAYER_UNIT_SPELL_EFFECT, FF)
set TI = TI + 1
endloop
call DestroyBoolExpr(FF)
call DestroyFilter(FF)
call TriggerAddAction(T,function Trig_Massive_Conversion_Actions)
call TriggerAddCondition(T,Condition(function Trig_Massive_Conversion_Conditions))
set FF = null
set T = null
endfunction
JASS:
function Trig_Multiple_Shot_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A62P'
endfunction
function Trig_Multiple_Shot_Actions takes nothing returns nothing
local unit caster=GetTriggerUnit()
local unit lastcreated
local location loc=GetSpellTargetLoc()
local real x1=GetUnitX(caster)
local real y1=GetUnitY(caster)
local real x2=GetLocationX(loc)
local real y2=GetLocationY(loc)
local real missilefacing=bj_RADTODEG*Atan2(y2-y1,x2-x1)
local real angle=(GetUnitFacing(caster)-(GetUnitAbilityLevel(caster,'A62P') * 10.00 ))
local real offsetx
local real offsety
local integer index=1
loop
exitwhen index>(GetUnitAbilityLevel(caster,'A62P')*5)
set lastcreated=CreateUnit(GetOwningPlayer(caster),'e605',x1,y1,missilefacing)
call UnitApplyTimedLife(lastcreated,'BTLF',2)
set offsetx=x2+150*Cos(angle*bj_DEGTORAD)
set offsety=y2+150*Sin(angle*bj_DEGTORAD)
call IssuePointOrder(lastcreated,"breathoffire",offsetx,offsety)
set lastcreated=null
set angle=angle+4.00
set index=index+1
endloop
call RemoveLocation(loc)
set caster=null
set loc=null
endfunction
//===========================================================================
constant function MSDF takes nothing returns boolean
return true
endfunction
function InitTrig_Multiple_Shot takes nothing returns nothing
local trigger T = CreateTrigger()
local integer TI = 0
local filterfunc FF = Filter(function MSDF)
loop
exitwhen (TI >= bj_MAX_PLAYER_SLOTS)
call TriggerRegisterPlayerUnitEvent(T, Player(TI), EVENT_PLAYER_UNIT_SPELL_EFFECT, FF)
set TI = TI + 1
endloop
call DestroyBoolExpr(FF)
call DestroyFilter(FF)
call TriggerAddAction(T,function Trig_Multiple_Shot_Actions)
call TriggerAddCondition(T,Condition(function Trig_Multiple_Shot_Conditions))
set FF = null
set T = null
endfunction
JASS:
function Trig_Napalm_Shock_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A62A'
endfunction
function Trig_Napalm_Shock_Actions takes nothing returns nothing
local unit caster=GetTriggerUnit()
local unit target=GetSpellTargetUnit()
local unit lastcreated
local real x1=GetUnitX(caster)
local real y1=GetUnitY(caster)
local real x2=GetUnitX(target)
local real y2=GetUnitY(target)
local real x3
local real y3
local real damage=40+(GetUnitAbilityLevel(caster,'A62A')*15)
local integer index=1
local real dx=x2-x1
local real dy=y2-y1
local real distance=SquareRoot(dx*dx+dy*dy)/100
local real angle=bj_RADTODEG*Atan2(y2-y1,x2-x1)
call UnitDamageTarget(caster,target,damage,true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Other\\Volcano\\VolcanoDeath.mdl",x1,y1))
loop
exitwhen index>R2I(distance)
set x3=x1+(udg_NS_Distance+100)*Cos(angle*bj_DEGTORAD)
set y3=y1+(udg_NS_Distance+100)*Sin(angle*bj_DEGTORAD)
set lastcreated=CreateUnit(GetOwningPlayer(caster),'n61G',x3,y3,angle)
set udg_NS_Distance=udg_NS_Distance+100
call UnitApplyTimedLife(lastcreated,'BTLF',0.2)
set lastcreated=null
set index=index+1
endloop
set lastcreated=CreateUnit(GetOwningPlayer(caster),'n61E',x2,y2,angle)
call UnitApplyTimedLife(lastcreated,'BTLF',3)
call UnitAddAbility(lastcreated,'A629')
call SetUnitAbilityLevel(lastcreated,'A629',GetUnitAbilityLevel(caster,'A62A'))
call IssueTargetOrder(lastcreated,"shadowstrike",target)
set udg_NS_Distance=0.00
endfunction
//===========================================================================
constant function NSDF takes nothing returns boolean
return true
endfunction
function InitTrig_Napalm_Shock takes nothing returns nothing
local trigger T = CreateTrigger()
local integer TI = 0
local filterfunc FF = Filter(function NSDF)
loop
exitwhen (TI >= bj_MAX_PLAYER_SLOTS)
call TriggerRegisterPlayerUnitEvent(T, Player(TI), EVENT_PLAYER_UNIT_SPELL_EFFECT, FF)
set TI = TI + 1
endloop
call DestroyBoolExpr(FF)
call DestroyFilter(FF)
call TriggerAddAction(T,function Trig_Napalm_Shock_Actions)
call TriggerAddCondition(T,Condition(function Trig_Napalm_Shock_Conditions))
set FF = null
set T = null
endfunction
JASS:
function Trig_Phoenix_Swap_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A634'
endfunction
function Trig_Phoenix_Swap_Actions takes nothing returns nothing
local unit caster=GetTriggerUnit()
local unit target=GetSpellTargetUnit()
local real x1=GetUnitX(caster)
local real x2=GetUnitX(target)
local real y1=GetUnitY(caster)
local real y2=GetUnitY(target)
call SetUnitX(caster,x2)
call SetUnitX(target,x1)
call SetUnitY(caster,y2)
call SetUnitY(target,y1)
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Other\\Doom\\DoomDeath.mdl",x1,y1))
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Other\\Doom\\DoomDeath.mdl",x2,y2))
if IsUnitEnemy(target,GetOwningPlayer(caster))==true then
call UnitDamageTarget(caster,target,50.00,true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
endif
set caster=null
set target=null
endfunction
//===========================================================================
constant function PSDF takes nothing returns boolean
return true
endfunction
function InitTrig_Phoenix_Swap takes nothing returns nothing
local trigger T = CreateTrigger()
local integer TI = 0
local filterfunc FF = Filter(function PSDF)
loop
exitwhen (TI >= bj_MAX_PLAYER_SLOTS)
call TriggerRegisterPlayerUnitEvent(T, Player(TI), EVENT_PLAYER_UNIT_SPELL_EFFECT, FF)
set TI = TI + 1
endloop
call DestroyBoolExpr(FF)
call DestroyFilter(FF)
call TriggerAddAction(T,function Trig_Phoenix_Swap_Actions)
call TriggerAddCondition(T,Condition(function Trig_Phoenix_Swap_Conditions))
set FF = null
set T = null
endfunction
JASS:
constant function Trig_Wind_Slash_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A62D'
endfunction
function WS_Filter takes nothing returns boolean
return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) != true and GetUnitState(GetFilterUnit(), UNIT_STATE_LIFE) >= .415 and IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit())) == true and IsUnitType(GetFilterUnit(), UNIT_TYPE_FLYING) != true and UnitIsSleeping(GetFilterUnit()) != true and IsUnitType(GetFilterUnit(), UNIT_TYPE_MAGIC_IMMUNE) != true and IsUnitHidden(GetFilterUnit()) != true)
endfunction
function Trig_Wind_Slash_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local unit v = GetSpellTargetUnit()
local real x = GetUnitX(v)
local real y = GetUnitY(v)
local integer loops = GetUnitAbilityLevel(u, 'A62D') * 2
local group g = CreateGroup()
local boolexpr bx = Filter(function WS_Filter)
call SetUnitInvulnerable( u, true )
call SetUnitVertexColor( u, 255, 255, 255, 127 )
call SelectUnit(u, false)
call PauseUnit( u, true )
call SetUnitPosition(u, x, y)
call PauseUnit(u, false)
call SetUnitAnimation( u, "attack" )
call UnitDamageTarget( u, v, GetRandomReal(150.00, 250.00), true, false, ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS)
call DestroyEffect(AddSpecialEffectTarget( "Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl", u, "chest" ))
loop
exitwhen (loops == 0)
call TriggerSleepAction( 0.20 )
set x = GetUnitX(v)
set y = GetUnitY(v)
set u = u
call GroupEnumUnitsInRange(g, x, y, 700., bx)
set v = GroupPickRandomUnit(g)
if ( v != null ) then
call SelectUnit(u, false)
call PauseUnit( u, true )
call SetUnitPosition( u, GetUnitX(v), GetUnitY(v) )
call PauseUnit( u, false )
call SetUnitAnimation( u, "attack" )
call UnitDamageTarget( u, v, GetRandomReal(150.00, 250.00), true, false, ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS)
call DestroyEffect(AddSpecialEffectTarget( "Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl", u, "chest" ))
else
exitwhen (true)
endif
set loops = loops - 1
endloop
if (GetLocalPlayer() == GetOwningPlayer(u)) then
call SelectUnit(u, true)
endif
call SetUnitVertexColor( u, 255, 255, 255, 255 )
call SetUnitInvulnerable( u, false )
call DestroyGroup(g)
call DestroyBoolExpr(bx)
set g = null
set bx = null
set u = null
set v = null
endfunction
//===========================================================================
constant function WSDF takes nothing returns boolean
return true
endfunction
function InitTrig_Wind_Slash takes nothing returns nothing
local trigger T = CreateTrigger()
local integer TI = 0
local filterfunc FF = Filter(function WSDF)
loop
exitwhen (TI >= bj_MAX_PLAYER_SLOTS)
call TriggerRegisterPlayerUnitEvent(T, Player(TI), EVENT_PLAYER_UNIT_SPELL_EFFECT, FF)
set TI = TI + 1
endloop
call DestroyBoolExpr(FF)
call DestroyFilter(FF)
call TriggerAddAction(T,function Trig_Wind_Slash_Actions)
call TriggerAddCondition(T,Condition(function Trig_Wind_Slash_Conditions))
set FF = null
set T = null
endfunction