Added condition for picking up items: If the player has a pet out, don't pick up items manually
This commit is contained in:
parent
440a89ffae
commit
0899e2ed3a
|
|
@ -178,6 +178,8 @@ namespace flyff {
|
||||||
|
|
||||||
DEFINE_MEMBER(3424, Vector<Skill>, skills);
|
DEFINE_MEMBER(3424, Vector<Skill>, skills);
|
||||||
|
|
||||||
|
DEFINE_MEMBER(3548, int, pickup_pet_inventory_index);
|
||||||
|
|
||||||
const MinimumSize<4096> size;
|
const MinimumSize<4096> size;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -747,36 +747,38 @@ void attacker_script() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// No item target and no attack target
|
// Only pickup if player has no pickup pet spawned.
|
||||||
current_pickup_item = find_next_item();
|
if(client.player->pickup_pet_inventory_index == -1) {
|
||||||
item = neuz.get_mover(current_pickup_item);
|
// No item target and no attack target
|
||||||
if (item) {
|
current_pickup_item = find_next_item();
|
||||||
auto *prop = reinterpret_cast<const flyff::ItemProperty *>(
|
item = neuz.get_mover(current_pickup_item);
|
||||||
static_cast<const flyff::ObjectProperty *>(item->property)
|
if (item) {
|
||||||
);
|
auto *prop = reinterpret_cast<const flyff::ItemProperty *>(
|
||||||
|
static_cast<const flyff::ObjectProperty *>(item->property)
|
||||||
|
);
|
||||||
|
|
||||||
std::string str = "Picking up ";
|
std::string str = "Picking up ";
|
||||||
str.append(neuz.get_text(prop->name));
|
str.append(neuz.get_text(prop->name));
|
||||||
|
|
||||||
interact(item->object_id, 1);
|
interact(item->object_id, 1);
|
||||||
|
|
||||||
neuz.show_message(str);
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
current_target = find_closest_target();
|
|
||||||
|
|
||||||
monster = neuz.get_mover(current_target);
|
|
||||||
if (monster) {
|
|
||||||
std::string str = "Attacking ";
|
|
||||||
str.append(monster->name);
|
|
||||||
|
|
||||||
interact(current_target, 1);
|
|
||||||
|
|
||||||
neuz.show_message(str);
|
neuz.show_message(str);
|
||||||
} else {
|
return;
|
||||||
neuz.show_message("Unable to find target.");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
current_target = find_closest_target();
|
||||||
|
monster = neuz.get_mover(current_target);
|
||||||
|
if (monster) {
|
||||||
|
std::string str = "Attacking ";
|
||||||
|
str.append(monster->name);
|
||||||
|
|
||||||
|
interact(current_target, 1);
|
||||||
|
|
||||||
|
neuz.show_message(str);
|
||||||
|
} else {
|
||||||
|
neuz.show_message("Unable to find target.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Reference in New Issue