Jump to content

Drop Item's Destroy Time Info


Recommended Posts

  • Honorable Member

This is the hidden content, please

Metin2 Download

 

This is the hidden content, please

2819150UYZqLT.png

 

Me and @Gurgarath tested it on windows server, we didn't see any problem.

If you have a problem with time(_t) or another bug, let me know so I can fix it.

Idea is from Sogma

  • Metin2 Dev 142
  • Eyes 7
  • Dislove 1
  • Sad 1
  • Think 1
  • Confused 1
  • Good 40
  • Love 8
  • Love 90

 

Link to comment
Share on other sites

  • Management

200.gif

Edited by Metin2 Dev
Core X - External 2 Internal
  • Smile Tear 1
  • Love 3
Link to comment
Share on other sites

  • Active Member

@ Cryptex Just search and use your brain, believe me, it's not too hard to find the functions. Sources are different, problem can be in configs in serverfiles too.

Spoiler
For dropped items without ownership
//item.h

void StartDestroyEvent(int iSec=300);

//item.cpp

void CItem::StartDestroyEvent(int iSec)

 

Edited by ReFresh

I'll be always helpful! 👊 

Link to comment
Share on other sites

  • Bot
10 hours ago, ReFresh said:

@ Cryptex Just search and use your brain, believe me, it's not too hard to find the functions. Sources are different, problem can be in configs in serverfiles too.

  Hide contents
For dropped items without ownership
//item.h

void StartDestroyEvent(int iSec=300);

//item.cpp

void CItem::StartDestroyEvent(int iSec)

 

is so hard to understand?.. i have everywhere 5 seconds and is the same.. it's show me 225 second.. 2 hours i spend to to be like in the tutorials... and is the same.

if i put 5 seconds it show me 225 seconds.. if i put 3 minutes (180seconds) it show me 335 seconds.. where is the problem ?

spacer.png

For dropped items without ownership 

//item.h 

void        StartDestroyEvent(int iSec=5);

//item.cpp

void CItem::StartDestroyEvent(int iSec)
{
    if (m_pkDestroyEvent)
        return;

    item_event_info* info = AllocEventInfo<item_event_info>();
    info->item = this;

    SetDestroyEvent(event_create(item_destroy_event, info, PASSES_PER_SEC(iSec)));
    TPacketGCItemDestroyTime p;
    p.bHeader = HEADER_GC_ITEM_DESTROY_TIME;
    p.dwVID = m_dwVID;
    p.tDestroyTime = tDestroyTime = time(0) + iSec;
    PacketAround(&p, sizeof(p));
}

//char_item.cpp

pkItemToDrop->StartDestroyEvent(5);

Edited by Metin2 Dev
Core X - External 2 Internal
  • Good 1

english_banner.gif

Link to comment
Share on other sites

  • Forum Moderator

Cryptex is right, it is not properly working on FreeBSD, it is working perfectly fine on Windows though. He will have 225 seconds displayed but the item will vanish after 5. You can also see it above in the thread. It's most likely a time_t mismatch

Edited by Gurgarath

Gurgarath
coming soon

Link to comment
Share on other sites

  • Bot
6 minutes ago, Gurgarath said:

Cryptex is right, it is not properly working on FreeBSD, it is working perfectly fine on Windows though. He will have 225 seconds displayed but the item will vanish after 5. You can also see it above in the thread. It's most likely a time_t mismatch

So, what can we do ?

english_banner.gif

Link to comment
Share on other sites

  • 3 months later...
  • 1 month later...
  • 11 months later...

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.