Page 1 of 1
Invis
Posted: Sat Aug 20, 2016 9:33 pm
by Gangrenous
I am wondering if invis is working for players? I tried this...
http://eq2emulator.net/wiki/index.php/LUA:Stealth
By using
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;
}
}
Re: Invis
Posted: Sat Aug 20, 2016 9:57 pm
by Jabantiz
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
Re: Invis
Posted: Sun Aug 21, 2016 6:41 am
by Gangrenous
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
Re: Invis
Posted: Sun Aug 21, 2016 6:47 am
by Gangrenous
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.
Re: Invis
Posted: Sun Aug 21, 2016 6:55 am
by Gangrenous
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)
Re: Invis
Posted: Sun Aug 21, 2016 7:14 am
by Gangrenous
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.
Re: Invis
Posted: Sun Aug 21, 2016 5:38 pm
by Gangrenous
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.
Re: Invis
Posted: Sun Aug 21, 2016 6:40 pm
by Scribble
I will update the wiki Monday.
Re: Invis
Posted: Mon Aug 22, 2016 4:56 am
by Scribble
http://eq2emulator.net/wiki/index.php/LUA:Stealth#Usage =Updated. If any further action is generated please post below.