Jump to content
  • 0

Ox invisibility


Avertus

Question

Recommended Posts

  • 0

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
Share on other sites

!-->
  • 0
  • Bronze

 

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

  • 0

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

  • 0

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

  • 0

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

  • 0

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

  • 0
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
Share on other sites

  • 0

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
Share on other sites

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.