Dankoo
Active Member
- Joined
- Sep 4, 2010
- Messages
- 1,007
- Reaction score
- 27
I have the following function on my Killing in the name of NPC:
What does it do:
When you have completed X tasks, he says the above sentences
What I would like it to do:
When you say "rank", it says your current rank
Any ideas about what might work?
Thanks!
eace:
LUA:
local rank = {
[1] = {need_points = 5, storage_value = -1, talkstate = 50},
[2] = {need_points = 10, storage_value = 0, talkstate = 51},
[3] = {need_points = 20, storage_value = 1, talkstate = 52},
[4] = {need_points = 30, storage_value = 2, talkstate = 53},
[5] = {need_points = 50, storage_value = 3, talkstate = 54}
}
for i = 1, #rank do
if msgcontains(msg, 'rank') then
if points >= rank[i].need_points and promote == rank[i].storage_value then
if rank[i].need_points == 5 then
selfSay("Welcome back "..getCreatureName(cid)..". You have completed 5 tasks for our society. Ask me for a {promotion} to advance your rank!", cid)
elseif rank[i].need_points == 10 then
selfSay("Welcome back "..getCreatureName(cid)..". You have completed 10 tasks for our society. Ask me for a {promotion} to advance your rank!", cid)
elseif rank[i].need_points == 20 then
selfSay("Salutations "..getCreatureName(cid)..". You have completed 20 tasks for our society. Ask me for a {promotion} to advance your rank!", cid)
elseif rank[i].need_points == 30 then
selfSay("Welcome back "..getCreatureName(cid)..". You have completed 30 tasks for our society. Ask me for a {promotion} to advance your rank!", cid)
elseif rank[i].need_points == 50 then
selfSay("By the gods....50 hunting tasks....this is austoding! Ask me for a {promotion} to advance your rank! And while you are here, I also have another special task for you.", cid)
end
talkState[talkUser] = rank[i].talkstate
end
end
end
What does it do:
When you have completed X tasks, he says the above sentences
What I would like it to do:
When you say "rank", it says your current rank
Any ideas about what might work?
Thanks!