SomeDude

Member
ServUO Version
Publish 58
Ultima Expansion
Endless Journey
If anyone could help me out would really appreciate it tryin to add token in baseCreature p58

OnKilledBy(ds.m_Mobile);

if (HumilityVirtue.IsInHunt(ds.m_Mobile) && Karma < 0)
HumilityVirtue.RegisterKill(ds.m_Mobile, this, list.Count);
}

for (int i = 0; i < titles.Count; ++i)
{
Titles.AwardFame(titles, fame, true);
Titles.AwardKarma(titles, karma, true);
TokenValidate.TokenAward(ds.m_Mobile, this);



Getting this error



C:\Users\Somedude\OneDrive\Desktop\NeverFade>dotnet build -c Release
Microsoft (R) Build Engine version 16.11.2+f32259642 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

Determining projects to restore...
All projects are up-to-date for restore.
Settings -> C:\Users\Somedude\OneDrive\Desktop\NeverFade\Settings\bin\Release\Settings.dll
Server -> C:\Users\Somedude\OneDrive\Desktop\NeverFade\Server\bin\Release\Server.dll
C:\Users\Somedude\OneDrive\Desktop\NeverFade\Scripts\Customs\Custom Systems\VitaNex\Core-5.3.0.1\Items\Misc\StrobeLantern.cs(71,28): warning CS0114: 'StrobeLantern.DefaultLight' hides inherited member 'Item.DefaultLight'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword. [C:\Users\Somedude\OneDrive\Desktop\NeverFade\Scripts\Scripts.csproj]
C:\Users\Somedude\OneDrive\Desktop\NeverFade\Scripts\Mobiles\Normal\BaseCreature.cs(6018,50): error CS0103: The name 'ds' does not exist in the current context [C:\Users\Somedude\OneDrive\Desktop\NeverFade\Scripts\Scripts.csproj]
C:\Users\Somedude\OneDrive\Desktop\NeverFade\Scripts\Customs\KarmaTokens\TokenAward.cs(15,18): warning CS0169: The field 'TokenValidate.m_Owner' is never used [C:\Users\Somedude\OneDrive\Desktop\NeverFade\Scripts\Scripts.csproj]

Build FAILED.

C:\Users\Somedude\OneDrive\Desktop\NeverFade\Scripts\Customs\Custom Systems\VitaNex\Core-5.3.0.1\Items\Misc\StrobeLantern.cs(71,28): warning CS0114: 'StrobeLantern.DefaultLight' hides inherited member 'Item.DefaultLight'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword. [C:\Users\Somedude\OneDrive\Desktop\NeverFade\Scripts\Scripts.csproj]
C:\Users\Somedude\OneDrive\Desktop\NeverFade\Scripts\Customs\KarmaTokens\TokenAward.cs(15,18): warning CS0169: The field 'TokenValidate.m_Owner' is never used [C:\Users\Somedude\OneDrive\Desktop\NeverFade\Scripts\Scripts.csproj]
C:\Users\Somedude\OneDrive\Desktop\NeverFade\Scripts\Mobiles\Normal\BaseCreature.cs(6018,50): error CS0103: The name 'ds' does not exist in the current context [C:\Users\Somedude\OneDrive\Desktop\NeverFade\Scripts\Scripts.csproj]
2 Warning(s)
1 Error(s)

Time Elapsed 00:00:07.40

Done!
 
C:\Users\Somedude\OneDrive\Desktop\NeverFade\Scripts\Mobiles\Normal\BaseCreature.cs(6018,50): error CS0103: The name 'ds' does not exist in the current context [C:\Users\Somedude\OneDrive\Desktop\NeverFade\Scripts\Scripts.csproj]
ds does not exist where you are trying to use it on line 6018, according to this error. Try to show the entire method that appears there for better clarity if you still need help.
 
Not sure what the ds is ment for? Probably ment for the damagestore? Or something like that? But it is not defined there
 
Tryin to get all mobs to drop tokens using this token script the baseCreature in p58 is a bit different then the one in 54 and 57 tryin to find the right spot to insert this TokenValidate.TokenAward(ds.m_Mobile,this); the old baseCreature added after
Titles.AwardFame( ds.m_Mobile, totalFame, true );
Titles.AwardKarma( ds.m_Mobile, totalKarma, true );


C#:
using System;
using Server;

namespace Server.Items
{
    public class Tokens : Item
    {
        [Constructable]
        public Tokens() : this( 1 )
        {
        }

        [Constructable]
        public Tokens( int amountFrom, int amountTo ) : this( Utility.RandomMinMax( amountFrom, amountTo ) )
        {
        }

        [Constructable]
        public Tokens( int amount ) : base( 0xEF0 )
        {
            Stackable = true;
            Name = "Tokens";
            Hue = 1364;
            Weight = 0;
            Amount = amount;
        }

        public Tokens( Serial serial ) : base( serial )
        {
        }

        public override int GetDropSound()
        {
            if ( Amount <= 1 )
                return 0x2E4;
            else if ( Amount <= 5 )
                return 0x2E5;
            else
                return 0x2E6;
        }

        public override void Serialize( GenericWriter writer )
        {
            base.Serialize( writer );

            writer.Write( (int) 0 ); // version
        }

        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();
        }
    }
}

C#:
//Original by Dupre
//Reworked by Karmageddon
//For new token system
//

using System;
using System.Collections;
using Server.Items;
using Server.Misc;

namespace Server.Mobiles
{
    public class TokenValidate
    {
        private Mobile m_Owner;       
        
        public static void TokenAward(Mobile from, BaseCreature bc)
        {       
            if ( from.Backpack == null )
                return;

            int karma = Math.Abs( bc.Karma );
            int tokenbase = ( bc.TotalGold + karma + bc.Fame + ((bc.Hits+bc.Stam+bc.Mana)/3)) / 4500;
            int maxtokens = 6 + ( 50 * tokenbase );
            int mintokens = maxtokens/100;

            int amount = Utility.Random( mintokens, maxtokens );           
            
            TokensGiven(from, amount);
        }
            
        public static void TokensGiven(Mobile from, int amount)
        {
            
            if (amount < 1)
                return;
            
            Item[] items = from.Backpack.FindItemsByType( typeof( TokenBox ) );

                foreach( TokenBox box in items )
                {                   
                    if ( from == box.Owner )
                    {
                        if (( box.Token  + amount ) <= 200000000 )
                        {
                            box.Token = (box.Token + amount);
                            from.SendMessage( "You have received {0} tokens", amount );
                            break;
                    }
                    else
                        from.SendMessage(1173, "You have a full token box, please make a check and store it in your bank.");
                    }
                }
            }
        }
    }
Ok got it added TokenValidate.TokenAward(ds.m_Mobile,this); under OnKilledBy(ds.m_Mobile); like this

C#:
OnKilledBy(ds.m_Mobile);

                        TokenValidate.TokenAward(ds.m_Mobile,this);

                        if (HumilityVirtue.IsInHunt(ds.m_Mobile) && Karma < 0)
                            HumilityVirtue.RegisterKill(ds.m_Mobile, this, list.Count);
                    }

                    for (int i = 0; i < titles.Count; ++i)
                    {
                        Titles.AwardFame(titles[i], fame[i], true);
                        Titles.AwardKarma(titles[i], karma[i], true);
                    }
                }
 
Last edited:

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back