Skip to content

Instantly share code, notes, and snippets.

@rvvvt
Created October 9, 2022 02:36
Show Gist options
  • Save rvvvt/dbfee3e801822658b424cfb019a30ba0 to your computer and use it in GitHub Desktop.
Save rvvvt/dbfee3e801822658b424cfb019a30ba0 to your computer and use it in GitHub Desktop.
random wand drop
public void OnDeath(Container c) // (random chance)
{
base.OnDeath(c);
if (1.0 > Utility.RandomDouble()) // 0.1=10% chance to drop
switch (Utility.Random(3))
{
case 0: c.DropItem(new WeaknessWand()); break;
case 1: c.DropItem(new ClumsyWand()); break;
case 2: c.DropItem(new FeebleWand()); break;
case 3: c.DropItem(new MagicArrowWand()); break;
case 4: c.DropItem(new HarmWand()); break;
case 5: c.DropItem(new HealWand()); break;
case 6: c.DropItem(new GreaterHealWand()); break;
case 7: c.DropItem(new FireballWand()); break;
case 8: c.DropItem(new LightningWand()); break;
case 9: c.DropItem(new IDWand()); break;
case 10: c.DropItem(new ManaDrainWand()); break;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment