Show
Ignore:
Timestamp:
11/19/08 13:22:12 (17 years ago)
Author:
yumileroy
Message:

[svn] * Added ACE for Linux and Windows (Thanks Derex for Linux part and partial Windows part)
* Updated to 6721 and 676
* Fixed TrinityScript? logo
* Version updated to 0.2.6721.676

Original author: Neo2003
Date: 2008-10-04 06:17:19-05:00

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/game/Player.cpp

    r2 r6  
    357357    m_ArmorProficiency = 0; 
    358358    m_canParry = false; 
     359    m_canBlock = false; 
    359360    m_canDualWield = false; 
    360361    m_ammoDPS = 0.0f; 
     
    617618            ++action_itr[i]; 
    618619    } 
    619  
    620     UpdateBlockPercentage(); 
    621620 
    622621    for (PlayerCreateInfoItems::const_iterator item_id_itr = info->item.begin(); item_id_itr!=info->item.end(); ++item_id_itr++) 
     
    22492248        SetFloatValue(PLAYER_SPELL_CRIT_PERCENTAGE1+i, 0.0f); 
    22502249 
    2251     // Base parry percents 
    2252     SetFloatValue(PLAYER_PARRY_PERCENTAGE, 5.0f); 
    2253  
    2254     //Base block percentage 
    2255     SetFloatValue(PLAYER_BLOCK_PERCENTAGE, 5.0f); 
    2256  
     2250    SetFloatValue(PLAYER_PARRY_PERCENTAGE, 0.0f); 
     2251    SetFloatValue(PLAYER_BLOCK_PERCENTAGE, 0.0f); 
    22572252    SetUInt32Value(PLAYER_SHIELD_BLOCK, 0); 
    22582253 
     
    32873282        updateVisualBits.SetBit(i); 
    32883283 
    3289     for(uint16 i = 0; i < INVENTORY_SLOT_BAG_END; i++) 
    3290     { 
    3291         updateVisualBits.SetBit((uint16)(PLAYER_FIELD_INV_SLOT_HEAD + i*2)); 
    3292         updateVisualBits.SetBit((uint16)(PLAYER_FIELD_INV_SLOT_HEAD + (i*2) + 1)); 
    3293     } 
    32943284    //Players visible items are not inventory stuff 
    32953285    //431) = 884 (0x374) = main weapon 
     
    34063396 
    34073397    // known spell 
    3408     if(HasSpell(trainer_spell->spell->Id)) 
     3398    if(HasSpell(trainer_spell->spell)) 
    34093399        return TRAINER_SPELL_GRAY; 
    34103400 
    34113401    // check race/class requirement 
    3412     if(!IsSpellFitByClassAndRace(trainer_spell->spell->Id)) 
     3402    if(!IsSpellFitByClassAndRace(trainer_spell->spell)) 
    34133403        return TRAINER_SPELL_RED; 
    34143404 
    34153405    // check level requirement 
    3416     if(getLevel() < ( trainer_spell->reqlevel ? trainer_spell->reqlevel : trainer_spell->spell->spellLevel)) 
     3406    if(getLevel() < trainer_spell->reqlevel) 
    34173407        return TRAINER_SPELL_RED; 
    34183408 
    3419     if(SpellChainNode const* spell_chain = spellmgr.GetSpellChainNode(trainer_spell->spell->Id)) 
     3409    if(SpellChainNode const* spell_chain = spellmgr.GetSpellChainNode(trainer_spell->spell)) 
    34203410    { 
    34213411        // check prev.rank requirement 
     
    34323422        return TRAINER_SPELL_RED; 
    34333423 
     3424    // exist, already checked at loading 
     3425    SpellEntry const* spell = sSpellStore.LookupEntry(trainer_spell->spell); 
     3426 
    34343427    // secondary prof. or not prof. spell 
    3435     uint32 skill = trainer_spell->spell->EffectMiscValue[1]; 
    3436  
    3437     if(trainer_spell->spell->Effect[1] != SPELL_EFFECT_SKILL || !IsPrimaryProfessionSkill(skill)) 
     3428    uint32 skill = spell->EffectMiscValue[1]; 
     3429 
     3430    if(spell->Effect[1] != SPELL_EFFECT_SKILL || !IsPrimaryProfessionSkill(skill)) 
    34383431        return TRAINER_SPELL_GREEN; 
    34393432 
    34403433    // check primary prof. limit 
    3441     if(spellmgr.IsPrimaryProfessionFirstRankSpell(trainer_spell->spell->Id) && GetFreePrimaryProffesionPoints() == 0) 
     3434    if(spellmgr.IsPrimaryProfessionFirstRankSpell(spell->Id) && GetFreePrimaryProffesionPoints() == 0) 
    34423435        return TRAINER_SPELL_RED; 
    34433436 
     
    48774870 
    48784871        if(pskill == SKILL_DEFENSE) 
    4879         { 
    4880             UpdateBlockPercentage(); 
    4881         } 
     4872            UpdateDefenseBonusesMod(); 
    48824873    } 
    48834874} 
     
    57915782        FactionEntry const *factionEntry1 = sFactionStore.LookupEntry(Rep->repfaction1); 
    57925783        uint32 current_reputation_rank1 = GetReputationRank(factionEntry1); 
    5793         if(factionEntry1 && current_reputation_rank1 <= Rep->reputration_max_cap1) 
     5784        if(factionEntry1 && current_reputation_rank1 <= Rep->reputation_max_cap1) 
    57945785            ModifyFactionReputation(factionEntry1, donerep1); 
    57955786 
     
    58095800        FactionEntry const *factionEntry2 = sFactionStore.LookupEntry(Rep->repfaction2); 
    58105801        uint32 current_reputation_rank2 = GetReputationRank(factionEntry2); 
    5811         if(factionEntry2 && current_reputation_rank2 <= Rep->reputration_max_cap2) 
     5802        if(factionEntry2 && current_reputation_rank2 <= Rep->reputation_max_cap2) 
    58125803            ModifyFactionReputation(factionEntry2, donerep2); 
    58135804 
     
    1155311544    } 
    1155411545 
    11555     QuestMenu *qm = PlayerTalkClass->GetQuestMenu(); 
    11556     qm->ClearMenu(); 
     11546    QuestMenu &qm = PlayerTalkClass->GetQuestMenu(); 
     11547    qm.ClearMenu(); 
    1155711548 
    1155811549    for(QuestRelations::const_iterator i = pObjectQIR->lower_bound(pObject->GetEntry()); i != pObjectQIR->upper_bound(pObject->GetEntry()); ++i) 
     
    1156111552        QuestStatus status = GetQuestStatus( quest_id ); 
    1156211553        if ( status == QUEST_STATUS_COMPLETE && !GetQuestRewardStatus( quest_id ) ) 
    11563             qm->AddMenuItem(quest_id, DIALOG_STATUS_REWARD_REP); 
     11554            qm.AddMenuItem(quest_id, DIALOG_STATUS_REWARD_REP); 
    1156411555        else if ( status == QUEST_STATUS_INCOMPLETE ) 
    11565             qm->AddMenuItem(quest_id, DIALOG_STATUS_INCOMPLETE); 
     11556            qm.AddMenuItem(quest_id, DIALOG_STATUS_INCOMPLETE); 
    1156611557        else if (status == QUEST_STATUS_AVAILABLE ) 
    11567             qm->AddMenuItem(quest_id, DIALOG_STATUS_CHAT); 
     11558            qm.AddMenuItem(quest_id, DIALOG_STATUS_CHAT); 
    1156811559    } 
    1156911560 
     
    1157711568 
    1157811569        if (pQuest->IsAutoComplete() && CanTakeQuest(pQuest, false)) 
    11579             qm->AddMenuItem(quest_id, DIALOG_STATUS_REWARD_REP); 
     11570            qm.AddMenuItem(quest_id, DIALOG_STATUS_REWARD_REP); 
    1158011571        else if ( status == QUEST_STATUS_NONE && CanTakeQuest( pQuest, false ) ) 
    11581             qm->AddMenuItem(quest_id, DIALOG_STATUS_AVAILABLE); 
     11572            qm.AddMenuItem(quest_id, DIALOG_STATUS_AVAILABLE); 
    1158211573    } 
    1158311574} 
     
    1158511576void Player::SendPreparedQuest( uint64 guid ) 
    1158611577{ 
    11587     QuestMenu* pQuestMenu = PlayerTalkClass->GetQuestMenu(); 
    11588     if( !pQuestMenu || pQuestMenu->MenuItemCount() < 1 ) 
     11578    QuestMenu& questMenu = PlayerTalkClass->GetQuestMenu(); 
     11579    if( questMenu.Empty() ) 
    1158911580        return; 
    1159011581 
    11591     uint32 status = pQuestMenu->GetItem(0).m_qIcon; 
    11592     if ( pQuestMenu->MenuItemCount() == 1 ) 
     11582    QuestMenuItem const& qmi0 = questMenu.GetItem( 0 ); 
     11583 
     11584    uint32 status = qmi0.m_qIcon; 
     11585 
     11586    // single element case 
     11587    if ( questMenu.MenuItemCount() == 1 ) 
    1159311588    { 
    1159411589        // Auto open -- maybe also should verify there is no greeting 
    11595         uint32 quest_id = pQuestMenu->GetItem(0).m_qId; 
     11590        uint32 quest_id = qmi0.m_qId; 
    1159611591        Quest const* pQuest = objmgr.GetQuestTemplate(quest_id); 
    1159711592        if ( pQuest ) 
     
    1160811603        } 
    1160911604    } 
     11605    // multiply entries 
    1161011606    else 
    1161111607    { 
     
    1377213768                break; 
    1377313769        } 
    13774     } 
    13775  
    13776     //Unmount Player from previous mount, so speed bug with mount is no more... 
    13777     if(IsMounted()) 
    13778     { 
    13779         Unmount(); 
    13780         RemoveSpellsCausingAura(SPELL_AURA_MOUNTED); 
    1378113770    } 
    1378213771 
     
    1562715616void Player::BuildPlayerChat(WorldPacket *data, uint8 msgtype, std::string text, uint32 language) const 
    1562815617{ 
    15629     bool pre = (msgtype==CHAT_MSG_EMOTE); 
    15630  
    1563115618    *data << (uint8)msgtype; 
    1563215619    *data << (uint32)language; 
     
    1563415621    *data << (uint32)language;                               //language 2.1.0 ? 
    1563515622    *data << (uint64)GetGUID(); 
    15636     *data << (uint32)(text.length()+1+(pre?3:0)); 
    15637     if(pre) 
    15638         data->append("%s ",3); 
     15623    *data << (uint32)(text.length()+1); 
    1563915624    *data << text; 
    1564015625    *data << (uint8)chatTag(); 
     
    1715217137    data << (float)0.01666667f;                             // game speed 
    1715317138    GetSession()->SendPacket( &data ); 
     17139 
     17140    // set fly flag if in fly form or taxi flight to prevent visually drop at ground in showup moment 
     17141    if(HasAuraType(SPELL_AURA_MOD_INCREASE_FLIGHT_SPEED) || isInFlight()) 
     17142        SetUnitMovementFlags(GetUnitMovementFlags() | MOVEMENTFLAG_FLYING2); 
    1715417143} 
    1715517144 
     
    1716317152    static const AuraType auratypes[] = 
    1716417153    { 
    17165         SPELL_AURA_MOD_FEAR,     SPELL_AURA_TRANSFORM, SPELL_AURA_WATER_WALK, 
    17166         SPELL_AURA_FEATHER_FALL, SPELL_AURA_HOVER,     SPELL_AURA_SAFE_FALL, 
    17167         SPELL_AURA_FLY,          SPELL_AURA_NONE 
     17154        SPELL_AURA_MOD_FEAR,     SPELL_AURA_TRANSFORM,                 SPELL_AURA_WATER_WALK, 
     17155        SPELL_AURA_FEATHER_FALL, SPELL_AURA_HOVER,                     SPELL_AURA_SAFE_FALL, 
     17156        SPELL_AURA_FLY,          SPELL_AURA_MOD_INCREASE_FLIGHT_SPEED, SPELL_AURA_NONE 
    1716817157    }; 
    1716917158    for(AuraType const* itr = &auratypes[0]; itr && itr[0] != SPELL_AURA_NONE; ++itr) 
     
    1811718106} 
    1811818107 
    18119 bool ItemPosCount::isContainedIn(ItemPosCountVec &vec) 
     18108void Player::SetCanParry( bool value ) 
     18109{ 
     18110    if(m_canParry==value) 
     18111        return;  
     18112 
     18113    m_canParry = value; 
     18114    UpdateParryPercentage(); 
     18115} 
     18116 
     18117void Player::SetCanBlock( bool value ) 
     18118{ 
     18119    if(m_canBlock==value) 
     18120        return;  
     18121 
     18122    m_canBlock = value; 
     18123    UpdateBlockPercentage(); 
     18124} 
     18125 
     18126bool ItemPosCount::isContainedIn(ItemPosCountVec const& vec) const 
    1812018127{ 
    1812118128    for(ItemPosCountVec::const_iterator itr = vec.begin(); itr != vec.end();++itr) 
    18122     { 
    18123         if(itr->pos == this->pos/* && itr->count == this.count*/) 
    18124         { 
     18129        if(itr->pos == this->pos) 
    1812518130            return true; 
    18126         } 
    18127     } 
     18131 
    1812818132    return false; 
    1812918133} 
    18130