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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...