Dustyn
Initiate
I've created an item "dungeon coin".
Everytime we leave a dungeon, these coins burn because you can't bring them outside dungeons.
So I've had this scripted in DungeonRegion :
The problem is yes, it works, but it doesn't at the same time. Lemme explain through images :
First, I am adding the coins... and I am inside a dungeon.
I put it in my backpack...
And now I am leaving the dungeon!
It still appears in backpack... but it's not existant! So if I click it, it appears no amount, and if I move it then it will disappear... so it's kinda leaving a ghost there in my pack! It's very irritating, and I don't understand why it's doing this when I can easily consume that item easily with other scripts... It's only when it comes to deleting it OnExit of the dungeonregion that it's doing this... And I'm doing the SAME THING, which is CONSUME the item with it's total amount........
I've tried everything : movetoworld then delete, change hue then delete, adding a function so it deletes from the dungeoncoin script itself, I went through all scripts that contain finditembytype... and more. I'm out of ideas, because NOTHING of what I tried works.
Thx for help!
Everytime we leave a dungeon, these coins burn because you can't bring them outside dungeons.
So I've had this scripted in DungeonRegion :
Code:
public override void OnExit( Mobile from )
{
if ( from != null && from is PlayerMobile && from.Alive )
{
Container pack = from.Backpack;
if ( pack != null )
{
Item[] dungeoncoins = pack.FindItemsByType( typeof( DungeonCoin ) );
bool hadcoins = false;
foreach ( Item dcoins in dungeoncoins )
{
hadcoins = true;
dcoins.Consume( dcoins.Amount );
}
if ( hadcoins )
from.LocalOverheadMessage( MessageType.Regular, 906, true, "*Your dungeon coins burned on your way out!*" );
}
}
}
The problem is yes, it works, but it doesn't at the same time. Lemme explain through images :
First, I am adding the coins... and I am inside a dungeon.
I put it in my backpack...
And now I am leaving the dungeon!
It still appears in backpack... but it's not existant! So if I click it, it appears no amount, and if I move it then it will disappear... so it's kinda leaving a ghost there in my pack! It's very irritating, and I don't understand why it's doing this when I can easily consume that item easily with other scripts... It's only when it comes to deleting it OnExit of the dungeonregion that it's doing this... And I'm doing the SAME THING, which is CONSUME the item with it's total amount........
I've tried everything : movetoworld then delete, change hue then delete, adding a function so it deletes from the dungeoncoin script itself, I went through all scripts that contain finditembytype... and more. I'm out of ideas, because NOTHING of what I tried works.
Thx for help!