Skip to content
Browse files

Merge branch 'pullrequests' of https://github.com/Kretol/ArkCORE into…

… pullrequests
  • Loading branch information...
2 parents 80bb9e1 + 9349774 commit b1cfecfa06f8520717e9ef29df7e6c29d6d4afc5 @Kretol Kretol committed Jan 5, 2013
View
13 src/server/game/Entities/Item/Item.cpp
@@ -1385,12 +1385,21 @@ FakeResult Item::SetFakeDisplay(uint32 iEntry)
if (!otherTmpl)
return FAKE_ERR_CANT_FIND_ITEM;
+ // Inventory slot must match
if (myTmpl->InventoryType != otherTmpl->InventoryType)
- return FAKE_ERR_DIFF_SLOTS;
+ return FAKE_ERR_DIFF_INVENTORYTYPE;
+
+ // Valid classes are weapons and armor
+ if ((myTmpl->Class != 2) && (myTmpl->Class != 4) || (otherTmpl->Class != 2) && (otherTmpl->Class != 4))
+ return FAKE_ERR_INVALID_CLASS;
+
+ // Subclasses should match (eg, no axe->mace)
+ if (myTmpl->SubClass != otherTmpl->SubClass)
+ return FAKE_ERR_DIFF_SUBCLASS;
if (m_fakeDisplayEntry != iEntry)
{
- sObjectMgr->SetFekeItem(GetGUIDLow(), iEntry);
+ sObjectMgr->SetFakeItem(GetGUIDLow(), iEntry);
(!m_fakeDisplayEntry) ? CharacterDatabase.PExecute("INSERT INTO fake_items VALUES (%u, %u)", GetGUIDLow(), iEntry) :
CharacterDatabase.PExecute("UPDATE fake_items SET fakeEntry = %u WHERE guid = %u", iEntry, GetGUIDLow());
View
4 src/server/game/Entities/Item/Item.h
@@ -160,9 +160,11 @@ enum FakeResult
FAKE_ERR_CANT_FIND_OWNER,
FAKE_ERR_CANT_FIND_ITEM,
FAKE_ERR_WRONG_QUALITY,
- FAKE_ERR_DIFF_SLOTS,
+ FAKE_ERR_DIFF_INVENTORYTYPE,
FAKE_ERR_DIFF_CLASS,
FAKE_ERR_DIFF_RACE,
+ FAKE_ERR_DIFF_SUBCLASS,
+ FAKE_ERR_INVALID_CLASS,
FAKE_ERR_OK
};
View
2 src/server/game/Globals/ObjectMgr.cpp
@@ -2542,7 +2542,7 @@ uint32 ObjectMgr::GetFakeItemEntry(uint32 itemGuid)
return 0;
}
-void ObjectMgr::SetFekeItem(uint32 itemGuid, uint32 fakeEntry)
+void ObjectMgr::SetFakeItem(uint32 itemGuid, uint32 fakeEntry)
{
_fakeItemsStore[itemGuid] = fakeEntry;
}
View
2 src/server/game/Globals/ObjectMgr.h
@@ -682,7 +682,7 @@ class ObjectMgr
}
uint32 GetFakeItemEntry(uint32 itemGuid);
- void SetFekeItem(uint32 itemGuid, uint32 fakeEntry);
+ void SetFakeItem(uint32 itemGuid, uint32 fakeEntry);
void RemoveFakeItem(uint32 itemGuid);
static InstanceTemplate const* GetInstanceTemplate(uint32 map)
View
3 src/server/game/Miscellaneous/Language.h
@@ -318,6 +318,9 @@ enum ArkCoreStrings
// Use for custom patches 11000-11999
LANG_AUTO_BROADCAST = 11000, LANG_INVALID_REALMID = 11001, LANG_FAILED_NO_PLACE_FOR_PET = 11002,
+ LANG_FAKEITEM_MISSING_ITEMS = 11003, LANG_FAKEITEM_MISSING_MONEY = 11004, LANG_FAKEITEM_MISSING_ITEM = 11007, LANG_FAKEITEM_DIFF_TYPE = 11008,
+ LANG_FAKEITEM_INVALID_TYPE = 11009, LANG_FAKEITEM_CLEARITEM = 11010, LANG_FAKEITEM_INVALID_QUALITY = 11011, LANG_FAKEITEM_DIFF_CLASS = 11012,
+ LANG_FAKEITEM_DIFF_RACE = 11013,
// NOT RESERVED IDS 12000-1999999999
// `db_script_string` table index 2000000000-2000009999 (MIN_DB_SCRIPT_STRING_ID-MAX_DB_SCRIPT_STRING_ID)
View
32 src/server/scripts/Custom/npc_transmogrify.cpp
@@ -32,8 +32,8 @@ class npc_transmogrify : public CreatureScript
bool OnGossipHello(Player* pPlayer, Creature* pCreature)
{
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_MONEY_BAG, "Transmogrifer!", GOSSIP_SENDER_MAIN, ACTION_TRANSMOGRIFY_ADD_DISPLAY);
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_MONEY_BAG, "Remove Transmogrifer", GOSSIP_SENDER_MAIN, ACTION_TRANSMOGRIFY_REMOVE_DISPLAY);
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_MONEY_BAG, "Transmogrify!", GOSSIP_SENDER_MAIN, ACTION_TRANSMOGRIFY_ADD_DISPLAY);
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_MONEY_BAG, "Remove Transmogrification", GOSSIP_SENDER_MAIN, ACTION_TRANSMOGRIFY_REMOVE_DISPLAY);
pPlayer->SEND_GOSSIP_MENU(51000, pCreature->GetGUID());
return true;
}
@@ -45,9 +45,11 @@ class npc_transmogrify : public CreatureScript
{
case ACTION_TRANSMOGRIFY_ADD_DISPLAY:
TransmogrifyItem(player, creature);
+ player->PlayerTalkClass->CloseGossip();
break;
case ACTION_TRANSMOGRIFY_REMOVE_DISPLAY:
ClearItem(player, creature);
+ player->PlayerTalkClass->CloseGossip();
break;
}
return true;
@@ -60,37 +62,45 @@ class npc_transmogrify : public CreatureScript
Item *displayItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, INVENTORY_SLOT_ITEM_START + 1);
if (!trItem || !displayItem)
{
- handler.PSendSysMessage("Put your items in slot 1 and 2 in your bag!");
+ handler.PSendSysMessage(LANG_FAKEITEM_MISSING_ITEMS);
return;
}
if (!player->HasEnoughMoney(PriceInGold))
{
- handler.PSendSysMessage("It costs %u gold!", PriceInGold);
+ handler.PSendSysMessage(LANG_FAKEITEM_MISSING_MONEY, PriceInGold);
return;
}
uint8 result = trItem->SetFakeDisplay(displayItem->GetProto()->ItemId);
switch (result)
{
case FAKE_ERR_CANT_FIND_ITEM:
- handler.PSendSysMessage("Your item was not found!");
+ handler.PSendSysMessage(LANG_FAKEITEM_MISSING_ITEM);
break;
case FAKE_ERR_WRONG_QUALITY:
- handler.PSendSysMessage("The item is of incorrect quality!");
+ handler.PSendSysMessage(LANG_FAKEITEM_INVALID_QUALITY);
break;
- case FAKE_ERR_DIFF_SLOTS:
- handler.PSendSysMessage("The items are for different slots!");
+ case FAKE_ERR_DIFF_INVENTORYTYPE:
+ handler.PSendSysMessage(LANG_FAKEITEM_DIFF_TYPE);
break;
case FAKE_ERR_DIFF_CLASS:
- handler.PSendSysMessage("Item is for a different class!");
+ handler.PSendSysMessage(LANG_FAKEITEM_DIFF_CLASS);
break;
case FAKE_ERR_DIFF_RACE:
- handler.PSendSysMessage("Item is for a different race!");
+ handler.PSendSysMessage(LANG_FAKEITEM_DIFF_RACE);
+ break;
+
+ case FAKE_ERR_INVALID_CLASS:
+ handler.PSendSysMessage(LANG_FAKEITEM_INVALID_TYPE);
+ break;
+
+ case FAKE_ERR_DIFF_SUBCLASS:
+ handler.PSendSysMessage(LANG_FAKEITEM_DIFF_TYPE);
break;
case FAKE_ERR_OK:
@@ -113,7 +123,7 @@ class npc_transmogrify : public CreatureScript
Item *trItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, INVENTORY_SLOT_ITEM_START);
if (!trItem)
{
- handler.PSendSysMessage("Put the item in the first slot of your bag!");
+ handler.PSendSysMessage(LANG_FAKEITEM_CLEARITEM);
return;
}

0 comments on commit b1cfecf

Please sign in to comment.
Something went wrong with that request. Please try again.