Ir para conteúdo

Alguem Poderia me ajudar com ese Scrip de passive Illusion


allanzinh

Posts Recomendados

Então eo vi um Topico com ese Scrip . depois eo vi o topico do slicer como criar spells e fui seguindo pq eo to com o serv dele . Eo fiz tudo "certo" não deo erro no server só que Não aconteceo nada com o misdreavuss . Eo quero um igual ow parecido com o da pxg que o pokemon quando está cendo atacado fica se multiplicando passivamente .

 

--/////////////////////// PASSIVAS /////////////////////////--
elseif spell == "Illusion Team" then
local function RemoveTeam(cid, master)
if isCreature(cid) then
local p = getThingPosWithDebug(cid)
doSendMagicEffect(p, 211)
doRemoveCreature(cid)
end
end
local function sendEff(cid, master, t)
if isCreature(cid) and isCreature(master) and t > 0 and #getCreatureSummons(master) >= 2 then
doSendMagicEffect(getThingPosWithDebug(cid), 86, master)
addEvent(sendEff, 1000, cid, master, t-1) --alterado v1.9
end
end
if getPlayerStorageValue(cid, 637500) >= 1 then
return true
end
local s = {
["Misdreavus"] = "MisdreavusTeam",
["Shiny Stantler"] = "ShinyStantlerTeam",
}
local master = getCreatureMaster(cid)
local item = getPlayerSlotItem(master, 8)
local pos = getThingPosWithDebug(cid)
local time = 5
local pokelife = (getCreatureHealth(cid) / getCreatureMaxHealth(cid))
local random = math.random(5, 10)
local dir = getCreatureLookDir(cid)
---------
doItemSetAttribute(item.uid, "hp", pokelife)
---------
doDisapear(cid)
doTeleportThing(cid, {x=4, y=3, z=10}, false)
doAppear(cid)
---------
doSummonMonster(master, s[getSubName(cid, target)]) --alterado v1.6.1
local pk = getCreatureSummons(master)[2]
adjustStatus(pk, item.uid, true, true, true)
---------
doTeleportThing(pk, getClosestFreeTile(pk, pos), false)
doTeleportThing(cid, getClosestFreeTile(cid, pos), false)
doCreatureSetLookDir(pk, dir)
doCreatureSetLookDir(cid, dir)
doSendMagicEffect(getThingPosWithDebug(pk), 211)
doSendMagicEffect(getThingPosWithDebug(cid), 211)
if getPlayerStorageValue(cid, 9658783) >= 1 then --gambiarra
doSetCreatureOutfit(cid, {lookType = 1446}, -1)
end
sendEff(cid, master, time) --alterado v1.9
--------
setPlayerStorageValue(pk, 637500, 1)
setPlayerStorageValue(master, 637501, 1)
addEvent(RemoveTeam, time*1000, pk, master)
addEvent(setPlayerStorageValue, time*1000, master, 637501, -2) --alterado v1.6

 

ALGUEM PODER ME AJUDAR COM ESE SCRIPT DO 5 REP+
Link para o comentário
Compartilhar em outros sites

Tente esse:

 

elseif spell == "" then
        local time = 5 * 1000
local name = getCreatureName(cid)
local status = getPokemonStatus(name, getOffense(creature) / pokes[name].off)
local newSummon = doSummonMonster(cid, name)
if not isCreature(newSummon) then return end
setWildPokemonLevel(newSummon, getLevel(cid), status)
doTeleportThing(newSummon, getThingPos(cid), false)
doSendMagicEffect(getThingPos(newSummon), CONST_ME_TELEPORT)
addEvent(function(uid) if isCreature(uid) then
  doSendMagicEffect(getThingPos(uid), CONST_ME_TELEPORT)
  doRemoveCreature(uid) end
end, time, newSummon)

 

 

Informe se o seu Server e com Lvl ou Sem

Link para o comentário
Compartilhar em outros sites

Tenta assim:

function onThink(cid, interval)
elseif spell == "" then
local storage = 124239
if getPlayerStorageValue(cid, storage) - os.time() > 0 then return end
setPlayerStorageValue(cid, storage, os.time() + 6)
        local time = 5 * 1000
local name = getCreatureName(cid)
local status = getPokemonStatus(name, getOffense(creature) / pokes[name].off)
local newSummon = doSummonMonster(cid, name)
if not isCreature(newSummon) then return end
setWildPokemonLevel(newSummon, getLevel(cid), status)
doTeleportThing(newSummon, getThingPos(cid), false)
doSendMagicEffect(getThingPos(newSummon), CONST_ME_TELEPORT)
addEvent(function(uid) if isCreature(uid) then
  doSendMagicEffect(getThingPos(uid), CONST_ME_TELEPORT)
  doRemoveCreature(uid) end
end, time, newSummon)
Editado por Shoguns
Link para o comentário
Compartilhar em outros sites

[25/02/2014 06:10:46] [Error - LuaScriptInterface::loadFile] data/lib/pokemon moves.lua:4035: 'end' expected (to close 'function' at line 4034) near 'elseif'
[25/02/2014 06:10:46] [Warning - LuaScriptInterface::initState] Cannot load data/lib/
[25/02/2014 06:10:46] [Error - LuaScriptInterface::loadFile] data/lib/pokemon moves.lua:4035: 'end' expected (to close 'function' at line 4034) near 'elseif'
[25/02/2014 06:10:46] [Warning - LuaScriptInterface::initState] Cannot load data/lib/
[25/02/2014 06:10:46] [Error - LuaScriptInterface::loadFile] data/lib/pokemon moves.lua:4035: 'end' expected (to close 'function' at line 4034) near 'elseif'
[25/02/2014 06:10:46] [Warning - LuaScriptInterface::initState] Cannot load data/lib/
[25/02/2014 06:10:47] [Error - LuaScriptInterface::loadFile] data/lib/pokemon moves.lua:4035: 'end' expected (to close 'function' at line 4034) near 'elseif'
[25/02/2014 06:10:47] [Warning - LuaScriptInterface::initState] Cannot load data/lib/
[25/02/2014 06:10:47] [Error - LuaScriptInterface::loadFile] data/lib/pokemon moves.lua:4035: 'end' expected (to close 'function' at line 4034) near 'elseif'
[25/02/2014 06:10:47] [Warning - LuaScriptInterface::initState] Cannot load data/lib/
[25/02/2014 06:10:48] [Error - LuaScriptInterface::loadFile] data/lib/pokemon moves.lua:4035: 'end' expected (to close 'function' at line 4034) near 'elseif'
[25/02/2014 06:10:48] [Warning - LuaScriptInterface::initState] Cannot load data/lib/
[25/02/2014 06:10:48] [Error - LuaScriptInterface::loadFile] data/lib/pokemon moves.lua:4035: 'end' expected (to close 'function' at line 4034) near 'elseif'
[25/02/2014 06:10:48] [Warning - LuaScriptInterface::initState] Cannot load data/lib/
o Erro que deo primeiro e depois deo ese erro aki

e deo um erro no [Creaturescript Interface] data/creaturesscrip/scrips/spaw.lua77

Editado por allanzinh
Link para o comentário
Compartilhar em outros sites

Arquivo.lua

 

elseif spell == "" then
local storage = 124239
if getPlayerStorageValue(cid, storage) - os.time() > 0 then return end
setPlayerStorageValue(cid, storage, os.time() + 6)
        local time = 5 * 1000
local name = getCreatureName(cid)
local status = getPokemonStatus(name, getOffense(creature) / pokes[name].off)
local newSummon = doSummonMonster(cid, name)
if not isCreature(newSummon) then return end
setWildPokemonLevel(newSummon, getLevel(cid), status)
doTeleportThing(newSummon, getThingPos(cid), false)
doSendMagicEffect(getThingPos(newSummon), CONST_ME_TELEPORT)
addEvent(function(uid) if isCreature(uid) then
  doSendMagicEffect(getThingPos(uid), CONST_ME_TELEPORT)
  doRemoveCreature(uid) end
end, time, newSummon)

 

 

Tag.xml

<event type="statschange" name="PassiveMis" event="script" value="arquivo.lua"/>

 

 

Registre a Tag no login.lua:

registerCreatureEvent(cid, "PassiveMis")
Editado por Shoguns
Link para o comentário
Compartilhar em outros sites

Deo ese agr


[25/02/2014 07:02:01] [Error - LuaScriptInterface::loadFile] data/creaturescripts/scripts/passive.lua:1: '<eof>' expected near 'elseif'

[25/02/2014 07:02:01] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/passive.lua)

[25/02/2014 07:02:01] data/creaturescripts/scripts/passive.lua:1: '<eof>' expected near 'elseif'


Deo ese Erro pq eo mudei o nome da pasta pra passive ? mais na tag eo coloquei passive tbm

Link para o comentário
Compartilhar em outros sites

Tenta assim o script:

 

elseif spell == "" then
local storage = 124239
return true
if getPlayerStorageValue(cid, storage) - os.time() > 0 then return end
setPlayerStorageValue(cid, storage, os.time() + 6)
        local time = 5 * 1000
local name = getCreatureName(cid)
local status = getPokemonStatus(name, getOffense(creature) / pokes[name].off)
local newSummon = doSummonMonster(cid, name)
if not isCreature(newSummon) then return end
setWildPokemonLevel(newSummon, getLevel(cid), status)
doTeleportThing(newSummon, getThingPos(cid), false)
doSendMagicEffect(getThingPos(newSummon), CONST_ME_TELEPORT)
addEvent(function(uid) if isCreature(uid) then
  doSendMagicEffect(getThingPos(uid), CONST_ME_TELEPORT)
  doRemoveCreature(uid) end
end, time, newSummon)
Link para o comentário
Compartilhar em outros sites

[25/02/2014 07:36:02] [Error - LuaScriptInterface::loadFile] data/creaturescripts/scripts/passive.lua:1: '<eof>' expected near 'elseif'

[25/02/2014 07:36:02] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/passive.lua)

[25/02/2014 07:36:02] data/creaturescripts/scripts/passive.lua:1: '<eof>' expected near 'elseif'


Deo ese Erro :/

Link para o comentário
Compartilhar em outros sites

testa ae..

if spell == "" then
      local time = 5 * 1000
      local name = getCreatureName(cid)
      local status = getPokemonStatus(name, getOffense(creature) / pokes[name].off)
      local newSummon = doSummonMonster(cid, name)
elseif not isCreature(newSummon) then return end
      setWildPokemonLevel(newSummon, getLevel(cid), status)
      doTeleportThing(newSummon, getThingPos(cid), false)
      doSendMagicEffect(getThingPos(newSummon), CONST_ME_TELEPORT)
      addEvent(function(uid) if isCreature(uid) then
      doSendMagicEffect(getThingPos(uid), CONST_ME_TELEPORT)
      doRemoveCreature(uid) end
end, time, newSummon)
Link para o comentário
Compartilhar em outros sites

 

function onThink(cid, interval)
 
if spell == "" then
      local time = 5 * 1000
      local name = getCreatureName(cid)
      local status = getPokemonStatus(name, getOffense(creature) / pokes[name].off)
      local newSummon = doSummonMonster(cid, name)
elseif not isCreature(newSummon) then return end
      setWildPokemonLevel(newSummon, getLevel(cid), status)
      doTeleportThing(newSummon, getThingPos(cid), false)
      doSendMagicEffect(getThingPos(newSummon), CONST_ME_TELEPORT)
      addEvent(function(uid) if isCreature(uid) then
      doSendMagicEffect(getThingPos(uid), CONST_ME_TELEPORT)
      doRemoveCreature(uid) end
end, time, newSummon)

 

 

Agora troca la na tag do xml o StatsChange por think

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...