Jump to content

Recommended Posts

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		},
  • Love 4
Link to comment
https://metin2.dev/topic/3045-ox-invisibility/#findComment-20109
Share on other sites

 

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
https://metin2.dev/topic/3045-ox-invisibility/#findComment-20141
Share on other sites

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
https://metin2.dev/topic/3045-ox-invisibility/#findComment-20938
Share on other sites

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
https://metin2.dev/topic/3045-ox-invisibility/#findComment-20986
Share on other sites

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
https://metin2.dev/topic/3045-ox-invisibility/#findComment-20991
Share on other sites

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
https://metin2.dev/topic/3045-ox-invisibility/#findComment-20993
Share on other sites

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

  • Love 1
Link to comment
https://metin2.dev/topic/3045-ox-invisibility/#findComment-20996
Share on other sites

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 by Metin2 Dev
Core X - External 2 Internal
Link to comment
https://metin2.dev/topic/3045-ox-invisibility/#findComment-21292
Share on other sites

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Guest
This topic is now closed to further replies.
×
×
  • 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.