Trace officier mais pas changement de voiles
ref procGetSailTextureData()
{
int st,i,sq;
int ms, os;
ref shref;
aref arEmbl,arSail;
string attrName;
int PChar = GetMainCharacterIndex();
int chrIdx = GetEventData();
int cn, e;
int offref;
for (e=0; e<COMPANION_MAX; e++)
{
cn = GetCompanionIndex(GetMainCharacter(), e);
if (cn>=0)
{
offref = GetCharacter(cn);
}
}
//DeleteAttribute(&BI_objRetValue,"");
string sUpgrade = "common";
ref refBaseShip = GetRealShip(GetCharacterShipType(&characters[chrIdx])); // boal
int iclass = sti(refBaseShip.Class);
int iUpgrade = sti(refBaseShip.ship.upgrades.sails); // boal
switch(iUpgrade)
{
case 1:
sUpgrade = "common";
break;
case 2:
sUpgrade = "pat";
break;
case 3:
sUpgrade = "silk";
break;
}
BI_objRetValue.normalTex = "ships\parus_" + sUpgrade + ".tga";
///âûñòàâëåíèå ãåðáà (ïåðåíåñòè íèæå â êàýéç íàöèé. âñå ÷òî â ýòîì êåéçå óáðàòü
BI_objRetValue.geraldTex = "";//"ships\gerald\chuckskull.tga";
BI_objRetValue.sailscolor = argb(255,255,255,255);
//BI_objRetValue.geraldTexPointer = 0; // (IDirect3DTexture8*)
string nationFileName = "ships\parus_" + sUpgrade + ".tga";
string tmpStr;
if(chrIdx==PChar) chrIdx = -1;
if(chrIdx==offref) chrIdx = -1;
if (chrIdx>=0)
{
BI_objRetValue.normalTex = "ships\parus_" + sUpgrade + ".tga";
BI_objRetValue.geraldTex = "";//"ships\gerald\chuckskull.tga";
BI_objRetValue.sailscolor = argb(255,255,255,255);
if (CheckAttribute(&characters[chrIdx], "ship.sails.color"))
{
BI_objRetValue.sailscolor = sti(characters[chrIdx].ship.sails.color);
}
if( CheckAttribute(&characters[chrIdx],"Ship.Sails.gerald_name") )
{
BI_objRetValue.geraldTex = characters[chrIdx].Ship.Sails.gerald_name;//ShipSails.gerald_name;
}
switch(sti(Characters[chrIdx].nation)) // Íå ðàáîòàåò ýòî :(
{
case ENGLAND:
if(iClass < 4){
BI_objRetValue.sailscolor = argb(255, 219, 199, 71);//Yellow
BI_objRetValue.geraldTex = "ships\gerald\eng_4.tga";}
if((iClass == 4) || (iClass == 5)){
BI_objRetValue.sailscolor = argb(255, 255, 153, 153);//Red
BI_objRetValue.geraldTex = "ships\gerald\eng_4.tga";}
if(iClass > 5){BI_objRetValue.sailscolor = argb(255, 255, 255, 153);//argb(255, 209, 145, 49);// yellow
BI_objRetValue.geraldTex = "ships\gerald\pir3.tga";trace("petite classe")}
break;
case FRANCE:
if(iClass < 4){
BI_objRetValue.sailscolor = argb(255, 0, 0, 255);// deep blue
BI_objRetValue.geraldTex = "ships\gerald\fra_3.tga";}
if((iClass == 4) || (iClass == 5)){
BI_objRetValue.sailscolor = argb(255, 105, 180, 230);//Red
BI_objRetValue.geraldTex = "ships\gerald\fra_5.tga";}
if(iClass > 5){BI_objRetValue.sailscolor = argb(255, 153, 204, 255);//Blue
BI_objRetValue.geraldTex = "ships\gerald\fra_6.tga";trace("petite classe")}
break;
case SPAIN:
if(iClass < 4){
BI_objRetValue.sailscolor = argb(255, 3, 91, 80);//green
BI_objRetValue.geraldTex = "ships\gerald\spa_4.tga";}
if((iClass == 4) || (iClass == 5)){
BI_objRetValue.sailscolor = argb(255, 255, 153, 153);//Red
BI_objRetValue.geraldTex = "ships\gerald\eng_4.tga";}
if(iClass > 5){BI_objRetValue.sailscolor = argb(255, 153, 255, 153);// yellow
BI_objRetValue.geraldTex = "ships\gerald\pir3.tga";trace("petite classe")}
break;
case PIRATE:
if(iClass < 4){
BI_objRetValue.sailscolor = argb(255, 60, 60, 60)//Black
BI_objRetValue.geraldTex = "ships\gerald\pir3.tga";}
if((iClass == 4) || (iClass == 5)){
BI_objRetValue.sailscolor = argb(255, 255, 153, 153);//Red
BI_objRetValue.geraldTex = "ships\gerald\pir6.tga";}
if(iClass > 5){BI_objRetValue.sailscolor = argb(255, 128, 128, 128);// Grey
BI_objRetValue.geraldTex = "ships\gerald\pir1.tga";trace("petite classe")}
break;
case HOLLAND:
if(iClass < 4){
BI_objRetValue.sailscolor = argb(255, 128, 128, 128);//Gray
BI_objRetValue.geraldTex = "ships\gerald\hol_4.tga";}
if((iClass == 4) || (iClass == 5)){
BI_objRetValue.sailscolor = argb(255, 255, 153, 153);//Red
BI_objRetValue.geraldTex = "ships\gerald\eng_4.tga";}
if(iClass > 5){BI_objRetValue.sailscolor = argb(255,60,60,60);// Black
BI_objRetValue.geraldTex = "ships\gerald\pir3.tga";trace("petite classe")}
break;
case MORVIS:
if(iClass < 4){
BI_objRetValue.sailscolor = argb(255, 255, 15, 15);//Red
BI_objRetValue.geraldTex = "ships\gerald\pir_6.tga";
BI_objRetValue.normalTex = "ships\parus_common_torn.tga";}
if((iClass == 4) || (iClass == 5)){
BI_objRetValue.sailscolor = argb(255, 255, 153, 153);//Red
BI_objRetValue.geraldTex = "ships\gerald\pir_1.tga";}
if(iClass > 5){BI_objRetValue.sailscolor = argb(255,255,110,90);// yellow
BI_objRetValue.geraldTex = "ships\gerald\pir_3.tga";trace("petite classe")}
break;
case PORTU:
if(iClass < 4){
BI_objRetValue.sailscolor = argb(255, 153, 255, 153);//pas Green
BI_objRetValue.geraldTex = "ships\gerald\spa_3.tga";}
if((iClass == 4) || (iClass == 5)){
BI_objRetValue.sailscolor = argb(255, 255, 153, 153);//Red
BI_objRetValue.geraldTex = "ships\gerald\eng_4.tga";}
if(iClass > 5){BI_objRetValue.sailscolor = argb(255,255,255,255);// yellow
BI_objRetValue.geraldTex = "ships\gerald\pir3.tga";trace("petite classe")}
break;
trace("voiles couleur nations")
}
st = GetCharacterShipType(GetCharacter(chrIdx))
if(st!=SHIP_NOTUSED)
{
shref = GetRealShip(st);
BI_objRetValue.maxSP = shref.sp;
// boal -->
if (CheckAttribute(shref, "EmblemedSails.normalTex")) // çàäíàííûé â òèïå ïàðóñ
{
BI_objRetValue.normalTex = shref.EmblemedSails.normalTex;
nationFileName = shref.EmblemedSails.normalTex;
}
if( CheckAttribute(&Characters[chrIdx],"Features.GeraldSails") && sti(Characters[chrIdx].Features.GeraldSails)==true)
{
makearef(arEmbl,shref.GeraldSails);
} else {
makearef(arEmbl,shref.EmblemedSails);
}
// boal <--
sq = GetAttributesNum(arEmbl);
for(i=0; i<sq; i++)
{
arSail = GetAttributeN(arEmbl,i);
attrName = GetAttributeName(arSail);
tmpStr = GetAttributeValue(arSail);
if( CheckAttribute(arSail,"hscale") ) {
BI_objRetValue.(attrName).hscale = arSail.hscale;
}
if( CheckAttribute(arSail,"vscale") ) {
BI_objRetValue.(attrName).vscale = arSail.vscale;
}
if(tmpStr=="1") {
//BI_objRetValue.(attrName).Gerald = nationFileName;
BI_objRetValue.(attrName) = nationFileName;
} else {
BI_objRetValue.(attrName).Gerald = tmpStr;
}
}
}
return &BI_objRetValue;
}
if (PChar == 1)
{
if (CheckAttribute(&characters[PChar], "ship.sails.color"))
{
BI_objRetValue.sailscolor = sti(characters[PChar].ship.sails.color);
}
if( CheckAttribute(&characters[PChar],"Ship.Sails.gerald_name") )
{
BI_objRetValue.geraldTex = characters[PChar].Ship.Sails.gerald_name;
}
trace("couleur de mon navire")
ms = GetCharacterShipType(GetCharacter(PChar))
if(ms!=SHIP_NOTUSED)
{
shref = GetRealShip(ms);
BI_objRetValue.maxSP = shref.sp;
// boal -->
if (CheckAttribute(shref, "EmblemedSails.normalTex")) // çàäíàííûé â òèïå ïàðóñ
{
BI_objRetValue.normalTex = shref.EmblemedSails.normalTex;
nationFileName = shref.EmblemedSails.normalTex;
}
if( CheckAttribute(&Characters[PChar],"Features.GeraldSails") && sti(Characters[PChar].Features.GeraldSails)==true)
{
makearef(arEmbl,shref.GeraldSails);
} else {
makearef(arEmbl,shref.EmblemedSails);
}
// boal <--
sq = GetAttributesNum(arEmbl);
for(i=0; i<sq; i++)
{
arSail = GetAttributeN(arEmbl,i);
attrName = GetAttributeName(arSail);
tmpStr = GetAttributeValue(arSail);
if( CheckAttribute(arSail,"hscale") ) {
BI_objRetValue.(attrName).hscale = arSail.hscale;
}
if( CheckAttribute(arSail,"vscale") ) {
BI_objRetValue.(attrName).vscale = arSail.vscale;
}
if(tmpStr=="1") {
BI_objRetValue.(attrName) = nationFileName;
} else {
BI_objRetValue.(attrName).Gerald = tmpStr;
}
}
}
}
if (offref >= 0)
{
trace("l officier est present 1")
if (CheckAttribute(&characters[offref], "ship.sails.color"))
{
trace("couleur de son navire")
BI_objRetValue.sailscolor = sti(characters[offref].ship.sails.color);
}
if( CheckAttribute(&characters[offref],"Ship.Sails.gerald_name") )
{
BI_objRetValue.geraldTex = characters[offref].Ship.Sails.gerald_name;//ShipSails.gerald_name;
}
os = GetCharacterShipType(GetCharacter(offref))
if(os!=SHIP_NOTUSED)
{
shref = GetRealShip(os);
BI_objRetValue.maxSP = shref.sp;
// boal -->
if (CheckAttribute(shref, "EmblemedSails.normalTex")) // çàäíàííûé â òèïå ïàðóñ
{
BI_objRetValue.normalTex = shref.EmblemedSails.normalTex;
nationFileName = shref.EmblemedSails.normalTex;
}
if( CheckAttribute(&Characters[offref],"Features.GeraldSails") && sti(Characters[offref].Features.GeraldSails)==true)
{
makearef(arEmbl,shref.GeraldSails);
} else {
makearef(arEmbl,shref.EmblemedSails);
}
// boal <--
sq = GetAttributesNum(arEmbl);
for(i=0; i<sq; i++)
{
arSail = GetAttributeN(arEmbl,i);
attrName = GetAttributeName(arSail);
tmpStr = GetAttributeValue(arSail);
if( CheckAttribute(arSail,"hscale") ) {
BI_objRetValue.(attrName).hscale = arSail.hscale;
}
if( CheckAttribute(arSail,"vscale") ) {
BI_objRetValue.(attrName).vscale = arSail.vscale;
}
if(tmpStr=="1") {
BI_objRetValue.(attrName) = nationFileName;
} else {
BI_objRetValue.(attrName).Gerald = tmpStr;
}
}
}
}
return &BI_objRetValue;
}