public void OutputSVM_Overlay(String output)
        {
            if (this.Address == 0)
            {
                return;
            }

            Process process = Process.ThisProcess();

            zString      str = zString.Create(process, "guc_string_helper");
            zCPar_Symbol sym = zCParser.getParser(process).GetSymbol(str);

            str.Dispose();

            str = zString.Create(process, output);
            sym.SetValue(str, 0);
            str.Dispose();


            str = zString.Create(process, "MOD_OutputSVM_Overlay");
            int id = zCParser.getParser(process).GetIndex(str);

            str.Dispose();

            zCParser.getParser(process).SetInstance(zString.Create(process, "SELF"), this.Address);
            zCParser.getParser(process).SetInstance(zString.Create(process, "OTHER"), this.Address);

            zCParser.CallFunc(process, new CallValue[] {
                new IntArg(zCParser.getParser(process).Address),
                new IntArg(id)
            });
        }
示例#2
0
        public static Int32 hook_LoadParserFile(String message)
        {
            try
            {
                int     parameterAddress = Convert.ToInt32(message);
                zString str = new zString(Process.ThisProcess(), Process.ThisProcess().ReadInt(parameterAddress + 4));
                zERROR.GetZErr(Process.ThisProcess()).Report(2, 'G', "LoadParserFile: " + str.Value, 0, "Program.cs", 0);

                zCParser parser = zCParser.getParser(Process.ThisProcess());
                parser.Reset();
                oCGame.Game(Process.ThisProcess()).DefineExternals_Ulfi(parser);
                parser.EnableTreeLoad(0);
                parser.EnableTreeSave(0);

                GUC.States.StartupState.initDefaultScripts();

                zString str2 = zString.Create(Process.ThisProcess(), "C_NPC");
                parser.AddClassOffset(str2, 0x120);
                str2.Dispose();

                str2 = zString.Create(Process.ThisProcess(), "C_ITEM");
                parser.AddClassOffset(str2, 0x120);
                str2.Dispose();

                parser.MainFileName.Set(GUC.States.StartupState.srcFile);

                parser.CreatePCode();
                parser.Error();
            }
            catch (Exception ex)
            {
                zERROR.GetZErr(Process.ThisProcess()).Report(2, 'G', ex.ToString(), 0, "Program.cs", 0);
            }
            return(0);
        }
        public void SetUseWithItem(String str)
        {
            zString zS = zString.Create(Process, str);

            SetUseWithItem(zS);
            zS.Dispose();
        }
示例#4
0
        public void SetName(String name)
        {
            zString str = zString.Create(Process, name);

            SetName(str);
            str.Dispose();
        }
        public void SetSize(int size)
        {
            if (size > this.size)
            {
                for (int i = this.size; i < size; i++)
                {
                    zString str    = zString.Create(process, "");
                    int     height = (int)(mHeight * 0.1f);
                    int     width  = (int)(mWidth * 0.05f);

                    zCViewText vt = viewBG.CreateText(0, 0, str);
                    vt.Timed = 0;
                    vt.Timer = -1;
                    vt.PosX  = width;
                    vt.PosY  = height + i * height;

                    viewTextList.Add(vt);

                    str.Dispose();
                }
            }
            else if (size < this.size)
            {
                zCViewText[] txview = viewTextList.ToArray();
                for (int i = size; i < this.size; i++)
                {
                    txview[i].Timed = 1;
                    txview[i].Timer = 0;
                    viewTextList.Remove(txview[i]);
                }
            }

            this.size = size;
        }
        public void SetKeyInstance(String lockString)
        {
            zString zS = zString.Create(Process, lockString);

            SetKeyInstance(zS);
            zS.Dispose();
        }
示例#7
0
        public void SetVisual(String visual)
        {
            zString str = zString.Create(Process, visual);

            SetVisual(str);
            str.Dispose();
        }
示例#8
0
        public void SetFont(String font)
        {
            zString f = zString.Create(Process, font);

            SetFont(f);
            f.Dispose();
        }
        public void SetPickLockStr(String lockString)
        {
            zString zS = zString.Create(Process, lockString);

            SetPickLockStr(zS);
            zS.Dispose();
        }
示例#10
0
        public void Show()
        {
            if (isShown)
            {
                return;
            }
            if (pView == null)
            {
                pView = zCView.Create(process, 0, 0, sizeX, sizeY);

                zString texStr  = zString.Create(process, texture);
                zString fontStr = zString.Create(process, "Font_Old_20_White_Hi.tga");
                pView.InsertBack(texStr);
                pView.SetFont(fontStr);

                texStr.Dispose();
                fontStr.Dispose();

                pView.PrintTimedCXY(zString.Create(process, text), -1, zColor.Create(process, 255, 255, 255, 255));
                pView.SetPos(posX, posY);
            }


            zCView.GetStartscreen(process).InsertItem(pView, 0);
            InputHooked.receivers.Add(this);
            isShown = true;
        }
示例#11
0
        public void setFont(String font)
        {
            if (font == null)
            {
                return;
            }
            String oldfont = this.font;

            this.font = font;

            if (oldfont.Trim().ToUpper() == font.Trim().ToUpper())
            {
                return;
            }



            Process process = Process.ThisProcess();
            zString str     = zString.Create(process, this.font);

            thisView.SetFont(str);
            str.Dispose();

            if (textView != null)
            {
                textView.Timed = 1;
                textView.Timer = 0;
                createText();
                setColor(this.color);
            }
        }
        public void Read(RakNet.BitStream stream, RakNet.Packet packet, Client client)
        {
            int plID = 0;

            stream.Read(out plID);

            if (plID == 0 || !sWorld.VobDict.ContainsKey(plID))
            {
                throw new Exception("Vob not found!");
            }
            Vob vob = sWorld.VobDict[plID];

            if (!(vob is NPCProto))
            {
                throw new Exception("Vob is not an NPC!");
            }

            if (vob.Address == 0)
            {
                return;
            }

            Process process = Process.ThisProcess();
            oCNpc   npc     = new oCNpc(process, vob.Address);
            //npc.StartDialogAni();
            zString str = zString.Create(process, "T_DIALOGGESTURE_09");

            npc.GetModel().StartAnimation(str);
            str.Dispose();

            zERROR.GetZErr(Process.ThisProcess()).Report(2, 'G', "npc StartDialog: " + vob.Address, 0, "Client.cs", 0);
        }
示例#13
0
        public textArea(Process process, zCView view, int height)
        {
            this.process = process;
            this.view    = view;

            fontY = this.view.Font.GetFontY();
            fontY = InputHooked.PixelToVirtualY(process, fontY);

            int lines = height / fontY;

            zString empty = zString.Create(process, "");

            vt = new zCViewText[lines];
            for (int i = 0; i < lines; i++)
            {
                vt[i]       = view.CreateText(0, i * fontY, empty);
                vt[i].Timed = 0;
                vt[i].Timer = -1;
            }
            empty.Dispose();


            Inputenabled = true;
            InputHooked.receivers.Add(this);
        }
示例#14
0
        public void StartAnimation(String str)
        {
            zString zStr = zString.Create(Process, str);

            StartAnimation(zStr);
            zStr.Dispose();
        }
示例#15
0
        public static void initDefaultScripts()
        {
            String[] arr = new String[] { "GUC.Resources.Constants.d", "GUC.Resources.Classes.d", "GUC.Resources.AI_Constants.d", "GUC.Resources.Text.d",
                                          "GUC.Resources.BodyStates.d", "GUC.Resources.Focus.d", "GUC.Resources.Species.d",
                                          "GUC.Resources.NPC_Default.d", "GUC.Resources.PC_Hero.d" };

            zString str      = null;
            String  fileList = "";

            foreach (String internalFile in arr)
            {
                zERROR.GetZErr(Process.ThisProcess()).Report(2, 'G', "Parse: " + internalFile, 0, "Program.cs", 0);
                using (StreamReader sr = new StreamReader(Assembly.GetExecutingAssembly().GetManifestResourceStream(internalFile), System.Text.Encoding.Default))
                {
                    String file = getRandomScriptString(".d");
                    File.WriteAllText(file, sr.ReadToEnd(), System.Text.Encoding.Default);
                    fileList += Path.GetFileName(file.ToUpper()) + "\r\n";

                    //str = zString.Create(Process.ThisProcess(), file.ToUpper());
                    //zCParser.getParser(Process.ThisProcess()).ParseFile(str);
                    //str.Dispose();
                }
            }


            String file_FileList = getRandomScriptString(".src");

            srcFile = file_FileList;
            File.WriteAllText(file_FileList, fileList);

            str = zString.Create(Process.ThisProcess(), file_FileList.ToUpper());
            zCParser.getParser(Process.ThisProcess()).ParseSource(str);
            str.Dispose();

            str = zString.Create(Process.ThisProcess(), "C_NPC");
            zCPar_Symbol sym = zCParser.getParser(Process.ThisProcess()).GetSymbol(str);

            str.Dispose();
            sym.SetClassOffset(0x120);

            str = zString.Create(Process.ThisProcess(), "C_ITEM");
            sym = zCParser.getParser(Process.ThisProcess()).GetSymbol(str);
            str.Dispose();
            sym.SetClassOffset(0x120);

            zERROR.GetZErr(Process.ThisProcess()).Report(2, 'G', "Startup-Scripts-parsed!", 0, "Program.cs", 0);
        }
示例#16
0
        public int GetAniIDFromAniName(String animname)
        {
            zString str = zString.Create(Process, animname);
            int     x   = GetAniIDFromAniName(str);

            str.Dispose();
            return(x);
        }
示例#17
0
        public void SetAdditionalVisuals(String bodyMesh, int bodyTex, int skinColor, String headMesh, int headTex, int TeethTex, int Armor)
        {
            zString zBodyMesh = zString.Create(Process, bodyMesh);
            zString zHeadMesh = zString.Create(Process, headMesh);

            Process.THISCALL <NullReturnCall>((uint)Address, (uint)FuncOffsets.SetAdditionalVisuals, new CallValue[] { zBodyMesh, new IntArg(bodyTex), new IntArg(skinColor), zHeadMesh, new IntArg(headTex), new IntArg(TeethTex), new IntArg(Armor) });
            zBodyMesh.Dispose();
            zHeadMesh.Dispose();
        }
示例#18
0
        public override void Destroy()
        {
            hide();

            emptyString.Dispose();


            thisView.Dispose();
        }
示例#19
0
        public void PrintTimedCXY(String str, float time, byte r, byte g, byte b, byte a)
        {
            zColor  colr = zColor.Create(Process, r, g, b, a);
            zString zstr = zString.Create(Process, str);

            PrintTimedCXY(zstr, time, colr);
            colr.Dispose();
            zstr.Dispose();
        }
示例#20
0
        public int GetIndex(String str)
        {
            zString zS = zString.Create(Process, str);
            int     i  = GetIndex(zS);

            zS.Dispose();

            return(i);
        }
        public zCModelAni SearchAni(String str)
        {
            zString    zStr = zString.Create(Process, str);
            zCModelAni ma   = SearchAni(zStr);

            zStr.Dispose();

            return(ma);
        }
示例#22
0
        public oCItem CreateItem(String instance)
        {
            zString str = zString.Create(Process, instance);
            int     id  = zCParser.getParser(Process).GetIndex(str);

            str.Dispose();

            return(CreateItem(id));
        }
示例#23
0
        public String getStringParameter()
        {
            zString str = zString.Create(Process, "");

            Process.THISCALL <NullReturnCall>((uint)Address, (uint)FuncOffsets.GetParameter_String, new CallValue[] { (IntArg)str.Address });
            String rStr = str.Value;

            str.Dispose();
            return(rStr);
        }
示例#24
0
        public oCNpc CreateNPC(string instance)
        {
            zString str = zString.Create(Process, instance);
            oCNpc   npc = null;

            npc = CreateNPC(zCParser.getParser(Process).GetIndex(str));
            str.Dispose();

            return(npc);
        }
示例#25
0
        private void createText()
        {
            Process process = Process.ThisProcess();
            zString str     = zString.Create(process, this.text);

            textView = thisView.CreateText(this.position.X, this.position.Y, str);
            str.Dispose();

            textView.Timed = 0;
            textView.Timer = -1;
        }
示例#26
0
        public int IsAnimationActive(String animname)
        {
            int result = 0;

            zString str = zString.Create(Process, animname);

            result = IsAnimationActive(str);
            str.Dispose();

            return(result);
        }
示例#27
0
        public Bar(Process process, int posX, int posY, String frontTex, String backTex)
        {
            Process = process;


            int[] size  = InputHooked.PixelToVirtual(process, new int[] { 180, 20 });
            int[] sizeB = InputHooked.PixelToVirtual(process, new int[] { 180 - 7, 20 - 3 });
            int[] posB  = InputHooked.PixelToVirtual(process, new int[] { 7, 3 });


            backView = zCView.Create(process, posX, posY, size[0], size[1]);
            zString tex = zString.Create(process, backTex);

            backView.InsertBack(tex);
            tex.Dispose();

            frontView = zCView.Create(process, posX + posB[0], posY + posB[1], sizeB[0], sizeB[1]);
            tex       = zString.Create(process, frontTex);
            frontView.InsertBack(tex);
            tex.Dispose();
        }
示例#28
0
        public void setTexture(String tex)
        {
            if (tex == null || tex == "")
            {
                return;
            }
            Process process = Process.ThisProcess();
            zString text    = zString.Create(process, tex);

            view.InsertBack(text);
            text.Dispose();
        }
示例#29
0
 public void delete()
 {
     if (SpaceText != null)
     {
         SpaceText.Dispose();
     }
     foreach (zCViewText vt in textViews)
     {
         vt.Timed = 1;
         vt.Timer = 0;
     }
 }
示例#30
0
        private void createText()
        {
            String  text    = tB.getText();
            Process process = Process.ThisProcess();
            zString str     = zString.Create(process, text);

            tB.vt = thisView.CreateText(position.X, position.Y, str);

            str.Dispose();

            tB.vt.Timed = 0;
            tB.vt.Timer = -1;
        }