diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/game/Formulas.h | 60 | ||||
| -rw-r--r-- | src/game/ItemHandler.cpp | 10 | ||||
| -rw-r--r-- | src/game/Level1.cpp | 18 | ||||
| -rw-r--r-- | src/game/ObjectMgr.cpp | 70 | ||||
| -rw-r--r-- | src/game/ObjectMgr.h | 4 | ||||
| -rw-r--r-- | src/game/Pet.cpp | 6 | ||||
| -rw-r--r-- | src/game/Player.cpp | 8 | ||||
| -rw-r--r-- | src/game/Player.h | 7 | ||||
| -rw-r--r-- | src/game/SharedDefines.h | 12 | ||||
| -rw-r--r-- | src/game/Spell.cpp | 4 | ||||
| -rw-r--r-- | src/game/SpellAuras.cpp | 8 | ||||
| -rw-r--r-- | src/game/SpellEffects.cpp | 45 | ||||
| -rw-r--r-- | src/game/Unit.h | 22 | ||||
| -rw-r--r-- | src/game/World.cpp | 1 | ||||
| -rw-r--r-- | src/game/World.h | 1 | ||||
| -rw-r--r-- | src/mangosd/mangosd.conf.dist.in | 5 | ||||
| -rw-r--r-- | src/shared/revision_nr.h | 2 | 
17 files changed, 146 insertions, 137 deletions
diff --git a/src/game/Formulas.h b/src/game/Formulas.h index f9915a2001c..a3af5adedbe 100644 --- a/src/game/Formulas.h +++ b/src/game/Formulas.h @@ -118,66 +118,6 @@ namespace Trinity              return (uint32)(xp_gain*sWorld.getRate(RATE_XP_KILL));          } -        inline uint32 xp_Diff(uint32 lvl) -        { -            if( lvl < 29 ) -                return 0; -            if( lvl == 29 ) -                return 1; -            if( lvl == 30 ) -                return 3; -            if( lvl == 31 ) -                return 6; -            else -                return (5*(lvl-30)); -        } - -        inline uint32 mxp(uint32 lvl) -        { -            if (lvl < 60) -            { -                return (45 + (5*lvl)); -            } -            else -            { -                return (235 + (5*lvl)); -            } -        } - -        inline uint32 xp_to_level(uint32 lvl) -        { -            uint32 xp = 0; -            if (lvl < 60) -            { -                xp = (8*lvl + xp_Diff(lvl)) * mxp(lvl); -            } -            else if (lvl == 60) -            { -                xp = (155 + mxp(lvl) * (1344 - 70 - ((69 - lvl) * (7 + (69 - lvl) * 8 - 1)/2))); -            } -            else if (lvl < 70) -            { -                xp = (155 + mxp(lvl) * (1344 - ((69-lvl) * (7 + (69 - lvl) * 8 - 1)/2))); -            }else -            { -                // level higher than 70 is not supported -                xp = (uint32)(779700 * (pow(sWorld.getRate(RATE_XP_PAST_70), (int32)lvl - 69))); -                return ((xp < 0x7fffffff) ? xp : 0x7fffffff); -            } - -            // The XP to Level is always rounded to the nearest 100 points (50 rounded to high). -            xp = ((xp + 50) / 100) * 100;                   // use additional () for prevent free association operations in C++ - -            if ((lvl > 10) && (lvl < 60))                   // compute discount added in 2.3.x -            { -                uint32 discount = (lvl < 28) ? (lvl - 10) : 18; -                xp = (xp * (100 - discount)) / 100;         // apply discount -                xp = (xp / 100) * 100;                      // floor to hundreds -            } - -            return xp; -        } -          inline float xp_in_group_rate(uint32 count, bool isRaid)          {              if(isRaid) diff --git a/src/game/ItemHandler.cpp b/src/game/ItemHandler.cpp index e96ef742c32..2c2cf2f82f1 100644 --- a/src/game/ItemHandler.cpp +++ b/src/game/ItemHandler.cpp @@ -1114,10 +1114,6 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recv_data)      CHECK_PACKET_SIZE(recv_data,8*4);      uint64 guids[4]; -    uint32 GemEnchants[3], OldEnchants[3]; -    Item *Gems[3]; -    bool SocketBonusActivated, SocketBonusToBeActivated; -      for(int i = 0; i < 4; i++)          recv_data >> guids[i]; @@ -1135,6 +1131,7 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recv_data)      //this slot is excepted when applying / removing meta gem bonus      uint8 slot = itemTarget->IsEquipped() ? itemTarget->GetSlot() : NULL_SLOT; +    Item *Gems[3];      for(int i = 0; i < 3; i++)          Gems[i] = guids[i + 1] ? _player->GetItemByGuid(guids[i + 1]) : NULL; @@ -1154,6 +1151,7 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recv_data)              return;      } +    uint32 GemEnchants[3], OldEnchants[3];      for(int i = 0; i < 3; ++i)                              //get new and old enchantments      {          GemEnchants[i] = (GemProps[i]) ? GemProps[i]->spellitemenchantement : 0; @@ -1202,7 +1200,7 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recv_data)          }      } -    SocketBonusActivated = itemTarget->GemsFitSockets();    //save state of socketbonus +    bool SocketBonusActivated = itemTarget->GemsFitSockets();    //save state of socketbonus      _player->ToggleMetaGemsActive(slot, false);             //turn off all metagems (except for the target item)      //if a meta gem is being equipped, all information has to be written to the item before testing if the conditions for the gem are met @@ -1224,7 +1222,7 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recv_data)      for(uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot < SOCK_ENCHANTMENT_SLOT+3; ++enchant_slot)          _player->ApplyEnchantment(itemTarget,EnchantmentSlot(enchant_slot),true); -    SocketBonusToBeActivated = itemTarget->GemsFitSockets();//current socketbonus state +    bool SocketBonusToBeActivated = itemTarget->GemsFitSockets();//current socketbonus state      if(SocketBonusActivated ^ SocketBonusToBeActivated)     //if there was a change...      {          _player->ApplyEnchantment(itemTarget,BONUS_ENCHANTMENT_SLOT,false); diff --git a/src/game/Level1.cpp b/src/game/Level1.cpp index ba68df16f7f..5f657344864 100644 --- a/src/game/Level1.cpp +++ b/src/game/Level1.cpp @@ -2043,14 +2043,14 @@ bool ChatHandler::HandleModifyMoneyCommand(const char* args)      return true;  } -//Edit Player field +//Edit Unit field  bool ChatHandler::HandleModifyBitCommand(const char* args)  {      if( !*args )          return false; -    Player *chr = getSelectedPlayer(); -    if (chr == NULL) +    Unit *unit = this->getSelectedUnit(); +    if (!unit)      {          SendSysMessage(LANG_NO_CHAR_SELECTED);          SetSentErrorMessage(true); @@ -2058,7 +2058,7 @@ bool ChatHandler::HandleModifyBitCommand(const char* args)      }      // check online security -    if (HasLowerSecurity(chr, 0)) +    if (unit->GetTypeId() == TYPEID_PLAYER && HasLowerSecurity((Player *)unit, 0))          return false;      char* pField = strtok((char*)args, " "); @@ -2072,13 +2072,12 @@ bool ChatHandler::HandleModifyBitCommand(const char* args)      uint16 field = atoi(pField);      uint32 bit   = atoi(pBit); -    if (field < 1 || field >= PLAYER_END) +    if (field < OBJECT_END || field >= unit->GetValuesCount())      {          SendSysMessage(LANG_BAD_VALUE);          SetSentErrorMessage(true);          return false;      } -      if (bit < 1 || bit > 32)      {          SendSysMessage(LANG_BAD_VALUE); @@ -2086,17 +2085,16 @@ bool ChatHandler::HandleModifyBitCommand(const char* args)          return false;      } -    if ( chr->HasFlag( field, (1<<(bit-1)) ) ) +    if ( unit->HasFlag( field, (1<<(bit-1)) ) )      { -        chr->RemoveFlag( field, (1<<(bit-1)) ); +        unit->RemoveFlag( field, (1<<(bit-1)) );          PSendSysMessage(LANG_REMOVE_BIT, bit, field);      }      else      { -        chr->SetFlag( field, (1<<(bit-1)) ); +        unit->SetFlag( field, (1<<(bit-1)) );          PSendSysMessage(LANG_SET_BIT, bit, field);      } -      return true;  } diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index df179143fb9..03165ff51e7 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -1695,7 +1695,7 @@ void ObjectMgr::LoadItemPrototypes()          {              if(proto->Class != dbcitem->Class)              { -                sLog.outErrorDb("Item (Entry: %u) not correct ñlass %u, must be %u (still using DB value).",i,proto->Class,dbcitem->Class); +                sLog.outErrorDb("Item (Entry: %u) not correct class %u, must be %u (still using DB value).",i,proto->Class,dbcitem->Class);                  // It safe let use Class from DB              }              /* disabled: have some strange wrong cases for Subclass values. @@ -2658,6 +2658,67 @@ void ObjectMgr::LoadPlayerInfo()              }          }      } + +    // Loading xp per level data +    { +        mPlayerXPperLevel.resize(sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL)); +        for (uint32 level = 0; level < sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL); ++level) +            mPlayerXPperLevel[level] = 0; + +        //                                                 0    1 +        QueryResult *result  = WorldDatabase.Query("SELECT lvl, xp_for_next_level FROM player_xp_for_level"); + +        uint32 count = 0; + +        if (!result) +        { +            barGoLink bar( 1 ); + +            sLog.outString(); +            sLog.outString( ">> Loaded %u xp for level definitions", count ); +            sLog.outErrorDb( "Error loading `player_xp_for_level` table or empty table."); +            exit(1); +        } + +        barGoLink bar( result->GetRowCount() ); + +        do +        { +            Field* fields = result->Fetch(); + +            uint32 current_level = fields[0].GetUInt32(); +            uint32 current_xp    = fields[1].GetUInt32(); + +            if(current_level >= sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL)) +            { +                if(current_level > STRONG_MAX_LEVEL)        // hardcoded level maximum +                    sLog.outErrorDb("Wrong (> %u) level %u in `player_xp_for_level` table, ignoring.", STRONG_MAX_LEVEL,current_level); +                else +                    sLog.outDetail("Unused (> MaxPlayerLevel in mangosd.conf) level %u in `player_xp_for_levels` table, ignoring.",current_level); +                continue; +            } +            //PlayerXPperLevel +            mPlayerXPperLevel[current_level] = current_xp; +            bar.step(); +            ++count; +        } +        while (result->NextRow()); + +        delete result; + +        sLog.outString(); +        sLog.outString( ">> Loaded %u xp for level definitions", count ); +    } + +    // fill level gaps +    for (uint32 level = 1; level < sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL); ++level) +    { +        if( mPlayerXPperLevel[level] == 0) +        { +            sLog.outErrorDb("Level %i does not have XP for level data. Using data of level [%i] + 100.",level+1, level); +            mPlayerXPperLevel[level] = mPlayerXPperLevel[level-1]+100; +        } +    }  }  void ObjectMgr::GetPlayerClassLevelInfo(uint32 class_, uint32 level, PlayerClassLevelInfo* info) const @@ -5885,6 +5946,13 @@ uint32 ObjectMgr::GetBaseXP(uint32 level)      return mBaseXPTable[level] ? mBaseXPTable[level] : 0;  } +uint32 ObjectMgr::GetXPForLevel(uint32 level) +{ +    if (level < mPlayerXPperLevel.size()) +        return mPlayerXPperLevel[level]; +    return 0; +} +  void ObjectMgr::LoadPetNames()  {      uint32 count = 0; diff --git a/src/game/ObjectMgr.h b/src/game/ObjectMgr.h index 74a63bfbe41..18b80eee523 100644 --- a/src/game/ObjectMgr.h +++ b/src/game/ObjectMgr.h @@ -598,6 +598,7 @@ class ObjectMgr          std::string GeneratePetName(uint32 entry);          uint32 GetBaseXP(uint32 level); +        uint32 GetXPForLevel(uint32 level);          int32 GetFishingBaseSkillLevel(uint32 entry) const          { @@ -903,6 +904,9 @@ class ObjectMgr          void BuildPlayerLevelInfo(uint8 race, uint8 class_, uint8 level, PlayerLevelInfo* plinfo) const;          PlayerInfo playerInfo[MAX_RACES][MAX_CLASSES]; +        typedef std::vector<uint32> PlayerXPperLevel;       // [level] +        PlayerXPperLevel mPlayerXPperLevel; +          typedef std::map<uint32,uint32> BaseXPMap;          // [area level][base xp]          BaseXPMap mBaseXPTable; diff --git a/src/game/Pet.cpp b/src/game/Pet.cpp index f02587c1e1b..834362a0d5c 100644 --- a/src/game/Pet.cpp +++ b/src/game/Pet.cpp @@ -709,7 +709,7 @@ void Pet::GivePetXP(uint32 xp)          newXP -= nextLvlXP;          SetLevel( level + 1 ); -        SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, uint32((Trinity::XP::xp_to_level(level+1))/4)); +        SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, objmgr.GetXPForLevel(level+1)/4);          level = getLevel();          nextLvlXP = GetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP); @@ -772,7 +772,7 @@ bool Pet::CreateBaseAtCreature(Creature* creature)      setPowerType(POWER_FOCUS);      SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, 0);      SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, 0); -    SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, uint32((Trinity::XP::xp_to_level(creature->getLevel()))/4)); +    SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, objmgr.GetXPForLevel(creature->getLevel())/4);      SetUInt32Value(UNIT_NPC_FLAGS, 0);      CreatureFamilyEntry const* cFamily = sCreatureFamilyStore.LookupEntry(creature->GetCreatureInfo()->family); @@ -915,7 +915,7 @@ bool Pet::InitStatsForLevel(uint32 petlevel)          }          case HUNTER_PET:          { -            SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, uint32((Trinity::XP::xp_to_level(petlevel))/4)); +            SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, objmgr.GetXPForLevel(petlevel)/4);              learnLevelupSpells();              //these formula may not be correct; however, it is designed to be close to what it should be              //this makes dps 0.5 of pets level diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 6d9cf868834..0f03e0791f4 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -2287,7 +2287,7 @@ void Player::GiveLevel(uint32 level)      GetSession()->SendPacket(&data); -    SetUInt32Value(PLAYER_NEXT_LEVEL_XP, Trinity::XP::xp_to_level(level)); +    SetUInt32Value(PLAYER_NEXT_LEVEL_XP, objmgr.GetXPForLevel(level));      //update level, max level of skills      if(getLevel()!= level) @@ -2369,7 +2369,7 @@ void Player::InitStatsForLevel(bool reapplyMods)      objmgr.GetPlayerLevelInfo(getRace(),getClass(),getLevel(),&info);      SetUInt32Value(PLAYER_FIELD_MAX_LEVEL, sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL) ); -    SetUInt32Value(PLAYER_NEXT_LEVEL_XP, Trinity::XP::xp_to_level(getLevel())); +    SetUInt32Value(PLAYER_NEXT_LEVEL_XP, objmgr.GetXPForLevel(getLevel()));      UpdateSkillsForLevel (); @@ -19790,7 +19790,7 @@ void Player::EnterVehicle(Vehicle *vehicle)      vehicle->SetCharmerGUID(GetGUID());      vehicle->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK); -    vehicle->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNKNOWN5); +    vehicle->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_24);      vehicle->setFaction(getFaction());      SetCharm(vehicle);                                      // charm @@ -19842,7 +19842,7 @@ void Player::ExitVehicle(Vehicle *vehicle)  {      vehicle->SetCharmerGUID(0);      vehicle->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK); -    vehicle->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNKNOWN5); +    vehicle->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_24);      vehicle->setFaction((GetTeam() == ALLIANCE) ? vehicle->GetCreatureInfo()->faction_A : vehicle->GetCreatureInfo()->faction_H);      SetCharm(NULL); diff --git a/src/game/Player.h b/src/game/Player.h index 6b883f3f05c..0917f0acf27 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -442,6 +442,13 @@ enum PlayerFlags      PLAYER_FLAGS_UNK17          = 0x00010000,               // pre-3.0.3 PLAYER_FLAGS_SANCTUARY flag for player entered sanctuary      PLAYER_FLAGS_UNK18          = 0x00020000,               // taxi benchmark mode (on/off) (2.0.1)      PLAYER_FLAGS_PVP_TIMER      = 0x00040000,               // 3.0.2, pvp timer active (after you disable pvp manually) +    PLAYER_FLAGS_UNK20          = 0x00080000, +    PLAYER_FLAGS_UNK21          = 0x00100000,  +    PLAYER_FLAGS_UNK22          = 0x00200000, +    PLAYER_FLAGS_UNK23          = 0x00400000, +    PLAYER_FLAGS_UNK24          = 0x00800000,               // disabled all abilitys on tab except autoattack +    PLAYER_FLAGS_UNK25          = 0x01000000,               // disabled all melee ability on tab include autoattack +  };  // used for PLAYER__FIELD_KNOWN_TITLES field (uint64), (1<<bit_index) without (-1) diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h index 34276c4810e..7cc41ae075f 100644 --- a/src/game/SharedDefines.h +++ b/src/game/SharedDefines.h @@ -260,7 +260,7 @@ enum SpellCategory  #define SPELL_ATTR_EX_NEGATIVE                    0x00000080            // 7  #define SPELL_ATTR_EX_NOT_IN_COMBAT_TARGET        0x00000100            // 8 Spell req target not to be in combat state  #define SPELL_ATTR_EX_UNK9                        0x00000200            // 9 -#define SPELL_ATTR_EX_UNK10                       0x00000400            // 10 +#define SPELL_ATTR_EX_NO_INITIAL_AGGRO            0x00000400            // 10 no generates threat on cast 100%  #define SPELL_ATTR_EX_UNK11                       0x00000800            // 11  #define SPELL_ATTR_EX_UNK12                       0x00001000            // 12  #define SPELL_ATTR_EX_UNK13                       0x00002000            // 13 @@ -311,7 +311,7 @@ enum SpellCategory  #define SPELL_ATTR_EX2_UNK25                      0x02000000            // 25  #define SPELL_ATTR_EX2_UNK26                      0x04000000            // 26 unaffected by school immunity  #define SPELL_ATTR_EX2_UNK27                      0x08000000            // 27 -#define SPELL_ATTR_EX2_UNK28                      0x10000000            // 28 +#define SPELL_ATTR_EX2_UNK28                      0x10000000            // 28 no breaks stealth if it fails??  #define SPELL_ATTR_EX2_CANT_CRIT                  0x20000000            // 29 Spell can't crit  #define SPELL_ATTR_EX2_UNK30                      0x40000000            // 30  #define SPELL_ATTR_EX2_FOOD                       0x80000000            // 31 food, well-fed, and a few others @@ -332,8 +332,8 @@ enum SpellCategory  #define SPELL_ATTR_EX3_UNK13                      0x00002000            // 13  #define SPELL_ATTR_EX3_UNK14                      0x00004000            // 14 "Honorless Target" only this spells have this flag  #define SPELL_ATTR_EX3_UNK15                      0x00008000            // 15 Auto Shoot, Shoot, Throw,  - this is autoshot flag -#define SPELL_ATTR_EX3_UNK16                      0x00010000            // 16 -#define SPELL_ATTR_EX3_NO_INITIAL_AGGRO           0x00020000            // 17 no initial aggro +#define SPELL_ATTR_EX3_UNK16                      0x00010000            // 16 no triggers effects that trigger on casting a spell?? +#define SPELL_ATTR_EX3_UNK17                      0x00020000            // 17 no triggers effects that trigger on casting a spell??  #define SPELL_ATTR_EX3_UNK18                      0x00040000            // 18  #define SPELL_ATTR_EX3_UNK19                      0x00080000            // 19  #define SPELL_ATTR_EX3_DEATH_PERSISTENT           0x00100000            // 20 Death persistent spells @@ -341,7 +341,7 @@ enum SpellCategory  #define SPELL_ATTR_EX3_REQ_WAND                   0x00400000            // 22 Req wand  #define SPELL_ATTR_EX3_UNK23                      0x00800000            // 23  #define SPELL_ATTR_EX3_REQ_OFFHAND                0x01000000            // 24 Req offhand weapon -#define SPELL_ATTR_EX3_UNK25                      0x02000000            // 25 +#define SPELL_ATTR_EX3_UNK25                      0x02000000            // 25 no cause spell pushback ?  #define SPELL_ATTR_EX3_UNK26                      0x04000000            // 26  #define SPELL_ATTR_EX3_UNK27                      0x08000000            // 27  #define SPELL_ATTR_EX3_UNK28                      0x10000000            // 28 @@ -353,7 +353,7 @@ enum SpellCategory  #define SPELL_ATTR_EX4_UNK1                       0x00000002            // 1 proc on finishing move?  #define SPELL_ATTR_EX4_UNK2                       0x00000004            // 2  #define SPELL_ATTR_EX4_UNK3                       0x00000008            // 3 -#define SPELL_ATTR_EX4_UNK4                       0x00000010            // 4 +#define SPELL_ATTR_EX4_UNK4                       0x00000010            // 4 This will no longer cause guards to attack on use??  #define SPELL_ATTR_EX4_UNK5                       0x00000020            // 5  #define SPELL_ATTR_EX4_UNK6                       0x00000040            // 6  #define SPELL_ATTR_EX4_UNK7                       0x00000080            // 7 diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 5b1e5d0a7a0..858b6038ba8 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -1014,7 +1014,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)      if( !m_caster->IsFriendlyTo(unit) && !IsPositiveSpell(m_spellInfo->Id))      { -        if( !(m_spellInfo->AttributesEx3 & SPELL_ATTR_EX3_NO_INITIAL_AGGRO) ) +        if( !(m_spellInfo->AttributesEx & SPELL_ATTR_EX_NO_INITIAL_AGGRO) )          {              m_caster->CombatStart(unit);          } @@ -1089,7 +1089,7 @@ void Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask)              // assisting case, healing and resurrection              if(unit->hasUnitState(UNIT_STAT_ATTACK_PLAYER))                  m_caster->SetContestedPvP(); -            if( unit->isInCombat() && !(m_spellInfo->AttributesEx3 & SPELL_ATTR_EX3_NO_INITIAL_AGGRO) ) +            if( unit->isInCombat() && !(m_spellInfo->AttributesEx & SPELL_ATTR_EX_NO_INITIAL_AGGRO) )              {                  m_caster->SetInCombatState(unit->GetCombatTimer() > 0);                  unit->getHostilRefManager().threatAssist(m_caster, 0.0f); diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 398e6e11d79..6ee750e6e83 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -3045,9 +3045,9 @@ void Aura::HandleModPossessPet(bool apply, bool Real)          return;      if(apply) -        pet->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNKNOWN5); +        pet->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_24);      else -        pet->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNKNOWN5); +        pet->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_24);      ((Player*)caster)->SetFarSight(apply ? pet->GetGUID() : NULL);      ((Player*)caster)->SetCharm(apply ? pet : NULL); @@ -3229,7 +3229,7 @@ void Aura::HandleFeignDeath(bool apply, bool Real)              }          }                                                              // blizz like 2.0.x -        m_target->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNKNOWN6); +        m_target->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_29);                                                              // blizz like 2.0.x          m_target->SetFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FEIGN_DEATH);                                                              // blizz like 2.0.x @@ -3254,7 +3254,7 @@ void Aura::HandleFeignDeath(bool apply, bool Real)          m_target->SendMessageToSet(&data,true);          */                                                              // blizz like 2.0.x -        m_target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNKNOWN6); +        m_target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_29);                                                              // blizz like 2.0.x          m_target->RemoveFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FEIGN_DEATH);                                                              // blizz like 2.0.x diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 43b8bdf13fb..2c249afdd24 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -3889,35 +3889,34 @@ void Spell::EffectEnchantItemPerm(uint32 i)      p_caster->UpdateCraftSkill(m_spellInfo->Id); -    if (m_spellInfo->EffectMiscValue[i]) -    { -        uint32 enchant_id = m_spellInfo->EffectMiscValue[i]; +    uint32 enchant_id = m_spellInfo->EffectMiscValue[i]; +    if (!enchant_id) +        return; -        SpellItemEnchantmentEntry const *pEnchant = sSpellItemEnchantmentStore.LookupEntry(enchant_id); -        if(!pEnchant) -            return; +    SpellItemEnchantmentEntry const *pEnchant = sSpellItemEnchantmentStore.LookupEntry(enchant_id); +    if(!pEnchant) +        return; -        // item can be in trade slot and have owner diff. from caster -        Player* item_owner = itemTarget->GetOwner(); -        if(!item_owner) -            return; +    // item can be in trade slot and have owner diff. from caster +    Player* item_owner = itemTarget->GetOwner(); +    if(!item_owner) +        return; -        if(item_owner!=p_caster && p_caster->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getConfig(CONFIG_GM_LOG_TRADE) ) -        { -            sLog.outCommand(p_caster->GetSession()->GetAccountId(),"GM %s (Account: %u) enchanting(perm): %s (Entry: %d) for player: %s (Account: %u)", -                p_caster->GetName(),p_caster->GetSession()->GetAccountId(), -                itemTarget->GetProto()->Name1,itemTarget->GetEntry(), -                item_owner->GetName(),item_owner->GetSession()->GetAccountId()); -        } +    if(item_owner!=p_caster && p_caster->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getConfig(CONFIG_GM_LOG_TRADE) ) +    { +        sLog.outCommand(p_caster->GetSession()->GetAccountId(),"GM %s (Account: %u) enchanting(perm): %s (Entry: %d) for player: %s (Account: %u)", +            p_caster->GetName(),p_caster->GetSession()->GetAccountId(), +            itemTarget->GetProto()->Name1,itemTarget->GetEntry(), +            item_owner->GetName(),item_owner->GetSession()->GetAccountId()); +    } -        // remove old enchanting before applying new if equipped -        item_owner->ApplyEnchantment(itemTarget,PERM_ENCHANTMENT_SLOT,false); +    // remove old enchanting before applying new if equipped +    item_owner->ApplyEnchantment(itemTarget,PERM_ENCHANTMENT_SLOT,false); -        itemTarget->SetEnchantment(PERM_ENCHANTMENT_SLOT, enchant_id, 0, 0); +    itemTarget->SetEnchantment(PERM_ENCHANTMENT_SLOT, enchant_id, 0, 0); -        // add new enchanting if equipped -        item_owner->ApplyEnchantment(itemTarget,PERM_ENCHANTMENT_SLOT,true); -    } +    // add new enchanting if equipped +    item_owner->ApplyEnchantment(itemTarget,PERM_ENCHANTMENT_SLOT,true);  }  void Spell::EffectEnchantItemTmp(uint32 i) diff --git a/src/game/Unit.h b/src/game/Unit.h index 65ebaa51a83..725c76cf243 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -468,23 +468,23 @@ enum UnitVisibility  // Value masks for UNIT_FIELD_FLAGS  enum UnitFlags  { -    UNIT_FLAG_UNKNOWN7         = 0x00000001, +    UNIT_FLAG_UNK_0            = 0x00000001,      UNIT_FLAG_NON_ATTACKABLE   = 0x00000002,                // not attackable      UNIT_FLAG_DISABLE_MOVE     = 0x00000004,      UNIT_FLAG_PVP_ATTACKABLE   = 0x00000008,                // allow apply pvp rules to attackable state in addition to faction dependent state      UNIT_FLAG_RENAME           = 0x00000010,      UNIT_FLAG_PREPARATION      = 0x00000020,                // don't take reagents for spells with SPELL_ATTR_EX5_NO_REAGENT_WHILE_PREP -    UNIT_FLAG_UNKNOWN9         = 0x00000040, +    UNIT_FLAG_UNK_6            = 0x00000040,      UNIT_FLAG_NOT_ATTACKABLE_1 = 0x00000080,                // ?? (UNIT_FLAG_PVP_ATTACKABLE | UNIT_FLAG_NOT_ATTACKABLE_1) is NON_PVP_ATTACKABLE      UNIT_FLAG_NOT_ATTACKABLE_2 = 0x00000100,                // 2.0.8 -    UNIT_FLAG_UNKNOWN11        = 0x00000200,                // 3.0.3 - makes you unable to attack everything +    UNIT_FLAG_UNK_9            = 0x00000200,                // 3.0.3 - makes you unable to attack everything      UNIT_FLAG_LOOTING          = 0x00000400,                // loot animation      UNIT_FLAG_PET_IN_COMBAT    = 0x00000800,                // in combat?, 2.0.8      UNIT_FLAG_PVP              = 0x00001000,                // changed in 3.0.3      UNIT_FLAG_SILENCED         = 0x00002000,                // silenced, 2.1.1 -    UNIT_FLAG_UNKNOWN4         = 0x00004000,                // 2.0.8 -    UNIT_FLAG_UNKNOWN13        = 0x00008000, -    UNIT_FLAG_UNKNOWN14        = 0x00010000, +    UNIT_FLAG_UNK_14           = 0x00004000,                // 2.0.8 +    UNIT_FLAG_UNK_15           = 0x00008000, +    UNIT_FLAG_UNK_16           = 0x00010000,      UNIT_FLAG_PACIFIED         = 0x00020000,                // 3.0.3 ok      UNIT_FLAG_STUNNED          = 0x00040000,                // 3.0.3 ok      UNIT_FLAG_IN_COMBAT        = 0x00080000, @@ -492,19 +492,21 @@ enum UnitFlags      UNIT_FLAG_DISARMED         = 0x00200000,                // 3.0.3, disable melee spells casting..., "Required melee weapon" added to melee spells tooltip.      UNIT_FLAG_CONFUSED         = 0x00400000,      UNIT_FLAG_FLEEING          = 0x00800000, -    UNIT_FLAG_UNKNOWN5         = 0x01000000,                // used in spell Eyes of the Beast for pet... +    UNIT_FLAG_UNK_24           = 0x01000000,                // used in spell Eyes of the Beast for pet...      UNIT_FLAG_NOT_SELECTABLE   = 0x02000000,      UNIT_FLAG_SKINNABLE        = 0x04000000,      UNIT_FLAG_MOUNT            = 0x08000000, -    UNIT_FLAG_UNKNOWN17        = 0x10000000, -    UNIT_FLAG_UNKNOWN6         = 0x20000000,                // used in Feing Death spell -    UNIT_FLAG_SHEATHE          = 0x40000000 +    UNIT_FLAG_UNK_28           = 0x10000000, +    UNIT_FLAG_UNK_29           = 0x20000000,                // used in Feing Death spell +    UNIT_FLAG_SHEATHE          = 0x40000000, +    UNIT_FLAG_UNK_31           = 0x80000000  };  // Value masks for UNIT_FIELD_FLAGS_2  enum UnitFlags2  {      UNIT_FLAG2_FEIGN_DEATH      = 0x00000001, +    UNIT_FLAG2_UNK1             = 0x00000002,               // Hide unit model (show only player equip)      UNIT_FLAG2_COMPREHEND_LANG  = 0x00000008,      UNIT_FLAG2_FORCE_MOVE       = 0x00000040,      UNIT_FLAG2_REGENERATE_POWER = 0x00000800 diff --git a/src/game/World.cpp b/src/game/World.cpp index 3d230a3edbe..8861005e55c 100644 --- a/src/game/World.cpp +++ b/src/game/World.cpp @@ -456,7 +456,6 @@ void World::LoadConfigSettings(bool reload)      rate_values[RATE_XP_KILL]     = sConfig.GetFloatDefault("Rate.XP.Kill", 1.0f);      rate_values[RATE_XP_QUEST]    = sConfig.GetFloatDefault("Rate.XP.Quest", 1.0f);      rate_values[RATE_XP_EXPLORE]  = sConfig.GetFloatDefault("Rate.XP.Explore", 1.0f); -    rate_values[RATE_XP_PAST_70]  = sConfig.GetFloatDefault("Rate.XP.PastLevel70", 1.0f);      rate_values[RATE_REPUTATION_GAIN]  = sConfig.GetFloatDefault("Rate.Reputation.Gain", 1.0f);      rate_values[RATE_CREATURE_NORMAL_DAMAGE]          = sConfig.GetFloatDefault("Rate.Creature.Normal.Damage", 1.0f);      rate_values[RATE_CREATURE_ELITE_ELITE_DAMAGE]     = sConfig.GetFloatDefault("Rate.Creature.Elite.Elite.Damage", 1.0f); diff --git a/src/game/World.h b/src/game/World.h index 786982a81e7..76fd396d5b6 100644 --- a/src/game/World.h +++ b/src/game/World.h @@ -236,7 +236,6 @@ enum Rates      RATE_XP_KILL,      RATE_XP_QUEST,      RATE_XP_EXPLORE, -    RATE_XP_PAST_70,      RATE_REPUTATION_GAIN,      RATE_CREATURE_NORMAL_HP,      RATE_CREATURE_ELITE_ELITE_HP, diff --git a/src/mangosd/mangosd.conf.dist.in b/src/mangosd/mangosd.conf.dist.in index ed6f63946a9..e58d5d68f25 100644 --- a/src/mangosd/mangosd.conf.dist.in +++ b/src/mangosd/mangosd.conf.dist.in @@ -994,10 +994,6 @@ Visibility.Distance.Grey.Object = 10  #        XP rates  #        Default: 1  # -#    Rate.XP.PastLevel70 -#        XP needed per level past 70 (Rates below 1 not recommended) -#        Default: 1 -#  #    Rate.Rest.InGame  #    Rate.Rest.Offline.InTavernOrCity  #    Rate.Rest.Offline.InWilderness @@ -1107,7 +1103,6 @@ Rate.Drop.Money = 1  Rate.XP.Kill    = 1  Rate.XP.Quest   = 1  Rate.XP.Explore = 1 -Rate.XP.PastLevel70 = 1  Rate.Rest.InGame = 1  Rate.Rest.Offline.InTavernOrCity = 1  Rate.Rest.Offline.InWilderness = 1 diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 22fa8177058..d159296e986 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@  #ifndef __REVISION_NR_H__  #define __REVISION_NR_H__ - #define REVISION_NR "7090" + #define REVISION_NR "7092"  #endif // __REVISION_NR_H__  | 
