• 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!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

A little question by a noob.

Status
Not open for further replies.
Level 5
Joined
Oct 8, 2010
Messages
134
Edit: I understand this is not appropriate here, sorry for posting this at Jass class and not at the Jass Question forum.
Later this day I shall delete this, if it is answered before I deleted it, then that would be awesome, and a repost would not be needed.


Heya vlad727 here.

I am kinda new to Jass/vJass, and have (for reasons now unknown to me) avoided jass in the past.

I started using it in my projects for my LAN friends, and I got a simple question
regarding syntax.

I use the threat system (the only not need fix one xD)
And what I am editing are script calls that call to the system, so spells generate formula based threat.


What is the syntax I am going to need to get the stat of the casting unit?
I am, shamefully, lost and lack the time to do a lot of jass classes.

So Fellow Hive Members, please help me out

Thx in advance, Vlad727
 
Last edited:
Level 13
Joined
Mar 24, 2013
Messages
1,105
I think what you're looking for is this?

JASS:
Native GetHeroStr takes unit whichHero, Boolean bonuses returns integer

That is from memory hopefully someone can confirm. It's the same for int and agi
 
Level 5
Joined
Oct 8, 2010
Messages
134
Will give it a try once i get home, hope it works.
currently the thing uses skill lvl, but i use un levelvable skills.
so getting the stats is important xD
 
@pOke is correct.

From .j file natives:
JASS:
native          GetHeroAgi          takes unit whichHero, boolean includeBonuses returns integer
native          GetHeroInt          takes unit whichHero, boolean includeBonuses returns integer
native          GetHeroStr          takes unit whichHero, boolean includeBonuses returns integer

// BJ, functioning as a switch statement
function GetHeroStatBJ takes integer whichStat, unit whichHero, boolean includeBonuses returns integer
    if (whichStat == bj_HEROSTAT_STR) then
        return GetHeroStr(whichHero, includeBonuses)
    elseif (whichStat == bj_HEROSTAT_AGI) then
        return GetHeroAgi(whichHero, includeBonuses)
    elseif (whichStat == bj_HEROSTAT_INT) then
        return GetHeroInt(whichHero, includeBonuses)
    else
        // Unrecognized hero stat - return 0
        return 0
    endif
endfunction
 
Status
Not open for further replies.
Top