Chaos_Knight
New Member
- Reaction score
- 39
Moving Strikes
Description : The Blademaster is so quickly with his attack, so he can move incredibly fast behind the target, dealing damage.
Level 1 : Has a 2% Chance to move, And deal 35 damage.
Level 2 : Has a 4% Chance to move, And deal 70 damage.
Level 3 : Has a 6% Chance to move, And deal 105 damage.
MUI/MPI : I Think
Leakless : Cant see anything so, yes i suppose
Lagless : ... Of course
Tell me if there is any more bugs, or anythign else.
Code
JASS:
library MovingStrike initializer Init requires Damage
// +-------------------------------------------------------------------------------+
// | Moving Strikes - Created by Chaos_Knight. Requires a vJass preprocessor! |
// +-------------------------------------------------------------------------------+
// | Gives a chance to move the attacker behind the unit which is attacked, |
// | and deal damage. |
// +-------------------------------------------------------------------------------+
// | How to Import: |
// | - Create a new trigger |
// | - Convert it to Custom text (Edit > Convert to Custom Text) |
// | - Replace everything there with this code |
// | - Change the constants to suit yourself |
// | - Enjoy! |
// +-------------------------------------------------------------------------------+
// |-------------|
// | Constants: |
// |-------------|
globals
/*Model*/
//----------------------------------------------------------------------------------------------+
private constant string EFFECT = "Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missile_mini.mdl"
//----------------------------------------------------------------------------------------------+
private constant string EFFECT2 = "Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missile.mdl"
//----------------------------------------------------------------------------------------------+
private constant string EFFECT3 = "Abilities\\Spells\\Human\\Thunderclap\\ThunderClapCaster.mdl"
//----------------------------------------------------------------------------------------------+
private constant string EFFECT4 = "Abilities\\Spells\\Other\\Doom\\DoomDeath.mdl"
//----------------------------------------------------------------------------------------------+
private constant string EFFECT6 = "Abilities\\Spells\\Other\\Monsoon\\MonsoonBoltTarget.mdl"
/*End of Model Editing*/
/*Attached To? */
//----------------------------------------------------------------------------------------------+
private constant string EFFECT_POSITION = "weapon,left"
//----------------------------------------------------------------------------------------------+
private constant string EFFECTPOSITION = "hand,right"
/* End Of Attachments*/
//----------------------------------------------------------------------------------------------+
private constant string EFFECTPOS = "origin"
//----------------------------------------------------------------------------------------------+
/* End Of Attachments*/
/* This "SHOWEFFECT" should be true if you want to see the Special Effects */
private constant boolean SHOWEFFECT = true
//----------------------------------------------------------------------------------------------+
private constant boolean IS_RANGED = true
//----------------------------------------------------------------------------------------------+
private constant boolean IS_MEELE = true
//----------------------------------------------------------------------------------------------+
/* Color Red of The TextTag*/
private constant integer RED = 90
//----------------------------------------------------------------------------------------------+
/* Color Green of the TextTag*/
private constant integer GREEN = 0
//----------------------------------------------------------------------------------------------+
/* Color Blue of the TextTag*/
private constant integer BLUE = 110
//----------------------------------------------------------------------------------------------+
/* Visibilty of the TextTag*/
private constant integer ALPHA = 255
//----------------------------------------------------------------------------------------------+
/* If true, shows the texttag*/
private constant boolean SHOWDAMAGE = true
//----------------------------------------------------------------------------------------------+
/*Damage dealt * The unit ability lvl*/
private constant integer DAMAGE = 35
//----------------------------------------------------------------------------------------------+
/* Chance of triggering this trigger*/
private constant integer CHANCE = 100
/* 100% chance is for testing purposes. If you dont want this to be imba, have it on 1.*/
//----------------------------------------------------------------------------------------------+
/* How Long Moving */
private constant integer FROMTARGET = 128
//----------------------------------------------------------------------------------------------+
/* Attack Type */
private constant attacktype AtkType = ATTACK_TYPE_CHAOS
//----------------------------------------------------------------------------------------------+
/* Damage Type */
private constant damagetype DmgType = DAMAGE_TYPE_FIRE
//----------------------------------------------------------------------------------------------+
/* Weapon Type */
private constant weapontype WepType = WEAPON_TYPE_WHOKNOWS
//----------------------------------------------------------------------------------------------+
/* Your spells ID */
private constant integer ID = 039;A000039;
//----------------------------------------------------------------------------------------------+
//| E N D |
//| O F |
//| C O N I F I G U R A B L E S|
endglobals
private constant function CHANC takes integer level returns integer
return CHANCE * level
endfunction
private constant function DMG takes integer Lvl returns integer
return DAMAGE * Lvl
endfunction
// |------------------|
// | End of Constants |
// |------------------|
// DO NOT EDIT BELOW THIS LINE!
private function Cons takes nothing returns boolean
return IsUnitEnemy(GetTriggerUnit() , GetOwningPlayer(GetEventDamageSource())) and GetRandomInt(0, 100) <= CHANC(GetUnitAbilityLevel(GetEventDamageSource(), ID)) and not IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) and GetUnitAbilityLevel(GetEventDamageSource() , ID) > 0
endfunction
private function Moving takes nothing returns nothing
local unit u = GetEventDamageSource()
local unit t = GetTriggerUnit()
local real x1 = GetUnitX( u ) /* A Units X Position */
local real y1 = GetUnitY( u ) /* A Units Y Position */
local real x2 = GetUnitX( t ) /* A Units X Position */
local real y2 = GetUnitY( t ) /* A Units Y Position */
local real angle = Atan2(y2 - y1, x2 - x1)
local texttag TT = CreateTextTag()
if SHOWEFFECT then
call DestroyEffect(AddSpecialEffectTarget(EFFECT, u, EFFECT_POSITION))
call DestroyEffect(AddSpecialEffectTarget(EFFECT2, u, EFFECTPOSITION))
call DestroyEffect(AddSpecialEffectTarget(EFFECT3, t, EFFECTPOS))
call DestroyEffect(AddSpecialEffectTarget(EFFECT4, t, EFFECTPOS))
call DestroyEffect(AddSpecialEffectTarget(EFFECT6, t, EFFECTPOS))
endif
if SHOWDAMAGE then
call SetTextTagText (TT,R2S(DMG(GetUnitAbilityLevel(u, ID))) + "!", 0.023)
call SetTextTagPosUnit (TT, u, 10 )
call SetTextTagColor (TT, RED, GREEN, BLUE, 255 )
call SetTextTagVelocity (TT, 0.0355 * Cos(90. * bj_DEGTORAD), 0.0355 * Sin(90. * bj_DEGTORAD))
call SetTextTagVisibility (TT, true)
call SetTextTagFadepoint (TT, 2.00)
call SetTextTagLifespan (TT, 2.00)
call SetTextTagPermanent (TT, false)
endif
call SetUnitX( u , x2 + FROMTARGET * Cos(angle))
call SetUnitY( u , y2 + FROMTARGET * Sin(angle))
call Damage_EnableEvent(false)
call UnitDamageTarget( u , t , DMG(GetUnitAbilityLevel(u, ID)) , IS_RANGED , IS_MEELE , AtkType , DmgType , WepType )
call Damage_EnableEvent(true)
set u = null
set TT = null
set t = null
endfunction
//------------------------------------------------------------------
private function Init takes nothing returns nothing
local trigger tr = CreateTrigger()
call Damage_RegisterEvent(tr)
call TriggerAddCondition( tr , Condition(function Cons))
call TriggerAddAction( tr , function Moving)
set tr = null
endfunction
//----------------------+
//END OF MOVING STRIKES |
//----------------------+
endlibrary
Screenies:
Very Bad Screenie. I dont know how to take a good screenie at a Istant spell.
Updates
Update 1.0 : Release
Update 1.1 : Much changing in the code. No callbacks. Nulled everything i think..
New Terrain: Thanks Tinki3
Update 1.2 : New Code. Thanks to SineCosine
Update 1.3 : You can now change the Chance and Damage in the globals.
Update 1.4 : This update was from Laiev. If you are using this spell, give him credits.
Update 1.5 : Even more from Laiev. No need to give me credits.. . Laiev could have made this spell twice better. I delete it..
Update 1.6 : Changed the Texttag string.
Update 1.7 : Another if. SIX Sfxs. More globals.
BIG UPDATE: Maked this to use Damage. Now you cant abuse this anymore with the "Stop" action. As said, big update.
UPDATE 1.9 : MUCH MORE COMMENTS! Nulled Trigger, as Jedi told me. Yay!
Update 1.1 : Much changing in the code. No callbacks. Nulled everything i think..
New Terrain: Thanks Tinki3
Update 1.2 : New Code. Thanks to SineCosine
Update 1.3 : You can now change the Chance and Damage in the globals.
Update 1.4 : This update was from Laiev. If you are using this spell, give him credits.
Update 1.5 : Even more from Laiev. No need to give me credits.. . Laiev could have made this spell twice better. I delete it..
Update 1.6 : Changed the Texttag string.
Update 1.7 : Another if. SIX Sfxs. More globals.
BIG UPDATE: Maked this to use Damage. Now you cant abuse this anymore with the "Stop" action. As said, big update.
UPDATE 1.9 : MUCH MORE COMMENTS! Nulled Trigger, as Jedi told me. Yay!