~GaLs~
† Ғσſ ŧħə ѕαĸε Φƒ ~Ğ䣚~ †
- Reaction score
- 180
It has been a long long time that I has submitting spells, I'm start it again. 
~GaLs~ proudly presents the
Passive Spell Pack
This spell pack focus to the aspect of passive spell.
Since I saw in the forum, most of them are active spell, why no people making passive spell? I made it then. xD
All of the spell contains the following characteristic.
Now now, lets start the introduction.
*I will spoiler tag up all the spells as it takes time to load, if you are interested, just open it, else, ignore it and post at below.
Download it here:
View attachment [Spell Pack] Passive v1.2.w3x
[Spell Pack] Passive v1.1.w3x
[Spell Pack] Passive v1.0.w3x
Q - Why use filefront instead of uploading to this site?
A - This is not the final version, people will critic me, and I will upload newer version. I will only upload the final version to TH.
A - I don't know why can't press the attachment button...
Feel free to critic me. 
~GaLs~ proudly presents the
Passive Spell Pack
This spell pack focus to the aspect of passive spell.
Since I saw in the forum, most of them are active spell, why no people making passive spell? I made it then. xD
All of the spell contains the following characteristic.
- MUI (Multi Unit Instanceability)
- Lagless
- Fast
Now now, lets start the introduction.
*I will spoiler tag up all the spells as it takes time to load, if you are interested, just open it, else, ignore it and post at below.
Strength Requiem
Gold Transmittion
Critical Buff
Lucky Barrier
Code:
Give chances to increase owns damage but increases the enemy's armor as well.
Level 1 - 5% to increase its enemy's armor by 10 and increases self's damage by 100%.
Level 2 - 10% to increase its enemy's armor by 20 and increases self's damage by 200%.
Level 3 - 15% to increase the enemy's armor by 30 and increases self's damage by 300%.
Duration - 3 seconds.
JASS:
scope StrengthRequiem
//===================================================================================
// Strength Requiem
// by kentchow75/~GaLs~
//===================================================================================
//
// Implemention Instruction
//
//--------------------------------------------------------------------------------
// -Object Needed to be copied from Object Editor to your map.
// [ Ability ]
// 1. Increase Armor [R] [StrengthRequiem]
// 2. Increase Damage [D] [StrengthRequiem]
// 3. Strength Requiem
//
// [ Buff ]
// 1. Increase Armor [StrengthRequiem]
// 2. Increase Damage [StrengthRequiem]
// 3. Strength Requiem [StrengthRequiem]
//
// [ Unit ]
// 1. Dummy +Armor/+Damage [StrengthRequiem]
//--------------------------------------------------------------------------------
// -Trigger
// 1. Copy this whole trigger to your map.
//--------------------------------------------------------------------------------
// -Requirements
// 1. Jass NewGen WorldEditor from <a href="http://www.wc3campaigns.net" target="_blank" class="link link--external" rel="nofollow noopener">www.wc3campaigns.net</a>. ( v4b and above )
//--------------------------------------------------------------------------------
//===================================================================================
// Implementation End
//===================================================================================
//*******************************************************************************************
// Configuration (This is where you need to edit to make the spell works in your map)
//*******************************************************************************************
//
//<-------------------- Percentage -------------------->//
private constant function GetPercent takes integer level returns integer
return level*5 //Level * 5
endfunction
//<------------------ Percentage End ------------------>//
globals
//<-------------------- Rawcode -------------------->//
//
private constant integer SR_Id = 'A000'
//Rawcode of Strength Requiem
private constant integer SR_Dm = 'A003'
//Rawcode of Increase Damage [D] [Strength Requiem]
private constant integer SR_Am = 'A001'
//Rawcode of Increase Armor [A] [Strength Requiem]
private constant integer SR_Dy = 'h001'
//Rawcode of +Damage/Armor unit.
//
//<------------------ Rawcode End ------------------>//
//*******************************************************************************************
// Configuration End
//*******************************************************************************************
// -----------------------> Do not edit anything below this line. <-----------------------//
// -----------------------> Do not edit anything below this line. <-----------------------//
// -----------------------> Do not edit anything below this line. <-----------------------//
endglobals
private struct StrReq
unit atker
unit trgerunit
integer lvl
integer percent
method PlusArmor takes nothing returns nothing
local unit u = CreateUnit(GetOwningPlayer(.atker),SR_Dy,GetUnitX(.atker),GetUnitY(.atker),0)
call UnitAddAbility(u,SR_Am)
call SetUnitAbilityLevel(u,SR_Am,.lvl)
call UnitApplyTimedLife(u,'BTLF',1)
call IssueTargetOrder(u,"innerfire",.trgerunit)
set u = null
endmethod
method PlusDamage takes nothing returns nothing
local unit u = CreateUnit(GetOwningPlayer(.atker),SR_Dy,GetUnitX(.atker),GetUnitY(.atker),0)
call UnitAddAbility(u,SR_Dm)
call SetUnitAbilityLevel(u,SR_Dm,.lvl)
call UnitApplyTimedLife(u,'BTLF',1)
call IssueTargetOrder(u,"innerfire",.atker)
set u = null
endmethod
static method create takes unit atk, unit trg returns StrReq
local StrReq SR = StrReq.allocate()
set SR.atker = atk
set SR.trgerunit = trg
set SR.lvl = GetUnitAbilityLevel(SR.atker, SR_Id)
set SR.percent = GetPercent(SR.lvl)
if GetRandomInt(0,100) <= SR.percent then
call SR.PlusArmor()
call SR.PlusDamage()
endif
call SR.destroy()
return 0
endmethod
endstruct
private function SRCond takes nothing returns boolean
if GetUnitAbilityLevel(GetEventDamageSource(),SR_Id) > 0 then
call StrReq.create(GetEventDamageSource(),GetTriggerUnit())
endif
return false
endfunction
//<-- Damaged Main Engine -->//
globals
private trigger CALL_BACK = null
private trigger PERIODIC = CreateTrigger()
endglobals
private function pickedCond takes nothing returns boolean
return GetUnitState(GetFilterUnit(),UNIT_STATE_LIFE)>0 and IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE) == false
endfunction
private function pickedAct takes nothing returns nothing
call TriggerRegisterUnitEvent(CALL_BACK,GetEnumUnit(),EVENT_UNIT_DAMAGED)
endfunction
private function PeriodicAct takes nothing returns nothing
local group picked = CreateGroup()
//Setting Trigger
if CALL_BACK != null then
call DestroyTrigger(CALL_BACK)
endif
set CALL_BACK = CreateTrigger()
call TriggerAddCondition(CALL_BACK,Condition(function SRCond))
//End
call GroupEnumUnitsInRect(picked, bj_mapInitialPlayableArea,Condition(function pickedCond))
call ForGroup(picked, function pickedAct)
call DestroyGroup(picked)
set picked = null
endfunction
//<-- Damaged Main Engine End -->//
//===========================================================================
function InitTrig_Strength_Requiem takes nothing returns nothing
call TriggerRegisterTimerEvent(PERIODIC,.1,true)
call TriggerAddAction(PERIODIC,function PeriodicAct)
endfunction
endscope

Gold Transmittion
Code:
This unit has chances to poke a hole in its foe's poket and steals money from it.
Chances - 3 x Level.
Gold - 5 x Level.
JASS:
scope GoldTransmittion
//===================================================================================
// Gold Transmittion
// by kentchow75/~GaLs~
//===================================================================================
//
// Implemention Instruction
//
//--------------------------------------------------------------------------------
// -Object Needed to be copied from Object Editor to your map.
// [ Ability ]
// 1. Gold Transmittion
//
//--------------------------------------------------------------------------------
// -Trigger
// 1. Copy this whole trigger to your map.
//--------------------------------------------------------------------------------
// -Requirements
// 1. Jass NewGen WorldEditor from <a href="http://www.wc3campaigns.net" target="_blank" class="link link--external" rel="nofollow noopener">www.wc3campaigns.net</a>. ( v4b and above )
//--------------------------------------------------------------------------------
// -Optional
// 1. Import the icon in Import Manager to your map. It is Passive Transmute icon.
//===================================================================================
// Implementation End
//===================================================================================
//*******************************************************************************************
// Configuration (This is where you need to edit to make the spell works in your map)
//*******************************************************************************************
//
//
//<-------------------- Percentage -------------------->//
private constant function GetPercent takes integer level returns integer
return 3 * level //3 * Level
endfunction
//<------------------ Percentage End ------------------>//
//<-------------------- Gold -------------------->//
private constant function GetGold takes integer level returns integer
return 5 * level //Gold stole when ability fired. ( 5 * Level )
endfunction
//<------------------ Gold End ------------------>//
globals
// <-------------------- Rawcode -------------------->
//
private constant integer GT_ID = 'A004'
// Rawcode of Gold Transmittion
//
// <------------------ Rawcode End ------------------>
//
//
// <-------------------- Special Effect -------------------->
//
private constant string GT_SF = "UI\\Feedback\\GoldCredit\\GoldCredit.mdl"
// This is the special effect that will spawn when the ability is fired.
//
// <------------------ Special Effect End------------------>
//*******************************************************************************************
// Configuration End
//*******************************************************************************************
// -----------------------> Do not edit anything below this line. <-----------------------//
// -----------------------> Do not edit anything below this line. <-----------------------//
// -----------------------> Do not edit anything below this line. <-----------------------//
endglobals
globals
private sound GT_SD
endglobals
private struct GoldT
unit atker
unit atked
integer lvl
integer perc
integer gold
texttag tt
texttag tt2
method PlaySoundOnUnit takes sound soundHandle, real volumePercent, unit whichUnit returns nothing
call AttachSoundToUnitBJ(soundHandle, whichUnit)
call SetSoundVolumeBJ(soundHandle, volumePercent)
call StartSound(soundHandle)
endmethod
method StealGold takes nothing returns nothing
call SetPlayerState(GetOwningPlayer(.atked),PLAYER_STATE_RESOURCE_GOLD,GetPlayerState(GetOwningPlayer(.atked),PLAYER_STATE_RESOURCE_GOLD)-.gold)
call SetPlayerState(GetOwningPlayer(.atker),PLAYER_STATE_RESOURCE_GOLD,GetPlayerState(GetOwningPlayer(.atker),PLAYER_STATE_RESOURCE_GOLD)+.gold)
call DestroyEffect(AddSpecialEffectTarget(GT_SF,.atked,"overhead"))
call DestroyEffect(AddSpecialEffectTarget(GT_SF,.atker,"overhead"))
call .PlaySoundOnUnit(GT_SD,100, .atked)
endmethod
method CreateTT takes nothing returns nothing
set .tt = CreateTextTag()
call SetTextTagText(.tt,"-"+I2S(.gold),10 * 0.023 / 10)
call SetTextTagVelocityBJ(.tt, 64,90)
call SetTextTagPos(.tt, GetUnitX(.atked),GetUnitY(.atked),100)
call SetTextTagPermanent(.tt,false)
call SetTextTagFadepoint(.tt,1)
call SetTextTagColor(.tt,255,255,1,255)
call SetTextTagLifespan(.tt,2)
set .tt2 = CreateTextTag()
call SetTextTagText(.tt2,"+"+I2S(.gold),10 * 0.023 / 10)
call SetTextTagVelocityBJ(.tt2, 64,90)
call SetTextTagPos(.tt2, GetUnitX(.atker),GetUnitY(.atker),100)
call SetTextTagPermanent(.tt2,false)
call SetTextTagFadepoint(.tt2,1)
call SetTextTagColor(.tt2,255,255,1,255)
call SetTextTagLifespan(.tt2,2)
endmethod
static method create takes unit atk, unit atk_ed returns GoldT
local GoldT GT = GoldT.allocate()
set GT.atker = atk
set GT.atked = atk_ed
set GT.lvl = GetUnitAbilityLevel(atk, GT_ID)
set GT.perc = GetPercent(GT.lvl)
set GT.gold = GetGold(GT.lvl)
if GetRandomInt(0,100) <= GT.perc then
call GT.StealGold()
call GT.CreateTT()
endif
call GT.destroy()
return 0
endmethod
endstruct
private function GTCond takes nothing returns boolean
if GetUnitAbilityLevel(GetEventDamageSource(),GT_ID)>0 then
call GoldT.create(GetEventDamageSource(),GetTriggerUnit())
endif
return false
endfunction
//<-- Damaged Main Engine -->//
globals
private trigger CALL_BACK = null
private trigger PERIODIC = CreateTrigger()
endglobals
private function pickedCond takes nothing returns boolean
return GetUnitState(GetFilterUnit(),UNIT_STATE_LIFE)>0 and IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE) == false
endfunction
private function pickedAct takes nothing returns nothing
call TriggerRegisterUnitEvent(CALL_BACK,GetEnumUnit(),EVENT_UNIT_DAMAGED)
endfunction
private function PeriodicAct takes nothing returns nothing
local group picked = CreateGroup()
//Setting Trigger
if CALL_BACK != null then
call DestroyTrigger(CALL_BACK)
endif
set CALL_BACK = CreateTrigger()
call TriggerAddCondition(CALL_BACK,Condition(function GTCond))
//End
call GroupEnumUnitsInRect(picked, bj_mapInitialPlayableArea,Condition(function pickedCond))
call ForGroup(picked, function pickedAct)
call DestroyGroup(picked)
set picked = null
endfunction
//<-- Damaged Main Engine End -->//
//===========================================================================
function InitTrig_Gold_Transmittion takes nothing returns nothing
call TriggerRegisterTimerEvent(PERIODIC,.1,true)
call TriggerAddAction(PERIODIC,function PeriodicAct)
set GT_SD = CreateSound( "Abilities\\Spells\\Other\\Transmute\\AlchemistTransmuteDeath1.wav", false, true, true, 10, 10, "CombatSoundsEAX" )
call SetSoundParamsFromLabel( GT_SD, "TransmuteMissileImpact" )
call SetSoundDuration( GT_SD, 1601 )
endfunction
endscope

Critical Buff
Code:
This unit buffs nearby ally unit and gives them chances to deal critical damage.
Chances - 15+(10 x Level).
Multiply - 1.5+(0.5 x Level).
JASS:
scope CriticalBuff
//===================================================================================
// Critical Buff
// by kentchow75/~GaLs~
//===================================================================================
//
// Implemention Instruction
//
//--------------------------------------------------------------------------------
// -Object Needed to be copied from Object Editor to your map.
// [ Ability ]
// 1. Critical Strike [CS Buff]
// 2. Spell Book [CS Buff]
// 3. Critical Buff
//
// [ Buff ]
// 1. Critical Buff
//--------------------------------------------------------------------------------
// -Trigger
// 1. Copy this whole trigger to your map.
//--------------------------------------------------------------------------------
// -Requirements
// 1. Jass NewGen WorldEditor from <a href="http://www.wc3campaigns.net" target="_blank" class="link link--external" rel="nofollow noopener">www.wc3campaigns.net</a>. ( v4b and above )
//--------------------------------------------------------------------------------
//===================================================================================
// Implementation End
//===================================================================================
globals
//*******************************************************************************************
// Configuration (This is where you need to edit to make the spell works in your map)
//*******************************************************************************************
//
//
//<-------------------- Rawcode -------------------->//
//
private constant integer CB_ID = 'A007'
//Rawcode of Critical Buff
private constant integer CBR_ID = 'A005'
//Rawcode of Critical Strike [CS Buff]
private constant integer SB_ID = 'A006'
//Rawcode of Spell Book [CS Buff]
private constant integer CBBUFF_ID = 'B004'
//Rawcode of the buff Critical Buff
//
//<-------------------- Rawcode -------------------->//
//
endglobals
//
//<-------------------- Effect Range -------------------->//
//
private constant function GetEffectRange takes integer lvl returns real
return 450.+(100. * lvl) //How far will this buff affect
endfunction
//
//<-------------------- Effect Range End -------------------->//
//*******************************************************************************************
// Configuration End
//*******************************************************************************************
//*******************************************************************************************
// FAQ
//*******************************************************************************************
//
// Q. How to adjust the critical strike data? (Multiply, percentage and others)
// A. All of these can be adjust at "Critical Strike [CS Buff]" ability.
//
// Q. Is the effect range should be the same as the one in "Critical Buff" ability?
// A. Yes, it should be the same or else it will malfunction, use a nice formula to make it accurately same as in object editor.
//
//*******************************************************************************************
// FAQ End
//*******************************************************************************************
// -----------------------> Do not edit anything below this line. <-----------------------//
// -----------------------> Do not edit anything below this line. <-----------------------//
// -----------------------> Do not edit anything below this line. <-----------------------//
globals
private group HOST = CreateGroup()
private group CHILD = CreateGroup()
endglobals
private struct CritiBuff
static method ChildCond takes nothing returns boolean
return GetUnitAbilityLevel(GetFilterUnit(),CBBUFF_ID) >0
endmethod
static method HostAct takes nothing returns nothing
local unit host = GetEnumUnit()
local unit leecher
local integer lvl
local real Er = GetEffectRange(GetUnitAbilityLevel(host,CB_ID))
call GroupEnumUnitsInRange(CHILD, GetUnitX(host),GetUnitY(host),Er+9000,Condition(function CritiBuff.ChildCond))
set leecher = FirstOfGroup(CHILD)
set lvl = GetUnitAbilityLevel(host,CB_ID)
loop
exitwhen leecher == null
//<- Adding Real Buff ->//
if SquareRoot((GetUnitX(leecher)-GetUnitX(host)) * (GetUnitX(leecher)-GetUnitX(host)) + (GetUnitY(leecher)-GetUnitY(host)) * (GetUnitY(leecher)-GetUnitY(host))) < Er+30 then
if GetUnitAbilityLevel(leecher, CBR_ID) < lvl then
call UnitAddAbility(leecher,SB_ID)
call SetUnitAbilityLevel(leecher, CBR_ID,lvl)
call SetPlayerAbilityAvailable(GetOwningPlayer(leecher),SB_ID,false)
endif
elseif SquareRoot((GetUnitX(leecher)-GetUnitX(host)) * (GetUnitX(leecher)-GetUnitX(host)) + (GetUnitY(leecher)-GetUnitY(host)) * (GetUnitY(leecher)-GetUnitY(host))) > Er+30 then
call UnitRemoveAbility(leecher, CBR_ID)
call UnitRemoveAbility(leecher, SB_ID)
endif
//<- Adding Real Buff End ->//
call GroupRemoveUnit(CHILD,leecher)
set leecher = FirstOfGroup(CHILD)
endloop
set leecher = null
set host = null
endmethod
static method HostCond takes nothing returns boolean
return GetUnitAbilityLevel(GetFilterUnit(),CB_ID) > 0
endmethod
static method create takes nothing returns CritiBuff
local CritiBuff cb = CritiBuff.allocate()
call GroupEnumUnitsInRect(HOST,bj_mapInitialPlayableArea,Condition(function CritiBuff.HostCond))
call ForGroup(HOST,function CritiBuff.HostAct)
call cb.destroy()
return 0
endmethod
endstruct
//===========================================================================
function InitTrig_Critical_Buff takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerAddAction(t, function CritiBuff.create)
call TriggerRegisterTimerEvent(t,0.1,true)
endfunction
endscope

Lucky Barrier
Code:
Can bashes any unit that attacks this unit.
7 x level %
Damage - 50 x level
Distance - 400 per second
Period - 00.25 x lvl
JASS:
scope LuckyBarrier
//===================================================================================
// Lucky Barrier
// by kentchow75/~GaLs~
//===================================================================================
//
// Implemention Instruction
//
//--------------------------------------------------------------------------------
// -Object Needed to be copied from Object Editor to your map.
// [ Ability ]
// 1. Lucky Barrier
//
// [ Buff ]
// 1. Lucky Barrier
//--------------------------------------------------------------------------------
// -Trigger
// 1. Copy this whole trigger to your map.
// 2. Copy ABC to your map if you don't have one.
//--------------------------------------------------------------------------------
// -Requirements
// 1. Jass NewGen WorldEditor from <a href="http://www.wc3campaigns.net" target="_blank" class="link link--external" rel="nofollow noopener">www.wc3campaigns.net</a>. ( v4b and above )
// 2. ABC system.
//--------------------------------------------------------------------------------
//===================================================================================
// Implementation End
//===================================================================================
//*******************************************************************************************
// Configuration (This is where you need to edit to make the spell works in your map)
//*******************************************************************************************
//
//<-------------------- Percentage -------------------->//
private constant function GetPercentage takes integer lvl returns integer
return lvl * 7 //lvl x 7
endfunction
//<------------------ Percentage End ------------------>//
//
//<-------------------- Damage -------------------->//
private constant function GetDamage takes integer lvl returns real
return lvl * 50. //lvl x 50
endfunction
//<-------------------- Damage End -------------------->//
//
//<-------------------- Period -------------------->//
private constant function GetPeriod takes integer lvl returns real
return .25 * lvl//0.25 * lvl
endfunction
//<-------------------- Period End -------------------->//
globals
//<-------------------- Rawcode -------------------->//
private constant integer LB_ID = 'A008' //Rawcode of Lucky Barrier Ability
private constant integer LBBuff_ID = 'B005' //Rawcode of Lucky Barrier Buff
//<-------------------- Rawcode End -------------------->//
//
//<-------------------- Slide Rate -------------------->//
private constant real LB_SLIDE_RATE = 8. // Slide the unit x range per LB_SPD second
//<-------------------- Slide Rate End -------------------->//
//
//<-------------------- Speed -------------------->//
private constant real LB_SPD = 0.02 //The current spd is 8 range per 0.02 sec. (Aka 400 range per second)
//<-------------------- Speed End-------------------->//
//
//<-------------------- Effects -------------------->//
private constant string LB_KS_EFFECT = "Abilities\\Spells\\NightElf\\SpiritOfVengeance\\SpiritOfVengeanceBirthMissile.mdl"
// ^ The effect that appear when knocking back a unit.
private constant string LB_SHIELD_EFFECT = "Abilities\\Spells\\Items\\SpellShieldAmulet\\SpellShieldCaster.mdl"
// ^ The effect that appear at the caster when this spell is fired.
//<-------------------- Effects End -------------------->//
//*******************************************************************************************
// Configuration End
//*******************************************************************************************
// -----------------------> Do not edit anything below this line. <-----------------------//
// -----------------------> Do not edit anything below this line. <-----------------------//
// -----------------------> Do not edit anything below this line. <-----------------------//
endglobals
private struct LBarrier
unit atked
unit atker
integer lvl
real array x [3]
real array y [3]
real newx
real newy
real stopx
real stopy
real BashAngle
real Counter = 0
real TotalPeriod
boolean fired
timer SlideT = CreateTimer()
private static method slide takes nothing returns nothing
local timer t = GetExpiredTimer()
local LBarrier lb = GetTimerStructA(t)
set lb.newx = lb.x[2] + LB_SLIDE_RATE * Cos(lb.BashAngle * bj_DEGTORAD)
set lb.newy = lb.y[2] + LB_SLIDE_RATE * Sin(lb.BashAngle * bj_DEGTORAD)
call DestroyEffect(AddSpecialEffect(LB_KS_EFFECT,lb.newx, lb.newy))
call IssueImmediateOrder(lb.atker, "stop")
//Check if Pathing Available
if IsTerrainPathable(lb.newx, lb.newy, PATHING_TYPE_WALKABILITY) == false then
call SetUnitX(lb.atker, lb.newx)
call SetUnitY(lb.atker, lb.newy)
endif
set lb.x[2] = GetUnitX(lb.atker)
set lb.y[2] = GetUnitY(lb.atker)
//The custom counting
set lb.Counter = lb.Counter + LB_SPD
if lb.Counter >= lb.TotalPeriod then
call lb.destroy()
endif
set t = null
endmethod
static method create takes unit attked, unit attacker returns LBarrier
local LBarrier lb = LBarrier.allocate()
set lb.atked = attked
set lb.atker = attacker
set lb.lvl = GetUnitAbilityLevel(lb.atked,LB_ID)
set lb.fired = GetRandomInt(0,100) <= (GetPercentage(lb.lvl)) and (IsUnitType(attacker, UNIT_TYPE_MELEE_ATTACKER) == true) and (IsUnitEnemy(attacker, GetOwningPlayer(attked))==true)
set lb.x[1] = GetUnitX(attked)
set lb.y[1] = GetUnitY(attked)
set lb.x[2] = GetUnitX(attacker)
set lb.y[2] = GetUnitY(attacker)
set lb.BashAngle = bj_RADTODEG * (Atan2(lb.y[2] - lb.y[1], lb.x[2] - lb.x[1]))//atked --> atker
set lb.TotalPeriod = GetPeriod(lb.lvl)
call SetTimerStructA(lb.SlideT, lb)
if lb.fired == true then
call DestroyEffect(AddSpecialEffectTarget(LB_SHIELD_EFFECT,lb.atked,"origin")) //x3 to improve visual effects
call DestroyEffect(AddSpecialEffectTarget(LB_SHIELD_EFFECT,lb.atked,"origin"))
call DestroyEffect(AddSpecialEffectTarget(LB_SHIELD_EFFECT,lb.atked,"origin"))
call UnitDamageTarget(lb.atked, lb.atker, GetDamage(lb.lvl),true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,null)
call TimerStart(lb.SlideT,LB_SPD, true, function LBarrier.slide)
elseif lb.fired == false then
call lb.destroy()
return 0
endif
return lb
endmethod
method onDestroy takes nothing returns nothing
call PauseTimer(.SlideT)
call ClearTimerStructA(.SlideT)
call DestroyTimer(.SlideT)
endmethod
endstruct
private function Cond takes nothing returns boolean
if GetUnitAbilityLevel(GetTriggerUnit(),LB_ID)>0 then
call LBarrier.create(GetTriggerUnit(), GetAttacker())
endif
return false
endfunction
//===========================================================================
function InitTrig_Lucky_Barrier takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(t,Condition(function Cond))
endfunction
endscope

Download it here:
View attachment [Spell Pack] Passive v1.2.w3x
[Spell Pack] Passive v1.1.w3x
[Spell Pack] Passive v1.0.w3x
Q - Why use filefront instead of uploading to this site?
A - This is not the final version, people will critic me, and I will upload newer version. I will only upload the final version to TH.
A - I don't know why can't press the attachment button...
Code:
[B][U][I]Change Log[/I][/U][/B]
v1.2 - Fixed misc code issue pointed out by Andrewgosu and released a beta code. (But he didn't appear to check it out.)
- Fixed a leak mistake pointed out by Tinki3. (CALL_BACK==null should be !=)
v1.1 - Fixed a bug pointed out by GoGo-Boy which the sliding doesn't stop because unit can't reach its destination.
(Fixed by changing system abit)
v1.0 - First released.