function TargetFilter takes nothing returns boolean
return IsUnitEnemy(GetFilterUnit(), bj_groupEnumOwningPlayer) and IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false and IsUnitType(GetFilterUnit(), UNIT_TYPE_MAGIC_IMMUNE) == false and (GetWidgetLife(GetFilterUnit())>0.405)
endfunction
function DamageEnemiesArea takes unit whichUnit, real radius, real x, real y, real amount, boolean attack, boolean ranged, attacktype attackType, damagetype damageType, weapontype weaponType, string sfx returns nothing
local group g = CreateGroup()
local boolexpr b = Condition(function TargetFilter)
local real x1
local real y1
local unit t
set bj_groupEnumOwningPlayer = GetOwningPlayer(whichUnit)
call GroupEnumUnitsInRange(g, x, y, radius, b)
call DestroyBoolExpr(b)
loop
set t = FirstOfGroup(g)
exitwhen t == null
call GroupRemoveUnit(g,t)
set x1 = GetUnitX(t)
set y1 = GetUnitY(t)
call DestroyEffect(AddSpecialEffect(sfx, x1, y1))
call UnitDamageTarget(whichUnit,t,amount,attack, ranged,attackType,damageType,weaponType)
endloop
call DestroyGroup(g)
set g = null
set b = null
set x = 0.00
set y = 0.00
endfunction
Name | Type | is_array | initial_value |
Hasis | hashtable | No | |
Hostile | unit | No | |
RestoreGroup | group | No |
function Trig_Revive_Hostiles_Conditions takes nothing returns boolean
return GetOwningPlayer(GetDyingUnit()) == Player(PLAYER_NEUTRAL_AGGRESSIVE)
endfunction
function Trig_Revive_Hostiles_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local location l = GetUnitLoc(u)
call TriggerSleepAction(10)
call CreateNUnitsAtLoc(1, GetUnitTypeId(u), GetOwningPlayer(u), l, 0.00)
call RemoveLocation(l)
set u = null
endfunction
//===========================================================================
function InitTrig_Revive_Hostiles takes nothing returns nothing
set gg_trg_Revive_Hostiles = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Revive_Hostiles, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_Revive_Hostiles, Condition( function Trig_Revive_Hostiles_Conditions ) )
call TriggerAddAction( gg_trg_Revive_Hostiles, function Trig_Revive_Hostiles_Actions )
endfunction
function Trig_Hero_Revive_Conditions takes nothing returns boolean
return IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) == true
endfunction
function Trig_Hero_Revive_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local player p = GetOwningPlayer(u)
call TriggerSleepAction( 1.00 )
call ReviveHero( u, GetPlayerStartLocationX(p), GetPlayerStartLocationY(p), true )
if (GetLocalPlayer() == p) then
call PanCameraToTimed( GetPlayerStartLocationX(p), GetPlayerStartLocationY(p), 0.5)
endif
call SetUnitLifePercentBJ( u, 100 )
call SetUnitManaPercentBJ( u, 100 )
call UnitResetCooldown( u )
set u = null
set p = null
endfunction
//===========================================================================
function InitTrig_Hero_Revive takes nothing returns nothing
set gg_trg_Hero_Revive = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Hero_Revive, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_Hero_Revive, Condition( function Trig_Hero_Revive_Conditions ) )
call TriggerAddAction( gg_trg_Hero_Revive, function Trig_Hero_Revive_Actions )
endfunction
//***************************************************************************************************
//* ===================
//* Runing Destruction
//* ===================
//* Made by Shdow89
//*
//*
//* How to implement:
//* ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
//* 1. Copy the spell "Runing Destruction" to your map, along with it's buff.
//*
//* 2. Make a global variable of the type hashtable and name it Hasis
//*
//* 3. Copy the costum script section and paste it in your map.
//*
//* 4. Copy this trigger and Paste it in your map. Or you can just copy the code
//* make a trigger with a name Runing Destruction, convert it to costum text(JASS) and paste the code.
//*
//* 5. Change the rawcode of the spell and buff in this code, to the ones in your map, and use the spell.
//* Go down through constants and change what you like.
//*
//* Choosable/Effects:
//* ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
//* Go down through constant function and change to what you like. Units affected are:
//* Enemy Units, Non-Magic immune, Non-Structures and living. This can be changed in the
//* costum script section of the map.
//*
//* Editor's Word:
//* ¯¯¯¯¯¯¯¯¯¯¯¯¯¯
//* My third JASS spell. I'm really proud of this one xD, and I enjoyed making it.
//* Have fun and alter what you want, just remember to give credits :).
//*
//* Spells Action:
//* ¯¯¯¯¯¯¯¯¯¯¯¯¯¯
//* The caster enters a destructive state. Whenever he's moving he deals damage to nearby
//* enemy units. Faster the caster is, more damage he will deal. In addition 1 % of caster's
//* movement speed is transfered into damage.
//*
//* Credits:
//* ¯¯¯¯¯¯¯¯
//* Daelin for his tutorial about DistanceBetweenPoints.
//* Deuterium for his continous comments and help :) (Hope you like this one :))
//* And you for dling the map :).
//*
//*
//*************************************************************************************************
constant function Runing_Destruction_ID takes nothing returns integer
return 'A000' // Runing Destruction ability ID
endfunction
constant function Runing_Destruction_Buff_ID takes nothing returns integer
return 'B000' // It's buff ID
endfunction
constant function Caster_SFX takes nothing returns string
return "Abilities\\Spells\\Orc\\FeralSpirit\\feralspiritdone.mdl" // SFX for the caster
endfunction
constant function Target_SFX takes nothing returns string
return "Abilities\\Spells\\Other\\Volcano\\VolcanoMissile.mdl" // SFX for the target
endfunction
constant function Caster_SFX_Point takes nothing returns string
return "chest" // The attachment point for SFX for caster
endfunction
constant function Radius takes nothing returns real
return 200.00 // AOE of the spell
endfunction
constant function Timer_Loop takes nothing returns real
return 0.1 // How fast timer repeats
endfunction
constant function Damage_Per takes integer i returns real
return 0.2 * i // Damage, it's 20 % * level of the Runing Destruction
endfunction
constant function Speed_Damage takes nothing returns real
return 0.01 // extra damage from the movement speed it's 1 % now.
endfunction
//===========================================================================================
//Don't edit anything below this, if you are unsure.
//==============================================================================================
function Trig_Runing_Destruction_Conditions takes nothing returns boolean
return GetSpellAbilityId() == Runing_Destruction_ID()
endfunction
function Runing_Destruction_Effect takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit butters = LoadUnitHandle(udg_Hasis, GetHandleId(t), 1)
local real snail = GetUnitMoveSpeed(butters)*Speed_Damage()
local real damage = 0.00
local real x = LoadReal(udg_Hasis, GetHandleId(t), 2)
local real y = LoadReal(udg_Hasis, GetHandleId(t), 3)
local integer i = LoadInteger(udg_Hasis, GetHandleId(t), 4)
local real x1 = GetUnitX(butters)
local real y1 = GetUnitY(butters)
if (GetUnitAbilityLevel(butters, Runing_Destruction_Buff_ID()) > 0) then
if x != x1 or y != y1 then
set damage = Damage_Per(i) * SquareRoot((x1-x)*(x1-x) + (y1-y)*(y1-y)) + snail
call DestroyEffect(AddSpecialEffectTarget(Caster_SFX(), butters, Caster_SFX_Point()))
call DamageEnemiesArea (butters, Radius(), x1, y1, damage, true, false, ATTACK_TYPE_MAGIC, DAMAGE_TYPE_MAGIC, WEAPON_TYPE_WHOKNOWS, Target_SFX())
endif
call SaveReal(udg_Hasis, GetHandleId(t), 2, x1)
call SaveReal(udg_Hasis, GetHandleId(t), 3, y1)
else
call PauseTimer(t)
call DestroyTimer(t)
set butters = null
endif
endfunction
function Trig_Runing_Destruction_Actions takes nothing returns nothing
local timer t = CreateTimer()
local unit cartman = GetTriggerUnit()
local integer i = GetUnitAbilityLevel(cartman, Runing_Destruction_ID())
local real x = GetUnitX(cartman)
local real y = GetUnitY(cartman)
call SaveUnitHandle(udg_Hasis, GetHandleId(t), 1, cartman)
call SaveReal(udg_Hasis, GetHandleId(t), 2, x)
call SaveReal(udg_Hasis, GetHandleId(t), 3, y)
call SaveInteger(udg_Hasis, GetHandleId(t), 4, i)
call TimerStart(t, Timer_Loop(), true, function Runing_Destruction_Effect)
set cartman = null
endfunction
//==================================================================================================
function InitTrig_Runing_Destruction takes nothing returns nothing
local trigger trig = CreateTrigger()
local integer guza
set guza = 0
loop
call TriggerRegisterPlayerUnitEvent(trig, Player(guza), EVENT_PLAYER_UNIT_SPELL_EFFECT, null)
set guza = guza + 1
exitwhen guza == 16
endloop
call TriggerAddCondition(trig, Condition(function Trig_Runing_Destruction_Conditions))
call TriggerAddAction(trig, function Trig_Runing_Destruction_Actions)
call Preload(Caster_SFX())
call Preload(Target_SFX())
call PreloadStart()
set udg_Hasis = InitHashtable()
set trig = null
endfunction