summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-10-19 16:21:09 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-10-19 16:21:09 +0000
commit11e47ab6ff3d3ba751bf111d0c1948ac23dbb313 (patch)
tree4050919dd7b3d7bfe3770a556c08717f98107c24 /src/map/pc.c
parent0dfce081c8043b95b11e617cd40ca8ce85e9b1df (diff)
downloadhercules-11e47ab6ff3d3ba751bf111d0c1948ac23dbb313.tar.gz
hercules-11e47ab6ff3d3ba751bf111d0c1948ac23dbb313.tar.bz2
hercules-11e47ab6ff3d3ba751bf111d0c1948ac23dbb313.tar.xz
hercules-11e47ab6ff3d3ba751bf111d0c1948ac23dbb313.zip
- Added the Monk combos to skill_castnodex so their delay is not decreased by skills.
- Added the actual skill delay of 1000ms to Triple Attack and Chain combo in skill_cast_db. Added Combo Finish and TigerFist as well with a delay of 700ms. - Phantasmic arrow now knockbacks even if it misses. - Adjusted the way Monk combo times work. The combo time is now always 300ms (adjusted by combo_delay_rate) which takes effect inmediately AFTER your current skill's canact-delay (which is why the particular skill delays were moved to skillcast_db) - Modified skill_delayfix so it performs the can-act reduction from agi/dex for combos there. - Modified pc_steal_item so that it behaves more closely to the way it does on Aegis. - Commented out the monster_noteleport mapflag from the guild castles as this is the Aegis behaviour git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9012 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c45
1 files changed, 28 insertions, 17 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index a69d63e29..e615b1807 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -3179,9 +3179,10 @@ int pc_show_steal(struct block_list *bl,va_list ap)
*------------------------------------------
*/
//** pc.c:
-int pc_steal_item(struct map_session_data *sd,struct block_list *bl)
+int pc_steal_item(struct map_session_data *sd,struct block_list *bl, int lv)
{
- int i,skill,itemid,flag;
+ static int i = 0;
+ int rate,itemid,flag;
struct status_data *sd_status, *md_status;
struct mob_data *md;
struct item tmp_item;
@@ -3193,33 +3194,43 @@ int pc_steal_item(struct map_session_data *sd,struct block_list *bl)
md_status= status_get_status_data(bl);
md = (TBL_MOB *)bl;
- if(md->state.steal_flag>=battle_config.skill_steal_max_tries || md_status->mode&MD_BOSS || md->master_id ||
+ if(md->state.steal_flag>=battle_config.skill_steal_max_tries ||
+ md_status->mode&MD_BOSS || md->master_id ||
(md->class_>=1324 && md->class_<1364) || // prevent stealing from treasure boxes [Valaris]
map[md->bl.m].flag.nomobloot || // check noloot map flag [Lorky]
- md->sc.data[SC_STONE].timer != -1 || md->sc.data[SC_FREEZE].timer != -1 //status change check
+ md->sc.opt1 //status change check
)
return 0;
- skill = battle_config.skill_steal_type == 1
- ? (sd_status->dex - md_status->dex)/2 + pc_checkskill(sd,TF_STEAL)*6 + 10
- : sd_status->dex - md_status->dex + pc_checkskill(sd,TF_STEAL)*3 + 10;
+ rate = battle_config.skill_steal_type
+ ? (sd_status->dex - md_status->dex)/2 + lv*6 + 10
+ : sd_status->dex - md_status->dex + lv*3 + 10;
- skill+= sd->add_steal_rate; //Better make the steal_Rate addition affect % rather than an absolute on top of the total drop rate. [Skotlex]
+ rate += sd->add_steal_rate; //Better make the steal_Rate addition affect % rather than an absolute on top of the total drop rate. [Skotlex]
- if (skill < 1)
+ if (rate < 1)
return 0;
md->state.steal_flag++; //increase steal tries number
- for(i = 0; i<MAX_MOB_DROP; i++)//Pick one mobs drop slot.
- {
- itemid = md->db->dropitem[i].nameid;
- if(itemid <= 0 || (itemid>4000 && itemid<5000 && pc_checkskill(sd,TF_STEAL) <= 5))
- continue;
- if(rand() % 10000 < md->db->dropitem[i].p*skill/100)
- break;
+ //preliminar statistical data hints at this behaviour:
+ //each steal attempt: try to steal against ONE mob drop, and no more.
+ //We use a static index to prevent giving priority to any of the slots.
+ old_i = i;
+ do {
+ i++;
+ if (i == MAX_MOB_DROP-1 && lv <= 5)
+ continue; //Cannot steal "last slot" (card slot)
+ if (i == MAX_MOB_DROP)
+ i = 0;
+ } while (md->db->dropitem[i].p <= 0 && old_i != i);
+
+ if(old_i == i) {
+ md->state.steal_flag = UCHAR_MAX; //Tag for speed up in case you reinsist
+ return 0; //Mob has nothing stealable!
}
- if (i == MAX_MOB_DROP)
+
+ if(rand() % 10000 >= md->db->dropitem[i].p*rate/100)
return 0;
md->state.steal_flag = UCHAR_MAX; //you can't steal from this mob any more