Guida [How-To] Colored quest scrolls v2 (revised)

Stato
Discussione chiusa ad ulteriori risposte.

martysama0134

Utente Platinum
9 Gennaio 2009
3,446
80
1,703
1,107
Ultima modifica da un moderatore:
Avviso: Lascerò il contenuto di questa mia guida in inglese per semplicità!

This is a revised version of an old thread. Following this How-To, you will have a better customizable solution for the aspect of your quests.

You will be able to choice amongst: quest icon, text color, blink effect (like whisper buttons)


How To
You just need to replace 2 little things:
  1. In interfaceModule.py, replace BINARY_RecvQuest with this
  2. In questlib.lua, replace send_letter_ex with this


Explanation:
-the 2° argument of send_letter_ex will support multiple parameters:
  • green|blue|purple|golden|fucsia|aqua and so on (you can add them in BINARY_RecvQuest by adding new colors 0xFF+#HEX; Color Picker Online)
  • blink (the quest will flash like the whisper messages)
  • ex (a dummy tag to separate it from "info" and "item")

-the 3° argument is the name of the icon to choose, which the current availables are:
  • scroll_open.tga
  • scroll_open_green.tga
  • scroll_open_blue.tga
  • scroll_open_purple.tga
  • scroll_open_golden.tga


Examples:
3n9yRqF.png

Codice:
send_letter_ex(localeInfo.LanguageOptionTitle, "green,blink,ex", "scroll_open_green.tga")

M8MMP3N.png

Codice:
send_letter_ex(localeInfo.LanguageOptionTitle, "blue,blink,ex", "scroll_open_blue.tga")

gkEolrr.png

Codice:
send_letter_ex(localeInfo.LanguageOptionTitle, "purple,blink,ex", "scroll_open_purple.tga")

AH6tgAW.png

Codice:
send_letter_ex(localeInfo.LanguageOptionTitle, "golden,blink,ex", "scroll_open_golden.tga")

7uBSyfS.png

Codice:
send_letter_ex(localeInfo.LanguageOptionTitle, "golden,blink,ex", "scroll_open.tga")

qvhg6Ql.png

Codice:
send_letter_ex(localeInfo.LanguageOptionTitle, "golden,blink,ex", "scroll_open_green.tga")
Note: As you can imagine, the only limitation is that the color in N won't appear. (it will require additional code and work, so just forget it)


Download:
Check the attachment (colored-quest-scrolls-v2-res.zip) and add metin2_patch_new_questicon in your client.
 

Allegati

  • colored-quest-scrolls-v2-res.zip
    191.5 KB · Visualizzazioni: 136
  • Mi piace
Reazioni: Mr.Gherusio
In un altro forum mi è stato chiesto come usarlo, quindi ho aggiunto uno shortcut:
How to use in a quest?
Instead of send_letter("XXX") you use send_letter_ex("XXX", "green,blink,ex", "scroll_open_green.tga") if you want green icon, green text, and the icon blinking.

OR
add these in questlib.lua
Codice:
function send_letter_blue(name) send_letter_ex(name, "ex", "scroll_open_blue.tga") end
function send_letter_golden(name) send_letter_ex(name, "ex", "scroll_open_golden.tga") end
function send_letter_green(name) send_letter_ex(name, "ex", "scroll_open_green.tga") end
function send_letter_purple(name) send_letter_ex(name, "ex", "scroll_open_purple.tga") end

function send_letter_blue_blink(name) send_letter_ex(name, "blink,ex", "scroll_open_blue.tga") end
function send_letter_golden_blink(name) send_letter_ex(name, "blink,ex", "scroll_open_golden.tga") end
function send_letter_green_blink(name) send_letter_ex(name, "blink,ex", "scroll_open_green.tga") end
function send_letter_purple_blink(name) send_letter_ex(name, "blink,ex", "scroll_open_purple.tga") end

function send_letter_blue_text(name) send_letter_ex(name, "blue,ex", "scroll_open_blue.tga") end
function send_letter_golden_text(name) send_letter_ex(name, "golden,ex", "scroll_open_golden.tga") end
function send_letter_green_text(name) send_letter_ex(name, "green,ex", "scroll_open_green.tga") end
function send_letter_purple_text(name) send_letter_ex(name, "purple,ex", "scroll_open_purple.tga") end

function send_letter_blue_blink_text(name) send_letter_ex(name, "blink,blue,ex", "scroll_open_blue.tga") end
function send_letter_golden_blink_text(name) send_letter_ex(name, "blink,golden,ex", "scroll_open_golden.tga") end
function send_letter_green_blink_text(name) send_letter_ex(name, "blink,green,ex", "scroll_open_green.tga") end
function send_letter_purple_blink_text(name) send_letter_ex(name, "blink,purple,ex", "scroll_open_purple.tga") end
So you would just need to replace send_letter("something") with send_letter_green_text("something") for text and icon green.
 
  • Mi piace
Reazioni: Mr.Gherusio
Dove posso trovare le scroll missioni colorate in diversi colori?

-----EDIT-----

Trovate, come non detto. Non avevo acceso il cervello e neanche Google.
 
Ultima modifica da un moderatore:
Ho scritto per il mio server una funzione di selezione dinamica per gli scrolls colorati, se volete potete usarla al posto di usare una funzione per ogni singola variazione di scroll come mostrato invece da Martino.

Function:
Codice:
--[[
    Invia un send_letter_ex controllando il colore e prendendo come argomenti:
    "name", il nome che visualizzera' la pergamena inviata.
    "string_color", il colore della scritta (bianca di default se non esistente nell'array 'color_table').
    "scroll_color", il colore della pergamena (rossa di default se non esistente nell'array 'color_table').
    "blink", un valore booleano che stabilisce se la pergamena deve 'lampeggiare' o no.
]]
send_letter_color = function(name, string_color, scroll_color, blink)
    local string_type;
    local scroll_type;
    local color_table = {"blue", "golden", "green", "purple"};

    if (table_is_in(color_table, string_color)) then
        if (blink) then
            string_type = string.format("blink,%s,ex", string_color);
        else
            string_type = string.format("%s,ex", string_color);
        end -- if/else
    else
        if (blink) then
            string_type = "blink,ex";
        else
            string_type = "ex";
        end -- if/else
    end -- if/else

    if (table_is_in(color_table, scroll_color)) then
        scroll_type = string.format("scroll_open_%s.tga", scroll_color);
    else
        scroll_type = "scroll_open.tga";
    end -- if/else

    return send_letter_ex(name, string_type, scroll_type);
end -- function


Esempio di utilizzo della funzione:
Codice:
send_letter_color("Opzioni Lingua", "green", "green", false);


Equivalra' in game a:
3n9yRqF.png
 
Stato
Discussione chiusa ad ulteriori risposte.