Browse Source

Resource Merchant

lakebane-master
FatBoy-DOTC 9 months ago
parent
commit
629fce8cff
  1. 39
      src/engine/server/world/WorldServer.java

39
src/engine/server/world/WorldServer.java

@ -658,7 +658,7 @@ public class WorldServer {
Logger.error("FAILED TO ADD RUNE MERCHANT"); Logger.error("FAILED TO ADD RUNE MERCHANT");
} }
try { try {
Building sdrHut = BuildingManager.getBuilding(27984); 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;
@ -668,26 +668,25 @@ public class WorldServer {
resourceMerchant = merchant; resourceMerchant = merchant;
} }
if (!exists) { if (!exists) {
NPC runeMerchant = 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);
runeMerchant.sellPercent = 9999.00f; resourceMerchant.sellPercent = 9999.00f;
runeMerchant.buildingUUID = sdrHut.getObjectUUID(); resourceMerchant.buildingUUID = sdrHut.getObjectUUID();
runeMerchant.building = sdrHut; resourceMerchant.building = sdrHut;
NPCManager.slotCharacterInBuilding(runeMerchant); NPCManager.slotCharacterInBuilding(resourceMerchant);
runeMerchant.setLoc(runeMerchant.bindLoc); resourceMerchant.setLoc(resourceMerchant.bindLoc);
runeMerchant.updateDatabase(); //resourceMerchant.updateDatabase();
}else{ }
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.setName("Stocky the Resource Merchant");
resourceMerchant.updateDatabase();
} }
resourceMerchant.sellPercent = 0.0f;
resourceMerchant.setName("Stocky the Resource Merchant");
//resourceMerchant.updateDatabase();
} }
} }
catch(Exception e){ catch(Exception e){

Loading…
Cancel
Save