Lava Titan
Developer
i'm requesting a script for a item that adds onuse 150k mana but it can only be used one time per account...
ITEM ID: 7440
TFS: 0.3.5
Script type: Action script
ITEM ID: 7440
TFS: 0.3.5
Script type: Action script
if getPlayerStorageValue(cid, 40689) == -1 then
setPlayerMaxMana(cid, getPlayerMaxMana(cid) + 150000)
setPlayerStorageValue(cid, 40689, 1)
end
@Lava TitanLUA:if getPlayerStorageValue(cid, 40689) == -1 then setPlayerMaxMana(cid, getPlayerMaxMana(cid) + 150000) setPlayerStorageValue(cid, 40689, 1) end
one time per player this is. One time per account would be a bit silly but can be made with database changes.
<action itemid="7440" event="script" value="manaitem.lua"/>
function onUse(cid, item, frompos, item2, topos)
if getPlayerStorageValue(cid, 40689) == -1 then
setPlayerStorageValue(cid, 40689, 1)
setPlayerMaxMana(cid, getPlayerMaxMana(cid) + 150000)
return true
end
return false
end
function onUse(cid, item, frompos, item2, topos)
if getPlayerStorageValue(cid, 40689) == -1 then
setPlayerStorageValue(cid, 40689, 1)
doCreatureAddMana(cid, 150000)
return true
end
return false
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
setCreatureMaxMana(cid, (getCreatureMaxMana(cid) + 150000)) then
doCreatureSay(cid, "You gained 150,000 Max Mana Points, now your health is ".. getCreatureMaxMana(cid) .."!" ,19)
return doRemoveItem(item.uid)
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerLevel(cid) >= 1000 then
setCreatureMaxMana(cid, (getCreatureMaxMana(cid) + 150000)) then
doCreatureSay(cid, "You gained 150,000 Max Mana Points, now your health is ".. getCreatureMaxMana(cid) .."!" ,19)
doRemoveItem(item.uid)
else
doPlayerSendCancel(cid, "Your level is not high enough.")
end
return TRUE
end
@Elizabeth:shut up elizabeth
Guys the script doesnt work it says "You cannot use this item."
local cfg =
{
level = 1000,
itemid = 7440,
newMana = 150000
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if (item.itemid == cfg.itemid) then
if getPlayerLevel(cid) >= cfg.level then
setCreatureMaxMana(cid, (getCreatureMaxMana(cid)+cfg.newMana))
doSendAnimatedText(getCreaturePosition(cid), "MANA!",TEXTCOLOR_RED)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS)
doCreatureSay(cid, "You have recieved ".. cfg.newMana .." extra mana points, now your mana is ".. getCreatureMaxMana(cid) .."!", TALKTYPE_ORANGE_1)
doRemoveItem(item.uid)
else
doPlayerSendCancel(cid, "Your level is not high enough.")
end
return TRUE
end
end
LUA:local cfg = { level = 1000, itemid = 7440, newMana = 150000 } function onUse(cid, item, fromPosition, itemEx, toPosition) if (item.itemid == cfg.itemid) then if getPlayerLevel(cid) >= cfg.level then setCreatureMaxMana(cid, (getCreatureMaxMana(cid)+cfg.newMana)) doSendAnimatedText(getCreaturePosition(cid), "MANA!",TEXTCOLOR_RED) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS) doCreatureSay(cid, "You have recieved ".. cfg.newMana .." extra mana points, now your health is ".. getCreatureMaxMana(cid) .."!", TALKTYPE_ORANGE_1) doRemoveItem(item.uid) else doPlayerSendCancel(cid, "Your level is not high enough.") end return TRUE end end
local cfg =
{
level = 1000,
itemid = 7440,
newMana = 150000,
storage = 1000
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if (item.itemid == cfg.itemid) then
if getPlayerLevel(cid) >= cfg.level and getPlayerStorageValue(cid, cfg.storage) == -1 then
setCreatureMaxMana(cid, (getCreatureMaxMana(cid)+cfg.newMana))
doSendAnimatedText(getCreaturePosition(cid), "MANA!",TEXTCOLOR_RED)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS)
doCreatureSay(cid, "You have recieved ".. cfg.newMana .." extra mana points, now your health is ".. getCreatureMaxMana(cid) .."!", TALKTYPE_ORANGE_1)
doRemoveItem(item.uid)
setPlayerStorageValue(cid, cgf.storage, 1)
else
doPlayerSendCancel(cid, "Your level is not high enough.")
end
return TRUE
end
end
local cfg =
{
level = 1000,
itemid = 7440,
newMana = 150000
}
local storage = 14565
function onUse(cid, item, fromPosition, itemEx, toPosition)
if (item.itemid == cfg.itemid) then
if getPlayerLevel(cid) >= cfg.level then
if getPlayerStorageValue(cid, storage) == -1 then
setCreatureMaxMana(cid, (getCreatureMaxMana(cid)+cfg.newMana))
setPlayerStorageValue(cid, storage, 1)
doSendAnimatedText(getCreaturePosition(cid), "MANA!",TEXTCOLOR_RED)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS)
doCreatureSay(cid, "You have recieved ".. cfg.newMana .." extra mana points, now your mana is ".. getCreatureMaxMana(cid) .."!", TALKTYPE_ORANGE_1)
doRemoveItem(item.uid)
else
doPlayerSendCancel(cid, "You have already used this before.")
end
else
doPlayerSendCancel(cid, "Your level is not high enough.")
end
return TRUE
end
end