diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2008-01-10 22:02:33 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2008-01-10 22:02:33 +0000 |
commit | 234ababd8c1a9df4391c6c54f9167f625e432dc2 (patch) | |
tree | 6e7e67c85594893c8aab0730789f36e5c5d4f2ef /src/map/skill.c | |
parent | f9e689d36895ff10c03fc3c488da28693636d454 (diff) | |
download | hercules-234ababd8c1a9df4391c6c54f9167f625e432dc2.tar.gz hercules-234ababd8c1a9df4391c6c54f9167f625e432dc2.tar.bz2 hercules-234ababd8c1a9df4391c6c54f9167f625e432dc2.tar.xz hercules-234ababd8c1a9df4391c6c54f9167f625e432dc2.zip |
- Fixed getmonsterinfo to return "null" when returning the name of a non-existing mob instead of -1.
- Extended the status_percent_damage define to include a bolean to specify whether or not the target can be killed from it.
- Corrected CR_CULTIVATION to fail when the target cell has some BL_CHAR on it already.
- Changed the meaning of 'flag' in status_percent_change, to enable differentiation between damage that can kill the object and damage that cannot.
- Script command percentheal will no longer kill the player if the specified amount is negative (and not -100).
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12051 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/skill.c')
-rw-r--r-- | src/map/skill.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/map/skill.c b/src/map/skill.c index 2fba7b6ca..1015f2092 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -561,7 +561,7 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, int break; case HT_SHOCKWAVE: - status_percent_damage(src, bl, 0, 15*skilllv+5); + status_percent_damage(src, bl, 0, 15*skilllv+5, false); break; case HT_SANDMAN: @@ -603,7 +603,7 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, int break; case PA_PRESSURE: - status_percent_damage(src, bl, 0, 15+5*skilllv); + status_percent_damage(src, bl, 0, 15+5*skilllv, false); break; case RG_RAID: @@ -2710,12 +2710,12 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, int clif_skill_nodamage(src,bl,skillid,skilllv,1); if (skilllv == 5) skill_attack(BF_MAGIC,src,src,bl,skillid,skilllv,tick,flag); - status_percent_damage(src, bl, 0, 100); + status_percent_damage(src, bl, 0, 100, false); } else { clif_skill_nodamage(src,src,skillid,skilllv,1); if (skilllv == 5) skill_attack(BF_MAGIC,src,src,src,skillid,skilllv,tick,flag); - status_percent_damage(src, src, 0, 100); + status_percent_damage(src, src, 0, 100, false); } if (sd) skill_blockpc_start (sd, skillid, (skilllv < 5 ? 10000: 15000)); break; @@ -4261,7 +4261,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in if(sp < 1) sp = 1; status_heal(bl,0,sp,2); clif_skill_nodamage(bl,bl,SA_MAGICROD,tsc->data[SC_MAGICROD]->val1,1); - status_percent_damage(bl, src, 0, -20); //20% max SP damage. + status_percent_damage(bl, src, 0, -20, false); //20% max SP damage. } else { struct unit_data *ud = unit_bl2ud(bl); int bl_skillid=0,bl_skilllv=0,hp = 0; @@ -4787,7 +4787,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in switch (eff) { case 0: // heals SP to 0 - status_percent_damage(src, bl, 0, 100); + status_percent_damage(src, bl, 0, 100, false); break; case 1: // matk halved sc_start(bl,SC_INCMATKRATE,100,-50,skill_get_time2(skillid,skilllv)); @@ -5815,14 +5815,17 @@ int skill_castend_pos2(struct block_list* src, int x, int y, int skillid, int sk int i = skilllv - 1; int j = pc_search_inventory(sd,skill_db[skillid].itemid[i]); if(j < 0 || skill_db[skillid].itemid[i] <= 0 || sd->inventory_data[j] == NULL || - sd->status.inventory[j].amount < skill_db[skillid].amount[i]) { + sd->status.inventory[j].amount < skill_db[skillid].amount[i] || + map_count_oncell(src->m,x,y,BL_CHAR) > 0 + ) { clif_skill_fail(sd,skillid,0,0); return 1; } + pc_delitem(sd,j,skill_db[skillid].amount[i],0); clif_skill_poseffect(src,skillid,skilllv,x,y,tick); if (rand()%100 < 50) - mob_once_spawn(sd, sd->bl.m, x, y, "--ja--",(skilllv < 2 ? 1084+rand()%2 : 1078+rand()%6), 1, ""); + mob_once_spawn(sd, src->m, x, y, "--ja--",(skilllv < 2 ? 1084+rand()%2 : 1078+rand()%6), 1, ""); else clif_skill_fail(sd,skillid,0,0); } @@ -10263,7 +10266,7 @@ int skill_produce_mix (struct map_session_data *sd, int skill_id, int nameid, in } else { switch (skill_id) { case ASC_CDP: //25% Damage yourself, and display same effect as failed potion. - status_percent_damage(NULL, &sd->bl, -25, 0); + status_percent_damage(NULL, &sd->bl, -25, 0, true); case AM_PHARMACY: case AM_TWILIGHT1: case AM_TWILIGHT2: |