Kore is not identifying the weapon type

All resolved question will be found here. It is recommended that you browse / search through this section first and see if your question has been answered before

Moderators: Moderators, Documentation Writers

User avatar
SkylorD
Moderators
Moderators
Posts: 1196
Joined: 16 Dec 2011, 02:53
Noob?: No
Location: Brazil

Kore is not identifying the weapon type

#1 Post by SkylorD »

Hello.

Today I was watching my eq, and I remembered that I possessed an elemental weapon, the fire damascus.
However, I noticed that when typing "q", the element did not appear.
I play in bRO.

My openkore is version 7910..

Good,So I went looking for the error, I even try to solve...
I went para src\network\receive\ServerType0.pm and found this line :

Code: Select all

   $self->{nested} = {
      items_nonstackable => { # EQUIPMENTITEM_EXTRAINFO
         type1 => {
            len => 20,
            types => 'v2 C2 v2 C2 a8',
            keys => [qw(index nameID type identified type_equip equipped broken upgrade cards)],
         },
         type2 => {
            len => 24,
            types => 'v2 C2 v2 C2 a8 l',
            keys => [qw(index nameID type identified type_equip equipped broken upgrade cards expire)],
         },
         type3 => {
            len => 26,
            types => 'v2 C2 v2 C2 a8 l v',
            keys => [qw(index nameID type identified type_equip equipped broken upgrade cards expire bindOnEquipType)],
         },
         type4 => {
            len => 28,
            types => 'v2 C2 v2 C2 a8 l v2',
            keys => [qw(index nameID type identified type_equip equipped broken upgrade cards expire bindOnEquipType sprite_id)],
         },
      },
      items_stackable => {
         type1 => {
            len => 10,
            types => 'v2 C2 v2',
            keys => [qw(index nameID type identified amount type_equip)], # type_equip or equipped?
         },
         type2 => {
            len => 18,
            types => 'v2 C2 v2 a8',
            keys => [qw(index nameID type identified amount type_equip cards)],
         },
         type3 => {
            len => 22,
            types => 'v2 C2 v2 a8 l',
            keys => [qw(index nameID type identified amount type_equip cards expire)],
         },
      },
   };
I don't understand nothing that are written here.
Sorry if this problem was solved.I use search ;)
Learn rules
EternalHarvest
Developers
Developers
Posts: 1798
Joined: 05 Dec 2008, 05:42
Noob?: Yes

Re: Kore is not identifying the weapon type

#2 Post by EternalHarvest »

If the inventory looks normal and all items are displayed, but some details (element) aren't displaying, the problem is probably with sub itemName in Misc.pm.
User avatar
SkylorD
Moderators
Moderators
Posts: 1196
Joined: 16 Dec 2011, 02:53
Noob?: No
Location: Brazil

Re: Kore is not identifying the weapon type

#3 Post by SkylorD »

Code: Select all

sub itemName {
	my $item = shift;

	my $name = itemNameSimple($item->{nameID});

	# Resolve item prefix/suffix (carded or forged)
	my $prefix = "";
	my $suffix = "";
	my @cards;
	my %cards;
	for (my $i = 0; $i < 4; $i++) {
		my $card = unpack("v1", substr($item->{cards}, $i*2, 2));
		next unless $card;
		push(@cards, $card);
		($cards{$card} ||= 0) += 1;
	}
	if ($cards[0] == 254) {
		# Alchemist-made potion
		#
		# Ignore the "cards" inside.
	} elsif ($cards[0] == 65280) {
		# Pet egg
		# cards[0] == 65280
		# substr($item->{cards}, 2, 4) = packed pet ID
		# cards[3] == 1 if named, 0 if not named

	} elsif ($cards[0] == 255) {
		# Forged weapon
		#
		# Display e.g. "VVS Earth" or "Fire"
		my $elementID = $cards[1] % 10;
		my $elementName = $elements_lut{$elementID};
		my $starCrumbs = ($cards[1] >> 8) / 5;
		if ( $starCrumbs >= 1 && $starCrumbs <= 3 )
		{
			$prefix .= ('V'x$starCrumbs)."S " if $starCrumbs;
			$prefix .= "$elementName " if ($elementName ne "");
			$suffix = "$elementName" if ($elementName ne "");
		}
	} elsif (@cards) {
		# Carded item
		#
		# List cards in alphabetical order.
		# Stack identical cards.
		# e.g. "Hydra*2,Mummy*2", "Hydra*3,Mummy"
		$suffix = join(':', map {
			cardName($_).($cards{$_} > 1 ? "*$cards{$_}" : '')
		} sort { cardName($a) cmp cardName($b) } keys %cards);
	}

	my $numSlots = $itemSlotCount_lut{$item->{nameID}} if ($prefix eq "");

	my $display = "";
	$display .= "BROKEN " if $item->{broken};
	$display .= "+$item->{upgrade} " if $item->{upgrade};
	$display .= $prefix if $prefix;
	$display .= $name;
	$display .= " [$suffix]" if $suffix;
	$display .= " [$numSlots]" if $numSlots;

	return $display;
}
I do not understand any of that sub.
I Think in modify this line :
$suffix = "$elementName" if ($elementName ne "");
Modifying the ne to eq,but doesn't work :)

You can help me with this ?
This archives is very large.
Most do not read this file. Except for the part of monsters.

Thanks for the help, is an advance. ;)
Learn rules