protected void RemovePartyMember(Mobile m) { PartyList.Remove(m); RemovePartyEffects(m); if (m is PlayerMobile) { foreach (var pet in ((PlayerMobile)m).AllFollowers.Where(p => PartyList.Contains(p))) { RemovePartyMember(pet); } } }
protected void AddPartyMember(Mobile m) { PartyList.Add(m); AddPartyEffects(m); if (m is PlayerMobile) { foreach (var pet in ((PlayerMobile)m).AllFollowers.Where(p => !PartyList.Contains(p) && ValidPartyMember(p))) { AddPartyMember(pet); } } }
private void UpdatePets(Mobile m) { if (m is PlayerMobile pm) { foreach (Mobile pet in pm.AllFollowers) { if (!PartyList.Contains(pet) && ValidPartyMember(pet)) { AddPartyMember(pet); } } } }
public List <Mobile> GetParty() { if (!PartyEffects) { return(null); } Party p = Party.Get(Caster); List <Mobile> list = new List <Mobile>(); if (p != null) { IPooledEnumerable eable = Caster.Map.GetMobilesInRange(Caster.Location, PartyRange); foreach (Mobile mob in eable) { Mobile check = mob; if (mob is BaseCreature && (((BaseCreature)mob).Summoned || ((BaseCreature)mob).Controlled)) { check = ((BaseCreature)mob).GetMaster(); } if (check != null && p.Contains(check)) { list.Add(mob); if (PartyList == null) { PartyList = new List <Mobile>(); } if (!PartyList.Contains(mob)) { PartyList.Add(mob); } } } eable.Free(); } if (!list.Contains(Caster)) { list.Add(Caster); } return(list); }
private void UpdatePets(Mobile m) { if (m is PlayerMobile pm) { for (var index = 0; index < pm.AllFollowers.Count; index++) { Mobile pet = pm.AllFollowers[index]; if (!PartyList.Contains(pet) && ValidPartyMember(pet)) { AddPartyMember(pet); } } } }
protected void RemovePartyMember(Mobile m) { PartyList.Remove(m); RemovePartyEffects(m); if (m is PlayerMobile pm) { foreach (Mobile pet in pm.AllFollowers) { if (PartyList.Contains(pet)) { RemovePartyMember(pet); } } } }
protected void AddPartyMember(Mobile m) { PartyList.Add(m); AddPartyEffects(m); if (m is PlayerMobile pm) { foreach (Mobile pet in pm.AllFollowers) { if (!PartyList.Contains(pet) && ValidPartyMember(pet)) { AddPartyMember(pet); } } } }
protected void RemovePartyMember(Mobile m) { PartyList.Remove(m); RemovePartyEffects(m); if (m is PlayerMobile pm) { for (var index = 0; index < pm.AllFollowers.Count; index++) { Mobile pet = pm.AllFollowers[index]; if (PartyList.Contains(pet)) { RemovePartyMember(pet); } } } }
protected void AddPartyMember(Mobile m) { PartyList.Add(m); AddPartyEffects(m); if (m is PlayerMobile pm) { for (var index = 0; index < pm.AllFollowers.Count; index++) { Mobile pet = pm.AllFollowers[index]; if (!PartyList.Contains(pet) && ValidPartyMember(pet)) { AddPartyMember(pet); } } } }
public void UpdateParty(bool playersOnly) { Party p = Party.Get(Caster); if (PartyList == null) { PartyList = new List <Mobile>(); } if (p != null) { for (var index = 0; index < p.Members.Count; index++) { var x = p.Members[index]; Mobile m = x.Mobile; if (!PartyList.Contains(m) && (!playersOnly || m is PlayerMobile) && ValidPartyMember(m)) { AddPartyMember(m); } else if (PartyList.Contains(m) && !ValidPartyMember(m)) { RemovePartyMember(m); } else { UpdatePets(m); } } } else if (!PartyList.Contains(Caster)) { AddPartyMember(Caster); } }