Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- oid world_speak_npcs(void *world_void)
- {
- World *world = static_cast<World *>(world_void);
- UTIL_PTR_VECTOR_FOREACH(world->maps, Map, map)
- {
- UTIL_PTR_VECTOR_FOREACH(map->npcs, NPC, npc)
- {
- int rand = util::rand(35, 100);
- if(rand > 1 && rand < 3) //1% chance say first message
- {
- npc->Msg(static_cast<std::string>(world->npcsay_config[util::to_string(npc->id) + ".1"]));
- }
- else if(rand > 30 && rand < 32) //1% chance change message
- {
- npc->Msg(static_cast<std::string>(world->npcsay_config[util::to_string(npc->id) + ".2"]));
- }
- else if(rand > 70 && rand < 72) // 1% chance say 3rd
- {
- npc->Msg(static_cast<std::string>(world->npcsay_config[util::to_string(npc->id) + ".3"]));
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement