Jump to content
  • 0

R>NPC Changing sprites


Yonko

Question


  • Group:  Members
  • Topic Count:  166
  • Topics Per Day:  0.04
  • Content Count:  789
  • Reputation:   50
  • Joined:  04/16/12
  • Last Seen:  

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
Link to comment
Share on other sites

14 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.01
  • Content Count:  193
  • Reputation:   41
  • Joined:  07/21/16
  • Last Seen:  

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.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.01
  • Content Count:  193
  • Reputation:   41
  • Joined:  07/21/16
  • Last Seen:  

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
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  166
  • Topics Per Day:  0.04
  • Content Count:  789
  • Reputation:   50
  • Joined:  04/16/12
  • Last Seen:  

 

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

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.01
  • Content Count:  193
  • Reputation:   41
  • Joined:  07/21/16
  • Last Seen:  

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;

}
Link to comment
Share on other sites

  • 0

  • Group:  Developer
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  141
  • Reputation:   45
  • Joined:  08/14/12
  • Last Seen:  

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);
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.01
  • Content Count:  193
  • Reputation:   41
  • Joined:  07/21/16
  • Last Seen:  

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

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  166
  • Topics Per Day:  0.04
  • Content Count:  789
  • Reputation:   50
  • Joined:  04/16/12
  • Last Seen:  

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

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.01
  • Content Count:  193
  • Reputation:   41
  • Joined:  07/21/16
  • Last Seen:  

Try adding end; just before the timer.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  166
  • Topics Per Day:  0.04
  • Content Count:  789
  • Reputation:   50
  • Joined:  04/16/12
  • Last Seen:  

Try adding end; just before the timer.

yah i try putting it because it appears on map server console that ; is missing but still the problem exist

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.01
  • Content Count:  193
  • Reputation:   41
  • Joined:  07/21/16
  • Last Seen:  

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.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  166
  • Topics Per Day:  0.04
  • Content Count:  789
  • Reputation:   50
  • Joined:  04/16/12
  • Last Seen:  

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

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.01
  • Content Count:  193
  • Reputation:   41
  • Joined:  07/21/16
  • Last Seen:  

Can I see the entire script?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  166
  • Topics Per Day:  0.04
  • Content Count:  789
  • Reputation:   50
  • Joined:  04/16/12
  • Last Seen:  

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

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  166
  • Topics Per Day:  0.04
  • Content Count:  789
  • Reputation:   50
  • Joined:  04/16/12
  • Last Seen:  

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.

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