summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/map/battle.c28
-rw-r--r--src/map/clif.c15
-rw-r--r--src/map/map.c2
-rw-r--r--src/map/pc.c9
-rw-r--r--src/map/pc.h2
-rw-r--r--src/map/script.c6
-rw-r--r--src/map/skill.c19
-rw-r--r--src/map/status.c18
-rw-r--r--src/map/status.h2
-rw-r--r--src/map/trade.h2
10 files changed, 63 insertions, 40 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index 31fe502f6..ace947aca 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -753,8 +753,8 @@ int battle_calc_masteryfix(struct block_list *src, struct block_list *target, ui
int ratio = sd->status.base_level + status_get_dex(src) + status_get_luk(src);
if ( i == 2 ) ratio += status_get_str(src); //Star Anger
if (skill < 4 )
- ratio /= 12 - 3 * skill;
- damage += damage * ratio;
+ ratio /= (12 - 3 * skill);
+ damage += damage * ratio / 100;
}
if( sc ){
@@ -4345,15 +4345,11 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
wd.damage = sstatus->max_hp* 9/100;
wd.damage2 = 0;
break;
-
-#ifdef RENEWAL
- case MO_EXTREMITYFIST: // [malufett]
- wd.damage = battle->calc_base_damage(src, target, skill_id, skill_lv, nk, n_ele, s_ele, s_ele_, EQI_HAND_R, (sc && sc->data[SC_MAXIMIZEPOWER]?1:0)|8, wd.flag);
- // first value is still not confirm.
- wd.damage = status_get_sp(src) + 10 * status_get_sp(src) * wd.damage / 100 + 8 * wd.damage;
- flag.tdef = 1;
- break;
case NJ_ISSEN: // [malufett]
+#ifndef RENEWAL
+ wd.damage = 40*sstatus->str +skill_lv*(sstatus->hp/10 + 35);
+ wd.damage2 = 0;
+#else
{
short totaldef = status_get_total_def(target);
i = 0;
@@ -4367,12 +4363,14 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
ATK_RATE(50);
flag.idef = 1;
}
-#else
-
- wd.damage = 40*sstatus->str +skill_lv*(sstatus->hp/10 + 35);
- wd.damage2 = 0;
-#endif
break;
+ case MO_EXTREMITYFIST: // [malufett]
+ wd.damage = battle->calc_base_damage(src, target, skill_id, skill_lv, nk, n_ele, s_ele, s_ele_, EQI_HAND_R, (sc && sc->data[SC_MAXIMIZEPOWER]?1:0)|8, wd.flag);
+ // first value is still not confirm.
+ wd.damage = status_get_sp(src) + 10 * status_get_sp(src) * wd.damage / 100 + 8 * wd.damage;
+ flag.tdef = 1;
+#endif
+ break;
#ifndef RENEWAL
case LK_SPIRALPIERCE:
case ML_SPIRALPIERCE:
diff --git a/src/map/clif.c b/src/map/clif.c
index 0c2d16a4d..840aad1f4 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -5964,12 +5964,13 @@ void clif_wis_message(int fd, const char* nick, const char* mes, int mes_len)
safestrncpy((char*)WFIFOP(fd,28), mes, mes_len);
WFIFOSET(fd,WFIFOW(fd,2));
#else
+ struct map_session_data *ssd = iMap->nick2sd(nick);
+
WFIFOHEAD(fd, mes_len + NAME_LENGTH + 8);
WFIFOW(fd,0) = 0x97;
WFIFOW(fd,2) = mes_len + NAME_LENGTH + 8;
safestrncpy((char*)WFIFOP(fd,4), nick, NAME_LENGTH);
- WFIFOL(fd,28) = 0; // isAdmin; if nonzero, also displays text above char
- // TODO: WFIFOL(fd,28) = pc->get_group_level(ssd);
+ WFIFOL(fd,28) = (pc->get_group_level(ssd) == 99) ? 1 : 0; // isAdmin; if nonzero, also displays text above char
safestrncpy((char*)WFIFOP(fd,32), mes, mes_len);
WFIFOSET(fd,WFIFOW(fd,2));
#endif
@@ -9756,7 +9757,7 @@ void clif_parse_progressbar(int fd, struct map_session_data * sd)
if( iTimer->gettick() < sd->progressbar.timeout && sd->st )
sd->st->state = END;
- sd->progressbar.npc_id = sd->progressbar.timeout = 0;
+ sd->state.workinprogress = sd->progressbar.npc_id = sd->progressbar.timeout = 0;
npc_scriptcont(sd, npc_id, false);
}
@@ -9776,8 +9777,8 @@ void clif_parse_WalkToXY(int fd, struct map_session_data *sd)
if (sd->sc.opt1 && ( sd->sc.opt1 == OPT1_STONEWAIT || sd->sc.opt1 == OPT1_BURNING ))
; //You CAN walk on this OPT1 value.
- else if( sd->progressbar.npc_id )
- clif->progressbar_abort(sd);
+ /*else if( sd->progressbar.npc_id )
+ clif->progressbar_abort(sd);*/
else if (pc_cant_act(sd))
return;
@@ -10572,7 +10573,7 @@ void clif_parse_DropItem(int fd, struct map_session_data *sd)
if (pc_isdead(sd))
break;
- if ( pc_cant_act2(sd) )
+ if ( pc_cant_act2(sd) || sd->state.vending )
break;
if (sd->sc.count && (
@@ -10794,7 +10795,7 @@ void clif_parse_NpcClicked(int fd,struct map_session_data *sd)
#endif
return;
}
- if ( pc_cant_act2(sd) || !(bl = iMap->id2bl(RFIFOL(fd,2))) )
+ if ( pc_cant_act2(sd) || !(bl = iMap->id2bl(RFIFOL(fd,2))) || sd->state.vending )
return;
switch (bl->type) {
diff --git a/src/map/map.c b/src/map/map.c
index d74263d1a..5f86286e9 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -5246,6 +5246,7 @@ void map_hp_symbols(void) {
HPM->share(vending,"vending");
HPM->share(pc,"pc");
HPM->share(party,"party");
+ HPM->share(trade,"trade");
HPM->share(iMap,"iMap");
/* partial */
HPM->share(mapit,"mapit");
@@ -5278,6 +5279,7 @@ void load_defaults(void) {
vending_defaults();
pc_defaults();
party_defaults();
+ trade_defaults();
}
int do_init(int argc, char *argv[])
{
diff --git a/src/map/pc.c b/src/map/pc.c
index ef70aad97..b7644f2fb 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -4255,7 +4255,7 @@ int pc_useitem(struct map_session_data *sd,int n)
nullpo_ret(sd);
- if( sd->npc_id ){
+ if( sd->npc_id || sd->state.workinprogress&1 ){
/* TODO: add to clif->messages enum */
#ifdef RENEWAL
clif->msg(sd, 0x783); // TODO look for the client date that has this message.
@@ -4295,8 +4295,8 @@ int pc_useitem(struct map_session_data *sd,int n)
return 0;
/* 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 != ITEMID_REINS_OF_MOUNT && sd->sc.data[SC_ALL_RIDING] )
+ if( sd->inventory_data[n]->flag.delay_consume && nameid != ITEMID_REINS_OF_MOUNT ) {
+ if( sd->sc.data[SC_ALL_RIDING] )
return 0;
else if( pc_issit(sd) )
return 0;
@@ -4323,7 +4323,8 @@ int pc_useitem(struct map_session_data *sd,int n)
} else {// not yet used item (all slots are initially empty)
sd->item_delay[i].nameid = nameid;
}
- sd->item_delay[i].tick = tick + sd->inventory_data[n]->delay;
+ if( !(nameid == ITEMID_REINS_OF_MOUNT && sd->sc.option&(OPTION_WUGRIDER|OPTION_RIDING|OPTION_DRAGON|OPTION_MADOGEAR)) )
+ sd->item_delay[i].tick = tick + sd->inventory_data[n]->delay;
} else {// should not happen
ShowError("pc_useitem: Exceeded item delay array capacity! (nameid=%d, char_id=%d)\n", nameid, sd->status.char_id);
}
diff --git a/src/map/pc.h b/src/map/pc.h
index 5c585af1c..43d5d40c7 100644
--- a/src/map/pc.h
+++ b/src/map/pc.h
@@ -603,7 +603,7 @@ enum equip_pos {
#define pc_cant_act(sd) ( (sd)->npc_id || (sd)->state.vending || (sd)->state.buyingstore || (sd)->chatID || ((sd)->sc.opt1 && (sd)->sc.opt1 != OPT1_BURNING) || (sd)->state.trading || (sd)->state.storage_flag || (sd)->state.prevend )
/* equals pc_cant_act except it doesn't check for chat rooms */
-#define pc_cant_act2(sd) ( (sd)->npc_id || (sd)->state.vending || (sd)->state.buyingstore || ((sd)->sc.opt1 && (sd)->sc.opt1 != OPT1_BURNING) || (sd)->state.trading || (sd)->state.storage_flag || (sd)->state.prevend )
+#define pc_cant_act2(sd) ( (sd)->npc_id || (sd)->state.buyingstore || ((sd)->sc.opt1 && (sd)->sc.opt1 != OPT1_BURNING) || (sd)->state.trading || (sd)->state.storage_flag || (sd)->state.prevend )
#define pc_setdir(sd,b,h) ( (sd)->ud.dir = (b) ,(sd)->head_dir = (h) )
#define pc_setchatid(sd,n) ( (sd)->chatID = n )
diff --git a/src/map/script.c b/src/map/script.c
index 15870aaa7..682faa42b 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -16312,6 +16312,7 @@ BUILDIN(progressbar)
sd->progressbar.npc_id = st->oid;
sd->progressbar.timeout = iTimer->gettick() + second*1000;
+ sd->state.workinprogress = 3;
clif->progressbar(sd, strtol(color, (char **)NULL, 0), second);
return true;
@@ -16520,9 +16521,10 @@ BUILDIN(setmounting) {
TBL_PC* sd;
if( (sd = script_rid2sd(st)) == NULL )
return true;
- if( sd->sc.option&(OPTION_WUGRIDER|OPTION_RIDING|OPTION_DRAGON|OPTION_MADOGEAR) )
+ if( sd->sc.option&(OPTION_WUGRIDER|OPTION_RIDING|OPTION_DRAGON|OPTION_MADOGEAR) ){
+ clif->msgtable(sd->fd, 0X78b);
script_pushint(st,0);//can't mount with one of these
- else {
+ }else {
if( sd->sc.data[SC_ALL_RIDING] )
status_change_end(&sd->bl, SC_ALL_RIDING, INVALID_TIMER);
else
diff --git a/src/map/skill.c b/src/map/skill.c
index 5a10038d8..685fec353 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -2395,6 +2395,10 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds
//Can't attack nor use items until skill's delay expires. [Skotlex]
sd->ud.attackabletime = sd->canuseitem_tick = sd->ud.canact_tick;
break;
+ case TK_DODGE:
+ if( pc->checkskill(sd, TK_JUMPKICK) > 0 )
+ flag = 1;
+ break;
case SR_DRAGONCOMBO:
if( pc->checkskill(sd, SR_FALLENEMPIRE) > 0 )
flag = 1;
@@ -3761,7 +3765,7 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
int sflag = skill_area_temp[0] & 0xFFF, heal;
if( flag&SD_LEVEL )
sflag |= SD_LEVEL; // -1 will be used in packets instead of the skill level
- if( skill_area_temp[1] != bl->id && !(skill->get_inf2(skill_id)&INF2_NPC_SKILL) )
+ if( (skill_area_temp[1] != bl->id && !(skill->get_inf2(skill_id)&INF2_NPC_SKILL)) || flag&SD_ANIMATION )
sflag |= SD_ANIMATION; // original target gets no animation (as well as all NPC skills)
heal = skill->attack(skill->get_type(skill_id), src, src, bl, skill_id, skill_lv, tick, sflag);
@@ -3776,6 +3780,8 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
case GN_CARTCANNON:
clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
break;
+ case SR_TIGERCANNON:
+ flag |= SD_ANIMATION;
case LG_MOONSLASHER:
clif->skill_damage(src,bl,tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
break;
@@ -7965,12 +7971,11 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
break;
for(i = 0; i < SC_MAX; i++)
{
- if( SC_COMMON_MAX > i ){
- if ( !tsc->data[i] || !status_get_sc_type(i) )
- continue;
+ if ( !tsc->data[i] )
+ continue;
+ if( SC_COMMON_MAX > i )
if ( status_get_sc_type(i)&SC_NO_CLEARANCE )
continue;
- }
switch (i) {
case SC_ASSUMPTIO:
if( bl->type == BL_MOB )
@@ -8551,7 +8556,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
case SR_FLASHCOMBO:
clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
for(i = SR_FLASHCOMBO_ATK_STEP1; i <= SR_FLASHCOMBO_ATK_STEP4; i++)
- skill->addtimerskill(src, tick + 600 * (i - SR_FLASHCOMBO_ATK_STEP1), bl->id, 0, 0, i, skill_lv, BF_WEAPON, flag|SD_LEVEL);
+ skill->addtimerskill(src, tick + 500 * (i - SR_FLASHCOMBO_ATK_STEP1), bl->id, 0, 0, i, skill_lv, BF_WEAPON, flag|SD_LEVEL);
break;
case WA_SWING_DANCE:
case WA_MOONLIT_SERENADE:
@@ -13101,12 +13106,14 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
case TK_STORMKICK:
case TK_DOWNKICK:
case TK_COUNTER:
+ case TK_JUMPKICK:
case HT_POWER:
case GC_COUNTERSLASH:
case GC_WEAPONCRUSH:
case SR_FALLENEMPIRE:
case SR_DRAGONCOMBO:
case SR_TIGERCANNON:
+ case SR_GATEOFHELL:
break;
default: return 0;
}
diff --git a/src/map/status.c b/src/map/status.c
index 8363b8021..55b79fff7 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -915,6 +915,7 @@ void initChangeTables(void) {
StatusIconChangeTable[SC_PUSH_CART] = SI_ON_PUSH_CART;
StatusIconChangeTable[SC_REBOUND] = SI_REBOUND;
StatusIconChangeTable[SC_ALL_RIDING] = SI_ALL_RIDING;
+ StatusIconChangeTable[SC_MONSTER_TRANSFORM] = SI_MONSTER_TRANSFORM;
//Other SC which are not necessarily associated to skills.
StatusChangeFlagTable[SC_ATTHASTE_POTION1] = SCB_ASPD;
@@ -1022,6 +1023,7 @@ void initChangeTables(void) {
StatusDisplayType[SC_BLOOD_SUCKER] = true;
StatusDisplayType[SC__SHADOWFORM] = true;
StatusDisplayType[SC__MANHOLE] = true;
+ StatusDisplayType[SC_MONSTER_TRANSFORM] = true;
#ifdef RENEWAL_EDP
// renewal EDP increases your weapon atk
@@ -2500,7 +2502,7 @@ int status_calc_pc_(struct map_session_data* sd, bool first)
#ifdef RENEWAL
wa->matk += sd->inventory_data[index]->matk;
wa->wlv = wlv;
- if( r ) // renewal magic attack refine bonus
+ if( r && sd->weapontype1 != W_BOW ) // renewal magic attack refine bonus
wa->matk += refine_info[wlv].bonus[r-1] / 100;
#endif
@@ -8327,10 +8329,10 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
break;
case SC_BLOOD_SUCKER:
{
- struct block_list *src = iMap->id2bl(sce->val2);
+ struct block_list *src = iMap->id2bl(val2);
val3 = 1;
if(src)
- val3 = 200 + 100 * sce->val1 + status_get_int(src);
+ val3 = 200 + 100 * val1 + status_get_int(src);
val4 = tick / 1000;
tick_time = 1000; // [GodLesZ] tick time
}
@@ -8712,6 +8714,11 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
tick_time = 10000;
val4 = tick / tick_time;
break;
+ case SC_MONSTER_TRANSFORM:
+ if( !mobdb_checkid(val1) )
+ val1 = 1002; // default poring
+ val_flag |= 1;
+ break;
default:
if( calc_flag == SCB_NONE && StatusSkillChangeTable[type] == 0 && StatusIconChangeTable[type] == 0 )
{ //Status change with no calc, no icon, and no skill associated...?
@@ -8739,8 +8746,12 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
case SC_SUMMON3:
case SC_SUMMON4:
case SC_SUMMON5:
+ case SC_MONSTER_TRANSFORM:
val_flag |= 1;
break;
+ case SC_KYOUGAKU:
+ clif->status_change(bl, SI_ACTIVE_MONSTER_TRANSFORM, 1, 0, 1002, 0, 0); // Poring in disguise
+ break;
}
}
@@ -9646,7 +9657,6 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const
}
break;
case SC_KYOUGAKU:
- clif->sc_end(&sd->bl,sd->bl.id,AREA,SI_KYOUGAKU);
clif->sc_end(&sd->bl,sd->bl.id,AREA,SI_ACTIVE_MONSTER_TRANSFORM);
break;
case SC_CLAIRVOYANCE:
diff --git a/src/map/status.h b/src/map/status.h
index 617cd9572..fbce95f17 100644
--- a/src/map/status.h
+++ b/src/map/status.h
@@ -671,6 +671,8 @@ typedef enum sc_type {
SC_ALL_RIDING,
SC_HANBOK,
+ SC_MONSTER_TRANSFORM,
+
SC_MAX, //Automatically updated max, used in for's to check we are within bounds.
} sc_type;
diff --git a/src/map/trade.h b/src/map/trade.h
index 6bcefdb96..f66c70525 100644
--- a/src/map/trade.h
+++ b/src/map/trade.h
@@ -20,6 +20,6 @@ struct trade_interface {
} trade_s;
struct trade_interface *trade;
-void trade_interface(void);
+void trade_defaults(void);
#endif /* _TRADE_H_ */