Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- override void WorldTick()
- {
- if(level.time == 5) // Give the lists some time to build.
- {
- // Global variables.
- let gvars = GC_GlobalVariables.Get();
- // Dynamic array of potential lotto winners.
- Array<Actor> PotentialLottoWinners;
- for(int i = 0; i < gvars.MonsterList.Size(); i++)
- {
- if(gvars.MonsterList[i] is "BaronOfHell" ||
- gvars.MonsterList[i] is "PainElemental" ||
- gvars.MonsterList[i] is "Archvile" ||)
- {
- // Push each one's pointer to the list of pointers of this classtype.
- PotentialLottoWinners.Push(gvars.MonsterList[i]);
- }
- }
- // Then randomly select one to give an item.
- PotentialLottoWinners(random(0, PotentialLottoWinners.Size()-1)).GiveInventory("Promotion",1);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement