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

CreatureEvent [CreatureEvent/Npc] Killing in the name of... [All monsters, all tasks with rewards]

@Owned420!!

Have you registered the event in login.lua?

If you has been registered the event, the post here the creature-script to see what's wrong!

@dizoxur!

Post here you npc-script to see what's wrong!
 
Lua:
local config = {
	loginMessage = getConfigValue('loginMessage')
}

function onLogin(cid)
	local loss = getConfigValue('deathLostPercent')
	if(loss ~= nil) then
		doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
	end

	local accountManager = getPlayerAccountManager(cid)
	if(accountManager == MANAGER_NONE) then
		local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
		if(lastLogin > 0) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
			str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."
		else
			str = str .. " Please choose your outfit."
			doPlayerSendOutfitWindow(cid)
		end

		doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
	elseif(accountManager == MANAGER_NAMELOCK) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")
	elseif(accountManager == MANAGER_ACCOUNT) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.")
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")
	end

	if(not isPlayerGhost(cid)) then
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
	end

	registerCreatureEvent(cid, "PlayerDeath")
	registerCreatureEvent(cid, "GuildMotd")
	registerCreatureEvent(cid, "Idle")
	registerCreatureEvent(cid, "SkullCheck")
	registerCreatureEvent(cid, "ReportBug")   registerCreatureEvent(cid, "KillingInTheNameOf")
	return true
end
...

Lua:
<?xml version="1.0" encoding="UTF-8"?>
<creaturescripts>
	<event type="login" name="PlayerLogin" event="script" value="login.lua"/>

	<event type="joinchannel" name="GuildMotd" event="script" value="guildmotd.lua"/>
	<event type="receivemail" name="Mail" event="script" value="mail.lua"/>
	<event type="reportbug" name="SaveReportBug" script="reportbug.lua"/>

	<event type="think" name="Idle" event="script" value="idle.lua"/>
	<event type="think" name="SkullCheck" event="script" value="skullcheck.lua"/>
      <event type="login" name="Welcome!" script="loginserver.lua"/>
      <event type="death" name="PlayerDeath" event="script" value="playerdeath.lua"/>
      <event type="kill" name="KillingInTheNameOf" event="script" value="killinginthenameof.lua"/>

</creaturescripts>
...

It is registered.. Im assuming thats correctly done?..

How do i link the code properly when i post.
 
Last edited:
Lua:
registerCreatureEvent(cid, "ReportBug") registerCreatureEvent(cid, "KillingInTheNameOf")

Separate it!

Lua:
registerCreatureEvent(cid, "ReportBug")
registerCreatureEvent(cid, "KillingInTheNameOf")

PD: Use code/lua "[ lua][ /lua]" tags
PD2: If the script is still not working, post the script (killinginthenameof.lua)
 
This is the killinginthenameof.lua in creature scripts / scripts.


Lua:
  function onKill(cid, target, lastHit)

local questCreatures =
{
        ["troll"] = {questStarted = 1510, questStorage = 65000, creatureStorage = 15000, killsRequired = 100, raceName = "Trolls"},
        ["frost troll"] = {questStarted = 1510, questStorage = 65000, creatureStorage = 15001, killsRequired = 100, raceName = "Trolls"},
        ["furious troll"] = {questStarted = 1510, questStorage = 65000, creatureStorage = 15002, killsRequired = 100, raceName = "Trolls"},
        ["island troll"] = {questStarted = 1510, questStorage = 65000, creatureStorage = 15003, killsRequired = 100, raceName = "Trolls"},
        ["swamp troll"] = {questStarted = 1510, questStorage = 65000, creatureStorage = 15004, killsRequired = 100, raceName = "Trolls"},
        ["troll champion"] = {questStarted = 1510, questStorage = 65000, creatureStorage = 15005, killsRequired = 100, raceName = "Trolls"},
        ["troll legionnaire"] = {questStarted = 1510, questStorage = 65000, creatureStorage = 15006, killsRequired = 100, raceName = "Trolls"},

        ["goblin"] = {questStarted = 1511, questStorage = 65001, creatureStorage = 15007, killsRequired = 150, raceName = "Goblins"},
        ["goblin assassin"] = {questStarted = 1511, questStorage = 65001, creatureStorage = 15008, killsRequired = 150, raceName = "Goblins"},
        ["goblin leader"] = {questStarted = 1511, questStorage = 65001, creatureStorage = 15009, killsRequired = 150, raceName = "Goblins"},
        ["goblin scavenger"] = {questStarted = 1511, questStorage = 65001, creatureStorage = 15010, killsRequired = 150, raceName = "Goblins"},

        ["rotworm"] = {questStarted = 1512, questStorage = 65002, creatureStorage = 15011, killsRequired = 300, raceName = "Rotworms"},
        ["carriom worm"] = {questStarted = 1512, questStorage = 65002, creatureStorage = 15012, killsRequired = 300, raceName = "Rotworms"},

        ["cyclops"] = {questStarted = 1513, questStorage = 65003, creatureStorage = 15013, killsRequired = 500, raceName = "Cyclops"},
        ["cyclops smith"] = {questStarted = 1513, questStorage = 65003, creatureStorage = 15014, killsRequired = 500, raceName = "Cyclops"},
        ["cyclops drone"] = {questStarted = 1513, questStorage = 65003, creatureStorage = 15015, killsRequired = 500, raceName = "Cyclops"},


        ["crocodile"] = {questStarted = 1514, questStorage = 65004, creatureStorage = 15016, killsRequired = 300, raceName = "Crocodiles"},

        ["tarantula"] = {questStarted = 1515, questStorage = 65005, creatureStorage = 15017, killsRequired = 300, raceName = "Tarantulas"},

        ["carniphila"] = {questStarted = 1516, questStorage = 65006, creatureStorage = 15018, killsRequired = 150, raceName = "Carniphilas"},

        ["stone golem"] = {questStarted = 1517, questStorage = 65007, creatureStorage = 15019, killsRequired = 200, raceName = "Stone Golems"},

        ["mammoth"] = {questStarted = 1518, questStorage = 65008, creatureStorage = 15020, killsRequired = 300, raceName = "Mammoths"},

        ["ice golem"] = {questStarted = 1519, questStorage = 65009, creatureStorage = 15021, killsRequired = 300, raceName = "Ice Golems"},

        ["quara predator scout"] = {questStarted = 1520, questStorage = 65010, creatureStorage = 15022, killsRequired = 300, raceName = "Quaras Scout"},
        ["quara constrictor scout"] = {questStarted = 1520, questStorage = 65010, creatureStorage = 15023, killsRequired = 300, raceName = "Quaras Scout"},
        ["quara hydromancer scout"] = {questStarted = 1520, questStorage = 65010, creatureStorage = 15024, killsRequired = 300, raceName = "Quaras Scout"},
        ["quara mantassin scout"] = {questStarted = 1520, questStorage = 65010, creatureStorage = 15025, killsRequired = 300, raceName = "Quaras Scout"},
        ["quara pincher scout"] = {questStarted = 1520, questStorage = 65010, creatureStorage = 15026, killsRequired = 300, raceName = "Quaras Scout"},

        ["quara predator"] = {questStarted = 1521, questStorage = 65011, creatureStorage = 15027, killsRequired = 300, raceName = "Quaras"},
        ["quara constrictor"] = {questStarted = 1521, questStorage = 65011, creatureStorage = 15028, killsRequired = 300, raceName = "Quaras"},
        ["quara hydromancer"] = {questStarted = 1521, questStorage = 65011, creatureStorage = 15029, killsRequired = 300, raceName = "Quaras"},
        ["quara mantassin"] = {questStarted = 1521, questStorage = 65011, creatureStorage = 15030, killsRequired = 300, raceName = "Quaras"},
        ["quara pincher"] = {questStarted = 1521, questStorage = 65011, creatureStorage = 15031, killsRequired = 300, raceName = "Quaras"},

        ["water elemental"] = {questStarted = 1522, questStorage = 65012, creatureStorage = 15032, killsRequired = 70, raceName = "Water Elementals"},
        ["roaring water elemental"] = {questStarted = 1522, questStorage = 65012, creatureStorage = 15033, killsRequired = 70, raceName = "Water Elementals"},
        ["slick water elemental"] = {questStarted = 1522, questStorage = 65012, creatureStorage = 15034, killsRequired = 70, raceName = "Water Elementals"},
        ["massive water elemental"] = {questStarted = 1522, questStorage = 65012, creatureStorage = 15035, killsRequired = 70, raceName = "Water Elementals"},

        ["earth elemental"] = {questStarted = 1523, questStorage = 65013, creatureStorage = 15036, killsRequired = 70, raceName = "Earth Elementals"},
        ["jagged earth elemental"] = {questStarted = 1523, questStorage = 65013, creatureStorage = 15037, killsRequired = 70, raceName = "Earth Elementals"},
        ["massive earth elemental"] = {questStarted = 1523, questStorage = 65013, creatureStorage = 15038, killsRequired = 70, raceName = "Earth Elementals"},
        ["muddy earth elemental"] = {questStarted = 1523, questStorage = 65013, creatureStorage = 15039, killsRequired = 70, raceName = "Earth Elementals"},

        ["energy elemental"] = {questStarted = 1524, questStorage = 65014, creatureStorage = 15040, killsRequired = 70, raceName = "Energy Elementals"},
        ["charged energy elemental"] = {questStarted = 1524, questStorage = 65014, creatureStorage = 15041, killsRequired = 70, raceName = "Energy Elementals"},
        ["massive energy elemental"] = {questStarted = 1524, questStorage = 65014, creatureStorage = 15042, killsRequired = 70, raceName = "Energy Elementals"},
        ["overcharged energy elemental"] = {questStarted = 1524, questStorage = 65014, creatureStorage = 15043, killsRequired = 70, raceName = "Energy Elementals"},

        ["fire elemental"] = {questStarted = 1525, questStorage = 65015, creatureStorage = 15044, killsRequired = 70, raceName = "Fire Elementals"},
        ["blazing fire elemental"] = {questStarted = 1525, questStorage = 65015, creatureStorage = 15045, killsRequired = 70, raceName = "Fire Elementals"},
        ["blistering fire elemental"] = {questStarted = 1525, questStorage = 65015, creatureStorage = 15046, killsRequired = 70, raceName = "Fire Elementals"},
        ["massive fire elemental"] = {questStarted = 1525, questStorage = 65015, creatureStorage = 15047, killsRequired = 70, raceName = "Fire Elementals"},

        ["mutated rat"] = {questStarted = 1526, questStorage = 65016, creatureStorage = 15048, killsRequired = 200, raceName = "Mutated Rats"},

        ["giant spider"] = {questStarted = 1527, questStorage = 65017, creatureStorage = 15049, killsRequired = 500, raceName = "Giant Spiders"},

        ["hydra"] = {questStarted = 1528, questStorage = 65018, creatureStorage = 15050, killsRequired = 2000, raceName = "Hydras"},

        ["sea serpent"] = {questStarted = 1529, questStorage = 65019, creatureStorage = 15051, killsRequired = 2000, raceName = "Sea Serpents"},

        ["behemoth"] = {questStarted = 1530, questStorage = 65020, creatureStorage = 15052, killsRequired = 2000, raceName = "Behemoths"},

        ["serpent spawn"] = {questStarted = 1531, questStorage = 65021, creatureStorage = 15053, killsRequired = 1500, raceName = "Serpents Spawn"},

        ["green djinn"] = {questStarted = 1532, questStorage = 65022, creatureStorage = 15054, killsRequired = 500, raceName = "Green Djinns"},
        ["efreet"] = {questStarted = 1532, questStorage = 65022, creatureStorage = 15055, killsRequired = 500, raceName = "Green Djinns"},

        ["blue djinn"] = {questStarted = 1533, questStorage = 65023, creatureStorage = 15056, killsRequired = 500, raceName = "Blue Djinns"},
        ["marid"] = {questStarted = 1533, questStorage = 65023, creatureStorage = 15057, killsRequired = 500, raceName = "Blue Djinns"},

        ["pirate buccaneer"] = {questStarted = 1534, questStorage = 65024, creatureStorage = 15058, killsRequired = 3000, raceName = "Pirates"},
        ["pirate corsair"] = {questStarted = 1534, questStorage = 65024, creatureStorage = 15059, killsRequired = 3000, raceName = "Pirates"},
        ["pirate cutthroat"] = {questStarted = 1534, questStorage = 65024, creatureStorage = 15060, killsRequired = 3000, raceName = "Pirates"},
        ["pirate ghost"] = {questStarted = 1534, questStorage = 65024, creatureStorage = 15061, killsRequired = 3000, raceName = "Pirates"},
        ["pirate marauder"] = {questStarted = 1534, questStorage = 65024, creatureStorage = 15062, killsRequired = 3000, raceName = "Pirates"},
        ["pirate skeleton"] = {questStarted = 1534, questStorage = 65024, creatureStorage = 15063, killsRequired = 3000, raceName = "Pirates"},

        ["pirate buccaneer"] = {questStarted = 1535, questStorage = 65025, creatureStorage = 15064, killsRequired = 3000, raceName = "Pirates"},
        ["pirate corsair"] = {questStarted = 1535, questStorage = 65025, creatureStorage = 15065, killsRequired = 3000, raceName = "Pirates"},
        ["pirate cutthroat"] = {questStarted = 1535, questStorage = 65025, creatureStorage = 15066, killsRequired = 3000, raceName = "Pirates"},
        ["pirate ghost"] = {questStarted = 1535, questStorage = 65025, creatureStorage = 15067, killsRequired = 3000, raceName = "Pirates"},
        ["pirate marauder"] = {questStarted = 1535, questStorage = 65025, creatureStorage = 15068, killsRequired = 3000, raceName = "Pirates"},
        ["pirate skeleton"] = {questStarted = 1535, questStorage = 65025, creatureStorage = 15069, killsRequired = 3000, raceName = "Pirates"},

        ["minotaur"] = {questStarted = 1536, questStorage = 65026, creatureStorage = 15070, killsRequired = 5000, raceName = "Minotaurs"},

        ["necromancer"] = {questStarted = 1537, questStorage = 65027, creatureStorage = 15071, killsRequired = 4000, raceName = "Magicians"},
        ["priestess"] = {questStarted = 1537, questStorage = 65027, creatureStorage = 15072, killsRequired = 4000, raceName = "Magicians"},

        ["necromancer"] = {questStarted = 1538, questStorage = 65028, creatureStorage = 15073, killsRequired = 1000, raceName = "Magicians"},
        ["priestess"] = {questStarted = 1538, questStorage = 65028, creatureStorage = 15074, killsRequired = 1000, raceName = "Magicians"},

        ["demon"] = {questStarted = 1539, questStorage = 65029, creatureStorage = 15075, killsRequired = 6666, raceName = "Demons"}
}

local creature = questCreatures[getCreatureName(target)]
       
        if creature then
                if(isPlayer(target) == true) then
                        return true
                end
                if getPlayerStorageValue(cid, creature.questStarted) > 0 then
                        if getPlayerStorageValue(cid, creature.questStorage) < creature.killsRequired then
                                if getPlayerStorageValue(cid, creature.questStorage) < 0 then
                                        doPlayerSetStorageValue(cid, creature.questStorage, 0)
                                end

                                if getPlayerStorageValue(cid, creature.creatureStorage) < 0 then
                                        doPlayerSetStorageValue(cid, creature.creatureStorage, 0)
                                end
                                doPlayerSetStorageValue(cid, creature.questStorage, getPlayerStorageValue(cid, creature.questStorage) + 1)
                                doPlayerSetStorageValue(cid, creature.creatureStorage, getPlayerStorageValue(cid, creature.creatureStorage) + 1)
                                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "" .. getPlayerStorageValue(cid, creature.creatureStorage) .. " " .. getCreatureName(target) .. " defeated. Total [" .. getPlayerStorageValue(cid, creature.questStorage) .. "/" .. creature.killsRequired .. "] " .. creature.raceName .. ".")
                        end
                end
        end
        return true
end

Thanks for your reply , i tried lining everything up , but the NPC still does not respond..

22:03 Grizzly Adams: Welcome, GOD Owned! I have been expecting you.
22:03 GOD Owned [1337]: Task
22:04 GOD Owned [1337]: Mission
22:04 GOD Owned [1337]: Trade
22:04 GOD Owned [1337]: Job
 
@Owned420 and all people

I've updated the NPC Script, so update it on your server and test it!

@People that get error with teleport rewards...

There was a bug in the script, i've fixed it now, you can update the NPC-Script or do the following thing:

In rewards configuration, change all:
Lua:
values = {THUL_POSITION, false} //Thul Example

To:
Lua:
values = THUL_POSITION //Thul Example

And change all:
Lua:
doTeleportThing(cid, tasks[s].rewards.first.values[1], tasks[s].rewards.first.values[2]) //First reward example

To:
Lua:
doTeleportThing(cid, tasks[s].rewards.first.values) //First reward example

Remember that the script was tested, working perfect in TFS 0.3.6pl1.
 
When I say report it say 0 of 100 killed.
I came back with the 100 trolls killed, say report and it still saying 0 killed of 100.

:S

TFS 0.3.6
 
how to make the NPC will convene a boss?
when you finish killing everything
 
16:34 Grizzly Adams: Welcome, Black Night! I have been expecting you.
16:34 Black Night [208]: task

-- ERROR IN CONSOLE "[Killing in the name of::Task Error]>> Something if wrong!" --

16:34 Black Night [208]: task
16:34 Grizzly Adams: You have started the task number 1, in this task you need to kill 100 Trolls.
16:34 Grizzly Adams: How rude!
16:34 Black Night [208]: exevo frigo hur
16:36 Grizzly Adams: Welcome, Black Night! I have been expecting you.
16:36 Black Night [208]: task
16:36 Grizzly Adams: You are currently making task about Trolls.
16:36 Black Night [208]: report
16:36 Grizzly Adams: Great!... you have finished the task number 1. Good job.

16:36 100 troll defeated. Total [100/100] Trolls.

-- At here all are ok! --

16:37 Black Night [208]: task
16:37 Grizzly Adams: You have started the task number 2, in this task you need to kill 150 Goblins.
16:37 Grizzly Adams: How rude!

-- After killing the trolls, he says to kill Goblins, but I kill them and nothing happens, I've checked, everything is ok in the scripts and goblins. --

I am using TFS 0.3.6PL1 with all the updated files

<script>
<event name="KillingInTheNameOf"/>
</script>
 
Last edited:
ekhm? I must say twice 'task' to make it work
also while I'm making a task, the NPC doesn't answer for 'task'.
 
Last edited:
16:34 Grizzly Adams: Welcome, Black Night! I have been expecting you.
16:34 Black Night [208]: task

-- ERROR IN CONSOLE "[Killing in the name of::Task Error]>> Something if wrong!" --

16:34 Black Night [208]: task
16:34 Grizzly Adams: You have started the task number 1, in this task you need to kill 100 Trolls.
16:34 Grizzly Adams: How rude!
16:34 Black Night [208]: exevo frigo hur
16:36 Grizzly Adams: Welcome, Black Night! I have been expecting you.
16:36 Black Night [208]: task
16:36 Grizzly Adams: You are currently making task about Trolls.
16:36 Black Night [208]: report
16:36 Grizzly Adams: Great!... you have finished the task number 1. Good job.

16:36 100 troll defeated. Total [100/100] Trolls.

-- At here all are ok! --

16:37 Black Night [208]: task
16:37 Grizzly Adams: You have started the task number 2, in this task you need to kill 150 Goblins.
16:37 Grizzly Adams: How rude!

-- After killing the trolls, he says to kill Goblins, but I kill them and nothing happens, I've checked, everything is ok in the scripts and goblins. --

I am using TFS 0.3.6PL1 with all the updated files

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

Something is wrong with the storages or the goblin names!

PD: thanks for the bug when u ask for your first task (the error in console)

Edit::

I've tested script again! all is working... including the error that you get in console, all is working correctly.
 
Last edited:
Hum.. I test it on 0.3.5 and it dosen't work for me:S

NPC: Current 0 Trolls killed, you need to kill 100.
I have killed like over 100 Trolls.
Does this script work with 0.3.6?

Thanks, anyway nice script. Can you PM me and help me:p?
 
Hum.. I test it on 0.3.5 and it dosen't work for me:S

NPC: Current 0 Trolls killed, you need to kill 100.
I have killed like over 100 Trolls.
Does this script work with 0.3.6?

Thanks, anyway nice script. Can you PM me and help me:p?

POst here your scripts to see what is the problem
 
you it is online?? because the npc not it is counting the creature or the script!!
 
onKill event is executed every time when something dies. You don't need to put
Code:
<script>
<event name="KillingInTheNameOf"/>
</script>
 
When I say report it say 0 of 100 killed.
I came back with the 100 trolls killed, say report and it still saying 0 killed of 100.

:S

TFS 0.3.6

I have the same error. Why it doesn't works? : (

#edit: Sorry! Now it works : ) - wrong monster names in killinginthenameof.lua : )
 
Last edited:
Originally Posted by Aeron View Post
When I say report it say 0 of 100 killed.
I came back with the 100 trolls killed, say report and it still saying 0 killed of 100.

:S

TFS 0.3.6

Even erro here!!
 
Back
Top