Yhaj Posted May 7, 2020 Group: Members Topic Count: 18 Topics Per Day: 0.01 Content Count: 41 Reputation: 0 Joined: 05/04/18 Last Seen: October 10, 2020 Share Posted May 7, 2020 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. Quote Link to comment Share on other sites More sharing options...
0 Kreustoo Posted May 7, 2020 Group: Members Topic Count: 34 Topics Per Day: 0.01 Content Count: 216 Reputation: 45 Joined: 05/03/13 Last Seen: March 9 Share Posted May 7, 2020 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 Quote Link to comment Share on other sites More sharing options...
0 Yhaj Posted May 8, 2020 Group: Members Topic Count: 18 Topics Per Day: 0.01 Content Count: 41 Reputation: 0 Joined: 05/04/18 Last Seen: October 10, 2020 Author Share Posted May 8, 2020 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 ^_^ Quote Link to comment Share on other sites More sharing options...
Question
Yhaj
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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.