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
 
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.
 
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
 
i would suggest to use the action "unit - damage target" instead.
 
You cant detect the main attribute with triggers alone
 
but he can detect the hero casting the spell and the main attribute of a specific hero is always the same.
 
Wow. Lots of heroes = lots of if/then/else
 
you only have to take the number of heroes which can actually cast this spell.
and besides, do you know a better way?
 
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.
 
actually this is a nice idea but i would suggest using invisible passive abilitys instead of having those 3 extra spellbooks consuming space.
 
Didnt know passive could be invisible. Use attribute bonus but no bonus then check the field hide icon
 
Like item armor bonus with no bonus? It doesn't show. It's what I use for attachments so...
 
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.
 
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
 
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
 
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.
 
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
 
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.
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    News portal has been retired. Main page of site goes to Headline News forum now
  • The Helper The Helper:
    I am working on getting access to the old news portal under a different URL for those that would rather use that for news before we get a different news view.
  • Ghan Ghan:
    Easily done
    +1
  • The Helper The Helper:
    https://www.thehelper.net/pages/news/ is a link to the old news portal - i will integrate it into the interface somewhere when i figure it out
  • Ghan Ghan:
    Need to try something
  • Ghan Ghan:
    Hopefully this won't cause problems.
  • Ghan Ghan:
    Hmm
  • Ghan Ghan:
    I have converted the Headline News forum to an Article type forum. It will now show the top 20 threads with more detail of each thread.
  • Ghan Ghan:
    See how we like that.
  • The Helper The Helper:
    I do not see a way to go past the 1st page of posts on the forum though
  • The Helper The Helper:
    It is OK though for the main page to open up on the forum in the view it was before. As long as the portal has its own URL so it can be viewed that way I do want to try it as a regular forum view for a while
  • Ghan Ghan:
    Yeah I'm not sure what the deal is with the pagination.
  • Ghan Ghan:
    It SHOULD be there so I think it might just be an artifact of having an older style.
  • Ghan Ghan:
    I switched it to a "Standard" article forum. This will show the thread list like normal, but the threads themselves will have the first post set up above the rest of the "comments"
  • The Helper The Helper:
    I don't really get that article forum but I think it is because I have never really seen it used on a multi post thread
  • Ghan Ghan:
    RpNation makes more use of it right now as an example: https://www.rpnation.com/news/
  • The Helper The Helper:
  • The Helper The Helper:
    What do you think Tom?
  • tom_mai78101 tom_mai78101:
    I will have to get used to this.
  • tom_mai78101 tom_mai78101:
    The latest news feed looks good

      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