Is it possible to calculate and extract the crafted items char_id from card position 3 and 4 ?
I have this test script, where i'm trying to extract as many data from the crafted items as possible and show results.
In docs char_id is calculated: @card3 = @charid & 65535; @card4 = @charid >> 16; when crafting them.
Hello,
Is it possible to calculate and extract the crafted items char_id from card position 3 and 4 ?
I have this test script, where i'm trying to extract as many data from the crafted items as possible and show results.
In docs char_id is calculated: @card3 = @charid & 65535; @card4 = @charid >> 16; when crafting them.
- script #atcmd_test -1,{ OnInit: bindatcmd "test", strnpcinfo(3)+"::OnAtCommand"; end; OnAtCommand: if (getgmlevel() < 60) end; [email protected]_id = getcharid(0); getinventorylist( [email protected]_id ); for( [email protected] = 0; [email protected]<@inventorylist_count; [email protected]++ ) { if(@inventorylist_card1[[email protected]] == CARD0_PET) { message strcharinfo(0), ([email protected]+1) +". [Pet] "+ getitemname(@inventorylist_id[[email protected]]) + " ("+ @inventorylist_amount[[email protected]] +")"; } else if(@inventorylist_card1[[email protected]] == CARD0_FORGE) { message strcharinfo(0), ([email protected]+1) +". [Forge]" + (@inventorylist_refine[[email protected]] ? " +"+ @inventorylist_refine[[email protected]] : "") + " "+ callsub(S_ForgeProperty, @inventorylist_card2[[email protected]]) + " "+ getitemname(@inventorylist_id[[email protected]]) + " ("+ @inventorylist_amount[[email protected]] +")" + (@inventorylist_equip[[email protected]] > 0 ? " Equiped: "+ callsub(S_EquipPosition,@inventorylist_equip[[email protected]]) : "") + (@inventorylist_attribute[[email protected]] ? " broken" : ""); // for debugs: //(@inventorylist_card2[[email protected]] ? " card-2:" + @inventorylist_card2[[email protected]] : "") + //(@inventorylist_card3[[email protected]] ? " card-3:" + @inventorylist_card3[[email protected]] : "") + //(@inventorylist_card4[[email protected]] ? " card-4:" + @inventorylist_card4[[email protected]] : ""); } else if(@inventorylist_card1[[email protected]] == CARD0_CREATE) { message strcharinfo(0), ([email protected]+1) +". [Create]" + (@inventorylist_refine[[email protected]] ? " +"+ @inventorylist_refine[[email protected]] : "") + " "+ getitemname(@inventorylist_id[[email protected]]) + " ("+ @inventorylist_amount[[email protected]] +")" + (@inventorylist_equip[[email protected]] > 0 ? " Equiped: "+ callsub(S_EquipPosition,@inventorylist_equip[[email protected]]) : ""); // for debugs: //(@inventorylist_card2[[email protected]] ? " card-2:" + @inventorylist_card2[[email protected]] : "") + //(@inventorylist_card3[[email protected]] ? " card-3:" + @inventorylist_card3[[email protected]] : "") + //(@inventorylist_card4[[email protected]] ? " card-4:" + @inventorylist_card4[[email protected]] : ""); } else if (@inventorylist_equip[[email protected]] > 0) { // Equiped items message strcharinfo(0), ([email protected]+1) +"." + (@inventorylist_refine[[email protected]] ? " +"+ @inventorylist_refine[[email protected]] : "") + " "+ getitemname(@inventorylist_id[[email protected]]) + " ("+ @inventorylist_amount[[email protected]] +")" + " Equiped: "+ callsub(S_EquipPosition,@inventorylist_equip[[email protected]]) + (@inventorylist_identify[[email protected]] ? "" : " unidentified") + (@inventorylist_attribute[[email protected]] ? " broken" : "") + (@inventorylist_card1[[email protected]] ? " card-1:" + @inventorylist_card1[[email protected]] : "") + //@inventorylist_card1[[email protected]] == 256 is Egg (@inventorylist_card2[[email protected]] ? " card-2:" + @inventorylist_card2[[email protected]] : "") + (@inventorylist_card3[[email protected]] ? " card-3:" + @inventorylist_card3[[email protected]] : "") + (@inventorylist_card4[[email protected]] ? " card-4:" + @inventorylist_card4[[email protected]] : ""); } else { // Other inventory items message strcharinfo(0), ([email protected]+1) +"." + (@inventorylist_refine[[email protected]] ? " +"+ @inventorylist_refine[[email protected]] : "") + " "+ getitemname(@inventorylist_id[[email protected]]) + " ("+ @inventorylist_amount[[email protected]] +")" + (@inventorylist_identify[[email protected]] ? "" : " unidentified") + (@inventorylist_attribute[[email protected]] ? " broken" : "") + (@inventorylist_card1[[email protected]] ? " card-1:" + @inventorylist_card1[[email protected]] : "") + (@inventorylist_card2[[email protected]] ? " card-2:" + @inventorylist_card2[[email protected]] : "") + (@inventorylist_card3[[email protected]] ? " card-3:" + @inventorylist_card3[[email protected]] : "") + (@inventorylist_card4[[email protected]] ? " card-4:" + @inventorylist_card4[[email protected]] : ""); } //debugmes "Equip: "+ getitemname(@inventorylist_id[[email protected]]) + ": "[email protected]_equip[[email protected]]; } end; S_ForgeProperty: [email protected] = getarg(0); // 1 - Ice, 2 - Earth 3 - Fire 4 - Wind. // Calc formula: ElementNumber + ((StarCrubNumber * 5) << 8) switch([email protected]) { case 3840: [email protected]$ = "Very Very Very Strong Neutral"; break; case 3841: [email protected]$ = "Very Very Very Strong Ice"; break; case 3842: [email protected]$ = "Very Very Very Strong Earth"; break; case 3843: [email protected]$ = "Very Very Very Strong Fire"; break; case 3844: [email protected]$ = "Very Very Very Strong Wind"; break; case 2560: [email protected]$ = "Very Very Strong Neutral"; break; case 2561: [email protected]$ = "Very Very Strong Ice"; break; case 2562: [email protected]$ = "Very Very Strong Earth"; break; case 2563: [email protected]$ = "Very Very Strong Fire"; break; case 2564: [email protected]$ = "Very Very Strong Wind"; break; case 1280: [email protected]$ = "Very Strong Neutral"; break; case 1281: [email protected]$ = "Very Strong Ice"; break; case 1282: [email protected]$ = "Very Strong Earth"; break; case 1283: [email protected]$ = "Very Strong Fire"; break; case 1284: [email protected]$ = "Very Strong Wind"; break; case 0: [email protected]$ = "Neutral"; break; case 1: [email protected]$ = "Ice"; break; case 2: [email protected]$ = "Earth"; break; case 3: [email protected]$ = "Fire"; break; case 4: [email protected]$ = "Wind"; break; default: [email protected]$ = ""; break; } //debugmes "Calc value: "+ [email protected]; //debugmes "Calc result: "+ [email protected]$; return [email protected]$; S_EquipPosition: [email protected] = getarg(0); if([email protected] == EQP_ACC_L) { [email protected]$ = "Accessory Left"; } else if([email protected] == EQP_ACC_R) { [email protected]$ = "Accessory Right"; } else if([email protected] == EQP_SHOES) { [email protected]$ = "Shoes"; } else if([email protected] == EQP_GARMENT) { [email protected]$ = "Garment"; } else if([email protected] == EQP_HEAD_LOW) { [email protected]$ = "Head lower"; } else if([email protected] == EQP_HEAD_MID) { [email protected]$ = "Head middle"; } else if([email protected] == EQP_HEAD_TOP) { [email protected]$ = "Head top"; } else if([email protected] == EQP_ARMOR) { [email protected]$ = "Armor"; } else if([email protected] == EQP_HAND_L) { [email protected]$ = "Hand Left"; } else if([email protected] == EQP_HAND_R) { [email protected]$ = "Hand Right"; } else if([email protected] == EQP_HAND_L + EQP_HAND_R) { [email protected]$ = "Hands Left & Right"; } else if([email protected] == EQP_COSTUME_HEAD_TOP) { [email protected]$ = "C-Head top"; } else if([email protected] == EQP_COSTUME_HEAD_MID) { [email protected]$ = "C-Head middle"; } else if([email protected] == EQP_COSTUME_HEAD_LOW) { [email protected]$ = "C-Head lower"; } else if([email protected] == EQP_COSTUME_GARMENT) { [email protected]$ = "C-Garment"; } else if([email protected] == EQP_AMMO) { [email protected]$ = "Ammonition"; } else if([email protected] == EQP_SHADOW_ARMOR) { [email protected]$ = "S-Armor"; } else if([email protected] == EQP_SHADOW_WEAPON) { [email protected]$ = "S-Weapon"; } else if([email protected] == EQP_SHADOW_SHIELD) { [email protected]$ = "S-Shield"; } else if([email protected] == EQP_SHADOW_SHOES) { [email protected]$ = "S-Shoes"; } else if([email protected] == EQP_SHADOW_ACC_R) { [email protected]$ = "S-Accessory Right"; } else if([email protected] == EQP_SHADOW_ACC_L) { [email protected]$ = "S-Accessory Left"; } else if([email protected] == EQP_ACC_RL) { [email protected]$ = "Accessory Both"; } else if([email protected] == EQP_SHADOW_ACC_RL) { [email protected]$ = "S-Accessory Both"; } else { [email protected]$ = ""; } return [email protected]$; }Thanks in advance.
Edited by SehrentosNotes
Link to comment
Share on other sites