Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool found = false;
- for (auto i = 0; i < 4; i++) {
- for_each(data.begin(), data.end(), [&](pair<string, Node *>node) {
- auto realnode = node.second;
- if (realnode["speak"] && rand() % 5 == 2) {
- ChangeState(node.first);
- // Get text to show.
- auto speakLines = realnode["speak"];
- auto line = speakLines[tostring(rand() % (speakLines.end() - speakLines.begin()))];
- ((Npc*)this)->cb.Set((string)WZ["String"]["Npc"][(string)line], "npc");
- }
- });
- if (found) break;
- }
Add Comment
Please, Sign In to add comment