I
IKilledKEnny
Guest
Vengeance (1.3).
Made due a request by Phoenixashes.
The READ ME:
Here are the 3 triggers to all intrested:
Future plans:
To fix the text tag, if you know how to fix this please let me know.
Made due a request by Phoenixashes.
The caster will pick one victim, after 12 seconds, the victim will be dealt damage, based on the damage that the caster took druing those 12 seconds. The damage that will be dealt to the target is: 65%/80%/95%/110%/125% of the damage that the caster took druing those 12 seconds. If druing those 12 seconds that caster will die, then the damage will reset.
The READ ME:
Code:
Please read this document, it's important so you could understand the spell better. Skipping this
read is not suggested and not following the rules listed wouldn't be moral.
====================================================================================================
>> Credits:
> This spell was requested by Phoenixashes, thus I did not come with the spell idea, but he did.
> KaTTaNa, for using his(/her) system in my map (see "Map")
> Tom Jones, for helping me with version 1.1.
====================================================================================================
>>> Rules: Please follow the following rules.
>> You may use this spell freely in your map with no credits needed.
>> You may modify this spell freely.
>> While you may use this freely in your own maps, please do not take this as your spell
and attempt to publish in other sites saying that it was made by you. This includes:
> You may not take the spell post it in any website without a premission for me. If you
want to post this spell you must contact me (see "Last Words").
> You may not post it in any contest etc.
> You may not present this spell to anyone as your work even afer you modified this.
>> I take no responsibility on this spell, if druing the import process somthing happens don't
blame me, if you choose importing this spell to your map you need to follow the
instuctions posted (see "How to Implement"), JASS is a powerful language that will cause
problems when not handled properly.
====================================================================================================
>> Description:
> The caster will pick one victim, after 12 seconds, the victim will be dealt damage, based on
the damage that the caster took druing those 12 seconds. The damage that will be dealt to the
target is: 65%/80%/95%/110%/125% of the damage that the caster took druing those 12 seconds.
If druing those 12 seconds that caster will die, then the damage will reset.
> Note: When the unit will be damaged a floating text will appear by it saying the damage
that was dealt (rounded down in order to make it more friendly). Only the owner of the
caster will be able to see the floating text.
====================================================================================================
>> Map
> All triggers under "Map" file are not needed in order for the spell to work, but are simply
triggers which help you when testing this spell.
> There is a creep revival system in the map as well as hero revival system so you could keep
testing this spell as long as you would like.
> Typing -Level and an # will set you hero's level, for example: "-Level 6" will set your hero's
level to six.
> You can restore completely your life and mana by pressing the esc button.
> I use KaTTaNa's Local Handle System for my spell, you must have it so the spell will work
in your own map (see "How to Implement"). It can be found in the header of the map. Note:
I use just part of the system, if you want to get the complete system go to: www.wc3jass.com.
> Side note: I changed the blademaster's settings slightly, no need to copy those changes.
====================================================================================================
>> Trigger
> The spell is made out of one trigger which stores in it two other local triggers.
> In each trigger there will be detailed comments explaining everything, I suggest you read them
carefully to understand the spell better.
> Do NOT modify functions that has in them the line "No need to modify this" unless you know
JASS well and understand the trigger.
> Note: The lines that set the TextTag are BJs simply becuase it makes the trigger much shorter
and anyway they slow the trigger by very little.
====================================================================================================
>> How to Implement
> Firstly copy the "Vengeance" buff which can be found in Buffs / Effects > Custom Buffs /
Effects > Human > Buff.
> Then copy the spell "Vengeance" which can be found in: Object Editor > Abilities >
Custom abilities > Human > Heroes. Modify it now if you want.
> After that's done go to the header of the map (where it says in this window "Vengeance.w3x")
and copy every bit of the code there, that is KaTTaNa's Local Handle System. If you have
the complete KaTTaNa's system already in your map you can skip this step.
> After the header of the map have been copied into your map's header, copy the trigger
"Vengeance" which can be found under this document.
> Lastly modify the triggers using the comments written in them.
====================================================================================================
>>> History
>> Version 1.3 (May 13th, 2007)
> Removed text tag feature for farther testing.
> Updated map name to fit the version.
>> Version 1.2 (May 12th, 2007)
> Added restoring feature to the map so it could ease the testing process.
> Added a feature that will create a special effect when the target is damaged.
> Improved comments.
> Major editing to this document.
> Thread was updated.
>> Version 1.1 (May 10th, 2007)
> Added a condition were the text tag will not appear if the target is dead
> Converted global triggers into local ones.
> Comments were edited so the spell could be more readable.
> Decreased greatly the use of KaTTaNa's Local Handle System so spell is faster now.
> Added few more constants to make the spell easier to modify
> Added buff and art effect to the spell
> Changed enemies to make them harder.
> Added -level command (See map)
> And finally added screenshots to the thread
>> Version 1.0 (May 6th, 2007)
> The first draft of the spell was created, the other versions are improvements to
this version.
====================================================================================================
>> Last Words:
> Please infrom me with any comments / suggestion / bugs founds etc. You can contact me through
E-mail ([email protected]), through private massage or by simply posting in the thread.
> I hope you enjoy using this spell, remember that you can use it freely in your map!
====================================================================================================
Your favorite murderer,
IKilledKEnny
Vengeance > READ ME > Version 1.3 (May 13th, 2007) > Made by IKilledKEnny.
Here are the 3 triggers to all intrested:
JASS:
// Enjoy the spell, and please read the "READ ME".
constant function VengeanceEffectString takes nothing returns string
// This is the string for the special effect
// It is Animate Dead now.
return "Abilities\\Spells\\Undead\\AnimateDead\\AnimateDeadTarget.mdl"
endfunction
function VengeancePercent takes integer level returns real
// Returns the damage function of the spell.
// At the moment it is level of the ability times 15 plus 50.
return I2R(level)*15+50
endfunction
constant function VengeanceDuration takes nothing returns real
// This will return the time that will pass until the unit will be damaged. Be sure to update
// the object editor as well when changing this
return 12.00
endfunction
constant function VengeanceSpellId takes nothing returns integer
// This function will return the spell's Id. You need to make sure you change this to the correct
// Id when importing it to your map. Id can be checked by clicking ctrl + d in the object editor.
return 039;A001039;
endfunction
function VengeanceCon takes nothing returns boolean
// This function checks if the spell that was casted is Vengeance.
// No need to modify this.
return GetSpellAbilityId()==VengeanceSpellId()
endfunction
function VengeanceDamageActTrig takes nothing returns nothing
// This trigger will increase damage when the caster takes damage
// No need to modify this
local unit caster=GetTriggerUnit() // Get triggering unit inside a variable
local real damage=GetHandleReal(caster,"damage") // We get damage variable that was linked to it
set damage=damage+GetEventDamage() // We increase it by the damage that was done to the caster
call SetHandleReal(caster,"damage",damage) // And finally, we relink the damage with the caster
set caster=null
endfunction
function VengeanceDeathActTrig takes nothing returns nothing
// This trigger will reset damage when the caster dies
// No need to modify this
local unit caster=GetTriggerUnit() // We get the triggering unit in a variable
local real damage=GetHandleReal(caster,"damage") // The damage var through the linkage
set damage=0 // Damage is now reset
call SetHandleReal(caster,"damage",damage) // And finally, we relink the damage with the caster
set caster=null
endfunction
function VengeanceMain takes nothing returns nothing
// This is the main function that will damage the unit and show the text tag.
// No need to modify this.
local unit caster=GetTriggerUnit() // Casting unit inside a variable
local unit target=GetSpellTargetUnit() // Target inside a variable
local integer level=GetUnitAbilityLevel(caster,VengeanceSpellId()) // The level of the ability
local real damage=0 // Real that will serve as damage calculator
local real percent=VengeancePercent(level)*0.01 // We get the percent of the damage using level
local real totalDamage // Will be served as the damaging real
local trigger trigDamage=CreateTrigger() // Creates a trigger that will increase "damage"
local trigger trigDeath=CreateTrigger() // Creates a triggers that will reset damage when the caster dies
local triggeraction taDamage=TriggerAddAction(trigDamage,function VengeanceDamageActTrig) // Attachs an action to the trigger
local triggeraction taDeath=TriggerAddAction(trigDeath,function VengeanceDeathActTrig) // Attachs an action to the trigger
call SetHandleReal(caster,"damage",damage) // Links damage with caster
call TriggerRegisterUnitEvent(trigDamage,caster,EVENT_UNIT_DAMAGED) // Adds event to the trigger
call TriggerRegisterUnitEvent(trigDeath,caster,EVENT_UNIT_DEATH) // Adds event to the trigger
call PolledWait(VengeanceDuration()) // Waits 12 seconds
if GetUnitState(target,UNIT_STATE_LIFE)>=0 then // Checks if target is still alive
set totalDamage=GetHandleReal(caster,"damage")*percent // Sets totalDamage
call UnitDamageTarget(caster,target,totalDamage,true,false,ATTACK_TYPE_MAGIC,DAMAGE_TYPE_DEATH,WEAPON_TYPE_WHOKNOWS) // Damages target.
call AddSpecialEffectTarget(VengeanceEffectString(),target,"origin") // Creates the effect.
endif
// Removes the leaks
call DisableTrigger(trigDamage)
call DisableTrigger(trigDeath)
call TriggerRemoveAction(trigDamage,taDamage)
call TriggerRemoveAction(trigDeath,taDeath)
call DestroyTrigger(trigDamage)
call DestroyTrigger(trigDeath)
set caster=null
set target=null
set caster=null
set target=null
endfunction
//===========================================================================
function InitTrig_Vengeance takes nothing returns nothing
set gg_trg_Vengeance=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_Vengeance,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(gg_trg_Vengeance,Condition(function VengeanceCon))
call TriggerAddAction(gg_trg_Vengeance,function VengeanceMain)
endfunction
Future plans:
To fix the text tag, if you know how to fix this please let me know.