Jump to content
  • 0

R>NPC Changing sprites


Question

Posted (edited)

Hi,


Can i request a npc like this. A npc that if you clicked and given a payment it will change or disguise for a certain time then return to the original just like the sequence below which includes if the NPC is already paid and change to Drops it will wait for the next turn to return to Poring to avoid spam/abuse


Example

Poring ---> (payment is given) ----> will transform into Drops (After a certain time let say 1min it will return to Poring)




Thanks =) have a nice day

Edited by Yonko

14 answers to this question

Recommended Posts

  • 0
Posted
morocc,161,90,5	script	Poring#test	1002,{

	if(.timer == 1) end;

	mes "Pay me?";
	menu "Yes",-;
	if(zeny < .zeny) end;
	zeny -= .zeny;
	setnpcdisplay strnpcinfo(3), "Drops", .disguise;
	set .timer,1;
	initnpctimer;
	

end;	
OnTimer5000:
	
	setnpcdisplay strnpcinfo(3), "Poring", .original;
	set .timer,0;
	stopnpctimer;
	end;


OnInit:

	set .disguise, 1113;
	set .original, 1002;
	set .zeny, 1;
	end;


}

Working like a charm.

  • 0
Posted

You can probably use the disguise NPC as base to make it work.

This might not be the optimal script, but yeah, if I got you right, this will work how you want it.
 

-	script	PoringToDrops#main	-1,{

	if(.timer == 1) end;

	mes "Pay me?";
	menu "Yes",-;
	if(zeny < .zeny) end;
	zeny -= .zeny;
	setnpcdisplay "Drops",.disguise;
	set .timer,1;
	initnpctimer;
	
OnTimer30000:
	
	setnpcdisplay "Poring",.original;
	set .timer,0;
	stopnpctimer;

end

OnInterIfInitOnce:

	set .disguise, 1113;
	set .original, 1002;
	set .zeny, 1;
	
end;

}

prontera,180,180,5	duplicate(PoringToDrops#main)	Poring	1002
  • 0
Posted

 

You can probably use the disguise NPC as base to make it work.

This might not be the optimal script, but yeah, if I got you right, this will work how you want it.

 

-	script	PoringToDrops#main	-1,{

	if(.timer == 1) end;

	mes "Pay me?";
	menu "Yes",-;
	if(zeny < .zeny) end;
	zeny -= .zeny;
	setnpcdisplay "Drops",.disguise;
	set .timer,1;
	initnpctimer;
	
OnTimer30000:
	
	setnpcdisplay "Poring",.original;
	set .timer,0;
	stopnpctimer;

end

OnInterIfInitOnce:

	set .disguise, 1113;
	set .original, 1002;
	set .zeny, 1;
	
end;

}

prontera,180,180,5	duplicate(PoringToDrops#main)	Poring	1002

Hi thanks for the reply but when im about to pay it gives this error on map server

[Error]: status_set_viewdata (NPC): No view data for class 0

  • 0
Posted

Try this one

 

prontera,180,180,5	script	Poring#test	1002,{

	if(.timer == 1) end;

	mes "Pay me?";
	menu "Yes",-;
	if(zeny < .zeny) end;
	zeny -= .zeny;
	setnpcdisplay "Drops",.disguise;
	set .timer,1;
	initnpctimer;
	
OnTimer30000:
	
	setnpcdisplay "Poring",.original;
	set .timer,0;
	stopnpctimer;

end

OnInit:

	set .disguise, 1113;
	set .original, 1002;
	set .zeny, 1;
	
end;

}
  • 0
Posted

You have to use this version

*setnpcdisplay("<npc name>", "<display name>", <class id>)

The NPC name is the name that's in the script header, display name is the name that's shown, and the class id is the sprite id you're disguising the npc.

setnpcdisplay(strnpcinfo(0), "Drops", .disguise);

setnpcdisplay(strnpcinfo(0), "Poring", .original);
  • 0
Posted

Oh, sorry, I didn't know. Thanks for the correction~  /no1

One thing i observed, it doesn't return to being a poring even i change the Timer into the lowest values, and while on being transformed into drops its clickable and interactable, how do i make it when it is in drops transformation it will not interact players it will be available to click/interact when poring thanks

 

You have to use this version

*setnpcdisplay("<npc name>", "<display name>", <class id>)

The NPC name is the name that's in the script header, display name is the name that's shown, and the class id is the sprite id you're disguising the npc.

setnpcdisplay(strnpcinfo(0), "Drops", .disguise);

setnpcdisplay(strnpcinfo(0), "Poring", .original);

Thanks it transforms now XD however my there's still a problem on my top quote answer

  • 0
Posted
prontera,180,180,5	script	Poring#test	1002,{

	if(.timer == 1) end;

	mes "Pay me?";
	menu "Yes",-;
	if(zeny < .zeny) end;
	zeny -= .zeny;
	setnpcdisplay "Drops",.disguise;
	set .timer,1;
	initnpctimer;

end;
	
OnTimer30000:

I meant that.

  • 0
Posted
prontera,180,180,5	script	Poring#test	1002,{

	if(.timer == 1) end;

	mes "Pay me?";
	menu "Yes",-;
	if(zeny < .zeny) end;
	zeny -= .zeny;
	setnpcdisplay "Drops",.disguise;
	set .timer,1;
	initnpctimer;

end;
	
OnTimer30000:

I meant that.

 

yah still not returning to be a poring

  • 0
Posted
morocc,161,90,5	script	Poring#test	1002,{

	if(.timer == 1) end;

	mes "Pay me?";
	menu "Yes",-;
	if(zeny < .zeny) end;
	zeny -= .zeny;
	setnpcdisplay(strnpcinfo(0), "Drops", .disguise);
	set .timer,1;
	initnpctimer;
	

end;	
OnTimer5000:
	
	setnpcdisplay(strnpcinfo(0), "Poring", .original);
	set .timer,0;
	stopnpctimer;
	end;


OnInit:

	set .disguise, 1113;
	set .original, 1002;
	set .zeny, 1;
	end;


}

there you go

  • 0
Posted
morocc,161,90,5	script	Poring#test	1002,{

	if(.timer == 1) end;

	mes "Pay me?";
	menu "Yes",-;
	if(zeny < .zeny) end;
	zeny -= .zeny;
	setnpcdisplay strnpcinfo(3), "Drops", .disguise;
	set .timer,1;
	initnpctimer;
	

end;	
OnTimer5000:
	
	setnpcdisplay strnpcinfo(3), "Poring", .original;
	set .timer,0;
	stopnpctimer;
	end;


OnInit:

	set .disguise, 1113;
	set .original, 1002;
	set .zeny, 1;
	end;


}

Working like a charm.

 

OMG thanks it works XDD i've sent you a message for something.

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