Quantcast
Channel: RaGEZONE - MMO Development Forums
Viewing all articles
Browse latest Browse all 35344

[HELP] Stucked with creating npc's

$
0
0
I want to set the npc's on the world but Im kinda stucked...

I dont know what I should do now.. I cant set the npc x/y/z location etc..

currently I have:

Code:

void CClientSession::SendNpcCreate(CNtlPacket * pPacket, CGameServer * app)
{

        printf("--- CREATE NPCS --- \n");
        CNtlPacket packet(sizeof(sGU_OBJECT_CREATE));
        sGU_OBJECT_CREATE * res = (sGU_OBJECT_CREATE *)packet.GetPacketData();


        CNPCTable * pNPcTable = app->g_pTableContainer->GetNpcTable();
        sNPC_TBLDAT *npcTblData = (sNPC_TBLDAT*)pNPcTable;

        res->wOpCode = GU_OBJECT_CREATE;
        res->handle = this->GetavatarHandle();
        res->sObjectInfo.objType = OBJTYPE_NPC;
        res->sObjectInfo.npcBrief.tblidx = npcTblData->tblidx;
        //res->sObjectInfo.npcState.sCharStateBase.vCurLoc.x =

        packet.SetPacketLen( sizeof(sGU_OBJECT_CREATE) );
        int rc = g_pApp->Send( this->GetHandle(), &packet );
}

the function is called at UG_ENTER_WORLD

Viewing all articles
Browse latest Browse all 35344

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>