Jump to content
Sign in to follow this  
Graf

Улучшающие свитки

Recommended Posts

Улучшающие свитки

Взято с архива.

В общем можно сделать свитки любых характеристик, но я приведу 5 примеров(атака, защита, физическое сопротивление, шанс уклонения, шанс попадания).

Для начала заходим в Server/resource/iteminfo.txt и вставляем наши свитки:

8601    Свиток атаки    n1481    10130005    0    0    0    0    0    0    0    0    0    0    0    0    1    1    1    1    99    0    500000    -1,-2,-2,-2    0    -1,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2    0    0    -1,-2,-2,-2,-2,-2,-2,-2,-2,-2    -1,-2,-2,-2,-2,-2,-2,-2,-2,-2    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0    0,0    0,0    0    0    0    0    0    0    0    0    0    Item_Use_Pendowo    0    0    0    0,0    0    0    Поместите вещь в первый слот инвентаря и два раза нажмите на свиток.    0
8602    Свиток защиты    n1481    10130005    0    0    0    0    0    0    0    0    0    0    0    0    1    1    1    1    99    0    500000    -1,-2,-2,-2    0    -1,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2    0    0    -1,-2,-2,-2,-2,-2,-2,-2,-2,-2    -1,-2,-2,-2,-2,-2,-2,-2,-2,-2    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0    0,0    0,0    0    0    0    0    0    0    0    0    0    Item_Use_Pendowo    0    0    0    0,0    0    0    Поместите вещь в первый слот инвентаря и два раза нажмите на свиток.    0
8603    Свиток физического сопротивления    n1481    10130005    0    0    0    0    0    0    0    0    0    0    0    0    1    1    1    1    99    0    500000    -1,-2,-2,-2    0    -1,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2    0    0    -1,-2,-2,-2,-2,-2,-2,-2,-2,-2    -1,-2,-2,-2,-2,-2,-2,-2,-2,-2    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0    0,0    0,0    0    0    0    0    0    0    0    0    0    Item_Use_Pendowo    0    0    0    0,0    0    0    Поместите вещь в первый слот инвентаря и два раза нажмите на свиток.    0
8604    Свиток шана уклонения    n1481    10130005    0    0    0    0    0    0    0    0    0    0    0    0    1    1    1    1    99    0    500000    -1,-2,-2,-2    0    -1,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2    0    0    -1,-2,-2,-2,-2,-2,-2,-2,-2,-2    -1,-2,-2,-2,-2,-2,-2,-2,-2,-2    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0    0,0    0,0    0    0    0    0    0    0    0    0    0    Item_Use_Pendowo    0    0    0    0,0    0    0    Поместите вещь в первый слот инвентаря и два раза нажмите на свиток.    0
8605    Свиток шанса попадания    n1481    10130005    0    0    0    0    0    0    0    0    0    0    0    0    1    1    1    1    99    0    500000    -1,-2,-2,-2    0    -1,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2    0    0    -1,-2,-2,-2,-2,-2,-2,-2,-2,-2    -1,-2,-2,-2,-2,-2,-2,-2,-2,-2    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0,0    0    0,0    0,0    0    0    0    0    0    0    0    0    0    Item_Use_Pendowo    0    0    0    0,0    0    0    Поместите вещь в первый слот инвентаря и два раза нажмите на свиток.    0

Далее пропишем функции для наших свитков. Открываем Server/resource/calculate/itemeffect.lua и вставялем:

function Item_Use_Pendowo(role,Item)

    local Cha_Boat = 0
    Cha_Boat = GetCtrlBoat ( role )
    if Cha_Boat ~=  nil then
        SystemNotice( role , "Нельзя использовать в море! " )
        UseItemFailed ( role )
        return
    end

        local Equipment        = GetChaItem(role, 2, 0)
        local EquipmentName    = GetItemName(GetItemID(Equipment))
        local EquipmentType    = GetItemType2(GetItemID(Equipment))
    	local Item_ID        = GetItemID(Item)

        if(Equipment == nil)then
              SystemNotice(role,"Поместите предмет в первую ячейку инвентаря. ")
        UseItemFailed ( role )
        return
        end


    if Item_ID == 8601 then -- id свитка атааки
            if(EquipmentType == 1 or EquipmentType == 2 or EquipmentType == 3 or EquipmentType == 4 or EquipmentType == 7 or EquipmentType == 9)then

                local ItemAttrI    = GetItemAttr(Equipment, ITEMATTR_VAL_MNATK)
                local ItemAttrII = GetItemAttr(Equipment, ITEMATTR_VAL_MXATK)
            local Bonus    = 200
                local FinalAttrI = ItemAttrI + Bonus
                local FinalAttrII= ItemAttrII + Bonus
            local Limit    = 32000    --Лимит улучшения (Максимум 32767)

            if (ItemAttrI >= Limit or ItemAttrII >= Limit) then
                    SystemNotice(role,"Предмет достиг своего лимита! ")
                UseItemFailed ( role )
                return
            end

            if (FinalAttrI >= Limit or FinalAttrII >= Limit) then
                    SetItemAttr(Equipment, ITEMATTR_VAL_MNATK, Limit)
                    SetItemAttr(Equipment, ITEMATTR_VAL_MXATK, Limit)
            else
                    SetItemAttr(Equipment, ITEMATTR_VAL_MNATK, FinalAttrI)
                    SetItemAttr(Equipment, ITEMATTR_VAL_MXATK, FinalAttrII)
            end

                SystemNotice(role,"Успешное улучшени +"..Bonus.." атаки к "..EquipmentName.."!")
                RefreshCha(role)
            else

                SystemNotice(role,"Свиток атаки можно использовать только на оружии! ")
            UseItemFailed ( role )
            return
            end

    elseif Item_ID == 8602 then --id свитка защиты
            if(EquipmentType == 20 or EquipmentType == 22 or EquipmentType == 23 or EquipmentType == 24 or EquipmentType == 27)then

                local ItemAttr    = GetItemAttr(Equipment, ITEMATTR_VAL_DEF)
            local Bonus    = 50
                local FinalAttr = ItemAttr + Bonus
            local Limit    = 5000

            if (ItemAttr >= Limit) then
                    SystemNotice(role,"Предмет достиг своего лимита! ")
                UseItemFailed ( role )
                return
            end

            if (FinalAttr >= Limit) then
                    SetItemAttr(Equipment, ITEMATTR_VAL_DEF, Limit)
            else
                    SetItemAttr(Equipment, ITEMATTR_VAL_DEF, FinalAttr)
            end

                SystemNotice(role,"Успешное улучшение +"..Bonus.." защиты в "..EquipmentName.."!")
                RefreshCha(role)
            else
		
                SystemNotice(role,"Свиток защиты можно использовать только в броне, ботинках, перчатках и шапке! ")
            UseItemFailed ( role )
            return
            end

    elseif Item_ID == 8603 then --id свитка физического сопротивления
            if(EquipmentType == 22 or EquipmentType == 27)then

                local ItemAttr    = GetItemAttr(Equipment, ITEMATTR_VAL_PDEF)
            local Bonus    = 5
                local FinalAttr = ItemAttr + Bonus
            local Limit    = 1000

            if (ItemAttr >= Limit) then
                    SystemNotice(role,"Предмет достиг своего лимита! ")
                UseItemFailed ( role )
                return
            end

            if (FinalAttr >= Limit) then
                    SetItemAttr(Equipment, ITEMATTR_VAL_PDEF, Limit)
            else
                    SetItemAttr(Equipment, ITEMATTR_VAL_PDEF, FinalAttr)
            end

                SystemNotice(role,"Успешное улучшение +"..Bonus.." физического сопротивления в "..EquipmentName.."!")
                RefreshCha(role)
            else

                SystemNotice(role,"Свиток физического сопротивления можно использовать только на броне и тату! ")
            UseItemFailed ( role )
            return
            end

    elseif Item_ID == 8604 then --id свитка шанса уклонения
            if(EquipmentType == 24 )then

                local ItemAttr    = GetItemAttr(Equipment, ITEMATTR_VAL_FLEE)
            local Bonus    = 5
                local FinalAttr = ItemAttr + Bonus
            local Limit    = 2000

            if (ItemAttr >= Limit) then
                    SystemNotice(role,"Предмет достиг своего лимита! ")
                UseItemFailed ( role )
                return
            end

            if (FinalAttr >= Limit) then
                    SetItemAttr(Equipment, ITEMATTR_VAL_FLEE, Limit)
            else
                    SetItemAttr(Equipment, ITEMATTR_VAL_FLEE, FinalAttr)
            end

                SystemNotice(role,"Успешное улучшение +"..Bonus.." шанса уклонения в "..EquipmentName.."!")
                RefreshCha(role)
            else

                SystemNotice(role,"Свиток уклонения можно использовать только на ботинках! ")
            UseItemFailed ( role )
            return
            end

    elseif Item_ID == 8605 then --Свиток шанса попадания
            if(EquipmentType == 23 )then

                local ItemAttr    = GetItemAttr(Equipment, ITEMATTR_VAL_HIT)
            local Bonus    = 5
                local FinalAttr = ItemAttr + Bonus
            local Limit    = 2000

            if (ItemAttr >= Limit) then
                    SystemNotice(role,"Предмет достиг своего лимита! ")
                UseItemFailed ( role )
                return
            end

            if (FinalAttr >= Limit) then
                    SetItemAttr(Equipment, ITEMATTR_VAL_HIT, Limit)
            else
                    SetItemAttr(Equipment, ITEMATTR_VAL_HIT, FinalAttr)
            end

                SystemNotice(role,"Успешное улучшение +"..Bonus.." шанса попадания в "..EquipmentName.."!")
                RefreshCha(role)
            else

                SystemNotice(role,"Свиток шанса попадания можно использовать только на перчатках! ")
            UseItemFailed ( role )
            return
            end
    end
end

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...