RevScript Dawnport Limitations: Level, Vocation Reward, Gold, Bank

Alex

Miembro del equipo
Webdesigner
LV
58
 
Awards
38
Hola a todos,

Para los que quieran sobrepasar el limite en Dawnport del Dinero , el nivel y el reward chest para cada vocation,( nivel 20 y dinero 1500 en banco y 500 en el personaje como maximo ) también el Npc que te quita el oro,
Podran aqui ver como cambiarlo,

El primero que haremos es ir en data/scripts/creaturescripts/others el fichero dawnport_max_level.lua , podreis modificar como sigue:

Código:
local dawnportMaxLevel = CreatureEvent("DawnportMaxLevel")

function dawnportMaxLevel.onAdvance(creature, target)
    local player = creature:getPlayer()
    if not player then
        return true
    end

    local town = player:getTown()
    if player:getLevel() == 20 and town and town:getId() == TOWNS_LIST.DAWNPORT then --- 20 , es el nivel Maximo, le poneis 1000 si quereis
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE,
            "You have reached the limit level and have to choose your vocation and leave Dawnport.")
        -- Adds the event that teleports the player to the temple in five minutes after reaching level 20
        addEvent(teleportToDawnportTemple, 5 * 60 * 1000, player:getId())
    end
    return true
end

dawnportMaxLevel:register()

Para cambiar los items rewards de los cofres el script esta en data/scripts/actions/quests el fichero se llama vocation_reward
Vereis muchas ID y las vocaciones, podran modificar los items y la quantidad

Código:
local UniqueTable = {
    -- Dawnport vocation rewards
    -- Sorcerer
    [14025] = {
        itemBag = 1988,
        itemReward = {{2643, 1}, {2175, 1}, {2190, 1}, {8819, 1}, {8820, 1}, {2649, 1}},
        itemRewardContainer = {{7620, 5}, {18559, 1}},
        storage = Storage.Quest.Dawnport.VocationReward,
        value = 1
    },
    -- Druid
    [14026] = {
        itemBag = 1988,
        itemReward = {{2643, 1}, {2175, 1}, {2182, 1}, {8819, 1}, {8820, 1}, {2649, 1}},
        itemRewardContainer = {{7620, 5}, {18559, 1}},
        storage = Storage.Quest.Dawnport.VocationReward,
        value = 2
    },
    -- Paladin
    [14027] = {
        itemBag = 1988,
        itemReward = {{2643, 1}, {2389, 1}, {2660, 1}, {8923, 1}, {2461, 1}},
        itemRewardContainer = {{2544, 100}, {18559, 1}},
        storage = Storage.Quest.Dawnport.VocationReward,
        value = 3
    },
    -- Knight
    [14028] = {
        itemBag = 1988,
        itemReward = {{2643, 1}, {2509, 1}, {8602, 1}, {2465, 1}, {2460, 1}, {2478, 1}},
        itemRewardContainer = {{7618, 5}, {18559, 1}},
        storage = Storage.Quest.Dawnport.VocationReward,
        value = 4
    }
}

local vocationReward = Action()

function vocationReward.onUse(player, item, fromPosition, itemEx, toPosition)
    local setting = UniqueTable[item.uid]
    if not setting then
        return true
    end

    if player:getStorageValue(setting.storage) >= 0 then
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The ".. getItemName(1740) .. " is empty.")
        return true
    end

    for i = 1, #setting.itemReward do
        local itemid = setting.itemReward[i][1]
        local count = setting.itemReward[i][2]
        for c = 1, count do
            player:addItem(itemid, 1)
        end
    end
    local container = player:addItem(setting.itemBag)
    for v = 1, #setting.itemRewardContainer do
        local itemid = setting.itemRewardContainer[v][1]
        local count = setting.itemRewardContainer[v][2]
        if ItemType(itemid):isStackable() or ItemType(itemid):getCharges() then
            container:addItem(itemid, count)
        else
            for c = 1, count do
                container:addItem(itemid, 1)
            end
        end
    end
    player:setStorageValue(setting.storage, setting.value)
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found a " .. getItemName(setting.itemBag) .. ".")
    return true
end

for index, value in pairs(UniqueTable) do
    vocationReward:uid(index)
end

vocationReward:register()

Update v12.64

El NPC Que quita el dinero ahora és Captain Dreadnought.

Por lo tanto entrareis en data/npc/scripts captain dreadnought, buscar dentro de captain_dreadnought estas lineas y modificar el numero 500 ( 3 veces en total ) por el numero deseado maximo de dinero que traer desde dawnport:

Código:
elseif (parameters.confirm == true) then
        if player:getMoney() > 500 then
            player:removeMoney((player:getMoney() - 500))
            npcHandler:say(
                "Well, that's really generous of you. That'll feed a lot of hungry mouths for a while. \z
                Right, now which {city} did you say you wanted to go to?",
                cid
            )
            npcHandler:resetNpc(cid)
        else
            npcHandler:say("Well, har har. Very funny. Come on, pick up the gold you just dropped.", cid)
        end
    elseif (parameters.decline == true) then
        if player:getMoney() > 500 then
            npcHandler:say(
                "By tempest! What's all this gold weighing us down? Don't you think that's a little risky with all \z
                these pirates around? You can take 500 with you, but that's it. Drop the rest or {donate} it to the \z
                Adventurers' Orphans Fund, really.",
                cid
            )
        end

En el NPC Oressa, encontrareis lo siguiente, Allowed ID significa lo que esta permitido de traer desde Dawnport hacia el continente en este caso, incluiremos el Crystal coin y el platinum coin ID

Código:
local container = player:getSlotItem(CONST_SLOT_BACKPACK)
            local allowedIds = {
                    2050, 2051, 2052, 2053,
                    2054, 2055, 2056, 2120,
                    2148, 2420, 2480, 2553,
                    2554, 2580, 5710, 8722,
                    8723, 2152, 2160
                }
            local toBeDeleted = {}
            if container and container:getSize() > 0 then
                for i = 0, container:getSize() do
                    if player:getMoney() > 500000000 then
                        player:removeMoney(math.abs(500 - player:getMoney()))
                    end
                    local item = container:getItem(i)
                    if item then
                        if not table.contains(allowedIds, item:getId()) then
                            toBeDeleted[#toBeDeleted + 1] = item.uid
                        end
                    end
                end
                if #toBeDeleted > 0 then
                    for i, v in pairs(toBeDeleted) do
                        local item = Item(v)
                        if item then
                            item:remove()
                        end
                    end
                end
            end

Ahora iremos por el Banco, para augmentar el limite del banco, iremos al NPC wentworth.lua linea 121 hasta linea 131 y le cambiareis el numero 1000 ( por lo que querais algo alto y el segundo 1000 por el mismo numero )
En la parte mas abajo vereis 2000, igual le subiis el numero muy muy alto y en el segundo 2000 también.

Código:
if count[cid] > 1000 or player:getBankBalance() >= 1000 then
                    npcHandler:say("Sorry, but you can't deposit that much.", cid)
                    npcHandler.topic[cid] = 0
                    return false
                end
            elseif player:getLevel() > 9 then
                if count[cid] > 2000 or player:getBankBalance() >= 2000 then
                    npcHandler:say("Sorry, but you can't deposit that much.", cid)
                    npcHandler.topic[cid] = 0
                    return false
                end

Al NPC plunderpurse.lua , en la linea 119 hasta 123 hay este codigo, el numero 1500 le pondreis por ejemplo 150000000000 , en el segundo 1500 de la misma linea el mismo numero tambien.

Código:
if msgcontains(msg, "yes") then
            if count[cid] > 1500 or player:getBankBalance() >= 1500 then
                npcHandler:say("Sorry, but you can't deposit that much.", cid)
                npcHandler.topic[cid] = 0
                return false

Con esto, que no altera nada al juego, podreis depositar lo que querais al banco, salir de dawnport con el dinero que habeis ganado o quedarse en dawnport hasta el nivel 1000.
 
Arriba