Aller au contenu

Photo

On Equip script to turn pc into a Lich


  • Veuillez vous connecter pour répondre
5 réponses à ce sujet

#1
Madasahatter

Madasahatter
  • Members
  • 111 messages
Hi,
 
Im looking for a script that would turn a pc into a Lich when they equip a certain item. And remove the effect when they unequip the item.

Thanx

Modifié par Madasahatter, 15 avril 2011 - 02:58 .


#2
GhostOfGod

GhostOfGod
  • Members
  • 863 messages
Well I don't think there is a polymorph for a lich so you will have to settle for just looking like one. But you could always add other feats or whatever if you really want to try and make the player become and actual lich.

This is a tag based script example. So you would just make sure that the tag of the item equipped/unequipped matches whatever you name this script:


#include "x2_inc_switches"
void main()
{
    int nEvent = GetUserDefinedItemEventNumber();

    if (nEvent == X2_ITEM_EVENT_EQUIP)
    {
        object oHelm = GetPCItemLastEquipped();
        object oPC = GetPCItemLastEquippedBy();
        int iCurrAppearance = GetAppearanceType(oPC);
        SetLocalInt(oHelm, "CURRNT_APPR", iCurrAppearance);
        SetCreatureAppearanceType(oPC, APPEARANCE_TYPE_LICH);
    }

    if (nEvent == X2_ITEM_EVENT_UNEQUIP)
    {
        object oHelm = GetPCItemLastUnequipped();
        object oPC = GetPCItemLastUnequippedBy();
        int iPrevAppearance = GetLocalInt(oHelm, "CURRNT_APPR");
        SetCreatureAppearanceType(oPC, iPrevAppearance);
    }
}


I named the object that was equipped/unequipped "oHelm" as an example. If you are using another type of item then you can name that something else of course. You might also want to add some visual effects to make the transformation look cooler. This is just the basics.

Hope this gets you heading in the right direction. good luck.

Modifié par GhostOfGod, 15 avril 2011 - 08:23 .


#3
Madasahatter

Madasahatter
  • Members
  • 111 messages
Thank's exactly what i was looking for :)

#4
Artistmonk

Artistmonk
  • Members
  • 30 messages
This goes where exactly?

Thanks

#5
GhostOfGod

GhostOfGod
  • Members
  • 863 messages
It's a tag based script. You don't put it anywhere. It just needs to be in your module. If you have tag based scripting turned on in your module, any time a player acquires, unacquires, equips, unequips, or activates an item, your module will automatically look for and execute a script that is named the same as the tag of that item.

#6
Artistmonk

Artistmonk
  • Members
  • 30 messages
Thanks.