here is the function:
Code: Select all
function DoDoubleClickEvent ();
if (distance (me, mymaster) > 1)
return 0;
endif
case (me.graphic)
CID_PACK_HORSE:
CID_PACK_LLAMA:
if (!me.backpack)
var newbackpack := CreateItemAtLocation (5288, 1176, 0, UOBJ_BACKPACK, 1);
if (!EquipItem (me, newbackpack))
DestroyItem (newbackpack);
endif
endif
SendOpenSpecialContainer (mymaster, me.backpack);
return 0;
endcase
//make sure they aren't already mounted
if (GetEquipmentByLayer (mymaster, LAYER_MOUNT))
return 0;
endif
mymaster.hidden := 0;
var mounttype := 0;
case (me.graphic)
CID_BROWN_HORSE:
mounttype := 0x3ea2;
CID_TAN_HORSE:
mounttype := 0x3e9f;
CID_LIGHT_HORSE:
mounttype := 0x3ea0;
CID_GREY_HORSE:
mounttype := 0x3ea1;
CID_LLAMA:
mounttype := 0x3ea6;
CID_DESERT_OSTARD:
mounttype := 0x3ea3;
CID_FRENZIED_OSTARD:
mounttype := 0x3ea4;
CID_FOREST_OSTARD:
mounttype := 0x3ea5;
endcase
if (mounttype)
if (MoveObjectToLocation (mymaster, me.x, me.y, me.z, me.realm, 0))
drop();
set_critical (1);
mymaster.facing := me.facing;
var mount := CreateItemAtLocation (5288, 1176, 0, UOBJ_MOUNT, 1);
if (!mount)
set_critical(0);
return 0;
endif
mount.color := me.color;
mount.graphic := mounttype;
SetObjProperty (mount, "petname", me.name);
SetObjProperty (mount, "npctemplate", me.npctemplate);
SetObjProperty (mount, "pethp", CINT (GetVital (me, "Life")/100));
SetObjProperty (mount, "petmana", CINT (GetVital (me, "Mana")/100));
SetObjProperty (mount, "petgraphic", me.graphic);
SetObjProperty (mount, "freetime", freetime);
if (Getobjproperty (me, "summoned"))
SetObjProperty (mount, "summoned", 1);
endif
if (GetObjProperty (me, "totem"))
SetObjProperty (mount, "totem", GetObjProperty (me, "totem"));
endif
if (GetObjProperty (me, "totemcolor"))
SetObjProperty (mount, "totemcolor", GetObjProperty (me, "totemcolor"));
endif
if (GetObjProperty (me, "totemdeaths"))
SetObjProperty (mount, "totemdeaths", GetObjProperty (me, "totemdeaths"));
endif
if (GetObjProperty (me, "ownerserial"))
SetObjProperty (mount, "ownerserial", GetObjProperty (me, "ownerserial"));
SetObjProperty (mount, "ownername", GetObjProperty (me, "ownername"));
SetObjProperty (mount, "oldname", GetObjProperty (me, "oldname"));
endif
if (!EquipItem (mymaster, mount))
DestroyItem (mount);
set_critical(0);
return 0;
endif
MoveObjectToLocation (me, 4550, 3687, 0, realm := _DEFAULT_REALM, flags := MOVEOBJECT_FORCELOCATION );
SetObjProperty (me, "guardkill", 1);
ApplyRawDamage (me, GetVital (me, "Life") + 3);
set_critical(0);
endif
endif
endfunctiondoes anyone have any ideas?