Przeglądaj źródła

- Modified the mob ai think time update after using skills from adelay/amotion to 100ms since the previous method adds a large delay before the AI activates again (which screws up with the timing of idle/walk skills)

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10348 54d463be-8e91-2dee-dedb-b68131a5f0ec
skotlex 18 lat temu
rodzic
commit
2b9eddf37d
4 zmienionych plików z 8 dodań i 9 usunięć
  1. 4 0
      Changelog-Trunk.txt
  2. 0 1
      src/map/mob.c
  3. 2 0
      src/map/mob.h
  4. 2 8
      src/map/skill.c

+ 4 - 0
Changelog-Trunk.txt

@@ -4,6 +4,10 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK.  ALL UNTESTED BUGFIXES/FEATURES GO
 IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 
 2007/04/25
+	* Modified the mob ai think time update after using skills from
+	  adelay/amotion to 100ms since the previous method adds a large delay before
+	  the AI activates again (which screws up with the timing of idle/walk
+	  skills)
 	* NPC_MAGICALATTACK now starts a state similar to Sacrificial Ritual, in
 	  the sense that every normal attack afterwards becomes a Magical Attack. The
 	  skill duration is 15 secs. [Skotlex]

+ 0 - 1
src/map/mob.c

@@ -35,7 +35,6 @@
 #include "date.h"
 #include "irc.h"
 
-#define MIN_MOBTHINKTIME 100
 #define IDLE_SKILL_INTERVAL 10	//Active idle skills should be triggered every 1 second (1000/MIN_MOBTHINKTIME)
 
 #define MOB_LAZYSKILLPERC 10	// Probability for mobs far from players from doing their IDLE skill. (rate of 1000 minute)

+ 2 - 0
src/map/mob.h

@@ -19,6 +19,8 @@
 #define MAX_MOB_DROP 10
 #define MAX_STEAL_DROP 7
 
+//Min time between AI executions
+#define MIN_MOBTHINKTIME 100
 //Min time before mobs do a check to call nearby friends for help (or for slaves to support their master)
 #define MIN_MOBLINKTIME 1000
 

+ 2 - 8
src/map/skill.c

@@ -5739,10 +5739,7 @@ int skill_castend_id (int tid, unsigned int tick, int id, int data)
 			break;
 
 		if(md) {
-			if(tid != -1) //Set afterskill delay.
-				md->last_thinktime=tick +md->status.amotion;
-			else
-				md->last_thinktime=tick +md->status.adelay;
+			md->last_thinktime=tick +MIN_MOBTHINKTIME;
 			if(md->skillidx >= 0 && md->db->skill[md->skillidx].emotion >= 0)
 				clif_emotion(src, md->db->skill[md->skillidx].emotion);
 		}
@@ -5927,10 +5924,7 @@ int skill_castend_pos (int tid, unsigned int tick, int id, int data)
 			break;
 
 		if(md) {
-			if (tid != -1)
-				md->last_thinktime=tick +md->status.amotion;
-			else
-				md->last_thinktime=tick +md->status.adelay;
+			md->last_thinktime=tick +MIN_MOBTHINKTIME;
 			if(md->skillidx >= 0 && md->db->skill[md->skillidx].emotion >= 0)
 				clif_emotion(src, md->db->skill[md->skillidx].emotion);
 		}