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:
Seefo
2014-05-07 22:11:18 -04:00
parent 2285378ad7
commit d182fea6eb
6 changed files with 38 additions and 6 deletions
+15 -1
View File
@@ -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");