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 !
|
Thanks to KLS, this script should now be obsolete:
http://code.google.com/p/projecteqem...c=svn465&r=465 :) |
Inspired by this thread btw, in case anyone was wondering.
|
With the frequency that we use that client search quest code, I think it would make a good addition to the source if we could figure out the best way to handle it in the code for quests. I was thinking of making a new sub event similar to timers, and you would call it in a similar way. Then, it would just do a for loop on anything matching that client search name.
Code:
sub EVENT_SPAWN { Or, maybe just add a way to easily make a list of all clients or all NPCs in a zone. Maybe something that would look through the entity list and make a new list of whatever you are looking for. I think that would cut down the overhead of doing a FOR loop to 2000 every time. Then, it would also be nice to have a way to pull the top entity ID from the zone so instead of setting it to 2000, it could be set to whatever the actual top ID number is. Getting a bit off topic here though. Thinking about making a new post in the features requests about it. It would be very useful if we could come up with a way to handle this easily. There are just too many uses for being able to find any client in a zone at random, or by distance, or whatever you specify. I just don't know the best way to handle it yet to start coding it. |
Not trying to Hijack but KLS while your on that subject could you also add functions in NPCSPECIALATTK so that mobs can be Un-Lullable, and Un-Pacifyable please ??
Thanks in advance King www.raidaddicts.org |
I can but might wanna post it in features requests incase I forget.
|
All times are GMT -4. The time now is 10:56 AM. |
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.