![]() |
[Request] Attacker.add/del - Printable Version +- SphereCommunity (https://forum.spherecommunity.net) +-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d) +--- Forum: General Help (/Forum-General-Help) +--- Thread: [Request] Attacker.add/del (/Thread-Request-Attacker-add-del) |
[Request] Attacker.add/del - XuN - 08-11-2013 07:08 AM Hello, i'm making a custom system that controls how many time and in wich circunstances can a NPC be in combat to make special habilites and more things. The problem I have is that the attacker system cares about who attacked the mob itself and I want some kind of 'enemy.add uid' because attacker is created when npc receives a hit and not in @attack. I've tried a workaround that do dmg 1,01,<src> in the @attack but it's a little ugly with aos damage and I see no other way scripting. RE: [Request] Attacker.add/del - Alaric - 08-11-2013 07:29 AM It depends what exactely do you want the NPC to do... I would suggest to loop through chars (forchars) and check their aggressions. Who are they attacking... iow. whether they are attacking the NPC. But think about casters, they aren't attacking. I would recommend you to invent another ability. :-/ For example, wouldn't be sufficient just checking how many players are around? Or the AoE dmg, why not.. its simple and effective. ![]() RE: [Request] Attacker.add/del - XuN - 08-11-2013 04:53 PM Until engage combat I check every second that each enemy (using attacker.x) is in certain range and in line of sight (or have been out of them for less than a defined time), have been active in the combat in the last x seconds and he's not death, and I want to delete him from the 'system' if he doesn't pass this arguments but i see no way for deleting a char from attacker list, even deleting memory attached to him, i also want this system to have control of damage done for a loot and exp system and also being able to cast some abilities or do some custom moves, speech, or whatever I like and have defined in some tag/def pointing to this char without making a script to every npc. I would need to rewrite whole system using tags for each enemy/dmg as I already have to use for distance/los, and it would help to make more active combats, when npc haves 0 enemies acording to this system I make him heal, so you can't run and dmg to kill him in 30 tries and also try to give more use to the party system by having to kill in groups some monsters Edit: BTW, attackear.clear doesn't work either by script or ingame command, you type .xshow attacker after using it and list is still up |