• logo_cipsoft
    Nowe serwery zostały otwarte 19 Lut 2025:
    Noctalia (Open PvP) Ignitera (Open PvP) us_logo Xybra (Open PvP)

msg. for (Congratulations! your lvl) [8.4]

Xart Irok

Senior User
Dołączył
Wrzesień 7, 2008
Posty
2925
Liczba reakcji
410
Wiek
34
jako plik lua wklejmy to i zapisz przykladowo jako AdvencLvl.lua
PHP:
local data = {
    [1] = { "Level UP", 30} -- 30 = variable[2]  // Animation effect
}
local config = {
showAllAdvances = "YES", --(YES/NO) // czy ma pokazywac napis nad postacia przy kazdym awansie? // YES == tak, NO == nie
broadcastOnLevels = {100, 200, 300, 400, 500} // wpisz poziomy, na ktorych ma oglaszac awans kazdemu graczowi // aby wylaczyc wpisz samo 0
}
function onAdvance(cid, skill, oldlevel, newlevel)
local pos = getPlayerPosition(cid)
local positions = {
        {x=pos.x+1,y=pos.y-1,z=pos.z},
        {x=pos.x-1,y=pos.y-1,z=pos.z},
        {x=pos.x+1,y=pos.y+1,z=pos.z},
        {x=pos.x-1,y=pos.y+1,z=pos.z},
        {x=pos.x+1,y=pos.y,z=pos.z},
        {x=pos.x-1,y=pos.y,z=pos.z},
        {x=pos.x,y=pos.y+1,z=pos.z},
        {x=pos.x,y=pos.y-1,z=pos.z}}
    if config.showAllAdvances == "YES" and (isInArray(config.broadcastOnLevels, getPlayerLevel(cid))) == TRUE and skill == 1 then
        broadcastMessage(getPlayerName(cid).." has been advanced on ".. newlevel .." level. Congratulations!", MESSAGE_EVENT_ADVANCE)
    end
    for type, variable in pairs(data) do
        if skill == 1 then
        for i = 1, table.maxn(positions) do
                    doSendMagicEffect(positions[i],variable[2])
        end
        break
        end
    end    
return TRUE
end
w creaturescripts/creaturescripts.xml dodaj ta linjke
PHP:
<event type="advance" name="AdvencLvl" script="AdvencLvl.lua"/>
a potem w pliku creaturescripts/scripts/login.lua dodaj ta linijke
PHP:
registerCreatureEvent(cid, "AdvencLvl")
 
Ostatnia edycja:
Teraz torche bardziej rozbudowany ale ten sam system

Teraz torche bardziej rozbudowany ale ten sam system

PHP:
local data = {
    [0] = { "Fist skill UP", 30}, -- 30 = variable[2]  -- Animation effect
    [1] = { "Club skill UP", 30}, -- 30 = variable[2]  -- Animation effect
    [2] = { "Sword skill UP", 30}, -- 30 = variable[2]  -- Animation effect
    [3] = { "Axe skill UP", 30}, -- 30 = variable[2]  -- Animation effect
    [4] = { "Distance skill UP", 30}, -- 30 = variable[2]  -- Animation effect
    [5] = { "Shield skill UP", 30}, -- 30 = variable[2]  -- Animation effect
    [6] = { "Fishing skill UP", 30}, -- 30 = variable[2]  -- Animation effect
    [7] = { "Magic level UP", 30}, -- 30 = variable[2]  -- Animation effect
    [8] = { "Level UP", 30} -- 30 = variable[2]  -- Animation effect
}
local config = {
showAllAdvances = "YES", --(YES/NO) // czy ma pokazywac napis nad postacia przy kazdym awansie? // YES == tak, NO == nie
broadcastOnLevels = {100, 200, 300, 400, 500} -- wpisz poziomy, na ktorych ma oglaszac awans kazdemu graczowi // aby wylaczyc wpisz samo 0
}
function onAdvance(cid, skill, oldlevel, newlevel)
local pos = getPlayerPosition(cid)
local positions = {
        {x=pos.x+1,y=pos.y-1,z=pos.z},
        {x=pos.x-1,y=pos.y-1,z=pos.z},
        {x=pos.x+1,y=pos.y+1,z=pos.z},
        {x=pos.x-1,y=pos.y+1,z=pos.z},
        {x=pos.x+1,y=pos.y,z=pos.z},
        {x=pos.x-1,y=pos.y,z=pos.z},
        {x=pos.x,y=pos.y+1,z=pos.z},
        {x=pos.x,y=pos.y-1,z=pos.z}}
        
    if config.showAllAdvances == "YES" and (isInArray(config.broadcastOnLevels, getPlayerLevel(cid))) == TRUE and skill == 8 then
        broadcastMessage(getPlayerName(cid).." has been advanced on ".. newlevel .." level. Congratulations!", MESSAGE_EVENT_ADVANCE)
    end

    for type, variable in pairs(data) do
        if skill == type then
        doCreatureSay(cid, ""..variable[1].." ["..newlevel.."]", TALKTYPE_ORANGE_1)
        for i = 1, table.maxn(positions) do
                    doSendMagicEffect(positions[i],variable[2])
        end
        break
        end
    end    
return TRUE
end
moze cie to zapisac pod tak sama nazwa chyba ze chcecie inaczej
 
Odp: msg. for (Congratulations! your lvl) [8.4]

Bardzo dobre przyda si? na ka?dy OTS.I tak ju? jest tak w wielu OTS.
Ale skrypt naprawd? podziwu , leci reput.
Pozdrawiam :)
 
Odp: msg. for (Congratulations! your lvl) [8.4]

czy da?oby sie tak zrobi? na tibi 8.1?
 
Odp: msg. for (Congratulations! your lvl) [8.4]

no wlasnie niema na XML 8.1 takiego czegos ;/ czyli ze nieda sie zrobic? :(
 
Odp: msg. for (Congratulations! your lvl) [8.4]

Mog?es chociaz napisac ze nie jestes autorem tego skryptu.
link do orginalnego tematu:
Ale i tak dz ze chociaz to tu wkleiles.
PZDR.
Danabur
 
Odp: msg. for (Congratulations! your lvl) [8.4]

ja mam otsa na 8.1 i mam tak creaturescipt
ale wyskakuje mi taki b?ad...:
5oryc3.jpg
 
Odp: msg. for (Congratulations! your lvl) [8.4]

ja mam otsa na 8.1 i mam tak creaturescipt
ale wyskakuje mi taki b?ad...:
5oryc3.jpg
wystarczy ze zminisz funkcje ktora odpowiada za wyslanie tekstu
Mog?es chociaz napisac ze nie jestes autorem tego skryptu.
link do orginalnego tematu:
Ale i tak dz ze chociaz to tu wkleiles.
PZDR.
Danabur
ja niemam zwyczaju podpisywac kogo jest ten skrypty a ni tez swojych skryptow nie podpisuje
a tak ogolnie to ten skrypty sa zawassowane bo nie bylo tego wyswietlania sie ze ktos nabil 100 lvl
 
Odp: msg. for (Congratulations! your lvl) [8.4]

@Xart Irok
to moze mi napiszesz bo ja sie nie orientuje za bardzo...
 
Odp: msg. for (Congratulations! your lvl) [8.4]

@Xart Irok
to moze mi napiszesz bo ja sie nie orientuje za bardzo...
zamieni to na drugie lub inne podam ponizej inne opcje
PHP:
doCreaturSay
PHP:
doPlayerSendTextMessage
 
Odp: msg. for (Congratulations! your lvl) [8.4]

Xart gdy to zamienilem to za kazdym razem gdy awansuje na wiekszy lvl lub w skillach to dostaje debuga... ;/
 
Odp: msg. for (Congratulations! your lvl) [8.4]

Nie wiem co Ty pokreciles koles !
Mam najnowszy TFS pod 8.4 !
vig5q3vhnswa8ynbr5bf.jpg

Jak to moge naprawic ?!
 
Odp: msg. for (Congratulations! your lvl) [8.4]

Autorem jest Pitufo@otland.net, przerobione przeze mnie dla otcentrum.pl. Prawd? m?wi?c da si? to jeszcze upro?ci?, ale to ju? si? ociera o kosmetyczne zmiany ;)
 
Do góry