Immolation
Member
- Reaction score
- 20
Timed Barrage
Allows shooting of several arrows with a single attack for a short amount of time.
GUI/vJASS= vJASS
Leakless?= Yes(I hope).
Lagless= Yes(for me).
MUI/MPI?= MUI
Changelog:
v1.1
-Spell is now MUI. Thanks to Tom Kazansky for concept!
-Fixed a bug with Barrage shooting too many arrows.
v1.00a
-Updated code.
v1.00
-Public release.
Code:GUI/vJASS= vJASS
Leakless?= Yes(I hope).
Lagless= Yes(for me).
MUI/MPI?= MUI
Changelog:
v1.1
-Spell is now MUI. Thanks to Tom Kazansky for concept!
-Fixed a bug with Barrage shooting too many arrows.
v1.00a
-Updated code.
v1.00
-Public release.
JASS:
scope Barrage initializer Initialization
//-------------------------------------------------------------
// Timed Barrage by Immolation
//-------------------------------------------------------------
// Description:
//---------------------------
// Allows shooting of several arrows with a single attack for a short amount of time.
// What do I need to import it in my map?
//---------------------------
// You need to download JASS NewGen, available at the following links:
// -http://www.thehelper.net/forums/showthread.php?t=73936-
// -http://www.wc3c.net/showthread.php?t=90999-
//Install it and then read the following paragraph.
// How do I put it in my map?
//---------------------------
// 1. Copy:
// a. The "Barrage" ability.
// b. The "Barrage(Buff)" ability.
// c. The "Barrage(Passive)" ability.
// d. The "Passive Book (Disabled)" ability.
// e. The "Barrage" buff.
// f. Export the "dummy.mdx" file and import it back into your map. (Export the icons if you wish too, be sure to set the right path though).
// g. Copy the "Dummy Unit" into your map.
// h. Copy this trigger.
// 2. Press CTRL + D while in the Object Editor to find out the rawcode of:
// a. The "Barrage" ability. Change the SPELL_ID to the rawcode that you find(it's 'A000' in this map).
// b. The "Barrage(Passive)" ability. Change the BARRAGE_ID to the rawcode that you find(it's 'A002' in this map).
// c. The "Barrage(Buff)" ability. Change the BUFFSPELL_ID to the rawcode that you find(it's 'A001' in this map).
// d. The "Passive Book (Disabled)" ability. Change the SPELLBOOK_ID to the rawcode that you find(it's 'A003' in this map).
// e. The "Barrage" buff. Change the BUFF_ID to the rawcode that you find(it's 'B000' in this map).
// f. The "Dummy Unit" unit. Change the DUMMY_ID to the rawcode that you find(it's 'n000' in this map).
// 3. Be sure that the "Passive Book (Disabled)" has the "Barrage (Passive)" ability.
// 4. Give the Barrage ability to your hero.
// 5. You have succesfully imported the spell <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite8" alt=":D" title="Big Grin :D" loading="lazy" data-shortname=":D" />
// Changelog:
//---------------------------
// v1.1
// -Spell is now MUI. (Thanks Tom Kazansky!)
//
// v1.00a:
// -Updated code.
//
// v1.00:
// -Public release.
//---------------------------
// TheHelper.net
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// RAWCODES
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
//About Configurables:
// The configurables can be found in the Object Editor.
// Modify the duration of the "Barrage (Buff)" ability to set the duration of the spell.
// Modify the cooldown&manacost of "Barrage" ability to set the desired cooldown&manacost.
// Check the "Barrage (Passive)" for the rest.
globals
private constant integer SPELL_ID = 039;A000039;
private constant integer BARRAGE_ID = 039;A002039;
private constant integer BUFFSPELL_ID = 039;A001039;
private constant string BUFFSPELL_ORDER = "rejuvination"
private constant integer BUFF_ID = 039;B000039;
private constant integer DUMMY_ID = 039;n000039;
private constant integer SPELLBOOK_ID = 039;A003039;
private constant real TIMEOUT = 0.2 // Used to check if the spell is active or not after casting every second.
// I suggest a number between 0.1-0.5. Default: 0.2
endglobals
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
private function Conditions takes nothing returns boolean
return GetSpellAbilityId() == SPELL_ID
endfunction
private function Actions takes nothing returns nothing
local unit TriggeringUnit = GetTriggerUnit()
local real x = GetUnitX(TriggeringUnit)
local real y = GetUnitY(TriggeringUnit)
local player TriggeringPlayer = GetOwningPlayer(TriggeringUnit)
local integer SpellLevel = GetUnitAbilityLevel(TriggeringUnit, SPELL_ID)
local unit Dummy = CreateUnit(TriggeringPlayer, DUMMY_ID, x, y, 0.00)
call UnitAddAbility(Dummy, BUFFSPELL_ID)
call SetUnitAbilityLevel(Dummy, BUFFSPELL_ID, SpellLevel)
call UnitApplyTimedLife(Dummy, 039;BTLF039;, 3.00)
call IssueTargetOrder(Dummy, BUFFSPELL_ORDER, TriggeringUnit)
call UnitAddAbility(TriggeringUnit, SPELLBOOK_ID)
call SetUnitAbilityLevel(TriggeringUnit, BARRAGE_ID, SpellLevel)
call TriggerSleepAction(0.0)
loop
exitwhen GetUnitAbilityLevel(TriggeringUnit, BUFF_ID) == 0
call TriggerSleepAction(TIMEOUT)
endloop
call UnitRemoveAbility(TriggeringUnit, SPELLBOOK_ID)
endfunction
//=============================================================================================
private function Initialization takes nothing returns nothing
local trigger Trigger = CreateTrigger()
local integer Loop = 0
call TriggerRegisterAnyUnitEventBJ(Trigger, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition(Trigger, Condition(function Conditions))
call TriggerAddAction(Trigger, function Actions)
loop
exitwhen Loop == 12
call SetPlayerAbilityAvailable(Player(Loop), SPELLBOOK_ID, false)
set Loop = Loop + 1
endloop
endfunction
endscope
P.S.: I know it's simple, but many people ask for it.
Lags a bit on the first cast, preload if needed.