Jump to content

Question

Posted

i have problem i line tiara can help me? pls

 

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..

}

 

 

Recommended Posts

  • 0
Posted

Ok, so its noblesse npc?

....

 

                  //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 **/   
                  ){

 

Dude read this part...

  • 0
Posted

yes is npc noble i have problem in line tiara anyone can repair pls! and send me

 

Show me the error... becouse as i  read i can't find anything wrong but the one i already show.

 

Edit try:

                  L2ItemInstance tiara = player.getInventory().addItem("tiara", 7694, 1, player, null);//give nobless tiara

				 	player.getInventory().addItem("tiara", 7694, 1, player, null);//give nobless tiara

  • 0
Posted

first of all using getItemById(222).getCount sucks since player may have not item with 222 ID in his inventory so .getCount is undifined. So use like:

 

if getItemById(222) != null

  if getItemById(222) >= 12345

        .

        .

        .

 

 

  • 0
Posted

first of all using getItemById(222).getCount sucks since player may have not item with 222 ID in his inventory so .getCount is undifined. So use like:

 

if getItemById(222) != null

  if getItemById(222) >= 12345

        .

        .

        .

 

                  }else
                     player.sendMessage("You don't have enough items.");

  • 0
Posted

                  }else
                     player.sendMessage("You don't have enough items.");

 

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(9210/**1 item id **/).getCount()>=9210/** Is bigger or equals required item count **/

&& player.getInventory().getItemByItemId(9211/**2 item id **/).getCount()>=9211/** Is bigger or equals required item count **/

&& player.getInventory().getItemByItemId(9212/**3 item id **/).getCount()>=9212/** Is bigger or equals required item count **/

&& player.getInventory().getItemByItemId(9213/**4 item id **/).getCount()>=9213/** Is bigger or equals required item count **/

){

player.setNoble(true, true);

player.getInventory().addItem("tiara", 7694, 1, player, null);//give nobless tiara

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..

}

 

and me go speak with npc and say me: You don't have enough items ... who is?

  • 0
Posted

               player.getInventory().getItemByItemId(9210/**1 item id **/).getCount()>=9210/** Is bigger or equals required item count **/
               && player.getInventory().getItemByItemId(9211/**2 item id **/).getCount()>=9211/** Is bigger or equals required item count **/
               && player.getInventory().getItemByItemId(9212/**3 item id **/).getCount()>=9212/** Is bigger or equals required item count **/   
               && player.getInventory().getItemByItemId(9213/**4 item id **/).getCount()>=9213/** Is bigger or equals required item count **/   

 

You request  9213 count from item 9213. And so on with all else...

 

 

  • 0
Posted

why don't you try to make this?

first of all using getItemById(222).getCount sucks since player may have not item with 222 ID in his inventory so .getCount is undifined. So use like:

 

if getItemById(222) != null

  if getItemById(222) >= 12345

        .

        .

        .

        .

        .

        .

  • 0
Posted

dont work

 

Man consider learning some more english becouse I am not able to understand what are your error in this case?

As i see the only problem could be in this lines:

   //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.");

 

But without error, or good description what exacly happend when you click/talk with the NPC...

 

 

  • 0
Posted

Man consider learning some more english becouse I am not able to understand what are your error in this case?

As i see the only problem could be in this lines:

   //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.");

 

But without error, or good description what exacly happend when you click/talk with the NPC...

i talk with the NPC i click in become nobles and he say You don't have enough items and me have items.. understand?

  • 0
Posted

i talk with the NPC i click in become nobles and he say You don't have enough items and me have items.. understand?

 

Tell me what chronicle is your L2J?

  • 0
Posted

Well, he asked for the code in this topic  http://maxcheaters.com/forum/index.php?topic=271490.0 but i haven't tested it when i wrote.... so, i think he might have not changed the '12345' to item ids he wanted to ask for ?

 

 

Guest
This topic is now closed to further replies.


  • Posts

    • Vilmis is the biggest scammer in history. He bans his members when they complain about something. I know more than one who's banned him. He updates shit, but he charges you like he's doing something serious.
    • I did not want to, but I will tell a few things (just because of other members that might understand something wrong): 1. Nothing held as hostage some kinda customer of yours. I think even now could find your donate panel code at my source code. So, stop spreading a lie because of your head progressive diseases. 2. Don't use my old customer's post as counterargument. We all had the worst customers which think they are the righest ones no matter what. He was one of them. He caused a lot of problems to me. Also, he was rude and disrespectful. 3. You're just simply hater. No matter what good I'm gonna say you gonna say in reverse. Smarter people sees the truth. 4. Look, you don't like me, I don't like you, but it's unnecessary to comment all post about my project and write everything worst just because you hate me. 😉
    • I've seen this many times, to be honest, let's hope that this time it will actually happen. I would suggest building something that helps develop trust within the community's sales. It could be something similar to FunPay, for example, which ensures secure trades for both the seller and the buyer, along with a rating system for both parties. I would also recommend doing something about the voting site, which has been paused for I don't know how many years since the Fiverr failure. Last but not least, I’d suggest creating an open blog or at least publishing weekly articles that can attract more people to the forum or encourage members to return and read them. The topics of these articles could include overviews and opinions on L2 or GTA V servers, PUBG, Fortnite, tech news, coding updates, or even general news that the author finds interesting.   How could you know such an information? 🤔 And yeah I agree on the part about the poor management
    • ➡ Discount for your purchase: JUNE2025 (10% discount) ➡ Our Online Shop: https://socnet.store  ➡ Our SMM-Boosting Panel: https://socnet.pro  ➡ Telegram Shop Bot: https://socnet.shop  ➡ Telegram Support: https://t.me/solomon_bog  ➡ Telegram Channel: https://t.me/accsforyou_shop  ➡ Discord Support: @AllSocialNetworksShop  ➡ Discord Server: https://discord.gg/y9AStFFsrh  ➡ WhatsApp Support: https://wa.me/79051904467 ➡ WhatsApp Channel: https://whatsapp.com/channel/0029Vau0CMX002TGkD4uHa2n  ➡ Email Support: solomonbog@socnet.store 
    • there are extenders that already have all that included ingame 🙂 for example GX-EXT
  • Topics

×
×
  • 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