Jump to content
  • 0

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


Yhaj

Question


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.01
  • Content Count:  41
  • Reputation:   0
  • Joined:  05/04/18
  • Last Seen:  

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.

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  215
  • Reputation:   45
  • Joined:  05/03/13
  • Last Seen:  

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

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.01
  • Content Count:  41
  • Reputation:   0
  • Joined:  05/04/18
  • Last Seen:  

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 ^_^

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