Simulated AE Rampage code.
This code can be applied to any mob to simulate an AE Rampage effect that will look like like real rampage to the players. AE Rampage hits any melee's with "Rampage" within a certain radius of the mob. This code will work stand alone but can be modified to whatever you wish.
This works under sub EVENT_TIMER How I set it up. When mob is attacked, timer begins to set off the rampage code. Stores the mobs name, stores its max damage, then calculates what that damage would be with max shielding(can adjust this), then stores what half the max damage would be, and sets this as the min. rampage damage. Finally it finds the difference between the max and the min. More detailed bellow. Quote:
So for example. If mobs max hit is 6000. This code would find a random number between 3000-6000 for each client in range and damage them with it. Code: Code:
Kayen GM Storm Haven |
Very cool stuff. :)
|
Thanks for the step by step explaination, that rocked!
One question though: How would you mod this code to select a single random target(s) from the zone & then cast on them? It's there, I'm just not good enough yet to see it. |
Choosing a random player and casting on them.
It is actual not that simple.
Here is away to use this code to choose semi-random targets. It isn't truly random b/c the list always cycles in the same order so the players at top have a better chance of getting hit, however they will really never notice. It's not perfect but its functional. The code basically searches the clients, and then for each client does a random 1-20(This can be changed to whatever you want, I'd recommend however many players are at the event). If the number is 18 the effect essentially goes off on that player and the cycle ends, if 20 is saves the players ID, then starts a 3 sec timer, then from that timer it casts a spell on that player. If you don't roll a 29, nothing happens. Here is the commented code. Quote:
Code:
sub EVENT_TIMER { |
Perfect, thanks for the code man & for taking the time to respond!
|
Been playing with this a bit on my server.. Can't seem to get the mob to do any actual Damage with the rampage...
I'm not that great with Perl.. Can you look this thing over and fix it for us ? Would rock !! NICE work btw on this... Have always wanted to have mobs AE Ramp.. King |
Just thought i would point out for those using this coode that it is missing a paranthesis (sp?)...
Code:
sub EVENT_TIMER Code:
sub EVENT_TIMER { |
Thanks for pointing that out. I made the correction in the original post.
|
Maybe the syntax error was the problem Mort.
Let me know if your still having trouble. I know it works, have it in place on SH a various mobs. |
Well can see the Message that it's rampaging but no one gets any damage .. I was invul tanking but those around were taking no damage at all...
|
Mort,
Are you using a very large mob? The larger the mob the larger you need to make the rampage distance. Post the code your using I'll take a look, unless its exactly the same. Here is a direct copy and paste of just a trash mob I have using it. Feel free to just use that and let me know. Code:
sub EVENT_COMBAT { |
Alright well it is working but when it hits the player looks like this
NPC hits you for 21018.95 points damage I imagine thats 21,018.95 damage but it sure does look weird.. any way to lose the damage after the decimal so it's just 21,019 (maybe rounding it up or something) King |
Yeah, good catch actually here is what you need to change
old Code:
my $RampDamageVar = (int(rand($DamageVar ))) + $ShieldMinDam; Code:
my $RampDamageVar = (int(rand($DamageVar ))) + (int($ShieldMinDam)); I'll apply this to my code too, I didn't catch it when I was testing cause prob was using easily divisable numbers |
I edited those changes into the code in the first post so people using this will get the finished code without having to do any edits.
|
Thanks again !
|
All times are GMT -4. The time now is 05:19 PM. |
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.