diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-10-26 07:16:47 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-10-26 07:16:47 +0000 |
commit | 9befe305370ddcc177ca36f1d4d6c295ddfb7533 (patch) | |
tree | 78136667031cc9c59a011db60b60bab5bab88f87 /src/map/skill.c | |
parent | ab7aaa8732cebbd42348b04647d55d30162b97b7 (diff) | |
download | hercules-9befe305370ddcc177ca36f1d4d6c295ddfb7533.tar.gz hercules-9befe305370ddcc177ca36f1d4d6c295ddfb7533.tar.bz2 hercules-9befe305370ddcc177ca36f1d4d6c295ddfb7533.tar.xz hercules-9befe305370ddcc177ca36f1d4d6c295ddfb7533.zip |
- Removed the config setting firewall_hits_on_undead setting, Firewall and kaensin now automatically calculate the number of hits they should do per iteration based on the skill trigger frequency (you may want to raise that delay of 1ms in the db, though)
- Cleaned a bit the loop for the Warmth skills.
- Added a mising pc_class2idx invocation (fixes a very minor bug when you request max skill lv for a skill in your tree with different max than the skill_db max)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11578 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/skill.c')
-rw-r--r-- | src/map/skill.c | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/src/map/skill.c b/src/map/skill.c index 130087e33..a73a820e7 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -758,6 +758,7 @@ const char* skill_get_desc( int id ){ int skill_tree_get_max(int id, int b_class) { int i, skillid; + b_class = pc_class2idx(b_class); for(i=0;(skillid=skill_tree[b_class][i].id)>0;i++) if (id == skillid) return skill_tree[b_class][i].max; return skill_get_max (id); @@ -7324,23 +7325,19 @@ int skill_unit_onplace_timer (struct skill_unit *src, struct block_list *bl, uns { case UNT_FIREWALL: case UNT_KAENSIN: - if (tstatus->def_ele == ELE_FIRE || battle_check_undead(tstatus->race, tstatus->def_ele)) { - int count=0; - //Fire property mobs and Undeads are never knocked back - //Should hit every 20ms [Playtester] - while (count++ < battle_config.firewall_hits_on_undead && !status_isdead(bl) && src->val2--) - skill_attack(BF_MAGIC,ss,&src->bl,bl,sg->skill_id,sg->skill_lv,tick+count*20,1); - } else { - int count=0; - int x = bl->x, y = bl->y; - //If target isn't knocked back it should hit every 20ms [Playtester] - while (count++ < battle_config.firewall_hits_on_undead && x == bl->x && y == bl->y && !status_isdead(bl) && src->val2--) - skill_attack(BF_MAGIC,ss,&src->bl,bl,sg->skill_id,sg->skill_lv,tick+count*20,0); - } + { + int count=0; + const int x = bl->x, y = bl->y; + //Take into account these hit more times than the timer interval + //can handle. + do + skill_attack(BF_MAGIC,ss,&src->bl,bl,sg->skill_id,sg->skill_lv,tick+count*sg->interval,0); + while(--src->val2 && x == bl->x && y == bl->y && + ++count < SKILLUNITTIMER_INTERVAL/sg->interval && !status_isdead(bl)); if (src->val2<=0) skill_delunit(src); break; - + } case UNT_SANCTUARY: if (battle_check_undead(tstatus->race, tstatus->def_ele) || tstatus->race==RC_DEMON) { //Only damage enemies with offensive Sanctuary. [Skotlex] @@ -7397,20 +7394,21 @@ int skill_unit_onplace_timer (struct skill_unit *src, struct block_list *bl, uns case SG_STAR_WARM: { int count=0; - int x = bl->x, y = bl->y; + const int x = bl->x, y = bl->y; //If target isn't knocked back it should hit every 20ms [Playtester] - while( count++ < SKILLUNITTIMER_INTERVAL/sg->interval && x == bl->x && y == bl->y && !status_isdead(bl) ) + do { if( bl->type == BL_PC ) status_zap(bl, 0, 15); //Only damage SP [Skotlex] else // mobs if( status_charge(ss, 0, 2) ) // costs 2 SP per hit - skill_attack(BF_WEAPON,ss,&src->bl,bl,sg->skill_id,sg->skill_lv,tick+count*20,0); + skill_attack(BF_WEAPON,ss,&src->bl,bl,sg->skill_id,sg->skill_lv,tick+count*sg->interval,0); else { //should end when out of sp. sg->limit = DIFF_TICK(tick,sg->tick); break; } - } + } while( x == bl->x && y == bl->y && + ++count < SKILLUNITTIMER_INTERVAL/sg->interval && !status_isdead(bl) ); } break; case WZ_STORMGUST: |