Este é um script que fizemos há um tempo atrás, todo o respeito ao J. Dre. Levamos horas, e frustração muito mais do que o nosso último script .. Mas, eu, ou J. Dre não está aqui pelo dinheiro, por isso vamos lançar este script também gratuitamente. Divirta-se e Divirta-se.
A idéia ..
Obter um certo nível, você recebe uma recompensa, e uma descrição especiais, neste caso, em 100, você seria chamado de "Warlord of the Flame"
The Scripts..
SetRank.lua:
local config = {
storage = 7500,
mailbox = {
{x = 95, y = 112, z = 7} -- mailbox location on map
}
}
local ranks = {
["Warlord of the Flame"] = {
c = {
level = 100,
prize = {2160, 10}
}
},
}
local function doPlayerAddDepotItems(cid, pos, town, items, notify) -- credits to Chojy for idea.
local parcel = doCreateItemEx(2595)
local label = doAddContainerItem(parcel, 2599)
doSetItemText(label, getCreatureName(cid) .."\n".. town)
doAddContainerItemEx(parcel, items)
doTeleportThing(parcel, pos)
if(notify == true) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your reward has been sent to your depot because you were unable to carry it.")
end
return true
end
function onAdvance(cid, skill, oldLevel, newLevel)
for desc, i in pairs(ranks) do
if skill == SKILL__LEVEL then
if newLevel >= i.c.level then
if getCreatureStorage(cid, config.storage) < newLevel then
local id = doCreateItemEx(i.c.prize[1], i.c.prize[2] or 1)
if(doPlayerAddItemEx(cid, id, false) ~= RETURNVALUE_NOERROR) then
doPlayerAddDepotItems(cid, config.mailbox[1], getTownName(getPlayerTown(cid)), id, true)
end
doCreatureSetStorage(cid, config.storage, newLevel)
doSendMagicEffect(getThingPos(cid), CONST_ME_GIFT_WRAPS)
doCreatureSay(cid, "Congratulations! You are now a " .. desc .. ".", TALKTYPE_MONSTER)
break
end
end
end
end
return true
end
LookRank.lua:
local t = {
[100] = {"Warlord of the Flame"}
}
local storage = 7500
function onLook(cid, thing, position, lookDistance)
if isPlayer(thing.uid) then
local voc = getPlayerVocation(thing.uid)
if t[getCreatureStorage(thing.uid, storage)] then
if cid == thing.uid then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You see yourself. " .. (voc == 0 and "You have no vocation" or "You are " .. getVocationInfo(voc).description) .. ".\nYou are also ranked as " .. t[getCreatureStorage(thing.uid, storage)][1] .. ".")
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You see " .. getCreatureName(thing.uid) .. " (Level: " .. getPlayerLevel(thing.uid) .. "). " .. (getPlayerSex(thing.uid) == 0 and "She" or "He") .. " " .. (voc == 0 and 'has no vocation' or 'is ' .. getVocationInfo(voc).description) .. ". " .. (getPlayerSex(thing.uid) == 0 and "\nShe" or "\nHe") .. " is also " .. t[getCreatureStorage(thing.uid, storage)][1] .. ".")
end
return false
end
end
return true
end
info
Grupo: Campones
Registrado: 05/09/11
Posts: 4
Reputação: +3
Este é um script que fizemos há um tempo atrás, todo o respeito ao J. Dre. Levamos horas, e frustração muito mais do que o nosso último script .. Mas, eu, ou J. Dre não está aqui pelo dinheiro, por isso vamos lançar este script também gratuitamente. Divirta-se e Divirta-se.
A idéia ..
Obter um certo nível, você recebe uma recompensa, e uma descrição especiais, neste caso, em 100, você seria chamado de "Warlord of the Flame"
The Scripts..
SetRank.lua:
local config = { storage = 7500, mailbox = { {x = 95, y = 112, z = 7} -- mailbox location on map } } local ranks = { ["Warlord of the Flame"] = { c = { level = 100, prize = {2160, 10} } }, } local function doPlayerAddDepotItems(cid, pos, town, items, notify) -- credits to Chojy for idea. local parcel = doCreateItemEx(2595) local label = doAddContainerItem(parcel, 2599) doSetItemText(label, getCreatureName(cid) .."\n".. town) doAddContainerItemEx(parcel, items) doTeleportThing(parcel, pos) if(notify == true) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your reward has been sent to your depot because you were unable to carry it.") end return true end function onAdvance(cid, skill, oldLevel, newLevel) for desc, i in pairs(ranks) do if skill == SKILL__LEVEL then if newLevel >= i.c.level then if getCreatureStorage(cid, config.storage) < newLevel then local id = doCreateItemEx(i.c.prize[1], i.c.prize[2] or 1) if(doPlayerAddItemEx(cid, id, false) ~= RETURNVALUE_NOERROR) then doPlayerAddDepotItems(cid, config.mailbox[1], getTownName(getPlayerTown(cid)), id, true) end doCreatureSetStorage(cid, config.storage, newLevel) doSendMagicEffect(getThingPos(cid), CONST_ME_GIFT_WRAPS) doCreatureSay(cid, "Congratulations! You are now a " .. desc .. ".", TALKTYPE_MONSTER) break end end end end return true endLookRank.lua:
local t = { [100] = {"Warlord of the Flame"} } local storage = 7500 function onLook(cid, thing, position, lookDistance) if isPlayer(thing.uid) then local voc = getPlayerVocation(thing.uid) if t[getCreatureStorage(thing.uid, storage)] then if cid == thing.uid then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You see yourself. " .. (voc == 0 and "You have no vocation" or "You are " .. getVocationInfo(voc).description) .. ".\nYou are also ranked as " .. t[getCreatureStorage(thing.uid, storage)][1] .. ".") else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You see " .. getCreatureName(thing.uid) .. " (Level: " .. getPlayerLevel(thing.uid) .. "). " .. (getPlayerSex(thing.uid) == 0 and "She" or "He") .. " " .. (voc == 0 and 'has no vocation' or 'is ' .. getVocationInfo(voc).description) .. ". " .. (getPlayerSex(thing.uid) == 0 and "\nShe" or "\nHe") .. " is also " .. t[getCreatureStorage(thing.uid, storage)][1] .. ".") end return false end end return true endIn CreatureScripts.xml..
In Login.lua..
[/center]