Jump to content

Delay time after bravery cape click


Recommended Posts

  • Premium

Change your braverycape type to 18 (quest item)

and use this quest i just wrote, naturally you can change the interval as you like:

 

quest bravery_cape begin
	state start begin
		when BRAVERYCAPEVNUM.use begin
			local interval_time = 3;
			if (pc.getqf("last_time")+interval_time < get_time())
				pc.setqf("last_time", get_time());
				pc.aggregate_monster();
			else
				syschat(string.format("[%s]: You need to wait %s seconds to do that.", item_name(item.get_vnum()), pc.getqf("last_time")+interval_time-get_time()))
			end -- if/else
		end -- when
	end -- state
end -- quest

 

  • Love 3

 

"Nothing's free in this life.

Ignorant people have an obligation to make up for their ignorance by paying those who help them.

Either you got the brains or cash, if you lack both you're useless."

Syreldar

Link to comment
Share on other sites

  • Premium
2 hours ago, Pierx said:

Thanks for answer man, i'll try it :D

But there is no way to do it just by client-side? 

I ask it just for avoid lag problems 

lag? i'm not even using a timer, what are you talking about?

 

"Nothing's free in this life.

Ignorant people have an obligation to make up for their ignorance by paying those who help them.

Either you got the brains or cash, if you lack both you're useless."

Syreldar

Link to comment
Share on other sites

7 minutes ago, Syreldar said:

lag? i'm not even using a timer, what are you talking about?

Yes no timer but I think every time you click on cape, you make a packet between client and server, right? I would avoid that.

Anyway, I tried it but quest doesn't start when i click on cape

PS:I put type 18 and subtype 0

Link to comment
Share on other sites

52 minutes ago, Pierx said:

Yes no timer but I think every time you click on cape, you make a packet between client and server, right? I would avoid that.

Anyway, I tried it but quest doesn't start when i click on cape

PS:I put type 18 and subtype 0

Do you want to set an interval, between uses?  I mean, to can click it at every 3 seconds, for example?

Link to comment
Share on other sites

  • Premium
1 hour ago, Pierx said:

Yes no timer but I think every time you click on cape, you make a packet between client and server, right? I would avoid that.

Anyway, I tried it but quest doesn't start when i click on cape

PS:I put type 18 and subtype 0

You want to avoid..packet sending? XD i don't think you have a clue about what you're saying.

Literally everything, every single thing in the game requires it, it's like you have to pay 10000 dollars and 1 cent and you refuse to give that 1 cent.

 

"Nothing's free in this life.

Ignorant people have an obligation to make up for their ignorance by paying those who help them.

Either you got the brains or cash, if you lack both you're useless."

Syreldar

Link to comment
Share on other sites

11 hours ago, Pierx said:

Yes, exactly what you said

All right!

////////////////////////////////////
// char.h
// search :

DWORD GetLastMoveTime() const {return m_dwLastMoveTime;}

//Add under:

DWORD GetLastCapeUseTime() const {return m_dwLastCapeUseIntTime;}

/////////////////////////////////
// char.h
// search 

DWORD m_dwLastMoveTime;

//Add under:

DWORD m_dwLastCapeUseIntTime;

////////////////////////////////
// char.cpp
// search :

m_dwPlayStartTime = m_dwLastMoveTime = get_dword_time();

// Add under :

m_dwLastCapeUseIntTime = 0;

////////////////////////////
// char.cpp
// search :

case UNIQUE_ITEM_CAPE_OF_COURAGE:
case 70057:
case 39006:
case REWARD_BOX_UNIQUE_ITEM_CAPE_OF_COURAGE:
	AggregateMonster();
	item->SetCount(item->GetCount() - 1);
	break;

// replace

case UNIQUE_ITEM_CAPE_OF_COURAGE:
case 70057:
case 39006:
case REWARD_BOX_UNIQUE_ITEM_CAPE_OF_COURAGE:
{
	int CalcLastCapeUseSec = (get_dword_time() - GetLastCapeUseTime()) / 1000 + 0.5; 

	if (CalcLastCapeUseSec < 1)
	{
		ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Wait 1 second."));
		return false;
	}

	AggregateMonster();
	item->SetCount(item->GetCount() - 1);
}
break;

I did not test it.  Replace 1 with the number of seconds.

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.