Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void AEPotionDust(RealmTime time, Item item, Position target, ActivateEffect eff)
- {
- var gameData = Program.Resources.GameData;
- var avaliableslot = Inventory.GetAvailableInventorySlot(item);
- var avaliablecontainerslot = containerItem.Inventory.GetAvailableInventorySlot(item);
- ushort itemValue;
- var potionchance = Random.NextDouble();
- if(potionchance <= 0.20)
- {
- var lifemanapotionchance = Random.Next(0, 2);
- Console.WriteLine("Life Mana = " + lifemanapotionchance);
- switch (lifemanapotionchance)
- {
- case 0:
- itemValue = 0xae9; //Potion of Life
- if (containerItem != null)
- containerItem.Inventory[avaliablecontainerslot] = gameData.Items[itemValue];
- else
- Inventory[avaliableslot] = gameData.Items[itemValue];
- break;
- case 1:
- itemValue = 0xaea; //Potion of Mana
- if (containerItem != null)
- containerItem.Inventory[avaliablecontainerslot] = gameData.Items[itemValue];
- else
- Inventory[avaliableslot] = gameData.Items[itemValue];
- break;
- }
- }
- else
- {
- var commonpotionchance = Random.Next(0, 6);
- Console.WriteLine("Common Potion = " + commonpotionchance);
- switch (commonpotionchance)
- {
- case 0:
- itemValue = 0xa4c; //Potion of Dexterity
- if (containerItem != null)
- containerItem.Inventory[avaliablecontainerslot] = gameData.Items[itemValue];
- else
- Inventory[avaliableslot] = gameData.Items[itemValue];
- break;
- case 1:
- itemValue = 0xa1f; //Potion of Attack
- if (containerItem != null)
- containerItem.Inventory[avaliablecontainerslot] = gameData.Items[itemValue];
- else
- Inventory[avaliableslot] = gameData.Items[itemValue];
- break;
- case 2:
- itemValue = 0xa20; //Potion of Defense
- if (containerItem != null)
- containerItem.Inventory[avaliablecontainerslot] = gameData.Items[itemValue];
- else
- Inventory[avaliableslot] = gameData.Items[itemValue];
- break;
- case 3:
- itemValue = 0xa35; //Potion of Wisdom
- if (containerItem != null)
- containerItem.Inventory[avaliablecontainerslot] = gameData.Items[itemValue];
- else
- Inventory[avaliableslot] = gameData.Items[itemValue];
- break;
- case 4:
- itemValue = 0xa34; //Potion of Vitality
- if (containerItem != null)
- containerItem.Inventory[avaliablecontainerslot] = gameData.Items[itemValue];
- else
- Inventory[avaliableslot] = gameData.Items[itemValue];
- break;
- case 5:
- itemValue = 0xa21; //Potion of Speed
- if (containerItem != null)
- containerItem.Inventory[avaliablecontainerslot] = gameData.Items[itemValue];
- else
- Inventory[avaliableslot] = gameData.Items[itemValue];
- break;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement