mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 18:52:22 +00:00
Item Transformation now works!
This commit is contained in:
committed by
Michael Cook (mackal)
parent
ee7f88d247
commit
daec5bde66
+17
-1
@@ -1889,6 +1889,9 @@ void Client::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho)
|
||||
if (strlen(item->IDFile) > 2)
|
||||
ns->spawn.equipment[MaterialPrimary] = atoi(&item->IDFile[2]);
|
||||
}
|
||||
else if (inst->GetOrnamentationIcon() && inst->GetOrnamentationIDFile()) {
|
||||
ns->spawn.equipment[MaterialPrimary] = inst->GetOrnamentationIDFile();
|
||||
}
|
||||
else {
|
||||
item = inst->GetItem();
|
||||
if (strlen(item->IDFile) > 2)
|
||||
@@ -1901,6 +1904,9 @@ void Client::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho)
|
||||
if (strlen(item->IDFile) > 2)
|
||||
ns->spawn.equipment[MaterialSecondary] = atoi(&item->IDFile[2]);
|
||||
}
|
||||
else if (inst->GetOrnamentationIcon() && inst->GetOrnamentationIDFile()) {
|
||||
ns->spawn.equipment[MaterialSecondary] = inst->GetOrnamentationIDFile();
|
||||
}
|
||||
else {
|
||||
item = inst->GetItem();
|
||||
if (strlen(item->IDFile) > 2)
|
||||
@@ -2766,6 +2772,9 @@ void Client::SetMaterial(int16 in_slot, uint32 item_id) {
|
||||
item = inst->GetOrnamentationAug(ornamentationAugtype)->GetItem();
|
||||
m_pp.item_material[MaterialPrimary] = atoi(item->IDFile + 2);
|
||||
}
|
||||
else if (inst && inst->GetOrnamentationIcon() && inst->GetOrnamentationIDFile()) {
|
||||
m_pp.item_material[MaterialPrimary] = inst->GetOrnamentationIDFile();
|
||||
}
|
||||
else {
|
||||
m_pp.item_material[MaterialPrimary] = atoi(item->IDFile + 2);
|
||||
}
|
||||
@@ -2776,6 +2785,9 @@ void Client::SetMaterial(int16 in_slot, uint32 item_id) {
|
||||
item = inst->GetOrnamentationAug(ornamentationAugtype)->GetItem();
|
||||
m_pp.item_material[MaterialSecondary] = atoi(item->IDFile + 2);
|
||||
}
|
||||
else if (inst && inst->GetOrnamentationIcon() && inst->GetOrnamentationIDFile()) {
|
||||
m_pp.item_material[MaterialSecondary] = inst->GetOrnamentationIDFile();
|
||||
}
|
||||
else {
|
||||
m_pp.item_material[MaterialSecondary] = atoi(item->IDFile + 2);
|
||||
}
|
||||
@@ -5832,7 +5844,11 @@ void Client::ProcessInspectRequest(Client* requestee, Client* requester) {
|
||||
const Item_Struct *aug_weap = inst->GetOrnamentationAug(ornamentationAugtype)->GetItem();
|
||||
strcpy(insr->itemnames[L], item->Name);
|
||||
insr->itemicons[L] = aug_weap->Icon;
|
||||
}
|
||||
}
|
||||
else if (inst->GetOrnamentationIcon() && inst->GetOrnamentationIDFile()) {
|
||||
strcpy(insr->itemnames[L], item->Name);
|
||||
insr->itemicons[L] = inst->GetOrnamentationIcon();
|
||||
}
|
||||
else {
|
||||
strcpy(insr->itemnames[L], item->Name);
|
||||
insr->itemicons[L] = item->Icon;
|
||||
|
||||
+1
-1
@@ -810,7 +810,7 @@ public:
|
||||
void QSSwapItemAuditor(MoveItem_Struct* move_in, bool postaction_call = false);
|
||||
void PutLootInInventory(int16 slot_id, const ItemInst &inst, ServerLootItem_Struct** bag_item_data = 0);
|
||||
bool AutoPutLootInInventory(ItemInst& inst, bool try_worn = false, bool try_cursor = true, ServerLootItem_Struct** bag_item_data = 0);
|
||||
bool SummonItem(uint32 item_id, int16 charges = -1, uint32 aug1 = 0, uint32 aug2 = 0, uint32 aug3 = 0, uint32 aug4 = 0, uint32 aug5 = 0, bool attuned = false, uint16 to_slot = MainCursor);
|
||||
bool SummonItem(uint32 item_id, int16 charges = -1, uint32 aug1 = 0, uint32 aug2 = 0, uint32 aug3 = 0, uint32 aug4 = 0, uint32 aug5 = 0, bool attuned = false, uint16 to_slot = MainCursor, uint32 ornament_icon = 0, uint32 ornament_idfile = 0);
|
||||
void SetStats(uint8 type,int16 set_val);
|
||||
void IncStats(uint8 type,int16 increase_val);
|
||||
void DropItem(int16 slot_id);
|
||||
|
||||
@@ -8031,6 +8031,10 @@ void Client::Handle_OP_InspectAnswer(const EQApplicationPacket *app)
|
||||
strcpy(insr->itemnames[L], item->Name);
|
||||
insr->itemicons[L] = aug_weap->Icon;
|
||||
}
|
||||
else if (inst->GetOrnamentationIcon() && inst->GetOrnamentationIDFile()) {
|
||||
strcpy(insr->itemnames[L], item->Name);
|
||||
insr->itemicons[L] = inst->GetOrnamentationIcon();
|
||||
}
|
||||
else {
|
||||
strcpy(insr->itemnames[L], item->Name);
|
||||
insr->itemicons[L] = item->Icon;
|
||||
|
||||
+6
-1
@@ -199,7 +199,7 @@ bool Client::CheckLoreConflict(const Item_Struct* item) {
|
||||
return (m_inv.HasItemByLoreGroup(item->LoreGroup, ~invWhereSharedBank) != INVALID_INDEX);
|
||||
}
|
||||
|
||||
bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5, bool attuned, uint16 to_slot) {
|
||||
bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5, bool attuned, uint16 to_slot, uint32 ornament_icon, uint32 ornament_idfile) {
|
||||
this->EVENT_ITEM_ScriptStopReturn();
|
||||
|
||||
// TODO: update calling methods and script apis to handle a failure return
|
||||
@@ -557,6 +557,11 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
|
||||
// attune item
|
||||
if(attuned && inst->GetItem()->Attuneable)
|
||||
inst->SetInstNoDrop(true);
|
||||
|
||||
if(ornament_icon > 0 && ornament_idfile > 0) {
|
||||
inst->SetOrnamentIcon(ornament_icon);
|
||||
inst->SetOrnamentationIDFile(ornament_idfile);
|
||||
}
|
||||
|
||||
// check to see if item is usable in requested slot
|
||||
if(enforceusable && (((to_slot >= MainCharm) && (to_slot <= MainAmmo)) || (to_slot == MainPowerSource))) {
|
||||
|
||||
@@ -2455,6 +2455,9 @@ int32 Mob::GetEquipmentMaterial(uint8 material_slot) const
|
||||
item = inst->GetOrnamentationAug(ornamentationAugtype)->GetItem();
|
||||
return atoi(&item->IDFile[2]);
|
||||
}
|
||||
else if (inst->GetOrnamentationIcon() && inst->GetOrnamentationIDFile()) {
|
||||
return inst->GetOrnamentationIDFile();
|
||||
}
|
||||
else {
|
||||
if (strlen(item->IDFile) > 2)
|
||||
return atoi(&item->IDFile[2]);
|
||||
|
||||
@@ -296,6 +296,8 @@
|
||||
#define GUILD_BANK_FULL 6098 // There is no more room in the Guild Bank.
|
||||
#define GUILD_BANK_TRANSFERRED 6100 // '%1' transferred to Guild Bank from Deposits.
|
||||
#define GUILD_BANK_EMPTY_HANDS 6108 // You must empty your hands to withdraw from the Guild Bank.
|
||||
#define TRANSFORM_FAILED 6326 //This mold cannot be applied to your %1.
|
||||
#define TRANSFORM_COMPLETE 6327 //You have successfully transformed your %1.
|
||||
#define GENERIC_STRING 6688 //%1 (used to any basic message)
|
||||
#define SENTINEL_TRIG_YOU 6724 //You have triggered your sentinel.
|
||||
#define SENTINEL_TRIG_OTHER 6725 //%1 has triggered your sentinel.
|
||||
|
||||
@@ -283,6 +283,26 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob
|
||||
}
|
||||
|
||||
container = inst;
|
||||
if (container->GetItem()->BagType == BagTypeTransformationmold) {
|
||||
const ItemInst* inst = container->GetItem(0);
|
||||
bool AllowAll = RuleB(Inventory, AllowAnyWeaponTransformation);
|
||||
if (inst && ItemInst::CanTransform(inst->GetItem(), container->GetItem(), AllowAll)) {
|
||||
const Item_Struct* new_weapon = inst->GetItem();
|
||||
user->DeleteItemInInventory(Inventory::CalcSlotId(in_combine->container_slot, 0), 0, true);
|
||||
container->Clear();
|
||||
user->SummonItem(new_weapon->ID, inst->GetCharges(), inst->GetAugmentItemID(0), inst->GetAugmentItemID(1), inst->GetAugmentItemID(2), inst->GetAugmentItemID(3), inst->GetAugmentItemID(4), inst->IsInstNoDrop(), MainCursor, container->GetItem()->Icon, atoi(container->GetItem()->IDFile + 2));
|
||||
user->Message_StringID(4, TRANSFORM_COMPLETE, inst->GetItem()->Name);
|
||||
if (RuleB(Inventory, DeleteTransformationMold))
|
||||
user->DeleteItemInInventory(in_combine->container_slot, 0, true);
|
||||
}
|
||||
else if (inst) {
|
||||
user->Message_StringID(4, TRANSFORM_FAILED, inst->GetItem()->Name);
|
||||
}
|
||||
EQApplicationPacket* outapp = new EQApplicationPacket(OP_TradeSkillCombine, 0);
|
||||
user->QueuePacket(outapp);
|
||||
safe_delete(outapp);
|
||||
return;
|
||||
}
|
||||
|
||||
DBTradeskillRecipe_Struct spec;
|
||||
if (!database.GetTradeRecipe(container, c_type, some_id, user->CharacterID(), &spec)) {
|
||||
|
||||
Reference in New Issue
Block a user