summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorglighta <glighta@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-11-22 01:13:28 +0000
committerglighta <glighta@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-11-22 01:13:28 +0000
commit078fe1c3ff072c85ca14a3465b0fc9d8a523711f (patch)
treea5673dc034fe5beafa040810683a09d509006032 /src
parent88a2f6741ec3aee559495a219d499ecc3425a3f1 (diff)
downloadhercules-078fe1c3ff072c85ca14a3465b0fc9d8a523711f.tar.gz
hercules-078fe1c3ff072c85ca14a3465b0fc9d8a523711f.tar.bz2
hercules-078fe1c3ff072c85ca14a3465b0fc9d8a523711f.tar.xz
hercules-078fe1c3ff072c85ca14a3465b0fc9d8a523711f.zip
-Apply EvilPuncker path from tid:71756
-Fix and upd logzeny enumeration type bugreport:6897 -Upd @zeny to send a message when succed bugreport:6886 -Upd ChaosPanic to affect all bugreport:6893 -Upd bloodylust cooldown and disable endure effect bugreport:6547 git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16940 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/atcommand.c7
-rw-r--r--src/map/clif.c4
-rw-r--r--src/map/mob.c2
-rw-r--r--src/map/pc.c14
-rw-r--r--src/map/skill.c12
-rw-r--r--src/map/status.c14
6 files changed, 30 insertions, 23 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 891fb1a79..abdd8267e 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -2526,7 +2526,7 @@ ACMD_FUNC(skillpoint)
*------------------------------------------*/
ACMD_FUNC(zeny)
{
- int zeny;
+ int zeny=0, ret=-1;
nullpo_retr(-1, sd);
if (!message || !*message || (zeny = atoi(message)) == 0) {
@@ -2535,12 +2535,13 @@ ACMD_FUNC(zeny)
}
if(zeny > 0){
- if(pc_getzeny(sd,zeny,LOG_TYPE_COMMAND,NULL) == 1)
+ if((ret=pc_getzeny(sd,zeny,LOG_TYPE_COMMAND,NULL)) == 1)
clif_displaymessage(fd, msg_txt(149)); // Unable to increase the number/value.
}
- else if(pc_payzeny(sd,-zeny,LOG_TYPE_COMMAND,NULL) == 1){
+ else if((ret=pc_payzeny(sd,-zeny,LOG_TYPE_COMMAND,NULL)) == 1){
clif_displaymessage(fd, msg_txt(41)); // Unable to decrease the number/value.
}
+ if(!ret) clif_displaymessage(fd, msg_txt(176)); //ret=0 mean cmd success
return 0;
}
diff --git a/src/map/clif.c b/src/map/clif.c
index 3b5dc0f57..746a12a75 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -10179,8 +10179,8 @@ void clif_parse_UseItem(int fd, struct map_session_data *sd)
if (sd->npc_id) {
if (sd->npc_id != sd->npc_item_flag)
return;
- } else
- if (pc_istrading(sd))
+ }
+ else if (pc_istrading(sd))
return;
//Whether the item is used or not is irrelevant, the char ain't idle. [Skotlex]
diff --git a/src/map/mob.c b/src/map/mob.c
index 56be06b2d..b5db08038 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -2436,7 +2436,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
if( sd->bonus.get_zeny_num && rnd()%100 < sd->bonus.get_zeny_rate ) {
i = sd->bonus.get_zeny_num > 0 ? sd->bonus.get_zeny_num : -md->level * sd->bonus.get_zeny_num;
if (!i) i = 1;
- pc_getzeny(sd, 1+rnd()%i, LOG_TYPE_OTHER, NULL);
+ pc_getzeny(sd, 1+rnd()%i, LOG_TYPE_PICKDROP_MONSTER, NULL);
}
}
diff --git a/src/map/pc.c b/src/map/pc.c
index 2b9401841..abb99a865 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -3588,7 +3588,7 @@ int pc_inventoryblank(struct map_session_data *sd)
*------------------------------------------*/
int pc_payzeny(struct map_session_data *sd,int zeny, enum e_log_pick_type type, struct map_session_data *tsd)
{
- nullpo_ret(sd);
+ nullpo_retr(-1,sd);
zeny = cap_value(zeny,-MAX_ZENY,MAX_ZENY); //prevent command UB
if( zeny < 0 )
@@ -3716,7 +3716,7 @@ int pc_getcash(struct map_session_data *sd, int cash, int points)
*------------------------------------------*/
int pc_getzeny(struct map_session_data *sd,int zeny, enum e_log_pick_type type, struct map_session_data *tsd)
{
- nullpo_ret(sd);
+ nullpo_retr(-1,sd);
zeny = cap_value(zeny,-MAX_ZENY,MAX_ZENY); //prevent command UB
if( zeny < 0 )
@@ -3848,6 +3848,10 @@ int pc_additem(struct map_session_data *sd,struct item *item_data,int amount,e_l
/*==========================================
* Remove an item at index n from inventory by amount.
+ * Parameters :
+ * @type
+ * 1 : don't notify deletion
+ * 2 : don't notify weight change
* Return:
* 0 = success
* 1 = invalid itemid or negative amount
@@ -4200,7 +4204,7 @@ int pc_useitem(struct map_session_data *sd,int n)
/* Items with delayed consume are not meant to work while in mounts except reins of mount(12622) */
if( sd->inventory_data[n]->flag.delay_consume ) {
- if( nameid != 12622 && sd->sc.option&OPTION_MOUNTING )
+ if( nameid != ITEMID_REINS_OF_MOUNT && sd->sc.option&OPTION_MOUNTING )
return 0;
else if( pc_issit(sd) )
return 0;
@@ -6661,7 +6665,7 @@ int pc_dead(struct map_session_data *sd,struct block_list *src)
{
base_penalty = (unsigned int)((double)sd->status.zeny * (double)battle_config.zeny_penalty / 10000.);
if(base_penalty)
- pc_payzeny(sd, base_penalty, LOG_TYPE_OTHER, NULL); //@TODO that type suck
+ pc_payzeny(sd, base_penalty, LOG_TYPE_PICKDROP_PLAYER, NULL);
}
}
@@ -6871,7 +6875,7 @@ int pc_setparam(struct map_session_data *sd,int type,int val)
case SP_ZENY:
if( val < 0 )
return 0;// can't set negative zeny
- log_zeny(sd, LOG_TYPE_NPC, sd, -(sd->status.zeny - cap_value(val, 0, MAX_ZENY)));
+ log_zeny(sd, LOG_TYPE_SCRIPT, sd, -(sd->status.zeny - cap_value(val, 0, MAX_ZENY)));
sd->status.zeny = cap_value(val, 0, MAX_ZENY);
break;
case SP_BASEEXP:
diff --git a/src/map/skill.c b/src/map/skill.c
index ad6ef2b45..c24ffc8c1 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -5003,7 +5003,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
break;
case SA_FORTUNE:
clif_skill_nodamage(src,bl,skillid,skilllv,1);
- if(sd) pc_getzeny(sd,status_get_lv(bl)*100,LOG_TYPE_OTHER,NULL);
+ if(sd) pc_getzeny(sd,status_get_lv(bl)*100,LOG_TYPE_STEAL,NULL);
break;
case SA_TAMINGMONSTER:
clif_skill_nodamage(src,bl,skillid,skilllv,1);
@@ -10980,10 +10980,12 @@ static int skill_unit_onplace (struct skill_unit *src, struct block_list *bl, un
if (!sce) {
TBL_PC *sd = BL_CAST(BL_PC, bl); //prevent fullheal exploit
if (sd && sd->bloodylust_tick && DIFF_TICK(gettick(), sd->bloodylust_tick) < skill_get_time2(SC_BLOODYLUST, 1))
- sc_start4(bl, type, 100, sg->skill_lv, 1, 0, 0, skill_get_time(LK_BERSERK, sg->skill_lv)); //do not refull heal
+ clif_skill_nodamage(&src->bl,bl,sg->skill_id,sg->skill_lv,
+ sc_start4(bl, type, 100, sg->skill_lv, 1, 0, 0, skill_get_time(LK_BERSERK, sg->skill_lv)));
else {
if (sd) sd->bloodylust_tick = gettick();
- sc_start4(bl, type, 100, sg->skill_lv, 0, 0, 0, skill_get_time(LK_BERSERK, sg->skill_lv));
+ clif_skill_nodamage(&src->bl,bl,sg->skill_id,sg->skill_lv,
+ sc_start4(bl, type, 100, sg->skill_lv, 0, 0, 0, skill_get_time(LK_BERSERK, sg->skill_lv)));
}
}
break;
@@ -13288,7 +13290,7 @@ int skill_consume_requirement( struct map_session_data *sd, short skill, short l
req.zeny = 0; //Zeny is reduced on skill_attack.
if( sd->status.zeny < req.zeny )
req.zeny = sd->status.zeny;
- pc_payzeny(sd,req.zeny,LOG_TYPE_OTHER,NULL); //@Need proper type
+ pc_payzeny(sd,req.zeny,LOG_TYPE_CONSUME,NULL);
}
}
@@ -17791,7 +17793,7 @@ void skill_reload (void) {
for( sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); sd = (TBL_PC*)mapit_next(iter) )
clif_skillinfoblock(sd);
mapit_free(iter);
-
+
}
/*==========================================
diff --git a/src/map/status.c b/src/map/status.c
index 68b7498fc..5fae9350f 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -7471,10 +7471,10 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
sc_start(bl,SC_BLEEDING,100,val1,skill_get_time2(status_sc2skill(type),val1));
break;
- case SC__BLOODYLUST:
case SC_BERSERK:
if (!sc->data[SC_ENDURE] || !sc->data[SC_ENDURE]->val4)
sc_start4(bl, SC_ENDURE, 100,10,0,0,2, tick);
+ case SC__BLOODYLUST:
//HP healing is performing after the calc_status call.
//Val2 holds HP penalty
if (!val4) val4 = skill_get_time2(status_sc2skill(type),val1);
@@ -8609,10 +8609,10 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
sc->opt3 |= OPT3_AURABLADE;
opt_flag = 0;
break;
-// case SC__BLOODYLUST:
case SC_BERSERK:
- sc->opt3 |= OPT3_BERSERK;
opt_flag = 0;
+// case SC__BLOODYLUST:
+ sc->opt3 |= OPT3_BERSERK;
break;
// case ???: // doesn't seem to do anything
// sc->opt3 |= OPT3_LIGHTBLADE;
@@ -9240,17 +9240,17 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const
}
break;
- case SC__BLOODYLUST:
case SC_BERSERK:
case SC_SATURDAYNIGHTFEVER:
//If val2 is removed, no HP penalty (dispelled?) [Skotlex]
- if (status->hp > 100 && sce->val2 && type != SC__BLOODYLUST)
+ if (status->hp > 100 && sce->val2)
status_set_hp(bl, 100, 0);
if(sc->data[SC_ENDURE] && sc->data[SC_ENDURE]->val4 == 2)
{
sc->data[SC_ENDURE]->val4 = 0;
status_change_end(bl, SC_ENDURE, INVALID_TIMER);
}
+ case SC__BLOODYLUST:
sc_start4(bl, SC_REGENERATION, 100, 10,0,0,(RGN_HP|RGN_SP), skill_get_time(LK_BERSERK, sce->val1));
if( type == SC_SATURDAYNIGHTFEVER ) //Sit down force of Saturday Night Fever has the duration of only 3 seconds.
sc_start(bl,SC_SITDOWN_FORCE,100,sce->val1,skill_get_time2(WM_SATURDAY_NIGHT_FEVER,sce->val1));
@@ -9531,10 +9531,10 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const
sc->opt3 &= ~OPT3_AURABLADE;
opt_flag = 0;
break;
-// case SC__BLOODYLUST:
case SC_BERSERK:
- sc->opt3 &= ~OPT3_BERSERK;
opt_flag = 0;
+// case SC__BLOODYLUST:
+ sc->opt3 &= ~OPT3_BERSERK;
break;
// case ???: // doesn't seem to do anything
// sc->opt3 &= ~OPT3_LIGHTBLADE;