Is it possible to make Bosses or trash mobs to actually use cast time in order to cast spells?
Lets say X boss casting divine Shield within the next 10 sec for example.
Is it possible to make Bosses or trash mobs to actually use cast time in order to cast spells?
Lets say X boss casting divine Shield within the next 10 sec for example.
I'm not too sure if there is an explicit method to implement this, but with some simple code you could make something along these lines.
Sudo Code:
"#" means: Whatever cast chance, per second, you would like the mob to have (ie. 1-10)
"randomMax" means: the maximum number in your random number bounds (ie. In the above case, 10)
while(yourTimerVariable != 10)
{
temp = randomNumber("#")}
if(temp == randomMax)
{
"Make the mob cast the spell."}
"Break the loop"
"Increment your timer variable by 1 with an LUA or C++ timer function"
"Make the mob cast the spell."
Then I guess you could make this a standalone function, where all of the numbers are passed in, each time you want to call the function from a different mob.
Again, this is very rough psuedo code, as I am not fluent in scripting mobs, but I believe this would do the job
Best of luck!
-Haith
[Edit]: To clarify: what this would do is pick a random number between 1 and whatever number you would like. It would then compare this random number, to the greatest number in your random bound. If they are equal, the mob casts. If they are not equal, the mob doesn't cast, waits one second, and tries again. If after 10 seconds, the mob hasn't cast, it will cast the spell after the 10 seconds.
[Edit]: This would actually probably be quite a bit simpler:
temp = randomNumber(1-10)
while(yourTimerVariable != temp)
{
"Increment yourTimerVariable by 1"}
"Make the mob cast the spell."
Thought of this afterwards, quite a bit more straightforward. lol
Last edited by Haith; 05-19-2010 at 09:59 PM.