LuckinhaSanNosso caráter é resultado de nossa condutaLConde
info
Grupo: Conde
Registrado: 03/09/11
Posts: 703
Reputação: +191
Gênero: Masculino
Char no Tibia: Mirade
27 de abril de 2013 às 19:13
Esta função serve para adicionar exp x player experience fase!
Exemplo, se fase exp é:
1-20 = 50x, em seguida, se você abrir um baú e você está abaixo do nível 20, você receberá a quantidade x 50
Vá em data/lib/ e abra o arquivo 050-functions.lua, adicione isto -
function AddStageExp(cid, amount)
if(amount == nil) then
return false
end
if(not isPlayer(cid)) then
return false
end
return (doPlayerAddExp(cid,amount*getExperienceStage(getPlayerLevel(cid), getVocationInfo(getPlayerVocation(cid)).experienceMultiplier)) and doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You gained " .. amount*getExperienceStage(getPlayerLevel(cid), getVocationInfo(getPlayerVocation(cid)).experienceMultiplier) .. " experience points."))
end[code]
Aqui está um exemplo em lua do scroll exp:
[code]local config = {
scroll_exp = 100,
scroll_level = 50
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if (getPlayerLevel(cid) >= config.scroll_level) then
AddStageExp(cid,config.scroll_exp)
doRemoveItem(item.uid, 1)
else
doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE,"Sorry, but it requires level "..config.scroll_level.." to use this scroll.")
end
return true
end
info
Grupo: Conde
Registrado: 03/09/11
Posts: 703
Reputação: +191
Gênero: Masculino
Char no Tibia: Mirade
Esta função serve para adicionar exp x player experience fase!
Exemplo, se fase exp é:
1-20 = 50x, em seguida, se você abrir um baú e você está abaixo do nível 20, você receberá a quantidade x 50
Vá em data/lib/ e abra o arquivo 050-functions.lua, adicione isto -
function AddStageExp(cid, amount) if(amount == nil) then return false end if(not isPlayer(cid)) then return false end return (doPlayerAddExp(cid,amount*getExperienceStage(getPlayerLevel(cid), getVocationInfo(getPlayerVocation(cid)).experienceMultiplier)) and doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You gained " .. amount*getExperienceStage(getPlayerLevel(cid), getVocationInfo(getPlayerVocation(cid)).experienceMultiplier) .. " experience points.")) end[code] Aqui está um exemplo em lua do scroll exp: [code]local config = { scroll_exp = 100, scroll_level = 50 } function onUse(cid, item, fromPosition, itemEx, toPosition) if (getPlayerLevel(cid) >= config.scroll_level) then AddStageExp(cid,config.scroll_exp) doRemoveItem(item.uid, 1) else doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE,"Sorry, but it requires level "..config.scroll_level.." to use this scroll.") end return true endCréditos - Printer