summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-12-04 11:36:31 -0200
committershennetsind <ind@henn.et>2013-12-04 11:36:31 -0200
commit2350c7e6a28630c0157ebca7e41f96b7716e79ce (patch)
tree2114c6ed441588450b01473e3896d620e513eaac /src/map/pc.c
parent85023b1aad64d2b3b5d5ff53e1704abe0e689aa9 (diff)
parentfdd8d1556526abcfbc95263aa3b0a651e7f4cf0a (diff)
downloadhercules-2350c7e6a28630c0157ebca7e41f96b7716e79ce.tar.gz
hercules-2350c7e6a28630c0157ebca7e41f96b7716e79ce.tar.bz2
hercules-2350c7e6a28630c0157ebca7e41f96b7716e79ce.tar.xz
hercules-2350c7e6a28630c0157ebca7e41f96b7716e79ce.zip
Merge branch 'master' of https://github.com/HerculesWS/Hercules
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c34
1 files changed, 20 insertions, 14 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index 85285e55c..f29ff7567 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -1136,7 +1136,12 @@ bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_tim
for( i = 0; i < 3; i++ )
sd->hate_mob[i] = -1;
- //warp player
+ sd->quest_log = NULL;
+ sd->num_quests = 0;
+ sd->avail_quests = 0;
+ sd->save_quest = false;
+
+ //warp player
if ((i=pc->setpos(sd,sd->status.last_point.map, sd->status.last_point.x, sd->status.last_point.y, CLR_OUTSIGHT)) != 0) {
ShowError ("Last_point_map %s - id %d not found (error code %d)\n", mapindex_id2name(sd->status.last_point.map), sd->status.last_point.map, i);
@@ -4819,14 +4824,16 @@ int pc_steal_item(struct map_session_data *sd,struct block_list *bl, uint16 skil
return 1;
}
-/*==========================================
- * Stole zeny from bl (mob)
- * return
- * 0 = fail
- * 1 = success
- *------------------------------------------*/
-int pc_steal_coin(struct map_session_data *sd,struct block_list *target) {
- int rate,skill_lv;
+/**
+ * Steals zeny from a monster through the RG_STEALCOIN skill.
+ *
+ * @param sd Source character
+ * @param target Target monster
+ *
+ * @return Amount of stolen zeny (0 in case of failure)
+ **/
+int pc_steal_coin(struct map_session_data *sd, struct block_list *target) {
+ int rate, skill_lv;
struct mob_data *md;
if(!sd || !target || target->type != BL_MOB)
return 0;
@@ -4838,15 +4845,14 @@ int pc_steal_coin(struct map_session_data *sd,struct block_list *target) {
if( mob_is_treasure(md) )
return 0;
- // FIXME: This formula is either custom or outdated.
- skill_lv = pc->checkskill(sd,RG_STEALCOIN)*10;
- rate = skill_lv + (sd->status.base_level - md->level)*3 + sd->battle_status.dex*2 + sd->battle_status.luk*2;
+ skill_lv = pc->checkskill(sd, RG_STEALCOIN);
+ rate = skill_lv*10 + (sd->status.base_level - md->level)*2 + sd->battle_status.dex/2 + sd->battle_status.luk/2;
if(rnd()%1000 < rate) {
- int amount = md->level*10 + rnd()%100;
+ int amount = md->level * skill_lv / 10 + md->level*8 + rnd()%(md->level*2 + 1); // mob_lv * skill_lv / 10 + random [mob_lv*8; mob_lv*10]
pc->getzeny(sd, amount, LOG_TYPE_STEAL, NULL);
md->state.steal_coin_flag = 1;
- return 1;
+ return amount;
}
return 0;
}