RO
dúvida

erro script

Por rohfagundes, 12 de abr. de 2013 em Scripts

resolvido
otserv
script
8
1.2k
rohfagundesR
12 de abril de 2013 às 08:18

bom ja q quem posto no topico de outro cara ignoro minha duvida eu resolvi criar um topico pra isso

 

 

adiciona isso em data/spells/lib

Data provided by Pastebin.com - Download Raw - See Original


  • hasWaterCombat = createCombatObject()

  • arrzor = {{1,1,1,1,1,1,1},{1,1,1,1,1,1,1},{1,1,0,0,0,1,1},{1,1,0,2,0,1,1},{1,1,0,0,0,1,1},{1,1,1,1,1,1,1},{1,1,1,1,1,1,1}}

  • setCombatArea(hasWaterCombat, createCombatArea(arrzor))

  • function onTile90(cid, pos)

  • local needcheck = getPlayerStorageValue(cid, 7177)

  • if needcheck == 1 then

  • return 1 end

  • pos.stackpos = 0

  • local mitem = getTileThingByPos(pos)

  • if isPisoAgua(mitem.itemid) == 1 then

  • setPlayerStorageValue(cid, 7177, 1)

  • return 1

  • end

  • end

  • setCombatCallback(hasWaterCombat, CALLBACK_PARAM_TARGETTILE, "onTile90")

  • function hasWater(cid, porcento)

  • doCombat(cid, hasWaterCombat, positionToVariant(getThingPos(cid)))

  • local nearwater = getPlayerStorageValue(cid, 7177)

  • if nearwater == 1 then

  • setPlayerStorageValue(cid, 7177, 0)

  • doPlayerSendTextMessage(cid, 25, "Using ambient water.")

  • return true

  • end

  • if porcento > 100 then return false end

  • local pouch = getPlayerSlotItem(cid, 10)

  • if pouch.itemid == 4864 and (pouch.actionid == 0 and 100 or pouch.actionid-100) >= porcento then

  • local newtype = (pouch.actionid == 0 and 200 or pouch.actionid) - porcento

  • if newtype == 100 then doTransformItem(pouch.uid, 4863) end

  • doSetItemActionId(pouch.uid, newtype)

  • doPlayerSendTextMessage(cid, 25, (newtype-100).. "% Rest")

  • return true

  • end

  • doPlayerSendTextMessage(cid, 25, "There is not enough water to perform this bending.")

  • return false

  • end

 

 

depois vai em action/script

cria um arquivo lua: waterpouch.lua e adc isso

Data provided by Pastebin.com - Download Raw - See Original


  • idff = 4863

  • idon = 4864

  • effect = 25

  • effectfail = 2

  • function onUse(cid,item,item2,frompos,topos,pos)

  • if getPlayerItemCount(cid,idff) >= 1 then

  • doPlayerRemoveItem(cid,idff,1)

  • doPlayerAddItem(cid,idon,1)

  • doSendMagicEffect(getCreaturePosition(cid),effect)

  • doPlayerSendTextMessage(cid,27,"Sua Water Pouch foi recarregada.") -- << não se a expressao correta

  • elseif getPlayerItemCount(cid,idon) >= 1 then

  • doPlayerSendTextMessage(cid,27,"Voce já está com o sua Water Pouch cheia.")

  • doSendMagicEffect(getCreaturePosition(cid),effectfail)

  • elseif getPlayerItemCount(cid,idon) <= 0 or getPlayerItemCount(cid,idoff) <= 0 then

  • doPlayerSendTextMessage(cid,27,"Voce nao tem nenhuma WP.")

  • doSendMagicEffect(getCreaturePosition(cid),effectfail)

  • end

  • end

 

 

depois em action.xml adicione essa tag

<action itemid="4632-4663;4828-4831;494-505;6627-6674;6687-6694" event="script" value="waterpouch.lua"/>

esses numeros, são as borda

 

 

bom esse script comigo ta dando erro na hora q vou soltar a spell

é esse erro \/

 

 

[11/04/2013 19:38:21] [Error - Spell Interface]

[11/04/2013 19:38:21] In a callback: data/spells/lib/spells.lua:onTile90

[11/04/2013 19:38:21] (Unknown script file)

[11/04/2013 19:38:21] Description:

[11/04/2013 19:38:21] data/spells/lib/spells.lua:182: attempt to call global 'isPisoAgua' (a nil value)

[11/04/2013 19:38:21] stack traceback:

[11/04/2013 19:38:21] data/spells/lib/spells.lua:182: in function <data/spells/lib/spells.lua:176>

[11/04/2013 19:38:21] [C]: in function 'doCombat'

[11/04/2013 19:38:21] data/spells/lib/spells.lua:192: in function 'hasWater'

[11/04/2013 19:38:21] data/spells/scripts/mage/water.lua:17: in function <data/spells/scripts/mage/water.lua:16>

 

[11/04/2013 19:38:21] [Error - Spell Interface]

[11/04/2013 19:38:21] data/spells/scripts/mage/waterl.lua:onCastSpell

[11/04/2013 19:38:21] Description:

[11/04/2013 19:38:21] data/spells/lib/spells.lua:204: attempt to call global 'doSetItemActionId' (a nil value)

[11/04/2013 19:38:21] stack traceback:

[11/04/2013 19:38:21] data/spells/lib/spells.lua:204: in function 'hasWater'

 

[11/04/2013 19:38:21] data/spells/scripts/mage/water.lua:17: in function <data/spells/scripts/mage/water.lua:16>

 

 

 

alguem pode me ajudar?

dalvorsnD
12 de abril de 2013 às 08:33

Qual versão do distro?

 

Quanto a função de actionid, ela está aparentemente correta, pelo menos em distros 0.4 ela está presente

Já em a outra, ela é customizada, mas provavelmente ela apenas checa se o itemid do parametro está dentro de um array(sendo esse uma tabela onde voce coloca todos os ids de agua)

rohfagundesR
12 de abril de 2013 às 08:40

eu testei nesse 0.3.6pl1

onde eu consigo esse 0.4?

dalvorsnD
12 de abril de 2013 às 08:54

eu testei nesse 0.3.6pl1

onde eu consigo esse 0.4?

 

Na vapus tem com sources e tudo mais.

rohfagundesR
12 de abril de 2013 às 09:00

entao esse problema é só por causa disso mesmo?

dalvorsnD
12 de abril de 2013 às 09:02

entao esse problema é só por causa disso mesmo?

 

Você com certeza tem funções correspondentes no tfs 0.3.6pl1, da uma olhada na pasta doc dele que tu acha

rohfagundesR
12 de abril de 2013 às 09:15

vlw eu peguei esse 0.4

e funcionou

mto obg +rep

RoksasR
12 de abril de 2013 às 13:08

Tópico movido para a seção de dúvidas e pedidos resolvidos.