Hi, long time no see. Here I am again having some free time but now, only for leisure purposes and maybe help out on anything I can.
I've search the forums and didn't find anything related. I am stuck with one problem, I am trying to learn how to catch responses from menus generated via source.
I know it's easy to do this via script and I've done a lot of them but I'm stuck on figuring out how to handle PC responses from source.
Below is a snippet of my code that I'm trying to play with.
skill.inc
// Copyright (c) rAthena Dev Teams - Licensed under GNU GPL// For more information, see LICENCE in the main folder#include"..\map\clif.hpp"#include"..\map\script.hpp"#include"..\common\socket.hpp"#include"..\common\malloc.hpp"#include"..\common\strlib.hpp"void test_skill_inc(struct map_session_data *sd){struct s_packet_db* info =&packet_db[RFIFOW(sd->fd,0)];if(sd->npc_id ==0){//create and display the menuchar* menu;
menu ="this:is:a:test";
clif_scriptmenu(sd,-1, menu);}else{uint8 select = RFIFOB(sd->fd,info->pos[1]);//parse responseswitch(select){case1:
clif_scriptmes(sd, sd->npc_id,"chose this");break;case2:
clif_scriptmes(sd, sd->npc_id,"chose is");break;case3:
clif_scriptmes(sd, sd->npc_id,"chose a");break;case4:
clif_scriptmes(sd, sd->npc_id,"chose test");break;}
clif_scriptclose(sd, sd->npc_id);}}
skill.cpp
#include"../custom/skill.inc"int skill_castend_nodamage_id(...)...case MC_VENDING:if(sd){//Prevent vending of GMs with unnecessary Level to trade/drop. [Skotlex]if(!pc_can_give_items(sd))
clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);else{
test_skill_inc(sd);}}...
My aim is to pop up a menu - in this case, "this," "is," "a," "test" - when the vending skill(or generally any skill) is pressed then creates a message window that contains the chosen item from the menu.
Question
Ninja
Hi, long time no see. Here I am again having some free time but now, only for leisure purposes and maybe help out on anything I can.
I've search the forums and didn't find anything related. I am stuck with one problem, I am trying to learn how to catch responses from menus generated via source.
I know it's easy to do this via script and I've done a lot of them but I'm stuck on figuring out how to handle PC responses from source.
Below is a snippet of my code that I'm trying to play with.
skill.inc
skill.cpp
My aim is to pop up a menu - in this case, "this," "is," "a," "test" - when the vending skill(or generally any skill) is pressed then creates a message window that contains the chosen item from the menu.
Will be grateful for the help thanks.
Link to comment
Share on other sites
0 answers to this question
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.