//Product of Void's model spawn with item.
****************************DOesn't equip******************
//Product of Void's model spawn with item.
This is a second script of a two script task that works within a converstation.
This one draws the variables creates a creature, creates item on creature, and makes them equip.
It DID work...but I broke it good.
its an older version of the script but perhaps someone will tell me WHERE I goobered it up.
Code:
void main(string sItems) { object oUsedit= GetLastSpeaker(); object oWalkforme; location lSh; int iType; int iSwitche=1; object oSM; object oSitem; object oStre; //string sItems; //iType =GetAppearanceType(oUsedit); lSh =GetLocation(GetWaypointByTag("WP_pov_model1_01")); oWalkforme =CreateObject(OBJECT_TYPE_CREATURE, "pov_mmale",lSh,FALSE, "pov_model1"); //SetCreatureAppearanceType(oWalkforme,iType); //oSM=GetObjectByTag("pov_osm"); iType =GetLocalInt(GetObjectByTag("pov_osm"), "iHasiem"); SetCreatureAppearanceType(oWalkforme,(GetAppearanceType(oUsedit))); //putting item on critter //sItems=GetLocalString(oSM, "sStore"); oStre=GetObjectByTag(sItems); //sItems=GetLocalString(oSM, "sItmz"); oSM=GetFirstItemInInventory(oStre); while(GetIsObjectValid(oSM)) { if (iSwitche== iType) { CopyItem(oSM,oUsedit); CopyItem(oSM,oWalkforme); oUsedit=GetFirstItemInInventory(oWalkforme); AssignCommand(oWalkforme, ActionEquipItem(oUsedit, INVENTORY_SLOT_CHEST)); //AssignCommand(oWalkforme, ActionEquipMostEffectiveArmor()); return; } oSM= GetNextItemInInventory(oStre); iSwitche++; } //oSitem= GetItemPossessedBy(oStre,sItems); //oUsedit = //CopyItem(oSitem,oUsedit); //CopyItem(oSitem,oWalkforme); AssignCommand(oWalkforme, ActionEquipMostEffectiveArmor()); }
//Product of Void's model spawn with item.
Code:
void main() { object oUsedit= GetLastSpeaker(); object oWalkforme, oSM, oStre; location lSh; int iType, iSwitche; string sStore; //find waypoint to spawn fashion model lSh =GetLocation(GetWaypointByTag("WP_pov_model1_01")); //aquire name of store to get stuff from sStore=GetLocalString(GetObjectByTag("pov_osm"), "sItmz"); SendMessageToPC(oUsedit, sStore); //get the gender of the model iType = GetLocalInt(GetObjectByTag("pov_osm"), "iGender"); //get the race iSwitche=GetLocalInt(GetObjectByTag("pov_osm"), "iRace"); //if they did not change the race/gender go with theirs if(iType==0 && iSwitche==0) { iType =GetGender(oUsedit); iSwitche=GetAppearanceType(oUsedit); } //actual selecting of male or female models sStore="pov_mmale"; if(iType >=1)sStore= "pov_fmale"; //make the critter oWalkforme =CreateObject(OBJECT_TYPE_CREATURE, sStore,lSh,FALSE, "pov_model1"); //change how it looks SetCreatureAppearanceType(oWalkforme,iSwitche); //give it a heartbeat so it will walk the waypoints hopefully. SetEventHandler(oWalkforme,CREATURE_SCRIPT_ON_HEARTBEAT, "nw_c2_default1"); SetEventHandler(oWalkforme,CREATURE_SCRIPT_ON_SPAWN_IN, "nw_c2_default9"); //start setting up the while function oStre=GetObjectByTag(sStore); oSM=GetFirstItemInInventory(oStre); //number in the invenotry of armor to copy. iType =GetLocalInt(GetObjectByTag("pov_osm"), "iHasiem"); iSwitche=1; while(GetIsObjectValid(oSM)) { if (iSwitche== iType) { SendMessageToPC(oUsedit, "found it"); CopyItem(oSM,oWalkforme); oUsedit=GetFirstItemInInventory(oWalkforme); AssignCommand(oWalkforme, ActionEquipItem(oUsedit, INVENTORY_SLOT_CHEST)); DelayCommand(120.0 ,DestroyObject(oWalkforme)); return; } oSM= GetNextItemInInventory(oStre); SendMessageToPC(oUsedit, "in loop"); iSwitche++; } //end of function }
This one draws the variables creates a creature, creates item on creature, and makes them equip.
It DID work...but I broke it good.
its an older version of the script but perhaps someone will tell me WHERE I goobered it up.
Comment