Index: ObjectMgr.cpp===================================================================
--- ObjectMgr.cpp (revision 532)
+++ ObjectMgr.cpp (working copy)
@@ -7255,7 +7255,7 @@
void ObjectMgr::LoadSpellCostEntrys() //法术使用消耗物品系统
{
m_Spell_Cost.clear();
- QueryResult *result = WorldDatabase.Query("SELECT entry, cost_money, cost_integral, cost_itemid, cost_itemcount FROM spell_cost");
+ QueryResult *result = WorldDatabase.Query("SELECT entry, cost_money, cost_integral, cost_itemid, cost_itemcount, cost_gmlevel FROM spell_cost");
uint32 total_count = 0;
@@ -7293,6 +7293,7 @@
//continue;
}
temp.itemcount = fields[4].GetUInt32();
+ temp.gmlevel = fields[5].GetUInt32();
m_Spell_Cost[entry] = temp; //把值放到内存
@@ -7308,7 +7309,7 @@
void ObjectMgr::LoadBuyItemPriceEntrys() //购买物品消耗系统
{
m_BuyItem_Price.clear();
- QueryResult *result = WorldDatabase.Query("SELECT entry, BuyItem, BuyItemCount FROM item_price");
+ QueryResult *result = WorldDatabase.Query("SELECT entry, BuyItem, BuyItemCount, BuyItem_jf, BuyItem_gmlevel FROM item_price");
uint32 total_count = 0;
@@ -7344,6 +7345,8 @@
//continue;
}
temp.itemcount = fields[2].GetUInt32();
+ temp.itemjf = fields[3].GetUInt32();
+ temp.itemgmlevel = fields[4].GetUInt32();
m_BuyItem_Price[entry] = temp; //把值放到内存
Index: ObjectMgr.h
===================================================================
--- ObjectMgr.h (revision 532)
+++ ObjectMgr.h (working copy)
@@ -101,6 +101,7 @@
uint32 integral;
uint32 itemid;
uint32 itemcount;
+ uint32 gmlevel;
};
struct BuyItemPrice //购买物品消耗系统
@@ -109,6 +110,8 @@
uint32 itemid;
uint32 buyitem;
uint32 itemcount;
+ uint32 itemjf;
+ uint32 itemgmlevel;
};
struct AttackPower //职业伤害治疗倍率系统
Index: Player.cpp
===================================================================
--- Player.cpp (revision 537)
+++ Player.cpp (working copy)
@@ -17746,18 +17746,17 @@
}
}
//购买物品消耗系统
- uint32 mItemid;
- uint32 mBuyitemid;
- uint32 mItemcount;
if (sConfig.GetIntDefault("BuyItem.Price.On.Off", 0) == 1)
{
//Player* pl;
ObjectMgr::BuyItemPriceMap const& cBuyItemPrice = sObjectMgr.GetItemPrice();
for (ObjectMgr::BuyItemPriceMap::const_iterator itr = cBuyItemPrice.begin(); itr != cBuyItemPrice.end(); ++itr)
{
- mItemid = itr->second.itemid;
- mBuyitemid = itr->second.buyitem;
- mItemcount= itr->second.itemcount;
+ uint32 mItemid = itr->second.itemid;
+ uint32 mBuyitemid = itr->second.buyitem;
+ uint32 mItemcount= itr->second.itemcount;
+ uint32 mItemjf = itr->second.itemjf;
+ uint32 mItemgmlevel = itr->second.itemgmlevel;
if (pProto->ItemId == mItemid && mItemid != 0)
{
@@ -17767,6 +17766,18 @@
GetSession()->SendAreaTriggerMessage(GetSession()->GetMangosString(15030),GetItemCharName(mBuyitemid),mItemcount);
return false;
}
+ //判断积分是否足够
+ if (mItemjf > 0 && GetAccountJf(GetSession()->GetAccountId()) < mItemjf )
+ {
+ GetSession()->SendAreaTriggerMessage(GetSession()->GetMangosString(15033),mItemjf);
+ return false;
+ }
+ //判断会员等级是否足够
+ if (mItemgmlevel > 0 && GetSession()->GetSecurity() < mItemgmlevel )
+ {
+ GetSession()->SendAreaTriggerMessage(GetSession()->GetMangosString(15034),mItemgmlevel);
+ return false;
+ }
else
{
ItemPosCountVec dest;
@@ -18065,18 +18076,17 @@
}
}
//购买物品消耗系统
- uint32 mItemid;
- uint32 mBuyitemid;
- uint32 mItemcount;
if (sConfig.GetIntDefault("BuyItem.Price.On.Off", 0) == 1)
{
//Player* pl;
ObjectMgr::BuyItemPriceMap const& cBuyItemPrice = sObjectMgr.GetItemPrice();
for (ObjectMgr::BuyItemPriceMap::const_iterator itr = cBuyItemPrice.begin(); itr != cBuyItemPrice.end(); ++itr)
{
- mItemid = itr->second.itemid;
- mBuyitemid = itr->second.buyitem;
- mItemcount= itr->second.itemcount;
+ uint32 mItemid = itr->second.itemid;
+ uint32 mBuyitemid = itr->second.buyitem;
+ uint32 mItemcount= itr->second.itemcount;
+ uint32 mItemjf = itr->second.itemjf;
+ uint32 mItemgmlevel = itr->second.itemgmlevel;
if (pProto->ItemId == mItemid && mItemid != 0)
{
@@ -18086,6 +18096,16 @@
GetSession()->SendAreaTriggerMessage(GetSession()->GetMangosString(15030),GetItemCharName(mBuyitemid),mItemcount);
return false;
}
+ if (mItemjf > 0 && GetAccountJf(GetSession()->GetAccountId()) < mItemjf )
+ {
+ GetSession()->SendAreaTriggerMessage(GetSession()->GetMangosString(15033),mItemjf);
+ return false;
+ }
+ if (mItemgmlevel > 0 && GetSession()->GetSecurity() < mItemgmlevel )
+ {
+ GetSession()->SendAreaTriggerMessage(GetSession()->GetMangosString(15034),mItemgmlevel);
+ return false;
+ }
else
{
ItemPosCountVec dest;
Index: Spell.cpp
===================================================================
--- Spell.cpp (revision 537)
+++ Spell.cpp (working copy)
@@ -2446,6 +2446,7 @@
uint32 mIntegral = itr->second.integral;
uint32 mItemid = itr->second.itemid;
uint32 mItemcount= itr->second.itemcount;
+ uint32 mGmlevel= itr->second.gmlevel;
if (m_spellInfo->Id == mSpellid && mSpellid != 0)
{
@@ -2485,6 +2486,14 @@
finish(false);
return;
}
+ //判断会员
+ if (mGmlevel > 0 && ((Player*)m_caster)->GetSession()->GetSecurity() < mGmlevel )
+ {
+ ((Player*)m_caster)->GetSession()->SendAreaTriggerMessage(((Player*)m_caster)->GetSession()->GetMangosString(15032),mGmlevel);
+ SendCastResult(SPELL_FAILED_SPELL_UNAVAILABLE);
+ finish(false);
+ return;
+ }
}
}
}
|