- Joined
- Oct 29, 2009
- Messages
- 738
- Reaction score
- 14
I leeched the Pokemon System from TetraSEA , manage to get my pokemon from @pokemon , but It won't save at the database , I already added the savetodb function for pokemon , and also I already executed the Pokemon SQL in my database , but it won't save it . And also after I @accept challenge , both my opponent and I will dc , I had added everything on pokemon into the source , no bat error .
Another error is that when a player died , instead of decreasing EXP , the EXP increases 2 times the original amount .
I tried replacing that with the 1 in TetraSEA , which is this.
But I am getting this error in Netbean
Both updateSingleStat is the same ... So what's the problem for the EXP ? :X
Another error is that when a player died , instead of decreasing EXP , the EXP increases 2 times the original amount .
PHP:
public void playerDead() {
if (this.getSubclass() == 2) {
int rand = Randomizer.nextInt(100);
if (rand >= 60) {
this.dropMessage(5, "You've cheated death!");
this.getStat().setHp(this.getStat().getMaxHp() / 2, this);
}
}
if (this.getHardcore() == 1) {
MapleInventory equipped = this.getInventory(MapleInventoryType.EQUIPPED);
List<Short> ids = new LinkedList<Short>();
for (Item item : equipped.list()) {
ids.add(item.getPosition());
}
for (short idf : ids) {
MapleInventoryManipulator.drop(this.getClient(), MapleInventoryType.EQUIPPED, idf, (short) 1);
}
World.Broadcast.broadcastMessage(MaplePacketCreator.serverNotice(6, 6, "[Hardcore]" + this.getName() + " has died in " + this.getMap().getMapName() + " Ch " + this.getClient().getChannel() + " - All of the equips the player wore were dropped in the map!"));
}
final MapleStatEffect statss = getStatForBuff(MapleBuffStat.SOUL_STONE);
if (statss != null) {
dropMessage(5, "You have been revived by Soul Stone.");
getStat().setHp(((getStat().getMaxHp() / 100) * statss.getX()), this);
setStance(0);
changeMap(getMap(), getMap().getPortal(0));
return;
}
if (getEventInstance() != null) {
getEventInstance().playerKilled(this);
}
cancelEffectFromBuffStat(MapleBuffStat.SHADOWPARTNER);
cancelEffectFromBuffStat(MapleBuffStat.MORPH);
cancelEffectFromBuffStat(MapleBuffStat.SOARING);
cancelEffectFromBuffStat(MapleBuffStat.MONSTER_RIDING);
cancelEffectFromBuffStat(MapleBuffStat.MECH_CHANGE);
cancelEffectFromBuffStat(MapleBuffStat.RECOVERY);
cancelEffectFromBuffStat(MapleBuffStat.HP_BOOST);
cancelEffectFromBuffStat(MapleBuffStat.MP_BOOST);
cancelEffectFromBuffStat(MapleBuffStat.ENHANCED_MAXHP);
cancelEffectFromBuffStat(MapleBuffStat.ENHANCED_MAXMP);
cancelEffectFromBuffStat(MapleBuffStat.MAXHP);
cancelEffectFromBuffStat(MapleBuffStat.MAXMP);
dispelSummons();
checkFollow();
dotHP = 0;
lastDOTTime = 0;
if (!GameConstants.isBeginnerJob(job) && !inPVP()) {
int charms = getItemQuantity(5130000, false);
if (charms > 0) {
MapleInventoryManipulator.removeById(client, MapleInventoryType.CASH, 5130000, 1, true, false);
charms--;
if (charms > 0xFF) {
charms = 0xFF;
}
client.getSession().write(MTSCSPacket.useCharm((byte) charms, (byte) 0));
} else {
float diepercentage = 0.0f;
int expforlevel = getNeededExp();
if (map.isTown() || FieldLimitType.RegularExpLoss.check(map.getFieldLimit())) {
diepercentage = 0.01f;
} else {
diepercentage = (float) (0.1f - ((traits.get(MapleTraitType.charisma).getLevel() / 20) / 100f));
}
int v10 = (int) (exp.get() - (long) ((double) expforlevel * diepercentage));
if (v10 < 0) {
v10 = 0;
}
exp.addAndGet(v10);
}
this.updateSingleStat(MapleStat.EXP, this.exp.get());
}
if (!stats.checkEquipDurabilitys(this, -100)) { //i guess this is how it works ?
dropMessage(5, "An item has run out of durability but has no inventory room to go to.");
} //lol
if (pyramidSubway != null) {
stats.setHp((short) 50, this);
pyramidSubway.fail(this);
}
}
I tried replacing that with the 1 in TetraSEA , which is this.
PHP:
public void playerDead() {
final MapleStatEffect statss = getStatForBuff(MapleBuffStat.SOUL_STONE);
if (statss != null) {
dropMessage(5, "You have been revived by Soul Stone.");
getStat().setHp(((getStat().getMaxHp() / 100) * statss.getX()), this);
setStance(0);
changeMap(getMap(), getMap().getPortal(0));
return;
}
if (getEventInstance() != null) {
getEventInstance().playerKilled(this);
}
cancelEffectFromBuffStat(MapleBuffStat.SHADOWPARTNER);
cancelEffectFromBuffStat(MapleBuffStat.MORPH);
cancelEffectFromBuffStat(MapleBuffStat.SOARING);
cancelEffectFromBuffStat(MapleBuffStat.MONSTER_RIDING);
cancelEffectFromBuffStat(MapleBuffStat.MECH_CHANGE);
cancelEffectFromBuffStat(MapleBuffStat.RECOVERY);
cancelEffectFromBuffStat(MapleBuffStat.HP_BOOST);
cancelEffectFromBuffStat(MapleBuffStat.MP_BOOST);
cancelEffectFromBuffStat(MapleBuffStat.ENHANCED_MAXHP);
cancelEffectFromBuffStat(MapleBuffStat.ENHANCED_MAXMP);
cancelEffectFromBuffStat(MapleBuffStat.MAXHP);
cancelEffectFromBuffStat(MapleBuffStat.MAXMP);
dispelSummons();
checkFollow();
dotHP = 0;
lastDOTTime = 0;
if (!GameConstants.isBeginnerJob(job) && !inPVP()) {
int charms = getItemQuantity(5130000, false);
if (charms > 0) {
MapleInventoryManipulator.removeById(client, MapleInventoryType.CASH, 5130000, 1, true, false);
charms--;
if (charms > 0xFF) {
charms = 0xFF;
}
client.getSession().write(MTSCSPacket.useCharm((byte) charms, (byte) 0));
} else {
float diepercentage = 0.0f;
int expforlevel = getNeededExp();
if (map.isTown() || FieldLimitType.RegularExpLoss.check(map.getFieldLimit())) {
diepercentage = 0.01f;
} else {
diepercentage = (float) (0.1f - ((traits.get(MapleTraitType.charisma).getLevel() / 20) / 100f));
}
int v10 = (int) (exp - (long) ((double) expforlevel * diepercentage));
if (v10 < 0) {
v10 = 0;
}
this.exp = v10;
}
this.updateSingleStat(MapleStat.EXP, this.exp);
}
if (!stats.checkEquipDurabilitys(this, -100)) { //i guess this is how it works ?
dropMessage(5, "An item has run out of durability but has no inventory room to go to.");
} //lol
if (pyramidSubway != null) {
stats.setHp((short) 50, this);
pyramidSubway.fail(this);
}
}
But I am getting this error in Netbean
PHP:
C:\Users\Darren\Desktop\src\client\MapleCharacter.java:3874: error: bad operand types for binary operator '-'
int v10 = (int) (exp - (long) ((double) expforlevel * diepercentage));
first type: AtomicInteger
second type: long
C:\Users\Darren\Desktop\src\client\MapleCharacter.java:3878: error: incompatible types
this.exp = v10;
required: AtomicInteger
found: int
C:\Users\Darren\Desktop\src\client\MapleCharacter.java:3880: error: no suitable method found for updateSingleStat(MapleStat,AtomicInteger)
this.updateSingleStat(MapleStat.EXP, this.exp);
method MapleCharacter.updateSingleStat(MapleStat,int,boolean) is not applicable
(actual and formal argument lists differ in length)
method MapleCharacter.updateSingleStat(MapleStat,int) is not applicable
(actual argument AtomicInteger cannot be converted to int by method invocation conversion)
3 errors