Carlos_ar

Member
ServUO Version
Publish 57
Ultima Expansion
Endless Journey
I am trying to get gifts to drop like OSI. I played with WinterGiftGiver.cs, changing the DateTime but nothing seems to happen.

Then I noticed when my server boots up the first line is this:
ServUO - [ServUO - Ultima Online Emulation] Version 0.0, Build 0.0 - Build on 1/1/2000 12:00:00 AM UTC - Release

Did I miss something in the config that would have it read the version, build, and correct date? Or is that just a default and the date/time is somewhere else to get the gifts to drop?

Thanks!

**************
DOH! Nevermind, I figured it out. Even if you set your timer for 1999, 01, 01, the system looks to see if you logged on between then and the current date. If you logged on then it assumes you got a gift already. So I had to set the date for today and log on as a character that hadn't logged in before today. That worked.

Trying to do Valentines gifts so this will work nicely.

Thanks!!... again... :)

***************

Next Question, in this same thread...

So... how would I go about changing the GiftGiver script to give to each character and not just 1 per account?

---- Bonus Problem:
Ok so I ran into this same problem when attempting to add Monster Statuettes as loot. "does not contain a constructor that takes zero arguments" Now I get things like the MonsterStatuettes and this one I'm working with, the ValentinesCard are essentially a generated item based on properties given by a generator script (my limited knowledge that's what I'm gathering) So what would I put into "DropItem(new ValentinesCard ());" that would call the randomness of the item without asking for a specific instance of it? I can't seem to figure out what goes in place of "(int itemid ())"

So... Thank you @Juzzver for helping me figure this part out!
DropItem(new ValentinesCard ()); should be DropItem(new ValentinesCard (Utility.RandomList( ValentinesCardSouth, ValentinesCardEast ));
 
Last edited:
So what problems remain open still? It appears like you've solved a number of them.

I ended up modifying my gift giving system so I wouldn't have to renew the scripts every year.
And as far as per character, you just need to have it check the last login of the playermobile and not the account. I think there's a few other changes I had to make to get it to work right.
 
So what problems remain open still? It appears like you've solved a number of them.

I ended up modifying my gift giving system so I wouldn't have to renew the scripts every year.
And as far as per character, you just need to have it check the last login of the playermobile and not the account. I think there's a few other changes I had to make to get it to work right.

Right now I can't figure how to get the gift per player rather than per account. I tried modifying a few lines, but obviously nothing so far has worked.

What did you edit?
 
I had to make a lot of edits to GiftGiving.cs as well as all the gifts...and to the playermobile (seen below). I'll just include what I put together. If you take these for your server, you will likely have to make a few edits to get them to work. Or you can just use them for reference...it appears that I did a mediocre job of documenting what I did (which is a lot more than most people do).

The playermobile edit is in private static void EventSink_Connected(ConnectedEventArgs e)
look for pm.LastOnline = DateTime.Now; and comment it out. That line should already exist in EventSink_Disconnected and there's no reason to be redundant...especially when there are game mechanics to worry about. By the way...if it doesn't exist in EventSink_Disconnected...add it.

I'm not as familiar with ServUO...so I don't know how many changes they've made since it was RunUO...so I don't know if that line still exists.
 

Attachments

  • Holiday Gift Giving Set.zip
    80.5 KB · Views: 8
I had to make a lot of edits to GiftGiving.cs as well as all the gifts...and to the playermobile (seen below). I'll just include what I put together. If you take these for your server, you will likely have to make a few edits to get them to work. Or you can just use them for reference...it appears that I did a mediocre job of documenting what I did (which is a lot more than most people do).

The playermobile edit is in private static void EventSink_Connected(ConnectedEventArgs e)
look for pm.LastOnline = DateTime.Now; and comment it out. That line should already exist in EventSink_Disconnected and there's no reason to be redundant...especially when there are game mechanics to worry about. By the way...if it doesn't exist in EventSink_Disconnected...add it.

I'm not as familiar with ServUO...so I don't know how many changes they've made since it was RunUO...so I don't know if that line still exists.
Thanks!! I'll give it a go.
 
No go. :( It doesn't work on ServUO.

No idea what I need to do to get it to give gifts per character. Right now it'll only do it 1 per account.
 
Last edited:
So...for ServUO,
Playermobile edit look for this module and comment out what is commented out here.
C#:
        private static void EventSink_Connected(ConnectedEventArgs e)
        {
            PlayerMobile pm = e.Mobile as PlayerMobile;

            if (pm != null)
            {
                pm.m_SessionStart = DateTime.UtcNow;

                if (pm.m_Quest != null)
                {
                    pm.m_Quest.StartTimer();
                }

                #region Mondain's Legacy
                QuestHelper.StartTimer(pm);
                #endregion

                pm.BedrollLogout = false;
                pm.BlanketOfDarknessLogout = false;
                //pm.LastOnline = DateTime.UtcNow;
            }

The included files can replace the scripts found in the GiftGiving folder and 18th Anniversary folder.

But if you plan on using these, be sure you edit other GiftGivers to work with the system.
Or as I've said before...you can just use these for reference.
 

Attachments

  • GiftGiving.zip
    3.1 KB · Views: 6
So...for ServUO,
Playermobile edit look for this module and comment out what is commented out here.
C#:
        private static void EventSink_Connected(ConnectedEventArgs e)
        {
            PlayerMobile pm = e.Mobile as PlayerMobile;

            if (pm != null)
            {
                pm.m_SessionStart = DateTime.UtcNow;

                if (pm.m_Quest != null)
                {
                    pm.m_Quest.StartTimer();
                }

                #region Mondain's Legacy
                QuestHelper.StartTimer(pm);
                #endregion

                pm.BedrollLogout = false;
                pm.BlanketOfDarknessLogout = false;
                //pm.LastOnline = DateTime.UtcNow;
            }

The included files can replace the scripts found in the GiftGiving folder and 18th Anniversary folder.

But if you plan on using these, be sure you edit other GiftGivers to work with the system.
Or as I've said before...you can just use these for reference.

So to get it to work, it's not just the playermobile edit, but I have to add the custom giftgiver scripts?

The Playermobile edit alone, does not fix the problem.
 
Correct. The playermobile edit is only about allowing the giftgiver.cs to update the last time that player has signed on...AFTER it gives the player the gift (if applicable). The giftgiver edits are the actual system. The giftgiver checks the player account. You change that to check the player instead.
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back