• 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!

Modify Reward script

Guerra

New Member
Joined
May 1, 2018
Messages
57
Reaction score
2
Location
Natal/RN - Brasil
Hello guys,

I would like to ask for help to modify a script of mine. My system is simple, but it has some peculiarities. It is a normal quest reward, but the name of the quester is recorded on the item.

What I would like to do:

1º add to the script the option to choose whether the prize the player will receive is item, outfit, mount or experience.
2º and that I can choose different prizes for each vocation of my server.

Below I will post the script that I use, so if anyone can help me modify it I appreciate it very much.

Lua:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local queststatus = player:getStorageValue(30049)
    if queststatus == -1 then
        player:sendTextMessage(MESSAGE_INFO_DESCR, "Parabens, voce achou um tesouro.")
        local quest = player:addItem(31432, 1)
        quest:setAttribute(ITEM_ATTRIBUTE_DESCRIPTION, "Esse item foi obtido por "..player:getName()..".")
        player:setStorageValue(30049, 1)   
    else
        player:sendTextMessage(MESSAGE_INFO_DESCR, "Voce ja pegou seu premio.")
    end
    return true
end
 

Ramirow

Advanced OT User
Joined
Aug 22, 2009
Messages
533
Solutions
15
Reaction score
237
Location
Argentina
How do you want the player to choose the reward? Via multiple chests (Like Annihilator does)?
I assume the only difference between vocations will be the item chosen and mount, experience or outfit will be the same for all, is that right?
 
OP
Guerra

Guerra

New Member
Joined
May 1, 2018
Messages
57
Reaction score
2
Location
Natal/RN - Brasil
How do you want the player to choose the reward? Via multiple chests (Like Annihilator does)?
I assume the only difference between vocations will be the item chosen and mount, experience or outfit will be the same for all, is that right?
my server has several classes. So that I don't have to make several chests, I would like to centralize everything in one code, you know? to be able to choose between various types of prizes (outfits, mounts, items, experience, etc.). In addition to being able to choose what each vocation will receive and the items received have the name of the player who completed the quest in his description. Like the code I posted above.

Obs: the topic below gives an initial idea of what it would be like, but with the difference of being able to choose what each class would receive and the items come with the name engraved in the description.
 
Last edited:
Top