From a29847bf8490833ba219f01fba1441d6c8f1b7a3 Mon Sep 17 00:00:00 2001 From: krz Date: Tue, 2 Jun 2009 20:59:13 +0200 Subject: Fix for some combat log errors. Only Vanish and Invisibility auras will now prevent from taking damage if target is not visible for caster. --HG-- branch : trunk --- src/game/Spell.cpp | 9 ++++++--- src/game/Unit.cpp | 11 +++++++++++ src/game/Unit.h | 1 + 3 files changed, 18 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index b43a57f9334..82756ad118f 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -1150,14 +1150,17 @@ void Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask) } if( !m_caster->IsFriendlyTo(unit) ) { + // reset damage to 0 if target has Invisibility or Vanish aura (_only_ vanish, not stealth) and isn't visible for caster + bool isVisibleForHit = ( (unit->HasAuraType(SPELL_AURA_MOD_INVISIBILITY) || unit->HasAuraTypeWithFamilyFlags(SPELL_AURA_MOD_STEALTH, SPELLFAMILY_ROGUE ,SPELLFAMILYFLAG_ROGUE_VANISH)) && !unit->isVisibleForOrDetect(m_caster, true)) ? false : true; + // for delayed spells ignore not visible explicit target - if(m_spellInfo->speed > 0.0f && unit==m_targets.getUnitTarget() && !unit->isVisibleForOrDetect(m_caster,false)) + if(m_spellInfo->speed > 0.0f && unit==m_targets.getUnitTarget() && !isVisibleForHit) { - m_caster->SendSpellMiss(unit, m_spellInfo->Id, SPELL_MISS_EVADE); + // that was causing CombatLog errors + //m_caster->SendSpellMiss(unit, m_spellInfo->Id, SPELL_MISS_EVADE); m_damage = 0; return; } - unit->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_HITBYSPELL); if(m_customAttr & SPELL_ATTR_CU_AURA_CC) unit->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_CC); diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 6f248b75161..2ec904dd865 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -616,6 +616,17 @@ bool Unit::HasAuraType(AuraType auraType) const return (!m_modAuras[auraType].empty()); } +bool Unit::HasAuraTypeWithFamilyFlags(AuraType auraType, uint32 familyName ,uint64 familyFlags) const +{ + if(!HasAuraType(auraType)) return false; + AuraList const &auras = GetAurasByType(auraType); + for(AuraList::const_iterator itr = auras.begin(); itr != auras.end(); ++itr) + if(SpellEntry const *iterSpellProto = (*itr)->GetSpellProto()) + if(iterSpellProto->SpellFamilyName == familyName && iterSpellProto->SpellFamilyFlags & familyFlags) + return true; + return false; +} + /* Called by DealDamage for auras that have a chance to be dispelled on damage taken. */ void Unit::RemoveSpellbyDamageTaken(uint32 damage, uint32 spell) { diff --git a/src/game/Unit.h b/src/game/Unit.h index 5eb4530113c..9929c173206 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -1018,6 +1018,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject uint32 GetCombatTimer() const { return m_CombatTimer; } bool HasAuraType(AuraType auraType) const; + bool HasAuraTypeWithFamilyFlags(AuraType auraType, uint32 familyName, uint64 familyFlags) const; bool HasAura(uint32 spellId, uint32 effIndex) const { return m_Auras.find(spellEffectPair(spellId, effIndex)) != m_Auras.end(); } -- cgit v1.2.3 From 3578b8d596b1d20b44e9529c1e151ae4c41c6621 Mon Sep 17 00:00:00 2001 From: Paradox Date: Wed, 3 Jun 2009 19:43:46 -0400 Subject: Backported from TC2 - More correctly calculate auction deposit. --HG-- branch : trunk --- src/game/AuctionHouseMgr.cpp | 38 +++++++++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/game/AuctionHouseMgr.cpp b/src/game/AuctionHouseMgr.cpp index 1554013af99..2619d589ec7 100644 --- a/src/game/AuctionHouseMgr.cpp +++ b/src/game/AuctionHouseMgr.cpp @@ -66,9 +66,41 @@ AuctionHouseObject * AuctionHouseMgr::GetAuctionsMap( uint32 factionTemplateId ) uint32 AuctionHouseMgr::GetAuctionDeposit(AuctionHouseEntry const* entry, uint32 time, Item *pItem) { - uint32 deposit = pItem->GetProto()->SellPrice * pItem->GetCount() * (time / MIN_AUCTION_TIME ); - - return uint32(deposit * entry->depositPercent * 3 * sWorld.getRate(RATE_AUCTION_DEPOSIT) / 100.0f ); + uint32 MSV = pItem->GetProto()->SellPrice; + double deposit; + double faction_pct; + if (MSV > 0) + { + if(sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION)) + faction_pct = (0.75 * (double)sWorld.getRate(RATE_AUCTION_DEPOSIT)); + else + { + FactionTemplateEntry const* u_entry = sFactionTemplateStore.LookupEntry(entry->houseId); + if(!u_entry) + faction_pct = (0.75 * (double)sWorld.getRate(RATE_AUCTION_DEPOSIT)); + else if(u_entry->ourMask & FACTION_MASK_ALLIANCE) + faction_pct = (0.15 * (double)sWorld.getRate(RATE_AUCTION_DEPOSIT)); + else if(u_entry->ourMask & FACTION_MASK_HORDE) + faction_pct = (0.15 * (double)sWorld.getRate(RATE_AUCTION_DEPOSIT)); + else + faction_pct = (0.75 * (double)sWorld.getRate(RATE_AUCTION_DEPOSIT)); + } + deposit = ((double)MSV * faction_pct * (double)pItem->GetCount()) * (double)(time / MIN_AUCTION_TIME ); + } + else + { + faction_pct = 0.0f; + deposit = 0.0f; + } + //sLog.outString("SellPrice:\t\t%u", MSV); + //sLog.outString("Deposit Percent:\t%f", faction_pct); + //sLog.outString("Min Auction Time:\t%u", (time / MIN_AUCTION_TIME )); + //sLog.outString("Count:\t\t\t%u", pItem->GetCount()); + //sLog.outString("Deposit:\t\t%f", deposit); + if (deposit > 0) + return (uint32)deposit; + else + return 0; } //does not clear ram -- cgit v1.2.3 From 85b68d886aa5ebc92dbd28ad83f710c0fd655579 Mon Sep 17 00:00:00 2001 From: krz Date: Fri, 5 Jun 2009 01:21:11 +0200 Subject: Send interrupt message at spell cast end if target is not visible for caster. --HG-- branch : trunk --- src/game/Spell.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 82756ad118f..d8cf24c2933 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -2238,6 +2238,11 @@ void Spell::cancel() void Spell::cast(bool skipCheck) { + if(m_targets.getUnitTarget() && !m_targets.getUnitTarget()->isVisibleForOrDetect(m_caster, true)) + { + cancel(); + return; + } SetExecutedCurrently(true); uint8 castResult = 0; -- cgit v1.2.3 From 65598fe2333472adb9a9eaa80ff4d5d3f62cce10 Mon Sep 17 00:00:00 2001 From: krz Date: Fri, 5 Jun 2009 02:02:50 +0200 Subject: Backported from TC2: allow Water Elemental to cast Freeze while casting Water Bolt --HG-- branch : trunk --- src/game/PetHandler.cpp | 5 ++++- src/game/Spell.cpp | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/game/PetHandler.cpp b/src/game/PetHandler.cpp index 350c390d86c..8ffe2529227 100644 --- a/src/game/PetHandler.cpp +++ b/src/game/PetHandler.cpp @@ -632,7 +632,10 @@ void WorldSession::HandlePetCastSpellOpcode( WorldPacket& recvPacket ) } if (caster->GetTypeId() == TYPEID_UNIT && ((Creature*)caster)->GetGlobalCooldown() > 0) + { + caster->SendPetCastFail(spellid, SPELL_FAILED_NOT_READY); return; + } SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellid); if(!spellInfo) @@ -651,7 +654,7 @@ void WorldSession::HandlePetCastSpellOpcode( WorldPacket& recvPacket ) caster->clearUnitState(UNIT_STAT_FOLLOW); - Spell *spell = new Spell(caster, spellInfo, false); + Spell *spell = new Spell(caster, spellInfo, spellid == 33395); // water elemental can cast freeze as triggered spell->m_targets = targets; int16 result = spell->PetCanCast(NULL); diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index d8cf24c2933..88bee994820 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -4269,7 +4269,7 @@ int16 Spell::PetCanCast(Unit* target) if(!m_caster->isAlive()) return SPELL_FAILED_CASTER_DEAD; - if(m_caster->IsNonMeleeSpellCasted(false)) //prevent spellcast interruption by another spellcast + if(m_caster->IsNonMeleeSpellCasted(false) && !m_IsTriggeredSpell) //prevent spellcast interruption by another spellcast return SPELL_FAILED_SPELL_IN_PROGRESS; if(m_caster->isInCombat() && IsNonCombatSpell(m_spellInfo)) return SPELL_FAILED_AFFECTING_COMBAT; -- cgit v1.2.3 From a319125b4f49109cf008b5f055cf56cd30a7ed7f Mon Sep 17 00:00:00 2001 From: krz Date: Fri, 5 Jun 2009 02:07:05 +0200 Subject: Change in SpellEntry structure to allow EffectBaseDice[] to store negative values - patch by thenecromancer. --HG-- branch : trunk --- src/shared/Database/DBCStructure.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/shared/Database/DBCStructure.h b/src/shared/Database/DBCStructure.h index 95703f9b778..8e8aa8bfba8 100644 --- a/src/shared/Database/DBCStructure.h +++ b/src/shared/Database/DBCStructure.h @@ -605,7 +605,7 @@ struct SpellEntry int32 EquippedItemInventoryTypeMask; // 64 (mask) uint32 Effect[3]; // 65-67 int32 EffectDieSides[3]; // 68-70 - uint32 EffectBaseDice[3]; // 71-73 + int32 EffectBaseDice[3]; // 71-73 float EffectDicePerLevel[3]; // 74-76 float EffectRealPointsPerLevel[3]; // 77-79 int32 EffectBasePoints[3]; // 80-82 (don't must be used in spell/auras explicitly, must be used cached Spell::m_currentBasePoints) -- cgit v1.2.3 From 715f410fb7fdebe1c22401cb749ad57eae637040 Mon Sep 17 00:00:00 2001 From: Chaz Brown Date: Fri, 5 Jun 2009 21:12:12 -0400 Subject: Fix AHBot to calculate the deposit for auctions so it can be used to check the code for figuring deposit amount on a wide range of items. Fix ahbotoptions command so it works from the server console again. change commented out lines in GetAuctionDeposit so they display in debug loglevel. Min/Max Time settings replaced with a function that selects 12 24 and 48 randomly as the auction times. Backport from TC2 --HG-- branch : trunk --- sql/characters.sql | 2 -- sql/updates/1556_characters_ahbot.sql | 3 ++ src/game/AuctionHouseBot.cpp | 56 ++++++++++++++++++++++++----------- src/game/AuctionHouseBot.h | 23 -------------- src/game/AuctionHouseMgr.cpp | 12 ++++---- src/game/Level3.cpp | 12 ++++++-- 6 files changed, 58 insertions(+), 50 deletions(-) create mode 100644 sql/updates/1556_characters_ahbot.sql (limited to 'src') diff --git a/sql/characters.sql b/sql/characters.sql index c2233b7e282..bcb2b449c0f 100644 --- a/sql/characters.sql +++ b/sql/characters.sql @@ -132,8 +132,6 @@ CREATE TABLE `auctionhousebot` ( `name` char(25) default NULL COMMENT 'Text name of the auctionhouse.', `minitems` int(11) default '0' COMMENT 'This is the minimum number of items you want to keep in the auction house. a 0 here will make it the same as the maximum.', `maxitems` int(11) default '0' COMMENT 'This is the number of items you want to keep in the auction house.', - `mintime` int(11) default '8' COMMENT 'Sets the minimum number of hours for an auction.', - `maxtime` int(11) default '24' COMMENT 'Sets the maximum number of hours for an auction.', `percentgreytradegoods` int(11) default '0' COMMENT 'Sets the percentage of the Grey Trade Goods auction items', `percentwhitetradegoods` int(11) default '27' COMMENT 'Sets the percentage of the White Trade Goods auction items', `percentgreentradegoods` int(11) default '12' COMMENT 'Sets the percentage of the Green Trade Goods auction items', diff --git a/sql/updates/1556_characters_ahbot.sql b/sql/updates/1556_characters_ahbot.sql new file mode 100644 index 00000000000..85c0b14bac4 --- /dev/null +++ b/sql/updates/1556_characters_ahbot.sql @@ -0,0 +1,3 @@ +ALTER TABLE `auctionhousebot` + DROP COLUMN `minTime`, + DROP COLUMN `maxTime`; diff --git a/src/game/AuctionHouseBot.cpp b/src/game/AuctionHouseBot.cpp index b139358b74a..1c1fdd57384 100644 --- a/src/game/AuctionHouseBot.cpp +++ b/src/game/AuctionHouseBot.cpp @@ -450,6 +450,40 @@ static void addNewAuctions(Player *AHBplayer, AHBConfig *config) break; } + if(auctionmgr.GetAItem(GUID_LOPART(item->GetGUID()))) + { + sLog.outError("Item %u not found", item->GetEntry()); + break; + } + if(!item->CanBeTraded()) + { + sLog.outError("Item %u can't be traded", item->GetEntry()); + break; + } + + if (item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAGS_CONJURED) || item->GetUInt32Value(ITEM_FIELD_DURATION)) + { + sLog.outError("Item %u is conjured or has a duration", item->GetEntry()); + break; + } + uint32 etime = urand(1,3); + switch(etime) + { + case 1: + etime = 43200; + break; + case 2: + etime = 86400; + break; + case 3: + etime = 172800; + break; + default: + etime = 86400; + break; + } + uint32 dep = auctionmgr.GetAuctionDeposit( ahEntry, etime, item ); + item->SetCount(stackCount); AuctionEntry* auctionEntry = new AuctionEntry; @@ -462,8 +496,8 @@ static void addNewAuctions(Player *AHBplayer, AHBConfig *config) auctionEntry->buyout = buyoutPrice; auctionEntry->bidder = 0; auctionEntry->bid = 0; - auctionEntry->deposit = 0; - auctionEntry->expire_time = (time_t) (urand(config->GetMinTime(), config->GetMaxTime()) * 60 * 60 + time(NULL)); + auctionEntry->deposit = dep; + auctionEntry->expire_time = (time_t) etime + time(NULL); auctionEntry->auctionHouseEntry = ahEntry; item->SaveToDB(); item->RemoveFromUpdateQueueOf(AHBplayer); @@ -1117,19 +1151,11 @@ void AuctionHouseBotCommands(uint32 command, uint32 ahMapID, uint32 col, char* a CharacterDatabase.PExecute("UPDATE auctionhousebot SET maxitems = '%u' WHERE auctionhouse = '%u'", maxItems, ahMapID); config->SetMaxItems(maxItems); }break; - case 3: //min time + case 3: //min time Deprecated (Place holder for future commands) { - char * param1 = strtok(args, " "); - uint32 minTime = (uint32) strtoul(param1, NULL, 0); - CharacterDatabase.PExecute("UPDATE auctionhousebot SET mintime = '%u' WHERE auctionhouse = '%u'", minTime, ahMapID); - config->SetMinTime(minTime); }break; - case 4: //max time + case 4: //max time Deprecated (Place holder for future commands) { - char * param1 = strtok(args, " "); - uint32 maxTime = (uint32) strtoul(param1, NULL, 0); - CharacterDatabase.PExecute("UPDATE auctionhousebot SET maxtime = '%u' WHERE auctionhouse = '%u'", maxTime, ahMapID); - config->SetMaxTime(maxTime); }break; case 5: //percentages { @@ -1250,12 +1276,6 @@ void AuctionHouseBotLoadValues(AHBConfig *config) if(debug_Out) {sLog.outError("minItems = %u", config->GetMinItems()); sLog.outError("maxItems = %u", config->GetMaxItems());} - //load min and max auction times - config->SetMinTime(CharacterDatabase.PQuery("SELECT mintime FROM auctionhousebot WHERE auctionhouse = %u",config->GetAHID())->Fetch()->GetUInt32()); - config->SetMaxTime(CharacterDatabase.PQuery("SELECT maxtime FROM auctionhousebot WHERE auctionhouse = %u",config->GetAHID())->Fetch()->GetUInt32()); - if(debug_Out) - {sLog.outError("minTime = %u", config->GetMinTime()); - sLog.outError("maxTime = %u", config->GetMaxTime());} //load percentages uint32 greytg = CharacterDatabase.PQuery("SELECT percentgreytradegoods FROM auctionhousebot WHERE auctionhouse = %u",config->GetAHID())->Fetch()->GetUInt32(); uint32 whitetg = CharacterDatabase.PQuery("SELECT percentwhitetradegoods FROM auctionhousebot WHERE auctionhouse = %u",config->GetAHID())->Fetch()->GetUInt32(); diff --git a/src/game/AuctionHouseBot.h b/src/game/AuctionHouseBot.h index 8d5c067a354..f1d4ba86ec9 100644 --- a/src/game/AuctionHouseBot.h +++ b/src/game/AuctionHouseBot.h @@ -37,8 +37,6 @@ class AHBConfig uint32 AHFID; uint32 minItems; uint32 maxItems; - uint32 minTime; - uint32 maxTime; uint32 percentGreyTradeGoods; uint32 percentWhiteTradeGoods; uint32 percentGreenTradeGoods; @@ -166,27 +164,6 @@ class AHBConfig { return maxItems; } - void SetMinTime(uint32 value) - { - minTime = value; - } - uint32 GetMinTime() - { - if (minTime < 1) - return 1; - else if ((maxTime) && (minTime > maxTime)) - return maxTime; - else - return minTime; - } - void SetMaxTime(uint32 value) - { - maxTime = value; - } - uint32 GetMaxTime() - { - return maxTime; - } void SetPercentages(uint32 greytg, uint32 whitetg, uint32 greentg, uint32 bluetg, uint32 purpletg, uint32 orangetg, uint32 yellowtg, uint32 greyi, uint32 whitei, uint32 greeni, uint32 bluei, uint32 purplei, uint32 orangei, uint32 yellowi) { uint32 totalPercent = greytg + whitetg + greentg + bluetg + purpletg + orangetg + yellowtg + greyi + whitei + greeni + bluei + purplei + orangei + yellowi; diff --git a/src/game/AuctionHouseMgr.cpp b/src/game/AuctionHouseMgr.cpp index 2619d589ec7..adb4a4a2787 100644 --- a/src/game/AuctionHouseMgr.cpp +++ b/src/game/AuctionHouseMgr.cpp @@ -92,11 +92,13 @@ uint32 AuctionHouseMgr::GetAuctionDeposit(AuctionHouseEntry const* entry, uint32 faction_pct = 0.0f; deposit = 0.0f; } - //sLog.outString("SellPrice:\t\t%u", MSV); - //sLog.outString("Deposit Percent:\t%f", faction_pct); - //sLog.outString("Min Auction Time:\t%u", (time / MIN_AUCTION_TIME )); - //sLog.outString("Count:\t\t\t%u", pItem->GetCount()); - //sLog.outString("Deposit:\t\t%f", deposit); + sLog.outDebug("SellPrice:\t\t%u", MSV); + sLog.outDebug("Deposit Percent:\t%f", faction_pct); + sLog.outDebug("Auction Time1:\t\t%u", time); + sLog.outDebug("Auction Time2:\t\t%u", MIN_AUCTION_TIME); + sLog.outDebug("Auction Time3:\t\t%u", (time / MIN_AUCTION_TIME )); + sLog.outDebug("Count:\t\t\t%u", pItem->GetCount()); + sLog.outDebug("Deposit:\t\t%f", deposit); if (deposit > 0) return (uint32)deposit; else diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp index 128971f0153..b0cb3c5fc9f 100644 --- a/src/game/Level3.cpp +++ b/src/game/Level3.cpp @@ -78,8 +78,8 @@ bool ChatHandler::HandleAHBotOptionsCommand(const char* args) PSendSysMessage("ahexpire"); PSendSysMessage("minitems"); PSendSysMessage("maxitems"); - PSendSysMessage("mintime"); - PSendSysMessage("maxtime"); + //PSendSysMessage(""); + //PSendSysMessage(""); PSendSysMessage("percentages"); PSendSysMessage("minprice"); PSendSysMessage("maxprice"); @@ -112,6 +112,9 @@ bool ChatHandler::HandleAHBotOptionsCommand(const char* args) } else if (strncmp(opt,"maxitems",l) == 0) { + PSendSysMessage("ahbotoptions mintime has been deprecated"); + return false; + /* char * param1 = strtok(NULL, " "); if ((!ahMapIdStr) || (!param1)) { @@ -119,9 +122,13 @@ bool ChatHandler::HandleAHBotOptionsCommand(const char* args) return false; } AuctionHouseBotCommands(2, ahMapID, NULL, param1); + */ } else if (strncmp(opt,"mintime",l) == 0) { + PSendSysMessage("ahbotoptions maxtime has been deprecated"); + return false; + /* char * param1 = strtok(NULL, " "); if ((!ahMapIdStr) || (!param1)) { @@ -129,6 +136,7 @@ bool ChatHandler::HandleAHBotOptionsCommand(const char* args) return false; } AuctionHouseBotCommands(3, ahMapID, NULL, param1); + */ } else if (strncmp(opt,"maxtime",l) == 0) { -- cgit v1.2.3 From 2e4fae75a4f4f24dc2c97b8bde4870974c073aa9 Mon Sep 17 00:00:00 2001 From: krz Date: Sun, 7 Jun 2009 02:02:00 +0200 Subject: Fix the bug that players couldn't talk with Spirit Healer --HG-- branch : trunk --- src/game/Spell.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 88bee994820..cb67391dcbf 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -2238,13 +2238,13 @@ void Spell::cancel() void Spell::cast(bool skipCheck) { - if(m_targets.getUnitTarget() && !m_targets.getUnitTarget()->isVisibleForOrDetect(m_caster, true)) + if(m_targets.getUnitTarget() && m_targets.getUnitTarget()->isAlive() && !m_targets.getUnitTarget()->isVisibleForOrDetect(m_caster, true)) { cancel(); return; } - SetExecutedCurrently(true); + SetExecutedCurrently(true); uint8 castResult = 0; // update pointers base at GUIDs to prevent access to non-existed already object -- cgit v1.2.3 From a30466075d528bea18f968e67af8611cd86c6827 Mon Sep 17 00:00:00 2001 From: krz Date: Sun, 7 Jun 2009 03:02:04 +0200 Subject: Fix some broken channeled spells. --HG-- branch : trunk --- src/game/SpellAuras.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index dc8616e2fa7..5fa6e5843fc 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -543,9 +543,8 @@ void Aura::Update(uint32 diff) } // Channeled aura required check distance from caster except in possessed cases - Unit *pRealTarget = (GetSpellProto()->EffectApplyAuraName[GetEffIndex()] == SPELL_AURA_PERIODIC_TRIGGER_SPELL) ? GetTriggerTarget() : m_target; - if(!pRealTarget) - return; + Unit *pRealTarget = (GetSpellProto()->EffectApplyAuraName[m_effIndex] == SPELL_AURA_PERIODIC_TRIGGER_SPELL && !IsAreaOfEffectSpell(sSpellStore.LookupEntry(GetSpellProto()->EffectTriggerSpell[m_effIndex])) && GetTriggerTarget()) ? GetTriggerTarget() : m_target; + if(IsChanneledSpell(m_spellProto) && !pRealTarget->isPossessed() && pRealTarget->GetGUID() != GetCasterGUID()) { -- cgit v1.2.3 From 728b2dd09edeb9d037f6801fdaec41d8f3a3e3ef Mon Sep 17 00:00:00 2001 From: Chaz Brown Date: Sun, 7 Jun 2009 09:08:27 -0400 Subject: Remove second copy of flusharenapoints command from chat.cpp --HG-- branch : trunk --- src/game/Chat.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'src') diff --git a/src/game/Chat.cpp b/src/game/Chat.cpp index ba9cc5d7a2d..1722fd9602c 100644 --- a/src/game/Chat.cpp +++ b/src/game/Chat.cpp @@ -713,7 +713,6 @@ ChatCommand * ChatHandler::getCommandTable() { "freeze", SEC_ADMINISTRATOR, false, &ChatHandler::HandleFreezeCommand, "", NULL }, { "unfreeze", SEC_ADMINISTRATOR, false, &ChatHandler::HandleUnFreezeCommand, "", NULL }, { "listfreeze", SEC_ADMINISTRATOR, false, &ChatHandler::HandleListFreezeCommand, "", NULL }, - { "flusharenapoints", SEC_ADMINISTRATOR, false, &ChatHandler::HandleFlushArenaPointsCommand, "", NULL }, { "possess", SEC_ADMINISTRATOR, false, &ChatHandler::HandlePossessCommand, "", NULL }, { "unpossess", SEC_ADMINISTRATOR, false, &ChatHandler::HandleUnPossessCommand, "", NULL }, -- cgit v1.2.3 From 798e6875aec72a3992274dc8153a27836151729c Mon Sep 17 00:00:00 2001 From: Chaz Brown Date: Sun, 7 Jun 2009 09:12:05 -0400 Subject: Remove second copy of flusharenapoints command from chat.cpp - Backported from TC2 --HG-- branch : trunk --- src/game/Chat.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src') diff --git a/src/game/Chat.cpp b/src/game/Chat.cpp index 81655dad638..871a39a93bc 100644 --- a/src/game/Chat.cpp +++ b/src/game/Chat.cpp @@ -631,7 +631,6 @@ ChatCommand * ChatHandler::getCommandTable() { "freeze", SEC_ADMINISTRATOR, false, &ChatHandler::HandleFreezeCommand, "", NULL }, { "unfreeze", SEC_ADMINISTRATOR, false, &ChatHandler::HandleUnFreezeCommand, "", NULL }, { "listfreeze", SEC_ADMINISTRATOR, false, &ChatHandler::HandleListFreezeCommand, "", NULL }, - { "flusharenapoints", SEC_ADMINISTRATOR, false, &ChatHandler::HandleFlushArenaPointsCommand, "", NULL }, { "possess", SEC_ADMINISTRATOR, false, &ChatHandler::HandlePossessCommand, "", NULL }, { "unpossess", SEC_ADMINISTRATOR, false, &ChatHandler::HandleUnPossessCommand, "", NULL }, { "bindsight", SEC_ADMINISTRATOR, false, &ChatHandler::HandleBindSightCommand, "", NULL }, @@ -894,7 +893,7 @@ int ChatHandler::ParseCommands(const char* text) if(!ExecuteCommandInTable(getCommandTable(), text, fullcmd)) { - if(m_session && m_session->GetSecurity() == SEC_PLAYER) + if(m_session && m_session->GetSecurity() == SEC_PLAYER) return 0; SendSysMessage(LANG_NO_CMD); } -- cgit v1.2.3 From aaeb7adedd13a33885ea95243ab9ab174bcdc4d9 Mon Sep 17 00:00:00 2001 From: megamage Date: Sun, 7 Jun 2009 10:23:50 -0500 Subject: *Fix the output of arena log. Note: use I64FMT to output full guid (uint64) and %u to output guidlow (uint32). Otherwise the log will be bugged. --HG-- branch : trunk --- src/game/ArenaTeam.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/game/ArenaTeam.cpp b/src/game/ArenaTeam.cpp index 73d782a3e3c..6eb30b9cfed 100644 --- a/src/game/ArenaTeam.cpp +++ b/src/game/ArenaTeam.cpp @@ -144,7 +144,7 @@ bool ArenaTeam::AddMember(const uint64& PlayerGuid) // hide promote/remove buttons if(CaptainGuid != PlayerGuid) pl->SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (GetSlot() * 6) + 1, 1); - sLog.outArena("Player: %s [GUID: %u] joined arena team type: %u [Id: %u].", pl->GetName(), pl->GetGUID(), GetType(), GetId()); + sLog.outArena("Player: %s [GUID: %u] joined arena team type: %u [Id: %u].", pl->GetName(), pl->GetGUIDLow(), GetType(), GetId()); } return true; } @@ -253,7 +253,7 @@ void ArenaTeam::SetCaptain(const uint64& guid) if(newcaptain) { newcaptain->SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + 1 + (GetSlot() * 6), 0); - sLog.outArena("Player: %s [GUID: %u] promoted player: %s [GUID: %u] to leader of arena team [Id: %u] [Type: %u].", oldcaptain->GetName(), oldcaptain->GetGUID(), newcaptain->GetName(), newcaptain->GetGUID(), GetId(), GetType()); + sLog.outArena("Player: %s [GUID: %u] promoted player: %s [GUID: %u] to leader of arena team [Id: %u] [Type: %u].", oldcaptain->GetName(), oldcaptain->GetGUIDLow(), newcaptain->GetName(), newcaptain->GetGUID(), GetId(), GetType()); } } @@ -279,7 +279,7 @@ void ArenaTeam::DelMember(uint64 guid) { player->SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (GetSlot() * 6) + i, 0); } - sLog.outArena("Player: %s [GUID: %u] left arena team type: %u [Id: %u].", player->GetName(), guid, GetType(), GetId()); + sLog.outArena("Player: %s [GUID: %u] left arena team type: %u [Id: %u].", player->GetName(), player->GetGUIDLow(), GetType(), GetId()); } CharacterDatabase.PExecute("DELETE FROM arena_team_member WHERE arenateamid = '%u' AND guid = '%u'", GetId(), GUID_LOPART(guid)); } @@ -298,7 +298,7 @@ void ArenaTeam::Disband(WorldSession *session) } if(Player *player = session->GetPlayer()) - sLog.outArena("Player: %s [GUID: %u] disbanded arena team type: %u [Id: %u].", player->GetName(), player->GetGUID(), GetType(), GetId()); + sLog.outArena("Player: %s [GUID: %u] disbanded arena team type: %u [Id: %u].", player->GetName(), player->GetGUIDLow(), GetType(), GetId()); CharacterDatabase.BeginTransaction(); CharacterDatabase.PExecute("DELETE FROM arena_team WHERE arenateamid = '%u'", Id); -- cgit v1.2.3 From 73299773235259a2bd2272f0c54b01a2435b7a01 Mon Sep 17 00:00:00 2001 From: megamage Date: Sun, 7 Jun 2009 10:32:08 -0500 Subject: *Remove rank buff when players leave wintergrasp. --HG-- branch : trunk --- src/game/Wintergrasp.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/game/Wintergrasp.cpp b/src/game/Wintergrasp.cpp index 782ec4ab537..2d76559a1c0 100644 --- a/src/game/Wintergrasp.cpp +++ b/src/game/Wintergrasp.cpp @@ -49,6 +49,9 @@ void LoadTeamPair(TeamPairMap &pairMap, const TeamPair *pair) } } +#define REMOVE_RANK_AURAS(p) (p)->RemoveAura(SPELL_RECRUIT);\ + (p)->RemoveAura(SPELL_CORPORAL);(p)->RemoveAura(SPELL_LIEUTENANT) + typedef std::list AreaPOIList; bool OPvPWintergrasp::SetupOutdoorPvP() @@ -342,8 +345,12 @@ void OPvPWintergrasp::HandlePlayerEnterZone(Player * plr, uint32 zone) void OPvPWintergrasp::HandlePlayerLeaveZone(Player * plr, uint32 zone) { - if(!plr->GetSession()->PlayerLogout() && plr->m_Vehicle) // dismiss in change zone case - plr->m_Vehicle->Dismiss(); + if(!plr->GetSession()->PlayerLogout()) + { + if(plr->m_Vehicle) // dismiss in change zone case + plr->m_Vehicle->Dismiss(); + REMOVE_RANK_AURAS(plr); + } plr->RemoveAura(SPELL_TENACITY); OutdoorPvP::HandlePlayerLeaveZone(plr, zone); UpdateTenacityStack(); @@ -495,9 +502,7 @@ void OPvPWintergrasp::StartBattle() { for(PlayerSet::iterator itr = m_players[team].begin(); itr != m_players[team].end(); ++itr) { - (*itr)->RemoveAura(SPELL_RECRUIT); - (*itr)->RemoveAura(SPELL_CORPORAL); - (*itr)->RemoveAura(SPELL_LIEUTENANT); + REMOVE_RANK_AURAS(*itr); (*itr)->CastSpell(*itr, SPELL_RECRUIT, true); } } @@ -514,9 +519,7 @@ void OPvPWintergrasp::EndBattle() for(PlayerSet::iterator itr = m_players[team].begin(); itr != m_players[team].end(); ++itr) { - (*itr)->RemoveAura(SPELL_RECRUIT); - (*itr)->RemoveAura(SPELL_CORPORAL); - (*itr)->RemoveAura(SPELL_LIEUTENANT); + REMOVE_RANK_AURAS(*itr); } } } -- cgit v1.2.3 From 3f81e97ff58a9013fe55f1060f48e3583015e72f Mon Sep 17 00:00:00 2001 From: megamage Date: Sun, 7 Jun 2009 11:59:50 -0500 Subject: *Remove a tc1 sql. --HG-- branch : trunk --- sql/updates/1556_characters_ahbot.sql | 3 --- src/game/Spell.cpp | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) delete mode 100644 sql/updates/1556_characters_ahbot.sql (limited to 'src') diff --git a/sql/updates/1556_characters_ahbot.sql b/sql/updates/1556_characters_ahbot.sql deleted file mode 100644 index 85c0b14bac4..00000000000 --- a/sql/updates/1556_characters_ahbot.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE `auctionhousebot` - DROP COLUMN `minTime`, - DROP COLUMN `maxTime`; diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 8ca1dc6f82a..e861635281e 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -2561,7 +2561,7 @@ void Spell::cast(bool skipCheck) if(m_targets.getUnitTarget()) { // three check: prepare, cast (m_casttime > 0), hit (delayed) - if(m_casttime && m_targets.getUnitTarget()->isAlive() && !m_caster->canSeeOrDetect(m_targets.getUnitTarget(), true))) + if(m_casttime && m_targets.getUnitTarget()->isAlive() && !m_caster->canSeeOrDetect(m_targets.getUnitTarget(), true)) { cancel(); return; -- cgit v1.2.3