Skip to content

Hero method for 2 weeks npc

Featured Replies

HI all, i set in my npc to make character hero. In next settings you will see. But, i want to set hero for 1 month. Now, if player buy hero, after restart, hero it's gone.
Here it is few setting.
 

else if (event.equalsIgnoreCase("hero"))
		{
			if (!player.isHero())
			{
				player.setHero(true);
				player.broadcastPacket(new SocialAction(player.getObjectId(), 20016)); // Hero Animation
				player.broadcastUserInfo();
				player.destroyItemByItemId("Get your hero!", 6391, 25000, player, true);
				return "character.htm";
			}
			else if (player.isHero())
			{
				player.setHero(false);
				player.broadcastUserInfo();
				return "character.htm";
			}
		}

How i can set a "period" ? I check olympiad method. But those settings are much and i don't understand nothing.
Greetings

  • Author

I can merge with oly table?

Agree. Thats a big system. You can make it very simple with a long type variable that check upon login if current Milliseconds is smaller than the variable to set hero and upon log out to store but thats an amateur way.

 

You better pay a dev or learn to make something good do not make amateur systems for servers with 2 lines of code just to have em

  • Author

And who can do this? I will pay it

I was scammed by EdithFinch
Anyone can come to fix this please? Not big deal. This guy make an incomplete code. I request a npc which gave hero for 1 day and second time to make a coin (handler) to give hero for 30 days. Coin and Npc take just required items and don't give Hero Status. Also i get time for this. Thank you!

  • 2 months later...

You need to save a unix time to your db, then every time a player logs in you need to make a new thread that removes player's hero in setTime-CurrentTime

  • Zake locked this topic
Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.