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

[TFS 0.3.7] Task NPC (Solved)

juansanchez

Intermediate OT User
Joined
Apr 2, 2015
Messages
217
Reaction score
130
Hello Otland People, as the title says, i need a task NPC, however this NPC needs to set a player storage after he's done with the task so he can go to a new Area in the map.

So basically, what i need is, the Npc asks the player to Kill a certain amount of 3 Monsters, after the player is done with that, he's able to go trough a specific tile which can only be crossed if a player has the task completed.

I'm using TFS 0.3.7 as in the title.
 
The onStepIn tile is easy enough to accomplish.
https://otland.net/threads/234306/page-14#post-2330703
Basically you just find the storage value that is used for the quest.
In my above example, when a task is completed the storage is set to 2.
Once you know the storage value, you simply make the onStepIn script based on the storage.

Using the above Task NPC as an example, here is a script for the completed Wasps, task.
Code:
local storage = 45003
local storage_value = 2

function onStepIn(cid, item, position, fromPosition)
    if not isPlayer(cid) then
        return true
    end
    if getPlayerStorageValue(cid, storage) < storage_value then
        doPlayerSendCancel(cid, "Requires completed quest to access this area.")
        doTeleportThing(cid, fromPosition, true)
    end
    return true
end
 
@Xikini, the stepIn tile worked, the npc task kind of worked, i have killed way past the amount of monsters (50), and when i go deliver the task to the npc, he says i haven't killed enough. Btw, can you make something that shows how many you have killed? Like a blue message in the Default channel, that says like [Demon Task (0/50)]
 
@Xikini, the stepIn tile worked, the npc task kind of worked, i have killed way past the amount of monsters (50), and when i go deliver the task to the npc, he says i haven't killed enough. Btw, can you make something that shows how many you have killed? Like a blue message in the Default channel, that says like [Demon Task (0/50)]
Did you install the creaturescript in the following post?
https://otland.net/threads/234306/page-14#post-2330705
 
@Xikini, can i do like, the person needs to kill 100 Trolls, 100 Swamp Trolls and 100 Whatever Trolls but with the same storage? Not like the one the script has, where the person gets the troll task, and can kill whichever troll and it'll count as one. It's like, 3 different tasks but with the same storage.
 
Last edited:
@Xikini, can i do like, the person needs to kill 100 Trolls, 100 Swamp Trolls and 100 Whatever Trolls but with the same storage? Not like the one the script has, where the person gets the troll task, and can kill whichever troll and it'll count as one. It's like, 3 different tasks but with the same storage.
Yes of course.
Look at 'Rotworms' or 'Orcs' or 'Minotaurs' for reference. (creaturescript)

-- Edit
Looking back at your reply I think I misunderstood you.

Within the current script no.
You'd have to make alterations to the npc and the creaturescript to accommodate this.

-- Edit 2
Typically Task NPC's are very very generic and you cannot typically deviate from what's already there.
If you need something different it's not going to be the prettiest code to look at, where there is a giant table containing everything.
You'll most likely need to script each monster individually.

In this case you'd want to give out multiple storages, for each monster, and have the script count them individually inside another onKill event, which would then tell the player to return to the NPC once all the storages have successfully added to their limit.
 
Last edited:
@Xikini, could you help me out? I'm having trouble using the script you sent me, to do only 1 task. Let's say the npc only has rotworm task, i am able to make it so the npc only gives out the Rotworm task, asks you to kill the amount and come back, however when i kill the rotworm, it doesn't count to the task, nothing shows in the default. I did the creaturescripts just like the other one, but it's not working.


-Edit:

NVM, now i actually understood how the creaturescript script works :)
 
Last edited:
Back
Top Bottom