Jump to content
×
×
  • Create New...
  • 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
  • Moon

 

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

Guest
This topic is now closed to further replies.


  • Activity

    1. 6
    2. 9

      Help in implementing a switch bot

    3. 0

      Special Inventory System Can't Sell To Npc's

    4. 0

      ROV2.GLOBAL | International | Server start 14.05.2022

    5. 75

      Services - System Ard [C ++ / Python / Lua]

    6. 76

      Chatting Window Renewal (Mini Version)

    7. 2

      ItemShop GM ZONE TAB

    8. 9

      Help in implementing a switch bot

  • Recently Browsing

    • No registered users viewing this page.

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.