3.3.5 profession NPC

Indította Nobody, 2013 január 26, 11:12:19 DÉLUTÁN

Előző téma - Következő téma

Nobody

Lattam 1-1 szerveren olyan npc-t ami gossip ben kepes volt a szakmakat kitanitani es a maxra huzni instant...lattam hogy volt mar ilyen tema...de amit ott talaltam nem mukodott....tehat a friss Trinityhez kellene :P aki tudna ilyen scriptet azt szepen kerem irja le nekem vagy pmben   ;D

IrOn

#include "ScriptPCH.h"



int GetProffNumber(Player* pPlayer)

{

if(!pPlayer)

return 0;



int profnumber = 0;



if(pPlayer->HasSpell(2259)) //Alchemy

profnumber += 1;



if(pPlayer->HasSpell(2018)) //Blacksmithing

profnumber += 1;



if(pPlayer->HasSpell(7411)) //Enchanting

profnumber += 1;



if(pPlayer->HasSpell(4036)) //Engineering

profnumber += 1;



if(pPlayer->HasSpell(2366)) //Herbalism

profnumber += 1;



if(pPlayer->HasSpell(45357)) //Inscription

profnumber += 1;



if(pPlayer->HasSpell(25229)) //Jewelcrafting

profnumber += 1;



if(pPlayer->HasSpell(2108)) //Leatherworking

profnumber += 1;



if(pPlayer->HasSpell(2575)) //Mining

profnumber += 1;



if(pPlayer->HasSpell(8613)) //Skinning

profnumber += 1;



if(pPlayer->HasSpell(3908)) //Tailoring

profnumber += 1;



return profnumber;

}



void LearnProf(Player* pPlayer, int prof)

{

/*

Prof Numbers

1:Alchemy

2:Blacksmithing

3:Enchanting

4:Engineering

5:Herbalism

6:Inscription

7:Jewelcrafting

8:Leatherworking

9:Mining

10:Skinning

11:Tailoring

*/



if(!pPlayer || prof > 11 || prof < 1)

return;



if(prof == 1) //Alchemy

{

pPlayer->learnSpell(2259, false);

pPlayer->learnSpell(3101, false);

pPlayer->learnSpell(53042, false);

pPlayer->learnSpell(3464, false);

pPlayer->learnSpell(11611, false);

pPlayer->learnSpell(28596, false);

pPlayer->learnSpell(51304, false);

pPlayer->SetSkill(171, pPlayer->GetSkillStep(171), 450, 450);

}



if(prof == 2) //Blacksmithing

{

pPlayer->learnSpell(2018, false);

pPlayer->learnSpell(3100, false);

pPlayer->learnSpell(3538, false);

pPlayer->learnSpell(9785, false);

pPlayer->learnSpell(29844, false);

pPlayer->learnSpell(51300, false);

pPlayer->SetSkill(164, pPlayer->GetSkillStep(164), 450, 450);

}



if(prof == 3) //Enchanting

{

pPlayer->learnSpell(7411, false);

pPlayer->learnSpell(7412, false);

pPlayer->learnSpell(7413, false);

pPlayer->learnSpell(13920, false);

pPlayer->learnSpell(28029, false);

pPlayer->learnSpell(51313, false);

pPlayer->SetSkill(333, pPlayer->GetSkillStep(333), 450, 450);

}



if(prof == 4) //Engineering

{

pPlayer->learnSpell(4036, false);

pPlayer->learnSpell(4037, false);

pPlayer->learnSpell(4038, false);

pPlayer->learnSpell(12656, false);

pPlayer->learnSpell(30350, false);

pPlayer->learnSpell(51306, false);

pPlayer->learnSpell(20219, false);

pPlayer->learnSpell(20222, false);

pPlayer->SetSkill(202, pPlayer->GetSkillStep(202), 450, 450);

}



if(prof == 5) //Herbalism

{

pPlayer->learnSpell(2366, false);

pPlayer->learnSpell(2368, false);

pPlayer->learnSpell(3570, false);

pPlayer->learnSpell(11993, false);

pPlayer->learnSpell(28695, false);

pPlayer->learnSpell(50300, false);

pPlayer->SetSkill(182, pPlayer->GetSkillStep(182), 450, 450);

}



if(prof == 6) //Inscription

{

pPlayer->learnSpell(45357, false);

pPlayer->learnSpell(45358, false);

pPlayer->learnSpell(45359, false);

pPlayer->learnSpell(45360, false);

pPlayer->learnSpell(45361, false);

pPlayer->learnSpell(45363, false);

pPlayer->SetSkill(773, pPlayer->GetSkillStep(773), 450, 450);

}



if(prof == 7) //Jewelcrafting

{

pPlayer->learnSpell(25229, false);

pPlayer->learnSpell(25230, false);

pPlayer->learnSpell(28894, false);

pPlayer->learnSpell(28895, false);

pPlayer->learnSpell(28897, false);

pPlayer->learnSpell(51311, false);

pPlayer->SetSkill(755, pPlayer->GetSkillStep(755), 450, 450);

}



if(prof == 8) //Leatherworking

{

pPlayer->learnSpell(2108, false);

pPlayer->learnSpell(3104, false);

pPlayer->learnSpell(3811, false);

pPlayer->learnSpell(10662, false);

pPlayer->learnSpell(32549, false);

pPlayer->learnSpell(51302, false);

pPlayer->SetSkill(165, pPlayer->GetSkillStep(165), 450, 450);

}



if(prof == 9) //Mining

{

pPlayer->learnSpell(2575, false);

pPlayer->learnSpell(2576, false);

pPlayer->learnSpell(3564, false);

pPlayer->learnSpell(10248, false);

pPlayer->learnSpell(29354, false);

pPlayer->learnSpell(50310, false);

pPlayer->SetSkill(186, pPlayer->GetSkillStep(186), 450, 450);

}



if(prof == 10) //Skinning

{

pPlayer->learnSpell(8613, false);

pPlayer->learnSpell(8617, false);

pPlayer->learnSpell(8618, false);

pPlayer->learnSpell(10768, false);

pPlayer->learnSpell(32678, false);

pPlayer->learnSpell(50305, false);

pPlayer->SetSkill(393, pPlayer->GetSkillStep(393), 450, 450);

}



if(prof == 11) //Tailoring

{

pPlayer->learnSpell(3908, false);

pPlayer->learnSpell(3909, false);

pPlayer->learnSpell(3910, false);

pPlayer->learnSpell(12180, false);

pPlayer->learnSpell(26790, false);

pPlayer->learnSpell(51309, false);

pPlayer->SetSkill(197, pPlayer->GetSkillStep(197), 450, 450);

}

}



void ListProffsForLearning(Player* pPlayer)

{

if(!pPlayer)

return;



pPlayer->ADD_GOSSIP_ITEM(0, "(Figyelem a trener 450.-ig adja a skill a proffokhoz!!!.)", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+15);

pPlayer->ADD_GOSSIP_ITEM(0, "A kovetkezo szakmak kozul valaszthatsz:", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);



if(!pPlayer->HasSpell(2259)) //Alchemy

pPlayer->ADD_GOSSIP_ITEM(0, "Alchemy", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);



if(!pPlayer->HasSpell(2018)) //Blacksmithing

pPlayer->ADD_GOSSIP_ITEM(0, "Blacksmithing", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5);



if(!pPlayer->HasSpell(7411)) //Enchanting

pPlayer->ADD_GOSSIP_ITEM(0, "Enchanting", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6);



if(!pPlayer->HasSpell(4036)) //Engineering

pPlayer->ADD_GOSSIP_ITEM(0, "Engineering", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+7);



if(!pPlayer->HasSpell(2366)) //Herbalism

pPlayer->ADD_GOSSIP_ITEM(0, "Herbalism", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+8);



if(!pPlayer->HasSpell(45357)) //Inscription

pPlayer->ADD_GOSSIP_ITEM(0, "Inscription", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+9);



if(!pPlayer->HasSpell(25229)) //Jewelcrafting

pPlayer->ADD_GOSSIP_ITEM(0, "Jewelcrafting", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+10);



if(!pPlayer->HasSpell(2108)) //Leatherworking

pPlayer->ADD_GOSSIP_ITEM(0, "Leatherworking", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+11);



if(!pPlayer->HasSpell(2575)) //Mining

pPlayer->ADD_GOSSIP_ITEM(0, "Mining", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+12);



if(!pPlayer->HasSpell(8613)) //Skinning

pPlayer->ADD_GOSSIP_ITEM(0, "Skinning", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+13);



if(!pPlayer->HasSpell(3908)) //Tailoring

pPlayer->ADD_GOSSIP_ITEM(0, "Tailoring", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+14);

}



class global_proff_trainer : public CreatureScript

{

public:

    global_proff_trainer() : CreatureScript("global_proff_trainer") { }



    bool OnGossipSelect(Player *pPlayer, Creature * pCreature, uint32 sender, uint32 action)

    {

        switch(action)

        {

            case GOSSIP_ACTION_INFO_DEF+1:

                break;

    case GOSSIP_ACTION_INFO_DEF+2:

    break;

    case GOSSIP_ACTION_INFO_DEF+3:

    break;

    case GOSSIP_ACTION_INFO_DEF+4:

    LearnProf(pPlayer, 1);

    break;

    case GOSSIP_ACTION_INFO_DEF+5:

    LearnProf(pPlayer, 2);

    break;

    case GOSSIP_ACTION_INFO_DEF+6:

    LearnProf(pPlayer, 3);

    break;

    case GOSSIP_ACTION_INFO_DEF+7:

    LearnProf(pPlayer, 4);

    break;

    case GOSSIP_ACTION_INFO_DEF+8:

    LearnProf(pPlayer, 5);

    break;

    case GOSSIP_ACTION_INFO_DEF+9:

    LearnProf(pPlayer, 6);

    break;

    case GOSSIP_ACTION_INFO_DEF+10:

    LearnProf(pPlayer, 7);

    break;

    case GOSSIP_ACTION_INFO_DEF+11:

    LearnProf(pPlayer, 8);

    break;

    case GOSSIP_ACTION_INFO_DEF+12:

    LearnProf(pPlayer, 9);

    break;

    case GOSSIP_ACTION_INFO_DEF+13:

    LearnProf(pPlayer, 10);

    break;

    case GOSSIP_ACTION_INFO_DEF+14:

    LearnProf(pPlayer, 11);

    break;

    case GOSSIP_ACTION_INFO_DEF+15:

    break;

        }



    pPlayer->CLOSE_GOSSIP_MENU();



        return true;

    }



    bool OnGossipHello(Player *pPlayer, Creature * pCreature)

    {

    int profnum = GetProffNumber(pPlayer);



    if(profnum == 22)

    pPlayer->ADD_GOSSIP_ITEM(0, "Sajnalom de tobb szakmat nem tanulhatsz.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);

    else if(profnum > 22)

    {

    pPlayer->ADD_GOSSIP_ITEM(0, "Neked tobb mint 22 szakmad van ami szabalyellenes, a szabalysertest jelentettem a gm-eknek.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);

    sLog->outError("A(z) %s nevu karakternek %i szakmaja van.", pPlayer->GetName(), profnum);

    }

    else if(profnum < 22)

    {

    ListProffsForLearning(pPlayer);

    }



        pPlayer->SEND_GOSSIP_MENU(1, pCreature->GetGUID());

        return true;

    }



};





void AddSC_global_proff_trainer()

{

    new global_proff_trainer();

}

Nobody

Meg uj vok a script beforgatasban de beforgattam http://collab.kpsn.org/display/tc/How-to_CustomScript alapjan de failed et kaptam

Raisen

Akkor az lett volna az első, hogy a fórumon legfőképp script témákban körül nézel mielőtt neki állasz. . .


http://infobarkacs.hu/index.php/topic,7141.0.html


▀█▀ █▀▀▄ █▀▀ █▀▀█ ▒█▀▀█ █▀▀█ █▀▀█ █░█ █▀▀█ █▀▀ █▀▀ ░ █░░█ █░░█
▒█░ █░░█ █▀▀ █░░█ ▒█▀▀▄ █▄▄█ █▄▄▀ █▀▄ █▄▄█ █░░ ▀▀█ ▄ █▀▀█ █░░█
▄█▄ ▀░░▀ ▀░░ ▀▀▀▀ ▒█▄▄█ ▀░░▀ ▀░▀▀ ▀░▀ ▀░░▀ ▀▀▀ ▀▀▀ █ ▀░░▀ ░▀▀▀

Nobody

elolvastam az a cikket de....voltak beszolasok es 1 valasz "hogy honnan látod, hogy passzol-e a szervered verziójához, jelzik általában a téma elején (skyfire)." nah de en Trinity vel "dolgozok" es nem igy mentek a dolgok....ezert a Trinity wikijeben keresgeltem es talaltam majd meg ma probalkozom  :P

Locutus

Van itt a forumon trinity script forgatás is....  Nem egy ember írta le tökéletesen hogyan forgatsz scriptet be. De ha akarod elmagyarázom én neked ...... TS vagy Skype on megtalálható vagyok ha véletlenül érdekelne.(Ha érdekel akkor PM be elküldöm az elérhetőségemet.)
Álljon fel az ország imádandó széki!
Nemzetek, országok, hódoljatok néki!
Uralkodjék köztünk ész, érdem, igazság,
Törvény s egyenlőség, s te, áldott szabadság!

Raisen

#6
Ennyit mondok a skyfire ügyre.

Copyright (C) 2011-2012 Project SkyFire <http://www.projectskyfire.org/>
* Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>

A scriptek ugyan úgy működnek ami a tc legújabb revéről van áthozva. Mind a kettő ugyan azon a nyelven írodott sőt a tc utolsó rev felépítése közel ugyan az mint a skyfirenak ezért nem is kell módosítani a macrok (includek) beolvasásán. Skyfiren használom a tc scripteket és vissza fele is igaz "Custom"

Off:
Nem értem mi nehéz ebben a custom mappába berakod a scriptet cmakelistben hozzá adod a scripted nevét majd a scriptloaderbe be írod az utolsó előtti sort ami a scriptben van első helyre voidal a végére void nélkül és csapathatod. (Ennyi nem lenne elég az example mappában mindenre van leírás amire szükséged lehet és részletesen le van írva mi mire jó.)

GOOSIP
Idéz/*
* Copyright (C) 2011-2012 Project SkyFire <http://www.projectskyfire.org/>
* Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2012 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 3 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, see <http://www.gnu.org/licenses/>.
*/

/* ScriptData
SDName: Example_Gossip_Codebox
SD%Complete: 100
SDComment: Show a codebox in gossip option
SDCategory: Script Examples
EndScriptData */

#include "ScriptPCH.h"
#include <cstring>

enum eEnums
{
    SPELL_POLYMORPH         = 12826,
    SPELL_MARK_OF_THE_WILD  = 26990,

    SAY_NOT_INTERESTED      = -1999922,
    SAY_WRONG               = -1999923,
    SAY_CORRECT             = -1999924
};

#define GOSSIP_ITEM_1       "A quiz: what's your name?"
#define GOSSIP_ITEM_2       "I'm not interested"

class example_gossip_codebox : public CreatureScript
{
    public:

        example_gossip_codebox()
            : CreatureScript("example_gossip_codebox")
        {
        }

        bool OnGossipHello(Player* player, Creature* creature)
        {
            player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_ITEM_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1, "", 0, true);
            player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);

            player->PlayerTalkClass->SendGossipMenu(907, creature->GetGUID());

            return true;
        }

        bool OnGossipSelect(Player* player, Creature* creature, uint32 /*Sender*/, uint32 action)
        {
            player->PlayerTalkClass->ClearMenus();
            if (action == GOSSIP_ACTION_INFO_DEF+2)
            {
                DoScriptText(SAY_NOT_INTERESTED, creature);
                player->CLOSE_GOSSIP_MENU();
            }

            return true;
        }

        bool OnGossipSelectCode(Player* player, Creature* creature, uint32 Sender, uint32 action, const char* code)
        {
            player->PlayerTalkClass->ClearMenus();
            if (Sender == GOSSIP_SENDER_MAIN)
            {
                switch (action)
                {
                case GOSSIP_ACTION_INFO_DEF+1:
                    if (std::strcmp(code, player->GetName()) != 0)
                    {
                        DoScriptText(SAY_WRONG, creature);
                        creature->CastSpell(player, SPELL_POLYMORPH, true);
                    }
                    else
                    {
                        DoScriptText(SAY_CORRECT, creature);
                        creature->CastSpell(player, SPELL_MARK_OF_THE_WILD, true);
                    }
                    player->CLOSE_GOSSIP_MENU();

                    return true;
                }
            }

            return false;
        }
};

void AddSC_example_gossip_codebox()
{
    new example_gossip_codebox();
}

Creature

Idéz/*
* Copyright (C) 2011-2012 Project SkyFire <http://www.projectskyfire.org/>
* Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2012 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 3 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, see <http://www.gnu.org/licenses/>.
*/

/* ScriptData
SDName: Example_Creature
SD%Complete: 100
SDComment: Short custom scripting example
SDCategory: Script Examples
EndScriptData */

#include "ScriptPCH.h"

// **** This script is designed as an example for others to build on ****
// **** Please modify whatever you'd like to as this script is only for developement ****

// **** Script Info* ***
// This script is written in a way that it can be used for both friendly and hostile monsters
// Its primary purpose is to show just how much you can really do with scripts
// I recommend trying it out on both an agressive NPC and on friendly npc

// **** Quick Info* ***
// Functions with Handled Function marked above them are functions that are called automatically by the core
// Functions that are marked Custom Function are functions I've created to simplify code

enum Yells
{
    //List of text id's. The text is stored in database, also in a localized version
    //(if translation not exist for the textId, default english text will be used)
    //Not required to define in this way, but simplify if changes are needed.
    SAY_AGGRO                                   = -1999900,
    SAY_RANDOM_0                                = -1999901,
    SAY_RANDOM_1                                = -1999902,
    SAY_RANDOM_2                                = -1999903,
    SAY_RANDOM_3                                = -1999904,
    SAY_RANDOM_4                                = -1999905,
    SAY_BERSERK                                 = -1999906,
    SAY_PHASE                                   = -1999907,
    SAY_DANCE                                   = -1999908,
    SAY_SALUTE                                  = -1999909,
    SAY_EVADE                                   = -1999910,
};

enum Spells
{
    // List of spells.
    // Not required to define them in this way, but will make it easier to maintain in case spellId change
    SPELL_BUFF                                  = 25661,
    SPELL_ONE                                   = 12555,
    SPELL_ONE_ALT                               = 24099,
    SPELL_TWO                                   = 10017,
    SPELL_THREE                                 = 26027,
    SPELL_FRENZY                                = 23537,
    SPELL_BERSERK                               = 32965,
};

enum eEnums
{
    // any other constants
    FACTION_WORGEN                              = 24
};

//List of gossip item texts. Items will appear in the gossip window.
#define GOSSIP_ITEM     "I'm looking for a fight"

class example_creature : public CreatureScript
{
    public:

        example_creature()
            : CreatureScript("example_creature")
        {
        }

        struct example_creatureAI : public ScriptedAI
        {
            // *** HANDLED FUNCTION ***
            //This is the constructor, called only once when the Creature is first created
            example_creatureAI(Creature* creature) : ScriptedAI(creature) {}

            // *** CUSTOM VARIABLES ****
            //These variables are for use only by this individual script.
            //Nothing else will ever call them but us.

            uint32 m_uiSayTimer;                                    // Timer for random chat
            uint32 m_uiRebuffTimer;                                 // Timer for rebuffing
            uint32 m_uiSpell1Timer;                                 // Timer for spell 1 when in combat
            uint32 m_uiSpell2Timer;                                 // Timer for spell 1 when in combat
            uint32 m_uiSpell3Timer;                                 // Timer for spell 1 when in combat
            uint32 m_uiBeserkTimer;                                 // Timer until we go into Beserk (enraged) mode
            uint32 m_uiPhase;                                       // The current battle phase we are in
            uint32 m_uiPhaseTimer;                                  // Timer until phase transition

            // *** HANDLED FUNCTION ***
            //This is called after spawn and whenever the core decides we need to evade
            void Reset()
            {
                m_uiPhase = 1;                                      // Start in phase 1
                m_uiPhaseTimer = 60000;                             // 60 seconds
                m_uiSpell1Timer = 5000;                             //  5 seconds
                m_uiSpell2Timer = urand(10000, 20000);               // between 10 and 20 seconds
                m_uiSpell3Timer = 19000;                            // 19 seconds
                m_uiBeserkTimer = 120000;                           //  2 minutes

                me->RestoreFaction();
            }

            // *** HANDLED FUNCTION ***
            // Enter Combat called once per combat
            void EnterCombat(Unit* who)
            {
                //Say some stuff
                DoScriptText(SAY_AGGRO, me, who);
            }

            // *** HANDLED FUNCTION ***
            // Attack Start is called when victim change (including at start of combat)
            // By default, attack who and start movement toward the victim.
            //void AttackStart(Unit* who)
            //{
            //    ScriptedAI::AttackStart(who);
            //}

            // *** HANDLED FUNCTION ***
            // Called when going out of combat. Reset is called just after.
            void EnterEvadeMode()
            {
                DoScriptText(SAY_EVADE, me);
            }

            // *** HANDLED FUNCTION ***
            //Our Receive emote function
            void ReceiveEmote(Player* /*player*/, uint32 uiTextEmote)
            {
                me->HandleEmoteCommand(uiTextEmote);

                switch (uiTextEmote)
                {
                    case TEXT_EMOTE_DANCE:
                        DoScriptText(SAY_DANCE, me);
                        break;
                    case TEXT_EMOTE_SALUTE:
                        DoScriptText(SAY_SALUTE, me);
                        break;
                }
             }

            // *** HANDLED FUNCTION ***
            //Update AI is called Every single map update (roughly once every 50ms if a player is within the grid)
            void UpdateAI(const uint32 uiDiff)
            {
                //Out of combat timers
                if (!me->getVictim())
                {
                    //Random Say timer
                    if (m_uiSayTimer <= uiDiff)
                    {
                        //Random switch between 5 outcomes
                        DoScriptText(RAND(SAY_RANDOM_0, SAY_RANDOM_1, SAY_RANDOM_2, SAY_RANDOM_3, SAY_RANDOM_4), me);

                        m_uiSayTimer = 45000;                      //Say something agian in 45 seconds
                    }
                    else
                        m_uiSayTimer -= uiDiff;

                    //Rebuff timer
                    if (m_uiRebuffTimer <= uiDiff)
                    {
                        DoCast(me, SPELL_BUFF);
                        m_uiRebuffTimer = 900000;                  //Rebuff agian in 15 minutes
                    }
                    else
                        m_uiRebuffTimer -= uiDiff;
                }

                //Return since we have no target
                if (!UpdateVictim())
                    return;

                //Spell 1 timer
                if (m_uiSpell1Timer <= uiDiff)
                {
                    //Cast spell one on our current target.
                    if (rand()%50 > 10)
                        DoCast(me->getVictim(), SPELL_ONE_ALT);
                    else if (me->IsWithinDist(me->getVictim(), 25.0f))
                        DoCast(me->getVictim(), SPELL_ONE);

                    m_uiSpell1Timer = 5000;
                }
                else
                    m_uiSpell1Timer -= uiDiff;

                //Spell 2 timer
                if (m_uiSpell2Timer <= uiDiff)
                {
                    //Cast spell two on our current target.
                    DoCast(me->getVictim(), SPELL_TWO);
                    m_uiSpell2Timer = 37000;
                }
                else
                    m_uiSpell2Timer -= uiDiff;

                //Beserk timer
                if (m_uiPhase > 1)
                {
                    //Spell 3 timer
                    if (m_uiSpell3Timer <= uiDiff)
                    {
                        //Cast spell one on our current target.
                        DoCast(me->getVictim(), SPELL_THREE);

                        m_uiSpell3Timer = 19000;
                    }
                    else
                        m_uiSpell3Timer -= uiDiff;

                    if (m_uiBeserkTimer <= uiDiff)
                    {
                        //Say our line then cast uber death spell
                        DoScriptText(SAY_BERSERK, me, me->getVictim());
                        DoCast(me->getVictim(), SPELL_BERSERK);

                        //Cast our beserk spell agian in 12 seconds if we didn't kill everyone
                        m_uiBeserkTimer = 12000;
                    }
                    else
                        m_uiBeserkTimer -= uiDiff;
                }
                else if (m_uiPhase == 1)                            //Phase timer
                {
                    if (m_uiPhaseTimer <= uiDiff)
                    {
                        //Go to next phase
                        ++m_uiPhase;
                        DoScriptText(SAY_PHASE, me);
                        DoCast(me, SPELL_FRENZY);
                    }
                    else
                        m_uiPhaseTimer -= uiDiff;
                }

                DoMeleeAttackIfReady();
            }
        };

        CreatureAI* GetAI(Creature* creature) const
        {
            return new example_creatureAI(creature);
        }

        bool OnGossipHello(Player* player, Creature* creature)
        {
            player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
            player->SEND_GOSSIP_MENU(907, creature->GetGUID());

            return true;
        }

        bool OnGossipSelect(Player* player, Creature* creature, uint32 /*Sender*/, uint32 action)
        {
            player->PlayerTalkClass->ClearMenus();
            if (action == GOSSIP_ACTION_INFO_DEF+1)
            {
                player->CLOSE_GOSSIP_MENU();
                //Set our faction to hostile towards all
                creature->setFaction(FACTION_WORGEN);
                creature->AI()->AttackStart(player);
            }

            return true;
        }
};

//This is the actual function called only once durring InitScripts()
//It must define all handled functions that are to be run in this script
void AddSC_example_creature()
{
    new example_creature();
}


▀█▀ █▀▀▄ █▀▀ █▀▀█ ▒█▀▀█ █▀▀█ █▀▀█ █░█ █▀▀█ █▀▀ █▀▀ ░ █░░█ █░░█
▒█░ █░░█ █▀▀ █░░█ ▒█▀▀▄ █▄▄█ █▄▄▀ █▀▄ █▄▄█ █░░ ▀▀█ ▄ █▀▀█ █░░█
▄█▄ ▀░░▀ ▀░░ ▀▀▀▀ ▒█▄▄█ ▀░░▀ ▀░▀▀ ▀░▀ ▀░░▀ ▀▀▀ ▀▀▀ █ ▀░░▀ ░▀▀▀

Nobody

#7
-

Nobody

#8
Talaltam 1 Profession NPC scriptet amit viszont sikerult beforgatni es ugy lattam mukodik tehat sztem a script amit Iron kuldott hibas :P
link: http://pastebin.com/JZA37DZK
Ezt csak azert irtam le ha mas is abba a helyzetbe kerulne mint en...jah es keszitettem egy NPC t is (SQL) amit world be kell importalni xP
INSERT INTO `creature_template` (`entry`, `difficulty_entry_1`, `difficulty_entry_2`, `difficulty_entry_3`, `KillCredit1`, `KillCredit2`, `modelid1`, `modelid2`, `modelid3`, `modelid4`, `name`, `subname`, `IconName`, `gossip_menu_id`, `minlevel`, `maxlevel`, `exp`, `faction_A`, `faction_H`, `npcflag`, `speed_walk`, `speed_run`, `scale`, `rank`, `mindmg`, `maxdmg`, `dmgschool`, `attackpower`, `dmg_multiplier`, `baseattacktime`, `rangeattacktime`, `unit_class`, `unit_flags`, `unit_flags2`, `dynamicflags`, `family`, `trainer_type`, `trainer_spell`, `trainer_class`, `trainer_race`, `minrangedmg`, `maxrangedmg`, `rangedattackpower`, `type`, `type_flags`, `lootid`, `pickpocketloot`, `skinloot`, `resistance1`, `resistance2`, `resistance3`, `resistance4`, `resistance5`, `resistance6`, `spell1`, `spell2`, `spell3`, `spell4`, `spell5`, `spell6`, `spell7`, `spell8`, `PetSpellDataId`, `VehicleId`, `mingold`, `maxgold`, `AIName`, `MovementType`, `InhabitType`, `HoverHeight`, `Health_mod`, `Mana_mod`, `Armor_mod`, `RacialLeader`, `questItem1`, `questItem2`, `questItem3`, `questItem4`, `questItem5`, `questItem6`, `movementId`, `RegenHealth`, `equipment_id`, `mechanic_immune_mask`, `flags_extra`, `ScriptName`, `WDBVerified`) VALUES (66678, 0, 0, 0, 0, 0, 21666, 0, 0, 0, 'Nobody', 'Professions Trainer', '', 0, 80, 80, 0, 35, 35, 1, 1, 1.14286, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 2048, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 3, 1, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 'Professions_NPC', 12340);

NPC ID : 66678

IrOn


Nobody

Proffession NPC Fix (Latest TC) ...ez szurt nekem szemet es gondoltam kiprobalom amugy a legfrissebb TC vel ment neked?

IrOn

régebben próbáltam, akkor még ment

Powered by EzPortal