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

Question: Call Pet

blacklisted

New Member
Joined
Jan 15, 2010
Messages
224
Reaction score
1
I have this method to call my White Wolf Hound pet, However the pet never gets called.
Am I calling the pet correctly? If I change
" UseItem(23695); " to " UseItem(8506);" it will eat the food no problems so I guess my logic is working ok, Is there a specific way of calling pets?

Code:
[FONT=Consolas]public void CallPet()
{
            if(isMounted() == true && skillCooldown("Run!") == 0)
             {
                 UseSkill("Run!");
                 return;
            }

            if(!isMounted())
            {[/FONT][FONT=Consolas]
                  [/FONT]
[FONT=Consolas][FONT=Consolas][COLOR=#000000]                 [FONT=Consolas]//UseItem([/FONT][/COLOR][/FONT][FONT=Consolas][COLOR=#000000][FONT=Consolas]8506);[/FONT][/COLOR][/FONT]
                 UseItem(23695);
[/FONT][FONT=Consolas]                  return;
            }
        }[/FONT]
 
Code:
if (!UseItem(23695))
  Log(GetLastError().ToString());

Result here.
 
the result of the log is "AlreadyHaveMount", Basicly I'm try to call a bet when I dismount.
 
Last edited:
When you try to call your wolf - you have another mount called already?
 
Try wait more after horse dissapear, and only then use wolf
 
Ive added the name of the specific mount that I am dismounting from and a wait, however im still getting the same error that "AlreadyHaveMount"
If I manualy use the Wolf button in game it will call the pet.

Code:
public void CallPet()
            {
                
                if (isMounted() && skillCooldown("Run!") == 0)
                {
                    UseSkill("Run!");                    
                }                
                else
                    if (!isMounted("Gray Lilyut Horse") && itemCooldown(23695) == 0 && getMount() != null)
                {                    
                    Thread.Sleep(50);
                    UseItem(23695);
                    if (!UseItem(23695))
                        Log(GetLastError().ToString());                       
                }
                return;
            }




Ive also tryed this but this also returns "AlreadyHaveMount"

Code:
public void CallPet()
            {
                
                if (isMounted() && skillCooldown("Run!") == 0)
                {
                    UseSkill("Run!");                    
                }                
                else

                var mount = getMount();
                if (mount != getMount("Gray Lilyut Horse"))
                {
                    UseItem(23695);
                    if (!UseItem(23695))
                       Log(GetLastError().ToString());
                }
                return;
            }
 
Last edited:
setting getMount()==null I no longer get an error in the log and the pet wolf is not called, I take it this is because this section of code never enters this if statment as it thinks I still have a mount.
it seems like having a pet out, the game treats the player is mounted.

Code:
if (!isMounted("Gray Lilyut Horse") && itemCooldown(23695) == 0 && getMount() == null)
                    {
                        //Thread.Sleep(50);
                        UseItem(23695);
                        if (!UseItem(23695))
                            Log(GetLastError().ToString());
                    }
 
Try this

Code:
private bool haveMount = false;

public void PluginRun() {
    onNewCreature += (c) => {
        if (c.Equals(getMount())) haveMount = true;
    };
    onCreatureRemoved += (c) => {
        if (c.Equals(getMount())) haveMount = false;
    };
}

EDIT: I'm dumb, this doesn't actually make the item usable. Haha. I was onto something different - reliably checking if the mount is there.
 
Last edited:
This seems to be working for me so far


Code:
public void CallPet()
            {
                //string mountName = getMount().name;
                bool canCallPet = true;
                if (itemCooldown("White Wolfhound") == 0)
                {
                    canCallPet = true;
                }
                else
                if (itemCooldown("White Wolfhound") != 0)
                {
                     canCallPet = false;
                }
                else
                if (itemCooldown("White Wolfhound") == 0 && getMount().name == "White Wolfhound")
                {
                    canCallPet = false;
                }                

                if (!isMounted("Gray Lilyut Horse") && !me.isMoving && canCallPet == true)
                {                    
                    UseItem("White Wolfhound");
                    Thread.Sleep(50);                    
                    return;                  
                }                
                if (isMounted() && skillCooldown("Run!") == 0)
                {
                    UseSkill("Run!");
                    //Log("Skill Used: Run!");                    
                    return;
                }        
            }
 
Back
Top