Hildagarn
Member
- Reaction score
- 20
JASS:
// +------------------------------------------------------------+
// | |
// | -=-=- Forked Entangle -=-=- |
// | -=-=- Trigger by Wolfie[NoCT] -=-=- |
// | -=-=- Idea by Hildagarn -=-=- |
// | Requires Jass NewGen |
// | |
// +------------------------------------------------------------+
// | |
// | Throws multiple surges of lightning at nearby enemy |
// | units. Units hit by this pulse of energy are |
// | paralyzed in place for a short period. |
// | |
// +------------------------------------------------------------+
// | |
// | -=-=- How To Implement -=-=- |
// | 1. Copy this trigger into your map |
// | 2. Copy the buffs into your map |
// | 3. Copy the abilities into your map |
// | 4. Copy the dummies into your map |
// | 5. Make sure the 'Rawcodes' in the trigger match |
// | your buffs/abilities/units in Object Editor |
// | 6. Customize the spell |
// | 7. Enjoy! |
// | |
// +------------------------------------------------------------+
// | -=-=- Version History -=-=- |
// | |
// | Version 1.0 |
// | - Initial release |
// | |
// +------------------------------------------------------------+
scope ForkEntangle initializer FEInit
// +-------------------------------------+
// | -=-=- MODIFY HERE -=-=- |
// | -=-=- MODIFY HERE -=-=- |
// | -=-=- MODIFY HERE -=-=- |
// +-------------------------------------+
globals
private constant integer FLID = 039;A01G039;
//Rawcode of the 'Forked Entangle' ability
private constant integer ERID = 039;A01A039;
//Rawcode of the 'Entangle' ability
private constant integer FDID = 039;A01H039;
//Rawcode of the 'Forked Dummy' ability
private constant integer DUID = 039;n00C039;
//Rawcode of the 'DummyCaster' unit
private constant string ERORDER = "entanglingroots"
//'Order String - Use/Turn On' of the 'Entangle' ability
private constant string FDORDER = "forkedlightning"
//'Order String - Use/Turn On' of the 'Forked Dummy' ability
private constant attacktype ATKTYPE = ATTACK_TYPE_NORMAL
//Attack Type of "Forked Entangle"
private constant damagetype DMGTYPE = DAMAGE_TYPE_NORMAL
//Damage Type of "Forked Entangle"
private constant boolean BONUS = true
//Include stat bonuses in damage?
endglobals
// +------------------------------------------------+
// | -=-=- Function Configurables -=-=- |
// +------------------------------------------------+
private function NUMBERHIT takes integer level returns integer
return (level + 2) + 1
//The number of units that get hit
endfunction
private function MULTIPLIER takes integer level returns real
return (level * 0.5)
//The amount to multiply the hero's stat by for damage
endfunction
// +----------------------------------------------+
// | -=-=- NO TOUCHIE PAST HERE -=-=- |
// | -=-=- NO TOUCHIE PAST HERE -=-=- |
// | -=-=- NO TOUCHIE PAST HERE -=-=- |
// +----------------------------------------------+
private function FEConditions takes nothing returns boolean
return (GetSpellAbilityId() == FLID)
endfunction
private function FEGConditions takes nothing returns boolean
return (IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit())) and GetUnitState(GetFilterUnit(), UNIT_STATE_LIFE) >= 0.405)
endfunction
private function FEActions takes nothing returns nothing
local unit tu = GetTriggerUnit()
local real tux = GetUnitX(tu)
local real tuy = GetUnitY(tu)
local integer QT = GetUnitAbilityLevel(tu, FLID)
local group FEGroup = CreateGroup()
local integer i = 0
local unit FoG
local unit u
call GroupEnumUnitsInRangeCounted(FEGroup, tux, tuy, 800, Filter(function FEGConditions), NUMBERHIT(QT))
loop
set FoG = FirstOfGroup(FEGroup)
exitwhen FoG == null
call UnitDamageTarget(tu, FoG, (GetHeroInt(tu, BONUS) * MULTIPLIER(QT)), true, true, ATKTYPE, DMGTYPE, WEAPON_TYPE_WHOKNOWS)
set u = CreateUnit(GetOwningPlayer(tu), DUID, tux, tuy, bj_UNIT_FACING)
call UnitAddAbility(u, FDID)
call SetUnitAbilityLevel(u, FDID, QT)
call IssueTargetOrder(u, FDORDER, FoG)
call UnitApplyTimedLife(u, 039;BTLF039;, 1.00)
set u = null
set u = CreateUnit(GetOwningPlayer(tu), DUID, tux, tuy, bj_UNIT_FACING)
call UnitAddAbility(u, ERID)
call SetUnitAbilityLevel(u, ERID, QT)
call IssueTargetOrder(u, ERORDER, FoG)
call UnitApplyTimedLife(u, 039;BTLF039;, 1.00)
call GroupRemoveUnit(FEGroup, FoG)
endloop
call DestroyGroup(FEGroup)
set u = null
set FoG = null
set tu = null
set FEGroup = null
endfunction
//====================================================================================================
private function FEInit takes nothing returns nothing
local trigger t = CreateTrigger()
local integer i = 0
loop
call TriggerRegisterPlayerUnitEvent(t, Player(i), EVENT_PLAYER_UNIT_SPELL_EFFECT, null)
set i = i + 1
exitwhen i == bj_MAX_PLAYER_SLOTS
endloop
call TriggerAddCondition(t, Condition(function FEConditions))
call TriggerAddAction(t, function FEActions)
endfunction
endscope
The entangled units do not get damaged. I have no idea about Jass so I couldn't tell what's whrong with it, but I do know the raw codes are correct.