handert
New Member
- Joined
- Nov 14, 2010
- Messages
- 4
- Reaction score
- 0
Good people, I have a little problem in the script Experience Scroll that is in the folder Mods.
(For Mods because this script is inside the folder Mods and doing joint with a XML file).
- My case is the following, I have this script below that it is a card that triples the experience of the player for 10 days, and I need that only people who have Premium Accounts able to use this card, if someone can help me would be very grateful.!
-Information Server:
Tibia 8.60
DLLS: (Inform not know for sure, but what use is that of the famous Baiak Otproject.)
*Mods/expscroll.xml
*Mods/script/expstagescroll.lua
NOTE: This script is not of my own, he was caught in another forum Tibia Servers, which was not put to why I can not remember the author, remember the forum, but through doubt will not put because I think that does not match with the rules of this forum.![Big Grin :D :D](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
(For Mods because this script is inside the folder Mods and doing joint with a XML file).
- My case is the following, I have this script below that it is a card that triples the experience of the player for 10 days, and I need that only people who have Premium Accounts able to use this card, if someone can help me would be very grateful.!
-Information Server:
Tibia 8.60
DLLS: (Inform not know for sure, but what use is that of the famous Baiak Otproject.)
*Mods/expscroll.xml
PHP:
<?xml version="1.0" encoding="UTF-8"?><mod name="Gold Cad Experience" version="1.0" author="TomCrusher" contact="otland.net" enabled="yes"> <action itemid="9004" event="script" value="expstagescroll.lua"/> <creatureevent type="think" name="ExpStage" event="script" value="expstagescroll.lua"/> <creatureevent type="login" name="ExpStageLogin" event="script" value="expstagescroll.lua"/></mod>
*Mods/script/expstagescroll.lua
PHP:
local config = { rate = 2,
storage = 1000,
expstorage = 1100,
register = 1200,
time = 864000,
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerStorageValue(cid, config.storage) <= 0 then
local rates = getPlayerRates(cid)
setPlayerStorageValue(cid, config.expstorage, rates[SKILL__LEVEL])
setPlayerStorageValue(cid, config.register, 1)
itemEx=itemid == 9004
doCreatureSay(cid, "Você ativou seu Gold Card Experience! Sua experience foi almentada em : 3x.", TALKTYPE_ORANGE_1, true, cid)
setPlayerStorageValue(cid, config.storage, os.time()+config.time)
doPlayerSetExperienceRate(cid, rates[SKILL__LEVEL]+config.rate)
doRemoveItem(item.uid,1)
registerCreatureEvent(cid, "ExpStage")
else
doCreatureSay(cid, "Você já ativou 1 card, espere ele terminar para usar outro!", TALKTYPE_ORANGE_1, true, cid)
end
return true
end
function onThink(cid, interval)
if getPlayerStorageValue(cid, config.register) == 1 then
if getPlayerStorageValue(cid, config.storage) <= os.time() then
doCreatureSay(cid, "Seu Gold Card Experience acabaou! Sua experience rate voltou ao normal.", TALKTYPE_ORANGE_1, true, cid)
setPlayerStorageValue(cid, config.storage, 0)
setPlayerStorageValue(cid, config.register, 0)
local oldexp = getPlayerStorageValue(cid, config.expstorage)
doPlayerSetExperienceRate(cid, oldexp)
unregisterCreatureEvent(cid, "ExpStage")
end
end
return true
end
function onLogin(cid)
if getPlayerStorageValue(cid, config.register) == 1 then
registerCreatureEvent(cid, "ExpStage")
local rates = getPlayerRates(cid)
doCreatureSay(cid, "Seu experience rate ainda está 3x mais alta que o normal.", TALKTYPE_ORANGE_1, true, cid)
if getPlayerStorageValue(cid, config.storage) > os.time() then
local oldexp = getPlayerStorageValue(cid, config.expstorage)
doPlayerSetExperienceRate(cid, oldexp+config.rate)
end
end
return true
end
NOTE: This script is not of my own, he was caught in another forum Tibia Servers, which was not put to why I can not remember the author, remember the forum, but through doubt will not put because I think that does not match with the rules of this forum.