Yardım Mapa Girdimi mapın girip cıktımı statü sıfırlamak

  • Konuyu açan Konuyu açan hancı21
  • Açılış Tarihi Açılış Tarihi
  • Yanıt Yanıt 0
  • Gösterim Gösterim 76
Konu sahibi bu konuda soru soruyor. Sorusu ile ilgili bilgisi olanların yanıtlamasını bekliyor.

hancı21

Üye
Üye
Mesaj
227
Çözümler
2
Beğeni
22
Puan
79
Ticaret Puanı
0
arkadaşlar mesela mapa ihtiyacı olan statü 20 birdefa mapa 20 statü ile girdimi bidaha tüm maplarda statü gereksinimi karşılamış gibi yapıyor har mapa girişp cıktıgında mapın ihtiyacı olan gereksinimi döngüye almam lazım
Kod:
Genişlet Daralt Kopyala
#ifdef ENABLE_CONQUEROR_LEVEL
            if (GetMapIndex() == 187)
            {
                if (GetPoint(POINT_SUNGMA_MOVE) < 20)
                {
                    SetPoint(type, 100);
                    val = GetPoint(type);
                    break;
                }
            }
#endif

system

cmd_general.cpp:
Genişlet Daralt Kopyala
#ifdef ENABLE_CONQUEROR_LEVEL
ACMD(do_conqueror_stat)
{
    char arg1[256];
    one_argument(argument, arg1, sizeof(arg1));

    if (!*arg1)
        return;

    if (ch->IsPolymorphed())
    {
        ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("?? ??? ??? ?? ? ????."));
        return;
    }

    if (ch->GetPoint(POINT_CONQUEROR_POINT) <= 0)
        return;

    BYTE idx = 0;

    if (!strcmp(arg1, "smh_str"))
        idx = POINT_SUNGMA_STR;
    else if (!strcmp(arg1, "smh_hp"))
        idx = POINT_SUNGMA_HP;
    else if (!strcmp(arg1, "smh_move"))
        idx = POINT_SUNGMA_MOVE;
    else if (!strcmp(arg1, "smh_inmune"))
        idx = POINT_SUNGMA_INMUNE;
    else
    {
        ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Error!"));
        return;
    }

    if (ch->GetRealPoint(idx) >= 30)
        return;

    ch->SetRealPoint(idx, ch->GetRealPoint(idx) + 1);
    ch->SetPoint(idx, ch->GetPoint(idx) + 1);
    ch->ComputePoints();
    ch->PointChange(idx, 0);

    if (idx == POINT_SUNGMA_HP)
    {
        ch->PointChange(POINT_MAX_HP, 0);
    }

    ch->PointChange(POINT_CONQUEROR_POINT, -1);
    ch->ComputePoints();
}
#endif

char.cpp:
Genişlet Daralt Kopyala
#ifdef ENABLE_CONQUEROR_LEVEL
bool CHARACTER::IsConquerorMap(int iMapIndex)
{
    if (iMapIndex == EASTPLAIN_01)
        return true;
    else if(iMapIndex == EASTPLAIN_02)
        return true;
    else if(iMapIndex == EASTPLAIN_03)
        return true;
    else if(iMapIndex == EMPIRECASTLE)
        return true;
    else if(iMapIndex == EASTPLAIN_04)
        return true;
    else if(iMapIndex == EASTPLAIN_05)
        return true;
    else if(iMapIndex == EASTPLAIN_06)
        return true;
    else if(iMapIndex == EASTPLAIN_07)
        return true;
    else if(iMapIndex == EASTPLAIN_08)
        return true;
    else if(iMapIndex == EASTPLAIN_09)
        return true;

    return false;
}

char.cpp:
Genişlet Daralt Kopyala
    case POINT_HIT_SP_RECOVERY:
        case POINT_MANASHIELD:
        case POINT_ATT_BONUS:
        {
#ifdef ENABLE_CONQUEROR_LEVEL
{
    struct SungmaImmuneRequirement
    {
        int mapIndex;
        int minImmune;
    };

    static const SungmaImmuneRequirement immuneRequirements[] =
    {
        {190,  1},
        {189, 20},
        {188, 20},
        {135, 55},
        {134, 20},
        {133, 20},
        {136, 20},
        {137, 20},
        {138, 20},
    };

    int currentMap = GetMapIndex();

    for (const auto& req : immuneRequirements)
    {
        if (currentMap == req.mapIndex && GetPoint(POINT_SUNGMA_INMUNE) < req.minImmune)
        {
            SetPoint(type, 100);
            val = GetPoint(type);
            break; // ilk e?le?mede cık
        }
    }
}
#endif



            SetPoint(type, GetPoint(type) + amount);
            val = GetPoint(type);
        }
        break;
        case POINT_SKILL_DAMAGE_BONUS:
        case POINT_NORMAL_HIT_DAMAGE_BONUS:
        case POINT_SKILL_DEFEND_BONUS:
        case POINT_NORMAL_HIT_DEFEND_BONUS:
            SetPoint(type, GetPoint(type) + amount);
            val = GetPoint(type);
            break;

#ifdef ENABLE_ANTI_RESIST_MAGIC_BONUS
        case POINT_ANTI_RESIST_MAGIC:
            if (GetRaceNum() == 2 or GetRaceNum() == 6)
                amount = amount / 2;
            
            SetPoint(type, GetPoint(type) + amount);
            val = GetPoint(type);
            break;
#endif

#ifdef ENABLE_ELEMENT_NEW_BONUSES
        case POINT_ENCHANT_DARK:
        case POINT_ENCHANT_EARTH:
        case POINT_ENCHANT_ELECT:
        case POINT_ENCHANT_FIRE:
        case POINT_ENCHANT_ICE:
        case POINT_ENCHANT_WIND:
#endif

#ifdef ENABLE_PENDANT
        case POINT_ATTBONUS_SWORD:
        case POINT_ATTBONUS_TWOHAND:
        case POINT_ATTBONUS_DAGGER:
        case POINT_ATTBONUS_BELL:
        case POINT_ATTBONUS_FAN:
        case POINT_ATTBONUS_BOW:
        case POINT_ATTBONUS_CLAW:
        case POINT_RESIST_HUMAN:
        case POINT_ATTBONUS_BOCEK:
        case POINT_ATTBONUS_COL:
        case POINT_ATTBONUS_CZ:
        case POINT_RESIST_DUSUS:
#endif

#ifdef ENABLE_HIDRA_STONE
        case POINT_ATTBONUS_HIDRA:
        case POINT_ATTBONUS_METIN:
#endif

#ifdef ENABLE_GLOVE_SYSTEM
        case POINT_RANDOM:
#endif

        case POINT_PARTY_ATTACKER_BONUS:
        case POINT_PARTY_TANKER_BONUS:
        case POINT_PARTY_BUFFER_BONUS:
        case POINT_PARTY_SKILL_MASTER_BONUS:
        case POINT_PARTY_HASTE_BONUS:
        case POINT_PARTY_DEFENDER_BONUS:
        case POINT_RESIST_WARRIOR:
        case POINT_RESIST_ASSASSIN:
        case POINT_RESIST_SURA:
        case POINT_RESIST_SHAMAN:
        case POINT_RESIST_WOLFMAN:
            SetPoint(type, GetPoint(type) + amount);
            val = GetPoint(type);
            break;

        case POINT_MALL_ATTBONUS:
        case POINT_MALL_DEFBONUS:
        case POINT_MALL_EXPBONUS:
        case POINT_MALL_ITEMBONUS:
        case POINT_MALL_GOLDBONUS:
        case POINT_MELEE_MAGIC_ATT_BONUS_PER:
            if (GetPoint(type) + amount > 1000)
            {
                sys_err("MALL_BONUS exceeded over 1000!! point type: %d name: %s amount %d", type, GetName(), amount);
                amount = 1000 - GetPoint(type);
            }
            SetPoint(type, GetPoint(type) + amount);
            val = GetPoint(type);
            break;

        case POINT_PC_BANG_EXP_BONUS :
        case POINT_PC_BANG_DROP_BONUS :
        case POINT_RAMADAN_CANDY_BONUS_EXP:
            SetPoint(type, amount);
            val = GetPoint(type);
            break;

        case POINT_EXP_DOUBLE_BONUS:
        case POINT_GOLD_DOUBLE_BONUS:
        case POINT_ITEM_DROP_BONUS:
        case POINT_POTION_BONUS:
            if (GetPoint(type) + amount > 1000)
            {
                sys_err("BONUS exceeded over 1000!! point type: %d name: %s amount %d", type, GetName(), amount);
                amount = 1000 - GetPoint(type);
            }

            SetPoint(type, GetPoint(type) + amount);
            val = GetPoint(type);
            break;

        case POINT_IMMUNE_STUN:
            SetPoint(type, GetPoint(type) + amount);
            val = GetPoint(type);
            if (val)
            {
                SET_BIT(m_pointsInstant.dwImmuneFlag, IMMUNE_STUN);
            }
            else
            {
                REMOVE_BIT(m_pointsInstant.dwImmuneFlag, IMMUNE_STUN);
            }
            break;

        case POINT_IMMUNE_SLOW:
            SetPoint(type, GetPoint(type) + amount);
            val = GetPoint(type);
            if (val)
            {
                SET_BIT(m_pointsInstant.dwImmuneFlag, IMMUNE_SLOW);
            }
            else
            {
                REMOVE_BIT(m_pointsInstant.dwImmuneFlag, IMMUNE_SLOW);
            }
            break;

        case POINT_IMMUNE_FALL:
            SetPoint(type, GetPoint(type) + amount);
            val = GetPoint(type);
            if (val)
            {
                SET_BIT(m_pointsInstant.dwImmuneFlag, IMMUNE_FALL);
            }
            else
            {
                REMOVE_BIT(m_pointsInstant.dwImmuneFlag, IMMUNE_FALL);
            }
            break;

        case POINT_ATT_GRADE_BONUS:
            SetPoint(type, GetPoint(type) + amount);
            PointChange(POINT_ATT_GRADE, amount);
            val = GetPoint(type);
            break;

        case POINT_DEF_GRADE_BONUS:
            SetPoint(type, GetPoint(type) + amount);
            PointChange(POINT_DEF_GRADE, amount);
            val = GetPoint(type);
            break;

        case POINT_MAGIC_ATT_GRADE_BONUS:
            SetPoint(type, GetPoint(type) + amount);
            PointChange(POINT_MAGIC_ATT_GRADE, amount);
            val = GetPoint(type);
            break;

        case POINT_MAGIC_DEF_GRADE_BONUS:
            SetPoint(type, GetPoint(type) + amount);
            PointChange(POINT_MAGIC_DEF_GRADE, amount);
            val = GetPoint(type);
            break;

        case POINT_VOICE:
        case POINT_EMPIRE_POINT:
            val = GetRealPoint(type);
            break;

        case POINT_POLYMORPH:
            SetPoint(type, GetPoint(type) + amount);
            val = GetPoint(type);
            SetPolymorph(val);
            break;

        case POINT_MOUNT:
            SetPoint(type, GetPoint(type) + amount);
            val = GetPoint(type);
            MountVnum(val);
            break;

        case POINT_ENERGY:
        case POINT_COSTUME_ATTR_BONUS:
            {
                int old_val = GetPoint(type);
                SetPoint(type, old_val + amount);
                val = GetPoint(type);
                BuffOnAttr_ValueChange(type, old_val, val);
            }
            break;
#ifdef ENABLE_CONQUEROR_LEVEL
        case POINT_CONQUEROR_LEVEL:
            if ((GetConquerorLevel() + amount) > gPlayerConquerorMaxLevel)
                return;

            SetConquerorLevel(GetConquerorLevel() + amount);
            val = GetConquerorLevel();

            sys_log(0, "CONQUEROR_LEVELUP: %s %d NEXT EXP %d", GetName(), GetConquerorLevel(), GetConquerorNextExp());
#ifdef ENABLE_WOLFMAN_CHARACTER
            if (GetJob() == JOB_WOLFMAN)
            {
                if ((5 <= val) && (GetSkillGroup()!=1))
                {
                    ClearSkill();
                    SetSkillGroup(1);
                    SetRealPoint(POINT_SKILL, GetLevel()-1);
                    SetPoint(POINT_SKILL, GetRealPoint(POINT_SKILL));
                    PointChange(POINT_SKILL, 0);
                }
            }
#endif
            PointChange(POINT_CONQUEROR_NEXT_EXP,    GetConquerorNextExp(), false);
            break;
        case POINT_CONQUEROR_NEXT_EXP:
            val = GetConquerorNextExp();
            bAmount = false;
            break;

        case POINT_CONQUEROR_EXP:
            {
                DWORD exp = GetConquerorExp();
                DWORD next_exp = GetConquerorNextExp();

#ifdef ENABLE_POINT_EXP_FIX
                if ((amount < 0) && (exp <= std::abs(amount)))
#else
                if ((amount < 0) && (exp < (DWORD)(-amount)))
#endif
                {
                    sys_log(1, "%s AMOUNT < 0 %d, CUR CONQUEROR EXP: %d", GetName(), -amount, exp);
                    amount = -exp;

                    SetConquerorExp(exp + amount);
                    val = GetExp();
                }
                else
                {
                    if (gPlayerConquerorMaxLevel <= GetConquerorLevel())
                        return;

                    if (test_server)
                        ChatPacket(CHAT_TYPE_INFO, "You have gained %d conqueror exp.", amount);

                    DWORD iExpBalance = 0;

                    // ?? ?!
                    if (exp + amount >= next_exp)
                    {
                        iExpBalance = (exp + amount) - next_exp;
                        amount = next_exp - exp;

                        SetConquerorExp(0);
                        exp = next_exp;
                    }
                    else
                    {
                        SetConquerorExp(exp + amount);
                        exp = GetConquerorExp();
                    }

                    DWORD q = DWORD(next_exp / 4.0f);
                    int iLevStep = GetRealPoint(POINT_CONQUEROR_LEVEL_STEP);

                    // iLevStep? 4 ???? ??? ???? ??? ??? ? ? ?? ???.
                    if (iLevStep >= 4)
                    {
                        sys_err("%s CONQUEROR_LEVEL_STEP bigger than 4! (%d)", GetName(), iLevStep);
                        iLevStep = 4;
                    }

                    if (exp >= next_exp && iLevStep < 4)
                    {
                        for (int i = 0; i < 4 - iLevStep; ++i)
                            PointChange(POINT_CONQUEROR_LEVEL_STEP, 1, false, true);
                    }
                    else if (exp >= q * 3 && iLevStep < 3)
                    {
                        for (int i = 0; i < 3 - iLevStep; ++i)
                            PointChange(POINT_CONQUEROR_LEVEL_STEP, 1, false, true);
                    }
                    else if (exp >= q * 2 && iLevStep < 2)
                    {
                        for (int i = 0; i < 2 - iLevStep; ++i)
                            PointChange(POINT_CONQUEROR_LEVEL_STEP, 1, false, true);
                    }
                    else if (exp >= q && iLevStep < 1)
                        PointChange(POINT_CONQUEROR_LEVEL_STEP, 1);

                    if (iExpBalance)
                    {
                        PointChange(POINT_CONQUEROR_EXP, iExpBalance);
                    }

                    val = GetConquerorExp();
                }
            }
            break;
        case POINT_CONQUEROR_LEVEL_STEP:

            if (amount > 0)
            {
                val = GetPoint(POINT_CONQUEROR_LEVEL_STEP) + amount;
                switch (val)
                {
                    case 1:
                    case 2:
                    case 3:
                        {
                            if ((GetConquerorLevel() <= g_iStatusPointGetLevelLimit) && (GetConquerorLevel() <= gPlayerConquerorMaxLevel) )
                                PointChange(POINT_CONQUEROR_POINT, 1);
                        }
                        break;
                    case 4:
                        {
                            PointChange(POINT_CONQUEROR_LEVEL, 1, false, true);
                            val = 0;
                        }
                        break;

                }

                SetPoint(POINT_CONQUEROR_LEVEL_STEP, val);
                SetRealPoint(POINT_CONQUEROR_LEVEL_STEP, val);

                Save();
            }
            else
                val = GetPoint(POINT_CONQUEROR_LEVEL_STEP);

            break;

        case POINT_SUNGMA_STR:
        case POINT_SUNGMA_HP:
#ifdef ENABLE_CONQUEROR_LEVEL
{
    struct SungmaRequirement
    {
        int mapIndex;
        int minHp;
    };

    static const SungmaRequirement requirements[] =
    {
        {187, 15},
        {190, 20},
        {189, 25},
        {188, 30},
        {135, 40},
        {134, 45},
        {136, 50},
        {137, 55},
        {138, 60},
    };

    int currentMap = GetMapIndex();

    // Daha once bu haritada kontrol yapılmamı?sa
    if (!HasCheckedMap(currentMap))
    {
        for (const auto& req : requirements)
        {
            if (currentMap == req.mapIndex && GetPoint(POINT_SUNGMA_HP) < req.minHp)
            {
                SetPoint(type, 100);
                val = GetPoint(type);
                break;
            }
        }
        AddCheckedMap(currentMap); // i?aretle
    }
}
#endif

        case POINT_SUNGMA_MOVE:

#ifdef ENABLE_CONQUEROR_LEVEL
{
    struct SungmaMoveRequirement
    {
        int mapIndex;
        int minMove;
    };

    static const SungmaMoveRequirement moveRequirements[] =
    {
        {190,  1},
        {189, 20},
        {188, 20},
        {187, 20},
        {135, 20},
        {134, 20},
        {133, 20},
        {136, 20},
        {137, 20},
        {138, 20},
    };

    int currentMap = GetMapIndex();

    for (const auto& req : moveRequirements)
    {
        if (currentMap == req.mapIndex && GetPoint(POINT_SUNGMA_MOVE) < req.minMove)
        {
            SetPoint(type, 100);
            val = GetPoint(type);
            break; // e?le?me bulundu?unda donguden cık
        }
    }
}
#endif



        case POINT_SUNGMA_INMUNE:

            SetPoint(type, GetPoint(type) + amount);
            val = GetPoint(type);
            break;
        case POINT_CONQUEROR_POINT:
            SetPoint(type, GetPoint(type) + amount);
            val = GetPoint(type);

            SetRealPoint(type, val);
            break;
#endif
#ifdef ENABLE_CONQUEROR_LEVEL
        case POINT_INVINCIBLE:
            SetPoint(type, amount);
            val = GetPoint(type);
            break;
#endif
 
Son düzenleme:
Geri
Üst