Jump to content
  • 0
Sign in to follow this  
norightinfo

[Request] Daily Supply NPC

Question

Hi~

I have been trying to analyze and modifying this script by @AnnieRuru 
https://github.com/AnnieRuru/Release/blob/master/scripts/Utility/daily supply/daily_supply_0.3.txt

However nothing seems working as it was too complicated for me.


Basically what I wanted is simple Daily Supply NPC script
+ Give 4 items (different items that I can set)
+ Once per account only (not per character)
+ No confirmation Dialog, it just gives the item upon clicking the NPC
+ If the user already claim the supply, an message bubble will show on top of NPC informing that they already claim the supply (ex. You already claim your reward today)

+ Although it is daily it will just reset every 12AM

 

Share this post


Link to post
Share on other sites

5 answers to this question

Recommended Posts

  • 1
4 hours ago, norightinfo said:

Hi~

I have been trying to analyze and modifying this script by @AnnieRuru 
https://github.com/AnnieRuru/Release/blob/master/scripts/Utility/daily supply/daily_supply_0.3.txt

However nothing seems working as it was too complicated for me.


Basically what I wanted is simple Daily Supply NPC script
+ Give 4 items (different items that I can set)
+ Once per account only (not per character)
+ No confirmation Dialog, it just gives the item upon clicking the NPC
+ If the user already claim the supply, an message bubble will show on top of NPC informing that they already claim the supply (ex. You already claim your reward today)

+ Although it is daily it will just reset every 12AM

 

You can try this one..
Try it, i just made the script without testing it. haha 😝😅

 

prontera,90,110,4	script	Daily Supply	4_M_MAYOR,{
	if(#DailySupply){
		message strcharinfo(0), "Supply already claimed.";
		end;
	}
	else if(!#DailySupply){
		getitem 505,1;
		getitem 506,1;
		getitem 507,1;
		getitem 508,1;
		set #DailySupply,1;
		end;
	}
}

-	script	DailySupplyReseter	FAKE_NPC,{
OnClock1159:
	announce "[ Daily Supply ] : You can now claim your Daily Supply Now. Thank You!",bc_all | bc_blue;
	while(1){
		query_sql("SELECT `account_id` from `char` WHERE `online` = 1",.@GetAccID);
		attachrid(.@GetAccID);
		set #DailySupply,0; 
		detachrid;
		break;
	}
end;
}

 

Edited by Kuya Jeo
Error found (unexpected string)

Share this post


Link to post
Share on other sites
  • 0
1 hour ago, Kuya Jeo said:

You can try this one..
Try it, i just made the script without testing it. haha 😝😅

 

prontera,90,110,4 script Daily Supply 4_M_MAYOR,{ if(#DailySupply){ message strcharinfo(0), "Supply already claimed."; end; } else if(!#DailySupply){ getitem 505,1; getitem 506,1; getitem 507,1; getitem 508,1; set #DailySupply,1; end; } } - script DailySupplyReseter FAKE_NPC,{ OnClock1159: announce "[ Daily Supply ] : "You can now claim your Daily Supply Now. Thank You!",bc_all | bc_blue; while(1){ query_sql("SELECT `account_id` from `char` WHERE `online` = 1",.@GetAccID); attachrid(.@GetAccID); set #DailySupply,0; detachrid; break; } end; }


prontera,90,110,4	script	Daily Supply	4_M_MAYOR,{
	if(#DailySupply){
		message strcharinfo(0), "Supply already claimed.";
		end;
	}
	else if(!#DailySupply){
		getitem 505,1;
		getitem 506,1;
		getitem 507,1;
		getitem 508,1;
		set #DailySupply,1;
		end;
	}
}

-	script	DailySupplyReseter	FAKE_NPC,{
OnClock1159:
	announce "[ Daily Supply ] : "You can now claim your Daily Supply Now. Thank You!",bc_all | bc_blue;
	while(1){
		query_sql("SELECT `account_id` from `char` WHERE `online` = 1",.@GetAccID);
		attachrid(.@GetAccID);
		set #DailySupply,0; 
		detachrid;
		break;
	}
end;
}

 


Hi @Kuya Jeo, thank you for this, There was an issue with "unexpected new line string..", however I was able to figure it out. 
It was on this line 
image.png.d28bc0037f8f1eaa1a31a2389d2e1169.png

Share this post


Link to post
Share on other sites
  • 0
27 minutes ago, norightinfo said:


Hi @Kuya Jeo, thank you for this, There was an issue with "unexpected new line string..", however I was able to figure it out. 
It was on this line 
image.png.d28bc0037f8f1eaa1a31a2389d2e1169.png

Oh yeah.. sorry about that.. 😝 but did you already test the script if it will reset?, you can change the time so that you can test it over and over.. I never tried to run that script thou. haha

Share this post


Link to post
Share on other sites
  • 0
40 minutes ago, Kuya Jeo said:

Oh yeah.. sorry about that.. 😝 but did you already test the script if it will reset?, you can change the time so that you can test it over and over.. I never tried to run that script thou. haha

Hi @Kuya Jeo yes, I adjusted the time, and it appears to be working.

Share this post


Link to post
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.   Restore formatting

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.