Merge commit 'origin/master' into 320

Conflicts:
	sql/mangos.sql
This commit is contained in:
tomrus88 2009-09-16 01:35:50 +04:00
commit b493c840e1
10 changed files with 111 additions and 78 deletions

View file

@ -24,7 +24,7 @@ CREATE TABLE `db_version` (
`version` varchar(120) default NULL,
`creature_ai_version` varchar(120) default NULL,
`cache_id` int(10) default '0',
`required_8498_01_mangos_spell_proc_event` bit(1) default NULL
`required_8499_01_mangos_spell_elixir` bit(1) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes';
--
@ -17044,14 +17044,29 @@ INSERT INTO `spell_elixir` VALUES
(45373,0x1),
(46837,0xB),
(46839,0xB),
(53747,0x2),
(53748,0x1),
(53746,0x1),
(53749,0x1),
(53751,0x2),
(53752,0x3),
(53755,0x3),
(53758,0x3),
(53760,0x3),
(53763,0x2),
(53764,0x2),
(54212,0x3),
(62380,0x3),
(67019,0x3);
(54452,0x1),
(54494,0x1),
(54497,0x2),
(60340,0x1),
(60341,0x1),
(60343,0x2),
(60344,0x1),
(60345,0x1),
(60346,0x1),
(60347,0x2),
(62380,0x3);
/*!40000 ALTER TABLE `spell_elixir` ENABLE KEYS */;

View file

@ -0,0 +1,24 @@
ALTER TABLE db_version CHANGE COLUMN required_8498_01_mangos_spell_proc_event required_8499_01_mangos_spell_elixir bit;
/* Elexirs added in 3.x */
DELETE FROM `spell_elixir` WHERE `entry` IN
(53747,53748,53746,53749,53751,53763,53764,54452,54494,54497,60340,60341,60343,60344,60345,60346,60347);
INSERT INTO `spell_elixir` (`entry`, `mask`) VALUES
(53747,0x2),
(53748,0x1),
(53746,0x1),
(53749,0x1),
(53751,0x2),
(53763,0x2),
(53764,0x2),
(54452,0x1),
(54494,0x1),
(54497,0x2),
(60340,0x1),
(60341,0x1),
(60343,0x2),
(60344,0x1),
(60345,0x1),
(60346,0x1),
(60347,0x2);

View file

@ -106,6 +106,7 @@ pkgdata_DATA = \
8488_01_mangos_spell_chain.sql \
8488_02_mangos_spell_bonus_data.sql \
8498_01_mangos_spell_proc_event.sql \
8499_01_mangos_spell_elixir.sql \
README
## Additional files to include when running 'make dist'
@ -192,4 +193,5 @@ EXTRA_DIST = \
8488_01_mangos_spell_chain.sql \
8488_02_mangos_spell_bonus_data.sql \
8498_01_mangos_spell_proc_event.sql \
8499_01_mangos_spell_elixir.sql \
README

View file

@ -421,7 +421,7 @@ uint32 GameEventMgr::Initialize() // return the next e
m_ActiveEvents.clear();
uint32 delay = Update();
sLog.outBasic("Game Event system initialized." );
isSystemInit = true;
m_IsGameEventsInit = true;
return delay;
}
@ -445,11 +445,14 @@ uint32 GameEventMgr::Update() // return the next e
StopEvent(itr);
else
{
if (!isSystemInit)
if (!m_IsGameEventsInit)
{
int16 event_nid = (-1) * (itr);
// spawn all negative ones for this event
GameEventSpawn(event_nid);
// disable any event specific quest (for cases where creature is spawned, but event not active).
UpdateEventQuests(itr, false);
}
}
}
@ -740,7 +743,7 @@ void GameEventMgr::UpdateEventQuests(uint16 event_id, bool Activate)
GameEventMgr::GameEventMgr()
{
isSystemInit = false;
m_IsGameEventsInit = false;
}
MANGOS_DLL_SPEC bool IsHolidayActive( HolidayIds id )

View file

@ -94,7 +94,7 @@ class GameEventMgr
GameEventIdMap mGameEventPoolIds;
GameEventDataMap mGameEvent;
ActiveEvents m_ActiveEvents;
bool isSystemInit;
bool m_IsGameEventsInit;
};
#define gameeventmgr MaNGOS::Singleton<GameEventMgr>::Instance()

View file

@ -1057,8 +1057,7 @@ bool Map::UnloadGrid(const uint32 &x, const uint32 &y, bool pForce)
GridMaps[gx][gy]->unloadData();
delete GridMaps[gx][gy];
}
// x and y are swapped
VMAP::VMapFactory::createOrGetVMapManager()->unloadMap(GetId(), gy, gx);
VMAP::VMapFactory::createOrGetVMapManager()->unloadMap(GetId(), gx, gy);
}
else
((MapInstanced*)m_parentMap)->RemoveGridMapReference(GridPair(gx, gy));

View file

@ -11419,8 +11419,7 @@ void Player::AddItemToBuyBackSlot( Item *pItem )
uint32 eslot = slot - BUYBACK_SLOT_START;
SetUInt64Value( PLAYER_FIELD_VENDORBUYBACK_SLOT_1 + (eslot * 2), pItem->GetGUID() );
ItemPrototype const *pProto = pItem->GetProto();
if( pProto )
if (ItemPrototype const *pProto = pItem->GetProto())
SetUInt32Value( PLAYER_FIELD_BUYBACK_PRICE_1 + eslot, pProto->SellPrice * pItem->GetCount() );
else
SetUInt32Value( PLAYER_FIELD_BUYBACK_PRICE_1 + eslot, 0 );
@ -11468,10 +11467,10 @@ void Player::RemoveItemFromBuyBackSlot( uint32 slot, bool del )
void Player::SendEquipError( uint8 msg, Item* pItem, Item *pItem2 )
{
sLog.outDebug( "WORLD: Sent SMSG_INVENTORY_CHANGE_FAILURE (%u)", msg);
WorldPacket data( SMSG_INVENTORY_CHANGE_FAILURE, (msg == EQUIP_ERR_CANT_EQUIP_LEVEL_I ? 22 : 18) );
WorldPacket data(SMSG_INVENTORY_CHANGE_FAILURE, (msg == EQUIP_ERR_CANT_EQUIP_LEVEL_I ? 22 : (msg == EQUIP_ERR_OK ? 1 : 18)));
data << uint8(msg);
if(msg)
if (msg != EQUIP_ERR_OK)
{
data << uint64(pItem ? pItem->GetGUID() : 0);
data << uint64(pItem2 ? pItem2->GetGUID() : 0);
@ -11640,27 +11639,18 @@ void Player::RemoveAllEnchantments(EnchantmentSlot slot)
// NOTE: no need to remove these from stats, since these aren't equipped
// in inventory
for(int i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; ++i)
{
Item* pItem = GetItemByPos( INVENTORY_SLOT_BAG_0, i );
if( pItem && pItem->GetEnchantmentId(slot) )
if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i))
if (pItem->GetEnchantmentId(slot))
pItem->ClearEnchantment(slot);
}
// in inventory bags
for(int i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i)
{
Bag* pBag = (Bag*)GetItemByPos( INVENTORY_SLOT_BAG_0, i );
if( pBag )
{
if (Bag* pBag = (Bag*)GetItemByPos( INVENTORY_SLOT_BAG_0, i ))
for(uint32 j = 0; j < pBag->GetBagSize(); ++j)
{
Item* pItem = pBag->GetItemByPos(j);
if( pItem && pItem->GetEnchantmentId(slot) )
if (Item* pItem = pBag->GetItemByPos(j))
if (pItem->GetEnchantmentId(slot))
pItem->ClearEnchantment(slot);
}
}
}
}
// duration == 0 will remove item enchant
void Player::AddEnchantmentDuration(Item *item,EnchantmentSlot slot,uint32 duration)

View file

@ -40,7 +40,7 @@ void WorldSession::SendNameQueryOpcode(Player *p)
// guess size
WorldPacket data( SMSG_NAME_QUERY_RESPONSE, (8+1+1+1+1+1+10) );
data.append(p->GetPackGUID()); // player guid
data << uint8(0); // added in 3.1
data << uint8(0); // added in 3.1; if > 1, then end of packet
data << p->GetName(); // played name
data << uint8(0); // realm name for cross realm BG usage
data << uint8(p->getRace());
@ -104,7 +104,7 @@ void WorldSession::SendNameQueryOpcodeFromDBCallBack(QueryResult *result, uint32
// guess size
WorldPacket data( SMSG_NAME_QUERY_RESPONSE, (8+1+1+1+1+1+1+10) );
data.appendPackGUID(MAKE_NEW_GUID(guid, 0, HIGHGUID_PLAYER));
data << uint8(0); // added in 3.1
data << uint8(0); // added in 3.1; if > 1, then end of packet
data << name;
data << uint8(0); // realm name for cross realm BG usage
data << uint8(pRace); // race

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "8498"
#define REVISION_NR "8502"
#endif // __REVISION_NR_H__

View file

@ -1,6 +1,6 @@
#ifndef __REVISION_SQL_H__
#define __REVISION_SQL_H__
#define REVISION_DB_CHARACTERS "required_8469_01_characters_character_spell"
#define REVISION_DB_MANGOS "required_8498_01_mangos_spell_proc_event"
#define REVISION_DB_MANGOS "required_8499_01_mangos_spell_elixir"
#define REVISION_DB_REALMD "required_8332_01_realmd_realmcharacters"
#endif // __REVISION_SQL_H__