[Spell]: An AoE mana-suck, need trigger help.

BarzahdX

Active Member
Reaction score
18
Either tell me how to get it done in GUI, or just post the code(so I can copy) in JASS. Please explain which are raw values, and which are variables. I know nothing of JASS, so don't expect me to be able to learn from this(however, in GUI would help).

What I need done.

Mana Bomb

The Archon explodes all of his mana to sap enemies within 900 AoE of theirs. The mana drained, will then be asborbed to the Archon.

Level 1: 200 mana.(drained)
Level 2: 400 mana.
Level 3: 600 mana.

Cooldown 1.5 minutes.
_____________________

So it's essentially a thunderclap that deals damage to mana instead of health, no slow, and the mana drained goes to the Archon.

Can it be done? And yes, I do feel inferior that I need to ask somebody to make an entire ability for me. :'(
 

hell_knight

Playing WoW
Reaction score
126
Unit Starts Effect of Ability

Ability being casted equal to ()

Code:
set pos1 = position of casting unit.
Set tempgroup = units within 900 of (pos1) matching conditions is enemy equal to true.

Pick every unit in tempgroup
 Set interger = mana of (Picked unit)
 Set mana to (Mana of (picked unit ) - (level of ability x 200).
   If/then/else
       interger  > (level of ability x 200)
       set mana of (casting unit) to (mana of (casting unit ) + (level of ability x 200)

Else - set mana of (casting unit) to (mana of (casting unit ) + interger

call RemoveLocation (udg_pos1)
call DestroyGroup (udg_tempgroup)

freehand , messy but the concept and math is there. put out mistakes was done in a rush.
 

BarzahdX

Active Member
Reaction score
18
Awesome! That was crazy fast. Thank you so very much.

Now I have a few questions. 1: "interger" Is it supposed to be "Integer"? Because you spelled it that way 3 times, wasn't sure. Edit: Oh wait, is that "interger" a variable?

2: Will this just add to his mana, or will it add to his mana the amount that was taken? Example: If I'm by no unis, will it still fill up 600 mana(I don't want it to)? And if I'm by 10 units, will it still just full 600? Or 6000?

3: Those spaces in "(casting unit )" and "(picked unit )" are those accidents, or are they imperative to the script?

Thank you again.. I look forward to see if it works.
 

hell_knight

Playing WoW
Reaction score
126
Integer.

2. Well ATM , it will suck as much as it can uncapped. By zero units 0 mana. 10 = 0-6000.I don't have time to fix that ATM.

3. No. you don't copy n paste it. You try to recreate it as close as possible in the GUI editor.

Kind of confusing if your new to it. I'll see what I can do till then I need get sleeping =D
 

ReVolver

Mega Super Ultra Cool Member
Reaction score
609
JASS:
function SpellID takes nothing returns integer 
    return 'A000' //Change this to your spell's RAW code.
endfunction

function AoE takes nothing returns integer
    return 900 //Change this to your AoE Amount
endfunction

function spellevel takes integer lvl returns integer 
    return lvl * -200 // Change 200 to w/e you want to increase per level
endfunction

function UnitFilter takes nothing returns boolean
    return GetUnitState(GetFilterUnit(), UNIT_STATE_LIFE) <= 0 and IsUnitAlly(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit()))
endfunction

function Absorb takes nothing returns integer
    local integer level
    set level = GetUnitAbilityLevel(GetTriggerUnit(),SpellID())
    call SetUnitState(GetEnumUnit(),UNIT_STATE_MANA, spellevel(level))
    return spellevel(level)
endfunction

function Trig_Mana_Drain_Actions takes nothing returns nothing
    local unit caster
    local group g
    set g = CreateGroup()
    set caster = GetTriggerUnit()
    call GroupEnumUnitsInRange(g,GetUnitX(caster),GetUnitY(caster), AoE(), Condition(function UnitFilter))
    call ForGroup(g, function Absorb)
    call SetUnitState(caster,UNIT_STATE_MANA, Absorb()*-1) //We want to give mana to him not take
    call DestroyGroup(g)
    set caster = null
    set g = null
endfunction

function Trig_Mana_Drain_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == SpellID()
endfunction

//===========================================================================
function InitTrig_Mana_Drain takes nothing returns nothing
    set gg_trg_Mana_Drain = CreateTrigger(  )
    call TriggerAddAction( gg_trg_Mana_Drain, function Trig_Mana_Drain_Actions )
    call TriggerAddCondition(gg_trg_Mana_Drain, Condition(function Trig_Mana_Drain_Conditions))
endfunction


non vJASS version, untested, should work.
 

BarzahdX

Active Member
Reaction score
18
Are the colors just for clarification? Or is there sometype of download I'm missing?

How do you find the spell's raw code? I'm going to use Thunderclap as the base.

There are so many variables in there.. It's confusing, and I don't know which type of variables I should be using where--but I'll try.. This could take awhile. :) I am in your debt. /bow
 

cleeezzz

The Undead Ranger.
Reaction score
268
1. yes colors are for clarification, easier to read.

2. hit Ctrl + D on the object editor

3. you dont need to know what variables are used, the variables are created within the code itself meaning you dont have to do anything except paste it in your header. if you really want to know,

JASS:
local unit caster


it says unit, so its a unit variable named caster.
 

BarzahdX

Active Member
Reaction score
18
The green words, should I remove those? Initially I thought yes, but is it actually just a comment, and will have no effect on the trigger? This question isn't super important, but as typically always, an answer is welcome.
 

Expelliarmus

Where to change the sig?
Reaction score
48
The green words, should I remove those? Initially I thought yes, but is it actually just a comment, and will have no effect on the trigger? This question isn't super important, but as typically always, an answer is welcome.
Comment will in no way interfere with the code, so you may remove them if you want.
 

BarzahdX

Active Member
Reaction score
18
o_O I just made the ability, made the trigger, converted it to custom script, copied, pasted, edited where necessary--and it has 35 compile errors.. As this is my *first* time *ever* using JASS, what's wrong, and how can I fix it?
 

BarzahdX

Active Member
Reaction score
18
So the trigger itself than.. If I properly understand you.

Code:
function Mana Bomb takes nothing returns integer 
    return 'A093:AHtc' 
endfunction

function AoE takes nothing returns integer
    return 900 
endfunction

function spellevel takes integer lvl returns integer 
    return lvl * -200 
endfunction

function UnitFilter takes nothing returns boolean
    return GetUnitState(GetFilterUnit(), UNIT_STATE_LIFE) <= 0 and IsUnitAlly(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit()))
endfunction

function Absorb takes nothing returns integer
    local integer level
    set level = GetUnitAbilityLevel(GetTriggerUnit(),SpellID())
    call SetUnitState(GetEnumUnit(),UNIT_STATE_MANA, spellevel(level))
    return spellevel(level)
endfunction

function Trig_Mana_Drain_Actions takes nothing returns nothing
    local unit caster
    local group g
    set g = CreateGroup()
    set caster = GetTriggerUnit()
    call GroupEnumUnitsInRange(g,GetUnitX(caster),GetUnitY(caster), AoE(), Condition(function UnitFilter))
    call ForGroup(g, function Absorb)
    call SetUnitState(caster,UNIT_STATE_MANA, Absorb()*-1)
    call DestroyGroup(g)
    set caster = null
    set g = null
endfunction

function Trig_Mana_Drain_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == Mana Bomb()
endfunction

//===========================================================================
function InitTrig_Mana_Drain takes nothing returns nothing
    set gg_trg_Mana_Drain = CreateTrigger(  )
    call TriggerAddAction( gg_trg_Mana_Drain, function Trig_Mana_Drain_Actions )
    call TriggerAddCondition(gg_trg_Mana_Drain, Condition(function Trig_Mana_Drain_Conditions))
endfunction

Hope that's what you were asking for.
 

Expelliarmus

Where to change the sig?
Reaction score
48
JASS:
//function Mana Bomb takes nothing returns integer // functions can not have spaces
function Mana_Bomb takes nothing returns integer 
    //return &#039;A093:AHtc&#039; 
    return &#039;AHtc&#039; // Raw Codes are 4 characters
endfunction

function AoE takes nothing returns integer
    return 900 
endfunction

function spellevel takes integer lvl returns integer 
    return lvl * -200 
endfunction

function UnitFilter takes nothing returns boolean
    return GetUnitState(GetFilterUnit(), UNIT_STATE_LIFE) &lt;= 0 and IsUnitAlly(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit()))
endfunction

function Absorb takes nothing returns integer
    local integer level
    set level = GetUnitAbilityLevel(GetTriggerUnit(),Mana_Bomb()) // Mana_Bomb was SpellID
    call SetUnitState(GetEnumUnit(),UNIT_STATE_MANA, spellevel(level))
    return spellevel(level)
endfunction

function Trig_Mana_Drain_Actions takes nothing returns nothing
    local unit caster
    local group g
    set g = CreateGroup()
    set caster = GetTriggerUnit()
    call GroupEnumUnitsInRange(g,GetUnitX(caster),GetUnitY(caster), AoE(), Condition(function UnitFilter))
    call ForGroup(g, function Absorb)
    call SetUnitState(caster,UNIT_STATE_MANA, Absorb()*-1)
    call DestroyGroup(g)
    set caster = null
    set g = null
endfunction

function Trig_Mana_Drain_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == Mana_Bomb()
endfunction

//===========================================================================
function InitTrig_Mana_Drain takes nothing returns nothing
    set gg_trg_Mana_Drain = CreateTrigger(  )
    call TriggerAddAction( gg_trg_Mana_Drain, function Trig_Mana_Drain_Actions )
    call TriggerAddCondition(gg_trg_Mana_Drain, Condition(function Trig_Mana_Drain_Conditions))
endfunction
 

BarzahdX

Active Member
Reaction score
18
AWESOME! It can be properly enabled now.. Haven't tested it yet, I'll update ya when I do.

How did me editing 4 things, remove 35 errors?
 

saw792

Is known to say things. That is all.
Reaction score
280
JASS:
function Mana_Bomb takes nothing returns integer 
    //return &#039;A093:AHtc&#039; 
    return &#039;A093&#039; // Raw Codes are 4 characters. The second four characters are the raw code of the ability it is based of.
endfunction


Also, your trigger that you posted the code into must be called Mana Drain, in case it isn't already.
 

Crusher

You can change this now in User CP.
Reaction score
121
I wish somethimes that there is mana value on all abilities -.-
Sorry but I Can't help you.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +1
  • V-SNES V-SNES:
    Happy Friday!
    +1

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top