Shattered Kingdoms
https://shatteredkingdoms.org/forums/

New scrited items system bug?
https://shatteredkingdoms.org/forums/viewtopic.php?f=26&t=13433
Page 1 of 2

Author:  Dark-Avenger [ Sat Apr 29, 2006 8:50 am ]
Post subject:  New scrited items system bug?

So I was doing some test of my own and I happened to wear a certain item that grants the shield spell. I already had shield from before so nothing happened first.

Code:
 oOOOoOOOoOOOoOOOoOOOoOOOoOOOoOOOoOOOoOOOoOOOoOOOoOOOoOOOoOOOoOOOoOOOoOOOoOOOo
 o [Affects] Golg 'oroth - Wrath of the Serpent                              o
 o===-===-===-===-===-===-===-===-===-===-===-===-===-===-===-===-===-===-===o
 o Affect: 'detect hidden'                                                   o
 o Affect: 'detect invis'                                                    o
 o Affect: 'shield' - deflection bonus to magical protection                 o
 o Affect: 'armor'                                                           o
 o Affect: 'protection'                                                      o
 o Affect: 'infravision'                                                     o
 o Affect: 'spirit aura'                                                     o
 o Affect: 'bless' - morale bonus to probability to hit                      o
 o Affect: 'bless' - morale bonus to willpower                               o
 oOOOoOOOoOOOoOOOoOOOoOOOoOOOoOOOoOOOoOOOoOOOoOOOoOOOoOOOoOOOoOOOoOOOoOOOoOOOo


Then...
Code:
>
wear XXX
It is a bit small for you.
You stop using a turban of shrouding mist.
You shiver as frigid air seeps from XXX.
The frost forms around you.
You are already protected by a force shield.  <-- Yes, I know, thank you.
You wear XXX on your head.

[HP:100%] [ME: 92%] [PE:100%]


I do my tests, I do a remove...
Code:
wear tur
You stop using XXX.
The chattering of your teeth subsides.
Your force shield shimmers then fades away.   <-- WHY?!?
The mystical armor shimmers slightly, and several spirits escape it to surround you in their protection.
You wear a turban of shrouding mist on your head.

[HP: 99%] [ME: 42%] [PE:100%]


And then...
Code:
oOOOoOOOoOOOoOOOoOOOoOOOoOOOoOOOoOOOoOOOoOOOoOOOoOOOoOOOoOOOoOOOoOOOoOOOoOOOo
 o [Affects] Golg 'oroth - Wrath of the Serpent                              o
 o===-===-===-===-===-===-===-===-===-===-===-===-===-===-===-===-===-===-===o
 o Affect: 'protection'                                                      o
 o Affect: 'armor'                                                           o
 o Affect: 'detect hidden'                                                   o
 o Affect: 'detect invis'                                                    o
 o Affect: 'infravision'                                                     o
 o Affect: 'spirit aura'                                                     o
 o Affect: 'bless' - morale bonus to probability to hit                      o
 o Affect: 'bless' - morale bonus to willpower                               o
 oOOOoOOOoOOOoOOOoOOOoOOOoOOOoOOOoOOOoOOOoOOOoOOOoOOOoOOOoOOOoOOOoOOOoOOOoOOOo


On remove of XXX my shield was gone, the spell from the NPC that was keeping it on me was released(NPC was back at 100% ME).

Perhaps fix it so it doesn't remove scripted spell unless the item itself casts the spell on the PC and he doesn't have it from earlier.

Author:  Gilgon [ Sat Apr 29, 2006 8:54 am ]
Post subject: 

It's the same with all scripted items - my di/dh mace will remove di from a potion I quaffed if I remove it.

Author:  Fepel Veiled [ Sat Apr 29, 2006 6:22 pm ]
Post subject: 

A turban now? [REDACTED].

Author:  Arsilan [ Sat Apr 29, 2006 6:29 pm ]
Post subject: 

You never spent any time around Syral obviously.

Author:  Fepel Veiled [ Sat Apr 29, 2006 7:08 pm ]
Post subject: 

Only thing Syral ever did to any of my characters was c summon alshanite;order all bash alshanite. :roll:

Oh wait, I thought the XXX was the turban. My bad. Read it wrong, but yes the script removes shield upon removal. It doesn't check if the shield is from the XXX or not.

Author:  TheCannibal [ Sat Apr 29, 2006 7:09 pm ]
Post subject: 

probably what is happening is that the item is casting a higher level spell on you than the one your NPC is putting on you in effect over riding it. Then when you remove the item, it removes the spell.

Author:  soultoast [ Sat Apr 29, 2006 8:09 pm ]
Post subject: 

Fepel Veiled wrote:
Only thing Syral ever did to any of my characters was c summon alshanite;order all bash alshanite. :roll:

Oh wait, I thought the XXX was the turban. My bad. Read it wrong, but yes the script removes shield upon removal. It doesn't check if the shield is from the XXX or not.


There is no flag for scripts that come from items, potions, etc. I.e. the item couldn't have a "release list", nor would a glance at the pfile show "Shield - cast on Character from Item". The only way to fix this would be to check the character for the presence of the shield spell before activating the script, assigning a variable for a positive match, and the bypassing the removal processes for instances where the variable is positive. Its really not something you're thinking of when you're coding phat lewt. It comes as hindsight. Unless you're Wert.

Author:  Dark-Avenger [ Sat Apr 29, 2006 9:12 pm ]
Post subject: 

Actually some items work like that soultoast. The sacred suits for example, if you keep let's say the low level spell casted on you, the script will simply never fire. And removing the item won't remove any spell.

Author:  soultoast [ Sat Apr 29, 2006 9:44 pm ]
Post subject: 

Dark-Avenger wrote:
Actually some items work like that soultoast. The sacred suits for example, if you keep let's say the low level spell casted on you, the script will simply never fire. And removing the item won't remove any spell.

You're reinforcing what I said.
1. These sacred suits probably use a failsafe of some sort similar to what I've mentioned.
2. I said that such a failsafe would not be implemented by most IMMs. Unless they're Wert. And Wert crafted the sacred suits.

I was pointing out the scripting error, explaining why it happened by shedding light on the misconceptions of "flags", and describing how to keep such oversights from happening in the future, that is all. :)

You kids need to read all the way through my posts, let the material digest, then respond. I love the fact that you all agree with me, I just don't like pointing it out to you. :P

Author:  Dark-Avenger [ Sat Apr 29, 2006 9:50 pm ]
Post subject: 

The "change" to sacred suits(that happened with the whole change to the scripting system) didn't happen by Wert I think.

So there are more builders that can see such things and change them.

And you know I'll always agree with the player of Janaan. :P

Page 1 of 2 All times are UTC - 8 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/