Ir para conteúdo
  • 0

[Creaturescripts]Ao Equipar Um Item ...


Oapocalipse

Pergunta

4 respostass a esta questão

Posts Recomendados

  • 0

outfitring.lua

local outfit_male = {lookType = 256, lookHead = 20, lookBody = 30, lookLegs = 004, lookFeet = 50, lookTypeEx = 0,}
local outfit_female = {lookType = 255, lookHead = 20, lookBody = 30, lookLegs = 004, lookFeet = 50, lookTypeEx = 0,}
local time = 10 -- tempo em minutos que ficara com a outfit


function onEquip(cid, item, slot) 
if(item.itemid ~= 7697 ) then 
if getPlayerSex(cid) == 1 then
doSetCreatureOutfit(cid, outfit_male, time*60*1000)
doSendMagicEffect(getThingPos(cid), 66)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sua outfit foi alterada.")
else
doSendMagicEffect(getThingPos(cid), 66)
doSetCreatureOutfit(cid, outfit_female, time*60*1000)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sua outfit foi alterada.")
end
end
return TRUE
end 

function onDeEquip(cid, item, slot) 
if(item.itemid ~= 7708) then 
return TRUE
end
doRemoveCondition(cid, CONDITION_OUTFIT)
return TRUE
end

 

movements.xml

<movevent type="Equip" itemid="7697" slot="ring" event="function" value="onEquipItem"/>
<movevent type="Equip" itemid="7708" slot="ring" event="script" value="outfitring.lua"/>
<movevent type="DeEquip" itemid="7708" slot="ring" event="script" value="outfitring.lua"/>

 

items.xml

 


<item id="7708" article="a" name="Outfit Ring">
<attribute key="weight" value="80"/>
<attribute key="slotType" value="ring"/>
<attribute key="transformEquipTo" value="7697"/>
<attribute key="stopduration" value="1"/>
<attribute key="showduration" value="1"/>
</item>

<item id="7697" article="an" name="Outfit Ring">
<attribute key="weight" value="80"/>
<attribute key="slotType" value="ring"/>
<attribute key="decayTo" value="0"/>
<attribute key="showduration" value="1"/>
</item>

Editado por Vodkart
Link para o comentário
Compartilhar em outros sites

  • 0

rsrs editei o topico lá..

 

se vc quiser que o anel fique com duração coloca:

 

<item id="7697" article="an" name="Outfit Ring">

<attribute key="weight" value="80"/>

<attribute key="slotType" value="ring"/>

<attribute key="decayTo" value="0"/>

<attribute key="duration" value="600"/>

<attribute key="showduration" value="1"/>

</item>

 

verde: nesse caso o anel irá durar 10 minutos xd

 

 

flw

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...