Bom Galera por um tempo tive uma dificuldade sobre o shop(Site) e a comunicaçao com o jogo, entao prestem atençao que vou colocar passo a passo o que montei de cada gente boa q fui encontrando em forums e cheguei ao 100% shop gesior. entao vamos la:[/size]
1-Real Server 2.2.5 (8.54-8.57) - XTibia.com, por doidin
2-Gesior ACC Maker - XTibia.com, por doidin
obs: n testei em outros a nao ser os acima listados, nao me responsabilizo por testes em outras versoes este mesmo acima citado estao pra downloads aqui no x'tibia.
apos seguir tutorial de instalaçao do gesior e ocorrer instalaçao 100% perfeita, tive a dificuldade de comprar itens no site e ir para o players in game entao seguir o seguinte tutorial:
1- Abra ".../xampp/htdocs/config/config.php" e ative o shop system (mude "0" para "1"):
Código:
$config['site']['shop_system'] = 1
2. Abra o arquivo globalevents.xml e adiciona a tag:
Código:
<globalevent name="shop" interval="30" script="shop.lua"/>
Em data/globalevent/shop.lua coloque:
Código:
-- ### CONFIG ###-- message send to player by script "type" (types you can check in "global.lua")
SHOP_MSG_TYPE = 19
-- time (in seconds) between connections to SQL database by shop script
SQL_interval = 30
-- ### END OF CONFIG ###
function onThink(interval, lastExecution)
local result_plr = db.getResult("SELECT * FROM z_ots_comunication WHERE `type` = 'login';")
if(result_plr:getID() ~= -1) then
while(true) do
id = tonumber(result_plr:getDataInt("id"))
action = tostring(result_plr:getDataString("action"))
delete = tonumber(result_plr:getDataInt("delete_it"))
cid = getCreatureByName(tostring(result_plr:getDataString("name")))
if isPlayer(cid) == TRUE then
local itemtogive_id = tonumber(result_plr:getDataInt("param1"))
local itemtogive_count = tonumber(result_plr:getDataInt("param2"))
local container_id = tonumber(result_plr:getDataInt("param3"))
local container_count = tonumber(result_plr:getDataInt("param4"))
local add_item_type = tostring(result_plr:getDataString("param5"))
local add_item_name = tostring(result_plr:getDataString("param6"))
local received_item = 0
local full_weight = 0
if add_item_type == 'container' then
container_weight = getItemWeightById(container_id, 1)
if isItemRune(itemtogive_id) == TRUE then
items_weight = container_count * getItemWeightById(itemtogive_id, 1)
else
items_weight = container_count * getItemWeightById(itemtogive_id, itemtogive_count)
end
full_weight = items_weight + container_weight
else
full_weight = getItemWeightById(itemtogive_id, itemtogive_count)
if isItemRune(itemtogive_id) == TRUE then
full_weight = getItemWeightById(itemtogive_id, 1)
else
full_weight = getItemWeightById(itemtogive_id, itemtogive_count)
end
end
local free_cap = getPlayerFreeCap(cid)
if full_weight <= free_cap then
if add_item_type == 'container' then
local new_container = doCreateItemEx(container_id, 1)
local iter = 0
while iter ~= container_count do
doAddContainerItem(new_container, itemtogive_id, itemtogive_count)
iter = iter + 1
end
received_item = doPlayerAddItemEx(cid, new_container)
else
local new_item = doCreateItemEx(itemtogive_id, itemtogive_count)
received_item = doPlayerAddItemEx(cid, new_item)
end
if received_item == RETURNVALUE_NOERROR then
doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, 'You received >> '.. add_item_name ..' << from OTS shop.')
db.executeQuery("DELETE FROM `z_ots_comunication` WHERE `id` = " .. id .. ";")
db.executeQuery("UPDATE `z_shop_history_item` SET `trans_state`='realized', `trans_real`=" .. os.time() .. " WHERE id = " .. id .. ";")
else
doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << from OTS shop is waiting for you. Please make place for this item in your backpack/hands and wait about '.. SQL_interval ..' seconds to get it.')
end
else
doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << from OTS shop is waiting for you. It weight is '.. full_weight ..' oz., you have only '.. free_cap ..' oz. free capacity. Put some items in depot and wait about '.. SQL_interval ..' seconds to get it.')
end
end
if not(result_plr:next()) then
break
end
end
result_plr:free()
end
return TRUE
end
2.1- CONFIGURAÇÃO
No início do arquivo postado acima é parte do shop config:
Código:
-- message send to player by script "type" (types you can check in "global.lua")
SHOP_MSG_TYPE = 17
-- time (in seconds) between connections to SQL database by shop script
SQL_interval = 30
Script padrão para se conectar com o banco de dados 1 vez a cada 30 segundos.
2.2- Abra seu arquivo constant.lua que se encontra em "data/lib/constant.lua" e adicione esta linha em qualquer lugar:
InitShopComunication = 0
3-Na database do seu otserv execute (no phpmyadmin):
Código:
CREATE TABLE IF NOT EXISTS `z_ots_comunication` (
`id` int(11) NOT NULL auto_increment,
`name` varchar(255) NOT NULL,
`type` varchar(255) NOT NULL,
`action` varchar(255) NOT NULL,
`param1` varchar(255) NOT NULL,
`param2` varchar(255) NOT NULL,
`param3` varchar(255) NOT NULL,
`param4` varchar(255) NOT NULL,
`param5` varchar(255) NOT NULL,
`param6` varchar(255) NOT NULL,
`param7` varchar(255) NOT NULL,
`delete_it` int(2) NOT NULL default '1',
PRIMARY KEY (`id`)
);
CREATE TABLE IF NOT EXISTS `z_shop_offer` (
`id` int(11) NOT NULL auto_increment,
`points` int(11) NOT NULL default '0',
`itemid1` int(11) NOT NULL default '0',
`count1` int(11) NOT NULL default '0',
`itemid2` int(11) NOT NULL default '0',
`count2` int(11) NOT NULL default '0',
`offer_type` varchar(255) default NULL,
`offer_description` text NOT NULL,
`offer_name` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
);
CREATE TABLE IF NOT EXISTS `z_shop_history_item` (
`id` int(11) NOT NULL auto_increment,
`to_name` varchar(255) NOT NULL default '0',
`to_account` int(11) NOT NULL default '0',
`from_nick` varchar(255) NOT NULL,
`from_account` int(11) NOT NULL default '0',
`price` int(11) NOT NULL default '0',
`offer_id` int(11) NOT NULL default '0',
`trans_state` varchar(255) NOT NULL,
`trans_start` int(11) NOT NULL default '0',
`trans_real` int(11) NOT NULL default '0',
PRIMARY KEY (`id`)
);
CREATE TABLE IF NOT EXISTS `z_shop_history_pacc` (
`id` int(11) NOT NULL auto_increment,
`to_name` varchar(255) NOT NULL default '0',
`to_account` int(11) NOT NULL default '0',
`from_nick` varchar(255) NOT NULL,
`from_account` int(11) NOT NULL default '0',
`price` int(11) NOT NULL default '0',
`pacc_days` int(11) NOT NULL default '0',
`trans_state` varchar(255) NOT NULL,
`trans_start` int(11) NOT NULL default '0',
`trans_real` int(11) NOT NULL default '0',
PRIMARY KEY (`id`)
);
4-
Fim da instalação. Agora adicione ofertas!! (exemplo abaixo)
Exemplo de configuração de ofertas. Execute na database do seu OT:
Código:
INSERT INTO `z_shop_offer`(`id`,`points`,`itemid1` ,`count1` ,`itemid2` ,`count2` ,`offer_type` ,`offer_description` ,`offer_name`)
VALUES (NULL , '10', '0', '12', '0', '0', 'pacc', 'Buy 12 days of premium account for yourself or your friend!', '12 Days of PACC'
), (NULL , '40', '5890', '50', '0', '0', 'item', 'Buy 50 Chicken Feathers!', '50x Chicken Feather'
), (NULL , '100', '2466', '1', '1987', '8', 'container', 'Buy bag with 8 Golden Armor! Become a rich mother fucker!', '8x Golden Armor');
Quando você for adicionar novas ofertas de PACC
id - empty (auto_incement)
points - quantos pontos custa essa oferta
count1 - Dias de PACC esta oferta dá.
offer_type = "pacc"
offer_description - Descrição da Oferta, exeplo: "Buy 5 days of PACC. With PACC you can visit new areas, fight stronger monsters and promote your character!"
offer_name - Nome da oferta, como: "5 Days of PACC"
Quando você for adicionar uma nova oferta de ITEM
id - empty (auto_increment)
points - quantos pontos custa essa oferta.
itemid1 - ID do item criato no seu OT
count1 - "quantidade" do item, como SD com 15 cargas tem "count" 15, item normais (bag, crossbow, golden armor...) tem "count" 1, "count" 3 não irá criar 3 Golden Armos, use 'container' para dar mais items.
offer_type = "item"
offer_description - Descrição da oferta, como: "Buy Golden Armor and become great knight! Fight stonger mosters and lose less HP!"
offer_name - Nome da nova oferta, como: "1x Golden Armor"
Quando você for adicionar uma nova oferta de CONTAINER
id - empty (auto_increment)
points - Quantos ponstos custa essa oferta
itemid1 - ID do item criado dentro da BP
count1 - "quantidade"/"tipo" dos itens da BP, para itens normais, use "count" 1, para dar mais itens use "count2" e coloce quantos itens serão dados.
itemid2 - ID da BP (como uma bag: 1987, ESSE ITEM DEVE SER UM CONTAINER E DEVE SER USÁVEL!!!)
count2 - Número de itens dentro do container, se você usar "bag" (id 1987) como container você pode por 1-8 items, se backpack 1-20, não coloque mais doque cabe no container!
offer_type = "container"
offer_description - Descrição da oferta, como: "Buy 8 Golden Armors in bag and become rich player! Fight stonger mosters and lose less HP or sell it for much cash!"
offer_name - Nome da oferta, como: "8x Golden Armor"
este tutorial foi do :KutyKutyx3 - ######
bom ate aew resolvemos o problema dos itens irem pro players, mas o gesior vem pra vender premy em vez de vip e n achando nenhum meio de fazer alguma coisa a respeito fui fazendo testes ate chegar ao ponto entao vejam a soluçao deste fator.
mantive o shopadmin do gesior e substituir o shopsystem que peguei de outro forum segue link abaixo
http://www.multiupload.com/AOA619X65R , observaçao e a seguinte extraia e pegue so o shopsystem e cole na sua pasta htdocs n substitua o shopadmin este item foi criado por gpedro do ######. ainda n terminou xD
[TFS 0.3/0.4] O melhor sistema VIP sempre! [Action/Movevent/Globalevent] Acção [Movevent /] Globalevent
Olá.
Primeiro de tudo Se você estiver indo para publicá-la em outro lugar, eu não quero que você tome os créditos porque sua mina de 100%. Primeiro de Tudo Se VOCÊ estiver indo parágrafo publica-la em Outro Lugar, eu Não Quero Que VOCÊ tome OS Créditos PORQUE SUA mina de 100%.
Bem, eu vou explicar o sistema .. Bem, Vou Explicar eu o Sistema .. A maior parte do sistema vip usar um globalevent para remover um dia vip a cada 24 horas, mas, e se o serv uptime têm 23 horas e acidente? A Maior parte do Sistema vip USAR UM globalevent n removedor vip dia UM A cada 24 horas, mas, e se o uptime dez serv 23 horas e acidente? O dia não poderia ser removido, então eu consertei, agora o dia vip será removido em uma hora específica, se você configurá-lo para duas horas, o dia vip serão removidos em duas horas por isso, se o acidente serv para ele como 3 minutos ainda irá remover os dias VIP 02:00 .. O dia Não Poderia Ser removido, elemento Fixo assim Que eu, agora o dia vip Será removido Hora Específica em uma, SE VOCÊ configura-lo n. Duas horas, o dia vip Serao em removidos Duas horas Por isso, se o acidente Para ele serv Como três minutos Ainda vip ira Retirar o dia não 02:00 ..
Também funciona para todas as contas a apenas como uma conta premium. Também funciona Para todas as Contas Apenas como um Uma Conta premium.
Testado em TheForgottenServer 0.3.6 / 0.4 TheForgottenServer Testado em 0.3.6 / 0.4
Este sistema VIP contém: Este Contém Sistema VIP:
* Suas funções proprias Funções Lua Lua
* Removedor automático dia. Removedor Automático dia.
* Telha VIP. Telha VIP.
* OnLogin script para verificar vip. script OnLogin vip verificar parág.
* Medalha de VIP. Medalha de VIP.
* Remover Comando Dias Vip. Vip comando remover Dias.
* Add Command Dias Vip. Adicionar Commando Vip Dias.
Okey bem aqui vai.
Vá para o seu phpmyadmin eo execute:
ALTER TABLE `accounts` ADD
`vipdays` int(11) NOT NULL DEFAULT 0;
Agora, vá para dados / lib / function.lua e adicione estas linhas no topo.
--- Vip functions by Kekoxfunction getPlayerVipDays(cid)
local Info = db.getResult("SELECT `vipdays` FROM `accounts` WHERE `id` = " .. getPlayerAccountId(cid) .. " LIMIT 1")
if Info:getID() ~= LUA_ERROR then
local days= Info:getDataInt("vipdays")
Info:free()
return days
end
return LUA_ERROR
end
function doAddVipDays(cid, days)
db.executeQuery("UPDATE `accounts` SET `vipdays` = `vipdays` + " .. days .. " WHERE `id` = " .. getPlayerAccountId(cid) .. ";")
end
function doRemoveVipDays(cid, days)
db.executeQuery("UPDATE `accounts` SET `vipdays` = `vipdays` - " .. days .. " WHERE `id` = " .. getPlayerAccountId(cid) .. ";")
end
Depois de feito isso, adicione essa linha de dados / creaturescript / login.lua
registerCreatureEvent(cid, "VipCheck")
agora, em dados creaturescript / scripts crie um novo arquivo e nomeá-la vipcheck.lua
--- Script by Kekoxfunction onLogin(cid)
if getPlayerVipDays(cid) >= 1 then
doPlayerSendTextMessage(cid, 19, "You have ".. getPlayerVipDays(cid) .." vip days left.")
end
return true
end
dados / creaturescript / creaturescript.xml
<event type="login" name="VipCheck" event="script" value="vipcheck.lua"/>
Agora, vá para a data / globalevents / scripts /, crie um novo arquivo e nomeá-la daysremover.lua
--- Script by Kekoxfunction onTimer()
db.executeQuery("UPDATE accounts SET vipdays = vipdays - 1 WHERE vipdays > 0;")
return true
end
dados / globalevents / globanevents.xml
<globalevent name="VipDaysRemover" time="00:01" event="script" value="daysremover.lua"/>
You can change the time when the vip day is going to be removed in ( time="00:01" ). Você pode mudar o tempo quando o dia vip vai ser removido (hora = "00:01").
If you have more than or just 1 vip day, when you login you'll get a message: Se você tiver mais de um dia ou apenas vip, quando fizer o login, você receberá uma mensagem:
Outros scrips
VIP Tile :
data/movements/scripts/ viptile.lua dados / movimentos / scripts / viptile.lua
--- Script by Kekoxfunction onStepIn(cid, item, position, fromPosition)
if getPlayerVipDays(cid) == 0 then
doTeleportThing(cid, fromPosition, FALSE)
end
return true
end
data/movements/movements.xml dados / movimentos / movements.xml
<movevent type="StepIn" actionid="11223" event="script" value="viptile.lua"/>
Em mapear editor, apenas conjunto de ações id 11223 para a telha que você quer ser telha VIP
Medalha VIP
dados / ações / scripts / vipmedal.lua
-- Vip medal by Kekoxfunction onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerVipDays(cid) > 365 then
doPlayerSendCancel(cid, "You can only have 1 year of vip account or less.")
else
doAddVipDays(cid, 30)
doCreatureSay(cid, "VIP")
doPlayerPopupFYI(cid, "We have added 30 vip days to your account!\nEnjoy it!.")
doRemoveItem(item.uid)
end
return true
end
data/actions/actions.xml dados / ações / actions.xml
<action itemid="2112" event="script" value="vipmedal.lua"/>
Não se esqueça de mudar o ID do item.
Adicionar comando dias VIP
data / talkactions / scripts / adddays.lua
--- Script by Kekox.function onSay(cid, words, param, channel)
if(param == '') then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.")
return true
end
local t = string.explode(param, ",")
t[1] = tonumber(t[1])
if(not t[1]) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires numeric param.")
return true
end
local pid = cid
if(t[2]) then
pid = getPlayerByNameWildcard(t[2])
if(not pid) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. t[2] .. " not found.")
return true
end
end
if(t[1] > 365) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can only add max 365 vip days.")
return true
end
sender = getPlayerByNameWildcard(cid)
doAddVipDays(pid, t[1])
doPlayerSendTextMessage(cid, "You have added ".. t[1] .." vip days to ".. t[2])
doPlayerSendTextMessage(pid, sender .." just added you ".. t[1] .." vip days.")
return true
end
data / talkactions / scripts / talkactions.xml /
<talkaction log="yes" words="/adddays" access="5" event="script" value="adddays.lua"/>
Comando Remover dias VIP
data/talkactions/scripts/ removedays.lua data / talkactions / scripts / removedays.lua
--- Script by Kekox fixed by Shawak.function onSay(cid, words, param, channel)
if(param == '') then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.")
return true
end
local t = string.explode(param, ",")
t[1] = tonumber(t[1])
if(not t[1]) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires numeric param.")
return true
end
local pid = cid
if(t[2]) then
pid = getPlayerByNameWildcard(t[2])
if(not pid) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. t[2] .. " not found.")
return true
end
end
if(t[1] > 365) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can only add max 365 vip days.")
return true
end
sender = getPlayerByNameWildcard(cid)
doRemoveVipDays(pid, t[1])
doPlayerSendTextMessage(cid, "You have removed ".. t[1] .." vip days to ".. t[2])
doPlayerSendTextMessage(pid, sender .." just removed you ".. t[1] .." vip days.")
return true
end
data / talkactions / scripts / talkactions.xml /
<talkaction log="yes" words="/removedays" access="5" event="script" value="removedays.lua"/>
Porta VIP
dados / ações / scripts / vipdoor.lua
function onUse(cid, item, frompos, item2, topos)if getPlayerVipDays(cid) >= 1 then
pos = getPlayerPosition(cid)
if pos.x == topos.x then
if pos.y < topos.y then
pos.y = topos.y + 1
else
pos.y = topos.y - 1
end
elseif pos.y == topos.y then
if pos.x < topos.x then
pos.x = topos.x + 1
else
pos.x = topos.x - 1
end
else
doPlayerSendTextMessage(cid,22,"Stand in front of the door.")
return true
end
doTeleportThing(cid,pos)
doSendMagicEffect(topos,12)
else
doPlayerSendTextMessage(cid,22,'Only VIP Account can go there.')
end
return true
end
dados / ações / actions.xml
<action actionid="2112" event="script" value="vipdoor.lua"/>
apenas para jogadores VIP Efeito
globalevents / scripts vipEffect.lua /
function onThink(interval, lastExecution)for _, name in ipairs(getOnlinePlayers()) do
local cid = getPlayerByName(name)
if getPlayerVipDays(cid) >= 1 then
doSendMagicEffect(getPlayerPosition(cid), 27)
doSendAnimatedText(getPlayerPosition(cid), "VIP!", TEXTCOLOR_RED)
end
end
return true
end
data/globalevents/globalevents.xml dados / globalevents / globalevents.xml
<globalevent name="vipEffect" interval="2" script="vipEffect.lua"/>
Funções
* getPlayerVipDays(cid) --- Use it to check how many vip days the player have. getPlayerVipDays (cid) --- Use-o para verificar quantos dias vip muitos, o jogador tem.
* doAddVipDays(cid, days) --- Use it to add vip days to someone. doAddVipDays (cid, dias) --- Use-o para adicionar dias vip para alguém.
* doRemoveVipDays(cid, days) --- Use it to remove vip days to someone. doRemoveVipDays (cid, dias) --- Use-a para remover vip dia para alguém.
creditos deste ultimo foi do kekox da otland net.
com isto a vip fucionou tranquilo resolvendo assim o problema de muitos que queriam deixar a premium pra todos free e ter players com vantagens pelo vip que agora e possivel pelo gesior xD!
bom pessoal agora tudo prontinho da use no item o nome vip aparece compra pelo site se otrna vip e pelo comando /vip add 30 nick o status vip tb fico ok no site uso o client 8.54 e o gesior e jogo acima citados.
meu site: http://blackout-pvp.servegame.com:8090/site atualizado...