Resource Merchant

This commit is contained in:
2024-02-22 19:35:05 -06:00
parent 7fefd53be2
commit 629fce8cff
+19 -20
View File
@@ -658,7 +658,7 @@ public class WorldServer {
Logger.error("FAILED TO ADD RUNE MERCHANT");
}
try {
Building sdrHut = BuildingManager.getBuilding(27984);
Building sdrHut = BuildingManager.getBuilding(27978);
Zone sdr = sdrHut.parentZone;
NPC resourceMerchant = null;
boolean exists = false;
@@ -668,26 +668,25 @@ public class WorldServer {
resourceMerchant = merchant;
}
if (!exists) {
NPC runeMerchant = NPC.createNPC("Stocky", 900, Vector3fImmutable.ZERO, Guild.getGuild(6), ZoneManager.getZoneByUUID(656), (short) 70, null);
runeMerchant.sellPercent = 9999.00f;
runeMerchant.buildingUUID = sdrHut.getObjectUUID();
runeMerchant.building = sdrHut;
NPCManager.slotCharacterInBuilding(runeMerchant);
runeMerchant.setLoc(runeMerchant.bindLoc);
runeMerchant.updateDatabase();
}else{
if(resourceMerchant != null){
for(int resourceID : Warehouse.getMaxResources().keySet()){
//MobLoot resource = new MobLoot(resourceMerchant,ItemBase.getItemBase(resourceID),1,false);
//resource.magicValue = Warehouse.getCostForResource(resourceID);
MobEquipment resource = new MobEquipment(resourceID,100.0f);
resource.magicValue = Warehouse.getCostForResource(resourceID);
resourceMerchant.contract.getSellInventory().add(resource);
}
resourceMerchant.sellPercent = 0.0f;
resourceMerchant.setName("Stocky the Resource Merchant");
resourceMerchant.updateDatabase();
resourceMerchant = NPC.createNPC("Stocky", 900, Vector3fImmutable.ZERO, Guild.getGuild(6), ZoneManager.getZoneByUUID(656), (short) 70, null);
resourceMerchant.sellPercent = 9999.00f;
resourceMerchant.buildingUUID = sdrHut.getObjectUUID();
resourceMerchant.building = sdrHut;
NPCManager.slotCharacterInBuilding(resourceMerchant);
resourceMerchant.setLoc(resourceMerchant.bindLoc);
//resourceMerchant.updateDatabase();
}
if(resourceMerchant != null) {
for (int resourceID : Warehouse.getMaxResources().keySet()) {
//MobLoot resource = new MobLoot(resourceMerchant,ItemBase.getItemBase(resourceID),1,false);
//resource.magicValue = Warehouse.getCostForResource(resourceID);
MobEquipment resource = new MobEquipment(resourceID, 100.0f);
resource.magicValue = Warehouse.getCostForResource(resourceID);
resourceMerchant.contract.getSellInventory().add(resource);
}
resourceMerchant.sellPercent = 0.0f;
resourceMerchant.setName("Stocky the Resource Merchant");
//resourceMerchant.updateDatabase();
}
}
catch(Exception e){