• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Spell: Multicast

Status
Not open for further replies.
Level 2
Joined
Aug 17, 2015
Messages
24
Hello ! Is there someone willingly to create for me a passive ability that has a chance to double cast an ability? I know the idea of the spell is already taken from DotA but I've seen it on some popular maps and I want to have some fun too on my map :D.

I want it as an ultimate ability,just 1 level and 20% chance.
 

Ardenian

A

Ardenian

^I think it does:

  • Set MCA_Next_Spell_Chance[0] = 100.00
  • Set MCA_Next_Spell_Chance[1] = 50.00
But, beware of:
Wietlol said:
This system can have one unit that can double cast abilities of the same chain per player.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
Take a look at Weitlol's Multicast System!

Lol, there was a complete discussion about its name when I released that... (Never got to make it complete though.)

However the name is refered to League of Legends where some abilities are multi-cast abilities making you able to cast the ability again doing a secondary effect.
For example, LeBlanc leaps to the target location, on second cast, she teleports back to the location she was when she cast that ability.
Or Anivia can launch an orb of ice at the target location, on second cast, it explodes stunning the units in it's AoE.
That system is NOT to cast a generic ability again.

However making that passive is not really hard to make.
Create a trigger that runs when a unit has cast one of the supported abilities of Double Cast.
If it will double cast (calculated by percentage), stop the triggering unit (causing the ability to not go on cooldown) and order the unit to cast that ability again at the same target etc etc etc.
You do have to set double cast on cooldown (easiest way is to use a unit indexer to store the data and a game time simulator to store at what gametime it is allowed to be cast on that unit again.

Unit Indexer can be Bribe's (which I use and recommend).
Game Time Simulator is a timer that starts on map init and keeps track of the actual gametime in accurate in-game seconds.
 
Level 2
Joined
Aug 17, 2015
Messages
24
Well,thanks for your answers guys.
@Wietlol but,can you post a screen of these triggers please?I'm not really good at triggers,I know just some basics .And if you used variables,post a screen of these too. :D
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
hmm... there is one problem that makes this trigger pretty long.
You cannot order a unit to cast an ability from a variable normally I guess.
Anyway, this should work:
  • Ability Multicast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • Custom script: set udg_TempReal[0] = GetGameTime()
      • Set TempUnit[0] = (Triggering unit)
      • Set TempInteger[0] = (Custom value of TempUnit[0])
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Multicast for TempUnit[0]) Greater than 0
          • Multicast_CooldownTime[TempInteger[0]] Less than or equal to TempReal[0]
          • Or - Any (Conditions) are true
            • Conditions
              • (Ability being cast) Equal to Firebolt (Neutral Hostile)
              • (Ability being cast) Equal to Storm Bolt
              • (Ability being cast) Equal to Holy Light
              • (Ability being cast) Equal to Death Coil
        • Then - Actions
        • Else - Actions
          • Skip remaining actions
      • -------- !!!!! Set Change in percentage here !!!!! --------
      • Set TempReal[1] = 15.00
      • Set TempReal[2] = (Random real number between 0.00 and 100.00)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TempReal[1] Greater than or equal to TempReal[2]
        • Then - Actions
          • -------- set the new cooldown time --------
          • Set Multicast_CooldownTime[TempInteger[0]] = (TempReal[0] + 10.00)
          • -------- order unit to cast --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Ability being cast) Equal to Firebolt (Neutral Hostile)
            • Then - Actions
              • Unit - Order TempUnit[0] to Neutral - Firebolt (Target unit of ability being cast)
              • Skip remaining actions
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Ability being cast) Equal to Storm Bolt
            • Then - Actions
              • Unit - Order TempUnit[0] to Human Mountain King - Storm Bolt (Target unit of ability being cast)
              • Skip remaining actions
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Ability being cast) Equal to Holy Light
            • Then - Actions
              • Unit - Order TempUnit[0] to Human Paladin - Holy Light (Target unit of ability being cast)
              • Skip remaining actions
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Ability being cast) Equal to Death Coil
            • Then - Actions
              • Unit - Order TempUnit[0] to Undead Death Knight - Death Coil (Target unit of ability being cast)
              • Skip remaining actions
            • Else - Actions
        • Else - Actions
When a unit starts the effect of an ability, you check if that unit has Multicast.
You also check if the ability being cast is one of the supporting abilities (Firebolt, Storm Bolt, Holy Light and Death Coil in this case).
If not, you skip the remaining actions meaning the trigger will just stop.

Then you set TempReal[1] to the amount that you want your chance to be.
(15 in this example is 15% chance to double cast.)
TempReal[2] will be used to have a random number to make the chance calculation work.

If TempReal[1] is greater than TempReal[2], then the unit will be ordered to cast the ability again.
However this is where you have to make an If/Then/Else for every single ability that you support because you cannot load the order id from the ability.
You also set a global real variable to the current gametime + 10 (meaning 10 seconds), so when you cast another ability, it will also check if the current gametime is higher than that real.

You can use Bribe's GUI Unit Indexer.
Also, create another trigger and call it "GTS System".
Convert it to custom text (Edit -> Convert to Custom Text).
Then remove all text inside it and replace it with this:
JASS:
library gtsSystem
    
    globals
        timer udg_GTS_Timer
        real udg_GTS_Hours = 0.
    endglobals
    
    function GetGameTime takes nothing returns real
        return 3600*udg_GTS_Hours + TimerGetElapsed(udg_GTS_Timer)
    endfunction
    
    function GameTimeWait takes real duration returns nothing
        local timer t
        local real  timeRemaining

        if duration > 0. then
            set t = CreateTimer()
            call TimerStart(t, duration, false, null)
            loop
                set timeRemaining = TimerGetRemaining(t)
                exitwhen timeRemaining <= 0
                
                if timeRemaining > bj_POLLED_WAIT_SKIP_THRESHOLD then
                    call TriggerSleepAction(0.1 * timeRemaining)
                else
                    call TriggerSleepAction(bj_POLLED_WAIT_INTERVAL)
                endif
            endloop
            call DestroyTimer(t)
            set t = null
        endif
    endfunction
    
endlibrary


function GTS_Add_Hour takes nothing returns nothing
    set udg_GTS_Hours = udg_GTS_Hours + 1.
endfunction
function InitTrig_GTS_System takes nothing returns nothing
    set udg_GTS_Timer = CreateTimer()
    call TimerStart(udg_GTS_Timer, 3600, true, function GTS_Add_Hour)
endfunction

If you havent gor JNGP 2.0 yet, then I really suggest you to download it. (It is also required for this trigger.)
(Be aware that you have to save the map before testing.)
 
Level 2
Joined
Aug 17, 2015
Messages
24
Well,as i said I'm pretty noob with triggers,so i have some questions:
1.How did you do the first action(custom script)?I tried like that:
25sl5qu.jpg

xD
2.What kind of variables are TempUnit and TempInteger ?
3.Why do I need JNGP 2.0 ?
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
1, Yes that is right.
Everything that is unable to do with normal GUI actions, has to be done in JASS.
A custom script is directly inserted into the JASS form of the GUI trigger (GUI triggers convert to JASS when you save the map.

2, I think that is self explanatory.
TempUnit is a temporary unit variable.
Aka a unit global variable (ussually array)
TempInteger is a temporary integer variable.
Aka an integer global variable (ussually array)
TempReal is a temporary... Ow cmon it is not that hard to understand.


3, Because I use library and globals which are vJASS features to automatically create global variables (and allow creation of global variables that are unable to be created using GUI) and change the location of the code to be able to be used by every other trigger.
But because I do use those features, that means that you as map maker are required to have a modified world editor (normal WC3 still runs properly, but vJASS has to be converted to normal JASS... like GUI triggers).
JNGP also allows larger maps, more tiles, and many many more simple features that everyone wants now and then.
Version 2.0 is the best version afaik.
 
Level 2
Joined
Aug 17, 2015
Messages
24
At question 2 I asked that because I managed at " Set TempUnit[0] = (Triggering unit) " TempUnit to be an Array Unit Varriable and I succeeded creating that line ; but at the second line I created the TempInteger[0] varriable as an array integer , but I didn't find how to make it's value to ( Custom Value of TempUnit[0] ) , so I tought it's another type of varriable. I hope you'll understand,my english is pretty bad :D .
 
Status
Not open for further replies.
Top