Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/10/20 in all areas

  1. Hello Mantosh, anyone else, I feel like i may have come across wrong. I am literally not asking anyone to provide me a script that does everything i want. which is what i think i came off as. what i am looking for is some back and forth regarding whatever im working on. please bear in mind i have very limited scripting experience, and even that is only in powershell. I have added some comments to the below script. It was found on max cheaters and looks like it could very likely be modified to do what i am looking for. All of the original writers comments are intact, anything that starts with '//--' is from me. I've already made some changes that i think are putting me on the right track, mainly adding the Npc.l2c reference, and the objects one which i plan on using later, and then modifying everything in the ifs from Player* to Npc*. the Char_ vs Npc_ is a question, i have no idea how to know whether the info in the player has the same properties as the info in the npc. sorry for the terminology here, im sure im saying it wrong, but i hope you get my meaning. the comments i added are just comments to myself about what needs to be done to accomplish what i want to do, as well as places where im not sure about something or whatever. Also, i added the appropriate values for a dagger class. just something i modified, doesnt really matter much. more to show that i went through everything and did what i could before addressing things that would have to be addressed before event testing it really. One obvious thing to point out, i know the PVPFLAG references are NOT going to be available for an npc, at least, i wouldnt expect it to, and that that is something that i will need to change, just no idea what to change it to atm and figure i'll learn that going forward. i understand that is something to change, can you show me how to figure out what to change it to? lol Anyway, any assistance would be greatly appreciated and i will be happy to clarify my questions or anything if that would help. /* This Scipt was created with JingJing IDE. * Author: Phear3d * @ 2012.March.09 at 05:40 PM * -- Reworked by deviouz1 11/10/20 */ INCLUDE StdLib\Player.l2c INCLUDE StdLib\Object.l2c INCLUDE StdLib\Npc.l2c INCLUDE StdLib\inventory.l2c INCLUDE \char_buffs.l2c DEFINE_GLOBAL SORTEDLIST DoNotAttack 0 //Chars to not target and not attack (add as many as you like) DoNotAttack.ADD 1 "MyFriend1" DoNotAttack.ADD 1 "MYFriend2" //Leave blank, "" , if not using toggle1 or toggle2 DEFINE_GLOBAL STRING Toggle1 "Vicious stance" DEFINE_GLOBAL STRING Toggle2 "" //Buff Type: 1=Warrior, 2=Tanker , 3=Mage DEFINE_GLOBAL INT BuffType 1 //Rebuff if char has under # of buffs (toggles/self buffs are counted as buffs) DEFINE_GLOBAL INT Buff_If_Under 20 //Skill and Attack Range DEFINE_GLOBAL INT Range 600 //Click To Village Delay/Sleep(ms), 12000 ms = 12 seconds (increase delay if you get ported to nearest village) DEFINE_GLOBAL INT To_Village_Delay 11000 //--**--**--**--**--**--**--**--**--**--**--**--**--**--** //DO NOT CHANGE ANYTHING BELOW!!!!!!! - Phear3d //-- I DO WHAT I WAWNT!! ,,|,(>.<),|,, ~ Deviouz1 DEFINE_GLOBAL STRING Nearest_Npc "" DEFINE_GLOBAL ARRAYLIST FlagList 0 DEFINE_GLOBAL SORTEDLIST MyBuffs 0 DEFINE_GLOBAL STRING NoName "" DEFINE_GLOBAL INT NeedBuffs 0 DEFINE_GLOBAL INT Toggle_1 0 DEFINE_GLOBAL INT Toggle_2 0 SET_EVENT "<&SCRIPTEVENT_SERVERPACKET&>" "<&SYSTEM_CURRENTFILE&>" SystemMessage 98 SET_EVENT "<&SCRIPTEVENT_SERVERPACKET&>" "<&SYSTEM_CURRENTFILE&>" AbnormalStatusUpdate 133 //-- Add more events like chat events, treasure chest on radar(? but prolly not), if my target is affected by w/e, etc... stuff to react to. PRINT_TEXT " Started <&SYSTEM_CURRENTFILE&> ] " SKILL_GET_ID Toggle_1 "<&Toggle1&>" SKILL_GET_ID Toggle_2 "<&Toggle2&>" //-- add more toggles THREAD CheckEQ THREAD Get_Target THREAD Check_Dead THREAD Check_Buffs //-- ^ is this the main order in which things happen? and then the while keeps these looping? Please clarify. THREAD Spam_HP THREAD Spam_MP //THREAD Spam_CP DEFINE ARRAYLIST NpcList 0 DEFINE INT dist 0 DO FlagList.CLEAR GET_NPCS NpcList SLEEP 500 FOREACH P Npc NpcList IF ( NpcList.P.PVPFLAG == 1 ) && ( NpcList.P.LOOKS_DEAD == 0 ) DISTANCE dist NpcList.P.X NpcList.P.Y NpcList.P.Z CHAR_X CHAR_Y CHAR_Z //-- need to verify the CHAR_* vs a possible NPC_*. It's likely, but unsure IF dist <= 9 CALL ADD_LIST VOID 1 NpcList.P.NAME ENDIF ENDIF NEXTEACH FOREACH P Npc NpcList IF ( NpcList.P.PVPFLAG == 1 ) && ( NpcList.P.LOOKS_DEAD == 0 ) DISTANCE dist NpcList.P.X NpcList.P.Y NpcList.P.Z CHAR_X CHAR_Y CHAR_Z IF ( dist > 9 ) && ( dist <= 99 ) CALL ADD_LIST VOID 1 NpcList.P.NAME ENDIF ENDIF NEXTEACH FOREACH P Npc NpcList IF ( NpcList.P.PVPFLAG == 1 ) && ( NpcList.P.LOOKS_DEAD == 0 ) DISTANCE dist NpcList.P.X NpcList.P.Y NpcList.P.Z CHAR_X CHAR_Y CHAR_Z IF ( dist > 99 ) && ( dist <= 499 ) CALL ADD_LIST VOID 1 NpcList.P.NAME ENDIF ENDIF NEXTEACH FOREACH P PLAYER PlayerList IF ( PlayerList.P.PVPFLAG == 1 ) && ( PlayerList.P.LOOKS_DEAD == 0 ) DISTANCE dist PlayerList.P.X PlayerList.P.Y PlayerList.P.Z CHAR_X CHAR_Y CHAR_Z IF ( dist > 499 ) && ( dist <= 999 ) CALL ADD_LIST VOID 1 PlayerList.P.NAME ENDIF ENDIF NEXTEACH FOREACH P PLAYER PlayerList IF ( PlayerList.P.PVPFLAG == 1 ) && ( PlayerList.P.LOOKS_DEAD == 0 ) DISTANCE dist PlayerList.P.X PlayerList.P.Y PlayerList.P.Z CHAR_X CHAR_Y CHAR_Z IF ( dist > 999 ) && ( dist <= 1499 ) CALL ADD_LIST VOID 1 PlayerList.P.NAME ENDIF ENDIF NEXTEACH FOREACH P Npc NpcList IF ( NpcList.P.PVPFLAG == 1 ) && ( NpcList.P.LOOKS_DEAD == 0 ) DISTANCE dist NpcList.P.X NpcList.P.Y NpcList.P.Z CHAR_X CHAR_Y CHAR_Z IF ( dist > 1499 ) && ( dist <= 1999 ) CALL ADD_LIST VOID 1 NpcList.P.NAME ENDIF ENDIF NEXTEACH FOREACH P Npc NpcList IF ( NpcList.P.PVPFLAG == 1 ) && ( NpcList.P.LOOKS_DEAD == 0 ) DISTANCE dist NpcList.P.X NpcList.P.Y NpcList.P.Z CHAR_X CHAR_Y CHAR_Z IF ( dist > 1999 ) && ( dist <= 2499 ) CALL ADD_LIST VOID 1 NpcList.P.NAME ENDIF ENDIF NEXTEACH FOREACH P Npc NpcList IF ( NpcList.P.PVPFLAG == 1 ) && ( NpcList.P.LOOKS_DEAD == 0 ) DISTANCE dist NpcList.P.X NpcList.P.Y NpcList.P.Z CHAR_X CHAR_Y CHAR_Z IF ( dist > 2499 ) && ( dist <= 2999 ) CALL ADD_LIST VOID 1 NpcList.P.NAME ENDIF ENDIF NEXTEACH FOREACH P Npc NpcList IF ( NpcList.P.PVPFLAG == 1 ) && ( NpcList.P.LOOKS_DEAD == 0 ) DISTANCE dist NpcList.P.X NpcList.P.Y NpcList.P.Z CHAR_X CHAR_Y CHAR_Z IF ( dist > 2999 ) && ( dist <= 3499 ) CALL ADD_LIST VOID 1 NpcList.P.NAME ENDIF ENDIF NEXTEACH FOREACH P Npc NpcList IF ( NpcList.P.PVPFLAG == 1 ) && ( NpcList.P.LOOKS_DEAD == 0 ) DISTANCE dist NpcList.P.X NpcList.P.Y NpcList.P.Z CHAR_X CHAR_Y CHAR_Z IF ( dist > 3499 ) && ( dist <= 3999 ) CALL ADD_LIST VOID 1 NpcList.P.NAME ENDIF ENDIF NEXTEACH FOREACH P Npc NpcList IF ( NpcList.P.PVPFLAG == 1 ) && ( NpcList.P.LOOKS_DEAD == 0 ) DISTANCE dist NpcList.P.X NpcList.P.Y NpcList.P.Z CHAR_X CHAR_Y CHAR_Z IF ( dist > 3999 ) && ( dist <= 4999 ) CALL ADD_LIST VOID 1 NpcList.P.NAME ENDIF ENDIF NEXTEACH SLEEP 2000 LOOP 1 == 1 END_SCRIPT //--------------------------------------------------------------------------------------- FUNCTION Get_Target DEFINE INT _dist 0 DEFINE INT F 0 DO IF NeedBuffs != 1 F = 0 Nearest_Npc = "" FOREACH F STRING FlagList IF F == 0 Nearest_Npc = FlagList.F ENDIF NEXTEACH IF ( TARGET_NAME == NULL ) || ( TARGET_NAME == "#$<&NoName&>" ) IF ("DoNotAttack.CONTAINS_KEY <&Nearest_Npc&>" == FALSE) COMMAND "/target <&Nearest_Npc&>" ENDIF ELSE DISTANCE _dist TARGET_X TARGET_Y TARGET_Z CHAR_X CHAR_Y CHAR_Z IF ( TARGET_LOOKS_DEAD == 1 ) || ( TARGET_NAME == CHAR_NAME ) || ( _dist > Range ) CANCEL_TARGET ENDIF ENDIF SLEEP 1300 ENDIF LOOP 1 == 1 RETURN VOID //--------------------------------------------------------------------------------------- FUNCTION Check_Dead DEFINE INT randSleep 0 DEFINE INT t_max 0 DEFINE INT t_min 0 t_min = To_Village_Delay - 1500 t_max = To_Village_Delay + 3500 DO IF CHAR_CUR_HP <= 0 CALL To_Village ENDIF SLEEP 1000 LOOP 1 == 1 RETURN VOID //--------------------------------------------------------------------------------------- FUNCTION To_Village LOCK TV DEFINE INT randSleep 0 DEFINE INT t_max 0 DEFINE INT t_min 0 t_min = To_Village_Delay - 1500 t_max = To_Village_Delay + 3500 CANCEL_TARGET GET_RAND randSleep "<&t_min&>" "<&t_max&>" SLEEP "<&randSleep&>" TAP_TO TOWN SLEEP 2500 //toggle1 IF Toggle_1 > 0 USE_SKILL "<&Toggle_1&>" ENDIF SLEEP 1000 //toggle2 IF Toggle_2 > 0 USE_SKILL "<&Toggle_2&>" ENDIF SLEEP 1000 UNLOCK TV RETURN VOID //--------------------------------------------- FUNCTION ADD_LIST 1 _name LOCK ADDL IF ("DoNotAttack.CONTAINS_KEY <&_name&>" == FALSE) FlagList.ADD _name //PRINT_TEXT " Added FlagList List: <&_name&> ]" ELSE //PRINT_TEXT " Found _name on DoNotAttack List: <&_name&> ]" ENDIF UNLOCK ADDL RETURN VOID //--------------------------------------------------------------------------------------- FUNCTION SPAM_CP DEFINE INT CPOT 1 ITEM_GET_ID CPOT "Greater CP Potion" DO IF CHAR_CUR_CP < CHAR_MAX_CP USE_ITEM "<&CPOT&>" ENDIF SLEEP 500 LOOP 1 == 1 RETURN VOID //--------------------------------------------------------------------------------------- FUNCTION Spam_MP DEFINE INT MPOT 1 DEFINE INT Half_MP Half_MP = CHAR_MAX_MP / 2 ITEM_GET_ID MPOT "Mana Potion" DO IF CHAR_CUR_MP < Half_MP USE_ITEM "<&MPOT&>" SLEEP 500 ENDIF SLEEP 500 LOOP 1 == 1 RETURN VOID //--------------------------------------------------------------------------------------- FUNCTION Spam_HP DEFINE INT HPOT 1 ITEM_GET_ID HPOT "Greater Healing Potion" DO IF CHAR_CUR_HP < CHAR_MAX_HP USE_ITEM "<&HPOT&>" SLEEP 11000 ENDIF SLEEP 500 LOOP 1 == 1 RETURN VOID //--------------------------------------------------------------------------------------- // Needs to be completely redone. Need to figure out how to access alt+b //--------------------------------------------------------------------------------------- FUNCTION Check_Buffs DO IF NeedBuffs == 1 COMMAND "/target Jack Sage" SLEEP 1000 COMMAND "/target Jack Sage" SLEEP 1000 IF BuffType == 1 NPC_DIALOG "bypass -h npc_<&TARGET_ID&>_Buff 1501 1499 1504 1500 1502 1519 825 829 4699 1363 1461 1364 1416 1238 914 271 272 274 275 309 310 915 530 264 265 266 267 268 269 304 305 349 364 529 1035 1397 1259 1542 1062 1388 1191 1182 1189 1354 1392 1393 1352 1307 1044 1323" ENDIF IF BuffType == 2 NPC_DIALOG "bypass -h npc_<&TARGET_ID&>_Buff 1501 1499 1504 1500 1502 1519 1503 825 828 4699 1363 1461 1364 1416 1238 914 271 272 274 275 309 310 530 264 266 267 268 269 265 304 305 349 364 529 1035 1397 1259 1542 1389 1191 1182 1189 1354 1392 1393 1352 1307 1044 1323" ENDIF IF BuffType == 3 NPC_DIALOG "bypass -h npc_<&TARGET_ID&>_Buff 1501 1499 1504 1500 1503 830 4703 1363 1461 1364 1416 1238 914 273 276 309 365 915 530 264 266 267 268 265 304 305 349 529 1035 1078 1085 1397 1303 1259 1542 1062 1389 1191 1182 1189 1354 1392 1393 1352 1307 1044 1323" ENDIF SLEEP 2000 ENDIF IF ( NeedBuffs == 0 ) && ( TARGET_NAME == "#$Jack Sage" ) CANCEL_TARGET SLEEP 1000 ENDIF SLEEP 2000 LOOP 1 == 1 RETURN VOID //--------------------------------------------- FUNCTION AbnormalStatusUpdate LOCK ASU MyBuffs.CLEAR DEFINE INT PacketType 0 DEFINE INT ListSize 0 DEFINE INT SkillId 0 DEFINE INT SkillLevel 0 DEFINE INT Duration 0 PACKET.READ_BYTE PacketType PACKET.READ_INT16 ListSize //PRINT_TEXT " Received AbnormalStatusUpdate packet: Size: <&ListSize&> ]" DEFINE char_buffs my_buff FOR MyBuffsEntryIDX 0 "<&ListSize&>" 1 PACKET.READ_INT32 SkillId PACKET.READ_INT16 SkillLevel PACKET.READ_INT32 Duration Duration = ( ( Duration * TICKS_PER_S ) + NOW ) my_buff.cha_id = CHAR_ID my_buff.sk_id = SkillId my_buff.sk_level = SkillLevel my_buff.sk_dur = Duration IF SkillId != 0 IF ("MyBuffs.CONTAINS_KEY <&SkillId&>" == FALSE) MyBuffs.ADD my_buff.clone "<&SkillId&>" ENDIF ENDIF NEXT IF MyBuffs.COUNT < Buff_If_Under NeedBuffs = 1 ELSE NeedBuffs = 0 ENDIF UNLOCK ASU RETURN VOID //--------------------------------------------------------------------------------------- //-- Should be reworked FUNCTION SystemMessage DEFINE INT PacketType 0 DEFINE INT MsgID 0 DEFINE INT typesCount 0 DEFINE INT Unk1 0 DEFINE INT TypeID 0 DEFINE STRING SName " " PACKET.READ_BYTE PacketType PACKET.READ_INT32 MsgID PACKET.READ_INT32 typesCount PACKET.READ_INT32 Unk1 //PACKET.READ_STRING SName PACKET.READ_INT32 TypeID IF MsgID == 113 IF TypeID == 1539 CANCEL_TARGET PRINT_TEXT " MsgID=<&MsgID&> | TypeID: <&TypeID&> (cannot be used due to unsuitable terms.) ]" //PRINT_TEXT " MsgID=<&MsgID&> | TypeID: <&TypeID&> | Packet: <&PACKET.GET_HEX&> ]" SLEEP 1000 CALL To_Village ENDIF ENDIF IF MsgID == 144 PRINT_TEXT " MsgID=<&MsgID&> | Cancelling Target! (That is an incorrect target.) ]" FOREACH F STRING FlagList IF ( F == 0 ) && ( TARGET_NAME == FlagList.F ) FlagList.REMOVE F SLEEP 500 CANCEL_TARGET ENDIF NEXTEACH ENDIF IF MsgID == 1996 CANCEL_TARGET PRINT_TEXT " MsgID=<&MsgID&> | Cancelling Target! (The attack has been blocked) ]" SLEEP 1000 ENDIF IF MsgID == 181 CANCEL_TARGET PRINT_TEXT " MsgID=<&MsgID&> | Cancelling Target! (Cannot see target.)]" SLEEP 1000 ENDIF IF MsgID == 748 CANCEL_TARGET PRINT_TEXT " MsgID=<&MsgID&> | Cancelling Target! (The distance is too far and so the casting has been stopped.) ]" SLEEP 1000 ENDIF IF MsgID == 2187 CANCEL_TARGET PRINT_TEXT " MsgID=<&MsgID&> | Cancelling Target! (The target is located where you cannot charge.) ]" SLEEP 1000 ENDIF RETURN VOID //--------------------------------------------------------------------------------------- FUNCTION CheckEQ DEFINE STRING WEAPON "" DEFINE STRING USE_ME "" DEFINE STRING TEMP "" DEFINE ARRAYLIST INV_LIST 0 GET_INVENTORY INV_LIST SLEEP 1000 FOREACH I Inventory INV_LIST IF ( ( INV_LIST.I.EQUIPPED == 1 ) ) && ( ( INV_LIST.I.SLOT == 16384 ) || ( INV_LIST.I.SLOT == 128 ) ) WEAPON = INV_LIST.I.NAME PRINT_TEXT " Detected Weapon Being Used: <&WEAPON&> ]" TEMP = INV_LIST.I.ID.GET_HEX32 USE_ME = "#$19 <&TEMP&> 00 00 00 00" ENDIF NEXTEACH DO GET_INVENTORY INV_LIST SLEEP 500 FOREACH I Inventory INV_LIST IF INV_LIST.I.NAME == "#$<&WEAPON&>" IF INV_LIST.I.EQUIPPED == #i0 PRINT_TEXT " Equipping <&WEAPON&> ]" INJECT "<&USE_ME&>" ENDIF ENDIF NEXTEACH SLEEP 1000 LOOP 1 == 1 RETURN VOID
    1 point
×
×
  • Create New...