I'm trying to install the
Lokai's Custom Race-Class System
( http://www.runuo.com/community/threads/runuo-2-0-rc1-lokais-custom-race-class-system.70967/ )
but following the instructions i have this problem:
Code:
Errors:
+ Custom Systems/lokais race-class system/NewMobile.cs:
    CS0029: Line 158: Cannot implicitly convert type `System.DateTime' to `long'
+ Custom Systems/lokais race-class system/NewSkills/Brewing.cs:
    CS0029: Line 33: Cannot implicitly convert type `System.DateTime' to `long'
    CS0029: Line 54: Cannot implicitly convert type `System.DateTime' to `long'
+ Custom Systems/lokais race-class system/NewSkills/DivineHealth.cs:
    CS0029: Line 33: Cannot implicitly convert type `System.DateTime' to `long'
    CS0029: Line 54: Cannot implicitly convert type `System.DateTime' to `long'
+ Custom Systems/lokais race-class system/NewSkills/Forestry.cs:
    CS0029: Line 33: Cannot implicitly convert type `System.DateTime' to `long'
    CS0029: Line 54: Cannot implicitly convert type `System.DateTime' to `long'
+ Custom Systems/lokais race-class system/NewSkills/Gardening.cs:
    CS0029: Line 33: Cannot implicitly convert type `System.DateTime' to `long'
    CS0029: Line 54: Cannot implicitly convert type `System.DateTime' to `long'
+ Custom Systems/lokais race-class system/NewSkills/GoldCrafting.cs:
    CS0029: Line 33: Cannot implicitly convert type `System.DateTime' to `long'
    CS0029: Line 54: Cannot implicitly convert type `System.DateTime' to `long'
+ Custom Systems/lokais race-class system/NewSkills/HealingArts.cs:
    CS0029: Line 33: Cannot implicitly convert type `System.DateTime' to `long'
    CS0029: Line 54: Cannot implicitly convert type `System.DateTime' to `long'
+ Custom Systems/lokais race-class system/NewSkills/Herblaw.cs:
    CS0029: Line 33: Cannot implicitly convert type `System.DateTime' to `long'
    CS0029: Line 54: Cannot implicitly convert type `System.DateTime' to `long'
+ Custom Systems/lokais race-class system/NewSkills/Hypnotism.cs:
    CS0029: Line 36: Cannot implicitly convert type `System.DateTime' to `long'
+ Custom Systems/lokais race-class system/NewSkills/LayOnHands.cs:
    CS0029: Line 33: Cannot implicitly convert type `System.DateTime' to `long'
    CS0029: Line 54: Cannot implicitly convert type `System.DateTime' to `long'
+ Custom Systems/lokais race-class system/NewSkills/Levitation.cs:
    CS0029: Line 33: Cannot implicitly convert type `System.DateTime' to `long'
    CS0029: Line 54: Cannot implicitly convert type `System.DateTime' to `long'
+ Custom Systems/lokais race-class system/NewSkills/MakeDisappear.cs:
    CS0029: Line 33: Cannot implicitly convert type `System.DateTime' to `long'
    CS0029: Line 54: Cannot implicitly convert type `System.DateTime' to `long'
+ Custom Systems/lokais race-class system/NewSkills/Negotiation.cs:
    CS0029: Line 33: Cannot implicitly convert type `System.DateTime' to `long'
    CS0029: Line 54: Cannot implicitly convert type `System.DateTime' to `long'
+ Custom Systems/lokais race-class system/NewSkills/PickPocket.cs:
    CS0029: Line 33: Cannot implicitly convert type `System.DateTime' to `long'
    CS0029: Line 54: Cannot implicitly convert type `System.DateTime' to `long'
+ Custom Systems/lokais race-class system/NewSkills/RemoveDisease.cs:
    CS0029: Line 33: Cannot implicitly convert type `System.DateTime' to `long'
    CS0029: Line 54: Cannot implicitly convert type `System.DateTime' to `long'
+ Custom Systems/lokais race-class system/NewSkills/SilverSmithing.cs:
    CS0029: Line 33: Cannot implicitly convert type `System.DateTime' to `long'
    CS0029: Line 54: Cannot implicitly convert type `System.DateTime' to `long'
+ Custom Systems/lokais race-class system/NewSkills/SleightOfHand.cs:
    CS0029: Line 33: Cannot implicitly convert type `System.DateTime' to `long'
    CS0029: Line 54: Cannot implicitly convert type `System.DateTime' to `long'
+ Custom Systems/lokais race-class system/NewSkills/WoodCarving.cs:
    CS0029: Line 33: Cannot implicitly convert type `System.DateTime' to `long'
    CS0029: Line 54: Cannot implicitly convert type `System.DateTime' to `long'
+ custom/AdvancedPlayerGate.cs:
    CS0019: Line 776: Operator `==' cannot be applied to operands of type `Server.Race' and `Server.Custom.Race'
+ custom/mobiles/BaseCreature.cs:
    CS0103: Line 6379: The name `ds' does not exist in the current context
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.

i try to change with UtcNow but the problem persist.

Any can help me?
 
Change all instances of DateTime.UtcNow to Core.TickCount - a lot of delay-based actions in the server are now handled this way.

Core.TickCount is represented as milliseconds, so when it comes to converting things like TimeSpan.FromSeconds( 1.5 ), you multiply the total seconds by 1000;

C#:
// represents things like Mobile.LastMoveTime.
long lastAction = mob.LastMoveTime;

// gives conversion compile error as described in OP.
bool elapsed = DateTime.UtcNow - lastAction > TimeSpan.FromSeconds( 1.5 );

// changes that do compile.
bool elapsed = Core.TickCount - lastAction > 1500; // 1.5 * 1000
 
perfect, now i only have one problem its with this line:

Code:
                        this.NextSkillTime = DateTime.Now + info.Callback( this );

and i try to put DateTime.UtcNow,

and Core.TickCount

:S
 
Assuming info.Callback() returns a TimeSpan, you can convert TimeSpan.TotalMilliseconds to Int32/64 and use it with Core.TickCount;

C#:
this.NextSkillTime = Core.TickCount + (int)info.Callback(this).TotalMilliseconds;
 
Not sure how far you got with this, pall, but I have to say that I do NOT recommend my old Race/Class system. It was packed with problems, not the least of which was trying to introduce a "NewMobile" class. While the idea at the time seemed better than trying to modify PlayerMobile, it actually created more problems than it solved.

If you have had some success, or learned anything useful through playing with it, then more power to you, but I thought I should warn you, since I dropped the system many years ago, and it may be hard to find support for working with the NewMobile class.
 
Thanks for the advise Lokai. Finally i'm using another system. I love your idea in this system but i see problems and finally i change to other.
 
Thanks for the advise Lokai. Finally i'm using another system. I love your idea in this system but i see problems and finally i change to other.

pall, Hello, I do not intend to hijack your thread here.

I was just wondering which race / class system you ended up using?

I also have tried the one from Lokai without much success.

Thanks in advance.
 
pall, Hello, I do not intend to hijack your thread here.

I was just wondering which race / class system you ended up using?

I also have tried the one from Lokai without much success.

Thanks in advance.
i don't remember where i found it, i think in runuo. I search the download and send you in a pm ^^
 
Can You help me with the convert for this?

Error:
Cannot implicitly convert type 'System.DateTime' to 'long'

m_From.NextSkillTime = DateTime.Now + TimeSpan.FromSeconds( 10.0 );
 
Can You help me with the convert for this?

Error:
Cannot implicitly convert type 'System.DateTime' to 'long'

m_From.NextSkillTime = DateTime.Now + TimeSpan.FromSeconds( 10.0 );

Assuming info.Callback() returns a TimeSpan, you can convert TimeSpan.TotalMilliseconds to Int32/64 and use it with Core.TickCount;

C#:
this.NextSkillTime = Core.TickCount + (int)info.Callback(this).TotalMilliseconds;
Already done by Vorpsire :)
 
can you show me how the full line of code will look? if this is the modified code.

m_From.NextSkillTime = DateTime.Now + TimeSpan.FromSeconds( 10.0 );
 
C#:
m_From.NextSkillTime = Core.TickCount + 10000; // 10k milliseconds = 10 seconds
 
It worked Thank you All :)

I have a different one if you all will help me understand?

double time = (from.NextSkillTime - DateTime.Now).TotalSeconds;

Would change to:

double time = (from.NextSkillTime - Core.TickCount).Totalmilliseconds; :confused:
 
Last edited:
Back