• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

how to add bonuses when creating account on project blackout server

Newbie Spellweaver
Joined
Jan 9, 2018
Messages
10
Reaction score
0
Anyone know in which part of my server I modify, for the player to receive 10000000 cash and 1000000 gold when creating their account on the server?

sorry for english
 
Moderator
Staff member
Moderator
Joined
Jan 13, 2013
Messages
1,186
Reaction score
360
Mind telling me what is the default starting cash?

Is it: 10000000 - 10,000,000

Code:
            Account account = AccountDaoService.getInstance().accountAuth(login, password);            if (account == null) {
                if (AuthServerProperty.getInstance().ACCOUNT_AUTO_CREATE && !AccountDaoService.getInstance().accountExist(login)) {
                    account = new Account();
                    account.setLogin(login);
                    account.setPassword(password);
                    account.setActive(true);
                    account.setEmail(login + "@nullmail.ru");
                    account.setMoney(10000000);
                    AccountDaoService.getInstance().create(account);
                    if (account.getId() != null) {
                        state = authAccount(client, account);
                    } else {
                        state = State.ERROR_AUTH;
                    }
                } else {
                    state = State.ERROR_AUTH;
                }
            } else {
                state = authAccount(client, account);
            }
        }
        lock.unlock();
        return state;
    }

I'm checking all over there doesn't seem to be anything about GP, GOLD, As well as it's not called cash it's classed as Money.

Code:
con = DatabaseFactory.getInstance().newConnection();            statement = con.prepareStatement(ACCOUNT_GET_BY_LOGIN_PASSWORD.getQuery());
            statement.setString(1, login);
            statement.setString(2, password);
            rs = statement.executeQuery();
            if (rs.next()) {
                account = new Account();
                account.setId(rs.getLong("id"));
                account.setLogin(rs.getString("login"));
                account.setPassword(rs.getString("password"));
                account.setEmail(rs.getString("email"));
                account.setMoney(rs.getInt("money"));
                account.setActive(rs.getBoolean("active"));
            }

Every area it would be in seems to only have the code below

Code:
account.setMoney(rs.getInt("money"));
 
Last edited:
Upvote 0
Newbie Spellweaver
Joined
Jan 9, 2018
Messages
10
Reaction score
0
Mind telling me what is the default starting cash?

Is it: 10000000 - 10,000,000

Code:
            Account account = AccountDaoService.getInstance().accountAuth(login, password);            if (account == null) {
                if (AuthServerProperty.getInstance().ACCOUNT_AUTO_CREATE && !AccountDaoService.getInstance().accountExist(login)) {
                    account = new Account();
                    account.setLogin(login);
                    account.setPassword(password);
                    account.setActive(true);
                    account.setEmail(login + "@nullmail.ru");
                    account.setMoney(10000000);
                    AccountDaoService.getInstance().create(account);
                    if (account.getId() != null) {
                        state = authAccount(client, account);
                    } else {
                        state = State.ERROR_AUTH;
                    }
                } else {
                    state = State.ERROR_AUTH;
                }
            } else {
                state = authAccount(client, account);
            }
        }
        lock.unlock();
        return state;
    }

in the case there is the initial cash bonus, the gp is where?
 
Upvote 0
Moderator
Staff member
Moderator
Joined
Jan 13, 2013
Messages
1,186
Reaction score
360
I believe this is what you're looking for?

Code:
public PlayerCreateTemplate readStartTemplate() {
        Connection con = null;
        PreparedStatement statement = null;
        ResultSet rs = null;
        PlayerCreateTemplate template = null;
        try {
            con = DatabaseFactory.getInstance().newConnection();
            statement = con.prepareStatement(TEMPLATE_SELECT_START_EQIPMENT.getQuery());
            rs = statement.executeQuery();


            int startmoney = 0;
            int stargp = 0;
            List<PlayerItem> list = new ArrayList<PlayerItem>();
            while (rs.next()) {
                if (rs.getInt("item_id") == 0) {
                    startmoney = rs.getInt("startmoney");
                    stargp = rs.getInt("startgp");
                    continue;
                }
                list.add(new PlayerItem(
                        rs.getBoolean("equipped") ? ItemLocation.valueOf(ItemLocation.EQUIPPED.name()) : ItemLocation.valueOf(ItemLocation.INVENTORY.name()),
                        ItemHolder.getInstance().getTemplate(rs.getInt("item_id")),
                        rs.getInt("count"), (ItemHolder.getInstance().getTemplate(rs.getInt("item_id")).getConsumeType() == ItemConsumeType.PERMANENT) ? 0 : 1,
                        false));
            }
            template = new PlayerCreateTemplate(startmoney, stargp);
            for (PlayerItem item : list)
                template.addPlayerItem(item);


        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            DatabaseUtils.closeDatabaseCSR(con, statement, rs);
        }
        return template;
    }

Code:
int startmoney = 0; 

int stargp = 0;


It's at this location below.

PB SERVER NANDO\pb-global\src\ru\pb\global\dao\impl

PlayerDaoImpl.java

Lines 274, 275.
 
Last edited:
Upvote 0
Newbie Spellweaver
Joined
Jan 9, 2018
Messages
10
Reaction score
0
I believe this is what you're looking for?

Code:
public PlayerCreateTemplate readStartTemplate() {
        Connection con = null;
        PreparedStatement statement = null;
        ResultSet rs = null;
        PlayerCreateTemplate template = null;
        try {
            con = DatabaseFactory.getInstance().newConnection();
            statement = con.prepareStatement(TEMPLATE_SELECT_START_EQIPMENT.getQuery());
            rs = statement.executeQuery();


            int startmoney = 0;
            int stargp = 0;
            List<PlayerItem> list = new ArrayList<PlayerItem>();
            while (rs.next()) {
                if (rs.getInt("item_id") == 0) {
                    startmoney = rs.getInt("startmoney");
                    stargp = rs.getInt("startgp");
                    continue;
                }
                list.add(new PlayerItem(
                        rs.getBoolean("equipped") ? ItemLocation.valueOf(ItemLocation.EQUIPPED.name()) : ItemLocation.valueOf(ItemLocation.INVENTORY.name()),
                        ItemHolder.getInstance().getTemplate(rs.getInt("item_id")),
                        rs.getInt("count"), (ItemHolder.getInstance().getTemplate(rs.getInt("item_id")).getConsumeType() == ItemConsumeType.PERMANENT) ? 0 : 1,
                        false));
            }
            template = new PlayerCreateTemplate(startmoney, stargp);
            for (PlayerItem item : list)
                template.addPlayerItem(item);


        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            DatabaseUtils.closeDatabaseCSR(con, statement, rs);
        }
        return template;
    }

Code:
int startmoney = 0; 

int stargp = 0;


It's at this location below.

PB SERVER NANDO\pb-global\src\ru\pb\global\dao\impl



Lines 274, 275.



in which part do I edit the cash and gold value that players will create when they create the account?in which part do I edit the cash and gold value that players will create when they create the account?
 
Upvote 0
Newbie Spellweaver
Joined
Jan 9, 2018
Messages
10
Reaction score
0
You edit this bit.
Code:
            int startmoney = 0;
            int stargp = 0;
            List<PlayerItem> list = new ArrayList<PlayerItem>();
            while (rs.next()) {
                if (rs.getInt("item_id") == 0) {
                    startmoney = rs.getInt("startmoney");
                    stargp = rs.getInt("startgp");
                    continue;

in place of 0, I put the value I want in this?
 
Upvote 0
Newbie Spellweaver
Joined
Jan 9, 2018
Messages
10
Reaction score
0
Where did you download it from, as that place might have the database, I'll have a look around for you tho.
where I downloaded what you have is with some problems, if you want to download it to have a look ...
 
Upvote 0
Back
Top