魔兽私服 经验交流 发布家族 高手进阶心得 软件下载 魔兽私服技术文章 家族联盟 广告合作

给单独种族多增加天赋

if(GetTeam()== 0)
    SetUInt32Value(PLAYER_CHARACTER_POINTS1,GetUInt32Value(PLAYER_CHARACTER_POINTS1)+5)

如果想要新建人物后就多给,那么就可以尝试在下面的问题加入(适合哪些上线 超过 10级的服务器)

bool Player::Create(WorldPacket& data )
{
        uint8 race,class_,gender,skin,face,hairStyle,hairColor,facialHair,outfitId;

        // unpack data into member variables
        data >> m_name;
       
        // correct capitalization
        CapitalizeString(m_name);

        data >> race >> class_ >> gender >> skin >> face;
        data >> hairStyle >> hairColor >> facialHair >> outfitId;

        info = objmgr.GetPlayerCreateInfo(race, class_);
        if(!info)
        {
                // info not found... disconnect
                sCheatLog.writefromsession(m_session, "tried to create invalid player with race %u and class %u", race, class_);
                m_session->Disconnect();
                return false;
        }

        // check that the account CAN create T*C characters, if we're making some
        if(race >= RACE_*LOODELF && !m_session->HasFlag(ACCOUNT_FLAG_XPACK_01))
        {
                sCheatLog.writefromsession(m_session, "tried to create player with race %u and class %u but no expansion flags", race, class_);
                m_session->Disconnect();
                return false;
        }

        m_mapId = info->mapId;
        m_zoneId = info->zoneId;
        m_position.ChangeCoords(info->positionX, info->positionY, info->positionZ);
        m_bind_pos_x = info->positionX;
        m_bind_pos_y = info->positionY;
        m_bind_pos_z = info->positionZ;
        m_bind_mapid = info->mapId;
        m_bind_zoneid = info->zoneId;
        m_isResting = 0;
        m_restAmount = 0;
        m_restState = 0;

        memset(m_taximask, 0, sizeof(uint32)*8);
       
        // set race dbc
        myRace = sCharRaceStore.LookupEntry(race);
        myClass = sCharClassStore.LookupEntry(class_);
        if(!myRace || !myClass)
        {
                // information not found
                sCheatLog.writefromsession(m_session, "tried to create invalid player with race %u and class %u, dbc info not found", race, class_);
                m_session->Disconnect();
                return false;
        }

        if(myRace->team_id == 7)
                m_team = 0;
        else
                m_team = 1;

        sLog.outString("Account %s creating a %s %s %s", m_session->GetAccountName().c_str(), gender ? "Female" : "Male",
                sCharRaceStore.LookupString(myRace->name2), sCharClassStore.LookupString(myClass->name));

        uint8 powertype = myClass->power_type;

        // Automatically add the race's taxi hub to the character's taximask at creation time ( 1 << (taxi_node_id-1) )
        memset(m_taximask,0,sizeof(m_taximask));
        switch(race)
        {
        case RACE_TAUREN:                m_taximask[0]= 1 << (22-1); break;
        case RACE_HUMAN:                m_taximask[0]= 1 << ( 2-1); break;
        case RACE_DWARF:                m_taximask[0]= 1 << ( 6-1); break;
        case RACE_GNOME:                m_taximask[0]= 1 << ( 6-1); break;
        case RACE_ORC:                  m_taximask[0]= 1 << (23-1); break;
        case RACE_TROLL:                m_taximask[0]= 1 << (23-1); break;
        case RACE_UNDEAD:                m_taximask[0]= 1 << (11-1); break;
        case RACE_NIGHTELF:          m_taximask[0]= 1 << (27-1); break;
        case RACE_*LOODELF:                m_taximask[2]= 1 << (18-1); break;
        case RACE_DRAENEI:                m_taximask[2]= 1 << (30-1); break;
        }

        // Set Starting stats for char
        SetFloatValue(O*JECT_FIELD_SCALE_X, ((race==RACE_TAUREN)?1.3f:1.0f));
        SetUInt32Value(UNIT_FIELD_HEALTH, info->health);
        SetUInt32Value(UNIT_FIELD_POWER1, info->mana );
        //SetUInt32Value(UNIT_FIELD_POWER2, 0 ); // this gets devided by 10
        SetUInt32Value(UNIT_FIELD_POWER3, info->focus );
        SetUInt32Value(UNIT_FIELD_POWER4, info->energy );
 
        SetUInt32Value(UNIT_FIELD_MAXHEALTH, info->health);
        SetUInt32Value(UNIT_FIELD_MAXPOWER1, info->mana );
        SetUInt32Value(UNIT_FIELD_MAXPOWER2, info->rage );
        SetUInt32Value(UNIT_FIELD_MAXPOWER3, info->focus );
        SetUInt32Value(UNIT_FIELD_MAXPOWER4, info->energy );
       
        //THIS IS NEEDED
        SetUInt32Value(UNIT_FIELD_*ASE_HEALTH, info->health);
        SetUInt32Value(UNIT_FIELD_*ASE_MANA, info->mana );
        SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, info->factiontemplate );

+        SetUInt32Value(UNIT_FIELD_LEVEL, sWorld.InitialPlyaerLevel );
+        if(GetUInt32Value(UNIT_FIELD_LEVEL) > 9 && GetTeam()== 0)  // 如果给部落的 就是 GetTeam()== 1
+                SetUInt32Value(PLAYER_CHARACTER_POINTS1,GetUInt32Value(PLAYER_CHARACTER_POINTS1)+5);
如果人物新建是 1级的话,可以使用下面的通过洗天赋实现

void Player::Reset_Talents()
{
        unsigned int numRows = sTalentStore.GetNumRows();
        for (unsigned int i = 0; i < numRows; i++)                  // Loop through all talents.
        {
                TalentEntry *tmpTalent = sTalentStore.LookupEntry(i);
                if(!tmpTalent)
                        continue; //should not ocur
                //this is a normal talent (i hope )
                for (int j = 0; j < 5; j++)
                {
                        if (tmpTalent->RankID[j] != 0)
                        {
                                m_SSSPecificSpells.erase(tmpTalent->RankID[j]);
                                SpellEntry *spellInfo;
                                spellInfo = sSpellStore.LookupEntry( tmpTalent->RankID[j] );
                                if(spellInfo)
                                {
                                        for(int k=0;k<3;k++)
                                                if(spellInfo->Effect[k] == SPELL_EFFECT_LEARN_SPELL)
                                                {
                                                        removeSpell(spellInfo->EffectTriggerSpell[k], false, 0, 0);
                                                        //remove higher ranks of this spell too (like earth shield lvl 1 is talent and the rest is thought from trainer)
                                                        SpellEntry *spellInfo2;
                                                        spellInfo2 = sSpellStore.LookupEntry( spellInfo->EffectTriggerSpell[k] );
                                                        if(spellInfo2)
                                                                removeSpell*yHashName(spellInfo2->NameHash);
                                                }
                                        //remove them all in 1 shot
                                        removeSpell*yHashName(spellInfo->NameHash);
                                }
                        }
                        else
                                break;
                }
        }
        uint32 l=getLevel();
        if(l>9)
        {
+              if(GetTeam()== 0)
+                SetUInt32Value(PLAYER_CHARACTER_POINTS1, (l - 9)+5);
+              else
                  SetUInt32Value(PLAYER_CHARACTER_POINTS1, l - 9);

        }
        else
        {
                SetUInt32Value(PLAYER_CHARACTER_POINTS1, 0);
        }

}

注意:增加天赋只有在新建或者重置天赋的地方加入,否则会无限给玩家增加,以上写的没有测试哦如果有错误希望自己修改吧

上一篇魔兽私服文章:上一篇: 根据目前在线阵营差别太大的阵营注册P
下一篇魔兽私服文章:下一篇: 关于解决卡马问题的说明
魔兽世界私服 魔兽世界下载 wow魔兽私服
五二我的wow魔兽私服网 www.52mysf.com 提供最新开魔兽世界私服发布 版权所有