Jump to content
  • 0

R> NPC that can give Item but you must be online 15days


Question

Posted

I want to have NPC that can give item but the player must be online 15days

for ex:

I played 1 hour and i logout, when i login this gametime will be onwards until i got 15days worth of hours

and it will give some Goodie item ❤️

 

Thanks in advanced.

2 answers to this question

Recommended Posts

  • 0
Posted

Hello,

Work on account and only on reconnection :

-	script	RewardForCo	-1,{

	OnPCLogoutEvent:
		if(@timingConnected > 0){
			@timeConnected = gettimetick(2)-@timingConnected;
			#sumConnected = #sumConnected + @timeConnected; // in seconds
		}
	end;
	
	OnPcLoginEvent:
		if(!#rewardConnection){
			if(#sumConnected >= 1296000) //15 days in seconds
			//if(#sumConnected >= 60) //1 minute, if you want to test
			{
				getinventorylist;
				if(checkweight(500,1) && @inventorylist_count <= (100-1)){
					#rewardConnection = 1;
					getitem 501,1; //REWARD -- edit the test if you add multiple items
					dispbottom "Great !";
				}else {
					dispbottom "Too heavy to get the reward !";
				}
			}else {
				@timingConnected = gettimetick(2);
			}
		}
	end;
}

Not heavily tested

  • 0
Posted
21 hours ago, Kreustoo said:

Hello,

Work on account and only on reconnection :


-	script	RewardForCo	-1,{

	OnPCLogoutEvent:
		if(@timingConnected > 0){
			@timeConnected = gettimetick(2)-@timingConnected;
			#sumConnected = #sumConnected + @timeConnected; // in seconds
		}
	end;
	
	OnPcLoginEvent:
		if(!#rewardConnection){
			if(#sumConnected >= 1296000) //15 days in seconds
			//if(#sumConnected >= 60) //1 minute, if you want to test
			{
				getinventorylist;
				if(checkweight(500,1) && @inventorylist_count <= (100-1)){
					#rewardConnection = 1;
					getitem 501,1; //REWARD -- edit the test if you add multiple items
					dispbottom "Great !";
				}else {
					dispbottom "Too heavy to get the reward !";
				}
			}else {
				@timingConnected = gettimetick(2);
			}
		}
	end;
}

Not heavily tested

Ohhhh, Thanks I'll gonna test it ^_^

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