Browse Source

autoloot, poison spore and more on the unknown skill [Shinomori]

git-svn-id: https://svn.code.sf.net/p/rathena/svn/branches/stable@1105 54d463be-8e91-2dee-dedb-b68131a5f0ec
(no author) 20 years ago
parent
commit
e4633d731a
4 changed files with 39 additions and 15 deletions
  1. 3 0
      Changelog-SVN.txt
  2. 1 1
      src/map/mob.c
  3. 12 9
      src/map/pet.c
  4. 23 5
      src/map/skill.c

+ 3 - 0
Changelog-SVN.txt

@@ -1,6 +1,9 @@
 Date	Added
 
 02/13
+        * added an @autoloot switch that Upa-kun has forgotten [Shinomori]
+        * changed pet_skillattack_timer and corrected the poison spore attack
+        * tighter check's on "unknown skill" error; but added prints to trace it
         * Added Wallex's changes to only evoke script_rid2sd if agitcheck(1) is used
           [celest]
         * Merged jA's equipment breaking system into the current one, and corrected

+ 1 - 1
src/map/mob.c

@@ -2049,7 +2049,7 @@ static int mob_delay_item_drop2(int tid,unsigned int tick,int id,int data)
 			}
 		} else
 		#endif
-		if(battle_config.item_auto_get){
+		if(battle_config.item_auto_get || ditem->first_sd->autoloot){//Autoloot added by Upa-Kun
 			drop_flag = 0;
 			if((flag = pc_additem(ditem->first_sd,&ditem->item_data,ditem->item_data.amount))){
 				clif_additem(ditem->first_sd,0,0,flag);

+ 12 - 9
src/map/pet.c

@@ -1577,19 +1577,22 @@ int pet_skillattack_timer(int tid,unsigned int tick,int id,int data)
 	}
 
 	if(md && rand()%100 < sd->pet.intimate*pd->skilltimer/100 ) {
-		if(pd->skilltype==6 || pd->skilltype==176) {
+		switch(pd->skilltype)
+		{
+		case SM_PROVOKE:
+		//case NPC_POISON: poison is not handled there
 			skill_castend_nodamage_id(&pd->bl,&md->bl,pd->skilltype,pd->skillval,tick,0);
-		}
-		
-		else if(pd->skilltype==110){
+			break;
+		case BS_HAMMERFALL:
 			skill_castend_pos2(&pd->bl,md->bl.x,md->bl.y,pd->skilltype,pd->skillval,tick,0);
-		}
-		
-		else if(pd->skilltype==91) {
+			break;
+		case WZ_HEAVENDRIVE:
 			skill_castend_pos2(&pd->bl,md->bl.x,md->bl.y,pd->skilltype,pd->skillval+rand()%100,tick,0);
-		}	
-		else 
+			break;
+		default:
 			skill_castend_damage_id(&pd->bl,&md->bl,pd->skilltype,pd->skillval,tick,0);
+			break;
+		}
 		pd->skillbonustimer=add_timer(gettick()+1000,pet_skillattack_timer,sd->bl.id,0);
 		return 0;
 	}

+ 23 - 5
src/map/skill.c

@@ -811,9 +811,12 @@ int skill_count_target(struct block_list *bl, va_list ap );
 
 // [MouseJstr] - skill ok to cast? and when?
 int skillnotok(int skillid, struct map_session_data *sd) {
+	
 	if (sd == 0)
-		return 0;
-
+		//return 0; 
+		return 1;
+	// I think it was meant to be "no skills allowed when not a valid sd"
+	
 	if (!(skillid >= 10000 && skillid < 10015))
 		if ((skillid > MAX_SKILL) || (skillid < 0))
 			return 1;
@@ -976,7 +979,12 @@ int skill_additional_effect( struct block_list* src, struct block_list *bl,int s
 	nullpo_retr(0, src);
 	nullpo_retr(0, bl);
 
-	//if(skilllv <= 0) return 0;
+	if(skillid < 0) 
+	{	// remove the debug print when this case is finished
+		printf("skill_additional_effect: skillid=%i\ncall: %p %p %i %i %i %i",skillid,
+						src, bl,skillid,skilllv,attack_type,tick);
+		return 0;
+	}
 	if(skillid > 0 && skilllv <= 0) return 0;	// don't forget auto attacks! - celest
 
 	if (src->type == BL_PC){
@@ -2212,7 +2220,12 @@ int skill_castend_damage_id( struct block_list* src, struct block_list *bl,int s
 	struct status_change *sc_data = status_get_sc_data(src);
 	int i;
 
-	if(skillid < 0)	return 0;
+	if(skillid < 0)	
+	{	// remove the debug print when this case is finished
+		printf("skill_castend_damage_id: skillid=%i\ncall: %p %p %i %i %i %i",skillid,
+						src, bl,skillid,skilllv,tick,flag);
+		return 0;
+	}
 	if(skillid > 0 && skilllv <= 0) return 0;
 
 	nullpo_retr(1, src);
@@ -2876,7 +2889,12 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
 				,1157,1159,1190,1272,1312,1373,1492};
 	int poringclass[]={1002};
 
-	//if(skilllv <= 0) return 0;
+	if(skillid < 0) 
+	{	// remove the debug print when this case is finished
+		printf("skill_castend_damage_id: skillid=%i\ncall: %p %p %i %i %i %i",skillid,
+						src, bl,skillid,skilllv,tick,flag);
+		return 0;
+	}
 	if(skillid > 0 && skilllv <= 0) return 0;	// celest
 
 	nullpo_retr(1, src);