Dungeon Crawl custom code merge

Added numerous modding hooks.
Added rules:
	Character:KeepLevelOverMax - Don't delevel a character if they are found to be over max level rule.
	Spells:UseCHAScribeHack - Optionally omit spells with CHA in effect12 when using scribespells and traindiscs
	Combat:MonkACBonusWeight - Adjust the weight threshold for monk AC bonus
	Combat:ClientStunLevel - Adjust the level clients kicks and bashes start to roll for stuns
	Combat;QuiverWRHasteDiv - Adjust the divisor applied to weight reduction for haste calcs
	Combat:UseArcheryBonusRoll - Make archery stationary bonus a roll
	Combat:ArcheryBonusChance - Archery stationary bonus chance

Added account flags and associated perl wrappers
Added EVENT_ITEM_TICK for interactive items
Added EVENT_DUEL_WIN and EVENT_DUEL_LOSE, which exports $enemyname and $enemyid
Added timer and interval to console worldshutdown command
Added EQW interface for worldshutdown and server-wide messages
This commit is contained in:
Tabasco
2013-04-24 15:58:51 -05:00
parent b15cb08f54
commit 56490400ca
45 changed files with 1321 additions and 156 deletions
+87 -1
View File
@@ -917,7 +917,8 @@ Zone::Zone(uint32 in_zoneid, uint32 in_instanceid, const char* in_short_name)
autoshutdown_timer((RuleI(Zone, AutoShutdownDelay))),
clientauth_timer(AUTHENTICATION_TIMEOUT * 1000),
spawn2_timer(1000),
qglobal_purge_timer(30000)
qglobal_purge_timer(30000),
hotzone_timer(120000)
{
zoneid = in_zoneid;
instanceid = in_instanceid;
@@ -1164,6 +1165,13 @@ bool Zone::Init(bool iStaticZone) {
zone->zone_time.setEQTimeZone(database.GetZoneTZ(zoneid, GetInstanceVersion()));
LogFile->write(EQEMuLog::Status, "Init Finished: ZoneID = %d, Time Offset = %d", zoneid, zone->zone_time.getEQTimeZone());
//DCBOOKMARK
LoadTickItems();
//MODDING HOOK FOR ZONE INIT
mod_init();
return true;
}
@@ -1483,6 +1491,9 @@ bool Zone::Process() {
}
}
//DCBOOKMARK
if(hotzone_timer.Check()) { UpdateHotzone(); }
return true;
}
@@ -1531,6 +1542,9 @@ void Zone::Repop(uint32 delay) {
MZoneLock.unlock();
initgrids_timer.Start();
//MODDING HOOK FOR REPOP
mod_repop();
}
void Zone::GetTimeSync()
@@ -2657,3 +2671,75 @@ void Zone::ReloadWorld(uint32 Option){
parse->ReloadQuests();
}
}
//DCBOOKMARK
void Zone::LoadTickItems()
{
char errbuf[MYSQL_ERRMSG_SIZE];
char* query = 0;
MYSQL_RES *result;
MYSQL_ROW row;
tick_items.clear();
//tick_globals.clear();
if(database.RunQuery(query, MakeAnyLenString(&query, "SELECT it_itemid, it_chance, it_level, it_qglobal, it_bagslot FROM item_tick"), errbuf, &result))
{
while((row = mysql_fetch_row(result)))
{
if(atoi(row[0]) < 1)
{
//tick_globals[std::string(row[0])] = { 0, atoi(row[1]), atoi(row[2]), (int16)atoi(row[4]), std::string(row[3]) };
}
else
{
tick_items[atoi(row[0])] = { atoi(row[0]), atoi(row[1]), atoi(row[2]), (int16)atoi(row[4]), std::string(row[3]) };
}
}
mysql_free_result(result);
safe_delete_array(query);
}
else
{
LogFile->write(EQEMuLog::Error, "Error in Zone::LoadTickItems: %s (%s)", query, errbuf);
safe_delete_array(query);
}
}
uint32 Zone::GetSpawnKillCount(uint32 in_spawnid) {
LinkedListIterator<Spawn2*> iterator(spawn2_list);
iterator.Reset();
while(iterator.MoreElements())
{
if(iterator.GetData()->GetID() == in_spawnid)
{
return(iterator.GetData()->killcount);
}
iterator.Advance();
}
}
void Zone::UpdateHotzone()
{
char errbuf[MYSQL_ERRMSG_SIZE];
char* query = 0;
MYSQL_RES *result;
MYSQL_ROW row;
bool updh;
if(database.RunQuery(query, MakeAnyLenString(&query,"SELECT hotzone FROM zone WHERE short_name = '%s'", GetShortName()), errbuf, &result) )
{
if( (row = mysql_fetch_row(result)) )
{
updh = atoi(row[0]) == 0 ? false:true;
//Hotzone status has changed
if(is_hotzone != updh)
{
is_hotzone = updh;
}
}
mysql_free_result(result);
}
safe_delete_array(query);
}