Jump to content

How to stop spam elixir?


Recommended Posts

  • Premium
6 minutes ago, ReFresh said:

You can do that by pc.setqf via quest:

 

Hidden Content

 

  Hide contents
		when 27100.use begin
			if pc.getqf("purple_elixir") > get_time() then
				syschat("This elixir is already activated, you have to wait 10 minutes before next use.")
			else
				affect.add_collect(7, 10, 60*10) -- you can edit the time before next use here
				pc.setqf("purple_elixir", get_time() +60*10) -- you can edit the time before next use here
				pc.remove_item(item.vnum, 1)
			end
		end

 

 

 

That is not how it works.
"*.use" triggers only work if the item's type is 18 (ITEM_QUEST), while a Potion/Elixir's type is 3.

Edited by Syreldar
  • Metin2 Dev 1

 

"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

  • Forum Moderator
3 hours ago, ReFresh said:

Sure, I forgot to mention that. But it will work, if you change the item type to 18.

No, it will unfortunately not work at all, you are removing the item as well as adding a "POINT_SP" affect out of nowhere and do not effectively return when the chrono is still running.

First of all, @Jimmermania, if you have an HP bug triggered by the Elixir, you should look forward to fixing this bug INSTEAD of adding a workaround with the elixir.

https://metin2.download/video/W9vALm1ShrWHRgT7m1ILDYMUJsUq627p/.mp4

 

However, a correct way to fix that would be to use the "PulseManager" library (courtesy of @ martysama0134). So basically you add

This is the hidden content, please
into your project and include it (#include "PulseManager.h").

This is the hidden content, please

 

Edited by Gurgarath
Core X - External 2 Internal
  • Metin2 Dev 24
  • Good 2
  • Love 7

Gurgarath
coming soon

Link to comment
Share on other sites

  • Forum Moderator
2 minutes ago, ReFresh said:

@Gurgarath And how you would do that globally for all newly added elixirs (for example for 50 new elixirs with different vnums), if my way is not effective? My way worked for me years ago.

In his case your remove the add_affect from your quest, and pass it to item type 18 and remove the remove item and basically just transform your quest into a setqf check which isn't that worth overall (even more for a 5sec check). Using my method you just have to use "case item_vnum:" and it will get the job done

Edited by Gurgarath
  • Good 1

Gurgarath
coming soon

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.