aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--contrib/check_updates.sh12
-rw-r--r--sql/updates/world/2015_10_10_05_world.sql4
-rw-r--r--src/server/game/Instances/InstanceScript.cpp22
-rw-r--r--src/server/game/Instances/InstanceScript.h1
-rw-r--r--src/server/scripts/Commands/cs_instance.cpp6
5 files changed, 37 insertions, 8 deletions
diff --git a/contrib/check_updates.sh b/contrib/check_updates.sh
index 97aa3dff7a8..017542eb807 100644
--- a/contrib/check_updates.sh
+++ b/contrib/check_updates.sh
@@ -22,7 +22,7 @@ do
updates=$((updates+1))
else
# The update isn't listed in the updates table of the given database.
- echo "- \"sql/updates/${file}\" is missing in table '${name}'.'updates'"
+ echo "- \"sql/updates/${name}/${file}\" is missing in the '${name}'.'updates' table."
error=1
fi
done
@@ -31,14 +31,14 @@ if [ ${error} -ne 0 ]
then
echo
echo "Fatal error:"
- echo " The Database Updater is broken for database '${name}"
- echo " due to applied update which are missing in the '${name}'.'updates' table."
+ echo " The Database Updater is broken for the '${name}' database,"
+ echo " because the applied update is missing in the '${name}'.'updates' table."
echo
echo "How to fix:"
- echo " Insert the missing names of sql updates which were applied already to"
- echo " the 'updates' table of the '${name}' base dump ('sql/base/${name}_database.sql')."
+ echo " Insert the missing names of the already applied sql updates"
+ echo " to the 'updates' table of the '${name}' base dump ('sql/base/${name}_database.sql')."
exit 1
else
- echo " Everything is ok, checked ${updates} updates."
+ echo " Everything is OK, finished checking ${updates} updates."
exit 0
fi
diff --git a/sql/updates/world/2015_10_10_05_world.sql b/sql/updates/world/2015_10_10_05_world.sql
new file mode 100644
index 00000000000..5a552b76e64
--- /dev/null
+++ b/sql/updates/world/2015_10_10_05_world.sql
@@ -0,0 +1,4 @@
+DELETE FROM `trinity_string` WHERE `entry` IN (5057, 5058);
+INSERT INTO `trinity_string` (`entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`) VALUES
+(5057, 'Boss id %i state is now set to %i (%s).', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(5058, 'Boss id %i state is %i (%s).', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
diff --git a/src/server/game/Instances/InstanceScript.cpp b/src/server/game/Instances/InstanceScript.cpp
index 5d44f3ec696..a8cf42ea49e 100644
--- a/src/server/game/Instances/InstanceScript.cpp
+++ b/src/server/game/Instances/InstanceScript.cpp
@@ -652,3 +652,25 @@ void InstanceScript::UpdateEncounterState(EncounterCreditType type, uint32 credi
}
}
}
+
+std::string InstanceScript::GetBossStateName(uint8 state)
+{
+ // See enum EncounterState in InstanceScript.h
+ switch (state)
+ {
+ case NOT_STARTED:
+ return "NOT_STARTED";
+ case IN_PROGRESS:
+ return "IN_PROGRESS";
+ case FAIL:
+ return "FAIL";
+ case DONE:
+ return "DONE";
+ case SPECIAL:
+ return "SPECIAL";
+ case TO_BE_DECIDED:
+ return "TO_BE_DECIDED";
+ default:
+ return "INVALID";
+ }
+}
diff --git a/src/server/game/Instances/InstanceScript.h b/src/server/game/Instances/InstanceScript.h
index e832d7cdffe..93dafea0413 100644
--- a/src/server/game/Instances/InstanceScript.h
+++ b/src/server/game/Instances/InstanceScript.h
@@ -220,6 +220,7 @@ class InstanceScript : public ZoneScript
virtual bool SetBossState(uint32 id, EncounterState state);
EncounterState GetBossState(uint32 id) const { return id < bosses.size() ? bosses[id].state : TO_BE_DECIDED; }
+ static std::string GetBossStateName(uint8 state);
BossBoundaryMap const* GetBossBoundary(uint32 id) const { return id < bosses.size() ? &bosses[id].boundary : NULL; }
// Achievement criteria additional requirements check
diff --git a/src/server/scripts/Commands/cs_instance.cpp b/src/server/scripts/Commands/cs_instance.cpp
index c960d3f3753..aa7310e3c65 100644
--- a/src/server/scripts/Commands/cs_instance.cpp
+++ b/src/server/scripts/Commands/cs_instance.cpp
@@ -254,7 +254,8 @@ public:
}
map->ToInstanceMap()->GetInstanceScript()->SetBossState(encounterId, (EncounterState)state);
- handler->PSendSysMessage(LANG_COMMAND_INST_SET_BOSS_STATE, encounterId, state);
+ std::string stateName = InstanceScript::GetBossStateName(state);
+ handler->PSendSysMessage(LANG_COMMAND_INST_SET_BOSS_STATE, encounterId, state, stateName);
return true;
}
@@ -318,7 +319,8 @@ public:
}
uint8 state = map->ToInstanceMap()->GetInstanceScript()->GetBossState(encounterId);
- handler->PSendSysMessage(LANG_COMMAND_INST_GET_BOSS_STATE, encounterId, state);
+ std::string stateName = InstanceScript::GetBossStateName(state);
+ handler->PSendSysMessage(LANG_COMMAND_INST_GET_BOSS_STATE, encounterId, state, stateName);
return true;
}
};