Better behaviour for .instance open/close commands
For Dungeons:
.instance open|close [mapid] normal|heroic|all
For Raids:
.instance open|close [mapid] normal|heroic|10man|25man|all|10normal|10heroic|25normal|25heroic
normal|heroic options will open|close instance in both 10man & 25man at once for selected difficulty
10man|25man options will open|close instance in both normal & heroic modes at once for selected num of players
--HG--
branch : trunk
This commit is contained in:
@@ -7062,20 +7062,62 @@ bool ChatHandler::HandleInstanceOpenCloseCommand(const char *args,bool open)
|
|||||||
uint8 status = objmgr.GetAccessRequirement(instance->access_id)->status;
|
uint8 status = objmgr.GetAccessRequirement(instance->access_id)->status;
|
||||||
uint8 flag = 0;
|
uint8 flag = 0;
|
||||||
|
|
||||||
if (strcmp(instanceModeStr,"normal") || strcmp(instanceModeStr,"10normal"))
|
const MapEntry *entry = sMapStore.LookupEntry(mapid);
|
||||||
flag = DUNGEON_STATUSFLAG_NORMAL;
|
if (!entry)
|
||||||
else if (strcmp(instanceModeStr,"heroic") || strcmp(instanceModeStr,"25normal"))
|
return false;
|
||||||
flag = DUNGEON_STATUSFLAG_HEROIC;
|
|
||||||
else if (strcmp(instanceModeStr,"10heroic"))
|
if (entry->IsDungeon())
|
||||||
flag = RAID_STATUSFLAG_10MAN_HEROIC;
|
{
|
||||||
else if (strcmp(instanceModeStr,"25heroic"))
|
if (strcmp(instanceModeStr,"normal"))
|
||||||
flag = RAID_STATUSFLAG_25MAN_HEROIC;
|
flag = DUNGEON_STATUSFLAG_NORMAL;
|
||||||
|
else if (strcmp(instanceModeStr,"heroic"))
|
||||||
|
flag = DUNGEON_STATUSFLAG_HEROIC;
|
||||||
|
else if (strcmp(instanceModeStr,"all"))
|
||||||
|
flag = DUNGEON_STATUSFLAG_NORMAL & DUNGEON_STATUSFLAG_HEROIC;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
PSendSysMessage("Unrecognized difficulty string");
|
||||||
|
SetSentErrorMessage(true);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
else if (entry->IsRaid())
|
||||||
|
{
|
||||||
|
if (strcmp(instanceModeStr,"normal"))
|
||||||
|
flag = RAID_STATUSFLAG_10MAN_NORMAL & RAID_STATUSFLAG_25MAN_NORMAL;
|
||||||
|
else if (strcmp(instanceModeStr,"heroic"))
|
||||||
|
flag = RAID_STATUSFLAG_10MAN_HEROIC & RAID_STATUSFLAG_25MAN_HEROIC;
|
||||||
|
else if (strcmp(instanceModeStr,"10man"))
|
||||||
|
flag = RAID_STATUSFLAG_10MAN_NORMAL & RAID_STATUSFLAG_10MAN_HEROIC;
|
||||||
|
else if (strcmp(instanceModeStr,"25man"))
|
||||||
|
flag = RAID_STATUSFLAG_25MAN_NORMAL & RAID_STATUSFLAG_25MAN_HEROIC;
|
||||||
|
else if (strcmp(instanceModeStr,"heroic"))
|
||||||
|
flag = RAID_STATUSFLAG_10MAN_HEROIC & RAID_STATUSFLAG_25MAN_HEROIC;
|
||||||
|
else if (strcmp(instanceModeStr,"10normal"))
|
||||||
|
flag = DUNGEON_STATUSFLAG_NORMAL;
|
||||||
|
else if (strcmp(instanceModeStr,"25normal"))
|
||||||
|
flag = DUNGEON_STATUSFLAG_HEROIC;
|
||||||
|
else if (strcmp(instanceModeStr,"10heroic"))
|
||||||
|
flag = RAID_STATUSFLAG_10MAN_HEROIC;
|
||||||
|
else if (strcmp(instanceModeStr,"25heroic"))
|
||||||
|
flag = RAID_STATUSFLAG_25MAN_HEROIC;
|
||||||
|
else if (strcmp(instanceModeStr,"all"))
|
||||||
|
flag = RAID_STATUSFLAG_10MAN_NORMAL & RAID_STATUSFLAG_10MAN_HEROIC & RAID_STATUSFLAG_25MAN_NORMAL & RAID_STATUSFLAG_25MAN_HEROIC;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
PSendSysMessage("Unrecognized difficulty string");
|
||||||
|
SetSentErrorMessage(true);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
PSendSysMessage("Unrecognized difficulty string");
|
PSendSysMessage("Map is not a dungeon/raid");
|
||||||
SetSentErrorMessage(true);
|
SetSentErrorMessage(true);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (open)
|
if (open)
|
||||||
status |= flag;
|
status |= flag;
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user