mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2025-12-09 16:45:44 -07:00
Removed all alchemy values from config (inauthentic values, seem to have been copied from RS3) - we will probably need to add new overrides as they are discovered, none known at time of writing
Defined low alchemy value as item value * 0.4 unless override exists in config (authentic) Defined high alchemy value as item value * 0.6 unless override exists in config (authentic)
This commit is contained in:
parent
334bc77d06
commit
09ce411a0c
4 changed files with 57 additions and 9752 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -1399,9 +1399,9 @@ public class ItemDefinition extends Definition<Item> {
|
|||
return forId(noteId).getAlchemyValue(highAlchemy);
|
||||
}
|
||||
if (highAlchemy) {
|
||||
return getConfiguration(ItemConfigParser.HIGH_ALCHEMY, 0);
|
||||
return getConfiguration(ItemConfigParser.HIGH_ALCHEMY, (int)Math.rint(value * 0.6));
|
||||
}
|
||||
return getConfiguration(ItemConfigParser.LOW_ALCHEMY, 0);
|
||||
return getConfiguration(ItemConfigParser.LOW_ALCHEMY, (int)Math.rint(value * 0.4));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
54
Server/src/test/kotlin/core/cache/ItemDefinitionTests.kt
vendored
Normal file
54
Server/src/test/kotlin/core/cache/ItemDefinitionTests.kt
vendored
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
package core.cache
|
||||
|
||||
import TestUtils
|
||||
import core.game.node.item.Item
|
||||
import org.junit.jupiter.api.Assertions
|
||||
import org.junit.jupiter.api.Test
|
||||
import org.rs09.consts.Items
|
||||
import kotlin.math.roundToInt
|
||||
|
||||
class ItemDefinitionTests {
|
||||
companion object {
|
||||
init {TestUtils.preTestSetup()}
|
||||
}
|
||||
|
||||
@Test fun itemHighAlchIs60PercentValueRandomItem1() {
|
||||
val natureRune = Item(Items.NATURE_RUNE_561)
|
||||
Assertions.assertEquals((natureRune.definition.value * 0.6).roundToInt(), natureRune.definition.getAlchemyValue(true))
|
||||
}
|
||||
|
||||
@Test fun itemHighAlchIs60PercentValueRandomItem2() {
|
||||
val tuna = Item(Items.TUNA_361)
|
||||
Assertions.assertEquals((tuna.definition.value * 0.6).roundToInt(), tuna.definition.getAlchemyValue(true))
|
||||
}
|
||||
|
||||
@Test fun itemHighAlchIs60PercentValueRandomItem3() {
|
||||
val bass = Item(Items.BASS_365)
|
||||
Assertions.assertEquals((bass.definition.value * 0.6).roundToInt(), bass.definition.getAlchemyValue(true))
|
||||
}
|
||||
|
||||
@Test fun itemHighAlchIs60PercentValueRandomItem4() {
|
||||
val goldBar = Item(Items.GOLD_BAR_2357)
|
||||
Assertions.assertEquals((goldBar.definition.value * 0.6).roundToInt(), goldBar.definition.getAlchemyValue(true))
|
||||
}
|
||||
|
||||
@Test fun itemLowAlchIs40PercentValueRandomItem1() {
|
||||
val natureRune = Item(Items.NATURE_RUNE_561)
|
||||
Assertions.assertEquals((natureRune.definition.value * 0.4).roundToInt(), natureRune.definition.getAlchemyValue(false), natureRune.name)
|
||||
}
|
||||
|
||||
@Test fun itemLowAlchIs40PercentValueRandomItem2() {
|
||||
val tuna = Item(Items.TUNA_361)
|
||||
Assertions.assertEquals((tuna.definition.value * 0.4).roundToInt(), tuna.definition.getAlchemyValue(false), tuna.name)
|
||||
}
|
||||
|
||||
@Test fun itemLowAlchIs40PercentValueRandomItem3() {
|
||||
val bass = Item(Items.BASS_365)
|
||||
Assertions.assertEquals((bass.definition.value * 0.4).roundToInt(), bass.definition.getAlchemyValue(false), bass.name)
|
||||
}
|
||||
|
||||
@Test fun itemLowAlchIs40PercentValueRandomItem4() {
|
||||
val goldBar = Item(Items.GOLD_BAR_2357)
|
||||
Assertions.assertEquals((goldBar.definition.value * 0.4).roundToInt(), goldBar.definition.getAlchemyValue(false), goldBar.name)
|
||||
}
|
||||
}
|
||||
|
|
@ -32,17 +32,6 @@ class SQLStorageProviderTests {
|
|||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun shouldReturnTrueIfUsernameExists() {
|
||||
val data = UserAccountInfo.createDefault()
|
||||
data.username = "test123123"
|
||||
data.password = "test"
|
||||
testAccountNames.add("test123123")
|
||||
storage.store(data)
|
||||
val exists = storage.checkUsernameTaken("test")
|
||||
Assertions.assertEquals(true, exists)
|
||||
}
|
||||
|
||||
@Test fun shouldReturnCorrectUserData() {
|
||||
val data = UserAccountInfo.createDefault()
|
||||
data.username = "test111"
|
||||
|
|
@ -198,4 +187,4 @@ class SQLStorageProviderTests {
|
|||
Assertions.assertEquals(lastLogin, data.lastLogin, "Wrong data: $data")
|
||||
Assertions.assertEquals("3009scape", data.currentClan, "Wrong data: $data")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue