public void AddAbilities(ushort minBound, ushort maxBound) { if (maxBound == 0) { AbilityInfo abInfo = AbilityMgr.GetAbilityInfo(minBound); if (abInfo != null && abInfo.ConstantInfo.MinimumRank <= Level) { NPCAbility npcAbility = new NPCAbility(abInfo.Entry, abInfo.ConstantInfo.AIRange, (byte)abInfo.Cooldown, true, ""); AbtInterface.NPCAbilities.Add(npcAbility); SendPetAbility(npcAbility); } } else { for (ushort i = minBound; i <= maxBound; ++i) { AbilityInfo abInfo = AbilityMgr.GetAbilityInfo(i); if (abInfo == null || abInfo.ConstantInfo.MinimumRank > Level) { continue; } NPCAbility npcAbility = new NPCAbility(abInfo.Entry, abInfo.ConstantInfo.AIRange, (byte)abInfo.Cooldown, true, ""); AbtInterface.NPCAbilities.Add(npcAbility); SendPetAbility(npcAbility); } } }
public void SendPetAbility(NPCAbility ability) { PacketOut Out = new PacketOut((byte)Opcodes.F_PET_INFO, 14); Out.WriteUInt16(Oid); Out.WriteByte(0); Out.WriteByte(0); Out.WriteByte(0); Out.WriteByte(1); Out.WriteByte(FollowMode); Out.WriteByte(AIMode); Out.WriteByte((byte)PetUpdateType.AddAbility); Out.WriteUInt16(ability.Entry); Out.WriteByte((byte)(ability.AutoUse ? 1 : 0)); Out.WriteByte(0); Out.WriteByte(0); Owner.SendPacket(Out); }