Ir para conteúdo

Mehahbr

Campones
  • Total de itens

    15
  • Registro em

  • Última visita

Tudo que Mehahbr postou

  1. Eu mesmo refiz o script aqui e deu certo... irei deixa aqui para todos verem [b]--------------------->> Criado por Mehah <<---------------[/b] [b]--------->> Refeito o Script do xOtServx( Eu) <<---------[/b] [b]------> Considerando os valores de Level e EXP <<--------[/b] [b]rateExp = 100 -- 0 a 100[/b] [b]rateExp1 = 80 -- 101 a 125[/b] [b]rateExp2 = 60 -- 126 a 150[/b] [b]rateExp3 = 40 -- 151 a 200[/b] [b]rateExp4 = 20 -- 201 a 250[/b] [b]rateExp5 = 10 -- 251 a 300[/b] [b]rateExp6 = 5 -- 301 a 400[/b] [b]rateExp7 = 3 -- 401 a 450[/b] [b]rateExp8 = 1 -- 451[/b] [b]bonus = 1 -- Bonus por estar com exp ring[/b] [b]expringid = 1000 -- Id do exp ring[/b] [b]------------------------------[/b] [b]function CalculeExp(monsterhp, exptotal, hit)[/b] [b]local x = hit <= monsterhp and math.ceil(exptotal * hit / monsterhp) or 0[/b] [b]local x2 = x - 20 + math.random(20)[/b] [b]return x2 > 0 and x2 or 0[/b] [b]end[/b] [b]function isSummon(uid)[/b] [b]return uid ~= getCreatureMaster(uid) or false[/b] [b]end[/b] [b]function onStatsChange(cid, attacker, type, combat, value)[/b] [b]if type == STATSCHANGE_HEALTHLOSS then[/b] [b]if isMonster(cid) then[/b] [b]if isCreature(attacker) then[/b] [b]local sid = isSummon(attacker) == true and getCreatureMaster(attacker) or attacker[/b] [b]if isPlayer(sid) and getPlayerLevel(sid) <= 100 then[/b] [b]local expg = CalculeExp(getCreatureMaxHealth(cid), getMonsterInfo(getCreatureName(cid)).experience * rateExp, value)[/b] [b]doPlayerSendTextMessage(sid, 23, "Você Ganhou "..expg.." exp.")[/b] [b]doPlayerAddExp(sid, expg)[/b] [b]elseif isPlayer(sid) and getPlayerLevel(sid) > 100 and getPlayerLevel(sid) <= 125 then[/b] [b]local expg1 = CalculeExp(getCreatureMaxHealth(cid), getMonsterInfo(getCreatureName(cid)).experience * rateExp1, value)[/b] [b]doPlayerSendTextMessage(sid, 23, "Você Ganhou "..expg1.." exp.")[/b] [b]doSendAnimatedText(getThingPos(sid), expg1, 215)[/b] [b]doPlayerAddExp(sid, expg1)[/b] [b]elseif isPlayer(sid) and getPlayerLevel(sid) > 125 and getPlayerLevel(sid) <= 150 then[/b] [b]local expg2 = CalculeExp(getCreatureMaxHealth(cid), getMonsterInfo(getCreatureName(cid)).experience * rateExp2, value)[/b] [b]doPlayerSendTextMessage(sid, 23, "Você Ganhou "..expg2.." exp.")[/b] [b]doSendAnimatedText(getThingPos(sid), expg2, 215)[/b] [b]doPlayerAddExp(sid, expg2)[/b] [b]elseif isPlayer(sid) and getPlayerLevel(sid) > 150 and getPlayerLevel(sid) <= 200 then[/b] [b]local expg3 = CalculeExp(getCreatureMaxHealth(cid), getMonsterInfo(getCreatureName(cid)).experience * rateExp3, value)[/b] [b]doPlayerSendTextMessage(sid, 23, "Você Ganhou "..expg3.." exp.")[/b] [b]doSendAnimatedText(getThingPos(sid), expg3, 215)[/b] [b]doPlayerAddExp(sid, expg3)[/b] [b]elseif isPlayer(sid) and getPlayerLevel(sid) > 200 and getPlayerLevel(sid) <= 250 then[/b] [b]local expg4 = CalculeExp(getCreatureMaxHealth(cid), getMonsterInfo(getCreatureName(cid)).experience * rateExp4, value)[/b] [b]doPlayerSendTextMessage(sid, 23, "Você Ganhou "..expg4.." exp.")[/b] [b]doSendAnimatedText(getThingPos(sid), expg4, 215)[/b] [b]doPlayerAddExp(sid, expg4)[/b] [b]elseif isPlayer(sid) and getPlayerLevel(sid) > 250 and getPlayerLevel(sid) <= 300 then[/b] [b]local expg5 = CalculeExp(getCreatureMaxHealth(cid), getMonsterInfo(getCreatureName(cid)).experience * rateExp5, value)[/b] [b]doPlayerSendTextMessage(sid, 23, "Você Ganhou "..expg5.." exp.")[/b] [b]doSendAnimatedText(getThingPos(sid), expg5, 215)[/b] [b]doPlayerAddExp(sid, expg5)[/b] [b]elseif isPlayer(sid) and getPlayerLevel(sid) > 300 and getPlayerLevel(sid) <= 450 then[/b] [b]local expg6 = CalculeExp(getCreatureMaxHealth(cid), getMonsterInfo(getCreatureName(cid)).experience * rateExp6, value)[/b] [b]doPlayerSendTextMessage(sid, 23, "Você Ganhou "..expg6.." exp.")[/b] [b]doSendAnimatedText(getThingPos(sid), expg6, 215)[/b] [b]doPlayerAddExp(sid, expg6)[/b] [b]elseif isPlayer(sid) and getPlayerLevel(sid) > 400 and getPlayerLevel(sid) <= 400 then[/b] [b]local expg7 = CalculeExp(getCreatureMaxHealth(cid), getMonsterInfo(getCreatureName(cid)).experience * rateExp7, value)[/b] [b]doPlayerSendTextMessage(sid, 23, "Você Ganhou "..expg7.." exp.")[/b] [b]doSendAnimatedText(getThingPos(sid), expg7, 215)[/b] [b]doPlayerAddExp(sid, expg7)[/b] [b]elseif isPlayer(sid) and getPlayerLevel(sid) > 450 then[/b] [b]local expg8 = CalculeExp(getCreatureMaxHealth(cid), getMonsterInfo(getCreatureName(cid)).experience * rateExp8, value)[/b] [b]doPlayerSendTextMessage(sid, 23, "Você Ganhou "..expg8.." exp.")[/b] [b]doSendAnimatedText(getThingPos(sid), expg8, 215)[/b] [b]doPlayerAddExp(sid, expg8)[/b] [b]end[/b] [b]end[/b] [b]end[/b] [b]elseif type == STATSCHANGE_HEALTHGAIN then[/b] [b]return false[/b] [b]end[/b] [b]return true[/b] [b]end[/b] [b]function onCombat(cid, target)[/b] [b]if isMonster(target) and not isSummon(target) and not isPlayer(target) then[/b] [b]registerCreatureEvent(target, "ExpGain")[/b] [b]end[/b] [b]return true[/b] [b]end[/b]
  2. muito obrigado garoto... te agradeco de coracao
  3. mano tipo eu sei que ele funciona so que ele nao fala no NPC Chat entende.? Queria por apra ele falar no NPC Chat .... AJudeemm... Thankss
  4. local focus = 0 local talk_start = 0 local target = 0 local following = false local attacking = false function onThingMove(creature, thing, oldpos, oldstackpos) end function onCreatureAppear(creature) end function onCreatureDisappear(cid, pos) if focus == cid then selfSay('Good bye then.') focus = 0 talk_start = 0 end end function onCreatureTurn(creature) end function msgcontains(txt, str) return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)')) end function onCreatureSay(cid, type, msg) msg = string.lower(msg) if (msgcontains(msg, 'hi') and focus == 0) and getDistanceToCreature(cid) < 4 then selfSay('Ola ' .. getCreatureName(cid) .. '! Eu vendo parcel, letter e ticket de viagem!') focus = cid talk_start = os.clock() elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then selfSay('Sorry, ' .. getCreatureName(cid) .. '! I talk with you in one minute.') elseif msgcontains(msg, 'ticket city') then selfSay('Voce tem os 1000 gold coin para comprar 1 ticket of city?') talk_state = 1 talk_start = os.clock() elseif talk_state == 1 and msgcontains(msg, 'yes') then if doPlayerRemoveMoney(cid,1000) == TRUE then selfSay('Parabens! Voce adquiriu um item!') local item1 = doPlayerAddItem(cid,1969,1) doItemSetAttribute(item1,"text","[Air Ticket]: Passaport\nDestination: GM Island.") doItemSetAttribute(item1,"name","GM Island Passaport") else selfSay('Desculpe, voce nao tem dinheiro suficiente!') end elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then selfSay('Bye ' .. getCreatureName(cid) .. ', Come back.') focus = 0 talk_start = 0 elseif msgcontains(msg, 'kashsauahsuacuyio') then selfSay('What?') talk_state = 0 end end function onCreatureChangeOutfit(creature) end function onThink() doNpcSetCreatureFocus(focus) if (os.clock() - talk_start) > 30 then if focus > 0 then selfSay('Next...') end focus = 0 talk_start = 0 end if focus ~= 0 then if getDistanceToCreature(focus) > 5 then selfSay('Good Bye') focus = 0 talk_start = 0 end end end Como passo esse npc para versao 8.6? Obrigado...
  5. Mehahbr

    [Ajuda] Npc System

    Eu tenho um npc feito na forma de tibia 7.92 encriptado assim local focus = 0 local talk_start = 0 local target = 0 local following = false local attacking = false function onThingMove(creature, thing, oldpos, oldstackpos) end function onCreatureAppear(creature) end function onCreatureDisappear(cid, pos) if focus == cid then selfSay('Good bye then.') focus = 0 talk_start = 0 end end function onCreatureTurn(creature) end function msgcontains(txt, str) return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)')) end function onCreatureSay(cid, type, msg) msg = string.lower(msg) if (msgcontains(msg, 'hi') and focus == 0) and getDistanceToCreature(cid) < 4 then selfSay('Ola ' .. getCreatureName(cid) .. '! Eu vendo parcel, letter e ticket de viagem!') focus = cid talk_start = os.clock() elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then selfSay('Sorry, ' .. getCreatureName(cid) .. '! I talk with you in one minute.') elseif msgcontains(msg, 'ticket city') then selfSay('Voce tem os 1000 gold coin para comprar 1 ticket of city?') talk_state = 1 talk_start = os.clock() elseif talk_state == 1 and msgcontains(msg, 'yes') then if doPlayerRemoveMoney(cid,1000) == TRUE then selfSay('Parabens! Voce adquiriu um item!') local item1 = doPlayerAddItem(cid,1969,1) doItemSetAttribute(item1,"text","[Air Ticket]: Passaport\nDestination: GM Island.") doItemSetAttribute(item1,"name","GM Island Passaport") else selfSay('Desculpe, voce nao tem dinheiro suficiente!') end elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then selfSay('Bye ' .. getCreatureName(cid) .. ', Come back.') focus = 0 talk_start = 0 elseif msgcontains(msg, 'kashsauahsuacuyio') then selfSay('What?') talk_state = 0 end end function onCreatureChangeOutfit(creature) end function onThink() doNpcSetCreatureFocus(focus) if (os.clock() - talk_start) > 30 then if focus > 0 then selfSay('Next...') end focus = 0 talk_start = 0 end if focus ~= 0 then if getDistanceToCreature(focus) > 5 then selfSay('Good Bye') focus = 0 talk_start = 0 end end end Como faco para por ele na versao atual tipo que fala no chat de npc e tals... '-' Obrigado pela Ajuda...
  6. Deu erro tambem :S
  7. Mehahbr

    [Script Erro] Ajudem

    Estou com um erro no meu script... toda vez que eu ataco um bicho, no executavel do server aparece este erro: E o Script exphit.lua é esse: -- ExpHit por Stage by Uissu local rateExp = getConfigValue('rateExperience') or 1 local useStages = true local tableStages = { -- {min,max or -1,rate} {1,75,200},{76,150,100},{151,200,50},{201,275,35},{276,300,25},{301,350,15},{351,375,10},{376,400,5},{401,425,3},{426,-1,1} } function getPlayerStageRate(cid, table) -- by Uissu for _,v in ipairs(table) do if getPlayerLevel(cid) >= v[1] and (v[2] == -1 or getPlayerLevel(cid) <= v[2]) then rate = v[3] break end end return rate end function CalculeExp(monsterhp, exptotal, hit) local x = hit <= monsterhp and math.ceil(exptotal * hit / monsterhp) or 0 local x2 = x - 20 + math.random(20) return x2 > 0 and x2 or 0 end function isSummon(uid) return uid ~= getCreatureMaster(uid) or false end function onStatsChange(cid, attacker, type, combat, value) if type == STATSCHANGE_HEALTHLOSS then if isMonster(cid) then if isCreature(attacker) then local sid = isSummon(attacker) == true and getCreatureMaster(attacker) or attacker if isPlayer(sid) then stageRate = getPlayerStageRate(cid, tableStages) local expg = CalculeExp(getCreatureMaxHealth(cid), getMonsterInfo(getCreatureName(cid)).experience * rateExp, value) doSendAnimatedText(getThingPos(sid), useStages and expg * stageRate or expg, 215) doPlayerAddExp(sid, useStages and expg * stageRate or expg) end end end elseif type == STATSCHANGE_HEALTHGAIN then return false 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 QUAL o erro desse script?? Poste pra mim como seria o certo disso... Obrigado pela ajuda....
  8. Mehahbr

    [Script Erro] Ajudem

    Assim meu otserv esta com erro na linha 11 que é a linha da funcao GetPlayerStageRate que é baseada nessa funcao local function getPlayerStageRate(pid) local stages = {{level = 1, 100},{level = 201, 50},{level=301,20},{level=401,5}} local rate = 1 for i,v in ipairs(stages) do if getPlayerLevel(pid) >= v[1] and (getPlayerLevel(pid) < stages[i+1].level or i == #stages) then rate = v[2] break end end return rate end A Linha 11 no script é a negritada acima O que tem de Errado?? Obrigado pela Ajuda... pbOT Team!
  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...