summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorcelest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-11-18 05:42:45 +0000
committercelest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-11-18 05:42:45 +0000
commite26e3b2570fdf836a8c6c556c711bb6a81c3ecf0 (patch)
treeadd69d2928118542584007ba0c002e4997950ee5 /src/map
parentdb5a0ba6de24da584349db3c53648a39d50fb63c (diff)
downloadhercules-e26e3b2570fdf836a8c6c556c711bb6a81c3ecf0.tar.gz
hercules-e26e3b2570fdf836a8c6c556c711bb6a81c3ecf0.tar.bz2
hercules-e26e3b2570fdf836a8c6c556c711bb6a81c3ecf0.tar.xz
hercules-e26e3b2570fdf836a8c6c556c711bb6a81c3ecf0.zip
Updated Cloaking, Endure, fixed bug with monster npc's
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/athena@244 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r--src/map/atcommand.c10
-rw-r--r--src/map/chrif.c2
-rw-r--r--src/map/clif.c2
-rw-r--r--src/map/pc.c39
-rw-r--r--src/map/pc.h2
-rw-r--r--src/map/script.c6
-rw-r--r--src/map/skill.c50
7 files changed, 69 insertions, 42 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 70ada41de..6debf2256 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -3207,7 +3207,7 @@ int atcommand_refine(
if (sd->status.inventory[i].refine != final_refine) {
sd->status.inventory[i].refine = final_refine;
current_position = sd->status.inventory[i].equip;
- pc_unequipitem(sd, i, 0);
+ pc_unequipitem(sd, i, 0, BF_NORMAL);
clif_refine(fd, sd, 0, i, sd->status.inventory[i].refine);
clif_delitem(sd, i, 1);
clif_additem(sd, i, 1, 0);
@@ -7255,7 +7255,7 @@ atcommand_dropall(const int fd, struct map_session_data* sd,
for (i = 0; i < MAX_INVENTORY; i++) {
if (sd->status.inventory[i].amount) {
if(sd->status.inventory[i].equip != 0)
- pc_unequipitem(sd, i, 0);
+ pc_unequipitem(sd, i, 0, BF_NORMAL);
pc_dropitem(sd, i, sd->status.inventory[i].amount);
}
}
@@ -7282,7 +7282,7 @@ atcommand_chardropall(const int fd, struct map_session_data* sd,
for (i = 0; i < MAX_INVENTORY; i++) {
if (pl_sd->status.inventory[i].amount) {
if(pl_sd->status.inventory[i].equip != 0)
- pc_unequipitem(pl_sd, i, 0);
+ pc_unequipitem(pl_sd, i, 0, BF_NORMAL);
pc_dropitem(pl_sd, i, pl_sd->status.inventory[i].amount);
}
}
@@ -7312,7 +7312,7 @@ atcommand_storeall(const int fd, struct map_session_data* sd,
for (i = 0; i < MAX_INVENTORY; i++) {
if (sd->status.inventory[i].amount) {
if(sd->status.inventory[i].equip != 0)
- pc_unequipitem(sd, i, 0);
+ pc_unequipitem(sd, i, 0, BF_NORMAL);
storage_storageadd(sd, i, sd->status.inventory[i].amount);
}
}
@@ -7347,7 +7347,7 @@ atcommand_charstoreall(const int fd, struct map_session_data* sd,
for (i = 0; i < MAX_INVENTORY; i++) {
if (pl_sd->status.inventory[i].amount) {
if(pl_sd->status.inventory[i].equip != 0)
- pc_unequipitem(pl_sd, i, 0);
+ pc_unequipitem(pl_sd, i, 0, BF_NORMAL);
storage_storageadd(pl_sd, i, sd->status.inventory[i].amount);
}
}
diff --git a/src/map/chrif.c b/src/map/chrif.c
index 6e53bd6d2..adb26868d 100644
--- a/src/map/chrif.c
+++ b/src/map/chrif.c
@@ -597,7 +597,7 @@ int chrif_changedsex(int fd)
// to avoid any problem with equipment and invalid sex, equipment is unequiped.
for (i = 0; i < MAX_INVENTORY; i++) {
if (sd->status.inventory[i].nameid && sd->status.inventory[i].equip)
- pc_unequipitem((struct map_session_data*)sd, i, 0);
+ pc_unequipitem((struct map_session_data*)sd, i, 0, BF_NORMAL);
}
// reset skill of some job
if (s_class.job == 19 || s_class.job == 4020 || s_class.job == 4042 ||
diff --git a/src/map/clif.c b/src/map/clif.c
index 0622f6108..c41e42294 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -8209,7 +8209,7 @@ void clif_parse_UnequipItem(int fd,struct map_session_data *sd)
if(sd->npc_id!=0 || sd->vender_id != 0 || sd->opt1 > 0)
return;
- pc_unequipitem(sd,index,0);
+ pc_unequipitem(sd,index,0,BF_NORMAL);
}
/*==========================================
diff --git a/src/map/pc.c b/src/map/pc.c
index 8f126e101..863f48ce1 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -603,7 +603,7 @@ int pc_breakweapon(struct map_session_data *sd)
if(sd->status.inventory[i].equip && sd->status.inventory[i].equip & 0x0002 && !sd->status.inventory[i].attribute==1){
item=sd->inventory_data[i];
sd->status.inventory[i].attribute=1;
- pc_unequipitem(sd,i,0);
+ pc_unequipitem(sd,i,0,BF_NORMAL);
sprintf(output, "%s has broken.",item->jname);
clif_emotion(&sd->bl,23);
clif_displaymessage(sd->fd, output);
@@ -635,7 +635,7 @@ int pc_breakarmor(struct map_session_data *sd)
if(sd->status.inventory[i].equip && sd->status.inventory[i].equip & 0x0010 && !sd->status.inventory[i].attribute==1){
item=sd->inventory_data[i];
sd->status.inventory[i].attribute=1;
- pc_unequipitem(sd,i,0);
+ pc_unequipitem(sd,i,0,BF_NORMAL);
sprintf(output, "%s has broken.",item->jname);
clif_emotion(&sd->bl,23);
clif_displaymessage(sd->fd, output);
@@ -1443,10 +1443,13 @@ int pc_calcstatus(struct map_session_data* sd,int first)
}
if(sd->sc_data[SC_DECREASEAGI].timer!=-1) // 速度減少(agiはbattle.cで)
sd->speed = sd->speed *125/100;
- if(sd->sc_data[SC_CLOAKING].timer!=-1)
- sd->speed = (sd->speed*(76+(sd->sc_data[SC_INCREASEAGI].val1*3)))/100;
+ if(sd->sc_data[SC_CLOAKING].timer!=-1) {
+ sd->critical_rate += 100; // critical increases
+ sd->speed = sd->speed * (sd->sc_data[SC_CLOAKING].val3-sd->sc_data[SC_CLOAKING].val1*3) /100;
+ }
+ //sd->speed = (sd->speed*(76+(sd->sc_data[SC_INCREASEAGI].val1*3)))/100;
if(sd->sc_data[SC_CHASEWALK].timer!=-1)
- sd->speed = sd->speed*(135-sd->sc_data[SC_CHASEWALK].val1*5)/100; // slow down by chasewalk
+ sd->speed = sd->speed * sd->sc_data[SC_CHASEWALK].val3 /100; // slow down by chasewalk
if(sd->sc_data[SC_BLESSING].timer!=-1){ // ブレッシング
sd->paramb[0]+= sd->sc_data[SC_BLESSING].val1;
sd->paramb[3]+= sd->sc_data[SC_BLESSING].val1;
@@ -2946,7 +2949,7 @@ int pc_delitem(struct map_session_data *sd,int n,int amount,int type)
sd->weight -= sd->inventory_data[n]->weight*amount ;
if(sd->status.inventory[n].amount<=0){
if(sd->status.inventory[n].equip)
- pc_unequipitem(sd,n,0);
+ pc_unequipitem(sd,n,0,BF_NORMAL);
memset(&sd->status.inventory[n],0,sizeof(sd->status.inventory[0]));
sd->inventory_data[n] = NULL;
}
@@ -4129,7 +4132,8 @@ int pc_attack_timer(int tid,unsigned int tick,int id,int data)
if(sd->bl.m != bl->m || pc_isdead(sd))
return 0;
- if( sd->opt1>0 || sd->status.option&2 || sd->status.option&16388) // 異常などで攻撃できない
+ //if( sd->opt1>0 || sd->status.option&2 || sd->status.option&16388) // 異常などで攻撃できない
+ if( sd->opt1>0 || sd->status.option&2 || sd->status.option&16384) // 異常などで攻撃できない
return 0;
if(sd->sc_data[SC_AUTOCOUNTER].timer != -1)
@@ -4137,7 +4141,8 @@ int pc_attack_timer(int tid,unsigned int tick,int id,int data)
if(sd->sc_data[SC_BLADESTOP].timer != -1)
return 0;
- if((opt = battle_get_option(bl)) != NULL && *opt&0x46)
+ //if((opt = battle_get_option(bl)) != NULL && *opt&0x46)
+ if((opt = battle_get_option(bl)) != NULL && *opt&0x42)
return 0;
if(((sc_data = battle_get_sc_data(bl)) != NULL && sc_data[SC_TRICKDEAD].timer != -1) ||
((sc_data = battle_get_sc_data(bl)) != NULL && sc_data[SC_BASILICA].timer != -1 ))
@@ -4178,6 +4183,7 @@ int pc_attack_timer(int tid,unsigned int tick,int id,int data)
map_freeblock_lock();
pc_stop_walking(sd,0);
sd->attacktarget_lv = battle_weapon_attack(&sd->bl,bl,tick,0);
+ // &2 = ? - Celest
if(!(battle_config.pc_cloak_check_type&2) && sd->sc_data[SC_CLOAKING].timer != -1)
skill_status_change_end(&sd->bl,SC_CLOAKING,-1);
if(sd->status.pet_id > 0 && sd->pd && sd->petDB && battle_config.pet_attack_support)
@@ -4221,7 +4227,8 @@ int pc_attack(struct map_session_data *sd,int target_id,int type)
return 1;
if(bl->type==BL_NPC) { // monster npcs [Valaris]
- npc_click(sd,RFIFOL(sd->fd,2));
+ //npc_click(sd,RFIFOL(sd->fd,2));
+ npc_click(sd,target_id); // submitted by leinsirk10 [Celest]
return 0;
}
@@ -4859,7 +4866,7 @@ int pc_resetlvl(struct map_session_data* sd,int type)
for(i=0;i<11;i++) { // unequip items that can't be equipped by base 1 [Valaris]
if(sd->equip_index[i] >= 0)
if(!pc_isequip(sd,sd->equip_index[i]))
- pc_unequipitem(sd,sd->equip_index[i],1);
+ pc_unequipitem(sd,sd->equip_index[i],1,BF_NORMAL);
}
clif_skillinfoblock(sd);
@@ -5125,7 +5132,7 @@ int pc_damage(struct block_list *src,struct map_session_data *sd,int damage)
int n = eq_n[rand()%eq_num];//該当アイテムの中からランダム
if(rand()%10000 < per){
if(sd->status.inventory[n].equip)
- pc_unequipitem(sd,n,0);
+ pc_unequipitem(sd,n,0,BF_NORMAL);
pc_dropitem(sd,n,1);
}
}
@@ -5138,7 +5145,7 @@ int pc_damage(struct block_list *src,struct map_session_data *sd,int damage)
|| (type == 2 && sd->status.inventory[i].equip)
|| type == 3) ){
if(sd->status.inventory[i].equip)
- pc_unequipitem(sd,i,0);
+ pc_unequipitem(sd,i,0,BF_NORMAL);
pc_dropitem(sd,i,1);
break;
}
@@ -5634,7 +5641,7 @@ int pc_jobchange(struct map_session_data *sd,int job, int upper)
for(i=0;i<11;i++) {
if(sd->equip_index[i] >= 0)
if(!pc_isequip(sd,sd->equip_index[i]))
- pc_unequipitem(sd,sd->equip_index[i],1); // 装備外し
+ pc_unequipitem(sd,sd->equip_index[i],1,BF_NORMAL); // 装備外し
}
clif_changelook(&sd->bl,LOOK_BASE,sd->view_class); // move sprite update to prevent client crashes with incompatible equipment [Valaris]
@@ -6271,7 +6278,7 @@ int pc_equipitem(struct map_session_data *sd,int n,int pos)
arrow=pc_search_inventory(sd,pc_checkequip(sd,9)); // Added by RoVeRT
for(i=0;i<11;i++) {
if(sd->equip_index[i] >= 0 && sd->status.inventory[sd->equip_index[i]].equip&pos) {
- pc_unequipitem(sd,sd->equip_index[i],1);
+ pc_unequipitem(sd,sd->equip_index[i],1,BF_NORMAL);
}
}
// 弓矢装備
@@ -6367,13 +6374,13 @@ int pc_equipitem(struct map_session_data *sd,int n,int pos)
* 装 備した物を外す
*------------------------------------------
*/
-int pc_unequipitem(struct map_session_data *sd,int n,int type)
+int pc_unequipitem(struct map_session_data *sd,int n,int type, int flag)
{
nullpo_retr(0, sd);
// -- moonsoul (if player is berserk then cannot unequip)
//
- if(sd->sc_data[SC_BERSERK].timer!=-1){
+ if(!flag && sd->sc_data[SC_BERSERK].timer!=-1){
clif_unequipitemack(sd,n,0,0);
return 0;
}
diff --git a/src/map/pc.h b/src/map/pc.h
index 2260fcdb7..a8c9cb385 100644
--- a/src/map/pc.h
+++ b/src/map/pc.h
@@ -112,7 +112,7 @@ int pc_resetlvl(struct map_session_data*,int type);
int pc_resetstate(struct map_session_data*);
int pc_resetskill(struct map_session_data*);
int pc_equipitem(struct map_session_data*,int,int);
-int pc_unequipitem(struct map_session_data*,int,int);
+int pc_unequipitem(struct map_session_data*,int,int,int);
int pc_checkitem(struct map_session_data*);
int pc_useitem(struct map_session_data*,int);
diff --git a/src/map/script.c b/src/map/script.c
index ddd17f915..667fc0b8e 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -3029,7 +3029,7 @@ int buildin_successrefitem(struct script_state *st)
#endif //USE_SQL
sd->status.inventory[i].refine++;
- pc_unequipitem(sd,i,0);
+ pc_unequipitem(sd,i,0, BF_NORMAL);
clif_refine(sd->fd,sd,0,i,sd->status.inventory[i].refine);
clif_delitem(sd,i,1);
clif_additem(sd,i,1,0);
@@ -3059,7 +3059,7 @@ int buildin_failedrefitem(struct script_state *st)
#endif //USE_SQL
sd->status.inventory[i].refine = 0;
- pc_unequipitem(sd,i,0);
+ pc_unequipitem(sd,i,0, BF_NORMAL);
// 精錬失敗エフェクトのパケット
clif_refine(sd->fd,sd,1,i,sd->status.inventory[i].refine);
pc_delitem(sd,i,1,0);
@@ -5801,7 +5801,7 @@ int buildin_nude(struct script_state *st)
for(i=0;i<11;i++)
if(sd->equip_index[i] >= 0)
- pc_unequipitem(sd,sd->equip_index[i],1);
+ pc_unequipitem(sd,sd->equip_index[i],1, BF_NORMAL);
return 0;
}
diff --git a/src/map/skill.c b/src/map/skill.c
index 24e207fed..c4fbdea5c 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -3380,8 +3380,7 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
/* 解除する */
skill_status_change_end(bl, sc, -1);
}
-
- skill_check_cloaking(bl);
+ //skill_check_cloaking(bl);
}
break;
@@ -3627,7 +3626,7 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
if(dstsd){
for(i=0;i<MAX_INVENTORY;i++){
if(dstsd->status.inventory[i].equip && dstsd->status.inventory[i].equip & 0x0002){
- pc_unequipitem(dstsd,i,0);
+ pc_unequipitem(dstsd,i,0,BF_SKILL);
break;
}
}
@@ -3650,7 +3649,7 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
if(dstsd){
for(i=0;i<MAX_INVENTORY;i++){
if(dstsd->status.inventory[i].equip && dstsd->status.inventory[i].equip & 0x0020){
- pc_unequipitem(dstsd,i,0);
+ pc_unequipitem(dstsd,i,0,BF_SKILL);
break;
}
}
@@ -3673,7 +3672,7 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
if(dstsd){
for(i=0;i<MAX_INVENTORY;i++){
if(dstsd->status.inventory[i].equip && dstsd->status.inventory[i].equip & 0x0010){
- pc_unequipitem(dstsd,i,0);
+ pc_unequipitem(dstsd,i,0,BF_SKILL);
break;
}
}
@@ -3695,7 +3694,7 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
if(dstsd){
for(i=0;i<MAX_INVENTORY;i++){
if(dstsd->status.inventory[i].equip && dstsd->status.inventory[i].equip & 0x0100){
- pc_unequipitem(dstsd,i,0);
+ pc_unequipitem(dstsd,i,0,BF_SKILL);
break;
}
}
@@ -4184,6 +4183,7 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
skill_status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,skillid,src->id,0,skill_get_time(skillid,skilllv),0 );
break;
case ASC_CDP: // Temporary skill for Create Deadly Poison[Celest]
+ // notes: success rate (from emperium.org) = 20 + [(20*Dex)/50] + [(20*Luk)/100]
if(sd) {
int eflag;
struct item item_tmp;
@@ -7792,6 +7792,7 @@ int skill_status_change_end(struct block_list* bl, int type, int tid)
switch(type){ /* 異常の種類ごとの?理 */
case SC_PROVOKE: /* プロボック */
+ case SC_ENDURE: // celest
case SC_CONCENTRATE: /* 集中力向上 */
case SC_BLESSING: /* ブレッシング */
case SC_ANGELUS: /* アンゼルス */
@@ -7959,6 +7960,7 @@ int skill_status_change_end(struct block_list* bl, int type, int tid)
case SC_HIDING:
case SC_CLOAKING:
*option &= ~((type == SC_HIDING) ? 2 : 4);
+ calc_flag = 1; // orn
opt_flag = 1 ;
break;
@@ -8159,8 +8161,8 @@ int skill_status_change_timer(int tid, unsigned int tick, int id, int data)
case SC_ENDURE: /* インデュア */
if(sd && sd->special_state.infinite_endure) {
- sc_data[type].timer=add_timer( 1000*600+tick,skill_status_change_timer, bl->id, data );
- sc_data[type].val2=1;
+ sc_data[type].timer=add_timer( 1000*60+tick,skill_status_change_timer, bl->id, data );
+ //sc_data[type].val2=1;
return 0;
}
break;
@@ -8544,6 +8546,7 @@ int skill_status_change_start(struct block_list *bl, int type, int val1, int val
break;
case SC_ENDURE: /* インデュア */
if(tick <= 0) tick = 1000 * 60;
+ calc_flag = 1; // for updating mdef
val2 = 7; // [Celest]
break;
case SC_CONCENTRATE: /* 集中力向上 */
@@ -8961,9 +8964,11 @@ int skill_status_change_start(struct block_list *bl, int type, int val1, int val
break;
case SC_CHASEWALK:
case SC_CLOAKING: /* クロ?キング */
- calc_flag = 1; // [Celest]
- if(bl->type == BL_PC)
+ if(bl->type == BL_PC) {
+ calc_flag = 1; // [Celest]
val2 = tick;
+ val3 = type==SC_CLOAKING ? 130-val1*3 : 135-val1*5;
+ }
else
tick = 5000*val1;
break;
@@ -9268,18 +9273,33 @@ int skill_check_cloaking(struct block_list *bl)
nullpo_retr(0, bl);
- if(bl->type == BL_PC &&
- (battle_config.pc_cloak_check_type&1 || pc_checkskill(sd,AS_CLOAKING)>2))
+ if(bl->type == BL_PC && !battle_config.pc_cloak_check_type) // If it's No it shouldn't be checked
return 0;
- else if(bl->type == BL_MOB && battle_config.monster_cloak_check_type&1)
+ else if(bl->type == BL_MOB && !battle_config.monster_cloak_check_type)
return 0;
for(i=0;i<sizeof(dx)/sizeof(dx[0]);i++){
int c=map_getcell(bl->m,bl->x+dx[i],bl->y+dy[i]);
if(c==1 || c==5) end=0;
}
if(end){
- skill_status_change_end(bl, SC_CLOAKING, -1);
- *battle_get_option(bl)&=~4; /* 念のための?理 */
+ if ((bl->type == BL_PC && pc_checkskill(sd,AS_CLOAKING)<3) || bl->type == BL_MOB) {
+ skill_status_change_end(bl, SC_CLOAKING, -1);
+ *battle_get_option(bl)&=~4; /* 念のための?理 */
+ }
+ else if (bl->type == BL_PC) {
+ sd->sc_data[SC_CLOAKING].val3 = 130;
+ //sd->speed = sd->speed * sd->sc_data[SC_CLOAKING].val3 /100;
+ //clif_updatestatus(sd,SP_SPEED);
+ pc_calcstatus (sd,0); // better way than calling this everytime?
+ }
+ }
+ else {
+ if (bl->type == BL_PC) {
+ sd->sc_data[SC_CLOAKING].val3 = 103;
+ //sd->speed = sd->speed * sd->sc_data[SC_CLOAKING].val3 /100;
+ //clif_updatestatus(sd,SP_SPEED);
+ pc_calcstatus (sd,0);
+ }
}
return end;
}