mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 19:37:03 +00:00
Merge remote branch 'origin/master' into 330
This commit is contained in:
commit
72b9dc318e
69 changed files with 683 additions and 213 deletions
|
|
@ -49,7 +49,7 @@ tbbmalloc:
|
|||
$(MAKE) -r -f $(tbb_root)/build/Makefile.tbbmalloc cfg=release malloc tbb_root=$(tbb_root)
|
||||
|
||||
install-exec-local:
|
||||
$(INSTALL) $(work_dir)/lib*.so* $(libdir)
|
||||
$(INSTALL) $(work_dir)/lib*.so* $(DESTDIR)$(libdir)
|
||||
|
||||
clean-local:
|
||||
-rm -f *.d *.o
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
DROP TABLE IF EXISTS `character_db_version`;
|
||||
CREATE TABLE `character_db_version` (
|
||||
`required_8721_01_characters_guild` bit(1) default NULL
|
||||
`required_8828_01_characters_instance_reset` bit(1) default NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Last applied sql update to DB';
|
||||
|
||||
--
|
||||
|
|
@ -1170,8 +1170,9 @@ UNLOCK TABLES;
|
|||
DROP TABLE IF EXISTS `instance_reset`;
|
||||
CREATE TABLE `instance_reset` (
|
||||
`mapid` int(11) unsigned NOT NULL default '0',
|
||||
`difficulty` tinyint(1) unsigned NOT NULL default '0',
|
||||
`resettime` bigint(40) NOT NULL default '0',
|
||||
PRIMARY KEY (`mapid`)
|
||||
PRIMARY KEY (`mapid`,`difficulty`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
|
|
|
|||
|
|
@ -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_8818_01_mangos_mangos_string` bit(1) default NULL
|
||||
`required_8840_01_mangos_spell_proc_event` bit(1) default NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes';
|
||||
|
||||
--
|
||||
|
|
@ -541,6 +541,7 @@ INSERT INTO `command` VALUES
|
|||
('character level',3,'Syntax: .character level [$playername] [#level]\r\n\r\nSet the level of character with $playername (or the selected if not name provided) by #numberoflevels Or +1 if no #numberoflevels provided). If #numberoflevels is omitted, the level will be increase by 1. If #numberoflevels is 0, the same level will be restarted. If no character is selected and name not provided, increase your level. Command can be used for offline character. All stats and dependent values recalculated. At level decrease talents can be reset if need. Also at level decrease equipped items with greater level requirement can be lost.'),
|
||||
('character rename',2,'Syntax: .character rename [$name]\r\n\r\nMark selected in game or by $name in command character for rename at next login.'),
|
||||
('character reputation',2,'Syntax: .character reputation [$player_name]\r\n\r\nShow reputation information for selected player or player find by $player_name.'),
|
||||
('character titles',2,'Syntax: .character titles [$player_name]\r\n\r\nShow known titles list for selected player or player find by $player_name.'),
|
||||
('combatstop',2,'Syntax: .combatstop [$playername]\r\nStop combat for selected character. If selected non-player then command applied to self. If $playername provided then attempt applied to online player $playername.'),
|
||||
('commands',0,'Syntax: .commands\r\n\r\nDisplay a list of available commands for your account level.'),
|
||||
('cooldown',3,'Syntax: .cooldown [#spell_id]\r\n\r\nRemove all (if spell_id not provided) or #spel_id spell cooldown from selected character or you (if no selection).'),
|
||||
|
|
@ -641,6 +642,7 @@ INSERT INTO `command` VALUES
|
|||
('lookup spell',3,'Syntax: .lookup spell $namepart\r\n\r\nLooks up a spell by $namepart, and returns all matches with their spell ID\'s.'),
|
||||
('lookup taxinode',3,'Syntax: .lookup taxinode $substring\r\n\r\nSearch and output all taxinodes with provide $substring in name.'),
|
||||
('lookup tele',1,'Syntax: .lookup tele $substring\r\n\r\nSearch and output all .tele command locations with provide $substring in name.'),
|
||||
('lookup title',2,'Syntax: .lookup title $$namepart\r\n\r\nLooks up a title by $namepart, and returns all matches with their title ID\'s and index\'s.'),
|
||||
('maxskill',3,'Syntax: .maxskill\r\nSets all skills of the targeted player to their maximum VALUESfor its current level.'),
|
||||
('modify arena',1,'Syntax: .modify arena #value\r\nAdd $amount arena points to the selected player.'),
|
||||
('modify aspeed',1,'Syntax: .modify aspeed #rate\r\n\r\nModify all speeds -run,swim,run back,swim back- of the selected player to \"normalbase speed for this move type\"*rate. If no player is selected, modify your speed.\r\n\r\n #rate may range from 0.1 to 10.'),
|
||||
|
|
@ -665,7 +667,6 @@ INSERT INTO `command` VALUES
|
|||
('modify spell',1,''),
|
||||
('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 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.'),
|
||||
('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.'),
|
||||
|
|
@ -753,6 +754,10 @@ INSERT INTO `command` VALUES
|
|||
('tele group',1,'Syntax: .tele group#location\r\n\r\nTeleport a selected player and his group members to a given location.'),
|
||||
('tele name',1,'Syntax: .tele name [#playername] #location\r\n\r\nTeleport the given character to a given location. Character can be offline.'),
|
||||
('ticket',2,'Syntax: .ticket on\r\n .ticket off\r\n .ticket #num\r\n .ticket $character_name\r\n\r\non/off for GMs to show or not a new ticket directly, $character_name to show ticket of this character, #num to show ticket #num.'),
|
||||
('titles add',2,'Syntax: .titles add #title\r\nAdd title #title (id or shift-link) to known titles list for selected player.'),
|
||||
('titles current',2,'Syntax: .titles current #title\r\nSet title #title (id or shift-link) as current selected titl for selected player. If title not in known title list for player then it will be added to list.'),
|
||||
('titles remove',2,'Syntax: .titles remove #title\r\nRemove title #title (id or shift-link) from known titles list for selected player.'),
|
||||
('titles setmask',2,'Syntax: .titles setmask #mask\r\n\r\nAllows user to use all titles from #mask.\r\n\r\n #mask=0 disables the title-choose-field'),
|
||||
('unaura',3,'Syntax: .unaura #spellid\r\n\r\nRemove aura due to spell #spellid from the selected Unit.'),
|
||||
('unban account',3,'Syntax: .unban account $Name\r\nUnban accounts for account name pattern.'),
|
||||
('unban character',3,'Syntax: .unban character $Name\r\nUnban accounts for character name pattern.'),
|
||||
|
|
@ -1904,9 +1909,6 @@ CREATE TABLE `instance_template` (
|
|||
`parent` int(10) unsigned NOT NULL,
|
||||
`levelMin` tinyint(3) unsigned NOT NULL default '0',
|
||||
`levelMax` tinyint(3) unsigned NOT NULL default '0',
|
||||
`maxPlayers` tinyint(3) unsigned NOT NULL default '0',
|
||||
`maxPlayersHeroic` tinyint(3) unsigned NOT NULL default '0',
|
||||
`reset_delay` int(10) unsigned NOT NULL default '0',
|
||||
`startLocX` float default NULL,
|
||||
`startLocY` float default NULL,
|
||||
`startLocZ` float default NULL,
|
||||
|
|
@ -3070,6 +3072,14 @@ INSERT INTO `mangos_string` VALUES
|
|||
(346,'Forced customize for player %s (GUID #%u) will be requested at next login.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||
(347,'TaxiNode ID %u not found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||
(348,'Game Object (Entry: %u) have invalid data and can\'t be spawned',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||
(349,'%d (idx:%d) - |cffffffff|Htitle:%d|h[%s %s]|h|r %s %s ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||
(350,'%d (idx:%d) - [%s %s] %s %s ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||
(351,'No titles found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||
(352,'Invalid title id: %u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||
(353,'Title %u (%s) added to known titles list for player %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||
(354,'Title %u (%s) removed from known titles list for player %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||
(355,'Title %u (%s) set as current seelcted title for player %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||
(356,'Current selected title for player %s reset as not known now.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||
(400,'|cffff0000[System Message]:|rScripts reloaded',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||
(401,'You change security level of account %s to %i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||
(402,'%s changed your security level to %i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||
|
|
@ -18234,7 +18244,7 @@ INSERT INTO `spell_proc_event` VALUES
|
|||
(53553, 0x00000000, 10, 0x00001000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
|
||||
(53569, 0x00000000, 10, 0x00200000, 0x00010000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
|
||||
(53576, 0x00000000, 10, 0x00200000, 0x00010000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
|
||||
(53601, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 6),
|
||||
(53601, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x000A02A8, 0x00000000, 0.000000, 0.000000, 6),
|
||||
(53646, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
|
||||
(53671, 0x00000000, 10, 0x00800000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
|
||||
(53673, 0x00000000, 10, 0x00800000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
|
||||
|
|
|
|||
6
sql/updates/8828_01_characters_instance_reset.sql
Normal file
6
sql/updates/8828_01_characters_instance_reset.sql
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
ALTER TABLE character_db_version CHANGE COLUMN required_8721_01_characters_guild required_8828_01_characters_instance_reset bit;
|
||||
|
||||
ALTER TABLE instance_reset
|
||||
ADD COLUMN difficulty tinyint(1) unsigned NOT NULL default '0' AFTER mapid,
|
||||
DROP PRIMARY KEY,
|
||||
ADD PRIMARY KEY (`mapid`,`difficulty`);
|
||||
6
sql/updates/8828_02_mangos_instance_template.sql
Normal file
6
sql/updates/8828_02_mangos_instance_template.sql
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
ALTER TABLE db_version CHANGE COLUMN required_8818_01_mangos_mangos_string required_8828_02_mangos_instance_template bit;
|
||||
|
||||
ALTER TABLE instance_template
|
||||
DROP COLUMN maxPlayers,
|
||||
DROP COLUMN maxPlayersHeroic,
|
||||
DROP COLUMN reset_delay;
|
||||
13
sql/updates/8833_01_mangos_mangos_string.sql
Normal file
13
sql/updates/8833_01_mangos_mangos_string.sql
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
ALTER TABLE db_version CHANGE COLUMN required_8828_02_mangos_instance_template required_8833_01_mangos_mangos_string bit;
|
||||
|
||||
DELETE FROM mangos_string WHERE entry in (349, 350, 351, 352, 353, 354, 355, 356);
|
||||
|
||||
INSERT INTO mangos_string VALUES
|
||||
(349,'%d (idx:%d) - |cffffffff|Htitle:%d|h[%s %s]|h|r %s %s ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||
(350,'%d (idx:%d) - [%s %s] %s %s ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||
(351,'No titles found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||
(352,'Invalid title id: %u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||
(353,'Title %u (%s) added to known titles list for player %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||
(354,'Title %u (%s) removed from known titles list for player %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||
(355,'Title %u (%s) set as current seelcted title for player %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||
(356,'Current selected title for player %s reset as not known now.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
|
||||
10
sql/updates/8833_02_mangos_command.sql
Normal file
10
sql/updates/8833_02_mangos_command.sql
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
ALTER TABLE db_version CHANGE COLUMN required_8833_01_mangos_mangos_string required_8833_02_mangos_command bit;
|
||||
|
||||
DELETE FROM command where name IN ('character titles','modify titles','titles add','titles current','titles remove','titles setmask');
|
||||
|
||||
INSERT INTO `command` VALUES
|
||||
('character titles',2,'Syntax: .character titles [$player_name]\r\n\r\nShow known titles list for selected player or player find by $player_name.'),
|
||||
('titles add',2,'Syntax: .titles add #title\r\nAdd title #title (id or shift-link) to known titles list for selected player.'),
|
||||
('titles current',2,'Syntax: .titles current #title\r\nSet title #title (id or shift-link) as current selected titl for selected player. If title not in known title list for player then it will be added to list.'),
|
||||
('titles remove',2,'Syntax: .titles remove #title\r\nRemove title #title (id or shift-link) from known titles list for selected player.'),
|
||||
('titles setmask',2,'Syntax: .titles setmask #mask\r\n\r\nAllows user to use all titles from #mask.\r\n\r\n #mask=0 disables the title-choose-field');
|
||||
6
sql/updates/8835_01_mangos_command.sql
Normal file
6
sql/updates/8835_01_mangos_command.sql
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
ALTER TABLE db_version CHANGE COLUMN required_8833_02_mangos_command required_8835_01_mangos_command bit;
|
||||
|
||||
DELETE FROM command where name IN ('lookup title');
|
||||
|
||||
INSERT INTO `command` VALUES
|
||||
('lookup title',2,'Syntax: .lookup title $$namepart\r\n\r\nLooks up a title by $namepart, and returns all matches with their title ID\'s and index\'s.');
|
||||
6
sql/updates/8840_01_mangos_spell_proc_event.sql
Normal file
6
sql/updates/8840_01_mangos_spell_proc_event.sql
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
ALTER TABLE db_version CHANGE COLUMN required_8835_01_mangos_command required_8840_01_mangos_spell_proc_event bit;
|
||||
|
||||
DELETE FROM `spell_proc_event` WHERE `entry`=53601;
|
||||
|
||||
INSERT INTO spell_proc_event VALUES
|
||||
(53601, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x000A02A8, 0x00000000, 0.000000, 0.000000, 6);
|
||||
|
|
@ -158,6 +158,12 @@ pkgdata_DATA = \
|
|||
8803_02_mangos_playercreateinfo_action.sql \
|
||||
8815_01_mangos_mangos_string.sql \
|
||||
8818_01_mangos_mangos_string.sql \
|
||||
8828_01_characters_instance_reset.sql \
|
||||
8828_02_mangos_instance_template.sql \
|
||||
8833_01_mangos_mangos_string.sql \
|
||||
8833_02_mangos_command.sql \
|
||||
8835_01_mangos_command.sql \
|
||||
8840_01_mangos_spell_proc_event.sql \
|
||||
README
|
||||
|
||||
## Additional files to include when running 'make dist'
|
||||
|
|
@ -296,4 +302,10 @@ EXTRA_DIST = \
|
|||
8803_02_mangos_playercreateinfo_action.sql \
|
||||
8815_01_mangos_mangos_string.sql \
|
||||
8818_01_mangos_mangos_string.sql \
|
||||
8828_01_characters_instance_reset.sql \
|
||||
8828_02_mangos_instance_template.sql \
|
||||
8833_01_mangos_mangos_string.sql \
|
||||
8833_02_mangos_command.sql \
|
||||
8835_01_mangos_command.sql \
|
||||
8840_01_mangos_spell_proc_event.sql \
|
||||
README
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
#include "AccountMgr.h"
|
||||
#include "Database/DatabaseEnv.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ObjectDefines.h"
|
||||
#include "Player.h"
|
||||
#include "Policies/SingletonImp.h"
|
||||
#include "Util.h"
|
||||
|
|
|
|||
|
|
@ -923,7 +923,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
|||
continue;
|
||||
|
||||
//FIXME: work only for instances where max==min for players
|
||||
if(((InstanceMap*)map)->GetMaxPlayers() != achievementCriteria->death_in_dungeon.manLimit)
|
||||
if (map->GetMaxPlayers() != achievementCriteria->death_in_dungeon.manLimit)
|
||||
continue;
|
||||
SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE);
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@
|
|||
|
||||
#include "WorldPacket.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "ObjectDefines.h"
|
||||
#include "ArenaTeam.h"
|
||||
#include "World.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@
|
|||
#include "Log.h"
|
||||
#include "World.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "ObjectDefines.h"
|
||||
#include "Player.h"
|
||||
#include "UpdateMask.h"
|
||||
#include "AuctionHouseMgr.h"
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
#include "Language.h"
|
||||
#include "Log.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "ObjectDefines.h"
|
||||
#include "Player.h"
|
||||
#include "World.h"
|
||||
#include "WorldPacket.h"
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@
|
|||
#include "ArenaTeam.h"
|
||||
#include "World.h"
|
||||
#include "Group.h"
|
||||
#include "ObjectDefines.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "WorldPacket.h"
|
||||
#include "Util.h"
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@
|
|||
#include "Log.h"
|
||||
#include "World.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "ObjectDefines.h"
|
||||
#include "Player.h"
|
||||
#include "Guild.h"
|
||||
#include "UpdateMask.h"
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@
|
|||
#include "Log.h"
|
||||
#include "World.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "ObjectDefines.h"
|
||||
#include "Player.h"
|
||||
#include "UpdateMask.h"
|
||||
#include "Chat.h"
|
||||
|
|
@ -54,6 +55,7 @@
|
|||
// |color|Htalent:talent_id,rank|h[name]|h|r - client, talent icon shift-click
|
||||
// |color|Htaxinode:id|h[name]|h|r
|
||||
// |color|Htele:id|h[name]|h|r
|
||||
// |color|Htitle:id|h[name]|h|r
|
||||
// |color|Htrade:spell_id,cur_value,max_value,unk3int,unk3str|h[name]|h|r - client, spellbook profession icon shift-click
|
||||
|
||||
bool ChatHandler::load_command_table = true;
|
||||
|
|
@ -121,6 +123,7 @@ ChatCommand * ChatHandler::getCommandTable()
|
|||
{ "level", SEC_ADMINISTRATOR, true, &ChatHandler::HandleCharacterLevelCommand, "", NULL },
|
||||
{ "rename", SEC_GAMEMASTER, true, &ChatHandler::HandleCharacterRenameCommand, "", NULL },
|
||||
{ "reputation", SEC_GAMEMASTER, true, &ChatHandler::HandleCharacterReputationCommand, "", NULL },
|
||||
{ "titles", SEC_GAMEMASTER, true, &ChatHandler::HandleCharacterTitlesCommand, "", NULL },
|
||||
{ NULL, 0, false, NULL, "", NULL }
|
||||
};
|
||||
|
||||
|
|
@ -293,6 +296,7 @@ ChatCommand * ChatHandler::getCommandTable()
|
|||
{ "spell", SEC_ADMINISTRATOR, true, &ChatHandler::HandleLookupSpellCommand, "", NULL },
|
||||
{ "taxinode", SEC_ADMINISTRATOR, true, &ChatHandler::HandleLookupTaxiNodeCommand, "", NULL },
|
||||
{ "tele", SEC_MODERATOR, true, &ChatHandler::HandleLookupTeleCommand, "", NULL },
|
||||
{ "title", SEC_GAMEMASTER, true, &ChatHandler::HandleLookupTitleCommand, "", NULL },
|
||||
{ NULL, 0, false, NULL, "", NULL }
|
||||
};
|
||||
|
||||
|
|
@ -314,7 +318,6 @@ ChatCommand * ChatHandler::getCommandTable()
|
|||
{ "faction", SEC_MODERATOR, false, &ChatHandler::HandleModifyFactionCommand, "", NULL },
|
||||
{ "spell", SEC_MODERATOR, false, &ChatHandler::HandleModifySpellCommand, "", NULL },
|
||||
{ "tp", SEC_MODERATOR, false, &ChatHandler::HandleModifyTalentCommand, "", NULL },
|
||||
{ "titles", SEC_MODERATOR, false, &ChatHandler::HandleModifyKnownTitlesCommand, "", NULL },
|
||||
{ "mount", SEC_MODERATOR, false, &ChatHandler::HandleModifyMountCommand, "", NULL },
|
||||
{ "honor", SEC_MODERATOR, false, &ChatHandler::HandleModifyHonorCommand, "", NULL },
|
||||
{ "rep", SEC_GAMEMASTER, false, &ChatHandler::HandleModifyRepCommand, "", NULL },
|
||||
|
|
@ -551,6 +554,15 @@ ChatCommand * ChatHandler::getCommandTable()
|
|||
{ NULL, 0, false, NULL, "", NULL }
|
||||
};
|
||||
|
||||
static ChatCommand titlesCommandTable[] =
|
||||
{
|
||||
{ "add", SEC_GAMEMASTER, false, &ChatHandler::HandleTitlesAddCommand, "", NULL },
|
||||
{ "current", SEC_GAMEMASTER, false, &ChatHandler::HandleTitlesCurrentCommand, "", NULL },
|
||||
{ "remove", SEC_GAMEMASTER, false, &ChatHandler::HandleTitlesRemoveCommand, "", NULL },
|
||||
{ "setmask", SEC_GAMEMASTER, false, &ChatHandler::HandleTitlesSetMaskCommand, "", NULL },
|
||||
{ NULL, 0, false, NULL, "", NULL }
|
||||
};
|
||||
|
||||
static ChatCommand unbanCommandTable[] =
|
||||
{
|
||||
{ "account", SEC_ADMINISTRATOR, true, &ChatHandler::HandleUnBanAccountCommand, "", NULL },
|
||||
|
|
@ -584,6 +596,7 @@ ChatCommand * ChatHandler::getCommandTable()
|
|||
{ "gobject", SEC_GAMEMASTER, false, NULL, "", gobjectCommandTable },
|
||||
{ "honor", SEC_GAMEMASTER, false, NULL, "", honorCommandTable },
|
||||
{ "wp", SEC_GAMEMASTER, false, NULL, "", wpCommandTable },
|
||||
{ "titles", SEC_GAMEMASTER, false, NULL, "", titlesCommandTable },
|
||||
{ "quest", SEC_ADMINISTRATOR, false, NULL, "", questCommandTable },
|
||||
{ "reload", SEC_ADMINISTRATOR, true, NULL, "", reloadCommandTable },
|
||||
{ "list", SEC_ADMINISTRATOR, true, NULL, "", listCommandTable },
|
||||
|
|
|
|||
|
|
@ -126,6 +126,7 @@ class ChatHandler
|
|||
bool HandleCharacterLevelCommand(const char* args);
|
||||
bool HandleCharacterRenameCommand(const char * args);
|
||||
bool HandleCharacterReputationCommand(const char* args);
|
||||
bool HandleCharacterTitlesCommand(const char* args);
|
||||
|
||||
bool HandleDebugAnimCommand(const char* args);
|
||||
bool HandleDebugArenaCommand(const char * args);
|
||||
|
|
@ -238,8 +239,8 @@ class ChatHandler
|
|||
bool HandleLookupSpellCommand(const char* args);
|
||||
bool HandleLookupTaxiNodeCommand(const char * args);
|
||||
bool HandleLookupTeleCommand(const char * args);
|
||||
bool HandleLookupTitleCommand(const char * args);
|
||||
|
||||
bool HandleModifyKnownTitlesCommand(const char* args);
|
||||
bool HandleModifyHPCommand(const char* args);
|
||||
bool HandleModifyManaCommand(const char* args);
|
||||
bool HandleModifyRageCommand(const char* args);
|
||||
|
|
@ -420,6 +421,11 @@ class ChatHandler
|
|||
bool HandleTeleGroupCommand(const char* args);
|
||||
bool HandleTeleNameCommand(const char* args);
|
||||
|
||||
bool HandleTitlesAddCommand(const char* args);
|
||||
bool HandleTitlesCurrentCommand(const char* args);
|
||||
bool HandleTitlesRemoveCommand(const char* args);
|
||||
bool HandleTitlesSetMaskCommand(const char* args);
|
||||
|
||||
bool HandleUnBanAccountCommand(const char* args);
|
||||
bool HandleUnBanCharacterCommand(const char* args);
|
||||
bool HandleUnBanIPCommand(const char* args);
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@
|
|||
#include "Player.h"
|
||||
#include "UpdateMask.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ObjectDefines.h"
|
||||
#include "Database/DatabaseEnv.h"
|
||||
#include "Opcodes.h"
|
||||
#include "GossipDef.h"
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@
|
|||
#include "WorldPacket.h"
|
||||
#include "World.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "ObjectDefines.h"
|
||||
#include "SpellMgr.h"
|
||||
#include "Creature.h"
|
||||
#include "QuestDef.h"
|
||||
|
|
@ -306,14 +307,13 @@ bool Creature::UpdateEntry(uint32 Entry, uint32 team, const CreatureData *data )
|
|||
SetCanModifyStats(true);
|
||||
UpdateAllStats();
|
||||
|
||||
FactionTemplateEntry const* factionTemplate = sFactionTemplateStore.LookupEntry(GetCreatureInfo()->faction_A);
|
||||
if (factionTemplate) // check and error show at loading templates
|
||||
// checked and error show at loading templates
|
||||
if (FactionTemplateEntry const* factionTemplate = sFactionTemplateStore.LookupEntry(GetCreatureInfo()->faction_A))
|
||||
{
|
||||
FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionTemplate->faction);
|
||||
if (factionEntry)
|
||||
if( !(GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_CIVILIAN) &&
|
||||
(factionEntry->team == ALLIANCE || factionEntry->team == HORDE) )
|
||||
SetPvP(true);
|
||||
if (factionTemplate->factionFlags & FACTION_TEMPLATE_FLAG_PVP)
|
||||
SetPvP(true);
|
||||
else
|
||||
SetPvP(false);
|
||||
}
|
||||
|
||||
for(int i=0; i < CREATURE_MAX_SPELLS; ++i)
|
||||
|
|
@ -1971,12 +1971,12 @@ bool Creature::LoadCreaturesAddon(bool reload)
|
|||
if (cainfo->bytes2 != 0)
|
||||
{
|
||||
// 0 SheathState
|
||||
// 1 Bytes2Flags
|
||||
// 1 UnitPVPStateFlags Set at Creature::UpdateEntry (SetPvp())
|
||||
// 2 UnitRename Pet only, so always 0 for default creature
|
||||
// 3 ShapeshiftForm Must be determined/set by shapeshift spell/aura
|
||||
|
||||
SetByteValue(UNIT_FIELD_BYTES_2, 0, uint8(cainfo->bytes2 & 0xFF));
|
||||
SetByteValue(UNIT_FIELD_BYTES_2, 1, uint8((cainfo->bytes2 >> 8) & 0xFF));
|
||||
//SetByteValue(UNIT_FIELD_BYTES_2, 1, uint8((cainfo->bytes2 >> 8) & 0xFF));
|
||||
//SetByteValue(UNIT_FIELD_BYTES_2, 2, uint8((cainfo->bytes2 >> 16) & 0xFF));
|
||||
SetByteValue(UNIT_FIELD_BYTES_2, 2, 0);
|
||||
//SetByteValue(UNIT_FIELD_BYTES_2, 3, uint8((cainfo->bytes2 >> 24) & 0xFF));
|
||||
|
|
|
|||
|
|
@ -236,6 +236,8 @@ enum AreaFlags
|
|||
|
||||
enum Difficulty
|
||||
{
|
||||
REGULAR_DIFFICULTY = 0,
|
||||
|
||||
DUNGEON_DIFFICULTY_NORMAL = 0,
|
||||
DUNGEON_DIFFICULTY_HEROIC = 1,
|
||||
|
||||
|
|
@ -251,7 +253,7 @@ enum Difficulty
|
|||
|
||||
enum SpawnMask
|
||||
{
|
||||
SPAWNMASK_CONTINENT = 1, // any any maps without spawn modes
|
||||
SPAWNMASK_REGULAR = (1 << REGULAR_DIFFICULTY),// any any maps without spawn modes (continents/subway) or in minimal spawnmode
|
||||
|
||||
SPAWNMASK_DUNGEON_NORMAL = (1 << DUNGEON_DIFFICULTY_NORMAL),
|
||||
SPAWNMASK_DUNGEON_HEROIC = (1 << DUNGEON_DIFFICULTY_HEROIC),
|
||||
|
|
@ -270,7 +272,8 @@ enum SpawnMask
|
|||
|
||||
enum FactionTemplateFlags
|
||||
{
|
||||
FACTION_TEMPLATE_FLAG_CONTESTED_GUARD = 0x00001000, // faction will attack players that were involved in PvP combats
|
||||
FACTION_TEMPLATE_FLAG_PVP = 0x00000800, // flagged for PvP
|
||||
FACTION_TEMPLATE_FLAG_CONTESTED_GUARD = 0x00001000, // faction will attack players that were involved in PvP combats
|
||||
};
|
||||
|
||||
enum FactionMasks
|
||||
|
|
|
|||
|
|
@ -100,7 +100,6 @@ DBCStorage <MapEntry> sMapStore(MapEntryfmt);
|
|||
|
||||
// DBC used only for initialization sMapDifficultyMap at startup.
|
||||
DBCStorage <MapDifficultyEntry> sMapDifficultyStore(MapDifficultyEntryfmt); // only for loading
|
||||
typedef std::map<uint32/*pair32(map,diff)*/,MapDifficulty> MapDifficultyMap;
|
||||
MapDifficultyMap sMapDifficultyMap;
|
||||
|
||||
DBCStorage <MovieEntry> sMovieStore(MovieEntryfmt);
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ bool IsTotemCategoryCompatiableWith(uint32 itemTotemCategoryId, uint32 requiredT
|
|||
void Zone2MapCoordinates(float& x,float& y,uint32 zone);
|
||||
void Map2ZoneCoordinates(float& x,float& y,uint32 zone);
|
||||
|
||||
typedef std::map<uint32/*pair32(map,diff)*/,MapDifficulty> MapDifficultyMap;
|
||||
MapDifficulty const* GetMapDifficultyData(uint32 mapId, Difficulty difficulty);
|
||||
|
||||
uint32 const* /*[3]*/ GetTalentTabPages(uint32 cls);
|
||||
|
|
@ -113,6 +114,7 @@ extern DBCStorage <LockEntry> sLockStore;
|
|||
extern DBCStorage <MailTemplateEntry> sMailTemplateStore;
|
||||
extern DBCStorage <MapEntry> sMapStore;
|
||||
//extern DBCStorage <MapDifficultyEntry> sMapDifficultyStore; -- use GetMapDifficultyData insteed
|
||||
extern MapDifficultyMap sMapDifficultyMap;
|
||||
extern DBCStorage <MovieEntry> sMovieStore;
|
||||
extern DBCStorage <QuestSortEntry> sQuestSortStore;
|
||||
extern DBCStorage <RandomPropertiesPointsEntry> sRandomPropertiesPointsStore;
|
||||
|
|
|
|||
|
|
@ -593,7 +593,7 @@ struct CharTitlesEntry
|
|||
{
|
||||
uint32 ID; // 0, title ids, for example in Quest::GetCharTitleId()
|
||||
//uint32 unk1; // 1 flags?
|
||||
//char* name[16]; // 2-17, unused
|
||||
char* name[16]; // 2-17
|
||||
// 18 string flag, unused
|
||||
//char* name2[16]; // 19-34, unused
|
||||
// 35 string flag, unused
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ const char BankBagSlotPricesEntryfmt[]="ni";
|
|||
const char BarberShopStyleEntryfmt[]="nixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxiii";
|
||||
const char BattlemasterListEntryfmt[]="niiiiiiiiiixssssssssssssssssxxx";
|
||||
const char CharStartOutfitEntryfmt[]="diiiiiiiiiiiiiiiiiiiiiiiiixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
|
||||
const char CharTitlesEntryfmt[]="nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxi";
|
||||
const char CharTitlesEntryfmt[]="nxssssssssssssssssxxxxxxxxxxxxxxxxxxi";
|
||||
const char ChatChannelsEntryfmt[]="iixssssssssssssssssxxxxxxxxxxxxxxxxxx";
|
||||
// ChatChannelsEntryfmt, index not used (more compact store)
|
||||
const char ChrClassesEntryfmt[]="nxixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxixii";
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@
|
|||
#include "Database/SQLStorage.h"
|
||||
#include "GMTicketMgr.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "ObjectDefines.h"
|
||||
#include "ProgressBar.h"
|
||||
#include "Policies/SingletonImp.h"
|
||||
#include "Player.h"
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
#include "GameEventMgr.h"
|
||||
#include "World.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "ObjectDefines.h"
|
||||
#include "PoolManager.h"
|
||||
#include "ProgressBar.h"
|
||||
#include "Language.h"
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@
|
|||
#include "Player.h"
|
||||
#include "World.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "ObjectDefines.h"
|
||||
#include "Group.h"
|
||||
#include "Formulas.h"
|
||||
#include "ObjectAccessor.h"
|
||||
|
|
|
|||
|
|
@ -22,7 +22,9 @@
|
|||
#define WITHDRAW_MONEY_UNLIMITED 0xFFFFFFFF
|
||||
#define WITHDRAW_SLOT_UNLIMITED 0xFFFFFFFF
|
||||
|
||||
#include "Common.h"
|
||||
#include "Item.h"
|
||||
#include "ObjectDefines.h"
|
||||
|
||||
class Item;
|
||||
|
||||
|
|
|
|||
|
|
@ -100,13 +100,13 @@ InstanceSave* InstanceSaveManager::AddInstanceSave(uint32 mapId, uint32 instance
|
|||
{
|
||||
// initialize reset time
|
||||
// for normal instances if no creatures are killed the instance will reset in two hours
|
||||
if(entry->map_type == MAP_RAID || difficulty == DUNGEON_DIFFICULTY_HEROIC)
|
||||
resetTime = GetResetTimeFor(mapId);
|
||||
if(entry->map_type == MAP_RAID || difficulty > DUNGEON_DIFFICULTY_NORMAL)
|
||||
resetTime = GetResetTimeFor(mapId,difficulty);
|
||||
else
|
||||
{
|
||||
resetTime = time(NULL) + 2 * HOUR;
|
||||
// normally this will be removed soon after in InstanceMap::Add, prevent error
|
||||
ScheduleReset(true, resetTime, InstResetEvent(0, mapId, instanceId));
|
||||
ScheduleReset(true, resetTime, InstResetEvent(0, mapId, difficulty, instanceId));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -378,18 +378,26 @@ void InstanceSaveManager::LoadResetTimes()
|
|||
// get the current reset times for normal instances (these may need to be updated)
|
||||
// these are only kept in memory for InstanceSaves that are loaded later
|
||||
// resettime = 0 in the DB for raid/heroic instances so those are skipped
|
||||
typedef std::map<uint32, std::pair<uint32, time_t> > ResetTimeMapType;
|
||||
ResetTimeMapType InstResetTime;
|
||||
QueryResult *result = CharacterDatabase.Query("SELECT id, map, resettime FROM instance WHERE resettime > 0");
|
||||
typedef std::pair<uint32 /*PAIR32(map,difficulty)*/, time_t> ResetTimeMapDiffType;
|
||||
typedef std::map<uint32, ResetTimeMapDiffType> InstResetTimeMapDiffType;
|
||||
InstResetTimeMapDiffType instResetTime;
|
||||
|
||||
// index instance ids by map/difficulty pairs for fast reset warning send
|
||||
typedef std::multimap<uint32 /*PAIR32(map,difficulty)*/, uint32 /*instanceid*/ > ResetTimeMapDiffInstances;
|
||||
ResetTimeMapDiffInstances mapDiffResetInstances;
|
||||
|
||||
QueryResult *result = CharacterDatabase.Query("SELECT id, map, difficulty, resettime FROM instance WHERE resettime > 0");
|
||||
if( result )
|
||||
{
|
||||
do
|
||||
{
|
||||
if(time_t resettime = time_t((*result)[2].GetUInt64()))
|
||||
if(time_t resettime = time_t((*result)[3].GetUInt64()))
|
||||
{
|
||||
uint32 id = (*result)[0].GetUInt32();
|
||||
uint32 mapid = (*result)[1].GetUInt32();
|
||||
InstResetTime[id] = std::pair<uint32, uint64>(mapid, resettime);
|
||||
uint32 difficulty = (*result)[2].GetUInt32();
|
||||
instResetTime[id] = ResetTimeMapDiffType(MAKE_PAIR32(mapid,difficulty), resettime);
|
||||
mapDiffResetInstances.insert(ResetTimeMapDiffInstances::value_type(MAKE_PAIR32(mapid,difficulty),id));
|
||||
}
|
||||
}
|
||||
while (result->NextRow());
|
||||
|
|
@ -404,8 +412,8 @@ void InstanceSaveManager::LoadResetTimes()
|
|||
Field *fields = result->Fetch();
|
||||
uint32 instance = fields[1].GetUInt32();
|
||||
time_t resettime = time_t(fields[0].GetUInt64() + 2 * HOUR);
|
||||
ResetTimeMapType::iterator itr = InstResetTime.find(instance);
|
||||
if(itr != InstResetTime.end() && itr->second.second != resettime)
|
||||
InstResetTimeMapDiffType::iterator itr = instResetTime.find(instance);
|
||||
if(itr != instResetTime.end() && itr->second.second != resettime)
|
||||
{
|
||||
CharacterDatabase.DirectPExecute("UPDATE instance SET resettime = '"UI64FMTD"' WHERE id = '%u'", uint64(resettime), instance);
|
||||
itr->second.second = resettime;
|
||||
|
|
@ -416,59 +424,65 @@ void InstanceSaveManager::LoadResetTimes()
|
|||
}
|
||||
|
||||
// schedule the reset times
|
||||
for(ResetTimeMapType::iterator itr = InstResetTime.begin(); itr != InstResetTime.end(); ++itr)
|
||||
for(InstResetTimeMapDiffType::iterator itr = instResetTime.begin(); itr != instResetTime.end(); ++itr)
|
||||
if(itr->second.second > now)
|
||||
ScheduleReset(true, itr->second.second, InstResetEvent(0, itr->second.first, itr->first));
|
||||
ScheduleReset(true, itr->second.second, InstResetEvent(0, PAIR32_LOPART(itr->second.first),Difficulty(PAIR32_HIPART(itr->second.first)),itr->first));
|
||||
}
|
||||
|
||||
// load the global respawn times for raid/heroic instances
|
||||
uint32 diff = sWorld.getConfig(CONFIG_INSTANCE_RESET_TIME_HOUR) * HOUR;
|
||||
m_resetTimeByMapId.resize(sMapStore.GetNumRows()+1);
|
||||
result = CharacterDatabase.Query("SELECT mapid, resettime FROM instance_reset");
|
||||
result = CharacterDatabase.Query("SELECT mapid, difficulty, resettime FROM instance_reset");
|
||||
if(result)
|
||||
{
|
||||
do
|
||||
{
|
||||
Field *fields = result->Fetch();
|
||||
uint32 mapid = fields[0].GetUInt32();
|
||||
if(!ObjectMgr::GetInstanceTemplate(mapid))
|
||||
Difficulty difficulty = Difficulty(fields[1].GetUInt32());
|
||||
uint64 oldresettime = fields[2].GetUInt64();
|
||||
|
||||
MapDifficulty const* mapDiff = GetMapDifficultyData(mapid,difficulty);
|
||||
if(!mapDiff)
|
||||
{
|
||||
sLog.outError("InstanceSaveManager::LoadResetTimes: invalid mapid %u in instance_reset!", mapid);
|
||||
CharacterDatabase.DirectPExecute("DELETE FROM instance_reset WHERE mapid = '%u'", mapid);
|
||||
sLog.outError("InstanceSaveManager::LoadResetTimes: invalid mapid(%u)/difficulty(%u) pair in instance_reset!", mapid, difficulty);
|
||||
CharacterDatabase.DirectPExecute("DELETE FROM instance_reset WHERE mapid = '%u' AND difficulty = '%u'", mapid,difficulty);
|
||||
continue;
|
||||
}
|
||||
|
||||
// update the reset time if the hour in the configs changes
|
||||
uint64 oldresettime = fields[1].GetUInt64();
|
||||
uint64 newresettime = (oldresettime / DAY) * DAY + diff;
|
||||
if(oldresettime != newresettime)
|
||||
CharacterDatabase.DirectPExecute("UPDATE instance_reset SET resettime = '"UI64FMTD"' WHERE mapid = '%u'", newresettime, mapid);
|
||||
CharacterDatabase.DirectPExecute("UPDATE instance_reset SET resettime = '"UI64FMTD"' WHERE mapid = '%u' AND difficulty = '%u'", newresettime, mapid, difficulty);
|
||||
|
||||
m_resetTimeByMapId[mapid] = newresettime;
|
||||
SetResetTimeFor(mapid,difficulty,newresettime);
|
||||
} while(result->NextRow());
|
||||
delete result;
|
||||
}
|
||||
|
||||
// clean expired instances, references to them will be deleted in CleanupInstances
|
||||
// must be done before calculating new reset times
|
||||
_DelHelper(CharacterDatabase, "id, map, difficulty", "instance", "LEFT JOIN instance_reset ON mapid = map WHERE (instance.resettime < '"UI64FMTD"' AND instance.resettime > '0') OR (NOT instance_reset.resettime IS NULL AND instance_reset.resettime < '"UI64FMTD"')", (uint64)now, (uint64)now);
|
||||
_DelHelper(CharacterDatabase, "id, map, instance.difficulty", "instance", "LEFT JOIN instance_reset ON mapid = map AND instance.difficulty = instance_reset.difficulty WHERE (instance.resettime < '"UI64FMTD"' AND instance.resettime > '0') OR (NOT instance_reset.resettime IS NULL AND instance_reset.resettime < '"UI64FMTD"')", (uint64)now, (uint64)now);
|
||||
|
||||
// calculate new global reset times for expired instances and those that have never been reset yet
|
||||
// add the global reset times to the priority queue
|
||||
for(uint32 i = 0; i < sInstanceTemplate.MaxEntry; i++)
|
||||
for(MapDifficultyMap::const_iterator itr = sMapDifficultyMap.begin(); itr != sMapDifficultyMap.end(); ++itr)
|
||||
{
|
||||
InstanceTemplate const* temp = ObjectMgr::GetInstanceTemplate(i);
|
||||
if(!temp || temp->reset_delay == 0)
|
||||
uint32 map_diff_pair = itr->first;
|
||||
uint32 mapid = PAIR32_LOPART(map_diff_pair);
|
||||
Difficulty difficulty = Difficulty(PAIR32_HIPART(map_diff_pair));
|
||||
MapDifficulty const* mapDiff = &itr->second;
|
||||
if (!mapDiff->resetTime)
|
||||
continue;
|
||||
|
||||
uint32 period = temp->reset_delay * DAY;
|
||||
assert(period != 0);
|
||||
time_t t = m_resetTimeByMapId[temp->map];
|
||||
// the reset_delay must be at least one day
|
||||
uint32 period = (mapDiff->resetTime / DAY * sWorld.getRate(RATE_INSTANCE_RESET_TIME)) * DAY;
|
||||
|
||||
time_t t = GetResetTimeFor(mapid,difficulty);
|
||||
if(!t)
|
||||
{
|
||||
// initialize the reset time
|
||||
t = today + period + diff;
|
||||
CharacterDatabase.DirectPExecute("INSERT INTO instance_reset VALUES ('%u','"UI64FMTD"')", i, (uint64)t);
|
||||
CharacterDatabase.DirectPExecute("INSERT INTO instance_reset VALUES ('%u','%u','"UI64FMTD"')", mapid, difficulty, (uint64)t);
|
||||
}
|
||||
|
||||
if(t < now)
|
||||
|
|
@ -477,17 +491,23 @@ void InstanceSaveManager::LoadResetTimes()
|
|||
// calculate the next reset time
|
||||
t = (t / DAY) * DAY;
|
||||
t += ((today - t) / period + 1) * period + diff;
|
||||
CharacterDatabase.DirectPExecute("UPDATE instance_reset SET resettime = '"UI64FMTD"' WHERE mapid = '%u'", (uint64)t, i);
|
||||
CharacterDatabase.DirectPExecute("UPDATE instance_reset SET resettime = '"UI64FMTD"' WHERE mapid = '%u' AND difficulty= '%u'", (uint64)t, mapid, difficulty);
|
||||
}
|
||||
|
||||
m_resetTimeByMapId[temp->map] = t;
|
||||
SetResetTimeFor(mapid,difficulty,t);
|
||||
|
||||
// schedule the global reset/warning
|
||||
uint8 type = 1;
|
||||
static int tim[4] = {3600, 900, 300, 60};
|
||||
for(; type < 4; type++)
|
||||
if(t - tim[type-1] > now) break;
|
||||
ScheduleReset(true, t - tim[type-1], InstResetEvent(type, i));
|
||||
if(t - tim[type-1] > now)
|
||||
break;
|
||||
|
||||
for(ResetTimeMapDiffInstances::const_iterator in_itr = mapDiffResetInstances.lower_bound(map_diff_pair);
|
||||
in_itr != mapDiffResetInstances.upper_bound(map_diff_pair); ++in_itr)
|
||||
{
|
||||
ScheduleReset(true, t - tim[type-1], InstResetEvent(type, mapid, difficulty, in_itr->second));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -528,8 +548,8 @@ void InstanceSaveManager::Update()
|
|||
else
|
||||
{
|
||||
// global reset/warning for a certain map
|
||||
time_t resetTime = GetResetTimeFor(event.mapid);
|
||||
_ResetOrWarnAll(event.mapid, event.type != 4, resetTime - now);
|
||||
time_t resetTime = GetResetTimeFor(event.mapid,event.difficulty);
|
||||
_ResetOrWarnAll(event.mapid, event.difficulty, event.type != 4, resetTime - now);
|
||||
if(event.type != 4)
|
||||
{
|
||||
// schedule the next warning/reset
|
||||
|
|
@ -580,29 +600,28 @@ void InstanceSaveManager::_ResetInstance(uint32 mapid, uint32 instanceId)
|
|||
else sObjectMgr.DeleteRespawnTimeForInstance(instanceId); // even if map is not loaded
|
||||
}
|
||||
|
||||
void InstanceSaveManager::_ResetOrWarnAll(uint32 mapid, bool warn, uint32 timeLeft)
|
||||
void InstanceSaveManager::_ResetOrWarnAll(uint32 mapid, Difficulty difficulty, bool warn, uint32 timeLeft)
|
||||
{
|
||||
// global reset for all instances of the given map
|
||||
// note: this isn't fast but it's meant to be executed very rarely
|
||||
Map const *map = sMapMgr.CreateBaseMap(mapid);
|
||||
if(!map->Instanceable())
|
||||
MapEntry const *mapEntry = sMapStore.LookupEntry(mapid);
|
||||
if (!mapEntry->Instanceable())
|
||||
return;
|
||||
|
||||
uint64 now = (uint64)time(NULL);
|
||||
|
||||
if(!warn)
|
||||
if (!warn)
|
||||
{
|
||||
// this is called one minute before the reset time
|
||||
InstanceTemplate const* temp = ObjectMgr::GetInstanceTemplate(mapid);
|
||||
if(!temp || !temp->reset_delay)
|
||||
MapDifficulty const* mapDiff = GetMapDifficultyData(mapid,difficulty);
|
||||
if (!mapDiff || !mapDiff->resetTime)
|
||||
{
|
||||
sLog.outError("InstanceSaveManager::ResetOrWarnAll: no instance template or reset delay for map %d", mapid);
|
||||
sLog.outError("InstanceSaveManager::ResetOrWarnAll: not valid difficulty or no reset delay for map %d", mapid);
|
||||
return;
|
||||
}
|
||||
|
||||
// remove all binds to instances of the given map
|
||||
for(InstanceSaveHashMap::iterator itr = m_instanceSaveById.begin(); itr != m_instanceSaveById.end();)
|
||||
{
|
||||
if(itr->second->GetMapId() == mapid)
|
||||
if (itr->second->GetMapId() == mapid && itr->second->GetDifficulty() == difficulty)
|
||||
_ResetSave(itr);
|
||||
else
|
||||
++itr;
|
||||
|
|
@ -617,12 +636,14 @@ void InstanceSaveManager::_ResetOrWarnAll(uint32 mapid, bool warn, uint32 timeLe
|
|||
|
||||
// calculate the next reset time
|
||||
uint32 diff = sWorld.getConfig(CONFIG_INSTANCE_RESET_TIME_HOUR) * HOUR;
|
||||
uint32 period = temp->reset_delay * DAY;
|
||||
uint32 period = mapDiff->resetTime * DAY;
|
||||
uint64 next_reset = ((now + timeLeft + MINUTE) / DAY * DAY) + period + diff;
|
||||
// update it in the DB
|
||||
CharacterDatabase.PExecute("UPDATE instance_reset SET resettime = '"UI64FMTD"' WHERE mapid = '%d'", next_reset, mapid);
|
||||
CharacterDatabase.PExecute("UPDATE instance_reset SET resettime = '"UI64FMTD"' WHERE mapid = '%d' AND difficulty = '%d'", next_reset, mapid, difficulty);
|
||||
}
|
||||
|
||||
// note: this isn't fast but it's meant to be executed very rarely
|
||||
Map const *map = sMapMgr.CreateBaseMap(mapid); // _not_ include difficulty
|
||||
MapInstanced::InstancedMaps &instMaps = ((MapInstanced*)map)->GetInstancedMaps();
|
||||
MapInstanced::InstancedMaps::iterator mitr;
|
||||
for(mitr = instMaps.begin(); mitr != instMaps.end(); ++mitr)
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@
|
|||
#include "Utilities/UnorderedMap.h"
|
||||
#include "Database/DatabaseEnv.h"
|
||||
#include "DBCEnums.h"
|
||||
#include "ObjectDefines.h"
|
||||
|
||||
struct InstanceTemplate;
|
||||
struct MapEntry;
|
||||
|
|
@ -118,28 +119,39 @@ class MANGOS_DLL_DECL InstanceSaveManager : public MaNGOS::Singleton<InstanceSav
|
|||
InstanceSaveManager();
|
||||
~InstanceSaveManager();
|
||||
|
||||
typedef std::map<uint32 /*InstanceId*/, InstanceSave*> InstanceSaveMap;
|
||||
typedef UNORDERED_MAP<uint32 /*InstanceId*/, InstanceSave*> InstanceSaveHashMap;
|
||||
typedef std::map<uint32 /*mapId*/, InstanceSaveMap> InstanceSaveMapMap;
|
||||
typedef UNORDERED_MAP<uint32 /*mapId*/, InstanceSaveHashMap> InstanceSaveMapMap;
|
||||
|
||||
/* resetTime is a global propery of each (raid/heroic) map
|
||||
all instances of that map reset at the same time */
|
||||
struct InstResetEvent
|
||||
{
|
||||
uint8 type;
|
||||
Difficulty difficulty:8;
|
||||
uint16 mapid;
|
||||
uint16 instanceId;
|
||||
InstResetEvent(uint8 t = 0, uint16 m = 0, uint16 i = 0) : type(t), mapid(m), instanceId(i) {}
|
||||
|
||||
InstResetEvent() : type(0), difficulty(DUNGEON_DIFFICULTY_NORMAL), mapid(0), instanceId(0) {}
|
||||
InstResetEvent(uint8 t, uint32 _mapid, Difficulty d, uint16 _instanceid)
|
||||
: type(t), difficulty(d), mapid(_mapid), instanceId(_instanceid) {}
|
||||
bool operator == (const InstResetEvent& e) { return e.instanceId == instanceId; }
|
||||
};
|
||||
typedef std::multimap<time_t /*resetTime*/, InstResetEvent> ResetTimeQueue;
|
||||
typedef std::vector<time_t /*resetTime*/> ResetTimeVector;
|
||||
typedef UNORDERED_MAP<uint32 /*PAIR32(map,difficulty)*/,time_t /*resetTime*/> ResetTimeByMapDifficultyMap;
|
||||
|
||||
void CleanupInstances();
|
||||
void PackInstances();
|
||||
|
||||
void LoadResetTimes();
|
||||
time_t GetResetTimeFor(uint32 mapid) { return m_resetTimeByMapId[mapid]; }
|
||||
time_t GetResetTimeFor(uint32 mapid, Difficulty d) const
|
||||
{
|
||||
ResetTimeByMapDifficultyMap::const_iterator itr = m_resetTimeByMapDifficulty.find(MAKE_PAIR32(mapid,d));
|
||||
return itr != m_resetTimeByMapDifficulty.end() ? itr->second : 0;
|
||||
}
|
||||
void SetResetTimeFor(uint32 mapid, Difficulty d, time_t t)
|
||||
{
|
||||
m_resetTimeByMapDifficulty[MAKE_PAIR32(mapid,d)] = t;
|
||||
}
|
||||
void ScheduleReset(bool add, time_t time, InstResetEvent event);
|
||||
|
||||
void Update();
|
||||
|
|
@ -156,7 +168,7 @@ class MANGOS_DLL_DECL InstanceSaveManager : public MaNGOS::Singleton<InstanceSav
|
|||
uint32 GetNumBoundGroupsTotal();
|
||||
|
||||
private:
|
||||
void _ResetOrWarnAll(uint32 mapid, bool warn, uint32 timeleft);
|
||||
void _ResetOrWarnAll(uint32 mapid, Difficulty difficulty, bool warn, uint32 timeleft);
|
||||
void _ResetInstance(uint32 mapid, uint32 instanceId);
|
||||
void _ResetSave(InstanceSaveHashMap::iterator &itr);
|
||||
void _DelHelper(DatabaseType &db, const char *fields, const char *table, const char *queryTail,...);
|
||||
|
|
@ -164,8 +176,8 @@ class MANGOS_DLL_DECL InstanceSaveManager : public MaNGOS::Singleton<InstanceSav
|
|||
bool lock_instLists;
|
||||
// fast lookup by instance id
|
||||
InstanceSaveHashMap m_instanceSaveById;
|
||||
// fast lookup for reset times
|
||||
ResetTimeVector m_resetTimeByMapId;
|
||||
// fast lookup for reset times (always use existed functions for access/set)
|
||||
ResetTimeByMapDifficultyMap m_resetTimeByMapDifficulty;
|
||||
ResetTimeQueue m_resetTimeQueue;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
#include "Common.h"
|
||||
#include "Item.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "ObjectDefines.h"
|
||||
#include "WorldPacket.h"
|
||||
#include "Database/DatabaseEnv.h"
|
||||
#include "ItemEnchantmentMgr.h"
|
||||
|
|
|
|||
|
|
@ -332,7 +332,15 @@ enum MangosStrings
|
|||
LANG_CUSTOMIZE_PLAYER_GUID = 346,
|
||||
LANG_COMMAND_GOTAXINODENOTFOUND = 347,
|
||||
LANG_GAMEOBJECT_HAVE_INVALID_DATA = 348,
|
||||
// Room for more level 2 349-399 not used
|
||||
LANG_TITLE_LIST_CHAT = 349,
|
||||
LANG_TITLE_LIST_CONSOLE = 350,
|
||||
LANG_COMMAND_NOTITLEFOUND = 351,
|
||||
LANG_INVALID_TITLE_ID = 352,
|
||||
LANG_TITLE_ADD_RES = 353,
|
||||
LANG_TITLE_REMOVE_RES = 354,
|
||||
LANG_TITLE_CURRENT_RES = 355,
|
||||
LANG_CURRENT_TITLE_RESET = 356,
|
||||
// Room for more level 2 357-399 not used
|
||||
|
||||
// level 3 chat
|
||||
LANG_SCRIPTS_RELOADED = 400,
|
||||
|
|
|
|||
|
|
@ -637,42 +637,6 @@ bool ChatHandler::HandleRecallCommand(const char* args)
|
|||
return true;
|
||||
}
|
||||
|
||||
//Edit Player KnownTitles
|
||||
bool ChatHandler::HandleModifyKnownTitlesCommand(const char* args)
|
||||
{
|
||||
if(!*args)
|
||||
return false;
|
||||
|
||||
uint64 titles = 0;
|
||||
|
||||
sscanf((char*)args, UI64FMTD, &titles);
|
||||
|
||||
Player *chr = getSelectedPlayer();
|
||||
if (!chr)
|
||||
{
|
||||
SendSysMessage(LANG_NO_CHAR_SELECTED);
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(chr, 0))
|
||||
return false;
|
||||
|
||||
uint64 titles2 = titles;
|
||||
|
||||
for(uint32 i = 1; i < sCharTitlesStore.GetNumRows(); ++i)
|
||||
if(CharTitlesEntry const* tEntry = sCharTitlesStore.LookupEntry(i))
|
||||
titles2 &= ~(uint64(1) << tEntry->bit_index);
|
||||
|
||||
titles &= ~titles2; // remove not existed titles
|
||||
|
||||
chr->SetUInt64Value(PLAYER__FIELD_KNOWN_TITLES, titles);
|
||||
SendSysMessage(LANG_DONE);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//Edit Player HP
|
||||
bool ChatHandler::HandleModifyHPCommand(const char* args)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -18,7 +18,9 @@
|
|||
|
||||
#include "Common.h"
|
||||
#include "Database/DatabaseEnv.h"
|
||||
#include "DBCStores.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "ObjectDefines.h"
|
||||
#include "Player.h"
|
||||
#include "Item.h"
|
||||
#include "GameObject.h"
|
||||
|
|
@ -4202,3 +4204,303 @@ bool ChatHandler::HandleWaterwalkCommand(const char* args)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleLookupTitleCommand(const char* args)
|
||||
{
|
||||
if(!*args)
|
||||
return false;
|
||||
|
||||
// can be NULL in console call
|
||||
Player* target = getSelectedPlayer();
|
||||
|
||||
// title name have single string arg for player name
|
||||
char const* targetName = target ? target->GetName() : "NAME";
|
||||
|
||||
std::string namepart = args;
|
||||
std::wstring wnamepart;
|
||||
|
||||
if(!Utf8toWStr(namepart,wnamepart))
|
||||
return false;
|
||||
|
||||
// converting string that we try to find to lower case
|
||||
wstrToLower( wnamepart );
|
||||
|
||||
uint32 counter = 0; // Counter for figure out that we found smth.
|
||||
|
||||
// Search in CharTitles.dbc
|
||||
for (uint32 id = 0; id < sCharTitlesStore.GetNumRows(); id++)
|
||||
{
|
||||
CharTitlesEntry const *titleInfo = sCharTitlesStore.LookupEntry(id);
|
||||
if(titleInfo)
|
||||
{
|
||||
int loc = GetSessionDbcLocale();
|
||||
std::string name = titleInfo->name[loc];
|
||||
if(name.empty())
|
||||
continue;
|
||||
|
||||
if (!Utf8FitTo(name, wnamepart))
|
||||
{
|
||||
loc = 0;
|
||||
for(; loc < MAX_LOCALE; ++loc)
|
||||
{
|
||||
if(loc==GetSessionDbcLocale())
|
||||
continue;
|
||||
|
||||
name = titleInfo->name[loc];
|
||||
if(name.empty())
|
||||
continue;
|
||||
|
||||
if (Utf8FitTo(name, wnamepart))
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(loc < MAX_LOCALE)
|
||||
{
|
||||
char const* knownStr = target && target->HasTitle(titleInfo) ? GetMangosString(LANG_KNOWN) : "";
|
||||
|
||||
char const* activeStr = target && target->GetUInt32Value(PLAYER_CHOSEN_TITLE)==titleInfo->bit_index
|
||||
? GetMangosString(LANG_ACTIVE)
|
||||
: "";
|
||||
|
||||
char titleNameStr[80];
|
||||
snprintf(titleNameStr,80,name.c_str(),targetName);
|
||||
|
||||
// send title in "id (idx:idx) - [namedlink locale]" format
|
||||
if (m_session)
|
||||
PSendSysMessage(LANG_TITLE_LIST_CHAT,id,titleInfo->bit_index,id,titleNameStr,localeNames[loc],knownStr,activeStr);
|
||||
else
|
||||
PSendSysMessage(LANG_TITLE_LIST_CONSOLE,id,titleInfo->bit_index,titleNameStr,localeNames[loc],knownStr,activeStr);
|
||||
|
||||
++counter;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (counter == 0) // if counter == 0 then we found nth
|
||||
SendSysMessage(LANG_COMMAND_NOTITLEFOUND);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleTitlesAddCommand(const char* args)
|
||||
{
|
||||
// number or [name] Shift-click form |color|Htitle:title_id|h[name]|h|r
|
||||
char* id_p = extractKeyFromLink((char*)args,"Htitle");
|
||||
if(!id_p)
|
||||
return false;
|
||||
|
||||
int32 id = atoi(id_p);
|
||||
if (id <= 0)
|
||||
{
|
||||
PSendSysMessage(LANG_INVALID_TITLE_ID, id);
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
Player * target = getSelectedPlayer();
|
||||
if(!target)
|
||||
{
|
||||
SendSysMessage(LANG_NO_CHAR_SELECTED);
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(target, 0))
|
||||
return false;
|
||||
|
||||
CharTitlesEntry const* titleInfo = sCharTitlesStore.LookupEntry(id);
|
||||
if(!titleInfo)
|
||||
{
|
||||
PSendSysMessage(LANG_INVALID_TITLE_ID, id);
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string tNameLink = GetNameLink(target);
|
||||
|
||||
char const* targetName = target->GetName();
|
||||
char titleNameStr[80];
|
||||
snprintf(titleNameStr,80,titleInfo->name[GetSessionDbcLocale()],targetName);
|
||||
|
||||
target->SetTitle(titleInfo);
|
||||
PSendSysMessage(LANG_TITLE_ADD_RES, id, titleNameStr, tNameLink.c_str());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleTitlesRemoveCommand(const char* args)
|
||||
{
|
||||
// number or [name] Shift-click form |color|Htitle:title_id|h[name]|h|r
|
||||
char* id_p = extractKeyFromLink((char*)args,"Htitle");
|
||||
if(!id_p)
|
||||
return false;
|
||||
|
||||
int32 id = atoi(id_p);
|
||||
if (id <= 0)
|
||||
{
|
||||
PSendSysMessage(LANG_INVALID_TITLE_ID, id);
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
Player * target = getSelectedPlayer();
|
||||
if(!target)
|
||||
{
|
||||
SendSysMessage(LANG_NO_CHAR_SELECTED);
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(target, 0))
|
||||
return false;
|
||||
|
||||
CharTitlesEntry const* titleInfo = sCharTitlesStore.LookupEntry(id);
|
||||
if(!titleInfo)
|
||||
{
|
||||
PSendSysMessage(LANG_INVALID_TITLE_ID, id);
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
target->SetTitle(titleInfo,true);
|
||||
|
||||
std::string tNameLink = GetNameLink(target);
|
||||
|
||||
char const* targetName = target->GetName();
|
||||
char titleNameStr[80];
|
||||
snprintf(titleNameStr,80,titleInfo->name[GetSessionDbcLocale()],targetName);
|
||||
|
||||
PSendSysMessage(LANG_TITLE_REMOVE_RES, id, titleNameStr, tNameLink.c_str());
|
||||
|
||||
if (!target->HasTitle(target->GetInt32Value(PLAYER_CHOSEN_TITLE)))
|
||||
{
|
||||
target->SetUInt32Value(PLAYER_CHOSEN_TITLE,0);
|
||||
PSendSysMessage(LANG_CURRENT_TITLE_RESET, tNameLink.c_str());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//Edit Player KnownTitles
|
||||
bool ChatHandler::HandleTitlesSetMaskCommand(const char* args)
|
||||
{
|
||||
if(!*args)
|
||||
return false;
|
||||
|
||||
uint64 titles = 0;
|
||||
|
||||
sscanf((char*)args, UI64FMTD, &titles);
|
||||
|
||||
Player *target = getSelectedPlayer();
|
||||
if (!target)
|
||||
{
|
||||
SendSysMessage(LANG_NO_CHAR_SELECTED);
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(target, 0))
|
||||
return false;
|
||||
|
||||
uint64 titles2 = titles;
|
||||
|
||||
for(uint32 i = 1; i < sCharTitlesStore.GetNumRows(); ++i)
|
||||
if(CharTitlesEntry const* tEntry = sCharTitlesStore.LookupEntry(i))
|
||||
titles2 &= ~(uint64(1) << tEntry->bit_index);
|
||||
|
||||
titles &= ~titles2; // remove not existed titles
|
||||
|
||||
target->SetUInt64Value(PLAYER__FIELD_KNOWN_TITLES, titles);
|
||||
SendSysMessage(LANG_DONE);
|
||||
|
||||
if (!target->HasTitle(target->GetInt32Value(PLAYER_CHOSEN_TITLE)))
|
||||
{
|
||||
target->SetUInt32Value(PLAYER_CHOSEN_TITLE,0);
|
||||
PSendSysMessage(LANG_CURRENT_TITLE_RESET,GetNameLink(target).c_str());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleCharacterTitlesCommand(const char* args)
|
||||
{
|
||||
Player* target;
|
||||
if(!extractPlayerTarget((char*)args,&target))
|
||||
return false;
|
||||
|
||||
LocaleConstant loc = GetSessionDbcLocale();
|
||||
char const* targetName = target->GetName();
|
||||
char const* knownStr = GetMangosString(LANG_KNOWN);
|
||||
|
||||
// Search in CharTitles.dbc
|
||||
for (uint32 id = 0; id < sCharTitlesStore.GetNumRows(); id++)
|
||||
{
|
||||
CharTitlesEntry const *titleInfo = sCharTitlesStore.LookupEntry(id);
|
||||
if (titleInfo && target->HasTitle(titleInfo))
|
||||
{
|
||||
std::string name = titleInfo->name[loc];
|
||||
if(name.empty())
|
||||
continue;
|
||||
|
||||
char const* activeStr = target && target->GetUInt32Value(PLAYER_CHOSEN_TITLE)==titleInfo->bit_index
|
||||
? GetMangosString(LANG_ACTIVE)
|
||||
: "";
|
||||
|
||||
char titleNameStr[80];
|
||||
snprintf(titleNameStr,80,name.c_str(),targetName);
|
||||
|
||||
// send title in "id (idx:idx) - [namedlink locale]" format
|
||||
if (m_session)
|
||||
PSendSysMessage(LANG_TITLE_LIST_CHAT,id,titleInfo->bit_index,id,titleNameStr,localeNames[loc],knownStr,activeStr);
|
||||
else
|
||||
PSendSysMessage(LANG_TITLE_LIST_CONSOLE,id,titleInfo->bit_index,name.c_str(),localeNames[loc],knownStr,activeStr);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleTitlesCurrentCommand(const char* args)
|
||||
{
|
||||
// number or [name] Shift-click form |color|Htitle:title_id|h[name]|h|r
|
||||
char* id_p = extractKeyFromLink((char*)args,"Htitle");
|
||||
if(!id_p)
|
||||
return false;
|
||||
|
||||
int32 id = atoi(id_p);
|
||||
if (id <= 0)
|
||||
{
|
||||
PSendSysMessage(LANG_INVALID_TITLE_ID, id);
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
Player * target = getSelectedPlayer();
|
||||
if(!target)
|
||||
{
|
||||
SendSysMessage(LANG_NO_CHAR_SELECTED);
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(target, 0))
|
||||
return false;
|
||||
|
||||
CharTitlesEntry const* titleInfo = sCharTitlesStore.LookupEntry(id);
|
||||
if(!titleInfo)
|
||||
{
|
||||
PSendSysMessage(LANG_INVALID_TITLE_ID, id);
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string tNameLink = GetNameLink(target);
|
||||
|
||||
target->SetTitle(titleInfo); // to be sure that title now known
|
||||
target->SetUInt32Value(PLAYER_CHOSEN_TITLE,titleInfo->bit_index);
|
||||
|
||||
PSendSysMessage(LANG_TITLE_CURRENT_RES, id, titleInfo->name[GetSessionDbcLocale()], tNameLink.c_str());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1048,7 +1048,7 @@ bool ChatHandler::HandleSetSkillCommand(const char* args)
|
|||
|
||||
if(!target->GetSkillValue(skill))
|
||||
{
|
||||
PSendSysMessage(LANG_SET_SKILL_ERROR, tNameLink.c_str(), skill, sl->name[0]);
|
||||
PSendSysMessage(LANG_SET_SKILL_ERROR, tNameLink.c_str(), skill, sl->name[GetSessionDbcLocale()]);
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
|
@ -1059,7 +1059,7 @@ bool ChatHandler::HandleSetSkillCommand(const char* args)
|
|||
return false;
|
||||
|
||||
target->SetSkill(skill, level, max);
|
||||
PSendSysMessage(LANG_SET_SKILL, skill, sl->name[0], tNameLink.c_str(), level, max);
|
||||
PSendSysMessage(LANG_SET_SKILL, skill, sl->name[GetSessionDbcLocale()], tNameLink.c_str(), level, max);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -3511,7 +3511,6 @@ bool ChatHandler::HandleReviveCommand(const char* args)
|
|||
{
|
||||
target->ResurrectPlayer(0.5f);
|
||||
target->SpawnCorpseBones();
|
||||
target->SaveToDB();
|
||||
}
|
||||
else
|
||||
// will resurrected at login without corpse
|
||||
|
|
@ -6394,4 +6393,4 @@ bool ChatHandler::HandleModifyGenderCommand(const char *args)
|
|||
ChatHandler(player).PSendSysMessage(LANG_YOUR_GENDER_CHANGED, gender_full, GetNameLink().c_str());
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@
|
|||
#include "GameObject.h"
|
||||
#include "Player.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ObjectDefines.h"
|
||||
#include "WorldSession.h"
|
||||
#include "LootMgr.h"
|
||||
#include "Object.h"
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@
|
|||
#include "Log.h"
|
||||
#include "World.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "ObjectDefines.h"
|
||||
#include "Player.h"
|
||||
#include "UpdateMask.h"
|
||||
#include "Unit.h"
|
||||
|
|
|
|||
|
|
@ -1127,6 +1127,23 @@ void Map::UnloadAll(bool pForce)
|
|||
}
|
||||
}
|
||||
|
||||
MapDifficulty const* Map::GetMapDifficulty() const
|
||||
{
|
||||
return GetMapDifficultyData(GetId(),GetDifficulty());
|
||||
}
|
||||
|
||||
uint32 Map::GetMaxPlayers() const
|
||||
{
|
||||
MapDifficulty const* mapDiff = GetMapDifficulty();
|
||||
return mapDiff ? mapDiff->maxPlayers : 0;
|
||||
}
|
||||
|
||||
uint32 Map::GetMaxResetDelay() const
|
||||
{
|
||||
MapDifficulty const* mapDiff = GetMapDifficulty();
|
||||
return mapDiff ? mapDiff->resetTime : 0;
|
||||
}
|
||||
|
||||
//*****************************
|
||||
// Grid function
|
||||
//*****************************
|
||||
|
|
@ -2610,22 +2627,14 @@ void InstanceMap::SetResetSchedule(bool on)
|
|||
// only for normal instances
|
||||
// the reset time is only scheduled when there are no payers inside
|
||||
// it is assumed that the reset time will rarely (if ever) change while the reset is scheduled
|
||||
if(IsDungeon() && !HavePlayers() && !IsRaid() && !IsHeroic())
|
||||
if(IsDungeon() && !HavePlayers() && !IsRaidOrHeroicDungeon())
|
||||
{
|
||||
InstanceSave *save = sInstanceSaveMgr.GetInstanceSave(GetInstanceId());
|
||||
if(!save) sLog.outError("InstanceMap::SetResetSchedule: cannot turn schedule %s, no save available for instance %d of %d", on ? "on" : "off", GetInstanceId(), GetId());
|
||||
else sInstanceSaveMgr.ScheduleReset(on, save->GetResetTime(), InstanceSaveManager::InstResetEvent(0, GetId(), GetInstanceId()));
|
||||
else sInstanceSaveMgr.ScheduleReset(on, save->GetResetTime(), InstanceSaveManager::InstResetEvent(0, GetId(), Difficulty(GetSpawnMode()), GetInstanceId()));
|
||||
}
|
||||
}
|
||||
|
||||
uint32 InstanceMap::GetMaxPlayers() const
|
||||
{
|
||||
InstanceTemplate const* iTemplate = ObjectMgr::GetInstanceTemplate(GetId());
|
||||
if(!iTemplate)
|
||||
return 0;
|
||||
return IsHeroic() ? iTemplate->maxPlayersHeroic : iTemplate->maxPlayers;
|
||||
}
|
||||
|
||||
/* ******* Battleground Instance Maps ******* */
|
||||
|
||||
BattleGroundMap::BattleGroundMap(uint32 id, time_t expiry, uint32 InstanceId, Map* _parent, uint8 spawnMode)
|
||||
|
|
@ -3560,4 +3569,3 @@ uint32 Map::GenerateLocalLowGuid(HighGuid guidhigh)
|
|||
ASSERT(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -227,9 +227,6 @@ struct InstanceTemplate
|
|||
uint32 parent;
|
||||
uint32 levelMin;
|
||||
uint32 levelMax;
|
||||
uint32 maxPlayers;
|
||||
uint32 maxPlayersHeroic;
|
||||
uint32 reset_delay; // FIX ME: now exist normal/heroic raids with possible different time of reset.
|
||||
float startLocX;
|
||||
float startLocY;
|
||||
float startLocZ;
|
||||
|
|
@ -365,15 +362,25 @@ class MANGOS_DLL_SPEC Map : public GridRefManager<NGridType>, public MaNGOS::Obj
|
|||
bool CheckGridIntegrity(Creature* c, bool moved) const;
|
||||
|
||||
uint32 GetInstanceId() const { return i_InstanceId; }
|
||||
uint8 GetSpawnMode() const { return (i_spawnMode); }
|
||||
virtual bool CanEnter(Player* /*player*/) { return true; }
|
||||
const char* GetMapName() const;
|
||||
|
||||
// have meaning only for instanced map (that have set real difficulty), NOT USE its for BaseMap
|
||||
// _currently_ spawnmode == difficulty, but this can be changes later, so use appropriate spawmmode/difficult functions
|
||||
// for simplify later code support
|
||||
// regular difficulty = continent/dungeon normal/first raid normal difficulty
|
||||
uint8 GetSpawnMode() const { return (i_spawnMode); }
|
||||
Difficulty GetDifficulty() const { return Difficulty(GetSpawnMode()); }
|
||||
bool IsRegularDifficulty() const { return GetDifficulty() == REGULAR_DIFFICULTY; }
|
||||
uint32 GetMaxPlayers() const; // dependent from map difficulty
|
||||
uint32 GetMaxResetDelay() const; // dependent from map difficulty
|
||||
MapDifficulty const* GetMapDifficulty() const; // dependent from map difficulty
|
||||
|
||||
bool Instanceable() const { return i_mapEntry && i_mapEntry->Instanceable(); }
|
||||
// NOTE: this duplicate of Instanceable(), but Instanceable() can be changed when BG also will be instanceable
|
||||
bool IsDungeon() const { return i_mapEntry && i_mapEntry->IsDungeon(); }
|
||||
bool IsRaid() const { return i_mapEntry && i_mapEntry->IsRaid(); }
|
||||
bool IsHeroic() const { return IsRaid() ? i_spawnMode >= RAID_DIFFICULTY_10MAN_HEROIC : i_spawnMode >= DUNGEON_DIFFICULTY_HEROIC; }
|
||||
bool IsRaidOrHeroicDungeon() const { return IsRaid() || GetDifficulty() > DUNGEON_DIFFICULTY_NORMAL; }
|
||||
bool IsBattleGround() const { return i_mapEntry && i_mapEntry->IsBattleGround(); }
|
||||
bool IsBattleArena() const { return i_mapEntry && i_mapEntry->IsBattleArena(); }
|
||||
bool IsBattleGroundOrArena() const { return i_mapEntry && i_mapEntry->IsBattleGroundOrArena(); }
|
||||
|
|
@ -599,7 +606,6 @@ class MANGOS_DLL_SPEC InstanceMap : public Map
|
|||
bool CanEnter(Player* player);
|
||||
void SendResetWarnings(uint32 timeLeft) const;
|
||||
void SetResetSchedule(bool on);
|
||||
uint32 GetMaxPlayers() const;
|
||||
|
||||
virtual void InitVisibilityDistance();
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ MapManager::_createBaseMap(uint32 id)
|
|||
}
|
||||
else
|
||||
{
|
||||
m = new Map(id, i_gridCleanUpDelay, 0, DUNGEON_DIFFICULTY_NORMAL);
|
||||
m = new Map(id, i_gridCleanUpDelay, 0, REGULAR_DIFFICULTY);
|
||||
}
|
||||
i_maps[id] = m;
|
||||
}
|
||||
|
|
@ -184,13 +184,11 @@ bool MapManager::CanPlayerEnter(uint32 mapid, Player* player)
|
|||
MapDifficulty const* mapDiff = GetMapDifficultyData(entry->MapID,player->GetDifficulty(entry->map_type == MAP_RAID));
|
||||
if (!mapDiff)
|
||||
{
|
||||
bool isNormalTargetMap = entry->map_type == MAP_RAID
|
||||
? (player->GetRaidDifficulty() == RAID_DIFFICULTY_10MAN_NORMAL)
|
||||
: (player->GetDungeonDifficulty() == DUNGEON_DIFFICULTY_NORMAL);
|
||||
bool isRegularTargetMap = player->GetDifficulty(entry->IsRaid()) == REGULAR_DIFFICULTY;
|
||||
|
||||
//Send aborted message
|
||||
// FIX ME: what about absent normal/heroic mode with specific players limit...
|
||||
player->SendTransferAborted(mapid, TRANSFER_ABORT_DIFFICULTY, isNormalTargetMap ? DUNGEON_DIFFICULTY_NORMAL : DUNGEON_DIFFICULTY_HEROIC);
|
||||
player->SendTransferAborted(mapid, TRANSFER_ABORT_DIFFICULTY, isRegularTargetMap ? DUNGEON_DIFFICULTY_NORMAL : DUNGEON_DIFFICULTY_HEROIC);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@
|
|||
#include "Player.h"
|
||||
#include "World.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "ObjectDefines.h"
|
||||
#include "WorldSession.h"
|
||||
#include "Auth/BigNumber.h"
|
||||
#include "Auth/Sha1.h"
|
||||
|
|
@ -669,8 +670,7 @@ void WorldSession::HandleResurrectResponseOpcode(WorldPacket & recv_data)
|
|||
if(!GetPlayer()->isRessurectRequestedBy(guid))
|
||||
return;
|
||||
|
||||
GetPlayer()->ResurectUsingRequestData();
|
||||
GetPlayer()->SaveToDB();
|
||||
GetPlayer()->ResurectUsingRequestData(); // will call spawncorpsebones
|
||||
}
|
||||
|
||||
void WorldSession::HandleAreaTriggerOpcode(WorldPacket & recv_data)
|
||||
|
|
@ -810,12 +810,10 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket & recv_data)
|
|||
if(!mapEntry)
|
||||
return;
|
||||
|
||||
bool isNormalTargetMap = mapEntry->IsRaid()
|
||||
? (GetPlayer()->GetRaidDifficulty() == RAID_DIFFICULTY_10MAN_NORMAL)
|
||||
: (GetPlayer()->GetDungeonDifficulty() == DUNGEON_DIFFICULTY_NORMAL);
|
||||
bool isRegularTargetMap = GetPlayer()->GetDifficulty(mapEntry->IsRaid()) == REGULAR_DIFFICULTY;
|
||||
|
||||
uint32 missingKey = 0;
|
||||
if (!isNormalTargetMap)
|
||||
if (!isRegularTargetMap)
|
||||
{
|
||||
if(at->heroicKey)
|
||||
{
|
||||
|
|
@ -828,7 +826,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket & recv_data)
|
|||
}
|
||||
|
||||
uint32 missingQuest = 0;
|
||||
if (!isNormalTargetMap)
|
||||
if (!isRegularTargetMap)
|
||||
{
|
||||
if (at->requiredQuestHeroic && !GetPlayer()->GetQuestRewardStatus(at->requiredQuestHeroic))
|
||||
missingQuest = at->requiredQuestHeroic;
|
||||
|
|
@ -845,7 +843,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket & recv_data)
|
|||
if(missingItem)
|
||||
SendAreaTriggerMessage(GetMangosString(LANG_LEVEL_MINREQUIRED_AND_ITEM), at->requiredLevel, ObjectMgr::GetItemPrototype(missingItem)->Name1);
|
||||
else if(missingKey)
|
||||
GetPlayer()->SendTransferAborted(at->target_mapId, TRANSFER_ABORT_DIFFICULTY, isNormalTargetMap ? DUNGEON_DIFFICULTY_NORMAL : DUNGEON_DIFFICULTY_HEROIC);
|
||||
GetPlayer()->SendTransferAborted(at->target_mapId, TRANSFER_ABORT_DIFFICULTY, isRegularTargetMap ? DUNGEON_DIFFICULTY_NORMAL : DUNGEON_DIFFICULTY_HEROIC);
|
||||
else if(missingQuest)
|
||||
SendAreaTriggerMessage(at->requiredFailedText.c_str());
|
||||
else if(missingLevel)
|
||||
|
|
|
|||
|
|
@ -141,20 +141,13 @@ void WorldSession::HandleMoveWorldportAckOpcode()
|
|||
}
|
||||
}
|
||||
|
||||
if (mInstance)
|
||||
if (mInstance && mEntry->IsDungeon())
|
||||
{
|
||||
if(mEntry->IsRaid())
|
||||
Difficulty diff = GetPlayer()->GetDifficulty(mEntry->IsRaid());
|
||||
if (uint32 timeReset = sInstanceSaveMgr.GetResetTimeFor(GetPlayer()->GetMapId(),diff))
|
||||
{
|
||||
uint32 timeleft = sInstanceSaveMgr.GetResetTimeFor(GetPlayer()->GetMapId()) - time(NULL);
|
||||
GetPlayer()->SendInstanceResetWarning(GetPlayer()->GetMapId(), GetPlayer()->GetRaidDifficulty(), timeleft);
|
||||
}
|
||||
else if(mEntry->IsNonRaidDungeon() && GetPlayer()->GetDungeonDifficulty() > DUNGEON_DIFFICULTY_NORMAL)
|
||||
{
|
||||
if(MapDifficulty const* mapDiff = GetMapDifficultyData(mEntry->MapID,GetPlayer()->GetDungeonDifficulty()))
|
||||
{
|
||||
uint32 timeleft = sInstanceSaveMgr.GetResetTimeFor(GetPlayer()->GetMapId()) - time(NULL);
|
||||
GetPlayer()->SendInstanceResetWarning(GetPlayer()->GetMapId(), GetPlayer()->GetDungeonDifficulty(), timeleft);
|
||||
}
|
||||
uint32 timeleft = timeReset - time(NULL);
|
||||
GetPlayer()->SendInstanceResetWarning(GetPlayer()->GetMapId(), diff, timeleft);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@
|
|||
#include "Player.h"
|
||||
#include "Vehicle.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "ObjectDefines.h"
|
||||
#include "UpdateData.h"
|
||||
#include "UpdateMask.h"
|
||||
#include "Util.h"
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@
|
|||
#include "Log.h"
|
||||
#include "MapManager.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "ObjectDefines.h"
|
||||
#include "SpellMgr.h"
|
||||
#include "UpdateMask.h"
|
||||
#include "World.h"
|
||||
|
|
@ -4593,42 +4594,14 @@ void ObjectMgr::LoadInstanceTemplate()
|
|||
if(!temp)
|
||||
continue;
|
||||
|
||||
const MapEntry* entry = sMapStore.LookupEntry(temp->map);
|
||||
if(!entry)
|
||||
{
|
||||
if(!MapManager::IsValidMAP(temp->map))
|
||||
sLog.outErrorDb("ObjectMgr::LoadInstanceTemplate: bad mapid %d for template!", temp->map);
|
||||
continue;
|
||||
}
|
||||
|
||||
//FIXME: now exist heroic instance, normal/heroic raid instances
|
||||
// entry->resetTimeHeroic store reset time for both heroic mode instance (raid and non-raid)
|
||||
// entry->resetTimeRaid store reset time for normal raid only
|
||||
// for current state entry->resetTimeRaid == entry->resetTimeHeroic in case raid instances with heroic mode.
|
||||
// but at some point wee need implement reset time dependent from raid instance mode
|
||||
if(temp->reset_delay == 0)
|
||||
if(!MapManager::IsValidMapCoord(temp->parent,temp->startLocX,temp->startLocY,temp->startLocZ,temp->startLocO))
|
||||
{
|
||||
MapDifficulty const* mapDiffNorm = GetMapDifficultyData(temp->map,DUNGEON_DIFFICULTY_NORMAL);
|
||||
MapDifficulty const* mapDiffHeroic = GetMapDifficultyData(temp->map,DUNGEON_DIFFICULTY_HEROIC);
|
||||
|
||||
// no reset time
|
||||
if ((!mapDiffNorm || mapDiffNorm->resetTime == 0) &&
|
||||
(!mapDiffHeroic || mapDiffHeroic->resetTime == 0))
|
||||
continue;
|
||||
|
||||
// use defaults from the DBC
|
||||
if(mapDiffHeroic && mapDiffHeroic->resetTime) // for both raid and non raids, read above
|
||||
{
|
||||
temp->reset_delay = mapDiffHeroic->resetTime / DAY;
|
||||
}
|
||||
else if (mapDiffNorm && mapDiffNorm->resetTime && entry->map_type == MAP_RAID)
|
||||
// for normal raid only
|
||||
{
|
||||
temp->reset_delay = mapDiffNorm->resetTime / DAY;
|
||||
}
|
||||
sLog.outErrorDb("ObjectMgr::LoadInstanceTemplate: bad parent entrance coordinates for map id %d template!", temp->map);
|
||||
temp->parent = 0; // will have wrong continent 0 parent, at least existed
|
||||
}
|
||||
|
||||
// the reset_delay must be at least one day
|
||||
temp->reset_delay = std::max((uint32)1, (uint32)(temp->reset_delay * sWorld.getRate(RATE_INSTANCE_RESET_TIME)));
|
||||
}
|
||||
|
||||
sLog.outString( ">> Loaded %u Instance Template definitions", sInstanceTemplate.RecordCount );
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@
|
|||
#include "WorldSession.h"
|
||||
#include "World.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "ObjectDefines.h"
|
||||
#include "Log.h"
|
||||
#include "Opcodes.h"
|
||||
#include "Guild.h"
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@
|
|||
#include "CellImpl.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ObjectDefines.h"
|
||||
#include "CreatureAI.h"
|
||||
#include "Formulas.h"
|
||||
#include "Group.h"
|
||||
|
|
@ -4318,7 +4319,8 @@ void Player::CreateCorpse()
|
|||
void Player::SpawnCorpseBones()
|
||||
{
|
||||
if(sObjectAccessor.ConvertCorpseForPlayer(GetGUID()))
|
||||
SaveToDB(); // prevent loading as ghost without corpse
|
||||
if (!GetSession()->PlayerLogoutWithSave()) // at logout we will already store the player
|
||||
SaveToDB(); // prevent loading as ghost without corpse
|
||||
}
|
||||
|
||||
Corpse* Player::GetCorpse() const
|
||||
|
|
@ -14471,6 +14473,8 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
|
|||
// clear charm/summon related fields
|
||||
SetCharm(NULL);
|
||||
SetPet(NULL);
|
||||
SetTargetGUID(0);
|
||||
SetChannelObjectGUID(0);
|
||||
SetCharmerGUID(0);
|
||||
SetOwnerGUID(0);
|
||||
SetCreatorGUID(0);
|
||||
|
|
@ -15619,6 +15623,7 @@ bool Player::_LoadHomeBind(QueryResult *result)
|
|||
|
||||
void Player::SaveToDB()
|
||||
{
|
||||
// we should assure this: assert((m_nextSave != sWorld.getConfig(CONFIG_INTERVAL_SAVE)));
|
||||
// delay auto save at any saves (manual, in code, or autosave)
|
||||
m_nextSave = sWorld.getConfig(CONFIG_INTERVAL_SAVE);
|
||||
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@
|
|||
|
||||
#include "PoolManager.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "ObjectDefines.h"
|
||||
#include "ProgressBar.h"
|
||||
#include "Log.h"
|
||||
#include "MapManager.h"
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@
|
|||
#include "Log.h"
|
||||
#include "World.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "ObjectDefines.h"
|
||||
#include "Player.h"
|
||||
#include "UpdateMask.h"
|
||||
#include "NPCHandler.h"
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@
|
|||
#include "WorldPacket.h"
|
||||
#include "Player.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "ObjectDefines.h"
|
||||
#include "World.h"
|
||||
#include "Util.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -2319,7 +2319,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
|
|||
{
|
||||
if (m_target->GetMap()->IsDungeon())
|
||||
{
|
||||
uint32 spellId = m_target->GetMap()->IsHeroic() ? 46163 : 44190;
|
||||
uint32 spellId = m_target->GetMap()->IsRegularDifficulty() ? 44190 : 46163;
|
||||
|
||||
m_target->CastSpell(m_target, spellId, true, NULL, this);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1399,14 +1399,22 @@ void Spell::EffectDummy(uint32 i)
|
|||
return;
|
||||
|
||||
uint32 rage = m_caster->GetPower(POWER_RAGE);
|
||||
// Glyph of Execution bonus
|
||||
if (Aura *aura = m_caster->GetDummyAura(58367))
|
||||
rage+=aura->GetModifier()->m_amount;
|
||||
|
||||
int32 basePoints0 = damage+int32(rage * m_spellInfo->DmgMultiplier[i] +
|
||||
// up to max 30 rage cost
|
||||
if(rage > 30)
|
||||
rage = 30;
|
||||
|
||||
// Glyph of Execution bonus
|
||||
uint32 rage_modified = rage;
|
||||
|
||||
if (Aura *aura = m_caster->GetDummyAura(58367))
|
||||
rage_modified += aura->GetModifier()->m_amount;
|
||||
|
||||
int32 basePoints0 = damage+int32(rage_modified * m_spellInfo->DmgMultiplier[i] +
|
||||
m_caster->GetTotalAttackPowerValue(BASE_ATTACK)*0.2f);
|
||||
|
||||
m_caster->CastCustomSpell(unitTarget, 20647, &basePoints0, NULL, NULL, true, 0);
|
||||
m_caster->SetPower(POWER_RAGE, 0);
|
||||
m_caster->SetPower(POWER_RAGE, m_caster->GetPower(POWER_RAGE)-rage);
|
||||
return;
|
||||
}
|
||||
// Slam
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@
|
|||
#include "Transports.h"
|
||||
#include "MapManager.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "ObjectDefines.h"
|
||||
#include "Path.h"
|
||||
|
||||
#include "WorldPacket.h"
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@
|
|||
#include "WorldSession.h"
|
||||
#include "World.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "ObjectDefines.h"
|
||||
#include "SpellMgr.h"
|
||||
#include "Unit.h"
|
||||
#include "QuestDef.h"
|
||||
|
|
@ -683,7 +684,7 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
|
|||
|
||||
if(m->IsDungeon() && creditedPlayer)
|
||||
{
|
||||
if(m->IsRaid() || m->IsHeroic())
|
||||
if (m->IsRaidOrHeroicDungeon())
|
||||
{
|
||||
if(cVictim->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_INSTANCE_BIND)
|
||||
((InstanceMap *)m)->PermBindAllPlayers(creditedPlayer);
|
||||
|
|
|
|||
|
|
@ -137,13 +137,18 @@ enum UnitStandStateType
|
|||
UNIT_STAND_STATE_SIT_MEDIUM_CHAIR = 5,
|
||||
UNIT_STAND_STATE_SIT_HIGH_CHAIR = 6,
|
||||
UNIT_STAND_STATE_DEAD = 7,
|
||||
UNIT_STAND_STATE_KNEEL = 8
|
||||
UNIT_STAND_STATE_KNEEL = 8,
|
||||
UNIT_STAND_STATE_SUBMERGED = 9
|
||||
};
|
||||
|
||||
// byte flag value (UNIT_FIELD_BYTES_1,2)
|
||||
enum UnitStandFlags
|
||||
{
|
||||
UNIT_STAND_FLAGS_UNK1 = 0x01,
|
||||
UNIT_STAND_FLAGS_CREEP = 0x02,
|
||||
UNIT_STAND_FLAGS_UNK3 = 0x04,
|
||||
UNIT_STAND_FLAGS_UNK4 = 0x08,
|
||||
UNIT_STAND_FLAGS_UNK5 = 0x10,
|
||||
UNIT_STAND_FLAGS_ALL = 0xFF
|
||||
};
|
||||
|
||||
|
|
@ -151,6 +156,7 @@ enum UnitStandFlags
|
|||
enum UnitBytes1_Flags
|
||||
{
|
||||
UNIT_BYTE1_FLAG_ALWAYS_STAND = 0x01,
|
||||
UNIT_BYTE1_FLAG_UNK_2 = 0x02,
|
||||
UNIT_BYTE1_FLAG_UNTRACKABLE = 0x04,
|
||||
UNIT_BYTE1_FLAG_ALL = 0xFF
|
||||
};
|
||||
|
|
@ -195,7 +201,7 @@ enum SheathState
|
|||
#define MAX_SHEATH_STATE 3
|
||||
|
||||
// byte (1 from 0..3) of UNIT_FIELD_BYTES_2
|
||||
enum UnitBytes2_Flags
|
||||
enum UnitPVPStateFlags
|
||||
{
|
||||
UNIT_BYTE2_FLAG_PVP = 0x01,
|
||||
UNIT_BYTE2_FLAG_UNK1 = 0x02,
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ WorldSession::WorldSession(uint32 id, WorldSocket *sock, AccountTypes sec, uint8
|
|||
LookingForGroup_auto_join(false), LookingForGroup_auto_add(false), m_muteTime(mute_time),
|
||||
_player(NULL), m_Socket(sock),_security(sec), _accountId(id), m_expansion(expansion),
|
||||
m_sessionDbcLocale(sWorld.GetAvailableDbcLocale(locale)), m_sessionDbLocaleIndex(sObjectMgr.GetIndexForLocale(locale)),
|
||||
_logoutTime(0), m_inQueue(false), m_playerLoading(false), m_playerLogout(false), m_playerRecentlyLogout(false),
|
||||
_logoutTime(0), m_inQueue(false), m_playerLoading(false), m_playerLogout(false), m_playerRecentlyLogout(false), m_playerSave(false),
|
||||
m_latency(0), m_TutorialsChanged(false)
|
||||
{
|
||||
if (sock)
|
||||
|
|
@ -292,6 +292,7 @@ void WorldSession::LogoutPlayer(bool Save)
|
|||
HandleMoveWorldportAckOpcode();
|
||||
|
||||
m_playerLogout = true;
|
||||
m_playerSave = Save;
|
||||
|
||||
if (_player)
|
||||
{
|
||||
|
|
@ -454,6 +455,7 @@ void WorldSession::LogoutPlayer(bool Save)
|
|||
}
|
||||
|
||||
m_playerLogout = false;
|
||||
m_playerSave = false;
|
||||
m_playerRecentlyLogout = true;
|
||||
LogoutRequest(0);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -113,6 +113,8 @@ class MANGOS_DLL_SPEC WorldSession
|
|||
|
||||
bool PlayerLoading() const { return m_playerLoading; }
|
||||
bool PlayerLogout() const { return m_playerLogout; }
|
||||
bool PlayerLogoutWithSave() const { return m_playerLogout && m_playerSave; }
|
||||
|
||||
|
||||
void SizeError(WorldPacket const& packet, uint32 size) const;
|
||||
|
||||
|
|
@ -751,6 +753,7 @@ class MANGOS_DLL_SPEC WorldSession
|
|||
bool m_playerLoading; // code processed in LoginPlayer
|
||||
bool m_playerLogout; // code processed in LogoutPlayer
|
||||
bool m_playerRecentlyLogout;
|
||||
bool m_playerSave; // code processed in LogoutPlayer with save request
|
||||
LocaleConstant m_sessionDbcLocale;
|
||||
int m_sessionDbLocaleIndex;
|
||||
uint32 m_latency;
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@
|
|||
#include "BattleGroundMgr.h"
|
||||
#include <fstream>
|
||||
#include "ObjectMgr.h"
|
||||
#include "ObjectDefines.h"
|
||||
#include "SpellMgr.h"
|
||||
|
||||
bool ChatHandler::HandleDebugSendSpellFailCommand(const char* args)
|
||||
|
|
|
|||
|
|
@ -163,7 +163,7 @@ extern int main(int argc, char **argv)
|
|||
sLog.outDetail("%s (Library: %s)", OPENSSL_VERSION_TEXT, SSLeay_version(SSLEAY_VERSION));
|
||||
if (SSLeay() < 0x009080bfL )
|
||||
{
|
||||
sLog.outDetail("WARNING: Outdated version of OpenSSL lib. Logins to server impossible!");
|
||||
sLog.outDetail("WARNING: Outdated version of OpenSSL lib. Logins to server may not work!");
|
||||
sLog.outDetail("WARNING: Minimal required version [OpenSSL 0.9.8k]");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -414,12 +414,19 @@ bool Master::_StartDB()
|
|||
}
|
||||
|
||||
if(!WorldDatabase.CheckRequiredField("db_version",REVISION_DB_MANGOS))
|
||||
{
|
||||
///- Wait for already started DB delay threads to end
|
||||
WorldDatabase.HaltDelayThread();
|
||||
return false;
|
||||
}
|
||||
|
||||
dbstring = sConfig.GetStringDefault("CharacterDatabaseInfo", "");
|
||||
if(dbstring.empty())
|
||||
{
|
||||
sLog.outError("Character Database not specified in configuration file");
|
||||
|
||||
///- Wait for already started DB delay threads to end
|
||||
WorldDatabase.HaltDelayThread();
|
||||
return false;
|
||||
}
|
||||
sLog.outString("Character Database: %s", dbstring.c_str());
|
||||
|
|
@ -428,17 +435,29 @@ bool Master::_StartDB()
|
|||
if(!CharacterDatabase.Initialize(dbstring.c_str()))
|
||||
{
|
||||
sLog.outError("Cannot connect to Character database %s",dbstring.c_str());
|
||||
|
||||
///- Wait for already started DB delay threads to end
|
||||
WorldDatabase.HaltDelayThread();
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!CharacterDatabase.CheckRequiredField("character_db_version",REVISION_DB_CHARACTERS))
|
||||
{
|
||||
///- Wait for already started DB delay threads to end
|
||||
WorldDatabase.HaltDelayThread();
|
||||
CharacterDatabase.HaltDelayThread();
|
||||
return false;
|
||||
}
|
||||
|
||||
///- Get login database info from configuration file
|
||||
dbstring = sConfig.GetStringDefault("LoginDatabaseInfo", "");
|
||||
if(dbstring.empty())
|
||||
{
|
||||
sLog.outError("Login database not specified in configuration file");
|
||||
|
||||
///- Wait for already started DB delay threads to end
|
||||
WorldDatabase.HaltDelayThread();
|
||||
CharacterDatabase.HaltDelayThread();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -447,17 +466,32 @@ bool Master::_StartDB()
|
|||
if(!loginDatabase.Initialize(dbstring.c_str()))
|
||||
{
|
||||
sLog.outError("Cannot connect to login database %s",dbstring.c_str());
|
||||
|
||||
///- Wait for already started DB delay threads to end
|
||||
WorldDatabase.HaltDelayThread();
|
||||
CharacterDatabase.HaltDelayThread();
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!loginDatabase.CheckRequiredField("realmd_db_version",REVISION_DB_REALMD))
|
||||
{
|
||||
///- Wait for already started DB delay threads to end
|
||||
WorldDatabase.HaltDelayThread();
|
||||
CharacterDatabase.HaltDelayThread();
|
||||
loginDatabase.HaltDelayThread();
|
||||
return false;
|
||||
}
|
||||
|
||||
///- Get the realm Id from the configuration file
|
||||
realmID = sConfig.GetIntDefault("RealmID", 0);
|
||||
if(!realmID)
|
||||
{
|
||||
sLog.outError("Realm ID not defined in configuration file");
|
||||
|
||||
///- Wait for already started DB delay threads to end
|
||||
WorldDatabase.HaltDelayThread();
|
||||
CharacterDatabase.HaltDelayThread();
|
||||
loginDatabase.HaltDelayThread();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -167,7 +167,7 @@ extern int main(int argc, char **argv)
|
|||
sLog.outDetail("%s (Library: %s)", OPENSSL_VERSION_TEXT, SSLeay_version(SSLEAY_VERSION));
|
||||
if (SSLeay() < 0x009080bfL )
|
||||
{
|
||||
sLog.outDetail("WARNING: Outdated version of OpenSSL lib. Logins to server impossible!");
|
||||
sLog.outDetail("WARNING: Outdated version of OpenSSL lib. Logins to server may not work!");
|
||||
sLog.outDetail("WARNING: Minimal required version [OpenSSL 0.9.8k]");
|
||||
}
|
||||
|
||||
|
|
@ -332,7 +332,11 @@ bool StartDB()
|
|||
}
|
||||
|
||||
if(!loginDatabase.CheckRequiredField("realmd_db_version",REVISION_DB_REALMD))
|
||||
{
|
||||
///- Wait for already started DB delay threads to end
|
||||
loginDatabase.HaltDelayThread();
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,8 +36,8 @@ const char GameObjectInfodstfmt[]="iiissssiifiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii";
|
|||
const char ItemPrototypesrcfmt[]="iiiisiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiffiffiiiiiiiiiifiiifiiiiiifiiiiiifiiiiiifiiiiiifiiiisiiiiiiiiiiiiiiiiiiiiiiiiifiiisiiii";
|
||||
const char ItemPrototypedstfmt[]="iiiisiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiffiffiiiiiiiiiifiiifiiiiiifiiiiiifiiiiiifiiiiiifiiiisiiiiiiiiiiiiiiiiiiiiiiiiifiiiiiiii";
|
||||
const char PageTextfmt[]="isi";
|
||||
const char InstanceTemplatesrcfmt[]="iiiiiiiffffs";
|
||||
const char InstanceTemplatedstfmt[]="iiiiiiiffffi";
|
||||
const char InstanceTemplatesrcfmt[]="iiiiffffs";
|
||||
const char InstanceTemplatedstfmt[]="iiiiffffi";
|
||||
|
||||
SQLStorage sCreatureStorage(CreatureInfosrcfmt, CreatureInfodstfmt, "entry","creature_template");
|
||||
SQLStorage sCreatureDataAddonStorage(CreatureDataAddonInfofmt,"guid","creature_addon");
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ libmangosshared_a_SOURCES = \
|
|||
Util.h \
|
||||
WorldPacket.h \
|
||||
revision_nr.h \
|
||||
revision_sql.h \
|
||||
revision.h
|
||||
|
||||
# Get revision (git or svn)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "8823"
|
||||
#define REVISION_NR "8840"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef __REVISION_SQL_H__
|
||||
#define __REVISION_SQL_H__
|
||||
#define REVISION_DB_CHARACTERS "required_8721_01_characters_guild"
|
||||
#define REVISION_DB_MANGOS "required_8818_01_mangos_mangos_string"
|
||||
#define REVISION_DB_CHARACTERS "required_8828_01_characters_instance_reset"
|
||||
#define REVISION_DB_MANGOS "required_8840_01_mangos_spell_proc_event"
|
||||
#define REVISION_DB_REALMD "required_8728_01_realmd_account"
|
||||
#endif // __REVISION_SQL_H__
|
||||
|
|
|
|||
|
|
@ -497,6 +497,7 @@
|
|||
<ClInclude Include="..\..\src\shared\MemoryLeaks.h" />
|
||||
<ClInclude Include="..\..\src\shared\ProgressBar.h" />
|
||||
<ClInclude Include="..\..\src\shared\revision_nr.h" />
|
||||
<ClInclude Include="..\..\src\shared\revision_sql.h" />
|
||||
<ClInclude Include="..\..\src\shared\ServiceWin32.h" />
|
||||
<ClInclude Include="..\..\src\shared\Threading.h" />
|
||||
<ClInclude Include="..\..\src\shared\Timer.h" />
|
||||
|
|
|
|||
|
|
@ -913,6 +913,10 @@
|
|||
RelativePath="..\..\src\shared\revision_nr.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\shared\revision_sql.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\shared\ServiceWin32.cpp"
|
||||
>
|
||||
|
|
|
|||
|
|
@ -941,6 +941,10 @@
|
|||
RelativePath="..\..\src\shared\revision_nr.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\shared\revision_sql.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\shared\ServiceWin32.cpp"
|
||||
>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue