private void UpdateIntelligentCreature(C.UpdateIntelligentCreature p)//IntelligentCreature { if (Stage != GameStage.Game) { return; } ClientIntelligentCreature petUpdate = p.Creature; if (petUpdate == null) { return; } if (p.ReleaseMe) { Player.ReleaseIntelligentCreature(petUpdate.PetType); return; } else if (p.SummonMe) { Player.SummonIntelligentCreature(petUpdate.PetType); return; } else if (p.UnSummonMe) { Player.UnSummonIntelligentCreature(petUpdate.PetType); return; } else { //Update the creature info for (int i = 0; i < Player.Info.IntelligentCreatures.Count; i++) { if (Player.Info.IntelligentCreatures[i].PetType == petUpdate.PetType) { Player.Info.IntelligentCreatures[i].CustomName = petUpdate.CustomName; Player.Info.IntelligentCreatures[i].SlotIndex = petUpdate.SlotIndex; Player.Info.IntelligentCreatures[i].Filter = petUpdate.Filter; Player.Info.IntelligentCreatures[i].petMode = petUpdate.petMode; } else { continue; } } if (Player.CreatureSummoned) { if (Player.SummonedCreatureType == petUpdate.PetType) { Player.UpdateSummonedCreature(petUpdate.PetType); } } } }
public void Update(ClientIntelligentCreature pet, bool setnew = false) { if (pet == null) return; if (PetType == IntelligentCreatureType.None || PetType != pet.PetType) setnew = true;//force new if (setnew) SetButtonInfo(pet); else { NameLabel.Text = pet.CustomName.ToString(); } }
private void SetButtonInfo(ClientIntelligentCreature pet) { if (pet == null) return; PetType = pet.PetType; NameLabel.Text = pet.CustomName.ToString(); PetButton.Index = pet.Icon; PetButton.PressedIndex = pet.Icon; SetCreatureFrames(); }
protected override void ReadPacket(BinaryReader reader) { Creature = new ClientIntelligentCreature(reader); }
protected override void ReadPacket(BinaryReader reader) { Creature = new ClientIntelligentCreature(reader); SummonMe = reader.ReadBoolean(); UnSummonMe = reader.ReadBoolean(); ReleaseMe = reader.ReadBoolean(); }