Browse Source

Code cleanup. Set Recall Point now checks if bind location is permitted (city zones), and cancells on combat

devn00b 1 year ago
parent
commit
5672520310

+ 1 - 0
EQ2/source/WorldServer/LuaFunctions.cpp

@@ -11062,6 +11062,7 @@ int EQ2Emu_lua_GetCanBind(lua_State* state) {
 	Spawn* player = lua_interface->GetSpawn(state);
 	ZoneServer* zone = player->GetZone();
 	if (zone) {
+		cout << "\n\n-----dev---- We Got zone!\n\n";
 		lua_interface->SetInt32Value(state, zone->GetCanBind());
 		return 1;
 	}

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

@@ -8356,17 +8356,17 @@ bool Client::GateAllowed() {
 
 bool Client::BindAllowed() {
 	ZoneServer* zone = GetCurrentZone();
-//	int canbind;
+
 	bool canbind = zone->GetCanBind();
 	return canbind;
 }
 
 bool Client::Bind() {
 	int canbind = BindAllowed();
-	cout << "\n\n--------------------DEV2------------------- [" << canbind << "]\n\n";
+	
 	if(canbind == 0) {
 		return false;
-	}
+	} 
 	player->GetPlayerInfo()->SetBindZone(GetCurrentZone()->GetZoneID());
 	player->GetPlayerInfo()->SetBindX(player->GetX());
 	player->GetPlayerInfo()->SetBindY(player->GetY());

+ 18 - 6
server/Spells/Commoner/SetRecallPoint.lua

@@ -3,14 +3,26 @@
     Script Author  : neatz09
     Script Date    : 2019.10.12 09:10:20
     Script Purpose : 
-                   : 
+    Edit By        : Devn00b: Implemented Bind Location check, as well as in combat check. 6/15/2022
 --]]
 
--- Info from spell_display_effects (remove from script when done)
--- This effect cannot be cast during combat
-
 function cast(Caster, Target)
-    Bind(Caster)
-    Say(Caster, "No Check setup for allowed binds yet. cannot be cast during combat not implemented yet.")
 
+	canbind = GetCanBind(Caster)
+	incombat = IsInCombat(Caster)
+	
+	if ( incombat == true)
+	then
+		Say(Caster, "You cannot use Set Recall Point while in combat.")
+	    goto exit;
+	end
+	
+	if( canbind == 0 )
+	then
+		Say(Caster, "You cannot use Set Recall Point at this location. Please try in a city or suburb.")
+	else
+		Bind(Caster)
+    end
+
+::exit::
 end