Full Version : Any chance of seeing.
xmlspawner >>XMLPoints Discussion >>Any chance of seeing.


<< Prev | Next >>

Nayfin- 05-26-2006
Is there any chance of seeing a release where players can see kills/deaths under their name that is a very popular subject that i sure couldnt figure out im script stupid!! :> xmlspawner/Checked2.gif

ArteGordon- 05-26-2006
that's an easy modification. Just add this to your PlayerMobile.cs

CODE

  public override void AddNameProperties( ObjectPropertyList list )
  {
   base.AddNameProperties(list);

   XmlPoints a = (XmlPoints)XmlAttach.FindAttachment(this, typeof(XmlPoints));

   if (a != null)
   {
    list.Add(1070722, "Kills {0} / Deaths {1}", a.Kills, a.Deaths);
   }
  }


or even include the Rank with

CODE

  public override void AddNameProperties( ObjectPropertyList list )
  {
   base.AddNameProperties(list);

   XmlPoints a = (XmlPoints)XmlAttach.FindAttachment(this, typeof(XmlPoints));

   if (a != null)
   {
    list.Add(1070722, "Kills {0} / Deaths {1} : Rank={2}", a.Kills, a.Deaths, a.Rank);
   }
  }


you probably also want to make this mod in xmlpoints.cs around line 520 so that Kill and Death values are updated in the players displayed properties as soon as they change.

QUOTE

  private static void UpdateRanking(Mobile m, XmlPoints attachment)
  {
  if(RankList == null) RankList = new ArrayList();

  // flag the rank list for updating on the next attempt to retrieve a rank
  needsupdate = true;

  bool found = false;

  // rank the entries
  for(int i= 0; i<RankList.Count;i++)
  {
    RankEntry p = RankList[i] as RankEntry;
               
    // found a match
    if(p != null && p.Killer == m)
    {
    // update the entry with the new points value

    p.PointsAttachment = attachment;
    found = true;
    break;
    }
  }

  // a new entry so add it
  if(!found)
  {
    RankList.Add(new RankEntry(m, attachment));
  }

  // if points statistics are being displayed in player name properties, then update them
  if(m != null) m.InvalidateProperties();

  }

olsyke- 07-04-2006
oh you just made me install xmlpoints ^^