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
  On 5/5/2013 at 11:39 PM, ower12 said:

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
  On 5/5/2013 at 11:46 PM, `Heroin said:

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
  On 5/5/2013 at 11:47 PM, Stewie said:

                  }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?

  On 5/5/2013 at 11:46 PM, `Heroin said:

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
  On 5/7/2013 at 6:36 PM, ower12 said:

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
  On 5/7/2013 at 8:21 PM, Stewie said:

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
  On 5/7/2013 at 10:46 PM, ower12 said:

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

    • My repository  https://github.com/gawric/Unity-Client-for-L2J
    • Project based on lucera2 Chronicle: Interlude Starting level: 80 Max level: 95 EXP/SP: x160 DROP:X1 RAID:X1 SAFE+7 MAX+25 Farm Aresa Cave of Trials Hellbound Night Instance - Elven Fortress from 10pm to 11pm PvP Areas Gludin Village - max item level 1 Garden of Eva - max items 3 lvl Hellbound Town - No restrictions *PvP Rewards enchant scrolls PVP SKILLS: - 1 lvl > 1000 pvps > Evo Magic Barrier - 2 lvl > 2000 pvps > Evo Shield - 3 lvl > 5000 pvps > Evo Might/Empower - 4 lvl > 10000 pvps > Evo Health - 5 lvl > 15000 pvps > Evo Bererker - 6 lvl > 20000 pvps > Evo Valor - Note: You need to restart to earn the skill! - Announcing your rank level on entering. - PvP Skills available only on the main class! - The buffs can be stucked from all levels! Custom Items Armors 5 lvls 1 lvl epic armor 2 lvl dynasty armor 3 lvl Vesper armor 4 lvl Titanium Armor 5 lvl Bloody Armor Weapons 6 lvls 1 lvl monster weapons 2 lvl dynasty weapons 3 lvl vesper weapons 4 lvl divine weapons (good for farm) 5 lvl weapons titanium weapons 6 lvl Raid & God weapons *Raid weapons can be earned only from RAIDS! * Raids and god weapons have the same stats. Jews Normal and Relic Accessories 1 & 2 lvl. Tattoos 1 & 2 lvl *2 lvl tattos can be enchanted. On each enchant adding atak speed, cast, hp, p.atk, m.atk, health depends on the tattoo. Enchant bonuses on weapon armors on weapon vary from +16 to +25 on armors +16 evo aura/ +18 bonus stas ENCHANT RATES BLESSED SCROLLS: -5% after every enchant EVO SCROLLS: +5% more chance than BLESSED EVO EPIC SCROLLS: +5% more chance and on fail the enchant stays the same DIVINE SCROLL: Only for divine weapons. 100% success rate. GOD SCROLL: 100% success rate. Only for God/raid weps/bloody armor. Farm and Economy Full custom farm mobs Armor/Weapon +++ as possible drop Custom Coins Custom chests (appear after the mob is killed with %). You can earn additional rare rewards. 2 levels of custom chests for better rewards. L2 Evo Quest - Daily challange. You need to collect 20 Evo Quest coins. After finishing the quest you will get your dialy reward. - 7 Days reward (progressive) - 4 cycles reward (When you finish 4 weeks quests, you will be awarded with a rare coin. You can exchange this Rare Coin for: 3 lvl weapon +0, Heroic Coin (3 days), 2 level jews. - Added quest tracking day 1: Silver Coins - 1000, 1 Blessed Scroll Weapon day 2: Blue Eva - 500, 2 Blessed Scroll Armor day 3: Silver Coins - 1400, 5 Event Medals day 4: Festival Adena- 50, 3 Blessed Scroll Weapon day 5: Silver Coins 2000, 4 Blessed Scroll Armor day 6: Blue Eva - 2000, Event Medal: 8 day 7: Heroic Contract 1, Event Medal 15 * With heroic contract you can get 3 days hero from the Donate Services NPC. All raids removed. All party mobs drop raid and epic raid coins. All clans have the chance to get unlimited raids. We have 3 custom pvp raids in the pvp zones. Respawn 12h. EVENTS TVT CTF SQUASH EVENT NIGHT EVENT Custom NPCS Gatekeeper Custom Shop - all important items Buffer - all needed buffs GM Shop - all basic items Donate shop - all items that can be donated Night Instance - Special Event (every day 10pm to 11pm) +2GMT *type .time in game to see the server time. Quest Manager Skill enchant manager Letters collector (earn additional rewards for collecting words) About classes: All classes boosted PVE skill dmg All summoners classes boosted (pet instant 92lvl) + boosted skills on pet. Critical Damage restriction formula. Website: https://l2evo.net GRAND OPENING: 24.04.2025 8PM +2 GMT. DISCORD: https://discord.gg/3DcBVKhNnX  
    • Get A Free Trial NOW! Get A Free Trial NOW! Get A Free Trial NOW!
  • Topics

×
×
  • Create New...