{"action":"created","issue":{"url":"https://api.github.com/repos/cmangos/mangos-tbc/issues/83","repository_url":"https://api.github.com/repos/cmangos/mangos-tbc","labels_url":"https://api.github.com/repos/cmangos/mangos-tbc/issues/83/labels{/name}","comments_url":"https://api.github.com/repos/cmangos/mangos-tbc/issues/83/comments","events_url":"https://api.github.com/repos/cmangos/mangos-tbc/issues/83/events","html_url":"https://github.com/cmangos/mangos-tbc/pull/83","id":166923229,"number":83,"title":"Elemental damage","user":{"login":"cala","id":1459044,"avatar_url":"https://avatars.githubusercontent.com/u/1459044?v=3","gravatar_id":"","url":"https://api.github.com/users/cala","html_url":"https://github.com/cala","followers_url":"https://api.github.com/users/cala/followers","following_url":"https://api.github.com/users/cala/following{/other_user}","gists_url":"https://api.github.com/users/cala/gists{/gist_id}","starred_url":"https://api.github.com/users/cala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cala/subscriptions","organizations_url":"https://api.github.com/users/cala/orgs","repos_url":"https://api.github.com/users/cala/repos","events_url":"https://api.github.com/users/cala/events{/privacy}","received_events_url":"https://api.github.com/users/cala/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-07-21T21:33:58Z","updated_at":"2016-07-27T17:18:47Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/cmangos/mangos-tbc/pulls/83","html_url":"https://github.com/cmangos/mangos-tbc/pull/83","diff_url":"https://github.com/cmangos/mangos-tbc/pull/83.diff","patch_url":"https://github.com/cmangos/mangos-tbc/pull/83.patch"},"body":"This is an port of the weapon elemental damage patch by @sidsukana for Classic.\r\nThe damage structure and calculation being slightly different, I had to fix a few merge conflict first hand.\r\nHowever, this results in a not fully working patch. What is working:\r\n- the elemental damage from a weapon are not used in the whole output calculation\r\n- the NPC immunities are handled\r\n- wands are working fine (school displayed in combat log and immunties handled !)\r\nWhat is not working:\r\n- the damage displayed in the player combat log is displayed ad unkown (player damage versus mob and mob damage versus player). The fact that the immunities are correctly handled tends to indicate that the error is in the code sent to client\r\n\r\nSo the only broken part seems to be the informative one (combat log). But it should be fixed before merging.\r\nOf all the merging conflicts I had, the ones that I'm not sure about (I mean: I was sure of them, but as they are likely candidates to the current behaviour, I'm no longer sure) are about the damage school conversion that are different from Classic.\r\n\r\nI'll highlight them in the code.\r\n\r\nThus, I would like to have @sidsukana opinion here because this is his work and he has a better understanding of this part of the code than me.\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/cmangos/mangos-tbc/issues/comments/235655868","html_url":"https://github.com/cmangos/mangos-tbc/pull/83#issuecomment-235655868","issue_url":"https://api.github.com/repos/cmangos/mangos-tbc/issues/83","id":235655868,"user":{"login":"sidsukana","id":90748,"avatar_url":"https://avatars.githubusercontent.com/u/90748?v=3","gravatar_id":"","url":"https://api.github.com/users/sidsukana","html_url":"https://github.com/sidsukana","followers_url":"https://api.github.com/users/sidsukana/followers","following_url":"https://api.github.com/users/sidsukana/following{/other_user}","gists_url":"https://api.github.com/users/sidsukana/gists{/gist_id}","starred_url":"https://api.github.com/users/sidsukana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sidsukana/subscriptions","organizations_url":"https://api.github.com/users/sidsukana/orgs","repos_url":"https://api.github.com/users/sidsukana/repos","events_url":"https://api.github.com/users/sidsukana/events{/privacy}","received_events_url":"https://api.github.com/users/sidsukana/received_events","type":"User","site_admin":false},"created_at":"2016-07-27T17:18:47Z","updated_at":"2016-07-27T17:18:47Z","body":"So, I need help of competent people in the description 0062FEA0 function ic client side.\r\nAnd now I can offer here is a solution.\r\nSince elemental damage is contained within the base, then we do not need to try to send it to the client. It is enough to correctly count of absorption and resist (in principle, it is logical and should be applied also to mangos-classic too)\r\n\r\n```diff\r\ndiff --git a/src/game/Unit.cpp b/src/game/Unit.cpp\r\nindex 6d03331..3d40e77 100644\r\n--- a/src/game/Unit.cpp\r\n+++ b/src/game/Unit.cpp\r\n@@ -4990,18 +4990,24 @@ void Unit::SendAttackStateUpdate(CalcDamageInfo* damageInfo)\r\n     data << damageInfo->target->GetPackGUID();\r\n     data << uint32(damageInfo->totalDamage);                // Total damage\r\n \r\n-    data << uint8(m_weaponDamageCount[damageInfo->attackType]); // Sub damage count\r\n+    data << uint8(1); // Sub damage count\r\n     //===  Sub damage description\r\n+    uint32 absorb = 0;\r\n+    uint32 resist = 0;\r\n+    data << uint32(damageInfo->subDamage[0].damageSchoolMask);\r\n+    data << float(damageInfo->totalDamage);\r\n+    data << uint32(damageInfo->totalDamage);\r\n     for (uint8 i = 0; i < m_weaponDamageCount[damageInfo->attackType]; i++)\r\n     {\r\n-        SubDamageInfo *subDamage = &damageInfo->subDamage[i];\r\n+        SubDamageInfo *subDamage = &damageInfo->subDamage[0];\r\n \r\n-        data << uint32(GetFirstSchoolInMask(subDamage->damageSchoolMask));  // School of sub damage\r\n-        data << float(subDamage->damage)/ float(damageInfo->totalDamage);   // Float coefficient of sub damage\r\n-        data << uint32(subDamage->damage);                                  // Sub damage\r\n-        data << uint32(subDamage->absorb);                                  // Absorb\r\n-        data << uint32(subDamage->resist);                                  // Resist\r\n+        absorb += subDamage->absorb;\r\n+        resist += subDamage->resist;\r\n     }\r\n+\r\n+    data << uint32(absorb);                                  // Absorb\r\n+    data << uint32(resist);                                  // Resist\r\n+\r\n     //=================================================\r\n     data << uint32(damageInfo->TargetState);\r\n     data << uint32(0);                                      // unknown, usually seen with -1, 0 and 1000\r\n\r\n```\r\n\r\n\r\n\r\n"}}
{"actor":{"display_login":"sidsukana"}}