Jump to content
  • 0

Question

Posted

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,{

6 answers to this question

Recommended Posts

  • 0
Posted (edited)

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
  • 0
Posted

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;
}

  • 0
Posted

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;
} 

 

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...