Ir para conteúdo

Crypter

Visconde
  • Total de itens

    368
  • Registro em

  • Última visita

  • Dias Ganhos

    14

Tudo que Crypter postou

  1. versão 8.6 so tem tutorial de Extender limite de Effects e não de Sprites
  2. Copia outro arquivo .lua renomeia e poem essa tua script Ou manda o arquivo aqui nesse topico que eu corrigo
  3. Você não disse se usa Mysql ou Sqlite, não mostrou nem ao menos o banco de dados, e quer um milagre
  4. function onUse(cid, item, frompos, item2, topos) level = getPlayerLevel(cid)-8 pid = getPlayerGUID(cid) magehealth = level*5 -- Quantidade de vida que o Sorcerer e Druid ganha a cada level(mude apenas os numeros) magemana = level*30 -- Quantidade de mana que o Sorcerer e Druid ganha a cada level(mude apenas os numeros) paladinhealth = level*10 -- Quantidade de vida que o Paladin ganha a cada level(mude apenas os numeros) paladinmana = level*15 -- Quantidade de mana que o Paladin ganha a cada level(mude apenas os numeros) knighthealth = level*15 -- Quantidade de vida que o Knight ganha a cada level(mude apenas os numeros) knightmana = level*5 -- Quantidade de mana que o Knight ganha a cada level(mude apenas os numeros) if item.uid == 37001 then doSendMagicEffect(topos, 14) doPlayerPopupFYI(cid, 'You changed your vocation to sorcerer.') doPlayerSetVocation(cid, 1) setCreatureMaxHealth(cid, magehealth) setCreatureMaxMana(cid, magemana) doRemoveCreature(cid) end if item.uid == 37011 then doPlayerSetVocation(cid, 2) setCreatureMaxHealth(cid, magehealth) setCreatureMaxMana(cid, magemana) doSendMagicEffect(topos, 14) doPlayerPopupFYI(cid, 'You changed your vocation to druid.') doRemoveCreature(cid) end if item.uid == 37012 then doPlayerSetVocation(cid, 3) setCreatureMaxHealth(cid, paladinhealth) setCreatureMaxMana(cid, paladinmana) doSendMagicEffect(topos, 14) doPlayerPopupFYI(cid, 'You changed your vocation to paladin.') doRemoveCreature(cid) end if item.uid == 37013 then doPlayerSetVocation(cid, 4) setCreatureMaxHealth(cid, knighthealth) setCreatureMaxMana(cid, knightmana) doSendMagicEffect(topos, 14) doPlayerPopupFYI(cid, 'You changed your vocation to knight.') doRemoveCreature(cid) end end
  5. function onUse(cid, item, frompos, item2, topos) level = getPlayerLevel(cid)-8 pid = getPlayerGUID(cid) magehealth = level*5 -- Quantidade de vida que o Sorcerer e Druid ganha a cada level(mude apenas os numeros) magemana = level*30 -- Quantidade de mana que o Sorcerer e Druid ganha a cada level(mude apenas os numeros) paladinhealth = level*10 -- Quantidade de vida que o Paladin ganha a cada level(mude apenas os numeros) paladinmana = level*15 -- Quantidade de mana que o Paladin ganha a cada level(mude apenas os numeros) knighthealth = level*15 -- Quantidade de vida que o Knight ganha a cada level(mude apenas os numeros) knightmana = level*5 -- Quantidade de mana que o Knight ganha a cada level(mude apenas os numeros) if item.uid == 37001 then doSendMagicEffect(topos, 14) doPlayerPopupFYI(cid, 'You changed your vocation to sorcerer.') doPlayerSetVocation(cid, 1) setCreatureMaxHealth(cid, magehealth) setCreatureMaxMana(cid, magemana) doRemoveCreature(cid) db.query("UPDATE `player_skills` SET `value` = ".. 10 ..", count = ".. 0 .." WHERE `player_id` = ".. pid ..";") db.query("UPDATE `players` SET `maglevel` = ".. 0 ..", `manaspent` = ".. 0 .." WHERE `id` = ".. pid ..";") end if item.uid == 37011 then doPlayerSetVocation(cid, 2) setCreatureMaxHealth(cid, magehealth) setCreatureMaxMana(cid, magemana) doSendMagicEffect(topos, 14) doPlayerPopupFYI(cid, 'You changed your vocation to druid.') doRemoveCreature(cid) db.query("UPDATE `player_skills` SET `value` = ".. 10 ..", count = ".. 0 .." WHERE `player_id` = ".. pid ..";") db.query("UPDATE `players` SET `maglevel` = ".. 0 ..", `manaspent` = ".. 0 .." WHERE `id` = ".. pid ..";") end if item.uid == 37012 then doPlayerSetVocation(cid, 3) setCreatureMaxHealth(cid, paladinhealth) setCreatureMaxMana(cid, paladinmana) doSendMagicEffect(topos, 14) doPlayerPopupFYI(cid, 'You changed your vocation to paladin.') doRemoveCreature(cid) db.query("UPDATE `player_skills` SET `value` = ".. 10 ..", count = ".. 0 .." WHERE `player_id` = ".. pid ..";") db.query("UPDATE `players` SET `maglevel` = ".. 0 ..", `manaspent` = ".. 0 .." WHERE `id` = ".. pid ..";") end if item.uid == 37013 then doPlayerSetVocation(cid, 4) setCreatureMaxHealth(cid, knighthealth) setCreatureMaxMana(cid, knightmana) doSendMagicEffect(topos, 14) doPlayerPopupFYI(cid, 'You changed your vocation to knight.') doRemoveCreature(cid) db.query("UPDATE `player_skills` SET `value` = ".. 10 ..", count = ".. 0 .." WHERE `player_id` = ".. pid ..";") db.query("UPDATE `players` SET `maglevel` = ".. 0 ..", `manaspent` = ".. 0 .." WHERE `id` = ".. pid ..";") end end
  6. Procure static int32_t luaL_errors(lua_State* L); e abaixo coloque static int32_t luaOpenPrivateChannel(lua_State* L); depois procure por lua_register(m_luaState, "doPlayerSendCancel", LuaInterface::luaDoPlayerSendCancel); e acima coloque //OpenPrivateChannel(cid) lua_register(m_luaState, "openPrivateChannel", LuaInterface::luaOpenPrivateChannel); Depois procure por int32_t LuaInterface::luaGetTileInfo(lua_State* L) e coloque acima int32_t LuaInterface::luaOpenPrivateChannel(lua_State* L){ ScriptEnviroment* env = getEnv(); uint32_t cid = popNumber(L); Player* player = env->getPlayerByUID(cid); if (!player || player->isRemoved() || !player->isPremium()) return false; ChatChannel* channel = g_chat.createChannel(player, 0xFFFF); if (!channel || !channel->addUser(player)) return false; player->sendCreatePrivateChannel(channel->getId(), channel->getName()); return true;} Agora vamos ao script para abrir o Live/Cast ao fazer logon. Vá em data/Creatureevents e crie um arquivo chamado live.lua e coloque o código abaixo function onLogin(cid)local t, data = 1, getPlayerSpectators(cid)if getPlayerAccountManager(cid) == MANAGER_NONE and getPlayerAccess(cid) <= 4 then -- Account Manager não irá iniciar o Cast e GM também não, mude apenas o Acess caso seja diferentedata.broadcast = truedoPlayerSetSpectators(cid, data)db.executeQuery("UPDATE `players` SET `broadcasting` = 1 WHERE `id` = " .. getPlayerGUID(cid))doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Seu Cast foi ativado automaticamente, para desativar digite /live off.")openPrivateChannel(cid) -- A função para abrir o PrivateChannelendreturn trueend Depois abra o login.lua e coloque registerCreatureEvent(cid, "AutoCast") Feito isso, abra o creaturescript.xml e coloque <event type="login" name="AutoCast" event="script" value="live.lua"/> Creditos: joadson
  7. Se você conseguiu criptografar fez um bom trabalho já pode começar a vender .
  8. Essas proteções não server pra nada ( Pelo menos a 3° ) , é só uma alteração no formato do arquivo.
  9. Verifique o Id do channel do cast , veja se tem a função de abrir channel na source
  10. (OBS: Não testei nenhum dos 2 ) Versão 1 : ( Voce coloca os valores que quer da storage ) function resetStorage(cid, pos)local Storages = {60612,60613,60614,60615,60616,60617,60618,}if getPlayerStorageValue(cid, 60613) >= 0 then for i=1, #Storages do setPlayerStorageValue(cid, Storages[i], -1) end doPlayerSendTextMessage(cid, 19, 'Voce perdeu todas as suas quests.') endend Versão 2 : ( Os valores ficam no for ) function resetStorage(cid, pos)if getPlayerStorageValue(cid, 60613) >= 0 then for i=60612, 60654 do setPlayerStorageValue(cid, i, -1) end doPlayerSendTextMessage(cid, 19, 'Voce perdeu todas as suas quests.') endend
  11. Registra no creaturescripts.xml e no login.lua e testa essa sua script
  12. local keywordHandler = KeywordHandler:new()local npcHandler = NpcHandler:new(keywordHandler)NpcSystem.parseParameters(npcHandler) function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) endfunction onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) endfunction onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg:lower()) endfunction onThink() npcHandler:onThink() endlocal talkState = {} function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if msgcontains(msg, "yes") and (getPlayerItemCount(cid, 12672) >= 1) and (getPlayerItemCount(cid, 12664) >= 1) and getPlayerStorageValue(cid, 56422) <=0 then doPlayerRemoveItem(cid, 12672, 1) doPlayerRemoveItem(cid, 12664, 1) setPlayerStorageValue(cid, 56422, 1) selfSay("AAHHHH. Muito obrigado voce conseguil os items, toma aqui sua Red senzu !!.", cid) elseif msgcontains(msg, "yes") and (getPlayerItemCount(cid, 12672) < 1) or (getPlayerItemCount(cid, 12664) < 1) and getPlayerStorageValue(cid, 56422) <=0 then selfSay("Ops.....", cid) elseif getPlayerStorageValue(cid, 56422) >= 1 then selfSay("Voce ja tem a Outflit", cid) end return trueend npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)npcHandler:addModule(FocusModule:new())
  13. <outfit id="8" default="0" quest="56422"> <list gender="0" lookType="147" name="Barbara"/> <list gender="1" lookType="143" name="Barbaro"/> </outfit> local keywordHandler = KeywordHandler:new()local npcHandler = NpcHandler:new(keywordHandler)NpcSystem.parseParameters(npcHandler) function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) endfunction onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) endfunction onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg:lower()) endfunction onThink() npcHandler:onThink() endlocal talkState = {} function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if msgcontains(msg, "yes") and (getPlayerItemCount(cid, 12672) >= 1) and (getPlayerItemCount(cid, 12664) >= 1) then doPlayerRemoveItem(cid, 12672, 1) doPlayerRemoveItem(cid, 12664, 1) setPlayerStorageValue(cid, 56422, 1) selfSay("AAHHHH. Muito obrigado voce conseguil os items, toma aqui sua Red senzu !!.", cid) elseif msgcontains(msg, "yes") and (getPlayerItemCount(cid, 12672) < 1) or (getPlayerItemCount(cid, 12664) < 1) then selfSay("Ops.....", cid) elseif getPlayerStorageValue(cid, 56422) >= 1 then selfSay("Voce ja tem a Outflit", cid) end return trueend npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)npcHandler:addModule(FocusModule:new())
  14. function onThink(cid, interval) if getCreatureOutfit(cid).lookType == 2140 then doCreateItem(15663, getCreaturePosition(cid), true) end return trueend
  15. Poem o codigo que do @Poccnn no arquivo 050-function ou crie um arquivo .lua na pasta data/lib (o arquivo 050-function fica localizado na mesma pasta lib)
  16. function onLogin(cid) local config = { [1] = {m=311,f=312}, [2] = {m=316,f=313} } local voc = config[getPlayerVocation(cid)] if voc then if getPlayerStorageValue(cid, 13000) < 0 then local newtype = "" if getPlayerSex(cid) == 0 then newtype = {lookType = voc.m} else newtype = {lookType = voc.f} end doCreatureChangeOutfit(cid, newtype) setPlayerStorageValue(cid, 13000, 1) end end return TRUEend
  17. Registra no actions.xml com o id da runa , caso ja tenha registrado diga o erro uso a script no meu server.
  18. Tenta assim: function getPlayerFrags(cid) local time = os.time() local times = {today = (time - 86400), week = (time - (7 * 86400))} local contents, result = {day = {}, week = {}, month = {}}, db.getResult("SELECT `pd`.`date`, `pd`.`level`, `p`.`name` FROM `player_killers` pk LEFT JOIN `killers` k ON `pk`.`kill_id` = `k`.`id` LEFT JOIN `player_deaths` pd ON `k`.`death_id` = `pd`.`id` LEFT JOIN `players` p ON `pd`.`player_id` = `p`.`id` WHERE `pk`.`player_id` = " .. getPlayerGUID(cid) .. " AND `k`.`unjustified` = 1 AND `pd`.`date` >= " .. (time - (30 * 86400)) .. " ORDER BY `pd`.`date` DESC") if(result:getID() ~= -1) then repeat local content = {date = result:getDataInt("date")} if(content.date > times.today) then table.insert(contents.day, content) elseif(content.date > times.week) then table.insert(contents.week, content) else table.insert(contents.month, content) end until not result:next() result:free() end local size = { day = table.maxn(contents.day), week = table.maxn(contents.week), month = table.maxn(contents.month) } return size.day + size.week + size.month end function onLogin(cid) registerCreatureEvent(cid, "fraglook") return true end function onLook(cid, thing, position, lookDistance) if isPlayer(thing.uid) and thing.uid ~= cid then local info1 = vip.hasVip(thing.uid) == TRUE and "VIP" or "Free" doPlayerSetSpecialDescription(thing.uid,'[Frags: '..getPlayerFrags(thing.uid)..']['..info1..']') return true elseif thing.uid == cid then local info2 = vip.hasVip(cid) == TRUE and "VIP" or "Free" doPlayerSetSpecialDescription(cid,'[Frags: '..getPlayerFrags(cid)..']['..info2..']') local string = 'You see yourself.' if getPlayerFlagValue(cid, PLAYERFLAG_SHOWGROUPINSTEADOFVOCATION) then string = string..' You are '.. getPlayerGroupName(cid) ..'.' elseif getPlayerVocation(cid) ~= 0 then string = string..' You are '.. getPlayerVocationName(cid) ..'.' else string = string..' You have no vocation.' end string = string..getPlayerSpecialDescription(cid)..'' if getPlayerGuildId(cid) > 0 then string = string..' You are ' .. (getPlayerGuildRank(cid) == '' and 'a member' or getPlayerGuildRank(cid)) ..' of the '.. getPlayerGuildName(cid) string = getPlayerGuildNick(cid) ~= '' and string..' ('.. getPlayerGuildNick(cid) ..').' or string..'.' end if getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEECREATUREDETAILS) then string = string..'nHealth: ['.. getCreatureHealth(cid) ..' / '.. getCreatureMaxHealth(cid) ..'], Mana: ['.. getCreatureMana(cid) ..' / '.. getCreatureMaxMana(cid) ..'].' string = string..'nIP: '.. doConvertIntegerToIp(getPlayerIp(cid)) ..'.' end if getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEEPOSITION) then string = string..'nPosition: [X:'.. position.x..'] [Y:'.. position.y..'] [Z:'.. position.z..'].' end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, string) return false end return true end
  19. Testa ai local cyko = {timer = 15, -- How long will the magic wall staycooldown = 3, -- How long to cast another onewords = {"I LOVE MAGIC WALL!","HAHA YOU CANT GET ME","BIATCH","BOOM"}, -- Here can you add or edit the catch phrases!txt = "END", -- Text when it removescolor_on_timer = TEXTCOLOR_BLUE, -- Color on countdownempty_storage = 1000 -- Please set a unused storage}function onUse(cid, item, fromPosition, itemEx, toPosition)if(getPlayerStorageValue(cid, cyko.empty_storage) > os.time()) thenreturn (doPlayerSendCancel(cid, "You are exhausted."))endif (getTileInfo(getThingPos(cid)).protection or getTileInfo(toPosition).protection) thenreturn (doPlayerSendCancel(cid, "You can't cast magic wall while your inside protection zone."))endlocal function removemw()if(getTileItemById(toPosition, 1497).uid > 0) thenif (version_check == 03) thenreturn (doSendAnimatedText(toPosition,cyko.txt, TEXTCOLOR_RED) and doSendMagicEffect(toPosition, CONST_ME_ENERGYHIT) and doRemoveItem(getTileItemById(toPosition, 1497).uid))elsereturn (doSendMagicEffect(toPosition, CONST_ME_ENERGYHIT) and doRemoveItem(getTileItemById(toPosition, 1497).uid))endendendfor mw = 1, cyko.timer dolocal o = cyko.timer - mwif (version_check == 03) thenaddEvent(doSendAnimatedText, mw * 1000, toPosition, o > 0 and tostring(o), cyko.color_on_timer)elseaddEvent(doSendAnimatedText2, mw * 1000, toPosition, o > 0 and tostring(o), cyko.color_on_timer)endendif (isWalkable(toPosition, false, false, true, true, true)) thendoCreateItem(1497, toPosition)setPlayerStorageValue(cid, cyko.storage, os.time() + cyko.cooldown)addEvent(removemw, cyko.timer * 1000)doSendMagicEffect(toPosition, CONST_ME_ENERGYAREA)if (random_txt_onsay == true) thendoCreatureSay(cid, cyko.words[math.random(#cyko.words)], TALKTYPE_ORANGE_1)endelsedoPlayerSendDefaultCancel(cid, RETURNVALUE_NOTENOUGHROOM)endreturn trueend
  20. Cria uma Spell que seta uma storage com segundos , e poem pra executar a creaturescripts com a storage
  21. Use esse comando na sua database antiga CREATE TABLE IF NOT EXISTS `guild_wars` ( `id` INT NOT NULL AUTO_INCREMENT, `guild_id` INT NOT NULL, `enemy_id` INT NOT NULL, `begin` BIGINT NOT NULL DEFAULT '0', `end` BIGINT NOT NULL DEFAULT '0', `frags` INT UNSIGNED NOT NULL DEFAULT '0', `payment` BIGINT UNSIGNED NOT NULL DEFAULT '0', `guild_kills` INT UNSIGNED NOT NULL DEFAULT '0', `enemy_kills` INT UNSIGNED NOT NULL DEFAULT '0', `status` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `status` (`status`), KEY `guild_id` (`guild_id`), KEY `enemy_id` (`enemy_id`)) ENGINE=InnoDB; ALTER TABLE `guild_wars` ADD CONSTRAINT `guild_wars_ibfk_1` FOREIGN KEY (`guild_id`) REFERENCES `guilds` (`id`) ON DELETE CASCADE, ADD CONSTRAINT `guild_wars_ibfk_2` FOREIGN KEY (`enemy_id`) REFERENCES `guilds` (`id`) ON DELETE CASCADE; ALTER TABLE `guilds` ADD `balance` BIGINT UNSIGNED NOT NULL AFTER `motd`; CREATE TABLE IF NOT EXISTS `guild_kills` ( `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY, `guild_id` INT NOT NULL, `war_id` INT NOT NULL, `death_id` INT NOT NULL) ENGINE = InnoDB; ALTER TABLE `guild_kills` ADD CONSTRAINT `guild_kills_ibfk_1` FOREIGN KEY (`war_id`) REFERENCES `guild_wars` (`id`) ON DELETE CASCADE, ADD CONSTRAINT `guild_kills_ibfk_2` FOREIGN KEY (`death_id`) REFERENCES `player_deaths` (`id`) ON DELETE CASCADE, ADD CONSTRAINT `guild_kills_ibfk_3` FOREIGN KEY (`guild_id`) REFERENCES `guilds` (`id`) ON DELETE CASCADE; ALTER TABLE `killers` ADD `war` INT NOT NULL DEFAULT 0;
  22. Tenta Remove essas linhas do Somefunctions: if hasProfession(thing) then -- Profession System str = str.."\n"..getPlayerSex(thing) == 0 and "She" or "He" .." is a "..getProfessionName(thing).."." end
  • Quem Está Navegando   0 membros estão online

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