Histórico de Curtidas
-
Apocalypse recebeu reputação de Ryukiimaru em Gravar posição do player por storage.bom primeiramente vc deve saber q a função getPlayerPosition(cid) retorna uma tabela, e tabelas não pode ser gravadas em uma storage somente numeros e strings. então vc pode fazer o seguinte montar uma string que salve os 3 valores separados por virgula assim; "x,y,z" local pos = getPlayerPosition(cid).x .. "," .. getPlayerPosition(cid).y .. "," .. getPlayerPosition(cid).z que sera a mesma coisa que;
local pos = "x,y,z" depois vc salva na storage:
setPlayerStorageValue(cid, 2220, pos) e por fim para retornar essa posição vc iria usar o auxilio do string.explode que transforma uma string em tabela, separando os valores de acordo com o separador que escolheu que nosso caso é a virgula. por exemplo: local pos = "x,y,z" local tab = string.explode(pos, ",") -- quando encontrar a virgula, ele passara para o proximo indice da tabela. que é a mesma coisa que isso:
local tab = {"x", "y", "z"} oque eu tenha que fazer agora é colocar no doTeleportThing: lembrando que a função doTeleportThing para funcioar precisa de uma tabela da seguinte estrutura: {x = x, y = y, z = z} então teremos que montar essa tabela com os valores da string.explode local posFinal = {x = tab[1], y = tab[2], z = tab[3]} -- ou seja x é igual ao primeiro indice da tabela tab, y o segundo e z o terceiro. depois só mandar o comando: doTeleportThing(cid, posFinal) fazendo isso resumidamente ficaria o seguinte: setPlayerStorageValue(cid, 2220, getPlayerPosition(cid).x .. "," .. getPlayerPosition(cid).y .. "," .. getPlayerPosition(cid).z) -- gravei os valores da posição do player como uma string local pos = string.explode(getPlayerStorageValue(cid, 2220), ",") -- peguei o valor da storage que é a string, e separei as posições doTeleportThing(cid, {x = pos[1], y = pos[2], z = pos[3]}) -- montei a tabela que a função precisa com os valores da storage separados por indices. espero que tenha entendido, qualquer coisa tamo ae !
-
Apocalypse recebeu reputação de RenanPhellip em Exp Por Hit v3.0 - Oficial XotservXInstalação
Primeiramente abra a pasta de seu ot, e procure pelo arquivo config.lua e procure por essas 2 linhas :
experienceStages = false rateExperience = 50 se o experienceStages tiver ativado mude para false, pois o sistema ainda não tem suporte á Stages. e é muito importante o rateExperience tiver como 0, pois ela sera configurada, em outro local agora. exemplo: experienceStages = false rateExperience = 0 agora entre na pasta creaturescripts/scripts e crie um arquivo lua, chamado exphit.lua e cole o seguinte código: -- CONFIGURAÇÕES DE EXPERIENCIA -- useStages = true -- Usar sistema de Stages , true/false premiumMultipliqueExp = 2 -- Players Premiums terão exp multiplicada, caso não querer deixe 1. rateExp = 50 -- Exp caso não for usar stages. local stages = { -- ["DELEVEL-ATELEVEL"] = EXP, (OBS: NUNCA REPETIR O MSM NUMERO, SEMPRE COLOCAR UM A MAIS.) ["1-50"] = 50, ["51-100"] = 45, ["101-150"] = 40, ["151-200"] = 35, ["201-250"] = 30, ["251-300"] = 25, ["351-400"] = 20, } ultimateExp = 15 -- exp que vai usar caso o level do player não tiver mais na tabela . -- CONFIGURAÇÕES DA PARTY partyPorcent = 40 -- Quantos Porcento da exp vai para os membros da party levelBlockParty = 1000 -- Diferença Maxima de Level permitida para membro da party ganhar exp. expShareRadiusX = 30 -- Distancia maxima permitida no eixo X para membro da party ganhar exp. expShareRadiusY = 30 -- Distancia maxima permitida no eixo Y para membro da party ganhar exp. expShareRadiusZ = 1 -- Distancia maxima permitida no eixo Z para membro da party ganhar exp. -- CONFIGURAÇÕES DE RINGS -- local rings = { -- [ID DO ANEL] = EXP MULTIPLICADA POR X EXP. [3048] = 2, [3049] = 4, [3050] = 6, } -- FIM DAS CONFIGURAÇÕES -- function CalculeExp(monsterhp, exptotal, hit) hit = hit <= monsterhp and math.ceil(exptotal * hit / monsterhp) or 0 return hit < 0 and 0 or hit end function isSummon(uid) return uid ~= getCreatureMaster(uid) or false end function onStatsChange(cid, attacker, type, combat, value) if getCreatureStorage(cid, 50001) ~= 1 then doCreatureSetStorage(cid, 50002, getMonsterInfo(getCreatureName(cid)).experience * rateExp) doCreatureSetStorage(cid, 50001, 1) end if type == STATSCHANGE_HEALTHLOSS then if isMonster(cid) then if isSummon(cid) then return true end if isCreature(attacker) then local _cid = isSummon(attacker) and getCreatureMaster(attacker) or attacker if isPlayer(_cid) then if useStages then for strstage, experience in pairs(stages) do tabstage = string.explode(strstage, "-") if getPlayerLevel(_cid) >= tabstage[1] and getPlayerLevel(_cid) <= tabstage[2] then ultimateExp = experience end end experienceRate = ultimateExp else experienceRate = rateExp end local expgain = CalculeExp(getCreatureMaxHealth(cid), getMonsterInfo(getCreatureName(cid)).experience * experienceRate, value) local ringexp = 1 for idring, expring in pairs(rings) do if getPlayerSlotItem(_cid, 9).itemid == idring then ringexp = expring break end end local premiumMultipliqueExp = isPremium(_cid) and premiumMultipliqueExp or 1 expgain = expgain * ringexp * premiumMultipliqueExp if getCreatureStorage(cid, 50002) > 0 then if getCreatureStorage(cid, 50002) - expgain < 0 then expgain = getCreatureStorage(cid, 50002) end doCreatureSetStorage(cid, 50002, getCreatureStorage(cid, 50002) - expgain) local party = false if isInParty(_cid) then local partyMembers, expParty = getPartyMembers(getPartyLeader(_cid)), expgain / 100 * partyPorcent for indice, partyMember in pairs(partyMembers) do attackerLevel, partyLevel = getPlayerLevel(_cid), getPlayerLevel(partyMember) attackerPos, partyPos = getThingPos(_cid), getThingPos(partyMember) x = false if math.abs(attackerLevel - partyLevel) > levelBlockParty then x = true elseif math.abs(attackerPos.x - partyPos.x) > expShareRadiusX then x = true elseif math.abs(attackerPos.y - partyPos.y) > expShareRadiusY then x = true elseif attackerPos.z ~= partyPos.z then x = true elseif _cid == partyMember then x = true end if x then partyMembers[indice] = nil end end if #partyMembers ~= 0 then expParty = math.ceil(expgain / 100 * partyPorcent) expmember = math.ceil(expParty / #partyMembers) for _, member in pairs(partyMembers) do if member ~= _cid then doPlayerSendTextMessage(member, 12, "You received "..expmember.." party exp.") doPlayerAddExp(member, expmember) end end doPlayerSendTextMessage(_cid, 12, "You gain "..expgain.." exp. (" ..partyPorcent.."% send to party)") doPlayerAddExp(_cid, expgain - expParty) party = true else party = false end end if not party then doPlayerSendTextMessage(_cid, 12, "You gain "..expgain.." exp.") doPlayerAddExp(_cid, expgain) end end end end end end return true end function onCombat(cid, target) if isMonster(target) and not isSummon(target) and not isPlayer(target) then registerCreatureEvent(target, "ExpGain") end return true end na mesma pasta procure pelo arquivo login.lua, e em cima de return true, adc a seguinte linha: registerCreatureEvent(cid, "ExpHit") volte na pasta anterior creaturescripts, e procure pelo arquivo creaturescritps.xml e cole as 2 tags: <event type="statschange" name="ExpGain" event="script" value="exphit.lua"/> <event type="combat" name="ExpHit" event="script" value="exphit.lua"/> para configurar a exp, que era configurada no config.lua está no começo do arquivo exphit.lua , e as configurações da party tbem, dos anéis, e até pode ser usado stages agora, segue abaixo o exemplo: -- CONFIGURAÇÕES DE EXPERIENCIA -- useStages = true -- Usar sistema de Stages , true/false premiumMultipliqueExp = 2 -- Players Premiums terão exp multiplicada, caso não querer deixe 1. rateExp = 50 -- Exp caso não for usar stages. local stages = { -- ["DELEVEL-ATELEVEL"] = EXP, (OBS: NUNCA REPETIR O MSM NUMERO, SEMPRE COLOCAR UM A MAIS.) ["1-50"] = 50, ["51-100"] = 45, ["101-150"] = 40, ["151-200"] = 35, ["201-250"] = 30, ["251-300"] = 25, ["351-400"] = 20, } ultimateExp = 15 -- exp que vai usar caso o level do player não tiver mais na tabela . -- CONFIGURAÇÕES DA PARTY partyPorcent = 40 -- Quantos Porcento da exp vai para os membros da party levelBlockParty = 1000 -- Diferença Maxima de Level permitida para membro da party ganhar exp. expShareRadiusX = 30 -- Distancia maxima permitida no eixo X para membro da party ganhar exp. expShareRadiusY = 30 -- Distancia maxima permitida no eixo Y para membro da party ganhar exp. expShareRadiusZ = 1 -- Distancia maxima permitida no eixo Z para membro da party ganhar exp. -- CONFIGURAÇÕES DE RINGS -- local rings = { -- [ID DO ANEL] = EXP MULTIPLICADA POR X EXP. [3048] = 2, [3049] = 4, [3050] = 6, } -- FIM DAS CONFIGURAÇÕES ----
Log V2.0 :
Log V3.0 ( 03/02/2013 ) :
-
Apocalypse recebeu reputação de drakylucas em Exp Por Hit v3.0 - Oficial XotservXInstalação
Primeiramente abra a pasta de seu ot, e procure pelo arquivo config.lua e procure por essas 2 linhas :
experienceStages = false rateExperience = 50 se o experienceStages tiver ativado mude para false, pois o sistema ainda não tem suporte á Stages. e é muito importante o rateExperience tiver como 0, pois ela sera configurada, em outro local agora. exemplo: experienceStages = false rateExperience = 0 agora entre na pasta creaturescripts/scripts e crie um arquivo lua, chamado exphit.lua e cole o seguinte código: -- CONFIGURAÇÕES DE EXPERIENCIA -- useStages = true -- Usar sistema de Stages , true/false premiumMultipliqueExp = 2 -- Players Premiums terão exp multiplicada, caso não querer deixe 1. rateExp = 50 -- Exp caso não for usar stages. local stages = { -- ["DELEVEL-ATELEVEL"] = EXP, (OBS: NUNCA REPETIR O MSM NUMERO, SEMPRE COLOCAR UM A MAIS.) ["1-50"] = 50, ["51-100"] = 45, ["101-150"] = 40, ["151-200"] = 35, ["201-250"] = 30, ["251-300"] = 25, ["351-400"] = 20, } ultimateExp = 15 -- exp que vai usar caso o level do player não tiver mais na tabela . -- CONFIGURAÇÕES DA PARTY partyPorcent = 40 -- Quantos Porcento da exp vai para os membros da party levelBlockParty = 1000 -- Diferença Maxima de Level permitida para membro da party ganhar exp. expShareRadiusX = 30 -- Distancia maxima permitida no eixo X para membro da party ganhar exp. expShareRadiusY = 30 -- Distancia maxima permitida no eixo Y para membro da party ganhar exp. expShareRadiusZ = 1 -- Distancia maxima permitida no eixo Z para membro da party ganhar exp. -- CONFIGURAÇÕES DE RINGS -- local rings = { -- [ID DO ANEL] = EXP MULTIPLICADA POR X EXP. [3048] = 2, [3049] = 4, [3050] = 6, } -- FIM DAS CONFIGURAÇÕES -- function CalculeExp(monsterhp, exptotal, hit) hit = hit <= monsterhp and math.ceil(exptotal * hit / monsterhp) or 0 return hit < 0 and 0 or hit end function isSummon(uid) return uid ~= getCreatureMaster(uid) or false end function onStatsChange(cid, attacker, type, combat, value) if getCreatureStorage(cid, 50001) ~= 1 then doCreatureSetStorage(cid, 50002, getMonsterInfo(getCreatureName(cid)).experience * rateExp) doCreatureSetStorage(cid, 50001, 1) end if type == STATSCHANGE_HEALTHLOSS then if isMonster(cid) then if isSummon(cid) then return true end if isCreature(attacker) then local _cid = isSummon(attacker) and getCreatureMaster(attacker) or attacker if isPlayer(_cid) then if useStages then for strstage, experience in pairs(stages) do tabstage = string.explode(strstage, "-") if getPlayerLevel(_cid) >= tabstage[1] and getPlayerLevel(_cid) <= tabstage[2] then ultimateExp = experience end end experienceRate = ultimateExp else experienceRate = rateExp end local expgain = CalculeExp(getCreatureMaxHealth(cid), getMonsterInfo(getCreatureName(cid)).experience * experienceRate, value) local ringexp = 1 for idring, expring in pairs(rings) do if getPlayerSlotItem(_cid, 9).itemid == idring then ringexp = expring break end end local premiumMultipliqueExp = isPremium(_cid) and premiumMultipliqueExp or 1 expgain = expgain * ringexp * premiumMultipliqueExp if getCreatureStorage(cid, 50002) > 0 then if getCreatureStorage(cid, 50002) - expgain < 0 then expgain = getCreatureStorage(cid, 50002) end doCreatureSetStorage(cid, 50002, getCreatureStorage(cid, 50002) - expgain) local party = false if isInParty(_cid) then local partyMembers, expParty = getPartyMembers(getPartyLeader(_cid)), expgain / 100 * partyPorcent for indice, partyMember in pairs(partyMembers) do attackerLevel, partyLevel = getPlayerLevel(_cid), getPlayerLevel(partyMember) attackerPos, partyPos = getThingPos(_cid), getThingPos(partyMember) x = false if math.abs(attackerLevel - partyLevel) > levelBlockParty then x = true elseif math.abs(attackerPos.x - partyPos.x) > expShareRadiusX then x = true elseif math.abs(attackerPos.y - partyPos.y) > expShareRadiusY then x = true elseif attackerPos.z ~= partyPos.z then x = true elseif _cid == partyMember then x = true end if x then partyMembers[indice] = nil end end if #partyMembers ~= 0 then expParty = math.ceil(expgain / 100 * partyPorcent) expmember = math.ceil(expParty / #partyMembers) for _, member in pairs(partyMembers) do if member ~= _cid then doPlayerSendTextMessage(member, 12, "You received "..expmember.." party exp.") doPlayerAddExp(member, expmember) end end doPlayerSendTextMessage(_cid, 12, "You gain "..expgain.." exp. (" ..partyPorcent.."% send to party)") doPlayerAddExp(_cid, expgain - expParty) party = true else party = false end end if not party then doPlayerSendTextMessage(_cid, 12, "You gain "..expgain.." exp.") doPlayerAddExp(_cid, expgain) end end end end end end return true end function onCombat(cid, target) if isMonster(target) and not isSummon(target) and not isPlayer(target) then registerCreatureEvent(target, "ExpGain") end return true end na mesma pasta procure pelo arquivo login.lua, e em cima de return true, adc a seguinte linha: registerCreatureEvent(cid, "ExpHit") volte na pasta anterior creaturescripts, e procure pelo arquivo creaturescritps.xml e cole as 2 tags: <event type="statschange" name="ExpGain" event="script" value="exphit.lua"/> <event type="combat" name="ExpHit" event="script" value="exphit.lua"/> para configurar a exp, que era configurada no config.lua está no começo do arquivo exphit.lua , e as configurações da party tbem, dos anéis, e até pode ser usado stages agora, segue abaixo o exemplo: -- CONFIGURAÇÕES DE EXPERIENCIA -- useStages = true -- Usar sistema de Stages , true/false premiumMultipliqueExp = 2 -- Players Premiums terão exp multiplicada, caso não querer deixe 1. rateExp = 50 -- Exp caso não for usar stages. local stages = { -- ["DELEVEL-ATELEVEL"] = EXP, (OBS: NUNCA REPETIR O MSM NUMERO, SEMPRE COLOCAR UM A MAIS.) ["1-50"] = 50, ["51-100"] = 45, ["101-150"] = 40, ["151-200"] = 35, ["201-250"] = 30, ["251-300"] = 25, ["351-400"] = 20, } ultimateExp = 15 -- exp que vai usar caso o level do player não tiver mais na tabela . -- CONFIGURAÇÕES DA PARTY partyPorcent = 40 -- Quantos Porcento da exp vai para os membros da party levelBlockParty = 1000 -- Diferença Maxima de Level permitida para membro da party ganhar exp. expShareRadiusX = 30 -- Distancia maxima permitida no eixo X para membro da party ganhar exp. expShareRadiusY = 30 -- Distancia maxima permitida no eixo Y para membro da party ganhar exp. expShareRadiusZ = 1 -- Distancia maxima permitida no eixo Z para membro da party ganhar exp. -- CONFIGURAÇÕES DE RINGS -- local rings = { -- [ID DO ANEL] = EXP MULTIPLICADA POR X EXP. [3048] = 2, [3049] = 4, [3050] = 6, } -- FIM DAS CONFIGURAÇÕES ----
Log V2.0 :
Log V3.0 ( 03/02/2013 ) :
-
Apocalypse recebeu reputação de LeoTK em Exp Por Hit v3.0 - Oficial XotservXInstalação
Primeiramente abra a pasta de seu ot, e procure pelo arquivo config.lua e procure por essas 2 linhas :
experienceStages = false rateExperience = 50 se o experienceStages tiver ativado mude para false, pois o sistema ainda não tem suporte á Stages. e é muito importante o rateExperience tiver como 0, pois ela sera configurada, em outro local agora. exemplo: experienceStages = false rateExperience = 0 agora entre na pasta creaturescripts/scripts e crie um arquivo lua, chamado exphit.lua e cole o seguinte código: -- CONFIGURAÇÕES DE EXPERIENCIA -- useStages = true -- Usar sistema de Stages , true/false premiumMultipliqueExp = 2 -- Players Premiums terão exp multiplicada, caso não querer deixe 1. rateExp = 50 -- Exp caso não for usar stages. local stages = { -- ["DELEVEL-ATELEVEL"] = EXP, (OBS: NUNCA REPETIR O MSM NUMERO, SEMPRE COLOCAR UM A MAIS.) ["1-50"] = 50, ["51-100"] = 45, ["101-150"] = 40, ["151-200"] = 35, ["201-250"] = 30, ["251-300"] = 25, ["351-400"] = 20, } ultimateExp = 15 -- exp que vai usar caso o level do player não tiver mais na tabela . -- CONFIGURAÇÕES DA PARTY partyPorcent = 40 -- Quantos Porcento da exp vai para os membros da party levelBlockParty = 1000 -- Diferença Maxima de Level permitida para membro da party ganhar exp. expShareRadiusX = 30 -- Distancia maxima permitida no eixo X para membro da party ganhar exp. expShareRadiusY = 30 -- Distancia maxima permitida no eixo Y para membro da party ganhar exp. expShareRadiusZ = 1 -- Distancia maxima permitida no eixo Z para membro da party ganhar exp. -- CONFIGURAÇÕES DE RINGS -- local rings = { -- [ID DO ANEL] = EXP MULTIPLICADA POR X EXP. [3048] = 2, [3049] = 4, [3050] = 6, } -- FIM DAS CONFIGURAÇÕES -- function CalculeExp(monsterhp, exptotal, hit) hit = hit <= monsterhp and math.ceil(exptotal * hit / monsterhp) or 0 return hit < 0 and 0 or hit end function isSummon(uid) return uid ~= getCreatureMaster(uid) or false end function onStatsChange(cid, attacker, type, combat, value) if getCreatureStorage(cid, 50001) ~= 1 then doCreatureSetStorage(cid, 50002, getMonsterInfo(getCreatureName(cid)).experience * rateExp) doCreatureSetStorage(cid, 50001, 1) end if type == STATSCHANGE_HEALTHLOSS then if isMonster(cid) then if isSummon(cid) then return true end if isCreature(attacker) then local _cid = isSummon(attacker) and getCreatureMaster(attacker) or attacker if isPlayer(_cid) then if useStages then for strstage, experience in pairs(stages) do tabstage = string.explode(strstage, "-") if getPlayerLevel(_cid) >= tabstage[1] and getPlayerLevel(_cid) <= tabstage[2] then ultimateExp = experience end end experienceRate = ultimateExp else experienceRate = rateExp end local expgain = CalculeExp(getCreatureMaxHealth(cid), getMonsterInfo(getCreatureName(cid)).experience * experienceRate, value) local ringexp = 1 for idring, expring in pairs(rings) do if getPlayerSlotItem(_cid, 9).itemid == idring then ringexp = expring break end end local premiumMultipliqueExp = isPremium(_cid) and premiumMultipliqueExp or 1 expgain = expgain * ringexp * premiumMultipliqueExp if getCreatureStorage(cid, 50002) > 0 then if getCreatureStorage(cid, 50002) - expgain < 0 then expgain = getCreatureStorage(cid, 50002) end doCreatureSetStorage(cid, 50002, getCreatureStorage(cid, 50002) - expgain) local party = false if isInParty(_cid) then local partyMembers, expParty = getPartyMembers(getPartyLeader(_cid)), expgain / 100 * partyPorcent for indice, partyMember in pairs(partyMembers) do attackerLevel, partyLevel = getPlayerLevel(_cid), getPlayerLevel(partyMember) attackerPos, partyPos = getThingPos(_cid), getThingPos(partyMember) x = false if math.abs(attackerLevel - partyLevel) > levelBlockParty then x = true elseif math.abs(attackerPos.x - partyPos.x) > expShareRadiusX then x = true elseif math.abs(attackerPos.y - partyPos.y) > expShareRadiusY then x = true elseif attackerPos.z ~= partyPos.z then x = true elseif _cid == partyMember then x = true end if x then partyMembers[indice] = nil end end if #partyMembers ~= 0 then expParty = math.ceil(expgain / 100 * partyPorcent) expmember = math.ceil(expParty / #partyMembers) for _, member in pairs(partyMembers) do if member ~= _cid then doPlayerSendTextMessage(member, 12, "You received "..expmember.." party exp.") doPlayerAddExp(member, expmember) end end doPlayerSendTextMessage(_cid, 12, "You gain "..expgain.." exp. (" ..partyPorcent.."% send to party)") doPlayerAddExp(_cid, expgain - expParty) party = true else party = false end end if not party then doPlayerSendTextMessage(_cid, 12, "You gain "..expgain.." exp.") doPlayerAddExp(_cid, expgain) end end end end end end return true end function onCombat(cid, target) if isMonster(target) and not isSummon(target) and not isPlayer(target) then registerCreatureEvent(target, "ExpGain") end return true end na mesma pasta procure pelo arquivo login.lua, e em cima de return true, adc a seguinte linha: registerCreatureEvent(cid, "ExpHit") volte na pasta anterior creaturescripts, e procure pelo arquivo creaturescritps.xml e cole as 2 tags: <event type="statschange" name="ExpGain" event="script" value="exphit.lua"/> <event type="combat" name="ExpHit" event="script" value="exphit.lua"/> para configurar a exp, que era configurada no config.lua está no começo do arquivo exphit.lua , e as configurações da party tbem, dos anéis, e até pode ser usado stages agora, segue abaixo o exemplo: -- CONFIGURAÇÕES DE EXPERIENCIA -- useStages = true -- Usar sistema de Stages , true/false premiumMultipliqueExp = 2 -- Players Premiums terão exp multiplicada, caso não querer deixe 1. rateExp = 50 -- Exp caso não for usar stages. local stages = { -- ["DELEVEL-ATELEVEL"] = EXP, (OBS: NUNCA REPETIR O MSM NUMERO, SEMPRE COLOCAR UM A MAIS.) ["1-50"] = 50, ["51-100"] = 45, ["101-150"] = 40, ["151-200"] = 35, ["201-250"] = 30, ["251-300"] = 25, ["351-400"] = 20, } ultimateExp = 15 -- exp que vai usar caso o level do player não tiver mais na tabela . -- CONFIGURAÇÕES DA PARTY partyPorcent = 40 -- Quantos Porcento da exp vai para os membros da party levelBlockParty = 1000 -- Diferença Maxima de Level permitida para membro da party ganhar exp. expShareRadiusX = 30 -- Distancia maxima permitida no eixo X para membro da party ganhar exp. expShareRadiusY = 30 -- Distancia maxima permitida no eixo Y para membro da party ganhar exp. expShareRadiusZ = 1 -- Distancia maxima permitida no eixo Z para membro da party ganhar exp. -- CONFIGURAÇÕES DE RINGS -- local rings = { -- [ID DO ANEL] = EXP MULTIPLICADA POR X EXP. [3048] = 2, [3049] = 4, [3050] = 6, } -- FIM DAS CONFIGURAÇÕES ----
Log V2.0 :
Log V3.0 ( 03/02/2013 ) :
-
Apocalypse recebeu reputação de tev em (Resolvido)[Pedido] Aparecer lista de pksfunction onSay(cid, words, param) local str = "PLAYERS PKS\n\n" for _, pid in pairs(getPlayersOnline()) do if getCreatureSkullType(pid) >= 3 then local skullsType = {"none", "none", "White Skull", "Red Skull", "Black Skull"} str = str .. getCreatureName(pid) .. ", " .. getPlayerLevel(pid) .. ", " .. skullsType[getCreatureSkullType(pid)] .. "\n" end end str = str == "PLAYERS PKS\n\n" and str .. "not found players pks" or str doPlayerPopupFYI(cid, str) return true end
-
Apocalypse recebeu reputação de gmstrikker em CHAMAR UMA VARIVAVEL DA LIBpokes["Bulbasaur"].level
-
Apocalypse recebeu reputação de gmstrikker em [GlobalEvent] Invasão diária de monstrosrealmente eu não percebi tal bug, script feito novamente, e desculpe abandonar o script, na proxima não critique reporte o erro, obrigado !
local configInv = { ["20:14"] = {nome = "The Demon Invasion", pos = {x=32369, y=32167, z=7}, monster = {"50 Demon", "1 The Imperor"}}, ["14:35"] = {nome = "The Massive Dragon Invasion", pos = {x=32368, y=32188, z=8}, monster = {"200 Dragon"}}, } function onThink(interval, lastExecution) local hours = tostring(os.date("%X")):sub(1, 5) if configInv[hours] then if GlobalStorageValue(95473) == hours then return true end doBroadcastMessage(hours .. " - " .. tb.nome .. " iníciou.") for _,x in pairs(tb.monster) do for s = 1, tonumber(x:match("%d+")) do doSummonCreature(x:match("%s(.+)"), tb.pos) end end setGlobalStorageValue(95473, hours) end return true end -
Apocalypse recebeu reputação de gmstrikker em (Resolvido)Ajuda melhorar meu scriptlocal LEVEL_VARIATION = 100 local LOSER_EXP_PER_LEVEL = 5000 function onKill(cid, target, lastHit) if not isPlayer(target) or getCreatureSkullType(target) >= 1 then return true end if getPlayerLevel(target) > 150 then return true end local TARGET_LEVEL_VARIATION = (getPlayerLevel(cid) - getPlayerLevel(target)) if TARGET_LEVEL_VARIATION >= LEVEL_VARIATION then local EXP_PUNISHMENT = TARGET_LEVEL_VARIATION * LOSER_EXP_PER_LEVEL doPlayerSendTextMessage(cid,22,'Voce foi punido por falta de honra! Matou um player com '..TARGET_LEVEL_VARIATION..' leveis de diferenca e perdeu '..EXP_PUNISHMENT..' pontos de exp.') doPlayerAddExp(cid, -EXP_PUNISHMENT) doCreatureSay(cid, "Power Abuse punido!", TALKTYPE_ORANGE_1) end return true end
-
Apocalypse recebeu reputação de gmstrikker em (Resolvido)Ajuda melhorar meu scriptcreio q o erro esta ocorrendo pq vc esta tentando verificar o level do target, sem verificar se o target é um player, ou seja se tem mesmo um level, eu faria assim:
local LEVEL_VARIATION = 100 local LOSER_EXP_PER_LEVEL = 5000 function onKill(cid, target, lastHit) if not isPlayer(target) or getCreatureSkullType(target) >= 1 then return true end local TARGET_LEVEL_VARIATION = (getPlayerLevel(cid) - getPlayerLevel(target)) if TARGET_LEVEL_VARIATION >= LEVEL_VARIATION then local EXP_PUNISHMENT = TARGET_LEVEL_VARIATION * LOSER_EXP_PER_LEVEL doPlayerSendTextMessage(cid,22,'Voce foi punido por falta de honra! Matou um player com '..TARGET_LEVEL_VARIATION..' leveis de diferenca e perdeu '..EXP_PUNISHMENT..' pontos de exp.') doPlayerAddExp(cid, -EXP_PUNISHMENT) doCreatureSay(cid, "Power Abuse punido!", TALKTYPE_ORANGE_1) end return true end -
Apocalypse recebeu reputação de x0wner em [GlobalEvent] Invasão diária de monstrosrealmente eu não percebi tal bug, script feito novamente, e desculpe abandonar o script, na proxima não critique reporte o erro, obrigado !
local configInv = { ["20:14"] = {nome = "The Demon Invasion", pos = {x=32369, y=32167, z=7}, monster = {"50 Demon", "1 The Imperor"}}, ["14:35"] = {nome = "The Massive Dragon Invasion", pos = {x=32368, y=32188, z=8}, monster = {"200 Dragon"}}, } function onThink(interval, lastExecution) local hours = tostring(os.date("%X")):sub(1, 5) if configInv[hours] then if GlobalStorageValue(95473) == hours then return true end doBroadcastMessage(hours .. " - " .. tb.nome .. " iníciou.") for _,x in pairs(tb.monster) do for s = 1, tonumber(x:match("%d+")) do doSummonCreature(x:match("%s(.+)"), tb.pos) end end setGlobalStorageValue(95473, hours) end return true end -
Apocalypse recebeu reputação de Chiitus em [GlobalEvent] Invasão diária de monstrosrealmente eu não percebi tal bug, script feito novamente, e desculpe abandonar o script, na proxima não critique reporte o erro, obrigado !
local configInv = { ["20:14"] = {nome = "The Demon Invasion", pos = {x=32369, y=32167, z=7}, monster = {"50 Demon", "1 The Imperor"}}, ["14:35"] = {nome = "The Massive Dragon Invasion", pos = {x=32368, y=32188, z=8}, monster = {"200 Dragon"}}, } function onThink(interval, lastExecution) local hours = tostring(os.date("%X")):sub(1, 5) if configInv[hours] then if GlobalStorageValue(95473) == hours then return true end doBroadcastMessage(hours .. " - " .. tb.nome .. " iníciou.") for _,x in pairs(tb.monster) do for s = 1, tonumber(x:match("%d+")) do doSummonCreature(x:match("%s(.+)"), tb.pos) end end setGlobalStorageValue(95473, hours) end return true end -
Apocalypse recebeu reputação de 12Bryan12 em Exp Por Hit v3.0 - Oficial XotservXInstalação
Primeiramente abra a pasta de seu ot, e procure pelo arquivo config.lua e procure por essas 2 linhas :
experienceStages = false rateExperience = 50 se o experienceStages tiver ativado mude para false, pois o sistema ainda não tem suporte á Stages. e é muito importante o rateExperience tiver como 0, pois ela sera configurada, em outro local agora. exemplo: experienceStages = false rateExperience = 0 agora entre na pasta creaturescripts/scripts e crie um arquivo lua, chamado exphit.lua e cole o seguinte código: -- CONFIGURAÇÕES DE EXPERIENCIA -- useStages = true -- Usar sistema de Stages , true/false premiumMultipliqueExp = 2 -- Players Premiums terão exp multiplicada, caso não querer deixe 1. rateExp = 50 -- Exp caso não for usar stages. local stages = { -- ["DELEVEL-ATELEVEL"] = EXP, (OBS: NUNCA REPETIR O MSM NUMERO, SEMPRE COLOCAR UM A MAIS.) ["1-50"] = 50, ["51-100"] = 45, ["101-150"] = 40, ["151-200"] = 35, ["201-250"] = 30, ["251-300"] = 25, ["351-400"] = 20, } ultimateExp = 15 -- exp que vai usar caso o level do player não tiver mais na tabela . -- CONFIGURAÇÕES DA PARTY partyPorcent = 40 -- Quantos Porcento da exp vai para os membros da party levelBlockParty = 1000 -- Diferença Maxima de Level permitida para membro da party ganhar exp. expShareRadiusX = 30 -- Distancia maxima permitida no eixo X para membro da party ganhar exp. expShareRadiusY = 30 -- Distancia maxima permitida no eixo Y para membro da party ganhar exp. expShareRadiusZ = 1 -- Distancia maxima permitida no eixo Z para membro da party ganhar exp. -- CONFIGURAÇÕES DE RINGS -- local rings = { -- [ID DO ANEL] = EXP MULTIPLICADA POR X EXP. [3048] = 2, [3049] = 4, [3050] = 6, } -- FIM DAS CONFIGURAÇÕES -- function CalculeExp(monsterhp, exptotal, hit) hit = hit <= monsterhp and math.ceil(exptotal * hit / monsterhp) or 0 return hit < 0 and 0 or hit end function isSummon(uid) return uid ~= getCreatureMaster(uid) or false end function onStatsChange(cid, attacker, type, combat, value) if getCreatureStorage(cid, 50001) ~= 1 then doCreatureSetStorage(cid, 50002, getMonsterInfo(getCreatureName(cid)).experience * rateExp) doCreatureSetStorage(cid, 50001, 1) end if type == STATSCHANGE_HEALTHLOSS then if isMonster(cid) then if isSummon(cid) then return true end if isCreature(attacker) then local _cid = isSummon(attacker) and getCreatureMaster(attacker) or attacker if isPlayer(_cid) then if useStages then for strstage, experience in pairs(stages) do tabstage = string.explode(strstage, "-") if getPlayerLevel(_cid) >= tabstage[1] and getPlayerLevel(_cid) <= tabstage[2] then ultimateExp = experience end end experienceRate = ultimateExp else experienceRate = rateExp end local expgain = CalculeExp(getCreatureMaxHealth(cid), getMonsterInfo(getCreatureName(cid)).experience * experienceRate, value) local ringexp = 1 for idring, expring in pairs(rings) do if getPlayerSlotItem(_cid, 9).itemid == idring then ringexp = expring break end end local premiumMultipliqueExp = isPremium(_cid) and premiumMultipliqueExp or 1 expgain = expgain * ringexp * premiumMultipliqueExp if getCreatureStorage(cid, 50002) > 0 then if getCreatureStorage(cid, 50002) - expgain < 0 then expgain = getCreatureStorage(cid, 50002) end doCreatureSetStorage(cid, 50002, getCreatureStorage(cid, 50002) - expgain) local party = false if isInParty(_cid) then local partyMembers, expParty = getPartyMembers(getPartyLeader(_cid)), expgain / 100 * partyPorcent for indice, partyMember in pairs(partyMembers) do attackerLevel, partyLevel = getPlayerLevel(_cid), getPlayerLevel(partyMember) attackerPos, partyPos = getThingPos(_cid), getThingPos(partyMember) x = false if math.abs(attackerLevel - partyLevel) > levelBlockParty then x = true elseif math.abs(attackerPos.x - partyPos.x) > expShareRadiusX then x = true elseif math.abs(attackerPos.y - partyPos.y) > expShareRadiusY then x = true elseif attackerPos.z ~= partyPos.z then x = true elseif _cid == partyMember then x = true end if x then partyMembers[indice] = nil end end if #partyMembers ~= 0 then expParty = math.ceil(expgain / 100 * partyPorcent) expmember = math.ceil(expParty / #partyMembers) for _, member in pairs(partyMembers) do if member ~= _cid then doPlayerSendTextMessage(member, 12, "You received "..expmember.." party exp.") doPlayerAddExp(member, expmember) end end doPlayerSendTextMessage(_cid, 12, "You gain "..expgain.." exp. (" ..partyPorcent.."% send to party)") doPlayerAddExp(_cid, expgain - expParty) party = true else party = false end end if not party then doPlayerSendTextMessage(_cid, 12, "You gain "..expgain.." exp.") doPlayerAddExp(_cid, expgain) end end end end end end return true end function onCombat(cid, target) if isMonster(target) and not isSummon(target) and not isPlayer(target) then registerCreatureEvent(target, "ExpGain") end return true end na mesma pasta procure pelo arquivo login.lua, e em cima de return true, adc a seguinte linha: registerCreatureEvent(cid, "ExpHit") volte na pasta anterior creaturescripts, e procure pelo arquivo creaturescritps.xml e cole as 2 tags: <event type="statschange" name="ExpGain" event="script" value="exphit.lua"/> <event type="combat" name="ExpHit" event="script" value="exphit.lua"/> para configurar a exp, que era configurada no config.lua está no começo do arquivo exphit.lua , e as configurações da party tbem, dos anéis, e até pode ser usado stages agora, segue abaixo o exemplo: -- CONFIGURAÇÕES DE EXPERIENCIA -- useStages = true -- Usar sistema de Stages , true/false premiumMultipliqueExp = 2 -- Players Premiums terão exp multiplicada, caso não querer deixe 1. rateExp = 50 -- Exp caso não for usar stages. local stages = { -- ["DELEVEL-ATELEVEL"] = EXP, (OBS: NUNCA REPETIR O MSM NUMERO, SEMPRE COLOCAR UM A MAIS.) ["1-50"] = 50, ["51-100"] = 45, ["101-150"] = 40, ["151-200"] = 35, ["201-250"] = 30, ["251-300"] = 25, ["351-400"] = 20, } ultimateExp = 15 -- exp que vai usar caso o level do player não tiver mais na tabela . -- CONFIGURAÇÕES DA PARTY partyPorcent = 40 -- Quantos Porcento da exp vai para os membros da party levelBlockParty = 1000 -- Diferença Maxima de Level permitida para membro da party ganhar exp. expShareRadiusX = 30 -- Distancia maxima permitida no eixo X para membro da party ganhar exp. expShareRadiusY = 30 -- Distancia maxima permitida no eixo Y para membro da party ganhar exp. expShareRadiusZ = 1 -- Distancia maxima permitida no eixo Z para membro da party ganhar exp. -- CONFIGURAÇÕES DE RINGS -- local rings = { -- [ID DO ANEL] = EXP MULTIPLICADA POR X EXP. [3048] = 2, [3049] = 4, [3050] = 6, } -- FIM DAS CONFIGURAÇÕES ----
Log V2.0 :
Log V3.0 ( 03/02/2013 ) :
-
Apocalypse recebeu reputação de Skyforever em Math.potnumero ^ expoente
-
Apocalypse recebeu reputação de Adriano SwaTT em Exp Por Hit v3.0 - Oficial XotservXMonstros dão somente a exp usada no monster.xml vezes a rate do server, ele pode healar toda sua vida, porém se ele ja tiver dado a exp, ele não vai dar mais.
ta no log
-
Apocalypse recebeu reputação de Fabiano Alberto em Exp Por Hit v3.0 - Oficial XotservXInstalação
Primeiramente abra a pasta de seu ot, e procure pelo arquivo config.lua e procure por essas 2 linhas :
experienceStages = false rateExperience = 50 se o experienceStages tiver ativado mude para false, pois o sistema ainda não tem suporte á Stages. e é muito importante o rateExperience tiver como 0, pois ela sera configurada, em outro local agora. exemplo: experienceStages = false rateExperience = 0 agora entre na pasta creaturescripts/scripts e crie um arquivo lua, chamado exphit.lua e cole o seguinte código: -- CONFIGURAÇÕES DE EXPERIENCIA -- useStages = true -- Usar sistema de Stages , true/false premiumMultipliqueExp = 2 -- Players Premiums terão exp multiplicada, caso não querer deixe 1. rateExp = 50 -- Exp caso não for usar stages. local stages = { -- ["DELEVEL-ATELEVEL"] = EXP, (OBS: NUNCA REPETIR O MSM NUMERO, SEMPRE COLOCAR UM A MAIS.) ["1-50"] = 50, ["51-100"] = 45, ["101-150"] = 40, ["151-200"] = 35, ["201-250"] = 30, ["251-300"] = 25, ["351-400"] = 20, } ultimateExp = 15 -- exp que vai usar caso o level do player não tiver mais na tabela . -- CONFIGURAÇÕES DA PARTY partyPorcent = 40 -- Quantos Porcento da exp vai para os membros da party levelBlockParty = 1000 -- Diferença Maxima de Level permitida para membro da party ganhar exp. expShareRadiusX = 30 -- Distancia maxima permitida no eixo X para membro da party ganhar exp. expShareRadiusY = 30 -- Distancia maxima permitida no eixo Y para membro da party ganhar exp. expShareRadiusZ = 1 -- Distancia maxima permitida no eixo Z para membro da party ganhar exp. -- CONFIGURAÇÕES DE RINGS -- local rings = { -- [ID DO ANEL] = EXP MULTIPLICADA POR X EXP. [3048] = 2, [3049] = 4, [3050] = 6, } -- FIM DAS CONFIGURAÇÕES -- function CalculeExp(monsterhp, exptotal, hit) hit = hit <= monsterhp and math.ceil(exptotal * hit / monsterhp) or 0 return hit < 0 and 0 or hit end function isSummon(uid) return uid ~= getCreatureMaster(uid) or false end function onStatsChange(cid, attacker, type, combat, value) if getCreatureStorage(cid, 50001) ~= 1 then doCreatureSetStorage(cid, 50002, getMonsterInfo(getCreatureName(cid)).experience * rateExp) doCreatureSetStorage(cid, 50001, 1) end if type == STATSCHANGE_HEALTHLOSS then if isMonster(cid) then if isSummon(cid) then return true end if isCreature(attacker) then local _cid = isSummon(attacker) and getCreatureMaster(attacker) or attacker if isPlayer(_cid) then if useStages then for strstage, experience in pairs(stages) do tabstage = string.explode(strstage, "-") if getPlayerLevel(_cid) >= tabstage[1] and getPlayerLevel(_cid) <= tabstage[2] then ultimateExp = experience end end experienceRate = ultimateExp else experienceRate = rateExp end local expgain = CalculeExp(getCreatureMaxHealth(cid), getMonsterInfo(getCreatureName(cid)).experience * experienceRate, value) local ringexp = 1 for idring, expring in pairs(rings) do if getPlayerSlotItem(_cid, 9).itemid == idring then ringexp = expring break end end local premiumMultipliqueExp = isPremium(_cid) and premiumMultipliqueExp or 1 expgain = expgain * ringexp * premiumMultipliqueExp if getCreatureStorage(cid, 50002) > 0 then if getCreatureStorage(cid, 50002) - expgain < 0 then expgain = getCreatureStorage(cid, 50002) end doCreatureSetStorage(cid, 50002, getCreatureStorage(cid, 50002) - expgain) local party = false if isInParty(_cid) then local partyMembers, expParty = getPartyMembers(getPartyLeader(_cid)), expgain / 100 * partyPorcent for indice, partyMember in pairs(partyMembers) do attackerLevel, partyLevel = getPlayerLevel(_cid), getPlayerLevel(partyMember) attackerPos, partyPos = getThingPos(_cid), getThingPos(partyMember) x = false if math.abs(attackerLevel - partyLevel) > levelBlockParty then x = true elseif math.abs(attackerPos.x - partyPos.x) > expShareRadiusX then x = true elseif math.abs(attackerPos.y - partyPos.y) > expShareRadiusY then x = true elseif attackerPos.z ~= partyPos.z then x = true elseif _cid == partyMember then x = true end if x then partyMembers[indice] = nil end end if #partyMembers ~= 0 then expParty = math.ceil(expgain / 100 * partyPorcent) expmember = math.ceil(expParty / #partyMembers) for _, member in pairs(partyMembers) do if member ~= _cid then doPlayerSendTextMessage(member, 12, "You received "..expmember.." party exp.") doPlayerAddExp(member, expmember) end end doPlayerSendTextMessage(_cid, 12, "You gain "..expgain.." exp. (" ..partyPorcent.."% send to party)") doPlayerAddExp(_cid, expgain - expParty) party = true else party = false end end if not party then doPlayerSendTextMessage(_cid, 12, "You gain "..expgain.." exp.") doPlayerAddExp(_cid, expgain) end end end end end end return true end function onCombat(cid, target) if isMonster(target) and not isSummon(target) and not isPlayer(target) then registerCreatureEvent(target, "ExpGain") end return true end na mesma pasta procure pelo arquivo login.lua, e em cima de return true, adc a seguinte linha: registerCreatureEvent(cid, "ExpHit") volte na pasta anterior creaturescripts, e procure pelo arquivo creaturescritps.xml e cole as 2 tags: <event type="statschange" name="ExpGain" event="script" value="exphit.lua"/> <event type="combat" name="ExpHit" event="script" value="exphit.lua"/> para configurar a exp, que era configurada no config.lua está no começo do arquivo exphit.lua , e as configurações da party tbem, dos anéis, e até pode ser usado stages agora, segue abaixo o exemplo: -- CONFIGURAÇÕES DE EXPERIENCIA -- useStages = true -- Usar sistema de Stages , true/false premiumMultipliqueExp = 2 -- Players Premiums terão exp multiplicada, caso não querer deixe 1. rateExp = 50 -- Exp caso não for usar stages. local stages = { -- ["DELEVEL-ATELEVEL"] = EXP, (OBS: NUNCA REPETIR O MSM NUMERO, SEMPRE COLOCAR UM A MAIS.) ["1-50"] = 50, ["51-100"] = 45, ["101-150"] = 40, ["151-200"] = 35, ["201-250"] = 30, ["251-300"] = 25, ["351-400"] = 20, } ultimateExp = 15 -- exp que vai usar caso o level do player não tiver mais na tabela . -- CONFIGURAÇÕES DA PARTY partyPorcent = 40 -- Quantos Porcento da exp vai para os membros da party levelBlockParty = 1000 -- Diferença Maxima de Level permitida para membro da party ganhar exp. expShareRadiusX = 30 -- Distancia maxima permitida no eixo X para membro da party ganhar exp. expShareRadiusY = 30 -- Distancia maxima permitida no eixo Y para membro da party ganhar exp. expShareRadiusZ = 1 -- Distancia maxima permitida no eixo Z para membro da party ganhar exp. -- CONFIGURAÇÕES DE RINGS -- local rings = { -- [ID DO ANEL] = EXP MULTIPLICADA POR X EXP. [3048] = 2, [3049] = 4, [3050] = 6, } -- FIM DAS CONFIGURAÇÕES ----
Log V2.0 :
Log V3.0 ( 03/02/2013 ) :
-
Apocalypse recebeu reputação de Vodkart em Exp Por Hit v3.0 - Oficial XotservXInstalação
Primeiramente abra a pasta de seu ot, e procure pelo arquivo config.lua e procure por essas 2 linhas :
experienceStages = false rateExperience = 50 se o experienceStages tiver ativado mude para false, pois o sistema ainda não tem suporte á Stages. e é muito importante o rateExperience tiver como 0, pois ela sera configurada, em outro local agora. exemplo: experienceStages = false rateExperience = 0 agora entre na pasta creaturescripts/scripts e crie um arquivo lua, chamado exphit.lua e cole o seguinte código: -- CONFIGURAÇÕES DE EXPERIENCIA -- useStages = true -- Usar sistema de Stages , true/false premiumMultipliqueExp = 2 -- Players Premiums terão exp multiplicada, caso não querer deixe 1. rateExp = 50 -- Exp caso não for usar stages. local stages = { -- ["DELEVEL-ATELEVEL"] = EXP, (OBS: NUNCA REPETIR O MSM NUMERO, SEMPRE COLOCAR UM A MAIS.) ["1-50"] = 50, ["51-100"] = 45, ["101-150"] = 40, ["151-200"] = 35, ["201-250"] = 30, ["251-300"] = 25, ["351-400"] = 20, } ultimateExp = 15 -- exp que vai usar caso o level do player não tiver mais na tabela . -- CONFIGURAÇÕES DA PARTY partyPorcent = 40 -- Quantos Porcento da exp vai para os membros da party levelBlockParty = 1000 -- Diferença Maxima de Level permitida para membro da party ganhar exp. expShareRadiusX = 30 -- Distancia maxima permitida no eixo X para membro da party ganhar exp. expShareRadiusY = 30 -- Distancia maxima permitida no eixo Y para membro da party ganhar exp. expShareRadiusZ = 1 -- Distancia maxima permitida no eixo Z para membro da party ganhar exp. -- CONFIGURAÇÕES DE RINGS -- local rings = { -- [ID DO ANEL] = EXP MULTIPLICADA POR X EXP. [3048] = 2, [3049] = 4, [3050] = 6, } -- FIM DAS CONFIGURAÇÕES -- function CalculeExp(monsterhp, exptotal, hit) hit = hit <= monsterhp and math.ceil(exptotal * hit / monsterhp) or 0 return hit < 0 and 0 or hit end function isSummon(uid) return uid ~= getCreatureMaster(uid) or false end function onStatsChange(cid, attacker, type, combat, value) if getCreatureStorage(cid, 50001) ~= 1 then doCreatureSetStorage(cid, 50002, getMonsterInfo(getCreatureName(cid)).experience * rateExp) doCreatureSetStorage(cid, 50001, 1) end if type == STATSCHANGE_HEALTHLOSS then if isMonster(cid) then if isSummon(cid) then return true end if isCreature(attacker) then local _cid = isSummon(attacker) and getCreatureMaster(attacker) or attacker if isPlayer(_cid) then if useStages then for strstage, experience in pairs(stages) do tabstage = string.explode(strstage, "-") if getPlayerLevel(_cid) >= tabstage[1] and getPlayerLevel(_cid) <= tabstage[2] then ultimateExp = experience end end experienceRate = ultimateExp else experienceRate = rateExp end local expgain = CalculeExp(getCreatureMaxHealth(cid), getMonsterInfo(getCreatureName(cid)).experience * experienceRate, value) local ringexp = 1 for idring, expring in pairs(rings) do if getPlayerSlotItem(_cid, 9).itemid == idring then ringexp = expring break end end local premiumMultipliqueExp = isPremium(_cid) and premiumMultipliqueExp or 1 expgain = expgain * ringexp * premiumMultipliqueExp if getCreatureStorage(cid, 50002) > 0 then if getCreatureStorage(cid, 50002) - expgain < 0 then expgain = getCreatureStorage(cid, 50002) end doCreatureSetStorage(cid, 50002, getCreatureStorage(cid, 50002) - expgain) local party = false if isInParty(_cid) then local partyMembers, expParty = getPartyMembers(getPartyLeader(_cid)), expgain / 100 * partyPorcent for indice, partyMember in pairs(partyMembers) do attackerLevel, partyLevel = getPlayerLevel(_cid), getPlayerLevel(partyMember) attackerPos, partyPos = getThingPos(_cid), getThingPos(partyMember) x = false if math.abs(attackerLevel - partyLevel) > levelBlockParty then x = true elseif math.abs(attackerPos.x - partyPos.x) > expShareRadiusX then x = true elseif math.abs(attackerPos.y - partyPos.y) > expShareRadiusY then x = true elseif attackerPos.z ~= partyPos.z then x = true elseif _cid == partyMember then x = true end if x then partyMembers[indice] = nil end end if #partyMembers ~= 0 then expParty = math.ceil(expgain / 100 * partyPorcent) expmember = math.ceil(expParty / #partyMembers) for _, member in pairs(partyMembers) do if member ~= _cid then doPlayerSendTextMessage(member, 12, "You received "..expmember.." party exp.") doPlayerAddExp(member, expmember) end end doPlayerSendTextMessage(_cid, 12, "You gain "..expgain.." exp. (" ..partyPorcent.."% send to party)") doPlayerAddExp(_cid, expgain - expParty) party = true else party = false end end if not party then doPlayerSendTextMessage(_cid, 12, "You gain "..expgain.." exp.") doPlayerAddExp(_cid, expgain) end end end end end end return true end function onCombat(cid, target) if isMonster(target) and not isSummon(target) and not isPlayer(target) then registerCreatureEvent(target, "ExpGain") end return true end na mesma pasta procure pelo arquivo login.lua, e em cima de return true, adc a seguinte linha: registerCreatureEvent(cid, "ExpHit") volte na pasta anterior creaturescripts, e procure pelo arquivo creaturescritps.xml e cole as 2 tags: <event type="statschange" name="ExpGain" event="script" value="exphit.lua"/> <event type="combat" name="ExpHit" event="script" value="exphit.lua"/> para configurar a exp, que era configurada no config.lua está no começo do arquivo exphit.lua , e as configurações da party tbem, dos anéis, e até pode ser usado stages agora, segue abaixo o exemplo: -- CONFIGURAÇÕES DE EXPERIENCIA -- useStages = true -- Usar sistema de Stages , true/false premiumMultipliqueExp = 2 -- Players Premiums terão exp multiplicada, caso não querer deixe 1. rateExp = 50 -- Exp caso não for usar stages. local stages = { -- ["DELEVEL-ATELEVEL"] = EXP, (OBS: NUNCA REPETIR O MSM NUMERO, SEMPRE COLOCAR UM A MAIS.) ["1-50"] = 50, ["51-100"] = 45, ["101-150"] = 40, ["151-200"] = 35, ["201-250"] = 30, ["251-300"] = 25, ["351-400"] = 20, } ultimateExp = 15 -- exp que vai usar caso o level do player não tiver mais na tabela . -- CONFIGURAÇÕES DA PARTY partyPorcent = 40 -- Quantos Porcento da exp vai para os membros da party levelBlockParty = 1000 -- Diferença Maxima de Level permitida para membro da party ganhar exp. expShareRadiusX = 30 -- Distancia maxima permitida no eixo X para membro da party ganhar exp. expShareRadiusY = 30 -- Distancia maxima permitida no eixo Y para membro da party ganhar exp. expShareRadiusZ = 1 -- Distancia maxima permitida no eixo Z para membro da party ganhar exp. -- CONFIGURAÇÕES DE RINGS -- local rings = { -- [ID DO ANEL] = EXP MULTIPLICADA POR X EXP. [3048] = 2, [3049] = 4, [3050] = 6, } -- FIM DAS CONFIGURAÇÕES ----
Log V2.0 :
Log V3.0 ( 03/02/2013 ) :
-
Apocalypse recebeu reputação de Puncker em Exp Por Hit v3.0 - Oficial XotservXInstalação
Primeiramente abra a pasta de seu ot, e procure pelo arquivo config.lua e procure por essas 2 linhas :
experienceStages = false rateExperience = 50 se o experienceStages tiver ativado mude para false, pois o sistema ainda não tem suporte á Stages. e é muito importante o rateExperience tiver como 0, pois ela sera configurada, em outro local agora. exemplo: experienceStages = false rateExperience = 0 agora entre na pasta creaturescripts/scripts e crie um arquivo lua, chamado exphit.lua e cole o seguinte código: -- CONFIGURAÇÕES DE EXPERIENCIA -- useStages = true -- Usar sistema de Stages , true/false premiumMultipliqueExp = 2 -- Players Premiums terão exp multiplicada, caso não querer deixe 1. rateExp = 50 -- Exp caso não for usar stages. local stages = { -- ["DELEVEL-ATELEVEL"] = EXP, (OBS: NUNCA REPETIR O MSM NUMERO, SEMPRE COLOCAR UM A MAIS.) ["1-50"] = 50, ["51-100"] = 45, ["101-150"] = 40, ["151-200"] = 35, ["201-250"] = 30, ["251-300"] = 25, ["351-400"] = 20, } ultimateExp = 15 -- exp que vai usar caso o level do player não tiver mais na tabela . -- CONFIGURAÇÕES DA PARTY partyPorcent = 40 -- Quantos Porcento da exp vai para os membros da party levelBlockParty = 1000 -- Diferença Maxima de Level permitida para membro da party ganhar exp. expShareRadiusX = 30 -- Distancia maxima permitida no eixo X para membro da party ganhar exp. expShareRadiusY = 30 -- Distancia maxima permitida no eixo Y para membro da party ganhar exp. expShareRadiusZ = 1 -- Distancia maxima permitida no eixo Z para membro da party ganhar exp. -- CONFIGURAÇÕES DE RINGS -- local rings = { -- [ID DO ANEL] = EXP MULTIPLICADA POR X EXP. [3048] = 2, [3049] = 4, [3050] = 6, } -- FIM DAS CONFIGURAÇÕES -- function CalculeExp(monsterhp, exptotal, hit) hit = hit <= monsterhp and math.ceil(exptotal * hit / monsterhp) or 0 return hit < 0 and 0 or hit end function isSummon(uid) return uid ~= getCreatureMaster(uid) or false end function onStatsChange(cid, attacker, type, combat, value) if getCreatureStorage(cid, 50001) ~= 1 then doCreatureSetStorage(cid, 50002, getMonsterInfo(getCreatureName(cid)).experience * rateExp) doCreatureSetStorage(cid, 50001, 1) end if type == STATSCHANGE_HEALTHLOSS then if isMonster(cid) then if isSummon(cid) then return true end if isCreature(attacker) then local _cid = isSummon(attacker) and getCreatureMaster(attacker) or attacker if isPlayer(_cid) then if useStages then for strstage, experience in pairs(stages) do tabstage = string.explode(strstage, "-") if getPlayerLevel(_cid) >= tabstage[1] and getPlayerLevel(_cid) <= tabstage[2] then ultimateExp = experience end end experienceRate = ultimateExp else experienceRate = rateExp end local expgain = CalculeExp(getCreatureMaxHealth(cid), getMonsterInfo(getCreatureName(cid)).experience * experienceRate, value) local ringexp = 1 for idring, expring in pairs(rings) do if getPlayerSlotItem(_cid, 9).itemid == idring then ringexp = expring break end end local premiumMultipliqueExp = isPremium(_cid) and premiumMultipliqueExp or 1 expgain = expgain * ringexp * premiumMultipliqueExp if getCreatureStorage(cid, 50002) > 0 then if getCreatureStorage(cid, 50002) - expgain < 0 then expgain = getCreatureStorage(cid, 50002) end doCreatureSetStorage(cid, 50002, getCreatureStorage(cid, 50002) - expgain) local party = false if isInParty(_cid) then local partyMembers, expParty = getPartyMembers(getPartyLeader(_cid)), expgain / 100 * partyPorcent for indice, partyMember in pairs(partyMembers) do attackerLevel, partyLevel = getPlayerLevel(_cid), getPlayerLevel(partyMember) attackerPos, partyPos = getThingPos(_cid), getThingPos(partyMember) x = false if math.abs(attackerLevel - partyLevel) > levelBlockParty then x = true elseif math.abs(attackerPos.x - partyPos.x) > expShareRadiusX then x = true elseif math.abs(attackerPos.y - partyPos.y) > expShareRadiusY then x = true elseif attackerPos.z ~= partyPos.z then x = true elseif _cid == partyMember then x = true end if x then partyMembers[indice] = nil end end if #partyMembers ~= 0 then expParty = math.ceil(expgain / 100 * partyPorcent) expmember = math.ceil(expParty / #partyMembers) for _, member in pairs(partyMembers) do if member ~= _cid then doPlayerSendTextMessage(member, 12, "You received "..expmember.." party exp.") doPlayerAddExp(member, expmember) end end doPlayerSendTextMessage(_cid, 12, "You gain "..expgain.." exp. (" ..partyPorcent.."% send to party)") doPlayerAddExp(_cid, expgain - expParty) party = true else party = false end end if not party then doPlayerSendTextMessage(_cid, 12, "You gain "..expgain.." exp.") doPlayerAddExp(_cid, expgain) end end end end end end return true end function onCombat(cid, target) if isMonster(target) and not isSummon(target) and not isPlayer(target) then registerCreatureEvent(target, "ExpGain") end return true end na mesma pasta procure pelo arquivo login.lua, e em cima de return true, adc a seguinte linha: registerCreatureEvent(cid, "ExpHit") volte na pasta anterior creaturescripts, e procure pelo arquivo creaturescritps.xml e cole as 2 tags: <event type="statschange" name="ExpGain" event="script" value="exphit.lua"/> <event type="combat" name="ExpHit" event="script" value="exphit.lua"/> para configurar a exp, que era configurada no config.lua está no começo do arquivo exphit.lua , e as configurações da party tbem, dos anéis, e até pode ser usado stages agora, segue abaixo o exemplo: -- CONFIGURAÇÕES DE EXPERIENCIA -- useStages = true -- Usar sistema de Stages , true/false premiumMultipliqueExp = 2 -- Players Premiums terão exp multiplicada, caso não querer deixe 1. rateExp = 50 -- Exp caso não for usar stages. local stages = { -- ["DELEVEL-ATELEVEL"] = EXP, (OBS: NUNCA REPETIR O MSM NUMERO, SEMPRE COLOCAR UM A MAIS.) ["1-50"] = 50, ["51-100"] = 45, ["101-150"] = 40, ["151-200"] = 35, ["201-250"] = 30, ["251-300"] = 25, ["351-400"] = 20, } ultimateExp = 15 -- exp que vai usar caso o level do player não tiver mais na tabela . -- CONFIGURAÇÕES DA PARTY partyPorcent = 40 -- Quantos Porcento da exp vai para os membros da party levelBlockParty = 1000 -- Diferença Maxima de Level permitida para membro da party ganhar exp. expShareRadiusX = 30 -- Distancia maxima permitida no eixo X para membro da party ganhar exp. expShareRadiusY = 30 -- Distancia maxima permitida no eixo Y para membro da party ganhar exp. expShareRadiusZ = 1 -- Distancia maxima permitida no eixo Z para membro da party ganhar exp. -- CONFIGURAÇÕES DE RINGS -- local rings = { -- [ID DO ANEL] = EXP MULTIPLICADA POR X EXP. [3048] = 2, [3049] = 4, [3050] = 6, } -- FIM DAS CONFIGURAÇÕES ----
Log V2.0 :
Log V3.0 ( 03/02/2013 ) :
-
Apocalypse recebeu reputação de Adriano SwaTT em Exp Por Hit v3.0 - Oficial XotservXInstalação
Primeiramente abra a pasta de seu ot, e procure pelo arquivo config.lua e procure por essas 2 linhas :
experienceStages = false rateExperience = 50 se o experienceStages tiver ativado mude para false, pois o sistema ainda não tem suporte á Stages. e é muito importante o rateExperience tiver como 0, pois ela sera configurada, em outro local agora. exemplo: experienceStages = false rateExperience = 0 agora entre na pasta creaturescripts/scripts e crie um arquivo lua, chamado exphit.lua e cole o seguinte código: -- CONFIGURAÇÕES DE EXPERIENCIA -- useStages = true -- Usar sistema de Stages , true/false premiumMultipliqueExp = 2 -- Players Premiums terão exp multiplicada, caso não querer deixe 1. rateExp = 50 -- Exp caso não for usar stages. local stages = { -- ["DELEVEL-ATELEVEL"] = EXP, (OBS: NUNCA REPETIR O MSM NUMERO, SEMPRE COLOCAR UM A MAIS.) ["1-50"] = 50, ["51-100"] = 45, ["101-150"] = 40, ["151-200"] = 35, ["201-250"] = 30, ["251-300"] = 25, ["351-400"] = 20, } ultimateExp = 15 -- exp que vai usar caso o level do player não tiver mais na tabela . -- CONFIGURAÇÕES DA PARTY partyPorcent = 40 -- Quantos Porcento da exp vai para os membros da party levelBlockParty = 1000 -- Diferença Maxima de Level permitida para membro da party ganhar exp. expShareRadiusX = 30 -- Distancia maxima permitida no eixo X para membro da party ganhar exp. expShareRadiusY = 30 -- Distancia maxima permitida no eixo Y para membro da party ganhar exp. expShareRadiusZ = 1 -- Distancia maxima permitida no eixo Z para membro da party ganhar exp. -- CONFIGURAÇÕES DE RINGS -- local rings = { -- [ID DO ANEL] = EXP MULTIPLICADA POR X EXP. [3048] = 2, [3049] = 4, [3050] = 6, } -- FIM DAS CONFIGURAÇÕES -- function CalculeExp(monsterhp, exptotal, hit) hit = hit <= monsterhp and math.ceil(exptotal * hit / monsterhp) or 0 return hit < 0 and 0 or hit end function isSummon(uid) return uid ~= getCreatureMaster(uid) or false end function onStatsChange(cid, attacker, type, combat, value) if getCreatureStorage(cid, 50001) ~= 1 then doCreatureSetStorage(cid, 50002, getMonsterInfo(getCreatureName(cid)).experience * rateExp) doCreatureSetStorage(cid, 50001, 1) end if type == STATSCHANGE_HEALTHLOSS then if isMonster(cid) then if isSummon(cid) then return true end if isCreature(attacker) then local _cid = isSummon(attacker) and getCreatureMaster(attacker) or attacker if isPlayer(_cid) then if useStages then for strstage, experience in pairs(stages) do tabstage = string.explode(strstage, "-") if getPlayerLevel(_cid) >= tabstage[1] and getPlayerLevel(_cid) <= tabstage[2] then ultimateExp = experience end end experienceRate = ultimateExp else experienceRate = rateExp end local expgain = CalculeExp(getCreatureMaxHealth(cid), getMonsterInfo(getCreatureName(cid)).experience * experienceRate, value) local ringexp = 1 for idring, expring in pairs(rings) do if getPlayerSlotItem(_cid, 9).itemid == idring then ringexp = expring break end end local premiumMultipliqueExp = isPremium(_cid) and premiumMultipliqueExp or 1 expgain = expgain * ringexp * premiumMultipliqueExp if getCreatureStorage(cid, 50002) > 0 then if getCreatureStorage(cid, 50002) - expgain < 0 then expgain = getCreatureStorage(cid, 50002) end doCreatureSetStorage(cid, 50002, getCreatureStorage(cid, 50002) - expgain) local party = false if isInParty(_cid) then local partyMembers, expParty = getPartyMembers(getPartyLeader(_cid)), expgain / 100 * partyPorcent for indice, partyMember in pairs(partyMembers) do attackerLevel, partyLevel = getPlayerLevel(_cid), getPlayerLevel(partyMember) attackerPos, partyPos = getThingPos(_cid), getThingPos(partyMember) x = false if math.abs(attackerLevel - partyLevel) > levelBlockParty then x = true elseif math.abs(attackerPos.x - partyPos.x) > expShareRadiusX then x = true elseif math.abs(attackerPos.y - partyPos.y) > expShareRadiusY then x = true elseif attackerPos.z ~= partyPos.z then x = true elseif _cid == partyMember then x = true end if x then partyMembers[indice] = nil end end if #partyMembers ~= 0 then expParty = math.ceil(expgain / 100 * partyPorcent) expmember = math.ceil(expParty / #partyMembers) for _, member in pairs(partyMembers) do if member ~= _cid then doPlayerSendTextMessage(member, 12, "You received "..expmember.." party exp.") doPlayerAddExp(member, expmember) end end doPlayerSendTextMessage(_cid, 12, "You gain "..expgain.." exp. (" ..partyPorcent.."% send to party)") doPlayerAddExp(_cid, expgain - expParty) party = true else party = false end end if not party then doPlayerSendTextMessage(_cid, 12, "You gain "..expgain.." exp.") doPlayerAddExp(_cid, expgain) end end end end end end return true end function onCombat(cid, target) if isMonster(target) and not isSummon(target) and not isPlayer(target) then registerCreatureEvent(target, "ExpGain") end return true end na mesma pasta procure pelo arquivo login.lua, e em cima de return true, adc a seguinte linha: registerCreatureEvent(cid, "ExpHit") volte na pasta anterior creaturescripts, e procure pelo arquivo creaturescritps.xml e cole as 2 tags: <event type="statschange" name="ExpGain" event="script" value="exphit.lua"/> <event type="combat" name="ExpHit" event="script" value="exphit.lua"/> para configurar a exp, que era configurada no config.lua está no começo do arquivo exphit.lua , e as configurações da party tbem, dos anéis, e até pode ser usado stages agora, segue abaixo o exemplo: -- CONFIGURAÇÕES DE EXPERIENCIA -- useStages = true -- Usar sistema de Stages , true/false premiumMultipliqueExp = 2 -- Players Premiums terão exp multiplicada, caso não querer deixe 1. rateExp = 50 -- Exp caso não for usar stages. local stages = { -- ["DELEVEL-ATELEVEL"] = EXP, (OBS: NUNCA REPETIR O MSM NUMERO, SEMPRE COLOCAR UM A MAIS.) ["1-50"] = 50, ["51-100"] = 45, ["101-150"] = 40, ["151-200"] = 35, ["201-250"] = 30, ["251-300"] = 25, ["351-400"] = 20, } ultimateExp = 15 -- exp que vai usar caso o level do player não tiver mais na tabela . -- CONFIGURAÇÕES DA PARTY partyPorcent = 40 -- Quantos Porcento da exp vai para os membros da party levelBlockParty = 1000 -- Diferença Maxima de Level permitida para membro da party ganhar exp. expShareRadiusX = 30 -- Distancia maxima permitida no eixo X para membro da party ganhar exp. expShareRadiusY = 30 -- Distancia maxima permitida no eixo Y para membro da party ganhar exp. expShareRadiusZ = 1 -- Distancia maxima permitida no eixo Z para membro da party ganhar exp. -- CONFIGURAÇÕES DE RINGS -- local rings = { -- [ID DO ANEL] = EXP MULTIPLICADA POR X EXP. [3048] = 2, [3049] = 4, [3050] = 6, } -- FIM DAS CONFIGURAÇÕES ----
Log V2.0 :
Log V3.0 ( 03/02/2013 ) :