Esempio n. 1
0
        internal bool FuncLabel(NPCACTION act, IEnumerable <TokenData> parm)
        {
            var npc = NpcMgr.Get(_npcId.Value);

            if (npc != null)
            {
                var pos = Interpreter.GetCurPos();
                if (npc.SetActionScript(act, parm, pos) > 0)
                {
                    if (act == NPCACTION.ONINIT)
                    {
                        //std::vector<int,std::allocator<int>>::push_back((std::vector<int,std::allocator<int> > *)(a2 + 188), &npcId);
                        //v7->m_OnInit = 0;
                    }

                    //v9 = CInterpreter::GetCurPos(*(N2FTAFile **)a2, a2 + 12);
                    //(*(void (**)(int, const char *, ...))(v10 + 64))(a2, "FuncLabel: action[%d] addr %x\n", act, v9);
                    return(true);
                }
                else
                {
                    Debug.Print("FuncLabel: too many label.");
                }
            }

            return(false);
        }
Esempio n. 2
0
        private int FuncNpc2(NpcSvrNpcInfo npcInfo)
        {
            // find zone by map
            var aid = id++;

            _npcId = aid;
            var npc = NpcMgr.Add(aid);

            npc.SetInfo(aid, npcInfo);
            ScriptEventHandler.AddNpc(aid, npcInfo, npcInfo.Zone);
            return(aid);
        }
Esempio n. 3
0
 internal void Run(BinBuf binBuf, int pcId, int npcId, int act)
 {
     _npcId  = npcId;
     _binBuf = binBuf;
     if (npcId > 0)
     {
         var npc = NpcMgr.Get(npcId);
         if (npc != null)
         {
             var actionScriptPos = npc.GetActionScriptPos(act);
             if (actionScriptPos > 0)
             {
                 var success = Interpreter.Run(binBuf, actionScriptPos, false) == false;
                 // Ok, we got the line now and Interpreter.Run will set the position the the npc.bin buffer, but who executes the dialog?
             }
         }
     }
 }