Bom, faz um tempo que eu mostrei um addon system para o meu servidor
E Hoje eu adaptei ele para o PDE 3.0 e irei ensinar a por em seu servidor!
Só testado em PDE 3.0, não sei se vai funcionar em algum PDA ou outro tipo de servidor.
Vá em actions/scripts e crie um arquivo chamado addon.lua.
Adicione isso lá:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local addons = {
[ID DO ITEM] = {pokemon= "NOME DO POKEMON" , looktype = LOOKTYPE NORMAL, fly = FLY, SE NÃO TIVER PONHA 0, ride = RIDE, SE NÃO TIVER PONHA 0, surf = SE NÃO TIVER SURF PONHA 0},
}
if #getCreatureSummons(cid) > 0 then
doPlayerSendCancel(cid, "Please back your pokemon.")
return false
end
local addon = addons[item.itemid].looktype
local fly = addons[item.itemid].fly
local ride = addons[item.itemid].ride
local surf = addons[item.itemid].surf
local pb = getPlayerSlotItem(cid, 8).uid
local pk = addons[item.itemid].pokemon
if getItemAttribute(pb,"poke") ~= pk then
doPlayerSendCancel(cid, "Sorry, you can't use this addon on this poke.")
return false
end
if getItemAttribute(pb,"addon") >= 0 then
doRemoveItem(item.uid, 1)
doPlayerSendTextMessage(cid, 27, "Congratulations! Now your pokemon will use the addon.")
doSetItemAttribute(pb,"addon",addon)
doSetItemAttribute(pb,"addonfly",fly)
doSetItemAttribute(pb,"addonride",ride)
doSetItemAttribute(pb,"addonsurf",surf)
return true
end
return true
end
Em actions.xml adicione:
<action itemid="ID;ID;ID" event="script" value="addon.lua"/>
Agora em actions/goback.lua antes de:
else
doPlayerSendCancel(cid, "This pokemon is fainted.")
end
return true
end
Adicione:
local pk = getCreatureSummons(cid)[1]
local pb = getPlayerSlotItem(cid, 8).uid
local look = getItemAttribute(pb,"addon")
if not look then
doSetItemAttribute(pb,"addon",0)
end
if look > 0 then
doSetCreatureOutfit(pk, {lookType = look}, -1)
end
Em lib/order.lua encontre:
local pokemon = flys[getPokemonName(getCreatureSummons(cid)[1])]
doPlayerSendTextMessage(cid, 27, "Type \"up\" or \"h1\" to fly higher and \"down\" or \"h2\" to fly lower.")
doChangeSpeed(cid, -getCreatureSpeed(cid))
local speed = 500 + PlayerSpeed/5 + getSpeed(sid) * 6 * speedRate
doChangeSpeed(cid, speed)
setPlayerStorageValue(cid, 54844, speed)
doSetCreatureOutfit(cid, {lookType = pokemon[1] + 351}, -1)
doItemSetAttribute(getPlayerSlotItem(cid, 8).uid, "hp", getCreatureHealth(getCreatureSummons(cid)[1]) / getCreatureMaxHealth(getCreatureSummons(cid)[1]))
doRemoveCreature(getCreatureSummons(cid)[1])
setPlayerStorageValue(cid, 17000, 1)
Abaixo adicione:
local addonfly= getPlayerSlotItem(cid, 8).uid
local addofly = getItemAttribute(addonfly,"addonfly")
if not addofly then
doSetItemAttribute(addonfly,"addonfly",0)
end
if addofly > 0 then
doSetCreatureOutfit(cid, {lookType = addofly}, -1)
end
Continuando em order.lua Encontre:
local pokemon = rides[getPokemonName(getCreatureSummons(cid)[1])]
doChangeSpeed(cid, -getCreatureSpeed(cid))
local speed = 150 + PlayerSpeed + getSpeed(sid) * 5 * speedRate
doChangeSpeed(cid, speed)
setPlayerStorageValue(cid, 54844, speed)
doSetCreatureOutfit(cid, {lookType = pokemon[1] + 351}, -1)
doItemSetAttribute(getPlayerSlotItem(cid, 8).uid, "hp", getCreatureHealth(getCreatureSummons(cid)[1]) / getCreatureMaxHealth(getCreatureSummons(cid)[1]))
doRemoveCreature(getCreatureSummons(cid)[1])
setPlayerStorageValue(cid, 17001, 1)
Em baixo adicione:
local addonride = getPlayerSlotItem(cid, 8).uid
local addoride = getItemAttribute(addonride,"addonride")
if not addoride then
doSetItemAttribute(addonride,"addonride",0)
end
if addoride > 0 then
doSetCreatureOutfit(cid, {lookType = addoride}, -1)
en
Agora em movements/surf.lua encontre:
doSetCreatureOutfit(cid, {lookType = surfs[getPokemonName(getCreatureSummons(cid)[1])].lookType + 351}, -1)
doCreatureSay(cid, ""..getPokeName(getCreatureSummons(cid)[1])..", lets surf!", 1)
doChangeSpeed(cid, -(getCreatureSpeed(cid)))
E troque por:
local addonsurf = getPlayerSlotItem(cid, 8).uid
local addosurf = getItemAttribute(addonsurf,"addonsurf")
if not addosurf then
doSetItemAttribute(addonsurf,"addonsurf",0)
doSetCreatureOutfit(cid, {lookType = surfs[getPokemonName(getCreatureSummons(cid)[1])].lookType + 351}, -1)
end
if addosurf > 0 then
doSetCreatureOutfit(cid, {lookType = addosurf}, -1)
end
doCreatureSay(cid, ""..getPokeName(getCreatureSummons(cid)[1])..", lets surf!", 1)
doChangeSpeed(cid, -(getCreatureSpeed(cid)))
No mesmo arquivo ache:
doSummonMonster(cid, pokemon)
Logo abaixo adicione:
local pk = getCreatureSummons(cid)[1]
local balla = getPlayerSlotItem(cid, 8).uid
local balladdon = getItemAttribute(balla,"addon")
if not balladdon then
doSetItemAttribute(balla,"addon",0)
end
if balladdon > 0 then
doSetCreatureOutfit(pk, {lookType = balladdon}, -1)
end
Por ultimo em actions/order.lua encontre:
doPlayerSay(cid, ""..getPokeName(getCreatureSummons(cid)[1])..", let me get down!", 1)
doRegainSpeed(cid) --alterado v1.7
doRemoveCondition(cid, CONDITION_OUTFIT)
Abaixo adicione:
local pkjg = getCreatureSummons(cid)[1]
local pkza = getPlayerSlotItem(cid, 8).uid
local pkxd = getItemAttribute(pkjg,"addon")
if not pkxd then
doSetItemAttribute(pkza,"addon",0)
elseif pkxd > 0 then
doSetCreatureOutfit(pkjg, {lookType = pkxd}, -1)
end
Vá em creaturescripts/scripts/login.lua Troque tudo por:
Pokébolas com maior chance de catch dependendo do tipo do pokemon!
Também vou ensinar a adicionar pokébolas
Não pensei em um nome melhor, então vou chamar de:
Ball System
Adicionando novas Pokebolas:
Pokébolas com maior chance de catch dependendo do tipo do pokemon!
Créditos:
@Ceetros (talvez ? )
@zipter98 (tive a ideia no tópico do @@Bluester, para acessar clique aqui)