RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

S1980 Shard Referral Reward System

Shadow1980

Wanderer
Pyro-Tech said:
That would seem to be the case....would be better to set it up to allow more than one refer at one time....would suck to actually get 8 people, then only get the one in the end

I designed the system with activity in mind. Due to the default settings, the chance that this happens is very slim for active people.
But aye, you are right. I have been looking for a simple way to set more referrals but I don't really want to put an endless amount of tags on people. Suggestions are of course welcome. (Working on some other things right now as well.)
 

snicker7

Sorceror
store multiple names in the GotFriend tag using your typical flat file array, CSV! =] use commas or pipes, I don't think character names can have either.
 

snicker7

Sorceror
I got a bit ambitious.


line 73:
Code:
						friendacct.SetTag( "GotAFriend", "true" );
						friendacct.SetTag( "GotFriend", ac.ToString() );
to
Code:
						if ( Convert.ToBoolean( ac.GetTag("GotAFriend") ) ) {
							string friends = ac.GetTag( "GotFriend" ) + "," + ac.ToString();
							friendacct.SetTag( "GotFriend", friends );
						} else {
							friendacct.SetTag( "GotAFriend", "true" );
							friendacct.SetTag( "GotFriend", ac.ToString() );
						}

and line 83:
Code:
				string friend = ac.GetTag( "GotFriend" );
				m.SendMessage( String.Format( "You receive a reward for referring one of your friends to {1}.", TAFShardName ) );
				m.AddToBackpack( new ReferrerReward() );
to
Code:
				string friend = ac.GetTag( "GotFriend" );
				string[] friends = friend.Split(',');
				for(int i=0;i<friends.Length;++i){
					m.SendMessage( String.Format( "You receive a reward for referring one of your friends to {1}.", TAFShardName ) );
					m.AddToBackpack( new ReferrerReward() );
				}
 

Kamron

Knight
I was wondering when someone would release a system like this. I haven't had time, and many shards have asked me for this. Funny enough, I have most of it coded for my own shard. It doesn't work quite the same way, but none-the-less your method of checking if people are active is pretty sound.

I do have a few suggestions for your code, but alas, I do not have time to post it in a beneficial way. Overall, good job.
 

Shadow1980

Wanderer
snicker7 said:
doh, i made a small mistake in the code above, i wrote it when I just woke up. fixed it now though.

Thank you snicker, that is a nice way to do it. I will work this into the system as soon as I have the time. Your suggestion & active assistance is quite appreciated.

Magus Bstone said:
very nice i have been to you shard and ii have to say bravo

Thank you for the compliment Magus. We do our best to provide some fun to a small community :)

XxSP1DERxX said:
I was wondering when someone would release a system like this. I haven't had time, and many shards have asked me for this. Funny enough, I have most of it coded for my own shard. It doesn't work quite the same way, but none-the-less your method of checking if people are active is pretty sound.

I do have a few suggestions for your code, but alas, I do not have time to post it in a beneficial way. Overall, good job.

I wondered the same and as nobody did so, I decided to have a go at it myself ;) Thanks for your compliment.
 

Pyro-Tech

Knight
snicker7 said:
I got a bit ambitious.


line 73:
Code:
                        friendacct.SetTag( "GotAFriend", "true" );
                        friendacct.SetTag( "GotFriend", ac.ToString() );
to
Code:
                        if ( Convert.ToBoolean( acct.GetTag("GotAFriend") ) ) {
                            string friends = ac.GetTag( "GotFriend" ) + "," + ac.ToString();
                            friendacct.SetTag( "GotFriend", friends );
                        } else {
                            friendacct.SetTag( "GotAFriend", "true" );
                            friendacct.SetTag( "GotFriend", ac.ToString() );
                        }
and line 83:
Code:
                string friend = ac.GetTag( "GotFriend" );
                m.SendMessage( String.Format( "You receive a reward for referring one of your friends to {1}.", TAFShardName ) );
                m.AddToBackpack( new ReferrerReward() );
to
Code:
                string friend = ac.GetTag( "GotFriend" );
                string[] friends = friend.Split(',');
                for(int i=0;i<friends.Length;++i){
                    m.SendMessage( String.Format( "You receive a reward for referring one of your friends to {1}.", TAFShardName ) );
                    m.AddToBackpack( new ReferrerReward() );
                }

i assume this adds the functionallity for multiple referrer's?
 

Pyro-Tech

Knight
Code:
 - Error: Scripts\Custom\New Scripts\Systems\Tell A Friend\TellAFriend.cs: CS0246: (line 73, co
lumn 31) The type or namespace name 'acct' could not be found (are you missing a using directiv
e or an assembly reference?)

got that error when trying to do the updated code (with the multiple accounts deal)....on line 73, is it supposed to be ac.GetTag instead of the acct.GetTag??
 

snicker7

Sorceror
doh, yep. was looking at another part of the script and typing at the same time.

I didn't test any of that.

Also, I'm sure Shadow will update his script when he has time. I was just posting that as a suggestion to him.
 

Shadow1980

Wanderer
snicker7 said:
doh, yep. was looking at another part of the script and typing at the same time.

I didn't test any of that.

Also, I'm sure Shadow will update his script when he has time. I was just posting that as a suggestion to him.

Thanks for your suggestion and active help snicker7. I have updated the first post of this thread with the new version.
 

snicker7

Sorceror
anytime =] glad to help out, I think we will be picking up this system to use, and possibly reducing the time limit and adding a check for a minimum number of GM skills before rewarding.
 

Shadow1980

Wanderer
snicker7 said:
anytime =] glad to help out, I think we will be picking up this system to use, and possibly reducing the time limit and adding a check for a minimum number of GM skills before rewarding.

That would be a way to do it, sort of depends on the shard, speed of skillgain and many other factors. I think it is flexible enough (for people with some very minor coding skills) to do pretty much whatever they want with. The foundation of a script/system is always the hardest and that is there :)
I hope people find some good uses for it.
 

chadmriden

Sorceror
Thanks for the script & the header comments / docs

This looks really cool.. I'm definitely going to use it.

I also wanted to compliment you on the comments at the beginning of the script:
/*
* RunUO Shard Referral System
* Author: Shadow1980
* Files: TellAFriend.cs
* Version 1.5
* Public Release: 17-04-2006 || Latest Release 20-04-2006
*
* Description:
* This system allows you to reward players for bringing friends into the shard.
* When a new player joins, they receive a gump asking them who referred them to the shard.
* They can enter the account name of the person in question there, which will add two tags to their account.
* v1.4+ they can also target a player character ingame and there is no mention of Account Name anywhere.
* Once certain configurable conditions are met, the referrer will receive a reward.
* Everything is handled on login, so to receive a reward for a referral both accounts have to remain active.
*
* Please note only the referrer receives a reward, but you can easely give a reward to the new player as well.
* To do this, uncomment lines 71 and 72. The reward can be found at line 251. Modify as you see fit.
*/

This is incredibly helpful, and is not as common practice as I would like it to be. I've downloaded a ton of scripts form this forum and elsewhere.. and add my own notes like this if they're not there already. I also add a link to the thread / website I found the script & can get support from. So if there is conflict with another script or a future release of RunUO.. I know where I got the script from and what version it is and who to credit / blame!

Thanks for taking that extra step. It's a very professional touch to an already cool, useful script.
 

snicker7

Sorceror
any good coder has a habit of documenting their own work =] *cough* if that says anything about a lot of people here, hah
 

Shadow1980

Wanderer
chadmriden said:
This looks really cool.. I'm definitely going to use it.

I also wanted to compliment you on the comments at the beginning of the script:


This is incredibly helpful, and is not as common practice as I would like it to be. I've downloaded a ton of scripts form this forum and elsewhere.. and add my own notes like this if they're not there already. I also add a link to the thread / website I found the script & can get support from. So if there is conflict with another script or a future release of RunUO.. I know where I got the script from and what version it is and who to credit / blame!

Thanks for taking that extra step. It's a very professional touch to an already cool, useful script.


I don't do it for the systems I never release I have to admit. But when you release something, at least some effort should be made to make the script accessible for experienced and novice alike in my opinion. It doesn't only help the people using the script, it also prevents a lot of questions!

Thank you for your compliments, they are much appreciated.
 

Pyro-Tech

Knight
i was also thinking of another nice feature for this script,

if a player wasn't referred (random join on gateway mabey?) they could have a button for the option of i wasn't referred or something to that effect....and shard admins could then put a special item or collection type thing for all new players....mabey a bag with some special item and a book that would tell all the places of interest and rules of the shard??

something to that effect

just a thought.
 

Shadow1980

Wanderer
Pyro-Tech said:
i was also thinking of another nice feature for this script,

if a player wasn't referred (random join on gateway mabey?) they could have a button for the option of i wasn't referred or something to that effect....and shard admins could then put a special item or collection type thing for all new players....mabey a bag with some special item and a book that would tell all the places of interest and rules of the shard??

something to that effect

just a thought.

That can be done through charactercreation. You just check the age of the parent account before handing some of the item if you are concerned about giving things more then once per account :)
 
Top