- UID
- 243149
- 帖子
- 3368
- 精华
- 7
- 威望
- 133
- 阅读权限
- 101
- 性别
- 男
- 来自
- 混沌虚空
- 注册时间
- 2004-11-17
|
127#
发表于 2005-5-17 09:08
| 只看该作者
紫色水晶R,2005-05-16, 09:30:48
讨论了半天还是不怎么样,看来小站的人也不过如此 行啊,看来是应该让这位“大虾”见识见识了……
int pc_steal_item(struct map_session_data *sd,struct block_list *bl)
{
if(sd != NULL && bl != NULL && bl->type == BL_MO {
int i,skill,itemid,flag, count;
struct mob_data *md;
md=(struct mob_data *)bl;
if(!md->state.steal_flag && mob_db[md->class_].mexp <= 0 && !(mob_db[md->class_].mode&0x20) &&
(!(md->class_>1324 && md->class_<1364))) // prevent stealing from treasure boxes [Valaris]
{
if (md->sc_data && (md->sc_data[SC_STONE].timer != -1 || md->sc_data[SC_FREEZE].timer != -1))
return 0;
skill = battle_config.skill_steal_type == 1
? (sd->paramc[4] - mob_db[md->class_].dex)/2 + pc_checkskill(sd,TF_STEAL)*6 + 10
: sd->paramc[4] - mob_db[md->class_].dex + pc_checkskill(sd,TF_STEAL)*3 + 10;
if(0 < skill)
{
for(count = 10; count <= 10 && count != 0; count--) //8 -> 10 Lupus
{
i = rand()%10; //8 -> 10 Lupus
itemid = mob_db[md->class_].dropitem.nameid;
if(itemid > 0 && itemdb_type(itemid) != 6)
{
//fixed rate. From Freya [Lupus]
if (rand() % 10000 < ((mob_db[md->class_].dropitem.p * skill) / 100 + sd->add_steal_rate))
{
struct item tmp_item;
memset(&tmp_item,0,sizeof(tmp_item));
tmp_item.nameid = itemid;
tmp_item.amount = 1;
tmp_item.identify = 1;
flag = pc_additem(sd,&tmp_item,1);
if(battle_config.show_steal_in_same_party)
{
party_foreachsamemap(pc_show_steal,sd,1,sd,tmp_ite m.nameid,0);
}
if(flag)
{
if(battle_config.show_steal_in_same_party)
{
party_foreachsamemap(pc_show_steal,sd,1,sd,tmp_ite m.nameid,1);
}
clif_additem(sd,0,0,flag);
}
md->state.steal_flag = 1;
return 1;
}
}
}
}
}
}
return 0;
basically it translate to something like: (i'm simplifying things)
(chance to steal) = (own dex) - (mob dex) + (steal level)*3 + 10
to determine your chance to steal which will be used in a formula later...
... there will be a random number chosen from 0 - 9 which determines your item drop... it will be checked if the item slot with the random number in the database of the monster contains an item... if it does it continues... (you have 10 chances to hit a slot containing an item)
N.B ( chance of jellopy drop for poring is 7000)
(Number_) = random number from 0 - 9999
item will be stolen if...
(Number_) < (chance of item drop) * (chance to steal) / 100 + (bonus from luck... only applicable in servers that allow modifications of droprates from luck)
but basically the success is determined if....
(Number_) < (chance of item drop) * (chance to steal) / 100
thats it... the rest of the code is basically talking about how it sets a steal flag on the monster to prevent it from being stolen again and the addition of item to the player...
P.S. the new kRO formula to calculate steal is exactly the same wif only the chance to steal different
(chance to steal) = ((own dex) - (mob dex))/2 + (steal level)*6 + 10
email me if you have any enquiries =)
hoshigami@gmail.com
P.S. the new kRO formula to calculate steal is exactly the same wif only the chance to steal different
(chance to steal) = ((own dex) - (mob dex))/2 + (steal level)*6 + 10
自己看吧,我们水平能力有限。请教此大虾解答。 |
|