Jump to content

Lowering Aggro Range


ub3rman123

Recommended Posts

I've created a script to lower aggro range on enemies by having them change factions when the player either activates them, attacks them, or gets within a certain range. Here's the script.

 

SCN SFKAggroScript

ref self

begin onload

set self to getself

end

begin onactivate

setfactionrank SFKWorgenFaction -1

setfactionrank SFKWorgenFaction2 0

startcombat player

activate

end

 

begin onhit player

setfactionrank SFKWorgenFaction -1

setfactionrank SFKWorgenFaction2 0

startcombat player

end

 

begin gamemode

if player.getdistance self <= 400

setfactionrank SFKWorgenFaction -1

setfactionrank SFKWorgenFaction2 0

startcombat player

endif

end

For some reason, it's become a sort of 'wild card' script. Sometimes the mobs just run at the player and never attack, sometimes it attracts every mob in the room, sometimes just the mobs of the same editor ID as the aggro'd one. Sometimes the mob is not lootable, sometimes the enemy does nothing.

 

Just as some background information, SFKWorgenFaction has a modifiers of 100 to playerfaction, both SFKWorgenFaction and SFKWorgenFaction2, and -100 to preyfaction and SFKDalaranFaction (The NPC's friendly to the player

 

SFKWorgenFaction2 has a modifier of -200 to SFKDalaranFaction, PlayerFaction, PreyFaction, and 100 to both worgen factions.

 

Does anyone know enough about scripting to know what's wrong with this script? If it can't be fixed, I'll have to leave it out and go back to the ways of all enemies just piling up on the player in each cell, because that's better than getting effects like those mentioned earlier. Unless anyone knows of an even better way to make enemies not attack the player until he's close enough.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...