• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Max Skills!

Trader

New Member
Joined
Aug 12, 2009
Messages
219
Reaction score
2
Hello,
Can any help me with making a chest box giving you max skills or a certain set ammount skill, for example if you use it, you get 192 skills in a skill of your choice (sword, axe, club) and I would also like it for magic level too (Add "X" number of ml's)

Thanks rep+!
 
Here it is man...

*data/actions/scripts
skillchest.lua
PHP:
function onUse(cid, item, frompos, item2, topos)

local config = {
               [9991] = {name="level", value=100, cost=0, id=8},
               [9992] = {name="magic level", value=100, cost=0, id=7},
               [9993] = {name="axe", value=100, cost=0, id=3},
               [9994] = {name="club", value=100, cost=0, id=1},
               [9995] = {name="sword", value=100, cost=0, id=2},
               [9996] = {name="fist", value=100, cost=0, id=0},
               [9997] = {name="shielding", value=100, cost=0, id=5},
               [9998] = {name="fishing", value=100, cost=0, id=6},
               [9999] = {name="distance", value=100, cost=0, id=4}
               }

if getPlayerMoney(cid) >= config[item.uid].cost then
doPlayerAddSkillTry(cid, config[item.uid].id, config[item.uid].value)
doPlayerSendTextMessage(cid, 25, "You gained " .. config[item.uid].value .. " of " .. config[item.uid].name .. " for " .. config[item.uid].cost .. " gold coins.")
doSendMagicEffect(frompos, math.random(1, 10))
doPlayerRemoveMoney(cid, config[item.uid].cost)
else
doPlayerSendTextMessage(cid, 20, "You need " .. config[item.uid].cost .. " gold coins to gain " .. config[item.uid].value .. " of " .. config[item.uid].name .. ".")
doSendMagicEffect(frompos, 2)
return true
end

return true
end

*data/actions/actions.xml
PHP:
<action fromuid="9991" touid="9999" event="script" value="skillchest.lua"/>

The explanation...
Put Unique IDs in the following chests:
PHP:
UID 9991 -- For gain level
UID 9992 -- For gain ML skill
UID 9993 -- For gain axe skill
UID 9994 -- For gain club skill
UID 9995 -- For gain sword skill
UID 9996 -- For gain fist skill
UID 9997 -- For gain shield skill
UID 9998 -- For gain fishing skill
UID 9999 -- For gain distance skill

Change the config, according to you:
PHP:
~~ value = 100 -- Here how much the player will gain when click on the chest.
~~ cost = 0 -- Here how much the player will need to pay for using the chest(or another item).
~~ Don't change anything else, otherwise it will be bugged.

Hey dude, I didn't put anything about storages, so, if the player want to click more than one time, he will be able to. If you want with storage, post here and I edit...
Intending to have helped... Rep++ pls... ;D
 
to make it use storage put this

Code:
if getPlayerMoney(cid) >= config[item.uid].cost and (getPlayerStorageValue(cid,[COLOR="RoyalBlue"][U]XXXX[/U][/COLOR]) == -1) then
doPlayerAddSkillTry(cid, config[item.uid].id, config[item.uid].value)
doPlayerSendTextMessage(cid, 25, "You gained " .. config[item.uid].value .. " of " .. config[item.uid].name .. " for " .. config[item.uid].cost .. " gold coins.")
doSendMagicEffect(frompos, math.random(1, 10))
doPlayerRemoveMoney(cid, config[item.uid].cost)
else
doPlayerSendTextMessage(cid, 20, "You already completed this quest.")
doSendMagicEffect(frompos, 2)
return true
end

change the storage value you want its underlined in blue and it should work
 
Back
Top