Two things:
One, use if(defined($Group)) - it's safer.
Two, the reason the CastGroupSpell function fails to work is because the function needs all spells in the list to have an 'aoe range' specified in the spell.
https://github.com/EQEmu/Server/blob...roups.cpp#L855
You will have to loop through the group members to buff everyone in the group, that function will not work as you intend it to.