Jump to content
  • 0

pc_isUseitem return homunculus


Tauro

Question


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  16
  • Reputation:   3
  • Joined:  10/07/16
  • Last Seen:  

Hi, I am trying to fix a code that is of my interest. But with this part of the code I can not find out the problem.
First through the rest skill the hom_vaporize is done.

	struct item tmp_item;
	struct s_homunculus *hom;
	struct homun_data *hd;
	int rate;
	hd = sd->hd;
	rate =(hd->homunculus.class_) + 5530;

		hom = &hd->homunculus;
		//sd->status.lock = 0;
		if(hom->ditto == 1){
		rate = 8162;
		}else{
		rate =(hd->homunculus.class_) + 5530;
		}
		hom_save(hd);

		//hom->char_id = sd->status.char_id;

		memset(&tmp_item,0,sizeof(tmp_item));
		tmp_item.nameid = rate;
		tmp_item.identify = 1;
		//tmp_item.refine=5;
		tmp_item.card[0] = CARD0_HUN;
		tmp_item.card[1] = GetWord(hd->homunculus.hom_id,0);
		tmp_item.card[2] = GetWord(hd->homunculus.hom_id,1);
		tmp_item.card[3] = 0;
		if((flag = pc_additem2(sd,&tmp_item,1))) {
			clif_additem(sd,0,0,flag);
			map_addflooritem(&tmp_item,1,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0,0);
		}
		sd = hd->master;
		hd->homunculus.intimacy = 0;
		return unit_remove_map(&hd->bl,CLR_OUTSIGHT);
}

The idea is to save card[1] and card[2] ids same as in the pet.cpp when it comes to obtaining an egg.

Then in pc.cpp / pc_isUseitem

switch( nameid ) {
		case 50844:
		if(hd){
			if(hom->evomoment == 1){	
				clif_displaymessage(sd->fd, "Usted no puede retornar.");
				return 0;
			}	
		break;
		}
	case 8031:

if(sd){

		if(hd)
			if(hom->evomoment == 1){	
				clif_displaymessage(sd->fd, "No puedes invocar otro pokemon mientras tu pokemon activo esta evolucionando.");
				return 0;
			}	
		

		if (sd->sc.data[SC_NOCHAT])
			return 0;


		if(sd->hd != NULL)
			return 0;

			if(sd->inventory.u.items_inventory[n].card[3] > 2){
				hom_create_request(sd, (sd->inventory.u.items_inventory[n].card[3]));
				clif_specialeffect(&sd->bl,41,AREA);
				return 1;
			}
			if(sd->inventory.u.items_inventory[n].card[3] == 1){
				clif_displaymessage(sd->fd, msg_txt(sd,718));
				return 0;
			}
			if(sd->inventory.u.items_inventory[n].card[3] == 0){
				sd->status.hom_id = MakeDWord(sd->inventory.u.items_inventory[n].card[1], sd->inventory.u.items_inventory[n].card[2]);
				intif_homunculus_requestload(sd->status.account_id, sd->status.hom_id);
				clif_specialeffect(&sd->bl,1049,AREA);
				return 1;
			}
	break;
	}

By having tmp_item.card [3] = 0;

will perform this action, which should return the homunculus

if(sd->inventory.u.items_inventory[n].card[3] == 0){
When not using the item does not recover the homunculus, someone has some idea of the problem. Thanks for any help!!!

 

 

Edited by naruto10890
Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...