NPC Move Script

Hi,

I would like to bring a NPC to walk.

I have written an example scribt, bot i get an Erro in the Script Load file.

But really should not appear Erro.

Here is my script :

[CODE]/* ScriptData

SDName: npc_redoxx

SD%Complete: 10

SDComment: Quest support: 800204

SDCategory: Katakomben Sturmwind

EndScriptData */

#include “ScriptPCH.h”

#include “World.h”

#include “WorldPacket.h”

//npc_Redoxx

float WPs[8][4] =

{

//x y z

{-57.040409f, 71.295708f, -31.717337f},

{-34.896469f, 71.150421f, -31.717337f},

};

class npc_redoxx : public CreatureScript

{

public:

npc_redoxx() : CreatureScript("npc_redoxx") { }






CreatureAI* GetAI(Creature* pCreature) const

{

    return new npc_redoxxAI (pCreature);

}


struct npc_redoxxAI : public ScriptedAI

{

    npc_redoxxAI(Creature *c) : ScriptedAI(c) {}


    uint32 CurrWP;




    bool ContinueWP;

    bool Reached;


    void Reset()

    {


        CurrWP = 0;

		ContinueWP = false;

        Reached = false;

    }


    void UpdateAI(const uint32 diff)

    {

        if (ContinueWP)

        {

            me->GetMotionMaster()->MovePoint(CurrWP, WPs[CurrWP][0], WPs[CurrWP][1], WPs[CurrWP][2]);

            ContinueWP = false;

        }



    }


    void EnterCombat(Unit* /*who*/) {}


    void MovementInform(uint32 type, uint32 id)

    {

        if (type != POINT_MOTION_TYPE)

            return;




        ++CurrWP;

        ContinueWP = true;

    }

};

};[/CODE]

Has anyone an idea?

Thanks in advance

Rhule

PS: This Script is for a Quest

Post the error please.

The Erro Code :

[CODE]3>game.lib(ScriptLoader.obj) : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ““void __cdecl AddSC_npc_redoxx(void)” (?AddSC_npc_redoxx@@YAXXZ)” in Funktion ““void __cdecl AddCustomScripts(void)” (?AddCustomScripts@@YAXXZ)”.

3>C:\Build\bin\Release\worldserver.exe : fatal error LNK1120: 1 nicht aufgelöste externe Verweise.[/CODE]

Sry, my Compailer is a German Version ^^

Rhule

Should have seen this without the error :confused: try this:

Passt sogar, bin auch deutsch /emoticons/default_wink.png Versuch das mal:

[CODE]/* ScriptData

SDName: npc_redoxx

SD%Complete: 10

SDComment: Quest support: 800204

SDCategory: Katakomben Sturmwind

EndScriptData */

#include “ScriptPCH.h”

#include “World.h”

#include “WorldPacket.h”

//npc_Redoxx

float WPs[8][4] =

{

//x y z

{-57.040409f, 71.295708f, -31.717337f},

{-34.896469f, 71.150421f, -31.717337f},

};

class npc_redoxx : public CreatureScript

{

public:

npc_redoxx() : CreatureScript("npc_redoxx") { }






CreatureAI* GetAI(Creature* pCreature) const

{

    return new npc_redoxxAI (pCreature);

}


struct npc_redoxxAI : public ScriptedAI

{

    npc_redoxxAI(Creature *c) : ScriptedAI(c) {}


    uint32 CurrWP;




    bool ContinueWP;

    bool Reached;


    void Reset()

    {


        CurrWP = 0;

                    ContinueWP = false;

        Reached = false;

    }


    void UpdateAI(const uint32 diff)

    {

        if (ContinueWP)

        {

            me->GetMotionMaster()->MovePoint(CurrWP, WPs[CurrWP][0], WPs[CurrWP][1], WPs[CurrWP][2]);

            ContinueWP = false;

        }



    }


    void EnterCombat(Unit* /*who*/) {}


    void MovementInform(uint32 type, uint32 id)

    {

        if (type != POINT_MOTION_TYPE)

            return;




        ++CurrWP;

        ContinueWP = true;

    }

};

};

void AddSC_npc_redoxx()

{

new npc_redoxx();

}

[/CODE]

Just added at the end of the script.

Musst nur am ende von jedem script etwas ähnliches wie das hier adden:

[CODE]void AddSC_npc_redoxx()

{

new npc_redoxx();

}[/CODE]
after void AddSC type in the line that you added in the ScriptLoader.

bei dem void AddSC immer das eintragen was du im ScriptLoader eingetragen hast.

ok, du bist mein Held /emoticons/default_biggrin.png

Danke /emoticons/default_smile.png

Was hast du verändert ?

Sehe ich auf dem ersten blick nicht ^^

Edit :

Überlesen danke /emoticons/default_smile.png

English dude!

Or take this to our German subforum.