Looking for a script that uses a customizable currency or item to spawn a champion, something like double clicking the skull at the alter consumes said item and spawns the champ. I know I've seen some I just can't find any. Thank you.
 
Looking for a script that uses a customizable currency or item to spawn a champion, something like double clicking the skull at the alter consumes said item and spawns the champ. I know I've seen some I just can't find any. Thank you.
I do not have a script for this, but Mogster and I used Xmlspawner for our various invasion bosses and such.

If you add an OnDoubleClick method to any item, you can have it take whatever "currency" you want though.
This is from Lokai's Greek Underworld gump:

C#:
public override void OnResponse( NetState state, RelayInfo info )
{
    Mobile from = state.Mobile;

    switch( info.ButtonID )
    {
        case 0:
        { break; }
        case 1:
        {
            RitualCoin coin = from.Backpack.FindItemByType( typeof( RitualCoin )) as RitualCoin; //This line is looking for the item to take from the player's Backpack only.
            if ( coin != null && coin.Amount >= 2 ) //This line determines the amount needed.
            {
                coin.Consume( 2 ); //This consumes the two coins from the amount the player is carrying.
                from.MoveToWorld( new Point3D( 609, 1904, -89 ), Map.Malas ); //This is the location the player is moved to after paying the 2 coins.
            }
            else
                from.SendMessage( 0, "You do not have enough Ritual Coins." );
            break;
        }
    }
}

You could handle it like a Peerless too, players collect the "keys", get close to an Xmlspawner, have the keys taken and are given the item to summon the boss. Really though, the NPC that takes the coins in this case, would work just as well as using an Xmlspawner. :)
 
Very nice I'll have to take a look at that when I get off work, would want to add in a check for the bank as well in case they don't carry the item required in their backpack :)
 
I do not have a script for this, but Mogster and I used Xmlspawner for our various invasion bosses and such.

If you add an OnDoubleClick method to any item, you can have it take whatever "currency" you want though.
This is from Lokai's Greek Underworld gump:

C#:
public override void OnResponse( NetState state, RelayInfo info )
{
    Mobile from = state.Mobile;

    switch( info.ButtonID )
    {
        case 0:
        { break; }
        case 1:
        {
            RitualCoin coin = from.Backpack.FindItemByType( typeof( RitualCoin )) as RitualCoin; //This line is looking for the item to take from the player's Backpack only.
            if ( coin != null && coin.Amount >= 2 ) //This line determines the amount needed.
            {
                coin.Consume( 2 ); //This consumes the two coins from the amount the player is carrying.
                from.MoveToWorld( new Point3D( 609, 1904, -89 ), Map.Malas ); //This is the location the player is moved to after paying the 2 coins.
            }
            else
                from.SendMessage( 0, "You do not have enough Ritual Coins." );
            break;
        }
    }
}

You could handle it like a Peerless too, players collect the "keys", get close to an Xmlspawner, have the keys taken and are given the item to summon the boss. Really though, the NPC that takes the coins in this case, would work just as well as using an Xmlspawner. :)
this is really interesting. So if I were to say add a boss where the player turns in{gets close enough} DecoTarot x2 to a fortune teller, where would I add this particular code to the DecoTarot? and change Ritual Coin for DecoTarot in the code this would allow me to teleport the whole party or just the player?
Post automatically merged:

this is really interesting. So if I were to say add a boss where the player turns in{gets close enough} DecoTarot x2 to a fortune teller, where would I add this particular code to the DecoTarot or npc? and change Ritual Coin for DecoTarot in the code this would allow me to teleport the whole party or just the player?
 
this is really interesting. So if I were to say add a boss where the player turns in{gets close enough} DecoTarot x2 to a fortune teller, where would I add this particular code to the DecoTarot? and change Ritual Coin for DecoTarot in the code this would allow me to teleport the whole party or just the player?
This particular code is part of a whole gump. This just illustrates how to have an NPC take the custom currency for something, in this case to teleport that person to the destination. You can do a whole party. Have a look at the Peerless code ;)
 
Back