Ir para conteúdo

[Spell] Remover Criatura


beto06

Posts Recomendados

Precisava de uma função que removesse todos os Wolfs (monstros normais e summons) de uma área e que depois realizasse o buff do script abaixo (caso não tiver criatura, não executar a spell):

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_GREEN)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, FALSE)

local condition = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition, CONDITION_PARAM_SUBID, 1)
setConditionParam(condition, CONDITION_PARAM_BUFF, TRUE)
setConditionParam(condition, CONDITION_PARAM_TICKS, 1 * 60 * 1000)
setConditionParam(condition, CONDITION_PARAM_SKILL_SHIELD, 10)

local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_GREEN)
setCombatParam(combat2, COMBAT_PARAM_AGGRESSIVE, FALSE)

local condition2 = createConditionObject(CONDITION_REGENERATION)
setConditionParam(condition2, CONDITION_PARAM_SUBID, 2)
setConditionParam(condition2, CONDITION_PARAM_BUFF, TRUE)
setConditionParam(condition2, CONDITION_PARAM_TICKS, 1 * 60 * 1000)
setConditionParam(condition2, CONDITION_PARAM_HEALTHGAIN, 10)
setConditionParam(condition2, CONDITION_PARAM_HEALTHTICKS, 4000)

local combat3 = createCombatObject()
setCombatParam(combat3, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_GREEN)
setCombatParam(combat3, COMBAT_PARAM_AGGRESSIVE, FALSE)

local condition3 = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition3, CONDITION_PARAM_SUBID, 3)
setConditionParam(condition3, CONDITION_PARAM_BUFF, TRUE)
setConditionParam(condition3, CONDITION_PARAM_TICKS, 1 * 60 * 1000)
setConditionParam(condition3, CONDITION_PARAM_STAT_MAGICLEVEL, -10)

function onCastSpell(cid, var, param)
if doPlayerRemoveItem(cid, 10926, 1) == TRUE then
doPlayerAddItem(cid, 7488, 1)
pot_count = getPlayerItemCount(cid, 7488) 
doPlayerRemoveItem(cid, 7488, pot_count) 
doPlayerAddItem(cid, 7488, pot_count) 
doCombat(cid, combat, var)
else
doPlayerSendCancel(cid, "Sorry, you need a flask of mind control.")
return FALSE
end

doSetCreatureOutfit(cid,{lookType = 308, lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet, lookAddons = getCreatureOutfit(cid).lookAddons},1 * 60 * 1000)
doAddCondition(cid, condition)
doAddCondition(cid, condition2)
doAddCondition(cid, condition3)
return TRUE
end

Agradeço com um REP+ :winksmiley02:

Link para o comentário
Compartilhar em outros sites

  • 4 weeks later...
×
×
  • Criar Novo...