Skip to content

Commit

Permalink
some cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
wazy committed Dec 30, 2012
1 parent 7fd146b commit ed71fee
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 19 deletions.
26 changes: 13 additions & 13 deletions src/server/game/Entities/Item/Item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -614,32 +614,32 @@ bool Item::LoadFromDB (uint32 guid, uint64 owner_guid, Field* fields, uint32 ent
return true;
}

void Item::DeleteFromDB (SQLTransaction& trans)
void Item::DeleteFromDB(SQLTransaction& trans)
{
sObjectMgr->RemoveFakeItem(GetGUIDLow());
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEM_INSTANCE);
stmt->setUInt32(0, GetGUIDLow());
trans->Append(stmt);
}

void Item::DeleteFromInventoryDB (SQLTransaction& trans)
void Item::DeleteFromInventoryDB(SQLTransaction& trans)
{
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INVENTORY_ITEM);
stmt->setUInt32(0, GetGUIDLow());
trans->Append(stmt);
}

ItemPrototype const *Item::GetProto () const
ItemPrototype const *Item::GetProto() const
{
return ObjectMgr::GetItemPrototype(GetEntry());
}

Player* Item::GetOwner () const
Player* Item::GetOwner() const
{
return sObjectMgr->GetPlayer(GetOwnerGUID());
}

uint32 Item::GetSkill ()
uint32 Item::GetSkill()
{
const static uint32 item_weapon_skills[MAX_ITEM_SUBCLASS_WEAPON] =
{ SKILL_AXES, SKILL_2H_AXES, SKILL_BOWS, SKILL_GUNS, SKILL_MACES, SKILL_2H_MACES, SKILL_POLEARMS, SKILL_SWORDS, SKILL_2H_SWORDS, 0, SKILL_STAVES, 0, 0, SKILL_FIST_WEAPONS, 0, SKILL_DAGGERS, SKILL_THROWN, SKILL_ASSASSINATION, SKILL_CROSSBOWS, SKILL_WANDS, SKILL_FISHING };
Expand Down Expand Up @@ -668,7 +668,7 @@ uint32 Item::GetSkill ()
}
}

uint32 Item::GetSpell ()
uint32 Item::GetSpell()
{
ItemPrototype const* proto = GetProto();

Expand Down Expand Up @@ -1266,7 +1266,7 @@ void Item::BuildUpdate (UpdateDataMapType& data_map)
ClearUpdateMask(false);
}

void Item::SaveRefundDataToDB ()
void Item::SaveRefundDataToDB()
{
SQLTransaction trans = CharacterDatabase.BeginTransaction();
trans->PAppend("DELETE FROM item_refund_instance WHERE item_guid = '%u'", GetGUIDLow());
Expand All @@ -1275,12 +1275,12 @@ void Item::SaveRefundDataToDB ()
CharacterDatabase.CommitTransaction(trans);
}

void Item::DeleteRefundDataFromDB ()
void Item::DeleteRefundDataFromDB()
{
CharacterDatabase.PExecute("DELETE FROM item_refund_instance WHERE item_guid = '%u'", GetGUIDLow());
}

void Item::SetNotRefundable (Player *owner, bool changestate)
void Item::SetNotRefundable(Player *owner, bool changestate)
{
if (!HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_REFUNDABLE))
return;
Expand All @@ -1298,7 +1298,7 @@ void Item::SetNotRefundable (Player *owner, bool changestate)
owner->DeleteRefundReference(GetGUIDLow());
}

void Item::UpdatePlayedTime (Player *owner)
void Item::UpdatePlayedTime(Player *owner)
{
/* Here we update our played time
We simply add a number to the current played time,
Expand Down Expand Up @@ -1326,19 +1326,19 @@ void Item::UpdatePlayedTime (Player *owner)
SetNotRefundable(owner);
}

uint32 Item::GetPlayedTime ()
uint32 Item::GetPlayedTime()
{
time_t curtime = time(NULL);
uint32 elapsed = uint32(curtime - m_lastPlayedTimeUpdate);
return GetUInt32Value(ITEM_FIELD_CREATE_PLAYED_TIME) + elapsed;
}

bool Item::IsRefundExpired ()
bool Item::IsRefundExpired()
{
return (GetPlayedTime() > 2 * HOUR);
}

void Item::SetSoulboundTradeable (AllowedLooterSet* allowedLooters, Player* currentOwner, bool apply)
void Item::SetSoulboundTradeable(AllowedLooterSet* allowedLooters, Player* currentOwner, bool apply)
{
if (apply)
{
Expand Down
2 changes: 1 addition & 1 deletion src/server/game/Globals/ObjectMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9336,4 +9336,4 @@ void ObjectMgr::LoadFactionChangeReputations()

sLog->outString();
sLog->outString(">> Loaded %u faction change reputation pairs.", counter);
}
}
22 changes: 17 additions & 5 deletions src/server/scripts/Custom/npc_transmogrify.cpp
Original file line number Diff line number Diff line change
@@ -1,17 +1,29 @@
/*
* Copyright (C) 2011-2012 ProjectStudioMirage <http://www.studio-mirage.fr/>
* Copyright (C) 2011-2012 https://github.com/Asardial
* Copyright (C) 2011 - 2012 ArkCORE <http://www.arkania.net/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/


// original author unknown
#include "ScriptPCH.h"

enum TransmogrifyActions {
ACTION_TRANSMOGRIFY_ADD_DISPLAY,
ACTION_TRANSMOGRIFY_REMOVE_DISPLAY
};

const uint16 PriceInGold = 1000 * 100 * 100; // 1k golds
const int32 PriceInGold = 10000000; // 1k gold

class npc_transmogrify : public CreatureScript
{
Expand Down Expand Up @@ -101,7 +113,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("Put the item in the first slot of your bag!");
return;
}

Expand Down

0 comments on commit ed71fee

Please sign in to comment.