Postado Julho 2, 2015 9 anos então gente eu tenho um server de naruto onde as spell gastam " chakra, stamina", e la tem uma spell q eu quero q ela pare de funcionar quando a stamina acabar. se puderem me ajudar vou fica muito grato!! aqui esta a script da spell.. local first_gate = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(first_gate, CONDITION_PARAM_TICKS, 99999999) setConditionParam(first_gate, CONDITION_PARAM_SKILL_FIST, 15) setConditionParam(first_gate, CONDITION_PARAM_SKILL_FISHING, 30) local gate_time = {11, 9, 8, 7, 6} local gate_cost = {50, 45, 40, 35, 30} local function finishJutsu(cid, psID) if not isCreature(cid) then return false end if getStorage(cid, 15054, 1) then if(getStorage(cid, 10258) == psID) then changeLookType(cid, 623, 0.3) addEvent(changeLookType, 300, cid, 624, 0.3) if(canDoJutsu(cid)) then setStorage(cid, 15048, 0) setStorage(cid, 15054, 0) setStorage(cid, 9000, 0) end if(canMove(cid)) then mayNotMove(cid, false) end setPlayerStorageValue(cid, 10257, 0) setPlayerStorageValue(cid, 10258, 0) doRemoveCondition(cid, CONDITION_ATTRIBUTES) addEvent(setWalkStyle, 600, cid, 'walk') end end end local function checkGate(cid, stamina) if getPlayerStamina(cid) <= 0 then return finishJutsu(cid) end if(getStorage(cid, 10257) == 6) then changeStamina(cid, stamina) if isCreature(cid) then addEvent(checkGate, 3000, cid, stamina) end end end local function preFlow(cid) if isCreature(cid) then if getPlayerStorageValue(cid, 10257) == 65 then local ppos = getCreaturePosition(cid) doSendMagicEffect(ppos, 94) return addEvent(preFlow, 250, cid) end end end local function stopGate(cid) setPlayerStorageValue(cid, 9000, 'doing jutsu') local psID = math.random(1, 99999) setStorage(cid, 15054, 0) setPlayerStorageValue(cid, 10258,psID) changeLookType(cid, 630, 0.3) addEvent(changeLookType, 300, cid, 631, 0.3) addEvent(changeLookType, 600, cid, 623, 0.3) addEvent(finishJutsu, 900, cid, psID) return true end local function chakraFlow(cid) if isCreature(cid) then if getStorage(cid, 10257) == 6 then -- doSendMagicEffect(getCreaturePosition(cid), 94) if(getStorage(cid, 9000) ~= "doing jutsu") then changeLookType(cid, 632, 0.25) if not getCreatureCondition(cid, CONDITION_ATTRIBUTES) then doAddCondition(cid, first_gate) end end return addEvent(chakraFlow, 250, cid) end end end local function third(cid, pos, level, psID) local level = getJutsuLevel(cid, "sixth") changeLookType(cid, 618, 0.1) addEvent(changeLookType, 100, cid, 619, 0.1) addEvent(changeLookType, 200, cid, 620, 0.1) addEvent(changeLookType, 300, cid, 630, 0.1) addEvent(changeLookType, 400, cid, 631, 0.1) addEvent(doSendMagicEffect, 300, pos, 94) addEvent(doCreatureSay, 300, cid, "KAI!!", TALKTYPE_YELL) setPlayerStorageValue(cid, 10257, 6) checkGate(cid, gate_cost[level]) chakraFlow(cid) doAddCondition(cid, first_gate) setWalkStyle(cid, 'run') sendNinjaInfo(cid) doPlayerSetNoMove(cid, false) setPlayerStorageValue(cid, 9000, 0) --addEvent(finishJutsu, 30000, cid, psID) end local function second(cid, pos, level, psID) local tai = getPlayerSkillLevel(cid, TAIJUTSU) local openTime = gate_time[level] * 1000 changeLookType(cid, 616, openTime/2000) addEvent(changeLookType, openTime/2, cid, 617, openTime/2000) --addEvent(preFlow, openTime/2,cid) addEvent(doSendAnimatedText, openTime/2, pos, "KEIMON!", COLOR_ORANGE) addEvent(valid(third), openTime, cid, pos, level, psID) end local function startGate(cid, psID) local pos = getCreaturePosition(cid) local level = getJutsuLevel(cid, "sixth") if (checkGenjutsu(cid, 'kanashibari')) then return true end setStorage(cid, 15048, 1) setStorage(cid, 15054, 1) changeLookType(cid, 614, 0.1) addEvent(changeLookType, 200, cid, 615, 0.8) doCreatureSay(cid, "HACHIMON", TALKTYPE_ORANGE_1) doCreatureSay(cid, "TONKOU...", TALKTYPE_ORANGE_1) addEvent(valid(second), 1000, cid, pos, level, psID) end local function returnGate(cid, gates) setWalkStyle(cid, 'run') doPlayerSetNoMove(cid, true) setPlayerStorageValue(cid, 9000, 'doing jutsu') changeLookType(cid, 630, 0.3) addEvent(changeLookType, 300, cid, 631, 0.3) addEvent(changeLookType, 600, cid, 623, 0.3) local psID = math.random(1, 99999) setPlayerStorageValue(cid, 10258,psID) addEvent(second, 900, cid, getCreaturePosition(cid), psID) end function onUse(cid, item, fromPosition, itemEx, toPosition) if getPlayerStorageValue(cid, 9000) == 'doing jutsu' then return doPlayerSendCancel(cid, 'You are already doing a jutsu!') end local gates = getStorage(cid, 10257) if gates == 6 then return stopGate(cid) else setPlayerStorageValue(cid, 10257, 65) local psID = math.random(1, 99999) setPlayerStorageValue(cid, 10258,psID) doPlayerSetNoMove(cid, true) setPlayerStorageValue(cid, 9000, 'doing jutsu') startGate(cid, psID) end return TRUE end Editado Julho 2, 2015 9 anos por gade (veja o histórico de edições)
Postado Julho 9, 2015 9 anos Ser está falando de Stamina msm ou soul. Tipo ser quer que a stamina cheguei a zero (00:00). Se ti ajudei. Marque como Melhor Resposta e agradeça com um Rep+, clicando em Gostei!. Obrigado!
Postado Agosto 8, 2015 9 anos O tópico foi movido para a área correta, preste mais atenção da próxima vez!Leia as regras do fórum: http://tibiaking.com/forum/topic/1281-regras-gerais/?p=7680 Este tópico foi movido:De: "OTServ → Scripting → Geral"Para: "OTServ → Suporte OTServ → Suporte de Scripts" _ .-'` `} _./) / } .'o \ | } '.___.'`.\ {` /`\_/ , `. } ME DA UMA NOZ! \=' .-' _`\ { `'`;/ `, } _\ @ ; } /__`;-...'--' Cluck!
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.