{"action":"created","issue":{"url":"https://api.github.com/repos/TrinityCore/TrinityCore/issues/19078","repository_url":"https://api.github.com/repos/TrinityCore/TrinityCore","labels_url":"https://api.github.com/repos/TrinityCore/TrinityCore/issues/19078/labels{/name}","comments_url":"https://api.github.com/repos/TrinityCore/TrinityCore/issues/19078/comments","events_url":"https://api.github.com/repos/TrinityCore/TrinityCore/issues/19078/events","html_url":"https://github.com/TrinityCore/TrinityCore/issues/19078","id":206289610,"number":19078,"title":"[7.x] Areatrigger system","user":{"login":"cocolino","id":1143446,"avatar_url":"https://avatars.githubusercontent.com/u/1143446?v=3","gravatar_id":"","url":"https://api.github.com/users/cocolino","html_url":"https://github.com/cocolino","followers_url":"https://api.github.com/users/cocolino/followers","following_url":"https://api.github.com/users/cocolino/following{/other_user}","gists_url":"https://api.github.com/users/cocolino/gists{/gist_id}","starred_url":"https://api.github.com/users/cocolino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cocolino/subscriptions","organizations_url":"https://api.github.com/users/cocolino/orgs","repos_url":"https://api.github.com/users/cocolino/repos","events_url":"https://api.github.com/users/cocolino/events{/privacy}","received_events_url":"https://api.github.com/users/cocolino/received_events","type":"User","site_admin":false},"labels":[{"id":137384659,"url":"https://api.github.com/repos/TrinityCore/TrinityCore/labels/Branch-master","name":"Branch-master","color":"188846","default":false},{"id":26232657,"url":"https://api.github.com/repos/TrinityCore/TrinityCore/labels/Comp-Database","name":"Comp-Database","color":"FF6600","default":false},{"id":104765,"url":"https://api.github.com/repos/TrinityCore/TrinityCore/labels/Sub-Entities","name":"Sub-Entities","color":"e10c02","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2017-02-08T18:51:25Z","updated_at":"2017-02-11T02:16:29Z","closed_at":null,"body":"[//]: # (***************************************************************)\r\n[//]: # (** DON'T DELETE THIS TEMPLATE ELSE YOUR ISSUE WILL BE CLOSED **)\r\n[//]: # (***************************************************************)\r\n\r\n**Description:** There are a couple of issues in the Areatrigger system (implemented in 6ab3877c91c9440b81cf1c7c66a1275ee04ea26a).\r\n\r\n**Current behaviour:** (Tell us what happens.)\r\n\r\nTested with AreaTrigger \"Rain of Fire\" - Teron'gor (156857).\r\n\r\nAdded:\r\n```sql\r\nDELETE FROM `areatrigger_template` WHERE `Id`= 6422;\r\nINSERT INTO `areatrigger_template` (`Id`,`Type`,`Flags`,`Data0`,`Data1`,`Data2`,`Data3`,`Data4`,`Data5`,`VerifiedBuild`) VALUES\r\n(6422, 0, 0, 10, 10, 0, 0, 0, 0, 23420);\r\n\r\nDELETE FROM `spell_areatrigger` WHERE `SpellId`= 156857;\r\nINSERT INTO `spell_areatrigger` (`SpellId`,`AreaTriggerId`,`MoveCurveId`,`ScaleCurveId`,`MorphCurveId`,`FacingCurveId`,`DecalPropertiesId`,`TimeToTarget`,`TimeToTargetScale`,`VerifiedBuild`) VALUES\r\n(156857, 6422, 0, 0, 0, 0, 0, 0, 8000, 23420);\r\n```\r\nIngame / on debugging + compared to sniff data the following issues appear:\r\n\r\n1. At creation, the Areatrigger internal Id should be used instead of the MiscId, which is used currently.\r\nThis can be seen in the below sniff snippet:\r\n```\r\n[0] UpdateType: CreateObject2\r\n[0] Object Guid: Full: 0x3430A093C00645800045D3000018F55C AreaTrigger/0 R3112/S17875 Map: 1182 Entry: 6422 Low: 1635676\r\n```\r\n2. In the sniffs all Areatriggers use the following stuff which is not handled currently:\r\n```\r\n[0] AREATRIGGER_EXTRA_SCALE_CURVE + 5: 1065353217/1\r\n[0] AREATRIGGER_EXTRA_SCALE_CURVE + 6: 1/1.401298E-45\r\n```\r\n\r\nI am not sure if that float and int mean something separate but it's weird that all AT's have this stuff.\r\n\r\n3. The Areatrigger does not visually display properly. Instead of showing meteors rain from the sky, only a small yellowish thing appears on the ground. Picture: https://imagebin.ca/v/3BiMKcDT5iSq\r\n\r\n**Expected behaviour:** (Tell us what should happen instead.)\r\n\r\nApart from 1 and 2 which are just things I saw and reported, point 3 is the actual issue (missing visuals on certain AT's). They should display properly. The closest thing to them is a persistent area aura that spawns dyn objects (as far as what they look like), but there is no dyn object or any other stuff seen in the sniffs. Also, no other opcodes are sent regarding this Areatrigger on creation, and the create block looks largely the same. Picture: https://imagebin.ca/v/3BiMfDoR2fh6\r\n\r\n**Steps to reproduce the problem:**\r\n\r\nDescribed above.\r\n\r\n**Branch(es):** 7.x (master)\r\n\r\n**TC rev. hash/commit:**  bc623ed97fbe38ec0119d075f506ead42b45804c\r\n\r\n\r\n[//]: # (This template is for problem reports. For other types of report, edit it accordingly.)\r\n[//]: # (If this is a crash report, include the crashlog with https://gist.github.com/)\r\n[//]: # (For fixes containing C++, create a Pull Request.)\r\n"},"comment":{"url":"https://api.github.com/repos/TrinityCore/TrinityCore/issues/comments/279113534","html_url":"https://github.com/TrinityCore/TrinityCore/issues/19078#issuecomment-279113534","issue_url":"https://api.github.com/repos/TrinityCore/TrinityCore/issues/19078","id":279113534,"user":{"login":"cocolino","id":1143446,"avatar_url":"https://avatars.githubusercontent.com/u/1143446?v=3","gravatar_id":"","url":"https://api.github.com/users/cocolino","html_url":"https://github.com/cocolino","followers_url":"https://api.github.com/users/cocolino/followers","following_url":"https://api.github.com/users/cocolino/following{/other_user}","gists_url":"https://api.github.com/users/cocolino/gists{/gist_id}","starred_url":"https://api.github.com/users/cocolino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cocolino/subscriptions","organizations_url":"https://api.github.com/users/cocolino/orgs","repos_url":"https://api.github.com/users/cocolino/repos","events_url":"https://api.github.com/users/cocolino/events{/privacy}","received_events_url":"https://api.github.com/users/cocolino/received_events","type":"User","site_admin":false},"created_at":"2017-02-11T02:16:29Z","updated_at":"2017-02-11T02:16:29Z","body":"@ joschiwald Yes my bad, posted parser retrieved data (no client files available for direct miscid retrieval).\r\n\r\nHere is something a lot more interesting i found though:\r\n\r\nTimeToTarget and Duration should be calculated based on total spline length for AT's that move.\r\n\r\nIf you look at these 2 consecutive packets you can see exactly what happens:\r\n\r\n1.\r\n[2] AREATRIGGER_DURATION: 7761/1.087548E-41\r\n[2] AREATRIGGER_TIME_TO_TARGET: 7761/1.087548E-41\r\n[2] AREATRIGGER_TIME_TO_TARGET_SCALE: 10000/1.401298E-41\r\n[2] AREATRIGGER_SPELLID: 157793/2.211151E-40\r\n\r\n2.\r\n[2] AREATRIGGER_DURATION: 7759/1.087267E-41\r\n[2] AREATRIGGER_TIME_TO_TARGET: 7759/1.087267E-41\r\n[2] AREATRIGGER_TIME_TO_TARGET_SCALE: 10000/1.401298E-41\r\n[2] AREATRIGGER_SPELLID: 157793/2.211151E-40\r\n\r\nI found that AREATRIGGER_TIME_TO_TARGET_SCALE is always given the value of the full duration of the spell (see http://www.wowhead.com/spell=157793/arcane-bomb - Duration 10 seconds), while AREATRIGGER_DURATION and AREATRIGGER_TIME_TO_TARGET are used based on the AT having movement spline points or not.\r\n- If the AT is static, AREATRIGGER_TIME_TO_TARGET doesn't appear in the sniff, and AREATRIGGER_DURATION reflects the total duration of the spell aswell.\r\n- If the AT has movement, the two fields are calculated on creation based on the total spline distance (distance to the end spline point) and the total spell duration - meaning the AT speed. At each update tick, the two fields are then adjusted to reflect the position change of the AT compared to the spline end point. When the AT reaches the last spline point, it must expire and get removed.\r\n\r\nWhat this means is that DB fields should not be used for setting AREATRIGGER_TIME_TO_TARGET / AREATRIGGER_TIME_TO_TARGET_SCALE, since the first is dynamic and the second is always a reflection of the total spell duration. \r\nAlso, _UpdateDuration should also change AREATRIGGER_TIME_TO_TARGET, or they both should be moved to a better place or handled differently in AreaTrigger::Update. It seems normal they are connected if an AT must move to a spot and despawn after reaching it. Note: this will need special duration addition handling for path recalculations where the AT should also return back to the caster instead of despawning, such as Divine Star.\r\nLast, AreaTriggerReShape should not be sent to init spline movement, because if the block in BuildMovementUpdate is fine the client handles it by himself and starts the AT movement clientside. We just have to mimic it serverside. Also, AreaTriggerReShape is not sent when the destination is reached unless new points are given for path recalculation. Blame the diff if you want, but it would be more fair to call the reshape as repath and the other way around. I changed them like this to reflect what they should do better:\r\n\r\n    SMSG_AREA_TRIGGER_RE_PATH                                      = 0x2638,\r\n    SMSG_AREA_TRIGGER_RE_SHAPE                                     = 0x263C,\r\n\r\nAnd there are also\r\n\r\n    SMSG_AREA_TRIGGER_MOVEMENT_UPDATE                    = 0x263B,\r\n    SMSG_AREA_TRIGGER_POSITION_UPDATE                        = 0x263A,\r\n\r\nWhich are sent on creation / position reached and signal different things i haven't fully figured out yet."}}
{"actor":{"display_login":"cocolino"}}