• 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 that attacks monsters

Flipparn

I like horses
Joined
Feb 19, 2008
Messages
89
Reaction score
21
I know that this has existed before, so I'm requesting it since I can't find anything when searching for it.

I need an NPC that attacks monsters, it should be able to use spells etc.

Thanks in advance!
 
You could make an NPC with the GM invisible, make it summon the attacking NPC and use the doCreatureSay ability with the summon ID define this when its summoned
Lua:
 local summon = DoSummonCreature(asdfadsfas), doConvinceCreature(cid, summon), doCreatureSay(summon, sadas, type)
or how it is done. With the GM invisibility you can just make the non attacking NPC not move and have it get the flag so players cant attack it.
Making it only summon the creature once could be done with setting its max summons or using a global ID if you chose to have this reset when restarting the server.

What's left now is the issue of attacking, but if I recall correctly (didnt do LUA for a while) there's a function that sorts that for you.

There is probably some other way aswell, however that is how I would do it.

Also, depending on how you do it, remember that it is possible to do a talkaction script that checks your pos (could make it check inside an area) then if you're in that pos, depending on your added keywords it could make a monster reply and react just like a normal NPC. [doMonsterSetTarget(cid, target)]
 
Last edited:
Back
Top