Merge branch 'master' into 4.3.4

Conflicts:
	sql/base/characters_database.sql
	src/server/game/Guilds/Guild.cpp
	src/server/game/Handlers/ChatHandler.cpp
	src/server/scripts/EasternKingdoms/silverpine_forest.cpp
This commit is contained in:
Spp committed 2012-11-08 11:25:38 +01:00
commit 35d63a9799
13 files changed
+160 -58

No files matched your search

+47 -32
View File
@@ -1922,24 +1922,6 @@ CREATE TABLE `guild_member` (
`rank` tinyint(3) unsigned NOT NULL,
`pnote` varchar(31) NOT NULL DEFAULT '',
`offnote` varchar(31) NOT NULL DEFAULT '',
`BankResetTimeMoney` int(10) unsigned NOT NULL DEFAULT '0',
`BankRemMoney` int(10) unsigned NOT NULL DEFAULT '0',
`BankResetTimeTab0` int(10) unsigned NOT NULL DEFAULT '0',
`BankRemSlotsTab0` int(10) unsigned NOT NULL DEFAULT '0',
`BankResetTimeTab1` int(10) unsigned NOT NULL DEFAULT '0',
`BankRemSlotsTab1` int(10) unsigned NOT NULL DEFAULT '0',
`BankResetTimeTab2` int(10) unsigned NOT NULL DEFAULT '0',
`BankRemSlotsTab2` int(10) unsigned NOT NULL DEFAULT '0',
`BankResetTimeTab3` int(10) unsigned NOT NULL DEFAULT '0',
`BankRemSlotsTab3` int(10) unsigned NOT NULL DEFAULT '0',
`BankResetTimeTab4` int(10) unsigned NOT NULL DEFAULT '0',
`BankRemSlotsTab4` int(10) unsigned NOT NULL DEFAULT '0',
`BankResetTimeTab5` int(10) unsigned NOT NULL DEFAULT '0',
`BankRemSlotsTab5` int(10) unsigned NOT NULL DEFAULT '0',
`BankResetTimeTab6` int(10) unsigned NOT NULL DEFAULT '0',
`BankRemSlotsTab6` int(10) unsigned NOT NULL DEFAULT '0',
`BankResetTimeTab7` int(10) unsigned NOT NULL DEFAULT '0',
`BankRemSlotsTab7` int(10) unsigned NOT NULL DEFAULT '0',
UNIQUE KEY `guid_key` (`guid`),
KEY `guildid_key` (`guildid`),
KEY `guildid_rank_key` (`guildid`,`rank`)
@@ -1955,33 +1937,66 @@ LOCK TABLES `guild_member` WRITE;
/*!40000 ALTER TABLE `guild_member` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `guild_member_withdraw`
--
DROP TABLE IF EXISTS `guild_member_withdraw`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE IF NOT EXISTS `guild_member_withdraw` (
`guid` int(10) unsigned NOT NULL,
`tab0` int(10) unsigned NOT NULL DEFAULT '0',
`tab1` int(10) unsigned NOT NULL DEFAULT '0',
`tab2` int(10) unsigned NOT NULL DEFAULT '0',
`tab3` int(10) unsigned NOT NULL DEFAULT '0',
`tab4` int(10) unsigned NOT NULL DEFAULT '0',
`tab5` int(10) unsigned NOT NULL DEFAULT '0',
`tab6` int(10) unsigned NOT NULL DEFAULT '0',
`tab7` int(10) unsigned NOT NULL DEFAULT '0',
`money` int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`guid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Guild Member Daily Withdraws';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `guild_member_withdraw`
--
LOCK TABLES `guild_member_withdraw` WRITE;
/*!40000 ALTER TABLE `guild_member_withdraw` DISABLE KEYS */;
/*!40000 ALTER TABLE `guild_member_withdraw` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `guild_news_log`
--
DROP TABLE IF EXISTS `guild_news_log`;
DROP TABLE IF EXISTS `guild_newslog`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `guild_news_log` (
`guild` int(10) unsigned NOT NULL,
`id` int(10) unsigned NOT NULL,
`eventType` int(10) unsigned NOT NULL,
`playerGuid` bigint(20) unsigned NOT NULL,
`data` int(10) unsigned NOT NULL,
`flags` int(10) unsigned NOT NULL,
`date` int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`guild`,`id`)
`guildid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Guild Identificator',
`LogGuid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Log record identificator - auxiliary column',
`EventType` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT 'Event type',
`PlayerGuid` int(10) unsigned NOT NULL DEFAULT '0',
`Flags` int(10) unsigned NOT NULL DEFAULT '0',
`Value` int(10) unsigned NOT NULL DEFAULT '0',
`TimeStamp` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Event UNIX time',
PRIMARY KEY (`guildid`,`LogGuid`)
KEY `guildid_key` (`guildid`),
KEY `Idx_PlayerGuid` (`PlayerGuid`),
KEY `Idx_LogGuid` (`LogGuid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `guild_news_log`
-- Dumping data for table `guild_newslog`
--
LOCK TABLES `guild_news_log` WRITE;
/*!40000 ALTER TABLE `guild_news_log` DISABLE KEYS */;
/*!40000 ALTER TABLE `guild_news_log` ENABLE KEYS */;
UNLOCK TABLES;
LOCK TABLES `guild_newslog` WRITE;
/*!40000 ALTER TABLE `guild_newslog` DISABLE KEYS */;
/*!40000 ALTER TABLE `guild_newslog` ENABLE KEYS */;
--
-- Table structure for table `guild_rank`
@@ -27,4 +27,3 @@ ALTER TABLE `guild_member` DROP COLUMN `BankResetTimeTab5`;
DELETE FROM `worldstates` WHERE `entry`=20006;
INSERT INTO `worldstates` (`entry`,`value`,`comment`) VALUES (20006,0, 'Guild daily reset');
@@ -0,0 +1,36 @@
SET @GUID := 43456;
DELETE FROM `creature` WHERE `guid` BETWEEN @GUID+0 AND @GUID+3;
INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`,`npcflag`,`unit_flags`,`dynamicflags`) VALUES
(@GUID+0,30236,571,1,64,0,0,6219.17,59.9983,400.375,1.6057,120,0,0,1,0,0,0,0,0),
(@GUID+1,30236,571,1,64,0,0,6256.11,93.2413,410.92,0.767945,120,0,0,1,0,0,0,0,0),
(@GUID+2,30236,571,1,64,0,0,6297.37,53.5677,410.957,0.802851,120,0,0,1,0,0,0,0,0),
(@GUID+3,30236,571,1,64,0,0,6162.81,60.9792,400.371,1.55334,120,0,0,1,0,0,0,0,0);
DELETE FROM `creature_template_addon` WHERE `entry`=30236;
INSERT INTO `creature_template_addon` (`entry`,`path_id`,`mount`,`bytes1`,`bytes2`,`auras`) VALUES
(30236,0,0,0x0,0x1,'');
DELETE FROM `creature_model_info` WHERE `modelid`=27101;
INSERT INTO `creature_model_info` (`modelid`,`bounding_radius`,`combat_reach`,`gender`) VALUES
(27101,0.3055,1,2);
UPDATE `creature_template` SET `VehicleId`=246,`npcflag`=0x1000000,`resistance2`=4394,`resistance4`=1 WHERE `entry`=30236;
DELETE FROM `npc_spellclick_spells` WHERE `npc_entry`=30236;
INSERT INTO `npc_spellclick_spells` (`npc_entry`,`spell_id`,`cast_flags`,`user_type`) VALUES
(30236,57573,1,0);
SET @OGUID := 7278;
DELETE FROM `gameobject` WHERE `id` IN (192657,192658,192769,192770,192767,192768,192771,192772);
INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES
(@OGUID+0, 192657, 571, 1, 64, 6255.958, 93.05556, 403.0368, 5.454153, 0, 0, 0, 1, 120, 255, 1),
(@OGUID+1, 192658, 571, 1, 64, 6255.961, 93.06424, 408.4696, 5.44543, 0, 0, 0, 1, 120, 255, 1),
(@OGUID+2, 192769, 571, 1, 64, 6219.205, 59.86806, 392.5132, 6.283184, 0, 0, 0, 1, 120, 255, 1),
(@OGUID+3, 192770, 571, 1, 64, 6219.202, 59.875, 397.924, 6.274461, 0, 0, 0, 1, 120, 255, 1),
(@OGUID+4, 192767, 571, 1, 64, 6297.223, 53.39583, 402.9972, 5.532692, 0, 0, 0, 1, 120, 255, 1),
(@OGUID+5, 192768, 571, 1, 64, 6297.226, 53.40451, 408.4129, 5.523969, 0, 0, 0, 1, 120, 255, 1),
(@OGUID+6, 192771, 571, 1, 64, 6162.772, 60.73438, 392.4362, 6.265733, 0, 0, 0, 1, 120, 255, 1),
(@OGUID+7, 192772, 571, 1, 64, 6162.768, 60.74306, 397.8138, 6.257008, 0, 0, 0, 1, 120, 255, 1);
UPDATE `gameobject_template` SET `flags`=32,`faction`=114 WHERE `entry` IN (192657,192658,192769,192770,192767,192768,192771,192772);
@@ -360,7 +360,7 @@ void GameObject::Update(uint32 diff)
Unit* caster = GetOwner();
if (caster && caster->GetTypeId() == TYPEID_PLAYER)
{
caster->FinishSpell(CURRENT_CHANNELED_SPELL);
caster->ToPlayer()->RemoveGameObject(this, false);
WorldPacket data(SMSG_FISH_ESCAPED, 0);
caster->ToPlayer()->GetSession()->SendPacket(&data);
@@ -1361,6 +1361,8 @@ void GameObject::Use(Unit* user)
player->SendLoot(GetGUID(), LOOT_FISHING);
}
// TODO: else: junk
else
m_respawnTime = time(NULL);
break;
}
+67 -18
View File
@@ -31,6 +31,56 @@
#define MAX_GUILD_BANK_TAB_TEXT_LEN 500
#define EMBLEM_PRICE 10 * GOLD
std::string _GetGuildEventString(GuildEvents event)
{
switch (event)
{
case GE_PROMOTION:
return "Member promotion";
case GE_DEMOTION:
return "Member demotion";
case GE_MOTD:
return "Guild MOTD";
case GE_JOINED:
return "Member joined";
case GE_LEFT:
return "Member left";
case GE_REMOVED:
return "Member removed";
case GE_LEADER_IS:
return "Leader is";
case GE_LEADER_CHANGED:
return "Leader changed";
case GE_DISBANDED:
return "Guild disbanded";
case GE_TABARDCHANGE:
return "Tabard change";
case GE_RANK_UPDATED:
return "Rank updated";
case GE_RANK_DELETED:
return "Rank deleted";
case GE_SIGNED_ON:
return "Member signed on";
case GE_SIGNED_OFF:
return "Member signed off";
case GE_GUILDBANKBAGSLOTS_CHANGED:
return "Bank bag slots changed";
case GE_BANK_TAB_PURCHASED:
return "Bank tab purchased";
case GE_BANK_TAB_UPDATED:
return "Bank tab updated";
case GE_BANK_MONEY_SET:
return "Bank money set";
case GE_BANK_MONEY_CHANGED:
return "Bank money changed";
case GE_BANK_TEXT_CHANGED:
return "Bank tab text changed";
default:
break;
}
return "<None>";
}
inline uint32 _GetGuildBankTabPrice(uint8 tabId)
{
switch (tabId)
@@ -337,10 +387,9 @@ void Guild::RankInfo::SaveToDB(SQLTransaction& trans) const
CharacterDatabase.ExecuteOrAppend(trans, stmt);
}
bool Guild::RankInfo::CreateMissingTabsIfNeeded(uint8 ranks, SQLTransaction& trans)
void Guild::RankInfo::CreateMissingTabsIfNeeded(uint8 tabs, SQLTransaction& trans, bool logOnCreate /* = false */)
{
bool ret = false;
for (uint8 i = 0; i < ranks; ++i)
for (uint8 i = 0; i < tabs; ++i)
{
GuildBankRightsAndSlots& rightsAndSlots = m_bankTabRightsAndSlots[i];
if (rightsAndSlots.GetTabId() == i)
@@ -350,7 +399,9 @@ bool Guild::RankInfo::CreateMissingTabsIfNeeded(uint8 ranks, SQLTransaction& tra
if (m_rankId == GR_GUILDMASTER)
rightsAndSlots.SetGuildMasterValues();
ret = true;
if (logOnCreate)
sLog->outError(LOG_FILTER_GUILD, "Guild %u has broken Tab %u for rank %u. Created default tab.", m_guildId, i, m_rankId);
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_GUILD_BANK_RIGHT);
stmt->setUInt32(0, m_guildId);
stmt->setUInt8 (1, i);
@@ -359,8 +410,6 @@ bool Guild::RankInfo::CreateMissingTabsIfNeeded(uint8 ranks, SQLTransaction& tra
stmt->setUInt32(4, rightsAndSlots.GetSlots());
trans->Append(stmt);
}
return ret;
}
void Guild::RankInfo::SetName(std::string const& name)
@@ -1631,17 +1680,14 @@ void Guild::HandleBuyBankTab(WorldSession* session, uint8 tabId)
if (!tabCost)
return;
if (!player->HasEnoughMoney(uint64(tabCost))) // Should not happen, this is checked by client
if (!player->HasEnoughMoney(tabCost)) // Should not happen, this is checked by client
return;
player->ModifyMoney(-int64(tabCost));
player->ModifyMoney(-int32(tabCost));
uint8 rankId = member->GetRankId();
_CreateNewBankTab();
GuildBankRightsAndSlots rightsAndSlots(tabId);
_SetRankBankTabRightsAndSlots(rankId, rightsAndSlots);
_BroadcastEvent(GE_BANK_TAB_PURCHASED, 0);
SendPermissions(session); /// Hack to force client to update permissions
SendPermissions(session); /// Hack to force client to update permissions
}
void Guild::HandleInviteMember(WorldSession* session, std::string const& name)
@@ -2406,11 +2452,8 @@ bool Guild::Validate()
else
{
SQLTransaction trans = CharacterDatabase.BeginTransaction();
if (rankInfo->CreateMissingTabsIfNeeded(_GetPurchasedTabsSize(), trans))
{
sLog->outError(LOG_FILTER_GUILD, "Guild %u has broken Tabs for rank id %u, creating default tab...", m_id, rankId);
CharacterDatabase.CommitTransaction(trans);
}
rankInfo->CreateMissingTabsIfNeeded(_GetPurchasedTabsSize(), trans, true);
CharacterDatabase.CommitTransaction(trans);
}
}
}
@@ -2722,6 +2765,10 @@ void Guild::_CreateNewBankTab()
stmt->setUInt8 (1, tabId);
trans->Append(stmt);
++tabId;
for (Ranks::iterator itr = m_ranks.begin(); itr != m_ranks.end(); ++itr)
(*itr).CreateMissingTabsIfNeeded(tabId, trans, false);
CharacterDatabase.CommitTransaction(trans);
}
@@ -3204,7 +3251,9 @@ void Guild::_BroadcastEvent(GuildEvents guildEvent, uint64 guid, const char* par
data << uint64(guid);
BroadcastPacket(&data);
sLog->outDebug(LOG_FILTER_GUILD, "SMSG_GUILD_EVENT [Broadcast] Event: %u", guildEvent);
if (sLog->ShouldLog(LOG_FILTER_GUILD, LOG_LEVEL_DEBUG))
sLog->outDebug(LOG_FILTER_GUILD, "SMSG_GUILD_EVENT [Broadcast] Event: %s (%u)", _GetGuildEventString(guildEvent).c_str(), guildEvent);
}
void Guild::SendBankList(WorldSession* session, uint8 tabId, bool withContent, bool withTabInfo) const
+1 -1
View File
@@ -604,7 +604,7 @@ private:
}
void SetBankTabSlotsAndRights(GuildBankRightsAndSlots rightsAndSlots, bool saveToDB);
bool CreateMissingTabsIfNeeded(uint8 ranks, SQLTransaction& trans);
void CreateMissingTabsIfNeeded(uint8 ranks, SQLTransaction& trans, bool logOnCreate = false);
private:
uint32 m_guildId;
+1 -1
View File
@@ -732,7 +732,7 @@ void WorldSession::HandlePetSpellAutocastOpcode(WorldPacket& recvPacket)
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellid);
// do not add not learned spells/ passive spells
if (!pet->HasSpell(spellid) || spellInfo->IsAutocastable())
if (!pet->HasSpell(spellid) || !spellInfo->IsAutocastable())
return;
CharmInfo* charmInfo = pet->GetCharmInfo();
@@ -89,7 +89,6 @@ void TargetedMovementGeneratorMedium<T,D>::_setTargetLocation(T &owner)
Movement::MoveSplineInit init(owner);
init.MoveTo(x,y,z);
init.SetFacing(i_target.getTarget());
init.SetWalk(((D*)this)->EnableWalking());
init.Launch();
}
@@ -19,7 +19,7 @@
#include "MoveSpline.h"
#include <sstream>
#include "Log.h"
#include "Unit.h"
#include "Creature.h"
namespace Movement{
+1 -1
View File
@@ -2255,7 +2255,7 @@ void Spell::EffectSummonType(SpellEffIndex effIndex)
// randomize position for multiple summons
m_caster->GetRandomPoint(*destTarget, radius, pos);
summon = m_originalCaster->SummonCreature(entry, *destTarget, summonType, duration);
summon = m_originalCaster->SummonCreature(entry, pos, summonType, duration);
if (!summon)
continue;
+1 -1
View File
@@ -2471,7 +2471,7 @@ bool SpellInfo::_IsPositiveEffect(uint8 effIndex, bool deep) const
continue;
// if non-positive trigger cast targeted to positive target this main cast is non-positive
// this will place this spell auras as debuffs
if (_IsPositiveTarget(spellTriggeredProto->Effects[i].TargetA.GetTarget(), spellTriggeredProto->Effects[effIndex].TargetB.GetTarget()) && !spellTriggeredProto->_IsPositiveEffect(i, true))
if (_IsPositiveTarget(spellTriggeredProto->Effects[i].TargetA.GetTarget(), spellTriggeredProto->Effects[i].TargetB.GetTarget()) && !spellTriggeredProto->_IsPositiveEffect(i, true))
return false;
}
}
@@ -17,6 +17,7 @@
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "SpellAuras.h"
enum Orphans
{
@@ -33,6 +33,7 @@ EndContentData */
#include "ScriptedGossip.h"
#include "ScriptedEscortAI.h"
#include "SpellScript.h"
#include "SpellAuras.h"
/*######
## npc_injured_rainspeaker_oracle