Talow

Member
Talow submitted a new resource:

Player Book Publishing System - Let the word get out.

These scripts allow your players to to drop a book on top of a publisher then, after confirming, have the book published.

Once created the books can then be created, either at random or by the # the book was published.

To use this system first add a publisher where you want people to be able to have their books published. I recommend that you use a spawner for this part, but for simple testing you can do by command: [add publisher

Players then take any book and drop it on to the publisher....

Read more about this resource...
 
Is there any way to convert this away from Merchant (baseescortable), problem is if a player decides to escort the publisher, they are gone until respawn.
 
Sure you can change it out, it's not really using the Merchant stuff anyways. It was just a referance so I didn't need to dress the NPC and stuff in the code, First remove(delete) any publishers you have out, change Merchant to what you want it based off of then loaded it. Any books you already have should load just fine however if you forget to delete the publishers already out then you'll have to deal with deleting them on load up, just easyer to do:
[global delete where publisher
Then there's nothing to worry about.
 
So I tried changing it to BaseVendor and I got this error during compile.

Code:
Errors:
+ Custom Systems/Publishing/Publisher.cs:
    CS0534: Line 12: 'Server.Mobiles.Publisher' does not implement inherited abstract member 'Server.Mobiles.BaseVendor.InitSBInfo()'
    CS0534: Line 12: 'Server.Mobiles.Publisher' does not implement inherited abstract member 'Server.Mobiles.BaseVendor.SBInfos.get'
Scripts: One or more scripts failed to compile or no script files were found.
[doublepost=1463637293][/doublepost]Fixed it, did not feel like adding the Vendor stuff that would not be used to make it work. So I used base creature and added the Base.. lol

Code:
using System;
using System.Collections;
using System.Collections.Generic;
using Server;
using Server.Items;
using Server.Gumps;
using Server.Commands;
using Engale.BookPublishing;

namespace Server.Mobiles
{
   public class Publisher : BaseCreature
   {
     private static List<BookContent> m_Books;
     
     public static List<BookContent> Books
     {
       get{
         if(m_Books == null)
           m_Books = new List<BookContent>();
         return m_Books;
       }
       set{
         m_Books = value;
       }
     }
     
     [Constructable]
     public Publisher()
       : base(AIType.AI_Animal, FightMode.None, 10, 1, 0.2, 0.4)
  {
  this.InitStats(31, 41, 51);

  this.SetSkill(SkillName.Healing, 36, 68);

  this.SpeechHue = Utility.RandomDyedHue();
  this.Title = "the publisher";
  this.Hue = Utility.RandomSkinHue();

  if (this.Female = Utility.RandomBool())
  {
  this.Body = 0x191;
  this.Name = NameList.RandomName("female");
  }
  else
  {
  this.Body = 0x190;
  this.Name = NameList.RandomName("male");
  }
  this.AddItem(new Doublet(Utility.RandomDyedHue()));
  this.AddItem(new Sandals(Utility.RandomNeutralHue()));
  this.AddItem(new ShortPants(Utility.RandomNeutralHue()));
  this.AddItem(new HalfApron(Utility.RandomDyedHue()));

  Utility.AssignRandomHair(this);

  Container pack = new Backpack();

  pack.DropItem(new Gold(250, 300));

  pack.Movable = false;

  this.AddItem(pack);
  }
     
     public override bool OnDragDrop(Mobile from, Item dropped)
  {
  if(dropped is BaseBook)
       {
         object[] arg = new object[1];
         arg[0] = dropped;
         YesNo.SimpleConfirmMsg( new YesNoCallbackState( PublishConfirm ), from, "Publish This Book?", true, arg );
       }
  return base.OnDragDrop(from, dropped);
  }
  public override void OnDoubleClick(Mobile from)
  {
  from.SendGump(new BookPubGump(from));
  }
     public void PublishConfirm(Mobile from, bool yesNo, object[] arg)
     {
       if(!yesNo)
         return;
       BaseBook book = arg[0] as BaseBook;
       if(book == null)
         return;
       
       BookContent bc = new BookContent(book.Title, book.Author, book.Pages);
       
       if(m_Books == null)
         m_Books = new List<BookContent>();
       
       if(!m_Books.Contains(bc))
         m_Books.Add(bc);
     }
     
     public Publisher( Serial serial ) : base( serial )
     {}
     
     public override void Serialize( GenericWriter writer )
     {
       base.Serialize( writer );

       writer.Write( (int)0 ); // version
     }

     public override void Deserialize( GenericReader reader )
     {
       base.Deserialize( reader );

       int version = reader.ReadInt();
     }
   }
}
 
Last edited:

Active Shards

Donations

Total amount
$50.00
Goal
$1,000.00
Back