* Random accumulated bits and pieces.
- Added checks/warnings to pc_paycash and pc_getcash (follow up to r12264). - Added missing packet_db.txt and packet length table entries for packet 0x0859 (follow up to r14799). - Added set of map_id2xx wrappers for map_id2bl for most common map objects, which return NULL when the bl-type is not the expected one (also updated map_id2nd to behave this way). - Fixed missing ',' in mob_skill_db.txt example (follow up to r14270). - Updated mapcache with recent maps (up to que_lhz). - Functions 'msg_txt' and 'job_name' now return a const pointer. git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14813 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
parent
88785ac802
commit
9d505aed9b
@ -1,5 +1,13 @@
|
||||
Date Added
|
||||
|
||||
2011/05/13
|
||||
* Random accumulated bits and pieces. [Ai4rei]
|
||||
- Added checks/warnings to pc_paycash and pc_getcash (follow up to r12264).
|
||||
- Added missing packet_db.txt and packet length table entries for packet 0x0859 (follow up to r14799).
|
||||
- Added set of map_id2xx wrappers for map_id2bl for most common map objects, which return NULL when the bl-type is not the expected one (also updated map_id2nd to behave this way).
|
||||
- Fixed missing ',' in mob_skill_db.txt example (follow up to r14270).
|
||||
- Updated mapcache with recent maps (up to que_lhz).
|
||||
- Functions 'msg_txt' and 'job_name' now return a const pointer.
|
||||
2011/05/08
|
||||
* Script command 'query_logsql' now throws a warning when SQL logs are disabled (related r11892). [Ai4rei]
|
||||
* Updated/revised description of instance-related script commands (bugreport:4880). [Ai4rei]
|
||||
|
@ -679,6 +679,10 @@ map: tha_t12
|
||||
map: auction_01
|
||||
map: auction_02
|
||||
|
||||
// ???
|
||||
// -- 2005-12-06gdata_k.gpf
|
||||
alde_tt03
|
||||
|
||||
// --- Garden City Hugel / Kiehl ---
|
||||
// -- 2005-12-20sdata_k.gpf --
|
||||
map: hugel
|
||||
@ -989,6 +993,20 @@ map: iz_dun05
|
||||
// -- 2010-12-01data_x.gpf
|
||||
map: evt_mobroom
|
||||
|
||||
// ???
|
||||
map: dic_dun03
|
||||
//map: mjolnir_04_1
|
||||
//map: evt_swar_b
|
||||
//map: evt_swar_r
|
||||
//map: evt_swar_s
|
||||
//map: evt_swar_t
|
||||
|
||||
// Lighthalzen Dungeon F4, Wolfchev's Laboratory
|
||||
// -- 2011-03-16rdata_x.gpf
|
||||
map: 1@lhz
|
||||
map: lhz_dun04
|
||||
map: que_lhz
|
||||
|
||||
//------------------------- Clone Maps ---------------------------
|
||||
//------------------------- Extra Maps ---------------------------
|
||||
|
||||
|
BIN
db/map_cache.dat
BIN
db/map_cache.dat
Binary file not shown.
@ -810,6 +810,16 @@ mal_dun01
|
||||
1@cash
|
||||
iz_dun05
|
||||
evt_mobroom
|
||||
alde_tt03
|
||||
dic_dun03
|
||||
//mjolnir_04_1
|
||||
//evt_swar_b
|
||||
//evt_swar_r
|
||||
//evt_swar_s
|
||||
//evt_swar_t
|
||||
1@lhz
|
||||
lhz_dun04
|
||||
que_lhz
|
||||
|
||||
// Only add maps under this line if they are not standard maps!
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
//MOB_ID,dummy value (info only),STATE,SKILL_ID,SKILL_LV,rate (10000 = 100%),casttime,delay,cancelable,target,condition type,condition value,val1,val2,val3,val4,val5,emotion,chat
|
||||
//Example
|
||||
//1001,Poring@TF_POISON,attack,52,3,100,1500,10000,no,target,always,0,,,,,7
|
||||
//1001,Poring@TF_POISON,attack,52,3,100,1500,10000,no,target,always,0,,,,,7,
|
||||
//
|
||||
//rate refers to the chance of the skill being casted when the condition is fulfilled.
|
||||
//delay is the time in milliseconds that has to be pass before recasting the same skill.
|
||||
|
@ -1603,6 +1603,7 @@ packet_ver: 26
|
||||
0x0856,-1
|
||||
0x0857,-1
|
||||
0x0858,-1
|
||||
0x0859,-1
|
||||
|
||||
//Add new packets here
|
||||
//packet_ver: 27
|
||||
|
@ -89,7 +89,7 @@ int lowtohigh_compare (const void * a, const void * b)
|
||||
//-----------------------------------------------------------
|
||||
// Return the message string of the specified number by [Yor]
|
||||
//-----------------------------------------------------------
|
||||
char* msg_txt(int msg_number)
|
||||
const char* msg_txt(int msg_number)
|
||||
{
|
||||
if (msg_number >= 0 && msg_number < MAX_MSG &&
|
||||
msg_table[msg_number] != NULL && msg_table[msg_number][0] != '\0')
|
||||
@ -5753,7 +5753,7 @@ ACMD_FUNC(skilltree)
|
||||
struct map_session_data *pl_sd = NULL;
|
||||
int skillnum;
|
||||
int meets, j, c=0;
|
||||
char target[NAME_LENGTH], *tbl;
|
||||
char target[NAME_LENGTH];
|
||||
struct skill_tree_entry *ent;
|
||||
nullpo_retr(-1, sd);
|
||||
|
||||
@ -5771,9 +5771,7 @@ ACMD_FUNC(skilltree)
|
||||
c = pc_calc_skilltree_normalize_job(pl_sd);
|
||||
c = pc_mapid2jobid(c, pl_sd->status.sex);
|
||||
|
||||
tbl = job_name(c);
|
||||
|
||||
sprintf(atcmd_output, "Player is using %s skill tree (%d basic points)", tbl, pc_checkskill(pl_sd, 1));
|
||||
sprintf(atcmd_output, "Player is using %s skill tree (%d basic points)", job_name(c), pc_checkskill(pl_sd, 1));
|
||||
clif_displaymessage(fd, atcmd_output);
|
||||
|
||||
ARR_FIND( 0, MAX_SKILL_TREE, j, skill_tree[c][j].id == 0 || skill_tree[c][j].id == skillnum );
|
||||
|
@ -41,7 +41,7 @@ int atcommand_killmonster(const int fd, struct map_session_data* sd, const char*
|
||||
|
||||
#define MAX_MSG 1000
|
||||
extern char* msg_table[MAX_MSG];
|
||||
char* msg_txt(int msg_number);
|
||||
const char* msg_txt(int msg_number);
|
||||
int msg_config_read(const char* cfgName);
|
||||
void do_final_msg(void);
|
||||
|
||||
|
@ -9692,7 +9692,8 @@ void clif_parse_ChatLeave(int fd, struct map_session_data* sd)
|
||||
//0:
|
||||
static void clif_noask_sub(struct map_session_data *src, struct map_session_data *target, int type)
|
||||
{
|
||||
char *msg, output[256];
|
||||
const char* msg;
|
||||
char output[256];
|
||||
// Your request has been rejected by autoreject option.
|
||||
msg = msg_txt(392);
|
||||
clif_disp_onlyself(src, msg, strlen(msg));
|
||||
@ -15029,7 +15030,7 @@ static int packetdb_readdb(void)
|
||||
0, 0, 0, 0, 0, -1, -1, 3, 2, 66, 5, 2, 12, 6, 0, 0,
|
||||
//#0x0840
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
};
|
||||
|
@ -1659,8 +1659,30 @@ struct mob_data * map_id2md(int id)
|
||||
|
||||
struct npc_data * map_id2nd(int id)
|
||||
{// just a id2bl lookup because there's no npc_db
|
||||
if (id <= 0) return NULL;
|
||||
return (struct npc_data*)map_id2bl(id);
|
||||
struct block_list* bl = map_id2bl(id);
|
||||
|
||||
return BL_CAST(BL_NPC, bl);
|
||||
}
|
||||
|
||||
struct homun_data* map_id2hd(int id)
|
||||
{
|
||||
struct block_list* bl = map_id2bl(id);
|
||||
|
||||
return BL_CAST(BL_HOM, bl);
|
||||
}
|
||||
|
||||
struct mercenary_data* map_id2mc(int id)
|
||||
{
|
||||
struct block_list* bl = map_id2bl(id);
|
||||
|
||||
return BL_CAST(BL_MER, bl);
|
||||
}
|
||||
|
||||
struct chat_data* map_id2cd(int id)
|
||||
{
|
||||
struct block_list* bl = map_id2bl(id);
|
||||
|
||||
return BL_CAST(BL_CHAT, bl);
|
||||
}
|
||||
|
||||
/// Returns the nick of the target charid or NULL if unknown (requests the nick to the char server).
|
||||
|
@ -584,6 +584,9 @@ struct map_session_data* map_charid2sd(int charid);
|
||||
struct map_session_data * map_id2sd(int id);
|
||||
struct mob_data * map_id2md(int id);
|
||||
struct npc_data * map_id2nd(int id);
|
||||
struct homun_data* map_id2hd(int id);
|
||||
struct mercenary_data* map_id2mc(int id);
|
||||
struct chat_data* map_id2cd(int id);
|
||||
struct block_list * map_id2bl(int id);
|
||||
|
||||
#define map_id2index(id) map[(id)].index
|
||||
|
52
src/map/pc.c
52
src/map/pc.c
@ -3263,11 +3263,31 @@ int pc_payzeny(struct map_session_data *sd,int zeny)
|
||||
void pc_paycash(struct map_session_data *sd, int price, int points)
|
||||
{
|
||||
char output[128];
|
||||
int cash = price - points;
|
||||
int cash;
|
||||
nullpo_retv(sd);
|
||||
|
||||
pc_setaccountreg(sd,"#CASHPOINTS",sd->cashPoints - cash);
|
||||
pc_setaccountreg(sd,"#KAFRAPOINTS",sd->kafraPoints - points);
|
||||
if( price < 0 || points < 0 )
|
||||
{
|
||||
ShowError("pc_paycash: Paying negative points (price=%d, points=%d, account_id=%d, char_id=%d).\n", price, points, sd->status.account_id, sd->status.char_id);
|
||||
return;
|
||||
}
|
||||
|
||||
if( points > price )
|
||||
{
|
||||
ShowWarning("pc_paycash: More kafra points provided than needed (price=%d, points=%d, account_id=%d, char_id=%d).\n", price, points, sd->status.account_id, sd->status.char_id);
|
||||
points = price;
|
||||
}
|
||||
|
||||
cash = price-points;
|
||||
|
||||
if( sd->cashPoints < cash || sd->kafraPoints < points )
|
||||
{
|
||||
ShowError("pc_paycash: Not enough points (cash=%d, kafra=%d) to cover the price (cash=%d, kafra=%d) (account_id=%d, char_id=%d).\n", sd->cashPoints, sd->kafraPoints, cash, points, sd->status.account_id, sd->status.char_id);
|
||||
return;
|
||||
}
|
||||
|
||||
pc_setaccountreg(sd, "#CASHPOINTS", sd->cashPoints-cash);
|
||||
pc_setaccountreg(sd, "#KAFRAPOINTS", sd->kafraPoints-points);
|
||||
|
||||
if( battle_config.cashshop_show_points )
|
||||
{
|
||||
@ -3283,7 +3303,13 @@ void pc_getcash(struct map_session_data *sd, int cash, int points)
|
||||
|
||||
if( cash > 0 )
|
||||
{
|
||||
pc_setaccountreg(sd,"#CASHPOINTS",sd->cashPoints + cash);
|
||||
if( cash > MAX_ZENY-sd->cashPoints )
|
||||
{
|
||||
ShowWarning("pc_getcash: Cash point overflow (cash=%d, have cash=%d, account_id=%d, char_id=%d).\n", cash, sd->cashPoints, sd->status.account_id, sd->status.char_id);
|
||||
cash = MAX_ZENY-sd->cashPoints;
|
||||
}
|
||||
|
||||
pc_setaccountreg(sd, "#CASHPOINTS", sd->cashPoints+cash);
|
||||
|
||||
if( battle_config.cashshop_show_points )
|
||||
{
|
||||
@ -3291,10 +3317,20 @@ void pc_getcash(struct map_session_data *sd, int cash, int points)
|
||||
clif_disp_onlyself(sd, output, strlen(output));
|
||||
}
|
||||
}
|
||||
else if( cash < 0 )
|
||||
{
|
||||
ShowError("pc_getcash: Obtaining negative cash points (cash=%d, account_id=%d, char_id=%d).\n", cash, sd->status.account_id, sd->status.char_id);
|
||||
}
|
||||
|
||||
if( points > 0 )
|
||||
{
|
||||
pc_setaccountreg(sd,"#KAFRAPOINTS",sd->kafraPoints + points);
|
||||
if( points > MAX_ZENY-sd->kafraPoints )
|
||||
{
|
||||
ShowWarning("pc_getcash: Kafra point overflow (points=%d, have points=%d, account_id=%d, char_id=%d).\n", points, sd->kafraPoints, sd->status.account_id, sd->status.char_id);
|
||||
points = MAX_ZENY-sd->kafraPoints;
|
||||
}
|
||||
|
||||
pc_setaccountreg(sd, "#KAFRAPOINTS", sd->kafraPoints+points);
|
||||
|
||||
if( battle_config.cashshop_show_points )
|
||||
{
|
||||
@ -3302,6 +3338,10 @@ void pc_getcash(struct map_session_data *sd, int cash, int points)
|
||||
clif_disp_onlyself(sd, output, strlen(output));
|
||||
}
|
||||
}
|
||||
else if( points < 0 )
|
||||
{
|
||||
ShowError("pc_getcash: Obtaining negative kafra points (points=%d, account_id=%d, char_id=%d).\n", points, sd->status.account_id, sd->status.char_id);
|
||||
}
|
||||
}
|
||||
|
||||
/*==========================================
|
||||
@ -4608,7 +4648,7 @@ int pc_mapid2jobid(unsigned short class_, int sex)
|
||||
/*====================================================
|
||||
* This function return the name of the job (by [Yor])
|
||||
*----------------------------------------------------*/
|
||||
char* job_name(int class_)
|
||||
const char* job_name(int class_)
|
||||
{
|
||||
switch (class_) {
|
||||
case JOB_NOVICE:
|
||||
|
@ -727,7 +727,7 @@ int pc_candrop(struct map_session_data *sd,struct item *item);
|
||||
int pc_jobid2mapid(unsigned short b_class); // Skotlex
|
||||
int pc_mapid2jobid(unsigned short class_, int sex); // Skotlex
|
||||
|
||||
char * job_name(int class_);
|
||||
const char * job_name(int class_);
|
||||
|
||||
struct skill_tree_entry {
|
||||
short id;
|
||||
|
@ -4780,7 +4780,7 @@ BUILDIN_FUNC(jobchange)
|
||||
BUILDIN_FUNC(jobname)
|
||||
{
|
||||
int class_=script_getnum(st,2);
|
||||
script_pushconststr(st,job_name(class_));
|
||||
script_pushconststr(st, (char*)job_name(class_));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user