summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorcelest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-11-25 16:37:02 +0000
committercelest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-11-25 16:37:02 +0000
commitd944e1b20e85f474ed4f08d4a9caf747b80bd51e (patch)
tree768966a7f35d789ec8ba7ea7d51aa64a4e13888b /src/map
parent4ad2c136939d190f29c1faf3775e6359cd82572b (diff)
downloadhercules-d944e1b20e85f474ed4f08d4a9caf747b80bd51e.tar.gz
hercules-d944e1b20e85f474ed4f08d4a9caf747b80bd51e.tar.bz2
hercules-d944e1b20e85f474ed4f08d4a9caf747b80bd51e.tar.xz
hercules-d944e1b20e85f474ed4f08d4a9caf747b80bd51e.zip
Added Ore Discovery, and base code for Slim Pitcher and Preservation
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/athena@361 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r--src/map/mob.c22
-rw-r--r--src/map/skill.c76
-rw-r--r--src/map/skill.h2
3 files changed, 96 insertions, 4 deletions
diff --git a/src/map/mob.c b/src/map/mob.c
index 93425c81e..ef67341f8 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -2458,6 +2458,28 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type)
log_drop(mvp_sd, md->class, log_item);
#endif
+ // Ore Discovery [Celest]
+ if (pc_checkskill(sd,BS_FINDINGORE)>0 && 1 >= rand()%1000) {
+ struct delay_item_drop *ditem;
+ int itemid[17] = { 714, 756, 757, 969, 984, 985, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1002 };
+ ditem=(struct delay_item_drop *)aCalloc(1,sizeof(struct delay_item_drop));
+ ditem->nameid = itemid[rand()%17];
+ log_item[i] = ditem->nameid;
+ ditem->amount = 1;
+ ditem->m = md->bl.m;
+ ditem->x = md->bl.x;
+ ditem->y = md->bl.y;
+ ditem->first_sd = mvp_sd;
+ ditem->second_sd = second_sd;
+ ditem->third_sd = third_sd;
+ add_timer(tick+500+i,mob_delay_item_drop,(int)ditem,0);
+ }
+
+ #ifndef TXT_ONLY
+ if(log_config.drop > 0)
+ log_drop(mvp_sd, md->class, log_item);
+ #endif
+
if(sd && sd->state.attack_type == BF_WEAPON) {
for(i=0;i<sd->monster_drop_item_count;i++) {
struct delay_item_drop *ditem;
diff --git a/src/map/skill.c b/src/map/skill.c
index 6078f1c0c..4ced6ac61 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -1728,7 +1728,7 @@ int skill_attack( int attack_type, struct block_list* src, struct block_list *ds
if(rand()%100 < rate)
skill_addtimerskill(src,tick + 800,bl->id,0,0,skillid,skilllv,0,flag);
}
- if(damage > 0 && dmg.flag&BF_SKILL && bl->type==BL_PC && pc_checkskill((struct map_session_data *)bl,RG_PLAGIARISM)){
+ if(damage > 0 && dmg.flag&BF_SKILL && bl->type==BL_PC && pc_checkskill((struct map_session_data *)bl,RG_PLAGIARISM) && sc_data[SC_PRESERVE].timer != -1){
struct map_session_data *tsd = (struct map_session_data *)bl;
nullpo_retr(0, tsd);
if(!tsd->status.skill[skillid].id && !tsd->status.skill[skillid].id
@@ -3849,6 +3849,7 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
}
}
break;
+
case RG_STRIPHELM: /* ストリップヘルム */
{
struct status_change *tsc_data = battle_get_sc_data(bl);
@@ -3871,6 +3872,31 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
}
}
break;
+
+ case ST_FULLSTRIP:
+ {
+ struct status_change *tsc_data = battle_get_sc_data(bl);
+
+ if(tsc_data && tsc_data[SC_CP_HELM].timer != -1)
+ break;
+ strip_per = 5+2*skilllv+strip_fix/5;
+ strip_time = skill_get_time(skillid,skilllv)+strip_fix/2;
+ if(rand()%100 < strip_per){
+ clif_skill_nodamage(src,bl,skillid,skilllv,1);
+ skill_status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,strip_time,0 );
+ 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,BF_SKILL);
+ break;
+ }
+ }
+ }
+ }
+ }
+ break;
+
+
/* PotionPitcher */
case AM_POTIONPITCHER: /* ポ?ションピッチャ? */
{
@@ -3904,7 +3930,7 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
hp = hp * (100 + pc_checkskill(sd,AM_POTIONPITCHER)*10 + pc_checkskill(sd,AM_LEARNINGPOTION)*5)/100;
if(dstsd) {
sp = dstsd->status.max_sp * sd->potion_per_sp / 100;
- sp = sp * (100 + pc_checkskill(sd,AM_POTIONPITCHER) + pc_checkskill(sd,AM_LEARNINGPOTION)*5)/100;
+ sp = sp * (100 + pc_checkskill(sd,AM_POTIONPITCHER)*10 + pc_checkskill(sd,AM_LEARNINGPOTION)*5)/100;
}
}
else {
@@ -3915,7 +3941,7 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
hp = hp * (100 + pc_checkskill(dstsd,SM_RECOVERY)*10) / 100;
}
if(sd->potion_sp > 0) {
- sp = sd->potion_sp * (100 + pc_checkskill(sd,AM_POTIONPITCHER) + pc_checkskill(sd,AM_LEARNINGPOTION)*5)/100;
+ sp = sd->potion_sp * (100 + pc_checkskill(sd,AM_POTIONPITCHER)*10 + pc_checkskill(sd,AM_LEARNINGPOTION)*5)/100;
sp = sp * (100 + (battle_get_int(bl)<<1)) / 100;
if(dstsd)
sp = sp * (100 + pc_checkskill(dstsd,MG_SRECOVERY)*10) / 100;
@@ -3976,6 +4002,7 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
skill_status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_get_time(skillid,skilllv),0 );
}
break;
+
case SA_DISPELL: /* ディスペル */
{
int i;
@@ -4345,12 +4372,14 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
if(sd)
skill_use_id(sd,src->id,sd->skillid_dance,sd->skilllv_dance);
break;
+
case AS_SPLASHER: /* ベナムスプラッシャ? */
if((double)battle_get_max_hp(bl)*2/3 < battle_get_hp(bl)) //HPが2/3以上?っていたら失敗
return 1;
clif_skill_nodamage(src,bl,skillid,skilllv,1);
skill_status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,skillid,src->id,0,skill_get_time(skillid,skilllv),0 );
break;
+
case PF_MINDBREAKER: /* プロボック */
{
struct status_change *sc_data = battle_get_sc_data(bl);
@@ -4389,6 +4418,20 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
}
break;
+ // Slim Pitcher [Celest]
+ case CR_SLIMPITCHER:
+ {
+ if (sd && flag&1) {
+ int hp = sd->potion_hp * (100 + pc_checkskill(sd,CR_SLIMPITCHER)*5 + pc_checkskill(sd,AM_POTIONPITCHER)*10 + pc_checkskill(sd,AM_LEARNINGPOTION)*5)/100;
+ hp = hp * (100 + (battle_get_vit(bl)<<1))/100;
+ if (dstsd)
+ hp = hp * (100 + pc_checkskill(dstsd,SM_RECOVERY)*10)/100;
+ clif_skill_nodamage(src,bl,skillid,skilllv,1);
+ battle_heal(src,bl,hp,0,0);
+ }
+ }
+ break;
+
case RG_CLEANER: //AppleGirl
clif_skill_nodamage(src,bl,skillid,skilllv,1);
{
@@ -4842,6 +4885,33 @@ int skill_castend_pos2( struct block_list *src, int x,int y,int skillid,int skil
clif_skill_poseffect(src,skillid,skilllv,x,y,tick);
}
break;
+
+ // Slim Pitcher [Celest]
+ case CR_SLIMPITCHER:
+ {
+ if (sd) {
+ int x = skilllv%11 - 1;
+ int i = pc_search_inventory(sd,skill_db[skillid].itemid[x]);
+ if(i < 0 || skill_db[skillid].itemid[x] <= 0 || sd->inventory_data[i] == NULL ||
+ sd->status.inventory[i].amount < skill_db[skillid].amount[x]) {
+ clif_skill_fail(sd,skillid,0,0);
+ map_freeblock_unlock();
+ return 1;
+ }
+ sd->state.potionpitcher_flag = 1;
+ sd->potion_hp = 0;
+ run_script(sd->inventory_data[i]->use_script,0,sd->bl.id,0);
+ pc_delitem(sd,i,skill_db[skillid].amount[x],0);
+ sd->state.potionpitcher_flag = 0;
+ if(sd->potion_hp > 0) {
+ map_foreachinarea(skill_area_sub,
+ src->m,x-3,y-3,x+3,y+3,0,
+ src,skillid,skilllv,tick,flag|BCT_ALL|1,
+ skill_castend_nodamage_id);
+ }
+ }
+ }
+ break;
}
return 0;
diff --git a/src/map/skill.h b/src/map/skill.h
index 3b2a942f0..9e5db0f59 100644
--- a/src/map/skill.h
+++ b/src/map/skill.h
@@ -352,7 +352,7 @@ enum { // struct map_session_data の status_changeの番?テ?ブル
SC_HAWKEYES = 199,
SC_BATTLEORDERS = 200,
SC_REGENERATION = 201,
-
+ SC_PRESERVE = 202,
// -- testing various SC effects
// SC_AURABLADE =81,