Aller au contenu

Photo

Crap. Cant find a script.


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

#1
Starbridge

Starbridge
  • Members
  • 29 messages
So a while ago I had a script that on new player entry to server it saw they had 0 EXP so it would strip them of everything they had and give them the set items and/or gold I wanted, then set them with 1 EXP so this would not trigger on them again.  Anyone have a name or a link to this older post?  I tried looking with key word search player strip, server entry and didnt come up with anything. 
Assist please.

#2
Starbridge

Starbridge
  • Members
  • 29 messages
I have a script generator and I have dinked around with it for a while now and I cant figure out a way to get it to work.

#3
420

420
  • Members
  • 190 messages
Try this, I just whipped it up so it isn't tested:
//Goes in module's OnClientEnter event
void main()
{
object oPC = GetEnteringObject();

if(GetXP(oPC) == 0)
    {
    SetXP(oPC, 1);

    int iCounter;
    object oItem;

    //Strip equipped items
    for (iCounter = 0; iCounter <= NUM_INVENTORY_SLOTS; iCounter++)
        {
        oItem = GetItemInSlot(iCounter, oPC);
        DestroyObject(oItem);
        }
    //Strip inventory items
    oItem = GetFirstItemInInventory(oPC);
    while(GetIsObjectValid(oItem))
        {
        DestroyObject(oItem);
        oItem = GetNextItemInInventory();
        }

    TakeGoldFromCreature(GetGold(), oPC, TRUE);

    //Give the PC gold
    int nAmount = 10;
    CreateItemOnObject("nw_it_gold001", oPC, nAmount);

    //Give the PC items
    CreateItemOnObject("item_resref_1", oPC);
    CreateItemOnObject("item_resref_2", oPC);
    CreateItemOnObject("item_resref_3", oPC);
    }
}

-420

#4
Starbridge

Starbridge
  • Members
  • 29 messages
I'll test it out. Thank you.

*30 seconds later*

Ok, so it half worked?

All equipped items were deleted and the gold amount was added to starting pool, but I kinda like that about the gold. Still need to figure out a way to get rid of everything in inventory.

#5
420

420
  • Members
  • 190 messages

Starbridge wrote...

All equipped items were deleted and the gold amount was added to starting pool, but I kinda like that about the gold. Still need to figure out a way to get rid of everything in inventory.

Sorry, my bad. Copied it from another script and forgot to replace a default variable:
//Goes in module's OnClientEnter event
void main()
{
object oPC = GetEnteringObject();

if(GetXP(oPC) == 0)
    {
    SetXP(oPC, 1);

    int iCounter;
    object oItem;

    //Strip equipped items
    for (iCounter = 0; iCounter <= NUM_INVENTORY_SLOTS; iCounter++)
        {
        oItem = GetItemInSlot(iCounter, oPC);
        DestroyObject(oItem);
        }
    //Strip inventory items
    oItem = GetFirstItemInInventory(oPC);
    while(GetIsObjectValid(oItem))
        {
        DestroyObject(oItem);
        oItem = GetNextItemInInventory(oPC);
        }

    TakeGoldFromCreature(GetGold(), oPC, TRUE);

    //Give the PC gold
    int nAmount = 10;
    CreateItemOnObject("nw_it_gold001", oPC, nAmount);

    //Give the PC items
    CreateItemOnObject("item_resref_1", oPC);
    CreateItemOnObject("item_resref_2", oPC);
    CreateItemOnObject("item_resref_3", oPC);
    }
}

-420

#6
Tarot Redhand

Tarot Redhand
  • Members
  • 2 693 messages
Thought this might help. It's from the 1st page of the 'Endless List of Homebrew Functions' thread on the old BioBoards and not by me.



//////////////////////////////////////////////////////////

// StripPC(oObject)

// Posted: Friday, 11 July 2003 01:20AM by Jassper

// oObject = A Player object

// Strips a PC of all Items

//////////////////////////////////////////////////////////



void StripPC(object oPC)

{

if(!GetIsPC(oPC)) return;



// Check Equip Items and get rid of them



int i;

for(i=0; i<14; i++)

{

object oEquip = GetItemInSlot(i,oPC);

if(GetIsObjectValid(oEquip))

{

SetPlotFlag(oEquip, FALSE);

DestroyObject(oEquip);

}

}



// Check general Inventory and clear it out.



object oItem = GetFirstItemInInventory(oPC);

while(GetIsObjectValid(oItem))

{

SetPlotFlag(oItem, FALSE);

DestroyObject(oItem);

oItem = GetNextItemInInventory(oPC);

}



//Take their Gold



int nAmount = GetGold(oPC);

if(nAmount > 0)

AssignCommand(oPC, TakeGoldFromCreature(nAmount, oPC, TRUE));

}



TR

#7
Starbridge

Starbridge
  • Members
  • 29 messages
Thank you. Both of you. :)

#8
Taino

Taino
  • Members
  • 139 messages
Or you can use this Sir Elric's Simple New Player Setup v1.5