TR
pedido

Problema Arena

Por Tripexilina, 25 de out. de 2012 em Scripts

script
22
3.2k
TripexilinaT
27 de outubro de 2012 às 00:58

Ele só tá tentando ajuda @Flaah...

Yan OliveiraY
27 de outubro de 2012 às 01:08

@Tripexilina

 

Liga não os cara so q ter post, apague tudo q tive no seu npc e poe isso dentro:

 

 

local keywordHandler = KeywordHandler:new()

 

local npcHandler = NpcHandler:new(keywordHandler)

NpcSystem.parseParameters(npcHandler)

function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end

function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end

function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end

function onThink() npcHandler:onThink() end

function enterArena(cid, message, keywords, parameters, node)

if(not npcHandler:isFocused(cid)) then

return false

end

local cost = 0

local levelname = ''

if getPlayerStorageValue(cid, 42355) < 1 then

cost = 1000

levelname = 'greenshore'

levelneeded = 30

elseif getPlayerStorageValue(cid, 42355) == 1 then

cost = 5000

levelname = 'scrapper'

levelneeded = 50

elseif getPlayerStorageValue(cid, 42355) == 2 then

cost = 10000

levelname = 'warlord'

levelneeded = 80

end

if string.lower(keywords[1]) == 'yes' and parameters.prepare ~= 1 then

if(getPlayerLevel(cid) >= levelneeded) then

if(getPlayerMoney(cid) >= cost) then

doPlayerRemoveMoney(cid, cost)

npcHandler:say('Now you can go to test.', cid)

setPlayerStorageValue(cid, 42351, 1)

else

npcHandler:say('You don\'t have ' .. cost .. ' gp! Come back when you will be ready!', cid)

end

else

npcHandler:say('You don\'t have ' .. levelneeded .. ' level! Come back when you will be ready!', cid)

end

npcHandler:resetNpc()

elseif string.lower(keywords[1]) == 'no' then

npcHandler:say('Come back later then!', cid)

npcHandler:resetNpc()

else

if getPlayerStorageValue(cid, 42355) < 3 then

npcHandler:say('You test will be ' .. levelname .. ' level. If you want enter you must pay ' .. cost .. ' gp and have ' .. levelneeded .. ' level. Wanna try?', cid)

else

npcHandler:say('You did all arena levels.',cid)

end

end

return true

end

npcHandler:setMessage(MESSAGE_GREET, 'Hello |PLAYERNAME|! Do you want to make arena?')

local yesNode = KeywordNode:new({'yes'}, enterArena, {})

local noNode = KeywordNode:new({'no'}, enterArena, {})

local node1 = keywordHandler:addKeyword({'arena'}, enterArena, {prepare=1})

node1:addChildKeywordNode(yesNode)

node1:addChildKeywordNode(noNode)

 

local node1 = keywordHandler:addKeyword({'fight'}, enterArena, {prepare=1})

node1:addChildKeywordNode(yesNode)

node1:addChildKeywordNode(noNode)

local node1 = keywordHandler:addKeyword({'yes'}, enterArena, {prepare=1})

node1:addChildKeywordNode(yesNode)

node1:addChildKeywordNode(noNode)

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)

npcHandler:addModule(FocusModule:new())

 

 

 

se der erro ainda me avise.

TripexilinaT
27 de outubro de 2012 às 01:49

Continua o mesmo problema man, será que o erro nao esta em outra pasta? No actions? Ou sei eu aonde mais...

Yan OliveiraY
27 de outubro de 2012 às 11:25

Não cara, pq é o npc da quest q ta dano erro, eu testei aki, poste o npc.xml pra mim ver se é ele mesmo o problema.

TripexilinaT
27 de outubro de 2012 às 15:47

É o mesmo que postei la em cima, o outro é o que vc me passou...

FlaahF
27 de outubro de 2012 às 16:08

Ve se funciona :

 

 

function onStepIn(cid, item, position, fromPosition)

local leave = {x=1171, y=90, z=7}

if InitArenaScript == 0 then

InitArenaScript = 1

for i = 0,9 do

setGlobalStorageValue(42300+i, 0)

setGlobalStorageValue(42400+i, 0)

end

checkArenaRooms({})

end

local arena_room = item.actionid

local player_arena = getPlayerStorageValue(cid, 42355)

if getPlayerStorageValue(cid, arena_room+getPlayerStorageValue(cid, 42355)*10-1) == 1 or arena_room+getPlayerStorageValue(cid, 42355)*10-1 == 42299 then

if getGlobalStorageValue(cid, arena_room) == 0 then

local monster_uid = getGlobalStorageValue(arena_room+100)

if monster_uid > 0 then

if isCreature(monster_uid) == true then

doRemoveCreature(monster_uid)

end

end

local spawn_pos = getThingPos(arena_room)

local monster = doCreateMonster(arena_monsters[arena_room]+getPlayerStorageValue(cid, 42355)*10], {x=spawn_pos.x-1,y=spawn_pos.y-1,z=spawn_pos.z})

setGlobalStorageValue(arena_room+100, monster)

doTeleportThing(cid, spawn_pos, true)

setGlobalStorageValue(arena_room, cid)

setGlobalStorageValue(arena_room-1, 0)

setPlayerStorageValue(cid, 42350, os.time()+arena_room_max_time)

else

doTeleportThing(cid, fromPosition, true)

doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE,getCreatureName(getGlobalStorageValue(cid, arena_room))..' is now in next room. Wait a moment and try again.')

end

else

doTeleportThing(cid, fromPosition, true)

doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE,'First kill monster!')

end

if arena_room == 42300 then

setPlayerStorageValue(cid, 42351, 0)

setPlayerStorageValue(cid, 42352, 1)

end

return true

end

function checkArenaRooms(param)

addEvent(checkArenaRooms, 1000, {})

for i = 42300, 42309 do

local player = getGlobalStorageValue(i)

if isPlayer(player) == true then

local player_storage = getPlayerStorageValue(player, 42350)

if player_storage <= os.time() then

doTeleportThing(player, leave, true)

setPlayerStorageValue(player, 42350, 0)

setGlobalStorageValue(i, 0)

doPlayerSendTextMessage(player,MESSAGE_STATUS_CONSOLE_ORANGE,'You have been kicked from arena! You have only ' .. arena_room_max_time .. ' seconds for one room.')

elseif player_storage - 10 <= os.time() then

doPlayerSendTextMessage(player,MESSAGE_EVENT_DEFAULT,'Masz ' .. player_storage - os.time() .. ' sekund, zeby przejsc do kolejnego pokoju!')

end

else

setGlobalStorageValue(i, 0)

end

end

end

 

 

 

Se não de certo me avise.

Tenta agr:

 

 

function onStepIn(cid, item, position, fromPosition)

local leave = {x=1171, y=90, z=7}

if InitArenaScript == 0 then

InitArenaScript = 1

for i = 0,9 do

setGlobalStorageValue(42300+i, 0)

setGlobalStorageValue(42400+i, 0)

end

checkArenaRooms({})

end

local arena_room = item.actionid

local player_arena = getPlayerStorageValue(cid, 42355)

if getPlayerStorageValue(cid, arena_room+getPlayerStorageValue(cid, 42355)*10-1) == 1 or arena_room+getPlayerStorageValue(cid, 42355)*10-1 == 42299 then

if getGlobalStorageValue(cid, arena_room) == 0 then

local monster_uid = getGlobalStorageValue(arena_room+100)

if monster_uid > 0 then

if isCreature(monster_uid) == true then

doRemoveCreature(monster_uid)

end

end

local spawn_pos = getThingPos(arena_room)

local monster = doCreateMonster(arena_monsters[arena_room+getPlayerStorageValue(cid, 42355)*10], {x=spawn_pos.x-1,y=spawn_pos.y-1,z=spawn_pos.z})

setGlobalStorageValue(arena_room+100, monster)

doTeleportThing(cid, spawn_pos, true)

setGlobalStorageValue(arena_room, cid)

setGlobalStorageValue(arena_room-1, 0)

setPlayerStorageValue(cid, 42350, os.time()+arena_room_max_time)

else

doTeleportThing(cid, fromPosition, true)

doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE,getCreatureName(getGlobalStorageValue(cid, arena_room))..' is now in next room. Wait a moment and try again.')

end

else

doTeleportThing(cid, fromPosition, true)

doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE,'First kill monster!')

end

if arena_room == 42300 then

setPlayerStorageValue(cid, 42351, 0)

setPlayerStorageValue(cid, 42352, 1)

end

return true

end

function checkArenaRooms(param)

addEvent(checkArenaRooms, 1000, {})

for i = 42300, 42309 do

local player = getGlobalStorageValue(i)

if isPlayer(player) == true then

local player_storage = getPlayerStorageValue(player, 42350)

if player_storage <= os.time() then

doTeleportThing(player, leave, true)

setPlayerStorageValue(player, 42350, 0)

setGlobalStorageValue(i, 0)

doPlayerSendTextMessage(player,MESSAGE_STATUS_CONSOLE_ORANGE,'You have been kicked from arena! You have only ' .. arena_room_max_time .. ' seconds for one room.')

elseif player_storage - 10 <= os.time() then

doPlayerSendTextMessage(player,MESSAGE_EVENT_DEFAULT,'Masz ' .. player_storage - os.time() .. ' sekund, zeby przejsc do kolejnego pokoju!')

end

else

setGlobalStorageValue(i, 0)

end

end

end

 

 

 

Se não der me avise.

Tenta agr:

 

 

function onStepIn(cid, item, position, fromPosition)

local leave = {x=1171, y=90, z=7}

if InitArenaScript == 0 then

InitArenaScript = 1

for i = 0,9 do

setGlobalStorageValue(42300+i, 0)

setGlobalStorageValue(42400+i, 0)

end

checkArenaRooms({})

end

local arena_room = item.actionid

local player_arena = getPlayerStorageValue(cid, 42355)

if getPlayerStorageValue(cid, arena_room+getPlayerStorageValue(cid, 42355)*10-1) == 1 or arena_room+getPlayerStorageValue(cid, 42355)*10-1 == 42299 then

if getGlobalStorageValue(cid, arena_room) == 0 then

local monster_uid = getGlobalStorageValue(arena_room+100)

if monster_uid > 0 then

if isCreature(monster_uid) == true then

doRemoveCreature(monster_uid)

end

end

local spawn_pos = getThingPos(arena_room)

local monster = doCreateMonster(arena_monsters[arena_room+getPlayerStorageValue(cid, 42355)*10], {x=spawn_pos.x-1,y=spawn_pos.y-1,z=spawn_pos.z})

setGlobalStorageValue(arena_room+100, monster)

doTeleportThing(cid, spawn_pos, true)

setGlobalStorageValue(arena_room, cid)

setGlobalStorageValue(arena_room-1, 0)

setPlayerStorageValue(cid, 42350, os.time()+arena_room_max_time)

else

doTeleportThing(cid, fromPosition, true)

doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE,getCreatureName(getGlobalStorageValue(cid, arena_room))..' is now in next room. Wait a moment and try again.')

end

else

doTeleportThing(cid, fromPosition, true)

doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE,'First kill monster!')

end

if arena_room == 42300 then

setPlayerStorageValue(cid, 42351, 0)

setPlayerStorageValue(cid, 42352, 1)

end

return true

end

function checkArenaRooms(param)

addEvent(checkArenaRooms, 1000, {})

for i = 42300, 42309 do

local player = getGlobalStorageValue(i)

if isPlayer(player) == true then

local player_storage = getPlayerStorageValue(player, 42350)

if player_storage <= os.time() then

doTeleportThing(player, leave, true)

setPlayerStorageValue(player, 42350, 0)

setGlobalStorageValue(i, 0)

doPlayerSendTextMessage(player,MESSAGE_STATUS_CONSOLE_ORANGE,'You have been kicked from arena! You have only ' .. arena_room_max_time .. ' seconds for one room.')

elseif player_storage - 10 <= os.time() then

doPlayerSendTextMessage(player,MESSAGE_EVENT_DEFAULT,'Masz ' .. player_storage - os.time() .. ' sekund, zeby przejsc do kolejnego pokoju!')

end

else

setGlobalStorageValue(cid, 0)

end

end

 

 

Tente agr:

 

 

function onStepIn(cid, item, position, fromPosition)

local leave = {x=1171, y=90, z=7}

if InitArenaScript == 0 then

InitArenaScript = 1

for i = 0,9 do

setGlobalStorageValue(42300+i, 0)

setGlobalStorageValue(42400+i, 0)

end

checkArenaRooms({})

end

local arena_room = item.actionid

local player_arena = getPlayerStorageValue(cid, 42355)

if getPlayerStorageValue(cid, arena_room+getPlayerStorageValue(cid, 42355)*10-1) == 1 or arena_room+getPlayerStorageValue(cid, 42355)*10-1 == 42299 then

if getGlobalStorageValue(cid, arena_room) == 0 then

local monster_uid = getGlobalStorageValue(arena_room+100)

if monster_uid > 0 then

if isCreature(monster_uid) == true then

doRemoveCreature(monster_uid)

end

end

local spawn_pos = getThingPos(arena_room)

local monster = doCreateMonster(arena_monsters[arena_room+getPlayerStorageValue(cid, 42355)*10], {x=spawn_pos.x-1,y=spawn_pos.y-1,z=spawn_pos.z})

setGlobalStorageValue(arena_room+100, monster)

doTeleportThing(cid, spawn_pos, true)

setGlobalStorageValue(arena_room, cid)

setGlobalStorageValue(arena_room-1, 0)

setPlayerStorageValue(cid, 42350, os.time()+arena_room_max_time)

else

doTeleportThing(cid, fromPosition, true)

doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE,getCreatureName(getGlobalStorageValue(cid, arena_room))..' is now in next room. Wait a moment and try again.')

end

else

doTeleportThing(cid, fromPosition, true)

doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE,'First kill monster!')

end

if arena_room == 42300 then

setPlayerStorageValue(cid, 42351, 0)

setPlayerStorageValue(cid, 42352, 1)

end

return true

end

function checkArenaRooms(param)

addEvent(checkArenaRooms, 1000, {})

for i = 42300, 42309 do

local player = getGlobalStorageValue(i)

if isPlayer(player) == true then

local player_storage = getPlayerStorageValue(player, 42350)

if player_storage <= os.time() then

doTeleportThing(player, leave, true)

setPlayerStorageValue(player, 42350, 0)

setGlobalStorageValue(i, 0)

doPlayerSendTextMessage(player,MESSAGE_STATUS_CONSOLE_ORANGE,'You have been kicked from arena! You have only ' .. arena_room_max_time .. ' seconds for one room.')

elseif player_storage - 10 <= os.time() then

doPlayerSendTextMessage(player,MESSAGE_EVENT_DEFAULT,'Masz ' .. player_storage - os.time() .. ' sekund, zeby przejsc do kolejnego pokoju!')

end

else

setGlobalStorageValue(i, 0)

end

end

Tente agr:

 

 

function onStepIn(cid, item, position, fromPosition)

local leave = {x=1171, y=90, z=7}

if InitArenaScript == 0 then

InitArenaScript = 1

for i = 0,9 do

setGlobalStorageValue(42300+i, 0)

setGlobalStorageValue(42400+i, 0)

end

checkArenaRooms({})

end

local arena_room = item.actionid

local player_arena = getPlayerStorageValue(cid, 42355)

if getPlayerStorageValue(cid, arena_room+getPlayerStorageValue(cid, 42355)*10-1) == 1 or arena_room+getPlayerStorageValue(cid, 42355)*10-1 == 42299 then

if getGlobalStorageValue(cid, arena_room) == 0 then

local monster_uid = getGlobalStorageValue(arena_room+100)

if monster_uid > 0 then

if isCreature(monster_uid) == true then

doRemoveCreature(monster_uid)

end

end

local spawn_pos = getThingPos(arena_room)

local monster = doCreateMonster(arena_monsters[arena_room+getPlayerStorageValue(cid, 42355)*10], {x=spawn_pos.x-1,y=spawn_pos.y-1,z=spawn_pos.z})

setGlobalStorageValue(arena_room+100, monster)

doTeleportThing(cid, spawn_pos, true)

setGlobalStorageValue(arena_room, cid)

setGlobalStorageValue(arena_room-1, 0)

setPlayerStorageValue(cid, 42350, os.time()+arena_room_max_time)

else

doTeleportThing(cid, fromPosition, true)

doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE,getCreatureName(getGlobalStorageValue(cid, arena_room))..' is now in next room. Wait a moment and try again.')

end

else

doTeleportThing(cid, fromPosition, true)

doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE,'First kill monster!')

end

if arena_room == 42300 then

setPlayerStorageValue(cid, 42351, 0)

setPlayerStorageValue(cid, 42352, 1)

end

return true

end

function checkArenaRooms(param)

addEvent(checkArenaRooms, 1000, {})

for i = 42300, 42309 do

local player = getGlobalStorageValue(i)

if isPlayer(player) == true then

local player_storage = getPlayerStorageValue(player, 42350)

if player_storage <= os.time() then

doTeleportThing(player, leave, true)

setPlayerStorageValue(player, 42350, 0)

setGlobalStorageValue(i, 0)

doPlayerSendTextMessage(player,MESSAGE_STATUS_CONSOLE_ORANGE,'You have been kicked from arena! You have only ' .. arena_room_max_time .. ' seconds for one room.')

elseif player_storage - 10 <= os.time() then

doPlayerSendTextMessage(player,MESSAGE_EVENT_DEFAULT,'Masz ' .. player_storage - os.time() .. ' sekund, zeby przejsc do kolejnego pokoju!')

end

else

setGlobalStorageValue(i, 0)

end

end

end

 

 

@Tripexilina

 

Liga não os cara so q ter post, apague tudo q tive no seu npc e poe isso dentro:

 

 

local keywordHandler = KeywordHandler:new()

 

local npcHandler = NpcHandler:new(keywordHandler)

NpcSystem.parseParameters(npcHandler)

function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end

function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end

function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end

function onThink() npcHandler:onThink() end

function enterArena(cid, message, keywords, parameters, node)

if(not npcHandler:isFocused(cid)) then

return false

end

local cost = 0

local levelname = ''

if getPlayerStorageValue(cid, 42355) < 1 then

cost = 1000

levelname = 'greenshore'

levelneeded = 30

elseif getPlayerStorageValue(cid, 42355) == 1 then

cost = 5000

levelname = 'scrapper'

levelneeded = 50

elseif getPlayerStorageValue(cid, 42355) == 2 then

cost = 10000

levelname = 'warlord'

levelneeded = 80

end

if string.lower(keywords[1]) == 'yes' and parameters.prepare ~= 1 then

if(getPlayerLevel(cid) >= levelneeded) then

if(getPlayerMoney(cid) >= cost) then

doPlayerRemoveMoney(cid, cost)

npcHandler:say('Now you can go to test.', cid)

setPlayerStorageValue(cid, 42351, 1)

else

npcHandler:say('You don\'t have ' .. cost .. ' gp! Come back when you will be ready!', cid)

end

else

npcHandler:say('You don\'t have ' .. levelneeded .. ' level! Come back when you will be ready!', cid)

end

npcHandler:resetNpc()

elseif string.lower(keywords[1]) == 'no' then

npcHandler:say('Come back later then!', cid)

npcHandler:resetNpc()

else

if getPlayerStorageValue(cid, 42355) < 3 then

npcHandler:say('You test will be ' .. levelname .. ' level. If you want enter you must pay ' .. cost .. ' gp and have ' .. levelneeded .. ' level. Wanna try?', cid)

else

npcHandler:say('You did all arena levels.',cid)

end

end

return true

end

npcHandler:setMessage(MESSAGE_GREET, 'Hello |PLAYERNAME|! Do you want to make arena?')

local yesNode = KeywordNode:new({'yes'}, enterArena, {})

local noNode = KeywordNode:new({'no'}, enterArena, {})

local node1 = keywordHandler:addKeyword({'arena'}, enterArena, {prepare=1})

node1:addChildKeywordNode(yesNode)

node1:addChildKeywordNode(noNode)

 

local node1 = keywordHandler:addKeyword({'fight'}, enterArena, {prepare=1})

node1:addChildKeywordNode(yesNode)

node1:addChildKeywordNode(noNode)

local node1 = keywordHandler:addKeyword({'yes'}, enterArena, {prepare=1})

node1:addChildKeywordNode(yesNode)

node1:addChildKeywordNode(noNode)

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)

npcHandler:addModule(FocusModule:new())

 

 

 

se der erro ainda me avise.

 

E isso não é douple post?

 

E não acuse alguem sem saber, porq estou nesse forum pra ajuda as pessoas e tira minhas duvidas e não pra ganha posts, blz?!

 

Porq sera mil veses melhor pro postador que é vc e pro cara que esta pedindo a ajuda, que vc postasse em um post só, e so ficasse editando, isso é só uma critica construtiva, não destruitva KKK' happy.png , mais ta blz, continua ajudando ele ai. happy.png

 

@EDIT

 

@LuckOake

 

OPS, Desculpa, mais só achei que era muito post seguido, eu pensei que era melhor te usado o mesmo post, pra ajuda, mais ta blz KKK', desculpe. he.gif

 

E deu a impreção que o @Yan18 , esta postando o mesmo script mais só com alguns erros, só pra ele ganha mais posts... ATENÇÃO MODERADORES happy.png

Editado Outubro 27 por Flaah

LuckOakeL
27 de outubro de 2012 às 16:15

@Flaah

 

Double post é quando o cara posta duas vezes seguidas, sem esperar que outro responda. Isso ai que ele fez não é double post e nem flood, ele estava tentando ajudar.