Jump to content
  • 0

Requesting a restock npc


Eros

Question


  • Group:  Members
  • Topic Count:  76
  • Topics Per Day:  0.02
  • Content Count:  202
  • Reputation:   2
  • Joined:  07/09/12
  • Last Seen:  

Does anyone know how to make a script that auto restock potion once you click the healer for example you set it to 500 Cold Medicine 10 Halo Halo.

Everytime you talk to the healer, The healer will automatically restock your cold medicine and halo halo to 10 pcs.

Thanks.

Link to comment
Share on other sites

8 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

prontera,159,184,5	script	kjhfksjdfhs	100,{

percentheal 100,100;

if ( countitem( "Cold_Medicine" ) < 500 ) {

.@count = 500 - countitem( "Cold_Medicine" );

if ( checkweight( "Cold_Medicine", .@count ) )

getitem "Cold_Medicine", .@count;

}

if ( countitem( "Halohalo" ) < 10 ) {

.@count = 10 - countitem( "Halohalo" );

if ( checkweight( "Halohalo", .@count ) )

getitem "Halohalo", .@count;

}

end;

}

500 cold medicines is quite heavy ...
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  76
  • Topics Per Day:  0.02
  • Content Count:  202
  • Reputation:   2
  • Joined:  07/09/12
  • Last Seen:  

Miss sexy beautiful annie do you have a NPC that you can set a ammount of item that you want to get 

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

prontera,159,184,5	script	kjhfksjdfhs	100,{
	percentheal 100,100;
	if ( countitem( "Cold_Medicine" ) < @cold_medecine ) {
		.@count = @cold_medecine - countitem( "Cold_Medicine" );
		if ( checkweight( "Cold_Medicine", .@count ) )
			getitem "Cold_Medicine", .@count;
	}
	if ( countitem( "Halohalo" ) < @haloh ) {
		.@count = @haloh - countitem( "Halohalo" );
		if ( checkweight( "Halohalo", .@count ) )
			getitem "Halohalo", .@count;
	}
	end;
OnWhisperGlobal:
	mes "how many cold medecine?";
	input @cold_medecine, 0,500;
	mes "how many halo";
	input @haloh, 0,10;
	close;
}

whisper the npc to set the amount

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

I rather change the healing into OnTouch, and the setting into normal npc message

I'm having fun complicating this script

[paste=5dtzwyernzn1]

somehow it seems like ..

if ( sscanf( potion_restock$, "%d#%d", .@a, .@b ) < 2 )

doesn't work if the potion_restock$ is an emptry string ..

-> reported -> http://rathena.org/board/tracker/issue-8562-

Edited by AnnieRuru
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  76
  • Topics Per Day:  0.02
  • Content Count:  202
  • Reputation:   2
  • Joined:  07/09/12
  • Last Seen:  

I mean miss annie everytime you click the healer you'll automatically restock a potion 

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

then how do you want to make the settings so the players can adjust the number of potions they want to bring ?

or do you mean only the GM can set, players can only click on it ?

yeah ... making this more complicated

[paste=6iuyh744gw92]

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  76
  • Topics Per Day:  0.02
  • Content Count:  202
  • Reputation:   2
  • Joined:  07/09/12
  • Last Seen:  

What i mean is everytime you click it will restock and i'll be the one who will set the potions.


players can only click it

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

that's no fun at all ...

prontera,159,184,5	script	kjhfksjdfhs	100,{
	if ( ( .@count = .cold_medicine - countitem( "Cold_Medicine" ) ) > 0 ) {
		if ( checkweight( "Cold_Medicine", .@count ) )
			getitem "Cold_Medicine", .@count;
		else
			dispbottom "You can't carry enough Cold Medicine";
	}
	if ( ( .@count = .halohalo - countitem( "Halohalo" ) ) > 0 ) {
		if ( checkweight( "Halohalo", .@count ) )
			getitem "Halohalo", .@count;
		else
			dispbottom "You can't carry enough Halohalo";
	}
	end;
OnInit:
	.cold_medicine = 500;
	.halohalo = 10;
}
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...