Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[Add-On] Shroom's Donation Points system

Elite Diviner
Joined
Jul 13, 2008
Messages
419
Reaction score
217
Shroom's Donation Points system
First of all I want to clear something up... I'm not sure if something like this has already been released, if yes don't flame me because I'm only trying to help. I made this script for my server after I added donations. For every $ a user donates he receive 1 Donation Point. With these Donation Points they can buy items from a NPC. The Donation Points are saved in the accounts table, not in the characters table.

MapleCharacter.java
Add
Code:
	private int donationpoints;
After
Code:
	private int gifttokens;
Add
Code:
			ret.donationpoints = rs.getInt("donationpoints");
After
Code:
			ret.gifttokens = rs.getInt("gTokens");
(You have to do this 2 times, if you don't have this line (ret.gifttokens = rs.getInt("gTokens");) two times, then you should better add this Cash Shop fix: [ame]http://forum.ragezone.com/showthread.php?t=431787[/ame])
Replace
Code:
			ps = con.prepareStatement("UPDATE accounts SET `nxCash` = ?, `mPoints` = ?, `gTokens` = ? WHERE id = ?");
With
Code:
			ps = con.prepareStatement("UPDATE accounts SET `nxCash` = ?, `mPoints` = ?, `gTokens` = ?, `donationpoints` = ? WHERE id = ?");
Replace
Code:
			ps.setInt(3, gifttokens);
			ps.setInt(4, client.getAccID());
With
Code:
			ps.setInt(3, gifttokens);
			ps.setInt(4, donationpoints);
			ps.setInt(5, client.getAccID());
Add
Code:
	public int getDonationPoints() {
            return donationpoints;
	}
       
        public void gainDonationPoints(int donationpoints) {
            this.donationpoints += donationpoints;
        }
       
        public void setDonationPoints(int donationpoints) {
            this.donationpoints = donationpoints;
        }
After
Code:
	public int getNX() {
		    return nxcash;
	}

NPCConversationManager.java
Add
Code:
	public int getDonationPoints() {
		return getPlayer().getDonationPoints();
	}

	public void gainDonationPoints(int donationpoints) {
                getPlayer().gainDonationPoints(donationpoints);
        }
        
        public void setDonationPoints(int donationpoints) {
            getPlayer().setDonationPoints(donationpoints);
        }
Before the last bracket.

MySQL
Execute
Code:
ALTER TABLE `accounts` ADD COLUMN `donationpoints` int(11) NOT NULL DEFAULT '0';


The NPC commands are...
Code:
cm.getDonationPoints() - Gets the current amount of Donation Points
cm.gainDonationPoints() - Gives Donation Points
cm.setDonationPoints - Sets Donation Points



Hope it's usefull and works...
Credits to me for making this and who ever made the Cash Shop working because I based the most things from it.
 
Last edited by a moderator:
Newbie Spellweaver
Joined
Aug 8, 2008
Messages
47
Reaction score
0
Re: [Release] Shroom's Donation Points system

first post! Awesome release! i will definitely use it for my server!
 
Legendary Battlemage
Loyal Member
Joined
May 18, 2008
Messages
614
Reaction score
53
Re: [Release] Shroom's Donation Points system

looks good
 
Elite Diviner
Joined
Jul 13, 2008
Messages
419
Reaction score
217
Re: [Release] Shroom's Donation Points system

Oops, forgot the MySQL part...
Added!
 
Newbie Spellweaver
Joined
Jan 8, 2007
Messages
41
Reaction score
0
Re: [Release] Shroom's Donation Points system

Great job. Hopefully if I add this ill find a use for it. Maybe your donation points could be spent to get rare items and to buy access to certain commands.... Hmmph.
 
Elite Diviner
Joined
Jul 13, 2008
Messages
419
Reaction score
217
Re: [Release] Shroom's Donation Points system

That's for what I use it, for items they can't get without donations. You can use the NPC commands to script a Donation Shop NPC or you can wait till I'm done wiht mine and release it.

EDIT : Hehe, my Donation system is up since 30 minutes and I already received 30 $...
 
Junior Spellweaver
Joined
Apr 6, 2008
Messages
140
Reaction score
0
Re: [Release] Shroom's Donation Points system

It seems working lol and good luck on your donations xD
 
Elite Diviner
Joined
Jul 13, 2008
Messages
419
Reaction score
217
Re: [Release] Shroom's Donation Points system

Thanks...

Btw, does somebody know a site where I can buy a dedicated server with a Paypal account?
 
Newbie Spellweaver
Joined
Jun 1, 2008
Messages
91
Reaction score
0
Re: [Release] Shroom's Donation Points system

Wow. This is really awesome. Nice release.
 
Experienced Elementalist
Joined
Jul 10, 2008
Messages
299
Reaction score
3
Re: [Release] Shroom's Donation Points system

Cool i was thinking of releasing mine, but this one is more organized. Nice job.
 
Junior Spellweaver
Joined
Apr 7, 2008
Messages
100
Reaction score
0
Re: [Release] Shroom's Donation Points system

I've had this forever, but good thing someone released it. Maybe I'll release the PayPal IPN script I built for my donation system when I get time.
 
Legendary Battlemage
Joined
May 23, 2008
Messages
628
Reaction score
4
Re: [Release] Shroom's Donation Points system

Pretty useful but i have another system :)
 
Newbie Spellweaver
Joined
Jun 20, 2008
Messages
9
Reaction score
0
Re: [Release] Shroom's Donation Points system

wow this is awesome. Just a request? can anyone code a command so that when players type for example @donation it tells them how much points they have?
 
Newbie Spellweaver
Joined
Jul 26, 2008
Messages
29
Reaction score
0
Re: [Release] Shroom's Donation Points system

Lol nice Flav. Keep Realsing -=]
 
Legendary Battlemage
Joined
May 23, 2008
Messages
628
Reaction score
4
Re: [Release] Shroom's Donation Points system

On second thought... I'm gonna use your system now lol.
Thanks for the release
 
Λκαяυz føяeνeя
Loyal Member
Joined
Jun 28, 2008
Messages
1,950
Reaction score
73
Re: [Release] Shroom's Donation Points system

@donate
-- Explains how much u need to donate to get what features
also
@donations
-- Tells you ur points (not my idea)
 
Elite Diviner
Joined
Jul 13, 2008
Messages
419
Reaction score
217
Re: [Release] Shroom's Donation Points system

wow this is awesome. Just a request? can anyone code a command so that when players type for example @donation it tells them how much points they have?

I can make it tomorrow, never scripted a User Command but I think it's easy. I will give a look to it and post it then later here.
Alternative you can use the NPC command I already made to let your users check how much Donation Points they have.
Code:
/*Donater Shop - by Flav*/


var status = 0;

function start() {
	status = -1;
	action(1, 0, 0);
}

function action(mode, type, selection) {
	if (mode == -1) {
		cm.dispose();
	} else {
		if (mode == 0 && status == 0) {
			cm.dispose();
			return;
		}

		if (mode == 1)
			status++;
		else
			status--;

		if (status == 0) {
			cm.sendOk("You have #r"+cm.getDonationPoints()+" Donation Points#k to spend.");
			cm.dispose();
		}
	}
}
 
Legendary Battlemage
Loyal Member
Joined
May 18, 2008
Messages
614
Reaction score
53
Re: [Release] Shroom's Donation Points system

user commands are easy to script if you know what ur doing ^^
 
Λκαяυz føяeνeя
Loyal Member
Joined
Jun 28, 2008
Messages
1,950
Reaction score
73
Re: [Release] Shroom's Donation Points system

I can make it tomorrow, never scripted a User Command but I think it's easy. I will give a look to it and post it then later here.
Alternative you can use the NPC command I already made to let your users check how much Donation Points they have.
Code:
/*Donater Shop - by Flav*/


var status = 0;

function start() {
	status = -1;
	action(1, 0, 0);
}

function action(mode, type, selection) {
	if (mode == -1) {
		cm.dispose();
	} else {
		if (mode == 0 && status == 0) {
			cm.dispose();
			return;
		}

		if (mode == 1)
			status++;
		else
			status--;

		if (status == 0) {
			cm.sendOk("You have #r"+cm.getDonationPoints()+" Donation Points#k to spend.");
			cm.dispose();
		}
	}
}

Just take like a normal command like !say or something and edit it around xP
 
Elite Diviner
Joined
Jul 13, 2008
Messages
419
Reaction score
217
Re: [Release] Shroom's Donation Points system

Yea I think it's easy and I know I can do it... lol ...but I'm busy and lazy at the moment, also it's 01:21 AM here and I go to bed soon!
I will script it tomorrow! :)

But since this system is made for NPCs which sell the special items to the donaters it's easier to use the NPC script. My NPC tells the user how many Donation Points he has on his account and then ask if he wants to buy something with the points.
 
Back
Top