Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
Alright I'm making a spell that does various things but involves forcing all units within a 450 aoe to attack the casting unit for 4.5 seconds. I have been asking around and have been told it's only done with jass, wich i haven't had the time to learn yet =/ so if someone could make this for me i would be greatly appreciative .
EDIT(for clarity): Unit casts spell, run/call jass script.
Taunt orders all units to attack it, but the order can be canceled.
What you could do is have a dummy unit cast taunt every .2 seconds, then if it is attacked, reorder the attacking unit to attack the main caster unit.
--donut3.5--
Example: Gost casts Mocking Shout (the taunt ability)(it sets my hero as the variable) then right after i do Donut3.5 casts mocking shout and the variabel changes, making the units that are supposed to attack me, attack him. I suppose i could use a couple arrays but im sure there is an easier way.
I thought in jass you could determine who gave you a specific buff, that was how i was gonna do it but i dont know jass.
Bah, I suppose there's no easy MUI way for GUI.. you could just assign a variable and index it, use that old MUI trick.. but it'd be better in JASS with handles or structs or something.
--donut3.5--
Thats what im saying >.> can someone make the forced attack part in jass for me >.> all the other effects are covered by the actual ability being casted. (I COULD do this in gui but it would be just bleh and way harder then it needs to be.)
I know i can do it with arrays/gui but it would never be solidyly mui and it would be a hassle n' messy, and i tend to stray from custom values because you can only use them for one thing per map in addition it stilll wouldnt be mui if you just used custom values and not arrays. Once agian, can someone make this via jass for me?
EDIT: Sadly monster lure is the same as taunt, it issues an order for u to attack it, but if a player is controlling the units he can order them not to.
create a variable named TempUnit Custom script: local unit TempUnit = GetTriggerUnit()
For Each Integer A from 0 to <duration>x5
Create a dummy unit on TempUnit and order it to cast taunt
Wait 0.2 seconds
Since we localled the TempUnit on top it will be MUI (trust me)
You can't wait any less then approx. .3 seconds in multiplayer. (This has been over discussed, if you want to find out more run a search!!) Also taunt isn't really the best idea as has been stated elsewhere. (At the very least it needs additional trigger reinforcement)
Ok here it is... I was considering double posting so that people would know that I had posted it, but seeing how badly people who do that tend to end up...
Click the 'Forced Attack' ability acolytes have then move them around. I didn't use any attachables, I found a better method. Also it appears to be pretty efficient. However the more units on your map/the more units using the ability, the bigger the efficiency loss!
This took me about an hour of work so I hope its what you want.
JASS:
globals
constant integer TRIGGERSPELL = 'A000' //The dummy spell casted by the unit to begin the ability
constant integer SPELLBUFF = 'B000' //The buff id which the CASTER has
constant real SPELLRADIUS = 200.00 //determines the radius you wish to use.
constant real TIMERSPEED = 0.10 //The timer speed for unit positional updates. It also controls how often it forces the units to attack (If they aren't already)
constant boolean EFFECTALLYS = false //If this is true, allys of the caster will be forced to attack it as well.
group IsInRange = CreateGroup()
group HasBuff = CreateGroup()
unit CurPick //Damn, yes I know I should have used attachabels instead of globals, but isn't a global faster then gamecache?!
endglobals
function Trig_Compulsion_Conditions takes nothing returns boolean
return GetSpellAbilityId() == TRIGGERSPELL
endfunction
function Trig_Compulsion_Actions takes nothing returns nothing
call GroupAddUnit(HasBuff,GetSpellAbilityUnit())
endfunction
//=========================================================================== Compulsion
function InitTrig_Compulsion takes nothing returns nothing
set gg_trg_Compulsion = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Compulsion, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_Compulsion, Condition( function Trig_Compulsion_Conditions ) )
call TriggerAddAction( gg_trg_Compulsion, function Trig_Compulsion_Actions )
endfunction
This is actually the main trigger though it is smaller then the other two triggers (The three triggers make up the system)
You can modify my constants to almost anything.
How it works:
First when a unit casts the ability, it adds that unit to a group
Then every TIMERSPEED (seconds) it will check every unit in the map and see if they are within range of every unit in the group.
If they are it adds them to group IsInRange and if they aren't attacking, it orders them too.
Incase they are attacking something else the last trigger checks every attack of the units IsInRange to determine if they are targeting the proper unit, if they aren't it forces them to.
Edit:Fixed a small glitch when EFFECTALLYS was set to true
Edit2:Added a quick description of workings!
Edit3:Fixed something that would have leaked units into the system (Not a memory leak)
Yes I have Weu, and I'm using Jass New Gen Editor, which is pretty much a required thing these days if your using JASS.
I'm pretty sure you want need WEU, but you will need Jass New Gen Editor.
For now try and run the map through warcraft (that will work no matter what editor I used) See if its what you want!
http://www.wc3campaigns.net/showthread.php?t=90999
Its much better then WEU, and so far I can't find anyone who has anything bad to say about it. Its the best editor modification available at the moment.
I found a completely random line of WEU code in the default map initialization GUI. Must have put it there by accident. After I check for anymore WEU junk I'll post it on this post.
This can be opened/tested in NORMAL WE. However if you save it will be unable to cope with vjass and will bring up dozens of errors and probably stop the map from working. So if you wish to modify the map/use the system. Get the Jass New Gen pack. It comes with a lot of other cool features as well.
(1) It replaces WE debugger (which is crappy) with something better.
(2) It supports syntax highlighting while modifying jass within the editor.
(3) It supports the use of 'undo' within jass text boxes. (At last...)
(4) It allows you to test world editor in windowed mode.
(5) It simulates many great features for JASS which didn't exist there before. (By use of a preprocessor)
(6) It doesn't corrupt your maps.
(7) If you have WEU it can work with that two.
(8) It offers the many of the features WEU offered without having to actually have WEU.
(9) It allows you to choose raw codes for your objects in the object edtior.
(10) etc...
Cool, I can open it now in editor. Testing it as i type to see if it's what i want. Regardless wether it is or not im going to rep you for your continious help, thanks man!
EDIT: Alright, that is exactly what I want but theres one problem, i think it has a problem with ranged units, there not always within the 300 aoe (in addition th tooltop says 300 aoe but your constant says 200, but that wouldnt effect it anyways but just fyi.) when atttacking, sometimes when i casted it with the acolytes by the trolls then ran away some of the trolls would go and attack my trolls agian.
Ahhhhh dangit. I'd have to rebuild the system due to the method I used to make it.
I suggest simply increasing the constant for distance. Then they're range won't help them.
Besides in the normal game your units won't run away well they? They'd be attacking units without the classification of 'worker' so your units wouldn't run away. Unless your unit moved, a ranged attacker within the AOE wouldn't be able to leave it.
To test exactly how this works, set the constant that makes it effect allys to true. Then get one of your ranged units in the AOE and try to escape.
Well if i set the constant larger then the initial aoe would be increased aswell, hmmm... And yea in the game when you cast this you gain spell resist and armor so you might just activate it while running away.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.