|
@@ -16545,12 +16545,82 @@ BUILDIN_FUNC(readbook)
|
|
Questlog script commands
|
|
Questlog script commands
|
|
*******************/
|
|
*******************/
|
|
|
|
|
|
|
|
+BUILDIN_FUNC(questinfo)
|
|
|
|
+{
|
|
|
|
+ TBL_NPC* nd = map_id2nd(st->oid);
|
|
|
|
+ int quest_id, icon, job, color = 0;
|
|
|
|
+ struct questinfo qi;
|
|
|
|
+
|
|
|
|
+ if( nd == NULL || nd->bl.m == -1 )
|
|
|
|
+ return true;
|
|
|
|
+
|
|
|
|
+ quest_id = script_getnum(st, 2);
|
|
|
|
+ icon = script_getnum(st, 3);
|
|
|
|
+
|
|
|
|
+ #if PACKETVER >= 20120410
|
|
|
|
+ if(icon < 0 || (icon > 8 && icon != 9999) || icon == 7)
|
|
|
|
+ icon = 9999; // Default to nothing if icon id is invalid.
|
|
|
|
+ #else
|
|
|
|
+ if(icon < 0 || icon > 7)
|
|
|
|
+ icon = 0;
|
|
|
|
+ else
|
|
|
|
+ icon = icon + 1;
|
|
|
|
+ #endif
|
|
|
|
+
|
|
|
|
+ qi.quest_id = quest_id;
|
|
|
|
+ qi.icon = (unsigned char)icon;
|
|
|
|
+ qi.nd = nd;
|
|
|
|
+
|
|
|
|
+ if( script_hasdata(st, 4) ) {
|
|
|
|
+ color = script_getnum(st, 4);
|
|
|
|
+ if( color < 0 || color > 3 ) {
|
|
|
|
+ ShowWarning("buildin_questinfo: invalid color '%d', changing to 0\n",color);
|
|
|
|
+ script_reportfunc(st);
|
|
|
|
+ color = 0;
|
|
|
|
+ }
|
|
|
|
+ qi.color = (unsigned char)color;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ qi.hasJob = false;
|
|
|
|
+
|
|
|
|
+ if(script_hasdata(st, 5)) {
|
|
|
|
+ job = script_getnum(st, 5);
|
|
|
|
+
|
|
|
|
+ if (!pcdb_checkid(job))
|
|
|
|
+ ShowError("buildin_questinfo: Nonexistant Job Class.\n");
|
|
|
|
+ else {
|
|
|
|
+ qi.hasJob = true;
|
|
|
|
+ qi.job = (unsigned short)job;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ map_add_questinfo(nd->bl.m,&qi);
|
|
|
|
+
|
|
|
|
+ return true;
|
|
|
|
+}
|
|
|
|
+
|
|
BUILDIN_FUNC(setquest)
|
|
BUILDIN_FUNC(setquest)
|
|
{
|
|
{
|
|
struct map_session_data *sd = script_rid2sd(st);
|
|
struct map_session_data *sd = script_rid2sd(st);
|
|
|
|
+ int i, quest_id;
|
|
|
|
+
|
|
nullpo_ret(sd);
|
|
nullpo_ret(sd);
|
|
|
|
+
|
|
|
|
+ quest_id = script_getnum(st, 2);
|
|
|
|
+
|
|
|
|
+ quest_add(sd, quest_id);
|
|
|
|
|
|
- quest_add(sd, script_getnum(st, 2));
|
|
|
|
|
|
+ // If questinfo is set, remove quest bubble once quest is set.
|
|
|
|
+ for(i = 0; i < map[sd->bl.m].qi_count; i++) {
|
|
|
|
+ struct questinfo *qi = &map[sd->bl.m].qi_data[i];
|
|
|
|
+ if( qi->quest_id == quest_id ) {
|
|
|
|
+#if PACKETVER >= 20120410
|
|
|
|
+ clif_quest_show_event(sd, &qi->nd->bl, 9999, 0);
|
|
|
|
+#else
|
|
|
|
+ clif_quest_show_event(sd, &qi->nd->bl, 0, 0);
|
|
|
|
+#endif
|
|
|
|
+ }
|
|
|
|
+ }
|
|
return SCRIPT_CMD_SUCCESS;
|
|
return SCRIPT_CMD_SUCCESS;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -16613,17 +16683,32 @@ BUILDIN_FUNC(showevent)
|
|
{
|
|
{
|
|
TBL_PC *sd = script_rid2sd(st);
|
|
TBL_PC *sd = script_rid2sd(st);
|
|
struct npc_data *nd = map_id2nd(st->oid);
|
|
struct npc_data *nd = map_id2nd(st->oid);
|
|
- int state, color;
|
|
|
|
|
|
+ int icon, color = 0;
|
|
|
|
|
|
if( sd == NULL || nd == NULL )
|
|
if( sd == NULL || nd == NULL )
|
|
return 0;
|
|
return 0;
|
|
- state = script_getnum(st, 2);
|
|
|
|
- color = script_getnum(st, 3);
|
|
|
|
|
|
|
|
- if( color < 0 || color > 3 )
|
|
|
|
- color = 0; // set default color
|
|
|
|
|
|
+ icon = script_getnum(st, 2);
|
|
|
|
+ if( script_hasdata(st, 3) ) {
|
|
|
|
+ color = script_getnum(st, 3);
|
|
|
|
+ if( color < 0 || color > 3 ) {
|
|
|
|
+ ShowWarning("buildin_showevent: invalid color '%d', changing to 0\n",color);
|
|
|
|
+ script_reportfunc(st);
|
|
|
|
+ color = 0;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ #if PACKETVER >= 20120410
|
|
|
|
+ if(icon < 0 || (icon > 8 && icon != 9999) || icon == 7)
|
|
|
|
+ icon = 9999; // Default to nothing if icon id is invalid.
|
|
|
|
+ #else
|
|
|
|
+ if(icon < 0 || icon > 7)
|
|
|
|
+ icon = 0;
|
|
|
|
+ else
|
|
|
|
+ icon = icon + 1;
|
|
|
|
+ #endif
|
|
|
|
|
|
- clif_quest_show_event(sd, &nd->bl, state, color);
|
|
|
|
|
|
+ clif_quest_show_event(sd, &nd->bl, icon, color);
|
|
return SCRIPT_CMD_SUCCESS;
|
|
return SCRIPT_CMD_SUCCESS;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -19150,13 +19235,14 @@ struct script_function buildin_func[] = {
|
|
BUILDIN_DEF(useatcmd, "s"),
|
|
BUILDIN_DEF(useatcmd, "s"),
|
|
|
|
|
|
//Quest Log System [Inkfish]
|
|
//Quest Log System [Inkfish]
|
|
|
|
+ BUILDIN_DEF(questinfo, "ii??"),
|
|
BUILDIN_DEF(setquest, "i"),
|
|
BUILDIN_DEF(setquest, "i"),
|
|
BUILDIN_DEF(erasequest, "i"),
|
|
BUILDIN_DEF(erasequest, "i"),
|
|
BUILDIN_DEF(completequest, "i"),
|
|
BUILDIN_DEF(completequest, "i"),
|
|
BUILDIN_DEF(checkquest, "i?"),
|
|
BUILDIN_DEF(checkquest, "i?"),
|
|
BUILDIN_DEF(isbegin_quest,"i"),
|
|
BUILDIN_DEF(isbegin_quest,"i"),
|
|
BUILDIN_DEF(changequest, "ii"),
|
|
BUILDIN_DEF(changequest, "ii"),
|
|
- BUILDIN_DEF(showevent, "ii"),
|
|
|
|
|
|
+ BUILDIN_DEF(showevent, "i?"),
|
|
|
|
|
|
//Bound items [Xantara] & [Akinari]
|
|
//Bound items [Xantara] & [Akinari]
|
|
BUILDIN_DEF2(getitem,"getitembound","vii?"),
|
|
BUILDIN_DEF2(getitem,"getitembound","vii?"),
|