Pārlūkot izejas kodu

Added updated client effects list.
Corrected some doc/npc typos.
Reindented some mob AI code.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@13074 54d463be-8e91-2dee-dedb-b68131a5f0ec

ultramage 17 gadi atpakaļ
vecāks
revīzija
a9a32d2da8
4 mainītis faili ar 63 papildinājumiem un 42 dzēšanām
  1. 19 4
      doc/effect_list.txt
  2. 1 1
      doc/script_commands.txt
  3. 1 1
      npc/merchants/inn.txt
  4. 42 36
      src/map/mob.c

+ 19 - 4
doc/effect_list.txt

@@ -3,7 +3,7 @@
 //===== By ================================================
 //= Valaris, Spira, Au{R}oN, Tharis, HiddenDragon
 //===== Version ===========================================
-//= 1.8
+//= 2.1
 //=========================================================
 //= 1.0 - Formatted to the standard
 //= 1.1 - New Effects, up to 2007/05/07 Sakexe. [Au{R}oN]
@@ -14,6 +14,9 @@
 //= 1.6 - New Effects, up to 2008/01/02 Sakexe. [Au{R}oN]
 //= 1.7 - New Effects, up to 2008/03/26 Sakexe. [Au{R}oN]
 //= 1.8 - Corrected several effect descriptions. [L0ne_W0lf]
+//= 1.9 - New Effects, up to 2008/05/28 Sakexe. [Au{R}oN]
+//= 2.0 - New Effects, up to 2008/07/15 Sakexe. [Au{R}oN]
+//= 2.1 - New Effects, up to 2008/08/06a Sakexe. [Au{R}oN]
 //===== Description =======================================
 //= A list of client-side effects sorted by their ID
 //=========================================================
@@ -722,8 +725,20 @@ number	description
 693.	Translucent yellow circle
 694.	Translucent green circle
 695.	Rotating green light
-696.	The same of 690 and 691 but Blue/Purple.
+696.	The same of 690 and 691 but Blue/Purple
 697.	(Nothing)
 698.	(Nothing)
-699.	Fall of powder from the sky and raise of some leaf.
-700+.	No More Effects From 2008/03/26 Sakexe.
+699.	Fall of powder from the sky and raise of some leaf
+700.	Big Colored Green Sphere.
+701.	Little Colored Violet Sphere
+702.	Light Infltrarion from and Fall of powder from the sky
+703.	(Nothing)
+704.	(Nothing)
+705.	(Nothing)
+706.	(Nothing)
+707.	Client Crash :P
+708.	A Perfect Copy of Storm Gust Effect (Effect 89)
+709.	A Firework that split in 4 mini fireworks
+710.	A Sphere like Effect 701 but Green, and a bit more larger
+711.	A big violet wall
+712.	No More Effects From 2008/08/06a Sakexe.

+ 1 - 1
doc/script_commands.txt

@@ -4887,7 +4887,7 @@ complete the effect.
 
 Changes the display name and/or display class of the target npc.
 Returns 0 is successful, 1 if the npc does not exist.
-Size is 0 = norma 1 = small 2 = big.
+Size is 0 = normal 1 = small 2 = big.
 
 Since trunk r11779
 

+ 1 - 1
npc/merchants/inn.txt

@@ -59,7 +59,7 @@ prt_in,61,141,2	script	Inn Employee#Ahlma	53,{
 }
 
 //======================== Alberta ====================================
-alberta_in,32,142,3	script	Inn Employee#Moira	53,{
+alberta_in,32,142,3	script	Inn Employee#Jennie	53,{
 
 	callfunc "F_InnMaid","[Employee Jennie]","'Fisherman Inn'!","alberta_in",26,142;
 	warp "alberta_in",18,188; end;

+ 42 - 36
src/map/mob.c

@@ -1481,48 +1481,55 @@ static bool mob_ai_sub_hard(struct mob_data *md, unsigned int tick)
 	}
 			
 	// Check for target change.
-	if (md->attacked_id && mode&MD_CANATTACK)
+	if( md->attacked_id && mode&MD_CANATTACK )
 	{
-		if (md->attacked_id == md->target_id)
+		if( md->attacked_id == md->target_id )
 		{	//Rude attacked check.
-			if (!battle_check_range(&md->bl, tbl, md->status.rhw.range) &&
-				(	//Can't attack back and can't reach back.
-					(!can_move && DIFF_TICK(tick, md->ud.canmove_tick) > 0 &&
-					  	(battle_config.mob_ai&0x2 || md->sc.data[SC_SPIDERWEB])) ||
-					(!mob_can_reach(md, tbl, md->min_chase, MSS_RUSH))
-				) &&
-				md->state.attacked_count++ >= RUDE_ATTACKED_COUNT &&
-				!mobskill_use(md, tick, MSC_RUDEATTACKED) && //If can't rude Attack
-				can_move && unit_escape(&md->bl, tbl, rand()%10 +1)) //Attempt escape
+			if( !battle_check_range(&md->bl, tbl, md->status.rhw.range)
+			&&  ( //Can't attack back and can't reach back.
+			      (!can_move && DIFF_TICK(tick, md->ud.canmove_tick) > 0 && (battle_config.mob_ai&0x2 || md->sc.data[SC_SPIDERWEB]))
+			      || !mob_can_reach(md, tbl, md->min_chase, MSS_RUSH)
+			    )
+			&&  md->state.attacked_count++ >= RUDE_ATTACKED_COUNT
+			&&  !mobskill_use(md, tick, MSC_RUDEATTACKED) //If can't rude Attack
+			&&  can_move && unit_escape(&md->bl, tbl, rand()%10 +1)) //Attempt escape
 			{	//Escaped
 				md->attacked_id = 0;
 				return true;
 			}
-		} else
-		if ((abl= map_id2bl(md->attacked_id)) && (!tbl || mob_can_changetarget(md, abl, mode))) {
-			if (md->bl.m != abl->m || abl->prev == NULL ||
-				(dist = distance_bl(&md->bl, abl)) >= MAX_MINCHASE ||
-				battle_check_target(&md->bl, abl, BCT_ENEMY) <= 0 ||
-				(battle_config.mob_ai&0x2 && !status_check_skilluse(&md->bl, abl, 0, 0)) || //Retaliate check
-				(!battle_check_range(&md->bl, abl, md->status.rhw.range) &&
-					( //Reach check
-					(!can_move && DIFF_TICK(tick, md->ud.canmove_tick) > 0 &&
-							(battle_config.mob_ai&0x2 || md->sc.data[SC_SPIDERWEB])) ||
-						!mob_can_reach(md, abl, dist+md->db->range3, MSS_RUSH)
-					)
+		}
+		else
+		if( (abl= map_id2bl(md->attacked_id)) && (!tbl || mob_can_changetarget(md, abl, mode)) )
+		{
+			if (md->bl.m != abl->m || abl->prev == NULL
+			|| (dist = distance_bl(&md->bl, abl)) >= MAX_MINCHASE
+			|| battle_check_target(&md->bl, abl, BCT_ENEMY) <= 0
+			|| (battle_config.mob_ai&0x2 && !status_check_skilluse(&md->bl, abl, 0, 0)) //Retaliate check
+			|| (!battle_check_range(&md->bl, abl, md->status.rhw.range)
+				&&
+				( //Reach check
+				  (!can_move && DIFF_TICK(tick, md->ud.canmove_tick) > 0 && (battle_config.mob_ai&0x2 || md->sc.data[SC_SPIDERWEB]))
+				  || !mob_can_reach(md, abl, dist+md->db->range3, MSS_RUSH)
+				  )
 				)
-			)	{	//Rude attacked
-				if (md->state.attacked_count++ >= RUDE_ATTACKED_COUNT &&
-					!mobskill_use(md, tick, MSC_RUDEATTACKED) && can_move &&
-					!tbl && unit_escape(&md->bl, abl, rand()%10 +1))
+			)
+			{	//Rude attacked
+				if (md->state.attacked_count++ >= RUDE_ATTACKED_COUNT
+				&& !mobskill_use(md, tick, MSC_RUDEATTACKED) && can_move
+				&& !tbl && unit_escape(&md->bl, abl, rand()%10 +1))
 				{	//Escaped.
 					//TODO: Maybe it shouldn't attempt to run if it has another, valid target?
 					md->attacked_id = 0;
 					return true;
 				}
-			} else if (!(battle_config.mob_ai&0x2) && !status_check_skilluse(&md->bl, abl, 0, 0)) {
+			}
+			else
+			if (!(battle_config.mob_ai&0x2) && !status_check_skilluse(&md->bl, abl, 0, 0))
+			{
 				//Can't attack back, but didn't invoke a rude attacked skill...
-			} else { //Attackable
+			}
+			else
+			{ //Attackable
 				if (!tbl || dist < md->status.rhw.range || !check_distance_bl(&md->bl, tbl, dist)
 					|| battle_gettarget(tbl) != md->bl.id)
 				{	//Change if the new target is closer than the actual one
@@ -1537,6 +1544,7 @@ static bool mob_ai_sub_hard(struct mob_data *md, unsigned int tick)
 				}
 			}
 		}
+
 		//Clear it since it's been checked for already.
 		md->attacked_id = 0;
 	}
@@ -1549,20 +1557,18 @@ static bool mob_ai_sub_hard(struct mob_data *md, unsigned int tick)
 	if (!tbl && mode&MD_LOOTER && md->lootitem && DIFF_TICK(tick, md->ud.canact_tick) > 0 &&
 		(md->lootitem_count < LOOTITEM_SIZE || battle_config.monster_loot_type != 1))
 	{	// Scan area for items to loot, avoid trying to loot of the mob is full and can't consume the items.
-		map_foreachinrange (mob_ai_sub_hard_lootsearch, &md->bl,
-			view_range, BL_ITEM, md, &tbl);
+		map_foreachinrange (mob_ai_sub_hard_lootsearch, &md->bl, view_range, BL_ITEM, md, &tbl);
 	}
 
 	if ((!tbl && mode&MD_AGGRESSIVE) || md->state.skillstate == MSS_FOLLOW)
 	{
-		map_foreachinrange (mob_ai_sub_hard_activesearch, &md->bl,
-			view_range, DEFAULT_ENEMY_TYPE(md), md, &tbl);
-	} else
+		map_foreachinrange (mob_ai_sub_hard_activesearch, &md->bl, view_range, DEFAULT_ENEMY_TYPE(md), md, &tbl);
+	}
+	else
 	if (mode&MD_CHANGECHASE && (md->state.skillstate == MSS_RUSH || md->state.skillstate == MSS_FOLLOW))
 	{
 		search_size = view_range<md->status.rhw.range ? view_range:md->status.rhw.range;
-		map_foreachinrange (mob_ai_sub_hard_changechase, &md->bl,
-				search_size, DEFAULT_ENEMY_TYPE(md), md, &tbl);
+		map_foreachinrange (mob_ai_sub_hard_changechase, &md->bl, search_size, DEFAULT_ENEMY_TYPE(md), md, &tbl);
 	}
 
 	if (!tbl) { //No targets available.