Jump to content
  • 0

Mob Script call NPC


Giant Whisper

Question


  • Group:  Members
  • Topic Count:  55
  • Topics Per Day:  0.01
  • Content Count:  190
  • Reputation:   3
  • Joined:  04/11/12
  • Last Seen:  

when killing a mob you can make it appear an npc where this mob is deadI would like that by killing the mob the npc appears where dead

this is a summary of what has been achieved

monster "1@pop1",50,53,"Guardian Chest",3733,1,"Erza::OnErzaDead";
warp "1@pop1",49,50;
set hecho, 1;
end;

OnErzaDead:
enablenpc "Chest Novice";
sleep 500000;
disablenpc "Chest Novice";
end;

1@pop1,51,51,4    script    Chest Novice    10005,{

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  303
  • Reputation:   117
  • Joined:  12/10/16
  • Last Seen:  

Could you test this?

	monster "1@pop1",50,53,"Guardian Chest",3733,1,"Erza::OnErzaDead";
	warp "1@pop1",49,50;
	set hecho, 1;
	end;

OnErzaDead:
	set .@id,killedgid;
	getunitdata .@id,.@data;
	set .@x,.@data[UMOB_X];
	set .@y,.@data[UMOB_Y];
	enablenpc "Chest Novice";
	unitwarp getnpcid(0,"Chest Novice"),"1@pop1",.@x,.@y;
	sleep 500000;
	disablenpc "Chest Novice";
	end;

 

Edited by n0tttt
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  55
  • Topics Per Day:  0.01
  • Content Count:  190
  • Reputation:   3
  • Joined:  04/11/12
  • Last Seen:  

this error comes out in the console, npc_enable: Attempted to hide a non-existing NPC Chest Novice (flag=0)

this is the npc is in the same script

1@pop1,51,51,4    script    Chest Novice    10005,{

    rentitem 1599,1012000;
    rentitem 2199,1012000;
    disablenpc strnpcinfo(0);
    warp "prontera",58,59;
    end;
}

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  303
  • Reputation:   117
  • Joined:  12/10/16
  • Last Seen:  

It's because disablenpc gets executed twice. This should fix it:

	monster "1@pop1",50,53,"Guardian Chest",3733,1,"Erza::OnErzaDead";
	warp "1@pop1",49,50;
	set hecho, 1;
	end;

OnErzaDead:
	set .@id,killedgid;
	getunitdata .@id,.@data;
	set .@x,.@data[UMOB_X];
	set .@y,.@data[UMOB_Y];
	enablenpc "Chest Novice";
	unitwarp getnpcid(0,"Chest Novice"),"1@pop1",.@x,.@y;
	sleep 500000;
	if(getmapxy(.@m$,.@x,.@y,UNITTYPE_NPC,"Chest Novice") != 0)
		disablenpc "Chest Novice";
	end;

 1@pop1,51,51,4	script	Chest Novice	10005,{

	rentitem 1599,1012000;
	rentitem 2199,1012000;
	disablenpc strnpcinfo(0);
	awake "Erza";
	warp "prontera",58,59;
	end;
} 

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  55
  • Topics Per Day:  0.01
  • Content Count:  190
  • Reputation:   3
  • Joined:  04/11/12
  • Last Seen:  

when killing the mob the npc still does not appear where the mob has died

warning: buildin_getunitdata: invalid object type

debug: source (NPC): Erza at protenra (151,190)

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  303
  • Reputation:   117
  • Joined:  12/10/16
  • Last Seen:  

Do you have rAthena updated at least to this commit? https://github.com/rathena/rathena/commit/c856b07c45aed6c5842ee19a940f7e76f780221c

How did  you kill the monster? By command or manually?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  55
  • Topics Per Day:  0.01
  • Content Count:  190
  • Reputation:   3
  • Joined:  04/11/12
  • Last Seen:  

thank you very much n0tttt  ?

 

excuse me could you help me in this script 

 

Link to comment
Share on other sites

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...