diff options
67 files changed, 3186 insertions, 362 deletions
diff --git a/contrib/grafana/1_General.json b/contrib/grafana/1_General.json new file mode 100644 index 00000000000..e54791f190e --- /dev/null +++ b/contrib/grafana/1_General.json @@ -0,0 +1,889 @@ +{ + "id": 1, + "title": "General info", + "originalTitle": "General info", + "tags": [], + "style": "dark", + "timezone": "browser", + "editable": true, + "hideControls": false, + "sharedCrosshair": false, + "rows": [ + { + "collapse": false, + "editable": true, + "height": "25px", + "panels": [ + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "datasource": "Influx", + "editable": true, + "error": false, + "format": "none", + "id": 5, + "interval": null, + "isNew": true, + "links": [], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "span": 3, + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "targets": [ + { + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "auto" + ], + "type": "time" + } + ], + "measurement": "online_players", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "type": "field", + "params": [ + "value" + ] + }, + { + "type": "last", + "params": [] + } + ] + ], + "tags": [ + { + "key": "realm", + "operator": "=~", + "value": "/^$realm$/" + } + ] + } + ], + "thresholds": "", + "title": "Online players", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current", + "timeFrom": null, + "timeShift": null, + "hideTimeOverride": false + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "datasource": "Influx", + "editable": true, + "error": false, + "format": "none", + "id": 6, + "interval": null, + "isNew": true, + "links": [], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "span": 3, + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "targets": [ + { + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "auto" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "update_time_diff", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "realm", + "operator": "=~", + "value": "/^$realm$/" + } + ] + } + ], + "thresholds": "", + "title": "Update diff (avg)", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "avg", + "timeFrom": "1m" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "datasource": "Influx", + "editable": true, + "error": false, + "format": "none", + "id": 7, + "interval": null, + "isNew": true, + "links": [], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "span": 3, + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "targets": [ + { + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "auto" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "update_time_diff", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [] + } + ], + "thresholds": "", + "title": "Update diff (avg)", + "transparent": false, + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "avg", + "timeFrom": "5m" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "datasource": "Influx", + "editable": true, + "error": false, + "format": "none", + "id": 8, + "interval": null, + "isNew": true, + "links": [], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "span": 3, + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "targets": [ + { + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "auto" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "update_time_diff", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "realm", + "operator": "=~", + "value": "/^$realm$/" + } + ] + } + ], + "thresholds": "", + "title": "Update diff (avg)", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "avg", + "timeFrom": "15m", + "timeShift": null + } + ], + "title": "New row" + }, + { + "collapse": false, + "editable": true, + "height": "250px", + "panels": [ + { + "aliasColors": {}, + "bars": false, + "datasource": "Influx", + "editable": true, + "error": false, + "fill": 1, + "grid": { + "leftLogBase": 1, + "leftMax": null, + "leftMin": null, + "rightLogBase": 1, + "rightMax": null, + "rightMin": null, + "threshold1": null, + "threshold1Color": "rgba(216, 200, 27, 0.27)", + "threshold2": null, + "threshold2Color": "rgba(234, 112, 112, 0.22)" + }, + "id": 1, + "isNew": true, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "span": 12, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "Update diff", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "update_time_diff", + "policy": "default", + "query": "SELECT mean(\"value\") FROM \"update_time_diff\" WHERE \"realm\" =~ /$realm$/ AND $timeFilter GROUP BY time($interval) fill(null)", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "realm", + "operator": "=~", + "value": "/$realm$/" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Update diff", + "tooltip": { + "msResolution": false, + "shared": true, + "value_type": "cumulative" + }, + "type": "graph", + "x-axis": true, + "xaxis": { + "show": true + }, + "y-axis": true, + "y_formats": [ + "ms", + "short" + ], + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ] + } + ], + "title": "Row" + }, + { + "collapse": false, + "editable": true, + "height": "250px", + "panels": [ + { + "aliasColors": {}, + "bars": false, + "datasource": "Influx", + "editable": true, + "error": false, + "fill": 1, + "grid": { + "leftLogBase": 1, + "leftMax": null, + "leftMin": null, + "rightLogBase": 1, + "rightMax": null, + "rightMin": null, + "threshold1": null, + "threshold1Color": "rgba(216, 200, 27, 0.27)", + "threshold2": null, + "threshold2Color": "rgba(234, 112, 112, 0.22)" + }, + "id": 4, + "isNew": true, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "span": 12, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "Online players", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "online_players", + "policy": "default", + "query": "SELECT mean(\"value\") FROM \"online_players\" WHERE \"realm\" =~ /$realm$/ AND $timeFilter GROUP BY time($interval) fill(null)", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "realm", + "operator": "=~", + "value": "/$realm$/" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Online players", + "tooltip": { + "msResolution": false, + "shared": true, + "value_type": "cumulative" + }, + "type": "graph", + "x-axis": true, + "xaxis": { + "show": true + }, + "y-axis": true, + "y_formats": [ + "short", + "short" + ], + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ] + } + ], + "title": "New row" + }, + { + "collapse": false, + "editable": true, + "height": "250px", + "panels": [ + { + "aliasColors": {}, + "bars": false, + "datasource": "Influx", + "editable": true, + "error": false, + "fill": 1, + "grid": { + "leftLogBase": 1, + "leftMax": null, + "leftMin": null, + "rightLogBase": 1, + "rightMax": null, + "rightMin": null, + "threshold1": null, + "threshold1Color": "rgba(216, 200, 27, 0.27)", + "threshold2": null, + "threshold2Color": "rgba(234, 112, 112, 0.22)" + }, + "id": 3, + "isNew": true, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [ + { + "alias": "Logouts", + "transform": "negative-Y" + } + ], + "span": 12, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "Logins", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "player_events", + "policy": "default", + "query": "SELECT count(\"text\") FROM \"player_events\" WHERE \"realm\" =~ /$realm$/ AND \"title\" = 'Login' AND $timeFilter GROUP BY time($interval) fill(0)", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "text" + ], + "type": "field" + }, + { + "params": [], + "type": "count" + } + ] + ], + "tags": [ + { + "key": "realm", + "operator": "=", + "value": "Trinity" + } + ] + }, + { + "alias": "Logouts", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "policy": "default", + "query": "SELECT count(\"text\") FROM \"player_events\" WHERE \"realm\" =~ /$realm$/ AND \"title\" = 'Logout' AND $timeFilter GROUP BY time($interval) fill(0)", + "rawQuery": true, + "refId": "B", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Player login/logout", + "tooltip": { + "msResolution": false, + "shared": true, + "value_type": "cumulative" + }, + "type": "graph", + "x-axis": true, + "xaxis": { + "show": true + }, + "y-axis": true, + "y_formats": [ + "short", + "short" + ], + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ] + } + ], + "title": "New row" + } + ], + "time": { + "from": "now-15m", + "to": "now" + }, + "timepicker": { + "now": true, + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ], + "time_options": [ + "5m", + "15m", + "1h", + "6h", + "12h", + "24h", + "2d", + "7d", + "30d" + ] + }, + "templating": { + "list": [ + { + "allFormat": "regex values", + "current": { + "text": "Trinity", + "value": "Trinity" + }, + "datasource": "Influx", + "includeAll": false, + "multi": false, + "multiFormat": "regex values", + "name": "realm", + "options": [ + { + "text": "Trinity", + "value": "Trinity", + "selected": true + } + ], + "query": "show tag values from events with key = realm", + "refresh": 1, + "regex": "", + "type": "query" + } + ] + }, + "annotations": { + "list": [ + { + "datasource": "Influx", + "enable": true, + "iconColor": "#C0C6BE", + "iconSize": 13, + "lineColor": "rgba(255, 96, 96, 0.592157)", + "name": "Global Events", + "query": "select title, text from events where $timeFilter and realm =~ /$realm$/", + "showLine": true, + "textColumn": "text", + "titleColumn": "title" + } + ] + }, + "refresh": "1m", + "schemaVersion": 12, + "version": 7, + "links": [] +}
\ No newline at end of file diff --git a/contrib/grafana/2_Maps.json b/contrib/grafana/2_Maps.json new file mode 100644 index 00000000000..6c2cecb1035 --- /dev/null +++ b/contrib/grafana/2_Maps.json @@ -0,0 +1,339 @@ +{ + "id": 2, + "title": "Maps, vmaps and mmaps", + "originalTitle": "Maps, vmaps and mmaps", + "tags": [], + "style": "dark", + "timezone": "browser", + "editable": true, + "hideControls": false, + "sharedCrosshair": false, + "rows": [ + { + "collapse": false, + "editable": true, + "height": "250px", + "panels": [ + { + "aliasColors": {}, + "bars": false, + "datasource": "Influx", + "editable": true, + "error": false, + "fill": 1, + "grid": { + "leftLogBase": 1, + "leftMax": null, + "leftMin": null, + "rightLogBase": 1, + "rightMax": null, + "rightMin": null, + "threshold1": null, + "threshold1Color": "rgba(216, 200, 27, 0.27)", + "threshold2": null, + "threshold2Color": "rgba(234, 112, 112, 0.22)" + }, + "id": 2, + "isNew": true, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [ + { + "alias": "Unload tile", + "transform": "negative-Y" + } + ], + "span": 12, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "Load tile", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$interval" + ], + "type": "time" + }, + { + "params": [ + "0" + ], + "type": "fill" + } + ], + "query": "SELECT count(\"title\") FROM \"map_events\" WHERE \"realm\" =~ /$realm$/ AND \"title\" = 'LoadMapTile' AND $timeFilter GROUP BY time($interval) fill(0)", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [] + }, + { + "alias": "Unload tile", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "query": "SELECT count(\"title\") FROM \"map_events\" WHERE \"realm\" =~ /$realm$/ AND \"title\" = 'UnloadMapTile' AND $timeFilter GROUP BY time($interval) fill(0)", + "rawQuery": true, + "refId": "B", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Map", + "tooltip": { + "shared": true, + "value_type": "cumulative" + }, + "type": "graph", + "x-axis": true, + "y-axis": true, + "y_formats": [ + "short", + "short" + ] + } + ], + "title": "Row" + }, + { + "collapse": false, + "editable": true, + "height": "250px", + "panels": [ + { + "aliasColors": {}, + "bars": false, + "datasource": "Influx", + "editable": true, + "error": false, + "fill": 1, + "grid": { + "leftLogBase": 1, + "leftMax": null, + "leftMin": null, + "rightLogBase": 1, + "rightMax": null, + "rightMin": null, + "threshold1": null, + "threshold1Color": "rgba(216, 200, 27, 0.27)", + "threshold2": null, + "threshold2Color": "rgba(234, 112, 112, 0.22)" + }, + "id": 1, + "isNew": true, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "span": 12, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "Pathfinding queries", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "query": "SELECT count(\"title\") FROM \"mmap_events\" WHERE \"realm\" =~ /$realm$/ AND \"title\" = 'CalculatePath' AND $timeFilter GROUP BY time($interval) fill(0)", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "MMap", + "tooltip": { + "shared": true, + "value_type": "cumulative" + }, + "type": "graph", + "x-axis": true, + "y-axis": true, + "y_formats": [ + "short", + "short" + ] + } + ], + "title": "New row" + } + ], + "time": { + "from": "now-15m", + "to": "now" + }, + "timepicker": { + "now": true, + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ], + "time_options": [ + "5m", + "15m", + "1h", + "6h", + "12h", + "24h", + "2d", + "7d", + "30d" + ] + }, + "templating": { + "list": [ + { + "allFormat": "regex values", + "current": { + "text": "Trinity", + "value": "Trinity" + }, + "datasource": "Influx", + "includeAll": false, + "multi": false, + "multiFormat": "regex values", + "name": "realm", + "options": [ + { + "text": "Trinity", + "value": "Trinity", + "selected": true + } + ], + "query": "show tag values from events with key = realm", + "refresh": true, + "type": "query" + } + ] + }, + "annotations": { + "list": [ + { + "datasource": "Influx", + "enable": true, + "iconColor": "#C0C6BE", + "iconSize": 13, + "lineColor": "rgba(255, 96, 96, 0.592157)", + "name": "Global Events", + "query": "select title, text from events where $timeFilter and realm =~ /$realm$/", + "showLine": true, + "textColumn": "text", + "titleColumn": "title" + } + ] + }, + "refresh": "1m", + "schemaVersion": 8, + "version": 11, + "links": [] +}
\ No newline at end of file diff --git a/contrib/grafana/3_Network.json b/contrib/grafana/3_Network.json new file mode 100644 index 00000000000..98c190e1185 --- /dev/null +++ b/contrib/grafana/3_Network.json @@ -0,0 +1,242 @@ +{ + "id": 3, + "title": "Network", + "originalTitle": "Network", + "tags": [], + "style": "dark", + "timezone": "browser", + "editable": true, + "hideControls": false, + "sharedCrosshair": false, + "rows": [ + { + "collapse": false, + "editable": true, + "height": "250px", + "panels": [ + { + "aliasColors": {}, + "bars": false, + "datasource": "Influx", + "editable": true, + "error": false, + "fill": 1, + "grid": { + "leftLogBase": 1, + "leftMax": null, + "leftMin": null, + "rightLogBase": 1, + "rightMax": null, + "rightMin": null, + "threshold1": null, + "threshold1Color": "rgba(216, 200, 27, 0.27)", + "threshold2": null, + "threshold2Color": "rgba(234, 112, 112, 0.22)" + }, + "id": 1, + "isNew": true, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "span": 12, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "Processed packets", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$interval" + ], + "type": "time" + }, + { + "params": [ + "0" + ], + "type": "fill" + } + ], + "measurement": "processed_packets", + "query": "SELECT sum(\"value\") FROM \"processed_packets\" WHERE \"realm\" =~ /$realm$/ AND $timeFilter GROUP BY time($interval) fill(0)", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + } + ] + ], + "tags": [ + { + "key": "realm", + "operator": "=~", + "value": "/$realm$/" + } + ] + }, + { + "alias": "Processed packets / mean per session", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$interval" + ], + "type": "time" + }, + { + "params": [ + "0" + ], + "type": "fill" + } + ], + "measurement": "processed_packets", + "query": "SELECT mean(\"value\") FROM \"processed_packets\" WHERE \"realm\" =~ /$realm$/ AND $timeFilter GROUP BY time($interval) fill(0)", + "refId": "B", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "realm", + "operator": "=~", + "value": "/$realm$/" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Processed packets", + "tooltip": { + "shared": true, + "value_type": "cumulative" + }, + "type": "graph", + "x-axis": true, + "y-axis": true, + "y_formats": [ + "short", + "short" + ] + } + ], + "title": "Row" + } + ], + "time": { + "from": "now-15m", + "to": "now" + }, + "timepicker": { + "now": true, + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ], + "time_options": [ + "5m", + "15m", + "1h", + "6h", + "12h", + "24h", + "2d", + "7d", + "30d" + ] + }, + "templating": { + "list": [ + { + "allFormat": "regex values", + "current": { + "text": "Trinity", + "value": "Trinity" + }, + "datasource": "Influx", + "includeAll": false, + "multi": false, + "multiFormat": "regex values", + "name": "realm", + "options": [ + { + "text": "Trinity", + "value": "Trinity", + "selected": true + } + ], + "query": "show tag values from events with key = realm", + "refresh": true, + "type": "query" + } + ] + }, + "annotations": { + "list": [ + { + "datasource": "Influx", + "enable": true, + "iconColor": "#C0C6BE", + "iconSize": 13, + "lineColor": "rgba(255, 96, 96, 0.592157)", + "name": "Global Events", + "query": "select title, text from events where $timeFilter and realm =~ /$realm$/", + "showLine": true, + "textColumn": "text", + "titleColumn": "title" + } + ] + }, + "refresh": "1m", + "schemaVersion": 8, + "version": 7, + "links": [] +}
\ No newline at end of file diff --git a/sql/updates/world/3.3.5/2016_06_04_00_world.sql b/sql/updates/world/3.3.5/2016_06_04_00_world.sql new file mode 100644 index 00000000000..e44fe54de55 --- /dev/null +++ b/sql/updates/world/3.3.5/2016_06_04_00_world.sql @@ -0,0 +1,19 @@ +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=6556; + +DELETE FROM `smart_scripts` WHERE `entryorguid`=6556 AND `source_type`=0; +DELETE FROM `smart_scripts` WHERE `entryorguid`=6557 AND `source_type`=0 AND `id`=7; +DELETE FROM `smart_scripts` WHERE `entryorguid`=6559 AND `source_type`=0 AND `id`=1; + +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(6556, 0, 0, 0, 8, 0, 100, 1, 15702, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Muculent Ooze - On Spell Hit (Filling Empty Jar) - Despawn'), +(6557, 0, 7, 0, 8, 0, 100, 1, 15702, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Primal Ooze - On Spell Hit (Filling Empty Jar) - Despawn'), +(6559, 0, 1, 0, 8, 0, 100, 1, 15702, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Glutinous Ooze - On Spell Hit (Filling Empty Jar) - Despawn'); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=17 AND `SourceEntry`=15702; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(17, 0, 15702, 0, 0, 31, 1, 3, 6556, 0, 0, 0, 0, '', 'Filling Empty Jar can be used on Muculent Ooze'), +(17, 0, 15702, 0, 1, 31, 1, 3, 6557, 0, 0, 0, 0, '', 'Filling Empty Jar can be used on Muculent Ooze'), +(17, 0, 15702, 0, 2, 31, 1, 3, 6559, 0, 0, 0, 0, '', 'Filling Empty Jar can be used on Muculent Ooze'), +(17, 0, 15702, 0, 0, 36, 1, 0, 0, 0, 1, 0, 0, '', 'Target must be dead'), +(17, 0, 15702, 0, 1, 36, 1, 0, 0, 0, 1, 0, 0, '', 'Target must be dead'), +(17, 0, 15702, 0, 2, 36, 1, 0, 0, 0, 1, 0, 0, '', 'Target must be dead'); diff --git a/sql/updates/world/3.3.5/2016_06_04_01_world.sql b/sql/updates/world/3.3.5/2016_06_04_01_world.sql new file mode 100644 index 00000000000..fb048449d40 --- /dev/null +++ b/sql/updates/world/3.3.5/2016_06_04_01_world.sql @@ -0,0 +1,12 @@ +DROP TABLE IF EXISTS `playercreateinfo_cast_spell`; +CREATE TABLE IF NOT EXISTS `playercreateinfo_cast_spell` ( + `raceMask` INT(10) UNSIGNED NOT NULL DEFAULT '0', + `classMask` INT(10) UNSIGNED NOT NULL DEFAULT '0', + `spell` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0', + `note` VARCHAR(255) DEFAULT NULL +) ENGINE=MYISAM DEFAULT CHARSET=utf8; + +DELETE FROM `playercreateinfo_cast_spell` WHERE `spell` IN (48266, 2457); +INSERT INTO `playercreateinfo_cast_spell` (`racemask`, `classmask`, `spell`, `note`) VALUES +(0, 32, 48266, 'Death Knight - Blood Presence'), +(0, 1, 2457, 'Warrior - Battle Stance'); diff --git a/sql/updates/world/3.3.5/2016_06_05_00_world.sql b/sql/updates/world/3.3.5/2016_06_05_00_world.sql new file mode 100644 index 00000000000..6da2282d424 --- /dev/null +++ b/sql/updates/world/3.3.5/2016_06_05_00_world.sql @@ -0,0 +1,2 @@ +-- +UPDATE `page_text` SET `Text`="Westfall Stew$B$B3 parts Stringy Vulture Meat$B3 Goretusk Snouts$B3 Murloc Eyes$B3 Okra$B$BMix together and bring to a boil. Let simmer for at least two hours before serving." WHERE `ID`=213; diff --git a/sql/updates/world/3.3.5/2016_06_05_01_world.sql b/sql/updates/world/3.3.5/2016_06_05_01_world.sql new file mode 100644 index 00000000000..444a5be17ed --- /dev/null +++ b/sql/updates/world/3.3.5/2016_06_05_01_world.sql @@ -0,0 +1,2 @@ +-- +UPDATE `page_text` SET `Text`="Osric,$B$BPlease find below the list of armor of which we are in need:$B$B10 Mail shirts$B20 Helms$B30 Armor Patches$B15 Mail Boots$B$BWe are, as always, in your debt. And should Westfall ever be free of the thieves who threaten it, it would ease the guilt in my heart if I could invite you to my family's home, for a fine meal cooked from the bounty this land was once so well known.$B$B-Lewis$BQuartermaster, Sentinel Hill" WHERE `ID`=2512; diff --git a/sql/updates/world/3.3.5/2016_06_05_02_world.sql b/sql/updates/world/3.3.5/2016_06_05_02_world.sql new file mode 100644 index 00000000000..cab093eb88f --- /dev/null +++ b/sql/updates/world/3.3.5/2016_06_05_02_world.sql @@ -0,0 +1,2 @@ +-- +UPDATE `page_text` SET `Text`="Grelin,$B$BMy time is short and many matters press on my time, and I hope that your investigation of the trolls will not be one of them. Therefore I will allow you to use my authority in dealing with the trolls in whatever fashion you deem necessary, more so if you are able to find an expedient solution.$B$BMagni Bronzebeard" WHERE `ID`=80; diff --git a/sql/updates/world/3.3.5/2016_06_05_03_world.sql b/sql/updates/world/3.3.5/2016_06_05_03_world.sql new file mode 100644 index 00000000000..d9bd5ecab2c --- /dev/null +++ b/sql/updates/world/3.3.5/2016_06_05_03_world.sql @@ -0,0 +1,2 @@ +-- +UPDATE `quest_template_addon` SET `PrevQuestID`=315 WHERE `ID`=415; diff --git a/sql/updates/world/3.3.5/2016_06_05_04_world.sql b/sql/updates/world/3.3.5/2016_06_05_04_world.sql new file mode 100644 index 00000000000..fdf6b535f8d --- /dev/null +++ b/sql/updates/world/3.3.5/2016_06_05_04_world.sql @@ -0,0 +1,2 @@ +-- +UPDATE `quest_offer_reward` SET `RewardText`="The Malt is brewed, the Boars are dead$BAnd before all is done and anything said$BWe will have to fight for first dibs$BOn these savory Beer Basted Boar Ribs!" WHERE `ID`=384; diff --git a/sql/updates/world/3.3.5/2016_06_05_05_world.sql b/sql/updates/world/3.3.5/2016_06_05_05_world.sql new file mode 100644 index 00000000000..9c69b2d7639 --- /dev/null +++ b/sql/updates/world/3.3.5/2016_06_05_05_world.sql @@ -0,0 +1,5 @@ +-- +UPDATE `quest_template_addon` SET `PrevQuestID`=8328 WHERE `ID`=10068; +UPDATE `quest_template_addon` SET `PrevQuestID`=9676 WHERE `ID`=10069; +UPDATE `quest_template_addon` SET `PrevQuestID`=9393 WHERE `ID`=10070; +UPDATE `quest_template_addon` SET `PrevQuestID`=8564 WHERE `ID`=10072; diff --git a/sql/updates/world/3.3.5/2016_06_05_06_world.sql b/sql/updates/world/3.3.5/2016_06_05_06_world.sql new file mode 100644 index 00000000000..5d63a2c7e37 --- /dev/null +++ b/sql/updates/world/3.3.5/2016_06_05_06_world.sql @@ -0,0 +1,2 @@ +-- +UPDATE `quest_template_addon` SET `PrevQuestID`=8325 WHERE `ID` IN (9393, 8328, 9676, 8564, 9392, 8563); diff --git a/sql/updates/world/3.3.5/2016_06_05_07_world.sql b/sql/updates/world/3.3.5/2016_06_05_07_world.sql new file mode 100644 index 00000000000..71d39603080 --- /dev/null +++ b/sql/updates/world/3.3.5/2016_06_05_07_world.sql @@ -0,0 +1,4 @@ +-- add missing localization for item "Bamboo Cage Key" (entry: 12301) +DELETE FROM `locales_item` WHERE `entry`=12301; +INSERT INTO `locales_item` (`entry`, `name_loc2`, `name_loc3`, `name_loc6`, `name_loc7`, `name_loc8`) VALUES +(12301, 'Clé de la cage en bambou', 'Bambuskäfigschlüssel', 'Llave de jaula de bambú', 'Llave de jaula de bambú', 'Ключ от бамбуковой клетки'); diff --git a/sql/updates/world/3.3.5/2016_06_05_08_world.sql b/sql/updates/world/3.3.5/2016_06_05_08_world.sql new file mode 100644 index 00000000000..a2f5c580f92 --- /dev/null +++ b/sql/updates/world/3.3.5/2016_06_05_08_world.sql @@ -0,0 +1,2 @@ +-- adding a key requirement for gameobject "Cage Door" (entry: 143979) at Kurzen's Compound by closing it +UPDATE `gameobject` SET `state`=1 WHERE `guid`=10673; diff --git a/sql/updates/world/3.3.5/2016_06_05_09_world.sql b/sql/updates/world/3.3.5/2016_06_05_09_world.sql new file mode 100644 index 00000000000..98f707aafcd --- /dev/null +++ b/sql/updates/world/3.3.5/2016_06_05_09_world.sql @@ -0,0 +1,9 @@ +-- Plague Scientist SAI +SET @ENTRY := 37023; +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,0,0,100,0,2000,3000,23000,24000,11,71103,0,0,0,0,0,6,0,0,0,0,0,0,0,"Plague Scientist - In Combat - Cast 'Combobulating Spray'"), +(@ENTRY,0,1,0,0,0,100,0,5000,6000,5000,6000,11,73079,0,0,0,0,0,2,0,0,0,0,0,0,0,"Plague Scientist - In Combat - Cast 'Plague Blast'"), +(@ENTRY,0,2,0,0,0,100,0,9000,10000,25000,26000,11,69871,0,0,0,0,0,9,0,0,30,0,0,0,0,"Plague Scientist - In Combat - Cast 'Plague Stream'"), +(@ENTRY,0,3,0,1,0,100,0,2000,3000,10000,10000,11,69871,0,0,0,0,0,9,10404,0,10,0,0,0,0,"Plague Scientist - Out of Combat - Cast 'Plague Stream'"); diff --git a/sql/updates/world/3.3.5/2016_06_05_10_world.sql b/sql/updates/world/3.3.5/2016_06_05_10_world.sql new file mode 100644 index 00000000000..66c6e8dbc7c --- /dev/null +++ b/sql/updates/world/3.3.5/2016_06_05_10_world.sql @@ -0,0 +1,5 @@ +-- +DELETE FROM `spell_area` WHERE `spell` IN (74092, 74310); +INSERT INTO `spell_area` (`spell`, `area`, `quest_start`, `quest_end`, `aura_spell`, `racemask`, `gender`, `autocast`, `quest_start_status`) VALUES +(74092,368,25495,25445,0,0,2,1,74), +(74310,133,25287,25393,0,0,2,1,74); diff --git a/sql/updates/world/3.3.5/2016_06_05_11_world.sql b/sql/updates/world/3.3.5/2016_06_05_11_world.sql new file mode 100644 index 00000000000..3a76d73f9ab --- /dev/null +++ b/sql/updates/world/3.3.5/2016_06_05_11_world.sql @@ -0,0 +1,7 @@ +-- +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN(13,17) AND `SourceEntry`=58912; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(17,0,58912,0,0,31,1,3,31254,0,0,0,0,'','Deathstorm requires target Lordaeron Footsoldier'), +(17,0,58912,0,1,31,1,3,32414,0,0,0,0,'','Deathstorm requires target Lordaeron Captain'), +(13,1,58912,0,0,31,0,3,31254,0,0,0,0,'','Deathstorm can hit Lordaeron Footsoldier'), +(13,1,58912,0,1,31,0,3,32414,0,0,0,0,'','Deathstorm can hit Lordaeron Captain'); diff --git a/sql/updates/world/3.3.5/2016_06_05_12_world.sql b/sql/updates/world/3.3.5/2016_06_05_12_world.sql new file mode 100644 index 00000000000..a446260985f --- /dev/null +++ b/sql/updates/world/3.3.5/2016_06_05_12_world.sql @@ -0,0 +1,2 @@ +-- +UPDATE `creature_template` SET `InhabitType` = 1 WHERE `entry` = 17312; diff --git a/sql/updates/world/3.3.5/2016_06_06_00_world.sql b/sql/updates/world/3.3.5/2016_06_06_00_world.sql new file mode 100644 index 00000000000..61d93dab677 --- /dev/null +++ b/sql/updates/world/3.3.5/2016_06_06_00_world.sql @@ -0,0 +1,83 @@ +-- ghoul_base_stats +DELETE FROM `pet_levelstats` WHERE creature_entry = 26125; +INSERT INTO `pet_levelstats` (`creature_entry`, `level`, `hp`, `mana`, `armor`, `str`, `agi`, `sta`, `inte`, `spi`) VALUES +(26125,1,48,80,10,20,16,13,20,8), +(26125,2,105,106,67,22,17,14,21,9), +(26125,3,162,132,124,24,18,15,22,10), +(26125,4,219,158,181,26,19,16,23,11), +(26125,5,276,184,238,28,20,17,24,12), +(26125,6,333,210,295,30,21,18,25,13), +(26125,7,390,236,352,32,22,19,26,14), +(26125,8,447,262,409,34,23,20,27,15), +(26125,9,504,288,466,36,24,21,28,16), +(26125,10,561,314,523,38,25,22,29,17), +(26125,11,618,340,580,40,26,23,30,18), +(26125,12,675,366,637,42,27,24,31,19), +(26125,13,732,392,694,44,28,25,32,20), +(26125,14,789,418,751,46,29,26,33,21), +(26125,15,846,444,808,48,30,27,34,22), +(26125,16,903,470,865,50,31,28,35,23), +(26125,17,960,496,922,52,32,29,36,24), +(26125,18,1017,522,979,54,33,30,37,25), +(26125,19,1074,548,1036,56,34,31,38,26), +(26125,20,1131,574,1093,58,35,32,39,27), +(26125,21,1188,600,1150,60,36,33,40,28), +(26125,22,1245,626,1207,62,37,34,41,29), +(26125,23,1302,652,1264,64,38,35,42,30), +(26125,24,1359,678,1321,66,39,36,43,31), +(26125,25,1416,704,1378,68,40,37,44,32), +(26125,26,1473,730,1435,70,41,38,45,33), +(26125,27,1530,756,1492,72,42,39,46,34), +(26125,28,1587,782,1549,74,43,40,47,35), +(26125,29,1644,808,1606,76,44,41,48,36), +(26125,30,1701,834,1663,78,45,42,49,37), +(26125,31,1758,860,1720,80,46,43,50,38), +(26125,32,1815,886,1777,82,47,44,51,39), +(26125,33,1872,912,1834,84,48,45,52,40), +(26125,34,1929,938,1891,86,49,46,53,41), +(26125,35,1986,964,1948,88,50,47,54,42), +(26125,36,2043,990,2005,90,51,48,55,43), +(26125,37,2100,1016,2062,92,52,49,56,44), +(26125,38,2157,1042,2119,94,53,50,57,45), +(26125,39,2214,1068,2176,96,54,51,58,46), +(26125,40,2271,1094,2233,98,55,52,59,47), +(26125,41,2328,1120,2290,100,56,53,60,48), +(26125,42,2385,1146,2347,102,57,54,61,49), +(26125,43,2442,1172,2404,104,58,55,62,50), +(26125,44,2499,1198,2461,106,59,56,63,51), +(26125,45,2556,1224,2518,108,60,57,64,52), +(26125,46,2613,1250,2575,110,61,58,65,53), +(26125,47,2670,1276,2632,112,62,59,66,54), +(26125,48,2727,1302,2689,114,63,60,67,55), +(26125,49,2784,1328,2746,116,64,61,68,56), +(26125,50,2841,1354,2803,118,65,62,69,57), +(26125,51,2898,1380,2860,120,66,63,70,58), +(26125,52,2955,1406,2917,122,67,64,71,59), +(26125,53,3012,1432,2974,124,68,65,72,60), +(26125,54,3069,1458,3031,126,69,66,73,61), +(26125,55,3126,1484,3088,128,70,67,74,62), +(26125,56,3183,1510,3145,130,71,68,75,63), +(26125,57,3240,1536,3202,132,72,69,76,64), +(26125,58,3297,1562,3259,134,73,70,77,65), +(26125,59,3354,1588,3316,136,74,71,78,66), +(26125,60,3411,1614,3373,138,75,72,79,67), +(26125,61,3468,1640,3430,140,76,73,80,68), +(26125,62,3525,1666,3487,142,77,74,81,69), +(26125,63,3582,1692,3544,144,78,75,82,70), +(26125,64,3639,1718,3601,146,79,76,83,71), +(26125,65,3696,1744,3658,148,80,77,84,72), +(26125,66,3753,1770,3715,150,81,78,85,73), +(26125,67,3810,1796,3772,152,82,79,86,74), +(26125,68,3867,1822,3829,154,83,80,87,75), +(26125,69,3924,1848,3886,156,84,81,88,76), +(26125,70,3981,1874,3943,158,85,82,89,77), +(26125,71,4038,1900,4000,160,86,83,90,78), +(26125,72,4095,1926,4057,162,87,84,91,79), +(26125,73,4152,1952,4114,164,88,85,92,80), +(26125,74,4209,1978,4171,166,89,86,93,81), +(26125,75,4266,2004,4228,168,90,87,94,82), +(26125,76,4323,2030,4285,170,91,88,95,83), +(26125,77,4380,2056,4342,172,92,89,96,84), +(26125,78,4437,2082,4399,174,93,90,97,85), +(26125,79,4494,2108,4456,176,94,91,98,86), +(26125,80,4551,2134,4513,331,95,92,99,87); diff --git a/sql/updates/world/3.3.5/2016_06_07_00_world.sql b/sql/updates/world/3.3.5/2016_06_07_00_world.sql new file mode 100644 index 00000000000..fbe7c362718 --- /dev/null +++ b/sql/updates/world/3.3.5/2016_06_07_00_world.sql @@ -0,0 +1,2 @@ +-- remove incorrect trigger flag from hodir ice blocks that prevents encounter from starting +UPDATE `creature_template` SET `flags_extra`=(`flags_extra`&~128) WHERE `entry` IN (32938,33353); diff --git a/sql/updates/world/3.3.5/2016_06_07_01_world.sql b/sql/updates/world/3.3.5/2016_06_07_01_world.sql new file mode 100644 index 00000000000..09e86bc0396 --- /dev/null +++ b/sql/updates/world/3.3.5/2016_06_07_01_world.sql @@ -0,0 +1,622 @@ +-- +-- Waypoints for Ghostlands +-- +-- Pathing for Deatholme Acolyte Entry: 16315 'TDB FORMAT' +SET @NPC := 82514; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=6980.597,`position_y`=-5898.018,`position_z`=28.76383 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,6980.597,-5898.018,28.76383,0,0,0,0,100,0), -- 23:05:14 +(@PATH,2,6980.413,-5864.207,38.00547,0,0,0,0,100,0), -- 23:05:31 +(@PATH,3,6985.412,-5841.971,49.12637,0,0,0,0,100,0), -- 23:05:46 +(@PATH,4,6996.224,-5824.525,58.95233,0,0,0,0,100,0), -- 23:05:56 +(@PATH,5,7008.987,-5810.714,68.33813,0,0,0,0,100,0), -- 23:06:05 +(@PATH,6,7018.887,-5796.988,77.02762,0,0,0,0,100,0), -- 23:06:14 +(@PATH,7,7023.633,-5785.236,83.22521,0,0,0,0,100,0), -- 23:06:21 +(@PATH,8,7025.083,-5767.624,91.65661,0,0,0,0,100,0), -- 23:06:27 +(@PATH,9,7023.818,-5754.515,99.82605,0,0,0,0,100,0), -- 23:06:35 +(@PATH,10,7021.463,-5739.864,105.2905,0,0,0,0,100,0), -- 23:06:42 +(@PATH,11,7023.037,-5750.744,102.3329,0,0,0,0,100,0), -- 23:06:50 +(@PATH,12,7024.833,-5765.023,93.1219,0,0,0,0,100,0), -- 23:06:54 +(@PATH,13,7024.46,-5781.898,84.79234,0,0,0,0,100,0), -- 23:07:01 +(@PATH,14,7021.089,-5792.683,79.57092,0,0,0,0,100,0), -- 23:07:09 +(@PATH,15,7010.271,-5809.296,69.25038,0,0,0,0,100,0), -- 23:07:14 +(@PATH,16,6998.258,-5822.302,60.71892,0,0,0,0,100,0), -- 23:07:23 +(@PATH,17,6986.333,-5840.401,49.7908,0,0,0,0,100,0), -- 23:07:31 +(@PATH,18,6980.666,-5861.458,39.13383,0,0,0,0,100,0); -- 23:07:40 + +-- Pathing for Deatholme Acolyte Entry: 16315 'TDB FORMAT' +SET @NPC := 82536; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=6997.067,`position_y`=-5687.621,`position_z`=102.8226 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,6997.067,-5687.621,102.8226,0,0,0,0,100,0), -- 23:06:27 +(@PATH,2,6990.939,-5688.242,101.8386,0,0,0,0,100,0), -- 23:06:32 +(@PATH,3,6976.603,-5693.576,96.38464,0,0,0,0,100,0), -- 23:06:36 +(@PATH,4,6970.503,-5700.29,92.63046,0,0,0,0,100,0), -- 23:06:41 +(@PATH,5,6967.743,-5712.647,88.57698,0,0,0,0,100,0), -- 23:06:45 +(@PATH,6,6970.009,-5720.242,85.64739,0,0,0,0,100,0), -- 23:06:50 +(@PATH,7,6971.563,-5723.634,84.75957,0,0,0,0,100,0), -- 23:06:55 +(@PATH,8,6979.354,-5724.356,84.26402,0,0,0,0,100,0), -- 23:06:57 +(@PATH,9,6979.47,-5714.573,84.58974,0,0,0,0,100,0), -- 23:07:00 +(@PATH,10,6979.149,-5705.578,84.45787,0,0,0,0,100,0), -- 23:07:05 +(@PATH,11,6979.545,-5714.578,84.56152,0,0,0,0,100,0), -- 23:09:00 +(@PATH,12,6979.16,-5705.374,84.45621,0,0,0,0,100,0), -- 23:09:04 +(@PATH,13,6980.682,-5682.834,82.93341,0,0,0,0,100,0), -- 23:09:11 +(@PATH,14,6985.518,-5671.094,82.00629,0,0,0,0,100,0), -- 23:09:17 +(@PATH,15,6990.438,-5665.75,81.61432,0,0,0,0,100,0), -- 23:09:22 +(@PATH,16,6995.886,-5661.015,81.00694,0,0,0,0,100,0), -- 23:09:26 +(@PATH,17,6995.958,-5660.979,80.95592,0,0,0,0,100,0), -- 23:09:29 +(@PATH,18,6990.574,-5665.602,81.49225,0,0,0,0,100,0), -- 23:09:30 +(@PATH,19,6985.71,-5671.139,81.79518,0,0,0,0,100,0), -- 23:09:33 +(@PATH,20,6979.59,-5690.713,83.48748,0,0,0,0,100,0), -- 23:09:38 +(@PATH,21,6979.259,-5705.457,84.32413,0,0,0,0,100,0), -- 23:09:44 +(@PATH,22,6980.716,-5719.662,84.53703,0,0,0,0,100,0), -- 23:09:52 +(@PATH,23,6978.376,-5725.388,84.53719,0,0,0,0,100,0), -- 23:09:56 +(@PATH,24,6977.495,-5726.067,84.54002,0,0,0,0,100,0), -- 23:09:58 +(@PATH,25,6968.405,-5716.007,87.3763,0,0,0,0,100,0), -- 23:10:01 +(@PATH,26,6967.94,-5709.555,89.84632,0,0,0,0,100,0), -- 23:10:06 +(@PATH,27,6974.01,-5696.171,94.75365,0,0,0,0,100,0), -- 23:10:09 +(@PATH,28,6984.721,-5690.32,99.80565,0,0,0,0,100,0); -- 23:10:14 + +-- Pathing for Deatholme Acolyte Entry: 16315 'TDB FORMAT' +SET @NPC := 82537; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=7010.643,`position_y`=-5693.538,`position_z`=102.6286 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,7010.643,-5693.538,102.6286,0,0,0,0,100,0), -- 23:06:47 +(@PATH,2,7016.285,-5693.483,102.6231,0,0,0,0,100,0), -- 23:06:49 +(@PATH,3,7018.219,-5692.301,102.6074,0,0,0,0,100,0), -- 23:06:50 +(@PATH,4,7021.005,-5689.024,102.3725,0,0,0,0,100,0), -- 23:06:53 +(@PATH,5,7018.614,-5679.159,102.6098,0,0,0,0,100,0), -- 23:06:56 +(@PATH,6,7014.545,-5677.964,102.6143,0,0,0,0,100,0), -- 23:06:57 +(@PATH,7,7010.401,-5678.611,102.6134,0,0,0,0,100,0), -- 23:07:00 +(@PATH,8,7007.026,-5681.029,102.6129,0,0,0,0,100,0), -- 23:07:02 +(@PATH,9,7004.883,-5684.334,102.6098,0,0,0,0,100,0), -- 23:07:05 +(@PATH,10,7005.852,-5689.117,102.6089,0,0,0,0,100,0); -- 23:07:07 + +-- Pathing for Deatholme Acolyte Entry: 16315 'TDB FORMAT' +SET @NPC := 82540; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=7029.595,`position_y`=-5682.818,`position_z`=102.658 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,7029.595,-5682.818,102.658,0,0,0,0,100,0), -- 23:06:56 +(@PATH,2,7035.782,-5681.29,102.0026,0,0,0,0,100,0), -- 23:07:01 +(@PATH,3,7045.729,-5681.199,98.82371,0,0,0,0,100,0), -- 23:07:03 +(@PATH,4,7056.35,-5684.523,93.90004,0,0,0,0,100,0), -- 23:07:07 +(@PATH,5,7045.667,-5681.057,98.76253,0,0,0,0,100,0), -- 23:09:05 +(@PATH,6,7056.332,-5684.539,93.80215,0,0,0,0,100,0), -- 23:09:09 +(@PATH,7,7060.951,-5689.726,91.59099,0,0,0,0,100,0), -- 23:09:13 +(@PATH,8,7064.874,-5703.865,86.7645,0,0,0,0,100,0), -- 23:09:17 +(@PATH,9,7063.655,-5709.466,84.63042,0,0,0,0,100,0), -- 23:09:22 +(@PATH,10,7058.803,-5714.256,84.48442,0,0,0,0,100,0), -- 23:09:27 +(@PATH,11,7057.9,-5714.272,84.27392,0,0,0,0,100,0), -- 23:09:28 +(@PATH,12,7054.177,-5703.301,84.48618,0,0,0,0,100,0), -- 23:09:30 +(@PATH,13,7052.994,-5694.213,84.35367,0,0,0,0,100,0), -- 23:09:37 +(@PATH,14,7043.341,-5673.357,82.8222,0,0,0,0,100,0), -- 23:09:43 +(@PATH,15,7035.741,-5663.536,81.92133,0,0,0,0,100,0), -- 23:09:49 +(@PATH,16,7029.659,-5659.765,81.63133,0,0,0,0,100,0), -- 23:09:52 +(@PATH,17,7022.754,-5657.553,81.0175,0,0,0,0,100,0), -- 23:09:56 +(@PATH,18,7022.701,-5657.519,80.93935,0,0,0,0,100,0), -- 23:10:00 +(@PATH,19,7029.343,-5659.941,81.43478,0,0,0,0,100,0), -- 23:10:01 +(@PATH,20,7038.872,-5666.699,82.0325,0,0,0,0,100,0), -- 23:10:05 +(@PATH,21,7047.313,-5680.742,83.38,0,0,0,0,100,0), -- 23:10:08 +(@PATH,22,7052.837,-5694.202,84.4315,0,0,0,0,100,0), -- 23:10:14 +(@PATH,23,7053.863,-5703.065,84.7151,0,0,0,0,100,0), -- 23:10:20 +(@PATH,24,7054.707,-5709.983,84.50665,0,0,0,0,100,0), -- 23:10:26 +(@PATH,25,7057.84,-5714.267,84.24426,0,0,0,0,100,0), -- 23:10:29 +(@PATH,26,7064.392,-5706.512,85.34109,0,0,0,0,100,0), -- 23:10:30 +(@PATH,27,7063.626,-5695.099,89.8451,0,0,0,0,100,0), -- 23:10:34 +(@PATH,28,7059.115,-5687.389,92.43468,0,0,0,0,100,0), -- 23:10:39 +(@PATH,29,7048.491,-5681.79,97.46969,0,0,0,0,100,0), -- 23:10:43 +(@PATH,30,7038.716,-5681.117,100.7739,0,0,0,0,100,0); -- 23:10:48 + +-- Pathing for Grimscale Oracle Entry: 15669 'TDB FORMAT' +SET @NPC := 56234; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=8878.816,`position_y`=-5749.102,`position_z`=0.5971264 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,8878.816,-5749.102,0.5971264,0,0,0,0,100,0), -- 23:32:50 +(@PATH,2,8872.123,-5724.519,0.5082448,0,0,0,0,100,0), -- 23:33:17 +(@PATH,3,8858.525,-5719.116,0.797046,0,0,0,0,100,0), -- 23:33:23 +(@PATH,4,8820.211,-5718.883,-1.039287,0,0,0,0,100,0), -- 23:33:33 +(@PATH,5,8797.094,-5711.732,0.5297012,0,0,0,0,100,0), -- 23:33:43 +(@PATH,6,8789.655,-5709.307,0.9552886,0,0,0,0,100,0), -- 23:33:53 +(@PATH,7,8771.264,-5697.327,1.041862,0,0,0,0,100,0), -- 23:34:01 +(@PATH,8,8754.51,-5692.826,0.9234784,0,0,0,0,100,0), -- 23:34:08 +(@PATH,9,8754.548,-5692.86,0.8107796,0,0,0,0,100,0), -- 23:34:17 +(@PATH,10,8754.832,-5692.778,1.003729,0,0,0,0,100,0), -- 23:34:22 +(@PATH,11,8771.507,-5697.777,0.8035664,0,0,0,0,100,0), -- 23:34:29 +(@PATH,12,8806.005,-5714.252,-1.612888,0,0,0,0,100,0), -- 23:34:38 +(@PATH,13,8829.296,-5721.84,1.24645,0,0,0,0,100,0), -- 23:34:48 +(@PATH,14,8847.945,-5721.054,0.8082525,0,0,0,0,100,0), -- 23:34:57 +(@PATH,15,8858.877,-5719.242,0.7433279,0,0,0,0,100,0), -- 23:35:07 +(@PATH,16,8872.451,-5724.64,0.7027312,0,0,0,0,100,0); -- 23:35:13 + +-- Pathing for Grimscale Oracle Entry: 15669 'TDB FORMAT' +SET @NPC := 56221; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=8777.075,`position_y`=-5755.628,`position_z`=0.7944576 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,8777.075,-5755.628,0.7944576,0,0,0,0,100,0), -- 23:25:41 +(@PATH,2,8744.947,-5758.729,1.44137,0,0,0,0,100,0), -- 23:26:14 +(@PATH,3,8723.646,-5744.492,0.7795044,0,0,0,0,100,0), -- 23:26:24 +(@PATH,4,8711.309,-5729.942,1.035426,0,0,0,0,100,0), -- 23:26:32 +(@PATH,5,8691.229,-5710.955,0.2195589,0,0,0,0,100,0), -- 23:26:39 +(@PATH,6,8687.803,-5701.443,-0.1464095,0,0,0,0,100,0), -- 23:26:48 +(@PATH,7,8653.561,-5676.286,1.293998,0,0,0,0,100,0), -- 23:27:01 +(@PATH,8,8641.836,-5678.255,1.193712,0,0,0,0,100,0), -- 23:27:12 +(@PATH,9,8641.773,-5678.348,1.107449,0,0,0,0,100,0), -- 23:27:23 +(@PATH,10,8667.416,-5673.973,0.01454574,0,0,0,0,100,0), -- 23:27:32 +(@PATH,11,8675.772,-5684.51,0.2002553,0,0,0,0,100,0), -- 23:27:43 +(@PATH,12,8690.506,-5709.449,0.5053282,0,0,0,0,100,0), -- 23:27:56 +(@PATH,13,8694.455,-5720.396,0.996207,0,0,0,0,100,0), -- 23:28:04 +(@PATH,14,8711.694,-5730.25,0.9948567,0,0,0,0,100,0), -- 23:28:12 +(@PATH,15,8732.313,-5750.292,1.464421,0,0,0,0,100,0), -- 23:28:20 +(@PATH,16,8751.975,-5757.997,0.9221863,0,0,0,0,100,0), -- 23:28:30 +(@PATH,17,8777.087,-5755.516,0.800478,0,0,0,0,100,0); -- 23:28:43 + +-- Pathing for Grimscale Forager Entry: 15670 'TDB FORMAT' +SET @NPC := 56242; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=9071.955,`position_y`=-5877.383,`position_z`=0.6975139 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,9071.955,-5877.383,0.6975139,0,0,0,0,100,0), -- 23:37:45 +(@PATH,2,9059.324,-5868.073,-1.393102,0,0,0,0,100,0), -- 23:38:00 +(@PATH,3,9029.121,-5854.314,0.6379914,0,0,0,0,100,0), -- 23:38:11 +(@PATH,4,9026.947,-5821.172,1.145625,0,0,0,0,100,0), -- 23:38:21 +(@PATH,5,9027.102,-5820.248,1.393944,0,0,0,0,100,0), -- 23:38:35 +(@PATH,6,9032.799,-5775.275,0.952391,0,0,0,0,100,0), -- 23:38:44 +(@PATH,7,9031.125,-5767.591,0.8471048,0,0,0,0,100,0), -- 23:38:56 +(@PATH,8,9008.104,-5754.679,0.8015774,0,0,0,0,100,0), -- 23:39:07 +(@PATH,9,8966.937,-5741.705,1.29663,0,0,0,0,100,0), -- 23:39:17 +(@PATH,10,8962.295,-5740.867,1.235597,0,0,0,0,100,0), -- 23:39:27 +(@PATH,11,8927.979,-5767.035,0.04672858,0,0,0,0,100,0), -- 23:39:37 +(@PATH,12,8938.715,-5761.229,1.038244,0,0,0,0,100,0), -- 23:39:45 +(@PATH,13,8943.727,-5758.281,0.968925,0,0,0,0,100,0), -- 23:39:52 +(@PATH,14,8981.834,-5744.667,0.7889291,0,0,0,0,100,0), -- 23:40:02 +(@PATH,15,8986.465,-5746.015,0.8002989,0,0,0,0,100,0), -- 23:40:12 +(@PATH,16,9008.296,-5754.792,0.820213,0,0,0,0,100,0), -- 23:40:21 +(@PATH,17,9036.458,-5792.002,1.43752,0,0,0,0,100,0), -- 23:40:32 +(@PATH,18,9028.837,-5817.06,1.559729,0,0,0,0,100,0), -- 23:40:45 +(@PATH,19,9023.854,-5848.162,1.221549,0,0,0,0,100,0), -- 23:40:54 +(@PATH,20,9042.734,-5857.301,-2.073786,0,0,0,0,100,0); -- 23:41:08 + +-- Pathing for Grimscale Seer Entry: 15950 'TDB FORMAT' +SET @NPC := 56391; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=9037.592,`position_y`=-5766.527,`position_z`=0.5168767 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,9037.592,-5766.527,0.5168767,0,0,0,0,100,0), -- 23:42:42 +(@PATH,2,9048.254,-5784.458,0.9698197,0,0,0,0,100,0), -- 23:42:51 +(@PATH,3,9059.32,-5798.216,-0.9207587,0,0,0,0,100,0), -- 23:42:59 +(@PATH,4,9076.928,-5813.567,0.3946522,0,0,0,0,100,0), -- 23:43:10 +(@PATH,5,9080.393,-5815.896,0.6621327,0,0,0,0,100,0), -- 23:43:18 +(@PATH,6,9088.405,-5809.686,0.7750955,0,0,0,0,100,0), -- 23:43:21 +(@PATH,7,9106.832,-5804.949,0.821775,0,0,0,0,100,0), -- 23:43:28 +(@PATH,8,9123.148,-5807.707,0.8019806,0,0,0,0,100,0), -- 23:43:36 +(@PATH,9,9135.586,-5821.801,0.7773802,0,0,0,0,100,0), -- 23:43:43 +(@PATH,10,9149.662,-5822.438,0.7227378,0,0,0,0,100,0), -- 23:43:49 +(@PATH,11,9167.805,-5833.559,0.5458255,0,0,0,0,100,0), -- 23:43:58 +(@PATH,12,9167.66,-5833.448,0.4231594,0,0,0,0,100,0), -- 23:44:11 +(@PATH,13,9167.701,-5833.285,0.7127371,0,0,0,0,100,0), -- 23:44:23 +(@PATH,14,9149.432,-5822.394,0.7666007,0,0,0,0,100,0), -- 23:44:32 +(@PATH,15,9135.407,-5821.695,0.8019806,0,0,0,0,100,0), -- 23:44:38 +(@PATH,16,9123.027,-5807.496,0.8282324,0,0,0,0,100,0), -- 23:44:45 +(@PATH,17,9106.761,-5805.003,0.785993,0,0,0,0,100,0), -- 23:44:51 +(@PATH,18,9088.161,-5809.791,0.7095211,0,0,0,0,100,0), -- 23:45:00 +(@PATH,19,9071.598,-5809.765,-0.6348054,0,0,0,0,100,0), -- 23:45:03 +(@PATH,20,9050.107,-5787.132,0.9787122,0,0,0,0,100,0), -- 23:45:10 +(@PATH,21,9049.096,-5785.835,1.078146,0,0,0,0,100,0); -- 23:45:20 + +-- Pathing for Ghostlands Guardian Entry: 16541 'TDB FORMAT' +SET @NPC := 145414; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=7150.675,`position_y`=-7072.731,`position_z`=55.28159 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,7150.675,-7072.731,55.28159,0,0,0,0,100,0), -- 11:51:25 +(@PATH,2,7140.165,-7095.667,56.32489,0,0,0,0,100,0), -- 11:51:41 +(@PATH,3,7134.295,-7111.137,58.849,0,0,0,0,100,0), -- 11:51:51 +(@PATH,4,7149.599,-7137.551,55.19991,0,0,0,0,100,0), -- 11:51:59 +(@PATH,5,7183.908,-7143.587,56.03042,0,0,0,0,100,0), -- 11:52:11 +(@PATH,6,7218.184,-7136.882,58.99335,0,0,0,0,100,0), -- 11:52:25 +(@PATH,7,7235.5,-7129.492,60.65919,0,0,0,0,100,0), -- 11:52:39 +(@PATH,8,7243.874,-7125.855,61.10926,0,30000,0,0,100,0), -- 11:52:51 +(@PATH,9,7243.135,-7095.02,61.9528,0,0,0,0,100,0), -- 11:53:38 +(@PATH,10,7224.584,-7078.627,58.69924,0,0,0,0,100,0), -- 11:54:28 +(@PATH,11,7189.417,-7063.731,58.10524,0,0,0,0,100,0); -- 11:54:29 + +-- Pathing for Ghostlands Guardian Entry: 16541 'TDB FORMAT' +SET @NPC := 81743; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=7483.415,`position_y`=-6898.222,`position_z`=96.65485 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,7483.415,-6898.222,96.65485,0,0,0,0,100,0), -- 22:01:51 +(@PATH,2,7490.502,-6889.069,94.41743,0,0,0,0,100,0), -- 22:01:59 +(@PATH,3,7481.624,-6866.266,88.67288,0,0,0,0,100,0), -- 22:02:05 +(@PATH,4,7480.969,-6837.274,77.65476,0,0,0,0,100,0), -- 22:02:16 +(@PATH,5,7480.024,-6797.451,76.10669,0,0,0,0,100,0), -- 22:02:28 +(@PATH,6,7478.713,-6785.392,77.4765,0,0,0,0,100,0), -- 22:02:43 +(@PATH,7,7479.419,-6793.053,76.67186,0,0,0,0,100,0), -- 22:02:54 +(@PATH,8,7480.9,-6834.077,76.25935,0,0,0,0,100,0), -- 22:03:02 +(@PATH,9,7480.634,-6861.903,86.81428,0,0,0,0,100,0), -- 22:03:17 +(@PATH,10,7490.069,-6885.811,93.34169,0,0,0,0,100,0); -- 22:03:30 + +-- Pathing for Ghostlands Guardian Entry: 16541 'TDB FORMAT' +SET @NPC := 81737; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=7546.458,`position_y`=-6726.992,`position_z`=80.78694 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,7546.458,-6726.992,80.78694,0,0,0,0,100,0), -- 22:05:54 +(@PATH,2,7527.194,-6732.486,80.58603,0,0,0,0,100,0), -- 22:06:08 +(@PATH,3,7604.331,-6767.942,85.9845,0,0,0,0,100,0), -- 22:09:49 +(@PATH,4,7593.505,-6753.936,89.24313,0,0,0,0,100,0), -- 22:09:59 +(@PATH,5,7575.111,-6734.221,84.59973,0,0,0,0,100,0); -- 22:10:07 + +-- Pathing for Ghostlands Guardian Entry: 16541 'TDB FORMAT' +SET @NPC := 81723; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=7640.057,`position_y`=-6821.591,`position_z`=80.17661 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,7640.057,-6821.591,80.17661,0,0,0,0,100,0), -- 22:05:42 +(@PATH,2,7633.815,-6796.717,78.65404,0,0,0,0,100,0), -- 22:05:51 +(@PATH,3,7615.372,-6775.387,80.24687,0,0,0,0,100,0), -- 22:06:00 +(@PATH,4,7632.267,-6793.745,77.46573,0,0,0,0,100,0), -- 22:06:15 +(@PATH,5,7634.777,-6800.083,79.74638,0,0,0,0,100,0), -- 22:06:27 +(@PATH,6,7649.132,-6834.647,83.15082,0,0,0,0,100,0), -- 22:06:37 +(@PATH,7,7656.086,-6858.044,87.99471,0,0,0,0,100,0), -- 22:06:45 +(@PATH,8,7651.524,-6839.359,84.67632,0,0,0,0,100,0), -- 22:06:56 +(@PATH,9,7640.049,-6821.556,80.16749,0,0,0,0,100,0); -- 22:07:05 + +-- Pathing for Ghostlands Guardian Entry: 16541 'TDB FORMAT' +SET @NPC := 81719; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=7563.64,`position_y`=-6881.709,`position_z`=112.1673 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,7563.64,-6881.709,112.1673,0,0,0,0,100,0), -- 18:53:33 +(@PATH,2,7551.659,-6901.236,112.1663,0,0,0,0,100,0), -- 18:53:38 +(@PATH,3,7555.867,-6910.663,111.9691,0,0,0,0,100,0), -- 18:56:12 +(@PATH,4,7565.996,-6914.735,108.4578,0,0,0,0,100,0), -- 18:53:51 +(@PATH,5,7579.56,-6906.405,103.1527,0,0,0,0,100,0), -- 18:54:00 +(@PATH,6,7591.544,-6890.522,95.51781,0,0,0,0,100,0), -- 18:54:08 +(@PATH,7,7595.471,-6871.276,94.72267,0,0,0,0,100,0), -- 18:54:18 +(@PATH,8,7586.251,-6861.987,93.77134,0,0,0,0,100,0), -- 18:54:24 +(@PATH,9,7577.42,-6854.581,93.04897,0,0,0,0,100,0), -- 18:55:26 +(@PATH,10,7578.87,-6826.335,87.31084,0,0,0,0,100,0), -- 18:54:34 +(@PATH,11,7578.864,-6821.618,86.92613,0,0,0,0,100,0), -- 18:54:47 +(@PATH,12,7561.332,-6803.103,87.30068,0,0,0,0,100,0), -- 18:55:15 +(@PATH,13,7560.291,-6799.682,87.58893,0,0,0,0,100,0), -- 18:55:08 +(@PATH,14,7556.946,-6782.622,89.82014,0,0,0,0,100,0), -- 18:54:58 +(@PATH,15,7560.291,-6799.682,87.58893,0,0,0,0,100,0), -- 18:55:08 +(@PATH,16,7561.332,-6803.103,87.30068,0,0,0,0,100,0), -- 18:55:15 +(@PATH,17,7578.864,-6821.618,86.92613,0,0,0,0,100,0), -- 18:54:47 +(@PATH,18,7578.87,-6826.335,87.31084,0,0,0,0,100,0), -- 18:54:34 +(@PATH,19,7577.42,-6854.581,93.04897,0,0,0,0,100,0), -- 18:55:26 +(@PATH,20,7588.399,-6863.539,93.97005,0,0,0,0,100,0), -- 18:55:39 +(@PATH,21,7593.956,-6877.988,95.42189,0,0,0,0,100,0), -- 18:55:48 +(@PATH,22,7583.048,-6903.001,101.4519,0,0,0,0,100,0), -- 18:55:55 +(@PATH,23,7570.524,-6913.488,106.4994,0,0,0,0,100,0), -- 18:56:05 +(@PATH,24,7555.867,-6910.663,111.9691,0,0,0,0,100,0), -- 18:56:12 +(@PATH,25,7551.659,-6901.236,112.1663,0,0,0,0,100,0), -- 18:53:38 +(@PATH,26,7563.374,-6882.594,112.1059,0,0,0,0,100,0); -- 18:56:20 + +-- Pathing for Ghostlands Guardian Entry: 16541 'TDB FORMAT' +SET @NPC := 81745; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=7493.75,`position_y`=-6888.333,`position_z`=94.14599 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,7493.75,-6888.333,94.14599,0,0,0,0,100,0), -- 21:57:19 +(@PATH,2,7481.219,-6899.196,97.32906,0,0,0,0,100,0), -- 21:57:29 +(@PATH,3,7455.676,-6912.633,103.082,0,0,0,0,100,0), -- 21:57:36 +(@PATH,4,7435.434,-6934.373,107.2755,0,0,0,0,100,0), -- 21:57:49 +(@PATH,5,7429.151,-6957.596,112.5967,0,0,0,0,100,0), -- 21:58:00 +(@PATH,6,7409.229,-6988.246,112.3306,0,0,0,0,100,0), -- 21:58:16 +(@PATH,7,7398.064,-7006.403,105.4191,0,0,0,0,100,0), -- 21:58:24 +(@PATH,8,7379.978,-7023.313,98.34062,0,0,0,0,100,0), -- 21:58:33 +(@PATH,9,7368.91,-7048.285,91.6894,0,0,0,0,100,0), -- 21:58:44 +(@PATH,10,7362.03,-7076.459,81.8666,0,0,0,0,100,0), -- 21:58:55 +(@PATH,11,7335.145,-7098.242,66.09917,0,0,0,0,100,0), -- 21:59:07 +(@PATH,12,7304.179,-7104.348,54.56339,0,0,0,0,100,0), -- 21:59:23 +(@PATH,13,7332.545,-7099.682,64.96516,0,0,0,0,100,0), -- 21:59:41 +(@PATH,14,7360.992,-7078.073,81.13574,0,0,0,0,100,0), -- 21:59:57 +(@PATH,15,7367.925,-7051.186,90.94432,0,0,0,0,100,0), -- 22:00:12 +(@PATH,16,7376.316,-7028.957,96.4644,0,0,0,0,100,0), -- 22:00:25 +(@PATH,17,7397.015,-7007.736,104.9266,0,0,0,0,100,0), -- 22:00:35 +(@PATH,18,7408.008,-6990.256,111.4358,0,0,0,0,100,0), -- 22:00:46 +(@PATH,19,7411.379,-6986.646,112.7126,0,0,0,0,100,0), -- 22:00:56 +(@PATH,20,7429.151,-6957.596,112.5967,0,0,0,0,100,0), -- 21:58:00 +(@PATH,21,7433.051,-6937.843,108.0633,0,0,0,0,100,0), -- 22:01:05 +(@PATH,22,7445.005,-6922.467,103.7956,0,0,0,0,100,0), -- 22:01:28 +(@PATH,23,7450.903,-6915.155,103.3749,0,0,0,0,100,0), -- 22:01:28 +(@PATH,24,7450.903,-6915.155,103.3749,0,0,0,0,100,0), -- 22:01:28 +(@PATH,25,7477.773,-6901.932,98.37746,0,0,0,0,100,0), -- 22:01:33 +(@PATH,26,7493.729,-6888.343,94.15305,0,0,0,0,100,0); -- 22:01:45 + +-- Pathing for Blacksmith Frances Entry: 17655 'TDB FORMAT' +SET @NPC := 81724; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=7604.855,`position_y`=-6905.621,`position_z`=93.76188 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,7604.855,-6905.621,93.76188,0.8203048,60000,0,0,100,0), -- 22:07:38 +(@PATH,2,7600.523,-6904.995,93.88599,0,0,0,0,100,0), -- 22:08:19 +(@PATH,3,7600.523,-6904.995,93.88599,1.780236,0,0,0,100,0), -- 22:08:21 +(@PATH,4,7600.064,-6907.846,93.76472,0,0,0,0,100,0), -- 22:09:30 +(@PATH,5,7600.523,-6904.995,93.88599,0,30000,0,0,100,0), -- 22:10:03 +(@PATH,6,7600.523,-6904.995,93.88599,1.780236,0,0,0,100,0), -- 22:10:04 +(@PATH,7,7598.409,-6904.81,94.34996,0,60000,0,0,100,0), -- 22:10:58 +(@PATH,8,7596.794,-6905.625,94.31394,3.996804,0,0,0,100,0), -- 22:10:59 +(@PATH,9,7600.523,-6904.995,93.88599,0,0,0,0,100,0), -- 22:11:26 +(@PATH,10,7600.523,-6904.995,93.88599,1.780236,0,0,0,100,0), -- 22:11:27 +(@PATH,11,7598.409,-6904.81,94.34996,0,60000,0,0,100,0), -- 22:12:20 +(@PATH,12,7596.794,-6905.625,94.31394,3.996804,0,0,0,100,0), -- 22:12:22 +(@PATH,13,7600.523,-6904.995,93.88599,0,0,0,0,100,0), -- 22:12:42 +(@PATH,14,7600.523,-6904.995,93.88599,1.780236,0,0,0,100,0), -- 22:12:44 +(@PATH,15,7604.855,-6905.621,93.76188,0,120000,0,0,100,0), -- 22:14:00 +(@PATH,16,7604.855,-6905.621,93.76188,0.8203048,0,0,0,100,0); -- 22:14:02 + +-- Pathing for Rathis Tomber Entry: 16224 'TDB FORMAT' +SET @NPC := 81720; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=7638.232,`position_y`=-6842.241,`position_z`=84.2546 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,7638.232,-6842.241,84.2546,2.076942,0,0,0,100,0), -- 22:09:02 +(@PATH,2,7636.98,-6839.962,83.24476,0,0,0,0,100,0), -- 22:09:36 +(@PATH,3,7637.41,-6837.574,82.88759,0,0,0,0,100,0), -- 22:09:38 +(@PATH,4,7639.8,-6835.542,82.59454,0,0,0,0,100,0), -- 22:09:39 +(@PATH,5,7643.04,-6835.119,82.58206,0,0,0,0,100,0), -- 22:09:40 +(@PATH,6,7644.657,-6837.574,83.20168,0,0,0,0,100,0), -- 22:09:41 +(@PATH,7,7644.05,-6838.9,83.9032,0,60000,0,0,100,0), +(@PATH,8,7645.192,-6836.052,83.1027,0,0,0,0,100,0), -- 22:09:50 +(@PATH,9,7642.421,-6834.729,82.59531,0,0,0,0,100,0), -- 22:09:51 +(@PATH,10,7639.884,-6835.1,82.53012,0,0,0,0,100,0), -- 22:09:52 +(@PATH,11,7637.52,-6837.243,82.75238,0,0,0,0,100,0), -- 22:09:53 +(@PATH,12,7636.066,-6839.554,82.94509,0,0,0,0,100,0), -- 22:09:55 +(@PATH,13,7637.412,-6842.98,83.70974,0,10000,0,0,100,0), -- 22:09:56 +(@PATH,14,7638.232,-6842.241,84.2546,0,0,0,0,100,0), -- 22:10:06 +(@PATH,15,7638.232,-6842.241,84.2546,2.076942,60000,0,0,100,0); -- 22:10:06 + +-- Pathing for Sentinel Infiltrator Entry: 16333 'TDB FORMAT' +SET @NPC := 85939; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=6826.52,`position_y`=-7216.635,`position_z`=26.2077 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,6826.52,-7216.635,26.2077,0,0,0,0,100,0), -- 18:25:44 +(@PATH,2,6840.17,-7215.392,27.32393,0,0,0,0,100,0), -- 18:25:48 +(@PATH,3,6842.315,-7214.781,27.5872,0,0,0,0,100,0), -- 18:25:52 +(@PATH,4,6847.95,-7208.919,27.60912,0,0,0,0,100,0), -- 18:25:54 +(@PATH,5,6846.517,-7200.238,27.39073,0,0,0,0,100,0), -- 18:25:58 +(@PATH,6,6836.5,-7187.716,26.55817,0,0,0,0,100,0), -- 18:26:01 +(@PATH,7,6829.814,-7187.942,25.16908,0,0,0,0,100,0), -- 18:26:05 +(@PATH,8,6828.214,-7188.198,24.70531,0,0,0,0,100,0), -- 18:26:08 +(@PATH,9,6820.545,-7191.426,24.19164,0,0,0,0,100,0), -- 18:26:11 +(@PATH,10,6816.887,-7196.539,24.25371,0,0,0,0,100,0), -- 18:26:15 +(@PATH,11,6816.825,-7206.355,24.66104,0,0,0,0,100,0), -- 18:26:18 +(@PATH,12,6824.003,-7215.546,25.92787,0,0,0,0,100,0); -- 18:26:22 + +-- Pathing for Sentinel Infiltrator Entry: 16333 'TDB FORMAT' +-- Needs SAI scripting +SET @NPC := 85810; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=6834.944,`position_y`=-7216.469,`position_z`=26.75792 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,6834.944,-7216.469,26.75792,0,0,0,0,100,0), -- 18:21:32 +(@PATH,2,6826.208,-7222.83,27.19634,0,0,0,0,100,0), -- 18:21:40 +(@PATH,3,6817.325,-7206.505,24.92965,0,0,0,0,100,0), -- 18:21:52 +(@PATH,4,6819.723,-7180.195,25.83248,0,0,0,0,100,0), -- 18:22:00 +(@PATH,5,6811.1,-7153.327,37.85592,0,0,0,0,100,0), -- 18:22:11 +(@PATH,6,6794.896,-7138.714,44.19709,0,0,0,0,100,0), -- 18:22:24 +(@PATH,7,6778.596,-7138.577,47.74215,0,0,0,0,100,0), -- 18:22:34 +(@PATH,8,6770.257,-7144.743,49.66928,0,0,0,0,100,0), -- 18:22:40 +(@PATH,9,6786.903,-7138.087,45.32982,0,0,0,0,100,0), -- 18:22:53 +(@PATH,10,6817.342,-7166.106,30.71012,0,0,0,0,100,0), -- 18:23:03 +(@PATH,11,6823.649,-7165.904,28.29505,0,0,0,0,100,0), -- 18:23:20 +(@PATH,12,6835.131,-7148.97,30.26661,0,0,0,0,100,0), -- 18:23:27 +(@PATH,13,6835.175,-7162.583,27.79875,0,0,0,0,100,0), -- 18:23:38 +(@PATH,14,6835.874,-7170.188,26.83617,0,0,0,0,100,0), -- 18:23:45 +(@PATH,15,6827.219,-7186.351,24.99562,0,0,0,0,100,0), -- 18:23:49 +(@PATH,16,6818.312,-7181.476,25.84511,0,0,0,0,100,0), -- 18:23:56 +(@PATH,17,6813.708,-7178.023,26.07334,0,0,0,0,100,0), -- 18:24:03 +(@PATH,18,6800.086,-7180.936,26.13367,0,0,0,0,100,0), -- 18:24:08 +(@PATH,19,6788.234,-7196.194,26.14623,0,0,0,0,100,0), -- 18:24:16 +(@PATH,20,6784.672,-7191.459,26.15236,0,0,0,0,100,0), -- 18:25:03 +(@PATH,21,6802.208,-7180.021,26.09461,0,0,0,0,100,0), -- 18:25:13 +(@PATH,22,6821.094,-7186.088,24.97617,0,0,0,0,100,0), -- 18:25:20 +(@PATH,23,6836.174,-7190.566,26.19097,0,0,0,0,100,0), -- 18:25:24 +(@PATH,24,6844.302,-7187.855,27.69562,0,0,0,0,100,0), -- 18:25:32 +(@PATH,25,6846.742,-7212.095,27.73918,0,0,0,0,100,0); -- 18:25:45 + +-- Pathing for Sentinel Infiltrator Entry: 16333 'TDB FORMAT' +-- Needs SAI scripting +SET @NPC := 85876; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=6814.882,`position_y`=-7163.52,`position_z`=33.06502 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,6814.882,-7163.52,33.06502,0,0,0,0,100,0), -- 18:26:55 +(@PATH,2,6796.829,-7138.427,44.13749,0,0,0,0,100,0), -- 18:27:03 +(@PATH,3,6778.327,-7138.773,48.00482,0,0,0,0,100,0), -- 18:27:16 +(@PATH,4,6776.107,-7139.004,48.73849,0,0,0,0,100,0), -- 18:27:24 +(@PATH,5,6783.224,-7137.825,46.49815,0,0,0,0,100,0), -- 18:27:51 +(@PATH,6,6794.398,-7137.108,44.60288,0,0,0,0,100,0), -- 18:27:56 +(@PATH,7,6800.035,-7146.845,40.49599,0,0,0,0,100,0), -- 18:28:01 +(@PATH,8,6795.779,-7165.81,32.8607,0,0,0,0,100,0), -- 18:28:05 +(@PATH,9,6794.719,-7181.562,26.63479,0,0,0,0,100,0), -- 18:28:14 +(@PATH,10,6794.198,-7190.434,25.95545,0,0,0,0,100,0), -- 18:28:24 +(@PATH,11,6789.857,-7191.004,25.8968,0,0,0,0,100,0), -- 18:28:38 +(@PATH,12,6789.924,-7190.855,26.1468,0,0,0,0,100,0), -- 18:28:41 +(@PATH,13,6801.363,-7179.81,25.90792,0,0,0,0,100,0), -- 18:28:54 +(@PATH,14,6801.586,-7179.51,26.09436,0,0,0,0,100,0), -- 18:29:01 +(@PATH,15,6817.118,-7187.298,24.99203,0,0,0,0,100,0), -- 18:29:06 +(@PATH,16,6818.806,-7191.954,24.44993,0,0,0,0,100,0), -- 18:29:13 +(@PATH,17,6819.498,-7215.1,25.45433,0,0,0,0,100,0), -- 18:29:18 +(@PATH,18,6817.387,-7217.657,26.22639,0,0,0,0,100,0), -- 18:29:24 +(@PATH,19,6815.59,-7207.964,25.15621,0,0,0,0,100,0), -- 18:29:35 +(@PATH,20,6816.641,-7195.688,24.46806,0,0,0,0,100,0), -- 18:29:44 +(@PATH,21,6830.292,-7179.979,26.3147,0,0,0,0,100,0), -- 18:29:50 +(@PATH,22,6823.895,-7177.721,26.77645,0,0,0,0,100,0); -- 18:30:03 + +-- Pathing for Shadowpine Catlord Entry: 16345 'TDB FORMAT' +SET @NPC := 85833; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=6825.845,`position_y`=-7407.999,`position_z`=47.05538 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,6825.845,-7407.999,47.05538,0,0,0,0,100,0), -- 18:03:11 +(@PATH,2,6819.822,-7407.742,47.8176,0,0,0,0,100,0), -- 18:03:23 +(@PATH,3,6797.965,-7395.941,47.85873,0,0,0,0,100,0), -- 18:03:32 +(@PATH,4,6790.372,-7391.337,48.14279,0,0,0,0,100,0), -- 18:05:27 +(@PATH,5,6785.934,-7382.063,48.67854,0,0,0,0,100,0), -- 18:05:12 +(@PATH,6,6780.216,-7369.419,49.53757,0,0,0,0,100,0), -- 18:03:44 +(@PATH,7,6762.875,-7356.745,49.3274,0,0,0,0,100,0), -- 18:03:59 +(@PATH,8,6757.482,-7359.899,49.68204,0,0,0,0,100,0), -- 18:04:51 +(@PATH,9,6752.945,-7365.431,51.41992,0,0,0,0,100,0), -- 18:04:05 +(@PATH,10,6736.967,-7385.644,51.58582,0,0,0,0,100,0), -- 18:04:20 +(@PATH,11,6707.192,-7407.871,51.19869,0,0,0,0,100,0), -- 18:04:48 +(@PATH,12,6706.392,-7408.471,51.19869,0,0,0,0,100,0), -- 18:04:48 +(@PATH,13,6736.911,-7385.608,51.53582,0,0,0,0,100,0), -- 18:04:48 +(@PATH,14,6752.945,-7365.431,51.41992,0,0,0,0,100,0), -- 18:04:05 +(@PATH,15,6757.482,-7359.899,49.68204,0,0,0,0,100,0), -- 18:04:51 +(@PATH,16,6765.563,-7357.226,49.71237,0,0,0,0,100,0), -- 18:05:06 +(@PATH,17,6780.216,-7369.419,49.53757,0,0,0,0,100,0), -- 18:03:44 +(@PATH,18,6785.934,-7382.063,48.67854,0,0,0,0,100,0), -- 18:05:12 +(@PATH,19,6790.372,-7391.337,48.14279,0,0,0,0,100,0), -- 18:05:27 +(@PATH,20,6797.965,-7395.941,47.85873,0,0,0,0,100,0), -- 18:03:32 +(@PATH,21,6819.822,-7407.742,47.8176,0,0,0,0,100,0); -- 18:03:23 + +-- Pathing for Shadowpine Catlord Entry: 16345 'TDB FORMAT' +SET @NPC := 85899; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=6642.614,`position_y`=-7403.334,`position_z`=65.37686 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,6642.614,-7403.334,65.37686,0,0,0,0,100,0), -- 18:12:02 +(@PATH,2,6655.589,-7402.668,65.25717,0,0,0,0,100,0), -- 18:12:07 +(@PATH,3,6659.145,-7404.814,64.66093,0,0,0,0,100,0), -- 18:12:13 +(@PATH,4,6666.81,-7405.762,59.45066,0,0,0,0,100,0), -- 18:12:16 +(@PATH,5,6670.078,-7400.617,57.92281,0,0,0,0,100,0), -- 18:12:19 +(@PATH,6,6683.644,-7387.567,57.7993,0,0,0,0,100,0), -- 18:12:25 +(@PATH,7,6694.211,-7385.182,53.51888,0,0,0,0,100,0), -- 18:12:30 +(@PATH,8,6701.323,-7375.21,53.19016,0,0,0,0,100,0), -- 18:12:39 +(@PATH,9,6706.042,-7306.476,52.34984,0,0,0,0,100,0), -- 18:12:56 +(@PATH,10,6698.629,-7306.6,52.3459,0,0,0,0,100,0), -- 18:13:09 +(@PATH,11,6658.128,-7346.422,53.5539,0,0,0,0,100,0), -- 18:13:25 +(@PATH,12,6663.863,-7357.194,55.34796,0,0,0,0,100,0), -- 18:13:40 +(@PATH,13,6687.574,-7370.823,53.74558,0,0,0,0,100,0), -- 18:13:48 +(@PATH,14,6692.782,-7383.596,54.75917,0,0,0,0,100,0), -- 18:14:00 +(@PATH,15,6679.604,-7389.391,57.81517,0,0,0,0,100,0), -- 18:14:09 +(@PATH,16,6668.09,-7405,57.93337,0,0,0,0,100,0), -- 18:14:14 +(@PATH,17,6663.221,-7406.32,61.86858,0,0,0,0,100,0), -- 18:14:20 +(@PATH,18,6657.667,-7403.231,64.99197,0,0,0,0,100,0), -- 18:14:23 +(@PATH,19,6646.945,-7407.651,65.2119,0,0,0,0,100,0), -- 18:14:27 +(@PATH,20,6642.138,-7401.195,67.02313,0,0,0,0,100,0), -- 18:14:32 +(@PATH,21,6643.672,-7393.591,70.57539,0,0,0,0,100,0), -- 18:14:37 +(@PATH,22,6648.191,-7390.153,70.75128,0,0,0,0,100,0), -- 18:14:41 +(@PATH,23,6655.95,-7390.098,70.72308,0,0,0,0,100,0), -- 18:14:45 +(@PATH,24,6672.11,-7389.826,70.80399,0,0,0,0,100,0), -- 18:14:49 +(@PATH,25,6674.516,-7400.391,70.78954,0,0,0,0,100,0), -- 18:14:54 +(@PATH,26,6670.333,-7405.347,70.74722,0,0,0,0,100,0), -- 18:14:58 +(@PATH,27,6655.763,-7405.991,70.77985,0,0,0,0,100,0), -- 18:15:03 +(@PATH,28,6652.884,-7398.17,70.53949,0,0,0,0,100,0), -- 18:15:08 +(@PATH,29,6648.519,-7390.229,70.74633,0,0,0,0,100,0), -- 18:15:14 +(@PATH,30,6643.527,-7393.528,70.72253,0,0,0,0,100,0), -- 18:15:17 +(@PATH,31,6642.74,-7403.402,65.47425,0,0,0,0,100,0); -- 18:15:22 + +-- Pathing for Shadowpine Hexxer Entry: 16346 'TDB FORMAT' +SET @NPC := 85922; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=6544.311,`position_y`=-7415.042,`position_z`=66.8414 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,6544.311,-7415.042,66.8414,0,0,0,0,100,0), -- 18:12:06 +(@PATH,2,6557.531,-7398.131,62.547,0,0,0,0,100,0), -- 18:12:18 +(@PATH,3,6584.465,-7368.215,56.64576,0,0,0,0,100,0), -- 18:12:52 +(@PATH,4,6589.184,-7361.762,55.35123,0,0,0,0,100,0), -- 18:12:52 +(@PATH,5,6593.902,-7355.309,54.72623,0,0,0,0,100,0), -- 18:12:52 +(@PATH,6,6598.534,-7348.974,54.28678,0,0,0,0,100,0), -- 18:12:52 +(@PATH,7,6603.207,-7346.335,54.47303,0,0,0,0,100,0), -- 18:15:13 +(@PATH,8,6609.078,-7343.148,54.03077,0,0,0,0,100,0), -- 18:12:53 +(@PATH,9,6619.535,-7340.988,53.94233,0,0,0,0,100,0), -- 18:15:00 +(@PATH,10,6636.512,-7345.48,53.38771,0,0,0,0,100,0), -- 18:13:02 +(@PATH,11,6650.978,-7350.788,53.67146,0,0,0,0,100,0), -- 18:14:42 +(@PATH,12,6679.457,-7366.645,54.62379,0,0,0,0,100,0), -- 18:13:15 +(@PATH,13,6688.482,-7368.755,53.68621,0,0,0,0,100,0), -- 18:13:31 +(@PATH,14,6707.076,-7373.765,53.0295,0,0,0,0,100,0), -- 18:14:20 +(@PATH,15,6724.337,-7391.231,52.32455,0,0,0,0,100,0), -- 18:13:40 +(@PATH,16,6742.169,-7407.499,51.53728,0,0,0,0,100,0), -- 18:13:54 +(@PATH,17,6740.595,-7406.18,51.4976,0,0,0,0,100,0), -- 18:14:08 +(@PATH,18,6724.337,-7391.231,52.32455,0,0,0,0,100,0), -- 18:13:40 +(@PATH,19,6707.076,-7373.765,53.0295,0,0,0,0,100,0), -- 18:14:20 +(@PATH,20,6686.671,-7368.761,53.71722,0,0,0,0,100,0), -- 18:14:34 +(@PATH,21,6679.457,-7366.645,54.62379,0,0,0,0,100,0), -- 18:13:15 +(@PATH,22,6650.978,-7350.788,53.67146,0,0,0,0,100,0), -- 18:14:42 +(@PATH,23,6636.512,-7345.48,53.38771,0,0,0,0,100,0), -- 18:13:02 +(@PATH,24,6619.535,-7340.988,53.94233,0,0,0,0,100,0), -- 18:15:00 +(@PATH,25,6609.078,-7343.148,54.03077,0,0,0,0,100,0), -- 18:12:53 +(@PATH,26,6603.207,-7346.335,54.47303,0,0,0,0,100,0), -- 18:15:13 +(@PATH,27,6598.534,-7348.974,54.28678,0,0,0,0,100,0), -- 18:12:52 +(@PATH,28,6593.902,-7355.309,54.72623,0,0,0,0,100,0), -- 18:12:52 +(@PATH,29,6586.425,-7365.703,56.44064,0,0,0,0,100,0), -- 18:15:20 +(@PATH,30,6560.438,-7394.56,61.59495,0,0,0,0,100,0), -- 18:15:30 +(@PATH,31,6544.499,-7415.031,66.93755,0,0,0,0,100,0); -- 18:15:45 diff --git a/src/common/Collision/DynamicTree.cpp b/src/common/Collision/DynamicTree.cpp index 5d2e18b1a2e..111606644de 100644 --- a/src/common/Collision/DynamicTree.cpp +++ b/src/common/Collision/DynamicTree.cpp @@ -248,7 +248,7 @@ bool DynamicMapTree::isInLineOfSight(float x1, float y1, float z1, float x2, flo float DynamicMapTree::getHeight(float x, float y, float z, float maxSearchDist, uint32 phasemask) const { - G3D::Vector3 v(x, y, z); + G3D::Vector3 v(x, y, z + 0.5f); G3D::Ray r(v, G3D::Vector3(0, 0, -1)); DynamicTreeIntersectionCallback callback(phasemask); impl->intersectZAllignedRay(r, callback, maxSearchDist); diff --git a/src/common/Collision/Maps/MapTree.cpp b/src/common/Collision/Maps/MapTree.cpp index 4d0996e1961..5907971efb9 100644 --- a/src/common/Collision/Maps/MapTree.cpp +++ b/src/common/Collision/Maps/MapTree.cpp @@ -22,6 +22,7 @@ #include "VMapDefinitions.h" #include "Log.h" #include "Errors.h" +#include "Metric.h" #include <string> #include <sstream> @@ -415,6 +416,8 @@ namespace VMAP } else iLoadedTiles[packTileID(tileX, tileY)] = false; + TC_METRIC_EVENT("map_events", "LoadMapTile", + "Map: " + std::to_string(iMapID) + " TileX: " + std::to_string(tileX) + " TileY: " + std::to_string(tileY)); return result; } @@ -473,6 +476,8 @@ namespace VMAP } } iLoadedTiles.erase(tile); + TC_METRIC_EVENT("map_events", "UnloadMapTile", + "Map: " + std::to_string(iMapID) + " TileX: " + std::to_string(tileX) + " TileY: " + std::to_string(tileY)); } void StaticMapTree::getModelInstances(ModelInstance* &models, uint32 &count) diff --git a/src/common/Metric/Metric.cpp b/src/common/Metric/Metric.cpp new file mode 100644 index 00000000000..9484cebcc72 --- /dev/null +++ b/src/common/Metric/Metric.cpp @@ -0,0 +1,235 @@ +/* +* Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/> +* +* This program is free software; you can redistribute it and/or modify it +* under the terms of the GNU General Public License as published by the +* Free Software Foundation; either version 2 of the License, or (at your +* option) any later version. +* +* This program is distributed in the hope that it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +* more details. +* +* You should have received a copy of the GNU General Public License along +* with this program. If not, see <http://www.gnu.org/licenses/>. +*/ + +#include "Metric.h" +#include "Log.h" +#include "Config.h" +#include "Util.h" + +void Metric::Initialize(std::string const& realmName, boost::asio::io_service& ioService, std::function<void()> overallStatusLogger) +{ + _realmName = realmName; + _batchTimer = Trinity::make_unique<boost::asio::deadline_timer>(ioService); + _overallStatusTimer = Trinity::make_unique<boost::asio::deadline_timer>(ioService); + _overallStatusLogger = overallStatusLogger; + LoadFromConfigs(); +} + +bool Metric::Connect() +{ + _dataStream.connect(_hostname, _port); + auto error = _dataStream.error(); + if (error) + { + TC_LOG_ERROR("metric", "Error connecting to '%s:%s', disabling Metric. Error message : %s", + _hostname.c_str(), _port.c_str(), error.message().c_str()); + _enabled = false; + return false; + } + _dataStream.clear(); + return true; +} + +void Metric::LoadFromConfigs() +{ + bool previousValue = _enabled; + _enabled = sConfigMgr->GetBoolDefault("Metric.Enable", false); + _updateInterval = sConfigMgr->GetIntDefault("Metric.Interval", 10); + if (_updateInterval < 1) + { + TC_LOG_ERROR("metric", "'Metric.Interval' config set to %d, overriding to 1.", _updateInterval); + _updateInterval = 1; + } + + _overallStatusTimerInterval = sConfigMgr->GetIntDefault("Metric.OverallStatusInterval", 1); + if (_overallStatusTimerInterval < 1) + { + TC_LOG_ERROR("metric", "'Metric.OverallStatusInterval' config set to %d, overriding to 1.", _overallStatusTimerInterval); + _overallStatusTimerInterval = 1; + } + + // Schedule a send at this point only if the config changed from Disabled to Enabled. + // Cancel any scheduled operation if the config changed from Enabled to Disabled. + if (_enabled && !previousValue) + { + std::string connectionInfo = sConfigMgr->GetStringDefault("Metric.ConnectionInfo", ""); + if (connectionInfo.empty()) + { + TC_LOG_ERROR("metric", "'Metric.ConnectionInfo' not specified in configuration file."); + return; + } + + Tokenizer tokens(connectionInfo, ';'); + if (tokens.size() != 3) + { + TC_LOG_ERROR("metric", "'Metric.ConnectionInfo' specified with wrong format in configuration file."); + return; + } + + _hostname.assign(tokens[0]); + _port.assign(tokens[1]); + _databaseName.assign(tokens[2]); + Connect(); + + ScheduleSend(); + ScheduleOverallStatusLog(); + } +} + +void Metric::Update() +{ + if (_overallStatusTimerTriggered) + { + _overallStatusTimerTriggered = false; + _overallStatusLogger(); + } +} + +void Metric::LogEvent(std::string const& category, std::string const& title, std::string const& description) +{ + using namespace std::chrono; + + MetricData* data = new MetricData; + data->Category = category; + data->Timestamp = system_clock::now(); + data->Type = METRIC_DATA_EVENT; + data->Title = title; + data->Text = description; + + _queuedData.Enqueue(data); +} + +void Metric::SendBatch() +{ + using namespace std::chrono; + + std::stringstream batchedData; + MetricData* data; + bool firstLoop = true; + while (_queuedData.Dequeue(data)) + { + if (!firstLoop) + batchedData << "\n"; + + batchedData << data->Category; + if (!_realmName.empty()) + batchedData << ",realm=" << _realmName; + + batchedData << " "; + + switch (data->Type) + { + case METRIC_DATA_VALUE: + batchedData << "value=" << data->Value; + break; + case METRIC_DATA_EVENT: + batchedData << "title=\"" << data->Title << "\",text=\"" << data->Text << "\""; + break; + } + + batchedData << " "; + + batchedData << std::to_string(duration_cast<nanoseconds>(data->Timestamp.time_since_epoch()).count()); + + firstLoop = false; + delete data; + } + + // Check if there's any data to send + if (batchedData.tellp() == std::streampos(0)) + { + ScheduleSend(); + return; + } + + if (!_dataStream.good() && !Connect()) + return; + + _dataStream << "POST " << "/write?db=" << _databaseName << " HTTP/1.1\r\n"; + _dataStream << "Host: " << _hostname << ":" << _port << "\r\n"; + _dataStream << "Accept: */*\r\n"; + _dataStream << "Content-Type: application/octet-stream\r\n"; + _dataStream << "Content-Transfer-Encoding: binary\r\n"; + + _dataStream << "Content-Length: " << std::to_string(batchedData.tellp()) << "\r\n\r\n"; + _dataStream << batchedData.rdbuf(); + + std::string http_version; + _dataStream >> http_version; + unsigned int status_code = 0; + _dataStream >> status_code; + if (status_code != 204) + { + TC_LOG_ERROR("metric", "Error sending data, returned HTTP code: %u", status_code); + } + + // Read and ignore the status description + std::string status_description; + std::getline(_dataStream, status_description); + // Read headers + std::string header; + while (std::getline(_dataStream, header) && header != "\r") + { + if (header == "Connection: close\r") + _dataStream.close(); + } + + ScheduleSend(); +} + +void Metric::ScheduleSend() +{ + if (_enabled) + { + _batchTimer->expires_from_now(boost::posix_time::seconds(_updateInterval)); + _batchTimer->async_wait(std::bind(&Metric::SendBatch, this)); + } + else + { + _dataStream.close(); + MetricData* data; + // Clear the queue + while (_queuedData.Dequeue(data)) + ; + } +} + +void Metric::ForceSend() +{ + // Send what's queued only if io_service is stopped (so only on shutdown) + if (_enabled && _batchTimer->get_io_service().stopped()) + SendBatch(); +} + +void Metric::ScheduleOverallStatusLog() +{ + if (_enabled) + { + _overallStatusTimer->expires_from_now(boost::posix_time::seconds(_overallStatusTimerInterval)); + _overallStatusTimer->async_wait([this](const boost::system::error_code&) + { + _overallStatusTimerTriggered = true; + ScheduleOverallStatusLog(); + }); + } +} + +Metric* Metric::instance() +{ + static Metric instance; + return &instance; +} diff --git a/src/common/Metric/Metric.h b/src/common/Metric/Metric.h new file mode 100644 index 00000000000..1855e1d0098 --- /dev/null +++ b/src/common/Metric/Metric.h @@ -0,0 +1,141 @@ +/* +* Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/> +* +* This program is free software; you can redistribute it and/or modify it +* under the terms of the GNU General Public License as published by the +* Free Software Foundation; either version 2 of the License, or (at your +* option) any later version. +* +* This program is distributed in the hope that it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +* more details. +* +* You should have received a copy of the GNU General Public License along +* with this program. If not, see <http://www.gnu.org/licenses/>. +*/ + +#ifndef METRIC_H__ +#define METRIC_H__ + +#include "Common.h" +#include "Threading/MPSCQueue.h" +#include <boost/asio/ip/tcp.hpp> +#include <boost/algorithm/string.hpp> +#include <type_traits> + +enum MetricDataType +{ + METRIC_DATA_VALUE, + METRIC_DATA_EVENT +}; + +struct MetricData +{ + std::string Category; + std::chrono::time_point<std::chrono::system_clock> Timestamp; + MetricDataType Type; + + // LogValue-specific fields + std::string Value; + + // LogEvent-specific fields + std::string Title; + std::string Text; +}; + +class TC_COMMON_API Metric +{ +private: + boost::asio::ip::tcp::iostream _dataStream; + MPSCQueue<MetricData> _queuedData; + std::unique_ptr<boost::asio::deadline_timer> _batchTimer; + std::unique_ptr<boost::asio::deadline_timer> _overallStatusTimer; + int32 _updateInterval = 0; + int32 _overallStatusTimerInterval = 0; + bool _enabled = false; + bool _overallStatusTimerTriggered = false; + std::string _hostname; + std::string _port; + std::string _databaseName; + std::function<void()> _overallStatusLogger; + std::string _realmName; + + bool Connect(); + void SendBatch(); + void ScheduleSend(); + void ScheduleOverallStatusLog(); + + template<class T, typename std::enable_if<std::is_integral<T>::value>::type* = nullptr> + static std::string FormatInfluxDBValue(T value) { return std::to_string(value) + 'i'; } + + static std::string FormatInfluxDBValue(std::string const& value) + { + return '"' + boost::replace_all_copy(value, "\"", "\\\"") + '"'; + } + + static std::string FormatInfluxDBValue(bool value) { return value ? "t" : "f"; } + static std::string FormatInfluxDBValue(const char* value) { return FormatInfluxDBValue(std::string(value)); } + static std::string FormatInfluxDBValue(double value) { return std::to_string(value); } + static std::string FormatInfluxDBValue(float value) { return FormatInfluxDBValue(double(value)); } + +public: + static Metric* instance(); + + void Initialize(std::string const& realmName, boost::asio::io_service& ioService, std::function<void()> overallStatusLogger = [](){}); + void LoadFromConfigs(); + void Update(); + + template<class T> + void LogValue(std::string const& category, T value) + { + using namespace std::chrono; + + MetricData* data = new MetricData; + data->Category = category; + data->Timestamp = system_clock::now(); + data->Type = METRIC_DATA_VALUE; + data->Value = FormatInfluxDBValue(value); + + _queuedData.Enqueue(data); + } + + void LogEvent(std::string const& category, std::string const& title, std::string const& description); + + void ForceSend(); + bool IsEnabled() const { return _enabled; } +}; + +#define sMetric Metric::instance() + +#if PLATFORM != PLATFORM_WINDOWS +#define TC_METRIC_EVENT(category, title, description) \ + do { \ + if (sMetric->IsEnabled()) \ + sMetric->LogEvent(category, title, description); \ + } while (0) +#define TC_METRIC_VALUE(category, value) \ + do { \ + if (sMetric->IsEnabled()) \ + sMetric->LogValue(category, value); \ + } while (0) +#else +#define TC_METRIC_EVENT(category, title, description) \ + __pragma(warning(push)) \ + __pragma(warning(disable:4127)) \ + do { \ + if (sMetric->IsEnabled()) \ + sMetric->LogEvent(category, title, description); \ + } while (0) \ + __pragma(warning(pop)) +#define TC_METRIC_VALUE(category, value) \ + __pragma(warning(push)) \ + __pragma(warning(disable:4127)) \ + do { \ + if (sMetric->IsEnabled()) \ + sMetric->LogValue(category, value); \ + } while (0) \ + __pragma(warning(pop)) +#endif + +#endif // METRIC_H__ diff --git a/src/server/game/AI/PlayerAI/PlayerAI.cpp b/src/server/game/AI/PlayerAI/PlayerAI.cpp index 68cb268ac6c..d5c17cce3ad 100644 --- a/src/server/game/AI/PlayerAI/PlayerAI.cpp +++ b/src/server/game/AI/PlayerAI/PlayerAI.cpp @@ -893,7 +893,7 @@ PlayerAI::TargetedSpell SimpleCharmedPlayerAI::SelectAppropriateCastForSpec() VerifyAndPushSpellCast(spells, SPELL_BLIND, TARGET_VICTIM, 2); VerifyAndPushSpellCast(spells, SPELL_CLOAK_OF_SHADOWS, TARGET_NONE, 2); - uint32 builder, finisher; + uint32 builder = 0, finisher = 0; switch (GetSpec()) { case SPEC_ROGUE_ASSASSINATION: diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 7c258e09b09..a0a7651df13 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -1480,10 +1480,10 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u if (TransportBase* trans = me->GetDirectTransport()) trans->CalculatePassengerPosition(dest.x, dest.y, dest.z); - me->GetMotionMaster()->MovePoint(e.action.MoveToPos.pointId, dest.x, dest.y, dest.z); + me->GetMotionMaster()->MovePoint(e.action.MoveToPos.pointId, dest.x, dest.y, dest.z, e.action.MoveToPos.disablePathfinding == 0); } else - me->GetMotionMaster()->MovePoint(e.action.MoveToPos.pointId, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ()); + me->GetMotionMaster()->MovePoint(e.action.MoveToPos.pointId, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), e.action.MoveToPos.disablePathfinding == 0); break; } case SMART_ACTION_RESPAWN_TARGET: diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h index 3105f087bf7..828b89ff2d7 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h @@ -504,7 +504,7 @@ enum SMART_ACTION SMART_ACTION_SET_ORIENTATION = 66, // SMART_ACTION_CREATE_TIMED_EVENT = 67, // id, InitialMin, InitialMax, RepeatMin(only if it repeats), RepeatMax(only if it repeats), chance SMART_ACTION_PLAYMOVIE = 68, // entry - SMART_ACTION_MOVE_TO_POS = 69, // PointId, xyz + SMART_ACTION_MOVE_TO_POS = 69, // PointId, transport, disablePathfinding SMART_ACTION_RESPAWN_TARGET = 70, // SMART_ACTION_EQUIP = 71, // entry, slotmask slot1, slot2, slot3 , only slots with mask set will be sent to client, bits are 1, 2, 4, leaving mask 0 is defaulted to mask 7 (send all), slots1-3 are only used if no entry is set SMART_ACTION_CLOSE_GOSSIP = 72, // none @@ -958,6 +958,7 @@ struct SmartAction { uint32 pointId; uint32 transport; + uint32 disablePathfinding; } MoveToPos; struct diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index d7e478bb4e5..fed41f79b88 100644 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -2004,7 +2004,7 @@ void GameObject::SetDestructibleState(GameObjectDestructibleState state, Player* RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_DESTROYED); SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_DAMAGED); - uint32 modelId = m_goInfo->building.damagedDisplayId; + uint32 modelId = m_goInfo->displayId; if (DestructibleModelDataEntry const* modelData = sDestructibleModelDataStore.LookupEntry(m_goInfo->building.destructibleData)) if (modelData->DamagedDisplayId) modelId = modelData->DamagedDisplayId; @@ -2032,7 +2032,7 @@ void GameObject::SetDestructibleState(GameObjectDestructibleState state, Player* RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_DAMAGED); SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_DESTROYED); - uint32 modelId = m_goInfo->building.destroyedDisplayId; + uint32 modelId = m_goInfo->displayId; if (DestructibleModelDataEntry const* modelData = sDestructibleModelDataStore.LookupEntry(m_goInfo->building.destructibleData)) if (modelData->DestroyedDisplayId) modelId = modelData->DestroyedDisplayId; diff --git a/src/server/game/Entities/GameObject/GameObject.h b/src/server/game/Entities/GameObject/GameObject.h index 2b092427178..ff3d9ce8e20 100644 --- a/src/server/game/Entities/GameObject/GameObject.h +++ b/src/server/game/Entities/GameObject/GameObject.h @@ -57,6 +57,7 @@ struct GameObjectTemplate uint32 openTextID; //4 can be used to replace castBarCaption? uint32 closeTextID; //5 uint32 ignoredByPathing; //6 + uint32 conditionID1; //7 } door; //1 GAMEOBJECT_TYPE_BUTTON struct @@ -70,6 +71,7 @@ struct GameObjectTemplate uint32 openTextID; //6 can be used to replace castBarCaption? uint32 closeTextID; //7 uint32 losOK; //8 + uint32 conditionID1; //9 } button; //2 GAMEOBJECT_TYPE_QUESTGIVER struct @@ -84,6 +86,7 @@ struct GameObjectTemplate uint32 losOK; //7 uint32 allowMounted; //8 Is usable while on mount/vehicle. (0/1) uint32 large; //9 + uint32 conditionID1; //10 } questgiver; //3 GAMEOBJECT_TYPE_CHEST struct @@ -105,6 +108,7 @@ struct GameObjectTemplate uint32 openTextID; //14 can be used to replace castBarCaption? uint32 groupLootRules; //15 uint32 floatingTooltip; //16 + uint32 conditionID1; //17 } chest; //4 GAMEOBJECT_TYPE_BINDER - empty //5 GAMEOBJECT_TYPE_GENERIC @@ -117,6 +121,7 @@ struct GameObjectTemplate uint32 floatOnWater; //4 int32 questID; //5 } _generic; + uint32 conditionID1; //6 //6 GAMEOBJECT_TYPE_TRAP struct { @@ -135,6 +140,7 @@ struct GameObjectTemplate uint32 openTextID; //12 can be used to replace castBarCaption? uint32 closeTextID; //13 uint32 ignoreTotems; //14 + uint32 conditionID1; //15 } trap; //7 GAMEOBJECT_TYPE_CHAIR struct @@ -143,6 +149,7 @@ struct GameObjectTemplate uint32 height; //1 uint32 onlyCreatorUse; //2 uint32 triggeredEvent; //3 + uint32 conditionID1; //4 } chair; //8 GAMEOBJECT_TYPE_SPELL_FOCUS struct @@ -154,6 +161,8 @@ struct GameObjectTemplate uint32 questID; //4 uint32 large; //5 uint32 floatingTooltip; //6 + uint32 floatOnWater; //7 + uint32 conditionID1; //8 } spellFocus; //9 GAMEOBJECT_TYPE_TEXT struct @@ -162,6 +171,7 @@ struct GameObjectTemplate uint32 language; //1 uint32 pageMaterial; //2 uint32 allowMounted; //3 Is usable while on mount/vehicle. (0/1) + uint32 conditionID1; //4 } text; //10 GAMEOBJECT_TYPE_GOOBER struct @@ -187,6 +197,8 @@ struct GameObjectTemplate uint32 floatingTooltip; //18 uint32 gossipID; //19 uint32 WorldStateSetsState; //20 + uint32 floatOnWater; //21 + uint32 conditionID1; //22 } goober; //11 GAMEOBJECT_TYPE_TRANSPORT struct @@ -196,6 +208,7 @@ struct GameObjectTemplate uint32 autoCloseTime; //2 secs till autoclose = autoCloseTime / 0x10000 uint32 pause1EventID; //3 uint32 pause2EventID; //4 + uint32 mapID; //5 } transport; //12 GAMEOBJECT_TYPE_AREADAMAGE struct @@ -216,6 +229,7 @@ struct GameObjectTemplate uint32 cinematicId; //1 uint32 eventID; //2 uint32 openTextID; //3 can be used to replace castBarCaption? + uint32 conditionID1; //4 } camera; //14 GAMEOBJECT_TYPE_MAPOBJECT - empty //15 GAMEOBJECT_TYPE_MO_TRANSPORT @@ -244,9 +258,14 @@ struct GameObjectTemplate uint32 casterTargetSpellTargets; //5 uint32 castersGrouped; //6 uint32 ritualNoTargetCheck; //7 + uint32 conditionID1; //8 } summoningRitual; - //19 GAMEOBJECT_TYPE_MAILBOX - empty - //20 GAMEOBJECT_TYPE_DONOTUSE - empty + //19 GAMEOBJECT_TYPE_MAILBOX + struct + { + uint32 conditionID1; //0 + } mailbox; + //20 GAMEOBJECT_TYPE_DO_NOT_USE - empty //21 GAMEOBJECT_TYPE_GUARDPOST struct { @@ -261,6 +280,7 @@ struct GameObjectTemplate uint32 partyOnly; //2 uint32 allowMounted; //3 Is usable while on mount/vehicle. (0/1) uint32 large; //4 + uint32 conditionID1; //5 } spellcaster; //23 GAMEOBJECT_TYPE_MEETINGSTONE struct @@ -280,6 +300,7 @@ struct GameObjectTemplate uint32 noDamageImmune; //5 uint32 openTextID; //6 uint32 losOK; //7 + uint32 conditionID1; //8 } flagstand; //25 GAMEOBJECT_TYPE_FISHINGHOLE struct @@ -358,21 +379,21 @@ struct GameObjectTemplate { uint32 intactNumHits; //0 uint32 creditProxyCreature; //1 - uint32 state1Name; //2 + uint32 empty1; //2 uint32 intactEvent; //3 - uint32 damagedDisplayId; //4 + uint32 empty2; //4 uint32 damagedNumHits; //5 uint32 empty3; //6 uint32 empty4; //7 uint32 empty5; //8 uint32 damagedEvent; //9 - uint32 destroyedDisplayId; //10 + uint32 empty6; //10 uint32 empty7; //11 uint32 empty8; //12 uint32 empty9; //13 uint32 destroyedEvent; //14 uint32 empty10; //15 - uint32 debuildingTimeSecs; //16 + uint32 rebuildingTimeSecs; //16 uint32 empty11; //17 uint32 destructibleData; //18 uint32 rebuildingEvent; //19 @@ -381,7 +402,11 @@ struct GameObjectTemplate uint32 damageEvent; //22 uint32 empty14; //23 } building; - //34 GAMEOBJECT_TYPE_GUILDBANK - empty + //34 GAMEOBJECT_TYPE_GUILDBANK + struct + { + uint32 conditionID1; //0 + } guildbank; //35 GAMEOBJECT_TYPE_TRAPDOOR struct { diff --git a/src/server/game/Entities/Item/ItemPrototype.h b/src/server/game/Entities/Item/ItemPrototype.h index 9b0f4628364..5478c43326c 100644 --- a/src/server/game/Entities/Item/ItemPrototype.h +++ b/src/server/game/Entities/Item/ItemPrototype.h @@ -107,20 +107,20 @@ enum ItemBondingType enum ItemProtoFlags { - ITEM_PROTO_FLAG_UNK1 = 0x00000001, // ? + ITEM_PROTO_FLAG_NO_PICKUP = 0x00000001, // ? ITEM_PROTO_FLAG_CONJURED = 0x00000002, // Conjured item - ITEM_PROTO_FLAG_OPENABLE = 0x00000004, // Item can be right clicked to open for loot + ITEM_PROTO_FLAG_HAS_LOOT = 0x00000004, // Item can be right clicked to open for loot ITEM_PROTO_FLAG_HEROIC = 0x00000008, // Makes green "Heroic" text appear on item ITEM_PROTO_FLAG_DEPRECATED = 0x00000010, // Cannot equip or use ITEM_PROTO_FLAG_INDESTRUCTIBLE = 0x00000020, // Item can not be destroyed, except by using spell (item can be reagent for spell) - ITEM_PROTO_FLAG_UNK2 = 0x00000040, // ? + ITEM_PROTO_FLAG_PLAYER_CAST = 0x00000040, // Item's spells are castable by players ITEM_PROTO_FLAG_NO_EQUIP_COOLDOWN = 0x00000080, // No default 30 seconds cooldown when equipped - ITEM_PROTO_FLAG_UNK3 = 0x00000100, // ? - ITEM_PROTO_FLAG_WRAPPER = 0x00000200, // Item can wrap other items - ITEM_PROTO_FLAG_UNK4 = 0x00000400, // ? - ITEM_PROTO_FLAG_PARTY_LOOT = 0x00000800, // Looting this item does not remove it from available loot + ITEM_PROTO_FLAG_INT_BONUS_INSTEAD = 0x00000100, // ? + ITEM_PROTO_FLAG_IS_WRAPPER = 0x00000200, // Item can wrap other items + ITEM_PROTO_FLAG_USES_RESOURCES = 0x00000400, // ? + ITEM_PROTO_FLAG_MULTI_DROP = 0x00000800, // Looting this item does not remove it from available loot ITEM_PROTO_FLAG_REFUNDABLE = 0x00001000, // Item can be returned to vendor for its original cost (extended cost) - ITEM_PROTO_FLAG_CHARTER = 0x00002000, // Item is guild or arena charter + ITEM_PROTO_FLAG_PETITION = 0x00002000, // Item is guild or arena charter ITEM_PROTO_FLAG_UNK5 = 0x00004000, // Only readable items have this (but not all) ITEM_PROTO_FLAG_UNK6 = 0x00008000, // ? ITEM_PROTO_FLAG_UNK7 = 0x00010000, // ? diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index daad0c9d958..e389af1f636 100644 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -1445,7 +1445,7 @@ void WorldObject::UpdateAllowedPositionZ(float x, float y, float &z) const bool canSwim = ToCreature()->CanSwim(); float ground_z = z; float max_z = canSwim - ? GetMap()->GetWaterOrGroundLevel(x, y, z, &ground_z, !ToUnit()->HasAuraType(SPELL_AURA_WATER_WALK)) + ? GetMap()->GetWaterOrGroundLevel(GetPhaseMask(), x, y, z, &ground_z, !ToUnit()->HasAuraType(SPELL_AURA_WATER_WALK)) : ((ground_z = GetMap()->GetHeight(GetPhaseMask(), x, y, z, true))); if (max_z > INVALID_HEIGHT) { @@ -1469,7 +1469,7 @@ void WorldObject::UpdateAllowedPositionZ(float x, float y, float &z) const if (!ToPlayer()->CanFly()) { float ground_z = z; - float max_z = GetMap()->GetWaterOrGroundLevel(x, y, z, &ground_z, !ToUnit()->HasAuraType(SPELL_AURA_WATER_WALK)); + float max_z = GetMap()->GetWaterOrGroundLevel(GetPhaseMask(), x, y, z, &ground_z, !ToUnit()->HasAuraType(SPELL_AURA_WATER_WALK)); if (max_z > INVALID_HEIGHT) { if (z > max_z) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index ec86e8fe4c3..636f9b61019 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -7210,6 +7210,13 @@ void Player::DuelComplete(DuelCompleteType type) if (!duel) return; + // Check if DuelComplete() has been called already up in the stack and in that case don't do anything else here + if (duel->isCompleted || ASSERT_NOTNULL(duel->opponent->duel)->isCompleted) + return; + + duel->isCompleted = true; + duel->opponent->duel->isCompleted = true; + TC_LOG_DEBUG("entities.unit", "Player::DuelComplete: Player '%s' (%s), Opponent: '%s' (%s)", GetName().c_str(), GetGUID().ToString().c_str(), duel->opponent->GetName().c_str(), duel->opponent->GetGUID().ToString().c_str()); @@ -12323,7 +12330,7 @@ void Player::DestroyItem(uint8 bag, uint8 slot, bool update) // Delete rolled money / loot from db. // MUST be done before RemoveFromWorld() or GetTemplate() fails if (ItemTemplate const* pTmp = pItem->GetTemplate()) - if (pTmp->Flags & ITEM_PROTO_FLAG_OPENABLE) + if (pTmp->Flags & ITEM_PROTO_FLAG_HAS_LOOT) pItem->ItemContainerDeleteLootMoneyAndLootItemsFromDB(); if (IsInWorld() && update) diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 6a38cd3b9fe..4b11ca29db4 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -269,6 +269,7 @@ struct PlayerInfo uint16 displayId_f; PlayerCreateInfoItems item; PlayerCreateInfoSpells customSpells; + PlayerCreateInfoSpells castSpells; PlayerCreateInfoActions action; PlayerCreateInfoSkills skills; @@ -288,7 +289,7 @@ struct PvPInfo struct DuelInfo { - DuelInfo() : initiator(nullptr), opponent(nullptr), startTimer(0), startTime(0), outOfBound(0), isMounted(false) { } + DuelInfo() : initiator(nullptr), opponent(nullptr), startTimer(0), startTime(0), outOfBound(0), isMounted(false), isCompleted(false) { } Player* initiator; Player* opponent; @@ -296,6 +297,7 @@ struct DuelInfo time_t startTime; time_t outOfBound; bool isMounted; + bool isCompleted; }; struct Areas diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 6e921ae1622..fe8cb996135 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -16754,7 +16754,7 @@ void Unit::_ExitVehicle(Position const* exitPosition) Movement::MoveSplineInit init(this); // Creatures without inhabit type air should begin falling after exiting the vehicle - if (GetTypeId() == TYPEID_UNIT && !CanFly() && height > GetMap()->GetWaterOrGroundLevel(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), &height) + 0.1f) + if (GetTypeId() == TYPEID_UNIT && !CanFly() && height > GetMap()->GetWaterOrGroundLevel(GetPhaseMask(), pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), &height) + 0.1f) init.SetFall(); init.MoveTo(pos.GetPositionX(), pos.GetPositionY(), height, false); diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 33a0325851a..73dd7e49f30 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -3529,6 +3529,61 @@ void ObjectMgr::LoadPlayerInfo() } } + // Load playercreate cast spell + TC_LOG_INFO("server.loading", "Loading Player Create Cast Spell Data..."); + { + uint32 oldMSTime = getMSTime(); + + QueryResult result = WorldDatabase.PQuery("SELECT raceMask, classMask, spell FROM playercreateinfo_cast_spell"); + + if (!result) + TC_LOG_ERROR("server.loading", ">> Loaded 0 player create cast spells. DB table `playercreateinfo_cast_spell` is empty."); + else + { + uint32 count = 0; + + do + { + Field* fields = result->Fetch(); + uint32 raceMask = fields[0].GetUInt32(); + uint32 classMask = fields[1].GetUInt32(); + uint32 spellId = fields[2].GetUInt32(); + + if (raceMask != 0 && !(raceMask & RACEMASK_ALL_PLAYABLE)) + { + TC_LOG_ERROR("sql.sql", "Wrong race mask %u in `playercreateinfo_cast_spell` table, ignoring.", raceMask); + continue; + } + + if (classMask != 0 && !(classMask & CLASSMASK_ALL_PLAYABLE)) + { + TC_LOG_ERROR("sql.sql", "Wrong class mask %u in `playercreateinfo_cast_spell` table, ignoring.", classMask); + continue; + } + + for (uint32 raceIndex = RACE_HUMAN; raceIndex < MAX_RACES; ++raceIndex) + { + if (raceMask == 0 || ((1 << (raceIndex - 1)) & raceMask)) + { + for (uint32 classIndex = CLASS_WARRIOR; classIndex < MAX_CLASSES; ++classIndex) + { + if (classMask == 0 || ((1 << (classIndex - 1)) & classMask)) + { + if (PlayerInfo* info = _playerInfo[raceIndex][classIndex]) + { + info->castSpells.push_back(spellId); + ++count; + } + } + } + } + } + } while (result->NextRow()); + + TC_LOG_INFO("server.loading", ">> Loaded %u player create cast spells in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + } + } + // Load playercreate actions TC_LOG_INFO("server.loading", "Loading Player Create Action Data..."); { diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index 19638ec1bf8..786c708da93 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -45,6 +45,7 @@ #include "World.h" #include "WorldPacket.h" #include "WorldSession.h" +#include "Metric.h" class LoginQueryHolder : public SQLQueryHolder @@ -969,8 +970,14 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder) bool firstLogin = pCurrChar->HasAtLoginFlag(AT_LOGIN_FIRST); if (firstLogin) + { pCurrChar->RemoveAtLoginFlag(AT_LOGIN_FIRST); + PlayerInfo const* info = sObjectMgr->GetPlayerInfo(pCurrChar->getRace(), pCurrChar->getClass()); + for (uint32 spellId : info->castSpells) + pCurrChar->CastSpell(pCurrChar, spellId, true); + } + // show time before shutdown if shutdown planned. if (sWorld->IsShuttingDown()) sWorld->ShutdownMsg(true, pCurrChar); @@ -995,6 +1002,8 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder) sScriptMgr->OnPlayerLogin(pCurrChar, firstLogin); + TC_METRIC_EVENT("player_events", "Login", pCurrChar->GetName()); + delete holder; } diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index 7f5d882a912..42ce01708eb 100644 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -1095,7 +1095,7 @@ void WorldSession::HandleWrapItemOpcode(WorldPacket& recvData) return; } - if (!(gift->GetTemplate()->Flags & ITEM_PROTO_FLAG_WRAPPER)) // cheating: non-wrapper wrapper + if (!(gift->GetTemplate()->Flags & ITEM_PROTO_FLAG_IS_WRAPPER)) // cheating: non-wrapper wrapper { _player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, gift, NULL); return; diff --git a/src/server/game/Handlers/LootHandler.cpp b/src/server/game/Handlers/LootHandler.cpp index 82fdc2e54c7..ad5d8259e15 100644 --- a/src/server/game/Handlers/LootHandler.cpp +++ b/src/server/game/Handlers/LootHandler.cpp @@ -338,7 +338,7 @@ void WorldSession::DoLootRelease(ObjectGuid lguid) else { // Only delete item if no loot or money (unlooted loot is saved to db) or if it isn't an openable item - if (pItem->loot.isLooted() || !(proto->Flags & ITEM_PROTO_FLAG_OPENABLE)) + if (pItem->loot.isLooted() || !(proto->Flags & ITEM_PROTO_FLAG_HAS_LOOT)) player->DestroyItem(pItem->GetBagSlot(), pItem->GetSlot(), true); } return; // item can be looted only single player diff --git a/src/server/game/Handlers/SpellHandler.cpp b/src/server/game/Handlers/SpellHandler.cpp index e07e10ab00c..93e986b0339 100644 --- a/src/server/game/Handlers/SpellHandler.cpp +++ b/src/server/game/Handlers/SpellHandler.cpp @@ -196,7 +196,7 @@ void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket) } // Verify that the bag is an actual bag or wrapped item that can be used "normally" - if (!(proto->Flags & ITEM_PROTO_FLAG_OPENABLE) && !item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_WRAPPED)) + if (!(proto->Flags & ITEM_PROTO_FLAG_HAS_LOOT) && !item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_WRAPPED)) { pUser->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, item, NULL); TC_LOG_ERROR("network", "Possible hacking attempt: Player %s [guid: %u] tried to open item [guid: %u, entry: %u] which is not openable!", diff --git a/src/server/game/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp index 390b636bb5e..ebdeb4016dd 100644 --- a/src/server/game/Loot/LootMgr.cpp +++ b/src/server/game/Loot/LootMgr.cpp @@ -353,7 +353,7 @@ LootItem::LootItem(LootStoreItem const& li) conditions = li.conditions; ItemTemplate const* proto = sObjectMgr->GetItemTemplate(itemid); - freeforall = proto && (proto->Flags & ITEM_PROTO_FLAG_PARTY_LOOT); + freeforall = proto && (proto->Flags & ITEM_PROTO_FLAG_MULTI_DROP); follow_loot_rules = proto && (proto->FlagsCu & ITEM_FLAGS_CU_FOLLOW_LOOT_RULES); needs_quest = li.needs_quest; @@ -429,7 +429,7 @@ void Loot::AddItem(LootStoreItem const& item) // non-conditional one-player only items are counted here, // free for all items are counted in FillFFALoot(), // non-ffa conditionals are counted in FillNonQuestNonFFAConditionalLoot() - if (!item.needs_quest && item.conditions.empty() && !(proto->Flags & ITEM_PROTO_FLAG_PARTY_LOOT)) + if (!item.needs_quest && item.conditions.empty() && !(proto->Flags & ITEM_PROTO_FLAG_MULTI_DROP)) ++unlootedCount; } } @@ -1640,7 +1640,7 @@ void LoadLootTemplates_Item() // remove real entries and check existence loot ItemTemplateContainer const* its = sObjectMgr->GetItemTemplateStore(); for (ItemTemplateContainer::const_iterator itr = its->begin(); itr != its->end(); ++itr) - if (lootIdSet.find(itr->second.ItemId) != lootIdSet.end() && itr->second.Flags & ITEM_PROTO_FLAG_OPENABLE) + if (lootIdSet.find(itr->second.ItemId) != lootIdSet.end() && itr->second.Flags & ITEM_PROTO_FLAG_HAS_LOOT) lootIdSet.erase(itr->second.ItemId); // output error for any still listed (not referenced from appropriate table) ids diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index 794be12ee7c..d9bf1d3bbad 100644 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -2299,12 +2299,12 @@ inline GridMap* Map::GetGrid(float x, float y) return GridMaps[gx][gy]; } -float Map::GetWaterOrGroundLevel(float x, float y, float z, float* ground /*= NULL*/, bool /*swim = false*/) const +float Map::GetWaterOrGroundLevel(uint32 phasemask, float x, float y, float z, float* ground /*= NULL*/, bool /*swim = false*/) const { if (const_cast<Map*>(this)->GetGrid(x, y)) { // we need ground level (including grid height version) for proper return water level in point - float ground_z = GetHeight(PHASEMASK_NORMAL, x, y, z, true, 50.0f); + float ground_z = GetHeight(phasemask, x, y, z, true, 50.0f); if (ground) *ground = ground_z; diff --git a/src/server/game/Maps/Map.h b/src/server/game/Maps/Map.h index 5f134613e85..48864180b84 100644 --- a/src/server/game/Maps/Map.h +++ b/src/server/game/Maps/Map.h @@ -494,7 +494,7 @@ class TC_GAME_API Map : public GridRefManager<NGridType> BattlegroundMap* ToBattlegroundMap() { if (IsBattlegroundOrArena()) return reinterpret_cast<BattlegroundMap*>(this); else return NULL; } BattlegroundMap const* ToBattlegroundMap() const { if (IsBattlegroundOrArena()) return reinterpret_cast<BattlegroundMap const*>(this); return NULL; } - float GetWaterOrGroundLevel(float x, float y, float z, float* ground = NULL, bool swim = false) const; + float GetWaterOrGroundLevel(uint32 phasemask, float x, float y, float z, float* ground = NULL, bool swim = false) const; float GetHeight(uint32 phasemask, float x, float y, float z, bool vmap = true, float maxSearchDist = DEFAULT_HEIGHT_SEARCH) const; bool isInLineOfSight(float x1, float y1, float z1, float x2, float y2, float z2, uint32 phasemask) const; void Balance() { _dynamicTree.balance(); } diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index b9df9e3accc..7f77453d00b 100644 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -1490,11 +1490,12 @@ enum GameObjectFlags { GO_FLAG_IN_USE = 0x00000001, // disables interaction while animated GO_FLAG_LOCKED = 0x00000002, // require key, spell, event, etc to be opened. Makes "Locked" appear in tooltip - GO_FLAG_INTERACT_COND = 0x00000004, // cannot interact (condition to interact) + GO_FLAG_INTERACT_COND = 0x00000004, // cannot interact (condition to interact - requires GO_DYNFLAG_LO_ACTIVATE to enable interaction clientside) GO_FLAG_TRANSPORT = 0x00000008, // any kind of transport? Object can transport (elevator, boat, car) GO_FLAG_NOT_SELECTABLE = 0x00000010, // not selectable even in GM mode GO_FLAG_NODESPAWN = 0x00000020, // never despawn, typically for doors, they just change state - GO_FLAG_TRIGGERED = 0x00000040, // typically, summoned objects. Triggered by spell or other events + GO_FLAG_AI_OBSTACLE = 0x00000040, // makes the client register the object in something called AIObstacleMgr, unknown what it does + GO_FLAG_FREEZE_ANIMATION = 0x00000080, GO_FLAG_DAMAGED = 0x00000200, GO_FLAG_DESTROYED = 0x00000400 }; diff --git a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp index 421678ded17..59e1fdb3de0 100644 --- a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp @@ -57,7 +57,7 @@ void RandomMovementGenerator<Creature>::_setRandomLocation(Creature* creature) // Limit height change const float distanceZ = float(rand_norm()) * travelDistZ/2.0f; destZ = respZ + distanceZ; - float levelZ = map->GetWaterOrGroundLevel(destX, destY, destZ-2.0f); + float levelZ = map->GetWaterOrGroundLevel(creature->GetPhaseMask(), destX, destY, destZ-2.5f); // Problem here, we must fly above the ground and water, not under. Let's try on next tick if (levelZ >= destZ) diff --git a/src/server/game/Movement/PathGenerator.cpp b/src/server/game/Movement/PathGenerator.cpp index 3b4f19adb0b..45d8401bcba 100644 --- a/src/server/game/Movement/PathGenerator.cpp +++ b/src/server/game/Movement/PathGenerator.cpp @@ -25,6 +25,7 @@ #include "DisableMgr.h" #include "DetourCommon.h" #include "DetourNavMeshQuery.h" +#include "Metric.h" ////////////////// PathGenerator ////////////////// PathGenerator::PathGenerator(const Unit* owner) : @@ -61,6 +62,8 @@ bool PathGenerator::CalculatePath(float destX, float destY, float destZ, bool fo if (!Trinity::IsValidMapCoord(destX, destY, destZ) || !Trinity::IsValidMapCoord(x, y, z)) return false; + TC_METRIC_EVENT("mmap_events", "CalculatePath", ""); + G3D::Vector3 dest(destX, destY, destZ); SetEndPosition(dest); diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index ddcc10b53dd..b774463e8fd 100644 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -43,6 +43,7 @@ #include "WardenWin.h" #include "MoveSpline.h" #include "WardenMac.h" +#include "Metric.h" #include <zlib.h> @@ -380,6 +381,8 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater) break; } + TC_METRIC_VALUE("processed_packets", processedPackets); + _recvQueue.readd(requeuePackets.begin(), requeuePackets.end()); if (m_Socket && m_Socket->IsOpen() && _warden) @@ -536,6 +539,8 @@ void WorldSession::LogoutPlayer(bool save) //! Call script hook before deletion sScriptMgr->OnPlayerLogout(_player); + TC_METRIC_EVENT("player_events", "Logout", _player->GetName()); + //! Remove the player from the world // the player may not be in the world when logging out // e.g if he got disconnected during a transfer to another map diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 37457f36145..b5c5b9f82b6 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -58,6 +58,7 @@ #include "SkillDiscovery.h" #include "SkillExtraItems.h" #include "SmartAI.h" +#include "Metric.h" #include "TicketMgr.h" #include "TransportMgr.h" #include "Unit.h" @@ -396,6 +397,7 @@ void World::LoadConfigSettings(bool reload) return; } sLog->LoadFromConfig(); + sMetric->LoadFromConfigs(); } ///- Read the player limit and the Message of the day from the config file @@ -1937,6 +1939,8 @@ void World::SetInitialWorldSettings() TC_LOG_INFO("server.worldserver", "World initialized in %u minutes %u seconds", (startupDuration / 60000), ((startupDuration % 60000) / 1000)); + TC_METRIC_EVENT("events", "World initialized", "World initialized in " + std::to_string(startupDuration / 60000) + " minutes " + std::to_string((startupDuration % 60000) / 1000) + " seconds"); + if (uint32 realmId = sConfigMgr->GetIntDefault("RealmID", 0)) // 0 reserved for auth sLog->SetRealmId(realmId); } @@ -2251,6 +2255,10 @@ void World::Update(uint32 diff) ProcessCliCommands(); sScriptMgr->OnWorldUpdate(diff); + + // Stats logger update + sMetric->Update(); + TC_METRIC_VALUE("update_time_diff", diff); } void World::ForceGameEventUpdate() diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_rend_blackhand.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_rend_blackhand.cpp index 817aaf0a253..f962a019da6 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_rend_blackhand.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_rend_blackhand.cpp @@ -187,6 +187,12 @@ public: events.ScheduleEvent(EVENT_MORTAL_STRIKE, urand(17000, 19000)); } + void IsSummonedBy(Unit* /*summoner*/) override + { + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); + DoZoneInCombat(); + } + void JustDied(Unit* /*killer*/) override { _JustDied(); diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp index 4a6fee12098..6fa1093c38f 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp @@ -209,6 +209,7 @@ public: me->SetUInt32Value(UNIT_NPC_FLAGS, 0); DoCast(me, SPELL_NEFARIANS_BARRIER); me->SetStandState(UNIT_STAND_STATE_STAND); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); AttackStart(target); events.ScheduleEvent(EVENT_SHADOW_BOLT, urand(3000, 10000)); events.ScheduleEvent(EVENT_FEAR, urand(10000, 20000)); diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_razorgore.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_razorgore.cpp index e58bded801b..e97b7cba388 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_razorgore.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_razorgore.cpp @@ -32,6 +32,7 @@ enum Say enum Spells { + // @todo orb uses the wrong spell, this needs sniffs SPELL_MINDCONTROL = 42013, SPELL_CHANNEL = 45537, SPELL_EGG_DESTROY = 19873, @@ -103,7 +104,7 @@ public: secondPhase = true; me->RemoveAllAuras(); - me->SetHealth(me->GetMaxHealth()); + me->SetFullHealth(); } void DoAction(int32 action) override @@ -114,6 +115,7 @@ public: void DamageTaken(Unit* /*who*/, uint32& damage) override { + // @todo this is wrong - razorgore should still take damage, he should just nuke the whole room and respawn if he dies during P1 if (!secondPhase) damage = 0; } @@ -146,6 +148,7 @@ public: break; case EVENT_CONFLAGRATION: DoCastVictim(SPELL_CONFLAGRATION); + // @todo is this even necessary? pretty sure AI ignores targets with disorient by default if (me->GetVictim() && me->EnsureVictim()->HasAura(SPELL_CONFLAGRATION)) if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true)) me->TauntApply(target); @@ -175,10 +178,10 @@ public: { if (InstanceScript* instance = go->GetInstanceScript()) if (instance->GetData(DATA_EGG_EVENT) != DONE) - if (Creature* razor = instance->GetCreature(DATA_RAZORGORE_THE_UNTAMED)) + if (Creature* razorgore = instance->GetCreature(DATA_RAZORGORE_THE_UNTAMED)) { - razor->Attack(player, true); - player->CastSpell(razor, SPELL_MINDCONTROL); + razorgore->Attack(player, true); + player->CastSpell(razorgore, SPELL_MINDCONTROL); } return true; } diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_ragnaros.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_ragnaros.cpp index e0cae87051f..a89a6b491e8 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_ragnaros.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_ragnaros.cpp @@ -159,7 +159,7 @@ class boss_ragnaros : public CreatureScript break; case EVENT_INTRO_5: me->SetReactState(REACT_AGGRESSIVE); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC); _introState = 2; break; default: diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp index 7440984d7c5..7c622c6154f 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp @@ -222,10 +222,10 @@ class boss_anubarak_trial : public CreatureScript instance->SetBossState(BOSS_ANUBARAK, FAIL); //Summon Scarab Swarms neutral at random places for (int i = 0; i < 10; i++) - if (Creature* temp = me->SummonCreature(NPC_SCARAB, AnubarakLoc[1].GetPositionX()+urand(0, 50)-25, AnubarakLoc[1].GetPositionY()+urand(0, 50)-25, AnubarakLoc[1].GetPositionZ())) + if (Creature* scarab = me->SummonCreature(NPC_SCARAB, AnubarakLoc[1].GetPositionX()+urand(0, 50)-25, AnubarakLoc[1].GetPositionY()+urand(0, 50)-25, AnubarakLoc[1].GetPositionZ())) { - temp->setFaction(31); - temp->GetMotionMaster()->MoveRandom(10); + scarab->setFaction(31); + scarab->GetMotionMaster()->MoveRandom(10); } } diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp index 6c1b516c7de..ee44e1391b4 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp @@ -453,22 +453,22 @@ class boss_toc_champion_controller : public CreatureScript for (uint8 i = 0; i < vChampionEntries.size(); ++i) { uint8 pos = urand(0, vChampionJumpTarget.size()-1); - if (Creature* temp = me->SummonCreature(vChampionEntries[i], vChampionJumpOrigin[urand(0, vChampionJumpOrigin.size()-1)], TEMPSUMMON_MANUAL_DESPAWN)) + if (Creature* champion = me->SummonCreature(vChampionEntries[i], vChampionJumpOrigin[urand(0, vChampionJumpOrigin.size()-1)], TEMPSUMMON_MANUAL_DESPAWN)) { - _summons.Summon(temp); - temp->SetReactState(REACT_PASSIVE); - temp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC); + _summons.Summon(champion); + champion->SetReactState(REACT_PASSIVE); + champion->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC); if (playerTeam == ALLIANCE) { - temp->SetHomePosition(vChampionJumpTarget[pos].GetPositionX(), vChampionJumpTarget[pos].GetPositionY(), vChampionJumpTarget[pos].GetPositionZ(), 0); - temp->GetMotionMaster()->MoveJump(vChampionJumpTarget[pos], 20.0f, 20.0f); - temp->SetOrientation(0); + champion->SetHomePosition(vChampionJumpTarget[pos].GetPositionX(), vChampionJumpTarget[pos].GetPositionY(), vChampionJumpTarget[pos].GetPositionZ(), 0); + champion->GetMotionMaster()->MoveJump(vChampionJumpTarget[pos], 20.0f, 20.0f); + champion->SetOrientation(0); } else { - temp->SetHomePosition((ToCCommonLoc[1].GetPositionX()*2)-vChampionJumpTarget[pos].GetPositionX(), vChampionJumpTarget[pos].GetPositionY(), vChampionJumpTarget[pos].GetPositionZ(), 3); - temp->GetMotionMaster()->MoveJump((ToCCommonLoc[1].GetPositionX() * 2) - vChampionJumpTarget[pos].GetPositionX(), vChampionJumpTarget[pos].GetPositionY(), vChampionJumpTarget[pos].GetPositionZ(), vChampionJumpTarget[pos].GetOrientation(), 20.0f, 20.0f); - temp->SetOrientation(3); + champion->SetHomePosition((ToCCommonLoc[1].GetPositionX()*2)-vChampionJumpTarget[pos].GetPositionX(), vChampionJumpTarget[pos].GetPositionY(), vChampionJumpTarget[pos].GetPositionZ(), 3); + champion->GetMotionMaster()->MoveJump((ToCCommonLoc[1].GetPositionX() * 2) - vChampionJumpTarget[pos].GetPositionX(), vChampionJumpTarget[pos].GetPositionY(), vChampionJumpTarget[pos].GetPositionZ(), vChampionJumpTarget[pos].GetOrientation(), 20.0f, 20.0f); + champion->SetOrientation(3); } } vChampionJumpTarget.erase(vChampionJumpTarget.begin()+pos); @@ -485,10 +485,10 @@ class boss_toc_champion_controller : public CreatureScript case 1: for (SummonList::iterator i = _summons.begin(); i != _summons.end(); ++i) { - if (Creature* temp = ObjectAccessor::GetCreature(*me, *i)) + if (Creature* summon = ObjectAccessor::GetCreature(*me, *i)) { - temp->SetReactState(REACT_AGGRESSIVE); - temp->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC); + summon->SetReactState(REACT_AGGRESSIVE); + summon->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC); } } break; @@ -640,12 +640,12 @@ struct boss_faction_championsAI : public BossAI if (TeamInInstance == ALLIANCE) { - if (Creature* temp = ObjectAccessor::GetCreature(*me, instance->GetGuidData(NPC_VARIAN))) - temp->AI()->Talk(SAY_KILL_PLAYER); + if (Creature* varian = ObjectAccessor::GetCreature(*me, instance->GetGuidData(NPC_VARIAN))) + varian->AI()->Talk(SAY_KILL_PLAYER); } else - if (Creature* temp = ObjectAccessor::GetCreature(*me, instance->GetGuidData(NPC_GARROSH))) - temp->AI()->Talk(SAY_KILL_PLAYER); + if (Creature* garrosh = ObjectAccessor::GetCreature(*me, instance->GetGuidData(NPC_GARROSH))) + garrosh->AI()->Talk(SAY_KILL_PLAYER); } } diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp index e353c4482a6..93823987d78 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp @@ -118,7 +118,7 @@ class boss_jaraxxus : public CreatureScript _JustReachedHome(); instance->SetBossState(BOSS_JARAXXUS, FAIL); DoCast(me, SPELL_JARAXXUS_CHAINS); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC); } void KilledUnit(Unit* who) override diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp index 7f4a2158d25..b2283ec6fde 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp @@ -191,7 +191,7 @@ class boss_gormok : public CreatureScript { case 0: instance->DoUseDoorOrButton(instance->GetGuidData(GO_MAIN_GATE_DOOR)); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_PC); me->SetReactState(REACT_AGGRESSIVE); me->SetInCombatWithZone(); break; @@ -595,7 +595,7 @@ struct boss_jormungarAI : public BossAI case EVENT_SUMMON_ACIDMAW: if (Creature* acidmaw = me->SummonCreature(NPC_ACIDMAW, ToCCommonLoc[9].GetPositionX(), ToCCommonLoc[9].GetPositionY(), ToCCommonLoc[9].GetPositionZ(), 5, TEMPSUMMON_MANUAL_DESPAWN)) { - acidmaw->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); + acidmaw->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_PC); acidmaw->SetReactState(REACT_AGGRESSIVE); acidmaw->SetInCombatWithZone(); acidmaw->CastSpell(acidmaw, SPELL_EMERGE); @@ -752,7 +752,7 @@ class boss_dreadscale : public CreatureScript { case 0: instance->DoCloseDoorOrButton(instance->GetGuidData(GO_MAIN_GATE_DOOR)); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_PC); me->SetReactState(REACT_AGGRESSIVE); me->SetInCombatWithZone(); break; @@ -925,7 +925,7 @@ class boss_icehowl : public CreatureScript break; case 2: instance->DoUseDoorOrButton(instance->GetGuidData(GO_MAIN_GATE_DOOR)); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_PC); me->SetReactState(REACT_AGGRESSIVE); me->SetInCombatWithZone(); break; diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp index 278f6a7ab4f..c6ac59218ea 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp @@ -440,10 +440,8 @@ class boss_fjola : public CreatureScript // Allocate an unique random stage to each position in the array. for (int i = 0; i < MAX_STAGES - 1; ++i) { - int random = i + (rand32() % (MAX_STAGES - i)); - int temp = Stage[i]; - Stage[i] = Stage[random]; - Stage[random] = temp; + int random = i + urand(0, MAX_STAGES - i); + std::swap(Stage[i], Stage[random]); } } private: @@ -804,8 +802,8 @@ class spell_valkyr_essences : public SpellScriptLoader else { owner->CastSpell(owner, poweringUp, true); - if (Aura* pTemp = owner->GetAura(poweringUp)) - pTemp->ModStackAmount(stacksCount); + if ((pAura = owner->GetAura(poweringUp))) + pAura->ModStackAmount(stacksCount); } } } @@ -829,8 +827,8 @@ class spell_valkyr_essences : public SpellScriptLoader else { owner->CastSpell(owner, poweringUp, true); - if (Aura* pTemp = owner->GetAura(poweringUp)) - pTemp->ModStackAmount(stacksCount); + if ((pAura = owner->GetAura(poweringUp))) + pAura->ModStackAmount(stacksCount); } } } diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp index 0ffe74932e0..c2f2c8e8547 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp @@ -174,7 +174,7 @@ class npc_announcer_toc10 : public CreatureScript if (Creature* jaraxxus = ObjectAccessor::GetCreature(*player, instance->GetGuidData(NPC_JARAXXUS))) { jaraxxus->RemoveAurasDueToSpell(SPELL_JARAXXUS_CHAINS); - jaraxxus->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + jaraxxus->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC); jaraxxus->SetReactState(REACT_DEFENSIVE); jaraxxus->SetInCombatWithZone(); } @@ -360,11 +360,11 @@ class npc_fizzlebang_toc : public CreatureScript { Talk(SAY_STAGE_1_06, killer); _instance->SetData(TYPE_EVENT, 1180); - if (Creature* temp = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(NPC_JARAXXUS))) + if (Creature* jaraxxus = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(NPC_JARAXXUS))) { - temp->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - temp->SetReactState(REACT_AGGRESSIVE); - temp->SetInCombatWithZone(); + jaraxxus->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC); + jaraxxus->SetReactState(REACT_AGGRESSIVE); + jaraxxus->SetInCombatWithZone(); } } @@ -457,18 +457,18 @@ class npc_fizzlebang_toc : public CreatureScript break; case 1140: Talk(SAY_STAGE_1_04); - if (Creature* temp = me->SummonCreature(NPC_JARAXXUS, ToCCommonLoc[1].GetPositionX(), ToCCommonLoc[1].GetPositionY(), ToCCommonLoc[1].GetPositionZ(), 5.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, DESPAWN_TIME)) + if (Creature* jaraxxus = me->SummonCreature(NPC_JARAXXUS, ToCCommonLoc[1].GetPositionX(), ToCCommonLoc[1].GetPositionY(), ToCCommonLoc[1].GetPositionZ(), 5.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, DESPAWN_TIME)) { - temp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - temp->SetReactState(REACT_PASSIVE); - temp->GetMotionMaster()->MovePoint(0, ToCCommonLoc[1].GetPositionX(), ToCCommonLoc[1].GetPositionY()-10, ToCCommonLoc[1].GetPositionZ()); + jaraxxus->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC); + jaraxxus->SetReactState(REACT_PASSIVE); + jaraxxus->GetMotionMaster()->MovePoint(0, ToCCommonLoc[1].GetPositionX(), ToCCommonLoc[1].GetPositionY()-10, ToCCommonLoc[1].GetPositionZ()); } _instance->SetData(TYPE_EVENT, 1142); _updateTimer = 5*IN_MILLISECONDS; break; case 1142: - if (Creature* temp = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(NPC_JARAXXUS))) - temp->SetTarget(me->GetGUID()); + if (Creature* jaraxxus = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(NPC_JARAXXUS))) + jaraxxus->SetTarget(me->GetGUID()); if (Creature* pTrigger = ObjectAccessor::GetCreature(*me, _triggerGUID)) pTrigger->DespawnOrUnsummon(); if (Creature* pPortal = ObjectAccessor::GetCreature(*me, _portalGUID)) @@ -477,19 +477,19 @@ class npc_fizzlebang_toc : public CreatureScript _updateTimer = 10*IN_MILLISECONDS; break; case 1144: - if (Creature* temp = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(NPC_JARAXXUS))) - temp->AI()->Talk(SAY_STAGE_1_05); + if (Creature* jaraxxus = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(NPC_JARAXXUS))) + jaraxxus->AI()->Talk(SAY_STAGE_1_05); _instance->SetData(TYPE_EVENT, 1150); _updateTimer = 5*IN_MILLISECONDS; break; case 1150: - if (Creature* temp = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(NPC_JARAXXUS))) + if (Creature* jaraxxus = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(NPC_JARAXXUS))) { //1-shot Fizzlebang - temp->CastSpell(me, 67888, false); - me->SetInCombatWith(temp); - temp->AddThreat(me, 1000.0f); - temp->AI()->AttackStart(me); + jaraxxus->CastSpell(me, 67888, false); // 67888 - Fel Lightning + me->SetInCombatWith(jaraxxus); + jaraxxus->AddThreat(me, 1000.0f); + jaraxxus->AI()->AttackStart(me); } _instance->SetData(TYPE_EVENT, 1160); _updateTimer = 3*IN_MILLISECONDS; @@ -561,11 +561,11 @@ class npc_tirion_toc : public CreatureScript { _instance->DoUseDoorOrButton(_instance->GetGuidData(GO_MAIN_GATE_DOOR)); - if (Creature* temp = me->SummonCreature(NPC_GORMOK, ToCSpawnLoc[0].GetPositionX(), ToCSpawnLoc[0].GetPositionY(), ToCSpawnLoc[0].GetPositionZ(), 5, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30*IN_MILLISECONDS)) + if (Creature* gormok = me->SummonCreature(NPC_GORMOK, ToCSpawnLoc[0].GetPositionX(), ToCSpawnLoc[0].GetPositionY(), ToCSpawnLoc[0].GetPositionZ(), 5, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30*IN_MILLISECONDS)) { - temp->GetMotionMaster()->MovePoint(0, ToCCommonLoc[5].GetPositionX(), ToCCommonLoc[5].GetPositionY(), ToCCommonLoc[5].GetPositionZ()); - temp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); - temp->SetReactState(REACT_PASSIVE); + gormok->GetMotionMaster()->MovePoint(0, ToCCommonLoc[5].GetPositionX(), ToCCommonLoc[5].GetPositionY(), ToCCommonLoc[5].GetPositionZ()); + gormok->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); + gormok->SetReactState(REACT_PASSIVE); } } _updateTimer = 3*IN_MILLISECONDS; @@ -582,11 +582,11 @@ class npc_tirion_toc : public CreatureScript if (_instance->GetBossState(BOSS_BEASTS) != DONE) { _instance->DoUseDoorOrButton(_instance->GetGuidData(GO_MAIN_GATE_DOOR)); - if (Creature* temp = me->SummonCreature(NPC_DREADSCALE, ToCSpawnLoc[1].GetPositionX(), ToCSpawnLoc[1].GetPositionY(), ToCSpawnLoc[1].GetPositionZ(), 5, TEMPSUMMON_MANUAL_DESPAWN)) + if (Creature* dreadscale = me->SummonCreature(NPC_DREADSCALE, ToCSpawnLoc[1].GetPositionX(), ToCSpawnLoc[1].GetPositionY(), ToCSpawnLoc[1].GetPositionZ(), 5, TEMPSUMMON_MANUAL_DESPAWN)) { - temp->GetMotionMaster()->MovePoint(0, ToCCommonLoc[5].GetPositionX(), ToCCommonLoc[5].GetPositionY(), ToCCommonLoc[5].GetPositionZ()); - temp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); - temp->SetReactState(REACT_PASSIVE); + dreadscale->GetMotionMaster()->MovePoint(0, ToCCommonLoc[5].GetPositionX(), ToCCommonLoc[5].GetPositionY(), ToCCommonLoc[5].GetPositionZ()); + dreadscale->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); + dreadscale->SetReactState(REACT_PASSIVE); } } _updateTimer = 5*IN_MILLISECONDS; @@ -600,9 +600,9 @@ class npc_tirion_toc : public CreatureScript if (_instance->GetBossState(BOSS_BEASTS) != DONE) { _instance->DoUseDoorOrButton(_instance->GetGuidData(GO_MAIN_GATE_DOOR)); - if (Creature* temp = me->SummonCreature(NPC_ICEHOWL, ToCSpawnLoc[0].GetPositionX(), ToCSpawnLoc[0].GetPositionY(), ToCSpawnLoc[0].GetPositionZ(), 5, TEMPSUMMON_DEAD_DESPAWN)) + if (Creature* icehowl = me->SummonCreature(NPC_ICEHOWL, ToCSpawnLoc[0].GetPositionX(), ToCSpawnLoc[0].GetPositionY(), ToCSpawnLoc[0].GetPositionZ(), 5, TEMPSUMMON_DEAD_DESPAWN)) { - temp->GetMotionMaster()->MovePoint(2, ToCCommonLoc[5].GetPositionX(), ToCCommonLoc[5].GetPositionY(), ToCCommonLoc[5].GetPositionZ()); + icehowl->GetMotionMaster()->MovePoint(2, ToCCommonLoc[5].GetPositionX(), ToCCommonLoc[5].GetPositionY(), ToCCommonLoc[5].GetPositionZ()); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); me->SetReactState(REACT_PASSIVE); } @@ -698,34 +698,34 @@ class npc_tirion_toc : public CreatureScript break; case 4010: Talk(SAY_STAGE_3_02); - if (Creature* temp = me->SummonCreature(NPC_LIGHTBANE, ToCSpawnLoc[1].GetPositionX(), ToCSpawnLoc[1].GetPositionY(), ToCSpawnLoc[1].GetPositionZ(), 5, TEMPSUMMON_CORPSE_TIMED_DESPAWN, DESPAWN_TIME)) + if (Creature* lightbane = me->SummonCreature(NPC_LIGHTBANE, ToCSpawnLoc[1].GetPositionX(), ToCSpawnLoc[1].GetPositionY(), ToCSpawnLoc[1].GetPositionZ(), 5, TEMPSUMMON_CORPSE_TIMED_DESPAWN, DESPAWN_TIME)) { - temp->SetVisible(false); - temp->SetReactState(REACT_PASSIVE); - temp->SummonCreature(NPC_LIGHT_ESSENCE, TwinValkyrsLoc[0].GetPositionX(), TwinValkyrsLoc[0].GetPositionY(), TwinValkyrsLoc[0].GetPositionZ()); - temp->SummonCreature(NPC_LIGHT_ESSENCE, TwinValkyrsLoc[1].GetPositionX(), TwinValkyrsLoc[1].GetPositionY(), TwinValkyrsLoc[1].GetPositionZ()); + lightbane->SetVisible(false); + lightbane->SetReactState(REACT_PASSIVE); + lightbane->SummonCreature(NPC_LIGHT_ESSENCE, TwinValkyrsLoc[0].GetPositionX(), TwinValkyrsLoc[0].GetPositionY(), TwinValkyrsLoc[0].GetPositionZ()); + lightbane->SummonCreature(NPC_LIGHT_ESSENCE, TwinValkyrsLoc[1].GetPositionX(), TwinValkyrsLoc[1].GetPositionY(), TwinValkyrsLoc[1].GetPositionZ()); } - if (Creature* temp = me->SummonCreature(NPC_DARKBANE, ToCSpawnLoc[2].GetPositionX(), ToCSpawnLoc[2].GetPositionY(), ToCSpawnLoc[2].GetPositionZ(), 5, TEMPSUMMON_CORPSE_TIMED_DESPAWN, DESPAWN_TIME)) + if (Creature* darkbane = me->SummonCreature(NPC_DARKBANE, ToCSpawnLoc[2].GetPositionX(), ToCSpawnLoc[2].GetPositionY(), ToCSpawnLoc[2].GetPositionZ(), 5, TEMPSUMMON_CORPSE_TIMED_DESPAWN, DESPAWN_TIME)) { - temp->SetVisible(false); - temp->SetReactState(REACT_PASSIVE); - temp->SummonCreature(NPC_DARK_ESSENCE, TwinValkyrsLoc[2].GetPositionX(), TwinValkyrsLoc[2].GetPositionY(), TwinValkyrsLoc[2].GetPositionZ()); - temp->SummonCreature(NPC_DARK_ESSENCE, TwinValkyrsLoc[3].GetPositionX(), TwinValkyrsLoc[3].GetPositionY(), TwinValkyrsLoc[3].GetPositionZ()); + darkbane->SetVisible(false); + darkbane->SetReactState(REACT_PASSIVE); + darkbane->SummonCreature(NPC_DARK_ESSENCE, TwinValkyrsLoc[2].GetPositionX(), TwinValkyrsLoc[2].GetPositionY(), TwinValkyrsLoc[2].GetPositionZ()); + darkbane->SummonCreature(NPC_DARK_ESSENCE, TwinValkyrsLoc[3].GetPositionX(), TwinValkyrsLoc[3].GetPositionY(), TwinValkyrsLoc[3].GetPositionZ()); } _updateTimer = 3*IN_MILLISECONDS; _instance->SetData(TYPE_EVENT, 4015); break; case 4015: _instance->DoUseDoorOrButton(_instance->GetGuidData(GO_MAIN_GATE_DOOR)); - if (Creature* temp = ObjectAccessor::GetCreature((*me), _instance->GetGuidData(NPC_LIGHTBANE))) + if (Creature* lightbane = ObjectAccessor::GetCreature((*me), _instance->GetGuidData(NPC_LIGHTBANE))) { - temp->GetMotionMaster()->MovePoint(1, ToCCommonLoc[8].GetPositionX(), ToCCommonLoc[8].GetPositionY(), ToCCommonLoc[8].GetPositionZ()); - temp->SetVisible(true); + lightbane->GetMotionMaster()->MovePoint(1, ToCCommonLoc[8].GetPositionX(), ToCCommonLoc[8].GetPositionY(), ToCCommonLoc[8].GetPositionZ()); + lightbane->SetVisible(true); } - if (Creature* temp = ObjectAccessor::GetCreature((*me), _instance->GetGuidData(NPC_DARKBANE))) + if (Creature* darkbane = ObjectAccessor::GetCreature((*me), _instance->GetGuidData(NPC_DARKBANE))) { - temp->GetMotionMaster()->MovePoint(1, ToCCommonLoc[9].GetPositionX(), ToCCommonLoc[9].GetPositionY(), ToCCommonLoc[9].GetPositionZ()); - temp->SetVisible(true); + darkbane->GetMotionMaster()->MovePoint(1, ToCCommonLoc[9].GetPositionX(), ToCCommonLoc[9].GetPositionY(), ToCCommonLoc[9].GetPositionZ()); + darkbane->SetVisible(true); } _updateTimer = 10*IN_MILLISECONDS; _instance->SetData(TYPE_EVENT, 4016); diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp index 3ac85809fa2..6b20ae6a373 100644 --- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp @@ -1921,6 +1921,7 @@ class npc_frostsworn_general : public CreatureScript { if (Creature* reflection = me->SummonCreature(NPC_REFLECTION, *target, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 3000)) { + reflection->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); target->CastSpell(reflection, SPELL_CLONE, true); target->CastSpell(reflection, SPELL_GHOST_VISUAL, true); reflection->AI()->AttackStart(target); @@ -2155,6 +2156,7 @@ struct npc_escape_event_trash : public ScriptedAI DoZoneInCombat(me, 0.0f); if (Creature* leader = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_ESCAPE_LEADER))) { + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); me->SetInCombatWith(leader); leader->SetInCombatWith(me); me->AddThreat(leader, 0.0f); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp index 86068a1ecba..c03a1c6fbc1 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp @@ -30,6 +30,8 @@ Destroying of Toasty Fires */ +/* @todo Hodir aggro behavior is wonky. He gets set to _PASSIVE, but never to _AGGRESSIVE unless you kill an ice block which doesn't spawn unless you have*/ + enum HodirYells { SAY_AGGRO = 0, @@ -375,7 +377,7 @@ class boss_hodir : public CreatureScript Talk(SAY_SLAY); } - void DamageTaken(Unit* /*who*/, uint32& damage) override + void DamageTaken(Unit* who, uint32& damage) override { if (damage >= me->GetHealth()) { @@ -403,6 +405,12 @@ class boss_hodir : public CreatureScript _JustDied(); } + else if (!me->IsInCombat()) + { + me->SetReactState(REACT_AGGRESSIVE); + me->AI()->DoZoneInCombat(); + me->AI()->AttackStart(who); + } } void UpdateAI(uint32 diff) override diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp index 7106e9e4ebe..a50643c5deb 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp @@ -178,7 +178,7 @@ class boss_ignis : public CreatureScript { summon->setFaction(16); summon->SetReactState(REACT_AGGRESSIVE); - summon->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_PACIFIED | UNIT_FLAG_STUNNED | UNIT_FLAG_REMOVE_CLIENT_CONTROL); + summon->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_PACIFIED | UNIT_FLAG_STUNNED | UNIT_FLAG_REMOVE_CLIENT_CONTROL | UNIT_FLAG_IMMUNE_TO_PC); } summon->AI()->AttackStart(me->GetVictim()); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp index 8aa443cba3f..9342b3a068e 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp @@ -972,7 +972,7 @@ class boss_vx_001 : public CreatureScript events.ScheduleEvent(EVENT_FLAME_SUPPRESSANT_VX, 6000); // Missing break intended. case DO_START_VX001: - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_PC); me->RemoveAurasDueToSpell(SPELL_FREEZE_ANIM); me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE); // Remove emotestate. //me->SetUInt32Value(UNIT_FIELD_BYTES_1, 33554432); Blizzard handles hover animation like this it seems. @@ -1145,7 +1145,7 @@ class boss_aerial_command_unit : public CreatureScript events.ScheduleEvent(EVENT_SUMMON_FIRE_BOTS, 1000, 0, PHASE_AERIAL_COMMAND_UNIT); // Missing break intended. case DO_START_AERIAL: - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_PC); me->SetReactState(REACT_AGGRESSIVE); events.SetPhase(PHASE_AERIAL_COMMAND_UNIT); diff --git a/src/server/scripts/Northrend/zone_sholazar_basin.cpp b/src/server/scripts/Northrend/zone_sholazar_basin.cpp index f2edccd99b5..95250682782 100644 --- a/src/server/scripts/Northrend/zone_sholazar_basin.cpp +++ b/src/server/scripts/Northrend/zone_sholazar_basin.cpp @@ -780,7 +780,7 @@ public: bird->KillSelf(); crunchy->GetMotionMaster()->MovePoint(0, bird->GetPositionX(), bird->GetPositionY(), - bird->GetMap()->GetWaterOrGroundLevel(bird->GetPositionX(), bird->GetPositionY(), bird->GetPositionZ())); + bird->GetMap()->GetWaterOrGroundLevel(bird->GetPhaseMask(), bird->GetPositionX(), bird->GetPositionY(), bird->GetPositionZ())); /// @todo Make crunchy perform emote eat when he reaches the bird break; diff --git a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp index 14aeda04a7e..39718a6b418 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp @@ -539,6 +539,7 @@ public: void EnterCombat(Unit* /*who*/) override { + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); me->setActive(true); DoZoneInCombat(); } @@ -585,7 +586,7 @@ public: void SpellHit(Unit* /*caster*/, const SpellInfo* spell) override { - if (spell->Id == SPELL_GLAIVE_RETURNS) // Re-equip our warblades! + if (spell->Id == SPELL_GLAIVE_RETURNS) // Re-equip our warglaives! { if (!me->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID)) SetEquipmentSlots(false, EQUIP_ID_MAIN_HAND, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); @@ -673,7 +674,7 @@ public: Timer[EVENT_TALK_SEQUENCE] = 100; me->RemoveAllAuras(); me->InterruptNonMeleeSpells(false); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); me->GetMotionMaster()->Clear(false); me->AttackStop(); break; @@ -791,99 +792,99 @@ public: { switch (FlightCount) { - case 1: // lift off - me->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); - me->SetDisableGravity(true); - me->StopMoving(); - Talk(SAY_ILLIDAN_TAKEOFF); - Timer[EVENT_FLIGHT_SEQUENCE] = 3000; - break; - case 2: // move to center - me->GetMotionMaster()->MovePoint(0, CENTER_X + 5, CENTER_Y, CENTER_Z); // +5, for SPELL_THROW_GLAIVE bug - Timer[EVENT_FLIGHT_SEQUENCE] = 0; - break; - case 3: // throw one glaive - { - uint8 i=1; - Creature* Glaive = me->SummonCreature(BLADE_OF_AZZINOTH, GlaivePosition[i].x, GlaivePosition[i].y, GlaivePosition[i].z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); - if (Glaive) + case 1: // lift off + me->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); + me->SetDisableGravity(true); + me->StopMoving(); + Talk(SAY_ILLIDAN_TAKEOFF); + Timer[EVENT_FLIGHT_SEQUENCE] = 3000; + break; + case 2: // move to center + me->GetMotionMaster()->MovePoint(0, CENTER_X + 5, CENTER_Y, CENTER_Z); // +5, for SPELL_THROW_GLAIVE bug + Timer[EVENT_FLIGHT_SEQUENCE] = 0; + break; + case 3: // throw one glaive { - GlaiveGUID[i] = Glaive->GetGUID(); - Glaive->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - Glaive->SetDisplayId(MODEL_INVISIBLE); - Glaive->setFaction(me->getFaction()); - DoCast(Glaive, SPELL_THROW_GLAIVE2); + uint8 i=1; + Creature* Glaive = me->SummonCreature(BLADE_OF_AZZINOTH, GlaivePosition[i].x, GlaivePosition[i].y, GlaivePosition[i].z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); + if (Glaive) + { + GlaiveGUID[i] = Glaive->GetGUID(); + Glaive->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + Glaive->SetDisplayId(MODEL_INVISIBLE); + Glaive->setFaction(me->getFaction()); + DoCast(Glaive, SPELL_THROW_GLAIVE2); + } } - } - Timer[EVENT_FLIGHT_SEQUENCE] = 700; - break; - case 4: // throw another - SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); - { - uint8 i=0; - Creature* Glaive = me->SummonCreature(BLADE_OF_AZZINOTH, GlaivePosition[i].x, GlaivePosition[i].y, GlaivePosition[i].z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); - if (Glaive) + Timer[EVENT_FLIGHT_SEQUENCE] = 700; + break; + case 4: // throw another + SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); { - GlaiveGUID[i] = Glaive->GetGUID(); - Glaive->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - Glaive->SetDisplayId(MODEL_INVISIBLE); - Glaive->setFaction(me->getFaction()); - DoCast(Glaive, SPELL_THROW_GLAIVE, true); + uint8 i=0; + Creature* Glaive = me->SummonCreature(BLADE_OF_AZZINOTH, GlaivePosition[i].x, GlaivePosition[i].y, GlaivePosition[i].z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); + if (Glaive) + { + GlaiveGUID[i] = Glaive->GetGUID(); + Glaive->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + Glaive->SetDisplayId(MODEL_INVISIBLE); + Glaive->setFaction(me->getFaction()); + DoCast(Glaive, SPELL_THROW_GLAIVE, true); + } } - } - Timer[EVENT_FLIGHT_SEQUENCE] = 5000; - break; - case 5: // summon flames - SummonFlamesOfAzzinoth(); - Timer[EVENT_FLIGHT_SEQUENCE] = 3000; - break; - case 6: // fly to hover point - me->GetMotionMaster()->MovePoint(0, HoverPosition[HoverPoint].x, HoverPosition[HoverPoint].y, HoverPosition[HoverPoint].z); - Timer[EVENT_FLIGHT_SEQUENCE] = 0; - break; - case 7: // return to center - me->GetMotionMaster()->MovePoint(0, CENTER_X, CENTER_Y, CENTER_Z); - Timer[EVENT_FLIGHT_SEQUENCE] = 0; - break; - case 8: // glaive return - for (uint8 i = 0; i < 2; ++i) - { - if (GlaiveGUID[i]) + Timer[EVENT_FLIGHT_SEQUENCE] = 5000; + break; + case 5: // summon flames + SummonFlamesOfAzzinoth(); + Timer[EVENT_FLIGHT_SEQUENCE] = 3000; + break; + case 6: // fly to hover point + me->GetMotionMaster()->MovePoint(0, HoverPosition[HoverPoint].x, HoverPosition[HoverPoint].y, HoverPosition[HoverPoint].z); + Timer[EVENT_FLIGHT_SEQUENCE] = 0; + break; + case 7: // return to center + me->GetMotionMaster()->MovePoint(0, CENTER_X, CENTER_Y, CENTER_Z); + Timer[EVENT_FLIGHT_SEQUENCE] = 0; + break; + case 8: // glaive return + for (uint8 i = 0; i < 2; ++i) { - Unit* Glaive = ObjectAccessor::GetUnit(*me, GlaiveGUID[i]); - if (Glaive) + if (GlaiveGUID[i]) { - Glaive->CastSpell(me, SPELL_GLAIVE_RETURNS, false); // Make it look like the Glaive flies back up to us - Glaive->SetDisplayId(MODEL_INVISIBLE); // disappear but not die for now + Unit* Glaive = ObjectAccessor::GetUnit(*me, GlaiveGUID[i]); + if (Glaive) + { + Glaive->CastSpell(me, SPELL_GLAIVE_RETURNS, false); // Make it look like the Glaive flies back up to us + Glaive->SetDisplayId(MODEL_INVISIBLE); // disappear but not die for now + } } } - } - Timer[EVENT_FLIGHT_SEQUENCE] = 2000; - break; - case 9: // land - me->SetDisableGravity(false); - me->StopMoving(); - me->HandleEmoteCommand(EMOTE_ONESHOT_LAND); - for (uint8 i = 0; i < 2; ++i) - { - if (GlaiveGUID[i]) + Timer[EVENT_FLIGHT_SEQUENCE] = 2000; + break; + case 9: // land + me->SetDisableGravity(false); + me->StopMoving(); + me->HandleEmoteCommand(EMOTE_ONESHOT_LAND); + for (uint8 i = 0; i < 2; ++i) { - if (Creature* glaive = ObjectAccessor::GetCreature(*me, GlaiveGUID[i])) - glaive->DespawnOrUnsummon(); + if (GlaiveGUID[i]) + { + if (Creature* glaive = ObjectAccessor::GetCreature(*me, GlaiveGUID[i])) + glaive->DespawnOrUnsummon(); - GlaiveGUID[i].Clear(); + GlaiveGUID[i].Clear(); + } } - } - Timer[EVENT_FLIGHT_SEQUENCE] = 2000; - break; - case 10: // attack - DoResetThreat(); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE); - me->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE); - EnterPhase(PHASE_NORMAL_2); - break; - default: - break; + Timer[EVENT_FLIGHT_SEQUENCE] = 2000; + break; + case 10: // attack + DoResetThreat(); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE); + me->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE); + EnterPhase(PHASE_NORMAL_2); + break; + default: + break; } ++FlightCount; } @@ -913,23 +914,23 @@ public: switch (TransformCount) { - case 2: - DoResetThreat(); - break; - case 4: - EnterPhase(PHASE_DEMON); - break; - case 7: - DoResetThreat(); - break; - case 9: - if (MaievGUID) - EnterPhase(PHASE_NORMAL_MAIEV); // Depending on whether we summoned Maiev, we switch to either phase 5 or 3 - else - EnterPhase(PHASE_NORMAL_2); - break; - default: - break; + case 2: + DoResetThreat(); + break; + case 4: + EnterPhase(PHASE_DEMON); + break; + case 7: + DoResetThreat(); + break; + case 9: + if (MaievGUID) + EnterPhase(PHASE_NORMAL_MAIEV); // Depending on whether we summoned Maiev, we switch to either phase 5 or 3 + else + EnterPhase(PHASE_NORMAL_2); + break; + default: + break; } if (Phase == PHASE_TRANSFORM_SEQUENCE) Timer[EVENT_TRANSFORM_SEQUENCE] = DemonTransformation[TransformCount].timer; @@ -957,37 +958,37 @@ public: switch (Phase) { - case PHASE_NORMAL: - if (HealthBelowPct(65)) - EnterPhase(PHASE_FLIGHT_SEQUENCE); - break; + case PHASE_NORMAL: + if (HealthBelowPct(65)) + EnterPhase(PHASE_FLIGHT_SEQUENCE); + break; - case PHASE_NORMAL_2: - if (HealthBelowPct(30)) - EnterPhase(PHASE_TALK_SEQUENCE); - break; + case PHASE_NORMAL_2: + if (HealthBelowPct(30)) + EnterPhase(PHASE_TALK_SEQUENCE); + break; - case PHASE_NORMAL_MAIEV: - if (HealthBelowPct(1)) - EnterPhase(PHASE_TALK_SEQUENCE); - break; + case PHASE_NORMAL_MAIEV: + if (HealthBelowPct(1)) + EnterPhase(PHASE_TALK_SEQUENCE); + break; - case PHASE_TALK_SEQUENCE: - if (Event == EVENT_TALK_SEQUENCE) - HandleTalkSequence(); - break; + case PHASE_TALK_SEQUENCE: + if (Event == EVENT_TALK_SEQUENCE) + HandleTalkSequence(); + break; - case PHASE_FLIGHT_SEQUENCE: - if (Event == EVENT_FLIGHT_SEQUENCE) - HandleFlightSequence(); - break; + case PHASE_FLIGHT_SEQUENCE: + if (Event == EVENT_FLIGHT_SEQUENCE) + HandleFlightSequence(); + break; - case PHASE_TRANSFORM_SEQUENCE: - if (Event == EVENT_TRANSFORM_SEQUENCE) - HandleTransformSequence(); - break; - default: - break; + case PHASE_TRANSFORM_SEQUENCE: + if (Event == EVENT_TRANSFORM_SEQUENCE) + HandleTransformSequence(); + break; + default: + break; } if (me->IsNonMeleeSpellCast(false)) @@ -998,63 +999,63 @@ public: switch (Event) { // PHASE_NORMAL - case EVENT_BERSERK: - Talk(SAY_ILLIDAN_ENRAGE); - DoCast(me, SPELL_BERSERK, true); - Timer[EVENT_BERSERK] = 5000; // The buff actually lasts forever. - break; - - case EVENT_TAUNT: - Talk(SAY_ILLIDAN_TAUNT); - Timer[EVENT_TAUNT] = urand(25000, 35000); - break; - - case EVENT_SHEAR: - // no longer exists in 3.0f.2 - // DoCastVictim(SPELL_SHEAR); - Timer[EVENT_SHEAR] = 25000 + (rand32() % 16 * 1000); - break; - - case EVENT_FLAME_CRASH: - DoCastVictim(SPELL_FLAME_CRASH); - Timer[EVENT_FLAME_CRASH] = urand(30000, 40000); - break; - - case EVENT_PARASITIC_SHADOWFIEND: - { - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 200, true)) - DoCast(target, SPELL_PARASITIC_SHADOWFIEND, true); - Timer[EVENT_PARASITIC_SHADOWFIEND] = urand(35000, 45000); - } - break; - - case EVENT_PARASITE_CHECK: - Timer[EVENT_PARASITE_CHECK] = 0; - break; - - case EVENT_DRAW_SOUL: - DoCastVictim(SPELL_DRAW_SOUL); - Timer[EVENT_DRAW_SOUL] = urand(50000, 60000); - break; - - // PHASE_NORMAL_2 - case EVENT_AGONIZING_FLAMES: - DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0), SPELL_AGONIZING_FLAMES); - Timer[EVENT_AGONIZING_FLAMES] = 0; - break; - - case EVENT_TRANSFORM_NORMAL: - EnterPhase(PHASE_TRANSFORM_SEQUENCE); - break; - - // PHASE_NORMAL_MAIEV - case EVENT_ENRAGE: - DoCast(me, SPELL_ENRAGE); - Timer[EVENT_ENRAGE] = 0; - break; - - default: - break; + case EVENT_BERSERK: + Talk(SAY_ILLIDAN_ENRAGE); + DoCast(me, SPELL_BERSERK, true); + Timer[EVENT_BERSERK] = 5000; // The buff actually lasts forever. + break; + + case EVENT_TAUNT: + Talk(SAY_ILLIDAN_TAUNT); + Timer[EVENT_TAUNT] = urand(25000, 35000); + break; + + case EVENT_SHEAR: + // no longer exists in 3.0f.2 + // DoCastVictim(SPELL_SHEAR); + Timer[EVENT_SHEAR] = 25000 + (rand32() % 16 * 1000); + break; + + case EVENT_FLAME_CRASH: + DoCastVictim(SPELL_FLAME_CRASH); + Timer[EVENT_FLAME_CRASH] = urand(30000, 40000); + break; + + case EVENT_PARASITIC_SHADOWFIEND: + { + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 200, true)) + DoCast(target, SPELL_PARASITIC_SHADOWFIEND, true); + Timer[EVENT_PARASITIC_SHADOWFIEND] = urand(35000, 45000); + } + break; + + case EVENT_PARASITE_CHECK: + Timer[EVENT_PARASITE_CHECK] = 0; + break; + + case EVENT_DRAW_SOUL: + DoCastVictim(SPELL_DRAW_SOUL); + Timer[EVENT_DRAW_SOUL] = urand(50000, 60000); + break; + + // PHASE_NORMAL_2 + case EVENT_AGONIZING_FLAMES: + DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0), SPELL_AGONIZING_FLAMES); + Timer[EVENT_AGONIZING_FLAMES] = 0; + break; + + case EVENT_TRANSFORM_NORMAL: + EnterPhase(PHASE_TRANSFORM_SEQUENCE); + break; + + // PHASE_NORMAL_MAIEV + case EVENT_ENRAGE: + DoCast(me, SPELL_ENRAGE); + Timer[EVENT_ENRAGE] = 0; + break; + + default: + break; } DoMeleeAttackIfReady(); } @@ -1063,32 +1064,32 @@ public: { switch (Event) { - case EVENT_FIREBALL: - DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0), SPELL_FIREBALL); - Timer[EVENT_FIREBALL] = 3000; - break; - - case EVENT_DARK_BARRAGE: - DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0), SPELL_DARK_BARRAGE); - Timer[EVENT_DARK_BARRAGE] = 0; - break; - - case EVENT_EYE_BLAST: - CastEyeBlast(); - Timer[EVENT_EYE_BLAST] = 0; - break; - - case EVENT_MOVE_POINT: - Phase = PHASE_FLIGHT_SEQUENCE; - Timer[EVENT_FLIGHT_SEQUENCE] = 0; // do not start Event when changing hover point - HoverPoint += (rand32() % 3 + 1); - if (HoverPoint > 3) - HoverPoint -= 4; - me->GetMotionMaster()->MovePoint(0, HoverPosition[HoverPoint].x, HoverPosition[HoverPoint].y, HoverPosition[HoverPoint].z); - break; - - default: - break; + case EVENT_FIREBALL: + DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0), SPELL_FIREBALL); + Timer[EVENT_FIREBALL] = 3000; + break; + + case EVENT_DARK_BARRAGE: + DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0), SPELL_DARK_BARRAGE); + Timer[EVENT_DARK_BARRAGE] = 0; + break; + + case EVENT_EYE_BLAST: + CastEyeBlast(); + Timer[EVENT_EYE_BLAST] = 0; + break; + + case EVENT_MOVE_POINT: + Phase = PHASE_FLIGHT_SEQUENCE; + Timer[EVENT_FLIGHT_SEQUENCE] = 0; // do not start Event when changing hover point + HoverPoint += (rand32() % 3 + 1); + if (HoverPoint > 3) + HoverPoint -= 4; + me->GetMotionMaster()->MovePoint(0, HoverPosition[HoverPoint].x, HoverPosition[HoverPoint].y, HoverPosition[HoverPoint].z); + break; + + default: + break; } } @@ -1096,29 +1097,29 @@ public: { switch (Event) { - case EVENT_SHADOW_BLAST: - me->GetMotionMaster()->Clear(false); - if (me->GetVictim() && (!me->IsWithinDistInMap(me->GetVictim(), 50) || !me->IsWithinLOSInMap(me->GetVictim()))) - me->GetMotionMaster()->MoveChase(me->GetVictim(), 30); - else - me->GetMotionMaster()->MoveIdle(); - DoCastVictim(SPELL_SHADOW_BLAST); - Timer[EVENT_SHADOW_BLAST] = 4000; - break; - case EVENT_SHADOWDEMON: - DoCast(me, SPELL_SUMMON_SHADOWDEMON); - Timer[EVENT_SHADOWDEMON] = 0; - Timer[EVENT_FLAME_BURST] += 10000; - break; - case EVENT_FLAME_BURST: - DoCast(me, SPELL_FLAME_BURST); - Timer[EVENT_FLAME_BURST] = 15000; - break; - case EVENT_TRANSFORM_DEMON: - EnterPhase(PHASE_TRANSFORM_SEQUENCE); - break; - default: - break; + case EVENT_SHADOW_BLAST: + me->GetMotionMaster()->Clear(false); + if (me->GetVictim() && (!me->IsWithinDistInMap(me->GetVictim(), 50) || !me->IsWithinLOSInMap(me->GetVictim()))) + me->GetMotionMaster()->MoveChase(me->GetVictim(), 30); + else + me->GetMotionMaster()->MoveIdle(); + DoCastVictim(SPELL_SHADOW_BLAST); + Timer[EVENT_SHADOW_BLAST] = 4000; + break; + case EVENT_SHADOWDEMON: + DoCast(me, SPELL_SUMMON_SHADOWDEMON); + Timer[EVENT_SHADOWDEMON] = 0; + Timer[EVENT_FLAME_BURST] += 10000; + break; + case EVENT_FLAME_BURST: + DoCast(me, SPELL_FLAME_BURST); + Timer[EVENT_FLAME_BURST] = 15000; + break; + case EVENT_TRANSFORM_DEMON: + EnterPhase(PHASE_TRANSFORM_SEQUENCE); + break; + default: + break; } } } @@ -1148,7 +1149,7 @@ public: /********************************** End of Illidan AI* *****************************************/ -/******* Functions and vars for Akama's AI* *****/ +/******* Functions and vars for Maiev's AI* *****/ class boss_maiev_shadowsong : public CreatureScript { public: @@ -1377,6 +1378,7 @@ public: } }; +/******* Functions and vars for Akama's AI* *****/ class npc_akama_illidan : public CreatureScript { public: diff --git a/src/server/scripts/Outland/zone_shadowmoon_valley.cpp b/src/server/scripts/Outland/zone_shadowmoon_valley.cpp index 7ea87a3c0c4..c6815c3be42 100644 --- a/src/server/scripts/Outland/zone_shadowmoon_valley.cpp +++ b/src/server/scripts/Outland/zone_shadowmoon_valley.cpp @@ -90,8 +90,10 @@ public: void SummonInfernal() { - Creature* infernal = me->SummonCreature(NPC_INFERNAL_ATTACKER, me->GetPositionX(), me->GetPositionY(), ground + 0.05f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000); - infernalGUID = infernal->GetGUID(); + if (Creature* infernal = me->SummonCreature(NPC_INFERNAL_ATTACKER, me->GetPositionX(), me->GetPositionY(), ground + 0.05f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000)) + infernalGUID = infernal->GetGUID(); + else + infernalGUID = ObjectGuid::Empty; } void UpdateAI(uint32 diff) override diff --git a/src/server/worldserver/Main.cpp b/src/server/worldserver/Main.cpp index f4d736ac675..0241221a2ac 100644 --- a/src/server/worldserver/Main.cpp +++ b/src/server/worldserver/Main.cpp @@ -52,6 +52,7 @@ #include "Realm/Realm.h" #include "DatabaseLoader.h" #include "AppenderDB.h" +#include "Metric.h" using namespace boost::program_options; namespace fs = boost::filesystem; @@ -196,6 +197,13 @@ extern int main(int argc, char** argv) LoadRealmInfo(); + sMetric->Initialize(realm.Name, _ioService, []() + { + TC_METRIC_VALUE("online_players", sWorld->GetPlayerCount()); + }); + + TC_METRIC_EVENT("events", "Worldserver started", ""); + // Initialize the World sScriptMgr->SetScriptLoader(AddScripts); sWorld->SetInitialWorldSettings(); @@ -295,6 +303,9 @@ extern int main(int argc, char** argv) StopDB(); + TC_METRIC_EVENT("events", "Worldserver shutdown", ""); + sMetric->ForceSend(); + TC_LOG_INFO("server.worldserver", "Halting process..."); ShutdownCLIThread(cliThread); diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist index e620404e91a..b832d0e8224 100644 --- a/src/server/worldserver/worldserver.conf.dist +++ b/src/server/worldserver/worldserver.conf.dist @@ -34,6 +34,7 @@ # AUCTION HOUSE BOT BUYER CONFIG # LOGGING SYSTEM SETTINGS # PACKET SPOOF PROTECTION SETTINGS +# METRIC SETTINGS # ################################################################################################### @@ -3700,3 +3701,42 @@ PacketSpoof.BanDuration = 86400 # ################################################################################################### + +################################################################################################### +# METRIC SETTINGS +# +# These settings control the statistics sent to the metric database (currently InfluxDB) +# +# Metric.Enable +# Description: Enables statistics sent to the metric database. +# Default: 0 - (Disabled) +# 1 - (Enabled) + +Metric.Enable = 0 + +# +# Metric.Interval +# Description: Interval between every batch of data sent in seconds +# Default: 10 seconds +# + +Metric.Interval = 10 + +# +# Metric.ConnectionInfo +# Description: Connection settings for metric database (currently InfluxDB). +# Example: "hostname;port;database" +# Default: "127.0.0.1;8086;worldserver" + +Metric.ConnectionInfo = "127.0.0.1;8086;worldserver" + +# +# Metric.OverallStatusInterval +# Description: Interval between every gathering of overall worldserver status data in seconds +# Default: 1 second +# + +Metric.OverallStatusInterval = 1 + +# +################################################################################################### |
