Sample Prog Request - Renamining Spellbooks/Amulets of comm

For builders to discuss and ask building questions.
Post Reply
Nedylene
Sword Grand Master
Sword Grand Master
Posts: 517
Joined: Mon Aug 25, 2003 2:00 am
Location: Zhentil Keep

Sample Prog Request - Renamining Spellbooks/Amulets of comm

Post by Nedylene » Sun Jan 13, 2008 4:54 am

I swore I had a sample of this somewhere but I cannot find it. Can I please have a sample of a program that takes a spellbook or amulet of communication and renames it for a fee? Such as the ones in Sune's temple in Tantras? Thank you!
User avatar
Japcil
Sword Grand Master
Sword Grand Master
Posts: 1143
Joined: Fri Jun 17, 2005 5:32 pm
Location: Golden Oaks
Contact:

Post by Japcil » Sun Jan 13, 2008 5:02 am

You would use the vnum of the generic item ex i45 for amulet of communication and then use progs like bribe for the fee. The restringing or "renaming of the item lesson can be found here: http://www.gallwey.com/fk/builders/genericobject.php
Image
Nedylene
Sword Grand Master
Sword Grand Master
Posts: 517
Joined: Mon Aug 25, 2003 2:00 am
Location: Zhentil Keep

Post by Nedylene » Sun Jan 13, 2008 5:16 am

I am looking more to restring an item already on a person. IE the amulet of communication which they obtained in the regular quest.. or the spellbook they got when first created. Is this possible or would it just be a bribe program and just make a new one for them?
User avatar
Japcil
Sword Grand Master
Sword Grand Master
Posts: 1143
Joined: Fri Jun 17, 2005 5:32 pm
Location: Golden Oaks
Contact:

Post by Japcil » Sun Jan 13, 2008 5:29 am

You can use qbits to do that. First do a bribe prog:

Code: Select all

>bribe_prog 500~
if quest(0,1,$n) == 0
  sayto $n Ok now give me your amulet.
  mpmset $n quest 0 1 1
endif
~
>give_prog i45
if quest(0,1,$n) == 1
  mpecho This mob waves their fingers over your amulet and mutters some ancient dialect.
  mpecho This mob hands you back your new amulet.
  mposet on $n i45 name i45 {C0}blue runed amulet
  mposet on $n i45 short {C0}a blue runed amulet
  mposet on $n i45 long {C0}A blue runed amulet lies forgotten here.
  mposet on $n i45 ed addline 'blue runed amulet' {C0}This amulet has been infused with magical powers and is covered in blue runes.
endif
~
|
Image
Dalvyn
Sword Grand Master
Sword Grand Master
Posts: 4708
Joined: Tue Jul 15, 2003 9:26 pm
Location: House of Wonder, Waterdeep

Post by Dalvyn » Sun Jan 13, 2008 6:08 am

Not 100% correct, but close :)

First, make sure that the character has paid/done the quest/whatever. In the case of a simple payment, that would be something like this:

Code: Select all

>bribe_prog 500~
if quest(0,1,$n) == 0
  sayto $n Ok now give me your amulet.
  mpmset $n quest 0 1 1
  mpjunk all.coins
else
  sayto $n You have already paid me!
  sayto $n But thank you for the generous tip.
  sayto $n Now, give me your amulet please.
  (or the mob reimbuses $n)
endif
~
It sets a quest bit indicating that the character has paid.

Then, to do the renaming itself, you would use a give_prog. Amulets of communications are items vnum 45, so it would go something like this:

Code: Select all

>give_prog i45
if quest(0,1,$n) == 0
  sayto $n Hey! You must pay me first!
  drop i45
else
  mpecho This mob waves their fingers over your amulet and mutters some ancient dialect.
  mpecho This mob hands you back your new amulet.
  mposet i45 name i45 blue runed amulet
  mposet i45 short {C0}a blue runed amulet
  mposet i45 long {C0}A blue runed amulet lies forgotten here.
  mposet i45 ed addline 'blue runed amulet' {C0}This amulet has been infused with magical powers and is covered in blue runes.
endif
~
(I removed the "on $n", because "on $n" means that you are modifying something (an object) which is carried/held by $n; this is not the case here: the mob has the item, since $n has given it).

The renaming itself is done with those 4 mposet lines.

Name = the list of all keywords; make sure to include iVNUM in them.
Short = the short description (as in: (worn around neck) ...)
Long = the long description (as in: what you see when you enter a room and the object is on the ground)

And you have the option to add a line at the end of the item's description (you can omit that part if you don't want to change the item's description).
Image
User avatar
Japcil
Sword Grand Master
Sword Grand Master
Posts: 1143
Joined: Fri Jun 17, 2005 5:32 pm
Location: Golden Oaks
Contact:

Post by Japcil » Sun Jan 13, 2008 6:32 am

Probably best to use mpdeposit instead of junk all.coin as well since we have functioning economies.
Image
User avatar
Kregor
Sword Grand Master
Sword Grand Master
Posts: 1474
Joined: Sun Jul 11, 2004 6:14 am
Location: Baldur's Gate

Post by Kregor » Sun Jan 13, 2008 9:57 am

Actually, both. mpdeposit won't remove the coins from the merchant, also we use the mpdeposit command judiciously on FK, so depending on the size of the bribe, it may or may not be a good idea.
"There is no safety for honest men except by believing all possible evil of evil men."

Kregor - Ranger of Tangled Trees
Rozor - Lady Luck's Duelist
Tygen - Ranger-Bard of Mielikki
Dalvyn
Sword Grand Master
Sword Grand Master
Posts: 4708
Joined: Tue Jul 15, 2003 9:26 pm
Location: House of Wonder, Waterdeep

Post by Dalvyn » Sun Jan 13, 2008 10:19 am

Area economy constantly rises, till it reaches back the maximum set in the area file, so all mpdeposit commands are really not necessary (unless the amount of money is counted in platinum).
Image
User avatar
Japcil
Sword Grand Master
Sword Grand Master
Posts: 1143
Joined: Fri Jun 17, 2005 5:32 pm
Location: Golden Oaks
Contact:

Post by Japcil » Sun Jan 13, 2008 5:48 pm

If it doesnt remove the coins what is the point of the command now really? Especially if they constantly rise without it?
Image
User avatar
Kregor
Sword Grand Master
Sword Grand Master
Posts: 1474
Joined: Sun Jul 11, 2004 6:14 am
Location: Baldur's Gate

Post by Kregor » Mon Jan 14, 2008 2:15 am

Leftover code from Smaug. Back in the day, in its days as Smaug code, there were no coin objects on a mobile's person, or a PCs person, or anywhere really, save the ground when they were dropped or picked up, rather just a field in its file to say how much money it had, the mpdeposit command added to the economy and reduced the mobile's gold field by a like amount.

FKMud has evolved considerably past the old Smaug days. It could very well be that we could consider the mpdeposit command deprecated.
"There is no safety for honest men except by believing all possible evil of evil men."

Kregor - Ranger of Tangled Trees
Rozor - Lady Luck's Duelist
Tygen - Ranger-Bard of Mielikki
Post Reply