Exported TrainDisc to Lua.

Updated idle timer names.
This commit is contained in:
cavedude00 2014-02-27 23:21:57 -08:00
parent c18e9d9503
commit 16afa277de
4 changed files with 21 additions and 9 deletions

View File

@ -1,6 +1,9 @@
EQEMu Changelog (Started on Sept 24, 2003 15:50) EQEMu Changelog (Started on Sept 24, 2003 15:50)
------------------------------------------------------- -------------------------------------------------------
== 02/27/2014 ==
cavedude: Exported TrainDisc to Lua.
== 02/26/2014 == == 02/26/2014 ==
Kayen: Implemented SE_FrenziedDevestation - increase critical spell chacnce and 2x mana cost for DD spells Kayen: Implemented SE_FrenziedDevestation - increase critical spell chacnce and 2x mana cost for DD spells
Kayen: Fixed SE_SpellProcChance - Now works on spell dervived procs Kayen: Fixed SE_SpellProcChance - Now works on spell dervived procs
@ -8,6 +11,7 @@ cavedude: Added two new NPC special_abilities. ALWAYS_FLEE, which forces the NPC
cavedude: Fixed an issue where rectangular roamboxes could cause an NPC to get stuck on a single coord. cavedude: Fixed an issue where rectangular roamboxes could cause an NPC to get stuck on a single coord.
cavedude: Added a new roambox column, mindelay allowing you to have more control over the roambox delay. cavedude: Added a new roambox column, mindelay allowing you to have more control over the roambox delay.
Uleat: Fix for 'sqrt' failure on vs2010 clients Uleat: Fix for 'sqrt' failure on vs2010 clients
image: Added idle zone timer to save CPU cycles.
Required SQL: utils/sql/git/required/2014_02_26_roambox_update.sql Required SQL: utils/sql/git/required/2014_02_26_roambox_update.sql

View File

@ -560,6 +560,11 @@ void Lua_Client::UnscribeSpellAll(bool update_client) {
self->UnscribeSpellAll(update_client); self->UnscribeSpellAll(update_client);
} }
void Lua_Client::TrainDisc(int itemid) {
Lua_Safe_Call_Void();
self->TrainDiscipline(itemid);
}
void Lua_Client::UntrainDisc(int slot) { void Lua_Client::UntrainDisc(int slot) {
Lua_Safe_Call_Void(); Lua_Safe_Call_Void();
self->UntrainDisc(slot); self->UntrainDisc(slot);
@ -1352,6 +1357,7 @@ luabind::scope lua_register_client() {
.def("UnscribeSpell", (void(Lua_Client::*)(int,bool))&Lua_Client::UnscribeSpell) .def("UnscribeSpell", (void(Lua_Client::*)(int,bool))&Lua_Client::UnscribeSpell)
.def("UnscribeSpellAll", (void(Lua_Client::*)(void))&Lua_Client::UnscribeSpellAll) .def("UnscribeSpellAll", (void(Lua_Client::*)(void))&Lua_Client::UnscribeSpellAll)
.def("UnscribeSpellAll", (void(Lua_Client::*)(bool))&Lua_Client::UnscribeSpellAll) .def("UnscribeSpellAll", (void(Lua_Client::*)(bool))&Lua_Client::UnscribeSpellAll)
.def("TrainDisc", (void(Lua_Client::*)(int))&Lua_Client::TrainDisc)
.def("UntrainDisc", (void(Lua_Client::*)(int))&Lua_Client::UntrainDisc) .def("UntrainDisc", (void(Lua_Client::*)(int))&Lua_Client::UntrainDisc)
.def("UntrainDisc", (void(Lua_Client::*)(int,bool))&Lua_Client::UntrainDisc) .def("UntrainDisc", (void(Lua_Client::*)(int,bool))&Lua_Client::UntrainDisc)
.def("UntrainDiscAll", (void(Lua_Client::*)(void))&Lua_Client::UntrainDiscAll) .def("UntrainDiscAll", (void(Lua_Client::*)(void))&Lua_Client::UntrainDiscAll)

View File

@ -138,6 +138,7 @@ public:
void UnscribeSpell(int slot, bool update_client); void UnscribeSpell(int slot, bool update_client);
void UnscribeSpellAll(); void UnscribeSpellAll();
void UnscribeSpellAll(bool update_client); void UnscribeSpellAll(bool update_client);
void TrainDisc(int itemid);
void UntrainDisc(int slot); void UntrainDisc(int slot);
void UntrainDisc(int slot, bool update_client); void UntrainDisc(int slot, bool update_client);
void UntrainDiscAll(); void UntrainDiscAll();

View File

@ -336,8 +336,10 @@ int main(int argc, char** argv) {
bool worldwasconnected = worldserver.Connected(); bool worldwasconnected = worldserver.Connected();
EQStream* eqss; EQStream* eqss;
EQStreamInterface *eqsi; EQStreamInterface *eqsi;
Timer temp_timer(10); uint8 IDLEZONEUPDATE = 200;
temp_timer.Start(); uint8 ZONEUPDATE = 10;
Timer zoneupdate_timer(ZONEUPDATE);
zoneupdate_timer.Start();
while(RunLoops) { while(RunLoops) {
{ //profiler block to omit the sleep from times { //profiler block to omit the sleep from times
@ -381,13 +383,12 @@ int main(int argc, char** argv) {
entity_list.AddClient(client); entity_list.AddClient(client);
} }
uint8 IDLEZONETIME = 200; if ( numclients < 1 && zoneupdate_timer.GetDuration() != IDLEZONEUPDATE )
if ( numclients < 1 && temp_timer.GetDuration() != IDLEZONETIME ) zoneupdate_timer.SetTimer(IDLEZONEUPDATE);
temp_timer.SetTimer(IDLEZONETIME); else if ( numclients > 0 && zoneupdate_timer.GetDuration() == IDLEZONEUPDATE )
else if ( numclients > 0 && temp_timer.GetDuration() == IDLEZONETIME )
{ {
temp_timer.SetTimer(10); zoneupdate_timer.SetTimer(ZONEUPDATE);
temp_timer.Trigger(); zoneupdate_timer.Trigger();
} }
//check for timeouts in other threads //check for timeouts in other threads
@ -402,7 +403,7 @@ int main(int argc, char** argv) {
worldwasconnected = false; worldwasconnected = false;
} }
if (ZoneLoaded && temp_timer.Check()) { if (ZoneLoaded && zoneupdate_timer.Check()) {
{ {
if(net.group_timer.Enabled() && net.group_timer.Check()) if(net.group_timer.Enabled() && net.group_timer.Check())
entity_list.GroupProcess(); entity_list.GroupProcess();