PDA

View Full Version : Check Buffs Before Cast


Hateborne
01-12-2011, 09:30 PM
Evening ladies and gents, I come to you with a question (or series..depending).

Can some one point me in the direction of where I might find either examples of buff checking or provide one?

Basically, I am looking to check for a certain buff during the casting process. To better demonstrate, I'll use Gift of Mana (AAXP) as my guinea pig.

A) Player casts Nuke001.
B) Player completes Nuke001, orc pawn is roflstomped.
C) Player gains Gift of Mana.
D) Player casts Nuke002. etc etc

I am looking to add in a check for certain buffs (i.e. Gift of Mana) during the casting process for possibly allowing a stacking effect (or if nothing else, for my own point of reference).


I appreciate any and all help provided!

-Hateborne

Caryatis
01-12-2011, 10:29 PM
You mean in a perl script or in the source? Also not quite sure what you mean by stacking effect, like add another spell?

Hateborne
01-13-2011, 11:27 AM
Apologies for not clarifying.

In the source (C++).

I chose Gift of Mana because the effect is similar. Currently, I have issues with Gift of Mana not working in the current source version.

Player has 50k mana.
Player casts Nuke001 (30k mana).
Player gains Gift of Mana.
Player has Gift of Mana but CANNOT cast Nuke002 (25k mana) because the client is only checking current mana and ignoring the fact that he has GoM up.

Basically, in the source I am using (possibly even the ones on servers) GoM will only work if the player already had the mana to cast the spell. If you have GoM but don't have the actual amount to cast the spell....no go.

Trying to find a way to add a check for either a dynamic spell id (search for the spell id where the name matches 'Gift of Mana') or hardcode in the spell id from my spell file. As server goes to set the mana cost, if buff GoM is found, then mana cost is set to 1.

The stacking thing is something completely different (as I have learned last night). Ignore that bit.



Thank you for the reply and thank you in advance for any more you can provide!

-Hate

Caryatis
01-13-2011, 07:33 PM
Just to be clear, that's how it works on live as well. You need to have the full amount for the spell even if you aren't going to use any of it.

However if you wanted to alter it so its like that, search spells.cpp for the message you get when you don't have enough mana, that is going to be the spot you want to add a check to.

Hateborne
01-13-2011, 07:40 PM
I see, thank you for the heads up and information.

-Hateborne