Ir para conteúdo
  • Cadastre-se

(Resolvido)Ajuda com check outfit


Ir para solução Resolvido por Sekk,

Posts Recomendados

Alguém ajuda a fazer um script que checa o outfit??

 Ex: 

</outfit>

    
<outfit id="9" premium="yes">
        
<list gender="0" lookType="148" name="Druid"/>
        
<list gender="1" lookType="144" name="Druid"/>
 

 

checar se alguém ta usando Druid full

Editado por kiinho (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

Esse é um esboço:

local outfit = getCreatureOutfit(cid)

funcão onSay, onUse, onThink, onTime, onStepIn
if outfit.lookType == 144 and outfit.lookAddons == 3 then
fazer x coisa
elseif outfit.lookType == 148 and outfit.lookAddons == 3 then
fazer a mesma coisa x
end
return true
end

 

Mas preciso saber exatamente o que o script faz pra poder escrever ele uahuah

Link para o post
Compartilhar em outros sites
54 minutos atrás, Sekk disse:

Esse é um esboço:


local outfit = getCreatureOutfit(cid)

funcão onSay, onUse, onThink, onTime, onStepIn
if outfit.lookType == 144 and outfit.lookAddons == 3 then
fazer x coisa
elseif outfit.lookType == 148 and outfit.lookAddons == 3 then
fazer a mesma coisa x
end
return true
end

 

Mas preciso saber exatamente o que o script faz pra poder escrever ele uahuah

Spoiler

local water = {490, 491, 492, 493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625}

local combat = createCombatObject()

local meteor = createCombatObject()
setCombatParam(meteor, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(meteor, COMBAT_PARAM_EFFECT, CONST_ME_ICEATTACK)
setCombatFormula(meteor, COMBAT_FORMULA_LEVELMAGIC, -7.2, -400, -7.3, -400)

local meteor_water = createCombatObject()
setCombatParam(meteor_water, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(meteor_water, COMBAT_PARAM_EFFECT, CONST_ME_LOSEENERGY)
setCombatFormula(meteor_water, COMBAT_FORMULA_LEVELMAGIC, -7.2, -400, -7.3, -400)

combat_arr = {
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 3, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
}

local combat_area = createCombatArea(combat_arr)
setCombatArea(combat, combat_area)

local function meteorCast(p)
doCombat(p.cid, p.combat, positionToVariant(p.pos))
end

function onTargetTile(cid, pos)
if (math.random(0, 0) == 0) then
local ground = getThingfromPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 1})
if (isInArray(water, ground.itemid) == TRUE) then
local newpos = {x = pos.x + 9, y = pos.y - 8, z = pos.z}
doSendDistanceShoot(newpos, pos, 28)
addEvent(meteorCast, 100, {cid = cid, pos = pos, combat = meteor_water})
else
local newpos = {x = pos.x + 9, y = pos.y - 8, z = pos.z}
doSendDistanceShoot(newpos, pos, 28)
addEvent(meteorCast, 100, {cid = cid,pos = pos, combat = meteor})
end
end
end

setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTile")

function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end

aqui vai uma spell, meu objetivo é, fazer um check no outfit se for 9 = druid (mas tem que ser o addon completo) ele adiciona paralyze aqui vai o paralyze 

eu separei o paralyze da spell, espero que consiga ajeitar ou então adicione uma paralyze nova ^^

se o player não tiver o addon, usa a spell normal (sem paralyze)

com addon ( add paralyze) :)

Spoiler

local stun = createConditionObject(CONDITION_PARALYZE)
setConditionParam(stun, CONDITION_PARAM_TICKS, 20000)
setConditionFormula(stun, -0.9, 1, -0.9, 1)
setCombatCondition(meteor, stun)

 

local function stunEffect(cid)
doSendMagicEffect(getThingPos(cid), CONST_ME_STUN)
end

se conseguir REP+

Link para o post
Compartilhar em outros sites
6 minutos atrás, kiinho disse:
  Ocultar conteúdo

local water = {490, 491, 492, 493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625}

local combat = createCombatObject()

local meteor = createCombatObject()
setCombatParam(meteor, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(meteor, COMBAT_PARAM_EFFECT, CONST_ME_ICEATTACK)
setCombatFormula(meteor, COMBAT_FORMULA_LEVELMAGIC, -7.2, -400, -7.3, -400)

local meteor_water = createCombatObject()
setCombatParam(meteor_water, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(meteor_water, COMBAT_PARAM_EFFECT, CONST_ME_LOSEENERGY)
setCombatFormula(meteor_water, COMBAT_FORMULA_LEVELMAGIC, -7.2, -400, -7.3, -400)

combat_arr = {
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 3, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
}

local combat_area = createCombatArea(combat_arr)
setCombatArea(combat, combat_area)

local function meteorCast(p)
doCombat(p.cid, p.combat, positionToVariant(p.pos))
end

function onTargetTile(cid, pos)
if (math.random(0, 0) == 0) then
local ground = getThingfromPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 1})
if (isInArray(water, ground.itemid) == TRUE) then
local newpos = {x = pos.x + 9, y = pos.y - 8, z = pos.z}
doSendDistanceShoot(newpos, pos, 28)
addEvent(meteorCast, 100, {cid = cid, pos = pos, combat = meteor_water})
else
local newpos = {x = pos.x + 9, y = pos.y - 8, z = pos.z}
doSendDistanceShoot(newpos, pos, 28)
addEvent(meteorCast, 100, {cid = cid,pos = pos, combat = meteor})
end
end
end

setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTile")

function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end

aqui vai uma spell, meu objetivo é, fazer um check no outfit se for 9 = druid (mas tem que ser o addon completo) ele adiciona paralyze aqui vai o paralyze 

eu separei o paralyze da spell, espero que consiga ajeitar ou então adicione uma paralyze nova ^^

se o player não tiver o addon, usa a spell normal (sem paralyze)

com addon ( add paralyze) :)

  Ocultar conteúdo

local stun = createConditionObject(CONDITION_PARALYZE)
setConditionParam(stun, CONDITION_PARAM_TICKS, 20000)
setConditionFormula(stun, -0.9, 1, -0.9, 1)
setCombatCondition(meteor, stun)

 

local function stunEffect(cid)
doSendMagicEffect(getThingPos(cid), CONST_ME_STUN)
end

se conseguir REP+

 

outfit 9? 

Link para o post
Compartilhar em outros sites
Agora, Sekk disse:

 

outfit 9? 

</outfit>

    
<outfit id="9" premium="yes">
        
<list gender="0" lookType="148" name="Druid"/>
        
<list gender="1" lookType="144" name="Druid"/>

 

kkk foi o que vc tinha feito xd

@Sekk

Link para o post
Compartilhar em outros sites
local outfit = getCreatureOutfit(cid)
local stun = createConditionObject(CONDITION_PARALYZE)

if outfit.lookType == 144 and outfit.lookAddons == 3 then
	setConditionParam(stun, CONDITION_PARAM_TICKS, 20000)
	setConditionFormula(stun, -0.9, 1, -0.9, 1)
	setCombatCondition(meteor, stun)
elseif outfit.lookType == 148 and outfit.lookAddons == 3 then
	setConditionParam(stun, CONDITION_PARAM_TICKS, 20000)
	setConditionFormula(stun, -0.9, 1, -0.9, 1)
	setCombatCondition(meteor, stun)
end

local function stunEffect(cid)
	doSendMagicEffect(getThingPos(cid), CONST_ME_STUN)
end

 

Link para o post
Compartilhar em outros sites

em que parte da spell eu coloco? pode montar pra mim? Coloquei assim e deu um erro

Spoiler

local water = {490, 491, 492, 493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625}
local combat = createCombatObject()
local meteor = createCombatObject()
setCombatParam(meteor, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(meteor, COMBAT_PARAM_EFFECT, CONST_ME_ICEATTACK)
setCombatFormula(meteor, COMBAT_FORMULA_LEVELMAGIC, -7.2, -400, -7.3, -400)
local outfit = getCreatureOutfit(cid)
local stun = createConditionObject(CONDITION_PARALYZE)
if outfit.lookType == 144 and outfit.lookAddons == 3 then
    setConditionParam(stun, CONDITION_PARAM_TICKS, 20000)
    setConditionFormula(stun, -0.9, 1, -0.9, 1)
    setCombatCondition(meteor, stun)
elseif outfit.lookType == 148 and outfit.lookAddons == 3 then
    setConditionParam(stun, CONDITION_PARAM_TICKS, 20000)
    setConditionFormula(stun, -0.9, 1, -0.9, 1)
    setCombatCondition(meteor, stun)
end
local function stunEffect(cid)
doSendMagicEffect(getThingPos(cid), CONST_ME_STUN)
end
local meteor_water = createCombatObject()
setCombatParam(meteor_water, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(meteor_water, COMBAT_PARAM_EFFECT, CONST_ME_LOSEENERGY)
setCombatFormula(meteor_water, COMBAT_FORMULA_LEVELMAGIC, -7.2, -400, -7.3, -400)
combat_arr = {
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 3, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
}
local combat_area = createCombatArea(combat_arr)
setCombatArea(combat, combat_area)
local function meteorCast(p)
doCombat(p.cid, p.combat, positionToVariant(p.pos))
end
function onTargetTile(cid, pos)
if (math.random(0, 0) == 0) then
local ground = getThingfromPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 1})
if (isInArray(water, ground.itemid) == TRUE) then
local newpos = {x = pos.x + 9, y = pos.y - 8, z = pos.z}
doSendDistanceShoot(newpos, pos, 28)
addEvent(meteorCast, 100, {cid = cid, pos = pos, combat = meteor_water})
else
local newpos = {x = pos.x + 9, y = pos.y - 8, z = pos.z}
doSendDistanceShoot(newpos, pos, 28)
addEvent(meteorCast, 100, {cid = cid,pos = pos, combat = meteor})
end
end
end
setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTile")
function onCastSpell(cid, var)
doCombat(cid, combat, var)
end

 

 

 

Screenshot_7.png

@Sekk

Editado por kiinho (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
  • Solução
local water = {490, 491, 492, 493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625}
local combat = createCombatObject()
local meteor = createCombatObject()
setCombatParam(meteor, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(meteor, COMBAT_PARAM_EFFECT, CONST_ME_ICEATTACK)
setCombatFormula(meteor, COMBAT_FORMULA_LEVELMAGIC, -7.2, -400, -7.3, -400)

local meteor_water = createCombatObject()
setCombatParam(meteor_water, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(meteor_water, COMBAT_PARAM_EFFECT, CONST_ME_LOSEENERGY)
setCombatFormula(meteor_water, COMBAT_FORMULA_LEVELMAGIC, -7.2, -400, -7.3, -400)
combat_arr = {
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 3, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
}
local combat_area = createCombatArea(combat_arr)
setCombatArea(combat, combat_area)
local function meteorCast(p)
doCombat(p.cid, p.combat, positionToVariant(p.pos))
end
function onTargetTile(cid, pos)
if (math.random(0, 0) == 0) then
local ground = getThingfromPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 1})
if (isInArray(water, ground.itemid) == TRUE) then
local newpos = {x = pos.x + 9, y = pos.y - 8, z = pos.z}
doSendDistanceShoot(newpos, pos, 28)
addEvent(meteorCast, 100, {cid = cid, pos = pos, combat = meteor_water})
else
local newpos = {x = pos.x + 9, y = pos.y - 8, z = pos.z}
doSendDistanceShoot(newpos, pos, 28)
addEvent(meteorCast, 100, {cid = cid,pos = pos, combat = meteor})
end
end
end

setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTile")

local o = getCreatureOutfit(cid)
local stun = createConditionObject(CONDITION_PARALYZE)

function onCastSpell(cid, var)
if o.lookType == 144 and o.lookAddons == 3 then
    setConditionParam(stun, CONDITION_PARAM_TICKS, 20000)
    setConditionFormula(stun, -0.9, 1, -0.9, 1)
    setCombatCondition(meteor, stun)
	doCombat(cid, combat, var)
elseif o.lookType == 148 and o.lookAddons == 3 then
    setConditionParam(stun, CONDITION_PARAM_TICKS, 20000)
    setConditionFormula(stun, -0.9, 1, -0.9, 1)
    setCombatCondition(meteor, stun)
	doCombat(cid, combat, var)
else
	doCombat(cid, combat, var)
end

local function stunEffect(cid)
doSendMagicEffect(getThingPos(cid), CONST_ME_STUN)
end

 

Link para o post
Compartilhar em outros sites
1 minuto atrás, Sekk disse:

local water = {490, 491, 492, 493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625}
local combat = createCombatObject()
local meteor = createCombatObject()
setCombatParam(meteor, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(meteor, COMBAT_PARAM_EFFECT, CONST_ME_ICEATTACK)
setCombatFormula(meteor, COMBAT_FORMULA_LEVELMAGIC, -7.2, -400, -7.3, -400)

local meteor_water = createCombatObject()
setCombatParam(meteor_water, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(meteor_water, COMBAT_PARAM_EFFECT, CONST_ME_LOSEENERGY)
setCombatFormula(meteor_water, COMBAT_FORMULA_LEVELMAGIC, -7.2, -400, -7.3, -400)
combat_arr = {
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 3, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
}
local combat_area = createCombatArea(combat_arr)
setCombatArea(combat, combat_area)
local function meteorCast(p)
doCombat(p.cid, p.combat, positionToVariant(p.pos))
end
function onTargetTile(cid, pos)
if (math.random(0, 0) == 0) then
local ground = getThingfromPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 1})
if (isInArray(water, ground.itemid) == TRUE) then
local newpos = {x = pos.x + 9, y = pos.y - 8, z = pos.z}
doSendDistanceShoot(newpos, pos, 28)
addEvent(meteorCast, 100, {cid = cid, pos = pos, combat = meteor_water})
else
local newpos = {x = pos.x + 9, y = pos.y - 8, z = pos.z}
doSendDistanceShoot(newpos, pos, 28)
addEvent(meteorCast, 100, {cid = cid,pos = pos, combat = meteor})
end
end
end

setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTile")

local o = getCreatureOutfit(cid)
local stun = createConditionObject(CONDITION_PARALYZE)

function onCastSpell(cid, var)
if o.lookType == 144 and o.lookAddons == 3 then
    setConditionParam(stun, CONDITION_PARAM_TICKS, 20000)
    setConditionFormula(stun, -0.9, 1, -0.9, 1)
    setCombatCondition(meteor, stun)
	doCombat(cid, combat, var)
elseif o.lookType == 148 and o.lookAddons == 3 then
    setConditionParam(stun, CONDITION_PARAM_TICKS, 20000)
    setConditionFormula(stun, -0.9, 1, -0.9, 1)
    setCombatCondition(meteor, stun)
	doCombat(cid, combat, var)
else
	doCombat(cid, combat, var)
end

local function stunEffect(cid)
doSendMagicEffect(getThingPos(cid), CONST_ME_STUN)
end

 

funciona em TFS 0.4?

Link para o post
Compartilhar em outros sites

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.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo