mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 13:37:05 +00:00
[9095] Allow apply .modify scale to targeted creature (without save scale).
Also add command description to mangos.sql. Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
15193ab9c3
commit
65c12d4998
6 changed files with 26 additions and 15 deletions
|
|
@ -24,7 +24,7 @@ CREATE TABLE `db_version` (
|
|||
`version` varchar(120) default NULL,
|
||||
`creature_ai_version` varchar(120) default NULL,
|
||||
`cache_id` int(10) default '0',
|
||||
`required_9074_01_mangos_command` bit(1) default NULL
|
||||
`required_9095_01_mangos_command` bit(1) default NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes';
|
||||
|
||||
--
|
||||
|
|
@ -662,7 +662,7 @@ INSERT INTO `command` VALUES
|
|||
('modify rage',1,'Syntax: .modify rage #newrage\r\n\r\nModify the rage of the selected player. If no player is selected, modify your rage.'),
|
||||
('modify rep',2,'Syntax: .modify rep #repId (#repvalue | $rankname [#delta])\r\nSets the selected players reputation with faction #repId to #repvalue or to $reprank.\r\nIf the reputation rank name is provided, the resulting reputation will be the lowest reputation for that rank plus the delta amount, if specified.\r\nYou can use \'.pinfo rep\' to list all known reputation ids, or use \'.lookup faction $name\' to locate a specific faction id.'),
|
||||
('modify runicpower',1,'Syntax: .modify runicpower #newrunicpower\r\n\r\nModify the runic power of the selected player. If no player is selected, modify your runic power.'),
|
||||
('modify scale',1,''),
|
||||
('modify scale',1,'Syntax: .modify scale #scale\r\n\r\nChange model scale for targeted player (util relogin) or creature (until respawn).'),
|
||||
('modify speed',1,'Syntax: .modify speed #rate\r\n.speed #rate\r\n\r\nModify the running speed of the selected player to \"normal base run speed\"*rate. If no player is selected, modify your speed.\r\n\r\n #rate may range from 0.1 to 10.'),
|
||||
('modify spell',1,''),
|
||||
('modify standstate',2,'Syntax: .modify standstate #emoteid\r\n\r\nChange the emote of your character while standing to #emoteid.'),
|
||||
|
|
|
|||
6
sql/updates/9095_01_mangos_command.sql
Normal file
6
sql/updates/9095_01_mangos_command.sql
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
ALTER TABLE db_version CHANGE COLUMN required_9074_01_mangos_command required_9095_01_mangos_command bit;
|
||||
|
||||
DELETE FROM command where name IN ('modify scale');
|
||||
|
||||
INSERT INTO `command` VALUES
|
||||
('modify scale',1,'Syntax: .modify scale #scale\r\n\r\nChange model scale for targeted player (util relogin) or creature (until respawn).');
|
||||
|
|
@ -224,6 +224,7 @@ pkgdata_DATA = \
|
|||
9068_02_mangos_spell_chain.sql \
|
||||
9070_01_mangos_spell_proc_event.sql \
|
||||
9074_01_mangos_command.sql \
|
||||
9095_01_mangos_command.sql \
|
||||
README
|
||||
|
||||
## Additional files to include when running 'make dist'
|
||||
|
|
@ -428,4 +429,5 @@ EXTRA_DIST = \
|
|||
9068_02_mangos_spell_chain.sql \
|
||||
9070_01_mangos_spell_proc_event.sql \
|
||||
9074_01_mangos_command.sql \
|
||||
9095_01_mangos_command.sql \
|
||||
README
|
||||
|
|
|
|||
|
|
@ -1320,30 +1320,33 @@ bool ChatHandler::HandleModifyScaleCommand(const char* args)
|
|||
return false;
|
||||
|
||||
float Scale = (float)atof((char*)args);
|
||||
if (Scale > 3.0f || Scale <= 0.0f)
|
||||
if (Scale > 10.0f || Scale <= 0.0f)
|
||||
{
|
||||
SendSysMessage(LANG_BAD_VALUE);
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
Player *chr = getSelectedPlayer();
|
||||
if (chr == NULL)
|
||||
Unit *target = getSelectedUnit();
|
||||
if (target == NULL)
|
||||
{
|
||||
SendSysMessage(LANG_NO_CHAR_SELECTED);
|
||||
SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(chr, 0))
|
||||
return false;
|
||||
if (target->GetTypeId()==TYPEID_PLAYER)
|
||||
{
|
||||
// check online security
|
||||
if (HasLowerSecurity((Player*)target, 0))
|
||||
return false;
|
||||
|
||||
PSendSysMessage(LANG_YOU_CHANGE_SIZE, Scale, GetNameLink(chr).c_str());
|
||||
if (needReportToTarget(chr))
|
||||
ChatHandler(chr).PSendSysMessage(LANG_YOURS_SIZE_CHANGED, GetNameLink().c_str(), Scale);
|
||||
PSendSysMessage(LANG_YOU_CHANGE_SIZE, Scale, GetNameLink((Player*)target).c_str());
|
||||
if (needReportToTarget((Player*)target))
|
||||
ChatHandler((Player*)target).PSendSysMessage(LANG_YOURS_SIZE_CHANGED, GetNameLink().c_str(), Scale);
|
||||
}
|
||||
|
||||
chr->SetFloatValue(OBJECT_FIELD_SCALE_X, Scale);
|
||||
target->SetFloatValue(OBJECT_FIELD_SCALE_X, Scale);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "9094"
|
||||
#define REVISION_NR "9095"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef __REVISION_SQL_H__
|
||||
#define __REVISION_SQL_H__
|
||||
#define REVISION_DB_CHARACTERS "required_8874_01_characters_character_skills"
|
||||
#define REVISION_DB_MANGOS "required_9074_01_mangos_command"
|
||||
#define REVISION_DB_MANGOS "required_9095_01_mangos_command"
|
||||
#define REVISION_DB_REALMD "required_9010_01_realmd_realmlist"
|
||||
#endif // __REVISION_SQL_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue