* Fixed some typos and exploits in the Blacksmith and Hunter job quest

* Modified 'wedding' script command to work with "OnTimer" scripts
* Added 'attachnpctimer' and 'detachnpctimer' script command

git-svn-id: https://svn.code.sf.net/p/rathena/svn/branches/stable@944 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
celest 2005-01-10 10:16:06 +00:00
parent 65bc36dba7
commit c94c71d282
9 changed files with 104 additions and 15 deletions

View File

@ -1,11 +1,30 @@
Date Added Date Added
01/0 01/10
* Added Shinomori and orn's fix for the skill tree to only check the first
required skill in the DB and skipping the rest [celest]
* Modified 'wedding' script command to work with "OnTimer" scripts even without
doing 'attachnpctimer' (The 'player not attached' error will still display,
but the effect will appear *over the NPC* instead of the player...
at least it won't fail ^^) [celest]
* Added 'attachnpctimer' script command for attaching the player to the current
npc's timer in "OnTimerxxxx" scripts, thanks to Wallex for the idea. [celest]
Syntax:
attachnpctimer;
attachnpctimer "<Player Name">;
Check /npc/sample/npc_test_npctimer2.txt for example.
* Added 'detachnpctimer' script command for detaching players from the npc's
timer. [celest] Syntax:
detachnpctimer;
detachnpctimer "<NPC Name">;
* Added 'OnInterIfInitOnce' for WoE scripts & modified the WoE scripts as well [Ajarn & Codemaster] [Thanks to FREYA] [SVN 943] * Added 'OnInterIfInitOnce' for WoE scripts & modified the WoE scripts as well [Ajarn & Codemaster] [Thanks to FREYA] [SVN 943]
* Added the @sound command and the NPC command of soundeffectall * Added the @sound command and the NPC command of soundeffectall
- works just like soundeffect, but plays for everyone in the area [Codemaster] [SVN 942] - works just like soundeffect, but plays for everyone in the area [Codemaster] [SVN 942]
* Don't allow Pets to attack Guardians outside of WoE [Codemaster] [SVN 940] * Don't allow Pets to attack Guardians outside of WoE [Codemaster] [SVN 940]
* Require 15% of HP or more for WE_MALE skill [Codemaster] [SVN 940] * Require 15% of HP or more for WE_MALE skill [Codemaster] [SVN 940]
* Require 15% of SP or more for WE_FEMALE skill [Codemaster] [SVN 940] * Require 15% of SP or more for WE_FEMALE skill [Codemaster] [SVN 940]
01/07 01/07
* Upon changing to high novice 100 stat points should be given, not 88 [celest] * Upon changing to high novice 100 stat points should be given, not 88 [celest]
* Give high novices First Aid and Trick Dead upon job changing [celest] * Give high novices First Aid and Trick Dead upon job changing [celest]

View File

@ -34,6 +34,9 @@ Other Ppl
Date Added Date Added
====== ======
01/10
* Fixed some typos and exploits in the Blacksmith and Hunter job quest,
thanks to Riotblade and nonox
01/09/05 01/09/05
* Modified guild war scripts to fix a bug for duplicate guild storages. [Codemaster & Ajarn] * Modified guild war scripts to fix a bug for duplicate guild storages. [Codemaster & Ajarn]
8/1 8/1

View File

@ -7,7 +7,7 @@
//= Optimized and further edited by kobra_k88. //= Optimized and further edited by kobra_k88.
//= Further bugfixed and tested by Lupus //= Further bugfixed and tested by Lupus
//===== Current Version: ===================================== //===== Current Version: =====================================
//= 1.0 //= 1.1
//===== Compatible With: ===================================== //===== Compatible With: =====================================
//= eAthena 0.5.2 + //= eAthena 0.5.2 +
//===== Description: ========================================= //===== Description: =========================================
@ -17,6 +17,7 @@
//= names and labels. Edited some text.[kobra_k88] //= names and labels. Edited some text.[kobra_k88]
//= Removed "if(JobLevel > 48) goto higher". It was a left over line. //= Removed "if(JobLevel > 48) goto higher". It was a left over line.
//= Thx to "Decker".[kobra_k88] //= Thx to "Decker".[kobra_k88]
//= Fixed some typos, thanks to Riotblade [celest]
============================================================== ==============================================================
@ -461,7 +462,7 @@ L_result:
mes "Good!"; mes "Good!";
next; next;
mes "[Geshupenschte]"; mes "[Geshupenschte]";
mes "Lets see....your score is ^5533FF"+@score+"."^000000; mes "Lets see....your score is ^5533FF"+@score+".^000000";
if (@score == 100) goto L_perfect; if (@score == 100) goto L_perfect;
mes "............."; mes ".............";
next; next;
@ -485,7 +486,7 @@ L_result2:
mes "Great!"; mes "Great!";
next; next;
mes "[Geshupenschte]"; mes "[Geshupenschte]";
mes "Lets see....your score is ^5533FF"+@score+"."^000000; mes "Lets see....your score is ^5533FF"+@score+".^000000";
if (@score > 80) goto L_pass; if (@score > 80) goto L_pass;
mes "............."; mes ".............";
next; next;
@ -1160,7 +1161,7 @@ comodo.gat,158,342,4 script Bismarck 118,{
if (BSMITH_Q == 3) goto L_Start; if (BSMITH_Q == 3) goto L_Start;
mes "[Bismarck]"; mes "[Bismarck]";
mes "......Ughï...."; mes "......Ugh?...";
mes ".....When's that delivery coming......"; mes ".....When's that delivery coming......";
next; next;
mes "[Bismarck]"; mes "[Bismarck]";

View File

@ -6,7 +6,7 @@
//= Converted by kobra_k88 //= Converted by kobra_k88
//= Further bugfixed and tested by Lupus //= Further bugfixed and tested by Lupus
//===== Current Version: ===================================== //===== Current Version: =====================================
//= 1.7 //= 1.8
//===== Compatible With: ===================================== //===== Compatible With: =====================================
//= eAthena 1.0 //= eAthena 1.0
//===== Description: ========================================= //===== Description: =========================================
@ -19,6 +19,7 @@
//= v1.5 Fixed items quest fork bug [Lupus] //= v1.5 Fixed items quest fork bug [Lupus]
//= v1.6 Fixed items quest bug: added extra condition [Lupus] //= v1.6 Fixed items quest bug: added extra condition [Lupus]
//= v1.7 Fixed skillpoints check bug [Lupus] //= v1.7 Fixed skillpoints check bug [Lupus]
//= v1.8 Fixed an exploit, thanks to nonox [celest]
//============================================================ //============================================================
@ -722,7 +723,6 @@ OnMyMobDead1:
killmonsterall "job_hunte.gat"; killmonsterall "job_hunte.gat";
enablenpc "SwitchHnt"; enablenpc "SwitchHnt";
areaannounce "job_hunte.gat", 50, 64, 123, 143, "[Test Guide]: Great job! Go use the switch now!",8; areaannounce "job_hunte.gat", 50, 64, 123, 143, "[Test Guide]: Great job! Go use the switch now!",8;
set HNTR_Q2, 2;
end; end;
} }
@ -843,6 +843,7 @@ job_hunte.gat,93,101,1 script SwitchHnt 723,{
job_hunte.gat,89,139,1 script ExitHnt 45,2,2,{ job_hunte.gat,89,139,1 script ExitHnt 45,2,2,{
deltimer "TimerHnt::OnTimer196000"; deltimer "TimerHnt::OnTimer196000";
set HNTR_Q2, 2;
warp "payon_in02.gat", 16, 26; warp "payon_in02.gat", 16, 26;
killmonsterall "job_hunte.gat"; killmonsterall "job_hunte.gat";
donpcevent "HntTG::OnStart"; donpcevent "HntTG::OnStart";

View File

@ -0,0 +1,16 @@
prontera.gat,156,183,0 script NPCtimerƒeƒXƒg::npctimerX0000 116,{
L_INIT:
mes "What would you like to know?";
menu "Tell me my level",L_WAIT;
L_WAIT:
mes "I need time to think...";
initnpctimer;
attachnpctimer;
close;
OnTimer5000:
mes "Ah, your level is " + readparam(11);
detachnpctimer;
close;
}

View File

@ -376,7 +376,7 @@ struct npc_data {
char *script; char *script;
short xs,ys; short xs,ys;
int guild_id; int guild_id;
int timer,timerid,timeramount,nexttimer; int timer,timerid,timeramount,nexttimer,timerrid;
unsigned int timertick; unsigned int timertick;
struct npc_timerevent_list *timer_event; struct npc_timerevent_list *timer_event;
int label_list_num; int label_list_num;

View File

@ -589,7 +589,7 @@ int npc_timerevent(int tid,unsigned int tick,int id,int data)
nd->u.scr.timerid = add_timer(tick+next,npc_timerevent,id,next); nd->u.scr.timerid = add_timer(tick+next,npc_timerevent,id,next);
} }
run_script(nd->u.scr.script,te->pos,0,nd->bl.id); run_script(nd->u.scr.script,te->pos,nd->u.scr.timerrid,nd->bl.id);
return 0; return 0;
} }
/*========================================== /*==========================================
@ -612,6 +612,7 @@ int npc_timerevent_start(struct npc_data *nd)
} }
nd->u.scr.nexttimer=j; nd->u.scr.nexttimer=j;
nd->u.scr.timertick=gettick(); nd->u.scr.timertick=gettick();
nd->u.scr.timerrid=0; // no players attached by default [celest]
if(j>=n) if(j>=n)
return 0; return 0;

View File

@ -1048,11 +1048,12 @@ int pc_calc_skilltree(struct map_session_data *sd)
for(j=0;j<5;j++) { for(j=0;j<5;j++) {
if( skill_tree[s][c][i].need[j].id && if( skill_tree[s][c][i].need[j].id &&
pc_checkskill(sd,skill_tree[s][c][i].need[j].id) < pc_checkskill(sd,skill_tree[s][c][i].need[j].id) <
skill_tree[s][c][i].need[j].lv) skill_tree[s][c][i].need[j].lv) {
f=0; f=0;
break; break;
} }
} }
}
if(f && sd->status.skill[id].id==0 ){ if(f && sd->status.skill[id].id==0 ){
sd->status.skill[id].id=id; sd->status.skill[id].id=id;
flag=1; flag=1;

View File

@ -193,6 +193,8 @@ int buildin_stopnpctimer(struct script_state *st);
int buildin_startnpctimer(struct script_state *st); int buildin_startnpctimer(struct script_state *st);
int buildin_setnpctimer(struct script_state *st); int buildin_setnpctimer(struct script_state *st);
int buildin_getnpctimer(struct script_state *st); int buildin_getnpctimer(struct script_state *st);
int buildin_attachnpctimer(struct script_state *st); // [celest]
int buildin_detachnpctimer(struct script_state *st); // [celest]
int buildin_announce(struct script_state *st); int buildin_announce(struct script_state *st);
int buildin_mapannounce(struct script_state *st); int buildin_mapannounce(struct script_state *st);
int buildin_areaannounce(struct script_state *st); int buildin_areaannounce(struct script_state *st);
@ -414,6 +416,8 @@ struct {
{buildin_startnpctimer,"startnpctimer","*"}, {buildin_startnpctimer,"startnpctimer","*"},
{buildin_setnpctimer,"setnpctimer","*"}, {buildin_setnpctimer,"setnpctimer","*"},
{buildin_getnpctimer,"getnpctimer","i*"}, {buildin_getnpctimer,"getnpctimer","i*"},
{buildin_attachnpctimer,"attachnpctimer","*"}, // attached the player id to the npc timer [Celest]
{buildin_detachnpctimer,"detachnpctimer","*"}, // detached the player id from the npc timer [Celest]
{buildin_announce,"announce","si"}, {buildin_announce,"announce","si"},
{buildin_mapannounce,"mapannounce","ssi"}, {buildin_mapannounce,"mapannounce","ssi"},
{buildin_areaannounce,"areaannounce","siiiisi"}, {buildin_areaannounce,"areaannounce","siiiisi"},
@ -3967,6 +3971,46 @@ int buildin_setnpctimer(struct script_state *st)
return 0; return 0;
} }
/*==========================================
* attaches the player rid to the timer [Celest]
*------------------------------------------
*/
int buildin_attachnpctimer(struct script_state *st)
{
struct map_session_data *sd;
struct npc_data *nd;
nd=(struct npc_data *)map_id2bl(st->oid);
if( st->end > st->start+2 ) {
char *name = conv_str(st,& (st->stack->stack_data[st->start+2]));
sd=map_nick2sd(name);
} else {
sd = script_rid2sd(st);
}
if (sd==NULL)
return 0;
nd->u.scr.timerrid = sd->bl.id;
return 0;
}
/*==========================================
* detaches a player rid from the timer [Celest]
*------------------------------------------
*/
int buildin_detachnpctimer(struct script_state *st)
{
struct npc_data *nd;
if( st->end > st->start+2 )
nd=npc_name2id(conv_str(st,& (st->stack->stack_data[st->start+2])));
else
nd=(struct npc_data *)map_id2bl(st->oid);
nd->u.scr.timerrid = 0;
return 0;
}
/*========================================== /*==========================================
* VÌ<EFBFBD>ºƒAƒiƒEƒƒX * VÌ<EFBFBD>ºƒAƒiƒEƒƒX
*------------------------------------------ *------------------------------------------
@ -5445,10 +5489,13 @@ int buildin_marriage(struct script_state *st)
int buildin_wedding_effect(struct script_state *st) int buildin_wedding_effect(struct script_state *st)
{ {
struct map_session_data *sd=script_rid2sd(st); struct map_session_data *sd=script_rid2sd(st);
struct block_list *bl;
if(sd==NULL) if(sd==NULL) {
return 0; bl=map_id2bl(st->oid);
clif_wedding_effect(&sd->bl); } else
bl=&sd->bl;
clif_wedding_effect(bl);
return 0; return 0;
} }
int buildin_divorce(struct script_state *st) int buildin_divorce(struct script_state *st)