Talkaction de trocar 100 Super Coins por 1 Pedra:
Script.lua
function onSay(cid, words, param) if doPlayerRemoveItem(cid, 10560, 100) then doPlayerAddItem(cid, 12372, 1) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You've bought a "..getItemNameById(12372)..".") else doPlayerSendCancel(cid, "You still need more "..(100-getPlayerItemCount(cid, 10560)).." super coins to buy a "..getItemNameById(12372)..".") end return true end
Talkactions.xml:
<talkaction words="!buysafirapet" event="script" value="script.lua"/>
Criar e remover o pet "Safira" ao utilizar a pedra:
Script.lua:
function doPlayerHaveSafira(cid)
for _,summon in pairs(getCreatureSummons(cid)) do
if getCreatureName(summon) == "Safira" then
return true
break
end
end
return false
end
function onUse(cid, item, pos, item2, topos)
if doPlayerHaveSafira(cid) then
for _,summon in pairs(getCreatureSummons(cid)) do
if getCreatureName(summon) == "Safira" then
doSendMagicEffect(getThingPos(summon), 11)
doRemoveCreature(summon)
end
end
doCreatureSay(cid, 'Back, Safira!')
else
local safira = doCreateMonster("Safira", getThingPos(cid))
if safira then
doConvinceCreature(cid, safira.uid)
end
doCreatureSay(cid, 'Go, Safira!')
end
return true
end
Actions.xml:
<action itemid="12372" event="script" value="script.lua"/>
O monstro, Safira (sem a outfit que deseja, coloquei de um Uissinho *.*):
Script.lua:
<?xml version="1.0" encoding="utf-8"?> <monster name="[PET] Safira" namedescription="the safira pet" race="undead" experience="0" speed="300" manacost="0"> <health now="1000" max="1000"/> <look type="12" corpse="0"/> <targetchange interval="2000" chance="0"/> <strategy attack="100" defense="0"/> <flags> <flag attackable="0"/> <flag hostile="1"/> <flag convinceable="1"/> <flag pushable="1"/> <flag canpushitems="1"/> <flag targetdistance="1"/> <flag staticattack="90"/> </flags> <attacks> <attack name="melee" interval="2000" min="-34000" max="-36500"/> </attacks> <defenses armor="6" defense="6"/> <voices interval="5000" chance="10"> <voice sentence="grrrr"/> <voice sentence="groar"/> </voices> </monster>
Tag em monsters.xml:
<monster name="Safira" file="safira.xml"/>




info
Grupo: Campones
Registrado: 12/08/11
Posts: 91
Reputação: +5
Char no Tibia: Herculean Strength
Queria um Script que é o seguinte.
Há um NPC que fiz. Ele vende a 100kk 100 Super coins (ID: 10560) -- Feito
Com 100 super coins usando esse comando !buysafirapet aparece uma pedra (ID: 12372) -- Não feito
Quando desse Use Aparecesse o (PET) Safira. OBS: Quero O Script do Monstro. -- NÃO Feito
Que seja impossivel de matar o PET. Semelhante ao PET System Do Reason.sytes.net [8.6]
Quem ajudar com todos os detalhes . daria rep por 15 dias
Editado Fevereiro 4 por MarcioSkate22