Jump to content

Remove Costumes Time


Recommended Posts

Hello world :)

I keep thinking about movingg from 2089m to 40k

Bun encountered a problem.

In game 2089m, players have 0 timp at costumes, if i move to 40k, when you login in game, costumes automaticaly will removed from your character because you already have 0 timp on costumes.

How can change from source to no remove costumes if have 0 time . 

Sorry for my bad english :) . 

Link to comment
Share on other sites

I think  this is best method.

// Costume

UPDATE `item` SET `socket0`='4233600' WHERE 41001 <= vnum && vnum <= 41135;

//  Hair

UPDATE `item` SET `socket0`='4233600' WHERE 73001 <= vnum && vnum <= 75620;

Quote: How can change from source to no remove costumes if have 0 time?

Method shit ( check this ):

void CItem::StartRealTimeExpireEvent()
{
	if (m_pkRealTimeExpireEvent)
		return;
	for (int i=0 ; i < ITEM_LIMIT_MAX_NUM ; i++)
	{
		if (LIMIT_REAL_TIME == GetProto()->aLimits[i].bType || LIMIT_REAL_TIME_START_FIRST_USE == GetProto()->aLimits[i].bType)
		{
			item_vid_event_info* info = AllocEventInfo<item_vid_event_info>();
			info->item_vid = GetVID();
			m_pkRealTimeExpireEvent = event_create( real_time_expire_event, info, PASSES_PER_SEC(1));
			sys_log(0, "REAL_TIME_EXPIRE: StartRealTimeExpireEvent");
			return;
		}
	}
}

	for (int i=0 ; i < ITEM_LIMIT_MAX_NUM ; i++)
	{
		if (LIMIT_REAL_TIME == item->GetLimitType(i))
		{
			if (item->GetLimitValue(i))
			{
				item->SetSocket(0, time(0) + item->GetLimitValue(i)); 
			}
			else
			{
				item->SetSocket(0, time(0) + 60*60*24*7); 
			}

			item->StartRealTimeExpireEvent();
		}

  • Love 1
Link to comment
Share on other sites

9 hours ago, VegaS said:

I think  this is best method.

// Costume


UPDATE `item` SET `socket0`='4233600' WHERE 41001 <= vnum && vnum <= 41135;

//  Hair


UPDATE `item` SET `socket0`='4233600' WHERE 73001 <= vnum && vnum <= 75620;

 

Quote: How can change from source to no remove costumes if have 0 time?

Method shit ( check this ):


void CItem::StartRealTimeExpireEvent()
{
	if (m_pkRealTimeExpireEvent)
		return;
	for (int i=0 ; i < ITEM_LIMIT_MAX_NUM ; i++)
	{
		if (LIMIT_REAL_TIME == GetProto()->aLimits[i].bType || LIMIT_REAL_TIME_START_FIRST_USE == GetProto()->aLimits[i].bType)
		{
			item_vid_event_info* info = AllocEventInfo<item_vid_event_info>();
			info->item_vid = GetVID();
			m_pkRealTimeExpireEvent = event_create( real_time_expire_event, info, PASSES_PER_SEC(1));
			sys_log(0, "REAL_TIME_EXPIRE: StartRealTimeExpireEvent");
			return;
		}
	}
}

 


	for (int i=0 ; i < ITEM_LIMIT_MAX_NUM ; i++)
	{
		if (LIMIT_REAL_TIME == item->GetLimitType(i))
		{
			if (item->GetLimitValue(i))
			{
				item->SetSocket(0, time(0) + item->GetLimitValue(i)); 
			}
			else
			{
				item->SetSocket(0, time(0) + 60*60*24*7); 
			}

			item->StartRealTimeExpireEvent();
		}

 

Code is not working . 

https://metin2.download/picture/k27frZfjqfPp4zi6MUaC9q07EoG01gsf/.png

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

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.