Преглед изворни кода

- Fixed @summon's delete timer being screwed up.
- Cleaned up a bit the summon script command.
- Fixed the clone script command's delete-timer being screwed up.
- Corrected battle config name max_walk_rate, it should be named max_walk_speed.


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

skotlex пре 18 година
родитељ
комит
eac939f439
8 измењених фајлова са 23 додато и 14 уклоњено
  1. 4 0
      Changelog-Trunk.txt
  2. 3 0
      conf-tmpl/Changelog.txt
  3. 1 1
      conf-tmpl/battle/player.conf
  4. 1 2
      src/map/atcommand.c
  5. 1 1
      src/map/clif.c
  6. 1 1
      src/map/mob.c
  7. 11 9
      src/map/script.c
  8. 1 0
      src/map/status.c

+ 4 - 0
Changelog-Trunk.txt

@@ -3,6 +3,10 @@ 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.
 
+2006/08/31
+	* Fixed @summon's delete timer being screwed up. [Skotlex]
+	* Cleaned up a bit the summon script command. [Skotlex]
+	* Fixed the clone script command's delete-timer being screwed up. [Skotlex]
 2006/08/30
 	* Skill required-state will now only be checked on cast-begin, not
 	  cast-end. [Skotlex]

+ 3 - 0
conf-tmpl/Changelog.txt

@@ -1,5 +1,8 @@
 Date	Added
 
+2006/08/31
+	* Corrected battle config name max_walk_rate, it should be named
+	  max_walk_speed. [Skotlex]
 2006/08/29
 	* monster_ai&1 now only signals whether mobs should update their target
 	  cell while chasing more frequently (rather than being state-driven like

+ 1 - 1
conf-tmpl/battle/player.conf

@@ -86,7 +86,7 @@ natural_heal_weight_rate: 50
 max_aspd: 190
 
 // Maximum walk speed rate (200 would be capped to twice the normal speed)
-max_walk_rate: 300
+max_walk_speed: 300
 
 // Maximum HP. (Default is 1000000) (Note 3)
 max_hp: 1000000

+ 1 - 2
src/map/atcommand.c

@@ -8594,7 +8594,6 @@ atcommand_summon(
 {
 	char name[NAME_LENGTH];
 	int mob_id = 0;
-	int id = 0;
 	int duration = 0;
 	struct mob_data *md;
 	unsigned int tick=gettick();
@@ -8621,7 +8620,7 @@ atcommand_summon(
 	if(md){
 		md->master_id=sd->bl.id;
 		md->special_state.ai=1;
-		md->deletetimer=add_timer(tick+(duration*60000),mob_timer_delete,id,0);
+		md->deletetimer=add_timer(tick+(duration*60000),mob_timer_delete,md->bl.id,0);
 		clif_misceffect2(&md->bl,344);
 		mob_spawn(md);
 		sc_start4(&md->bl, SC_MODECHANGE, 100, 1, 0, MD_AGGRESSIVE, 0, 60000);

+ 1 - 1
src/map/clif.c

@@ -6323,7 +6323,7 @@ int clif_sendegg(struct map_session_data *sd)
 	if(sd->status.pet_id <= 0) {
 		for(i=0,n=0;i<MAX_INVENTORY;i++){
 			if(sd->status.inventory[i].nameid<=0 || sd->inventory_data[i] == NULL ||
-			   sd->inventory_data[i]->type!=7 ||
+			   sd->inventory_data[i]->type!=IT_PETEGG ||
 			   sd->status.inventory[i].amount<=0)
 				continue;
 			WFIFOW(fd,n*2+4)=i+2;

+ 1 - 1
src/map/mob.c

@@ -2997,7 +2997,7 @@ int mob_clone_spawn(struct map_session_data *sd, int m, int x, int y, const char
 		if (master_id) //Attach to Master
 			md->master_id = master_id;
 		if (duration) //Auto Delete after a while.
-			md->deletetimer = add_timer (gettick() + duration, mob_timer_delete, i, 0);
+			md->deletetimer = add_timer (gettick() + duration, mob_timer_delete, md->bl.id, 0);
 	}
 #if 0
 	//I am playing with this for packet-research purposes, enable it if you want, but don't remove it :X [Skotlex]

+ 11 - 9
src/map/script.c

@@ -10651,7 +10651,7 @@ int buildin_logmes(struct script_state *st)
 
 int buildin_summon(struct script_state *st)
 {
-	int _class, id, timeout=0;
+	int _class, timeout=0;
 	char *str,*event="";
 	struct map_session_data *sd;
 	struct mob_data *md;
@@ -10670,14 +10670,16 @@ int buildin_summon(struct script_state *st)
 	}
 
 	clif_skill_poseffect(&sd->bl,AM_CALLHOMUN,1,sd->bl.x,sd->bl.y,tick);
-	id=mob_once_spawn(sd, "this", 0, 0, str,_class,1,event);
-	md=(struct mob_data *)map_id2bl(id);
-	if (!md) return 0;
-	md->master_id=sd->bl.id;
-	md->special_state.ai=1;
-	md->deletetimer=add_timer(tick+(timeout>0?timeout*1000:60000),mob_timer_delete,id,0);
-	clif_misceffect2(&md->bl,344);
-	sc_start4(&md->bl, SC_MODECHANGE, 100, 1, 0, MD_AGGRESSIVE, 0, 60000);
+
+	md = mob_once_spawn_sub(&sd->bl, sd->bl.m, sd->bl.x, sd->bl.y, str, _class, event);
+	if (md) {
+		md->master_id=sd->bl.id;
+		md->special_state.ai=1;
+		md->deletetimer = add_timer(tick+(timeout>0?timeout*1000:60000),mob_timer_delete,md->bl.id,0);
+		mob_spawn (md); //Now it is ready for spawning.
+		clif_misceffect2(&md->bl,344);
+		sc_start4(&md->bl, SC_MODECHANGE, 100, 1, 0, MD_AGGRESSIVE, 0, 60000);
+	}
 	return 0;
 }
 

+ 1 - 0
src/map/status.c

@@ -3952,6 +3952,7 @@ struct regen_data *status_get_regen_data(struct block_list *bl)
 			return NULL;
 	}
 }
+
 struct status_data *status_get_status_data(struct block_list *bl)
 {
 	nullpo_retr(NULL, bl);