Jump to content
  • 0

[Help] Hero messenger NPC


Question

Posted

geia :)

vrika sto forum ena npc opou boroun oi aploi char na milane sto hero chat alla 9eli item gia na milisoun..evala 500 adena alla den ta kanei destory otan milas mia fora..

alla vlepi ama exeis 500 adena gia na milisis dn s ta katastrefi ;$

 

	else if(_command.startsWith("hmesit")){
							String heroMessage = "";
							int itemId = 57 , itemCount = 500;
							StringTokenizer stringTokenizer = new StringTokenizer(_command);
							stringTokenizer.nextToken();

									while(stringTokenizer.hasMoreTokens())
										heroMessage = heroMessage + stringTokenizer.nextToken() + " ";

							if(heroMessage == "")
								return;

							if(heroMessage.length() >= 100)
							{
								activeChar.sendMessage("too much big");
								return;
							}

							if(activeChar.getInventory().getItemByItemId(itemId) == null || activeChar.getInventory().getItemByItemId(itemId).getCount() < itemCount){
								activeChar.sendMessage("You don't have enought items to use this npc instance");
								return;
							}

							activeChar.getInventory().destroyItemByItemId("done", itemId, itemCount, activeChar, null);
							for(L2PcInstance heroTakers : L2World.getInstance().getAllPlayers())
								if(heroTakers != null)
								heroTakers.sendPacket(new CreatureSay(activeChar.getObjectId(),Say2.HERO_VOICE,activeChar.getName(),heroMessage));
						}

afto beni sto RequestBypassToServer.java

bori kapios na to epe3ergasti lg gia na katastrefete to item otan milaei meso tou NPC?

3 answers to this question

Recommended Posts

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock