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

NPC [TFS 1.1] Monster Tasks

Hugofasima

Website: thenosegang.servegame.com
Joined
Jun 24, 2015
Messages
206
Best answers
0
Reaction score
22
You should get textmessages while you kill the monsters, if nothing happens, you can add print to the script to see if the server even loads the script.
Under function onKill: print("script load test")
If you don't get this message in your console when you kill something, it means the server isn't using the script, so make sure it's added correct and restart the server.
Limos, nothing happened... I really can't found anything wrong on installation! I did it 5 times already.

My distro on start up:
Code:
Compiled on May 14 2015 22:47:50 for platform x64

A server developed by Mark Samman
Visit our forum for updates, support, and resources: http://otland.net/.

>> Loading config
>> Establishing database connection... MySQL 6.1.6
>> Running database manager
>> Loading vocations
>> Loading items
>> Loading script systems
>> Loading monsters
>> Loading outfits
>> Checking world type... PVP
>> Loading map
> Map size: 3000x3000.
> Map loading time: 2.132 seconds.
> Loaded house items in: 0.002 s
>> Initializing gamestate
>> Loaded 280 npcs, spawned 18770 monsters.
Saving server...
> Saved house items in: 0.069 s
>> Fury Gate today is in Dorion.
>> Loaded all modules, server starting up...
>> Forgotten Server Online!

I also did what you said, I've added print("script load test") above onKill function, and the server isn't printing "script load test" on distro on kill. The server was reloaded for every change too! I trust your scripts, I know it is right. Just can't find what is wrong.

My TFS is 1.1 btw
 
OP
Limos

Limos

Premium User
Joined
Jun 7, 2010
Messages
10,018
Best answers
8
Reaction score
2,980
Location
Netherlands
Did you also restart the server? Sometimes reload doesn't work properly.
Add it under function onKill btw, everything between function onKill and the end that closes it is loaded every time you kill something, so if it's added correct, you should get that message.
If it still doesn't do anything, how did you added it, are the monster names without capitals?
 
Last edited:

Hugofasima

Website: thenosegang.servegame.com
Joined
Jun 24, 2015
Messages
206
Best answers
0
Reaction score
22
Did you also restart the server? Sometimes reload doesn't work properly.
Add it under function onKill btw, everything between function onKill and the end that closes it is loaded every time you kill something, so if it's added correct, you should get that message.
If it still doesn't do anything, how did you added it, are the monster names without capitals?
It is working now Limos!!!!!

I said it wrong. The server was restarted for every change. My monsters are without capitals too. The problem occurred because there were two login.lua files.


I've added 'player:registerEvent("Tasks")' in the wrong login.lua located at '...creaturescripts/scripts/others/login.lua'. (from by edited TFS 1.0; got confused...)

The correctly login.lua is located on '...creaturescripts/scripts/login.lua'.


Now it is printing on distro like you said it should happen (10 Dragons on test):
Code:
>> Forgotten Server Online!


Task Test has logged in.
script load test
script load test
script load test
script load test
script load test
script load test
script load test
script load test
script load test
script load test

Thanks for your patience Limos! :)
 

Sir Knighter

ArchlightOnline.com
Premium User
Joined
Jun 29, 2009
Messages
4,212
Best answers
0
Reaction score
1,278
Location
Canada
Do it then. I dare you. I just want a small one for repeating 3 tasks (from a specific npc, not the normal tasks npc)
 

Sir Knighter

ArchlightOnline.com
Premium User
Joined
Jun 29, 2009
Messages
4,212
Best answers
0
Reaction score
1,278
Location
Canada
Code:
     elseif monsters[cmsg] and npcHandler.topic[cid] == 1 then
         if player:getStorageValue(monsters[cmsg].storage) == -1 then
             npcHandler:say("Good luck, come back when you killed "..monsters[cmsg].amount.." "..cmsg..".", cid)
             player:setStorageValue(storage, 1)
             player:setStorageValue(monsters[cmsg].storage, -1)
         else
             npcHandler:say("You already did the "..cmsg.." mission.", cid)
         end
Like so?
 
OP
Limos

Limos

Premium User
Joined
Jun 7, 2010
Messages
10,018
Best answers
8
Reaction score
2,980
Location
Netherlands
At that part the NPC gives the mission, the NPC gives the reward at the part where the NPC says "Good job, here is your reward".
 

Ahead

New Member
Joined
Dec 27, 2013
Messages
165
Best answers
0
Reaction score
2
Exp given is multiplied by server rates or it's just net?.

Thanks!. Nice script <3
 
OP
Limos

Limos

Premium User
Joined
Jun 7, 2010
Messages
10,018
Best answers
8
Reaction score
2,980
Location
Netherlands
Exp given is multiplied by server rates or it's just net?.
The player will just get that amount of exp, if you want the exp to be multiplied based on exp stages you can do it like this.
Code:
player:addExperience(x.exp * Game.getExperienceStage(player:getLevel()))
 

Saffyto

L0l
Joined
Sep 11, 2008
Messages
301
Best answers
0
Reaction score
9
Location
Sweden
Limos How can i edite this to count dragons and dragon hatchling in the same task aswell?

" ['dragon'] = {amount = 10, storage = 19000, startstorage = 5010, startvalue = 1},"

i tried this:
['dragon'] ['dragon hatchling'] = {amount = 10, storage = 19000, startstorage = 5010, startvalue = 1}
['dragon' 'dragon hatchling'] = {amount = 10, storage = 19000, startstorage = 5010, startvalue = 1}

but doesnt work.. how it should work properly? could you help me?

thanks btw ;*
 
OP
Limos

Limos

Premium User
Joined
Jun 7, 2010
Messages
10,018
Best answers
8
Reaction score
2,980
Location
Netherlands
You can just add another line with dragon hatchling, then use the same storage.
For the textmessage to still say dragons instead of for example 5 dragon hatchlings killed when you killed 2 dragon hatchlings and 3 dragons, you can add name = 'Dragon' in the table and then in the textmessage.
Code:
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, 'Task message: '..(stor +1)..' of '..monster.amount..' '..(monster.name or target:getName())..'s killed.')
 

Saffyto

L0l
Joined
Sep 11, 2008
Messages
301
Best answers
0
Reaction score
9
Location
Sweden
Thanks Limos !
:D
@offtopic
Could you bring me some help in other thing not related about script?
I know you dont have all the time to help every people who ask you this but... if you accept we can make a deal.
I cant send you private messages
 

kozmo

Member
Joined
Jan 30, 2009
Messages
395
Best answers
0
Reaction score
13
Thanks for making this
your awesome :)
 
Last edited:

jumbaliah

New Member
Joined
Sep 8, 2015
Messages
1
Best answers
0
Reaction score
0
Is there a way to make it so that everyone who was attacking the monster will get a kill?
 

Lava Titan

Developer
Joined
Jul 25, 2009
Messages
1,510
Best answers
0
Reaction score
4
Location
Portugal
@Limos what storage does player get after complete first task?

I need to know storages so I can make 1 quest door for each task :X

like you complete first task u can do first quest, complete 2nd task u can do 2nd quest, etc...
 

Awesomedudei

Revolutionot.com
Joined
Jan 20, 2010
Messages
327
Best answers
0
Reaction score
69
Location
Sweden
Great work Limos, i managed to make them repeatable but id also like to have a cooldown on every task. How would i go about?
 
Top