1
0

Added anvil enchantment handling. (#3857)

+ Added anvil enchantment handling.
This commit is contained in:
Lane Kolbly
2017-07-28 12:00:20 -05:00
committed by Tiger Wang
parent 5402b214b3
commit 790e15f2e6
6 changed files with 480 additions and 37 deletions

View File

@@ -730,7 +730,6 @@ void cSlotAreaCrafting::UpdateRecipe(cPlayer & a_Player)
cCraftingRecipe & Recipe = GetRecipeForPlayer(a_Player);
cRoot::Get()->GetCraftingRecipes()->GetRecipe(a_Player, Grid, Recipe);
SetSlot(0, a_Player, Recipe.GetResult());
m_ParentWindow.SendSlot(a_Player, this, 0);
}
@@ -1136,7 +1135,9 @@ void cSlotAreaAnvil::UpdateResult(cPlayer & a_Player)
}
}
// TODO: Add enchantments.
// Add the enchantments from the sacrifice to the target
int EnchantmentCost = Input.AddEnchantmentsFromItem(SecondInput);
NeedExp += EnchantmentCost;
}
}
@@ -1166,8 +1167,6 @@ void cSlotAreaAnvil::UpdateResult(cPlayer & a_Player)
Input.m_CustomName = RepairedItemName;
}
// TODO: Add enchantment exp cost.
m_MaximumCost = RepairCost + NeedExp;
if (NeedExp < 0)
@@ -2522,6 +2521,8 @@ void cSlotAreaTemporary::SetSlot(int a_SlotNum, cPlayer & a_Player, const cItem
}
itr->second[static_cast<size_t>(a_SlotNum)] = a_Item;
m_ParentWindow.SendSlot(a_Player, this, a_SlotNum);
}