Author Topic: "Restores the default starting gear for new characters"  (Read 147 times)

Legacy_WhiteTiger

  • Hero Member
  • *****
  • Posts: 889
  • Karma: +0/-0
"Restores the default starting gear for new characters"
« on: February 07, 2014, 07:56:05 pm »


               ------------------------------------------------------------------------------------------------------------------------------
I am using a script By ShaDoOoW that's delete all starting itens Anti-newchar Exploits code by Shadooow


but new chars are naked! we need restore the basic character equipment as defined by bioware.


So we need  restores the default starting gear for new characters - add starting itens to all new characters created, but each class has to had different equipament.

I have organized all references (blueprint resref and tag) to all classes read:

------------------------------------------------------------------------------------------------------------------------------


Before All, we have 3 important things that all players must start: GOLD, BOOK and Clothes.

-----------------MyModule World Universal Starting Itens-----------------
#Clothes (Already using/equipped) - Name:Woodsman Outfit - Blueprint ResRef:cloth002 Tag:NW_CLOTH001
#Book - Name: Livro de Regras - Blueprint ResRef:livroderegras TAG:LivrodeRegras
#Tourch - Blueprint Res:it_torch002 TAG:NW_IT_TORCH001
#Potion - Name:Potion of Cure Light Wounds  - Blueprint ResRef:it_mpotion002 TAG:NW_IT_MPOTION001
#GOLD: 20 gps
--------------------------------------------------------------------

Itens for Each Class

---------------1.Barbarian----------------
#item inventory *ARMOR:Hide Armor - Blueprint ResRef:aarcl009 TAG:NW_AARCL008
#item inventory *WEAPON:Handaxe - Blueprint ResRef:waxhn002 TAG:NW_WAXHN001

---------------2.Bard---------------------
#item inventory *ARMOR:Leather Armor - Blueprint ResRef:aarcl002 TAG:NW_AARCL001
#item inventory *WEAPON:Light Crossbow - Blueprint ResRef:wbwxl002 TAG:NW_WBWXL001
#item inventory *WEAPON:Dagger - Blueprint ResRef:wswdg002 TAG:NW_WSWDG001
#item inventory - Bolt - Blueprint ResRef:wambo002 TAG:NW_WAMBO001
#item inventory - SCROLL Protection from Alignment - Blueprint ResREF:it_sparscr103 TAG:NW_IT_SPARSCR102
#item inventory - SCROLL Magic Missile - Blueprint ResREF:it_sparscr110 TAG:NW_IT_SPARSCR109
#item inventory - SCROLL Summon Creature 1 - Blueprint ResREF:it_sparscr106 TAG:NW_IT_SPARSCR105
#item inventory - SCROLL Sleep - Blueprint ResREF:it_sparscr109 TAG:NW_IT_SPARSCR108

---------------3.Cleric-------------------
#item inventory *ARMOR:Studded Leather Armor  - Blueprint ResRef:aarcl003 TAG:NW_AARCL002
#item inventory *WEAPON:Mace - Blueprint ResRef:wblml002 TAG:NW_WBLML001
#item inventory *SHIELD:Small Shield - Blueprint ResRef:ashsw002 TAG:NW_ASHSW001

---------------4.Druid--------------------
#item inventory *ARMOR:Leather Armor - Blueprint ResRef:aarcl002 TAG:NW_AARCL001
#item inventory *WEAPON:Sickle - Blueprint ResRef:wspsc002 TAG:NW_WSPSC001

---------------5.Fighter------------------
#item inventory *ARMOR:Studded Leather Armor  - Blueprint ResRef:aarcl003 TAG:NW_AARCL002
#item inventory *WEAPON:Short Sword - Blueprint ResRef:wswss002 TAG:NW_WSWSS001

---------------6.Monk---------------------
#item inventory *ARMOR:Monk's Outfit  - Blueprint ResRef:cloth017 TAG:NW_CLOTH016
#item inventory *WEAPON: Kama - Blueprint ResRef:wspka002 TAG:NW_WSPKA001

---------------7.Paladin------------------
#item inventory *ARMOR:Studded Leather Armor  - Blueprint ResRef:aarcl003 TAG:NW_AARCL002
#item inventory *WEAPON:Longsword - Blueprint ResRef:wswls002 TAG:NW_WSWLS001
#item inventory *SHIELD:Large Shield - Blueprint ResRef:ashlw002 TAG:NW_ASHLW001
#item inventory *Helmet:Pot Helmet - Blueprint ResRef:arhe002 TAG:NW_ARHE001

---------------8.Ranger-------------------
#item inventory *ARMOR:Leather Armor - Blueprint ResRef:aarcl002 TAG:NW_AARCL001
#item inventory *WEAPON:Longsword - Blueprint ResRef:wswls002 TAG:NW_WSWLS001
#item inventory *WEAPON:Dagger - Blueprint ResRef:wswdg002 TAG:NW_WSWDG001
#item inventory *WEAPON:Shortbow - Blueprint ResRef:wbwsh002 TAG:wbwsh002
#item inventory - Arrow - Blueprint ResRef:wbwsh002 TAG:NW_WAMAR001

---------------9.Rogue--------------------
#item inventory *ARMOR:Leather Armor - Blueprint ResRef:aarcl002 TAG:NW_AARCL001
#item inventory *WEAPON:Short Sword - Blueprint ResRef:wswss002 TAG:NW_WSWSS001
#item inventory *WEAPON:Dagger - Blueprint ResRef:wswdg002 TAG:NW_WSWDG001
#item inventory - Minor Spike Trap Kit - Blueprint ResRef:it_trap002 TAG:NW_IT_TRAP001
#item inventory - Thieve's Tools +1 - Blueprint ResRef:it_picks002 TAG:NW_IT_PICKS001

---------------10.Sorcerer----------------
#item inventory *ARMOR:Sorcerer's Robe - Blueprint ResRef: TAG:
#item inventory *WEAPON:Light Crossbow - Blueprint ResRef:wbwxl002 TAG:NW_WBWXL001
#item inventory *WEAPON:Dagger - Blueprint ResRef:wswdg002 TAG:NW_WSWDG001
#item inventory - Bolt - Blueprint ResRef:wambo002 TAG:NW_WAMBO001
#item inventory - SCROLL Protection from Alignment - Blueprint ResREF:it_sparscr103 TAG:NW_IT_SPARSCR102
#item inventory - SCROLL Magic Missile - Blueprint ResREF:it_sparscr110 TAG:NW_IT_SPARSCR109
#item inventory - SCROLL Summon Creature 1 - Blueprint ResREF:it_sparscr106 TAG:NW_IT_SPARSCR105
#item inventory - SCROLL Sleep - Blueprint ResREF:it_sparscr109 TAG:NW_IT_SPARSCR108

---------------11.Wizard------------------
#item inventory *ARMOR:Wizard's Robe - Blueprint ResRef: TAG:
#item inventory *WEAPON:Light Crossbow - Blueprint ResRef:wbwxl002 TAG:NW_WBWXL001
#item inventory *WEAPON:Dagger - Blueprint ResRef:wswdg002 TAG:NW_WSWDG001
#item inventory - Bolt - Blueprint ResRef:wambo002 TAG:NW_WAMBO001
#item inventory - SCROLL Protection from Alignment - Blueprint ResREF:it_sparscr103 TAG:NW_IT_SPARSCR102
#item inventory - SCROLL Magic Missile - Blueprint ResREF:it_sparscr110 TAG:NW_IT_SPARSCR109
#item inventory - SCROLL Summon Creature 1 - Blueprint ResREF:it_sparscr106 TAG:NW_IT_SPARSCR105
#item inventory - SCROLL Sleep - Blueprint ResREF:it_sparscr109 TAG:NW_IT_SPARSCR108
               
               

               


                     Modifié par sandronejm, 07 février 2014 - 11:32 .
                     
                  


            

Legacy_Proleric

  • Hero Member
  • *****
  • Posts: 1750
  • Karma: +0/-0
"Restores the default starting gear for new characters"
« Reply #1 on: February 08, 2014, 06:48:31 am »


               I can't find a Bioware script that does this, so it may be an engine function. It's not difficult, though.

I put my "dress" code in x3_mod_pre_enter, to ensure that it happens at the right point during the OnClientEnter event.

From experience, you'll need a one second delay after the item strip has completed (i.e. additional to delays in that script, if there are any).

The standard equipment for the class is in the packeq****.2da, which can be read with the Get2DAString function, incrementing the line number in a loop from zero until you hit a null string.

For each valid line, you'll need something like

    oEquip = CreateItemOnObject(sEquip, oPC);
and for the armour/clothing

    AssignCommand(oPC, ActionEquipItem(oEquip, INVENTORY_SLOT_CHEST));

               
               

               
            

Legacy__Guile

  • Hero Member
  • *****
  • Posts: 1308
  • Karma: +0/-0
"Restores the default starting gear for new characters"
« Reply #2 on: February 08, 2014, 06:54:23 am »


               Basically you will want to make an OnEnter Event Script that will go in a Trigger's OnEnter event...
When the PC enters the trigger it will give them their items & starting gear / levels / xp & whatever..

I'm assuming you are requesting for someone to make you a script with all of this starting gear?
=================================================================================


int XP_TO_GIVE = 30; // Set XP to give the PC at here.. (Must Be AT Least 1 xp!)

int GP_TO_GIVE = 300; // Set the GP to give the PC Here..

//Put this script OnEnter
void main(){

object oPC = GetEnteringObject();
if (!GetIsPC(oPC)) return;
int DoOnce = GetLocalInt(oPC, GetTag(OBJECT_SELF));
if (DoOnce==TRUE) return;
if(GetXP(oPC) >= 1) return; // Stop here if the PC has ANY XP AT ALL! 
SetLocalInt(oPC, GetTag(OBJECT_SELF), TRUE);
GiveGoldToCreature(oPC, GP_TO_GIVE);
GiveXPToCreature(oPC, XP_TO_GIVE);
string ItemResRef;

//-----------------------------------------------------------------------------------------
// For Items To Give ALL Classes.....

// Copy & Paste The Code Below & Change ResRef to Add More Items...
   
ItemResRef = "enter_resref_here";
CreateItemOnObject(ItemResRef ", oPC);



 //---------------------------------------------------------------------------------------
 // For Item To Give A Specific Class...

 // For Cleric...
 if ((GetLevelByClass(CLASS_TYPE_CLERIC, oPC) >= 1))
 {
   // Copy & Paste The Code Below & Change ResRef to Add More Items...
   ItemResRef = "enter_resref_here";
   CreateItemOnObject(ItemResRef ", oPC);

 } 
 
 // for Druid....
 else if ((GetLevelByClass(CLASS_TYPE_DRUID, oPC) >= 1))
 {
  // Copy & Paste The Code Below & Change ResRef to Add More Items...
   ItemResRef = "enter_resref_here";
   CreateItemOnObject(ItemResRef ", oPC);

 }

 // for Sorcerer
 else if ((GetLevelByClass(CLASS_TYPE_SORCERER, oPC) >= 1))
 {
  // Copy & Paste The Code Below & Change ResRef to Add More Items...
   ItemResRef = "enter_resref_here";
   CreateItemOnObject(ItemResRef ", oPC);

 }

 // for Wizard.
 else if ((GetLevelByClass(CLASS_TYPE_WIZARD, oPC) >= 1))
 {
  // Copy & Paste The Code Below & Change ResRef to Add More Items...
   ItemResRef = "enter_resref_here";
   CreateItemOnObject(ItemResRef ", oPC);

 }

 // for Rogue
 else if ((GetLevelByClass(CLASS_TYPE_ROGUE, oPC) >= 1))
 {
   // Copy & Paste The Code Below & Change ResRef to Add More Items...
   ItemResRef = "enter_resref_here";
   CreateItemOnObject(ItemResRef ", oPC);

 }

 // for Fighter
 else if ((GetLevelByClass(CLASS_TYPE_FIGHTER, oPC) >= 1))
 {
   // Copy & Paste The Code Below & Change ResRef to Add More Items...
   ItemResRef = "enter_resref_here";
   CreateItemOnObject(ItemResRef ", oPC);

 }

  // for Paladin
 else if ((GetLevelByClass(CLASS_TYPE_PALADIN, oPC) >= 1))
 {
   // Copy & Paste The Code Below & Change ResRef to Add More Items...
   ItemResRef = "enter_resref_here";
   CreateItemOnObject(ItemResRef ", oPC);

 }

  // for Ranger
 else if ((GetLevelByClass(CLASS_TYPE_RANGER, oPC) >= 1))
 {
   // Copy & Paste The Code Below & Change ResRef to Add More Items...
   ItemResRef = "enter_resref_here";
   CreateItemOnObject(ItemResRef ", oPC);

 }

 // for Bard
 else if ((GetLevelByClass(CLASS_TYPE_BARD, oPC) >= 1))
 {
   // Copy & Paste The Code Below & Change ResRef to Add More Items...
   ItemResRef = "enter_resref_here";
   CreateItemOnObject(ItemResRef ", oPC);

 }

 // for Monk
 else if ((GetLevelByClass(CLASS_TYPE_MONK, oPC) >= 1))
 {
   // Copy & Paste The Code Below & Change ResRef to Add More Items...
   ItemResRef = "enter_resref_here";
   CreateItemOnObject(ItemResRef ", oPC);

 }

 // for Barbarian
 else if ((GetLevelByClass(CLASS_TYPE_BARBARIAN, oPC) >= 1))
 {
   // Copy & Paste The Code Below & Change ResRef to Add More Items...
   ItemResRef = "enter_resref_here";
   CreateItemOnObject(ItemResRef ", oPC);

 }

// End Script
}
               
               

               


                     Modifié par _Guile, 08 février 2014 - 07:14 .
                     
                  


            

Legacy_WhiteTiger

  • Hero Member
  • *****
  • Posts: 889
  • Karma: +0/-0
"Restores the default starting gear for new characters"
« Reply #3 on: February 08, 2014, 04:06:45 pm »


               It wont work... Guile and Proleric
               
               

               
            

Legacy_Proleric

  • Hero Member
  • *****
  • Posts: 1750
  • Karma: +0/-0
"Restores the default starting gear for new characters"
« Reply #4 on: February 08, 2014, 10:48:11 pm »


               If you've tried my approach, please post your script. It's working in my modules, albeit without the nuance of selecting kit by class.