Author Topic: Crap. Cant find a script.  (Read 374 times)

Legacy_Starbridge

  • Jr. Member
  • **
  • Posts: 57
  • Karma: +0/-0
Crap. Cant find a script.
« on: January 09, 2011, 09:43:59 pm »


               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.
               
               

               
            

Legacy_Starbridge

  • Jr. Member
  • **
  • Posts: 57
  • Karma: +0/-0
Crap. Cant find a script.
« Reply #1 on: January 09, 2011, 09:53:07 pm »


               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.
               
               

               
            

Legacy_420

  • Sr. Member
  • ****
  • Posts: 370
  • Karma: +0/-0
Crap. Cant find a script.
« Reply #2 on: January 09, 2011, 10:33:49 pm »


               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
               
               

               
            

Legacy_Starbridge

  • Jr. Member
  • **
  • Posts: 57
  • Karma: +0/-0
Crap. Cant find a script.
« Reply #3 on: January 10, 2011, 12:40:57 am »


               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.
               
               

               
            

Legacy_420

  • Sr. Member
  • ****
  • Posts: 370
  • Karma: +0/-0
Crap. Cant find a script.
« Reply #4 on: January 10, 2011, 01:35:38 am »


               

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
               
               

               
            

Legacy_Tarot Redhand

  • Hero Member
  • *****
  • Posts: 4165
  • Karma: +0/-0
Crap. Cant find a script.
« Reply #5 on: January 10, 2011, 01:42:38 am »


               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
               
               

               
            

Legacy_Starbridge

  • Jr. Member
  • **
  • Posts: 57
  • Karma: +0/-0
Crap. Cant find a script.
« Reply #6 on: January 10, 2011, 04:18:07 am »


               Thank you.  Both of you.  '<img'>
               
               

               
            

Legacy_Taino

  • Sr. Member
  • ****
  • Posts: 268
  • Karma: +0/-0
Crap. Cant find a script.
« Reply #7 on: January 10, 2011, 06:30:36 pm »


               Or you can use this Sir Elric's Simple New Player Setup v1.5