The "equip_arrow" seems unavailable in attackSkillSlot
Moderator: Moderators
The "equip_arrow" seems unavailable in attackSkillSlot
The "equip_arrow" seems unavailable in attackSkillSlot.
Even the "equip_????" seem all unavailable in attackSkillSlot.
I can not found any code lines about the "equip_arrow" !!
Even the "equip_????" seem all unavailable in attackSkillSlot.
I can not found any code lines about the "equip_arrow" !!
-
- Developers
- Posts: 1798
- Joined: 05 Dec 2008, 05:42
- Noob?: Yes
Re: The "equip_arrow" seems unavailable in attackSkillSlot
AI::CoreLogic::processSkillUse:
Code: Select all
Actor::Item::scanConfigAndEquip("$args->{prefix}_equip");
Re: The "equip_arrow" seems unavailable in attackSkillSlot
Thank you very much !EternalHarvest wrote:AI::CoreLogic::processSkillUse:Code: Select all
Actor::Item::scanConfigAndEquip("$args->{prefix}_equip");
I got it !
But, I set the equip_arrow in attackSkillSlot, it sometimes does not work !
-
- Developers
- Posts: 1798
- Joined: 05 Dec 2008, 05:42
- Noob?: Yes
Re: The "equip_arrow" seems unavailable in attackSkillSlot
Sometimes it does work?sofax222 wrote:it sometimes does not work !
Re: The "equip_arrow" seems unavailable in attackSkillSlot
Yes !EternalHarvest wrote: Sometimes it does work?
I will make more check out.
May be it is a problem in config.txt.
Re: The "equip_arrow" seems unavailable in attackSkillSlot
When my role runs out of equip_arrow item (not un-equip).
And auto-get from storage with autostorage.
Then it can not be auto-equip in attackSkillSlot !
It could be a problem, I am not realy sure !
And auto-get from storage with autostorage.
Then it can not be auto-equip in attackSkillSlot !
It could be a problem, I am not realy sure !
Re: The "equip_arrow" seems unavailable in attackSkillSlot
I got the solution !
I am sure that...
When my role runs out of equip_arrow item (not un-equip).
And auto-get from storage with autostorage.
Then it can not be auto-equip in attackSkillSlot !
I change the code:
Original src/Misc.pm
My new code:
But, I am not sure this is a best solution !
If it is a good solution, I will update it with SVN !
I am sure that...
When my role runs out of equip_arrow item (not un-equip).
And auto-get from storage with autostorage.
Then it can not be auto-equip in attackSkillSlot !
I change the code:
Original src/Misc.pm
Code: Select all
##
# inventoryItemRemoved($invIndex, $amount)
#
# Removes $amount of $invIndex from $char->{inventory}.
# Also prints a message saying the item was removed (unless it is an arrow you
# fired).
sub inventoryItemRemoved {
my ($invIndex, $amount) = @_;
my $item = $char->inventory->get($invIndex);
if (!$char->{arrow} || ($item && $char->{arrow} != $item->{index})) {
# This item is not an equipped arrow
message TF("Inventory Item Removed: %s (%d) x %d\n", $item->{name}, $invIndex, $amount), "inventory";
}
$item->{amount} -= $amount;
$char->inventory->remove($item) if ($item->{amount} <= 0);
$itemChange{$item->{name}} -= $amount;
}
Code: Select all
##
# inventoryItemRemoved($invIndex, $amount)
#
# Removes $amount of $invIndex from $char->{inventory}.
# Also prints a message saying the item was removed (unless it is an arrow you
# fired).
sub inventoryItemRemoved {
my ($invIndex, $amount) = @_;
my $item = $char->inventory->get($invIndex);
if (!$char->{arrow} || ($item && $char->{arrow} != $item->{index})) {
# This item is not an equipped arrow
message TF("Inventory Item Removed: %s (%d) x %d\n", $item->{name}, $invIndex, $amount), "inventory";
}
$item->{amount} -= $amount;
# un-equip the Arrow
if ($item->{amount} <= 0 && $char->{arrow} && ($char->{arrow} == $item->{index})) {
message TF("Run out of Arrow/Bullet: %s (%d)\n", $item->{name}, $invIndex), "inventory";
delete $char->{equipment}{arrow};
}
$char->inventory->remove($item) if ($item->{amount} <= 0);
$itemChange{$item->{name}} -= $amount;
}
If it is a good solution, I will update it with SVN !
-
- Developers
- Posts: 1798
- Joined: 05 Dec 2008, 05:42
- Noob?: Yes
Re: The "equip_arrow" seems unavailable in attackSkillSlot
Fine, if the client follows the same logic (when you've got the same arrows again, they're unequipped).
There's no unequip_item packet for it? Maybe it's here, but not handled right? Also this fix may share some code with unequip_item.
There's no unequip_item packet for it? Maybe it's here, but not handled right? Also this fix may share some code with unequip_item.
Re: The "equip_arrow" seems unavailable in attackSkillSlot
Yes, there is a "00AC" packet for "unequip_item".EternalHarvest wrote:Fine, if the client follows the same logic (when you've got the same arrows again, they're unequipped).
There's no unequip_item packet for it? Maybe it's here, but not handled right? Also this fix may share some code with unequip_item.
And it includes the "Arrows" :
Code: Select all
.........
if ($args->{type} == 10 || $args->{type} == 32768) {
delete $char->{equipment}{arrow};
} else {
.........
So, I think the "unequip_item" packet works fine.
I will to check the received packets after running out of arrows.
Re: The "equip_arrow" seems unavailable in attackSkillSlot
I make sure that the running out of arrows without receiveing any "unequip_item" packets.
Firstly, I add some code into "unequip_item" subroutine to show some messsge on console, such as:
PS: the "unequip_item" subroutine is in src/Newwork/Receive/ServerType0.pm.
Firstly, I add some code into "unequip_item" subroutine to show some messsge on console, such as:
PS: the "unequip_item" subroutine is in src/Newwork/Receive/ServerType0.pm.
Code: Select all
....
sub unequip_item {
my ($self, $args) = @_;
message TF("--- Unequip Packet, item tyep: %d\n", $args->{type}), 'inventory';
.....
[/coe]
Then to process the following steps:
1. To get 10 arrows from storage and equip it.
2. To use the "uneq" to un-equip the arrow. The console show the "Unequip" message what I added.
3. To walk into field and to start to kill the monsters with arrows....
4. When running out the 10 arrows... The console [color=#FF0000]never[/color] show the "Unequip" message what I added.
I do the test twice. And get the same result:
The running out of arrows without receiveing any "unequip_item" packets.
So, I think adding the code into the "inventory_item_removed" packet is a solution, so far.
PS: Actually the modifief code is in inventoryItemRemoved of src/Misc.pm file