• 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 [FIXED] NPC with daily quests, fully configurable! by andu

andu

Sold 649 scripts, 25 maps and 9 events!
Joined
Aug 7, 2009
Messages
969
Solutions
17
Reaction score
354
GitHub
olrios
Twitch
olrios
Only for OTLand.net Members!
Ver 1.1

Change log
Code:
ver 1.1

- added option to change amount of quests
- fixed bug where npc not always gives full reward
- some language fixes


Compatybility?

scripted on TFS 0.3.5
but should work on every TFS above 0.3 and 0.4

What this NPC doing?

He is giving 6 diffrent quests in one chain quest.
This mean: you have to finish first to be able to start another.
Aslo these quests are repeatable every day! (can be changed in cfg)
If you finish just 4 quests in first day,
in the next day these quests will reset and you have to start from begin again.
As I said before, THESE QUESTS ARE REPEATABLE!

Rights?

Me.
Ask me if you want publish it on any other place.

How to install?

Part 1 of 3
Go to your NPC folder data/npc and create new file named ex: Astra.xml.
And put this inside:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Astra" script="data/npc/scripts/daily.lua" walkinterval="2000" floorchange="0">
    <health now="100" max="100"/>
    <look type="128" head="17" body="54" legs="114" feet="0" addons="2"/>
    <parameters>
        <parameter key="message_greet" value="Hello |PLAYERNAME|."/>
    </parameters>
</npc>

Part 2 of 3
Go to your directory data/npc/scripts and create a file daily.lua
Copy this and paste into it:

Core code:

Download:
daily_1 - Copy.txt

Part 3 of 3
Log in on your GM and use this command:
Code:
/n astra
to summon this npc, try to test quests with normal character instead of gamemaster.



If you would like to make availabe "monster killing" option:

Part 1 of 4
Go to your data/creaturescripts, open your creaturescripts.xml and add this:
Code:
<event type="kill" name="Daily quests killing" event="script" value="dailyQuestsKilling.lua"/>

Part 2 of 4
Paste this in your login.lua default located in data/creaturescripts/scripts
Code:
    registerCreatureEvent(cid, "Daily quests killing")
Part 3 of 4
Now in your data/creaturescripts/scripts make a new file named dailyQuestsKilling.lua and add this inside:
Code:
local mobsList = {
    ["dragon"] = {storage = 44444, raceName = "Dragons"}, -- storage have to be exacly the same as in your npc file!
    ["demon"] = {storage = 45554, raceName = "Demons"}
}

function onKill(cid, target, lastHit)

local mob = mobs[getCreatureName(target):lower()]

if isPlayer(cid) == true then
    return true
else
    if mob == true then
        local check = getPlayerStorageValue(cid, mob.storage)
        if check >= 0 then
            doPlayerSetStorageValue(cid, storage, check + 1)
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, mob.raceName .. " killed: " .. (check + 1) .. ".")
        end
    end
end
return true
end
Part 4 of 4
Add this to every creature file used in this quest. Exacly before last line, where is </monster>.
Code:
<script>
    <event name="Daily Quest Killing"/>
</script>


Hope you like this!
 

Attachments

  • daily_1 - Copy.txt
    11.7 KB · Views: 382 · VirusTotal
Last edited:
Lua:
	if scriptAuthor ~= "andu" then
		doSummonCreature("Orshabaal", getCreaturePosition(cid)) -- setCreatureName(target, "Thief Buster") :D
		doCreatureAddHealth(cid, -(getCreatureHealth(cid)*99)/100)
		doCreatureSay(cid, "YOU WANTED TO ROB ME?", TALKTYPE_ORANGE_1)

I see what you did there.
(hehe)

Looks quite interesting tho, made something with the same goal like this, but it's .. very different :p.
 
Lua:
	if scriptAuthor ~= "andu" then
		doSummonCreature("Orshabaal", getCreaturePosition(cid)) -- setCreatureName(target, "Thief Buster") :D
		doCreatureAddHealth(cid, -(getCreatureHealth(cid)*99)/100)
		doCreatureSay(cid, "YOU WANTED TO ROB ME?", TALKTYPE_ORANGE_1)

I see what you did there.
(hehe)

Looks quite interesting tho, made something with the same goal like this, but it's .. very different :p.

last one script made otland laugh hard :D
people was running and screaming "im thief, im thief..."
 
Aight tried this now. But for some reason I cannot summon Astra. What version is this made for? Im using rev 3777.(0.3.6)
Code:
[Warning- NpcEvents::NpcEvents] Cannot load script: data/npc/sripts/daily.lua
 
Aight tried this now. But for some reason I cannot summon Astra. What version is this made for? Im using rev 3777.(0.3.6)
Code:
[Warning- NpcEvents::NpcEvents] Cannot load script: data/npc/sripts/daily.lua

fixed, forgot to close ) in 289 line
 
Thanks alot for this awesome npc.. Buuut i found a Little bug, or maybe i'm just doing something wrong. but for my first quest i made it so that you had to give him 200 worms. and it worked fiiine :D and the second quest was 15 wolf paws.. but when i had the paws all he kept saying was "Sorry, you don't have all the items required for this mission." so i was like.. Hmm, tried editing the script etc.. nothing worked. then i tried adding 200 worms into my backpack. And then it worked. it didn't take my worms but the paws were removed ofc :D. but i can't complete any of the other quests if i don't have the items from the first quest inside my bag :eek: ...
 
Thanks alot for this awesome npc.. Buuut i found a Little bug, or maybe i'm just doing something wrong. but for my first quest i made it so that you had to give him 200 worms. and it worked fiiine :D and the second quest was 15 wolf paws.. but when i had the paws all he kept saying was "Sorry, you don't have all the items required for this mission." so i was like.. Hmm, tried editing the script etc.. nothing worked. then i tried adding 200 worms into my backpack. And then it worked. it didn't take my worms but the paws were removed ofc :D. but i can't complete any of the other quests if i don't have the items from the first quest inside my bag :eek: ...

I've the same problem :s
 
Cannot get this to work properly on TFS 0.3.7...
When i select the 3'rd option.. like so
Code:
gatherKillOrFind = 3, -- 1: you have to gather items (from ground, from monsters etc), 2: you have to kill specific amount of monsters, 3: you have to kill boss and take from his body a specific item.

This error spam's like crazy....
Code:
[0:16:11:429] [Error - NpcScript Interface]
[0:16:11:500] <Unkown script file>
[0:16:11:507] Description:
[0:16:11:509] attempt to call a nil value
[0:16:11:511] stack traceable:
 
Last edited:
[26/05/2013 10:59:13] [Warning - Monster::Monster] Unknown event name - KillingInTheNameOf
 
[error - lauscriptInterface::LoadFile] data/npc/scripts/daily.lua:210: function arguments expected near ':'

It's no longer works due to FKIN STUPID NON TESTED forum GUI update what broke lots of scripts written on this forum in the past!

And I connot upload it here due to stupid thing:
Code:
The following error occurred:
The submitted message is too long to be processed. Please shorten it.
 
[error - lauscriptInterface::LoadFile] data/npc/scripts/daily.lua:210: function arguments expected near ':'
Change this
Code:
function onCreatureAppear(cid) npcHandler:eek:nCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:eek:nCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:eek:nCreatureSay(cid, type, msg) end
function onThink() npcHandler:eek:nThink() end

To this
Code:
function onCreatureAppear(cid)       npcHandler:onCreatureAppear(cid)       end
function onCreatureDisappear(cid)     npcHandler:onCreatureDisappear(cid)       end
function onCreatureSay(cid, type, msg)     npcHandler:onCreatureSay(cid, type, msg)     end
function onThink()         npcHandler:onThink()           end

: o was changed to : eek : when the Lua tags didn't exist anymore.
Same goes for every other npc release that doesn't have code tags.
 
[19/02/2014 07:10:43] [Warning - Monster::Monster] Unknown event name - KillingInTheNameOf
[19/02/2014 07:10:43] [Warning - Monster::Monster] Unknown event name - KillingInTheNameOf
[19/02/2014 07:10:43] [Warning - Monster::Monster] Unknown event name - KillingInTheNameOf
[19/02/2014 07:10:43] [Warning - Monster::Monster] Unknown event name - KillingInTheNameOf
[19/02/2014 07:10:43] [Warning - Monster::Monster] Unknown event name - KillingInTheNameOf
[19/02/2014 07:10:43] [Warning - Monster::Monster] Unknown event name - KillingInTheNameOf
[19/02/2014 07:10:43] [Warning - Monster::Monster] Unknown event name - KillingInTheNameOf
[19/02/2014 07:10:43] [Warning - Monster::Monster] Unknown event name - KillingInTheNameOf
[19/02/2014 07:10:43] [Warning - Monster::Monster] Unknown event name - KillingInTheNameOf
[19/02/2014 07:10:44] [Warning - Monster::Monster] Unknown event name - KillingInTheNameOf
[19/02/2014 07:10:44] [Warning - Monster::Monster] Unknown event name - KillingInTheNameOf
[19/02/2014 07:10:44] [Warning - Monster::Monster] Unknown event name - KillingInTheNameOf
[19/02/2014 07:10:44] [Warning - Monster::Monster] Unknown event name - KillingInTheNameOf
 
[19/02/2014 07:10:43] [Warning - Monster::Monster] Unknown event name - KillingInTheNameOf
[19/02/2014 07:10:43] [Warning - Monster::Monster] Unknown event name - KillingInTheNameOf
[19/02/2014 07:10:43] [Warning - Monster::Monster] Unknown event name - KillingInTheNameOf
[19/02/2014 07:10:43] [Warning - Monster::Monster] Unknown event name - KillingInTheNameOf
[19/02/2014 07:10:43] [Warning - Monster::Monster] Unknown event name - KillingInTheNameOf
[19/02/2014 07:10:43] [Warning - Monster::Monster] Unknown event name - KillingInTheNameOf
[19/02/2014 07:10:43] [Warning - Monster::Monster] Unknown event name - KillingInTheNameOf
[19/02/2014 07:10:43] [Warning - Monster::Monster] Unknown event name - KillingInTheNameOf
[19/02/2014 07:10:43] [Warning - Monster::Monster] Unknown event name - KillingInTheNameOf
[19/02/2014 07:10:44] [Warning - Monster::Monster] Unknown event name - KillingInTheNameOf
[19/02/2014 07:10:44] [Warning - Monster::Monster] Unknown event name - KillingInTheNameOf
[19/02/2014 07:10:44] [Warning - Monster::Monster] Unknown event name - KillingInTheNameOf
[19/02/2014 07:10:44] [Warning - Monster::Monster] Unknown event name - KillingInTheNameOf
http://otland.net/threads/grizzly-a...me-of-quest-all-tasks-more-real-tibia.159150/
 
but this hapend when I implented your script tho :p

it's my error in console

I think becaused I added

<script>
<event name="KillingInTheNameOf"/>
</script>

at my Dragon Monster
 
but this hapend when I implented your script tho :p

it's my error in console

I think becaused I added

<script>
<event name="KillingInTheNameOf"/>
</script>

at my Dragon Monster
If you added it, you need to have fully working "KillingInTheNameOf" script in creaturescripts.
 
If you added it, you need to have fully working "KillingInTheNameOf" script in creaturescripts.
Found a bug, change:
Code:
<script>
<event name="KillingInTheNameOf"/>
</script>
to:
Code:
<script>
<event name="Daily quests killing"/>
</script>
 
another error:
creaturescripts/scripts/dailyquestkilling.lua:eek:nkill
creaturescripts/scripts/dailyquestkilling.lua:9: attempt to index global 'mobs' (a nil value)
stack traceback:
data/creaturescripts/script/dailyquestkilling.lua:9: in function <data/creaturescripts/script/dailyquestkilling.lua:7>
 
Back
Top