Avertus 1 Posted September 13, 2014 Share Posted September 13, 2014 Hey, have you any idea how to make invisibility players on the ox? Link to comment Share on other sites More sharing options...
Denis 1477 Posted September 13, 2014 Share Posted September 13, 2014 Just create a new quest function int pc_makemeinvisible(lua_State* L) { LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr(); if (ch->IsAffectFlag(AFF_INVISIBILITY)) { ch->RemoveAffect(AFFECT_INVISIBILITY); } else { ch->AddAffect(AFFECT_INVISIBILITY, POINT_NONE, 0, AFF_INVISIBILITY, INFINITE_AFFECT_DURATION, 0, true); } return 1; } { "make_invisible", pc_makemeinvisible }, 4 Link to comment Share on other sites More sharing options...
Premium Galet 514 Posted September 14, 2014 Premium Share Posted September 14, 2014 You can even put the character into spectator mode. 1 Link to comment Share on other sites More sharing options...
Avertus 1 Posted September 14, 2014 Author Share Posted September 14, 2014 Don't work quest startnie begin state start begin when login begin pc.makemeinvisible() end end end Link to comment Share on other sites More sharing options...
Night 367 Posted September 14, 2014 Share Posted September 14, 2014 Just create a new quest function int pc_makemeinvisible(lua_State* L) { LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr(); if (ch->IsAffectFlag(AFF_INVISIBILITY)) { ch->RemoveAffect(AFFECT_INVISIBILITY); } else { ch->AddAffect(AFFECT_INVISIBILITY, POINT_NONE, 0, AFF_INVISIBILITY, INFINITE_AFFECT_DURATION, 0, true); } return 1; } { "make_invisible", pc_makemeinvisible }, wouldnt this mean that once player login and has : IsAffectFlag(AFF_INVISIBILITY) then the quest function will remove it and he want something like show mode Don't work quest startnie begin state start begin when login begin pc.makemeinvisible() end end end you want it for ox map so chose the map index Link to comment Share on other sites More sharing options...
Avertus 1 Posted September 14, 2014 Author Share Posted September 14, 2014 I tested it on ox in pc.get_index_map () - did not yield effect, so I wanted to see the same when login. Any ideas? Link to comment Share on other sites More sharing options...
Avertus 1 Posted September 15, 2014 Author Share Posted September 15, 2014 f5 Link to comment Share on other sites More sharing options...
Premium Galet 514 Posted September 15, 2014 Premium Share Posted September 15, 2014 Use the /inv command or /o command. Link to comment Share on other sites More sharing options...
Avertus 1 Posted September 15, 2014 Author Share Posted September 15, 2014 But then I have to give players such rights and will be a benefit if you like. And add a command ("inv") will not work. Link to comment Share on other sites More sharing options...
Avertus 1 Posted September 18, 2014 Author Share Posted September 18, 2014 f5 Link to comment Share on other sites More sharing options...
Avertus 1 Posted September 21, 2014 Author Share Posted September 21, 2014 f5 Link to comment Share on other sites More sharing options...
Former Staff .InyaProduction 1134 Posted September 22, 2014 Former Staff Share Posted September 22, 2014 Don't work quest startnie begin state start begin when login begin pc.makemeinvisible() end endend Did you add the function to source? Link to comment Share on other sites More sharing options...
Avertus 1 Posted September 22, 2014 Author Share Posted September 22, 2014 Yup. Link to comment Share on other sites More sharing options...
JachuPL 312 Posted September 22, 2014 Share Posted September 22, 2014 Yup. but... you know that if you want to call a function added to source, in ex. { "make_invisible", pc_makemeinvisible }, you just use pc.make_invisible() and NOT the second one? Link to comment Share on other sites More sharing options...
Avertus 1 Posted September 22, 2014 Author Share Posted September 22, 2014 I have when login with pc.get_map_index() == 113 begin pc.make_invisible() end I add pc.make_invisible to quest_function and don't work. Link to comment Share on other sites More sharing options...
Think 117 Posted September 23, 2014 Share Posted September 23, 2014 Add a syschat to the quest and see if shows up. Are you sure you compiled the quest? Does it throw out any errors? Link to comment Share on other sites More sharing options...
Risan 115 Posted September 23, 2014 Share Posted September 23, 2014 Thats is better: int pc_makemeinvisible(lua_State* L) //syntax: pc_makemeinvisible(seconds) { if (!lua_isnumber(L, 1)) { sys_err("pc_makemeinvisible ERRROR : wrong argument (time)"); return 0; } int iDuration = lua_tonumber(L, 1); if (iDuration < 0) { sys_err("pc_makemeinvisible ERRROR : time is negative %u",iDuration); return 0; } LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr(); if (!ch) { sys_err("pc_makemeinvisible FATALL ERROR : No Character Answer!"); return 0; } if (ch->IsAffectFlag(AFF_INVISIBILITY)) { ch->RemoveAffect(AFF_INVISIBILITY); } ch->AddAffect(AFF_INVISIBILITY, POINT_NONE, 0, AFF_INVISIBILITY, iDuration, 0, true); sys_log(0, "QUEST pc_makemeinvisible -> PlayerName: %s Duration: %u", ch->GetName(), iDuration); return 0; } Link to comment Share on other sites More sharing options...
Avertus 1 Posted September 23, 2014 Author Share Posted September 23, 2014 Syserr: SYSERR: Sep 23 19:03:41.152281 :: pc_makemeinvisible: pc_makemeinvisible ERRROR : wrong argument (time) SYSERR: Sep 23 19:04:24.952424 :: pc_makemeinvisible: pc_makemeinvisible ERRROR : wrong argument (time) SYSERR: Sep 23 19:05:44.632302 :: pc_makemeinvisible: pc_makemeinvisible ERRROR : wrong argument (time) Link to comment Share on other sites More sharing options...
Risan 115 Posted September 23, 2014 Share Posted September 23, 2014 you most give number parameter.... Link to comment Share on other sites More sharing options...
Avertus 1 Posted September 23, 2014 Author Share Posted September 23, 2014 And well, not looked . But I don't really have an idea what value to enter . I don't know how many ox will last . Link to comment Share on other sites More sharing options...
Risan 115 Posted September 23, 2014 Share Posted September 23, 2014 Omg.. Can like this: from: if (!lua_isnumber(L, 1)) { sys_err("pc_makemeinvisible ERRROR : wrong argument (time)"); return 0; } int iDuration = lua_tonumber(L, 1); to replace: if (!lua_isnumber(L, 1)) { // sys_err("pc_makemeinvisible ERRROR : wrong argument (time)"); //return 0; int iDuration = 216000; //60*60*60 } else { int iDuration = lua_tonumber(L, 1); } Link to comment Share on other sites More sharing options...
Avertus 1 Posted September 23, 2014 Author Share Posted September 23, 2014 Well, yes, but then after leaving the ox will continue invisible , right? Link to comment Share on other sites More sharing options...
Avertus 1 Posted September 23, 2014 Author Share Posted September 23, 2014 I 'd do it for this function + qf in quest: when login with pc.get_map_index() == 113 begin pc.setqf("inv", 1) pc.make_invisible() -- on inv end when login and pc.getqf("inv") == 1 begin pc.setqf("inv", 0) pc.make_invisible() --- of inv end I'm sorry , I forgot to edit and added a new post. Link to comment Share on other sites More sharing options...
Risan 115 Posted September 23, 2014 Share Posted September 23, 2014 when login with pc.get_map_index() == 113 begin pc.setqf("inv", 1) pc.make_invisible(60*60*24) -- on inv end when login and pc.getqf("inv") == 1 begin pc.setqf("inv", 0) pc.make_invisible(1) --- of inv end or create new questfunction.. unmakeinvisible ... 1 Link to comment Share on other sites More sharing options...
Avertus 1 Posted September 28, 2014 Author Share Posted September 28, 2014 (edited) Don't work quest oxinvi begin state start begin when login with pc.get_map_index() == 113 begin pc.setqf("inv", 1) pc.make_invisible(60*60*24) -- on inv syschat("On inv ") end end end https://metin2.download/picture/cuuKj99eW2G5RfOqLrwVANROtMSD4NXt/.png Edited August 30, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Recommended Posts