Aller au contenu

Photo

UT_HireFollower() preventing xp gain


  • Veuillez vous connecter pour répondre
2 réponses à ce sujet

#1
Magic

Magic
  • Members
  • 187 messages
Inside the function

  void UT_HireFollower(object oFollower, int bPreventLevelup = FALSE)

there is a call

  WR_SetFollowerState(oFollower, FOLLOWER_STATE_ACTIVE, TRUE, 0, TRUE);

to the function

  void WR_SetFollowerState(object oCreature, int nState, int nSendEvent = TRUE, int nMinLevel = 0,
      int bPreventLevelup = FALSE)

This means the follower will be prevented from gaining xp afterwards. To enable it again, the flag CREATURE_REWARD_FLAGS needs to be cleared again after the hired event was processed (there the flag is set). New events are processed after the current script.
  SetLocalInt(OBJECT_SELF,CREATURE_REWARD_FLAGS,0);
Alternatively, the relevant contents of UT_HireFollower() are to be called directly.

Is this actually a good way and place to discuss such findings? I was surprised to find little about followers at all but maybe I'm doing the search wrong?

#2
Craig Graff

Craig Graff
  • Members
  • 608 messages
This is a perfectly good place to mention such things. However it is even better if you can find a place on the wiki to mention any such gotchas. Perhaps in the page for the function?

#3
Magic

Magic
  • Members
  • 187 messages
Thanks for the answer. I wanted to avoid editing at several places but I was willing to try. However, I can't find the function's page? Are there actually any for wrapper functions like UT_*() or WR_*()? I assumed only the core functions have been parsed there.