Jump to content
  • 0
Yhaj

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

Question

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.

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Hello,

Work on account and only on reconnection :

-	script	RewardForCo	-1,{

	OnPCLogoutEvent:
		if(@timingConnected > 0){
			@timeConnected = gettimetick(2)[email protected];
			#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

Share this post


Link to post
Share on other sites
  • 0
21 hours ago, Kreustoo said:

Hello,

Work on account and only on reconnection :

-	script	RewardForCo	-1,{

	OnPCLogoutEvent:
		if(@timingConnected > 0){
			@timeConnected = gettimetick(2)[email protected];
			#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 ^_^

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

Important Information

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