mirror of
https://github.com/ProjectSWGCore/NGECore2.git
synced 2026-08-02 03:15:52 -04:00
Loot System changes, see extended
* Added /setgodmode genloot <lootTemplate> command * Added the option to have a 'custom setup' of a looted object template (see scripts/loot/lootItems/veryrareloot/rare_ankarres_sapphire.py), procedure is same as object scripts * Looted items no longer need custom names in order to not have an empty name (most scripts containing a custom name can now have that method removed)
This commit is contained in:
@@ -285,6 +285,17 @@ public class LootService implements INetworkDispatch {
|
||||
}
|
||||
}
|
||||
|
||||
public SWGObject generateLootItem(CreatureObject requester, String template)
|
||||
{
|
||||
LootRollSession rollSession = new LootRollSession();
|
||||
rollSession.setSessionPlanet(requester.getPlanet());
|
||||
|
||||
handleLootPoolItems(template, rollSession);
|
||||
if(rollSession.getDroppedItems().get(0) != null) return rollSession.getDroppedItems().get(0);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private void handleLootPoolItems(String itemName,LootRollSession lootRollSession){
|
||||
|
||||
@@ -399,7 +410,7 @@ public class LootService implements INetworkDispatch {
|
||||
customName = setRandomStatsJewelry(droppedItem, lootRollSession);
|
||||
}
|
||||
|
||||
if (customName!=null)
|
||||
if (!customName.isEmpty())
|
||||
handleCustomDropName(droppedItem, customName);
|
||||
|
||||
if (stackable!=-1){
|
||||
@@ -451,6 +462,9 @@ public class LootService implements INetworkDispatch {
|
||||
droppedItem.setStringAttribute("required_faction", requiredFaction);
|
||||
}
|
||||
|
||||
if(core.scriptService.getMethod(itemPath,"","customSetup") != null)
|
||||
core.scriptService.callScript(itemPath, "", "customSetup", droppedItem);
|
||||
|
||||
|
||||
lootRollSession.addDroppedItem(droppedItem);
|
||||
System.out.println("END REACHED");
|
||||
|
||||
Reference in New Issue
Block a user