Heal spell based on main attribute

Anderzzon

Active Member
Reaction score
4
I wanna create a spell that heals the target based on the casters main atribute.

It should heal MAx4, so if the caster has 25 intel (and is an intel hero (I feel a need to be overly clear...)) then the target should be healed for 100.

Is it possible to do this with a rather simple trigger? No JASS since I haven't even used started using JASS yet so...

/Anderzzon
 

Accname

2D-Graphics enthusiast
Reaction score
1,463
make a custom spell which does completely nothing (best to use channel) and create a trigger similar to the following one:
Trigger:
  • Untitled Trigger 001
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Heal (custom ability)
    • Actions
      • Unit - Set life of (Target unit of ability being cast) to ((Life of (Target unit of ability being cast)) + (0.25 x (Real((Intelligence of (Triggering unit) (Include bonuses))))))

you can add special effects or a text tags or whatever you like, this is just the basic.
 

Anderzzon

Active Member
Reaction score
4
That doesn't look too hard. Thanks mate.

Now... if I want to create a simular spell that damages instead. Is it the same though the other way around?

/Anderzzon
 

Accname

2D-Graphics enthusiast
Reaction score
1,463
i would suggest to use the action "unit - damage target" instead.
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
You cant detect the main attribute with triggers alone
 

Accname

2D-Graphics enthusiast
Reaction score
1,463
but he can detect the hero casting the spell and the main attribute of a specific hero is always the same.
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
Wow. Lots of heroes = lots of if/then/else
 

Accname

2D-Graphics enthusiast
Reaction score
1,463
you only have to take the number of heroes which can actually cast this spell.
and besides, do you know a better way?
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
Well this is if there is alot of heroes. You need 3 passives that do nothing and name then str, agi, int, then you need 3 spell books that has visible set to false and Name them also str, agi, int. Then put the passive str in spell book str and do the same with agi and int. Then give the str spell book to all strenth heroes do the same with agi and int. Then just detect if he has str then he is a strenth hero or if he has agi then his agility.
 

Accname

2D-Graphics enthusiast
Reaction score
1,463
actually this is a nice idea but i would suggest using invisible passive abilitys instead of having those 3 extra spellbooks consuming space.
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
Didnt know passive could be invisible. Use attribute bonus but no bonus then check the field hide icon
 

Anderzzon

Active Member
Reaction score
4
Like item armor bonus with no bonus? It doesn't show. It's what I use for attachments so...
 

ChaosWarlock

New Member
Reaction score
7
I just put my heroes into one of there groups when they are picked, str/agi/int. Then when the unit casts a spell I check what group it is in and do the damage according to that attribute.
 

Anderzzon

Active Member
Reaction score
4
I was thinking the same, just place them in unit groups. I thought of that yessterday. After the post I did with the armor thingie. :p

/Anderzzon
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
How do you add non existant units to unit groups and if the enter the map you will need a lot of if then else and it leaks 3 unit groups
 

ChaosWarlock

New Member
Reaction score
7
Non existent units cant cast spells.

Yes you need 3 if/then/else.

Event: Unit enters map
Condition: Unit is a hero
Action: If multiple
Unit = Paladin
Unit = Tauren Chieften
Then add to Heroes_Str
Else

(Repeat the red for intel and agi heroes.)

The three unit groups do not leak. Only leaks if you do "pick every unit in..." and you don't use a variable.
 

roXplosive

New Member
Reaction score
15
I was thinking of using an array of structure (1 position for every hero unit available) that has constant values . This works well if you have a selection area for heroes .

JASS:

structure mainstat
   private integer UnitCode
   private integer AttributeCode

   method SetValue takes unit u , integer a returns nothing
          set u=GetUnitTypeId(u)
          set AttributeCode=a
   endmethod

   method StatType takes unit u returns integer
         if UnitCode==GetUnitTypeId(u) then
           return AttributeCode
         else
           return -1
         endif
  endmethod

endstructure


Then for the heroes actually created make a pair of (unit,abilitycode) for faster access in the spell . But chaos Warlock's method is better . Only don't let some heroes out when creating the map
 

Dirac

22710180
Reaction score
147
Donst even need to know which one is the main attribute, it uses to be the one with the highest value as for

IF
And
If Intelligence greater than Strenght
If Intelligence greater than Agility
THEN
Stuff with intelligence
ELSE

IF
And
If Agility greater than Strenght
If Agility greater than Intelligence
THEN
Stuff with Agility
ELSE
 
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
    +2
  • 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