summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
Diffstat (limited to 'src/map')
-rw-r--r--src/map/clif.c56
-rw-r--r--src/map/map.h2
-rw-r--r--src/map/pc.c2
-rw-r--r--src/map/skill.c88
-rw-r--r--src/map/unit.c2
5 files changed, 77 insertions, 73 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index c79305fc3..792862f85 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -2959,7 +2959,7 @@ int clif_arrow_create_list(struct map_session_data *sd)
WFIFOSET(fd, WFIFOW(fd,2));
if (c > 0) {
sd->menuskill_id = AC_MAKINGARROW;
- sd->menuskill_lv = c;
+ sd->menuskill_val = c;
}
return 0;
@@ -4676,9 +4676,9 @@ int clif_skill_warppoint(struct map_session_data* sd, int skill_num, int skill_l
sd->menuskill_id = skill_num;
if (skill_num == AL_WARP)
- sd->menuskill_lv = (sd->ud.skillx<<16)|sd->ud.skilly; //Store warp position here.
+ sd->menuskill_val = (sd->ud.skillx<<16)|sd->ud.skilly; //Store warp position here.
else
- sd->menuskill_lv = skill_lv;
+ sd->menuskill_val = skill_lv;
return 0;
}
/*==========================================
@@ -4778,7 +4778,7 @@ int clif_skill_produce_mix_list(struct map_session_data *sd, int trigger)
WFIFOSET(fd,WFIFOW(fd,2));
if(c > 0) {
sd->menuskill_id = AM_PHARMACY;
- sd->menuskill_lv = trigger;
+ sd->menuskill_val = trigger;
return 1;
}
return 0;
@@ -5229,7 +5229,7 @@ int clif_item_identify_list(struct map_session_data *sd)
WFIFOW(fd,2)=c*2+4;
WFIFOSET(fd,WFIFOW(fd,2));
sd->menuskill_id = MC_IDENTIFY;
- sd->menuskill_lv = c;
+ sd->menuskill_val = c;
}
return 0;
}
@@ -5282,7 +5282,7 @@ int clif_item_repair_list(struct map_session_data *sd,struct map_session_data *d
WFIFOW(fd,2)=c*13+4;
WFIFOSET(fd,WFIFOW(fd,2));
sd->menuskill_id = BS_REPAIRWEAPON;
- sd->menuskill_lv = dstsd->bl.id;
+ sd->menuskill_val = dstsd->bl.id;
}else
clif_skill_fail(sd,sd->ud.skillid,0,0);
@@ -5347,7 +5347,7 @@ int clif_item_refine_list(struct map_session_data *sd)
WFIFOSET(fd,WFIFOW(fd,2));
if (c > 0) {
sd->menuskill_id = WS_WEAPONREFINE;
- sd->menuskill_lv = skilllv;
+ sd->menuskill_val = skilllv;
}
return 0;
}
@@ -6086,7 +6086,7 @@ int clif_sendegg(struct map_session_data *sd)
WFIFOSET(fd,WFIFOW(fd,2));
sd->menuskill_id = SA_TAMINGMONSTER;
- sd->menuskill_lv = -1;
+ sd->menuskill_val = -1;
return 0;
}
@@ -6243,7 +6243,7 @@ int clif_autospell(struct map_session_data *sd,int skilllv)
WFIFOSET(fd,packet_len(0x1cd));
sd->menuskill_id = SA_AUTOSPELL;
- sd->menuskill_lv = skilllv;
+ sd->menuskill_val = skilllv;
return 0;
}
@@ -9508,7 +9508,7 @@ void clif_parse_UseSkillToId(int fd, struct map_session_data *sd)
if(sd->menuskill_id)
{
if (sd->menuskill_id == SA_TAMINGMONSTER)
- sd->menuskill_id = sd->menuskill_lv = 0; //Cancel pet capture.
+ sd->menuskill_id = sd->menuskill_val = 0; //Cancel pet capture.
else
if (sd->menuskill_id != SA_AUTOSPELL)
return; //Can't use skills while a menu is open.
@@ -9611,7 +9611,7 @@ void clif_parse_UseSkillToPosSub(int fd, struct map_session_data *sd, int skilll
if(sd->menuskill_id)
{
if (sd->menuskill_id == SA_TAMINGMONSTER)
- sd->menuskill_id = sd->menuskill_lv = 0; //Cancel pet capture.
+ sd->menuskill_id = sd->menuskill_val = 0; //Cancel pet capture.
else
if (sd->menuskill_id != SA_AUTOSPELL)
return; //Can't use skills while a menu is open.
@@ -9678,7 +9678,7 @@ void clif_parse_UseSkillMap(int fd,struct map_session_data *sd)
if (clif_cant_act(sd))
{
- sd->menuskill_id = sd->menuskill_lv = 0;
+ sd->menuskill_id = sd->menuskill_val = 0;
return;
}
@@ -9704,11 +9704,11 @@ void clif_parse_ProduceMix(int fd,struct map_session_data *sd)
if (clif_trading(sd)) {
//Make it fail to avoid shop exploits where you sell something different than you see.
clif_skill_fail(sd,sd->ud.skillid,0,0);
- sd->menuskill_lv = sd->menuskill_id = 0;
+ sd->menuskill_val = sd->menuskill_id = 0;
return;
}
skill_produce_mix(sd,0,RFIFOW(fd,2),RFIFOW(fd,4),RFIFOW(fd,6),RFIFOW(fd,8), 1);
- sd->menuskill_lv = sd->menuskill_id = 0;
+ sd->menuskill_val = sd->menuskill_id = 0;
}
/*==========================================
* 武器修理
@@ -9720,11 +9720,11 @@ void clif_parse_RepairItem(int fd, struct map_session_data *sd)
if (clif_trading(sd)) {
//Make it fail to avoid shop exploits where you sell something different than you see.
clif_skill_fail(sd,sd->ud.skillid,0,0);
- sd->menuskill_lv = sd->menuskill_id = 0;
+ sd->menuskill_val = sd->menuskill_id = 0;
return;
}
skill_repairweapon(sd,RFIFOW(fd,2));
- sd->menuskill_lv = sd->menuskill_id = 0;
+ sd->menuskill_val = sd->menuskill_id = 0;
}
/*==========================================
@@ -9739,12 +9739,12 @@ void clif_parse_WeaponRefine(int fd, struct map_session_data *sd)
if (clif_trading(sd)) {
//Make it fail to avoid shop exploits where you sell something different than you see.
clif_skill_fail(sd,sd->ud.skillid,0,0);
- sd->menuskill_lv = sd->menuskill_id = 0;
+ sd->menuskill_val = sd->menuskill_id = 0;
return;
}
idx = RFIFOW(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[0]);
skill_weaponrefine(sd, idx-2);
- sd->menuskill_lv = sd->menuskill_id = 0;
+ sd->menuskill_val = sd->menuskill_id = 0;
}
/*==========================================
@@ -9821,7 +9821,7 @@ void clif_parse_ItemIdentify(int fd,struct map_session_data *sd)
if (sd->menuskill_id != MC_IDENTIFY)
return;
skill_identify(sd,RFIFOW(fd,2)-2);
- sd->menuskill_lv = sd->menuskill_id = 0;
+ sd->menuskill_val = sd->menuskill_id = 0;
}
/*==========================================
* 矢作成
@@ -9833,11 +9833,11 @@ void clif_parse_SelectArrow(int fd,struct map_session_data *sd)
if (clif_trading(sd)) {
//Make it fail to avoid shop exploits where you sell something different than you see.
clif_skill_fail(sd,sd->ud.skillid,0,0);
- sd->menuskill_lv = sd->menuskill_id = 0;
+ sd->menuskill_val = sd->menuskill_id = 0;
return;
}
skill_arrow_create(sd,RFIFOW(fd,2));
- sd->menuskill_lv = sd->menuskill_id = 0;
+ sd->menuskill_val = sd->menuskill_id = 0;
}
/*==========================================
* オートスペル受信
@@ -9847,7 +9847,7 @@ void clif_parse_AutoSpell(int fd,struct map_session_data *sd)
if (sd->menuskill_id != SA_AUTOSPELL)
return;
skill_autospell(sd,RFIFOW(fd,2));
- sd->menuskill_lv = sd->menuskill_id = 0;
+ sd->menuskill_val = sd->menuskill_id = 0;
}
/*==========================================
* カード使用
@@ -10520,10 +10520,10 @@ void clif_parse_CatchPet(int fd, struct map_session_data *sd)
void clif_parse_SelectEgg(int fd, struct map_session_data *sd)
{
- if (sd->menuskill_id != SA_TAMINGMONSTER || sd->menuskill_lv != -1)
+ if (sd->menuskill_id != SA_TAMINGMONSTER || sd->menuskill_val != -1)
return;
pet_select_egg(sd,RFIFOW(fd,2)-2);
- sd->menuskill_lv = sd->menuskill_id = 0;
+ sd->menuskill_val = sd->menuskill_id = 0;
}
void clif_parse_SendEmotion(int fd, struct map_session_data *sd)
@@ -11346,7 +11346,7 @@ void clif_parse_FeelSaveOk(int fd,struct map_session_data *sd)
int i;
if (sd->menuskill_id != SG_FEEL)
return;
- i = sd->menuskill_lv-1;
+ i = sd->menuskill_val-1;
if (i<0 || i > 2) return; //Bug?
sd->feel_map[i].index = map[sd->bl.m].index;
@@ -11357,7 +11357,7 @@ void clif_parse_FeelSaveOk(int fd,struct map_session_data *sd)
// clif_misceffect2(&sd->bl, 0x1b0);
// clif_misceffect2(&sd->bl, 0x21f);
clif_feel_info(sd, i, 0);
- sd->menuskill_lv = sd->menuskill_id = 0;
+ sd->menuskill_val = sd->menuskill_id = 0;
}
/*==========================================
@@ -11368,8 +11368,8 @@ void clif_parse_ReqFeel(int fd, struct map_session_data *sd, int skilllv)
WFIFOHEAD(fd,packet_len(0x253));
WFIFOW(fd,0)=0x253;
WFIFOSET(fd, packet_len(0x253));
- sd->menuskill_id=SG_FEEL;
- sd->menuskill_lv=skilllv;
+ sd->menuskill_id = SG_FEEL;
+ sd->menuskill_val = skilllv;
}
void clif_parse_AdoptRequest(int fd,struct map_session_data *sd)
diff --git a/src/map/map.h b/src/map/map.h
index 6722b7ed4..6fca83945 100644
--- a/src/map/map.h
+++ b/src/map/map.h
@@ -626,7 +626,7 @@ struct map_session_data {
short skillid_dance,skilllv_dance;
char blockskill[MAX_SKILL]; // [celest]
int cloneskill_id;
- int menuskill_id, menuskill_lv;
+ int menuskill_id, menuskill_val;
int invincible_timer;
unsigned int canlog_tick;
diff --git a/src/map/pc.c b/src/map/pc.c
index ad57ef809..4aa3c622e 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -4947,7 +4947,7 @@ int pc_dead(struct map_session_data *sd,struct block_list *src)
if (sd->skillitem)
sd->skillitem = sd->skillitemlv = 0;
if (sd->menuskill_id)
- sd->menuskill_id = sd->menuskill_lv = 0;
+ sd->menuskill_id = sd->menuskill_val = 0;
//Reset ticks.
sd->hp_loss_tick = sd->sp_loss_tick = 0;
diff --git a/src/map/skill.c b/src/map/skill.c
index 8f0481f95..bf6e84d8c 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -6302,7 +6302,7 @@ int skill_castend_map (struct map_session_data *sd, int skill_num, const char *m
nullpo_retr(0, sd);
//Simplify skill_failed code.
-#define skill_failed(sd) { sd->menuskill_id = sd->menuskill_lv = 0; }
+#define skill_failed(sd) { sd->menuskill_id = sd->menuskill_val = 0; }
if(skill_num != sd->menuskill_id)
return 0;
@@ -6351,9 +6351,8 @@ int skill_castend_map (struct map_session_data *sd, int skill_num, const char *m
case AL_TELEPORT:
if(strcmp(map,"Random")==0)
pc_randomwarp(sd,3);
- else if (sd->menuskill_lv > 1) //Need lv2 to be able to warp here.
- pc_setpos(sd,sd->status.save_point.map,
- sd->status.save_point.x,sd->status.save_point.y,3);
+ else if (sd->menuskill_val > 1) //Need lv2 to be able to warp here.
+ pc_setpos(sd,sd->status.save_point.map,sd->status.save_point.x,sd->status.save_point.y,3);
break;
case AL_WARP:
@@ -6388,8 +6387,8 @@ int skill_castend_map (struct map_session_data *sd, int skill_num, const char *m
//When it's an item-used warp-portal, the skill-lv used is lost.. assume max level.
lv = sd->skillitem==skill_num?skill_get_max(skill_num):pc_checkskill(sd,skill_num);
- wx = sd->menuskill_lv>>16;
- wy = sd->menuskill_lv&0xffff;
+ wx = sd->menuskill_val>>16;
+ wy = sd->menuskill_val&0xffff;
if(lv <= 0) return 0;
for(i=0;i<lv;i++){
@@ -6426,7 +6425,7 @@ int skill_castend_map (struct map_session_data *sd, int skill_num, const char *m
break;
}
- sd->menuskill_id = sd->menuskill_lv = 0;
+ sd->menuskill_id = sd->menuskill_val = 0;
return 0;
#undef skill_failed
}
@@ -6991,8 +6990,7 @@ int skill_unit_onplace (struct skill_unit *src, struct block_list *bl, unsigned
case UNT_SIEGFRIED:
case UNT_HERMODE:
//Needed to check when a dancer/bard leaves their ensemble area.
- if (sg->src_id==bl->id &&
- !(sc && sc->data[SC_SPIRIT].timer != -1 && sc->data[SC_SPIRIT].val2 == SL_BARDDANCER))
+ if (sg->src_id==bl->id && !(sc && sc->data[SC_SPIRIT].timer != -1 && sc->data[SC_SPIRIT].val2 == SL_BARDDANCER))
return skillid;
if (sc && sc->data[type].timer==-1)
sc_start4(bl,type,100,sg->skill_lv,sg->val1,sg->val2,0,sg->limit);
@@ -7005,7 +7003,7 @@ int skill_unit_onplace (struct skill_unit *src, struct block_list *bl, unsigned
case UNT_DONTFORGETME:
case UNT_FORTUNEKISS:
case UNT_SERVICEFORYOU:
- if (sg->src_id==bl->id && (!sc || sc->data[SC_SPIRIT].timer == -1 || sc->data[SC_SPIRIT].val2 != SL_BARDDANCER))
+ if (sg->src_id==bl->id && !(sc && sc->data[SC_SPIRIT].timer != -1 && sc->data[SC_SPIRIT].val2 == SL_BARDDANCER))
return 0;
if (!sc) return 0;
if (sc->data[type].timer==-1)
@@ -7017,6 +7015,7 @@ int skill_unit_onplace (struct skill_unit *src, struct block_list *bl, unsigned
sc->data[type].timer = add_timer(tick+sg->limit, status_change_timer, bl->id, type);
}
break;
+
case UNT_FOGWALL:
if (sc && sc->data[type].timer==-1)
{
@@ -7036,6 +7035,7 @@ int skill_unit_onplace (struct skill_unit *src, struct block_list *bl, unsigned
if(src->limit + sg->tick > tick + 700)
src->limit = DIFF_TICK(tick+700,sg->tick);
break;
+
case UNT_MOONLIT:
//Knockback out of area if affected char isn't in Moonlit effect
if (sc && sc->data[SC_DANCING].timer!=-1 && (sc->data[SC_DANCING].val1&0xFFFF) == CG_MOONLIT)
@@ -8907,7 +8907,7 @@ void skill_repairweapon (struct map_session_data *sd, int idx)
struct map_session_data *target_sd;
nullpo_retv(sd);
- target_sd = map_id2sd(sd->menuskill_lv);
+ target_sd = map_id2sd(sd->menuskill_val);
if (!target_sd) //Failed....
return;
if(idx==0xFFFF) // No item selected ('Cancel' clicked)
@@ -8970,15 +8970,18 @@ void skill_weaponrefine (struct map_session_data *sd, int idx)
nullpo_retv(sd);
- if (idx >= 0 && idx < MAX_INVENTORY) {
+ if (idx >= 0 && idx < MAX_INVENTORY)
+ {
struct item_data *ditem = sd->inventory_data[idx];
item = &sd->status.inventory[idx];
- if(item->nameid > 0 && ditem->type == 4) {
- if (item->refine >= sd->menuskill_lv ||
- item->refine >= MAX_REFINE || // if it's no longer refineable
- ditem->flag.no_refine || // if the item isn't refinable
- (i = pc_search_inventory(sd, material [ditem->wlv])) < 0 ) { //fixed by Lupus (item pos can be = 0!)
+ if(item->nameid > 0 && ditem->type == 4)
+ {
+ if( item->refine >= sd->menuskill_val
+ || item->refine >= MAX_REFINE // if it's no longer refineable
+ || ditem->flag.no_refine // if the item isn't refinable
+ || (i = pc_search_inventory(sd, material [ditem->wlv])) < 0 )
+ {
clif_skill_fail(sd,sd->menuskill_id,0,0);
return;
}
@@ -9038,7 +9041,7 @@ int skill_autospell (struct map_session_data *sd, int skillid)
nullpo_retr(0, sd);
- skilllv = sd->menuskill_lv;
+ skilllv = sd->menuskill_val;
lv=pc_checkskill(sd,skillid);
if(skilllv <= 0 || !lv) return 0; // Player must learn the skill before doing auto-spell [Lance]
@@ -10009,13 +10012,12 @@ int skill_unit_timer_sub (struct block_list *bl, va_list ap)
nullpo_retr(0, group);
flag = skill_dance_switch(unit, group, 0);
- if (unit->range>=0 && group->interval!=-1) {
+ if (unit->range>=0 && group->interval!=-1)
+ {
if (battle_config.skill_wall_check)
- map_foreachinshootrange(skill_unit_timer_sub_onplace, bl, unit->range,
- group->bl_flag,bl,tick);
+ map_foreachinshootrange(skill_unit_timer_sub_onplace, bl, unit->range, group->bl_flag, bl,tick);
else
- map_foreachinrange(skill_unit_timer_sub_onplace, bl, unit->range,
- group->bl_flag,bl,tick);
+ map_foreachinrange(skill_unit_timer_sub_onplace, bl, unit->range, group->bl_flag, bl,tick);
if (!unit->alive)
{
if (flag)
@@ -10026,7 +10028,8 @@ int skill_unit_timer_sub (struct block_list *bl, va_list ap)
if (flag)
skill_dance_switch(unit, group, 1);
- if((DIFF_TICK(tick,group->tick)>=group->limit || DIFF_TICK(tick,group->tick)>=unit->limit)){
+ if((DIFF_TICK(tick,group->tick)>=group->limit || DIFF_TICK(tick,group->tick)>=unit->limit))
+ {
switch(group->unit_id){
case UNT_BLASTMINE:
case UNT_GROUNDDRIFT_WIND:
@@ -10048,29 +10051,31 @@ int skill_unit_timer_sub (struct block_list *bl, va_list ap)
case UNT_FREEZINGTRAP:
case UNT_CLAYMORETRAP:
case UNT_TALKIEBOX:
- {
- struct block_list *src=map_id2bl(group->src_id);
- if(src && src->type==BL_PC && !group->state.into_abyss)
- { //Avoid generating trap items when it did not cost to create them. [Skotlex]
- struct item item_tmp;
- memset(&item_tmp,0,sizeof(item_tmp));
- item_tmp.nameid=1065;
- item_tmp.identify=1;
- map_addflooritem(&item_tmp,1,bl->m,bl->x,bl->y,NULL,NULL,NULL,0);
- }
- skill_delunit(unit, 0);
+ {
+ struct block_list *src=map_id2bl(group->src_id);
+ if(src && src->type==BL_PC && !group->state.into_abyss)
+ { //Avoid generating trap items when it did not cost to create them. [Skotlex]
+ struct item item_tmp;
+ memset(&item_tmp,0,sizeof(item_tmp));
+ item_tmp.nameid=1065;
+ item_tmp.identify=1;
+ map_addflooritem(&item_tmp,1,bl->m,bl->x,bl->y,NULL,NULL,NULL,0);
}
+ skill_delunit(unit, 0);
break;
+ }
default:
skill_delunit(unit, 0);
}
}
- if(group->unit_id == UNT_ICEWALL) {
+ if(group->unit_id == UNT_ICEWALL)
+ {
unit->val1 -= 5;
if(unit->val1 <= 0 && unit->limit + group->tick > tick + 700)
unit->limit = DIFF_TICK(tick+700,group->tick);
- } else
+ }
+ else
if (group->unit_id == UNT_TATAMIGAESHI && unit->range>=0)
{ //Disable processed cell.
unit->range = -1;
@@ -10227,8 +10232,7 @@ int skill_unit_move (struct block_list *bl, unsigned int tick, int flag)
if (flag&2 && flag&1)
{ //Onplace, check any skill units you have left.
int i;
- for (i=0; i < (sizeof(skill_unit_temp)/sizeof(int)) &&
- skill_unit_temp[i]; i++)
+ for (i=0; i < (sizeof(skill_unit_temp)/sizeof(int)) && skill_unit_temp[i]; i++)
skill_unit_onleft(skill_unit_temp[i], bl, tick);
}
@@ -10543,12 +10547,12 @@ int skill_produce_mix (struct map_session_data *sd, int skill_id, int nameid, in
break;
default:
if (sd->menuskill_id == AM_PHARMACY &&
- sd->menuskill_lv > 10 && sd->menuskill_lv <= 20)
+ sd->menuskill_val > 10 && sd->menuskill_val <= 20)
{ //Assume Cooking Dish
- if (sd->menuskill_lv >= 15) //Legendary Cooking Set.
+ if (sd->menuskill_val >= 15) //Legendary Cooking Set.
make_per = 10000; //100% Success
else
- make_per = 1200*(sd->menuskill_lv-10) //12% chance per set level.
+ make_per = 1200*(sd->menuskill_val-10) //12% chance per set level.
+ 7000 - 700*(skill_produce_db[idx].itemlv-10); //70% - 7% per dish level
break;
}
diff --git a/src/map/unit.c b/src/map/unit.c
index 7851357d5..d3c691c92 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -1696,7 +1696,7 @@ int unit_remove_map(struct block_list *bl, int clrtype)
if(sd->guild_alliance>0)
guild_reply_reqalliance(sd,sd->guild_alliance_account,0);
if(sd->menuskill_id)
- sd->menuskill_id = sd->menuskill_lv = 0;
+ sd->menuskill_id = sd->menuskill_val = 0;
pc_delinvincibletimer(sd);