mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 02:11:30 +00:00
Created RemoveFromInstance and RemoveAllFromInstance and exported to lua_general.cpp
This commit is contained in:
parent
057e4603db
commit
58f42f1af1
@ -1,5 +1,9 @@
|
||||
EQEMu Changelog (Started on Sept 24, 2003 15:50)
|
||||
-------------------------------------------------------
|
||||
== 03/04/2014 ==
|
||||
Sorvani: Created RemoveFromInstance and RemoveAllFromInstance to remove a single player or all players in an instance.
|
||||
Sorvani: Exported to Lua as eq.remove_from_instance(instance_id) and eq.remove_all_from_instance(instance_id).
|
||||
|
||||
== 03/03/2014 ==
|
||||
demonstar55: Implemented deadly strikes and gave rogues higher innate throwing crit chance
|
||||
|
||||
|
||||
@ -659,6 +659,14 @@ void lua_assign_raid_to_instance(uint32 instance_id) {
|
||||
quest_manager.AssignRaidToInstance(instance_id);
|
||||
}
|
||||
|
||||
void lua_remove_from_instance(uint32 instance_id) {
|
||||
quest_manager.RemoveFromInstance(instance_id);
|
||||
}
|
||||
|
||||
void lua_remove_all_from_instance(uint32 instance_id) {
|
||||
quest_manager.RemoveAllFromInstance(instance_id);
|
||||
}
|
||||
|
||||
void lua_flag_instance_by_group_leader(uint32 zone, uint32 version) {
|
||||
quest_manager.FlagInstanceByGroupLeader(zone, version);
|
||||
}
|
||||
@ -1195,6 +1203,8 @@ luabind::scope lua_register_general() {
|
||||
luabind::def("assign_to_instance", &lua_assign_to_instance),
|
||||
luabind::def("assign_group_to_instance", &lua_assign_group_to_instance),
|
||||
luabind::def("assign_raid_to_instance", &lua_assign_raid_to_instance),
|
||||
luabind::def("remove_from_instance", &lua_remove_from_instance),
|
||||
luabind::def("remove_all_from_instance", &lua_remove_all_from_instance),
|
||||
luabind::def("flag_instance_by_group_leader", &lua_flag_instance_by_group_leader),
|
||||
luabind::def("flag_instance_by_raid_leader", &lua_flag_instance_by_raid_leader),
|
||||
luabind::def("fly_mode", &lua_fly_mode),
|
||||
|
||||
@ -2557,6 +2557,43 @@ void QuestManager::AssignRaidToInstance(uint16 instance_id)
|
||||
}
|
||||
}
|
||||
|
||||
void QuestManager::RemoveFromInstance(uint16 instance_id)
|
||||
{
|
||||
QuestManagerCurrentQuestVars();
|
||||
if(initiator) {
|
||||
if(database.RemoveClientFromInstance(instance_id, initiator->CharacterID())) {
|
||||
initiator->Message(0, "Removed client from instance.");
|
||||
} else {
|
||||
initiator->Message(0, "Failed to remove client from instance.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void QuestManager::RemoveAllFromInstance(uint16 instance_id)
|
||||
{
|
||||
QuestManagerCurrentQuestVars();
|
||||
if(initiator) {
|
||||
std::list<uint32> charid_list;
|
||||
boolean removed_all = true;
|
||||
uint16 fail_count = 0;
|
||||
database.GetCharactersInInstance(instance_id,charid_list);
|
||||
auto iter = charid_list.begin();
|
||||
while(iter != charid_list.end()) {
|
||||
if(!database.RemoveClientFromInstance(instance_id, *iter)) {
|
||||
removed_all = false;
|
||||
++fail_count;
|
||||
}
|
||||
++iter;
|
||||
}
|
||||
if (removed_all) {
|
||||
initiator->Message(MT_Say, "Removed all players from instance.");
|
||||
} else {
|
||||
// once the expedition system is in, this message it not relevant
|
||||
initiator->Message(MT_Say, "Failed to remove %i player(s) from instance.", fail_count);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void QuestManager::MovePCInstance(int zone_id, int instance_id, float x, float y, float z, float heading)
|
||||
{
|
||||
QuestManagerCurrentQuestVars();
|
||||
|
||||
@ -211,6 +211,10 @@ public:
|
||||
void AssignToInstance(uint16 instance_id);
|
||||
void AssignGroupToInstance(uint16 instance_id);
|
||||
void AssignRaidToInstance(uint16 instance_id);
|
||||
void RemoveFromInstance(uint16 instance_id);
|
||||
//void RemoveGroupFromInstance(uint16 instance_id); //potentially useful but not implmented at this time.
|
||||
//void RemoveRaidFromInstance(uint16 instance_id); //potentially useful but not implmented at this time.
|
||||
void RemoveAllFromInstance(uint16 instance_id);
|
||||
void MovePCInstance(int zone_id, int instance_id, float x, float y, float z, float heading);
|
||||
void FlagInstanceByGroupLeader(uint32 zone, int16 version);
|
||||
void FlagInstanceByRaidLeader(uint32 zone, int16 version);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user