|
|
@ -703,41 +703,41 @@ public class WorldServer { |
|
|
|
catch(Exception e){ |
|
|
|
catch(Exception e){ |
|
|
|
Logger.error("FAILED TO ADD RUNE MERCHANT"); |
|
|
|
Logger.error("FAILED TO ADD RUNE MERCHANT"); |
|
|
|
} |
|
|
|
} |
|
|
|
try { |
|
|
|
//try {
|
|
|
|
Building sdrHut = BuildingManager.getBuilding(27978); |
|
|
|
// Building sdrHut = BuildingManager.getBuilding(27978);
|
|
|
|
Zone sdr = sdrHut.parentZone; |
|
|
|
// Zone sdr = sdrHut.parentZone;
|
|
|
|
NPC resourceMerchant = null; |
|
|
|
// NPC resourceMerchant = null;
|
|
|
|
boolean exists = false; |
|
|
|
// boolean exists = false;
|
|
|
|
for(NPC merchant : sdr.zoneNPCSet) |
|
|
|
// for(NPC merchant : sdr.zoneNPCSet)
|
|
|
|
if(merchant.contract.getContractID() == 900) { |
|
|
|
// if(merchant.contract.getContractID() == 900) {
|
|
|
|
exists = true; |
|
|
|
// exists = true;
|
|
|
|
resourceMerchant = merchant; |
|
|
|
// resourceMerchant = merchant;
|
|
|
|
} |
|
|
|
// }
|
|
|
|
if (!exists) { |
|
|
|
// if (!exists) {
|
|
|
|
resourceMerchant = NPC.createNPC("Stocky", 900, Vector3fImmutable.ZERO, Guild.getGuild(6), ZoneManager.getZoneByUUID(656), (short) 70, null); |
|
|
|
// resourceMerchant = NPC.createNPC("Stocky", 900, Vector3fImmutable.ZERO, Guild.getGuild(6), ZoneManager.getZoneByUUID(656), (short) 70, null);
|
|
|
|
resourceMerchant.sellPercent = 9999.00f; |
|
|
|
// resourceMerchant.sellPercent = 9999.00f;
|
|
|
|
resourceMerchant.buildingUUID = sdrHut.getObjectUUID(); |
|
|
|
// resourceMerchant.buildingUUID = sdrHut.getObjectUUID();
|
|
|
|
resourceMerchant.building = sdrHut; |
|
|
|
// resourceMerchant.building = sdrHut;
|
|
|
|
NPCManager.slotCharacterInBuilding(resourceMerchant); |
|
|
|
// NPCManager.slotCharacterInBuilding(resourceMerchant);
|
|
|
|
resourceMerchant.setLoc(resourceMerchant.bindLoc); |
|
|
|
// resourceMerchant.setLoc(resourceMerchant.bindLoc);
|
|
|
|
//resourceMerchant.updateDatabase();
|
|
|
|
//resourceMerchant.updateDatabase();
|
|
|
|
} |
|
|
|
// }
|
|
|
|
if(resourceMerchant != null) { |
|
|
|
// if(resourceMerchant != null) {
|
|
|
|
for (int resourceID : Warehouse.getMaxResources().keySet()) { |
|
|
|
// for (int resourceID : Warehouse.getMaxResources().keySet()) {
|
|
|
|
//MobLoot resource = new MobLoot(resourceMerchant,ItemBase.getItemBase(resourceID),1,false);
|
|
|
|
// //MobLoot resource = new MobLoot(resourceMerchant,ItemBase.getItemBase(resourceID),1,false);
|
|
|
|
//resource.magicValue = Warehouse.getCostForResource(resourceID);
|
|
|
|
// //resource.magicValue = Warehouse.getCostForResource(resourceID);
|
|
|
|
MobEquipment resource = new MobEquipment(resourceID, 100.0f); |
|
|
|
// MobEquipment resource = new MobEquipment(resourceID, 100.0f);
|
|
|
|
resource.magicValue = Warehouse.getCostForResource(resourceID); |
|
|
|
// resource.magicValue = Warehouse.getCostForResource(resourceID);
|
|
|
|
resourceMerchant.contract.getSellInventory().add(resource); |
|
|
|
// resourceMerchant.contract.getSellInventory().add(resource);
|
|
|
|
} |
|
|
|
// }
|
|
|
|
resourceMerchant.sellPercent = 0.0f; |
|
|
|
// resourceMerchant.sellPercent = 0.0f;
|
|
|
|
resourceMerchant.setName("Stocky the Resource Merchant"); |
|
|
|
// resourceMerchant.setName("Stocky the Resource Merchant");
|
|
|
|
//resourceMerchant.updateDatabase();
|
|
|
|
//resourceMerchant.updateDatabase();
|
|
|
|
} |
|
|
|
// }
|
|
|
|
} |
|
|
|
//}
|
|
|
|
catch(Exception e){ |
|
|
|
//catch(Exception e){
|
|
|
|
Logger.error("FAILED TO ADD RESOURCE MERCHANT"); |
|
|
|
// Logger.error("FAILED TO ADD RESOURCE MERCHANT");
|
|
|
|
} |
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
Logger.info("time to load World Objects: " + (System.currentTimeMillis() - start) + " ms"); |
|
|
|
Logger.info("time to load World Objects: " + (System.currentTimeMillis() - start) + " ms"); |
|
|
|
} |
|
|
|
} |
|
|
|