Flav
Posts: 24 Join date: 2008-08-16
 | Subject: Donation Points system Sat Aug 16, 2008 8:00 pm | |
| Open MapleCharacter.java and 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 two times, if you can't fine the line two times you should first use this : http://odindeveloping.forumotion.net/guides-f3/fix-disapearing-nx-cash-maple-points-and-gift-tokens-t7.htm) 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; } |
Open NPCConversationManager.java and 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.
Open MySQL and execute
| Code: | ALTER TABLE `accounts` ADD COLUMN `donationpoints` int(11) NOT NULL DEFAULT '0'; |
The NPC commands are
| Code: | cm.getDonationPoints() cm.gainDonationPoints() cm.setDonationPoints() |
|
|
f1r3
Posts: 17 Join date: 2008-08-18
 | Subject: Re: Donation Points system Mon Aug 18, 2008 10:52 am | |
| nice!!! my developer worked on that |
|