Postado Dezembro 16, 2014 10 anos Bom, queria que alguém criasse uma spell que, faz aumentar a vida em 30% e mana 30% !
Postado Dezembro 17, 2014 10 anos Solução local t = {time = 3, stor = 30303, stats = {30, 30}} -- time in minutes to cast again / storage / {health%, mana%} local hm = {} local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE) setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0) local condition = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(condition, CONDITION_PARAM_TICKS, t.time*60000) setConditionParam(condition, CONDITION_PARAM_STAT_MAXHEALTH, hm[1]) setConditionParam(condition, CONDITION_PARAM_STAT_MAXMANA, hm[2]) setCombatCondition(combat, condition) function onCastSpell(cid, var) if getPlayerStorageValue(cid, t.stor) - os.time() > 0 then doPlayerSendCancel(cid, 'This spell can only be cast every '..t.time..' minutes.') return false end table.insert(hm, t.stats[1]*(getCreatureMaxHealth(cid)/100)) table.insert(hm, t.stats[2]*(getCreatureMaxMana(cid)/100)) return doCombat(cid, combat, var) and setPlayerStorageValue(cid, t.stor, os.time() + t.time*60) end Editado Dezembro 18, 2014 10 anos por Suicide (veja o histórico de edições) The corrupt fear us. The honest support us. The heroic join us.
Postado Dezembro 17, 2014 10 anos Autor local time = 3 -- minutes local stats = {30, 30} -- {health, mana} % local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE) setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0) local condition = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(condition, CONDITION_PARAM_TICKS, time*60000) setConditionParam(condition, CONDITION_PARAM_STAT_MAXHEALTH, stats[1]*(getCreatureMaxHealth(cid)/100)) setConditionParam(condition, CONDITION_PARAM_STAT_MAXMANA, stats[2]*(getCreatureMaxMana(cid)/100)) setCombatCondition(combat, condition) function onCastSpell(cid, var) return doCombat(cid, combat, var) end [17/12/2014 21:28:09] Lua Script Error: [spell Interface] [17/12/2014 21:28:09] data/spells/scripts/hp.lua [17/12/2014 21:28:09] luaGetCreatureMaxHealth(). Creature not found [17/12/2014 21:28:09] Lua Script Error: [spell Interface] [17/12/2014 21:28:09] data/spells/scripts/hp.lua [17/12/2014 21:28:09] luaGetCreatureMaxMana(). Creature not found [17/12/2014 21:28:10] Reloaded spells. Porque deu esse error? OT e 8.4
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.