From 13c3b8e817abaddba678717d5428844607dbf487 Mon Sep 17 00:00:00 2001 From: skotlex Date: Mon, 13 Feb 2006 19:48:56 +0000 Subject: - Made the NPC_BREAK* skills attack skills again, their chance of equipment breaking code was moved to skill_additional_effect. - Added zeroing of skilltarget in skill_castend_id when skill fails. - Now when the exp table does not has enough data to reach the max level specified, the max level will not be reduced to enable leveling through quests/scripts/gm-commands/etc. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5271 54d463be-8e91-2dee-dedb-b68131a5f0ec --- Changelog-Trunk.txt | 5 ++++ db/skill_db.txt | 8 +++--- src/map/pc.c | 7 +++-- src/map/skill.c | 83 ++++++++++++++++++++++++++--------------------------- 4 files changed, 54 insertions(+), 49 deletions(-) diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index bce04dfae..47d519334 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -5,6 +5,11 @@ IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. EV GOES INTO TRUNK AND WILL BE MERGED INTO STABLE BY VALARIS AND WIZPUTER. -- VALARIS 2006/02/13 + * Made the NPC_BREAK* skills attack skills again, their chance of equipment + breaking code was moved to skill_additional_effect. [Skotlex] + * Now when the exp table does not has enough data to reach the max level + specified, the max level will not be reduced to enable leveling through + quests/scripts/gm-commands/etc. [Skotlex] * Made Land Protector Block Hammerfall. [Skotlex] * Updated item_db code to stop creating items for every non-existant ID used. Instead it will complain, and use a dummy item that has the view ID diff --git a/db/skill_db.txt b/db/skill_db.txt index 7ff7d02c2..02cc2cc49 100644 --- a/db/skill_db.txt +++ b/db/skill_db.txt @@ -359,10 +359,10 @@ 340,9,8,1,7,0,10,1:1:2:2:3:3:4:4:5:5,yes,0,2,0,magic,0 //NPC_DARKSTRIKE#Soul Strike of Darkness# 341,9,8,1,7,0,10,3:4:5:6:7:8:9:10:11:12,yes,0,2,0,magic,2:3:3:4:4:5:5:6:6:7 //NPC_DARKTHUNDER#Darkness Jupiter# 342,9,6,1,0,1,1,0,no,0,2,0,none,0 //NPC_STOP -343,9,6,1,0,1,10,1,no,0,2,0,weapon,0 //NPC_BREAKWEAPON#Break weapon# -344,9,6,1,0,1,10,1,no,0,2,0,weapon,0 //NPC_BREAKARMOR#Break armor# -345,9,6,1,0,1,10,1,no,0,2,0,weapon,0 //NPC_BREAKHELM#Break helm# -346,9,6,1,0,1,10,1,no,0,2,0,weapon,0 //NPC_BREAKSHIELD#Break shield# +343,9,6,1,-1,0,10,1,no,0,2,0,weapon,0 //NPC_BREAKWEAPON#Break weapon# +344,9,6,1,-1,0,10,1,no,0,2,0,weapon,0 //NPC_BREAKARMOR#Break armor# +345,9,6,1,-1,0,10,1,no,0,2,0,weapon,0 //NPC_BREAKHELM#Break helm# +346,9,6,1,-1,0,10,1,no,0,2,0,weapon,0 //NPC_BREAKSHIELD#Break shield# 347,-1,6,1,9,0,10,1,no,0,2,0,weapon,0 //NPC_UNDEADATTACK 348,0,0,4,9,1,10,1,no,0,2,0,magic,0 //NPC_CHANGEUNDEAD 349,0,6,4,0,1,10,0,no,0,2,0,weapon,0 //NPC_POWERUP diff --git a/src/map/pc.c b/src/map/pc.c index a19ff6538..11fe0d53c 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -8146,9 +8146,10 @@ int pc_readdb(void) //0: x, 1: x, 2: x: 3: x 4: 0 <- last valid value is at 3. while ((i = max_level[job][type]-2) >= 0 && exp_table[job][type][i] <= 0) max_level[job][type]--; - if (max_level[job][type] < max) { - ShowError("pc_readdb: Specified max %d for job %d, but that job's exp table only goes up to level %d.\n", max, job, max_level[job][type]); + ShowWarning("pc_readdb: Specified max %d for job %d, but that job's exp table only goes up to level %d.\n", max, job, max_level[job][type]); + ShowNotice("(You may still reach lv %d through scripts/gm-commands)\n"); + max_level[job][type] = max; } // ShowDebug("%s - Class %d: %d\n", type?"Job":"Base", job, max_level[job][type]); for (i = 1; i < job_count; i++) { @@ -8158,7 +8159,7 @@ int pc_readdb(void) continue; } memcpy(exp_table[job][type], exp_table[jobs[0]][type], sizeof(exp_table[0][0])); - max_level[job][type] = max_level[jobs[0]][type]; + max_level[job][type] = max; // ShowDebug("%s - Class %d: %d\n", type?"Job":"Base", job, max_level[job][type]); } } diff --git a/src/map/skill.c b/src/map/skill.c index df195df00..6809b3ce8 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -1075,20 +1075,20 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, int clif_updatestatus(dstsd,SP_SP); } break; - case SL_STUN: - if (status_get_size(bl)==1) //Only stuns mid-sized mobs. - status_change_start(bl,SC_STAN,(30+10*skilllv),skilllv,0,0,0,skill_get_time(skillid,skilllv),0); - break; - case SG_SUN_WARM: - case SG_MOON_WARM: - case SG_STAR_WARM: - if (dstsd) { - dstsd->status.sp -= 5; - if(dstsd->status.sp < 0) - dstsd->status.sp = 0; - clif_updatestatus(dstsd,SP_SP); - } - break; + case SL_STUN: + if (status_get_size(bl)==1) //Only stuns mid-sized mobs. + status_change_start(bl,SC_STAN,(30+10*skilllv),skilllv,0,0,0,skill_get_time(skillid,skilllv),0); + break; + case SG_SUN_WARM: + case SG_MOON_WARM: + case SG_STAR_WARM: + if (dstsd) { + dstsd->status.sp -= 5; + if(dstsd->status.sp < 0) + dstsd->status.sp = 0; + clif_updatestatus(dstsd,SP_SP); + } + break; /* MOBの追加?果付きスキル */ case NPC_PETRIFYATTACK: @@ -1113,6 +1113,26 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, int pc_heal(dstsd,0,-sp); } break; + // Equipment breaking monster skills [Celest] + case NPC_BREAKWEAPON: + if(dstsd && rand()%10000 < 10*skilllv*battle_config.equip_skill_break_rate) + pc_breakweapon(dstsd); + break; + + case NPC_BREAKARMOR: + if(dstsd && rand()%10000 < 10*skilllv*battle_config.equip_skill_break_rate) + pc_breakarmor(dstsd); + break; + + case NPC_BREAKHELM: + if(dstsd && rand()%10000 < 10*skilllv*battle_config.equip_skill_break_rate) + pc_breakhelm(dstsd); + break; + + case NPC_BREAKSHIELD: + if(dstsd && rand()%10000 < 10*skilllv*battle_config.equip_skill_break_rate) + pc_breakshield(dstsd); + break; case CH_TIGERFIST: status_change_start(bl,SC_STOP,(10+skilllv*10),0,0,0,0,skill_get_time2(skillid,skilllv),0); @@ -2532,6 +2552,10 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl,int s case NPC_HOLYATTACK: case NPC_DARKNESSATTACK: case NPC_TELEKINESISATTACK: + case NPC_BREAKARMOR: + case NPC_BREAKHELM: + case NPC_BREAKSHIELD: + case NPC_BREAKWEAPON: case NPC_UNDEADATTACK: case LK_AURABLADE: /* オ?ラブレ?ド */ case LK_SPIRALPIERCE: /* スパイラルピア?ス */ @@ -5042,31 +5066,6 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in clif_skill_nodamage(src,bl,skillid,skilllv,1); break; - // Equipment breaking monster skills [Celest] - case NPC_BREAKWEAPON: - clif_skill_nodamage(src,bl,skillid,skilllv,1); - if(dstsd && rand()%10000 < 10*skilllv*battle_config.equip_skill_break_rate) - pc_breakweapon(dstsd); - break; - - case NPC_BREAKARMOR: - clif_skill_nodamage(src,bl,skillid,skilllv,1); - if(dstsd && rand()%10000 < 10*skilllv*battle_config.equip_skill_break_rate) - pc_breakarmor(dstsd); - break; - - case NPC_BREAKHELM: - clif_skill_nodamage(src,bl,skillid,skilllv,1); - if(dstsd && rand()%10000 < 10*skilllv*battle_config.equip_skill_break_rate) - pc_breakhelm(dstsd); - break; - - case NPC_BREAKSHIELD: - clif_skill_nodamage(src,bl,skillid,skilllv,1); - if(dstsd && rand()%10000 < 10*skilllv*battle_config.equip_skill_break_rate) - pc_breakshield(dstsd); - break; - case NPC_POWERUP: // +20% attack per skill level? It's a guess... [Skotlex] status_change_start(bl,SC_INCATKRATE,100,40*skilllv,0,0,0,skilllv * 60000,0); @@ -5773,8 +5772,7 @@ int skill_castend_id( int tid, unsigned int tick, int id,int data ) nullpo_retr(0, sd); //Code cleanup. -#undef skill_failed -#define skill_failed(sd) { sd->skillid = sd->skilllv = sd->skillitem = sd->skillitemlv = -1; sd->canact_tick = sd->canmove_tick = tick; } +#define skill_failed(sd) { sd->skillid = sd->skilllv = sd->skillitem = sd->skillitemlv = -1; sd->canact_tick = sd->canmove_tick = tick; sd->skilltarget = 0; } if(sd->skillid != SA_CASTCANCEL && sd->skilltimer != tid ) { /* タイマIDの確認 */ @@ -5904,6 +5902,7 @@ int skill_castend_id( int tid, unsigned int tick, int id,int data ) sd->skilltarget = 0; } return 0; +#undef skill_failed } /*---------------------------------------------------------------------------- */ @@ -5920,7 +5919,6 @@ int skill_castend_pos( int tid, unsigned int tick, int id,int data ) nullpo_retr(0, sd); //Code cleanup. -#undef skill_failed #define skill_failed(sd) { sd->skillid = sd->skilllv = sd->skillitem = sd->skillitemlv = -1; sd->canact_tick = sd->canmove_tick = tick; } if( sd->skilltimer != tid ) @@ -6005,6 +6003,7 @@ int skill_castend_pos( int tid, unsigned int tick, int id,int data ) if (sd->skillid != AL_WARP) sd->skillid = sd->skilllv = -1; //Clean this up for future references to battle_getcurrentskill. [Skotlex] return 0; +#undef skill_failed } /*========================================== -- cgit v1.2.3-70-g09d2