Jump to content
  • 0

Premium System


leertaste

Question


  • Group:  Members
  • Topic Count:  41
  • Topics Per Day:  0.01
  • Content Count:  137
  • Reputation:   1
  • Joined:  02/02/13
  • Last Seen:  

Hello Community!

I looked up for many Premium-Systems but I was very unhappy with them so I request for a new one

 

[information: I'm using eAthena so please put it in usable syntax for me :P]


What I want in this Premium System?


I want 3 different types of Premium Accounts:

[+ SQL Tables for Each Account Type]

SQL Tables will include:

ID, Account ID, Start Date, End Date, Status (activ/passiv)


1. Bronze
2. Silver
3. Gold

It should be possible giving this Premium type via Itemscript (callfunc)

- if your status is normal you can use: bronze premium upgrade/silver premium upgrade/gold premium upgrade

- if your status is bronze you can use: silver premium upgrade/gold premium upgrade

- if your status is silver you can use: gold premium upgrade
- if your status is gold you cant use any upgrade (as long your status wont be set back to normal(if expire date))

 

What are these types differences?

Bronze:
Standart Exp is 100% - Bronze will set this up to 125%                                // configureable like on the headear of the script [settings]

give an variable for using special function in other npcs (x)

 

Silver:
Standart Exp is 100% - Silver will set this up to 150%                                  // configureable like on the headear of the script [settings]

Itemrate will increased by 5%                                                                       // configureable like on the headear of the script [settings]

give an variable for using special function in other npcs (xy)

 

Gold:

Standart Exp is 100% - Gold will set this up to 200% (Doubled Exp Rate)   // configureable like on the headear of the script [settings]
Itemrate will increased by 10%                                                                     // configureable like on the headear of the script [settings]

give an variable for using special function in other npcs (xxy)

Enable the use of some extra @commands (maybe changing gm level of user to level 1)

 

Variable example: (maybe name these variables = AccLvL1(bronze), AccLvL2(silver), AccLvL3(gold))
Normal Account can't use the Jobmaster (because variable is missing)
Bronze User can't use the Jobmaster (cause given variable is not useable for jobmaster/missing)
Silver User can use the Jobmaster (but he will need to pay some zenys)
Gold User can use the Jobmaster (without paying)

(I'm NOT requesting the Npc. It was just an example what the variables will be used for)

 

Expire Date:

I want an expire date to be configurable (also can set the bronze/silver/gold account permanently)
In sql table it could be configured (end date = 0)

 

and if the premium status expired it should be shown at disbottom

 

At Login:
Everytime you login it should be displayed what type of account you have (dispbottom) (only if theres a type/NOT on normal account type)
and, if configured, the expire date or sth. like how long the premium status will hold on to.

 

NPC:

Maybe you can add an NPC where an

User can see:

- his account status (Normal/Bronze/Silver/Gold) and (if given) the expire date of it
(also display if the type of premium is set for permanent)

- a list of members having an premium account [bronze/Silver/Gold]

 

Example:

if normal

Hello [NAME] you have an normal account. Get an [iTEMNAME] to get a premium account.

if premium:
Hello [NAME] you have an [sTATUS ACCOUNT] and it's permanent/ and it will expire in [TIME Days, Hours, Minutes]

 

What an Admin (gm lvl 99) can do:
- delete someones premium status

- add a premium status for someone

 

I hope this is detailed enough so no questions will get over me ;)

 

It would be so freaking awesome if someone could script this for me! :D

I'm sure many users would implement this in their servers! :D
Please please please :D

Edited by leertaste
Link to comment
Share on other sites

15 answers to this question

Recommended Posts


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

Try this

http://pastebin.com/raw.php?i=yw8s8cMp

 

 

// 12703,Holy_Egg_2,Holy Egg,11,0,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc( "VIP_upgrade", 7, 12703, 0 ); /* 7 days, item ID to delete */ },{},{} // 	0 = up to bronze
// 12703,Holy_Egg_2,Holy Egg,11,0,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc( "VIP_upgrade", 7, 12703, 1 ); /* 7 days, item ID to delete */ },{},{} //1 = up to silver
// 12703,Holy_Egg_2,Holy Egg,11,0,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc( "VIP_upgrade", 7, 12703, 2 ); /* 7 days, item ID to delete */ },{},{} // 2 = up to gold
  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  26
  • Topics Per Day:  0.01
  • Content Count:  77
  • Reputation:   1
  • Joined:  03/11/12
  • Last Seen:  

i try to put on my server but i think its not work...i use rathena

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  41
  • Topics Per Day:  0.01
  • Content Count:  137
  • Reputation:   1
  • Joined:  02/02/13
  • Last Seen:  

Oh maaaaa gaaaawd! :D
I love you so much :D

The most parts are working perfectly =)

 

But i detected some errors i can't fix on my own :$

At first the SQL part :)
When I open the script in my query browser this "error" expires:
Line 28:

ALTER table `login` add column account_type varchar(255) NOT NULL default 'NULL' after `birthdate`, add index (account_type);

 

Error Message:

Duplicate column name 'account_type'

 

The next error appears:
When I try to delete an account from sql tabe via npc
my map_server gives this error message (I'm sure this error appears cause of the error in sql table line 28)

: DB error - Unknown column 'Calvin' in 'where clause'
[Debug]: at c:\users\-calvin-\desktop\eathena-sql-15228[trunk][win32]\src\map\sc
ript.c:13142 - DELETE FROM vip_gold WHERE account_name = Calvin
[Debug]: Source (NPC): VIP system at prontera (150,150)


When I use the Holy Egg (12703) my premium status will increased the account status to bronze
but when I use another holy egg my map server gives this error:

[sql]: DB error - Duplicate entry '2000000' for key 1
[Debug]: at c:\users\-calvin-\desktop\eathena-sql-15228[trunk][win32]\src\map\sc
ript.c:13142 - INSERT INTO vip_bronze (`account_id`,`account_name`,`start_date`,
`end_date`,`status`) VALUES (2000000,'admin','2013-03-11', ( DATE_ADD('2013-03-1
1', INTERVAL 7 DAY) ), 'ACTIVE')
[Debug]: Source (NPC): FAKE_NPC (invisible/not on a map)
[sql]: DB error - Data truncated for column 'account_type' at row 1
[Debug]: at c:\users\-calvin-\desktop\eathena-sql-15228[trunk][win32]\src\map\sc
ript.c:13142 - UPDATE login SET `account_type` = 'BRONZE' WHERE account_id = '20
00000'
[Debug]: Source (NPC): FAKE_NPC (invisible/not on a map)

 

Because of this my Status will not shown at NPC when I used the Holy Egg to increase account status to another
This NPC already says: "You have an normal account"... but in my sql bronze_vip table is the account listed O.O


Questions:

1.Am I supposed to create 3 Items? Every item will give me bronze/silver or gold status? Or do I have to upgrade all the way trough?

2.How can I set up no expire date? like an permanent premium account?

 


And again Capuche, I love your work *_*

Edited by leertaste
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

1/ SQL part and errors

 

Oh m

At first the SQL part :)
When I open the script in my query browser this "error" expires:
Line 28:

ALTER table `login` add column account_type varchar(255) NOT NULL default 'NULL' after `birthdate`, add index (account_type);

 

Error Message:

Duplicate column name 'account_type'

You already have a `account_type` column in login or you load the alter SQl twice. Don't worry about this

 

 

 

The next error appears:
When I try to delete an account from sql tabe via npc
my map_server gives this error message (I'm sure this error appears cause of the error in sql table line 28)

Quote

: DB error - Unknown column 'Calvin' in 'where clause'
[Debug]: at c:\users\-calvin-\desktop\eathena-sql-15228[trunk][win32]\src\map\sc
ript.c:13142 - DELETE FROM vip_gold WHERE account_name = Calvin
[Debug]: Source (NPC): VIP system at prontera (150,150)

Fixed in the last revision

 

 

When I use the Holy Egg (12703) my premium status will increased the account status to bronze
but when I use another holy egg my map server gives this error:

Quote

[sql]: DB error - Duplicate entry '2000000' for key 1
[Debug]: at c:\users\-calvin-\desktop\eathena-sql-15228[trunk][win32]\src\map\sc
ript.c:13142 - INSERT INTO vip_bronze (`account_id`,`account_name`,`start_date`,
`end_date`,`status`) VALUES (2000000,'admin','2013-03-11', ( DATE_ADD('2013-03-1
1', INTERVAL 7 DAY) ), 'ACTIVE')
[Debug]: Source (NPC): FAKE_NPC (invisible/not on a map)
[sql]: DB error - Data truncated for column 'account_type' at row 1
[Debug]: at c:\users\-calvin-\desktop\eathena-sql-15228[trunk][win32]\src\map\sc
ript.c:13142 - UPDATE login SET `account_type` = 'BRONZE' WHERE account_id = '20
00000'
[Debug]: Source (NPC): FAKE_NPC (invisible/not on a map)

 

Strange I don't have this kind of error.

- Make an @reloadscript just in case.

- Reload the sql table one by one.

 

CREATE TABLE IF NOT EXISTS `vip_bronze` (
  `account_id` int(11) unsigned NOT NULL default '0',
  `account_name` varchar(255) NOT NULL default 'NULL',
  `start_date` datetime NOT NULL default '0000-00-00 00:00:00',
  `end_date` datetime NOT NULL default '0000-00-00 00:00:00',
  `status` varchar(255) NOT NULL DEFAULT 'NULL',
  PRIMARY KEY  (`account_id`)
) ENGINE=MyISAM;

table silver

CREATE TABLE IF NOT EXISTS `vip_silver` (
  `account_id` int(11) unsigned NOT NULL default '0',
  `account_name` varchar(255) NOT NULL default 'NULL',
  `start_date` datetime NOT NULL default '0000-00-00 00:00:00',
  `end_date` datetime NOT NULL default '0000-00-00 00:00:00',
  `status` varchar(255) NOT NULL DEFAULT 'NULL',
  PRIMARY KEY  (`account_id`)
) ENGINE=MyISAM;

table gold

CREATE TABLE IF NOT EXISTS `vip_gold` (
  `account_id` int(11) unsigned NOT NULL default '0',
  `account_name` varchar(255) NOT NULL default 'NULL',
  `start_date` datetime NOT NULL default '0000-00-00 00:00:00',
  `end_date` datetime NOT NULL default '0000-00-00 00:00:00',
  `status` varchar(255) NOT NULL DEFAULT 'NULL',
  PRIMARY KEY  (`account_id`)
) ENGINE=MyISAM;

 

 

 

 

2/ Questions

 

1.Am I supposed to create 3 Items? Every item will give me
bronze/silver or gold status? Or do I have to upgrade all the way
trough?

You only need 1 item (Holy Egg (12703) here) to upgrade the account into bronze/silver/gold.

 

Each time you click on the item, you can upgrade the account into the next state and the item is delete.

- Your account is normal --> bronze

- Your account is bronze --> silver

-                             silver --> gold

-                              gold -- > you can't upgrade your account (limit reach)

 

 

You also can upgrade the account speaking with the NPC (required the item in your inventory). But don't forget to set this option in the NPC

set .item_premium, 501; // ID item to upgrade your account to bronze/silver/gold

 

 

2.How can I set up no expire date? like an permanent premium account?

Just put enough day when you change the account (3000 days is enough?)

 

 

You also can set the expired delay in the item

callfunc( "VIP_upgrade", 7, 12703 ); /* 7 days, item ID to delete */

 

 

Last revision : http://pastebin.com/raw.php?i=A45Z7Kfx

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  41
  • Topics Per Day:  0.01
  • Content Count:  137
  • Reputation:   1
  • Joined:  02/02/13
  • Last Seen:  

Oh wow! :)
You'r just great! :D

All problems seem to be fixed except the upgrading one.
When I use the "Holy Egg" the first time, I just get this error:

: DB error - Data truncated for column 'account_type' at row 1
[Debug]: at c:\users\-calvin-\desktop\eathena-sql-15228[trunk][win32]\src\map\sc
ript.c:13142 - UPDATE login SET `account_type` = 'BRONZE' WHERE account_id = '20
00000'
[Debug]: Source (NPC): VIP system at prontera (150,150)

 

When I try to "upgrade" to silver, the same error as in my last post appears.
But the GM Level in my Login Table is set to the amount of the Bronze Status.

But as the Npc says, I'v just got a normal account. O.O
Need more information?

I do also prefer 3 different items for bronze/silver/gold ;)
but this is still better then nothing :)

Edited by leertaste
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

I try with eA 15229 but I can reproduce your error - one mistake is fixed about GM level

 

http://pastebin.com/raw.php?i=vGTQPyuX

 

 

Try to truncate the account_type column and the vip table and re-test

UPDATE `login` SET `account_type` = 'NULL';
TRUNCATE `vip_bronze`;
TRUNCATE `vip_gold`;
TRUNCATE `vip_silver`;

 

 

I do also prefer 3 different items for bronze/silver/gold ;)
but this is still better then nothing :)

I will do it after the fix

Edited by Capuche
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  41
  • Topics Per Day:  0.01
  • Content Count:  137
  • Reputation:   1
  • Joined:  02/02/13
  • Last Seen:  

Try to truncate the account_type column and the vip table and re-test

 

Error:

Script line: 1    Data truncated for column 'account_type' at row 1

(GM Level is'nt set to "set .bronze_AccLvl, 0;" anymore)

 

 

I can't follow anymore o.o

Does maybe other SQL Scripts I've loadet "kill" each other?

Edited by leertaste
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

Does maybe other SQL Scripts I've loadet "kill" each other?

possible. You can test replacing in the script all

    account_type

by

    account_type_vip

 

then load in mysql

 

ALTER table `login` add column account_type_vip varchar(255) NOT NULL default 'NULL' after `birthdate`, add index (account_type_vip);

 

 

I don't find the answer of this problem.. it works fine on my local /swt

Edited by Capuche
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  41
  • Topics Per Day:  0.01
  • Content Count:  137
  • Reputation:   1
  • Joined:  02/02/13
  • Last Seen:  

Dude, it work's now ;)
Damn SQL Tables...

Dude, you'r the best!!! Really :D

 

EDIT: The Npc shows that I have first bronze, then silver, and then gold account, but the gm level isnt set to the level i setup in setup section

 

    set .bronze_AccLvl, 1;        // VIP bronze Account Level
    set .silver_AccLvl, 2;        //        silver
    set .gold_AccLvl, 3;        //        gold

Only on gold account I'll become GM Level 1 I restarted server after changing this

 


The last thing are the 3 items :$
or teach me how to do and i do it on my own :)))

Edited by leertaste
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

EDIT: The Npc shows that I have first bronze, then silver, and then gold

account, but the gm level isnt set to the level i setup in setup

section

 

hmm that must be coz you don't change it in the VIP_upgrade function too

	set .@bronze_AccLvl, 0;		// VIP bronze Account Level
	set .@silver_AccLvl, 0;		// 	   silver
	set .@gold_AccLvl, 1;		// 	   gold

Sorry I sound just a little bit of a skinflint about permanents variables

 

 

 

The last thing are the 3 items :$

or teach me how to do and i do it on my own :)))

hmm some questions

3 items, one item to upgrade each vip type : do you want to restrict the upgrade ?

 

Example :

An account's player is normal, he owns an item to upgrade his account to silver.

- The upgrade is restricted : he can't upgrade his account to silver, he must upgrade his account to bronze with an item upgrade bronze before.

- Not restricted : his account up to silver type

 

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  41
  • Topics Per Day:  0.01
  • Content Count:  137
  • Reputation:   1
  • Joined:  02/02/13
  • Last Seen:  

You have an normal account
And if you use an (for example) Silver Premium Ticket
you directly jump to silver premium without getting bronze before.


But it should also be possible to upgrade your Accunt to gold (with Holy Egg) after using the Silver Premium Ticket. (Same with bronze)

But it should also be possible to upgrade your Account to gold (with Gold Premium Ticket) after using the Silver Premium Ticket. (Same with bronze)
(So you reach Gold/silver)

Impossible:
- Using Bronze premium ticket if your account status is even higher (silver/bronze)
- Using Silver premium ticket if your account status is even higher (gold ticket)
So you can't "downgrade" you'r premium status to any lower

 

To say it in your words: Not restricted

Edited by leertaste
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  41
  • Topics Per Day:  0.01
  • Content Count:  137
  • Reputation:   1
  • Joined:  02/02/13
  • Last Seen:  

Oh thank you so much!!!

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.01
  • Content Count:  333
  • Reputation:   66
  • Joined:  09/05/12
  • Last Seen:  

How about this error?

 

: DB error - ALTER command denied to user 'user'@'serverip' for table 'vip_bronze'
[Debug]: at script.c:14628 - ALTER TABLE vip_bronze AUTO_INCREMENT = 1


I dunno why I get this error.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  93
  • Reputation:   0
  • Joined:  01/30/12
  • Last Seen:  

Not found error but its not working in my server i just try clicking it and nothing happens

Edited by dize11
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...