• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

[SOLVED] Hey Could i add MaxRange to group check script ?

Status
Not open for further replies.

callmephil

Respected Member
Hey, i've been working on a group script for many different script like mass group teleportation or mass group loot. but i've ecounter a problem. any-time player is in group without being in the same range of the creature it will also apply to it.

How could i add a Range Check to this script ?

Code:
void PlayerIsInGroup(Player* player)
{
	Group * group = player->GetGroup();

	Group::MemberSlotList const &members = group->GetMemberSlots();
	for (Group::MemberSlotList::const_iterator itr = members.begin(); itr != members.end(); ++itr)
	{
		Group::MemberSlot const &slot = *itr;
		Player* player = ObjectAccessor::FindPlayer((*itr).guid);
		if (player && player->GetSession())
			player->GetSpellHistory()->ResetAllCooldowns();
	}
}

Thanks for replying !
 
Last edited by a moderator:

callmephil

Respected Member
Hmm, I think i'm on the wrong section since i didin't found the TrinityCore Support forum, Tommy could you move me on it ?
 

Tommy

Founder
Hmm, I think i'm on the wrong section since i didin't found the TrinityCore Support forum, Tommy could you move me on it ?

You are in the correct section. If this is because I mentioned Eluna, what I linked is NOT Lua code if you looked. :p
 
Status
Not open for further replies.
Top