void UnSummonPetLogoff(int petid)
{
try
{
//First we close the pet by calling closepet void.
if (petid == Character.Grabpet.Grabpetid)
{
ClosePet(petid, Character.Grabpet.Details);
Character.Grabpet.Active = false;
Character.Grabpet.Spawned = false;
Character.Grabpet.Details = null;
}
else if (petid == Character.Attackpet.Uniqueid)
{
ClosePet(petid, Character.Attackpet.Details);
Character.Attackpet.Active = false;
Character.Attackpet.Spawned = false;
Character.Attackpet.Details = null;
}
//Update database information
MsSQL.UpdateData("UPDATE pets SET pet_active='0' WHERE pet_unique='" + petid + "' AND playerid='" + Character.Information.CharacterID + "'");
//Set active to false so the user can spawn another pet.
Character.Grabpet.Active = false;
}
catch (Exception ex)
{
Console.WriteLine("Pet despawn error: " + ex);
}
}