aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormaximius <none@none>2009-09-14 13:34:23 -0700
committermaximius <none@none>2009-09-14 13:34:23 -0700
commit32798803f88caf2c60992c336ae5aa935d4cb349 (patch)
tree3344fecfe1826e203d77b1b84d25ef73c410cfd2 /src
parent10d3d6817d4f1dda0a27e3350658463afb9c727b (diff)
*[8480] Provided real-time update for guidl ranks rights.
Specially for guild bank tab access rights (including currently open tab case!) Send roster broadcast for all online guild memebers at any rank edit and guild bank tab buy. Author: VladimirMangos *Fix a pretty stupid mistake of mine with that Stoneclaw Totem fix, put the code block in the wrong function! *Use comparison instead of std::min (for some reason std::min seems to expect 3 arguments on Windows!?) --HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/Guild.cpp10
-rw-r--r--src/game/Guild.h2
-rw-r--r--src/game/GuildHandler.cpp8
-rw-r--r--src/game/SpellAuras.cpp2
-rw-r--r--src/game/SpellEffects.cpp33
-rw-r--r--src/game/Totem.cpp34
-rw-r--r--src/game/WorldLog.cpp2
7 files changed, 46 insertions, 45 deletions
diff --git a/src/game/Guild.cpp b/src/game/Guild.cpp
index ddf94158275..92faebccad5 100644
--- a/src/game/Guild.cpp
+++ b/src/game/Guild.cpp
@@ -728,7 +728,7 @@ void Guild::Disband()
objmgr.RemoveGuild(m_Id);
}
-void Guild::Roster(WorldSession *session)
+void Guild::Roster(WorldSession *session /*= NULL*/)
{
// we can only guess size
WorldPacket data(SMSG_GUILD_ROSTER, (4+MOTD.length()+1+GINFO.length()+1+4+m_Ranks.size()*(4+4+GUILD_BANK_MAX_TABS*(4+4))+members.size()*50));
@@ -777,7 +777,10 @@ void Guild::Roster(WorldSession *session)
data << itr->second.OFFnote;
}
}
- session->SendPacket(&data);;
+ if (session)
+ session->SendPacket(&data);
+ else
+ BroadcastPacket(&data);
sLog.outDebug( "WORLD: Sent (SMSG_GUILD_ROSTER)" );
}
@@ -1085,7 +1088,7 @@ void Guild::DisplayGuildBankTabsInfo(WorldSession *session)
//data << uint32(0xFFFFFFFF); // bit 9 must be set for this packet to work
data << uint32(0);
data << uint8(1); // Tell Client this is a TabInfo packet
- data << uint8(m_PurchasedTabs); // here is the number of tabs
+ data << uint8(m_PurchasedTabs); // here is the number of tabs
for (uint8 i = 0; i < m_PurchasedTabs; ++i)
{
@@ -1975,7 +1978,6 @@ void Guild::SendGuildBankTabText(WorldSession *session, uint8 TabId)
session->SendPacket(&data);
else
BroadcastPacket(&data);
-
}
void Guild::SwapItems(Player * pl, uint8 BankTab, uint8 BankTabSlot, uint8 BankTabDst, uint8 BankTabSlotDst, uint32 SplitedAmount )
diff --git a/src/game/Guild.h b/src/game/Guild.h
index 549cdc0984a..0e70ed53fd0 100644
--- a/src/game/Guild.h
+++ b/src/game/Guild.h
@@ -376,7 +376,7 @@ class Guild
return NULL;
}
- void Roster(WorldSession *session);
+ void Roster(WorldSession *session = NULL); // NULL = broadcast
void Query(WorldSession *session);
void UpdateLogoutTime(uint64 guid);
diff --git a/src/game/GuildHandler.cpp b/src/game/GuildHandler.cpp
index 2d5bd1b91b5..4b163c09e85 100644
--- a/src/game/GuildHandler.cpp
+++ b/src/game/GuildHandler.cpp
@@ -678,7 +678,7 @@ void WorldSession::HandleGuildRankOpcode(WorldPacket& recvPacket)
guild->SetRankRights(rankId, rights);
guild->Query(this);
- guild->Roster(this);
+ guild->Roster(); // broadcast for tab rights update
}
void WorldSession::HandleGuildAddRankOpcode(WorldPacket& recvPacket)
@@ -709,7 +709,7 @@ void WorldSession::HandleGuildAddRankOpcode(WorldPacket& recvPacket)
guild->CreateRank(rankname, GR_RIGHT_GCHATLISTEN | GR_RIGHT_GCHATSPEAK);
guild->Query(this);
- guild->Roster(this);
+ guild->Roster(); // broadcast for tab rights update
}
void WorldSession::HandleGuildDelRankOpcode(WorldPacket& /*recvPacket*/)
@@ -735,7 +735,7 @@ void WorldSession::HandleGuildDelRankOpcode(WorldPacket& /*recvPacket*/)
guild->DelRank();
guild->Query(this);
- guild->Roster(this);
+ guild->Roster(); // broadcast for tab rights update
}
void WorldSession::SendGuildCommandResult(uint32 typecmd, const std::string& str,uint32 cmdresult)
@@ -1185,7 +1185,7 @@ void WorldSession::HandleGuildBankBuyTab( WorldPacket & recv_data )
GetPlayer()->ModifyMoney(-int(TabCost));
pGuild->SetBankMoneyPerDay(GetPlayer()->GetRank(), WITHDRAW_MONEY_UNLIMITED);
pGuild->SetBankRightsAndSlots(GetPlayer()->GetRank(), TabId, GUILD_BANK_RIGHT_FULL, WITHDRAW_SLOT_UNLIMITED, true);
- pGuild->Roster(this);
+ pGuild->Roster(); // broadcast for tab rights update
pGuild->DisplayGuildBankTabsInfo(this);
}
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index 82fd481a441..5661f5a422c 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -3436,7 +3436,7 @@ void AuraEffect::HandleAuraModShapeshift(bool apply, bool Real, bool changeAmoun
if (GetMiscValue() == FORM_CAT)
{
- int32 basePoints = std::min(FurorChance, oldVal);
+ int32 basePoints = (FurorChance < oldVal ? FurorChance : oldVal);
m_target->CastCustomSpell(m_target,17099,&basePoints,NULL,NULL,true,NULL,this);
}
else
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index 35db1b0cc04..e0e84b7c2bb 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -5345,6 +5345,39 @@ void Spell::EffectScriptEffect(uint32 effIndex)
((TempSummon*)m_caster)->UnSummon();
return;
}
+ // Stoneclaw Totem
+ case 55328: // Rank 1
+ case 55329: // Rank 2
+ case 55330: // Rank 3
+ case 55332: // Rank 4
+ case 55333: // Rank 5
+ case 55335: // Rank 6
+ case 55278: // Rank 7
+ case 58589: // Rank 8
+ case 58590: // Rank 9
+ case 58591: // Rank 10
+ {
+ int32 basepoints0 = damage;
+ // Cast Absorb on totems
+ for(uint8 slot = SUMMON_SLOT_TOTEM; slot < MAX_TOTEM_SLOT; ++slot)
+ {
+ if(!unitTarget->m_SummonSlot[slot])
+ continue;
+
+ Creature* totem = unitTarget->GetMap()->GetCreature(unitTarget->m_SummonSlot[slot]);
+ if(totem && totem->isTotem())
+ {
+ m_caster->CastCustomSpell(totem, 55277, &basepoints0, NULL, NULL, true);
+ }
+ }
+ // Glyph of Stoneclaw Totem
+ if (AuraEffect *aur=unitTarget->GetAuraEffect(63298, 0))
+ {
+ basepoints0 *= aur->GetAmount();
+ m_caster->CastCustomSpell(unitTarget, 55277, &basepoints0, NULL, NULL, true);
+ }
+ break;
+ }
}
break;
}
diff --git a/src/game/Totem.cpp b/src/game/Totem.cpp
index 0b621e56edf..885f1bfaeee 100644
--- a/src/game/Totem.cpp
+++ b/src/game/Totem.cpp
@@ -90,39 +90,7 @@ void Totem::InitSummon()
SendMessageToSet(&data, true);
if(m_type == TOTEM_PASSIVE)
- CastSpell(this, GetSpell(), true);
-
- // Stoneclaw Totem
- case 55328: // Rank 1
- case 55329: // Rank 2
- case 55330: // Rank 3
- case 55332: // Rank 4
- case 55333: // Rank 5
- case 55335: // Rank 6
- case 55278: // Rank 7
- case 58589: // Rank 8
- case 58590: // Rank 9
- case 58591: // Rank 10
- {
- int32 basepoints0 = damage;
- // Cast Absorb on totems
- for(uint8 slot = SUMMON_SLOT_TOTEM; slot < MAX_TOTEM_SLOT; ++slot)
- {
- if(!unitTarget->m_SummonSlot[slot])
- continue;
-
- Creature* totem = unitTarget->GetMap()->GetCreature(unitTarget->m_SummonSlot[slot]);
- if(totem && totem->isTotem())
- m_caster->CastCustomSpell(totem, 55277, &basepoints0, NULL, NULL, true);
- }
- // Glyph of Stoneclaw Totem
- if (AuraEffect *aur=unitTarget->GetAuraEffect(63298, 0))
- {
- basepoints0 *= aur->GetAmount();
- m_caster->CastCustomSpell(unitTarget, 55277, &basepoints0, NULL, NULL, true);
- }
- break;
- }
+ CastSpell(this, GetSpell(), true);
// Some totems can have both instant effect and passive spell
if (GetSpell(1))
diff --git a/src/game/WorldLog.cpp b/src/game/WorldLog.cpp
index 978514ac7d7..435e3279948 100644
--- a/src/game/WorldLog.cpp
+++ b/src/game/WorldLog.cpp
@@ -31,8 +31,6 @@
INSTANTIATE_SINGLETON_2(WorldLog, CLASS_LOCK);
INSTANTIATE_CLASS_MUTEX(WorldLog, ACE_Thread_Mutex);
-#define WORLD_LOG_FILE_STRING "world.log"
-
WorldLog::WorldLog() : i_file(NULL)
{
Initialize();