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

Multiple tasks

Tamiko

Member
Joined
Sep 1, 2014
Messages
24
Reaction score
0
Hi! :)

I would like to have a script for NPC which gives specific tasks
TFS: 0.2.15

I want:
- to choose which missions I want at the moment by writing mission/task, and Npc shows me what I can choose from like: Dragons, Dragon Lords, Hydras, Demons, Lizards
- also they should be rewarded with gold some item and exp
- I would like to make it appear in Quest log like: You killed 20/200 dragons

lets say
1 mission/task 200 dragons
2 mission/task 500 dls
3 mission/task 500 hydras
4 mission/task 1000 demons
5 mission/task 1000 of different kind of lizards

I was trying to make it by my own.. but I just failed: This is the thread that I wanted to make my script after.. but its too complicated for me to change Npc who wants me to gather stuff to npc who wants me to kill stuff :( : http://otland.net/threads/collecting-items-missions.164797/

Please if someone knows how to do it do not hesitate to help :p
I would be super happy :oops:

Tamiko
 
Last edited:
[12/09/2014 13:46:54] Warning: [Event::checkScript] Event onKill not found. /scripts/vipkills.lua

Even tho I have script there! o_O
<event type="kill" name="VipKills" script="vipkills.lua"/>

Code:
local monsters = {
   ["One"] = {storage = 5010, mstorage = 19000, amount = 150, exp = 500, item = {2160, 50}},
   ["Two"] = {storage = 5011, mstorage = 19001, amount = 300, exp = 1000, item = {2160, 100}},
   ["Three"] = {storage = 5012, mstorage = 19002, amount = 600, exp = 8000, item = {2160, 100}},
   ["Four"] = {storage = 5013, mstorage = 19003, amount = 1200, exp = 7000, item = {2160, 100}},
   ["Five"] = {storage = 5014, mstorage = 19004, amount = 2500, exp = 10000, item = {2160, 100}},
   ["Six"] = {storage = 5015, mstorage = 19005, amount = 5000, exp = 100000, item = {2160, 100}}
}
 
Last edited:
ok I found

Code:
function onKill(cid, target)
     local monster = config[getCreatureName(target):lower()]
     if isPlayer(target) or not monster or isSummon(target) then
         return true
     end

     if (getPlayerStorageValue(cid, monster.storage)+1) < monster.amount and getPlayerStorageValue(cid, monster.startstorage) >= monster.startvalue then
         setPlayerStorageValue(cid, monster.storage, getPlayerStorageValue(cid, monster.storage) + 1)
         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Task message: '..(getPlayerStorageValue(cid, monster.storage)+1)..' of '..monster.amount..' '..getCreatureName(target)..'s killed.')
     end
     if (getPlayerStorageValue(cid, monster.storage)+1) == monster.amount then
         doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Congratulations, you have killed '..(getPlayerStorageValue(cid, monster.storage)+1)..' '..getCreatureName(target)..'s and completed the '..getCreatureName(target)..'s mission.')
         setPlayerStorageValue(cid, monster.storage, getPlayerStorageValue(cid, monster.storage) + 1)
     end
     return true
end
 
Last edited:
Now I am stuck on something else.. Whatever I choose from NPC:
14:10 Moric: I have several tasks for you to kill, ..., which one do you choose?

whatever I say..
Mission yes .. no response
task ..
one ..
nothing works he is stuck on ... I have several tasks for you to kill, ..., which one do you choose?



Edited. nvm .. this script is so annoying
It is just when I change info in script.. like for different mobs.. or add more.. somehow I cant choose anything from NPC.. but when i have exactly what you show with dragons it works.. lmao :( also it stucks on many things.. either he says all the time that I did ot kill mobs, which i just did.. or he does not give me any mission :;

nvm thank you for help im tired of these scripts .. so much time on it and it does not want to work +.+
 
Last edited:
Can you post the full scripts, the errors and what exactly happens ingame? Like for example what you say to the npc and what it says back and what should be different etc.
 
Back
Top