Plugin::ArcheryAttack()
Going to post it for now. May need more work, as I was unable to test the complete functionality for Hitting of All clients (couldn't set it up to connect more than one).
What this plugin will do is allow a mob to do a custom archery attack against either, Current Target, All Targets on hatelist, or a random target on the mob's hatelist. Certain variables are settable in the main plugin file. Plugin requires RandomRange() from the following link: http://www.eqemulator.org/forums/showthread.php?t=30421 Here are the steps to add this plugin to your server: 1. Open notepad, or whatever text editor you prefer. 2. Copy and paste the following code into Notepad: Code:
# Usage: plugin::ArcheryAttack(MeanDamage, Variance, TargNumber); 4. Look over the variables in the ArcheryAttack.pl that you just saved, can edit a few different variables to customize how it works in accordance with what you want. 5. Do a #questreload and the new plugin should be ready for use Here is an example script: Code:
sub EVENT_SPAWN { Usage for this Plugin? Can set up a mob to have three timers once aggroed, one for the Single Target, one for the Hit all, one for hit random target on a permarooted mob and you now have a ranged fight. Give the mob high min/max damage to encourage people to stay out of melee. Was more developed as a way to see if I could do something like this. Current caveat, I could not find a way to pull a player's Shielding, so I used AC to simulate (poorly) a player's shielding. AC / 75 = Shielding Percent. If anyone has any ideas to get around that, please let me know! |
That looks like a pretty fun plugin for custom servers wanting to simulate ranged attacks. I have actually been wanting to add one in that simulates it more like you might see on Live using the following commands and more:
Code:
CheckLoSToLoc(x, y, z, [mob_size]) Code:
bool Mob::CheckHitChance(Mob* other, SkillType skillinuse, int Hand) Or, maybe I should just do it the right way and try to just write it all in the source code so Ranger class NPCs with Bows in their loot table or with a Bow weapon model equiped will use ranged attacks automatically (maybe with a rule option to enable). I think KLS has some ranged NPC code started already, so it might just mean finishing that code off. I think the hard part will be making it so they don't constantly run toward the character, as I think they should just get within a certain range and check LoS and shoot from that position until they are out of range or lose their LoS to the target. |
Hmm. Your option is much better. I'm still rather new to the whole perl scripting side of things, so it was a challenge I made myself to see if I could do something a bit more advanced than "give me this item".
That being said, I did get a nice encounter working with this plugin, however, I will be the first to admit, it has its share of redundancy in the code, it is somewhat sloppy, and could be streamlined. I admit I am very thrilled with the prospect of ranger (or any bow using npcs) using a bow if they have one in their loot table/model equipped. That's something that even live hasn't done yet! |
kinda old i know but has anyone finshed anything 100%?. Because Necro swarm pet aa are supose to be archers yet they melee lol.
Ill take a look at this code and see if i cant use it but am rather new to this stuff myself |
Yeah is this functional? I noticed there is a rule in the DB about npc archery damage now, but I haven't found a way to make them actually use bows.
|
Add special attack 'Y' to NPCs and they will use archery if their target is out of melee range. The rule is a multiplier of their normal dmg since we dont have values for ranged npc dmg in the db yet.
|
All times are GMT -4. The time now is 08:21 AM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.