758594 3 Postado Janeiro 27, 2012 Share Postado Janeiro 27, 2012 Bom,eu tenho essa magia > --// Requerimento para compatibilidade com as novas versões de OTServer \\local mayNotMove = doCreatureSetNoMove function doPushCreature(pos, target) creature = getThingfromPos({x=target.x, y=target.y, z=target.z, stackpos=253}).uid if target.y < pos.y and target.x == pos.x then newpos = {x=target.x, y=target.y-1, z=target.z} elseif target.y > pos.y and target.x == pos.x then newpos = {x=target.x, y=target.y+1, z=target.z} elseif target.y == pos.y and target.x > pos.x then newpos = {x=target.x+1, y=target.y, z=target.z} elseif target.y == pos.y and target.x < pos.x then newpos = {x=target.x-1, y=target.y, z=target.z} elseif target.y < pos.y and target.x > pos.x then newpos = {x=target.x+1, y=target.y-1, z=target.z} elseif target.y > pos.y and target.x < pos.x then newpos = {x=target.x-1, y=target.y+1, z=target.z} elseif target.y > pos.y and target.x > pos.x then newpos = {x=target.x+1, y=target.y+1, z=target.z} elseif target.y < pos.y and target.x < pos.x then newpos = {x=target.x-1, y=target.y-1, z=target.z} end if creature > 0 then if queryTileAddThing(creature, newpos) == TRUE then doTeleportThing(creature, newpos, TRUE) end end end local arr = { [1] = { {1,1,1}, {1,2,1}, {1,1,1} }, [2] = { {0,1,1,1,0}, {1,0,0,0,1}, {1,0,2,0,1}, {1,0,0,0,1}, {0,1,1,1,0} }, [3] = { {0,0,1,1,1,0,0}, {0,1,0,0,0,1,0}, {1,0,0,0,0,0,1}, {1,0,0,2,0,0,1}, {1,0,0,0,0,0,1}, {0,1,0,0,0,1,0}, {0,0,1,1,1,0,0} }, [4] = { {0,0,0,1,1,1,0,0,0}, {0,0,1,0,0,0,1,0,0}, {0,1,0,0,0,0,0,1,0}, {1,0,0,0,0,0,0,0,1}, {1,0,0,0,2,0,0,0,1}, {1,0,0,0,0,0,0,0,1}, {0,1,0,0,0,0,0,1,0}, {0,0,1,0,0,0,1,0,0}, {0,0,0,1,1,1,0,0,0} } } function onTargetCreature(cid, target) doPushCreature(getCreaturePosition(cid), target) end combat = {} for n, v in pairs(arr) do combat[n] = createCombatObject() _G["callback"..n] = onTargetCreature setCombatCallback(combat[n], CALLBACK_PARAM_TARGETTILE, "callback"..n) setCombatParam(combat[n], COMBAT_PARAM_EFFECT, 2) setCombatArea(combat[n], createCombatArea(v)) end function onCastSpell(cid, var) mayNotMove(cid, TRUE) for i = 1, #combat do addEvent(doCombat, i*150-150, cid, combat, var) if i == #combat then addEvent(mayNotMove, i*150-150, cid, FALSE) end end return TRUE end ai quero por nela,que só eu possa usar e no final dela caia dinheiro (2160) caia de 4 a 9 moedas de (2160).Vlw ^^ Link para o comentário https://xtibia.com/forum/topic/179280-script-rain/ Compartilhar em outros sites More sharing options...
758594 3 Postado Fevereiro 6, 2012 Autor Share Postado Fevereiro 6, 2012 alguem? Link para o comentário https://xtibia.com/forum/topic/179280-script-rain/#findComment-1195930 Compartilhar em outros sites More sharing options...
leandroskt8 2 Postado Fevereiro 6, 2012 Share Postado Fevereiro 6, 2012 (editado) tenta assim. --// Requerimento para compatibilidade com as novas versões de OTServer \\ local mayNotMove = doCreatureSetNoMove function doPushCreature(pos, target) creature = getThingfromPos({x=target.x, y=target.y, z=target.z, stackpos=253}).uid if target.y < pos.y and target.x == pos.x then newpos = {x=target.x, y=target.y-1, z=target.z} elseif target.y > pos.y and target.x == pos.x then newpos = {x=target.x, y=target.y+1, z=target.z} elseif target.y == pos.y and target.x > pos.x then newpos = {x=target.x+1, y=target.y, z=target.z} elseif target.y == pos.y and target.x < pos.x then newpos = {x=target.x-1, y=target.y, z=target.z} elseif target.y < pos.y and target.x > pos.x then newpos = {x=target.x+1, y=target.y-1, z=target.z} elseif target.y > pos.y and target.x < pos.x then newpos = {x=target.x-1, y=target.y+1, z=target.z} elseif target.y > pos.y and target.x > pos.x then newpos = {x=target.x+1, y=target.y+1, z=target.z} elseif target.y < pos.y and target.x < pos.x then newpos = {x=target.x-1, y=target.y-1, z=target.z} end if creature > 0 then if queryTileAddThing(creature, newpos) == TRUE then doTeleportThing(creature, newpos, TRUE) end end end local arr = { [1] = { {1,1,1}, {1,2,1}, {1,1,1} }, [2] = { {0,1,1,1,0}, {1,0,0,0,1}, {1,0,2,0,1}, {1,0,0,0,1}, {0,1,1,1,0} }, [3] = { {0,0,1,1,1,0,0}, {0,1,0,0,0,1,0}, {1,0,0,0,0,0,1}, {1,0,0,2,0,0,1}, {1,0,0,0,0,0,1}, {0,1,0,0,0,1,0}, {0,0,1,1,1,0,0} }, [4] = { {0,0,0,1,1,1,0,0,0}, {0,0,1,0,0,0,1,0,0}, {0,1,0,0,0,0,0,1,0}, {1,0,0,0,0,0,0,0,1}, {1,0,0,0,2,0,0,0,1}, {1,0,0,0,0,0,0,0,1}, {0,1,0,0,0,0,0,1,0}, {0,0,1,0,0,0,1,0,0}, {0,0,0,1,1,1,0,0,0} } } function onTargetCreature(cid, target) doPushCreature(getCreaturePosition(cid), target) doPlayerAddItem(cid,2160,4,9) end combat = {} for n, v in pairs(arr) do combat[n] = createCombatObject() _G["callback"..n] = onTargetCreature setCombatCallback(combat[n], CALLBACK_PARAM_TARGETTILE, "callback"..n) setCombatParam(combat[n], COMBAT_PARAM_EFFECT, 2) setCombatArea(combat[n], createCombatArea(v)) end function onCastSpell(cid, var) mayNotMove(cid, TRUE) for i = 1, #combat do addEvent(doCombat, i*150-150, cid, combat[i], var) if i == #combat then addEvent(mayNotMove, i*150-150, cid, FALSE) end end return TRUE end Editado Fevereiro 6, 2012 por godleandro Link para o comentário https://xtibia.com/forum/topic/179280-script-rain/#findComment-1195954 Compartilhar em outros sites More sharing options...
758594 3 Postado Fevereiro 8, 2012 Autor Share Postado Fevereiro 8, 2012 tenta assim. --// Requerimento para compatibilidade com as novas versões de OTServer \\ local mayNotMove = doCreatureSetNoMove function doPushCreature(pos, target) creature = getThingfromPos({x=target.x, y=target.y, z=target.z, stackpos=253}).uid if target.y < pos.y and target.x == pos.x then newpos = {x=target.x, y=target.y-1, z=target.z} elseif target.y > pos.y and target.x == pos.x then newpos = {x=target.x, y=target.y+1, z=target.z} elseif target.y == pos.y and target.x > pos.x then newpos = {x=target.x+1, y=target.y, z=target.z} elseif target.y == pos.y and target.x < pos.x then newpos = {x=target.x-1, y=target.y, z=target.z} elseif target.y < pos.y and target.x > pos.x then newpos = {x=target.x+1, y=target.y-1, z=target.z} elseif target.y > pos.y and target.x < pos.x then newpos = {x=target.x-1, y=target.y+1, z=target.z} elseif target.y > pos.y and target.x > pos.x then newpos = {x=target.x+1, y=target.y+1, z=target.z} elseif target.y < pos.y and target.x < pos.x then newpos = {x=target.x-1, y=target.y-1, z=target.z} end if creature > 0 then if queryTileAddThing(creature, newpos) == TRUE then doTeleportThing(creature, newpos, TRUE) end end end local arr = { [1] = { {1,1,1}, {1,2,1}, {1,1,1} }, [2] = { {0,1,1,1,0}, {1,0,0,0,1}, {1,0,2,0,1}, {1,0,0,0,1}, {0,1,1,1,0} }, [3] = { {0,0,1,1,1,0,0}, {0,1,0,0,0,1,0}, {1,0,0,0,0,0,1}, {1,0,0,2,0,0,1}, {1,0,0,0,0,0,1}, {0,1,0,0,0,1,0}, {0,0,1,1,1,0,0} }, [4] = { {0,0,0,1,1,1,0,0,0}, {0,0,1,0,0,0,1,0,0}, {0,1,0,0,0,0,0,1,0}, {1,0,0,0,0,0,0,0,1}, {1,0,0,0,2,0,0,0,1}, {1,0,0,0,0,0,0,0,1}, {0,1,0,0,0,0,0,1,0}, {0,0,1,0,0,0,1,0,0}, {0,0,0,1,1,1,0,0,0} } } function onTargetCreature(cid, target) doPushCreature(getCreaturePosition(cid), target) doPlayerAddItem(cid,2160,4,9) end combat = {} for n, v in pairs(arr) do combat[n] = createCombatObject() _G["callback"..n] = onTargetCreature setCombatCallback(combat[n], CALLBACK_PARAM_TARGETTILE, "callback"..n) setCombatParam(combat[n], COMBAT_PARAM_EFFECT, 2) setCombatArea(combat[n], createCombatArea(v)) end function onCastSpell(cid, var) mayNotMove(cid, TRUE) for i = 1, #combat do addEvent(doCombat, i*150-150, cid, combat[i], var) if i == #combat then addEvent(mayNotMove, i*150-150, cid, FALSE) end end return TRUE end cara ate que ficou daora mais teria como deixa pra cair o dinheiro no final das nuvenzinha? Link para o comentário https://xtibia.com/forum/topic/179280-script-rain/#findComment-1197054 Compartilhar em outros sites More sharing options...
leandroskt8 2 Postado Fevereiro 8, 2012 Share Postado Fevereiro 8, 2012 sim tenta assim que não der fala ai que vou tentar arrumar. --// Requerimento para compatibilidade com as novas versões de OTServer \\ local mayNotMove = doCreatureSetNoMove function doPushCreature(pos, target) creature = getThingfromPos({x=target.x, y=target.y, z=target.z, stackpos=253}).uid if target.y < pos.y and target.x == pos.x then newpos = {x=target.x, y=target.y-1, z=target.z} elseif target.y > pos.y and target.x == pos.x then newpos = {x=target.x, y=target.y+1, z=target.z} elseif target.y == pos.y and target.x > pos.x then newpos = {x=target.x+1, y=target.y, z=target.z} elseif target.y == pos.y and target.x < pos.x then newpos = {x=target.x-1, y=target.y, z=target.z} elseif target.y < pos.y and target.x > pos.x then newpos = {x=target.x+1, y=target.y-1, z=target.z} elseif target.y > pos.y and target.x < pos.x then newpos = {x=target.x-1, y=target.y+1, z=target.z} elseif target.y > pos.y and target.x > pos.x then newpos = {x=target.x+1, y=target.y+1, z=target.z} elseif target.y < pos.y and target.x < pos.x then newpos = {x=target.x-1, y=target.y-1, z=target.z} end if creature > 0 then if queryTileAddThing(creature, newpos) == TRUE then doTeleportThing(creature, newpos, TRUE) end end end function onTargetCreature(cid, target) doPushCreature(getCreaturePosition(cid), target) doPlayerAddItem(cid,2160,4,9) end local arr = { [1] = { {1,1,1}, {1,2,1}, {1,1,1} }, [2] = { {0,1,1,1,0}, {1,0,0,0,1}, {1,0,2,0,1}, {1,0,0,0,1}, {0,1,1,1,0} }, [3] = { {0,0,1,1,1,0,0}, {0,1,0,0,0,1,0}, {1,0,0,0,0,0,1}, {1,0,0,2,0,0,1}, {1,0,0,0,0,0,1}, {0,1,0,0,0,1,0}, {0,0,1,1,1,0,0} }, [4] = { {0,0,0,1,1,1,0,0,0}, {0,0,1,0,0,0,1,0,0}, {0,1,0,0,0,0,0,1,0}, {1,0,0,0,0,0,0,0,1}, {1,0,0,0,2,0,0,0,1}, {1,0,0,0,0,0,0,0,1}, {0,1,0,0,0,0,0,1,0}, {0,0,1,0,0,0,1,0,0}, {0,0,0,1,1,1,0,0,0} } } function onTargetCreature(cid, target) doPushCreature(getCreaturePosition(cid), target) end combat = {} for n, v in pairs(arr) do combat[n] = createCombatObject() _G["callback"..n] = onTargetCreature setCombatCallback(combat[n], CALLBACK_PARAM_TARGETTILE, "callback"..n) setCombatParam(combat[n], COMBAT_PARAM_EFFECT, 2) setCombatArea(combat[n], createCombatArea(v)) end function onCastSpell(cid, var) mayNotMove(cid, TRUE) for i = 1, #combat do addEvent(doCombat, i*150-150, cid, combat[i], var) if i == #combat then addEvent(mayNotMove, i*150-150, cid, FALSE) end end return TRUE end Link para o comentário https://xtibia.com/forum/topic/179280-script-rain/#findComment-1197064 Compartilhar em outros sites More sharing options...
758594 3 Postado Fevereiro 8, 2012 Autor Share Postado Fevereiro 8, 2012 cara nao ta funcionando tenta arrumar ai pra mim? se possivel?obg vou ter dar o rep+ pelo seu esforço se vc me der o script te dou outro,vlw ^^ Link para o comentário https://xtibia.com/forum/topic/179280-script-rain/#findComment-1197682 Compartilhar em outros sites More sharing options...
bepokemon 101 Postado Fevereiro 8, 2012 Share Postado Fevereiro 8, 2012 --// Requerimento para compatibilidade com as novas versões de OTServer \\ local mayNotMove = doCreatureSetNoMove function doPushCreature(pos, target) creature = getThingfromPos({x=target.x, y=target.y, z=target.z, stackpos=253}).uid if target.y < pos.y and target.x == pos.x then newpos = {x=target.x, y=target.y-1, z=target.z} elseif target.y > pos.y and target.x == pos.x then newpos = {x=target.x, y=target.y+1, z=target.z} elseif target.y == pos.y and target.x > pos.x then newpos = {x=target.x+1, y=target.y, z=target.z} elseif target.y == pos.y and target.x < pos.x then newpos = {x=target.x-1, y=target.y, z=target.z} elseif target.y < pos.y and target.x > pos.x then newpos = {x=target.x+1, y=target.y-1, z=target.z} elseif target.y > pos.y and target.x < pos.x then newpos = {x=target.x-1, y=target.y+1, z=target.z} elseif target.y > pos.y and target.x > pos.x then newpos = {x=target.x+1, y=target.y+1, z=target.z} elseif target.y < pos.y and target.x < pos.x then newpos = {x=target.x-1, y=target.y-1, z=target.z} end if creature > 0 then if queryTileAddThing(creature, newpos) == TRUE then doTeleportThing(creature, newpos, TRUE) end end end local arr = { [1] = { {1,1,1}, {1,2,1}, {1,1,1} }, [2] = { {0,1,1,1,0}, {1,0,0,0,1}, {1,0,2,0,1}, {1,0,0,0,1}, {0,1,1,1,0} }, [3] = { {0,0,1,1,1,0,0}, {0,1,0,0,0,1,0}, {1,0,0,0,0,0,1}, {1,0,0,2,0,0,1}, {1,0,0,0,0,0,1}, {0,1,0,0,0,1,0}, {0,0,1,1,1,0,0} }, [4] = { {0,0,0,1,1,1,0,0,0}, {0,0,1,0,0,0,1,0,0}, {0,1,0,0,0,0,0,1,0}, {1,0,0,0,0,0,0,0,1}, {1,0,0,0,2,0,0,0,1}, {1,0,0,0,0,0,0,0,1}, {0,1,0,0,0,0,0,1,0}, {0,0,1,0,0,0,1,0,0}, {0,0,0,1,1,1,0,0,0} } } function onTargetCreature(cid, target) doPushCreature(getCreaturePosition(cid), target) doCreateItem(2160, math.random(4,9), getThingPos(cid)) end combat = {} for n, v in pairs(arr) do combat[n] = createCombatObject() _G["callback"..n] = onTargetCreature setCombatCallback(combat[n], CALLBACK_PARAM_TARGETTILE, "callback"..n) setCombatParam(combat[n], COMBAT_PARAM_EFFECT, 2) setCombatArea(combat[n], createCombatArea(v)) end function onCastSpell(cid, var) mayNotMove(cid, TRUE) for i = 1, #combat do addEvent(doCombat, i*150-150, cid, combat[i], var) if i == #combat then addEvent(mayNotMove, i*150-150, cid, FALSE) end end return TRUE end Link para o comentário https://xtibia.com/forum/topic/179280-script-rain/#findComment-1197766 Compartilhar em outros sites More sharing options...
Posts Recomendados