Guest User

Untitled

a guest
Apr 25th, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.55 KB | None | 0 0
  1.                     bool found = false;
  2.                     for (auto i = 0; i < 4; i++) {
  3.                         for_each(data.begin(), data.end(), [&](pair<string, Node *>node) {
  4.                             auto realnode = node.second;
  5.                             if (realnode["speak"] && rand() % 5 == 2) {
  6.                                 ChangeState(node.first);
  7.                                 // Get text to show.
  8.                                 auto speakLines = realnode["speak"];
  9.                                 auto line = speakLines[tostring(rand() % (speakLines.end() - speakLines.begin()))];
  10.                                 ((Npc*)this)->cb.Set((string)WZ["String"]["Npc"][(string)line], "npc");
  11.                             }
  12.                         });
  13.                         if (found) break;
  14.                     }
Add Comment
Please, Sign In to add comment