Jump to content

Prevent Teleport While Fighting


Recommended Posts

  • 1 year later...
  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

  • Forum Moderator
  • share/locale/germany/quest/quest_functions
Spoiler

pc.is_fighting

 

  • Src/game/src/questlua_pc.cpp
Spoiler

//Search for:
			{ "is_engaged",		pc_is_engaged		},
// Add after:
			{ "is_fighting",    pc_is_fighting		},

//Search for:
	int pc_is_engaged(lua_State* L)
	{
		LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
		lua_pushboolean(L, marriage::CManager::instance().IsEngaged(ch->GetPlayerID()));
		return 1;
	}
// Add after:
	int pc_is_fighting(lua_State* L)
	{
		LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
		if (!ch)
			return 0;

		lua_pushboolean(L, ch->IsPosition(POS_FIGHTING));
		return 0;
	}

 

  • How-To-Use:
Spoiler

when button or info begin
	if pc.is_fighting() then
		say("Ummmm....")
		return
	end
	
	say("Click")
end

 

 

  • Love 3
Link to comment
Share on other sites

  • Premium
On 10/27/2017 at 10:10 PM, sheinfeld said:

Hey guys,

I am trying to prevent a player from teleporting while he is fighting a mob or another player (using teleport GUI).

 

Any one can help me with the quest function for check that?

 

Thanks!

Nice idea!

 

Thx vegas for the reply !

Link to comment
Share on other sites

14 hours ago, VegaS™ said:
  • share/locale/germany/quest/quest_functions
  Reveal hidden contents


pc.is_fighting

 

  • Src/game/src/questlua_pc.cpp
  Reveal hidden contents


//Search for:
			{ "is_engaged",		pc_is_engaged		},
// Add after:
			{ "is_fighting",    pc_is_fighting		},

//Search for:
	int pc_is_engaged(lua_State* L)
	{
		LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
		lua_pushboolean(L, marriage::CManager::instance().IsEngaged(ch->GetPlayerID()));
		return 1;
	}
// Add after:
	int pc_is_fighting(lua_State* L)
	{
		LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
		if (!ch)
			return 0;

		lua_pushboolean(L, ch->IsPosition(POS_FIGHTING));
		return 0;
	}

 

  • How-To-Use:
  Reveal hidden contents


when button or info begin
	if pc.is_fighting() then
		say("Ummmm....")
		return
	end
	
	say("Click")
end

 

 

 

Thanks VegaS!

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.