When i was trying to add npc vocab i couldnt find any released topics. Than finally i found one but than i found out that it was incomplete so here is the complete release of npc vocab. First of all I dont take
anycredits.Thecredits goes to the maker of this code and to ananas for helping me to fix it :] Anyways here is the code: (If you cant find it use CTRL + F)
In world.cpp under:
void world_timed_save(void *world_void)
{
World *world = static_cast<World *>(world_void);
UTIL_PTR_VECTOR_FOREACH(world->characters, Character, character)
{
character->Save();
}
world->guildmanager->SaveAll();
}
add:
http://pastebin.com/2v6spbzG
under:
event = new TimeEvent(spammer, this, 3600.00, Timer::FOREVER);
this->timer.Register(event);
event->Release();
add:
event = new TimeEvent(world_speak_npcs, this, 15.0, Timer::FOREVER);
this->timer.Register(event);
event->Release();
goto: npc.cpp. and add under:
#undef vd
#undef vv
#undef v
this:
http://pastebin.com/CtYPCcVm
now goto world.hpp and add under:
void FormulaVars(std::tr1::unordered_map<std::string, double> &vars, std::string prefix = "");
this:
void Msg(std::string message);
And now of course the .ini file :) Go back to world.cpp and add under:
this->home_config.Read(this->config["HomeFile"]);
this:
this->npcsay_config.Read(this->config["NpcSpeachFile"]);
and add under:
this->home_config.Read(this->config["HomeFile"]);
this:
this->npcsay_config.Read(this->config["NpcSpeachFile"]);
now goto world.hpp and add under:
Config home_config;
this:
Config npcsay_config;
now goto config.ini and add at ###Files### this:
NpcSpeachFile = ./data/npc.ini
now goto your data folder and make a file called: npc.ini and add in it:
### NPC Speach Sentances ###
#Format:
#(NpcID).1 = Message
#(NpcID).2 = Message2
#(NpcId).3 = Message3
#Messages are optional, you can do 1, 2, or 3 and it won't hurt anything.
1.1 = How are c00?
That's the end of the release. :D If you want to have all npc says than add this:
http://pastebin.com/xPJigcuc