helmet /shield craft without cep
#1
Posté 18 janvier 2011 - 02:13
The one without cep ,I have modified to have no cost or DC for craft armor /craft weapon.I added the 4 extra robes from the vault.I added the cloak craft lever. What I need now is to add the helmet and shield craft scripts if anyone has a link or knows where to find them.I cant seem to find the right one.
#2
Posté 18 janvier 2011 - 09:18
This first one would advance the helmet to the next appearance:
//change to next helmet appearance
void main()
{
object oPC = GetPCSpeaker();
object oHelm = GetItemInSlot(INVENTORY_SLOT_HEAD, oPC);
int iCurrentApp = GetItemAppearance(oHelm, ITEM_APPR_TYPE_ARMOR_MODEL, 0);
int iNewApp = iCurrentApp + 1;
int iMax = StringToInt(Get2DAString("baseitems", "MaxRange", BASE_ITEM_HELMET));
if (iNewApp > iMax) iNewApp = 1;
object oNewHelm = CopyItemAndModify(oHelm, ITEM_APPR_TYPE_ARMOR_MODEL, 0, iNewApp, TRUE);
while (!GetIsObjectValid(oNewHelm))
{
iNewApp++;
if (iNewApp > iMax) iNewApp = 1;
oNewHelm = CopyItemAndModify(oHelm, ITEM_APPR_TYPE_ARMOR_MODEL, 0, iNewApp, TRUE);
}
DestroyObject(oHelm);
AssignCommand(oPC, ClearAllActions(TRUE));
AssignCommand(oPC, ActionEquipItem(oNewHelm, INVENTORY_SLOT_HEAD));
//test line to see appearance #
//SendMessageToPC(oPC, "Appearance # " + IntToString(iNewApp));
}
And this one to go to the previous appearance:
//change to previous helmet appearance
void main()
{
object oPC = GetPCSpeaker();
object oHelm = GetItemInSlot(INVENTORY_SLOT_HEAD, oPC);
int iCurrentApp = GetItemAppearance(oHelm, ITEM_APPR_TYPE_ARMOR_MODEL, 0);
int iNewApp = iCurrentApp - 1;
int iMax = StringToInt(Get2DAString("baseitems", "MaxRange", BASE_ITEM_HELMET));
if (iNewApp < 1) iNewApp = iMax;
object oNewHelm = CopyItemAndModify(oHelm, ITEM_APPR_TYPE_ARMOR_MODEL, 0, iNewApp, TRUE);
while (!GetIsObjectValid(oNewHelm))
{
iNewApp--;
if (iNewApp < 1) iNewApp = iMax;
oNewHelm = CopyItemAndModify(oHelm, ITEM_APPR_TYPE_ARMOR_MODEL, 0, iNewApp, TRUE);
}
DestroyObject(oHelm);
AssignCommand(oPC, ClearAllActions(TRUE));
AssignCommand(oPC, ActionEquipItem(oNewHelm, INVENTORY_SLOT_HEAD));
//test line to see appearance #
//SendMessageToPC(oPC, "Appearance # " + IntToString(iNewApp));
}
Hope that helps. Good luck.
P.S. These would be easy to alter for the sheild appearances as well. You could have separate objects or NPCs that allow for changing the sheilds and helmets or you could wrap it up into one convo by setting some variable in the convo. You could also make it all one script. There are a lot of ways to go about this. Probably even some simpler versions of what I posted as well. I'm not the best scripter.
Modifié par GhostOfGod, 18 janvier 2011 - 09:19 .
#3
Posté 18 janvier 2011 - 06:05
#4
Posté 18 janvier 2011 - 07:54
I used a literal based on trial and error rather than looking at the 2da (errmmm mainly because I forgot it was there tbh
oNew = CopyItemAndModify(oItem, ITEM_APPR_TYPE_SIMPLE_MODEL, 0, nModel, TRUE);
in my script, wonder if I'm missing some choices, the last model in the list is the funny sparkly one?
Also with the shields there are different ranges depending on what type of shield it is and again using the ITEM_APPR_TYPE_SIMPLE_MODEL I have these as the limits:
switch(GetBaseItemType(oItem)) {
case BASE_ITEM_TOWERSHIELD:
if (nModel == 13) {
nModel = 21;
} else if (nModel == 23) {
nModel = 31;
} else if (nModel == 33) {
nModel = 41;
} else if (nModel == 43) {
nModel = 51;
} else if (nModel == 51) {
nModel = 11;
} else {
nModel++;
}
break;
case BASE_ITEM_SMALLSHIELD:
if (nModel == 13) {
nModel = 21;
} else if (nModel == 23) {
nModel = 31;
} else if (nModel == 33) {
nModel = 41;
} else if (nModel == 43) {
nModel = 11;
} else {
nModel++;
}
break;
case BASE_ITEM_LARGESHIELD:
if (nModel == 13) {
nModel = 21;
} else if (nModel == 23) {
nModel = 31;
} else if (nModel == 33) {
nModel = 41;
} else if (nModel == 43) {
nModel = 51;
} else if (nModel == 56) {
nModel = 61;
} else if (nModel == 75) {
nModel = 11;
} else {
nModel++;
}
break;
}
Do yours use the ITEM_APPR_TYPE_ARMOR_MODEL and do they all show the 100 shield types the 2da would suggest they would (assuming the same type script)?
Modifié par ent.devil, 18 janvier 2011 - 07:58 .
#5
Posté 19 janvier 2011 - 05:14
And yes it is using ITEM_APPR_TYPE_ARMOR_MODEL
Modifié par GhostOfGod, 19 janvier 2011 - 05:18 .
#6
Posté 06 mai 2011 - 09:54





Retour en haut







