mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 14:41:28 +00:00
[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:
parent
1cbda61891
commit
c3d8d423fe
@ -1090,7 +1090,7 @@ public:
|
|||||||
void SetPEQZoneFlag(uint32 zone_id);
|
void SetPEQZoneFlag(uint32 zone_id);
|
||||||
|
|
||||||
bool CanFish();
|
bool CanFish();
|
||||||
void GoFish();
|
void GoFish(bool guarantee = false, bool use_bait = true);
|
||||||
void ForageItem(bool guarantee = false);
|
void ForageItem(bool guarantee = false);
|
||||||
//Calculate vendor price modifier based on CHA: (reverse==selling)
|
//Calculate vendor price modifier based on CHA: (reverse==selling)
|
||||||
float CalcPriceMod(Mob* other = 0, bool reverse = false);
|
float CalcPriceMod(Mob* other = 0, bool reverse = false);
|
||||||
|
|||||||
@ -131,6 +131,7 @@ int command_init(void)
|
|||||||
command_add("feature", "Change your or your target's feature's temporarily", AccountStatus::QuestTroupe, command_feature) ||
|
command_add("feature", "Change your or your target's feature's temporarily", AccountStatus::QuestTroupe, command_feature) ||
|
||||||
command_add("size", "Change your targets size (alias of #feature size)", AccountStatus::QuestTroupe, command_feature) ||
|
command_add("size", "Change your targets size (alias of #feature size)", AccountStatus::QuestTroupe, command_feature) ||
|
||||||
command_add("find", "Search command used to find various things", AccountStatus::Guide, command_find) ||
|
command_add("find", "Search command used to find various things", AccountStatus::Guide, command_find) ||
|
||||||
|
command_add("fish", "Fish for an item", AccountStatus::QuestTroupe, command_fish) ||
|
||||||
command_add("fixmob", "[race|gender|texture|helm|face|hair|haircolor|beard|beardcolor|heritage|tattoo|detail] [next|prev] - Manipulate appearance of your target", AccountStatus::QuestTroupe, command_fixmob) ||
|
command_add("fixmob", "[race|gender|texture|helm|face|hair|haircolor|beard|beardcolor|heritage|tattoo|detail] [next|prev] - Manipulate appearance of your target", AccountStatus::QuestTroupe, command_fixmob) ||
|
||||||
command_add("flagedit", "Edit zone flags on your target. Use #flagedit help for more info.", AccountStatus::GMAdmin, command_flagedit) ||
|
command_add("flagedit", "Edit zone flags on your target. Use #flagedit help for more info.", AccountStatus::GMAdmin, command_flagedit) ||
|
||||||
command_add("forage", "Forage an item", AccountStatus::QuestTroupe, command_forage) ||
|
command_add("forage", "Forage an item", AccountStatus::QuestTroupe, command_forage) ||
|
||||||
@ -823,6 +824,7 @@ void command_bot(Client *c, const Seperator *sep)
|
|||||||
#include "gm_commands/faction.cpp"
|
#include "gm_commands/faction.cpp"
|
||||||
#include "gm_commands/feature.cpp"
|
#include "gm_commands/feature.cpp"
|
||||||
#include "gm_commands/find.cpp"
|
#include "gm_commands/find.cpp"
|
||||||
|
#include "gm_commands/fish.cpp"
|
||||||
#include "gm_commands/fixmob.cpp"
|
#include "gm_commands/fixmob.cpp"
|
||||||
#include "gm_commands/flagedit.cpp"
|
#include "gm_commands/flagedit.cpp"
|
||||||
#include "gm_commands/forage.cpp"
|
#include "gm_commands/forage.cpp"
|
||||||
|
|||||||
@ -83,6 +83,7 @@ void command_faction(Client *c, const Seperator *sep);
|
|||||||
void command_faction_association(Client *c, const Seperator *sep);
|
void command_faction_association(Client *c, const Seperator *sep);
|
||||||
void command_feature(Client *c, const Seperator *sep);
|
void command_feature(Client *c, const Seperator *sep);
|
||||||
void command_find(Client *c, const Seperator *sep);
|
void command_find(Client *c, const Seperator *sep);
|
||||||
|
void command_fish(Client* c, const Seperator* sep);
|
||||||
void command_fixmob(Client *c, const Seperator *sep);
|
void command_fixmob(Client *c, const Seperator *sep);
|
||||||
void command_flagedit(Client *c, const Seperator *sep);
|
void command_flagedit(Client *c, const Seperator *sep);
|
||||||
void command_forage(Client* c, const Seperator* sep);
|
void command_forage(Client* c, const Seperator* sep);
|
||||||
|
|||||||
@ -257,7 +257,7 @@ bool Client::CanFish() {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client::GoFish()
|
void Client::GoFish(bool guarantee, bool use_bait)
|
||||||
{
|
{
|
||||||
|
|
||||||
//TODO: generate a message if we're already fishing
|
//TODO: generate a message if we're already fishing
|
||||||
@ -306,7 +306,7 @@ void Client::GoFish()
|
|||||||
fishing_skill = 100+((fishing_skill-100)/2);
|
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;
|
uint32 food_id = 0;
|
||||||
|
|
||||||
//25% chance to fish an item.
|
//25% chance to fish an item.
|
||||||
@ -343,8 +343,10 @@ void Client::GoFish()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//consume bait, should we always consume bait on success?
|
if (use_bait) {
|
||||||
DeleteItemInInventory(bslot, 1, true); //do we need client update?
|
//consume bait, should we always consume bait on success?
|
||||||
|
DeleteItemInInventory(bslot, 1, true); //do we need client update?
|
||||||
|
}
|
||||||
|
|
||||||
if(food_id == 0) {
|
if(food_id == 0) {
|
||||||
int index = zone->random.Int(0, MAX_COMMON_FISH_IDS-1);
|
int index = zone->random.Int(0, MAX_COMMON_FISH_IDS-1);
|
||||||
|
|||||||
6
zone/gm_commands/fish.cpp
Normal file
6
zone/gm_commands/fish.cpp
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
#include "../client.h"
|
||||||
|
|
||||||
|
void command_fish(Client *c, const Seperator *sep)
|
||||||
|
{
|
||||||
|
c->GoFish(true, false);
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user