How do you make random attacks?
eg.
PlaySound(1);
Display("You attack NPC");
GiveScore(-2);
PlaySound(2);
Display(NPC throws fireball");
SetglobalInt(2,GetGlobalInt(2)-2);
//I have my comaprisons for health here
Now how can i make this:
PlaySound(2);
Display(NPC throws fireball");
SetglobalInt(2,GetGlobalInt(2)-2);
randomize with this
PlaySound(3);
Display(NPC throws Lava at you");
SetGlobalInt(2,GetGlobalInt(2)-2);
I hope I'm being clear ???
int ran = Random(1);
if (ran == 0) {
PlaySound(2);
Display("NPC throws fireball");
SetGlobalInt(2, GetGlobalInt(2) - 2);
}
else { // ran == 1
PlaySound(3);
Display("NPC throws Lava at you.");
SetGlobalInt(2, GetGlobalInt(2) - 2);
}