Browse Source

* 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://svn.code.sf.net/p/rathena/svn/trunk@14365 54d463be-8e91-2dee-dedb-b68131a5f0ec

L0ne_W0lf 15 năm trước cách đây
mục cha
commit
651dc32ac0
4 tập tin đã thay đổi với 16 bổ sung4 xóa
  1. 3 0
      Changelog-Trunk.txt
  2. 2 0
      db/Changelog.txt
  3. 3 2
      db/skill_db.txt
  4. 8 2
      src/map/battle.c

+ 3 - 0
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]

+ 2 - 0
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

+ 3 - 2
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

+ 8 - 2
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);