Advertisement
Guest User

Untitled

a guest
Oct 20th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. override void WorldTick()
  2. {
  3. if(level.time == 5) // Give the lists some time to build.
  4. {
  5. // Global variables.
  6. let gvars = GC_GlobalVariables.Get();
  7. // Dynamic array of potential lotto winners.
  8. Array<Actor> PotentialLottoWinners;
  9. for(int i = 0; i < gvars.MonsterList.Size(); i++)
  10. {
  11. if(gvars.MonsterList[i] is "BaronOfHell" ||
  12. gvars.MonsterList[i] is "PainElemental" ||
  13. gvars.MonsterList[i] is "Archvile" ||)
  14. {
  15. // Push each one's pointer to the list of pointers of this classtype.
  16. PotentialLottoWinners.Push(gvars.MonsterList[i]);
  17. }
  18. }
  19. // Then randomly select one to give an item.
  20. PotentialLottoWinners(random(0, PotentialLottoWinners.Size()-1)).GiveInventory("Promotion",1);
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement