コード例 #1
0
        private void TryDropDojoItem(TagPoint pos)
        {
            // 50% chance to drop a dojo powerup
            if (Constants.Rand.NextDouble() < 0.50)
            {
                var randBuffItem = Constants.Rand.Next(2022359, 2022422);

                var item = MasterManager.CreateItem(randBuffItem);

                if (item is null)
                {
                    return;
                }

                CDropFactory.CreateDropItem(this, pos, 0, item);
            }

            // 50% chance to drop a dojo hp/mp pot
            if (Constants.Rand.NextDouble() < 0.50)
            {
                var randPotItem = Constants.Rand.Next(2022430, 2022433);

                var item = MasterManager.CreateItem(randPotItem);

                if (item is null)
                {
                    return;
                }

                CDropFactory.CreateDropItem(this, pos, 0, item);
            }
        }
コード例 #2
0
 /// <summary>
 /// Creates an affected area using the coordinates of the
 ///     lt/rb points, offset by the position
 /// </summary>
 public CAffectedArea(int nSkillID, int dwOwnerId, TagPoint position, Point lt, Point rb, bool bLeft)
 {
     this.nSkillID  = nSkillID;
     this.dwOwnerId = dwOwnerId;
     rcArea         = new TagRect(lt.X, lt.Y, rb.X, rb.Y);
     rcArea.OffsetRect(position, bLeft);
     nType = AffectedAreaConstants.GetAreaType(nSkillID);
 }
コード例 #3
0
 public CAffectedArea(int nSkillID, int dwOwnerId, TagPoint position, Point lt, Point rb, AffectedAreaType nAreaType)
 {
     this.nSkillID  = nSkillID;
     this.dwOwnerId = dwOwnerId;
     rcArea         = new TagRect(lt.X, lt.Y, rb.X, rb.Y);
     rcArea.OffsetRect(position, true);
     nType = nAreaType;
 }
コード例 #4
0
        /// <summary>
        /// Internal handler for creating the affected area
        /// </summary>
        public static void CastGrenadeSkill(Character c, MapleAttack atkInfo)
        {
            // no validation because it has already occurred
            var skill  = c.Skills.Get(atkInfo.nSkillID);
            var offset = new TagPoint(atkInfo.nGrenadePtX, atkInfo.nGrenadePtY);

            c.Skills.CastAffectedAreaSkill
                (atkInfo.nSkillID, skill.nSLV, (short)skill.BuffTime, offset, skill.Template.LT, skill.Template.RB);
        }
コード例 #5
0
        public CField_Zakum(WvsGame parentInstance, int nMapId, int nInstanceId)
            : base(parentInstance, nMapId, nInstanceId)
        {
            SpawnPoint = new TagPoint(-11, -215);

            DropRect = new TagRect(-185, -240, 185, -200);

            IsChaosZakum = MapId == CHAOSZAKUM_MAP_ID;
            _exitmap     = IsChaosZakum ? 211042301 : 211042300;         // door to (chaos) zakum
        }
コード例 #6
0
        public CDrop(TagPoint tp, int ownerId)
        {
            OwnerCharId = ownerId;

            SpawnTime = DateTime.Now;

            StartPosX = tp.X;
            StartPosY = tp.Y;

            nLeaveType = DropLeaveType.TimeOut;
            nEnterType = DropEnterType.Create;
        }
コード例 #7
0
        public static void CreateDropMeso(CField field, TagPoint pStartPos, int dwOwnerID, int nAmount)
        {
            var drop = new CDrop(pStartPos, dwOwnerID)
            {
                bIsMoney = 1,
                ItemId   = nAmount
            };

            drop.Position.X = drop.StartPosX;
            drop.CalculateY(field, drop.StartPosY);

            field.Drops.Add(drop);
        }
コード例 #8
0
        public static void CreateDropItem(CField field, TagPoint pStartPos, int dwOwnerID, GW_ItemSlotBase pItem)
        {
            var drop = new CDrop(pStartPos, dwOwnerID)
            {
                Item   = pItem,
                ItemId = pItem.nItemID
            };

            drop.Position.X = drop.StartPosX;
            drop.CalculateY(field, drop.StartPosY);

            field.Drops.Add(drop);
        }
コード例 #9
0
        public Foothold FindBelow(TagPoint p)
        {
            List <Foothold> xMatches = new List <Foothold>();

            foreach (Foothold fh in Footholds) // find fhs with matching x coordinates
            {
                if (fh.X1 <= p.X && fh.X2 >= p.X)
                {
                    xMatches.Add(fh);
                }
            }

            xMatches.Sort();

            foreach (Foothold fh in xMatches)
            {
                if (!fh.Wall && fh.Y1 != fh.Y2)
                {
                    int    calcY;
                    double s1    = Math.Abs(fh.Y2 - fh.Y1);
                    double s2    = Math.Abs(fh.X2 - fh.X1);
                    double s4    = Math.Abs(p.X - fh.X1);
                    double alpha = Math.Atan(s2 / s1);
                    double beta  = Math.Atan(s1 / s2);
                    double s5    = Math.Cos(alpha) * (s4 / Math.Cos(beta));

                    if (fh.Y2 < fh.Y1)
                    {
                        calcY = fh.Y1 - ((int)s5);
                    }
                    else
                    {
                        calcY = fh.Y1 + ((int)s5);
                    }

                    if (calcY >= p.Y)
                    {
                        return(fh);
                    }
                }
                else if (!fh.Wall && fh.Y1 >= p.Y)
                {
                    return(fh);
                }
            }
            return(null);
        }
コード例 #10
0
ファイル: AttackInfo.cs プロジェクト: v3921358/Rebirth
 public AttackInfo()
 {
     aDamage    = new int[15];
     abCritical = new int[15];
     ptHit      = new TagPoint();
 }
コード例 #11
0
 public static extern IntPtr WindowFromPoint(TagPoint point);
コード例 #12
0
ファイル: Tokenizer.cs プロジェクト: ly774508966/Autoya
        private VirtualGameObject Tokenize(TagPoint parentTagPoint, string data)
        {
            // Debug.LogError("data:" + data);
            var charIndex = 0;
            var readPoint = 0;

            while (true)
            {
                // consumed.
                if (data.Length <= charIndex)
                {
                    break;
                }

                var chr = data[charIndex];
                // Debug.LogError("chr:" + chr);

                if (chr == '<')
                {
                    var foundTag = IsTag(data, charIndex);

                    if (foundTag == Tag.NO_TAG_FOUND)
                    {
                        // no tag found. go to next char.
                        charIndex++;
                        continue;
                    }

                    // Debug.LogError("foundTag:" + foundTag + " cont:" + data.Substring(charIndex));

                    var readingPointStartIndex = 0;
                    var readingPointLength     = 0;

                    if (readPoint < charIndex)
                    {
                        // Debug.LogError("readPoint:" + readPoint + " vs charIndex:" + charIndex);
                        var length = charIndex - readPoint;

                        // reserve index and length.
                        readingPointStartIndex = readPoint;
                        readingPointLength     = length;
                    }

                    var rawTagName = foundTag.ToString();
                    if (foundTag == Tag.H)
                    {
                        // get Hx(number). e.g. H -> H1
                        rawTagName = rawTagName + data[charIndex + 1 /*length ouf '<'*/ + 1 /*length of 'H'*/];
                    }


                    // set tag.
                    var tag = foundTag;

                    {                    // use tempCharIndex, return charIndex.
                        // set to next char index. after '<tag'
                        var tempCharIndex = charIndex + ("<" + rawTagName).Length;
                        var tempReadPoint = readPoint;

                        /*
                         *      collect attr and find start-tag end.
                         */
                        {
                            var kv = new Dictionary <KV_KEY, string>();
                            switch (data[tempCharIndex])
                            {
                            case ' ': {                                    // <tag [attr]/> or <tag [attr]>
                                var startTagEndIndex = data.IndexOf(">", tempCharIndex);

                                if (startTagEndIndex == -1)
                                {
                                    // start tag never close.
                                    charIndex++;
                                    continue;
                                }

                                // Debug.LogError("' ' found at tag:" + tag + " startTagEndIndex:" + startTagEndIndex);
                                var attrStr = data.Substring(tempCharIndex + 1, startTagEndIndex - tempCharIndex - 1);

                                kv = GetAttr(tag, attrStr);

                                // tag closed point is tagEndIndex. next point is tagEndIndex + 1.
                                tempCharIndex = startTagEndIndex + 1;
                                tempReadPoint = tempCharIndex;

                                // Debug.LogError("data[tagEndIndex - 1]:" + data[tagEndIndex - 1]);

                                /*
                                 *      single close tag found.
                                 *      this tag content is just closed.
                                 */
                                if (data[startTagEndIndex - 1] == '/')                                          // <tag [attr]/>
                                // Debug.LogError("-1 is / @tag:" + tag);

                                // add content before tag.
                                {
                                    if (0 < readingPointLength)
                                    {
                                        var str = data.Substring(readingPointStartIndex, readingPointLength);

                                        // Debug.LogError("1 str:" + str + " parentTagPoint:" + parentTagPoint.tag + " current tag:" + foundTag);

                                        if (!string.IsNullOrEmpty(str))
                                        {
                                            var contentTagPoint = new TagPoint(
                                                Tag._CONTENT,
                                                parentTagPoint.originalTagName,
                                                parentTagPoint.depth.Concat(new Tag[] { Tag._CONTENT }).ToArray(),
                                                new Dictionary <KV_KEY, string>(),
                                                string.Empty
                                                );
                                            contentTagPoint.vGameObject.transform.SetParent(parentTagPoint.vGameObject.transform);
                                            contentTagPoint.vGameObject.keyValueStore[KV_KEY._CONTENT] = str;
                                        }
                                    }

                                    var tagPoint2 = new TagPoint(tag, parentTagPoint.originalTagName, parentTagPoint.depth.Concat(new Tag[] { tag }).ToArray(), kv, rawTagName);
                                    tagPoint2.vGameObject.transform.SetParent(parentTagPoint.vGameObject.transform);

                                    charIndex = tempCharIndex;
                                    readPoint = tempReadPoint;
                                    continue;
                                }

                                // Debug.LogError("not closed tag:" + tag);

                                /*
                                 *      finding end-tag of this tag.
                                 */
                                var endTag = "</" + rawTagName.ToLower() + ">";
                                var cascadedStartTagHead = "<" + rawTagName.ToLower();

                                var endTagIndex = FindEndTag(endTag, cascadedStartTagHead, data, tempCharIndex);

                                // add content before tag.
                                if (0 < readingPointLength)
                                {
                                    var str = data.Substring(readingPointStartIndex, readingPointLength);

                                    // Debug.LogError("1 str:" + str + " parentTagPoint:" + parentTagPoint.tag + " current tag:" + foundTag);

                                    if (!string.IsNullOrEmpty(str))
                                    {
                                        var contentTagPoint = new TagPoint(
                                            Tag._CONTENT,
                                            parentTagPoint.originalTagName,
                                            parentTagPoint.depth.Concat(new Tag[] { Tag._CONTENT }).ToArray(),
                                            new Dictionary <KV_KEY, string>(),
                                            string.Empty
                                            );
                                        contentTagPoint.vGameObject.transform.SetParent(parentTagPoint.vGameObject.transform);
                                        contentTagPoint.vGameObject.keyValueStore[KV_KEY._CONTENT] = str;
                                    }
                                }

                                var contents = data.Substring(tempCharIndex, endTagIndex - tempCharIndex);

                                var tagPoint = new TagPoint(tag, parentTagPoint.originalTagName, parentTagPoint.depth.Concat(new Tag[] { tag }).ToArray(), kv, rawTagName);
                                tagPoint.vGameObject.transform.SetParent(parentTagPoint.vGameObject.transform);

                                // Debug.LogError("contents1:" + contents);
                                Tokenize(tagPoint, contents);

                                tempCharIndex = endTagIndex + endTag.Length;
                                tempReadPoint = tempCharIndex;

                                tempCharIndex++;

                                charIndex = tempCharIndex;
                                readPoint = tempReadPoint;
                                continue;;
                            }

                            case '>': {                                    // <tag> start tag is closed.
                                // set to next char.
                                tempCharIndex = tempCharIndex + 1;

                                // Debug.LogError("> found at tag:" + tag + " cont:" + data.Substring(tempCharIndex) + "___ finding end tag of tag:" + tag);

                                /*
                                 *      finding end-tag of this tag.
                                 */
                                var endTag = "</" + rawTagName.ToLower() + ">";
                                var cascadedStartTagHead = "<" + rawTagName.ToLower();

                                var endTagIndex = FindEndTag(endTag, cascadedStartTagHead, data, tempCharIndex);

                                // add content before tag.
                                if (0 < readingPointLength)
                                {
                                    var str = data.Substring(readingPointStartIndex, readingPointLength);

                                    // Debug.LogError("1 str:" + str + " parentTagPoint:" + parentTagPoint.tag + " current tag:" + foundTag);

                                    if (!string.IsNullOrEmpty(str))
                                    {
                                        var contentTagPoint = new TagPoint(
                                            Tag._CONTENT,
                                            parentTagPoint.originalTagName,
                                            parentTagPoint.depth.Concat(new Tag[] { Tag._CONTENT }).ToArray(),
                                            new Dictionary <KV_KEY, string>(),
                                            string.Empty
                                            );
                                        contentTagPoint.vGameObject.transform.SetParent(parentTagPoint.vGameObject.transform);
                                        contentTagPoint.vGameObject.keyValueStore[KV_KEY._CONTENT] = str;
                                    }
                                }

                                var contents = data.Substring(tempCharIndex, endTagIndex - tempCharIndex);

                                var tagPoint = new TagPoint(tag, parentTagPoint.originalTagName, parentTagPoint.depth.Concat(new Tag[] { tag }).ToArray(), kv, rawTagName);
                                tagPoint.vGameObject.transform.SetParent(parentTagPoint.vGameObject.transform);

                                // Debug.LogError("contents2:" + contents);
                                Tokenize(tagPoint, contents);

                                tempCharIndex = endTagIndex + endTag.Length;
                                tempReadPoint = tempCharIndex;

                                charIndex = tempCharIndex;
                                readPoint = tempReadPoint;
                                continue;
                            }

                            default: {
                                throw new Exception("parse error. unknown keyword found:" + data[charIndex] + " at tag:" + tag);
                            }
                            }
                        }
                    }
                }
                charIndex++;
            }

            if (readPoint < data.Length)
            {
                var restStr = data.Substring(readPoint);
                // Debug.LogError("2 restStr:" + restStr + " parentTagPoint:" + parentTagPoint.tag);
                if (!string.IsNullOrEmpty(restStr))
                {
                    var contentTagPoint = new TagPoint(Tag._CONTENT, parentTagPoint.originalTagName, parentTagPoint.depth.Concat(new Tag[] { Tag._CONTENT }).ToArray(), new Dictionary <KV_KEY, string>(), string.Empty);
                    contentTagPoint.vGameObject.transform.SetParent(parentTagPoint.vGameObject.transform);
                    contentTagPoint.vGameObject.keyValueStore[KV_KEY._CONTENT] = restStr;
                }
            }

            return(parentTagPoint.vGameObject);
        }
コード例 #13
0
ファイル: MapPos.cs プロジェクト: zhuomingliang/Rebirth
 public MapPos(TagPoint position)
 {
     Position = position;
 }
コード例 #14
0
ファイル: MapPos.cs プロジェクト: zhuomingliang/Rebirth
 public MapPos()
 {
     Position = new TagPoint();
 }
コード例 #15
0
 internal static extern IntPtr WindowFromPoint(TagPoint point);
コード例 #16
0
        private void TrySpawnBoss()
        {
#if RELEASE
            if (_timeSinceCreation.SecondsSinceStart() <= 2 * 60)
            {
                return;                                                               // need to be in map for 2 mins before the boss will spawn
            }
#endif
            if (!Users.Any())
            {
                return;
            }

            if (!ParentInstance.AreaBossManager.CanSpawn(MapId))
            {
                return;
            }

            TagPoint pt;
            int      mobId;

            switch (MapId)
            {
            case 104010200:                     // forest trail 2 - mano
                pt    = new TagPoint(308, 515);
                mobId = 2220000;
                break;

            case 100020101:                     // mushmom forest trail - mushmom
                pt    = new TagPoint(-691, 215);
                mobId = 6130101;
                break;

            case 100020301:                     // blue mushmom forest - blue mushmom
                pt    = new TagPoint(158, -685);
                mobId = 8220007;
                break;

            case 102020500:                     // gusty peak - stumpy
                pt    = new TagPoint(549, 2168);
                mobId = 3220000;
                break;

            case 103030300:                     // unseen danger - dyle
                pt = new TagPoint(99, 119);
                goto case 103030400;

            case 103030400:                     // deep mire - dyle
                pt    = new TagPoint(541, 121);
                mobId = 0;
                break;

            case 211041400:                     // forest of dead trees IV - riche
                pt    = new TagPoint(1278, 94);
                mobId = 6090000;
                break;

            case 211040500:                     // sharp cliff III - Snowman
                pt    = new TagPoint(37, 62);
                mobId = 8220001;
                break;

            case 211050000:                     // icy cold field - snow witch
                pt    = new TagPoint(288, -146);
                mobId = 6090001;
                break;

            case 200010302:                     // garden of darkness II - eliza
                pt    = new TagPoint(236, 83);
                mobId = 8220000;
                break;

            case 105020400:                     // cave exit - snack bar
                pt    = new TagPoint(631, 350);
                mobId = 8220008;
                break;

            case 230020100:                     // seaweed tower - seruf
                pt    = new TagPoint(-36, -80);
                mobId = 4220001;
                break;

            case 221020701:                     // eos tower 4th floor - rombot
                pt    = new TagPoint(-60, 1513);
                mobId = 4130103;
                break;

            case 220050200:                     // lost time 2 - timer
                pt    = new TagPoint(395, 1032);
                mobId = 5220003;
                break;

            //case 551030200: // spooky world - scarga
            //	pt = new TagPoint();
            //	mobId = 0;
            //	break;
            case 240020402:                     // manons forest - manon
                pt    = new TagPoint(-371, 452);
                mobId = 8180000;
                break;

            case 240020102:                     // griffey forest - griffey
                pt    = new TagPoint(422, 452);
                mobId = 8180001;
                break;

            case 240040401:                     // levtiathans canyon - leviathan
                pt    = new TagPoint(-52, 1641);
                mobId = 8220003;
                break;

            case 250020300:                     // advanced practice field - master dummy
                pt    = new TagPoint(1178, 51);
                mobId = 5090001;
                break;

            case 250010304:                     // Territory of Wandering Bear - Tae Roon
                pt    = new TagPoint(-480, 393);
                mobId = 7220000;
                break;

            case 250010504:                     // Goblin Forest 2 - King Sage Cat
                pt    = new TagPoint(76, 543);
                mobId = 7220002;
                break;

            case 251010101:                     // 60-Year-Old Herb Garden - Bamboo Warrior
                pt    = new TagPoint(308, 123);
                mobId = 6090002;
                break;

            case 251010102:                     // 80-Year-Old Herb Garden - Giant Centipede
                pt    = new TagPoint(435, -436);
                mobId = 5220004;
                break;

            case 260010500:                     // Dry Desert - Deo
                pt    = new TagPoint(733, 275);
                mobId = 3220001;
                break;

            case 261010003:                     // Lab - Unit 103 - Rurumo
                pt    = new TagPoint(305, 313);
                mobId = 6090004;
                break;

            case 261020300:                     // Lab - Area C-1 - Security Camera
                pt    = new TagPoint(390, 167);
                mobId = 7090000;
                break;

            case 261030000:                     // Lab - Secret Basement Path - Chimera
                pt    = new TagPoint(-321, 181);
                mobId = 8220002;
                break;

            case 270010500:                     // Memory Lane 5 - Dodo
                pt    = new TagPoint(-264, 181);
                mobId = 8220004;
                break;

            case 270020500:                     // Road of Regrets 5 - Lilynouch
                pt    = new TagPoint(108, -915);
                mobId = 8220005;
                break;

            case 270030500:                     // Road to Oblivion 5 - Lyka
                pt    = new TagPoint(239, -570);
                mobId = 8220006;
                break;
            //case 682000001: // Hollowed Ground - Headless Horseman
            //	pt = new TagPoint(304, 238);
            //	mobId = 9400549;
            //	break;
            //case 610010100: // Twisted Paths - Bigfoot
            //case 610010101:
            //case 610010102:
            //case 610010103:
            //case 610010104:
            //	pt = new TagPoint(526, 208);

            //	// 50/50 to spawn bigfoot or headless horseman
            //	mobId = Constants.Rand.NextDouble() > 0.5 ? 9400549 : 9400575;
            //	break;
            default: return;
            }

            Mobs.CreateMob(mobId, null, pt.X, pt.Y, 0, 0xFE, 0, 1, MobType.Normal, null);

            foreach (var item in Mobs)
            {
                item.SetController(Users.Random(), MobCtrlType.Active_Int);
            }

            Broadcast(CPacket.SystemMessage("The area boss emerges from the depths...."));
        }
コード例 #17
0
ファイル: Tokenizer.cs プロジェクト: ly774508966/Autoya
        public Tokenizer(string source)
        {
            var root = new TagPoint(Tag.ROOT, string.Empty, new Tag[0], new Dictionary <KV_KEY, string>(), string.Empty);

            rootObject = Tokenize(root, source.Replace("\n", string.Empty));
        }
コード例 #18
0
            public static COutPacket UserHit(int dwCharId, byte nAttackIdx, int nDamageRaw, int dwTemplateID, bool bLeft, byte nReflect, bool bPowerGuard, int dwMobID, byte nHitAction, TagPoint tagPOINT, bool bGuard, byte nStanceFlag, int nShadowSifterID, int nDamageShownToRemote)
            {
                var p = new COutPacket(SendOps.LP_UserHit);

                p.Encode4(dwCharId);
                p.Encode1(nAttackIdx);                 //skill
                p.Encode4(nDamageRaw);

                // normally the check is nAttackIdx > -2 but we cant cast the byte or itd turn into 254 which would always be false
                if (nAttackIdx != 0xFD && nAttackIdx != 0xFC)
                {
                    p.Encode4(dwTemplateID);
                    p.Encode1(bLeft);
                    p.Encode1(nReflect);
                    if (nReflect > 0)
                    {
                        p.Encode1(bPowerGuard);
                        p.Encode4(dwMobID);

                        p.Encode1(nHitAction);
                        tagPOINT.Encode(p);                        // p.Encode4(0); // encode tagPOINT -> ptHit = CInPacket::Decode4(v3);
                    }
                    p.Encode1(bGuard);
                    p.Encode1(nStanceFlag);                     // 1 or 2 -> 2 means its wildhunter jaguar boost for some reason, otherwise it uses the get_stance_skill_id
                }
                p.Encode4(nDamageShownToRemote);

                if (nDamageShownToRemote < 0)                 // 0 is miss, -1 is shadow sifter dodge (fake in odin)
                {
                    p.Encode4(nShadowSifterID);
                }

                return(p);
            }
コード例 #19
0
 public static extern IntPtr MonitorFromPoint(TagPoint pt, uint dwFlags);
コード例 #20
0
        public void CastAffectedAreaSkill(int nSkillID, int skillLevel, short buffTime, TagPoint offsetPos, Point lt, Point rb)
        {
            var area = new CAffectedArea(nSkillID, dwParentID, offsetPos, lt, rb,
                                         (Parent.Position.MoveAction & 1) != 0)
            {
                Duration = buffTime * 1000,
                nSLV     = (byte)skillLevel,
                tDelay   = 5
            };

            Parent.Field.AffectedAreas.Add(area);
        }
コード例 #21
0
 public static extern bool GetCursorPos(out TagPoint lpPoint);
コード例 #22
0
        //public int bHideTooltip;
        //public int bOnlyOnce;
        //public int nDelayTime;
        //public string sImage;
        //public int nVImpact;
        //public int nHImpact;
        //public string sReactorName;
        //public string sSessionValueKey;
        //public string sSessionValue;

        public Portal()
        {
            ptPos = new TagPoint();
        }