原版中动物无法释放,修正以适合JARRY服务器。
initevents gosub InitMenu gosub InitAnimalTaming gosub InitPickupRegs
loop: gosub Dispatch goto loop
sub InitMenu menu clear menu window title Uncle Dave's Tamer Plus 4.2 menu window size 320 190 menu window color $E0E0E0 menu font bgcolor $E0E0E0 menu font name MS Sans Serif menu font size 8 menu font style b menu text lblmovement 10 5 Features menu font style n menu check autotame 10 20 130 15 #false Auto Tame Creatures menu check pickupregs 10 35 130 15 #false Pickup Reagents menu font style b menu text lblrelease 10 55 Release Option menu font style n menu check releasecontext 10 70 130 15 #false Context Menu menu check releaserename 10 85 130 15 #false Rename menu check releasekill 10 100 130 15 #false Mage/Necro Kill menu font style b menu text lblmisc 10 120 Character Movement menu font style n menu check dontmove 10 135 130 15 #false Don't Move Character menu check returnstart 10 150 130 15 #false Return To Start menu font style b menu text lblstatistics 150 5 Statistics menu font style n menu text lbltameskill 150 20 Animal Taming: menu text lblloreskill 150 35 Animal Lore: menu text lbltameid 150 50 Animal Id: menu text lbltamecount 150 65 Attempts: menu font align right menu text tameskill 310 20 0/0 menu text loreskill 310 35 0/0 menu text tameid 310 50 N/A menu text tamecount 310 65 0 menu font align left menu button manualtame 150 90 80 25 Manual Tame menu button resetstart 150 115 80 25 Reset Start menu button ignorecurrent 230 90 80 25 Ignore Current menu button resetignore 230 115 80 25 Reset Ignore menu button setregcont 150 140 160 25 Set Reagent Container menu shape bgstatus 0 173 320 17 3 7 1 $999999 7 $E0E0E0 menu font color $666666 menu text lblstatus 5 175 Status: menu text status 40 175 Initializing gosub MenuUpdateStats menu show menu HideEUO set #menubutton N/A return
sub InitAnimalTaming event macro 8 2 ; open status wait 1s set %statusposx #contposx set %statusposy #contposy set %charstartx #charposx set %charstarty #charposy set %charstartz #charposz set %tameskill -1 set %tameigtimer 0 set %tamecount 0 set %tameid N/A return
sub InitPickupRegs set %reagents KUF_JUF_MZF_JZF_KZF_WZF_RZF_SZF event macro 8 7 ; open backpack wait 1s return
sub Dispatch menu set status Idle gosub ScriptIdletime gosub TamingCheckSkill set %finditems N/A menu get autotame if #menures = #true { gosub TamingIgnore reset set %finditems %tameable } menu get pickupregs if #menures = #true { if %finditems = N/A set %finditems %reagents else set %finditems %finditems , _ , %reagents } gosub FindClosestItem %finditems if %finddist = N/A { menu get returnstart if #menures = #true { gosub PathfindWait %charstartx %charstarty %charstartz if %moveres = error menu set returnstart #false } } if %finddist <> N/A { if %findtype in %tameable gosub Taming %findid if %findtype in %reagents gosub PickupRegs %findid } return
sub ScriptIdletime if #menubutton = manualtame 2 set #menubutton N/A gosub TamingManual if #menubutton = resetignore 2 set #menubutton N/A ignoreitem reset if #menubutton = resetstart 4 set #menubutton N/A set %charstartx #charposx set %charstarty #charposy set %charstartz #charposz if #menubutton = setregcont 2 set #menubutton N/A gosub SetReagentContainer gosub MenuUpdateStats gosub PickupRegsNearby return
sub MenuUpdateStats chooseskill anim str right #skill 1 set %_skilldec #strres set %_skill #skill / 10 set %_skillcap #skillcap / 10 menu set tameskill %_skill , #dot , %_skilldec , / , %_skillcap chooseskill anil str right #skill 1 set %_skilldec #strres set %_skill #skill / 10 set %_skillcap #skillcap / 10 menu set loreskill %_skill , #dot , %_skilldec , / , %_skillcap menu set tameid %tameid menu set tamecount %tamecount return
sub Taming if #followers >= #maxfol { display ok You have too many followers menu set autotame #false return } finditem %1 G_16 if #findkind = -1 return set %tameid #findid set %tametype #findtype set %tamedist #finddist if %tameid <> #ltargetid event exmsg %tameid 3 30 Pick me! set %tamecount 0 gosub MenuUpdateStats gosub TameAnimal set %tameid N/A return
sub TamingManual if %tameid <> N/A { event sysmessage You are already taming something. return } menu set status Waiting For Target gosub GetTargetId gosub Taming #ltargetid return
sub TamingCheckSkill menu get autotame if #menures = #false return chooseskill anim if #skill = #skillcap { display ok Taming skillcap reached menu set autotame #false return } if %tameskill = #skill return set %tameskill #skill ; --------------------------------------------------- ; this chart was auto-generated using TamingChart.xls ; --------------------------------------------------- if %tameskill >= 0 && %tameskill < 40 set %tameable HG_RD_NF_BE_NF_GO_WC if %tameskill >= 40 && %tameskill < 160 set %tameable HG_RD_NF_BE_NF_GO_WC_RF_AG_KB_WG_WG if %tameskill >= 160 && %tameskill < 220 set %tameable HG_RD_NF_BE_NF_GO_WC_RF_AG_KB_WG_WG_IG_NG_ZF_JF_TF_PF if %tameskill >= 220 && %tameskill < 280 set %tameable HG_RD_NF_BE_NF_GO_WC_RF_AG_KB_WG_WG_IG_NG_ZF_JF_TF_PF_TC if %tameskill >= 280 && %tameskill < 340 set %tameable GO_WC_RF_AG_KB_WG_WG_IG_NG_ZF_JF_TF_PF_TC_BB_TG_VE_PG if %tameskill >= 340 && %tameskill < 400 set %tameable WC_RF_AG_KB_WG_WG_IG_NG_ZF_JF_TF_PF_TC_BB_TG_VE_PG_CO_CG_JG_ZGB_XF_SF_MG_SG_OF_BO_WN_EG_QC if %tameskill >= 400 && %tameskill < 460 set %tameable RF_AG_KB_WG_WG_IG_NG_ZF_JF_TF_PF_TC_BB_TG_VE_PG_CO_CG_JG_ZGB_XF_SF_MG_SG_OF_BO_WN_EG_QC_BG_EG_VF_DG if %tameskill >= 460 && %tameskill < 520 set %tameable IG_NG_ZF_JF_TF_PF_TC_BB_TG_VE_PG_CO_CG_JG_ZGB_XF_SF_MG_SG_OF_BO_WN_EG_QC_BG_EG_VF_DG_ZI_ZE_IH if %tameskill >= 520 && %tameskill < 580 set %tameable IG_NG_ZF_JF_TF_PF_TC_BB_TG_VE_PG_CO_CG_JG_ZGB_XF_SF_MG_SG_OF_BO_WN_EG_QC_BG_EG_VF_DG_ZI_ZE_IH_UF_UE if %tameskill >= 580 && %tameskill < 640 set %tameable TC_BB_TG_VE_PG_CO_CG_JG_ZGB_XF_SF_MG_SG_OF_BO_WN_EG_QC_BG_EG_VF_DG_ZI_ZE_IH_UF_UE_VD_YF_L_M if %tameskill >= 640 && %tameskill < 700 set %tameable BB_TG_VE_PG_CO_CG_JG_ZGB_XF_SF_MG_SG_OF_BO_WN_EG_QC_BG_EG_VF_DG_ZI_ZE_IH_UF_UE_VD_YF_L_M_SD_AH_WF_QE if %tameskill >= 700 && %tameskill < 736 set %tameable CO_CG_JG_ZGB_XF_SF_MG_SG_OF_BO_WN_EG_QC_BG_EG_VF_DG_ZI_ZE_IH_UF_UE_VD_YF_L_M_SD_AH_WF_QE_GE_ZD if %tameskill >= 736 && %tameskill < 760 set %tameable CO_CG_JG_ZGB_XF_SF_MG_SG_OF_BO_WN_EG_QC_BG_EG_VF_DG_ZI_ZE_IH_UF_UE_VD_YF_L_M_SD_AH_WF_QE_GE_ZD_OH if %tameskill >= 760 && %tameskill < 796 set %tameable BG_EG_VF_DG_ZI_ZE_IH_UF_UE_VD_YF_L_M_SD_AH_WF_QE_GE_ZD_OH_YG_XG_RF if %tameskill >= 796 && %tameskill < 820 set %tameable BG_EG_VF_DG_ZI_ZE_IH_UF_UE_VD_YF_L_M_SD_AH_WF_QE_GE_ZD_OH_YG_XG_RF_KD if %tameskill >= 820 && %tameskill < 856 set %tameable ZI_ZE_IH_UF_UE_VD_YF_L_M_SD_AH_WF_QE_GE_ZD_OH_YG_XG_RF_KD_KG_CB if %tameskill >= 856 && %tameskill < 880 set %tameable ZI_ZE_IH_UF_UE_VD_YF_L_M_SD_AH_WF_QE_GE_ZD_OH_YG_XG_RF_KD_KG_CB_EH_QF if %tameskill >= 880 && %tameskill < 892 set %tameable UF_UE_VD_YF_L_M_SD_AH_WF_QE_GE_ZD_OH_YG_XG_RF_KD_KG_CB_EH_QF_LD_W_WJ if %tameskill >= 892 && %tameskill < 904 set %tameable UF_UE_VD_YF_L_M_SD_AH_WF_QE_GE_ZD_OH_YG_XG_RF_KD_KG_CB_EH_QF_LD_W_WJ_YE_XE if %tameskill >= 904 && %tameskill < 940 set %tameable UF_UE_VD_YF_L_M_SD_AH_WF_QE_GE_ZD_OH_YG_XG_RF_KD_KG_CB_EH_QF_LD_W_WJ_YE_XE_UB if %tameskill >= 940 && %tameskill < 988 set %tameable VD_YF_L_M_SD_AH_WF_QE_GE_ZD_OH_YG_XG_RF_KD_KG_CB_EH_QF_LD_W_WJ_YE_XE_UB_NC if %tameskill >= 988 && %tameskill < 1000 set %tameable SD_AH_WF_QE_GE_ZD_OH_YG_XG_RF_KD_KG_CB_EH_QF_LD_W_WJ_YE_XE_UB_NC_CD_DF_JJ_CH_MHB if %tameskill >= 1000 && %tameskill < 1012 set %tameable SD_AH_WF_QE_GE_ZD_OH_YG_XG_RF_KD_KG_CB_EH_QF_LD_W_WJ_YE_XE_UB_NC_CD_DF_JJ_CH_MHB_SH_TJ_SC if %tameskill >= 1012 && %tameskill < 1036 set %tameable SD_AH_WF_QE_GE_ZD_OH_YG_XG_RF_KD_KG_CB_EH_QF_LD_W_WJ_YE_XE_UB_NC_CD_DF_JJ_CH_MHB_SH_TJ_SC_TE if %tameskill >= 1036 set %tameable SD_AH_WF_QE_GE_ZD_OH_YG_XG_RF_KD_KG_CB_EH_QF_LD_W_WJ_YE_XE_UB_NC_CD_DF_JJ_CH_MHB_SH_TJ_SC_TE_HH_HH gosub TamingIgnore gain return
sub TamingIgnore if %1 = perm { ignoreitem %2 return } if %1 = temp { ignoreitem %2 1 set %tameigtimer #systime + 60000 return } if %1 = reset && #systime > %tameigtimer { ignoreitem reset 1 return } if %1 = skill { ignoreitem %2 2 return } if %1 = gain { ignoreitem reset 2 return } return
sub TameAnimal menu set status Starting To Tame TamingLoop: finditem %tameid G_16 if #findkind = -1 return if #finddist > 3 { menu set status Too Far Away gosub PathfindWait #findx #findy #findz if %moveres = error { gosub TamingIgnore temp %tameid return } if #menubutton = ignorecurrent { set #menubutton N/A gosub TamingIgnore perm %tameid return } gosub ScriptIdletime goto TamingLoop } set %tamecount %tamecount + 1 set %tamejournal #jindex + 1 set %tamefollow #followers set #ltargetid %tameid set #ltargetkind 1 event macro 13 35 ; animal taming target 2s event macro 22 0 ; last target gosub TamingMonitor if #result = success { gosub TamingRelease gosub TamingIgnore perm %tameid return } if #result = retry { gosub ScriptIdletime goto TamingLoop } if #result = retrylater { gosub TamingIgnore temp %tameid return } if #result = ignore { gosub TamingIgnore perm %tameid return } if #result = cancel { menu set autotame #false return } if #result = skill { gosub TamingIgnore skill %tameid return } gosub ScriptIdletime goto TamingLoop return
sub TamingMonitor set %movetimer 0 set %tametimer #systime + 15000 TamingMonitorLoop: if #jindex >= %tamejournal { scanjournal %tamejournal set %tamejournal %tamejournal + 1 if start_to_tame in #journal menu set status Taming Animal if seems_to_accept in #journal return success if anger_the_beast in #journal return retry if fail_to_tame in #journal return retry if too_far in #journal return retry if clear_path in #journal return retry if too_many_followers in #journal return cancel if can't_see_that in #journal return retrylater if too_angry in #journal return retrylater if distracted in #journal return retrylater if someone_else in #journal return retrylater if tame_already in #journal return ignore if cannot_be_tamed in #journal return ignore if can't_tame_that in #journal return ignore if no_chance in #journal return skill } if #followers > %tamefollow return success if #menubutton = ignorecurrent return ignore if #systime > %tametimer return retry finditem %tameid G_16 if #findkind = -1 return retry if #finddist > 3 && #systime > %movetimer { menu get dontmove if #menures = #false event pathfind #findx #findy #findz set %movetimer #systime + 1500 } gosub ScriptIdletime goto TamingMonitorLoop return
sub TamingRelease menu get releasecontext if #menures = #false { menu get releaserename if #menures = #false { event macro 1 0 All Follow Me return } } menu set status Releasing Animal set %attempt 0 set %adjust #false set %tamefollow #followers event macro 1 0 All Stay wait 10 gosub GetAnimalDisplacement TamingReleaseLoop: if #contid = #charid { event macro 8 2 wait 10 contpos %statusposx %statusposy wait 10 } if #contid = %tameid { gosub TamingRename event macro 1 0 SALANA Release wait 1s contpos 0 0 click 30 90 wait 1s } if #contname = normal_gump { if #contsize = 118_186 { set %xx #contposx + 50 set %yy #contposy + 165 click %xx %yy F wait 1s if #contsize = 270_120 { set %xx #contposx + 35 set %yy #contposy + 90 click %xx %yy F wait 15 } } else { set %xx #contposx + 50 set %yy #contposy + 10 click %xx %yy R wait 15 } } if #followers < %tamefollow { menu get releasekill if #menures = #true gosub TamingKill return } set %attempt ( %attempt % 5 ) + 1 finditem %tameid if #findkind = -1 return if %attempt > 1 && #finddist > 3 { event macro 1 0 All Stay event pathfind #findx #findy #findz wait 2s set %attempt 0 goto TamingReleaseLoop } if #finddist = 0 set %adjust #true if #finddist = 1 { set %deltax #findx - #charposx set %deltay #findy - #charposy if %deltay < 0 && %deltax = 0 set %adjust #true if %deltay < 0 && %deltax < 0 set %adjust #true if %deltay = 0 && %deltax < 0 set %adjust #true } if %adjust = #true { if %attempt = 1 { event macro 5 7 ; walk west event macro 5 7 ; walk west wait 1s } if %attempt = 2 { event macro 5 2 ; walk north east event macro 5 2 ; walk north east event macro 5 2 ; walk north east wait 1s } if %attempt = 3 { event macro 5 6 ; walk south west event macro 5 6 ; walk south west event macro 5 6 ; walk south west wait 1s } if %attempt = 4 { event macro 5 1 ; walk north event macro 5 1 ; walk north event macro 5 1 ; walk north wait 1s } if %attempt = 5 { event macro 5 4 ; walk south east event macro 5 4 ; walk south east event macro 5 4 ; walk south east event macro 5 4 ; walk south east wait 1s } set %adjust #false goto TamingReleaseLoop } finditem %tameid if #findkind = -1 return gosub GetScreenXY #findx #findy #findz 0 %screenydisp menu get releasecontext if #menures = #true { click %screenx %screeny F wait 1s goto TamingReleaseLoop } menu get releaserename if #menures = #true { click %screenx %screeny G wait 10 click %screenx %screeny P wait 10 goto TamingReleaseLoop } event macro 1 0 All Follow Me return
sub TamingRename menu set status Ranaming Animal contpos 5 30 wait 5 set %screenx #contposx + 130 set %screeny #contposy + 20 click %screenx %screeny for %i 1 5 { key RIGHT } for %i 1 20 { key BACK } msg SALANA$ click %screenx %screeny r return
sub TamingKill menu set status Killing Animal TamingKillLoop: finditem %tameid if #findkind = -1 return if #mana < 50 { chooseskill medi if #skill > 500 { event macro 13 46 ; meditation wait 11s goto TamingKillLoop } else { event sysmessage You must have at least 50 skill Meditation to use this option. menu set releasekill #false return } } set #ltargetid %tameid set #ltargetkind 1 chooseskill eval if #skill >= 800 event macro 15 50 ; flame strike else { chooseskill necr if #skill >= 800 event macro 15 109 ; pain strike else { event sysmessage You must have at least 80 skill in Necromancy or Evaluating Intelligence to use this option. menu set releasekill #false return } } target 6s event macro 22 0 ; last target wait 2s goto TamingKillLoop return
; clickScreenXYZ by ScriptFellow modded by Roadkill ; Mods by UncleDave sub GetScreenXY set %1 ( %1 - #charposx ) * 22 ; world x-coordinate set %2 ( #charposy - %2 ) * 22 ; world y-coordinate set %3 ( %3 - #charposz ) * 4 ; world z-coordinate if %0 < 4 || %4 = N/A set %4 0 ; x displacement, added to screen coordinate if %0 < 5 || %5 = N/A set %5 35 ; y displacement, added to screen coordinate set %screenx #clileft + #clixres / 2 + %1 + %2 + %4 set %screeny #clitop + #cliyres / 2 + %1 - %2 - %3 + %5 set %offscreen #true if %screenx > #clileft && + %screeny > #clitop && + %screenx < ( #clileft + #clixres ) && + %screeny < ( #clitop + #cliyres ) { set %offscreen #false ;click %screenx %screeny F } return
; GetYDisplacementForAnimType by Roadkill ; Mods by UncleDave sub GetAnimalDisplacement set %screenydisp -32 if %tametype in GE_ZD_L_M_TF__IG_NG__ZF_PF_EG_CO_TG_PG_VD set %screenydisp -25 if %tametype in AH set %screenydisp -45 if %tametype in DG_AG_WC_RF_WG_TC set %screenydisp -15 return
sub SetReagentContainer if %tameid <> N/A { event sysmessage You must wait until you are finished taming. return } event sysmessage Target the container to drop reagents. gosub GetTargetId set %regcont #ltargetid return
sub PickupRegs finditem %1 G_16 if #findkind = -1 return menu set status Picking Up Reagents set %regsid #findid set %regsdist #finddist if %regsdist > 2 { gosub PathfindWait #findx #findy #findz if %moveres = error { ignoreitem %regsid return } } gosub GetContainerPos %regcont if #result = #false { event sysmessage Unable to find reagent container. menu set pickupregs #false return } set %js #jindex event drag %regsid wait 10 if #contname = stack_gump key ENTER set %je #jindex for %ji %js %je { scanjournal %ji if can_not_pick in #journal 2 ignoreitem %regsid return } click %contdropx %contdropy wait 10 return
sub PickupRegsNearby menu get pickupregs if #menures = #false return finditem %reagents G_2 if #findkind <> -1 gosub PickupRegs #findid return
sub FindClosestItem finditem %1 G_16 set %findid #findid set %findtype #findtype set %finddist #finddist if #findcnt > 1 { for %i 1 #findcnt { finditem %1 %i G_16 if #findkind <> -1 && #finddist < %finddist { set %findid #findid set %findtype #findtype set %finddist #finddist } } } return
sub GetTargetId set #ltargetid N/A set #targcurs 1 GetTargetIdLoop: if #targcurs = 1 goto GetTargetIdLoop return
sub PathfindWait set %moveres unknown menu get dontmove if #menures = #true return if #charposx = %1 && #charposy = %2 { set %moveres success return } set %js #jindex event pathfind %1 %2 %3 wait 10 set %je #jindex for %ji %js %je { scanjournal %ji if pathfinding in #journal { set %movex #charposx set %movey #charposy set %movetimer #systime + 500 PathfindWaitLoop: if #systime < %movetimer goto PathfindWaitLoop if %movex = %1 && %movey = %2 { set %moveres success return } if %movex = #charposx && %movey = #charposy { set %moveres stopped return } set %movex #charposx set %movey #charposy set %movetimer #systime + 500 goto PathfindWaitLoop } if can't_get_there in #journal { set %moveres error return } } return
sub GetContainerPos finditem %1 C if #findkind = -1 return #false if #findtype = ZJF 5 ; backpack set %contposx #findx + 22 set %contposy #findy + 16 set %contdropx #findx + 22 set %contdropy #findy + 12 return #true if #findtype = CKF 5 ; bag set %contposx #findx + 22 set %contposy #findy + 15 set %contdropx #findx + 21 set %contdropy #findy + 10 return #true if #findtype = LKF 5 ; pouch set %contposx #findx + 22 set %contposy #findy + 13 set %contdropx #findx + 25 set %contdropy #findy + 7 return #true return #false
|