mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-07-13 22:01:04 -04:00
Refractor approach to special creature DNA loot
The point of this change is to get rid of all of the unnecessary DNA loot roll chance scripts located at script.item.dna.* and instead replace it with a proper implementation. There are 2 new columns in creatures.tab (dnaChancePct and dnaItemName) which are parsed during createCreature() and loot events to properly roll for loot chance of the DNA and to add it to a creature's inventory container.
This commit is contained in:
@@ -746,6 +746,13 @@ public class create extends script.base_script
|
||||
setObjVar(creature, "loot.lootTable", strLootTable);
|
||||
setObjVar(creature, "loot.numItems", intItems);
|
||||
}
|
||||
final float dnaLootPercentageChance = creatureDict.getFloat("dnaChancePct");
|
||||
final String dnaLootItemName = creatureDict.getString("dnaItemName");
|
||||
if(dnaLootPercentageChance > 0 && dnaLootItemName != null && static_item.isStaticItem(dnaLootItemName))
|
||||
{
|
||||
setObjVar(creature, loot.OBJVAR_DNA_LOOT_CHANCE, dnaLootPercentageChance);
|
||||
setObjVar(creature, loot.OBJVAR_DNA_LOOT_ITEM_NAME, dnaLootItemName);
|
||||
}
|
||||
if (!initializeArmor(creature, creatureDict, dataTableGetInt(STAT_BALANCE_TABLE, armorLevel - 1, diffClassName + "Armor")))
|
||||
{
|
||||
LOG("create", "Unable to initialize armor on " + creatureName + "(" + creature + ")");
|
||||
|
||||
Reference in New Issue
Block a user