Method giveItemRandomly should calculate double chance values.

This commit is contained in:
MobiusDevelopment 2020-06-16 03:24:56 +00:00
parent 438bbb88b7
commit 67fffe36d7
17 changed files with 34 additions and 17 deletions

View File

@ -2876,7 +2876,7 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
long minAmountWithBonus = (long) (minAmount * Config.RATE_QUEST_DROP);
long maxAmountWithBonus = (long) (maxAmount * Config.RATE_QUEST_DROP);
long dropChanceWithBonus = (long) (dropChance * Config.RATE_QUEST_DROP); // TODO separate configs for rate and amount
double dropChanceWithBonus = dropChance * Config.RATE_QUEST_DROP; // TODO separate configs for rate and amount
if ((npc != null) && Config.CHAMPION_ENABLE && npc.isChampion())
{
if ((itemId == Inventory.ADENA_ID) || (itemId == Inventory.ANCIENT_ADENA_ID))
@ -2920,6 +2920,7 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
{
playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
}
// if there is no limit, return true every time an item is given
if (limit <= 0)
{

View File

@ -2876,7 +2876,7 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
long minAmountWithBonus = (long) (minAmount * Config.RATE_QUEST_DROP);
long maxAmountWithBonus = (long) (maxAmount * Config.RATE_QUEST_DROP);
long dropChanceWithBonus = (long) (dropChance * Config.RATE_QUEST_DROP); // TODO separate configs for rate and amount
double dropChanceWithBonus = dropChance * Config.RATE_QUEST_DROP; // TODO separate configs for rate and amount
if ((npc != null) && Config.CHAMPION_ENABLE && npc.isChampion())
{
if ((itemId == Inventory.ADENA_ID) || (itemId == Inventory.ANCIENT_ADENA_ID))
@ -2920,6 +2920,7 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
{
playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
}
// if there is no limit, return true every time an item is given
if (limit <= 0)
{

View File

@ -2877,7 +2877,7 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
long minAmountWithBonus = (long) (minAmount * Config.RATE_QUEST_DROP);
long maxAmountWithBonus = (long) (maxAmount * Config.RATE_QUEST_DROP);
long dropChanceWithBonus = (long) (dropChance * Config.RATE_QUEST_DROP); // TODO separate configs for rate and amount
double dropChanceWithBonus = dropChance * Config.RATE_QUEST_DROP; // TODO separate configs for rate and amount
if ((npc != null) && Config.CHAMPION_ENABLE && npc.isChampion())
{
if ((itemId == Inventory.ADENA_ID) || (itemId == Inventory.ANCIENT_ADENA_ID))
@ -2921,6 +2921,7 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
{
playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
}
// if there is no limit, return true every time an item is given
if (limit <= 0)
{

View File

@ -2877,7 +2877,7 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
long minAmountWithBonus = (long) (minAmount * Config.RATE_QUEST_DROP);
long maxAmountWithBonus = (long) (maxAmount * Config.RATE_QUEST_DROP);
long dropChanceWithBonus = (long) (dropChance * Config.RATE_QUEST_DROP); // TODO separate configs for rate and amount
double dropChanceWithBonus = dropChance * Config.RATE_QUEST_DROP; // TODO separate configs for rate and amount
if ((npc != null) && Config.CHAMPION_ENABLE && npc.isChampion())
{
if ((itemId == Inventory.ADENA_ID) || (itemId == Inventory.ANCIENT_ADENA_ID))
@ -2921,6 +2921,7 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
{
playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
}
// if there is no limit, return true every time an item is given
if (limit <= 0)
{

View File

@ -2877,7 +2877,7 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
long minAmountWithBonus = (long) (minAmount * Config.RATE_QUEST_DROP);
long maxAmountWithBonus = (long) (maxAmount * Config.RATE_QUEST_DROP);
long dropChanceWithBonus = (long) (dropChance * Config.RATE_QUEST_DROP); // TODO separate configs for rate and amount
double dropChanceWithBonus = dropChance * Config.RATE_QUEST_DROP; // TODO separate configs for rate and amount
if ((npc != null) && Config.CHAMPION_ENABLE && npc.isChampion())
{
if ((itemId == Inventory.ADENA_ID) || (itemId == Inventory.ANCIENT_ADENA_ID))
@ -2921,6 +2921,7 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
{
playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
}
// if there is no limit, return true every time an item is given
if (limit <= 0)
{

View File

@ -2877,7 +2877,7 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
long minAmountWithBonus = (long) (minAmount * Config.RATE_QUEST_DROP);
long maxAmountWithBonus = (long) (maxAmount * Config.RATE_QUEST_DROP);
long dropChanceWithBonus = (long) (dropChance * Config.RATE_QUEST_DROP); // TODO separate configs for rate and amount
double dropChanceWithBonus = dropChance * Config.RATE_QUEST_DROP; // TODO separate configs for rate and amount
if ((npc != null) && Config.CHAMPION_ENABLE && npc.isChampion())
{
if ((itemId == Inventory.ADENA_ID) || (itemId == Inventory.ANCIENT_ADENA_ID))
@ -2921,6 +2921,7 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
{
playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
}
// if there is no limit, return true every time an item is given
if (limit <= 0)
{

View File

@ -2877,7 +2877,7 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
long minAmountWithBonus = (long) (minAmount * Config.RATE_QUEST_DROP);
long maxAmountWithBonus = (long) (maxAmount * Config.RATE_QUEST_DROP);
long dropChanceWithBonus = (long) (dropChance * Config.RATE_QUEST_DROP); // TODO separate configs for rate and amount
double dropChanceWithBonus = dropChance * Config.RATE_QUEST_DROP; // TODO separate configs for rate and amount
if ((npc != null) && Config.CHAMPION_ENABLE && npc.isChampion())
{
if ((itemId == Inventory.ADENA_ID) || (itemId == Inventory.ANCIENT_ADENA_ID))
@ -2921,6 +2921,7 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
{
playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
}
// if there is no limit, return true every time an item is given
if (limit <= 0)
{

View File

@ -2877,7 +2877,7 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
long minAmountWithBonus = (long) (minAmount * Config.RATE_QUEST_DROP);
long maxAmountWithBonus = (long) (maxAmount * Config.RATE_QUEST_DROP);
long dropChanceWithBonus = (long) (dropChance * Config.RATE_QUEST_DROP); // TODO separate configs for rate and amount
double dropChanceWithBonus = dropChance * Config.RATE_QUEST_DROP; // TODO separate configs for rate and amount
if ((npc != null) && Config.CHAMPION_ENABLE && npc.isChampion())
{
if ((itemId == Inventory.ADENA_ID) || (itemId == Inventory.ANCIENT_ADENA_ID))
@ -2921,6 +2921,7 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
{
playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
}
// if there is no limit, return true every time an item is given
if (limit <= 0)
{

View File

@ -2473,7 +2473,7 @@ public abstract class AbstractScript extends ManagedScript
long minAmountWithBonus = (long) (minAmount * Config.RATE_QUEST_DROP);
long maxAmountWithBonus = (long) (maxAmount * Config.RATE_QUEST_DROP);
long dropChanceWithBonus = (long) (dropChance * Config.RATE_QUEST_DROP); // TODO separate configs for rate and amount
double dropChanceWithBonus = dropChance * Config.RATE_QUEST_DROP; // TODO separate configs for rate and amount
if ((npc != null) && Config.CHAMPION_ENABLE && npc.isChampion())
{
if ((itemId == Inventory.ADENA_ID) || (itemId == Inventory.ANCIENT_ADENA_ID))
@ -2517,6 +2517,7 @@ public abstract class AbstractScript extends ManagedScript
{
playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
}
// if there is no limit, return true every time an item is given
if (limit <= 0)
{

View File

@ -2473,7 +2473,7 @@ public abstract class AbstractScript extends ManagedScript
long minAmountWithBonus = (long) (minAmount * Config.RATE_QUEST_DROP);
long maxAmountWithBonus = (long) (maxAmount * Config.RATE_QUEST_DROP);
long dropChanceWithBonus = (long) (dropChance * Config.RATE_QUEST_DROP); // TODO separate configs for rate and amount
double dropChanceWithBonus = dropChance * Config.RATE_QUEST_DROP; // TODO separate configs for rate and amount
if ((npc != null) && Config.CHAMPION_ENABLE && npc.isChampion())
{
if ((itemId == Inventory.ADENA_ID) || (itemId == Inventory.ANCIENT_ADENA_ID))
@ -2517,6 +2517,7 @@ public abstract class AbstractScript extends ManagedScript
{
playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
}
// if there is no limit, return true every time an item is given
if (limit <= 0)
{

View File

@ -2851,7 +2851,7 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
long minAmountWithBonus = (long) (minAmount * Config.RATE_QUEST_DROP);
long maxAmountWithBonus = (long) (maxAmount * Config.RATE_QUEST_DROP);
long dropChanceWithBonus = (long) (dropChance * Config.RATE_QUEST_DROP); // TODO separate configs for rate and amount
double dropChanceWithBonus = dropChance * Config.RATE_QUEST_DROP; // TODO separate configs for rate and amount
if ((npc != null) && Config.CHAMPION_ENABLE && npc.isChampion())
{
if ((itemId == Inventory.ADENA_ID) || (itemId == Inventory.ANCIENT_ADENA_ID))
@ -2895,6 +2895,7 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
{
playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
}
// if there is no limit, return true every time an item is given
if (limit <= 0)
{

View File

@ -2851,7 +2851,7 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
long minAmountWithBonus = (long) (minAmount * Config.RATE_QUEST_DROP);
long maxAmountWithBonus = (long) (maxAmount * Config.RATE_QUEST_DROP);
long dropChanceWithBonus = (long) (dropChance * Config.RATE_QUEST_DROP); // TODO separate configs for rate and amount
double dropChanceWithBonus = dropChance * Config.RATE_QUEST_DROP; // TODO separate configs for rate and amount
if ((npc != null) && Config.CHAMPION_ENABLE && npc.isChampion())
{
if ((itemId == Inventory.ADENA_ID) || (itemId == Inventory.ANCIENT_ADENA_ID))
@ -2895,6 +2895,7 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
{
playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
}
// if there is no limit, return true every time an item is given
if (limit <= 0)
{

View File

@ -2851,7 +2851,7 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
long minAmountWithBonus = (long) (minAmount * Config.RATE_QUEST_DROP);
long maxAmountWithBonus = (long) (maxAmount * Config.RATE_QUEST_DROP);
long dropChanceWithBonus = (long) (dropChance * Config.RATE_QUEST_DROP); // TODO separate configs for rate and amount
double dropChanceWithBonus = dropChance * Config.RATE_QUEST_DROP; // TODO separate configs for rate and amount
if ((npc != null) && Config.CHAMPION_ENABLE && npc.isChampion())
{
if ((itemId == Inventory.ADENA_ID) || (itemId == Inventory.ANCIENT_ADENA_ID))
@ -2895,6 +2895,7 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
{
playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
}
// if there is no limit, return true every time an item is given
if (limit <= 0)
{

View File

@ -2851,7 +2851,7 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
long minAmountWithBonus = (long) (minAmount * Config.RATE_QUEST_DROP);
long maxAmountWithBonus = (long) (maxAmount * Config.RATE_QUEST_DROP);
long dropChanceWithBonus = (long) (dropChance * Config.RATE_QUEST_DROP); // TODO separate configs for rate and amount
double dropChanceWithBonus = dropChance * Config.RATE_QUEST_DROP; // TODO separate configs for rate and amount
if ((npc != null) && Config.CHAMPION_ENABLE && npc.isChampion())
{
if ((itemId == Inventory.ADENA_ID) || (itemId == Inventory.ANCIENT_ADENA_ID))
@ -2895,6 +2895,7 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
{
playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
}
// if there is no limit, return true every time an item is given
if (limit <= 0)
{

View File

@ -2851,7 +2851,7 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
long minAmountWithBonus = (long) (minAmount * Config.RATE_QUEST_DROP);
long maxAmountWithBonus = (long) (maxAmount * Config.RATE_QUEST_DROP);
long dropChanceWithBonus = (long) (dropChance * Config.RATE_QUEST_DROP); // TODO separate configs for rate and amount
double dropChanceWithBonus = dropChance * Config.RATE_QUEST_DROP; // TODO separate configs for rate and amount
if ((npc != null) && Config.CHAMPION_ENABLE && npc.isChampion())
{
if ((itemId == Inventory.ADENA_ID) || (itemId == Inventory.ANCIENT_ADENA_ID))
@ -2895,6 +2895,7 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
{
playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
}
// if there is no limit, return true every time an item is given
if (limit <= 0)
{

View File

@ -2851,7 +2851,7 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
long minAmountWithBonus = (long) (minAmount * Config.RATE_QUEST_DROP);
long maxAmountWithBonus = (long) (maxAmount * Config.RATE_QUEST_DROP);
long dropChanceWithBonus = (long) (dropChance * Config.RATE_QUEST_DROP); // TODO separate configs for rate and amount
double dropChanceWithBonus = dropChance * Config.RATE_QUEST_DROP; // TODO separate configs for rate and amount
if ((npc != null) && Config.CHAMPION_ENABLE && npc.isChampion())
{
if ((itemId == Inventory.ADENA_ID) || (itemId == Inventory.ANCIENT_ADENA_ID))
@ -2895,6 +2895,7 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
{
playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
}
// if there is no limit, return true every time an item is given
if (limit <= 0)
{

View File

@ -2851,7 +2851,7 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
long minAmountWithBonus = (long) (minAmount * Config.RATE_QUEST_DROP);
long maxAmountWithBonus = (long) (maxAmount * Config.RATE_QUEST_DROP);
long dropChanceWithBonus = (long) (dropChance * Config.RATE_QUEST_DROP); // TODO separate configs for rate and amount
double dropChanceWithBonus = dropChance * Config.RATE_QUEST_DROP; // TODO separate configs for rate and amount
if ((npc != null) && Config.CHAMPION_ENABLE && npc.isChampion())
{
if ((itemId == Inventory.ADENA_ID) || (itemId == Inventory.ANCIENT_ADENA_ID))
@ -2895,6 +2895,7 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
{
playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
}
// if there is no limit, return true every time an item is given
if (limit <= 0)
{