Jump to content


Photo

Making a set like in DiabloII


  • Please log in to reply
8 replies to this topic

#1 Zvijer

Zvijer
  • Member
  • 27 posts

Posted 26 April 2003 - 06:50 AM

For instance, when a character equips my helm, amulet and boots, he gains +20MR as a result. I was thinking of making another amulet, and adding something such as this in baldur.bcs:

IF
HasItemEquiped("helm",Player1)
HasItemEquiped("amulet",Player1)
HasItemEquiped("boots",Player1)
THEN
RESPONSE #100
TakeItemReplace("amulet","amulet2",Player1)
END

Where amulet2 would grant the same bonuses and appear the same as amulet, but it would grant an invisible +20MR.

This would work, I guess, but here comes the most obvious problems:
-How to remove the bonus if any of those items gets unequipped?
-What if amulet2 gets unequipped and passed to another character?

Please, help.

#2 -Ghreyfain-

-Ghreyfain-
  • Guest

Posted 26 April 2003 - 09:46 AM

For instance, when a character equips my helm, amulet and boots, he gains +20MR as a result. I was thinking of making another amulet, and adding something such as this in baldur.bcs:

IF
HasItemEquiped("helm",Player1)
HasItemEquiped("amulet",Player1)
HasItemEquiped("boots",Player1)
THEN
RESPONSE #100
TakeItemReplace("amulet","amulet2",Player1)
END

Where amulet2 would grant the same bonuses and appear the same as amulet, but it would grant an invisible +20MR.

This would work, I guess, but here comes the most obvious problems:
-How to remove the bonus if any of those items gets unequipped?
-What if amulet2 gets unequipped and passed to another character?

Please, help.

For instance, when a character equips my helm, amulet and boots, he gains +20MR as a result. I was thinking of making another amulet, and adding something such as this in baldur.bcs:


I think dplayer3.bcs would be better. You'll see why in a bit.

IF
  HasItemEquiped("helm",Player1)
  HasItemEquiped("amulet",Player1)
  HasItemEquiped("boots",Player1)
THEN
  RESPONSE #100
    TakeItemReplace("amulet","amulet2",Player1)
END


Replace all instances of Player1 with Myself.

How to remove the bonus if any of those items gets unequipped?


IF
OR(3)
!HasItemEquiped("helm",Myself)
!HasItemEquiped("amulet2",Myself)
!HasItemEquiped("boots",Myself)
THEN
RESPONSE #100
TakeItemReplace("amulet2","amulet",Myself) // Switch the item back if any of them are unequipped.
END

What if amulet2 gets unequipped and passed to another character?


IF
PartyHasItem("amulet2") // Someone in the party has it.
OR(2)
!HasItem("amulet2",Myself) // Either I don't have it.
NumItemsGT("amulet2") // Or if I do, someone else has a copy for whatever reason.
THEN
RESPONSE #100
TakePartyItem("amulet2") // Take all the copies of amulet2
DestroyItem("Amulet2") // And destroy them
GiveItemCreate("amulet2",Myself,1,0,0) // Then create another one
END

This'll probably need tweaking. We tried something similar in the Kelsey mod and it didn't work properly because you can put
the potions in bags of holding and the like. Sometimes you just have to trust in the player's integrity. Heh.

#3 Zvijer

Zvijer
  • Member
  • 27 posts

Posted 26 April 2003 - 10:07 AM

Thank you very much, Ghreyfain :).

If I put it in dplayer3.bcs, it will work only for protagonist, won't it?
And if I wanted to put it in dplayer2.bcs as well, what would the object need to be? PlayerX, no?

(Scripting is tough until you get used to it :( )

#4 -Sim-

-Sim-
  • Guest

Posted 26 April 2003 - 02:28 PM

I think dplayer3.bcs would be better. You'll see why in a bit.

In my personal opinion, DPLAYERs are never better if you can help it. However, others might think differently depending on whether you care if your mod stops working when the party AI is turned off.

#5 -Ghreyfain-

-Ghreyfain-
  • Guest

Posted 26 April 2003 - 09:49 PM

Sim: Wasn't that only confirmed to be the case in Baldur's Gate 1?

#6 -Ghreyfain-

-Ghreyfain-
  • Guest

Posted 26 April 2003 - 09:51 PM

Thank you very much, Ghreyfain :).

If I put it in dplayer3.bcs, it will work only for protagonist, won't it?
And if I wanted to put it in dplayer2.bcs as well, what would the object need to be? PlayerX, no?

(Scripting is tough until you get used to it :( )

I can't remember which is which, but if characters that join use DPlayer2.bcs, you'd need to add the script portion to that, too. You would still use Myself as the object though, because they're running it on themselves.

#7 -Sim-

-Sim-
  • Guest

Posted 27 April 2003 - 03:37 AM

Sim: Wasn't that only confirmed to be the case in Baldur's Gate 1?

Well, if it was, then I confirmed it in BG2 as well a few months ago.

#8 Zvijer

Zvijer
  • Member
  • 27 posts

Posted 27 April 2003 - 12:25 PM

So I should use baldur.bcs?
And what's the deal with baldur25.bcs? Is it ToB only? Do I have to put the script in it as well to work in ToB areas or what?

#9 Zvijer

Zvijer
  • Member
  • 27 posts

Posted 27 April 2003 - 01:22 PM

Well, here is the script. When Firesuit Crown, Charm, Belt, Gloves and Robe are equipped at the same time, Charm should get invisibly switched with more potent version. But it doesn't.

At first I thought that it does get switched, but immediately switched back because of other blocks, but it can't be the case.

I tried some debugging, with no avail, so tell me if there is a error with script.

IF
    HasItemEquiped("V#FRAMUL",Myself) // Firesuit Charm
    HasItemEquiped("V#FRBELT",Myself) // Firesuit Belt
    HasItemEquiped("V#FRBRAC",Myself) // Firesuit Gloves
    HasItemEquiped("V#FRCROW",Myself) // Firesuit Crown
    HasItemEquiped("V#FRROBE",Myself) // Firesuit Robe
THEN
    RESPONSE #100
        TakeItemReplace("V#FRAMUL","V#FRAMUX",Myself) // Firesuit Charm
END

IF
    OR(5)
        !HasItemEquiped("V#FRAMUX",Myself) // Firesuit Charm
        !HasItemEquiped("V#FRBELT",Myself) // Firesuit Belt
        !HasItemEquiped("V#FRBRAC",Myself) // Firesuit Gloves
        !HasItemEquiped("V#FRCROW",Myself) // Firesuit Crown
        !HasItemEquiped("V#FRROBE",Myself) // Firesuit Robe
THEN
    RESPONSE #100
        TakeItemReplace("V#FRAMUX","V#FRAMUL",Myself) // Firesuit Charm
END

IF
    PartyHasItem("V#FRAMUX") // Firesuit Charm
    OR(2)
        !HasItem("V#FRAMUX",Myself) // Firesuit Charm
        NumItemsGT("V#FRAMUX",Myself,1) // Firesuit Charm
THEN
    RESPONSE #100
        TakePartyItem("V#FRAMUX") // Firesuit Charm
        DestroyItem("V#FRAMUX") // Firesuit Charm
        GiveItemCreate("V#FRAMUX",Myself,1,0,0) // Firesuit Charm
END

Ah, and NumItemsGT needs an object. Myself would not do the job.