A Muito tempo desemvolvendo o Script do Systema de Montaria e finalmente esta pronto OMG!
Agradeso a todos que me ajudarão
*Usando A talkaction
* Diga !animal go
Pra summonar o cavalo.
* Diga !animal mount
Para Montar no cavalo.
* Diga !animal ride
Para sair do cavalo.
* Diga !animal back
Para Tirar a Criatura.
* Instalando o Script
Va Na Pasta data Do servidor Talkactions/Scripts
Crie Uma Lua chamado animal
e cole isso dentro
-- [( XTibia Script By AntiemoXml, Doidin, Kydrai, Vodkart, MarcelloMkez )] -- -- [( XTibia Script ##Esclusivo Ao Xtibia.com ## XTibia Script )] -- function onSay(cid, words, param) local cfg = { storage = 6679, monster = "War Wolf", speed = 600, lookType = 4, time = 600 * 6000 * 1000000 } local summon = getPlayerStorageValue(cid, cfg.storage) if param:lower() == "go" then if summon <= 1 then if (getTilePzInfo(getCreaturePosition(cid)) == LUA_ERROR) then local m = doCreateMonster(cfg.monster, getCreaturePosition(cid)) doConvinceCreature(cid, m) setPlayerStorageValue(cid, cfg.storage, m) else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You Can'Not Summon Your Creature In Pz Zone.") end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have already summoned a horse.") end elseif param:lower() == "mount" then if isCreature(summon) then local outfit = getCreatureOutfit(cid) outfit.lookType = cfg.lookType doRemoveCreature(summon) doChangeSpeed(cid, cfg.speed) doSetCreatureOutfit(cid, outfit, cfg.time) else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need to summon a horse.") end elseif param:lower() == "ride" then if summon > 1 then local outfit = getCreatureOutfit(cid) if outfit.lookType ~= cfg.lookType then else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need Horse To Riding.") end if (getTilePzInfo(getCreaturePosition(cid)) == LUA_ERROR) then doRemoveCondition(cid, CONDITION_OUTFIT) doChangeSpeed(cid, -cfg.speed) local m = doCreateMonster(cfg.monster, getCreaturePosition(cid)) doConvinceCreature(cid, m) setPlayerStorageValue(cid, cfg.storage, m) else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You Can'Not Summon Your Creature In Pz Zone.") end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You're not riding a horse.") end elseif param:lower() == "back" then if isCreature(summon) then doRemoveCreature(summon) setPlayerStorageValue(cid, cfg.storage, 0) else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You do not summoned a horse.") end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.") end return TRUE end
agora va en talkactions.xml e coloque a seguinte tag
<talkaction words="!animal" script="animal.lua"/>
agora va en creaturescripts/scripts e crie 1 arquivo.lua chamado Summon
e cole isso dentro
function onLogin(cid) registerCreatureEvent(cid, "logoutss") return TRUE end function onLogout(cid) if getPlayerStorageValue(cid, 6679) >= 0 then setPlayerStorageValue(cid, 6679, 0) return FALSE end return TRUE end
isso e caso em um Logout com o storage ele ira resetar o storage do mesmo modo do back mas no caso de 1 logout com a criatura
agora va en creaturescripts.xml e coloque as seguintes tags
<event type="login" name="loginss" script="summon.lua"/> <event type="logout" name="logoutss" script="summon.lua"/>
aqui esta 1 fotinha para vocês verem como realmente fica
monster = "War Wolf", <---- Criatura Que ira ser sumonada exemplo você pode usar um war wolf ou ate otra coisa que você gostar 1 orc maruder e etc... speed = 600, <--- Local de Speed q o player ira ganhar en cima da montaria lookType = 4 <--- Looktype da Outifit de montaria exemplo 1 orc rider
IMPORTANTE
<flag convinceable="0"/>
convinceable="0"/ coloque para convinceable="1"/ para criatura Não te atacar
<flag convinceable="1"/>