Author Topic: Making Upgradeable Items in Baldur's Gate  (Read 10929 times)

0 Members and 1 Guest are viewing this topic.

Offline Raven

  • Miriam's sane half
  • Administrator
  • Level 5
  • *****
  • Posts: 3603
  • Karma: +118/-33
  • Gender: Female
  • Like Awesome!
    • View Profile
    • Vampire Tales
Making Upgradeable Items in Baldur's Gate
« on: July 11, 2012, 06:27:41 AM »
Making upgraded items in Baldur’s Gate is not difficult, just a little bit time consuming. This is an example of Magnus’s dialogue when you ask him to see if you have any items he can upgrade for you. Lets take an example of an item and walk you through this tutorial.
Code: [Select]

IF ~~ THEN BEGIN 10
  SAY ~Well <CHARNAME> lets see what ye 'ave eh?~
  IF ~PartyHasItem("misc1b")
~ THEN REPLY ~How about this butter knife? I can not think of many uses for it.~ GOTO 11
  IF ~PartyHasItem("sw2h06")
~ THEN REPLY ~How about the Spider's Bane Sword? Any way this can be improved?~ GOTO 12
  IF ~PartyHasItem("sw1h24")
~ THEN REPLY ~I have this Flame Tongue Sword can anything be done with this?~ GOTO 13
  IF ~PartyHasItem("sw1h23")
~ THEN REPLY ~Anything you can do with this scimitar?~ GOTO 14
  IF ~PartyHasItem("ring02")
~ THEN REPLY ~Anything you can do with the Ring of Fire Resistance?~ GOTO 15
  IF ~PartyHasItem("helm07")
~ THEN REPLY ~Anything you can do with the Helm of Balduran?~ GOTO 16
 [b] IF ~PartyHasItem("chan03")
~ THEN REPLY ~Anything you can do with the Mail of Dead chainmail~  GOTO 17[/b]
  IF ~PartyHasItem("bow04")
~ THEN REPLY ~Anything you can do to improve this long bow?~ GOTO 18
  IF ~PartyHasItem("bow08")
~ THEN REPLY ~How about the Eagle Bow? Can you do anything with this?~ GOTO 19
  IF ~PartyHasItem("belt04")
~ THEN REPLY ~How about the Girdle of Piercing? Can you do anything with this?~ GOTO 20
  IF ~PartyHasItem("ax1h03")
~ THEN REPLY ~How about the Battle Axe +2? Can you do anything with this?~ GOTO 21
  IF ~PartyHasItem("misc52")
~ THEN REPLY ~How about this wyvern head? Can you do anything with this?~ GOTO 22
  IF ~~ THEN REPLY ~Never mind I'll be on my way.~ GOTO 5
END

Ok lets work with the Mail of the Dead:

IF ~PartyHasItem("chan03")
~ THEN REPLY ~Anything you can do with the Mail of Dead chainmail~  GOTO 17


That part of the code is checking to see if you have the item in question CHAN03 which is Mail of the Dead. Which we do so lets jump down to statement 17 to see if we meet any more requirements of this upgrade.

Code: [Select]
IF ~~ THEN BEGIN 17
  SAY ~Chainmail of the Dead ye say? Now that's why I like to hear, working with good old armor. Hmm what kin I do to improve it... I know I kin make it offer better protection fer ye. All I need besides this is a diamond, potion of defense and 4000 gold pieces. How about it?~
  IF ~~ THEN REPLY ~No, not right now.~  GOTO 5
  IF ~PartyHasItem("chan03")
PartyHasItem("misc42")
PartyHasItem("potn24")
PartyGoldGT(3999)
~ THEN REPLY ~Sure thing. Go ahead and make it.~ DO ~TakePartyGold(4000)
TakePartyItem("chan03")
DestroyItem("chan03")
TakePartyItem("misc42")
DestroyItem("misc42")
TakePartyItem("potn24")
DestroyItem("potn24")
GiveItemCreate("maforg07",Player1,1,1,1)
~ EXIT
END

Ok in order to upgrade this item we need a diamond (MISC42), a Potion of Defense (POTN24) and 4000 gold. The PartyGoldGT(3999) checks to see if you have 3999 or greater in gold. If you do not meet any of those requirements you will not get this reply:
~ THEN REPLY ~Sure thing. Go ahead and make it.~ DO ~TakePartyGold(4000)

The reply you will get is:

IF ~~ THEN REPLY ~No, not right now.~  GOTO 5

We have the requirements to make this item, so lets continue.

We take the party’s gold, TakePartyGold(4000) and we take the items like TakePartyItem("chan03") and destroy it DestroyItem("chan03") so its not on Magnus if you decide to attack him , kill him and get your items back.

Now we give you the new item GiveItemCreate("maforg07",Player1,1,1,1) and place it in your inventory.

It takes a while to code out and think about the possible formulas for upgrading an item but its not that difficult to do with time and practice. I hope this sheds some light on upgrading items in Baldur’s Gate.


Per me si va nella citta dolente.
Per me si va nell eterno dolore.
Per me si va tra la perduta gente...
Lasciate ogni speranza perduta che'entrate!