* Autor: JDB [/tp]; Eu [teleportes]; Kekox [VIP SYSTEM]
* Servidor: testado: TFS 0.3.6; TFS 0.4 dev 4069 + data 4029
* SCRIPTS: TalkAction, Action, CreatureScript, Moviment, GlobalEvent.
Primeiro de tudo, vá a database do servidor, provavelmente localhost/phpmyadmin, e execute o seguinte comando na aba MySQL:
ALTER TABLE `accounts` ADD `vipdays` int(11) NOT NULL DEFAULT 0;
Agora adicione isso no topo de data/lib/function.lua:
--- Vip functions by Kekox function 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
Agora adicione essa linha aonde diz o mesmo começo da script no data/creaturescript/login.lua:
registerCreatureEvent(cid, "VipCheck")
Agora vá ao data/creaturescript/scripts e crie um novo arquivo chamado vipcheck.lua:
--- Script by Kekox function onLogin(cid) if getPlayerVipDays(cid) >= 1 then doPlayerSendTextMessage(cid, 19, "You have ".. getPlayerVipDays(cid) .." vip days left.") end return true end
data/creaturescript/creaturescript.xml
<event type="login" name="VipCheck" event="script" value="vipcheck.lua"/>
Vá ao data/globalevents/scripts/, crie um novo arquivo e renomeio para daysremover.lua :
--- Script by Kekox function onTimer() db.executeQuery("UPDATE accounts SET vipdays = vipdays - 1 WHERE vipdays > 0;") return true end
data/globalevents/globanevents.xml :
<globalevent name="VipDaysRemover" time="00:01" event="script" value="daysremover.lua"/>
Agora você pode alterar o momento do dia em que a vip vai ser removida no (time="00:01").
Se você tiver mais de um dia de vip você vai receber a mensagem:
Creditos do VIP System: Kekox num site de ots estrangeiro; lá tem mais scripts para vip.
Agora aos teleports.
Esses teleportes foram adicionados para o MAPA GLOBAL, qualquer um superior a versão 8.54 deve pegar.
É um comando que exige que o player seja premium, ou vip.
vá no data\talkactions\scripts, e adicione um arquivo.lua chamado de teleport.lua
local destinations = { ["Yalahar"] = {p = {x=585, y=676, z=7}, l = 10, c = 100, v = 2}, ["Carlin"] = {p = {x=32360, y=31782, z=7}, l = 10, c = 100, v = 3}, ["Ab'dendriel"] = {p = {x=32732, y=31634, z=7}, l = 10, c = 100, v = 4}, ["Kazordoon"] = {p = {x=32649, y=31925, z=11}, l = 10, c = 100, v = 5}, ["Thais"] = {p = {x=32369, y=32241, z=7}, l = 10, c = 100, v = 6}, ["Venore"] = {p = {x=32957, y=32076, z=7}, l = 10, c = 100, v = 7}, ["Darashia"] = {p = {x=33214, y=32453, z=7}, l = 10, c = 100, v = 8}, ["Ankrahmun"] = {p = {x=33194, y=32853, z=8}, l = 10, c = 100, v = 9}, ["Edron"] = {p = {x=33217, y=31814, z=8}, l = 10, c = 100, v = 10}, ["Port Hope"] = {p = {x=32595, y=32745, z=7}, l = 10, c = 100, v = 11}, ["Ethno"] = {p = {x=32028, y=31919, z=7}, l = 10, c = 100, v = 12}, ["Libert Bay"] = {p = {x=32317, y=32825, z=7}, l = 10, c = 100, v = 13}, ["Svarground"] = {p = {x=32302, y=31186, z=7}, l = 10, c = 100, v = 14}, ["Cormaya"] = {p = {x=33297, y=31984, z=7}, l = 10, c = 100, v = 15}, ["Gengia"] = {p = {x=32035, y=32169, z=5}, l = 10, c = 100, v = 16}, ["Galaxy"] = {p = {x=31583, y=31821, z=5}, l = 10, c = 100, v = 17}, ["MTSCYC"] = {p = {x=32449, y=32103, z=7}, l = 10, c = 100, v = 18}, ["OC"] = {p = {x=32655, y=32343, z=7}, l = 10, c = 100, v = 19}, ["DC"] = {p = {x=32657, y=32343, z=7}, l = 10, c = 100, v = 20}, ["POH"] = {p = {x=32816, y=32264, z=6}, l = 10, c = 100, v = 21}, ["VRNO"] = {p = {x=32699, y=32019, z=7}, l = 10, c = 100, v = 22}, ["VTNO"] = {p = {x=32663, y=31965, z=7}, l = 10, c = 100, v = 23}, ["DB"] = {p = {x=32626, y=31974, z=7}, l = 10, c = 100, v = 24}, ["CAC"] = {p = {x=32429, y=31600, z=7}, l = 10, c = 100, v = 25}, ["GL"] = {p = {x=32190, y=31782, z=7}, l = 10, c = 100, v = 26}, ["MC"] = {p = {x=32604, y=31838, z=7}, l = 10, c = 100, v = 27}, ["DLV"] = {p = {x=32797, y=32152, z=7}, l = 10, c = 100, v = 28}, ["VSTC"] = {p = {x=32938, y=32219, z=7}, l = 10, c = 100, v = 29}, ["ST"] = {p = {x=33098, y=32131, z=7}, l = 10, c = 100, v = 30}, ["ACV"] = {p = {x=32837, y=31927, z=7}, l = 10, c = 100, v = 31}, ["UR"] = {p = {x=32872, y=31772, z=7}, l = 10, c = 100, v = 32}, ["OCV"] = {p = {x=32827, y=31737, z=7}, l = 10, c = 100, v = 33}, ["WDK"] = {p = {x=32673, y=31883, z=7}, l = 10, c = 100, v = 34}, ["ADM"] = {p = {x=32579, y=31682, z=7}, l = 10, c = 100, v = 35}, ["AKSL1"] = {p = {x=33072, y=32761, z=7}, l = 10, c = 100, v = 36}, ["AKSL2"] = {p = {x=33257, y=32743, z=7}, l = 10, c = 100, v = 37}, ["DSR"] = {p = {x=33226, y=32302, z=7}, l = 10, c = 100, v = 38}, ["DSM"] = {p = {x=33301, y=32291, z=7}, l = 10, c = 100, v = 39}, ["AKD"] = {p = {x=33117, y=32608, z=7}, l = 10, c = 100, v = 40}, ["TCC"] = {p = {x=32417, y=32378, z=7}, l = 10, c = 100, v = 41}, ["FBD"] = {p = {x=32189, y=32426, z=9}, l = 10, c = 100, v = 42}, ["MWT"] = {p = {x=32417, y=32139, z=15}, l = 10, c = 100, v = 43}, ["MTSCV"] = {p = {x=32452, y=32067, z=8}, l = 10, c = 100, v = 44}, ["BKV"] = {p = {x=32823, y=31968, z=9}, l = 10, c = 100, v = 45}, } function onSay(cid, words, param, channel) local tp = destinations[param] if(param == "") then doPlayerSendCancel(cid, "Command param required.") return true end if(getPlayerMoney(cid) < tp.c) then doPlayerSendCancel(cid, "You do not have enough money.") elseif(getPlayerLevel(cid) < tp.l) then doPlayerSendCancel(cid, "Your level is not high enough.") elseif(isPlayerPzLocked(cid) == true) then doPlayerSendCancel(cid, "You are currently in a fight.") elseif(getPlayerPremiumDays(cid) < 1) then doPlayerSendCancel(cid, "You must have premium.") else doPlayerRemoveMoney(cid, tp.c) doTeleportThing(cid, tp.p) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have successfully teleported to ".. param ..".") end return true end
Cada um custa 100gold, e é para nivel 10, você pode alterar isso e adicionar outros pontos se quiser.
agora adicione o seguinte no talkactions.xml:
<talkaction log="no" words="/tp" access="0" event="script" value="teleport.lua"/>
Codigo e local respectivo para o comando /tp:
[spoiler=Teleport Places]
CIDADES
Yalahar
Carlin
Ab'dendriel
Kazordoon
Thais
Venore
Darashia
Ankrahmun
Edron
Port Hope
Ethno
Libert Bay
Svarground
Cormaya
Gengia
Galaxy
TP CODE SEM [] | AREAS DE HUNT
[MTSCYC] Mount Sternum CYC (thais cyc montanha)
[MTSCV] Mount Sternum Cave ( CUIDADO )
[OC] Outlaw Camp
[DC] Dark Cathedral
[POH] POH
[VRNO] Noroeste de Venore Rotworm
[VTNO] Noroeste de Venore Trolls
[DB] Dwarven Bridge
[CAC] Carlin Amazon camp
[GL] Ghostland
[MC] Montanha Carlin
[DLV] D Lair Venore
[VSTC] Venore Swamp Troll Camp
[sT] Shadowthorn (elf camp venore)
[ACV] Amazon Camp Venore
[uR] Ulderek's Rock (Orc Fortress)
[OCV] Orc Camp venore ( CUIDADO )
[WDK] Wyvern e Dragon Kazz
[ADM] Ab'dendriel monsters
[AKSL1] Ankrahmun Scarab & Larva 1
[AKSL2] Ankrahmun Scarab & Larva 2
[DSR] Darashia Rotworm
[DSM] Darashia Minotaur
[AKD] Ankrahmun Dragon
[TCC] Thais Cyc Camp ( CUIDADO )
[FBD] Fibula Dungeon
[MWT] Mintwallin (thais mino/gs/dl..)
[bKV] Black Knight's Villa
Credito da action de teleport: JDB, credito aos locais: Guiaki.
Espero que tenha ajudado \o/