- if (useitem->itemnum==198)
- {
- thisclient->once=false;
- thisclient->timerxp=time(NULL)+86400*3;
- Log(MSG_INFO,"Bonus XP to %i",thisclient->bonusxp);
- BEGINPACKET( pak, 0x702 );
- ADDSTRING( pak, "Your 300% experience bonus will hold for three days." );
- ADDBYTE( pak, 0 );
- thisclient->client->SendPacket(&pak);
- }
- else if(useitem->itemnum==199)
- {
- thisclient->once=true;
- thisclient->timerxp=time(NULL)+60*60;
- Log(MSG_INFO,"Bonus XP to %i",thisclient->bonusxp);
- BEGINPACKET( pak, 0x702 );
- ADDSTRING( pak, "Your 200% experience bonus will hold for one hour or until you log out." );
- ADDBYTE( pak, 0 );
- thisclient->client->SendPacket(&pak);
- }
- else if(useitem->itemnum==200)
- {
- thisclient->once=true;
- thisclient->timerxp=time(NULL)+60*60;
- Log(MSG_INFO,"Bonus XP to %i",thisclient->bonusxp);
- BEGINPACKET( pak, 0x702 );
- ADDSTRING( pak, "Your 300% experience bonus will hold for one hour or until you log out." );
- ADDBYTE( pak, 0 );
- thisclient->client->SendPacket(&pak);
- }
- else if(useitem->itemnum==201)
- {
- thisclient->once=true;
- thisclient->timerxp=time(NULL)+60*60;
- Log(MSG_INFO,"Bonus XP to %i",thisclient->bonusxp);
- BEGINPACKET( pak, 0x702 );
- ADDSTRING( pak, "Your 500% experience bonus will hold for one hour or until you log out." );
- ADDBYTE( pak, 0 );
- thisclient->client->SendPacket(&pak);
- }
- else if(useitem->itemnum==202)
- {
- thisclient->once=true;
- thisclient->timerxp=time(NULL)+3600*3;
- Log(MSG_INFO,"Bonus XP to %i",thisclient->bonusxp);
- BEGINPACKET( pak, 0x702 );
- ADDSTRING( pak, "Your 300% experience bonus will hold for three hours or until you log out." );
- ADDBYTE( pak, 0 );
- thisclient->client->SendPacket(&pak);
- }
- else if(useitem->itemnum==203)
- {
- thisclient->once=true;
- thisclient->timerxp=time(NULL)+3600*3;
- Log(MSG_INFO,"Bonus XP to %i",thisclient->bonusxp);
- BEGINPACKET( pak, 0x702 );
- ADDSTRING( pak, "Your 500% experience bonus will hold for three hours or until you log out." );
- ADDBYTE( pak, 0 );
- thisclient->client->SendPacket(&pak);
- }
- else if(useitem->itemnum==204)
- {
- thisclient->once=false;
- thisclient->timerxp=time(NULL)+86400*5;
- Log(MSG_INFO,"Bonus XP to %i",thisclient->bonusxp);
- BEGINPACKET( pak, 0x702 );
- ADDSTRING( pak, "Your 500% experience bonus will hold for five days." );
- ADDBYTE( pak, 0 );
- thisclient->client->SendPacket(&pak);
- }
- }
- else
- {
- //LMA: Player already has a medal exp.
- BEGINPACKET( pak, 0x702 );
- ADDSTRING( pak, "You already have an exp bonus." );
- ADDBYTE( pak, 0 );
- thisclient->client->SendPacket(&pak);
- return NULL;
- }
Hello again Osrose.
Been working a lot with my custom server now and have decided to do the EXP Medal bonuses.
And not surprised to encounter a bug.
The timers are way off from what it should really display.
Like this for instance:
I have created an EXP booster that goes on up to five days and there appeared the status below the HP/MP tab the status (symbol) after using the item. As shown in the screenshot, the timer is way off from the 720 Requirement Value 2 I wrote in the STB that which is calculated 6*24*5 for the 5 days EXP buff. Just so you know this is also coded and timed in the server properly, (timervalue:+86400*5 ) the only problem is that how the client is handling the time it should expire because from what I can see from the screenshot the remaining time is 33 days before it wears off.
To sum it all up:
The EXP Medal works fine - the only problem is how the client DISPLAYS (is that the right word?) the status expiration.
Same goes for timed regeneration (e.g. new fruits, potion - the one with the plus sign effects - those potion/fruits that that regenerates by percentage over time.)
There's this STATUS CHANGE column in the useitem stb, I'm not sure but I believe its new? (this is where the timed statuses goes just like those in the fruit consumables)
I'm assuming the time calculation is different between the server and client?
I'm hoping you could again guide me how to fix another rev 4 problem.
Thanks OsRose. Cheers!