Ir para conteúdo
  • 0

Arrumar Spell Silence tfs 1.0


diarmaint

Pergunta

Alguém poderia arrumar essa spell,

ela não dá erro em meu servidor mas também não funciona..

Deixa players e jogadores muted.

local tarmonster = true -- Can we cast this spell on monsters. Default is true
local ptime = 8000 -- This is how long the spell will last on a Player. Default is 8 seconds = 8000
local mtime = 10000 -- This is how long the spell will last on a Monster. Default is 10 seconds = 10000

local pcombat = createCombatObject()
setCombatParam(pcombat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_GREEN)
setCombatParam(pcombat, COMBAT_PARAM_AGGRESSIVE, true)
local pcondition = createConditionObject(CONDITION_MUTED)
setConditionParam(pcondition, CONDITION_PARAM_TICKS, ptime)
setCombatCondition(pcombat, pcondition)

local mcombat = createCombatObject()
setCombatParam(mcombat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_GREEN)
setCombatParam(mcombat, COMBAT_PARAM_AGGRESSIVE, true)
local mcondition = createConditionObject(CONDITION_MUTED)
setConditionParam(mcondition, CONDITION_PARAM_TICKS, mtime)
setCombatCondition(mcombat, mcondition)

function onCastSpell(cid, var)
local creature = Creature(cid)
local tar = creature:getTarget()

    if tar:getCondition(CONDITION_MUTED) then -- check right away if muted
        creature:sendTextMessage(MESSAGE_STATUS_SMALL, "This creature is already muted")
        return false
    else -- if not muted
        if tar:isPlayer() then -- check if player
            tar:say("^SILENCED^",TALKTYPE_MONSTER_SAY)
            return doCombat(tar, pcombat, var) -- return the combat
        end
        if tar:isMonster() and tarmonster then -- check if it effects monster and if it is a monster
            tar:say("^SILENCED^",TALKTYPE_MONSTER_SAY)
            return doCombat(tar, mcombat, var) -- return the combat
        else
            creature:sendTextMessage(MESSAGE_STATUS_SMALL, "You can only use this spell on Players.")
            return false
        end
    end
end

 

Link para o comentário
Compartilhar em outros sites

0 respostass a esta questão

Posts Recomendados

Até agora não há respostas para essa pergunta

×
×
  • Criar Novo...