[Request] Daily Supply NPC

norightinfo

New member
Messages
12
Points
0
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

 
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 😝😅

Code:
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;
}
 
Last edited by a moderator:
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

 
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 
View attachment 6756
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

 
Back
Top