Zedaf Posted August 27, 2024 Posted August 27, 2024 (edited) Hello, I recently started trying to learn how to develop a server for client 4274 and I've managed to spawn NPCs in but I can't interact with them. I'm aware that there is an NPCTalk type packet but as far as I can see from reading other posts, that's the one you send once you're already interacting with the NPC. I'm not certain but it seems that what some people have said is that you first need to somehow inform the client that your character is near to an NPC and then the client will send a packet which essentially says "this npc is able to talk to you now, respond with NPCTalk if you would like to begin". Is this correct? and if so, how do you inform the client that you're within range of NPCs? I have my jump function working correctly but it seems that this isn't enough to inform the client in the way required. Thanks Edited August 27, 2024 by Zedaf Quote
Spirited Posted August 27, 2024 Posted August 27, 2024 1 hour ago, Zedaf said: Hello, I recently started trying to learn how to develop a server for client 4274 and I've managed to spawn NPCs in but I can't interact with them. I'm aware that there is an NPCTalk type packet but as far as I can see from reading other posts, that's the one you send once you're already interacting with the NPC. I'm not certain but it seems that what some people have said is that you first need to somehow inform the client that your character is near to an NPC and then the client will send a packet which essentially says "this npc is able to talk to you now, respond with NPCTalk if you would like to begin". Is this correct? and if so, how do you inform the client that you're within range of NPCs? I have my jump function working correctly but it seems that this isn't enough to inform the client in the way required. Thanks Yup, that's right. When the client sends your server MsgWalk or MsgAction (for jumping), you need to either respond back to the client with the same message or with a kickback to its previous good coordinates. You also need to make sure your NPC is the right role type (so it sends you MsgNpc when you click on it). Should be type 2? Good luck! Quote
Konichu Posted August 27, 2024 Posted August 27, 2024 Just in case (also for documentation for the wiki if Spirited want), this is the NPC Type enum from Conquer taken from the client. ROLE_NPC_NONE = 0, // Illegal NPC ROLE_SHOPKEEPER_NPC = 1, // Shop NPC ROLE_TASK_NPC = 2, // Task NPC ROLE_STORAGE_NPC = 3, // Storage NPC ROLE_TRUNCK_NPC = 4, // Box NPC ROLE_FORGE_NPC = 6, // Forging NPC ROLE_EMBED_NPC = 7, // Embedding NPC ROLE_COMPOSE_NPC = 8, // Qiankun Five Elements Furnace ROLE_STATUARY_NPC = 9, // Statue NPC ROLE_SYNFLAG_NPC = 10, // Gang Mark NPC ROLE_PLAYER = 11, // Other players ROLE_HERO = 12, // Yourself ROLE_MONSTER = 13, // Monster ROLE_BOOTH_NPC = 14, // Stall NPC SYNTRANS_NPC = 15, // Gang Teleport NPC (used for 00:00 charging) (LINKID is the ID of the fixed NPC, mutually exclusive with other LINKID) ROLE_BOOTH_FLAG_NPC = 16, // Stall Flag NPC ROLE_MOUSE_NPC = 17, // NPC on the mouse ROLE_MAGICITEM = 18, // Trap Fire Wall ROLE_DICE_NPC = 19, // Dice NPC ROLE_WEAPONGOAL_NPC = 21, // Melee Attack NPC ROLE_MAGICGOAL_NPC = 22, // Magic Attack Target NPC ROLE_BOWGOAL_NPC = 23, // Bow and Arrow Target NPC ROLE_TARGET_NPC = 24, // Take a beating, no quest triggered ROLE_FURNITURE_NPC = 25, // Furniture NPC ROLE_CITY_GATE_NPC = 26, // City Gate NPC ROLE_NEIGHBOR_DOOR = 27, // Neighbor's Door ROLE_CALL_PET = 28, // Summoned Beast ROLE_TELEPORT = 29, // Teleport NPC ROLE_MOUNT_APPEND = 30, // Mount Pet Combination NPC ROLE_FAMILY_OCCUPY_NPC = 31, TASK_SHOPKEEPER_NPC = 32, // Quest Shop NPC TASK_FORGE_NPC = 33, // Quest Forging NPC TASK_EMBED_NPC = 34, // Quest Embedding NPC COMPOSE_GEM_NPC = 35, // Gem Combination NPC REDUCE_DMG_NPC = 36, // Equipment God Blessing NPC MAKE_ITEM_HOLE_NPC = 37, // Item Hole NPC SOLIDIFY_ITEM_NPC = 38, // Solidify equipment NPC COMPETE_BARRIER_NPC_ = 39, // Mount pet competition fence NPC FACTION_MATCH_FLAG = 40, // Gang battle flag FM_LEFT_BARRIER_NPC_ = 41, // Gang battle left base camp fence FM_RIGHT_BARRIER_NPC_ = 42, // Gang battle right base camp fence WARFLAG_FLAGALTAR = 43, // Cross-server battle flag competition battle flag platform WARFLAG_PRESENTFLAG = 44, // Cross-server battle flag competition flag-giving NPC WARFLAG_FLAG = 45, // Cross-server battle flag competition battle flag VEXILLUM_FLAGALTAR = 46, // New battle flag competition flag platform (the cut battle flag) VEXILLUM_FLAG = 47, // New Battle Flag Competition Flag (small trap-type flag) SLOT_MACHINE_NPC = 60, // Slot Machine NPC OS_LANDLORD = 61, // Cross-server players can attack NPC CHANGE_LOOKFACE_TASK_NPC = 62, // Task NPC that can change lookface ROLE_DESTRUCTIBLE_NPC = 63, // Destructible NPC ROLE_SYNBUFF_NPC = 64, // Gang Buff Pillar NPC SYN_BOSS = 65, // Gang BOSS ROLE_3DFURNITURE_NPC = 101, // 3D Furniture NPC ROLE_CITY_WALL_NPC = 102, // City Wall NPC ROLE_CITY_MOAT_NPC = 103, // Moat NPC ROLE_TEXAS_TABLE_NPC = 110, // Gambling table NPC ROLE_TRAP_MONSTER = 111, // Trap Monster ROLE_ROULETTE_TABLE_NPC = 112, // Roulette table NPC FRONTIER_SERVER_TRANS_NPC = 113, // Border server transmission NPC ROLE_TRAP_CAN_BE_ATTACK_NPC = 114, // Trap NPC that can be attacked ROLE_SH_TABLE_NPC = 115, // Stud table NPC ROLE_RAIDER_TABLE_NPC = 116, // Raiders of the Lost Ark table NPC ROLE_TURRET_NPC = 117, // Turret NPC ROLE_DOMINO_TABLE_NPC = 118, // Domino table NPC ROLE_TRAP_TRAPSORT_PORTAL = 119, // Blue rune of waterway - instant portal ROLE_NEWSLOT_NPC = 120, // 5*3 slot machine NPC ROLE_BLACKJACK_TABLE_NPC = 121, // 21-point gambling table NPC ROLE_FRUIT_MACHINE_NPC = 122, // Fruit machine NPC ROLE_SHEN_DING_NPC = 123, // Shen Ding NPC ROLE_SWORD_PRISON = 124; // Sword prison NPC Quote
Spirited Posted August 27, 2024 Posted August 27, 2024 Looks like I need to correct the theme when I get home. Lol Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.