Jump to content

Is bank system also available i rathena?


themon

Recommended Posts


  • Group:  Members
  • Topic Count:  53
  • Topics Per Day:  0.01
  • Content Count:  240
  • Reputation:   40
  • Joined:  04/27/13
  • Last Seen:  


ixv2oo.jpg
 


[spoiler=bank system now available]http://hercules.ws/board/topic/2455-introducing-bank-support/


 
[spoiler=Bank System English Texture by Themon]http://www.mediafire.com/folder/xe8e833gggvde/Bank_System_English_Texture



[spoiler=Bank Texture Update]2iqei2w.jpg

Edited by themon
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  41
  • Topics Per Day:  0.01
  • Content Count:  237
  • Reputation:   19
  • Joined:  06/05/13
  • Last Seen:  

just wait the rAthena developer's decision on this system

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  666
  • Reputation:   93
  • Joined:  04/27/12
  • Last Seen:  

Well currently it's not implemented, however, seeing as how it's been nearly 3months since kRO's release, and Hercules has done most if not all of the leg work, I don't see why we couldn't or shouldn't add this in. I for one would like this added in asap.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  21
  • Topics Per Day:  0.01
  • Content Count:  182
  • Reputation:   22
  • Joined:  12/30/12
  • Last Seen:  

It's an official feature, hopefully it'll soon be here in rAthena! Waiting for this one... but personally, I still like the Banker type NPC. /ok

Edited by Boom
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  53
  • Topics Per Day:  0.01
  • Content Count:  240
  • Reputation:   40
  • Joined:  04/27/13
  • Last Seen:  

I like the stock market NPC more /$ 

http://www.mediafire.com/folder/ivfidqkhb6qdd/Ragnarok_2013_client /gawi/bawi/bo/hmm

 

 

Edited by themon
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  32
  • Topics Per Day:  0.01
  • Content Count:  247
  • Reputation:   207
  • Joined:  10/23/12
  • Last Seen:  

Just marking this as approved for the time being.  If anyone wants to work on a port and provide a diff or a pull request that would make this process go that much faster.

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  81
  • Topics Per Day:  0.02
  • Content Count:  1654
  • Reputation:   583
  • Joined:  08/09/12
  • Last Seen:  

Oooh, I haven't heard about this 'official bank' until I read this post...

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  32
  • Topics Per Day:  0.01
  • Content Count:  247
  • Reputation:   207
  • Joined:  10/23/12
  • Last Seen:  

I am starting to work on this now.

Link to comment
Share on other sites

  • 2 weeks later...

  • Group:  Members
  • Topic Count:  53
  • Topics Per Day:  0.01
  • Content Count:  240
  • Reputation:   40
  • Joined:  04/27/13
  • Last Seen:  

I am starting to work on this now.

this is from Hercules scr

 

 

[spoiler=mmo.h]//Official Limit: 2.1b ( the var that stores the money doesn't go much higher than this by default )

#define MAX_BANK_ZENY 2100000000

struct mmo_charstatus {

int char_id;

int account_id;

int partner_id;

int father;

int mother;

int child;

unsigned int base_exp,job_exp;

int zeny;

int bank_vault;

 

[spoiler=clif.h]enum e_BANKING_DEPOSIT_ACK {

BDA_SUCCESS = 0x0,

BDA_ERROR = 0x1,

BDA_NO_MONEY = 0x2,

BDA_OVERFLOW = 0x3,

};

enum e_BANKING_WITHDRAW_ACK {

BWA_SUCCESS = 0x0,

BWA_NO_MONEY = 0x1,

BWA_UNKNOWN_ERROR = 0x2,

};

/* Bank System [Yommy/Hercules] */

void (*bank_deposit) (struct map_session_data *sd, enum e_BANKING_DEPOSIT_ACK reason);

void (*bank_withdraw) (struct map_session_data *sd,enum e_BANKING_WITHDRAW_ACK reason);

/* Bank System [Yommy/Hercules] */

void (*pBankDeposit) (int fd, struct map_session_data *sd);

void (*pBankWithdraw) (int fd, struct map_session_data *sd);

void (*pBankCheck) (int fd, struct map_session_data *sd);

void (*pBankOpen) (int fd, struct map_session_data *sd);

void (*pBankClose) (int fd, struct map_session_data *sd);

 

[spoiler=clif.c]/* Bank System [Yommy/Hercules] */

void clif_parse_BankDeposit(int fd, struct map_session_data* sd) {

struct packet_banking_deposit_req *p = P2PTR(fd);

int money;

if( !battle_config.feature_banking ) {

clif->colormes(fd,COLOR_RED,msg_txt(1483));

return;

}

money = (int)cap_value(p->Money,0,INT_MAX);

pc->bank_deposit(sd,money);

}

void clif_parse_BankWithdraw(int fd, struct map_session_data* sd) {

struct packet_banking_withdraw_req *p = P2PTR(fd);

int money;

if( !battle_config.feature_banking ) {

clif->colormes(fd,COLOR_RED,msg_txt(1483));

return;

}

money = (int)cap_value(p->Money,0,INT_MAX);

pc->bank_withdraw(sd,money);

}

void clif_parse_BankCheck(int fd, struct map_session_data* sd) {

struct packet_banking_check p;

if( !battle_config.feature_banking ) {

clif->colormes(fd,COLOR_RED,msg_txt(1483));

return;

}

p.PacketType = banking_checkType;

p.Money = (int)sd->status.bank_vault;

p.Reason = (short)0;

clif->send(&p,sizeof(p), &sd->bl, SELF);

}

void clif_parse_BankOpen(int fd, struct map_session_data* sd) {

return;

}

void clif_parse_BankClose(int fd, struct map_session_data* sd) {

return;

}

void clif_bank_deposit(struct map_session_data *sd, enum e_BANKING_DEPOSIT_ACK reason) {

struct packet_banking_deposit_ack p;

p.PacketType = banking_deposit_ackType;

p.Balance = sd->status.zeny;/* how much zeny char has after operation */

p.Money = (int64)sd->status.bank_vault;/* money in the bank */

p.Reason = (short)reason;

clif->send(&p,sizeof(p), &sd->bl, SELF);

}

void clif_bank_withdraw(struct map_session_data *sd,enum e_BANKING_WITHDRAW_ACK reason) {

struct packet_banking_withdraw_ack p;

p.PacketType = banking_withdraw_ackType;

p.Balance = sd->status.zeny;/* how much zeny char has after operation */

p.Money = (int64)sd->status.bank_vault;/* money in the bank */

p.Reason = (short)reason;

clif->send(&p,sizeof(p), &sd->bl, SELF);

}

 

 

 

 

 

 

    /* Bank System [Yommy/Hercules] */

    clif->bank_deposit = clif_bank_deposit;

    clif->bank_withdraw = clif_bank_withdraw;

 

 

 

 

 

    /* Bank System [Yommy/Hercules] */

    clif->pBankDeposit = clif_parse_BankDeposit;

    clif->pBankWithdraw = clif_parse_BankWithdraw;

    clif->pBankCheck = clif_parse_BankCheck;

    clif->pBankOpen = clif_parse_BankOpen;

    clif->pBankClose = clif_parse_BankClose;

 

[spoiler=packets.h]/* Bank System [Yommy/Hercules] */

#if PACKETVER >= 20130724

packet(0x09A6,12); // ZC_BANKING_CHECK

packet(0x09A7,10,clif->pBankDeposit,2,4,6);

packet(0x09A8,16); // ZC_ACK_BANKING_DEPOSIT

packet(0x09A9,10,clif->pBankWithdraw,2,4,6);

packet(0x09AA,16); // ZC_ACK_BANKING_WITHDRAW

packet(0x09AB,6,clif->pBankCheck,2,4);

////

packet(0x09B6,6,clif->pBankOpen,2,4);

packet(0x09B7,4); // ZC_ACK_OPEN_BANKING

packet(0x09B8,6,clif->pBankClose,2,4);

packet(0x09B9,4); // ZC_ACK_CLOSE_BANKING

#endif

 

[spoiler=packets_struct.h]#include "../common/mmo.h"

/**

*

**/

enum packet_headers {

banking_withdraw_ackType = 0x9aa,

banking_deposit_ackType = 0x9a8,

banking_checkType = 0x9a6,

struct packet_banking_check {

short PacketType;

int64 Money;

short Reason;

} __attribute__((packed));

struct packet_banking_deposit_req {

short PacketType;

unsigned int AID;

int Money;

} __attribute__((packed));

struct packet_banking_withdraw_req {

short PacketType;

unsigned int AID;

int Money;

} __attribute__((packed));

struct packet_banking_deposit_ack {

short PacketType;

short Reason;

int64 Money;

int Balance;

} __attribute__((packed));

struct packet_banking_withdraw_ack {

short PacketType;

short Reason;

int64 Money;

int Balance;

} __attribute__((packed));

 

[spoiler=log.h]typedef enum e_log_pick_type {

LOG_TYPE_NONE = 0,

LOG_TYPE_TRADE = 0x00001,

LOG_TYPE_VENDING = 0x00002,

LOG_TYPE_PICKDROP_PLAYER = 0x00004,

LOG_TYPE_PICKDROP_MONSTER = 0x00008,

LOG_TYPE_NPC = 0x00010,

LOG_TYPE_SCRIPT = 0x00020,

LOG_TYPE_STEAL = 0x00040,

LOG_TYPE_CONSUME = 0x00080,

LOG_TYPE_PRODUCE = 0x00100,

LOG_TYPE_MVP = 0x00200,

LOG_TYPE_COMMAND = 0x00400,

LOG_TYPE_STORAGE = 0x00800,

LOG_TYPE_GSTORAGE = 0x01000,

LOG_TYPE_MAIL = 0x02000,

LOG_TYPE_AUCTION = 0x04000,

LOG_TYPE_BUYING_STORE = 0x08000,

LOG_TYPE_OTHER = 0x10000,

LOG_TYPE_BANK = 0x20000,

// combinations

 

[spoiler=log.c]char log_picktype2char(e_log_pick_type type) {

switch( type ) {

case LOG_TYPE_TRADE: return 'T'; // (T)rade

case LOG_TYPE_VENDING: return 'V'; // (V)ending

case LOG_TYPE_PICKDROP_PLAYER: return 'P'; // (P)player

case LOG_TYPE_PICKDROP_MONSTER: return 'M'; // (M)onster

case LOG_TYPE_NPC: return 'S'; // NPC (S)hop

case LOG_TYPE_SCRIPT: return 'N'; // (N)PC Script

case LOG_TYPE_STEAL: return 'D'; // Steal/Snatcher

case LOG_TYPE_CONSUME: return 'C'; // ©onsumed

case LOG_TYPE_PRODUCE: return 'O'; // Pr(O)duced/Ingredients

case LOG_TYPE_MVP: return 'U'; // MVP Rewards

case LOG_TYPE_COMMAND: return 'A'; // (A)dmin command

case LOG_TYPE_STORAGE: return 'R'; // Sto®age

case LOG_TYPE_GSTORAGE: return 'G'; // (G)uild storage

case LOG_TYPE_MAIL: return 'E'; // (E)mail attachment

case LOG_TYPE_AUCTION: return 'I'; // Auct(I)on

case LOG_TYPE_BUYING_STORE: return 'B'; // (B)uying Store

case LOG_TYPE_LOOT: return 'L'; // (L)oot (consumed monster pick/drop)

case LOG_TYPE_BANK: return 'K'; // Ban(K) Transactions

case LOG_TYPE_OTHER: return 'X'; // Other

}

 

[spoiler=logs.conf ]

// 0x08000 - (B) Log buying store transactions

// 0x20000 - (K) Log account bank transactions

// 0x10000 - (X) Log all other transactions (rentals expiring/inserting cards/items removed by item_check/

 

[spoiler=char.c] if( p->bank_vault != cp->bank_vault ) {

if( SQL_ERROR == SQL->Query(sql_handle, "REPLACE INTO `%s` (`account_id`,`bank_vault`) VALUES ('%d','%d')",account_data_db,p->account_id,p->bank_vault) ) {

Sql_ShowDebug(sql_handle);

errors++;

} else

strcat(save_status, " bank");

}

 

[spoiler=pc.h] void (*bank_deposit) (struct map_session_data *sd, int money);

void (*bank_withdraw) (struct map_session_data *sd, int money);

 

[spoiler=main.sql]

`account_id` int(11) unsigned NOT NULL default '0',

`bank_vault` int(11) unsigned NOT NULL default '0',

PRIMARY KEY (`account_id`)

) ENGINE=MyISAM;

 

[spoiler=upgrades/2013-10-10--16-36.sql ]

`account_id` int(11) unsigned NOT NULL default '0',

`bank_vault` int(11) unsigned NOT NULL default '0',

PRIMARY KEY (`account_id`)

Edited by themon
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  32
  • Topics Per Day:  0.01
  • Content Count:  247
  • Reputation:   207
  • Joined:  10/23/12
  • Last Seen:  

Bank system was completed in 1290826 thanks to Lighta.  Please make sure to run the sql query in the file (currently svn17600).  The name should be changed sometime soon to reflect GIT.

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  737
  • Reputation:   216
  • Joined:  11/29/11
  • Last Seen:  

svn17600 is an awesome name reflecting to nothing but eh it was pretty.

Some note to that system :

-There currectly no safecheck wheater the update was correctly done in char or login.

This could lead to some zeny exploits. But don't worry there much chance to lose money trying to do so then gaining some.

Anyway will work on it. Or if you feel like doing so please propose your fix as a pull request.

  • Upvote 1
Link to comment
Share on other sites

×
×
  • Create New...