diff options
author | Lance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-11-20 10:11:20 +0000 |
---|---|---|
committer | Lance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-11-20 10:11:20 +0000 |
commit | 910042238bb081e769cd756a8268e3cdbef18f9e (patch) | |
tree | 8acb464c5d89faee316f67f1e5f4629e993bf065 /src/map/script.c | |
parent | d346bb491de94ea13a2dbc574cf05fe6be473945 (diff) | |
download | hercules-910042238bb081e769cd756a8268e3cdbef18f9e.tar.gz hercules-910042238bb081e769cd756a8268e3cdbef18f9e.tar.bz2 hercules-910042238bb081e769cd756a8268e3cdbef18f9e.tar.xz hercules-910042238bb081e769cd756a8268e3cdbef18f9e.zip |
- Removed security check since source level patch is applied. Reverted select(), created prompt().
modified Changelog-Trunk.txt
modified npc/airports/airships.txt
modified npc/cities/amatsu.txt
modified npc/cities/gonryun.txt
modified npc/cities/hugel.txt
modified npc/cities/lighthalzen.txt
modified npc/cities/niflheim.txt
modified npc/cities/valkyrie.txt
modified npc/custom/eAAC_Scripts/disguiser.txt
modified npc/custom/eAAC_Scripts/quest_warper.txt
modified npc/custom/jobs/jobmaster.txt
modified npc/events/idul_fitri.txt
modified npc/jobs/1-1e/gunslinger.txt
modified npc/jobs/1-1e/ninja.txt
modified npc/jobs/novice/novice.txt
modified npc/merchants/kunai_maker.txt
modified npc/merchants/novice_exchange.txt
modified npc/merchants/refine.txt
modified npc/other/comodo_gambling.txt
modified npc/other/dts_warper.txt
modified npc/other/marriage.txt
modified npc/other/powernpc.txt
modified npc/quests/Lvl4_weapon_quest.txt
modified npc/quests/gunslinger_quests.txt
modified npc/quests/quests_ein.txt
modified npc/quests/quests_umbala.txt
modified npc/sample/monster_controller.cpp
modified src/map/script.c
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9267 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/script.c')
-rw-r--r-- | src/map/script.c | 49 |
1 files changed, 48 insertions, 1 deletions
diff --git a/src/map/script.c b/src/map/script.c index 27ea71cbb..ebe4c490c 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -3512,6 +3512,7 @@ int buildin_checkequipedcard(struct script_state *st); int buildin_globalmes(struct script_state *st); int buildin_jump_zero(struct script_state *st); int buildin_select(struct script_state *st); +int buildin_prompt(struct script_state *st); int buildin_getmapmobs(struct script_state *st); //jA addition end int buildin_unequip(struct script_state *st); // unequip [Spectre] int buildin_getstrlen(struct script_state *st); //strlen [valaris] @@ -3846,6 +3847,7 @@ struct script_function buildin_func[] = { {buildin_checkequipedcard,"checkequipedcard","i"}, {buildin_jump_zero,"jump_zero","ii"}, //for future jA script compatibility {buildin_select,"select","*"}, //for future jA script compatibility + {buildin_prompt,"prompt","*"}, {buildin_globalmes,"globalmes","s*"}, {buildin_getmapmobs,"getmapmobs","s"}, //end jA addition {buildin_unequip,"unequip","i"}, // unequip command [Spectre] @@ -10308,7 +10310,52 @@ int buildin_select(struct script_state *st) sd->max_menu = max; clif_scriptmenu(script_rid2sd(st),st->oid,buf); aFree(buf); - } /*else if(sd->npc_menu==0xff){ // Cancel will be parsed since this is select() [Lance] + } else if(sd->npc_menu==0xff){ + sd->state.menu_or_input=0; + st->state=END; + } else { + //Skip empty menu entries which weren't displayed on the client (Skotlex) + for(i=st->start+2;i< (st->start+2+sd->npc_menu) && sd->npc_menu < (st->end-st->start-2);i++) { + conv_str(st,& (st->stack->stack_data[i])); // we should convert variables to strings before access it [jA1983] [EoE] + if((int)strlen(st->stack->stack_data[i].u.str) < 1) + sd->npc_menu++; //Empty selection which wasn't displayed on the client. + } + pc_setreg(sd,add_str((unsigned char *) "@menu"),sd->npc_menu); + sd->state.menu_or_input=0; + push_val(st->stack,C_INT,sd->npc_menu); + } + return 0; +} + +int buildin_prompt(struct script_state *st) +{ + char *buf; + int len,i,max = 1; + struct map_session_data *sd; + + sd=script_rid2sd(st); + + if(sd->state.menu_or_input==0){ + st->state=RERUNLINE; + sd->state.menu_or_input=1; + for(i=st->start+2,len=16;i<st->end;i++){ + conv_str(st,& (st->stack->stack_data[i])); + len+=(int)strlen(st->stack->stack_data[i].u.str)+1; + } + buf=(char *)aMalloc((len+1)*sizeof(char)); + buf[0]=0; + for(i=st->start+2,len=0;i<st->end;i++){ + strcat(buf,st->stack->stack_data[i].u.str); + strcat(buf,":"); + } + for(i=0; (unsigned int)i < strlen(buf); i++){ + if(buf[i] == ':') + max++; + } + sd->max_menu = max; + clif_scriptmenu(script_rid2sd(st),st->oid,buf); + aFree(buf); + } /*else if(sd->npc_menu==0xff){ sd->state.menu_or_input=0; st->state=END; }*/ else { |