What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal

Simple Rest()?

znuffie

Active Member
Joined
Feb 23, 2010
Messages
864
Reaction score
30
Can someone help me with a simple Rest() / NeedRest() behavior?

I can't, for the love of god, make my Druid CC drink properly. It keep using drinks, then mounts up and runs, or moves away, or whatever.

I can't understand why and how each of these routines are called...

Can someone spoon feed me or explain how they are supposed to work?
 
if needrest() is true then Rest()
so when you build them they need to kind of mirror each other NeedRest returning a Bool and Rest() actually doing the work and eating or drinking or whatever.

if you havent looked take a look at my CC creation guide in the developers section, it should give you some ideas about how it works.

*edit*
here you go and example that should work, and its commented.
Code:
        public override bool NeedRest
        {
            get
            {
                if (Me.HealthPercent <= 50)
                {
                    //if my health is less then 50 then return true, we do need to rest.
                    return true;
                }
                //Leave the false last since it needs to return false to say "Hey i dont need to rest"
                return false;
            }
        }

        public override void Rest()
        {

            if (Me.HealthPercent <= 50)
            {
                //if my health is less then 50, Eat - HB's API will automaticly pick the bestfood
                Styx.Logic.Common.Rest.Feed();
            }


        }
 
Last edited:
That's what I did >_<

Still randomly gets himself up and does other stuff while drinking/eating.

Guess the problem is somewhere else. I'll look into it.
 
if you wanna post or send me what you have ill be glad to look at it, and see if there is anything glaringly wrong causing the issue. but its completely up to you.
 
Just have to ask, as it doesn't seem documented thoroughly - What is
Code:
Styx.Logic.Common.Rest.NoDrink
used for?

I thought that it returns true if you have no drinks in your bags... but this doesn't seem to be the case?
 
Just have to ask, as it doesn't seem documented thoroughly - What is
Code:
Styx.Logic.Common.Rest.NoDrink
used for?

I thought that it returns true if you have no drinks in your bags... but this doesn't seem to be the case?
it seems like that's the cause, but the api could be buggy with that bool. sometimes updates can break small pieces of the api.
 
Back
Top