Quick little script that if applied in the npc.dfn file will have your monsters or npcs exploding loot diablo style.
all the better to annoy your friends and amaze your enemies by making it so much easier to pick a pvp fight.
Best used in conjunction with the upcoming 'walk over' to pickup loot script.
// 2/21/2022 by DukeHastMich/Humility function onCollide(trgSock, srcChar, trgItem){ //if not stackable or character overloaded or target is alive or target is locked down cancel let packCount = srcChar.pack.totalItemCount; if(!trgItem.isPileable|| packCount >=255|| trgItem.npc|| trgItem.isChar|| trgItem.movable>1){returnfalse;} //otherwise if it clears the garbage list of movable lockdowns the client screws up and character has a pack. elseif(!(chkGarbage(trgItem))&&(ValidateObject(srcChar.pack))){ // count the contents of their pack for overload check var packContents = srcChar.pack.totalItemCount;// Count for(mItem = srcChar.pack.FirstItem();!srcChar.pack.FinishedItems(); mItem = srcChar.pack.NextItem()){ // srcChar.TextMessage("debug"); if(ValidateObject(mItem)){ let currentID = mItem.id; if(currentID == trgItem.id){ if(mItem.amount+ trgItem.amount<65535){ mItem.amount= mItem.amount+ trgItem.amount; trgItem.Delete(); returnfalse; }else{ trgItem.amount-=(65535- mItem.amount); mItem.amount=65535; } } } } } // Place the item in the pack since we got this far if(!InTheBag(trgItem, srcChar, packContents)){ //srcChar.TextMessage("it puts the item in the pack or else it gets the ettin smack!", true) returnfalse; } }