Kamikaze Slash v1.3
by Magoiche
by Magoiche
GUI/JASS: vJASS
MUI/MPI: MUI and MPI
Leakless?: Yep
Lagless?: Yep
Requirements: NewGen
Import Difficult: Medium
Description: The caster enters in a milesecond of frenzy hiting the enemy with all its power. The hit is so powerfull that even the caster receives damage.
Level 1 - The caster receives 15% of the target current HP in damage and the target receives the same damage plus 5% of the caster current HP.
Level 2 - The caster receives 30% of the target current HP in damage and the target receives the same damage plus 10% of the caster current HP.
Level 3 - The caster receives 45% of the target current HP in damage and the target receives the same damage plus 15% of the caster current HP.
Level 4 - The caster receives 60% of the target current HP in damage and the target receives the same damage plus 20% of the caster current HP.
Screenshots:

Code:
JASS:
//////////////////////////////////////////////
//// Kamikaze Slash ////
//// by Magoiche Saika ////
//////////////////////////////////////////////
////NOTE: Everything that you can't change////
//// in this script you can in the ////
//// Object Editor. ////
//////////////////////////////////////////////
scope KamikazeSlash initializer Initial
globals
private constant integer KamikazeSlashRawData = 'A000'
// Raw Data of the Kamikaze Slash spell
private constant real TargetHPPercentage = 0.15
// Percentage of HP per Spell Level that damages the Caster
private constant real CasterHPPercentage = 0.05
// Percentage of the Caster current HP that is added to the Damage for the Caster
private constant attacktype KamikazeSlashAttackType = ATTACK_TYPE_HERO
// Attack Type of the spell
private constant damagetype KamikazeSlashDamageType = DAMAGE_TYPE_NORMAL
// Damage Type of the spell
private constant weapontype KamikazeSlashWeaponType = null
// Weapon Type of the spell
private constant string KamikazeSlashEffectsAttachmentPoint = "chest"
// Attachment Point for the effects
private constant integer KamikazeSlashNumberOfEffects = 4
// Number of Active Effects
private string array KamikazeSlashEffects
// Dont Change the Line Above please
endglobals
private function Effects takes nothing returns nothing
set KamikazeSlashEffects[0] = "Abilities\\Spells\\Other\\Stampede\\StampedeMissileDeath.mdl"
set KamikazeSlashEffects[1] = "Objects\\Spawnmodels\\Human\\HumanBlood\\BloodElfSpellThiefBlood.mdl"
set KamikazeSlashEffects[2] = "Objects\\Spawnmodels\\Other\\BeastmasterBlood\\BeastmasterBlood.mdl"
set KamikazeSlashEffects[3] = "Objects\\Spawnmodels\\Orc\\Orcblood\\BattrollBlood.mdl"
endfunction
// To change an effect just change the path. The path is the text
// between the ""
// To implement new effects you have to make a line bellow the line 37,
// the line should be like this: set Effects[4] = "Patch to the Effect"
// then put the number of effects in the Line 27
// REMEMBER: There must be two "\\". If you jsut copy the patch from the
// object editor there will be only one "\" so remember to put two '\\'
// Dont change anything after this line if don't know what you are doing.
private function Conditions takes nothing returns boolean
return GetSpellAbilityId() == KamikazeSlashRawData
endfunction
private function Actions takes nothing returns nothing
local unit Caster = GetTriggerUnit()
local unit Target = GetSpellTargetUnit()
local integer LoopAIndex = 0
local real HPDamage = TargetHPPercentage * GetUnitAbilityLevel( Caster, KamikazeSlashRawData ) * GetWidgetLife( Target )
call UnitDamageTarget( Caster, Caster, HPDamage, true, false, KamikazeSlashAttackType, KamikazeSlashDamageType, KamikazeSlashWeaponType )
set HPDamage = HPDamage + ( CasterHPPercentage * GetUnitAbilityLevel( Caster, KamikazeSlashRawData ) ) * GetWidgetLife( Caster )
call UnitDamageTarget( Caster, Target, HPDamage, true, false, KamikazeSlashAttackType, KamikazeSlashDamageType, KamikazeSlashWeaponType )
loop
exitwhen LoopAIndex > KamikazeSlashNumberOfEffects
call DestroyEffect( AddSpecialEffectTarget( KamikazeSlashEffects[LoopAIndex], Caster, KamikazeSlashEffectsAttachmentPoint ) )
call DestroyEffect( AddSpecialEffectTarget( KamikazeSlashEffects[LoopAIndex], Target, KamikazeSlashEffectsAttachmentPoint ) )
set LoopAIndex = LoopAIndex + 1
endloop
set Caster = null
set Target = null
endfunction
private function Initial takes nothing returns nothing
local trigger trig = CreateTrigger()
call Effects()
call TriggerRegisterAnyUnitEventBJ( trig, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( trig, Condition( function Conditions ) )
call TriggerAddAction( trig, function Actions )
set trig = null
endfunction
endscope
Changelog
v1.0 - Created and Submited the Spell
v1.1 - Made the spell more configurable
v1.2 - Made the spell even more configurable and removed some leaks
v1.3 - Enhanced the spell. Special thanks to Romek
v1.1 - Made the spell more configurable
v1.2 - Made the spell even more configurable and removed some leaks
v1.3 - Enhanced the spell. Special thanks to Romek
Instructions of how to import inside the map!