[Commands] Add #fish Command (#4136)

* [Commands] Add #fish Command

# Notes
- Adds `#fish` command.
- Allows operators to simulate fishing to see what they would get, consumes no bait.

* `use_bait`

* Update fish.cpp
This commit is contained in:
Alex King
2024-02-29 21:24:16 -05:00
committed by GitHub
parent 1cbda61891
commit c3d8d423fe
5 changed files with 16 additions and 5 deletions
+6 -4
View File
@@ -257,7 +257,7 @@ bool Client::CanFish() {
return true;
}
void Client::GoFish()
void Client::GoFish(bool guarantee, bool use_bait)
{
//TODO: generate a message if we're already fishing
@@ -306,7 +306,7 @@ void Client::GoFish()
fishing_skill = 100+((fishing_skill-100)/2);
}
if (zone->random.Int(0,175) < fishing_skill) {
if (guarantee || zone->random.Int(0,175) < fishing_skill) {
uint32 food_id = 0;
//25% chance to fish an item.
@@ -343,8 +343,10 @@ void Client::GoFish()
}
}
//consume bait, should we always consume bait on success?
DeleteItemInInventory(bslot, 1, true); //do we need client update?
if (use_bait) {
//consume bait, should we always consume bait on success?
DeleteItemInInventory(bslot, 1, true); //do we need client update?
}
if(food_id == 0) {
int index = zone->random.Int(0, MAX_COMMON_FISH_IDS-1);