Postado Junho 24, 2018 7 anos Galera, to com uma problema em uma spell de remover buff, que é o seguinte, ele remove apenas o efeito que está sendo enviado para o player, mas os atributos não. Segue as scripts abaixo: Spell de remover buff: local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -40.2, 1, -40.2, 1) function onCastSpell(cid, var) local target = getCreatureTarget(cid) local storage = 102053 -- Storage que ta em Todos os BUffs, alguns pode não está, então coloque a mesma storage em todos os buff. local position = {x=getThingPosition(getCreatureTarget(cid)).x+1, y=getThingPosition(getCreatureTarget(cid)).y+1, z=getThingPosition(getCreatureTarget(cid)).z} if isPlayer(target) then if getPlayerStorageValue(target, storage) == 1 then setPlayerStorageValue(target, storage, 0) doSendMagicEffect(position, 238) return doCombat(cid, combat, var) else doPlayerSendTextMessage(cid, 20, "O Player ja esta sem Buff.") end else doPlayerSendTextMessage(cid, 20, "Voce so pode usar este Jutsu em Players, pois monstros não tem Buff.") end end Buff: local tempo = 60 -- tempo em segundos. local effect = {287} -- effect no player local ml = 85 -- quantos ira aumentar o skill de ML local skillfist = 85 -- quantos ira aumentar o skill de Fist local skillsword = 85 -- quantos ira aumentar o skill de Sword local skillaxe = 85 -- quantos ira aumentar o skill de Axe local skillclub = 85 -- quantos ira aumentar o skill de Club local skilldistance = 85 -- quantos ira aumentar o skill de Distance local skillshield = 85 -- quantos ira aumentar o skill de Shield local health = 200 -- A cada 1 segundo quantos aumentar de vida local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0) local condition = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(condition, CONDITION_PARAM_TICKS, tempo*1000) setConditionParam(condition, CONDITION_PARAM_STAT_MAGICLEVEL, ml) setConditionParam(condition, CONDITION_PARAM_SKILL_FIST, skillfist) setConditionParam(condition, CONDITION_PARAM_SKILL_SWORD, skillsword) setConditionParam(condition, CONDITION_PARAM_SKILL_AXE, skillaxe) setConditionParam(condition, CONDITION_PARAM_SKILL_CLUB, skillclub) setConditionParam(condition, CONDITION_PARAM_SKILL_DISTANCE, skilldistance) setConditionParam(condition, CONDITION_PARAM_SKILL_SHIELD, skillshield) setConditionParam(condition, CONDITION_PARAM_OUTFIT, outfit) setCombatCondition(combat, condition) local condition = createConditionObject(CONDITION_HASTE) setConditionParam(condition, CONDITION_PARAM_SPEED, 250) setConditionParam(condition, CONDITION_PARAM_TICKS, tempo*1000) setConditionParam(condition, CONDITION_PARAM_BUFF, TRUE) setCombatCondition(combat, condition) local condition = createConditionObject(CONDITION_REGENERATION) setConditionParam(condition, CONDITION_PARAM_SUBID, 1) setConditionParam(condition, CONDITION_PARAM_BUFF, TRUE) setConditionParam(condition, CONDITION_PARAM_TICKS, tempo*1000) setConditionParam(condition, CONDITION_PARAM_HEALTHGAIN, health) setConditionParam(condition, CONDITION_PARAM_HEALTHTICKS, 1000) setCombatCondition(combat, condition) function magicEffect5555555(tempo2,tempo3,cid) if (isCreature(cid)) then if getPlayerStorageValue(cid, 102053) > 0 and getCreatureCondition(cid, CONDITION_REGENERATION, 1) then for i=1, #effect do local position = {x=getPlayerPosition(cid).x+1, y=getPlayerPosition(cid).y, z=getPlayerPosition(cid).z} doSendMagicEffect(position, effect[i]) end end end end function onCastSpell(cid, var) if getPlayerStorageValue(cid, 102053) ~= 1 or getCreatureCondition(cid, CONDITION_REGENERATION, 1) == false then doCombat(cid, combat, var) tempo2 = 0 while (tempo2 ~= (tempo*1000)) do addEvent(magicEffect5555555, tempo2, tempo2, tempo*1000, cid) tempo2 = tempo2 + 200 end setPlayerStorageValue(cid, 102053,1) -- storage verifica transformado, quando = 1 player esta transformado. else doPlayerSendCancel(cid, "Voce já está com Buff.") end end
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.