EventPoints System

Go down

EventPoints System

投稿 by 構築さん on 2014-05-31, 17:16

maplecharacter.java

Code:
private int eventpoints;

を追加

Code:
public int getEventPoints() {
return eventpoints;
}

public void gainEventPoints(int eventpoints) {
this.eventpoints += eventpoints;
}

public void setEventPoints(int eventpoints) {
this.eventpoints = eventpoints;
}

も追加

Code:
ret.accountid = rs.getInt("accountid");

の下に

Code:
ret.eventpoints = rs.getInt("eventpoints");

を追加

Code:
if (update) {
ps = con.prepareStatement("UPDATE characters SET level = ?, fame = ?, str = ?, dex = ?, luk = ?, `int` = ?, exp = ?, gachaexp = ?, hp = ?, mp = ?, maxhp = ?, maxmp = ?, sp = ?, ap = ?, gm = ?, skincolor = ?, gender = ?, job = ?, hair = ?, face = ?, map = ?, meso = ?, hpMpUsed = ?, spawnpoint = ?, party = ?, buddyCapacity = ?, messengerid = ?, messengerposition = ?, mountlevel = ?, mountexp = ?, mounttiredness= ?, equipslots = ?, useslots = ?, setupslots = ?, etcslots = ?, monsterbookcover = ?, vanquisherStage = ?, dojoPoints = ?, lastDojoStage = ?, finishedDojoTutorial = ?, vanquisherKills = ?, matchcardwins = ?, matchcardlosses = ?, matchcardties = ?, omokwins = ?, omoklosses = ?, omokties = ?, donorpoints = ?, occupation = ?, donor = ?, WHERE id = ?", Statement.RETURN_GENERATED_KEYS);

も追加

Code:
eventpoints = ?,

を追加

Code:
} else {
ps = con.prepareStatement("INSERT INTO characters (level, fame, str, dex, luk, `int`, exp, gachaexp, hp, mp, maxhp, maxmp, sp, ap, gm, skincolor, gender, job, hair, face, map, meso, hpMpUsed, spawnpoint, party, buddyCapacity, messengerid, messengerposition, mountlevel, mounttiredness, mountexp, equipslots, useslots, setupslots, etcslots, monsterbookcover, vanquisherStage, dojopoints, lastDojoStage, finishedDojoTutorial, vanquisherKills, matchcardwins, matchcardlosses, matchcardties, omokwins, omoklosses, omokties, donorpoints, occupation, donor, accountid, name, world) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", Statement.RETURN_GENERATED_KEYS);
}

も追加

Code:
if (update) {
ps = con.prepareStatement("UPDATE characters SET level = ?, fame = ?, str = ?, dex = ?, luk = ?, `int` = ?, exp = ?, gachaexp = ?, hp = ?, mp = ?, maxhp = ?, maxmp = ?, sp = ?, ap = ?, gm = ?, skincolor = ?, gender = ?, job = ?, hair = ?, face = ?, map = ?, meso = ?, hpMpUsed = ?, spawnpoint = ?, party = ?, buddyCapacity = ?, messengerid = ?, messengerposition = ?, mountlevel = ?, mountexp = ?, mounttiredness= ?, equipslots = ?, useslots = ?, setupslots = ?, etcslots = ?, monsterbookcover = ?, vanquisherStage = ?, dojoPoints = ?, lastDojoStage = ?, finishedDojoTutorial = ?, vanquisherKills = ?, matchcardwins = ?, matchcardlosses = ?, matchcardties = ?, omokwins = ?, omoklosses = ?, omokties = ?, donorpoints = ?, occupation = ?, donor = ?, eventpoints = ?, WHERE id = ?", Statement.RETURN_GENERATED_KEYS);
} else {
ps = con.prepareStatement("INSERT INTO characters (level, fame, str, dex, luk, `int`, exp, gachaexp, hp, mp, maxhp, maxmp, sp, ap, gm, skincolor, gender, job, hair, face, map, meso, hpMpUsed, spawnpoint, party, buddyCapacity, messengerid, messengerposition, mountlevel, mounttiredness, mountexp, equipslots, useslots, setupslots, etcslots, monsterbookcover, vanquisherStage, dojopoints, lastDojoStage, finishedDojoTutorial, vanquisherKills, matchcardwins, matchcardlosses, matchcardties, omokwins, omoklosses, omokties, donorpoints, occupation, donor, eventpoints, accountid, name, world) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", Statement.RETURN_GENERATED_KEYS);
}

を追加

Code:
ps.setInt(50, donor);
if (update) {
ps.setInt(51, id);
} else {
ps.setInt(51, accountid);
ps.setString(52, name);
ps.setInt(53, world);
}



Code:
ps.setInt(50, donor);
ps.setInt(51, eventpoints);
if (update) {
ps.setInt(52, id);
} else {
ps.setInt(52, accountid);
ps.setString(53, name);
ps.setInt(54, world);
}

に変更

Code:
} else if (sub[0].equals("gifteventpoints")) {
MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(sub[1]).gainEventPoints(Integer.parseInt(sub[2]));
victim.dropOverheadMessage("You have given " + sub[1] + " " + victim.getEventPoints + " eventpoints !");

を追加

SQL

Code:
ALTER TABLE `accounts` ADD COLUMN `eventpoints` int(11) NOT NULL DEFAULT '0';
avatar
構築さん
Admin

Posts : 193
Join date : 2014/05/29

http://maplescience.forumjap.com

トップに戻る Go down

トップに戻る


 
Permissions in this forum:
返信投稿: 不可