Jump to content

Question

Posted

ello you ask someone save items for noblest try make many times and I can not if someone can make me want to ask 4 items and you have to be lvl 78 .. thanks ..

p.d srry for my bad engish

 

else if (command.startsWith("become_noble"))

{

NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());

 

if (!player.isNoble())

{

player.setNoble(true, true);

player.sendPacket(new UserInfo(player));

html.setFile("data/html/classmaster/nobleok.htm");

player.sendPacket(html);

}

else

{

html.setFile("data/html/classmaster/alreadynoble.htm");

player.sendPacket(html);

}

}

1 answer to this question

Recommended Posts

  • 0
Posted

ello you ask someone save items for noblest try make many times and I can not if someone can make me want to ask 4 items and you have to be lvl 78 .. thanks ..

p.d srry for my bad engish

 

else if (command.startsWith("become_noble"))

{

NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());

 

if (!player.isNoble())

{

player.setNoble(true, true);

player.sendPacket(new UserInfo(player));

html.setFile("data/html/classmaster/nobleok.htm");

player.sendPacket(html);

}

else

{

html.setFile("data/html/classmaster/alreadynoble.htm");

player.sendPacket(html);

}

}

 

there ya go, fresh and new  :not bad:

else if (command.startsWith("become_noble"))
		{ 
		NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
		if (!player.isNoble())
			{
				//then you check for the level 78
				if(player.getLevel()>=78){

					//then you ask for items						
					if(
					player.getInventory().getItemByItemId(12345/**1 item id **/).getCount()>=12345/** Is bigger or equals required item count **/
					&& player.getInventory().getItemByItemId(12345/**2 item id **/).getCount()>=12345/** Is bigger or equals required item count **/
					&& player.getInventory().getItemByItemId(12345/**3 item id **/).getCount()>=12345/** Is bigger or equals required item count **/	
					&& player.getInventory().getItemByItemId(12345/**4 item id **/).getCount()>=12345/** Is bigger or equals required item count **/	
					){
					L2ItemInstance tiara = player.getInventory().addItem("tiara", 7694, 1, player, null);//give nobless tiara
					player.getInventory().equipItemAndRecord(tiara);//equip the tiara if you want
					player.setNoble(true, true);
					player.sendPacket(new UserInfo(player));
					html.setFile("data/html/classmaster/nobleok.htm");
					}else
						player.sendMessage("You don't have enough items.");
				}	
				else
					player.sendMessage("Your level must be 78 or higher.");
			}
			else
				html.setFile("data/html/classmaster/alreadynoble.htm");

			player.sendPacket(html);
			//and don't forget the imports for l2iteminstance etc..
		}

Guest
This topic is now closed to further replies.


×
×
  • Create New...