elmstfreddie
The Finglonger
- Reaction score
- 203
I realized I have never made a spell... So, I decided to make one!
It's my... second JASS trigger, so if there are any discrepancies please inform me!!!
MUI: Yup
Import Difficulty: Easy, just copy and paste the trigger
BJs: One, the any unit event.
The blade master goes into a rage, striking a unit and stunning the target until he fails. The chance to fail increases with every strike, but the damage done increases by every strike. Also, time between strikes is decreased with every strike. If the 15th strike is made on the level 3 of the ability, you instantly kill the target.
Map attached with the spell. Warning, the map has no prettiness. It's just dirt with some units. I suck too much at terrain, so I spared your eyes and made it blank.
Here's the coding for the ability:
If you want to use this in your map, don't give credit to yourself.
If you have credits in your map, put me in them. Otherwise, I don't care
Edit > Nulled mirroreffect and decreased time between attacks for a more... Good spell.
Edit > Made condition shorter (thanks PurgeandFire) and got rid of 1 of the BJs.
It's my... second JASS trigger, so if there are any discrepancies please inform me!!!
MUI: Yup
Import Difficulty: Easy, just copy and paste the trigger
BJs: One, the any unit event.
The blade master goes into a rage, striking a unit and stunning the target until he fails. The chance to fail increases with every strike, but the damage done increases by every strike. Also, time between strikes is decreased with every strike. If the 15th strike is made on the level 3 of the ability, you instantly kill the target.
Map attached with the spell. Warning, the map has no prettiness. It's just dirt with some units. I suck too much at terrain, so I spared your eyes and made it blank.
Here's the coding for the ability:
JASS:
function TextTagMessage takes texttag tt,real lifespan,integer colourred,integer colourgreen,integer colourblue,integer transparency,real fadepoint,real x,real y,real heightoffset,real xspeed,real yspeed,string message,real size,boolean show returns nothing
call SetTextTagPermanent(tt,false)
call SetTextTagLifespan(tt,lifespan)
call SetTextTagColor(tt,colourred,colourgreen,colourblue,transparency)
call SetTextTagFadepoint(tt,fadepoint)
call SetTextTagPos(tt,x,y,heightoffset)
call SetTextTagVelocity(tt,xspeed,yspeed)
call SetTextTagText(tt,message,size)
call SetTextTagVisibility(tt,show)
endfunction
function Trig_Slash_Actions takes nothing returns nothing
local unit Caster = GetTriggerUnit()
local unit Target = GetSpellTargetUnit()
local real CasterX
local real CasterY
local real TargetX
local real TargetY
local real CasterNewX
local real CasterNewY
local real MirrorEffectX
local real MirrorEffectY
local texttag array t
local integer l = 1
local effect array blood
local effect array mirroreffect
loop
exitwhen l > (GetUnitAbilityLevel(Caster,039;A000039;)*5)
call PauseUnit(Caster,true)
call PauseUnit(Target,true)
//Pauses the caster and target to prevent problems, however pausing target is unnecessary
set CasterX = GetUnitX(Caster)
set CasterY = GetUnitY(Caster)
set TargetX = GetUnitX(Target)
set TargetY = GetUnitY(Target)
//Edit (5.00*l)*2 for damage dealt
set CasterNewX = GetLocationX(GetUnitLoc(Target)) + 100.00 * Cos(l*45.00*(3.14159/180.00))
set CasterNewY = GetLocationY(GetUnitLoc(Target)) + 100.00 * Sin(l*45.00*(3.14159/180.00))
//Setting polar offsets for the caster
//No need to edit
call SetUnitPosition(Caster,CasterNewX,CasterNewY)
//Moves the caster to his new spot
call SetUnitFacing(Caster,((l*45.00)+180.00))
//Makes the caster face the target
call SetUnitAnimation(Caster,"attack")
//Gives the illusion of the Caster attacking
set MirrorEffectX = GetLocationX(GetUnitLoc(Target)) + 100.00 * Cos(((l*45.00)-45.00)*(3.14159/180.00))
set MirrorEffectY = GetLocationY(GetUnitLoc(Target)) + 100.00 * Sin(((l*45.00)-45.00)*(3.14159/180.00))
//Setting polar offsets for the mirror image effect
//No need to edit
set mirroreffect[l] = AddSpecialEffect("Abilities\\Spells\\Orc\\MirrorImage\\MirrorImageCaster.mdl",MirrorEffectX,MirrorEffectY)
if( not (l == 15)) then
if((GetRandomInt(1,50)) >= l) then
call UnitDamageTarget(Caster,Target,((5.00*l)*2),true,true,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_AXE_MEDIUM_CHOP)
if((GetUnitState(Target,UNIT_STATE_LIFE))== 0) then
set blood[l] = AddSpecialEffect("Objects\\Spawnmodels\\Orc\\OrcLargeDeathExplode\\OrcLargeDeathExplode.mdl",GetUnitX(Target),GetUnitY(Target))
set t[l] = CreateTextTag()
call TextTagMessage(t[l],1.50,255,20,20,255,(1.00-(0.05*l)),GetUnitX(Caster),GetUnitY(Caster),0.00,0.00,0.030,"DEADLY BLOW!",0.03,true)
call PauseUnit(Caster,false)
call PauseUnit(Target,false)
set t[l] = null
set Caster = null
set Target = null
set blood[l] = null
set mirroreffect[l] = null
return
else
set blood[l] = AddSpecialEffect("Objects\\Spawnmodels\\Orc\\Orcblood\\BattrollBlood.mdl",GetUnitX(Target),GetUnitY(Target))
set t[l] = CreateTextTag()
call TextTagMessage(t[l],1.50,255,20,20,255,(1.00-(0.05*l)),GetUnitX(Caster),GetUnitY(Caster),0.00,0.00,0.036,(I2S(((5*l)*2))+"!"),0.014+(0.001*l),true)
endif
else
call TextTagMessage(t[l],1.50,255,20,20,255,(1.00-(0.05*l)),GetUnitX(Caster),GetUnitY(Caster),0.00,0.00,0.036,"Failed",0.025,true)
call PauseUnit(Caster,false)
call PauseUnit(Target,false)
call TriggerSleepAction(1.50)
set t[l] = null
set Caster = null
set Target = null
set blood[l] = null
set mirroreffect[l] = null
return
endif
else
set blood[l] = AddSpecialEffect("Objects\\Spawnmodels\\Orc\\OrcLargeDeathExplode\\OrcLargeDeathExplode.mdl",GetUnitX(Target),GetUnitY(Target))
set t[l] = CreateTextTag()
call TextTagMessage(t[l],1.50,255,20,20,255,(1.00-(0.05*l)),GetUnitX(Caster),GetUnitY(Caster),0.00,0.00,0.036,"DEADLY BLOW!",0.03,true)
call PauseUnit(Caster,false)
call PauseUnit(Target,false)
set t[l] = null
set Caster = null
set Target = null
set blood[l] = null
set mirroreffect[l] = null
return
endif
call TriggerSleepAction(0.25)
call DestroyEffect(mirroreffect[l])
call TriggerSleepAction(((0.50-(0.05*l)))-0.25)
//((1.00-(0.05*l))) makes time between attacks shorten, change if desired
call DestroyEffect(blood[l])
//Destroy the blood effect
set l = l + 1
endloop
call PauseUnit(Caster,false)
call PauseUnit(Target,false)
set t[l] = null
set Caster = null
set Target = null
set blood[l] = null
set mirroreffect[l] = null
endfunction
If you want to use this in your map, don't give credit to yourself.
If you have credits in your map, put me in them. Otherwise, I don't care
Edit > Nulled mirroreffect and decreased time between attacks for a more... Good spell.
Edit > Made condition shorter (thanks PurgeandFire) and got rid of 1 of the BJs.