-
Total de itens
1347 -
Registro em
-
Última visita
-
Dias Ganhos
36
Tudo que Oneshot postou
-
Nome: doPlayerSendChannelsDialog(cid) Tipo: Função LUA Autor: Oneshot Fala, bandiputa! Recentemente baixei um servidor de Pokémon pela primeira vez para ver como funcionavam os sistemas lá dentro e fiquei impressionado com o sistema de clicar no computador e abrir a janela de canais. E então eu pensei comigo - "Vou ver como é que eles fizeram, né." - Fucei as pastas e não tinha nada e então a realidade me bateu na cara. Sim, aquela era uma função programada diretamente no código fonte do servidor e mais uma vez a realidade me bateu denovo - Ninguém disponibiliza as sources de servidores de Pokémon. Então o que eu fiz? Simples, desenvolvi minha própria função de abrir a janela de canais e ela é realmente simples, vocês mesmos irão ver. Em luascript.h, procure por: static int32_t luaGetChannelList(lua_State* L); Logo após, adicione: static int32_t luaDoPlayerSendChannelsDialog(lua_State* L); Em luascript.cpp, procure por: lua_register(m_luaState, "getChannelList", LuaInterface::luaGetChannelList); Logo após, adicione: lua_register(m_luaState, "doPlayerSendChannelsDialog", LuaInterface::luaDoPlayerSendChannelsDialog); Ainda em luascript.cpp, procure por: int32_t LuaInterface::luaGetChannelList(lua_State* L) { //getChannelList() lua_newtable(L); ChannelList list = g_chat.getPublicChannels(); ChannelList::const_iterator it = list.begin(); for(uint32_t i = 1; it != list.end(); ++it, ++i) { createTable(L, i); setField(L, "id", (*it)->getId()); setField(L, "name", (*it)->getName()); setField(L, "flags", (*it)->getFlags()); setField(L, "level", (*it)->getLevel()); setField(L, "access", (*it)->getAccess()); pushTable(L); } return 1; } E logo após, adicione: int32_t LuaInterface::luaDoPlayerSendChannelsDialog(lua_State* L) { //doPlayerSendChannelsDialog(uid) ScriptEnviroment* env = getEnv(); if(Player* player = env->getPlayerByUID(popNumber(L))) { player->sendChannelsDialog(); lua_pushboolean(L, true); } else { errorEx(getError(LUA_ERROR_PLAYER_NOT_FOUND)); lua_pushboolean(L, false); } return 1; } Agora é só compilar seu servidor no IDE de sua preferência. Exemplo de Uso: function onUse(cid, item, fromPosition, itemEx, toPosition) return doPlayerSendChannelsDialog(cid) end Se o nome estiver muito grande é só adicionar isso no 100-compat.lua sendChannelsDialog = doPlayerSendChannelsDialog Vale lembrar que isso é feito nas sources, no código-fonte do seu servidor. Abração \o/
-
Sim, não são nativas da linguagem Lua, mas existem nas bibliotecas de praticamente qualquer servidor atual. Observação: Notei que você adora me contrariar em tudo rsrs.
-
Embora esteja em área incorreta, esclarecerei a sua dúvida. Abra o arquivo channels.xml em data/XML, você verá isso: <?xml version="1.0" encoding="UTF-8"?> <channels> <!-- README: 0 - dynamic, reserved for guilds 1 - always acts as Party channel, only "name" tag available 3 - always acts as Rule Violations channel 9 - acts as Help channel- clientsided message 65535 - DO NOT CHANGE THE ID- only "name", "enabled", "active" and "logged" tags available --> <channel id="1" name="Party"/> <channel id="2" name="Staff" access="3"/> <channel id="3" name="Rule Violations" logged="yes"/> <channel id="4" name="Counselor" access="1"/> <channel id="5" name="Game-Chat" level="2"/> <channel id="6" name="Trade" level="8" muted="120" conditionId="2" conditionMessage="You may only place one offer in two minutes."> <vocation id="1-8"/> </channel> <channel id="7" name="Trade-Rookgaard" level="2" muted="120" conditionId="3" conditionMessage="You may only place one offer in two minutes."> <vocation id="0"/> </channel> <channel id="8" name="RL-Chat" level="2"/> <channel id="9" name="Help" logged="yes"/> <!-- <channel id="10" name="My Custom Channel"/> --> <channel id="65535" name="Private Chat Channel"/> </channels> Agora é só colocar muted com o valor em segundos que você quer no canal Help. <channel id="9" name="Help" muted="60" logged="yes"/> No exemplo acima, eu coloquei um mute de 60 segundos ou um minuto.
-
dúvida Trokar Efeito Quando O Enemy É Atingido Com Weapons!
pergunta respondeu ao kanxamatheus de Oneshot em Scripts
Código-fonte do servidor, chamado pela galera de sources. -
dúvida (Action)Problema Alavanca Para Adicionar O Item +10 Rep
pergunta respondeu ao Bennyhappy de Oneshot em Scripts
local monsters = { ["Dragon"] = { {x = 9168, y = 8572, z = 7}, {x = 9175, y = 8558, z = 7}, {x = 9169, y = 8575, z = 7}, {x = 9172, y = 8556, z = 7}, {x = 9173, y = 8567, z = 7}, {x = 9161, y = 8566, z = 7}, {x = 9165, y = 8567, z = 7}, {x = 9163, y = 8557, z = 7}, {x = 9183, y = 8560, z = 7}, {x = 9181, y = 8566, z = 7}, {x = 9165, y = 8560, z = 7} }, ["Dragon Lord Hatchling"] = { {x = 9169, y = 8568, z = 7}, {x = 9178, y = 8573, z = 7}, {x = 9182, y = 8570, z = 7}, {x = 9178, y = 8563, z = 7} }, ["Dragon Lord"] = { {x = 9171, y = 8575, z = 7}, {x = 9184, y = 8557, z = 7}, {x = 9184, y = 8565, z = 7}, {x = 9177, y = 8556, z = 7}, {x = 9168, y = 8558, z = 7}, {x = 9165, y = 8555, z = 7}, {x = 9162, y = 8563, z = 7}, {x = 9175, y = 8575, z = 7}, {x = 9170, y = 8565, z = 7}, {x = 9169, y = 8562, z = 7}, {x = 9177, y = 8567, z = 7} } } local walls = { [{x = 9166, y = 8574, z = 7}] = 9166, [{x = 9173, y = 8569, z = 7}] = 5278, [{x = 9180, y = 8581, z = 7}] = 9165, [{x = 9174, y = 8570, z = 7}] = 5282, [{x = 9176, y = 8573, z = 7}] = 5282 } local function checkFloor(fromPosition, toPosition) for x = fromPosition.x, toPosition.x do for y = fromPosition.y, toPosition.y do local position = {x = x, y = y, z = fromPosition.z} local creature = getTopCreature(position).uid if creature.uid > 0 and isMonster(creature) then return false end doCleanTile(position) end end return true end function onUse(cid, item, fromPosition, itemEx, toPosition) local areaFrom = {x = 9155, y = 9552, z = 7} local areaTo = {x = 9191, y = 8589, z = 7} local areaFrom2 = {x = 9160, y = 8544, z = 6} local areaTo2 = {x = 9188, y = 8583, z = 6} if(checkFloor(areaFrom, areaTo) == false or checkFloor(areaFrom2, areaTo2) == false) then return doPlayerSendCancel(cid, "Sorry, there are already monsters in arena.") end for monster, positions in pairs(monsters) do for _, position in ipairs(positions) do doCreateMonster(monster, position) position.z = position.z - 1 doCreateMonster(monster, position) end end doTransformItem(item.uid, (item.itemid == 1945 and 1946 or 1945)) for position, wall in pairs(walls) do if getTileItemById(position, wall).uid == 0 then doCreateItem(wall, position) position = position.z - 1 doCreateItem(wall, position) end end end Pronto, acho que funciona. O botão ou alavanca irá sumonar e criar paredes nos dois andares. -
Arrumei um pequeno bug no sistema na parte do comando /vote.
-
VÍDEO
-
dúvida Trokar Efeito Quando O Enemy É Atingido Com Weapons!
pergunta respondeu ao kanxamatheus de Oneshot em Scripts
No arquivo game.cpp, precisamente no bool Game::combatChangeHealth. Segue abaixo uma pequena parte dele. case COMBAT_PHYSICALDAMAGE: { Item* splash = NULL; switch(target->getRace()) { case RACE_VENOM: textColor = COLOR_LIGHTGREEN; magicEffect = MAGIC_EFFECT_POISON; splash = Item::CreateItem(ITEM_SMALLSPLASH, FLUID_GREEN); break; case RACE_BLOOD: textColor = COLOR_RED; magicEffect = MAGIC_EFFECT_DRAW_BLOOD; splash = Item::CreateItem(ITEM_SMALLSPLASH, FLUID_BLOOD); break; case RACE_UNDEAD: textColor = COLOR_GREY; magicEffect = MAGIC_EFFECT_HIT_AREA; break; case RACE_FIRE: textColor = COLOR_ORANGE; magicEffect = MAGIC_EFFECT_DRAW_BLOOD; break; case RACE_ENERGY: textColor = COLOR_PURPLE; magicEffect = MAGIC_EFFECT_PURPLEENERGY; break; default: break; } if(splash) { internalAddItem(NULL, target->getTile(), splash, INDEX_WHEREEVER, FLAG_NOLIMIT); startDecay(splash); } break; } No caso você trocaria isso: case RACE_BLOOD: textColor = COLOR_RED; magicEffect = MAGIC_EFFECT_DRAW_BLOOD; splash = Item::CreateItem(ITEM_SMALLSPLASH, FLUID_BLOOD); break; E mudaria o valor de magicEffect. Abraços. -
Não é querendo ser chato não, mas essas funções já existem e se chamam table.serialize e table.unserialize. Um grande abraço.
-
Nome: Advanced Poll System Tipo: Talkaction Autor: Oneshot Fala, meus queridos. Peregrinando pela seção de Pedidos e Dúvidas, vi um pedido do membro sarioyana que despertou minha vontade de programar sistemas um pouco mais elaborados. O pedido dele se trata de um sistema de votação, onde o responsável pelo servidor pode iniciar uma votação com quantas opções desejar. Fiz algo bem simples, você só precisa configurar os storages no ínicio do script, caso você já esteja usando os que estão por padrão. Abra seu arquivo talkactions.xml e adicione isso: <talkaction log="yes" words="/newpoll;/endpoll" access="5" event="script" value="pollsystem.lua"/> <talkaction words="/vote;/poll" event="script" value="pollsystem.lua"/> Crie um novo arquivo chamado pollsystem.lua em data/talkactions/scripts e adicione isso: local POLL_STORAGE = 80000 local OPTIONS_STORAGE = 80001 local PLAYER_STORAGE = 80000 local function getTotalVotes() local options = table.unserialize(getStorage(OPTIONS_STORAGE)) local amount = 0 for _, option in ipairs(options) do amount = amount + option[2] end return amount end local function getMostVotedOption() local options = table.unserialize(getStorage(OPTIONS_STORAGE)) local value, ret = 0 for _, option in ipairs(options) do if option[2] > value then value = option[2] ret = option[1] end end return ret end function onSay(cid, words, param, channel) param = param or "" if param == "" and not words == "/poll" then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "The command ".. words .." need parameters.") end local parameters, vote = {} if(words == "/newpoll") then if getStorage(POLL_STORAGE) ~= -1 then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry, but there is a poll in progress.\nIf you want to start a new poll, type /endpoll.") end parameters = string.explode(param, ",") if #parameters < 3 then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "The command /newpoll needs a poll and at least two options.") end if parameters[1] then local options = {} for i = 2, #parameters do table.insert(options, {parameters[i], 0}) end if #options < 2 then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Insert at least two options after the poll") end doSetStorage(POLL_STORAGE, parameters[1]) options = table.serialize(options) doSetStorage(OPTIONS_STORAGE, options) doBroadcastMessage("A new poll is in progress with the title '".. getStorage(POLL_STORAGE) .."?'!\nSee the status with /poll and vote with /vote.") end elseif(words == "/vote") then vote = tonumber(param) or -1 local options = table.unserialize(getStorage(OPTIONS_STORAGE)) if getStorage(POLL_STORAGE) == -1 then return doPlayerSendCancel(cid, "There is not a poll in progress.") end if vote == -1 then return doPlayerSendCancel(cid, "You need to choose a option to vote.") end if getCreatureStorage(cid, PLAYER_STORAGE) == 1 then print(getCreatureStorage(cid, PLAYER_STORAGE)) return doPlayerSendCancel(cid, "You cannot vote two times.") end if vote > #options then return doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE) end options[vote][2] = options[vote][2] + 1 doSetStorage(OPTIONS_STORAGE, table.serialize(options)) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have voted in the option ".. options[vote][1] .." successfully!") doCreatureSetStorage(cid, PLAYER_STORAGE, 1) elseif(words == "/poll") then local options = table.unserialize(getStorage(OPTIONS_STORAGE)) if getStorage(POLL_STORAGE) == -1 then return doPlayerSendCancel(cid, "There is not a poll in progress.") end local text = "ADVANCED poll SYSTEM\n\n".. getStorage(POLL_STORAGE) .."?\n" local count = 1 for _, option in ipairs(options) do text = text .."\n#".. count .." ".. option[1] .." ".. (getTotalVotes() == 0 and 0 or math.floor((option[2]/getTotalVotes()) * 100)) .."%\n" count = count + 1 end doPlayerPopupFYI(cid, text) elseif(words == "/endpoll") then if getStorage(POLL_STORAGE) == -1 then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "There is not a poll to be ended.") end if not getMostVotedOption() then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Wait at least one vote to end this poll.") end doBroadcastMessage("The poll '".. getStorage(POLL_STORAGE) .."?' has been finished!\nThe most voted option was ".. getMostVotedOption() ..".") doSetStorage(POLL_STORAGE, -1) doSetStorage(OPTIONS_STORAGE, -1) for _, player in ipairs(getPlayersOnline()) do doCreatureSetStorage(player, PLAYER_STORAGE, -1) end db.executeQuery("UPDATE `player_storage` SET value = -1 WHERE `key` = ".. PLAYER_STORAGE ..";") end return true end E pronto, o sistema está instalado. Basta agora no jogo com um GOD digitar: /newpoll pergunta,opção1,opção2,opção3,... E para finalizar a enquete /endpoll Jogadores podem usar os comandos abaixo para visualizar o estado da enquete e votar, respectivamente. /poll /vote O comando /vote deve ser seguido do número da opção que aparece no comando /poll Irei postar em breve um vídeo, fiquem ligados. Um grande abraço.
-
dúvida Ajudar A Completar Este Script (Ring Atacck Target Com Sd)
pergunta respondeu ao Bennyhappy de Oneshot em Scripts
Fiz de cabeça o script, então não prestei atenção nisso. Enfim, 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) setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1, -60, -1, -60, 5, 5, 4, 7) local combat_events = {} local function doCombatWithDelay(cid, combat, var, itemid) if isCreature(cid) then doCombat(cid, combat, var) if getPlayerSlotItem(cid, CONST_SLOT_RING) == itemid then combat_events[cid] = addEvent(doCombatWithDelay, 1 * 1000, cid, combat, var, itemid) end end end function onEquip(cid, item, slot) local target = getCreatureTarget(cid) if(target == 0) then return true end doCombat(cid, combat, numberToVariant(target)) combat_events[cid] = addEvent(doCombatWithDelay, 1 * 1000, cid, combat, numberToVariant(target), item.itemid) end function onDeEquip(cid, item, slot) doSendMagicEffect(getThingPosition(cid), CONST_ME_BLOCKHIT) stopEvent(combat_events[cid]) return true end -
local config = { maxLevelDifference = 0.7, experience = 2000 } function onKill(cid, target, lastHit) if(not isPlayer(target)) then return true end if(getCreatureSkull(cid) > 1) then return true end if(getPlayerLevel(target) > getPlayerLevel(cid) or getPlayerLevel(target) >= config.maxLevelDifference * getPlayerLevel(cid)) then return true end local formula = ((config.maxLevelDifference - (getPlayerLevel(target) / getPlayerLevel(cid))) * 100) * config.experience doPlayerAddExperience(cid, -formula) doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Você não teve honra!\nVocê matou um jogador com ".. getPlayerLevel(cid) - getPlayerLevel(target) .." levels de diferença e, por isso, perderá ".. formula .." pontos de experiência.") return true end Pela fórmula que eu fiz e pude entender do tópico: - Um jogador level 100 mata um jogador level 50 - level 50 é abaixo de 70% de 100 - logo o jogador irá receber uma punição. - Essa punição será - ((0.7 - 50/100) * 100) * 2000 - 40000 pontos de experiência. E não preciso do dinheiro não. Um grande abraço.
- 2 respostas
-
- anti power
- power abuser
- (e 2 mais)
-
dúvida Ajudar A Completar Este Script (Ring Atacck Target Com Sd)
pergunta respondeu ao Bennyhappy de Oneshot em Scripts
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) setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1, -60, -1, -60, 5, 5, 4, 7) local function doCombatWithDelay(cid, combat, var, itemid) doCombat(cid, combat, var) if getPlayerSlotItem(cid, CONST_SLOT_RING) == itemid then addEvent(doCombatWithDelay, 1 * 1000, cid, combat, var, itemid) end end function onEquip(cid, item, slot) local target = getCreatureTarget(cid) if(target == 0) then return true end doCombat(cid, combat, numberToVariant(target)) addEvent(doCombatWithDelay, 1 * 1000, cid, combat, numberToVariant(target), item.itemid) end function onDeEquip(cid, item, slot) doSendMagicEffect(getThingPosition(cid), CONST_ME_BLOCKHIT) return true end -
dúvida Ajudar A Completar Este Script (Ring Atacck Target Com Sd)
pergunta respondeu ao Bennyhappy de Oneshot em Scripts
Totalmente errado. 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) setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1, -60, -1, -60, 5, 5, 4, 7) function onEquip(cid, item, slot) local target = getCreatureTarget(cid) if(target == 0) then return true end return doCombat(cid, combat, numberToVariant(target)) end function onDeEquip(cid, item, slot) doSendMagicEffect(getThingPosition(cid), CONST_ME_BLOCKHIT) return true end -
VÍDEO DE FUNCIONAMENTO
-
Nome: Mega War's Spirit Gems Tipo: Action Autor: Oneshot Grande Éks. Uma coisa que eu adoro fazer quando estou sem nada para fazer õ_o É reproduzir sistemas de servidores/projetos famosos para testar atÉ onde posso chegar com a programação Lua. Notei que muita gente cobiça pelo sistema de Spirit Gems do servidor Mega War, então eu resolvi criar uma rÉplica não tão fiel desse sistema com base no que há disponível no site deles. Lá diz que são itens que adicionam certos atributos por tempo. Como eu achei muito simples, eu adicionei algumas frescurinhas, um efeito mágico sendo enviado enquanto os atributos que o item dá durarem. O sistema está bem fácil de configurar e intuitivo e isso É o que importa. Vamos lá. Abra seu arquivo items.xml e procure por isto: <item id="2153" article="a" name="violet gem"> <attribute key="weight" value="30"> </item> <item id="2154" article="a" name="yellow gem"> <attribute key="weight" value="30"> </item> Substitua por isso: <item id="2153" article="a" name="knight spirit gem"> <attribute key="description" value="Free the strongest medieval warrior's spirit that is inside you. (Melee +12%, Speed +40)"> <attribute key="weight" value="30"> </item> <item id="2154" article="a" name="paladin spirit gem"> <attribute key="description" value="Free the strongest medieval archer's spirit that is inside you. (Distance +12%, Speed +40)"> <attribute key="weight" value="30"> </item> Mais uma vez, procure por isso: <item id="2156" article="a" name="red gem"> <attribute key="weight" value="30"> </item> <item id="2157" article="a" name="gold nugget" plural="gold nuggets"> <attribute key="weight" value="10"> </item> <item id="2158" article="a" name="blue gem"> <attribute key="weight" value="100"> </item> Substitua por isso: <item id="2156" article="a" name="sorcerer spirit gem"> <attribute key="description" value="Free the strongest medieval mage's spirit that is inside you. (Magic +12%, Speed +40)"> <attribute key="weight" value="30"> </item> <item id="2157" article="a" name="gold nugget" plural="gold nuggets"> <attribute key="weight" value="10"> </item> <item id="2158" article="a" name="druid spirit gem"> <attribute key="description" value="Free the strongest medieval mage's spirit that is inside you. (Magic +12%, Speed +40)"> <attribute key="weight" value="100"> </item> Agora, crie um arquivo chamado gems.lua na pasta data/actions/scripts e adicione isso: local GemsConfig = { [2153] = { vocations = {4, 8}, effect = CONST_ME_EXPLOSIONAREA, conditions = { [CONDITION_ATTRIBUTES] = { [CONDITION_PARAM_TICKS] = 3 * 60 * 60 * 1000, [CONDITION_PARAM_SKILL_MELEEPERCENT] = 112, [CONDITION_PARAM_BUFF] = true, [CONDITION_PARAM_SUBID] = 200 }, [CONDITION_HASTE] = { [CONDITION_PARAM_TICKS] = 3 * 60 * 60 * 1000, [CONDITION_PARAM_SPEED] = 40 } } }, [2154] = { vocations = {3, 7}, effect = CONST_ME_HOLYDAMAGE, conditions = { [CONDITION_ATTRIBUTES] = { [CONDITION_PARAM_TICKS] = 3 * 60 * 60 * 1000, [CONDITION_PARAM_SKILL_DISTANCEPERCENT] = 112, [CONDITION_PARAM_BUFF] = true, [CONDITION_PARAM_SUBID] = 200 }, [CONDITION_HASTE] = { [CONDITION_PARAM_TICKS] = 3 * 60 * 60 * 1000, [CONDITION_PARAM_SPEED] = 40 } } }, [2156] = { vocations = {1, 5}, effect = CONST_ME_MORTAREA, conditions = { [CONDITION_ATTRIBUTES] = { [CONDITION_PARAM_TICKS] = 3 * 60 * 60 * 1000, [CONDITION_PARAM_STAT_MAGICLEVELPERCENT] = 112, [CONDITION_PARAM_BUFF] = true, [CONDITION_PARAM_SUBID] = 200 }, [CONDITION_HASTE] = { [CONDITION_PARAM_TICKS] = 3 * 60 * 60 * 1000, [CONDITION_PARAM_SPEED] = 40 } } }, [2158] = { vocations = {2, 6}, effect = CONST_ME_SMALLPLANTS, conditions = { [CONDITION_ATTRIBUTES] = { [CONDITION_PARAM_TICKS] = 3 * 60 * 60 * 1000, [CONDITION_PARAM_STAT_MAGICLEVELPERCENT] = 112, [CONDITION_PARAM_BUFF] = true, [CONDITION_PARAM_SUBID] = 200 }, [CONDITION_HASTE] = { [CONDITION_PARAM_TICKS] = 3 * 60 * 60 * 1000, [CONDITION_PARAM_SPEED] = 40 } } } } local Conditions = {} for itemid, info in pairs(GemsConfig) do Conditions[itemid] = {} for condition, parameters in pairs(info.conditions) do local new = createConditionObject(condition) for parameter, value in pairs(parameters) do setConditionParam(new, parameter, value) end table.insert(Conditions[itemid], new) end end local function doShowGemAura(cid, type) local position = getThingPosition(cid) doSendMagicEffect(position, type) if isCreature(cid) then if getCreatureCondition(cid, CONDITION_ATTRIBUTES, 200) then addEvent(doShowGemAura, 1 * 1000, cid, type) end end return true end function onUse(cid, item, fromPosition, itemEx, toPosition) if not GemsConfig[item.itemid] then return false end if not isInArray(GemsConfig[item.itemid].vocations, getPlayerVocation(cid)) then return doPlayerSendCancel(cid, "You cannot use this spirit gem.") end if getCreatureCondition(cid, CONDITION_ATTRIBUTES, 200) then return false end for _, condition in pairs(Conditions[item.itemid]) do doAddCondition(cid, condition) end doCreatureSay(cid, "AAAAH! I FEEL THE POWER!", TALKTYPE_ORANGE_1) doSendMagicEffect(toPosition, GemsConfig[item.itemid].effect) addEvent(doShowGemAura, 1 * 1000, cid, GemsConfig[item.itemid].effect) doRemoveItem(item.uid, 1) return true end Abra seu arquivo actions.xml e adicione isso: <action itemid="2153;2154;2156;2158" event="script" value="gems.lua"/> Caso você queria adicionar a restrição do utito tempo enquanto o efeito da spirit gem durar, abra o arquivo do utito tempo, apague tudo e coloque isso: Ele normalmente está em data/spells/scripts/support. local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE) setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false) local condition = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(condition, CONDITION_PARAM_TICKS, 10000) setConditionParam(condition, CONDITION_PARAM_SKILL_MELEEPERCENT, 135) setConditionParam(condition, CONDITION_PARAM_SKILL_SHIELDPERCENT, -100) setConditionParam(condition, CONDITION_PARAM_BUFF, true) setCombatCondition(combat, condition) function onCastSpell(cid, var) if getCreatureCondition(cid, CONDITION_ATTRIBUTES, 200) then return doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE) end return doCombat(cid, combat, var) end Não sei se está 100% fiel ao sistema do Mega War, uma vez que não pagarei para provar isso. Um abração.
-
Se não localizou nada, temos o nosso problema. Como não há nenhum script associado ao uniqueid do baú usado na quest, o sistema executa o padrão - abrir um baú vazio para armazenar coisas. O único modo de corrigir isso, é procurar se o servidor possui os scripts e então adicionar a chave no actions.xml ou então baixar outro servidor. Abraço.
-
Você andou trocando a versão do seu servidor? Se sim, o problema é simples, você esqueceu de registrar todas as uniqueids no actions.xml Caso você não tenha trocado, siga o que os colegas acima disseram, abra seu actions.xml em um editor de texto qualquer, aperte CTRL+F e procure por isso. uniqueid="10000" Se não houver nenhum resultado, confirma o fato de que os baús não possuem script para funcionar.
-
dúvida Ot Caindo Sozin, Quando Ataka Com Tal Arma, Ou Tal Magia
pergunta respondeu ao lfelipebsilva05 de Oneshot em Scripts
Verifique se as skills e maglevel dos personagens com essas novas vocações assumem valores acima de 500 no banco de dados. Poste também, se possível, o script da "sword vip do ot" -
Não gostei, um tutorial muito fraco na base do "decoreba" - são esses que mandam criar arquivo, colar e pronto.
-
dúvida Ot Caindo Sozin, Quando Ataka Com Tal Arma, Ou Tal Magia
pergunta respondeu ao lfelipebsilva05 de Oneshot em Scripts
Conheço esse erro. Isso acontece quando o personagem que usou a arma ou a magia possui skill ou maglevel exageradamente alto. Veja nas tais vocações "mixed", você não mudou as fórmulas de ganho de skill e maglevel, sem saber o que estava fazendo. -
function onUse(cid, item, fromPosition, itemEx, toPosition) local maglevel, level = getPlayerMagLevel(cid), getPlayerLevel(cid) local formula = 800 if maglevel < 1 then doSendMagicEffect(toPosition, CONST_ME_POFF) doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTENOUGHMAGICLEVEL) return true end if not isPlayer(itemEx.uid) then doSendMagicEffect(toPosition, CONST_ME_POFF) doPlayerSendDefaultCancel(cid, RETURNVALUE_CANONLYUSETHISRUNEONCREATURES) return true end doSendMagicEffect(toPosition, CONST_ME_MAGIC_BLUE) doCreatureAddHealth(itemEx.uid, formula) doCreatureAddMana(itemEx.uid, formula) if itemEx.uid == cid then doCreatureSay(itemEx.uid, "Aaahh...", TALKTYPE_ORANGE_1) end return true end
-
Aparece algum erro no console do servidor? E também há um erro quanto a chamada de uma função no script: doSendMAgicEffect(frompos,2) Essa função será acusada como inexistente, pois Lua é uma linguagem caso-sensitivo. doSendMagicEffect(frompos, 2) Já essa função é existente e o script será executado normalmente.
-
dúvida Comando Que Deleta Char, E Função Que Retira Todos Os Item Do Player Quando Ele Morre
pergunta respondeu ao eduardo190696 de Oneshot em Scripts
Só registrar o creaturescript no login.lua e no creaturescripts.xml. function onDeath(cid, corpse, deathList) if(isPlayer(cid)) then db.query("DELETE FROM `player_items` WHERE `player_id` = ".. getPlayerGUID(cid)) end return true end
-
Quem Está Navegando 0 membros estão online
- Nenhum usuário registrado visualizando esta página.