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 --- Changelog-Trunk.txt | 3 +++ db/Changelog.txt | 2 ++ db/skill_db.txt | 5 +++-- src/map/battle.c | 10 ++++++++-- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index 84adbf7db..03fc4b67e 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -3,6 +3,9 @@ Date Added AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK. IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. +2010/07/27 + * Rev. 14365 Updated npc_randomattack, it now does 100*skillevel percent damage. [L0ne_W0lf] + * Added patch from Paradox to allow a skill to use a random element for damage. See skill DB for info. 2010/06/27 * Rev. 14358 Follow up to r14357. Moved where sd is checked for existance in specialeffect2. [L0ne_W0lf] * Rev. 14357 Updated specialeffect2 to accept player names. (follow up to r14353) [L0ne_W0lf] diff --git a/db/Changelog.txt b/db/Changelog.txt index 9d3064384..3903c3de6 100644 --- a/db/Changelog.txt +++ b/db/Changelog.txt @@ -8,6 +8,8 @@ 1475 Equestrian's Spear: NEED INFO. 13005 Angelic Wing Dagger: NEED INFO. ======================= +2010/07/27 + * Rev. 14365 Updated entry for npc_randomattack in the skill database, now uses the newly added -3 element. [L0ne_W0lf] 2010/07/16 * Rev. 14364 Added two new item groups, and implemented the remaining in the item database. [L0ne_W0lf] 2010/07/10 diff --git a/db/skill_db.txt b/db/skill_db.txt index 079361b9e..bbb9eb6c0 100644 --- a/db/skill_db.txt +++ b/db/skill_db.txt @@ -4,8 +4,9 @@ // if range is < 5, the skill is considered melee-range) // 03 hit (8- repeated hitting, 6- single-hit) // 04 inf (0- passive, 1- enemy, 2- place, 4- self, 16- friend, 32- trap) -// 05 element (0- neutral, 1- water, 2- earth, 3- fire, 4- wind, 5- poison, -// 6- holy, 7- dark, 8- ghost, 9- undead, -1- use weapon element) +// 05 element (0 - neutral, 1 - water, 2 - earth, 3 - fire, 4 - wind, 5 - poison, +// 6 - holy, 7 - dark, 8 - ghost, 9 - undead, -1 - use weapon element +// -2 - use endowed element, -3 - use random element.) // 06 nk (skill damage properties): // 0x01 - No damage skill // 0x02 - Has splash area 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