From 9210ad1f04b6c6917f45c093f9a013a11082daa7 Mon Sep 17 00:00:00 2001 From: L0ne_W0lf Date: Wed, 28 Jul 2010 01:12:28 +0000 Subject: * 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 --- src/map/battle.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src') 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); -- cgit v1.2.3-70-g09d2