mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
[8071] Restore work .modify tp command. Allow apply it to selected character's pet.
This commit is contained in:
parent
7175007aba
commit
f34ce077c0
5 changed files with 42 additions and 12 deletions
|
|
@ -23,7 +23,7 @@ DROP TABLE IF EXISTS `db_version`;
|
||||||
CREATE TABLE `db_version` (
|
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,
|
||||||
`required_8065_01_mangos_spell_proc_event` bit(1) default NULL
|
`required_8071_01_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';
|
||||||
|
|
||||||
--
|
--
|
||||||
|
|
@ -414,6 +414,7 @@ INSERT INTO `command` VALUES
|
||||||
('modify standstate',2,'Syntax: .modify standstate #emoteid\r\n\r\nChange the emote of your character while standing to #emoteid.'),
|
('modify standstate',2,'Syntax: .modify standstate #emoteid\r\n\r\nChange the emote of your character while standing to #emoteid.'),
|
||||||
('modify swim',1,'Syntax: .modify swim #rate\r\n\r\nModify the swim speed of the selected player to \"normal swim speed\"*rate. If no player is selected, modify your speed.\r\n\r\n #rate may range from 0.1 to 10.'),
|
('modify swim',1,'Syntax: .modify swim #rate\r\n\r\nModify the swim speed of the selected player to \"normal swim speed\"*rate. If no player is selected, modify your speed.\r\n\r\n #rate may range from 0.1 to 10.'),
|
||||||
('modify titles',1,'Syntax: .modify titles #mask\r\n\r\nAllows user to use all titles from #mask.\r\n\r\n #mask=0 disables the title-choose-field'),
|
('modify titles',1,'Syntax: .modify titles #mask\r\n\r\nAllows user to use all titles from #mask.\r\n\r\n #mask=0 disables the title-choose-field'),
|
||||||
|
('modify tp',1,'Syntax: .modify tp #amount\r\n\r\nSet free talent pointes for selected character or character\'s pet. It will be reset to default expected at next levelup/login/quest reward.'),
|
||||||
('movegens',3,'Syntax: .movegens\r\n Show movement generators stack for selected creature or player.'),
|
('movegens',3,'Syntax: .movegens\r\n Show movement generators stack for selected creature or player.'),
|
||||||
('mute',1,'Syntax: .mute [$playerName] $timeInMinutes\r\n\r\nDisible chat messaging for any character from account of character $playerName (or currently selected) at $timeInMinutes minutes. Player can be offline.'),
|
('mute',1,'Syntax: .mute [$playerName] $timeInMinutes\r\n\r\nDisible chat messaging for any character from account of character $playerName (or currently selected) at $timeInMinutes minutes. Player can be offline.'),
|
||||||
('namego',1,'Syntax: .namego [$charactername]\r\n\r\nTeleport the given character to you. Character can be offline.'),
|
('namego',1,'Syntax: .namego [$charactername]\r\n\r\nTeleport the given character to you. Character can be offline.'),
|
||||||
|
|
|
||||||
6
sql/updates/8071_01_mangos_command.sql
Normal file
6
sql/updates/8071_01_mangos_command.sql
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
ALTER TABLE db_version CHANGE COLUMN required_8065_01_mangos_spell_proc_event required_8071_01_mangos_command bit;
|
||||||
|
|
||||||
|
DELETE FROM `command` WHERE `name` IN ('modify tp');
|
||||||
|
|
||||||
|
INSERT INTO `command` VALUES
|
||||||
|
('modify tp',1,'Syntax: .modify tp #amount\r\n\r\nSte free talent pointes for selected character or character\'s pet. It will be reset to default expected at next levelup/login/quest reward.');
|
||||||
|
|
@ -232,6 +232,7 @@ pkgdata_DATA = \
|
||||||
8060_01_mangos_spell_pet_auras.sql \
|
8060_01_mangos_spell_pet_auras.sql \
|
||||||
8064_01_mangos_spell_chain.sql \
|
8064_01_mangos_spell_chain.sql \
|
||||||
8065_01_mangos_spell_proc_event.sql \
|
8065_01_mangos_spell_proc_event.sql \
|
||||||
|
8071_01_mangos_command.sql \
|
||||||
README
|
README
|
||||||
|
|
||||||
## Additional files to include when running 'make dist'
|
## Additional files to include when running 'make dist'
|
||||||
|
|
@ -444,4 +445,5 @@ EXTRA_DIST = \
|
||||||
8060_01_mangos_spell_pet_auras.sql \
|
8060_01_mangos_spell_pet_auras.sql \
|
||||||
8064_01_mangos_spell_chain.sql \
|
8064_01_mangos_spell_chain.sql \
|
||||||
8065_01_mangos_spell_proc_event.sql \
|
8065_01_mangos_spell_proc_event.sql \
|
||||||
|
8071_01_mangos_command.sql \
|
||||||
README
|
README
|
||||||
|
|
|
||||||
|
|
@ -1040,23 +1040,44 @@ bool ChatHandler::HandleModifyTalentCommand (const char* args)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
int tp = atoi((char*)args);
|
int tp = atoi((char*)args);
|
||||||
if (tp>0)
|
if (tp < 0)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
Unit* target = getSelectedUnit();
|
||||||
|
if(!target)
|
||||||
{
|
{
|
||||||
Player* player = getSelectedPlayer();
|
SendSysMessage(LANG_NO_CHAR_SELECTED);
|
||||||
if(!player)
|
SetSentErrorMessage(true);
|
||||||
{
|
return false;
|
||||||
SendSysMessage(LANG_NO_CHAR_SELECTED);
|
}
|
||||||
SetSentErrorMessage(true);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
if(target->GetTypeId()==TYPEID_PLAYER)
|
||||||
|
{
|
||||||
// check online security
|
// check online security
|
||||||
if (HasLowerSecurity(player, 0))
|
if (HasLowerSecurity((Player*)target, 0))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
player->SetFreeTalentPoints(tp);
|
((Player*)target)->SetFreeTalentPoints(tp);
|
||||||
|
((Player*)target)->SendTalentsInfoData(false);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
else if(((Creature*)target)->isPet())
|
||||||
|
{
|
||||||
|
Unit *owner = target->GetOwner();
|
||||||
|
if(owner && owner->GetTypeId() == TYPEID_PLAYER && ((Pet *)target)->IsPermanentPetFor((Player*)owner))
|
||||||
|
{
|
||||||
|
// check online security
|
||||||
|
if (HasLowerSecurity((Player*)owner, 0))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
((Pet *)target)->SetFreeTalentPoints(tp);
|
||||||
|
((Player*)owner)->SendTalentsInfoData(true);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SendSysMessage(LANG_NO_CHAR_SELECTED);
|
||||||
|
SetSentErrorMessage(true);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "8070"
|
#define REVISION_NR "8071"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue