Invis

EQ2Emulator Development forum.

Moderator: Team Members

Post Reply
User avatar
Gangrenous
Posts: 812
Joined: Sun Apr 24, 2016 6:54 am
Characters: Dinsmoor

Invis

Post by Gangrenous » Sat Aug 20, 2016 9:33 pm

I am wondering if invis is working for players? I tried this...

http://eq2emulator.net/wiki/index.php/LUA:Stealth

By using

Code: Select all

Stealth(Caster, 2)
But I get this...

Code: Select all

23:24:54 E LUA       : LUA Stealth command error: invalid stealth type given
Looking at LuaFunction, not sure where it gets this value.

Code: Select all

	if (spawn){
		if (spawn->IsEntity()){
			if (type == 1){
				((Entity*)spawn)->AddStealthSpell(spell);
				if (!(spell->effect_bitmask & EFFECT_FLAG_STEALTH))
					spell->effect_bitmask += EFFECT_FLAG_STEALTH;
				}
			else if (type == 2){
				((Entity*)spawn)->AddInvisSpell(spell);
				if (!(spell->effect_bitmask & EFFECT_FLAG_INVIS))
					spell->effect_bitmask += EFFECT_FLAG_INVIS;
			}
			return 0;
		}
		else{
			lua_interface->LogError("LUA Stealth command error: target override is not Entity");
			return 0;
		}
	}
Resident Dirty Hippy

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: Invis

Post by Jabantiz » Sat Aug 20, 2016 9:57 pm

Looks like the wiki is wrong, looking at the code

Code: Select all

int EQ2Emu_lua_Stealth(lua_State* state){
	if(!lua_interface)
		return 0;

	int8 type = lua_interface->GetInt8Value(state);
	Spawn* spawn = lua_interface->GetSpawn(state, 2);
	LuaSpell* spell = lua_interface->GetCurrentSpell(state);
First param is the type, second param is optional, if it is not provided and used in a spell the spells targets will be use, if it is provided that spawn will get the stealth, if used outside of a spell the second param must be used.

This should work, assuming a spell

Code: Select all

function cast (Caster, Target)
    Stealth(2)
end

User avatar
Gangrenous
Posts: 812
Joined: Sun Apr 24, 2016 6:54 am
Characters: Dinsmoor

Re: Invis

Post by Gangrenous » Sun Aug 21, 2016 6:41 am

Yeah, something is definitely wrong. The spell will cast like that, not sure how you could cast it on someone else though. But the issue is with the spell active and you do a /reload spells you get a segmentation fault.

Code: Select all

#3  0x00000000006589c4 in SpellProcess::DeleteCasterSpell (
    this=this@entry=0x7fffd3f4c9a0, spell=0x7fffd1013360)
    at SpellProcess.cpp:376
#4  0x000000000065b49c in SpellProcess::Process (this=0x7fffd3f4c9a0)
    at SpellProcess.cpp:143
Resident Dirty Hippy

User avatar
Gangrenous
Posts: 812
Joined: Sun Apr 24, 2016 6:54 am
Characters: Dinsmoor

Re: Invis

Post by Gangrenous » Sun Aug 21, 2016 6:47 am

To be more specific though. It is when you do a /reload spells and then try to cast invis again. The icon does disappear, but the effect of being invis is still on. After the /reload spells and recast, that is when the crash occurs.
Resident Dirty Hippy

User avatar
Gangrenous
Posts: 812
Joined: Sun Apr 24, 2016 6:54 am
Characters: Dinsmoor

Re: Invis

Post by Gangrenous » Sun Aug 21, 2016 6:55 am

Another one, just for providing more info.

Code: Select all

0x00000000006587f0 in SpellProcess::DeleteCasterSpell (
    this=this@entry=0x7fffd3c865f0, spell=0x7fffd3f0dcc0)
    at SpellProcess.cpp:352
352                             if (spell->spell->GetSpellData()->cast_type == SPELL_CAST_TYPE_TOGGLE){
(gdb)
Resident Dirty Hippy

User avatar
Gangrenous
Posts: 812
Joined: Sun Apr 24, 2016 6:54 am
Characters: Dinsmoor

Re: Invis

Post by Gangrenous » Sun Aug 21, 2016 7:14 am

Stealth seems to work fine. One of the issues on the crashes seems to be when you use (2), Invis. It does not seem to be removing like it should.
Resident Dirty Hippy

User avatar
Gangrenous
Posts: 812
Joined: Sun Apr 24, 2016 6:54 am
Characters: Dinsmoor

Re: Invis

Post by Gangrenous » Sun Aug 21, 2016 5:38 pm

I see the issue. May want to notate in the Wiki that there is a RemoveInvis() that should be used. Maybe just should clarification if you use (2) and not (1), that you should remove it with RemoveInvis, RemoveStealth causes a crash.

Also, just a note, even after RemoveInvis, the icon still hangs out and does not go away.

Second thing, I notice the NPC's do not have a flag for seeinvis? Mobs seemed to aggro right though invis.
Resident Dirty Hippy

User avatar
Scribble
Team Member
Posts: 157
Joined: Wed Jun 22, 2016 5:30 am
EQ2Emu Server: Norrath Reborn
Characters: Scribe
Location: East Coast , USA
Contact:

Re: Invis

Post by Scribble » Sun Aug 21, 2016 6:40 pm

I will update the wiki Monday.
Follow me at https://twitter.com/EqIIEmulator
Like to keep up with news via Discordapp chat?

Join eq2emulator public discord at https://discord.gg/sCR4fPZ
Check me out on Twtich at https://www.twitch.tv/scribbleeq23

User avatar
Scribble
Team Member
Posts: 157
Joined: Wed Jun 22, 2016 5:30 am
EQ2Emu Server: Norrath Reborn
Characters: Scribe
Location: East Coast , USA
Contact:

Re: Invis

Post by Scribble » Mon Aug 22, 2016 4:56 am

http://eq2emulator.net/wiki/index.php/LUA:Stealth#Usage =Updated. If any further action is generated please post below.
Follow me at https://twitter.com/EqIIEmulator
Like to keep up with news via Discordapp chat?

Join eq2emulator public discord at https://discord.gg/sCR4fPZ
Check me out on Twtich at https://www.twitch.tv/scribbleeq23

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests