Skocz do zawartości
  • 👋 Witaj na MPCForum!

    Przeglądasz forum jako gość, co oznacza, że wiele świetnych funkcji jest jeszcze przed Tobą! 😎

    • Pełny dostęp do działów i ukrytych treści
    • Możliwość pisania i odpowiadania w tematach
    • System prywatnych wiadomości
    • Zbieranie reputacji i rozwijanie swojego profilu
    • Członkostwo w jednej z największych społeczności graczy

    👉 Dołączenie zajmie Ci mniej niż minutę – a zyskasz znacznie więcej!

    Zarejestruj się teraz

[Szukam] Skyptu . .


Pejos94

Rekomendowane odpowiedzi

Opublikowano

Witam poszukaje skyptu na npc , o nazwie Tyrung , ktory by dawal misje ( co 12,24h) na zabijanie XX potworów a za wykonanie misji dawal by expa XX

 

ale losowo

 

do tego komenda ktora by pokazywala obojetnie jak ile juz zabitych lub ile pozsostalo do zabicia mobow

 

np . !misja Tyrung

 

moje gg 221057

 

jesli taka potrzeba zaplace :>

 

dzieki z gory

Opublikowano

czyli chcesz taki system task jak na np. DBV ?

System taskow:

NPC:

local tasks =
{
    [1] = {questStarted = 1510, questStorage = 65000, killsRequired = 100, raceName = "Wolfs", rewards = {{enable = true, type = "exp", values = 5000}, {enable = true, type = "money", values = 2000}}},
     [2] = {questStarted = 1511, questStorage = 65001, killsRequired = 300, raceName = "Commandos", rewards = {{enable = true, type = "exp", values = 10000}, {enable = true, type = "money", values = 10000}}},
     [3] = {questStarted = 1512, questStorage = 65002, killsRequired = 50, raceName = "Pandorians", rewards = {{enable = true, type = "exp", values = 7000}, {enable = true, type = "money", values = 3000}}},
     [4] = {questStarted = 1513, questStorage = 65003, killsRequired = 500, raceName = "Triceratops", rewards = {{enable = true, type = "exp", values = 20000}, {enable = true, type = "money", values = 15000}}},
     [5] = {questStarted = 1514, questStorage = 65004, killsRequired = 750, raceName = "Nameks", rewards = {{enable = true, type = "exp", values = 150000}, {enable = true, type = "money", values = 50000}}},
     [5] = {questStarted = 1515, questStorage = 65005, killsRequired = 1000, raceName = "Deaths", rewards = {{enable = true, type = "exp", values = 300000}, {enable = true, type = "money", values = 100000}}},



}
 
local rankStorage = 32150
local choose = {}
 
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
 
function onCreatureAppear(cid)                          npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid)                       npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg)                  npcHandler:onCreatureSay(cid, type, msg) end
function onThink()                                      npcHandler:onThink() end
 
function getTasksStarted(cid)
    local tmp = {}
    for k, v in pairs(tasks) do
        if getCreatureStorage(cid, v.questStarted) == 1 then
            table.insert(tmp, k)
        end
    end
    return tmp
end
 
function getTaskByName(name)
    for k, v in pairs(tasks) do
        if v.raceName:lower() == name:lower() then
            return k
        end
    end
    return false
end
 
function creatureSayCallback(cid, type, msg)
 
    if(not npcHandler:isFocused(cid)) then
        return false
    end
    local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_PRIVATE and 0 or cid
    if isInArray({"task", "tasks"}, msg:lower()) then
        selfSay("There you can see the following tasks, please tell me the number of the task that you want to do.", cid)
        local text = ""
        for i = 1, table.maxn(tasks) do
            text = text .. (text == "" and "" or "\n") .. i .. "  -  " .. tasks[i].raceName .. (getCreatureStorage(cid, tasks[i].questStarted) == 1 and " [...]" or getCreatureStorage(cid, tasks[i].questStarted) == 2 and " [x]" or "")
        end
        return doShowTextDialog(cid, 5956, text)
 
    elseif getTaskByName(msg) or tasks[tonumber(msg)] then
        msg = (getTaskByName(msg) or tonumber(msg))
        if getCreatureStorage(cid, tasks[msg].questStarted) == 1 then
            selfSay("You already started this task.", cid)
            talkState[talkUser] = 0
            return true
        end

local storage = 65000

        if getCreatureStorage(cid, tasks[msg].questStarted) == 2 or getCreatureStorage(cid, storage) <= msg then
            selfSay("You already finished this task.", cid)
            talkState[talkUser] = 0
            can = false
        end
        if tasks[msg].level and getPlayerLevel(cid) < tasks[msg].level then
            selfSay("You need level " .. tasks[msg].level .. " or higher to make this task.", cid)
            talkState[talkUser] = 0
            return true
        end
        selfSay("Are you sure that do you want to start the task number " .. msg .. "? In this task you will need to defeat " .. tasks[msg].killsRequired .. " " .. tasks[msg].raceName .. ".", cid)
        choose[cid] = msg
        talkState[talkUser] = 1
    elseif msgcontains(msg, "yes") and talkState[talkUser] == 1 then
        doCreatureSetStorage(cid, tasks[choose[cid]].questStarted, 1)
        selfSay("You have started the task number " .. choose[cid] .. ", remember... in this task you will need to defeat " .. tasks[choose[cid]].killsRequired .. " " .. tasks[choose[cid]].raceName .. ". Good luck!", cid)
        talkState[talkUser] = 0
        return true
 
    elseif msg:lower() == "report" then
        local t = getTasksStarted(cid)
        local response = "You are currently making " .. (#t > 1 and "these" or "this") .. " task" .. (#t > 1 and "s" or "") .. ":\n"
        if table.maxn(t) > 0 then
            for _, tsk in ipairs(t) do
                if getCreatureStorage(cid, tasks[tsk].questStorage) < 0 then doCreatureSetStorage(cid, tasks[tsk].questStorage, 0) end
                response = response .. "     Name: " .. tasks[tsk].raceName .. "     Kills: " .. getCreatureStorage(cid, tasks[tsk].questStorage) .. " - " .. tasks[tsk].killsRequired .. ".\n"
            end
            response = response .. "Please say report and the name of the task that do you want to report, example: 'Report Trolls'."
            return selfSay(response, cid)
        else
            return selfSay("You need to start at least one task first.", cid)
        end
    elseif string.sub(msg:lower(), 0, 6) == "report" then
        local t = getTaskByName(string.sub(msg, 8, string.len(msg)))
        if not t then
            return selfSay("That task does not exists.", cid)
        end
 
        if getCreatureStorage(cid, tasks[t].questStarted) == 2 then
            return selfSay("You already finished this task.", cid)
        end
 
        if getCreatureStorage(cid, tasks[t].questStarted) < 1 then
            return selfSay("You don't have started this task.", cid)
        end
 
        if tasks[t].killsRequired > getCreatureStorage(cid, tasks[t].questStorage) then
            return selfSay("Current " .. getCreatureStorage(cid, tasks[t].questStorage) .. " " .. tasks[t].raceName .. " killed, you need to kill " .. tasks[t].killsRequired .. ".", cid)
        end
 
        for i = 1, table.maxn(tasks[t].rewards) do
            if(tasks[t].rewards[i].enable) then
                if isInArray({"boss", "teleport", 1}, tasks[t].rewards[i].type) then
                    doTeleportThing(cid, tasks[t].rewards[i].values)
                elseif isInArray({"exp", "experience", 2}, tasks[t].rewards[i].type) then
                    doPlayerAddExperience(cid, tasks[t].rewards[i].values)
                elseif isInArray({"item", 3}, tasks[t].rewards[i].type) then
                    doPlayerAddItem(cid, v.rewards[i].values[1], tasks[t].rewards[i].values[2])
                elseif isInArray({"money", 4}, tasks[t].rewards[i].type) then
                    doPlayerAddMoney(cid, tasks[t].rewards[i].values)
                elseif isInArray({"storage", "stor", 5}, tasks[t].rewards[i].type) then
                    doCreatureSetStorage(cid, tasks[t].rewards[i].values[1], tasks[t].rewards[i].values[2])
                elseif isInArray({"points", "rank", 2}, tasks[t].rewards[i].type) then
                    doCreatureSetStorage(cid, rankStorage, getCreatureStorage(cid, rankStorage) + tasks[t].rewards[i].values)
                else
                    print("[Warning - Npc::KillingInTheNameOf] Wrong reward type: " .. (tasks[t].rewards[i].type or "nil") .. ", reward could not be loaded.")
                end
            end
        end
        local rank = getCreatureStorage(cid, rankStorage)
        selfSay("Great!... you have finished the task number " .. t .. "" .. (rank > 4 and ", you are a " or "") .. "" .. (((rank > 4 and rank < 10) and ("Huntsman") or (rank > 9 and rank < 20) and ("Ranger") or (rank > 19 and rank < 30) and ("Big Game Hunter") or (rank > 29 and rank < 50) and ("Trophy Hunter") or (rank > 49) and ("Elite Hunter")) or "") .. ". Good job.", cid)
        return doCreatureSetStorage(cid, tasks[t].questStarted, 2)
    end
    return true
end
 
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

Creaturescripts:

local questCreatures =
{
    ["wolf"] = {questStarted = 1510, questStorage = 65000, creatureStorage = 15000, killsRequired = 100, raceName = "Wolfs"},

    ["commando"] = {questStarted = 1511, questStorage = 65001, creatureStorage = 15001, killsRequired = 300, raceName = "Commandos"},

    ["pandorian"] = {questStarted = 1512, questStorage = 65002, creatureStorage = 15002, killsRequired = 50, raceName = "Pandorians"},

    ["triceratops"] = {questStarted = 1513, questStorage = 65003, creatureStorage = 15003, killsRequired = 500, raceName = "Triceratops"},
    ["large triceratops"] = {questStarted = 1513, questStorage = 65003, creatureStorage = 15004, killsRequired = 500, raceName = "Triceratops"},

    ["namek"] = {questStarted = 1513, questStorage = 65004, creatureStorage = 15005, killsRequired = 750, raceName = "Nameks"},
    ["elder namek"] = {questStarted = 1514, questStorage = 65004, creatureStorage = 15006, killsRequired = 750, raceName = "Nameks"},

    ["mummy"] = {questStarted = 1515, questStorage = 65005, creatureStorage = 15007, killsRequired = 1000, raceName = "Deaths"},
    ["skeleton"] = {questStarted = 1515, questStorage = 65005, creatureStorage = 15008, killsRequired = 1000, raceName = "Deaths"},

    ["mummy"] = {questStarted = 1515, questStorage = 65005, creatureStorage = 15007, killsRequired = 1000, raceName = "Tsufuls"},
    ["skeleton"] = {questStarted = 1515, questStorage = 65005, creatureStorage = 15008, killsRequired = 1000, raceName = "Tsufuls"}


}
 
local msgType = MESSAGE_STATUS_CONSOLE_ORANGE
 
function onKill(cid, target, lastHit)
 
local creature = questCreatures[getCreatureName(target):lower()]
 
    if creature then
        if isPlayer(target) or isSummon(target) then return true end
 
        if getCreatureStorage(cid, creature.questStarted) > 0 then
            if getCreatureStorage(cid, creature.questStorage) < creature.killsRequired then
                if getCreatureStorage(cid, creature.questStorage) < 0 then
                    doCreatureSetStorage(cid, creature.questStorage, 0)
                end
 
                if getCreatureStorage(cid, creature.creatureStorage) < 0 then
                    doCreatureSetStorage(cid, creature.creatureStorage, 0)
                end
                doCreatureSetStorage(cid, creature.questStorage, getCreatureStorage(cid, creature.questStorage) + 1)
                doCreatureSetStorage(cid, creature.creatureStorage, getCreatureStorage(cid, creature.creatureStorage) + 1)
                doPlayerSendTextMessage(cid, msgType, getCreatureStorage(cid, creature.creatureStorage) .. " " .. getCreatureName(target) .. " defeated. Total [" .. getCreatureStorage(cid, creature.questStorage) .. "/" .. creature.killsRequired .. "] " .. creature.raceName .. ".")
            end
        end
    end
    return true
end

Co do komendy to nie wiem musial bym poszukac ale system task powinien dzialac :)

Opublikowano

Hmm spróbuję to wrzucić w testowy silnik ..

ale taskai to swoja drogą ; wpisuje !task nazwa_moba

 

i pokazuje ile zabilem/na ile i po zakonczeniu dostaje nagrode automatyczie

 

mysle zo to co podales to jest na to ze npc daje misje losowa co jakis czas na zabicie takich i takich mmobow i za zrobienie dostaje nagrode tak? to bylo by super =S

Opublikowano

Nie, to jest task system jak na rl czyli przyjmujesz na co chcesz i zabijasz i dostajesz golda i expa<br />Też będę szukał dziś tego systemu co ty ale jak czytałem to trzeba w source coś pozmieniac

Opublikowano

Na tym forum chyba nikt cie tego skryptu nie napisze a szukam go juz ze 2 godziny i nic. Napisz na OT landzie tam jest o wiele wiecej doswiadczonych skrypterow i napewno Ci pomoga

PS.

Masz source do swojego silnika ?

Zarchiwizowany

Ten temat przebywa obecnie w archiwum. Dodawanie nowych odpowiedzi zostało zablokowane.

×
×
  • Dodaj nową pozycję...