Full Version : Custom Skill Gump for Owner
xmlspawner >>Scripting Support >>Custom Skill Gump for Owner


<< Prev | Next >>

Erica- 07-21-2006
Hi ArteGordon i am having a little issue here ok the script that i will code was in my version RunUo 1.0 and gump skills showed right now i updated to work on RunUo 2.0 svn 66 but the problem is this in my shard i have skillcap at 12000 which you get to pick 12 skills on the skill stone now heres the problem ive tested it and ive also said this command --->[g and gump opens when i target a player thats had pick 12 skills to 100 but the gump is showing on human character skills 20 which its not true its 0 meaning the picture im going to show you is the command [g gump when target player now you see all the skills that say 20 they are actually 0 i even did a prop on player and they are maxed out on the 12 skills you see they picked which are 100 the gump shows the 100 as well which are right but those 20 are wrong should show 0 now if i do this to and elf character it will show the 12 skills 100 that they picked and the others show 0 but for human its showing 20 what can i do to get this script to work the right way heres the picture as i said before on top of this post.

user posted image

and heres the script.

CODE
//////////////////////////////////
//        v2        //
//      Scripted by Viago      //
//     www.fallensouls.org  //
//////////////////////////////////
using System;
using System.Collections;
using Server;
using Server.Mobiles;
using Server.Network;
using Server.Prompts;
using Server.Items;
using Server.Guilds;
using Server.Gumps;
using Server.Targeting;
using Server.Commands;


namespace Server.Mobiles
{
public class GMeSystem
{
 
 public static void Initialize()
 {
  CommandSystem.Register( "G", AccessLevel.Owner, new CommandEventHandler( Ex_OnCommand ) );
 }
 
 public static void Ex_OnCommand( CommandEventArgs args )
 {
  Mobile m = args.Mobile;
  PlayerMobile from = m as PlayerMobile;
  if( from != null )
  {
   m.SendMessage ( 66, "Target a Player Mobile to Examine it in detail." );
   m.Target = new InternalTarget();
  }
 }
 
 private class InternalTarget : Target
 {
  public InternalTarget() : base( 18, false, TargetFlags.None )
  {
  }
 
  protected override void OnTarget( Mobile from, object target) // Override the protected OnTarget() for our feature
  {
   PlayerMobile targeter = from as PlayerMobile;
   if ( target is PlayerMobile )
   {
    PlayerMobile t = ( PlayerMobile ) target;
    if ( targeter.AccessLevel == AccessLevel.Owner )
    {
     if ( !t.Alive )
     {
      targeter.SendMessage( "That Is Dead, Can Not Examine it" ); // That item is already blessed
     }
     else
     {
      targeter.SendGump ( new TermGMeGump( t ) );
     }
    }
    if ( targeter.AccessLevel == AccessLevel.Seer )
    {
     if ( t.AccessLevel >= AccessLevel.Seer)
     {
      targeter.SendMessage( "You Can Not Examine Anyone That Has a Higher Acess Level Than You Do" ); // That item is already blessed
     }
     else
     {
      targeter.SendGump ( new TermGMeGump( t ) );
     }
    }
    if ( targeter.AccessLevel == AccessLevel.GameMaster )
    {
     if ( t.AccessLevel >= AccessLevel.GameMaster)
     {
      targeter.SendMessage( "You Can Not Examine Anyone That Has a Higher Acess Level Than You Do" ); // That item is already blessed
     }
     else
     {
      targeter.SendGump ( new TermGMeGump( t ) );
     }
    }
    if ( targeter.AccessLevel == AccessLevel.Counselor )
    {
     if ( t.AccessLevel >= AccessLevel.Counselor)
     {
      targeter.SendMessage( "You Can Not Examine Anyone That Has a Higher Acess Level Than You Do" ); // That item is already blessed
     }
     else
     {
      targeter.SendGump ( new TermGMeGump( t ) );
     }
    }
   }
   else
   {
    from.SendMessage( "That is not a valid target." );
   }
  }
 }
 
 public class TermGMeGump : Gump
 {
  private PlayerMobile m_from;
  private double terb;
  private double terc;
  private double terd;
  private double tere;
  private double terf;
  private double terg;
  private double terh;
  private double teri;
  private double terj;
  private double terk;
  private double terl;
  private double term;
  private double tern;
  private double tero;
  private double terp;
  private double terq;
  private double terr;
  private double ters;
  private double tert;
  private double teru;
  private double terv;
  private double terw;
  private double terx;
  private double tery;
  private double terz;
  private double teraa;
  private double terab;
  private double terac;
  private double terad;
  private double terae;
  private double teraf;
  private double terag;
  private double terah;
  private double terai;
  private double teraj;
  private double terak;
  private double teral;
  private double teram;
  private double teran;
  private double terao;
  private double terap;
  private double teraq;
  private double terar;
  private double teras;
  private double terat;
  private double terau;
  private double terav;
  private double teraw;
  private double terax;
  private double teray;
  private double teraz;
  private double teraaa;
  private double teraab;
  private double teraac;
  private double teraad;
  private double teraae;
  private double seskill2;
  private double seskill1;
  private int str;
  private int dex;
  private int kill;
  private int fame;
  private int karma;
  // private int tokens;   // activate this ling only if you have my player Mobile
  private int intl;
  private int fl;
  private int fm;
  public int luck;
  public bool young;
  private Map Map;
  private string ter1;
  public TermGMeGump( PlayerMobile t) : base( 200, 200 )
  {
   m_from = t;
   double terb = t.Skills[SkillName.Alchemy].Value;
   double terc = t.Skills[SkillName.Blacksmith].Value;
   double terd = t.Skills[SkillName.Cartography].Value;
   double tere = t.Skills[SkillName.Carpentry].Value;
   double terf = t.Skills[SkillName.Cooking].Value;
   
   double terg = t.Skills[SkillName.Fletching].Value;
   double terh = t.Skills[SkillName.Inscribe].Value;
   double teri = t.Skills[SkillName.Tailoring].Value;
   double terj = t.Skills[SkillName.Tinkering].Value;
   double terk = t.Skills[SkillName.Discordance].Value;
   double terl = t.Skills[SkillName.Musicianship].Value;
   double term = t.Skills[SkillName.Peacemaking].Value;
   double tern = t.Skills[SkillName.Provocation].Value;
   double ters = t.Skills[SkillName.Chivalry].Value;
   double tert = t.Skills[SkillName.EvalInt].Value;
   double teru = t.Skills[SkillName.Magery].Value;
   double terv = t.Skills[SkillName.MagicResist].Value;
   double terw = t.Skills[SkillName.Meditation].Value;
   double terx = t.Skills[SkillName.Necromancy].Value;
   double tery = t.Skills[SkillName.SpiritSpeak].Value;
   double terz = t.Skills[SkillName.Camping].Value;
   double teraa = t.Skills[SkillName.Fishing].Value;
   double terab = t.Skills[SkillName.Focus].Value;
   double terac = t.Skills[SkillName.Healing].Value;
   double terad = t.Skills[SkillName.Herding].Value;
   double terae = t.Skills[SkillName.Lockpicking].Value;
   double teraf = t.Skills[SkillName.Lumberjacking].Value;
   double terag = t.Skills[SkillName.Mining].Value;
   double terah = t.Skills[SkillName.Snooping].Value;
   double terai = t.Skills[SkillName.Veterinary].Value;
   double teraj = t.Skills[SkillName.Archery].Value;
   double terak = t.Skills[SkillName.Fencing].Value;
   double teral = t.Skills[SkillName.Macing].Value;
   double teram = t.Skills[SkillName.Parry].Value;
   double teran = t.Skills[SkillName.Swords].Value;
   double terao = t.Skills[SkillName.Tactics].Value;
   double terap = t.Skills[SkillName.Wrestling].Value;
   double teraq = t.Skills[SkillName.AnimalTaming].Value;
   double terar = t.Skills[SkillName.Begging].Value;
   double teras = t.Skills[SkillName.DetectHidden].Value;
   double terat = t.Skills[SkillName.Hiding].Value;
   double terau = t.Skills[SkillName.RemoveTrap].Value;
   double terav = t.Skills[SkillName.Poisoning].Value;
   double teraw = t.Skills[SkillName.Stealing].Value;
   double terax = t.Skills[SkillName.Stealth].Value;
   double teray = t.Skills[SkillName.Tracking].Value;
   double teraz = t.Skills[SkillName.Anatomy].Value;
   double teraaa = t.Skills[SkillName.AnimalLore].Value;
   double teraab = t.Skills[SkillName.ArmsLore].Value;
   double teraac = t.Skills[SkillName.Forensics].Value;
   double teraad = t.Skills[SkillName.ItemID].Value;
   double teraae = t.Skills[SkillName.TasteID].Value;
   
   double seskill1 = t.Skills[SkillName.Ninjitsu].Value;
   double seskill2 = t.Skills[SkillName.Bushido].Value;
   int luck = t.Luck;
   int str = t.Str;
   // int tokens = t.Tokens;  // activate this ling only if you have my player Mobile
   int fame = t.Fame;
   int karma = t.Karma;
   bool young = t.Young;
   int kill = t.Kills;
   int dex = t.Dex;
   int intl = t.Int;
   int fl = t.Followers;
   int fm = t.FollowersMax;
   Map map = t.Map;
   ter1 = t.Name;
   this.Closable=true;
   this.Disposable=false;
   this.Dragable=true;
   this.Resizable=false;
   this.AddPage(0);
   //int line = 0;
   
   this.AddBackground(0, 33, 514, 440, 9270);
   this.AddBackground( 0, 480, 514, 70, 9270);
   this.AddLabel(205, 48, 1271, ter1 );
   
   this.AddLabel(200, 490, 55, "Pets");this.AddLabel(280, 490, 55, fl.ToString() );
   this.AddLabel(28, 490, 55, "Map");this.AddLabel(88, 490, 55, map.ToString() );
   
   this.AddLabel(350, 490, 55, "Luck");this.AddLabel(400, 490, 55, luck.ToString() );
   if ( t.Young == true  )
   {
    this.AddLabel(350, 505, 600, "Young Player");
   }
   //this.AddLabel(350, 520, 88, "Tokens");this.AddLabel(400, 520, 88, tokens.ToString() );    // activate this ling only if you have my player Mobile
   
   if ( t.Kills >= 0  )
   {
    this.AddLabel(200, 520, 55, "Kills");this.AddLabel(280, 520, 33, kill.ToString() );
   }
   
   this.AddLabel(200, 505, 55, "Karma");this.AddLabel(280, 505, 55, karma.ToString() );
   this.AddLabel(28, 505, 55, "Fame");this.AddLabel(88, 505, 55, fame.ToString() );
   if ( t.Criminal == true  )
   {
    this.AddLabel(58, 520, 33, "Criminal");
   }
   
   if ( t.AccessLevel == AccessLevel.Administrator  )
   {
    this.AddLabel(200, 68, 33, "Administrator");
   }
   else if ( t.AccessLevel == AccessLevel.GameMaster  )
   {
    this.AddLabel(200, 68, 798, "GameMaster");
   }
   else if ( t.AccessLevel == AccessLevel.Seer  )
   {
    this.AddLabel(200, 68, 99, "Seer");
   }
   else if ( t.AccessLevel == AccessLevel.Counselor  )
   {
    this.AddLabel(200, 68, 88, "Counselor");
   }
   else if ( t.AccessLevel == AccessLevel.Player  )
   {
    this.AddLabel(200, 68, 1150, "Player");
   }
   else
   {
    this.AddLabel(200, 68, 1150, "Player");
   }
   this.AddLabel(350, 108, 55, "Bushido");this.AddLabel(440, 108, 55, seskill2.ToString() );
   this.AddLabel(28, 48, 55, "Ninjitsu");this.AddLabel(114, 48, 55, seskill1.ToString() );
   this.AddLabel(28, 68, 55, "Fletching");this.AddLabel(114, 68, 55, terg.ToString() );
   this.AddLabel(28, 88, 55, "Inscribe");this.AddLabel(114, 88, 55, terh.ToString() );
   this.AddLabel(28, 108, 55, "Tailoring");this.AddLabel(114, 108, 55, teri.ToString() );
   this.AddLabel(28, 128, 55, "Tinkering");this.AddLabel(114, 128, 55, terj.ToString() );
   this.AddLabel(28, 148, 55, "Discordance");this.AddLabel(114, 148, 55, terk.ToString() );
   this.AddLabel(28, 168, 55, "Alchemy");this.AddLabel(114, 168, 55, terb.ToString() );
   this.AddLabel(28, 188, 55, "Musicianship");this.AddLabel(114, 188, 55, terl.ToString() );
   this.AddLabel(28, 208, 55, "Peacemaking");this.AddLabel(114, 208, 55, term.ToString() );
   this.AddLabel(28, 228, 55, "Provocation");this.AddLabel(114, 228, 55, tern.ToString() );
   this.AddLabel(28, 248, 55, "Chivalry");this.AddLabel(114, 248, 55, ters.ToString() );
   this.AddLabel(28, 268, 55, "Blacksmith");this.AddLabel(114, 268, 55, terc.ToString() );
   this.AddLabel(28, 288, 55, "EvalInt");this.AddLabel(114, 288, 55, tert.ToString() );
   this.AddLabel(28, 308, 55, "Magery");this.AddLabel(114, 308, 55, teru.ToString() );
   this.AddLabel(28, 328, 55, "MagicResist");this.AddLabel(114, 328, 55, terv.ToString() );
   this.AddLabel(28, 368, 55, "Cartography");this.AddLabel(114, 368, 55, terd.ToString() );
   this.AddLabel(28, 348, 55, "Meditation");this.AddLabel(114, 348, 55, terw.ToString() );
   this.AddLabel(28, 388, 55, "Necromancy");this.AddLabel(114, 388, 55, terx.ToString() );
   this.AddLabel(28, 408, 55, "SpiritSpeak");this.AddLabel(114, 408, 55, tery.ToString() );
   this.AddLabel(200, 408, 55, "Camping");this.AddLabel(280, 408, 55, terz.ToString() );
   this.AddLabel(200, 388, 55, "Fishing");this.AddLabel(280, 388, 55, teraa.ToString() );
   this.AddLabel(200, 108, 55, "Focus");this.AddLabel(280, 108, 55, terab.ToString() );
   this.AddLabel(200, 128, 55, "Healing");this.AddLabel(280, 128, 55, terac.ToString() );
   this.AddLabel(200, 148, 55, "Herding");this.AddLabel(280, 148, 55, terad.ToString() );
   this.AddLabel(200, 188, 55, "Lockpicking");this.AddLabel(280, 188, 55, terae.ToString() );
   this.AddLabel(200, 208, 55, "Lumberjacking");this.AddLabel(280, 208, 55, teraf.ToString() );
   this.AddLabel(200, 228, 55, "Mining");this.AddLabel(280, 228, 55, terag.ToString() );
   this.AddLabel(200, 248, 55, "Snooping");this.AddLabel(280, 248, 55, terah.ToString() );
   this.AddLabel(200, 288, 55, "Veterinary");this.AddLabel(280, 288, 55, terai.ToString() );
   this.AddLabel(200, 308, 55, "Archery");this.AddLabel(280, 308, 55, teraj.ToString() );
   this.AddLabel(200, 328, 55, "Fencing");this.AddLabel(280, 328, 55, terak.ToString() );
   this.AddLabel(200, 348, 55, "Macing");this.AddLabel(280, 348, 55, teral.ToString() );
   this.AddLabel(200, 268, 55, "Parry");this.AddLabel(280, 268, 55, teram.ToString() );
   this.AddLabel(200, 368, 55, "Swords");this.AddLabel(280, 368, 55, teran.ToString() );
   this.AddLabel(200, 168, 55, "Carpentry");this.AddLabel(280, 168, 55, tere.ToString() );
   
   this.AddLabel(350, 388, 55, "Tactics");this.AddLabel(440, 388, 55, terao.ToString() );
   this.AddLabel(350, 408, 55, "Wrestling");this.AddLabel(440, 408, 55, terap.ToString() );
   this.AddLabel(350, 128, 55, "AnimalTaming");this.AddLabel(440, 128, 55, teraq.ToString() );
   this.AddLabel(350, 148, 55, "Begging");this.AddLabel(440, 148, 55, terar.ToString() );
   this.AddLabel(350, 168, 55, "DetectHidden");this.AddLabel(440, 168, 55, teras.ToString() );
   this.AddLabel(350, 188, 55, "Hiding");this.AddLabel(440, 188, 55, terat.ToString() );
   this.AddLabel(350, 208, 55, "RemoveTrap");this.AddLabel(440, 208, 55, terau.ToString() );
   //this.AddLabel(350, 228, 55, "Poisoning");this.AddLabel(440, 228, 55, terav.ToString() );
   this.AddLabel(350, 248, 55, "Poisoning");this.AddLabel(440, 248, 55, terav.ToString() );
   this.AddLabel(350, 268, 55, "Stealing");this.AddLabel(440, 268, 55, teraw.ToString() );
   this.AddLabel(350, 288, 55, "Stealth");this.AddLabel(440, 288, 55, terax.ToString() );
   this.AddLabel(350, 308, 55, "Tracking");this.AddLabel(440, 308, 55, teray.ToString() );
   this.AddLabel(350, 328, 55, "Anatomy");this.AddLabel(440, 328, 55, teraz.ToString() );
   this.AddLabel(350, 348, 55, "AnimalLore");this.AddLabel(440, 348, 55, teraaa.ToString() );
   this.AddLabel(350, 368, 55, "ArmsLore");this.AddLabel(440, 368, 55, teraab.ToString() );
   this.AddLabel(350, 428, 55, "Forensics");this.AddLabel(440, 428, 55, teraac.ToString() );
   this.AddLabel(200, 428, 55, "ItemID");this.AddLabel(280, 428, 55, teraad.ToString() );
   this.AddLabel(200, 88, 55, "TasteID");this.AddLabel(280, 88, 55, teraae.ToString() );
   this.AddLabel(28, 428, 55, "Cooking");this.AddLabel(114, 428, 55, terf.ToString() );
   
   this.AddLabel(350, 48, 600, "Str");this.AddLabel(440, 48, 600, str.ToString() );
   this.AddLabel(350, 65, 600, "Dex");this.AddLabel(440, 65, 600, dex.ToString() );
   this.AddLabel(350, 85, 600, "Int");this.AddLabel(440, 85, 600, intl.ToString() );
   
  }
  public override void OnResponse( NetState state, RelayInfo info ) //Function for GumpButtonType.Reply Buttons
  {
   
   
   switch ( info.ButtonID )
   {
    case 4: // Props
     {
      break;
     }
    case 5: // Go to
     {
      break;
     }
    case 6: // Get
     {
      break;
     }
   }
  }
 }
}
}
//}
can you tell me if theres anyway this can get fixed the right way what would i have to edited and fix so those 20 shows as 0.
*PS* Also how can i add the skill spellweaving on this script cause i have no idea how to do this and where to put that skills as well . Thank You.

Haazen- 07-22-2006
Hi I see you addressed this to ArteGordon, but I will butt in any way.

Just a guess based on a previous problem I had, use Base rather than Value. i.e.
double terb = t.Skills[SkillName.Alchemy].Base;

I believe Value shows the skill with all bonuses added.