NPC Advance Guard [Attacking Pk's and Monsters with options] [TFS 1.x]

oualid6496

Well-Known Member
Joined
Aug 24, 2014
Messages
347
Best answers
0
Reaction score
56
Location
Dordrecht, The Netherlands
Ok, I find out now,, the problem happen only when there is more than 1 guard on the map
when I added 10 guard by city, it bugs
Yep had the same problem when you're adding multiple guards some guards won't attack.

Also can someone make it attack with physical instead of fire and just follow like a real guard? :p
 

SlayingWorld

Active Member
Joined
Jan 23, 2014
Messages
122
Best answers
0
Reaction score
29
Location
USA
How can i change the speed of the guard? I mean i know how to change it on the XML file. But the guard still only goes 1 step and pauses a bit then another step, very easy to outrun. Not arguing about it, great script to be honest! Just getting my head busted trying to edit it :p
 

Andréew

Humble mapper.
Premium User
Joined
Apr 14, 2015
Messages
660
Best answers
1
Reaction score
1,029
Location
Sweden
Yep had the same problem when you're adding multiple guards some guards won't attack.

Also can someone make it attack with physical instead of fire and just follow like a real guard? :p
It can be found in the code right here @Oualid
Code:
    -- If target is found
    local npcId = npc:getId()
    doTargetCombatHealth(npcId, targetId, COMBAT_FIREDAMAGE, -config.damageValue.min, -config.damageValue.max, CONST_ME_HITBYFIRE)
    npcPosition:sendDistanceEffect(targetPosition, CONST_ANI_FIRE)
    doNpcSetCreatureFocus(targetId)
@Printer this is a really nice script, thanks for sharing man! :)
 

kaszanalubizryc

New Member
Joined
Sep 10, 2015
Messages
148
Best answers
0
Reaction score
1
its possible change doteleport to move?
like npc move to attack creature/pk and moving back

i dislike the teleport
 

Pedrook

Well-Known Member
Joined
May 24, 2009
Messages
382
Best answers
3
Reaction score
91
NPC worked perfectly !! I loved the monsters' throw and it goes back to the initial position, after exceeding the limit of configurable SQM.

I only noticed some details that are:


NPC is attacking even when I go down or up a basement, ladder etc ... If I am still in the range he continues to attack regardless of the Z position.
_____________________________________________________________________________________________________________
After he loses the target, he gets stopped instead of walking again, even after putting in his XML >>>> speed = "500" walkinterval = "2000" <<<<<<


_____________________________________________________________________________________________________________

The same goes for killing a monster, it stops without moving until the next target appears.

_____________________________________________________________________________________________________________
When the player is Red skull or black the npc attacks the player even within the protection zone or house.


_____________________________________________________________________________________________________________

The npc attacks are not respecting the "blockwalls" (serves to block attacks when the target is behind the wall, pillars, closed doors, closed windows etc.)


_____________________________________________________________________________________________________________
Also I would like to know if it is possible to put it to when someone says "hi" it will answer at least what is in its XML.
I currently tested it and it did not work. :(

_____________________________________________________________________________________________________________
And finally leaving the "true" option on will continue attacking the summon.

OBS: I made the summon from the command of the GM / summon name of the monsters.

Thank you again for your attention. : D
 

Danat

Member
Joined
Jun 6, 2008
Messages
47
Best answers
0
Reaction score
12
Hey Printer, first THANKS for an amazing script.
it works great,
although i do have 2 problems, it might be the same tho, first i cant get it to work with spawned npcs from Map. I have to add it with command.
Second, as previously said, it only works with the last added guard.
Adding new NPCs with the same script, gets every other NPC with that script stuck.
coping the script into another NPC and adding only One copy of an NPC per NPC file seems to work. (But i wont be addind dozens of different NPCs.)
if anyone has an idea how to fix this
I've been trying to figure this out, why does the script only work with one NPC at the time. Does it end properly? i mean
if its constantly using the script, then that might cause a problem for other NPCs to use it? idk
something along those lines i think.

help or guidance would be appreciated.
Thanks again,
Danat.
 

massinha

New Member
Joined
Mar 13, 2019
Messages
8
Best answers
0
Reaction score
0
erro.png

hey i need help here


function Creature.isAttackable(self)
if not self:isNpc() then
if self:isPlayer() and not self:getGroup():getAccess() then
if config.attackPK.value and isInArray(config.attackPK.skulls, self:getSkull()) then
return true
end
end
 
Top