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 |
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
//***************************************************************************************************
//* ===================
//* Adrenaline
//* ===================
//* Made by Shdow89
//*
//*
//* How to implement:
//* ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
//* 1. Copy the spell "Adrenaline" to your map.
//*
//* 2. Copy the trigger trigger Adrenaline, and the entire Costum Script Section, and paste
//* it in your map. Change the spell rawcode, to the one in your map.
//*
//* 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 second JASS spell, it's fairly simple to make. Post comments and rate it at the
//* hive. Give credit if used, and enjoy :).
//*
//* Spells Action:
//* ¯¯¯¯¯¯¯¯¯¯¯¯¯¯
//* When adrenaline pumps the users blood, it enables him to completely absorb incoming damage.
//* If the damage he receives is very high, he will instead emit strong nova blasts around him
//* and deal damage to nearby enemies.
//*
//* Credits:
//* ¯¯¯¯¯¯¯¯
//* Daelin for his tutorial about Polar Projections.
//* And you for dling the map :).
//*
//*
//*************************************************************************************************
constant function Adrenaline_DodgeSFX takes nothing returns string
return "Abilities\\Spells\\NightElf\\Blink\\BlinkTarget.mdl" // SFX when unit absorbs damage
endfunction
constant function Adrenaline_NovaHit_SFX takes nothing returns string
return "Abilities\\Weapons\\Mortar\\MortarMissile.mdl" // SFX for units hit by nova blast
endfunction
constant function Nova_SFX takes nothing returns string
return "Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missile.mdl" // SFX for novas
endfunction
constant function Adrenaline_Rawcode takes nothing returns integer
return 'A000' // Adrenaline spell rawcode (change this to your rawcode)
endfunction
constant function Nova_Distance takes nothing returns real
return 150.00 // Distance between each nova
endfunction
constant function Nova_Time takes nothing returns real
return 0.2 // Time before next nova ring spawns
endfunction
constant function Nova_Count takes nothing returns integer
return 6 // Number of novas in each ring
endfunction
constant function Max_Damage takes integer i returns integer
return 50+(i*50) // Maximum damage that unit will absorb ( 50 + Adrenaline level * 50)
endfunction
constant function Max_Chance takes nothing returns integer
return 35 // Adrenaline activate chance
endfunction
constant function Damage_AOE takes nothing returns real
return 125.00 // AOE of the nova damage
endfunction
constant function Nova_Damage takes integer i returns real
return 25.00*i // Total damage each nova deals ( 50 + 50 * level of Adrenaline)
endfunction
//=========================================================================================
// Polar projection X and Y functions. Credit to Daelin.
function PolarProjectionX takes real x, real dist, real angle returns real
return x+dist*Cos(angle*bj_DEGTORAD)
endfunction
function PolarProjectionY takes real y, real dist, real angle returns real
return y+dist*Sin(angle*bj_DEGTORAD)
endfunction
//==========================================================================================
// Don't edit anything below this, if you are unsure.
function Trig_Adrenaline_Conditions takes nothing returns boolean
return GetLearnedSkillLevel() == 1 and GetLearnedSkill() == Adrenaline_Rawcode()
endfunction
//The function after damage receive.
function Trig_Adrenaline_MainActions takes nothing returns nothing
local unit kenny = GetTriggerUnit()
local integer chance = GetRandomInt(1, 100)
local integer counter2 = 0
local integer novas = Nova_Count()
local real damage = GetEventDamage()
local integer angle = 360/Nova_Count()
local real dist = Nova_Distance()
if chance <= Max_Chance() then
if Max_Damage(GetUnitAbilityLevel(kenny, Adrenaline_Rawcode())) > damage then
call SetUnitState(kenny, UNIT_STATE_LIFE, GetUnitState(kenny, UNIT_STATE_LIFE) + damage)
call DestroyEffect(AddSpecialEffect(Adrenaline_DodgeSFX(), GetUnitX(kenny), GetUnitY(kenny)))
else
loop
set counter2 = counter2 + 1
exitwhen counter2 > Nova_Count()
call DestroyEffect(AddSpecialEffect(Nova_SFX(), PolarProjectionX(GetUnitX(kenny), dist, I2R(counter2*angle)), PolarProjectionY(GetUnitY(kenny), dist, I2R(counter2*angle))))
call DamageEnemiesArea(kenny, Damage_AOE(), PolarProjectionX(GetUnitX(kenny), dist, I2R(counter2*angle)), PolarProjectionY(GetUnitY(kenny), dist, I2R(counter2*angle)), Nova_Damage(GetUnitAbilityLevel(kenny, Adrenaline_Rawcode())), true, false, ATTACK_TYPE_MAGIC, DAMAGE_TYPE_MAGIC, WEAPON_TYPE_WHOKNOWS, Adrenaline_NovaHit_SFX())
endloop
set counter2 = 0
set dist = dist + Nova_Distance()
call TriggerSleepAction(Nova_Time())
loop
set counter2 = counter2 + 1
exitwhen counter2 > Nova_Count()
call DestroyEffect(AddSpecialEffect(Nova_SFX(), PolarProjectionX(GetUnitX(kenny), dist, I2R(counter2*angle)), PolarProjectionY(GetUnitY(kenny), dist, I2R(counter2*angle))))
call DamageEnemiesArea(kenny, Damage_AOE(), PolarProjectionX(GetUnitX(kenny), dist, I2R(counter2*angle)), PolarProjectionY(GetUnitY(kenny), dist, I2R(counter2*angle)), Nova_Damage(GetUnitAbilityLevel(kenny, Adrenaline_Rawcode())), true, false, ATTACK_TYPE_MAGIC, DAMAGE_TYPE_MAGIC, WEAPON_TYPE_WHOKNOWS, Adrenaline_NovaHit_SFX())
endloop
set counter2 = 0
set dist = 0.00
endif
else
set kenny = null
set chance = 0
set damage = 0.00
set novas = 0
set angle = 0
endif
endfunction
//If the selected(unit with spell) unit has the spell, add him to damage event.
function Trig_Adrenaline_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local trigger t = CreateTrigger()
call TriggerRegisterUnitEvent(t, u, EVENT_UNIT_DAMAGED)
call TriggerAddAction(t, function Trig_Adrenaline_MainActions)
set u = null
set t = null
endfunction
//The init trigger
function InitTrig_Adrenaline takes nothing returns nothing
local trigger trig = CreateTrigger()
local integer sisa
set sisa = 0
loop
call TriggerRegisterPlayerUnitEvent(trig, Player(sisa), EVENT_PLAYER_HERO_SKILL , null)
set sisa = sisa + 1
exitwhen sisa == 16
endloop
call TriggerAddCondition(trig, Condition(function Trig_Adrenaline_Conditions))
call TriggerAddAction(trig, function Trig_Adrenaline_Actions)
call Preload(Adrenaline_DodgeSFX())
call Preload(Nova_SFX())
set sisa = 0
set trig = null
endfunction