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

    • We can help your Telegram group or channel grow fast with real, targeted Telegram members, safely and efficiently.   Our Telegram Member Add service lets you add members to Telegram group or channel from real, active communities — not bots or fakes.   With this Telegram group growth service, you’ll see results within hours, backed by clear reporting and safe automation.   ✅ What We Offer   • Done-for-you Telegram Member Add campaigns (Groups · Channels) • Targeted Telegram members from real, active users • Fast growth — up to 10K members in 24 hours • English-speaking or regional audiences (US · UK · EU) • Fully managed Telegram channel growth service with reports & analytics   💡 Why Choose Us   We don’t use spam or fake accounts. Our process safely adds members to your Telegram group or channel through verified multi-account setups, proxy rotation, and opt-out compliance. This ensures lasting growth and minimizes churn. Every campaign is managed by experts using tested Telegram infrastructure and growth systems. We also recommend combining Member Add with Telegram Mass DM for better engagement and retention after join.   🧩 Works Best For   • Businesses or communities launching new Telegram channels • Crypto, SaaS, and marketing projects needing visibility • Influencers and agencies growing multiple Telegram groups • Anyone seeking a reliable Telegram group growth service with real members 📩 To Get More Information   Telegram : @TeleLoopPulse   Website : https://telegramgrowthstudio.com/telegram-member-add.html
    • well,its SharedCreatureData.h problem.   /* 0398 */ //WCHAR m_sResurrectSpellerName[25];   this variable will cause L2server.exe crash...  
    • Custom High Five server L2insolence will open 2025-10-17 21:00 GMT+2 ! ! ! Web site: http://www.l2insolence.eu All info updates on Discord: https://discord.gg/duMjnj3y9A Last wipe was more then 1 year ago. We have custom skill, farm zones, materials for items to buy. Custom wepons, armor, jewels and more. All items in game have own stats. With custom looks. Glowing etc. Rates XP, SP: 25x Spoil and Drop: 10x Adena: 20x Server Hard Farm Enchantment Safe enchant Weapon: +20099 Safe enchant Armor: +20099 Max enchant Weapon: +20099 Max enchant Armor: +20099 Normal scrolls: 100% Blessed scrolls: 100% You can use scrolls or item enchant NPC to make +++ abd life beter. NPC Buffer There's an NPC buffer in all of our main towns: Aden, Giran and Goddard. It supplies Prophet Buffs, Songs and Dances for a small fee. Include all buff. We have custom self buffs learned with npc with custom stats. Global Gatekeeper GM Shop with normal items and custom ones, vote NPC, Event NPC, item upgrader NPC. Raid Bosses, every zone have its own boss and drops for rare mats. Olympiad The olympiad is ongoing every two weeks. Meaning if you become a hero you will have your hero status for two weeks. And hero have own custom stats on items.
  • 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