There is a problem in the trade code regarding norent items. I did a patch fix on my KA for laz.
I believe this is fixed for trading with pets, though there may still be an issue with inventory related to ninjadvloot.inc If so I can post my fixes for that.
Find the Sub PetToys and replace that entire section with this:
[CODE lang="javascript" title="Sub PetToys"]
Sub PetToys(string petName)
/if (!${Me.Pet.ID}) /return w
DEBUGPET PetToys Enter
/declare i int local
/declare j int local
/declare GrabItem int local 0
/declare PetToySpell string local 0
/declare FullText string local
/declare 2ndPart string local
/declare 3rdPart string local
/declare PetToysTemp string local ${Ini[${IniFileName},Pet,PetToysGave]}
/declare PetToyCheck string local
/declare GaveItem int local 1
/declare CondNo int local 0
/varset BagNum 0
/call OpenInvSlot
/declare petID int local ${Spawn[pet ${petName}].ID}
/if (!${Defined[PetToysOn]}) /return
/if (!${PetToysOn}) /return 0
/if (${BagNumLast}==99) {
/echo Inventory is full
/varset PetToysOn 0
/return X
}
/if (${BagNum}==0) {
/echo You must have an empty Top Inventory slot for Pet Toys to work.
/varset PetToysOn 0
/return X
}
| reset if different pet name only on my pet
/if (!${PetToysTemp.Find[${petName}]} && ${Me.Pet.CleanName.Equal[${petName}]}) {
/ini "${IniFileName}" "Pet" "PetToysGave" "0"
/varset PetToysTemp 0
}
/for i 1 to ${PetToys.Size}
DEBUGPET CHECKING: ${i} - ${PetToys[${i}]}
/if (${ConOn} && ${PetToys[${i}].Find[|cond]}) {
/varset CondNo ${PetToys[${i}].Mid[${Math.Calc[${PetToys[${i}].Find[|cond]}+5]},3]}
} else {
/varset CondNo 0
}
/if (${DebugPet}) {
/echo \atPetDebug PetToys 1: ${PetToys[${i}]}
/echo \atPetDebug PetToys 2: ${PetToysTemp}
/echo \atPetDebug PetToys 3: ${PetToys[${i}].Equal[Null]} || ${PetToysTemp.Find[${petName}]} && ${PetToysTemp.Find[${PetToys[${i}]}]}
/echo \atPetDebug PetToys 4: ${If[${CondNo},${Cond[${CondNo}]},0]}
}
/if (${CondNo}) {
/if (${If[${Cond[${CondNo}]},0,1]}) /continue
}
| Had to add pet name check else it will always skip giving weapons to OTHER pets.
DEBUGPET PetToys ${i} ${PetToys[${i}].Equal[Null]} SkipPetToy 1
/if (${PetToys[${i}].Equal[Null]}) /continue
| Are we handing weapons to the pet
/if (${PetToys[${i}].Arg[2,|].Length} && ${PetToys[${i}].Arg[2,|].NotEqual[null]}) {
/varset FullText ${PetToys[${i}]}
/varset PetToySpell ${PetToys[${i}].Arg[1,|]}
/varset 2ndPart ${PetToys[${i}].Arg[2,|]}
/varset 3rdPart ${PetToys[${i}].Arg[3,|]}
/varset PetToyCheck :${2ndPart}1
} else {
/varset FullText
/varset PetToySpell ${PetToys[${i}]}
/varset 2ndPart
/varset 3rdPart
/varset PetToyCheck ${PetToySpell}:
}
DEBUGPET PetToys ${Me.Pet.CleanName.Equal[${petName}]} && ${2ndPart.Length} && ${PetToysTemp.Find[1]} && ${PetToysTemp.Find[2]} SkipPetToy 2
/if (${Me.Pet.CleanName.Equal[${petName}]} && ${PetToysTemp.Find[${petName}]} && ${PetToysTemp.Find[${PetToyCheck}]}) /continue
/if (${Me.Pet.CleanName.Equal[${petName}]} && ${2ndPart.Length} && ${PetToysTemp.Find[1]} && ${PetToysTemp.Find[2]}) /continue
| Check if spell level less than 76 because mage pets auto equipped after that.
/if (${Me.Pet.CleanName.Equal[${petName}]} && ${Spell[${PetToySpell}].Level}>=76 && (${PetToySpell.Find[muzzle]} || ${PetToySpell.Find[visor]} || ${PetToySpell.Find[belt]})) /continue
| Check for pet toy spells in book to prevent double casting of items
/if (${Me.Book[${PetToySpell}]}) {
/call CastWhat "${PetToySpell}" ${Me.ID} Pet-nomem 0 0
/if (!${PetToysTemp.Find[${petName}]} && ${Me.Pet.CleanName.Equal[${petName}]}) {
/ini "${IniFileName}" "Pet" "PetToysGave" "${petName}"
/varset PetToysTemp ${Ini[${IniFileName},Pet,PetToysGave]}
}
/if (${Macro.Return.Equal[CAST_SUCCESS]}) {
/echo Casting pet toy spell >> ${PetToySpell} <<
}
/delay 15s ${Cursor.ID}
/if (!${Cursor.ID}) /return 0
| Check if spell has summoned a bag or folded pack
/if (${Cursor.Container} || ${Cursor.Name.Find[Folded]}) {
| If item is in Inv Slot exchange it with bag on cursor
/if (${InvSlot[pack${BagNum}].Item.ID}) /nomodkey /itemnotify pack${BagNum} leftmouseup
/while (1) {
/delay 2s ${Cursor.ID}
| Drop bag or item into inventory
/autoinventory
/delay 1s
| Drop exchanged item into inventory after bag is dropped
/if (${Cursor.ID}) /autoinventory
| If folded pack right click to convert to phantom satchel
/if (${InvSlot[pack${BagNum}].Item.Name.Find[folded]}) {
/nomodkey /itemnotify pack${BagNum} rightmouseup
/echo Opening ${InvSlot[pack${BagNum}].Item.Name}
/delay 3s
} else {
/break
}
}
}
/if (${InvSlot[pack${BagNum}].Item.Container} && (${InvSlot[pack${BagNum}].Item.Name.Find[Phantom Satchel]} || ${InvSlot[pack${BagNum}].Item.Name.Find[Pouch of Quellious]})) {
| Open the bag
/nomodkey /itemnotify pack${BagNum} rightmouseup
/delay 10
DEBUGPET PetToys ${i} - ${PetToySpell} - ${2ndPart} - ${3rdPart} - ${BagNum} - ${PetToysTemp}
| Condition revised to allow for pet weapons to be given to other people's pets.
/if (((${Me.Pet.CleanName.Equal[${petName}]} && !${PetToysTemp.Find[${2ndPart}1]}) && ${2ndPart.Length} && ${FindItemCount[=${2ndPart}]}) || (!${Me.Pet.CleanName.Equal[${petName}]} && ${2ndPart.Length} && ${FindItemCount[=${2ndPart}]})) {
/call GiveTo "${2ndPart}" ${petID}
/varset PetToysTemp ${PetToysTemp}|${PetToySpell}:${2ndPart}1
/if (${Me.Pet.CleanName.Equal[${petName}]}) /ini "${IniFileName}" "Pet" "PetToysGave" "${PetToysTemp}"
}
| Condition revised to allow for pet weapons to be given to other people's pets.
/if (((${Me.Pet.CleanName.Equal[${petName}]} && !${PetToysTemp.Find[${3rdPart}2]}) && ${3rdPart.Length} && ${FindItemCount[=${3rdPart}]}) || (!${Me.Pet.CleanName.Equal[${petName}]} && ${3rdPart.Length} && ${FindItemCount[=${3rdPart}]})) {
/call GiveTo "${3rdPart}" ${petID}
/varset PetToysTemp ${PetToysTemp}|${PetToySpell}:${3rdPart}2
/if (${Me.Pet.CleanName.Equal[${petName}]}) /ini "${IniFileName}" "Pet" "PetToysGave" "${PetToysTemp}"
}
/if (!${2ndPart.Length}) {
/for j 0 to ${InvSlot[pack${BagNum}].Item.Container}
/if (${InvSlot[pack${BagNum}].Item.Item[${j}].ID} && ${InvSlot[pack${BagNum}].Item.Item[${j}].Name.Length}) {
/call GiveTo "${InvSlot[pack${BagNum}].Item.Item[${j}].Name}" ${petID}
}
/delay 10
/next j
/if (${j}>=8 && !${PetToysTemp.Find[${PetToySpell}]} && ${Me.Pet.CleanName.Equal[${petName}]}) {
/varset PetToysTemp ${PetToysTemp}|${PetToySpell}
/ini "${IniFileName}" "Pet" "PetToysGave" "${PetToysTemp}"
}
}
}
/if (${Cursor.Name.Find[Summoned:]}) {
/if (${2ndPart.Length} && !${PetToysTemp.Find[1]}) {
/varset PetToysTemp ${PetToysTemp}|${PetToySpell}:${2ndPart}1
} else /if (${2ndPart.Length} && ${PetToysTemp.Find[1]} ) {
/varset PetToysTemp ${PetToysTemp}|${PetToySpell}:${2ndPart}2
} else /if (!${2ndPart.Length} && !${PetToysTemp.Find[${PetToySpell}]}) {
/varset PetToysTemp ${PetToysTemp}|${PetToySpell}:${Cursor.Name}
}
/call GiveTo "${Cursor.Name}" ${petID}
/if (${Me.Pet.CleanName.Equal[${petName}]}) /ini "${IniFileName}" "Pet" "PetToysGave" "${PetToysTemp}"
/varset GaveItem 0
}
/if (${InvSlot[pack${BagNum}].Item.Name.Find[Phantom Satchel]} || ${InvSlot[pack${BagNum}].Item.Name.Find[Pouch of Quellious]}) /call DestroyBag
}
/next i
| MUST reset PetToysGave after cycle complete in order to stop calling PetToys all the time.
/varset PetToysGave ${PetToysTemp}
/if (${Window[InventoryWindow].Open} && !${GaveItem}) /keypress inventory
/varset PetToysDone 1
/call DoWeMove ${ReturnToCamp} PetToys
DEBUGPET PetToys Leave
/return[/CODE]