Completely Automated Staff Team! - Oh yes, I did.

Discussion in 'Custom Script Releases' started by Tresdni, Jan 17, 2011.

  1. Sythen New Member


    Okay I Fixed The Issue: (Remember I Am Using An Unmodified Version Of Playermobile.cs From SVN 663)
    
    Find The Following Code:
    private List<Mobile> m_RecentlyReported;
    
    Under That Add This Code:
    private DateTime m_LastTimePaged;

    And... yes I did do everything you instructed us to do for the edits, this was a small oversight that is not in your directions :p lol No worries, it works and Thank you for such a wonderful script :)
  2. Tresdni New Member

    Drats, that's what I get for doing a release after drinking crown. I'll edit my post, thanks for the lookout!

    *First post updated, thanks again.
  3. rondelin New Member

    no where in my playermobile.cs does it say
    private List<Mobile> m_RecentlyReported;
  4. Tresdni New Member

    If your not using RunUO 2.1, then yours is going to use an array list instead, try searching for just m_RecentlyReported;
  5. rondelin New Member

    nothing remotely like it Runuo Ver 2.1 Build 3853.40219 here is my PM.cs I have made SA edits and customized playermobile file but that text doesn't exist.

    Attached Files:

  6. rondelin New Member

    LOL just plain weird isn't it? Appreciate any suggestions you might have Tresdni---thanx in advance
  7. HellRazor New Member

    Pretty cool idea! Thanks for sharing this.
  8. Tresdni New Member

    Just stick it after

    Code:
    private TimeSpan m_NpcGuildGameTime;
  9. JamzeMcC New Member

    Your serialize should look like so:
    Code:
      public override void Serialize(GenericWriter writer)
            {
                //cleanup our anti-macro table
                foreach (Hashtable t in m_AntiMacroTable.Values)
                {
                    ArrayList remove = new ArrayList();
                    foreach (CountAndTimeStamp time in t.Values)
                    {
                        if (time.TimeStamp + SkillCheck.AntiMacroExpire <= DateTime.Now)
                            remove.Add(time);
                    }
    
                    for (int i = 0; i < remove.Count; ++i)
                        t.Remove(remove[i]);
                }
    
                CheckKillDecay();
    
                CheckAtrophies(this);
    
                base.Serialize(writer);
    
                writer.Write((int)30); // Want to increase this number for versioning
    
                writer.Write((DateTime)m_LastTimePaged);
    
                writer.Write(m_VASTotalMonsterFame);    //This ain't going to be a small #.
    
    Otherwise there will be playermobile errors and it will want to wipe them all

    The color option does not work lol
    Edit* Thought I would add in a quick thank you. This should prove to be really helpful. The possibilities are endless with this as to what we can have it do. Great concept. Thanks
  10. Iraq- New Member

    Code:
    RunUO - [www.runuo.com] Version 2.0, Build 3567.2838
    Core: Running on .NET Framework Version 2.0.50727
    Core: Optimizing for 2 64-bit processors
    Scripts: Compiling C# scripts...done (cached)
    Scripts: Skipping VB.NET Scripts...done (use -vb to enable)
    Scripts: Verifying...done (3152 items, 635 mobiles)
    Regions: Loading...done
    World: Loading...An error was encountered while loading a saved object
     - Type: Server.Mobiles.PlayerMobile
     - Serial: 0x00000001
    Delete the object? (y/n)
    After pressing return an exception will be thrown and the server will terminate.
    
    
    :( Hey look, I did it!

    Ok so that broke my private shard. Can you tell me what it's supposed to look like? Here is my
    Deserialize:
    Code:
    public override void Deserialize( GenericReader reader )
            {
                base.Deserialize( reader );
                int version = reader.ReadInt();
    
                switch ( version )
                {
                    case 28:        // AUTOMATED STAFF TEAM EDIT
                    {
                        m_LastTimePaged = reader.ReadDateTime();
    
                        goto case 27;
                    }
                    case 27:
                    {
                        m_AnkhNextUse = reader.ReadDateTime();
    
                        goto case 26;
                    }
                    case 26:
                    {
                        m_AutoStabled = reader.ReadStrongMobileList();
    
                        goto case 25;
                    }
                    case 25:
                    {
                        int recipeCount = reader.ReadInt();
    
                        if( recipeCount > 0 )
                        {
                            m_AcquiredRecipes = new Dictionary<int, bool>();
    
                            for( int i = 0; i < recipeCount; i++ )
                            {
                                int r = reader.ReadInt();
                                if( reader.ReadBool() )    //Don't add in recipies which we haven't gotten or have been removed
                                    m_AcquiredRecipes.Add( r, true );
                            }
                        }
                        goto case 24;
                    }
                    case 24:
                    {
                        m_LastHonorLoss = reader.ReadDeltaTime();
                        goto case 23;
                    }
                    case 23:
                    {
                        m_ChampionTitles = new ChampionTitleInfo( reader );
                        goto case 22;
                    }
                    case 22:
                    {
                        m_LastValorLoss = reader.ReadDateTime();
                        goto case 21;
                    }
                    case 21:
                    {
                        m_ToTItemsTurnedIn = reader.ReadEncodedInt();
                        m_ToTTotalMonsterFame = reader.ReadInt();
                        goto case 20;
                    }
                    case 20:
                    {
                        m_AllianceMessageHue = reader.ReadEncodedInt();
                        m_GuildMessageHue = reader.ReadEncodedInt();
    
                        goto case 19;
                    }
                    case 19:
                    {
                        int rank = reader.ReadEncodedInt();
                        int maxRank = Guilds.RankDefinition.Ranks.Length -1;
                        if( rank > maxRank )
                            rank = maxRank;
    
                        m_GuildRank = Guilds.RankDefinition.Ranks[rank];
                        m_LastOnline = reader.ReadDateTime();
                        goto case 18;
                    }
                    case 18:
                    {
                        m_SolenFriendship = (SolenFriendship) reader.ReadEncodedInt();
    
                        goto case 17;
                    }
                    case 17: // changed how DoneQuests is serialized
                    case 16:
                    {
                        m_Quest = QuestSerializer.DeserializeQuest( reader );
    
                        if ( m_Quest != null )
                            m_Quest.From = this;
    
                        int count = reader.ReadEncodedInt();
    
                        if ( count > 0 )
                        {
                            m_DoneQuests = new List<QuestRestartInfo>();
    
                            for ( int i = 0; i < count; ++i )
                            {
                                Type questType = QuestSerializer.ReadType( QuestSystem.QuestTypes, reader );
                                DateTime restartTime;
    
                                if ( version < 17 )
                                    restartTime = DateTime.MaxValue;
                                else
                                    restartTime = reader.ReadDateTime();
    
                                m_DoneQuests.Add( new QuestRestartInfo( questType, restartTime ) );
                            }
                        }
    
                        m_Profession = reader.ReadEncodedInt();
                        goto case 15;
                    }
                    case 15:
                    {
                        m_LastCompassionLoss = reader.ReadDeltaTime();
                        goto case 14;
                    }
                    case 14:
                    {
                        m_CompassionGains = reader.ReadEncodedInt();
    
                        if ( m_CompassionGains > 0 )
                            m_NextCompassionDay = reader.ReadDeltaTime();
    
                        goto case 13;
                    }
                    case 13: // just removed m_PayedInsurance list
                    case 12:
                    {
                        m_BOBFilter = new Engines.BulkOrders.BOBFilter( reader );
                        goto case 11;
                    }
                    case 11:
                    {
                        if ( version < 13 )
                        {
                            List<Item> payed = reader.ReadStrongItemList();
    
                            for ( int i = 0; i < payed.Count; ++i )
                                payed[i].PayedInsurance = true;
                        }
    
                        goto case 10;
                    }
                    case 10:
                    {
                        if ( reader.ReadBool() )
                        {
                            m_HairModID = reader.ReadInt();
                            m_HairModHue = reader.ReadInt();
                            m_BeardModID = reader.ReadInt();
                            m_BeardModHue = reader.ReadInt();
    
                            // We cannot call SetHairMods( -1, -1 ) here because the items have not yet loaded
                            Timer.DelayCall( TimeSpan.Zero, new TimerCallback( RevertHair ) );
                        }
    
                        goto case 9;
                    }
                    case 9:
                    {
                        SavagePaintExpiration = reader.ReadTimeSpan();
    
                        if ( SavagePaintExpiration > TimeSpan.Zero )
                        {
                            BodyMod = ( Female ? 184 : 183 );
                            HueMod = 0;
                        }
    
                        goto case 8;
                    }
                    case 8:
                    {
                        m_NpcGuild = (NpcGuild)reader.ReadInt();
                        m_NpcGuildJoinTime = reader.ReadDateTime();
                        m_NpcGuildGameTime = reader.ReadTimeSpan();
                        goto case 7;
                    }
                    case 7:
                    {
                        m_PermaFlags = reader.ReadStrongMobileList();
                        goto case 6;
                    }
                    case 6:
                    {
                        NextTailorBulkOrder = reader.ReadTimeSpan();
                        goto case 5;
                    }
                    case 5:
                    {
                        NextSmithBulkOrder = reader.ReadTimeSpan();
                        goto case 4;
                    }
                    case 4:
                    {
                        m_LastJusticeLoss = reader.ReadDeltaTime();
                        m_JusticeProtectors = reader.ReadStrongMobileList();
                        goto case 3;
                    }
                    case 3:
                    {
                        m_LastSacrificeGain = reader.ReadDeltaTime();
                        m_LastSacrificeLoss = reader.ReadDeltaTime();
                        m_AvailableResurrects = reader.ReadInt();
                        goto case 2;
                    }
                    case 2:
                    {
                        m_Flags = (PlayerFlag)reader.ReadInt();
                        goto case 1;
                    }
                    case 1:
                    {
                        m_LongTermElapse = reader.ReadTimeSpan();
                        m_ShortTermElapse = reader.ReadTimeSpan();
                        m_GameTime = reader.ReadTimeSpan();
                        goto case 0;
                    }
                    case 0:
                    {
                        if( version < 26 )
                            m_AutoStabled = new List<Mobile>();
                        break;
                    }
                }
    and Serialize:
    Code:
    public override void Serialize( GenericWriter writer )
            {
                //cleanup our anti-macro table
                foreach ( Hashtable t in m_AntiMacroTable.Values )
                {
                    ArrayList remove = new ArrayList();
                    foreach ( CountAndTimeStamp time in t.Values )
                    {
                        if ( time.TimeStamp + SkillCheck.AntiMacroExpire <= DateTime.Now )
                            remove.Add( time );
                    }
    
                    for (int i=0;i<remove.Count;++i)
                        t.Remove( remove[i] );
                }
    
                //decay our kills
                if ( m_ShortTermElapse < this.GameTime )
                {
                    m_ShortTermElapse += TimeSpan.FromHours( 8 );
                    if ( ShortTermMurders > 0 )
                        --ShortTermMurders;
                }
    
                if ( m_LongTermElapse < this.GameTime )
                {
                    m_LongTermElapse += TimeSpan.FromHours( 40 );
                    if ( Kills > 0 )
                        --Kills;
                }
    
                CheckAtrophies( this );
    
                base.Serialize( writer );
    
                writer.Write( (int) 28 ); // version    // AUTOMATED STAFF TEAM EDIT CHANGED TO 28 FROM 27
    
                writer.Write( (DateTime) m_AnkhNextUse );
                writer.Write( m_AutoStabled, true );
    
                if( m_AcquiredRecipes == null )
                {
                    writer.Write( (int)0 );
                }
                else
                {
                    writer.Write( m_AcquiredRecipes.Count );
    
                    foreach( KeyValuePair<int, bool> kvp in m_AcquiredRecipes )
                    {
                        writer.Write( kvp.Key );
                        writer.Write( kvp.Value );
                    }
                }
    
                writer.WriteDeltaTime( m_LastHonorLoss );
    
                ChampionTitleInfo.Serialize( writer, m_ChampionTitles );
    
                writer.Write( m_LastValorLoss );
                writer.WriteEncodedInt( m_ToTItemsTurnedIn );
                writer.Write( m_ToTTotalMonsterFame );    //This ain't going to be a small #.
    
                writer.WriteEncodedInt( m_AllianceMessageHue );
                writer.WriteEncodedInt( m_GuildMessageHue );
    
                writer.WriteEncodedInt( m_GuildRank.Rank );
                writer.Write( m_LastOnline );
    
                writer.WriteEncodedInt( (int) m_SolenFriendship );
    
                QuestSerializer.Serialize( m_Quest, writer );
    
                if ( m_DoneQuests == null )
                {
                    writer.WriteEncodedInt( (int) 0 );
                }
                else
                {
                    writer.WriteEncodedInt( (int) m_DoneQuests.Count );
    
                    for ( int i = 0; i < m_DoneQuests.Count; ++i )
                    {
                        QuestRestartInfo restartInfo = m_DoneQuests[i];
    
                        QuestSerializer.Write( (Type) restartInfo.QuestType, QuestSystem.QuestTypes, writer );
                        writer.Write( (DateTime) restartInfo.RestartTime );
                    }
                }
    
                writer.WriteEncodedInt( (int) m_Profession );
    
                writer.WriteDeltaTime( m_LastCompassionLoss );
    
                writer.WriteEncodedInt( m_CompassionGains );
    
                if ( m_CompassionGains > 0 )
                    writer.WriteDeltaTime( m_NextCompassionDay );
    
                m_BOBFilter.Serialize( writer );
    
                bool useMods = ( m_HairModID != -1 || m_BeardModID != -1 );
    
                writer.Write( useMods );
    
                if ( useMods )
                {
                    writer.Write( (int) m_HairModID );
                    writer.Write( (int) m_HairModHue );
                    writer.Write( (int) m_BeardModID );
                    writer.Write( (int) m_BeardModHue );
                }
    
                writer.Write( SavagePaintExpiration );
    
                writer.Write( (int) m_NpcGuild );
                writer.Write( (DateTime) m_NpcGuildJoinTime );
                writer.Write( (TimeSpan) m_NpcGuildGameTime );
    
                writer.Write((DateTime)m_LastTimePaged);        // AUTOMATED STAFF TEAM EDIT (final)
    
                writer.Write( m_PermaFlags, true );
    
                writer.Write( NextTailorBulkOrder );
    
                writer.Write( NextSmithBulkOrder );
    
                writer.WriteDeltaTime( m_LastJusticeLoss );
                writer.Write( m_JusticeProtectors, true );
    
                writer.WriteDeltaTime( m_LastSacrificeGain );
                writer.WriteDeltaTime( m_LastSacrificeLoss );
                writer.Write( m_AvailableResurrects );
    
                writer.Write( (int) m_Flags );
    
                writer.Write( m_LongTermElapse );
                writer.Write( m_ShortTermElapse );
                writer.Write( this.GameTime );
            }
    I've followed you're directions to a T - what did I do wrong?
  11. JamzeMcC New Member

    Once the ser/deser is right, you will have to load a previous save. Atleast, that was the only Way I could get this in.
  12. Iraq- New Member

    Thanks jamze. I saw your post after I ran into this problem on my own... If you have a moment, can you see where my error is in my methods posted above?
  13. JamzeMcC New Member

    The only thing that I saw you did differently than I did is I put this line:
    Code:
    writer.Write((DateTime)m_LastTimePaged);        // AUTOMATED STAFF TEAM EDIT (final)
    Right under this line:
    Code:
    writer.Write( (int) 28 ); // version    // AUTOMATED STAFF TEAM EDIT CHANGED TO 28 FROM 27

    Now to be completely honest, Im not a wizard with ser/deser so that last part may not be required but doing it the way I showed ya I have proof that it works lol

    Other than that, I dont see any issues. After I caught the error, I had already had 2 saves with this running. I had to revert back to the third back up to get it to load.
  14. Iraq- New Member

    Alright, well thanks. I've done that and while i wasn't able to use any of my saved backups, I was able to pull the mobile folder from a crashed backup from earlier this afternoon. (and other than logging in as the Impaler who was spawned in doom (lol wtf i didn't even know you could do that) on my testing account) everything seems to be okay now. The only concern I have is that whatever caused my problem before will cause my problem again sometime down the line... but hopefully this reordering of the serialization code has fixed that. Great system Tresdni, I've already begun customizing mine :p
  15. JamzeMcC New Member

    Before reopening the shard to the public, do a quick save/restart It should work but just to be sure
  16. osd_daedalus New Member

    use the tag (code=rich) instead of (code) , in square brackets of course.

    Code:
    this uses[COLOR=rgb(255, 0, 0)] red color[/COLOR]
    Code:
    this uses red color
  17. Sythen New Member

    Hi everyone,

    @Tresdni - I absolutely LOVE this script, so much so that I went ahead and gave it some love by adding new StaffKeywords and Suggestion gumps. I hope you don't mind, but the gumps that came with this package were a bit, plain - so I spruced it up a lot. I hope you all enjoy these. You guys should change Shadows Edge to whatever your server name is, to personalize the system a bit. One last thing, there is a callback for the gumps now: [StaffKeywords and [Suggestion
    
    ***EDIT 3:32pm***
    I Uploaded Working Distro (Edits Done): HelpGump.cs and PlayerMobile.cs - Both Originally Unmodified From SVN 663 - I Do Not Know How That Will Affect RunUO 2.x Final, But If You Have The SVN Plug And Play. I fixed the serialization issues, thanks to Morexton and JamzeMcC for their assist. :)
    

    [IMG]

    Attached Files:

  18. James420 New Member

    I think the new gumps you made for it, looks way better. More polished up. But I think the list of keywords would be a lot nicer if they doubled as buttons also. Some times it's just simply easier to click a button then type out a keyword.
  19. Iraq- New Member

    I was just thinking the same thing. also was that gump created with gumpstudio?
  20. Sythen New Member

    Yes these were both made in gumpstudio... if you look in the gumps folder (from updated downloads above) I've included the original gumpstudio files if you want to edit them and finagle the code a bit.

    & Thank You! I'm glad you guys like the new gumps. :)

    The reason I didn't make the keywords buttons is because if I had done that, it would take away from the spirit of actually having to interact with an NPC. This system is in the spirit of role play, right? Typing out sentences or keywords is a lot more rpish than pushing buttons :) (imo). Feel free to edit it though :)
Insert every image as a...
  1.  0%

Share This Page