• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

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

If you will read and you'll make everything like its written it will work for you
 
Well, those arrays with information about task, rewards etc. can be shortened three times.

Why using disabled array:
Code:
second = {enable = false, type = nil, values = {nil, nil}}
while you can just check if it is:
Code:
if tasks[s].rewards.second then

also, so far I know that onKill event is used when anything dies. Then why you are using:
Code:
<script>
        <event name="KillingInTheNameOf"/>
</script>

Better check name of the monster directly from onKill.

Well, it would be better to use one, global array. For example in libs. Then it will be processed by either NPC and creaturescript. You can easily set up your own syntax for rewards. For example:
Code:
reward = {"exp", 1000, "teleport", {x=1000,y=1000,z=7}, "item", {2160,1}}

And script will read type from array just like reward[1], reward[3] and reward[5]. Values for types will be 1 position farther, like reward[1+1], reward[3+1] and reward[5+1].
 
i use 0.3.4 pl2 and i have this warn in console;

Code:
[03/01/2010 18:03:35] [Warning - Monster::Monster] Unknown event name - KillingInTheNameOf
 
Error:
[12/01/2010 14:08:45] [Error - Npc interface]
[12/01/2010 14:08:45] data/npc/scripts/killinginthenameof.lua:eek:nCreatureSay
[12/01/2010 14:08:45] Description:
[12/01/2010 14:08:45] attempt to index a nil value
[12/01/2010 14:08:45] stack traceback:
[12/01/2010 14:08:45] [C]: in function 'doTeleportThing'
[12/01/2010 14:08:45] data/npc/scripts/killinginthenameof.lua:118: in function 'callback'
[12/01/2010 14:08:45] data/npc/lib/npcsystem/npchandler.lua:390: in function 'onCreatureSay'
[12/01/2010 14:08:45] data/npc/scripts/killinginthenameof.lua:74: in function <data/npc/scripts/killinginthenameof.lua:74>

I have edited in NPC script this:
{enable = true, type = "boss", values = {x=703,y=600,z=7, false}},

Help?
 
Hey could you recheck the NPC? I think that he still respond wrong when you say Task while you have already one.
 
ok, i have next problem when I kill Troll it stay without hp :eek:

@edit
ok I fix my bug now I will go and test script ;p
 
Last edited:
Hello,

my friend have added this quest to his server. But it still sais you have killed 0 trolls.

I've changed troll to Troll but still the same.
 
Well, those arrays with information about task, rewards etc. can be shortened three times.

Why using disabled array:
Code:
second = {enable = false, type = nil, values = {nil, nil}}
while you can just check if it is:
Code:
if tasks[s].rewards.second then

For people who don't know much about lua, and don't know how to add rewars or something like that.

When i make a script, i think in people that are new in this, i try to write script with the minimun configuration.

If i write ascript and i write in my post (Example: "Configure rewards creating or deleting the rewards table, or disabling the rewards").. noobs can write something bad and get a error in console..if that happens, the my post will have so much replies about errors or something..

SORRY IF I WRITE IN BAD ENGLISH ;D!

@kudzu1988!
Change:
Lua:
{enable = true, type = "boss", values = {x=703,y=600,z=7, false}},

To:
Lua:
{enable = true, type = "boss", values = {x=703,y=600,z=7}, false},

The "false" need to be outside the position table, false in a second reward parameter.

@PEOPLE THAT SAYS "I KILL 100 TROLLS AND WHEN I SAY REPORT THE NPC STILL SAY THAT I HAVE KILLED 0 TROLLS"!!

YOU'RE DOING SOMETHING WRONG OR THE SCRIPT DON'T WORK WITH YOUR DISTRO... READ ALL MY POST AND FOLLOW ALL INTRUCTIONS, READ WELL THE PART ABOUT MONSTERS NAMES!
 
Hello,

as I said, we already changed the monster names from troll to Troll.

Distro: Newest TFS
 
@darkhaos
Well, but still if you are bored, you can extend script with more advanced option. Basic newbie in lua won't touch entire script but arrays with rewards. And could you check out if the script will work if you just use onKill event with name comparing statement. Then we could get rid of modifying monster files (if it'll work).

Anyways, nice work. Writing such long and configurable scripts is funny :)

PS. Try to make script as a mod. Then it will be even easier to set up it.
 
I have same problem when i chage code to:

Code:
  {enable = true, type = "boss", values = {x=703,y=600,z=7}, false},

from console:

Code:
[17/01/2010 10:58:49] 	[C]: in function 'doTeleportThing'
[17/01/2010 10:58:49] 	data/npc/scripts/killinginthenameof.lua:66: in function 'callback'
[17/01/2010 10:58:49] 	data/npc/lib/npcsystem/npchandler.lua:384: in function 'onCreatureSay'
[17/01/2010 10:58:49] 	data/npc/scripts/killinginthenameof.lua:22: in function <data/npc/scripts/killinginthenameof.lua:22>
 
I did everything you said, exactly how you said but it doesn't count the monsters I've killed...

I tried to change the name in the creature scripts to troll from Troll but it doesn't work.

I'm using The Forgotten Server 0.3.6pl1 (Crying Damson)

Will give alot of rep to the one who can help me out!
 
hey im using TFS 0.3.5 ive followed all instructions carefully , but when the NPC is summoned the only thing it responds too is " hi " .. His response is " Ive been expecting you blah blah " .. He wont respond to anything else.. Not task , not mission.. nothing , anyone know why this is?.. Ive reviewed everything 5x over.. I dont get what the issue is.
 
<?xml version="1.0" encoding="UTF-8"?>

<npc name="Grizzly Adams" script="data/npc/scripts/killinginthenameof.lua" access="3" walkinterval="2000" lookdir="2">
<mana now="800" max="800"/>
<health now="200" max="200"/>
<look type="144" head="97" body="97" legs="94" feet="97" addons="3"/>
</npc>

...

It is the correct path , sorry for not linking the code correctly i dont know how lol.. Also theres no console errors relating to the NPC.
 
Last edited:
For people who don't know much about lua, and don't know how to add rewars or something like that.

When i make a script, i think in people that are new in this, i try to write script with the minimun configuration.

If i write ascript and i write in my post (Example: "Configure rewards creating or deleting the rewards table, or disabling the rewards").. noobs can write something bad and get a error in console..if that happens, the my post will have so much replies about errors or something..

SORRY IF I WRITE IN BAD ENGLISH ;D!

@kudzu1988!
Change:
Lua:
{enable = true, type = "boss", values = {x=703,y=600,z=7, false}},

To:
Lua:
{enable = true, type = "boss", values = {x=703,y=600,z=7}, false},

The "false" need to be outside the position table, false in a second reward parameter.

@PEOPLE THAT SAYS "I KILL 100 TROLLS AND WHEN I SAY REPORT THE NPC STILL SAY THAT I HAVE KILLED 0 TROLLS"!!

YOU'RE DOING SOMETHING WRONG OR THE SCRIPT DON'T WORK WITH YOUR DISTRO... READ ALL MY POST AND FOLLOW ALL INTRUCTIONS, READ WELL THE PART ABOUT MONSTERS NAMES!

When i do like u say it's same problem ;/ any sugestions?
 
I have same problem when i chage code to:

Code:
  {enable = true, type = "boss", values = {x=703,y=600,z=7}, false},

from console:

Code:
[17/01/2010 10:58:49] 	[C]: in function 'doTeleportThing'
[17/01/2010 10:58:49] 	data/npc/scripts/killinginthenameof.lua:66: in function 'callback'
[17/01/2010 10:58:49] 	data/npc/lib/npcsystem/npchandler.lua:384: in function 'onCreatureSay'
[17/01/2010 10:58:49] 	data/npc/scripts/killinginthenameof.lua:22: in function <data/npc/scripts/killinginthenameof.lua:22>


I got the same problem, will rep ++ the one who helps me!
 
Back
Top