Postado Fevereiro 3, 2016 9 anos Autor addEvent(zEffect, 200, uid, effect, n + 1) nesse 200 aí, é em milisegundos.. qnt menor mais rápido só que vai ficar mais pesado no seu servidor
Postado Abril 8, 2016 9 anos Em 02/02/2016 at 07:44, xWhiteWolf disse: ficou bem merda do jeito q vc pediu, a graça do boss era ele possuir a skill e não deixar corpse.. mas já que vc quer imitar os cara do fox então toma: no xml do monstro vc coloca o corpse: corpse="8937"/> em data\creaturescripts\scripts\aegis.lua coloque assim> Mostrar conteúdo oculto local config = { storagekill = 19500, storageaegis = 19332, tempo = 5, times = 1, --- quantidade de vezes que tenho que matar charges = 1, effect1 = 66, effect2 = 10 } function onKill(cid, target, lastHit) local killed = getPlayerStorageValue(cid,config.storagekill) < 0 and 0 or getPlayerStorageValue(cid,config.storagekill) local skill = getPlayerStorageValue(cid, config.storageaegis) if isMonster(target) and getCreatureName(target):lower() == 'aegis' then if killed + 1 < config.times then doCreatureSay(target, "I'll be back mortal...", 20) doSendMagicEffect(getCreaturePosition(target), config.effect1) setPlayerStorageValue(cid, config.storagekill, killed + 1) addEvent(doSendMagicEffect, 1000*config.tempo, getThingPos(target), config.effect2) addEvent(doCreateMonster, 1000*config.tempo, "Aegis", getCreaturePosition(target), true) elseif killed + 1 >= config.times then setPlayerStorageValue(cid, config.storagekill, 0) if skill < config.charges then doPlayerSendTextMessage(cid,22,"Congratulations, you just killed "..getCreatureName(target).." and earned Aegis of Immortal skill!") doBroadcastMessage("O jogador ".. getCreatureName(cid) .." absorveu a special skill Aegis of the Immortal ao desferir o último golpe no BOSS Aegis.", 26) setPlayerStorageValue(cid, config.storageaegis, config.charges) zEffect(cid, 37) end end end return true end em data\lib\function.lua coloque no fim do arquivo Mostrar conteúdo oculto function zEffect(uid, effect, n) if isCreature(uid) and getPlayerStorageValue(uid, 19332) > 0 then local cpos = getCreaturePosition(uid) local positions = { [1] = {x = cpos.x + 1, y = cpos.y + 1, z = cpos.z}, [2] = {x = cpos.x - 1, y = cpos.y + 1 , z = cpos.z}, [3] = {x = cpos.x - 1, y = cpos.y - 1, z = cpos.z}, [4] = {x = cpos.x + 1, y = cpos.y - 1, z = cpos.z} } local n = (n and n <= #positions) and n or 1 doSendDistanceShoot(positions[n], positions[n + 1] or positions[1], effect) addEvent(zEffect, 200, uid, effect, n + 1) end return true end Agora pro monstro Aegis ter o efeito em volta vc vai ter que colocar essa função nele ao criá-lo no mapa. No caso do fox pode ser uma talkaction /startAegis ou um globalEvent (nao sei ql dos dois q é), aí nesse outro script de criar o monstro vc coloca zEffect(monster, 37) que vai ficar rodando nele. em data\creaturescripts\scripts\login.lua vc adiciona essa linha antes do ULTIMO return true: if getPlayerStorageValue(cid, 19332) > 0 then zEffect(cid, 37) end mano eu botei esse no meu server + todos que ataca e da magias no aegis ganha a aura e tmb aparece q todos desferiu ultimo hit tem como arruma? Editado Abril 13, 2016 9 anos por guizerah1995 (veja o histórico de edições)
Postado Abril 26, 2016 9 anos Autor depende muito d como seu server interpreta a function onKill.. se ele executar pra todos q ajudaram a matar vc precisa editar o aegis.lua no creaturescript e troca onde tá cid por lasthit como fica : function onKill(cid, target, lastHit) local killed = getPlayerStorageValue(lasthit,config.storagekill) local skill = getPlayerStorageValue(lasthit, config.storageaegis) if isMonster(target) and getCreatureName(target):lower() == 'aegis' then if killed < config.times then doCreatureSay(target, "I'll be back mortal...", 20) doSendMagicEffect(getThingPos(target), config.effect1) setPlayerStorageValue(lasthit, config.storagekill, killed+1) addEvent(doSendMagicEffect, 1000*config.tempo, getThingPos(target), config.effect2) addEvent(doCreateMonster, 1000*config.tempo, "Aegis", getCreaturePosition(target), true) end if killed >= config.times then setPlayerStorageValue(lasthit, config.storagekill, 0) if skill < config.charges then doPlayerSendTextMessage(lasthit,22,"Congratulations, you just killed "..getCreatureName(target).." and earned Aegis of Immortal skill!") setPlayerStorageValue(lasthit, config.storageaegis, config.charges) end end end return true end (lembra q vc tem que fazer checagens pra verificar se o lasthit é player, se ele existe.. etc.) Não sei como funciona nos outros servers mas o meu chama o onKill só para o lasthit então o parametro cid ja é o lasthit e o parametro lasthit é um booleano. e como era function onKill(cid, target, lastHit) local killed = getPlayerStorageValue(cid,config.storagekill) local skill = getPlayerStorageValue(cid, config.storageaegis) if isMonster(target) and getCreatureName(target):lower() == 'aegis' then if killed < config.times then doCreatureSay(target, "I'll be back mortal...", 20) doSendMagicEffect(getThingPos(target), config.effect1) setPlayerStorageValue(cid, config.storagekill, killed+1) addEvent(doSendMagicEffect, 1000*config.tempo, getThingPos(target), config.effect2) addEvent(doCreateMonster, 1000*config.tempo, "Aegis", getCreaturePosition(target), true) end if killed >= config.times then setPlayerStorageValue(cid, config.storagekill, 0) if skill < config.charges then doPlayerSendTextMessage(cid,22,"Congratulations, you just killed "..getCreatureName(target).." and earned Aegis of Immortal skill!") setPlayerStorageValue(cid, config.storageaegis, config.charges) end end end return true end
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.