Browse Source

Resource Merchant

lakebane-master
FatBoy-DOTC 10 months ago
parent
commit
267549ce15
  1. 14
      src/engine/server/world/WorldServer.java

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

@ -660,10 +660,13 @@ public class WorldServer { @@ -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 { @@ -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){

Loading…
Cancel
Save