diff options
author | L0ne_W0lf <L0ne_W0lf@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2010-07-28 01:12:28 +0000 |
---|---|---|
committer | L0ne_W0lf <L0ne_W0lf@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2010-07-28 01:12:28 +0000 |
commit | 9210ad1f04b6c6917f45c093f9a013a11082daa7 (patch) | |
tree | 279bf72af8afe3c9daf6d6bd5b98cb0710a19759 /src/map/battle.c | |
parent | 37c8176d5e1f7696587e942cd38e845376ae00f2 (diff) | |
download | hercules-9210ad1f04b6c6917f45c093f9a013a11082daa7.tar.gz hercules-9210ad1f04b6c6917f45c093f9a013a11082daa7.tar.bz2 hercules-9210ad1f04b6c6917f45c093f9a013a11082daa7.tar.xz hercules-9210ad1f04b6c6917f45c093f9a013a11082daa7.zip |
* Rev. 14365 Updated npc_randomattack, it now does 100*skillevel percent damage.
* Added patch from Paradox to allow a skill to use a random element for damage. See skill DB for info.
* Updated entry for npc_randomattack in the skill database, now uses the newly added -3 element.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14365 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/battle.c')
-rw-r--r-- | src/map/battle.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/map/battle.c b/src/map/battle.c index de0bfe07f..3ed1aa33c 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -1093,6 +1093,8 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src,struct blo } else if( s_ele == -2 ) //Use enchantment's element s_ele = s_ele_ = status_get_attack_sc_element(src,sc); + else if( s_ele == -3 ) //Use random element + s_ele = s_ele_ = rand()%ELE_MAX; switch( skill_num ) { case GS_GROUNDDRIFT: @@ -1502,7 +1504,7 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src,struct blo skillratio += 100; //Max damage for non players. break; case NPC_RANDOMATTACK: - skillratio += rand()%150-50; + skillratio += 100*skill_lv; break; case NPC_WATERATTACK: case NPC_GROUNDATTACK: @@ -2277,6 +2279,8 @@ struct Damage battle_calc_magic_attack(struct block_list *src,struct block_list s_ele = sstatus->rhw.ele; else if (s_ele == -2) //Use status element s_ele = status_get_attack_sc_element(src,status_get_sc(src)); + else if( s_ele == -3 ) //Use random element + s_ele = rand()%ELE_MAX; //Set miscellaneous data that needs be filled if(sd) { @@ -2611,8 +2615,10 @@ struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list * } s_ele = skill_get_ele(skill_num, skill_lv); - if (s_ele < 0) //Attack that takes weapon's element for misc attacks? Make it neutral [Skotlex] + if (s_ele < 0 && s_ele != -3) //Attack that takes weapon's element for misc attacks? Make it neutral [Skotlex] s_ele = ELE_NEUTRAL; + else if (s_ele == -3) //Use random element + s_ele = rand()%ELE_MAX; //Skill Range Criteria md.flag |= battle_range_type(src, target, skill_num, skill_lv); |