Jump to content

[Help] Some scripts doesn't work now ...


Recommended Posts

Posted

Hello all, i know here is not a forum for the script but the core can be the source of the problem ..

Indeed, some custum scripts doesn't work but other work ...

Why ?

This scripts for exemple does'nt work now but before he do !

/* Copyright (C) 2006 - 2010 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/

/* ScriptData
SDName: npc_level_reroll
SD%Complete: 90
SDComment: Give level 80 at a player who have already one level 80
SDCategory: NPC
EndScriptData
*/

#include "precompiled.h"
#include <cstring>
extern DatabaseMysql CharacterDatabase;

bool GossipHello_npc_level_reroll(Player* pPlayer, Creature* pCreature)
{
   pPlayer->ADD_GOSSIP_ITEM(0, "Avez vous deja un level 80 sur ce compte ? Cliquez ici si OUI.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
   pPlayer->ADD_GOSSIP_ITEM(0, "Vous n'etes pas interesse !", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
   //pPlayer->ADD_GOSSIP_ITEM(0, "Avez vous déja un level 80 sur ce compte ? Cliquez ici si OUI.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
   //pPlayer->ADD_GOSSIP_ITEM(0, "Vous n'êtes pas intéressé !", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
   //pPlayer->PlayerTalkClass->SendGossipMenu(907,pCreature->GetGUID());
   return true;
}

bool GossipSelect_ok_npc_level_reroll(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
{

   if (uiAction == GOSSIP_ACTION_INFO_DEF+2)
   {
       pCreature->MonsterWhisper("Au revoir et bon jeu !", pPlayer->GetGUID()); // Bye !
       pPlayer->CLOSE_GOSSIP_MENU();
   }

   if (uiAction == GOSSIP_ACTION_INFO_DEF+1)
   {
       if (pPlayer->getLevel() == 80)
       {
       pCreature->MonsterWhisper("Tu as déja le niveau 80 sur ce personnage.", pPlayer->GetGUID()); // You are already 80
       pPlayer->CLOSE_GOSSIP_MENU();
       }
       else
          {
          QueryResult *result = CharacterDatabase.PQuery("SELECT count(*) FROM characters WHERE account = %u AND level = 80", pPlayer->GetSession()->GetAccountId());
          if (result)
           {
           Field *Fields = result->Fetch();
           uint32 count = Fields[0].GetUInt32(); //Get if have a level 80 from database
           if (count >= 1) // test if have a level 80 in the account of player, HERE YES
            {
            pPlayer->GiveLevel(pPlayer->getLevel()+(80 - (pPlayer->getLevel())));
            pCreature->MonsterWhisper("Voila vous êtes au niveau 80, bon jeu a vous !", pPlayer->GetGUID()); // You are already 80
            }    
            else
               {
               pCreature->MonsterWhisper("Bien essayé mais nous somme pas dupes !", pPlayer->GetGUID()); // You lie, Go out ! ^^
               pPlayer->CastSpell(pPlayer, 3355, false);
               pPlayer->CLOSE_GOSSIP_MENU();
               }
            }
           }            
   }
   return false;
}

void AddSC_npc_level_reroll()
{
   Script *newscript;
   newscript = new Script;
   newscript->Name = "npc_level_reroll";
   newscript->pGossipHello = &GossipHello_npc_level_reroll;
   newscript->pGossipSelect = &GossipSelect_ok_npc_level_reroll;
   newscript->RegisterSelf();
}

The post in scriptdev2: http://www.scriptdev2.com/c-help-please-t5075.html

Sorry for my english but i am french ..

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use