コード例 #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);
        }
コード例 #2
0
ファイル: Npc.cs プロジェクト: Dia/ScriptLib
        internal int SetActionScript(NPCACTION action, IEnumerable <TokenData> parm, long pos)
        {
            var cnt = _actCount;

            if (cnt >= 50)
            {
                return(0);
            }

            if (action == NPCACTION.ONTIMER)
            {
                _actionScriptOnTimerActIdx[_onTimerActNo++] = cnt;
            }

            _actionScriptAction[_actCount] = action;
            _actionScriptPos[_actCount]    = pos;
            if (parm.Count() > 0)
            {
                _actionScriptParam[_actCount] = parm;
            }

            ++_actCount;
            return(1);
        }