Strona Główna Belxena 8.4 RPG

Forum poświęcone powstawaniu Belxena OTS


#1 2009-05-02 10:03:55

Wiesiu

Administrator

Zarejestrowany: 2009-04-03
Posty: 59
Punktów :   

Quest na expo i skille

Wrzuciłem jakiś czas temu na otland.net, to i tu przy okazji wrzucę
Kod:

local config = {
    storage = 5019,
    experience = 400,
    axe = 2429,
    club = 2394,
    sword = 2409
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if(getPlayerCustomFlagValue(cid, PlayerCustomFlag_GamemasterPrivileges) == TRUE) then
        return TRUE
    end
    if(getPlayerStorageValue(cid, config.storage) ~= -1) then
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.")
        return TRUE
    end
    local club = getPlayerSkill(cid, 1)
    local sword = getPlayerSkill(cid, 2)
    local axe = getPlayerSkill(cid, 3)
    local reward = 0
    if(axe > sword and axe > club) then
        reward = doCreateItemEx(config.axe, 1)
    elseif(club > sword and club > axe) then
        reward = doCreateItemEx(config.club, 1)
    elseif(sword > club and sword > axe) then
        reward = doCreateItemEx(config.sword, 1)
    end
    if(reward == 0) then
        doPlayerSendCancel(cid, "Sorry, you have to choose a weapon type first.")
    elseif(doPlayerAddItemEx(cid, reward, FALSE) ~= RETURNVALUE_NOERROR) then
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a reward weighing " .. getItemWeight(reward) .. " oz. It is too heavy or you have not enough space.")
    else
        local tmp = getItemDescriptions(reward)
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found " .. tmp.article .. " " .. tmp.name .. ".")
        setPlayerStorageValue(cid, config.storage, 1)
        doPlayerAddExp(cid, config.experience)
        doSendAnimatedText(getCreaturePosition(cid), config.experience, TEXTCOLOR_WHITE_EXP)
    end
    return TRUE
end

storage <- chyba nie muszę wyjaśniać
experience <- ilość otrzymanego doświadczenia za wykonanie
axe, club, sword <- numery broni


http://images.net.pl/file/u6iur6fo6sojbxta16uv.jpg

Offline

 

Stopka forum

RSS
Powered by PunBB
© Copyright 2002–2008 PunBB
Polityka cookies - Wersja Lo-Fi


Darmowe Forum | Ciekawe Fora | Darmowe Fora
www.vspolmiedztrans.pun.pl www.zspjasliska.pun.pl www.ogt.pun.pl www.promotyle.pun.pl www.realnet.pun.pl