Voici mon code principale reste des modif a faire :
Citation :bool GossipHello_ffa(Player *player, Creature* pCreature)
{
pCreature->GetMotionMaster()->Initialize();
pCreature->SetUInt32Value(UNIT_NPC_EMOTESTATE,10);
player->ADD_GOSSIP_ITEM( 5, "Activer la zone ffa", GOSSIP_SENDER_MAIN, 1002);
player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, pCreature->GetObjectGuid());
return true;
}
void SendDefaultMenu_ffa(Player *player, Creature *pCreature, uint32 action )
{
if(!player->getAttackers().empty())
{
player->CLOSE_GOSSIP_MENU();
pCreature->MonsterSay(TEXTE_1, LANG_UNIVERSAL, NULL);
return;
}
switch(action)
{
case 1002:
uint32 newArea = pCreature->GetAreaId();
AreaTableEntry const* zone = GetAreaEntryByAreaID(newArea);
if (zone->flags & AREA_FLAG_SANCTUARY || newArea == 395)
{
player->RemoveSpellsCausingAura(SPELL_AURA_MOUNTED);
player->->SetByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_SANCTUARY);
player->SetFFAPvP(true);
player->->CombatStopWithPets();
}
break;
}
}
bool GossipSelect_ffa(Player *player, Creature *pCreature, uint32 sender, uint32 action )
{
// Main menu
if (sender == GOSSIP_SENDER_MAIN)
SendDefaultMenu_ffa(player, pCreature, action);
return true;
}
void AddSC_ffa()
{
Script *newscript;
newscript = new Script;
newscript->Name = "ffa";
newscript->pGossipHello = &GossipHello_ffa;
newscript->pGossipSelect = &GossipSelect_ffa;
newscript->pItemUse = NULL;
newscript->pGOUse = NULL;
newscript->pAreaTrigger = NULL;
newscript-> pQuestAcceptItem = NULL;
newscript->pQuestAcceptGO = NULL;
newscript->pQuestRewardedGO = NULL;
newscript->RegisterSelf();
}
voila et a force de telment chercher je me suis meme emmeler les pinceaux dans mon code et jaimerai que cela sapplique sur l'area et non pas le joueur si c'est possible biensur.
merci à vous.