demon088
#088 in the Horde
Hello OtLand!
I wanted to share this action script that I have written with other scripts posted in this site. Review it and if someone wants to use, it would be cool! I'm using TFS 1.2 and it is working fine!
It is useful to make this a random reward box. In my own OTS I use 6 different items with rewards from different levels, this one is in the middle and gives equipment from all vocations. If you have any issue, suggestion or improvement, please leave your comments, It would be fun to work on it and share with you all!
To add it to your own server just follow the next:
Add to
Then create
Script:
Q: How this works?
A: It works giving one random item from 'REWARD', but also you have 5% to receive an additional item from 'REWARD', then you have also 10% chance to get an amulet, a ring or an accesory from 'JEWEL'.
I have also included in my own OTS [TFS 1.1] Item's upgrading by jewels and i added also a small chance to get the upgrading item. This is a good item for quests and provides that spicy fact on getting better items with luck. I hope you could enjoy it and expect good feedback from you! If someone else have worked on similar systems, please comment!
NOTE: This has not been tested in older TFS versions. If it works let me know!
I wanted to share this action script that I have written with other scripts posted in this site. Review it and if someone wants to use, it would be cool! I'm using TFS 1.2 and it is working fine!
It is useful to make this a random reward box. In my own OTS I use 6 different items with rewards from different levels, this one is in the middle and gives equipment from all vocations. If you have any issue, suggestion or improvement, please leave your comments, It would be fun to work on it and share with you all!
To add it to your own server just follow the next:
Add to
data/actions/actions.xml
Code:
<action itemid="4863" script="randomreward.lua"/>
Then create
actions/scripts/randomreward.lua
Script:
Lua:
local REWARD = {2471, 2496, 2343, 7902, 18398, 8868, 8867, 15489, 12643, 8887, 8886, 8885, 8877, 8878, 15407, 8884, 8881, 12607, 8889, 8865, 8890, 6132, 11117, 11118, 11240, 9933, 2358, 9777, 18405, 2469}
local JEWEL = {2171, 2661, 2168, 2214, 2165, 2213, 2207, 2169, 2122, 2127, 2124, 2121, 7697, 13825, 6300}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local randomChance = math.random(2, #REWARD)
doPlayerAddItem(cid, REWARD[randomChance], 1)
local randomLoot = math.random(1,20)
if randomLoot == 1 then
doPlayerSendTextMessage(cid, 19, "You found an extra item!")
local randomChance = math.random(2, #REWARD)
doPlayerAddItem(cid, REWARD[randomChance], 1)
end
local randomJewel = math.random(1,10)
if randomJewel == 1 then
doPlayerSendTextMessage(cid, 19, "You found a jewel!")
local randomChance = math.random(2, #JEWEL)
doPlayerAddItem(cid, JEWEL[randomChance], 1)
end
doSendMagicEffect(getPlayerPosition(cid), 73)
doRemoveItem(item.uid, 1)
return true
end
A: It works giving one random item from 'REWARD', but also you have 5% to receive an additional item from 'REWARD', then you have also 10% chance to get an amulet, a ring or an accesory from 'JEWEL'.
I have also included in my own OTS [TFS 1.1] Item's upgrading by jewels and i added also a small chance to get the upgrading item. This is a good item for quests and provides that spicy fact on getting better items with luck. I hope you could enjoy it and expect good feedback from you! If someone else have worked on similar systems, please comment!
NOTE: This has not been tested in older TFS versions. If it works let me know!