What's new

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

Xart Irok

Senior User
Joined
Sep 7, 2008
Messages
2,925
Reaction score
419
Age
32
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")
 
Last edited:

Xart Irok

Senior User
Joined
Sep 7, 2008
Messages
2,925
Reaction score
419
Age
32
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
 

arts1991

Advanced User
Joined
Apr 21, 2008
Messages
375
Reaction score
34
Age
33
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 :)
 

Kopi

Advanced User
Joined
Jan 28, 2009
Messages
152
Reaction score
14
Odp: msg. for (Congratulations! your lvl) [8.4]

czy da?oby sie tak zrobi? na tibi 8.1?
 

Xart Irok

Senior User
Joined
Sep 7, 2008
Messages
2,925
Reaction score
419
Age
32
Odp: msg. for (Congratulations! your lvl) [8.4]

czy da?oby sie tak zrobi? na tibi 8.1?
moze by dalo rade ale zobacz czy masz u siebie taki katalog jak creaturscript
 

Diverse-KoPeC

Advanced User
Joined
Dec 9, 2008
Messages
204
Reaction score
10
Odp: msg. for (Congratulations! your lvl) [8.4]

no wlasnie niema na XML 8.1 takiego czegos ;/ czyli ze nieda sie zrobic? :(
 

Danabur

Active User
Joined
Nov 1, 2008
Messages
63
Reaction score
9
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
 

Kopi

Advanced User
Joined
Jan 28, 2009
Messages
152
Reaction score
14
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
 

Xart Irok

Senior User
Joined
Sep 7, 2008
Messages
2,925
Reaction score
419
Age
32
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
 

Kopi

Advanced User
Joined
Jan 28, 2009
Messages
152
Reaction score
14
Odp: msg. for (Congratulations! your lvl) [8.4]

@Xart Irok
to moze mi napiszesz bo ja sie nie orientuje za bardzo...
 

Xart Irok

Senior User
Joined
Sep 7, 2008
Messages
2,925
Reaction score
419
Age
32
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
 

Kopi

Advanced User
Joined
Jan 28, 2009
Messages
152
Reaction score
14
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... ;/
 

Driftking

Active User
Joined
Jul 5, 2008
Messages
71
Reaction score
15
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 ?!
 

Keraxel

Active User
Joined
Apr 6, 2008
Messages
80
Reaction score
2
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 ;)
 
Top