Ir para conteúdo
Banner com Efeitos

Storm

Héroi
  • Registro em

  • Última visita

Tudo que Storm postou

  1. @Luzetti Você pode configurar a mensagem que o player terá que falar nessa linha if msgcontains(msg, 'itens') or msgcontains(msg, 'items') and talkState[talkUser] == 1 then
  2. Esqueci , código editado.
  3. @Luzetti local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid local config = { level = 50, -- Level necessario storage = 234123, -- Storage item = 2150, -- Id do item count = 50, -- Count do item new = 15, -- ID da nova outfit old = 10, -- ID da outfit antiga voc = 4 -- ID da nova voc } local outfit = {lookType = config.new} if msgcontains(msg, 'yes') or msgcontains(msg, 'sim') then selfSay("Traga para mim ".. config.count .." ".. getItemInfo(config.item).name .." para completar essa missao", cid) talkState[talkUser] = 1 end if msgcontains(msg, 'itens') or msgcontains(msg, 'items') and talkState[talkUser] == 1 then if getPlayerLevel(cid) >= config.level then if getCreatureStorage(cid, config.storage) == -1 then if doPlayerRemoveItem(cid, config.item, config.count) then doCreatureSetStorage(cid, config.storage, 1) doPlayerRemoveOutfitId(cid, config.old) doPlayerAddOutfitId(cid, config.new, 0) doCreatureChangeOutfit(cid, outfit) doPlayerSetVocation(cid, config.voc) addEvent(doRemoveCreature, 5000, cid) selfSay("Parabens , voce completou a missão", cid) else selfSay("Traga para mim ".. config.count .." ".. getItemInfo(config.item).name .." para completar essa missao", cid) talkState[talkUser] = 0 end else selfSay("voce ja completou essa missão", cid) talkState[talkUser] = 0 end else selfSay("Voce precisa ser level ".. config.level .." para iniciar essa missão.", cid) talkState[talkUser] = 0 end end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
  4. Bom , acho que vai ficar apelão um servidor com esse comando , mas ok local function isWalkable(pos, creature, proj, pz)-- by Nord if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end if getTopCreature(pos).uid > 0 and creature then return false end if getTileInfo(pos).protection and pz then return false, true end local n = not proj and 3 or 2 for i = 0, 255 do pos.stackpos = i local tile = getTileThingByPos(pos) if tile.itemid ~= 0 and not isCreature(tile.uid) then if hasProperty(tile.uid, n) or hasProperty(tile.uid, 7) then return false end end end return true end function onCastSpell(cid, var) local a = {x = getCreaturePosition(cid).x, y = getCreaturePosition(cid).y - 10, z = getCreaturePosition(cid).z} -- North local b = {x = getCreaturePosition(cid).x, y = getCreaturePosition(cid).y + 10, z = getCreaturePosition(cid).z} -- South local c = {x = getCreaturePosition(cid).x - 10, y = getCreaturePosition(cid).y, z = getCreaturePosition(cid).z} -- West local d = {x = getCreaturePosition(cid).x + 10, y = getCreaturePosition(cid).y, z = getCreaturePosition(cid).z} -- East if getCreatureLookDirection(cid) == NORTH then if isWalkable(a, false, false, false) and not getHouseFromPos(a) then return doTeleportThing(cid, a) else doPlayerSendTextMessage(cid, 27, "A posição onde você quer ir não é andavel") return doSendMagicEffect(getCreaturePosition(cid), 2) end elseif getCreatureLookDirection(cid) == SOUTH then if isWalkable(b, false, false, false) and not getHouseFromPos(b) then return doTeleportThing(cid, b) else doPlayerSendTextMessage(cid, 27, "A posição onde você quer ir não é andavel") return doSendMagicEffect(getCreaturePosition(cid), 2) end elseif getCreatureLookDirection(cid) == EAST then if isWalkable(d, false, false, false) and not getHouseFromPos(d) then return doTeleportThing(cid, d) else doPlayerSendTextMessage(cid, 27, "A posição onde você quer ir não é andavel") return doSendMagicEffect(getCreaturePosition(cid), 2) end elseif getCreatureLookDirection(cid) == WEST then if isWalkable(c, false, false, false) and not getHouseFromPos(c) then return doTeleportThing(cid, c) else doPlayerSendTextMessage(cid, 27, "A posição onde você quer ir não é andavel") return doSendMagicEffect(getCreaturePosition(cid), 2) end end end
  5. @Luzetti local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid local config = { level = 50, -- Level necessario storage = 234123, -- Storage item = 2150, -- Id do item count = 50, -- Count do item new = 15, -- ID da nova outfit old = 10, -- ID da outfit antiga voc = 4 -- ID da nova voc } local outfit = {lookType = config.new} if msgcontains(msg, 'yes') or msgcontains(msg, 'sim') then if getPlayerLevel(cid) >= config.level then if getCreatureStorage(cid, config.storage) == -1 then if doPlayerRemoveItem(cid, config.item, config.count) then doCreatureSetStorage(cid, config.storage, 1) doPlayerRemoveOutfitId(cid, config.old) doPlayerAddOutfitId(cid, config.new, 0) doCreatureChangeOutfit(cid, outfit) doPlayerSetVocation(cid, config.voc) selfSay("Parabens , voce completou a missão", cid) else selfSay("Traga para mim ".. config.count .." ".. getItemInfo(config.item).name .." para completar essa missao", cid) end else selfSay("voce ja completou essa missão", cid) end else selfSay("Voce precisa ser level ".. config.level .." para iniciar essa missão.", cid) end end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
  6. @Luzetti Voce explicou muito mal no tópico , mas eu tentei fazer : local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid local config = { level = 50, -- Level necessario storage = 234123, -- Storage item = 2150, -- Id do item count = 50, -- Count do item new = 15, -- ID da nova outfit old = 10 -- ID da outfit antiga } local outfit = {lookType = config.new} if msgcontains(msg, 'yes') or msgcontains(msg, 'sim') then if getPlayerLevel(cid) >= config.level then if getCreatureStorage(cid, config.storage) == -1 then if doPlayerRemoveItem(cid, config.item, config.count) then doCreatureSetStorage(cid, config.storage, 1) doPlayerRemoveOutfitId(cid, config.old) doPlayerAddOutfitId(cid, config.new, 0) doCreatureChangeOutfit(cid, outfit) selfSay("Parabens , voce completou a missão", cid) else selfSay("Traga para mim ".. config.count .." ".. getItemInfo(config.item).name .." para completar essa missao", cid) end else selfSay("voce ja completou essa missão", cid) end else selfSay("Voce precisa ser level ".. config.level .." para iniciar essa missão.", cid) end end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
  7. local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid msg = string.lower(msg) --------- local need = { {id = 12184, qt = 10}, --karp fin } local rewards = { {id = 2152, qt = 10}, --money } local stoFinish = 92087 --------- if msgcontains(msg, 'task') or msgcontains(msg, 'ajuda') then if getPlayerStorageValue(cid, stoFinish) >= 1 then selfSay("Sorry, you already had done this quest.", cid) talkState[talkUser] = 0 return true end if getPlayerStorageValue(cid, stoFinish) == -1 then selfSay("Hello my friend, can you bring to me: 200 magikarp fin? I will reward you!",cid) talkState[talkUser] = 1 return true end elseif msgcontains(msg, 'yes') or msgcontains(msg, 'sim') and talkState[talkUser] == 1 then if getPlayerItemCount(cid, need[1].id) < need[1].qt then selfSay("You don't brought to me all the items what i asked for...", cid) selfSay("Remember, you need to bring to me 200 magikarp fin...", cid) talkState[talkUser] = 0 return true end for i = 1, #need do doPlayerRemoveItem(cid, need.id, need.qt) end for i = 1, #rewards do doPlayerAddItem(cid, rewards.id, rewards.qt) doPlayerAddExperience(cid, 150000) end selfSay("thanks you, bye!", cid) setPlayerStorageValue(cid, stoFinish, 1) talkState[talkUser] = 0 return true end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
  8. Actions local config = { time = 5, -- Minutos para o player sair da area global = 3242, -- Global storage storage = 3214, -- Storage cost = 1000, -- Custo para entrar dentro = {x = 94 , y = 200, z = 7}, -- Pos de dentro da arena fora = {x = 90, y = 195, z = 6} -- Pos de fora da arena } local toPos = {x = 94 , y = 200, z = 7} -- | -- | Começo e final da arena local fromPos = {x = 94 , y = 200, z = 7} -- | local function Arena(uid) if isPlayer(uid) then if getCreatureStorage(uid, config.storage) == 1 then doCreatureSetStorage(uid, config.storage, -1) if isInRange(getCreaturePosition(uid), toPos, fromPos) then doTeleportThing(uid, config.fora) end end end doSetStorage(config.global, -1) end function onUse(cid, item, fromPosition, itemEx, toPosition) local pos = getCreaturePosition(cid) if getStorage(config.global) == -1 then if doPlayerRemoveMoney(cid, config.cost) then doTeleportThing(cid, config.dentro) doCreatureSetStorage(cid, config.storage, 1) addEvent(Arena, 60 * config.time * 1000, cid) return doPlayerSendTextMessage(cid, 26, "Voce iniciou a arena") else doPlayerSendTextMessage(cid, 27, "Voce precisa de ".. config.cost .." money para entrar na arena") return doSendMagicEffect(pos, 3) end else doPlayerSendTextMessage(cid, 27, "Já existe alguem na arena no momento, aguarde.") return doSendMagicEffect(pos, 3) end return true end CreatureScripts local toPos = {x = 94 , y = 200, z = 7} -- | -- | Começo e final da arena local fromPos = {x = 94 , y = 200, z = 7} -- | local storage = 3214 -- Storage function onPrepareDeath(cid, deathList) if isPlayer(cid) and isInRange(getCreaturePosition(cid), toPos, fromPos) then doCreatureSetStorage(cid, storage, -1) return true end return true end
  9. @quemtuacha function onMoveItem(moveItem, frompos, position, cid) if getHouseFromPos(frompos) then if getPlayerGUID(cid) == getHouseOwner(getHouseFromPos(frompos)) then return true else doPlayerSendTextMessage(cid, 27, "Voce nao pode mover itens desta house") doSendMagicEffect(getCreaturePosition(cid), 3) return false end end end
  10. @quemtuacha Você tem a função function onMoveItem(moveItem, frompos, position, cid) Adicionada nas sources ?
  11. Como essa script funciona?
  12. @leozincorsair <?xml version="1.0" encoding="UTF-8"?> <npc name="Bless" script="data/npc/scripts/task/bless.lua" walkinterval="2000" speed="0" floorchange="0"> <health now="100" max="100"/> <look type="167" head="38" body="79" legs="107" feet="114"/> <parameters> <parameter key="message_greet" value="I' sell bless , say {yes} "/> </parameters></npc>
  13. local itemid, count = 2160, 5 -- ID do item que precisa e sua count local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, type, msg) local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if msgcontains(msg, "yes") then for b = 1,5 do if getPlayerBlessing(cid, b) then selfSay('Voce ja tem Bless e nao precisa de outra!', cid) doSendMagicEffect(getPlayerPosition(cid), 3) else if doPlayerRemoveItem(cid, itemid, count) then for i = 1,5 do doPlayerAddBlessing(cid, i) end doSendMagicEffect(getPlayerPosition(cid), 6) selfSay("Voce comprou a bless!", cid) else selfSay("Voce precisa de ".. count .." ".. getItemInfo(itemid).name .." para comprar bless.", cid) end end end end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
  14. local config = { pos = {x=1765, y=578, z=7}, -- tempo = 30, -- effect1 = 10, -- effect2 = 10 -- } local fromPosition = {x=1031, y=737, z=7} local toPosition = {x=1031, y=737, z=7} function onCastSpell(cid, var) local pos = getCreaturePosition(cid) if isInRange(pos, fromPosition, toPosition) then doPlayerSendTextMessage(cid, 27, "Voce nao pode usar essa magia nesse local") return doSendMagicEffect(pos, 3) end if isPlayer(getCreatureTarget(cid)) then target = getCreatureTarget(cid) addEvent(doTeleportThing, 1000*config.tempo, target, getThingPos(target), true) addEvent(doSendMagicEffect, 1000*config.tempo, getThingPos(target), config.effect2) doSendMagicEffect(getThingPos(target), config.effect1) doTeleportThing(target, config.pos) if isCreature(cid) then doPlayerSendTextMessage(target, 27, "Voce ".. getCreatureName(cid) ..".") end if isPlayer(cid) and isCreature(target) then doPlayerSendTextMessage(cid, 27, "Voce levou para ".. getCreatureName(target) .."!") end else doPlayerSendCancel(cid, "Voces") end return true end
  15. local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, true) setCombatParam(combat, COMBAT_PARAM_EFFECT, 98) local condition = createConditionObject(CONDITION_PARALYZE) setConditionParam(condition, CONDITION_PARAM_TICKS, 10000) setConditionFormula(condition, -0.90, 0, -0.90, 0) setCombatCondition(combat, condition) local time = 2.0 -- Tempo de exhaustion local storage = 45674 -- não mecha function onCastSpell(cid, var) if exhaustion.check(cid, storage) then doPlayerSendCancel(cid, "You are exhauted.") doSendMagicEffect(getCreaturePosition(cid), 2) return false end if(not doCombat(cid, combat, var)) then return false end doSendMagicEffect(getThingPosition(cid), 91) exhaustion.set(cid, storage, time) return true end
  16. @Jociel local tempo = 60 local outfit = {lookType = 320, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 0} function onCastSpell(cid, var) local pos = getCreaturePosition(cid) local target = getCreatureTarget(cid) local targetpos = getCreaturePosition(target) local tsuku ={x = 103, y = 1780, z = 7} local alvo = {x = 103, y = 1777, z = 7} local from1,to1 = {x=97, y=1773, z=7},{x=109, y=1785, z=7} local from2,to2 = {x=979, y=911, z=7},{x=994, y=918, z=7} local from3,to3 = {x=557, y=1029, z=6},{x=573, y=1044, z=6} if isInRange(pos, from1, to1) then doPlayerSendCancel(cid, "Você ja esta !") return FALSE end if isInRange(pos, from2, to2) or isInRange(pos, from3, to3) then doPlayerSendCancel(cid, "Você nao pode usar !") return FALSE end if getTileInfo(getThingPos(cid)).pvp then doPlayerSendCancel(cid, "Você nao pode aqui!") return FALSE end if exhaustion.check(cid, 13132) == TRUE then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Aguarde " .. exhaustion.get(cid, 13132) .. " segundos para usar novamente.") return FALSE end local function Teleport_Player(cid) doTeleportThing(cid, pos) end local function Teleport_Target(target) doCreatureSetNoMove(target, 0) doTeleportThing(target, targetpos) end local function Teleport_Player_Emergency() for x = from1.x, to1.x do for y = from1.y, to1.y do local mob_player = getTopCreature({x=x, y=y, z=from1.z}).uid if mob_player ~= 0 and isPlayer(mob_player) then doTeleportThing(cid, pos) end end end end local function Teleport_Target_Emergency() for x = from1.x, to1.x do for y = from1.y, to1.y do local mob_target = getTopCreature({x=x, y=y, z=from1.z}).uid if mob_target ~= 0 and isPlayer(mob_target) then doCreatureSetNoMove(target, 0) doTeleportThing(target, targetpos) end end end end if isPlayer(target) then exhaustion.set(cid, 13132, 20) doSetCreatureOutfit(target, outfit, tempo * 1000) doCreatureSetNoMove(target, 1) doTeleportThing(cid,tsuku) doTeleportThing(target,alvo) doSendMagicEffect(alvo, 182) doCreatureSay(cid, "...!", TALKTYPE_MONSTER) addEvent(Teleport_Player, 15000, cid) addEvent(Teleport_Target, 15000, target) addEvent(Teleport_Player_Emergency, 20000) addEvent(Teleport_Target_Emergency, 20000) else doPlayerSendCancel(cid, "Use apenas em players.") end end
  17. @Jociel function onCastSpell(cid, var) local target = getCreatureTarget(cid) local outfit = { lookType = 10 } -- ID da looktype local time = 10 -- Segundos que a outfit durará if target then doSetCreatureOutfit(target, outfit, time * 1000) return true end end
  18. @Emanueldk Só mudar --_Goku Black_-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 600 and getPlayerVocation(cid) == 515 then doReborn(cid,1,534,511) talk_state = 0 --_Jiren_-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 600 and getPlayerVocation(cid) == 525 then doReborn(cid,1,543,521) talk_state = 0
  19. @Jociel local t = { [255] = {256, 50, 3000, 3000} -- {old vocation} = {New vocation, looktype, life extra, mana extra} } local itemid, count = 2150 , 5 -- ID do item que precisa local level = 100 -- level necessario para a promotion local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, type, msg) local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid local a = t[getPlayerVocation(cid)] if msgcontains(msg, "yes") then if a then if getPlayerLevel(cid) >= level then if doPlayerRemoveItem(cid, itemid, count) then local outfit = {lookType = a[2]} doPlayerSetVocation(cid, a[1]) doCreatureChangeOutfit(cid, outfit) setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + a[3]) setCreatureMaxMana(cid, getCreatureMaxMana(cid) + a[4]) addEvent(doRemoveCreature, 1000, cid) else selfSay('Voce precisa de '.. count ..' '.. getItemInfo(itemid).name ..' para fazer a super promotion.', cid) end else selfSay('Você precisa estar no level '.. level ..'.', cid) end else selfSay('Sua vocation não tem promotion disponivel', cid) end return true end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
  20. @Jociel local t = { [255] = {256, 50, 3000, 3000} -- {old vocation} = {New vocation, looktype, life extra, mana extra} } local itemid, count = 2150 , 5 -- ID do item que precisa local level = 100 -- level necessario para a promotion local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, type, msg) local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid local a = t[getPlayerVocation(cid)] local outfit = {lookType = a[2]} if msgcontains(msg, "yes") then if a then if getPlayerLevel(cid) >= level then if doPlayerRemoveItem(cid, itemid, count) then doPlayerSetVocation(cid, a[1]) doCreatureChangeOutfit(cid, outfit) setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + a[3]) setCreatureMaxMana(cid, getCreatureMaxMana(cid) + a[4]) addEvent(doRemoveCreature, 1000, cid) else selfSay('Voce precisa de '.. count ..' '.. getItemInfo(itemid).name ..' para fazer a super promotion.', cid) end else selfSay('Você precisa estar no level '.. level ..'.', cid) end else selfSay('Sua vocation não tem promotion disponivel', cid) end return true end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
  21. @bismarkzika local v = {1, 2, 3, 5} -- Vocations que poderão usar a spell function onSay(cid, words, param, channel) local pos = getCreaturePosition(cid) local t = string.explode(param, ",") local a = getPlayerByNameWildcard(t[1]) local voc = getPlayerVocation(cid) if not isInArray(v, voc) then doSendMagicEffect(pos, 5) doPlayerSendTextMessage(cid, 26, "Sua vocation não pode usar essa spell") return true end if (param == '') or (not t[1]) or (not t[2]) or (not isNumber(t[2])) then doSendMagicEffect(pos, 5) doPlayerSendTextMessage(cid, 26, "Parametros incorretos") return true end if not a then doSendMagicEffect(pos, 5) doPlayerSendTextMessage(cid, 26, "Player não encontrado") return true end if tonumber(t[2]) >= 101 or tonumber(t[2]) == 0 then doSendMagicEffect(pos, 5) doPlayerSendTextMessage(cid, 26, "Somente de 1 a 100") return true end local b = getCreatureMana(cid) / 100 * t[2] doCreatureAddMana(cid, -b) doCreatureAddMana(a, b) return true end
  22. Posta a script pra a galera te ajudar , ninguem é vidente.
  23. @bismarkzika -- Os parâmentros do comando são : !transfer NOME DO PLAYER, QUANTIDADE DE MANA A SER DOADA -- Exemplo : !transferencia Storrm, 1 -- <talkaction words="!transferencia" event="script" value="transfer.lua"/> function onSay(cid, words, param, channel) local pos = getCreaturePosition(cid) local t = string.explode(param, ",") local a = getPlayerByNameWildcard(t[1]) if (param == '') or (not t[1]) or (not t[2]) or (not isNumber(t[2])) then doSendMagicEffect(pos, 5) doPlayerSendTextMessage(cid, 26, "Parametros incorretos") return true end if not a then doSendMagicEffect(pos, 5) doPlayerSendTextMessage(cid, 26, "Player não encontrado") return true end if tonumber(t[2]) >= 101 or tonumber(t[2]) == 0 then doSendMagicEffect(pos, 5) doPlayerSendTextMessage(cid, 26, "Somente de 1 a 100") return true end local b = getCreatureMana(cid) / 100 * t[2] doCreatureAddMana(cid, -b) doCreatureAddMana(a, b) return true end
  24. local key = 378378 -- Storage do reset local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, true) setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA) setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH) function onGetFormulaValues(cid, level, maglevel) min = -((level / 5) + (maglevel * 4.5) + 20 + (getCreatureStorage(cid, key) * 5)) max = -((level / 5) + (maglevel * 7.6) + 48 + (getCreatureStorage(cid, key) * 5)) return min, max end setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues") function onCastSpell(cid, var) return doCombat(cid, combat, var) end
  25. local t = { [255] = {256, 50, 3000, 3000} -- {old vocation} = {New vocation, looktype, life extra, mana extra} } local itemid, count = 2150 , 5 -- ID do item que precisa local level = 100 -- level necessario para a promotion local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, type, msg) local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid local a = t[getPlayerVocation(cid)] local outfit = {lookType = a[2]} if msgcontains(msg, "yes") then if a then if getPlayerLevel(cid) >= level then if doPlayerRemoveItem(cid, itemid, count) then doPlayerSetVocation(cid, a[1]) doCreatureChangeOutfit(cid, outfit) setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + a[3]) setCreatureMaxMana(cid, getCreatureMaxMana(cid) + a[4]) addEvent(doRemoveCreature, 1000, cid) else selfSay("voce nao tem o item necessario", cid) end else selfSay("Voce nao tem o level necessario", cid) end else selfSay("Sua vocation não tem promotion", cid) end end return TRUE end

Informação Importante

Confirmação de Termo