Pmob

Results 1 to 2 of 2
  1. #1
    Member TheShiney is offline
    MemberRank
    Apr 2012 Join Date
    46Posts

    Pmob

    Does anyone have the code for pmob?
    Where do I put it exactly in developer commands?


  2. #2
    Grand Master TiredGuy is offline
    Grand MasterRank
    Mar 2012 Join Date
    Behind YouLocation
    1,527Posts

    Re: Pmob

    PHP Code:
            } else if (splitted[0].equalsIgnoreCase("pmob")) {
                
    int npcId Integer.parseInt(splitted[1]);
                
    int monsterId;
                
    int mobTime Integer.parseInt(splitted[2]);
                
    int xpos player.getPosition().x;
                
    int ypos player.getPosition().y;
                
    int fh player.getMap().getFootholds().findBelow(player.getPosition()).getId();
                if (
    splitted[2] == null) {
                    
    mobTime 0;
                }
                
    MapleMonster mob MapleLifeFactory.getMonster(npcId);
                if (
    mob != null && !mob.getName().equalsIgnoreCase("MISSINGNO")) {
                    
    mob.setPosition(player.getPosition());
                    
    mob.setCy(ypos);
                    
    mob.setRx0(xpos 50);
                    
    mob.setRx1(xpos 50);
                    
    mob.setFh(fh);
                    try {
                        
    Connection con DatabaseConnection.getConnection();
                        
    PreparedStatement ps con.prepareStatement("INSERT INTO spawns ( idd, f, fh, cy, rx0, rx1, type, x, y, mid, mobtime ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )");
                        
    ps.setInt(1npcId);
                        
    ps.setInt(20);
                        
    ps.setInt(3fh);
                        
    ps.setInt(4ypos);
                        
    ps.setInt(5xpos 50);
                        
    ps.setInt(6xpos 50);
                        
    ps.setString(7"m");
                        
    ps.setInt(8xpos);
                        
    ps.setInt(9ypos);
                        
    ps.setInt(10player.getMapId());
                        
    ps.setInt(11mobTime);
                        
    ps.executeUpdate();
                    } catch (
    SQLException e) {
                        
    player.dropMessage("Failed to save MOB to the database");
                    }
                    
    player.getMap().addMonsterSpawn(mobmobTime);
                } else {
                    
    player.dropMessage("You have entered an invalid Npc-Id");
                } 



Advertisement