sheinfeld 1 Posted October 27, 2017 Share Posted October 27, 2017 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! Link to comment Share on other sites More sharing options...
Forum Moderator VegaS™ 10271 Posted November 28, 2018 Forum Moderator Share Posted November 28, 2018 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 3 Check my GitHub Profile Click to find all the threads started by me [TOOL] Text file loader + JSON Link to comment Share on other sites More sharing options...
Premium WeedHex 635 Posted November 28, 2018 Premium Share Posted November 28, 2018 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 More sharing options...
sheinfeld 1 Posted November 28, 2018 Author Share Posted November 28, 2018 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 More sharing options...
Recommended Posts