Resource Merchant

This commit is contained in:
2024-02-22 19:15:13 -06:00
parent 6e14f723da
commit 267549ce15
+13 -1
View File
@@ -660,10 +660,13 @@ public class WorldServer {
try {
Building sdrHut = BuildingManager.getBuilding(27984);
Zone sdr = sdrHut.parentZone;
NPC resourceMerchant = null;
boolean exists = false;
for(NPC merchant : sdr.zoneNPCSet)
if(merchant.contract.getContractID() == 900)
if(merchant.contract.getContractID() == 900) {
exists = true;
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;
@@ -672,6 +675,15 @@ public class WorldServer {
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);
resourceMerchant.getInventory().add(resource);
}
resourceMerchant.sellPercent = 0.0f;
resourceMerchant.updateDatabase();
}
}
}
catch(Exception e){