Browse Source

Lacertae Update #1

- healthchanged function for SpawnScripts can now return a modified health.  healthchanged also now receives a third argument, Damage
eg function healthchanged(Spawn, Attacker, Damage)
-1 = immune (hit damage is set to 0)
0 (or no return) = default damage
1 or higher = new damage (before wards/procs take place)

- Fixed locking issues with player quests when calling /reload quests

- AddQuestStep now supports spawn ids as arguments 9+ (after the usableitemid) -- this will also set the quest flag icon that you would similarily see in a QuestStepKill noting a Spawn is involved with the quest

- Fixed ruleset error message to only display if we don't get a ruleset id

- Fixed a ASam crash in spawn_update_packet, didn't like our null_byte use.  Changed it to not bother since we memset the data, it is already a 0x00 byte no reason to memcpy it in.
Image 2 years ago
parent
commit
34569f0592

+ 45 - 30
EQ2/source/WorldServer/Combat.cpp

@@ -951,36 +951,51 @@ bool Entity::DamageSpawn(Entity* victim, int8 type, int8 damage_type, int32 low_
 	}
 	else{
 		hit_result = DAMAGE_PACKET_RESULT_SUCCESSFUL;
-		GetZone()->CallSpawnScript(victim, SPAWN_SCRIPT_HEALTHCHANGED, this);
-		int32 prevDmg = damage;
-		damage = victim->CheckWards(this, damage, damage_type);
-
-		if (damage < (sint64)prevDmg)
-			useWards = true;
-
-		victim->TakeDamage(damage);
-		victim->CheckProcs(PROC_TYPE_DAMAGED, this);
-
-		if (IsPlayer()) {
-			switch (damage_type) {
-			case DAMAGE_PACKET_DAMAGE_TYPE_SLASH:
-			case DAMAGE_PACKET_DAMAGE_TYPE_CRUSH:
-			case DAMAGE_PACKET_DAMAGE_TYPE_PIERCE:
-				if (((Player*)this)->GetPlayerStatisticValue(STAT_PLAYER_HIGHEST_MELEE_HIT) < damage)
-					((Player*)this)->UpdatePlayerStatistic(STAT_PLAYER_HIGHEST_MELEE_HIT, damage, true);
-				victim->CheckProcs(PROC_TYPE_DAMAGED_MELEE, this);
-				break;
-			case DAMAGE_PACKET_DAMAGE_TYPE_HEAT:
-			case DAMAGE_PACKET_DAMAGE_TYPE_COLD:
-			case DAMAGE_PACKET_DAMAGE_TYPE_MAGIC:
-			case DAMAGE_PACKET_DAMAGE_TYPE_MENTAL:
-			case DAMAGE_PACKET_DAMAGE_TYPE_DIVINE:
-			case DAMAGE_PACKET_DAMAGE_TYPE_DISEASE:
-			case DAMAGE_PACKET_DAMAGE_TYPE_POISON:
-				if (((Player*)this)->GetPlayerStatisticValue(STAT_PLAYER_HIGHEST_MAGIC_HIT) < damage)
-					((Player*)this)->UpdatePlayerStatistic(STAT_PLAYER_HIGHEST_MAGIC_HIT, damage, true);
-				victim->CheckProcs(PROC_TYPE_DAMAGED_MAGIC, this);
-				break;
+		sint32 return_damage = 0;
+		if(GetZone()->CallSpawnScript(victim, SPAWN_SCRIPT_HEALTHCHANGED, this, 0, false, damage, &return_damage) && return_damage != 0)
+		{
+			// anything not 0 (no return) becomes considered 'immune' to the damage
+			if(return_damage < 0) {
+				damage = 0;
+				hit_result = DAMAGE_PACKET_RESULT_NO_DAMAGE;
+			}
+			else if(return_damage != 0) {
+				// otherwise we use what was given back to us (either less or greater)
+				damage = return_damage;
+			}
+		}
+		
+		if(damage) {
+			int32 prevDmg = damage;
+			damage = victim->CheckWards(this, damage, damage_type);
+
+			if (damage < (sint64)prevDmg)
+				useWards = true;
+
+			victim->TakeDamage(damage);
+			victim->CheckProcs(PROC_TYPE_DAMAGED, this);
+
+			if (IsPlayer()) {
+				switch (damage_type) {
+				case DAMAGE_PACKET_DAMAGE_TYPE_SLASH:
+				case DAMAGE_PACKET_DAMAGE_TYPE_CRUSH:
+				case DAMAGE_PACKET_DAMAGE_TYPE_PIERCE:
+					if (((Player*)this)->GetPlayerStatisticValue(STAT_PLAYER_HIGHEST_MELEE_HIT) < damage)
+						((Player*)this)->UpdatePlayerStatistic(STAT_PLAYER_HIGHEST_MELEE_HIT, damage, true);
+					victim->CheckProcs(PROC_TYPE_DAMAGED_MELEE, this);
+					break;
+				case DAMAGE_PACKET_DAMAGE_TYPE_HEAT:
+				case DAMAGE_PACKET_DAMAGE_TYPE_COLD:
+				case DAMAGE_PACKET_DAMAGE_TYPE_MAGIC:
+				case DAMAGE_PACKET_DAMAGE_TYPE_MENTAL:
+				case DAMAGE_PACKET_DAMAGE_TYPE_DIVINE:
+				case DAMAGE_PACKET_DAMAGE_TYPE_DISEASE:
+				case DAMAGE_PACKET_DAMAGE_TYPE_POISON:
+					if (((Player*)this)->GetPlayerStatisticValue(STAT_PLAYER_HIGHEST_MAGIC_HIT) < damage)
+						((Player*)this)->UpdatePlayerStatistic(STAT_PLAYER_HIGHEST_MAGIC_HIT, damage, true);
+					victim->CheckProcs(PROC_TYPE_DAMAGED_MAGIC, this);
+					break;
+				}
 			}
 		}
 	}

+ 20 - 3
EQ2/source/WorldServer/LuaFunctions.cpp

@@ -3731,14 +3731,30 @@ int EQ2Emu_lua_AddQuestStep(lua_State* state) {
 		int32 quantity = lua_interface->GetInt32Value(state, 4);
 		float percentage = lua_interface->GetFloatValue(state, 5);
 		string str_taskgroup = lua_interface->GetStringValue(state, 6);
-		int16 icon = lua_interface->GetInt16Value(state, 7);
-		int32 usableitemid = lua_interface->GetInt32Value(state, 8);
 		const char* taskgroup = 0;
 		if (str_taskgroup.length() > 0)
 			taskgroup = str_taskgroup.c_str();
-		QuestStep* quest_step = quest->AddQuestStep(step, QUEST_STEP_TYPE_NORMAL, description, 0, quantity, taskgroup, 0, 0, percentage, usableitemid);
+		
+		int16 icon = lua_interface->GetInt16Value(state, 7);
+		int32 usableitemid = lua_interface->GetInt32Value(state, 8);
+		
+		int32 id = 0;
+		vector<int32>* ids = 0;
+		int i = 0;
+		while ((id = lua_interface->GetInt32Value(state, 9 + i))) {
+			if (ids == 0)
+				ids = new vector<int32>;
+			ids->push_back(id);
+			i++;
+		}
+
+		QuestStep* quest_step = quest->AddQuestStep(step, QUEST_STEP_TYPE_NORMAL, description, ids, quantity, taskgroup, 0, 0, percentage, usableitemid);
 		if (quest_step && icon && quantity > 0)
 			quest_step->SetIcon(icon);
+		if (quest->GetPlayer()) {
+			Client* client = quest->GetPlayer()->GetZone()->GetClientBySpawn(quest->GetPlayer());
+			quest->GetPlayer()->GetZone()->SendQuestUpdates(client);
+		}
 	}
 	return 0;
 }
@@ -3757,6 +3773,7 @@ int EQ2Emu_lua_AddQuestStepKillLogic(lua_State* state, int8 type)
 		const char* taskgroup = 0;
 		if (str_taskgroup.length() > 0)
 			taskgroup = str_taskgroup.c_str();
+		
 		int32 id = 0;
 		vector<int32>* ids = 0;
 		int i = 0;

+ 41 - 6
EQ2/source/WorldServer/LuaInterface.cpp

@@ -702,7 +702,7 @@ bool LuaInterface::CallSpawnScript(lua_State* state, int8 num_parameters) {
 	return true;
 }
 
-bool LuaInterface::CallZoneScript(lua_State* state, int8 num_parameters, int32* returnValue) {
+bool LuaInterface::CallScriptInt32(lua_State* state, int8 num_parameters, int32* returnValue) {
 	if(shutting_down)
 		return false;
 	if (!state || lua_pcall(state, num_parameters, 1, 0) != 0) {
@@ -728,6 +728,32 @@ bool LuaInterface::CallZoneScript(lua_State* state, int8 num_parameters, int32*
 	return true;
 }
 
+bool LuaInterface::CallScriptSInt32(lua_State* state, int8 num_parameters, sint32* returnValue) {
+	if(shutting_down)
+		return false;
+	if (!state || lua_pcall(state, num_parameters, 1, 0) != 0) {
+		if (state){
+			const char* err = lua_tostring(state, -1);
+			LogError("%s: %s", GetScriptName(state), err);
+			lua_pop(state, 1);
+		}
+		return false;
+	}
+	
+	sint32 result = 0;
+	
+	if (lua_isnumber(state, -1))
+	{
+		result = (sint32)lua_tointeger(state, -1);
+		lua_pop(state, 1);
+	}
+	
+	if(returnValue)
+		*returnValue = result;
+	
+	return true;
+}
+
 bool LuaInterface::CallRegionScript(lua_State* state, int8 num_parameters, int32* returnValue) {
 	if(shutting_down)
 		return false;
@@ -2185,7 +2211,7 @@ bool LuaInterface::RunItemScriptWithReturnString(string script_name, const char*
 }
 
 
-bool LuaInterface::RunSpawnScript(string script_name, const char* function_name, Spawn* npc, Spawn* spawn, const char* message, bool is_door_open) {
+bool LuaInterface::RunSpawnScript(string script_name, const char* function_name, Spawn* npc, Spawn* spawn, const char* message, bool is_door_open, sint32 input_value, sint32* return_value) {
 	if(!npc || spawn_scripts_reloading)
 		return false;
 
@@ -2223,11 +2249,20 @@ bool LuaInterface::RunSpawnScript(string script_name, const char* function_name,
 			SetBooleanValue(state, is_door_open);
 			num_parms++;
 		}
-		else if(message){
+		else {
+			if(message){
 			SetStringValue(state, message);
 			num_parms++;
+			}
+
+			if(!strcmp(function_name,"healthchanged"))
+			{
+				// passes as damage dealt
+				SetSInt32Value(state, input_value);
+				num_parms++;
+			}
 		}
-		if(!CallSpawnScript(state, num_parms)){
+		if(!CallScriptSInt32(state, num_parms, return_value)){
 			if(mutex)
 				mutex->releasereadlock(__FUNCTION__, __LINE__);
 			UseSpawnScript(script_name.c_str(), state, false);
@@ -2292,7 +2327,7 @@ bool LuaInterface::RunZoneScript(string script_name, const char* function_name,
 			SetSpawnValue(state, spawn_arg2);
 			num_params++;
 		}
-		if (!CallZoneScript(state, num_params)) {
+		if (!CallScriptInt32(state, num_params)) {
 			if (mutex)
 				mutex->releasereadlock(__FUNCTION__, __LINE__);
 			UseZoneScript(script_name.c_str(), state, false);
@@ -2337,7 +2372,7 @@ bool LuaInterface::RunZoneScriptWithReturn(string script_name, const char* funct
 		num_params++;
 		SetInt32Value(state, int32_arg3);
 		num_params++;
-		if (!CallZoneScript(state, num_params, returnValue)) {
+		if (!CallScriptInt32(state, num_params, returnValue)) {
 			if (mutex)
 				mutex->releasereadlock(__FUNCTION__, __LINE__);
 			UseZoneScript(script_name.c_str(), state, false);

+ 3 - 2
EQ2/source/WorldServer/LuaInterface.h

@@ -255,11 +255,12 @@ public:
 	bool			RunItemScriptWithReturnString(string script_name, const char* function_name, Item* item, Spawn* spawn = 0, std::string* returnValue = 0);
 	bool			CallItemScript(lua_State* state, int8 num_parameters, std::string* returnValue = 0);
 	bool			CallItemScript(lua_State* state, int8 num_parameters, sint64* returnValue = 0);
-	bool			RunSpawnScript(string script_name, const char* function_name, Spawn* npc, Spawn* spawn = 0, const char* message = 0, bool is_door_open = false);
+	bool			RunSpawnScript(string script_name, const char* function_name, Spawn* npc, Spawn* spawn = 0, const char* message = 0, bool is_door_open = false, sint32 input_value = 0, sint32* return_value = 0);
 	bool			CallSpawnScript(lua_State* state, int8 num_parameters);
 	bool			RunZoneScript(string script_name, const char* function_name, ZoneServer* zone, Spawn* spawn = 0, int32 int32_arg1 = 0, const char* str_arg1 = 0, Spawn* spawn_arg1 = 0, int32 int32_arg2 = 0, const char* str_arg2 = 0, Spawn* spawn_arg2 = 0);
 	bool			RunZoneScriptWithReturn(string script_name, const char* function_name, ZoneServer* zone, Spawn* spawn, int32 int32_arg1, int32 int32_arg2, int32 int32_arg3, int32* returnValue = 0);
-	bool			CallZoneScript(lua_State* state, int8 num_parameters, int32* returnValue = 0);
+	bool			CallScriptInt32(lua_State* state, int8 num_parameters, int32* returnValue = 0);
+	bool			CallScriptSInt32(lua_State* state, int8 num_parameters, sint32* returnValue = 0);
 	bool			RunRegionScript(string script_name, const char* function_name, ZoneServer* zone, Spawn* spawn = 0, sint32 int32_arg1 = 0, int32* returnValue = 0);
 	bool			CallRegionScript(lua_State* state, int8 num_parameters, int32* returnValue);
 	void			ResetFunctionStack(lua_State* state);

+ 14 - 0
EQ2/source/WorldServer/Player.cpp

@@ -4678,6 +4678,20 @@ vector<Quest*>* Player::CheckQuestsKillUpdate(Spawn* spawn, bool update){
 	return quest_updates;
 }
 
+bool Player::HasQuestUpdateRequirement(Spawn* spawn){
+	bool reqMet = false;
+	map<int32, Quest*>::iterator itr;
+	MPlayerQuests.readlock(__FUNCTION__, __LINE__);
+	for(itr = player_quests.begin(); itr != player_quests.end(); itr++){
+		if(itr->second && itr->second->CheckQuestReferencedSpawns(spawn)){
+			reqMet = true;
+			break;
+		}
+	}
+	MPlayerQuests.releasereadlock(__FUNCTION__, __LINE__);
+	return reqMet;
+}
+
 vector<Quest*>* Player::CheckQuestsChatUpdate(Spawn* spawn){
 	vector<Quest*>* quest_updates = 0;
 	map<int32, Quest*>::iterator itr;

+ 1 - 0
EQ2/source/WorldServer/Player.h

@@ -640,6 +640,7 @@ public:
 	vector<Quest*>* CheckQuestsItemUpdate(Item* item);
 	vector<Quest*>* CheckQuestsLocationUpdate();
 	vector<Quest*>* CheckQuestsKillUpdate(Spawn* spawn,bool update = true);
+	bool HasQuestUpdateRequirement(Spawn* spawn);
 	vector<Quest*>* CheckQuestsSpellUpdate(Spell* spell);
 	void CheckQuestsCraftUpdate(Item* item, int32 qty);
 	void CheckQuestsHarvestUpdate(Item* item, int32 qty);

+ 32 - 2
EQ2/source/WorldServer/Quests.cpp

@@ -133,7 +133,7 @@ int8 QuestStep::GetStepType(){
 	return type;
 }
 
-bool QuestStep::CheckStepKillUpdate(int32 id){
+bool QuestStep::CheckStepReferencedSpawnID(int32 id){
 	bool ret = false;
 	if(ids){
 		for(int32 i=0;i<ids->size();i++){
@@ -534,6 +534,36 @@ vector<QuestStep*>* Quest::GetQuestFailures(){
 	return &step_failures;
 }
 
+bool Quest::CheckQuestReferencedSpawns(Spawn* spawn){
+	QuestStep* step = 0;
+	bool ret = false;
+	int32 spawnDBID = spawn->GetDatabaseID();
+	
+	MQuestSteps.lock();
+	for(int32 i=0;i<quest_steps.size(); i++){
+		step = quest_steps[i];
+		if(!step || step->Complete())
+			continue;
+			switch(step->GetStepType())
+			{
+				case QUEST_STEP_TYPE_KILL:
+				case QUEST_STEP_TYPE_NORMAL: {
+					if(step->CheckStepReferencedSpawnID(spawnDBID))
+						ret = true;
+					
+					break;
+				}
+				case QUEST_STEP_TYPE_KILL_RACE_REQ: {
+					if(step->CheckStepKillRaceReqUpdate(spawn))
+						ret = true;
+
+					break;
+				}
+			}
+	}
+	MQuestSteps.unlock();
+	return ret;
+}
 
 bool Quest::CheckQuestKillUpdate(Spawn* spawn, bool update){
 	QuestStep* step = 0;
@@ -546,7 +576,7 @@ bool Quest::CheckQuestKillUpdate(Spawn* spawn, bool update){
 		if(!step)
 			continue;
 
-			if((step->GetStepType() == QUEST_STEP_TYPE_KILL && !step->Complete() && step->CheckStepKillUpdate(id)) ||
+			if((step->GetStepType() == QUEST_STEP_TYPE_KILL && !step->Complete() && step->CheckStepReferencedSpawnID(id)) ||
 			 (step->GetStepType() == QUEST_STEP_TYPE_KILL_RACE_REQ && !step->Complete() && step->CheckStepKillRaceReqUpdate(spawn)))
 			{
 				if (update == true) {

+ 2 - 1
EQ2/source/WorldServer/Quests.h

@@ -67,7 +67,7 @@ public:
 	QuestStep(QuestStep* old_step);
 	~QuestStep();
 	bool			CheckStepKillRaceReqUpdate(Spawn* spawn);
-	bool			CheckStepKillUpdate(int32 id);
+	bool			CheckStepReferencedSpawnID(int32 id);
 	bool			CheckStepChatUpdate(int32 id);
 	bool			CheckStepItemUpdate(int32 id);
 	bool			CheckStepLocationUpdate(float char_x, float char_y, float char_z, int32 zone_id);
@@ -160,6 +160,7 @@ public:
 	int32				GetStepProgress(int32 step_id);
 	int16				GetTaskGroupStep();
 	bool				QuestStepIsActive(int16 quest_step_id);
+	bool				CheckQuestReferencedSpawns(Spawn* spawn);
 	bool				CheckQuestKillUpdate(Spawn* spawn, bool update = true);
 	bool				CheckQuestChatUpdate(int32 id, bool update = true);
 	bool				CheckQuestItemUpdate(int32 id, int8 quantity = 1);

+ 1 - 1
EQ2/source/WorldServer/Rules/RulesDB.cpp

@@ -41,7 +41,7 @@ void WorldDatabase::LoadGlobalRuleSet() {
 
 	if (rule_set_id > 0 && !rule_manager.SetGlobalRuleSet(rule_set_id))
 		LogWrite(RULESYS__ERROR, 0, "Rules", "Error loading global rule set. A rule set with ID %u does not exist.", rule_set_id);
-	else
+	else if(rule_set_id == 0)
 		LogWrite(RULESYS__ERROR, 0, "Rules", "Variables table is missing default_ruleset_id variable name, this means the global rules will be code-default, database entries not used.  Use query such as \"insert into variables set variable_name='default_ruleset_id',variable_value='1',comment='Default ruleset';\" to resolve.");
 
 }

+ 11 - 14
EQ2/source/WorldServer/Spawn.cpp

@@ -315,7 +315,7 @@ void Spawn::InitializeVisPacketData(Player* player, PacketStruct* vis_packet) {
 			if (version < 1188 && quest_flag >= 16)
 				quest_flag = 1;
 			vis_packet->setDataByName("quest_flag", quest_flag);
-			if (player->CheckQuestsKillUpdate(this, false)) {
+			if (player->HasQuestUpdateRequirement(this)) {
 				vis_packet->setDataByName("name_quest_icon", 1);
 			}
 		}
@@ -947,8 +947,6 @@ EQ2Packet* Spawn::spawn_update_packet(Player* player, int16 version, bool overri
 			return 0;
 	}
 
-	static const uchar null_byte = 0;
-
 	uchar* info_changes = 0;
 	uchar* pos_changes = 0;
 	uchar* vis_changes = 0;
@@ -1017,12 +1015,18 @@ EQ2Packet* Spawn::spawn_update_packet(Player* player, int16 version, bool overri
 		memcpy(ptr, &packet_num, sizeof(int32));
 	}
 	ptr += sizeof(int32);
-
-	memcpy(ptr, info_changes ? info_changes : &null_byte, tmp_info_packet_size);
+	if(info_changes)
+		memcpy(ptr, info_changes, tmp_info_packet_size);
+	
 	ptr += info_packet_size;
-	memcpy(ptr, pos_changes ? pos_changes : &null_byte, tmp_pos_packet_size);
+	
+	if(pos_changes)
+		memcpy(ptr, pos_changes, tmp_pos_packet_size);
+	
 	ptr += pos_packet_size;
-	memcpy(ptr, vis_changes ? vis_changes : &null_byte, tmp_vis_packet_size);
+	
+	if(vis_changes)
+		memcpy(ptr, vis_changes, tmp_vis_packet_size);
 
 	EQ2Packet* ret_packet = 0;
 	if(info_packet_size + pos_packet_size + vis_packet_size > 0)
@@ -1330,13 +1334,6 @@ bool Spawn::TakeDamage(int32 damage){
 	}
 	return true;
 }
-
-void Spawn::TakeDamage(Spawn* attacker, int32 damage){
-	if (TakeDamage(damage))
-		GetZone()->CallSpawnScript(this, SPAWN_SCRIPT_HEALTHCHANGED, attacker);
-	SetLastAttacker(attacker);
-}
-
 ZoneServer*	Spawn::GetZone(){
 	return zone;
 }

+ 0 - 1
EQ2/source/WorldServer/Spawn.h

@@ -942,7 +942,6 @@ public:
 	Spawn*			GetLastAttacker();
 	void			SetLastAttacker(Spawn* spawn);
 	bool			TakeDamage(int32 damage);
-	void			TakeDamage(Spawn* attacker, int32 damage);
 	ZoneServer*		GetZone();
 	virtual void	SetZone(ZoneServer* in_zone, int32 version=0);
 	void			SetFactionID(int32 val) { faction_id = val; }

+ 8 - 3
EQ2/source/WorldServer/client.cpp

@@ -5527,15 +5527,20 @@ void Client::SetPlayerQuest(Quest* quest, map<int32, int32>* progress) {
 }
 
 void Client::AddPlayerQuest(Quest* quest, bool call_accepted, bool send_packets) {
+	bool lockCleared = false;
 	GetPlayer()->MPlayerQuests.writelock(__FUNCTION__, __LINE__);
 	if (player->player_quests.count(quest->GetQuestID()) > 0) {
 		if (player->player_quests[quest->GetQuestID()]->GetQuestFlags() > 0)
 			quest->SetQuestFlags(player->player_quests[quest->GetQuestID()]->GetQuestFlags());
-
-		RemovePlayerQuest(quest->GetQuestID(), false, false);
+		int32 questID = quest->GetQuestID();
+		lockCleared = true;
+		GetPlayer()->MPlayerQuests.releasewritelock(__FUNCTION__, __LINE__);
+		RemovePlayerQuest(questID, false, false);
 	}
 	player->player_quests[quest->GetQuestID()] = quest;
-	GetPlayer()->MPlayerQuests.releasewritelock(__FUNCTION__, __LINE__);
+	
+	if(!lockCleared)
+		GetPlayer()->MPlayerQuests.releasewritelock(__FUNCTION__, __LINE__);
 	
 	quest->SetPlayer(player);
 	current_quest_id = quest->GetQuestID();

+ 4 - 3
EQ2/source/WorldServer/zoneserver.cpp

@@ -2692,7 +2692,7 @@ void ZoneServer::AddSpawnGroupLocation(int32 group_id, int32 location_id, int32
 	MSpawnGroupAssociation.releasewritelock(__FUNCTION__, __LINE__);
 }
 
-bool ZoneServer::CallSpawnScript(Spawn* npc, int8 type, Spawn* spawn, const char* message, bool is_door_open){
+bool ZoneServer::CallSpawnScript(Spawn* npc, int8 type, Spawn* spawn, const char* message, bool is_door_open, sint32 input_value, sint32* return_value){
 
 	LogWrite(SPAWN__TRACE, 0, "Spawn", "Enter %s", __FUNCTION__);
 	if(!npc)
@@ -2778,7 +2778,7 @@ bool ZoneServer::CallSpawnScript(Spawn* npc, int8 type, Spawn* spawn, const char
 				break;
 									}
 			case SPAWN_SCRIPT_HEALTHCHANGED:{
-				lua_interface->RunSpawnScript(script, "healthchanged", npc, spawn);
+				result = lua_interface->RunSpawnScript(script, "healthchanged", npc, spawn, 0, false, input_value, return_value);
 				break;
 											}
 			case SPAWN_SCRIPT_RANDOMCHAT:{
@@ -4090,7 +4090,8 @@ void ZoneServer::SendAllSpawnsForLevelChange(Client* client) {
 			if (spawn && client->GetPlayer()->WasSentSpawn(spawn->GetID()) && !client->GetPlayer()->WasSpawnRemoved(spawn)) {
 				SendSpawnChanges(spawn, client, false, true);
 				// Attempt to slow down the packet spam sent to the client
-				Sleep(5);
+				// who the bloody fuck put a Sleep here
+				//Sleep(5);
 			}
 		}
 	}

+ 1 - 1
EQ2/source/WorldServer/zoneserver.h

@@ -312,7 +312,7 @@ public:
 	
 	EQ2Packet* GetZoneInfoPacket(Client* client);
 	Spawn*	FindSpawn(Player* searcher, const char* name);
-	bool	CallSpawnScript(Spawn* npc, int8 type, Spawn* spawn = 0, const char* message = 0, bool is_door_open = false);
+	bool	CallSpawnScript(Spawn* npc, int8 type, Spawn* spawn = 0, const char* message = 0, bool is_door_open = false, sint32 input_value = 0, sint32* return_value = 0);
 	void	SendSpawnVisualState(Spawn* spawn, int16 type);
 	void	SendSpellFailedPacket(Client* client, int16 error);
 	void	SendInterruptPacket(Spawn* interrupted, LuaSpell* spell, bool fizzle=false);

+ 3 - 3
EQ2/source/common/version.h

@@ -38,11 +38,11 @@
 #endif
 
 #if defined(LOGIN)
-#define CURRENT_VERSION	"0.9.3-procyon"
+#define CURRENT_VERSION	"0.9.3-lacertae"
 #elif defined(WORLD)
-#define CURRENT_VERSION	"0.9.3-procyon"
+#define CURRENT_VERSION	"0.9.3-lacertae"
 #else
-#define CURRENT_VERSION	"0.9.3-procyon"
+#define CURRENT_VERSION	"0.9.3-lacertae"
 #endif
 
 #define COMPILE_DATE	__DATE__