Pokemon System and EXP bug

Results 1 to 5 of 5
  1. #1
    ♥Fatal|Error♥ JungleByte is offline
    MemberRank
    Oct 2009 Join Date
    Singapore, SingLocation
    1,096Posts

    Pokemon System and EXP bug

    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 .
    PHP Code:
    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() / 2this);
                       }  
          }
                    if (
    this.getHardcore() == 1) {
                    
    MapleInventory equipped this.getInventory(MapleInventoryType.EQUIPPED);
                    List<
    Shortids = new LinkedList<Short>();
                    for (
    Item item equipped.list()) {
                    
    ids.add(item.getPosition());
                    }
                    for (
    short idf ids) {
                    
    MapleInventoryManipulator.drop(this.getClient(), MapleInventoryType.EQUIPPEDidf, (short1);
                    }
                    
    World.Broadcast.broadcastMessage(MaplePacketCreator.serverNotice(66"[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(5130000false);
                if (
    charms 0) {
                    
    MapleInventoryManipulator.removeById(clientMapleInventoryType.CASH51300001truefalse);

                    
    charms--;
                    if (
    charms 0xFF) {
                        
    charms 0xFF;
                    }
                    
    client.getSession().write(MTSCSPacket.useCharm((bytecharms, (byte0));
                } 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.EXPthis.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((short50this);
                
    pyramidSubway.fail(this);
            }
        } 
    I tried replacing that with the 1 in TetraSEA , which is this.
    PHP Code:
    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(5130000false);
                if (
    charms 0) {
                    
    MapleInventoryManipulator.removeById(clientMapleInventoryType.CASH51300001truefalse);

                    
    charms--;
                    if (
    charms 0xFF) {
                        
    charms 0xFF;
                    }
                    
    client.getSession().write(MTSCSPacket.useCharm((bytecharms, (byte0));
                } 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.EXPthis.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((short50this);
                
    pyramidSubway.fail(this);
            }
        } 
    But I am getting this error in Netbean
    PHP Code:
    C:\Users\Darren\Desktop\src\client\MapleCharacter.java:3874errorbad 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:3878errorincompatible types
                    this
    .exp v10;
      
    requiredAtomicInteger
      found
    :    int
    C
    :\Users\Darren\Desktop\src\client\MapleCharacter.java:3880errorno suitable method found for updateSingleStat(MapleStat,AtomicInteger)
                
    this.updateSingleStat(MapleStat.EXPthis.exp);
        
    method MapleCharacter.updateSingleStat(MapleStat,int,booleanis not applicable
          
    (actual and formal argument lists differ in length)
        
    method MapleCharacter.updateSingleStat(MapleStat,intis not applicable
          
    (actual argument AtomicInteger cannot be converted to int by method invocation conversion)
    3 errors 
    Both updateSingleStat is the same ... So what's the problem for the EXP ? :X


  2. #2
    Ass > Tits Lapje is offline
    MemberRank
    Feb 2009 Join Date
    nullLocation
    1,879Posts

    Re: Pokemon System and EXP bug

    You have 3 errors:

    1. Code:
      int v10 = (int) (exp - (long) ((double) expforlevel * diepercentage)); 
        first type:  AtomicInteger 
        second type: long
      Exp is an 'AtomicInteger' and you're substracting a long from it. You're also saving the result in an integer which might cause trouble.
    2. Code:
      incompatible types 
                      this.exp = v10; 
        required: AtomicInteger 
        found:    int
      Again, you're trying to save an integer in an 'AtomicInteger'. Google is your best friend.
    3. Code:
      this.updateSingleStat(MapleStat.EXP, this.exp); 
          method MapleCharacter.updateSingleStat(MapleStat,int,boolean) is not applicable 
            (actual and formal argument lists differ in length)
      You need to add a boolean value to the function. I assume it's whether you want to save the character but that's for you to check.

    Good luck.

  3. #3
    ♥Fatal|Error♥ JungleByte is offline
    MemberRank
    Oct 2009 Join Date
    Singapore, SingLocation
    1,096Posts

    Re: Pokemon System and EXP bug

    Quote Originally Posted by Lapje View Post
    You have 3 errors:

    1. Code:
      int v10 = (int) (exp - (long) ((double) expforlevel * diepercentage)); 
        first type:  AtomicInteger 
        second type: long
      Exp is an 'AtomicInteger' and you're substracting a long from it. You're also saving the result in an integer which might cause trouble.
    2. Code:
      incompatible types 
                      this.exp = v10; 
        required: AtomicInteger 
        found:    int
      Again, you're trying to save an integer in an 'AtomicInteger'. Google is your best friend.
    3. Code:
      this.updateSingleStat(MapleStat.EXP, this.exp); 
          method MapleCharacter.updateSingleStat(MapleStat,int,boolean) is not applicable 
            (actual and formal argument lists differ in length)
      You need to add a boolean value to the function. I assume it's whether you want to save the character but that's for you to check.

    Good luck.
    Thank you Sir (: Do you know about the pokemkn thing ?

  4. #4
    To dev or not to dev kaitodomoto is offline
    MemberRank
    Apr 2011 Join Date
    207Posts

    Re: Pokemon System and EXP bug

    You could try to leech it from Xeon They Have it in their source as well not sure if this is helpful but i could fix some of the error if you take it from them....

  5. #5
    ♥Fatal|Error♥ JungleByte is offline
    MemberRank
    Oct 2009 Join Date
    Singapore, SingLocation
    1,096Posts

    Re: Pokemon System and EXP bug

    Quote Originally Posted by kaitodomoto View Post
    You could try to leech it from Xeon They Have it in their source as well not sure if this is helpful but i could fix some of the error if you take it from them....
    Ok (: I will leech it from Xeon by the end of the afternoon (;



Advertisement