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

This commit is contained in:
devn00b 2022-06-15 12:57:25 -07:00
parent 8a6753febb
commit 5672520310
3 changed files with 22 additions and 9 deletions
EQ2/source/WorldServer
server/Spells/Commoner

View file

@ -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;
}

View file

@ -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());

View file

@ -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