Ir para conteúdo

zipter98

Herói
  • Total de itens

    2553
  • Registro em

  • Última visita

  • Dias Ganhos

    73

Tudo que zipter98 postou

  1. Se a speed do monstro for igual a 0, ele não irá se mover em ocasião alguma. Logo, para fazer o que você quer, seriam necessárias outras modificações. Em monster.cpp: No código da função: void Monster::onThink(uint32_t interval) Abaixo de: updateIdleStatus(); if(isIdle) return; coloque: if(Creature* creature = static_cast<Creature*>(this)) { if(!attackedCreature && !isSummon() && creature->getNoMove()) creature->setNoMove(true); } Depois, abaixo de: //We just spawned lets look around to see who is there. if(isSummon()) isMasterInRange = canSee(getMaster()->getPosition()); coloque: creature->setNoMove(true); Código lua: local storage = xxx function onTarget(cid, target) if isMonster(cid) and isPlayer(target) and getPlayerStorageValue(target, storage) > -1 then doCreatureSetNoMove(cid, false) return true end return false end
  2. data/creaturescripts/scripts: local storage = xxx function onTarget(cid, target) if isMonster(cid) and isPlayer(target) and getPlayerStorageValue(target, storage) > -1 then return true end return false end Tag: <event type="target" name="allowTarget" event="script" value="nome_do_arquivo.lua"/> No arquivo .XML do monstro, acima de: </monster> coloque: <script> <event name="allowTarget"/> </script>
  3. Qual o erro que aparece? Para todo caso, teste aquele código que exemplifiquei no tópico e informe se ele funciona adequadamente no seu servidor ou não. Se funcionar, é problema no código lua. Se não, o erro encontra-se na instalação da modificação nas sources.
  4. Tópico movido para dúvidas / pedidos resolvidos.
  5. Obrigado pelos comentários, pessoal. @Xtudomuito Basta deixar a speed dele igual a 0 (arquivo .XML do monstro).
  6. Para fazer isso seriam necessárias outras alterações. Retornando falso você vai impedir com que monstros ataquem summons e/ou players, e retornando verdadeiro a ação será realizada normalmente. E obrigado pela observação. Falta de atenção minha.
  7. Você não vai conseguir fazer isso sem modificações nas sources. http://www.xtibia.com/forum/topic/236635-ontarget-tambem-executado-por-monstros/
  8. Serei breve: com esta pequena modificação, o creatureevent onTarget poderá ser executado por monstros. Nas sources do seu servidor, abra o arquivo monster.cpp e procure por: if(it == targetList.end()) { //Target not found in our target list. #ifdef __DEBUG__ std::cout << "Target not found in targetList." << std::endl; #endif return false; } Abaixo deste bloco de código, coloque: CreatureEventList targetEvents = getCreatureEvents(CREATURE_EVENT_TARGET); for(CreatureEventList::iterator it = targetEvents.begin(); it != targetEvents.end(); ++it) { if(!(*it)->executeTarget(this, creature)) return false; } Depois, no código da função: void Monster::doAttacking(uint32_t interval) Abaixo de: if(!attackedCreature || (isSummon() && attackedCreature == this)) return; coloque: if(Creature* creature = attackedCreature->getCreature()) { CreatureEventList targetEvents = getCreatureEvents(CREATURE_EVENT_TARGET); for(CreatureEventList::iterator it = targetEvents.begin(); it != targetEvents.end(); ++it) { if(!(*it)->executeTarget(this, creature)) { setFollowCreature(NULL); setAttackedCreature(NULL); searchTarget(TARGETSEARCH_NEAREST); break; } } } Exemplo do que pode ser feito com esta alteração: Monstro não atacando jogador com X storagedata/creaturescripts/scripts: local storage = xxx function onTarget(cid, target) if isMonster(cid) and isPlayer(target) and getPlayerStorageValue(target, storage) > -1 then return false end return true end Tag: <event type="target" name="blockTarget" event="script" value="nome_do_arquivo.lua"/> No arquivo .XML do monstro, acima de: </monster> coloque: <script> <event name="blockTarget"/> </script>
  9. Troque: db.query por: db.executeQuery Esta correção também serve para aquele código que você mostrou no tópico.
  10. zipter98

    Surprise box

    Desculpe, corrigido.
  11. zipter98

    Surprise box

    local items = { --[numeração] = {id = ID DO ITEM, count = QUANTIDADE DO ITEM} [1]={id=2159, count=1}, -- [2]={id=2695, count=1}, -- [3]={id=2090, count=1}, -- [4]={id=6570, count=1}, -- [5]={id=6571, count=1}, -- [6]={id=7632, count=1}, -- [7]={id=7633, count=1}, -- [8]={id=2153, count=1}, -- [9]={id="level", count=1}, -- } function doPlayerAddLevel(cid, amount, round) local newExp = 0 local currentLevel = getPlayerLevel(cid) if amount > 0 then newExp = getExperienceForLevel(currentLevel + amount) - (round and getPlayerExperience(cid) or getExperienceForLevel(currentLevel)) else newExp = -((round and getPlayerExperience(cid) or getExperienceForLevel(currentLevel)) - getExperienceForLevel(currentLevel + amount)) end return doPlayerAddExp(cid, newExp) end function onUse(cid, item, fromPosition, itemEx, toPosition) local a = math.random(1, #items) if type(items[a].id) == "string" then doPlayerAddLevel(cid, items[a].count) else doPlayerAddItem(cid, items[a].id, items[a].count) end doSendAnimatedText(getPlayerPosition(cid), "Box!", TEXTCOLOR_GREEN) doPlayerSendTextMessage(cid, 27, "Você abriu a box e ganhou "..items[a].count.."x "..(tonumber(items[a].id) and getItemNameById(items[a].id) or "level"..(items[a].count > 1 and "s" or ""))..".") doRemoveItem(item.uid, 1) return true end
  12. Tópico Movido Este tópico foi movido de "OTServ → Suporte → Suporte Scripting" para "OTServ → Suporte → Suporte Servidores derivados".
  13. Tópico movido para dúvidas / pedidos resolvidos.
  14. zipter98

    Surprise box

    Tópico Movido Este tópico foi movido de "OTServ → Scripting → Scripts Prontos" para "OTServ → Suporte → Suporte Scripting".
  15. Tópico Movido Este tópico foi movido de "OTServ → Suporte → Suporte Scripting" para "OTServ → Suporte → Suporte Servidores derivados". Supondo que a base seja PDA: pokemon moves.lua: elseif spell == "Dual Flamethrower" then local outfit, time = xxx, 300 --Respectivamente, ID da outfit e tempo de duração. local pos = getThingPos(cid) local dir = { [0] = { effect = 106, posis = { {x = pos.x, y = pos.y - 1, z = pos.z}, {x = pos.x + 2, y = pos.y - 1, z = pos.z} } }, [1] = { effect = 109, posis = { {x = pos.x + 3, y = pos.y - 1, z = pos.z}, {x = pos.x + 3, y = pos.y + 2, z = pos.z} } }, [2] = { effect = 107, posis = { {x = pos.x, y = pos.y + 3, z = pos.z}, {x = pos.x + 2, y = pos.y + 3, z = pos.z} } }, [3] = { effect = 108, posis = { {x = pos.x - 1, y = pos.y, z = pos.z}, {x = pos.x - 1, y = pos.y + 2, z = pos.z} } } } local info = dir[getCreatureLookDirection(cid)] doMoveInArea2(cid, 0, dualFlameArea, FIREDAMAGE, min, max, spell) doSetCreatureOutfit(cid, {lookType = outfit}, time * 1000) for i = 1, #info.posis do doSendMagicEffect(info.posis[i], info.effect) end
  16. Se você conseguir encontrar o código da função que mencionei, posso lhe ajudar a instalá-la.
  17. Apesar de ter feito este código faz um tempo, suponho que ainda esteja funcionando como deve. Para base PDA: data/creaturescripts/scripts, exp2.0.lua: Troque: if valor >= getCreatureHealth(cid) then if isInArray(cannotKill, combat) and isPlayer(cid) then valor = getCreatureHealth(cid) - 1 else valor = getCreatureHealth(cid) end end por: local config = { sturdy = { --Pokémons que possuem a habilidade Sturdy. Configuração: ["nome_do_pokemon"] = lookType, ["Aggron"] = lookType, }, cd = 30, --Cooldown da habilidade. duration = 8, --Duração, em segundos, do Sturdy. storage = 8402, } if getPlayerStorageValue(cid, config.storage) > -1 then return false end local hp = getCreatureHealth(cid) - valor if not isPlayer(cid) and hp <= 1 and config.sturdy[getCreatureName(cid)] then local b = true if isSummon(cid) then local ball = getPlayerSlotItem(getCreatureMaster(cid), 8) if ball and getCD(ball.uid, "sturdy") > 0 then b = false end end if b then if hp < 1 then doCreatureAddHealth(cid, hp < 0 and (hp * -1) + 1 or 1) end setPlayerStorageValue(cid, config.storage, 1) if isSummon(cid) then local ball = getPlayerSlotItem(getCreatureMaster(cid), 8) if ball then setCD(ball.uid, "sturdy", config.duration + config.cd) end end doSetCreatureOutfit(cid, {lookType = config.sturdy[getCreatureName(cid)]}, config.duration * 1000) addEvent(function() if isCreature(cid) and getPlayerStorageValue(cid, config.storage) > -1 then setPlayerStorageValue(cid, config.storage, -1) doCreatureAddHealth(cid, -getCreatureHealth(cid)) end end, config.duration * 1000) end end if valor >= getCreatureHealth(cid) then if isInArray(cannotKill, combat) and isPlayer(cid) then valor = getCreatureHealth(cid) - 1 else valor = getCreatureHealth(cid) end end data/lib, newStatusSyst.lua: Troque: doCreatureAddHealth(cid, -damage, 15, COLOR_BURN) por: if getPlayerStorageValue(cid, 8402) == -1 then doCreatureAddHealth(cid, -damage, 15, COLOR_BURN) end Troque: doCreatureAddHealth(cid, -dano, 8, COLOR_GRASS) por: if getPlayerStorageValue(cid, 8402) == -1 then doCreatureAddHealth(cid, -dano, 8, COLOR_GRASS) end Troque: doCreatureAddHealth(cid, -damage) doSendAnimatedText(getThingPos(cid), "-"..damage.."", 144) doSendMagicEffect(getThingPos(cid), 45) ------ local newlife = life - getCreatureHealth(cid) if newlife >= 1 and attacker ~= 0 then doSendMagicEffect(getThingPos(attacker), 14) doCreatureAddHealth(attacker, newlife) doSendAnimatedText(getThingPos(attacker), "+"..newlife.."", 32) end por: if getPlayerStorageValue(cid, 8402) == -1 then doCreatureAddHealth(cid, -damage) doSendAnimatedText(getThingPos(cid), "-"..damage.."", 144) doSendMagicEffect(getThingPos(cid), 45) ------ local newlife = life - getCreatureHealth(cid) if newlife >= 1 and attacker ~= 0 then doSendMagicEffect(getThingPos(attacker), 14) doCreatureAddHealth(attacker, newlife) doSendAnimatedText(getThingPos(attacker), "+"..newlife.."", 32) end end
  18. Sim. Troque a tabela da lib por: megaEvolutions = { --[itemid] = {"poke_name", "mega_evolution", outfit_id}, [11638] = {"Charizard", "Mega Charizard X", xxx}, [11639] = {"Charizard", "Mega Charizard Y", xxx}, } Em data/actions/scripts, goback.lua: Abaixo de: if not isCreature(pk) then return true end coloque: if getItemAttribute(item.uid, "megaStone") then doSetCreatureOutfit(pk, {lookType = megaEvolutions[getItemAttribute(item.uid, "megaStone")][3]}, -1) end
  19. Tópico movido para dúvidas / pedidos resolvidos.
  20. Se for escrita em C++, coloque o código da função em luascript.cpp e, em luascript.h, declare-a. Se for em Lua, coloque-a em algum lugar da lib ou na própria talkaction. Procure na internet pelo seu sistema de guerra e refaça a instalação.
  21. A causa do erro é a ausência da função doGuildAddEnemy. Instale-a e seja feliz.
  22. E qual o erro que aparece na distro quando você usa esta talkaction?
  23. Sem problemas. Movido para resolvidos.
  24. Primeiramente, sempre procure colocar em seus tópicos títulos que sugiram o conteúdo do tópico. Colocando "Script do Zipter98" é muito generalizante, enquanto algo como "Ajuda para converter sistema para outra base (pokémon)" seria bem mais objetivo e talvez atraísse mais pessoas dispostas a ajudar. Para todo caso, alterei o título para você. Também recomendo o uso de spoiler para códigos muito grandes. Troque: doSetCreatureOutfit(cid, {lookType = pokemon[1] + 351}, -1) por: doSetCreatureOutfit(cid, {lookType = pokemon + 351}, -1)
  25. Já que você não mencionou a base utilizada, irei supor que é PDA. data/lib/pokemon moves.lua: elseif spell == "Outrage" then local config = { outfit = { --["pokemon_name"] = outfit, ["Salamence"] = xxx, }, AOE = { times = 2, --Quantas vezes o golpe AOE será usado. interval = 3000, --Intervalo de tempo, em milésimos de segundo, entre cada golpe AOE. combat = DRAGONDAMAGE, --Elemento. spell = { --Uma tabela deverá ser configurada com a área e efeito da parte com socos, e a outra com a parte do efeito do Draco Meteor. {area = OutrageArea1, effect = xxx}, --{area = área do dano AOE, effect = efeito} {area = OutrageArea2, effect = xxx} }, } } local function doOutrage(cid, times) if not isCreature(cid) then return true end for i = 1, #config.AOE.spell do doMoveInArea2(cid, config.AOE.spell[i].effect, config.AOE.spell[i].area, config.AOE.combat, min, max, spell) end times = times - 1 if times <= 0 then local rounds = math.random(4, 7) rounds = rounds + math.floor(getPokemonLevel(cid) / 35) local ret = {} ret.id = cid ret.cd = rounds ret.check = getPlayerStorageValue(cid, conds["Confusion"]) ret.cond = "Confusion" doCondition2(ret) return true end addEvent(doOutrage, config.AOE.interval, cid, times) end local ret = {} ret.id = cid ret.cd = config.AOE.interval / 1000 * config.AOE.times ret.eff = 0 ret.check = 0 ret.buff = spell ret.first = true doCondition2(ret) doSetCreatureOutfit(cid, {lookType = config.outfit[getCreatureName(cid)]}, config.AOE.interval * config.AOE.times) addEvent(doOutrage, config.AOE.interval, cid, config.AOE.times) areas.lua: OutrageArea1 = { {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0}, {0, 0, 0, 0, 1, 1, 1, 2, 1, 1, 1, 0, 0, 0, 0}, {0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, } OutrageArea2 = { {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0}, {0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0}, {0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0}, {0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0}, {0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, } newStatusSyst.lua, abaixo de: if buff == "Strafe" or buff == "Agility" then setPlayerStorageValue(cid, 374896, 1) --velo atk --alterado v1.6 doRaiseStatus(cid, 0, 0, 100, a) coloque: elseif buff == "Outrage" then doRaiseStatus(cid, 0, 1.4, 0, a)
  • Quem Está Navegando   0 membros estão online

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