Preserve EbonReach changes after Windows recovery
This commit is contained in:
@@ -24,3 +24,5 @@
|
|||||||
hs_err_pid*
|
hs_err_pid*
|
||||||
replay_pid*
|
replay_pid*
|
||||||
|
|
||||||
|
.idea/
|
||||||
|
*.iml
|
||||||
|
|||||||
@@ -674,46 +674,6 @@ public class Item extends AbstractWorldObject {
|
|||||||
public static Item newGoldItem(AbstractWorldObject awo, ItemBase ib, Enum.ItemContainerType containerType) {
|
public static Item newGoldItem(AbstractWorldObject awo, ItemBase ib, Enum.ItemContainerType containerType) {
|
||||||
return newGoldItem(awo, ib, containerType, true);
|
return newGoldItem(awo, ib, containerType, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
//used for vault!
|
|
||||||
public static Item newGoldItem(int accountID, ItemBase ib, Enum.ItemContainerType containerType) {
|
|
||||||
return newGoldItem(accountID, ib, containerType, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static Item newGoldItem(int accountID, ItemBase ib, Enum.ItemContainerType containerType, boolean persist) {
|
|
||||||
|
|
||||||
int ownerID;
|
|
||||||
OwnerType ownerType;
|
|
||||||
|
|
||||||
ownerID = accountID;
|
|
||||||
ownerType = OwnerType.Account;
|
|
||||||
|
|
||||||
|
|
||||||
Item newGold = new Item(ib, ownerID, ownerType,
|
|
||||||
(byte) 0, (byte) 0, (short) 0, (short) 0, true, false, containerType, (byte) 0,
|
|
||||||
new ArrayList<>(), "");
|
|
||||||
|
|
||||||
synchronized (newGold) {
|
|
||||||
newGold.numberOfItems = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (persist) {
|
|
||||||
try {
|
|
||||||
newGold = DbManager.ItemQueries.ADD_ITEM(newGold);
|
|
||||||
if (newGold != null) {
|
|
||||||
synchronized (newGold) {
|
|
||||||
newGold.numberOfItems = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
Logger.error(e);
|
|
||||||
}
|
|
||||||
DbManager.ItemQueries.ZERO_ITEM_STACK(newGold);
|
|
||||||
}
|
|
||||||
|
|
||||||
return newGold;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static Item newGoldItem(AbstractWorldObject awo, ItemBase ib, Enum.ItemContainerType containerType, boolean persist) {
|
private static Item newGoldItem(AbstractWorldObject awo, ItemBase ib, Enum.ItemContainerType containerType, boolean persist) {
|
||||||
|
|
||||||
int ownerID;
|
int ownerID;
|
||||||
@@ -771,10 +731,49 @@ public class Item extends AbstractWorldObject {
|
|||||||
}
|
}
|
||||||
DbManager.ItemQueries.ZERO_ITEM_STACK(newGold);
|
DbManager.ItemQueries.ZERO_ITEM_STACK(newGold);
|
||||||
}
|
}
|
||||||
|
|
||||||
newGold.containerType = containerType;
|
newGold.containerType = containerType;
|
||||||
|
|
||||||
return newGold;
|
return newGold;
|
||||||
}
|
}
|
||||||
|
//used for vault!
|
||||||
|
public static Item newGoldItem(int accountID, ItemBase ib, Enum.ItemContainerType containerType) {
|
||||||
|
return newGoldItem(accountID, ib, containerType, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Item newGoldItem(int accountID, ItemBase ib, Enum.ItemContainerType containerType, boolean persist) {
|
||||||
|
|
||||||
|
int ownerID;
|
||||||
|
OwnerType ownerType;
|
||||||
|
|
||||||
|
ownerID = accountID;
|
||||||
|
ownerType = OwnerType.Account;
|
||||||
|
|
||||||
|
|
||||||
|
Item newGold = new Item(ib, ownerID, ownerType,
|
||||||
|
(byte) 0, (byte) 0, (short) 0, (short) 0, true, false, containerType, (byte) 0,
|
||||||
|
new ArrayList<>(), "");
|
||||||
|
|
||||||
|
synchronized (newGold) {
|
||||||
|
newGold.numberOfItems = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (persist) {
|
||||||
|
try {
|
||||||
|
newGold = DbManager.ItemQueries.ADD_ITEM(newGold);
|
||||||
|
if (newGold != null) {
|
||||||
|
synchronized (newGold) {
|
||||||
|
newGold.numberOfItems = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
Logger.error(e);
|
||||||
|
}
|
||||||
|
DbManager.ItemQueries.ZERO_ITEM_STACK(newGold);
|
||||||
|
}
|
||||||
|
|
||||||
|
return newGold;
|
||||||
|
}
|
||||||
|
|
||||||
// This is to be used for trades - the new item is not stored in the database
|
// This is to be used for trades - the new item is not stored in the database
|
||||||
public static Item newGoldItemTemp(AbstractWorldObject awo, ItemBase ib) {
|
public static Item newGoldItemTemp(AbstractWorldObject awo, ItemBase ib) {
|
||||||
|
|||||||
@@ -1239,12 +1239,17 @@ public class PlayerCharacter extends AbstractCharacter {
|
|||||||
playerCharacter.deactivateCharacter();
|
playerCharacter.deactivateCharacter();
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
// Ebonreach: give new characters starter gold.
|
||||||
|
Item starterGold = Item.newGoldItem(playerCharacter, ItemBase.getItemBase(7), Enum.ItemContainerType.INVENTORY);
|
||||||
|
|
||||||
|
if (starterGold != null)
|
||||||
|
DbManager.ItemQueries.UPDATE_GOLD(starterGold, 10000);
|
||||||
|
|
||||||
// Get any new skills that belong to the player
|
// Get any new skills that belong to the player
|
||||||
playerCharacter.calculateSkills();
|
playerCharacter.calculateSkills();
|
||||||
|
|
||||||
a.setLastCharacter(playerCharacter.getObjectUUID());
|
a.setLastCharacter(playerCharacter.getObjectUUID());
|
||||||
playerCharacter.charItemManager.load();
|
playerCharacter.getCharItemManager().load();
|
||||||
|
|
||||||
playerCharacter.activateCharacter();
|
playerCharacter.activateCharacter();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user