mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
[11214] Implement .debug spellcoefs command
Command show default calculated and DB stored coefficients for spell direct/dot heal/damage.
This commit is contained in:
parent
ceaca46604
commit
9312ef7e78
9 changed files with 85 additions and 4 deletions
|
|
@ -24,7 +24,7 @@ CREATE TABLE `db_version` (
|
||||||
`version` varchar(120) default NULL,
|
`version` varchar(120) default NULL,
|
||||||
`creature_ai_version` varchar(120) default NULL,
|
`creature_ai_version` varchar(120) default NULL,
|
||||||
`cache_id` int(10) default '0',
|
`cache_id` int(10) default '0',
|
||||||
`required_11205_01_mangos_spell_proc_event` bit(1) default NULL
|
`required_11214_02_mangos_command` bit(1) default NULL
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes';
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes';
|
||||||
|
|
||||||
--
|
--
|
||||||
|
|
@ -552,6 +552,7 @@ INSERT INTO `command` VALUES
|
||||||
('debug play sound',1,'Syntax: .debug play sound #soundid\r\n\r\nPlay sound with #soundid.\r\nSound will be play only for you. Other players do not hear this.\r\nWarning: client may have more 5000 sounds...'),
|
('debug play sound',1,'Syntax: .debug play sound #soundid\r\n\r\nPlay sound with #soundid.\r\nSound will be play only for you. Other players do not hear this.\r\nWarning: client may have more 5000 sounds...'),
|
||||||
('debug setitemvalue',3,'Syntax: .debug setitemvalue #guid #field [int|hex|bit|float] #value\r\n\r\nSet the field #field of the item #itemguid in your inventroy to value #value.\r\n\r\nUse type arg for set input format: int (decimal number), hex (hex value), bit (bitstring), float. By default expect integer input format.'),
|
('debug setitemvalue',3,'Syntax: .debug setitemvalue #guid #field [int|hex|bit|float] #value\r\n\r\nSet the field #field of the item #itemguid in your inventroy to value #value.\r\n\r\nUse type arg for set input format: int (decimal number), hex (hex value), bit (bitstring), float. By default expect integer input format.'),
|
||||||
('debug setvalue',3,'Syntax: .debug setvalue #field [int|hex|bit|float] #value\r\n\r\nSet the field #field of the selected target to value #value. If no target is selected, set the content of your field.\r\n\r\nUse type arg for set input format: int (decimal number), hex (hex value), bit (bitstring), float. By default expect integer input format.'),
|
('debug setvalue',3,'Syntax: .debug setvalue #field [int|hex|bit|float] #value\r\n\r\nSet the field #field of the selected target to value #value. If no target is selected, set the content of your field.\r\n\r\nUse type arg for set input format: int (decimal number), hex (hex value), bit (bitstring), float. By default expect integer input format.'),
|
||||||
|
('debug spellcoefs',3,'Syntax: .debug spellcoefs #pellid\r\n\r\nShow default calculated and DB stored coefficients for direct/dot heal/damage.'),
|
||||||
('debug spellmods',3,'Syntax: .debug spellmods (flat|pct) #spellMaskBitIndex #spellModOp #value\r\n\r\nSet at client side spellmod affect for spell that have bit set with index #spellMaskBitIndex in spell family mask for values dependent from spellmod #spellModOp to #value.'),
|
('debug spellmods',3,'Syntax: .debug spellmods (flat|pct) #spellMaskBitIndex #spellModOp #value\r\n\r\nSet at client side spellmod affect for spell that have bit set with index #spellMaskBitIndex in spell family mask for values dependent from spellmod #spellModOp to #value.'),
|
||||||
('delticket',2,'Syntax: .delticket all\r\n .delticket #num\r\n .delticket $character_name\r\n\rall to dalete all tickets at server, $character_name to delete ticket of this character, #num to delete ticket #num.'),
|
('delticket',2,'Syntax: .delticket all\r\n .delticket #num\r\n .delticket $character_name\r\n\rall to dalete all tickets at server, $character_name to delete ticket of this character, #num to delete ticket #num.'),
|
||||||
('demorph',2,'Syntax: .demorph\r\n\r\nDemorph the selected player.'),
|
('demorph',2,'Syntax: .demorph\r\n\r\nDemorph the selected player.'),
|
||||||
|
|
@ -3859,6 +3860,11 @@ INSERT INTO `mangos_string` VALUES
|
||||||
(1169,'Scripting library build for different mangosd revision.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
(1169,'Scripting library build for different mangosd revision.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||||
(1200,'You try to view cinemitic %u but it doesn\'t exist.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
(1200,'You try to view cinemitic %u but it doesn\'t exist.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||||
(1201,'You try to view movie %u but it doesn\'t exist.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
(1201,'You try to view movie %u but it doesn\'t exist.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||||
|
(1202,'Spell %u %s = %f (*1.88 = %f) DB = %f AP = %f',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||||
|
(1203,'direct heal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||||
|
(1204,'direct damage',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||||
|
(1205,'dot heal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||||
|
(1206,'dot damage',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||||
(1500,'%u - [%s] AutoSpawn: %u MaxLimit: %u Creatures: %u GameObjecs: %u Pools %u Chance: %f %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
(1500,'%u - [%s] AutoSpawn: %u MaxLimit: %u Creatures: %u GameObjecs: %u Pools %u Chance: %f %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||||
(1501,'%u - |cffffffff|Hpool:%u|h[%s]|h|r AutoSpawn: %u MaxLimit: %u Creatures: %u GameObjecs: %u Pools %u %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
(1501,'%u - |cffffffff|Hpool:%u|h[%s]|h|r AutoSpawn: %u MaxLimit: %u Creatures: %u GameObjecs: %u Pools %u %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||||
(1502,'%u - [%s] AutoSpawn: %u MaxLimit: %u Creatures: %u GameObjecs: %u Pools %u %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
|
(1502,'%u - [%s] AutoSpawn: %u MaxLimit: %u Creatures: %u GameObjecs: %u Pools %u %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
|
||||||
|
|
|
||||||
10
sql/updates/11214_01_mangos_mangos_string.sql
Normal file
10
sql/updates/11214_01_mangos_mangos_string.sql
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
ALTER TABLE db_version CHANGE COLUMN required_11205_01_mangos_spell_proc_event required_11214_01_mangos_mangos_string bit;
|
||||||
|
|
||||||
|
DELETE FROM mangos_string WHERE entry IN (1202,1203,1204,1205,1206);
|
||||||
|
|
||||||
|
INSERT INTO mangos_string VALUES
|
||||||
|
(1202,'Spell %u %s = %f (*1.88 = %f) DB = %f AP = %f',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||||
|
(1203,'direct heal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||||
|
(1204,'direct damage',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||||
|
(1205,'dot heal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||||
|
(1206,'dot damage',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
|
||||||
7
sql/updates/11214_02_mangos_command.sql
Normal file
7
sql/updates/11214_02_mangos_command.sql
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
ALTER TABLE db_version CHANGE COLUMN required_11214_01_mangos_mangos_string required_11214_02_mangos_command bit;
|
||||||
|
|
||||||
|
DELETE FROM command WHERE name = 'debug spellcoefs';
|
||||||
|
|
||||||
|
INSERT INTO command (name, security, help) VALUES
|
||||||
|
('debug spellcoefs',3,'Syntax: .debug spellcoefs #pellid\r\n\r\nShow default calculated and DB stored coefficients for direct/dot heal/damage.');
|
||||||
|
|
||||||
|
|
@ -211,6 +211,7 @@ ChatCommand * ChatHandler::getCommandTable()
|
||||||
{ "setitemvalue", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSetItemValueCommand, "", NULL },
|
{ "setitemvalue", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSetItemValueCommand, "", NULL },
|
||||||
{ "setvalue", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSetValueCommand, "", NULL },
|
{ "setvalue", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSetValueCommand, "", NULL },
|
||||||
{ "spellcheck", SEC_CONSOLE, true, &ChatHandler::HandleDebugSpellCheckCommand, "", NULL },
|
{ "spellcheck", SEC_CONSOLE, true, &ChatHandler::HandleDebugSpellCheckCommand, "", NULL },
|
||||||
|
{ "spellcoefs", SEC_ADMINISTRATOR, true, &ChatHandler::HandleDebugSpellCoefsCommand, "", NULL },
|
||||||
{ "spellmods", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSpellModsCommand, "", NULL },
|
{ "spellmods", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSpellModsCommand, "", NULL },
|
||||||
{ "spawnvehicle", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSpawnVehicleCommand, "", NULL },
|
{ "spawnvehicle", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSpawnVehicleCommand, "", NULL },
|
||||||
{ "uws", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugUpdateWorldStateCommand, "", NULL },
|
{ "uws", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugUpdateWorldStateCommand, "", NULL },
|
||||||
|
|
|
||||||
|
|
@ -189,6 +189,7 @@ class ChatHandler
|
||||||
bool HandleDebugSetValueCommand(char* args);
|
bool HandleDebugSetValueCommand(char* args);
|
||||||
bool HandleDebugSpawnVehicleCommand(char* args);
|
bool HandleDebugSpawnVehicleCommand(char* args);
|
||||||
bool HandleDebugSpellCheckCommand(char* args);
|
bool HandleDebugSpellCheckCommand(char* args);
|
||||||
|
bool HandleDebugSpellCoefsCommand(char* args);
|
||||||
bool HandleDebugSpellModsCommand(char* args);
|
bool HandleDebugSpellModsCommand(char* args);
|
||||||
bool HandleDebugUpdateWorldStateCommand(char* args);
|
bool HandleDebugUpdateWorldStateCommand(char* args);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -920,7 +920,12 @@ enum MangosStrings
|
||||||
// Debug commands
|
// Debug commands
|
||||||
LANG_CINEMATIC_NOT_EXIST = 1200,
|
LANG_CINEMATIC_NOT_EXIST = 1200,
|
||||||
LANG_MOVIE_NOT_EXIST = 1201,
|
LANG_MOVIE_NOT_EXIST = 1201,
|
||||||
// Room for more debug 1202-1299 not used
|
LANG_SPELLCOEFS = 1202,
|
||||||
|
LANG_DIRECT_HEAL = 1203,
|
||||||
|
LANG_DIRECT_DAMAGE = 1204,
|
||||||
|
LANG_DOT_HEAL = 1205,
|
||||||
|
LANG_DOT_DAMAGE = 1206,
|
||||||
|
// Room for more debug 1207-1299 not used
|
||||||
|
|
||||||
// Reserved for old client release branches specific strings
|
// Reserved for old client release branches specific strings
|
||||||
// Room for old clients 2.x 1300-1399 not used
|
// Room for old clients 2.x 1300-1399 not used
|
||||||
|
|
|
||||||
|
|
@ -1085,6 +1085,57 @@ bool ChatHandler::HandleDebugModValueCommand(char* args)
|
||||||
return HandlerDebugModValueHelper(target, field, typeStr, valStr);
|
return HandlerDebugModValueHelper(target, field, typeStr, valStr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ChatHandler::HandleDebugSpellCoefsCommand(char* args)
|
||||||
|
{
|
||||||
|
uint32 spellid = ExtractSpellIdFromLink(&args);
|
||||||
|
if (!spellid)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
SpellEntry const * spellEntry = sSpellStore.LookupEntry(spellid);
|
||||||
|
if (!spellEntry)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
SpellBonusEntry const* bonus = sSpellMgr.GetSpellBonusData(spellid);
|
||||||
|
|
||||||
|
float direct_calc = CalculateDefaultCoefficient(spellEntry, SPELL_DIRECT_DAMAGE);
|
||||||
|
float dot_calc = CalculateDefaultCoefficient(spellEntry, DOT);
|
||||||
|
|
||||||
|
bool isDirectHeal = false;
|
||||||
|
for(int i = 0; i < 3; ++i)
|
||||||
|
{
|
||||||
|
// Heals (Also count Mana Shield and Absorb effects as heals)
|
||||||
|
if (spellEntry->Effect[i] == SPELL_EFFECT_HEAL || spellEntry->Effect[i] == SPELL_EFFECT_HEAL_MAX_HEALTH ||
|
||||||
|
(spellEntry->Effect[i] == SPELL_EFFECT_APPLY_AURA && (spellEntry->EffectApplyAuraName[i] == SPELL_AURA_SCHOOL_ABSORB || spellEntry->EffectApplyAuraName[i] == SPELL_AURA_PERIODIC_HEAL)) )
|
||||||
|
{
|
||||||
|
isDirectHeal = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool isDotHeal = false;
|
||||||
|
for(int i = 0; i < 3; ++i)
|
||||||
|
{
|
||||||
|
// Periodic Heals
|
||||||
|
if (spellEntry->Effect[i] == SPELL_EFFECT_APPLY_AURA && spellEntry->EffectApplyAuraName[i] == SPELL_AURA_PERIODIC_HEAL)
|
||||||
|
{
|
||||||
|
isDotHeal = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
char const* directHealStr = GetMangosString(LANG_DIRECT_HEAL);
|
||||||
|
char const* directDamageStr = GetMangosString(LANG_DIRECT_DAMAGE);
|
||||||
|
char const* dotHealStr = GetMangosString(LANG_DOT_HEAL);
|
||||||
|
char const* dotDamageStr = GetMangosString(LANG_DOT_DAMAGE);
|
||||||
|
|
||||||
|
PSendSysMessage(LANG_SPELLCOEFS, spellid, isDirectHeal ? directHealStr : directDamageStr,
|
||||||
|
direct_calc, direct_calc * 1.88f, bonus ? bonus->direct_damage : 0.0f, bonus ? bonus->ap_bonus : 0.0f);
|
||||||
|
PSendSysMessage(LANG_SPELLCOEFS, spellid, isDotHeal ? dotHealStr : dotDamageStr,
|
||||||
|
dot_calc, dot_calc * 1.88f, bonus ? bonus->dot_damage : 0.0f, bonus ? bonus->ap_dot_bonus : 0.0f);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
bool ChatHandler::HandleDebugSpellModsCommand(char* args)
|
bool ChatHandler::HandleDebugSpellModsCommand(char* args)
|
||||||
{
|
{
|
||||||
char* typeStr = ExtractLiteralArg(&args);
|
char* typeStr = ExtractLiteralArg(&args);
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "11213"
|
#define REVISION_NR "11214"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
#ifndef __REVISION_SQL_H__
|
#ifndef __REVISION_SQL_H__
|
||||||
#define __REVISION_SQL_H__
|
#define __REVISION_SQL_H__
|
||||||
#define REVISION_DB_CHARACTERS "required_11117_02_characters_world"
|
#define REVISION_DB_CHARACTERS "required_11117_02_characters_world"
|
||||||
#define REVISION_DB_MANGOS "required_11205_01_mangos_spell_proc_event"
|
#define REVISION_DB_MANGOS "required_11214_02_mangos_command"
|
||||||
#define REVISION_DB_REALMD "required_10008_01_realmd_realmd_db_version"
|
#define REVISION_DB_REALMD "required_10008_01_realmd_realmd_db_version"
|
||||||
#endif // __REVISION_SQL_H__
|
#endif // __REVISION_SQL_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue