Full Version : XMLQUEST 4 dummies
xmlspawner >>XMLSpawner - Tutorials >>XMLQUEST 4 dummies


<< Prev | Next >>

ArteGordon- 05-16-2006
QUOTE (BiO_ZeRg @ May 16, 2006 04:20 pm)
Example on karma and fame
GIVE/&lt;questholder/name/Kill Shinobi/notestring/Shinobi debe morir. Buscalo y eliminalo/objective1/KILLNAMED,Shinobi,1/autoreward/true/rewardstring/@bag/ADD/gold,2000/SETONTRIGMOB/ATTACH/xmladdkarma,1000/ATTACH/xmladdfame,1000

And Shinobi i dont now sad.gif ronin/name/shinobi

i was using on the xmlspawner 1 option but the command in the option HELP doesnt work with the spawner or i dont do it correct way

no, if you wanted the karma and fame to be automatically given when the quest is completed you need to set the AttachmentString on the questholder.

from xmlspawner2.txt

QUOTE

- added a new AttachmentString property that works in the same way as the RewardString only for attachments.  This allows both reward items and reward attachments to be specified by string in a single quest.


you can only give out a single attachment as an automatic reward, like xmladdkarma. It would look like this

GIVE/&lt;questholder/name/Kill Shinobi/notestring/Shinobi debe morir. Buscalo y eliminalo/objective1/KILLNAMED,Shinobi,1/autoreward/true/attachmentstring/xmladdkarma,1000/rewardstring/@bag/ADD/gold,2000

If you want to do more complicated things as a reward, like saying something or giving out multiple attachments, then you will have to do it as part of an xmldialog Action or put it on a triggered reward spawner using the

SETONTRIGMOB/ATTACH/xmladdkarma,1000/ATTACH/xmladdfame,1000

as an entry.

ArteGordon- 05-16-2006
QUOTE (ArteGordon @ May 16, 2006 04:15 pm)
QUOTE (BiO_ZeRg @ May 16, 2006 04:10 pm)
but i need modify with [xmledit or in the spawn ??

you would set that up on the spawner for Shinobi and the guards. Do it just like masterhelper.xml, except have Shinobi as your boss, and your guards instead of orcs.

look at the masterhelper.xml example.

replace the

troll/name/Orc Master

entry with your

ronin/name/Shinobi

and then attack him.

BiO_ZeRg- 05-16-2006
what is masterhelper.xml where is? i just download xml 1 2 3

And the karma and fame thing i can make example when you finish the quest on condition #70 ID 70

ifyoukillshinobiandgivetheswordtaked/SETONTRIGMOB/ATTACH/xmladdkarma,1000/ATTACH/xmladdfame,1000

and in the #80 ID 80

ifyourecive//ATTACH/xmladdkarma,1000/ATTACH/xmladdfame,1000/

Takeda will say THank for you help

ArteGordon- 05-16-2006
QUOTE (BiO_ZeRg @ May 16, 2006 04:33 pm)
what is masterhelper.xml where is? i just download xml 1 2 3

And the karma and fame thing i can make example when you finish the quest on condition #70 ID 70

ifyoukillshinobiandgivetheswordtaked/SETONTRIGMOB/ATTACH/xmladdkarma,1000/ATTACH/xmladdfame,1000

and in the #80 ID 80

ifyourecive//ATTACH/xmladdkarma,1000/ATTACH/xmladdfame,1000/

Takeda will say THank for you help

you can add an entry that has a DependsOn of -1 and has a Condition that checks to see if they are carrying a completed questholder, like

GETONCARRIED,Kill Shinobi,completed=true

Then you could have the Action field of that entry do whatever you wanted, like give out the reward or karma or fame with something like

GIVE/gold,2000 ; SETONTRIGMOB/ATTACH/xmladdfame,1000 ; SETONTRIGMOB/ATTACH/xmladdkarma,1000 ; TAKE/Kill Shinobi

Note that if you do it this way, then you cannot use the AutoReward feature of the quest since that automatically deletes the questholder when completed. They would have to actually return to the npc for their reward and you would have to TAKE the questholder yourself.

The masterhelper.xml example is in the xmlextras.zip package. You have to download that separately from the main package. You will find it in the main xmlspawner release thread.

BiO_ZeRg- 05-16-2006
I invant you to enter on my server

biozerg.servegame.com 2593

Auto Account if you want to come and see my quest on action biggrin.gif

ArteGordon- 05-16-2006
QUOTE (BiO_ZeRg @ May 16, 2006 05:09 pm)
I invant you to enter on my server

biozerg.servegame.com 2593

Auto Account if you want to come and see my quest on action biggrin.gif

congrats on getting it working. thanks for the invite.

BiO_ZeRg- 05-30-2006
[COLOR=red]invalid type specification: Repeatable
[COLOR=blue]I was redoing the quest when i put repatable/false and show me that


ArteGordon- 05-30-2006
QUOTE (BiO_ZeRg @ May 30, 2006 03:11 pm)
[COLOR=red]invalid type specification: Repeatable
[COLOR=blue]I was redoing the quest when i put repatable/false and show me that

paste the actual spawn entry that you were using.

Vladimir- 06-08-2006
How would you give tithingpoints as a quest reward?

ArteGordon- 06-08-2006
QUOTE (Vladimir @ June 08, 2006 09:28 am)
How would you give tithingpoints as a quest reward?

I would just make an attachment based on the XmlAddFame type attachments, and change Fame to TithingPoints and then use it just like the Fame, Karma, or Virtue adding attachments.

CODE

using System;
using Server;
using Server.Items;
using Server.Network;
using Server.Mobiles;
using System.Collections;

namespace Server.Engines.XmlSpawner2
{
public class XmlAddTithing : XmlAttachment
{
 private int m_DataValue;    // default data

 [CommandProperty( AccessLevel.GameMaster )]
 public int Value { get{ return m_DataValue; } set { m_DataValue = value; } }

 // These are the various ways in which the message attachment can be constructed.  
 // These can be called via the [addatt interface, via scripts, via the spawner ATTACH keyword.
 // Other overloads could be defined to handle other types of arguments
     
 // a serial constructor is REQUIRED
 public XmlAddTithing(ASerial serial) : base(serial)
 {
 }

 [Attachable]
 public XmlAddTithing( int value)
 {
  Value = value;
 }


 public override void Serialize( GenericWriter writer )
 {
  base.Serialize(writer);

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

 }

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

  int version = reader.ReadInt();
  // version 0
  m_DataValue = reader.ReadInt();
 }
 
 public override void OnAttach()
 {
  base.OnAttach();
     
  // apply the mod
  if(AttachedTo is PlayerMobile)
  {
   // for players just add it immediately
   ((Mobile)AttachedTo).TithingPoints += Value;

   ((Mobile)AttachedTo).SendMessage("Receive {0}",OnIdentify((Mobile)AttachedTo));

   // and then remove the attachment
   Timer.DelayCall(TimeSpan.Zero, new TimerCallback(Delete));
   //Delete();
  }
  else
   if(AttachedTo is Item)
  {
   // dont allow item attachments
   Delete();
  }

 }
 
 public override bool HandlesOnKilled { get { return true; } }
 
 public override void OnKilled(Mobile killed, Mobile killer )
 {
  base.OnKilled(killed, killer);

  if(killer == null) return;
     
  killer.TithingPoints += Value;

  killer.SendMessage("Receive {0}",OnIdentify(killer));
 }


 public override string OnIdentify(Mobile from)
 {

  return String.Format("{0} TithingPoints", Value);

 }
}
}

Vladimir- 06-08-2006
thx smile.gif xmlspawner/Checked2.gif

Vladimir- 06-08-2006
hmm I have this in the action bar for the reward

SETONTRIGMOB/ATTACH/XmlAddTithingPoints,250 ; SETONTHIS/MSG/Well Done {GETONTRIGMOB,name}! Use these Tithing Points wisely!

The NPC says the msg, but the attachment doesn't get added?

ArteGordon- 06-08-2006
if you cut and pasted the script directly, then the attachment is

XmlAddTithing

not

XmlAddTithingPoints

Vladimir- 06-08-2006
there we go smile.gif working nicely now... tx

mojo- 03-29-2010
hello Im using a basecreature.cs that looks totally different from what you say needs changing. At least I think i am.

Titles.AwardKarma( ds.m_Mobile, totalKarma, true );

to

Titles.AwardKarma( ds.m_Mobile, totalKarma, true );
// modification to support XmlQuest Killtasks
XmlQuest.RegisterKill( this, ds.m_Mobile);

Only thing close that I found was

Titles.AwardKarma(titles[i], karma[i], true);, that's what i have in mine, how would i change that?