This tool comes in handy for almost anybody playing your server,type #detail all, tips, or drops. "All" tells map id, tips, and drops on the map for players. "drops" = the n.p.c drops on the map. "tips" anything useful to help players understand the features of the map. You can add more to
theconfig as felt needed.
EX:std::string details, tips, drops;
or add more like std::string details, tips, drops, history,map story,map effect;
this will be a simple add in to servers < rev 203 "Im waiting tell sausage finishes updating newer revs before even messing with them"
In Talk.cpp add this with player commands
else if (command.length() >= 6 && command.compare(0,6,"detail") == 0 && arguments.size() >= 1)
{
int map = this->player->character->mapid;
int x = this->player->character->x;
int y = this->player->character->y;
int mid; std::string details, tips, drops;
for(int i = 0 ; i < static_cast<int>(this->server->world->details_config["amount"]) ; i++)
{
mid = static_cast<int>(this->server->world->details_config[util::to_string(i+1) + ".map"]);
details = static_cast<std::string>(this->server->world->details_config[util::to_string(i+1) + ".details"]);
drops = static_cast<std::string>(this->server->world->details_config[util::to_string(i+1) + ".drops"]);
if(this->player->character->mapid == mid)
{
PacketBuilder builder;
builder.SetID(PACKET_TALK, PACKET_TELL);
builder.AddBreakString("modbot");
if(arguments[0] == "all")
{
builder.AddBreakString("your location is" + util::to_string(x) + " , " + util::to_string(y) + " On map " + util::to_string(map) + ":" + "and here is some info about this map." + details + "The drops on thismapare,"
+ drops);
}
else if(arguments[0] == "tips")
{
builder.AddBreakString("here is some info about this map." + details);
}
else if(arguments[0] == "drops")
{
builder.AddBreakString("this maps drops are," + drops);
}
this->player->client->SendBuilder(builder);
}
}
}
In world.cpp add this in World::World(util::array<std::string, 6> dbinfo, const Config &eoserv_config, const Config &admin_config) with the rest.
this->details_config.Read(this->config["DetailsFile"]);
In void world::rehash add this
this->details_config.Read(static_cast<std::string>(this->config["DetailsFile"]));
in world.hpp add this with rest thank you
Config details_config
In your config.ini and config.local.ini add this above ## MapDir (string)
## DetailsFile (string)
# Detail of maps
DetailsFile = ./data/details.ini
Then in your data folder create a details.ini with this layout
##Map discriptions
amount = 3
1.map = 2
1.details =This is a harvesting map you need a pick axe to harvest, you can get a pixaxe in Davolger shops!
1.drops = Dragon: wing,claw,gold. Minion:ash,gold
2.map = 5
2.tips = the dragon has the key
2.drops = Spider:leg,fang,gold.
3.map = 7
3.details = the third door on the north of here
3.drops = Mrs.Pergitory: chains,shank,gold.