summaryrefslogtreecommitdiff
path: root/src/map/script.cpp
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2012-12-12 22:36:08 -0800
committerBen Longbons <b.r.longbons@gmail.com>2012-12-12 22:36:08 -0800
commit608f959900968e83fd25231c72308fc608742dd5 (patch)
tree33a250f00947d7c83ba50779da466b5f5885db9f /src/map/script.cpp
parentd8e5c96fbbed5d526dd77d2e427bcb3090bddd58 (diff)
downloadtmwa-608f959900968e83fd25231c72308fc608742dd5.tar.gz
tmwa-608f959900968e83fd25231c72308fc608742dd5.tar.bz2
tmwa-608f959900968e83fd25231c72308fc608742dd5.tar.xz
tmwa-608f959900968e83fd25231c72308fc608742dd5.zip
Remove guilds, finally
If anyone in the future wonders why I did this, just look at how many lines of code this eliminates.
Diffstat (limited to 'src/map/script.cpp')
-rw-r--r--src/map/script.cpp683
1 files changed, 25 insertions, 658 deletions
diff --git a/src/map/script.cpp b/src/map/script.cpp
index 71b5bfb..b3f44b3 100644
--- a/src/map/script.cpp
+++ b/src/map/script.cpp
@@ -28,7 +28,6 @@
#include "chrif.hpp"
#include "clif.hpp"
#include "../common/db.hpp"
-#include "guild.hpp"
#include "intif.hpp"
#include "itemdb.hpp"
#include "../common/lock.hpp"
@@ -149,9 +148,6 @@ void builtin_readparam(ScriptState *st);
void builtin_getcharid(ScriptState *st);
void builtin_getpartyname(ScriptState *st);
void builtin_getpartymember(ScriptState *st);
-void builtin_getguildname(ScriptState *st);
-void builtin_getguildmaster(ScriptState *st);
-void builtin_getguildmasterid(ScriptState *st);
void builtin_strcharinfo(ScriptState *st);
void builtin_getequipid(ScriptState *st);
void builtin_getequipname(ScriptState *st);
@@ -174,9 +170,7 @@ void builtin_bonus2(ScriptState *st);
void builtin_bonus3(ScriptState *st);
void builtin_skill(ScriptState *st);
void builtin_setskill(ScriptState *st);
-void builtin_guildskill(ScriptState *st);
void builtin_getskilllv(ScriptState *st);
-void builtin_getgdskilllv(ScriptState *st);
void builtin_basicskillcheck(ScriptState *st);
void builtin_getgmlevel(ScriptState *st);
void builtin_end(ScriptState *st);
@@ -195,7 +189,6 @@ void builtin_gettimetick(ScriptState *st);
void builtin_gettime(ScriptState *st);
void builtin_gettimestr(ScriptState *st);
void builtin_openstorage(ScriptState *st);
-void builtin_guildopenstorage(ScriptState *st);
void builtin_itemskill(ScriptState *st);
void builtin_monster(ScriptState *st);
void builtin_areamonster(ScriptState *st);
@@ -250,18 +243,7 @@ void builtin_removemapflag(ScriptState *st);
void builtin_getmapflag(ScriptState *st);
void builtin_pvpon(ScriptState *st);
void builtin_pvpoff(ScriptState *st);
-void builtin_gvgon(ScriptState *st);
-void builtin_gvgoff(ScriptState *st);
void builtin_emotion(ScriptState *st);
-void builtin_maprespawnguildid(ScriptState *st);
-void builtin_agitstart(ScriptState *st); // <Agit>
-void builtin_agitend(ScriptState *st);
-void builtin_agitcheck(ScriptState *st); // <Agitcheck>
-void builtin_flagemblem(ScriptState *st); // Flag Emblem
-void builtin_getcastlename(ScriptState *st);
-void builtin_getcastledata(ScriptState *st);
-void builtin_setcastledata(ScriptState *st);
-void builtin_requestguildinfo(ScriptState *st);
void builtin_getequipcardcnt(ScriptState *st);
void builtin_successremovecards(ScriptState *st);
void builtin_failedremovecards(ScriptState *st);
@@ -290,8 +272,6 @@ void builtin_stoptimer(ScriptState *st);
void builtin_cmdothernpc(ScriptState *st);
void builtin_mobcount(ScriptState *st);
void builtin_strmobinfo(ScriptState *st); // Script for displaying mob info [Valaris]
-void builtin_guardian(ScriptState *st); // Script for displaying mob info [Valaris]
-void builtin_guardianinfo(ScriptState *st); // Script for displaying mob info [Valaris]
void builtin_npcskilleffect(ScriptState *st); // skill effects for npcs [Valaris]
void builtin_specialeffect(ScriptState *st); // special effect script [Valaris]
void builtin_specialeffect2(ScriptState *st); // special effect script [Valaris]
@@ -371,9 +351,6 @@ struct
{builtin_getcharid, "getcharid", "i*"},
{builtin_getpartyname, "getpartyname", "i"},
{builtin_getpartymember, "getpartymember", "i"},
- {builtin_getguildname, "getguildname", "i"},
- {builtin_getguildmaster, "getguildmaster", "i"},
- {builtin_getguildmasterid, "getguildmasterid", "i"},
{builtin_strcharinfo, "strcharinfo", "i"},
{builtin_getequipid, "getequipid", "i"},
{builtin_getequipname, "getequipname", "i"},
@@ -394,9 +371,7 @@ struct
{builtin_bonus3, "bonus3", "iiii"},
{builtin_skill, "skill", "ii*"},
{builtin_setskill, "setskill", "ii"}, // [Fate]
- {builtin_guildskill, "guildskill", "ii"},
{builtin_getskilllv, "getskilllv", "i"},
- {builtin_getgdskilllv, "getgdskilllv", "ii"},
{builtin_basicskillcheck, "basicskillcheck", "*"},
{builtin_getgmlevel, "getgmlevel", ""},
{builtin_end, "end", ""},
@@ -417,7 +392,6 @@ struct
{builtin_gettime, "gettime", "i"},
{builtin_gettimestr, "gettimestr", "si"},
{builtin_openstorage, "openstorage", "*"},
- {builtin_guildopenstorage, "guildopenstorage", "*"},
{builtin_itemskill, "itemskill", "iis"},
{builtin_monster, "monster", "Mxysmi*"},
{builtin_areamonster, "areamonster", "Mxyxysmi*"},
@@ -473,18 +447,7 @@ struct
{builtin_getmapflag, "getmapflag", "Mi"},
{builtin_pvpon, "pvpon", "M"},
{builtin_pvpoff, "pvpoff", "M"},
- {builtin_gvgon, "gvgon", "s"},
- {builtin_gvgoff, "gvgoff", "s"},
{builtin_emotion, "emotion", "i"},
- {builtin_maprespawnguildid, "maprespawnguildid", "sii"},
- {builtin_agitstart, "agitstart", ""}, // <Agit>
- {builtin_agitend, "agitend", ""},
- {builtin_agitcheck, "agitcheck", "i"}, // <Agitcheck>
- {builtin_flagemblem, "flagemblem", "i"}, // Flag Emblem
- {builtin_getcastlename, "getcastlename", "s"},
- {builtin_getcastledata, "getcastledata", "si*"},
- {builtin_setcastledata, "setcastledata", "sii"},
- {builtin_requestguildinfo, "requestguildinfo", "i*"},
{builtin_getequipcardcnt, "getequipcardcnt", "i"},
{builtin_successremovecards, "successremovecards", "i"},
{builtin_failedremovecards, "failedremovecards", "ii"},
@@ -509,8 +472,6 @@ struct
{builtin_misceffect, "misceffect", "i*"},
{builtin_soundeffect, "soundeffect", "si"},
{builtin_strmobinfo, "strmobinfo", "im"}, // display mob data [Valaris]
- {builtin_guardian, "guardian", "siisii*i"}, // summon guardians
- {builtin_guardianinfo, "guardianinfo", "i"}, // display guardian data [Valaris]
{builtin_npcskilleffect, "npcskilleffect", "iiii"}, // npc skill effect [Valaris]
{builtin_specialeffect, "specialeffect", "i"}, // npc skill effect [Valaris]
{builtin_specialeffect2, "specialeffect2", "i"}, // skill effect on players[Valaris]
@@ -2919,7 +2880,7 @@ void builtin_getcharid (ScriptState *st)
if (num == 1)
push_val (st->stack, ScriptCode::INT, sd->status.party_id);
if (num == 2)
- push_val (st->stack, ScriptCode::INT, sd->status.guild_id);
+ push_val (st->stack, ScriptCode::INT, 0/*guild_id*/);
if (num == 3)
push_val (st->stack, ScriptCode::INT, sd->status.account_id);
}
@@ -2990,89 +2951,6 @@ void builtin_getpartymember (ScriptState *st)
}
-/*==========================================
- *指定IDのギルド名取得
- *------------------------------------------
- */
-static
-char *builtin_getguildname_sub (int guild_id)
-{
- struct guild *g = NULL;
- g = guild_search (guild_id);
-
- if (g != NULL)
- {
- char *buf;
- buf = (char *) calloc (24, 1);
- strcpy (buf, g->name);
- return buf;
- }
- return 0;
-}
-
-void builtin_getguildname (ScriptState *st)
-{
- char *name;
- int guild_id = conv_num (st, &(st->stack->stack_data[st->start + 2]));
- name = builtin_getguildname_sub (guild_id);
- if (name != 0)
- push_str (st->stack, ScriptCode::STR, name);
- else
- push_str (st->stack, ScriptCode::CONSTSTR, "null");
-}
-
-/*==========================================
- *指定IDのGuildMaster名取得
- *------------------------------------------
- */
-static
-char *builtin_getguildmaster_sub (int guild_id)
-{
- struct guild *g = NULL;
- g = guild_search (guild_id);
-
- if (g != NULL)
- {
- char *buf;
- buf = (char *) calloc (24, 1);
- strncpy (buf, g->master, 23);
- return buf;
- }
-
- return 0;
-}
-
-void builtin_getguildmaster (ScriptState *st)
-{
- char *master;
- int guild_id = conv_num (st, &(st->stack->stack_data[st->start + 2]));
- master = builtin_getguildmaster_sub (guild_id);
- if (master != 0)
- push_str (st->stack, ScriptCode::STR, master);
- else
- push_str (st->stack, ScriptCode::CONSTSTR, "null");
-}
-
-void builtin_getguildmasterid (ScriptState *st)
-{
- char *master;
- struct map_session_data *sd = NULL;
- int guild_id = conv_num (st, &(st->stack->stack_data[st->start + 2]));
- master = builtin_getguildmaster_sub (guild_id);
- if (master != 0)
- {
- if ((sd = map_nick2sd (master)) == NULL)
- {
- push_val (st->stack, ScriptCode::INT, 0);
- return;
- }
- push_val (st->stack, ScriptCode::INT, sd->status.char_id);
- }
- else
- {
- push_val (st->stack, ScriptCode::INT, 0);
- }
-}
/*==========================================
* キャラクタの名前
@@ -3103,12 +2981,8 @@ void builtin_strcharinfo (ScriptState *st)
}
if (num == 2)
{
- char *buf;
- buf = builtin_getguildname_sub (sd->status.guild_id);
- if (buf != 0)
- push_str (st->stack, ScriptCode::STR, buf);
- else
- push_str (st->stack, ScriptCode::CONSTSTR, "");
+ // was: guild name
+ push_str (st->stack, ScriptCode::CONSTSTR, "");
}
}
@@ -3542,26 +3416,6 @@ void builtin_setskill (ScriptState *st)
}
/*==========================================
- * ギルドスキル取得
- *------------------------------------------
- */
-void builtin_guildskill (ScriptState *st)
-{
- int id, level;
- struct map_session_data *sd;
- int i = 0;
-
- id = conv_num (st, &(st->stack->stack_data[st->start + 2]));
- level = conv_num (st, &(st->stack->stack_data[st->start + 3]));
-// if( st->end>st->start+4 )
-// flag=conv_num(st,&(st->stack->stack_data[st->start+4]) );
- sd = script_rid2sd (st);
- for (i = 0; i < level; i++)
- guild_skillup (sd, id);
-
-}
-
-/*==========================================
* スキルレベル所得
*------------------------------------------
*/
@@ -3572,40 +3426,6 @@ void builtin_getskilllv (ScriptState *st)
}
/*==========================================
- * getgdskilllv(Guild_ID, Skill_ID);
- * skill_id = 10000 : GD_APPROVAL
- * 10001 : GD_KAFRACONTACT
- * 10002 : GD_GUARDIANRESEARCH
- * 10003 : GD_CHARISMA
- * 10004 : GD_EXTENSION
- *------------------------------------------
- */
-void builtin_getgdskilllv (ScriptState *st)
-{
- int guild_id = conv_num (st, &(st->stack->stack_data[st->start + 2]));
- int skill_id = conv_num (st, &(st->stack->stack_data[st->start + 3]));
- struct guild *g = guild_search (guild_id);
- push_val (st->stack, ScriptCode::INT,
- (g == NULL) ? -1 : guild_checkskill (g, skill_id));
- return;
-/*
- struct map_session_data *sd=NULL;
- struct guild *g=NULL;
- int skill_id;
-
- skill_id=conv_num(st,& (st->stack->stack_data[st->start+2]));
- sd=script_rid2sd(st);
- if(sd && sd->status.guild_id > 0) g=guild_search(sd->status.guild_id);
- if(sd && g) {
- push_val(st->stack,ScriptCode::INT, guild_checkskill(g,skill_id+9999) );
- } else {
- push_val(st->stack,ScriptCode::INT,-1);
- }
- return;
-*/
-}
-
-/*==========================================
*
*------------------------------------------
*/
@@ -3949,15 +3769,6 @@ void builtin_openstorage (ScriptState *st)
storage_storageopen (sd);
}
-void builtin_guildopenstorage (ScriptState *st)
-{
- struct map_session_data *sd = script_rid2sd (st);
- int ret;
- st->state = STOP;
- ret = storage_guild_storageopen (sd);
- push_val (st->stack, ScriptCode::INT, ret);
-}
-
/*==========================================
* アイテムによるスキル発動
*------------------------------------------
@@ -5020,11 +4831,28 @@ void builtin_isloggedin (ScriptState *st)
*------------------------------------------
*/
enum
-{ MF_NOMEMO, MF_NOTELEPORT, MF_NOSAVE, MF_NOBRANCH, MF_NOPENALTY,
- MF_NOZENYPENALTY, MF_PVP, MF_PVP_NOPARTY, MF_PVP_NOGUILD, MF_GVG,
- MF_GVG_NOPARTY, MF_NOTRADE, MF_NOSKILL, MF_NOWARP, MF_NOPVP,
- MF_NOICEWALL,
- MF_SNOW, MF_FOG, MF_SAKURA, MF_LEAVES, MF_RAIN
+{
+ MF_NOMEMO = 0,
+ MF_NOTELEPORT = 1,
+ MF_NOSAVE = 2,
+ MF_NOBRANCH = 3,
+ MF_NOPENALTY = 4,
+ MF_NOZENYPENALTY = 5,
+ MF_PVP = 6,
+ MF_PVP_NOPARTY = 7,
+ //MF_PVP_NOGUILD = 8,
+ //MF_GVG = 9,
+ //MF_GVG_NOPARTY = 10,
+ MF_NOTRADE = 11,
+ MF_NOSKILL = 12,
+ MF_NOWARP = 13,
+ MF_NOPVP = 14,
+ MF_NOICEWALL = 15,
+ MF_SNOW = 16,
+ MF_FOG = 17,
+ MF_SAKURA = 18,
+ MF_LEAVES = 19,
+ MF_RAIN = 20,
};
void builtin_setmapflagnosave (ScriptState *st)
@@ -5072,12 +4900,6 @@ void builtin_setmapflag (ScriptState *st)
case MF_PVP_NOPARTY:
map[m].flag.pvp_noparty = 1;
break;
- case MF_PVP_NOGUILD:
- map[m].flag.pvp_noguild = 1;
- break;
- case MF_GVG_NOPARTY:
- map[m].flag.gvg_noparty = 1;
- break;
case MF_NOZENYPENALTY:
map[m].flag.nozenypenalty = 1;
break;
@@ -5145,12 +4967,6 @@ void builtin_removemapflag (ScriptState *st)
case MF_PVP_NOPARTY:
map[m].flag.pvp_noparty = 0;
break;
- case MF_PVP_NOGUILD:
- map[m].flag.pvp_noguild = 0;
- break;
- case MF_GVG_NOPARTY:
- map[m].flag.gvg_noparty = 0;
- break;
case MF_NOZENYPENALTY:
map[m].flag.nozenypenalty = 0;
break;
@@ -5216,12 +5032,6 @@ void builtin_getmapflag (ScriptState *st)
case MF_PVP_NOPARTY:
r = map[m].flag.pvp_noparty;
break;
- case MF_PVP_NOGUILD:
- r = map[m].flag.pvp_noguild;
- break;
- case MF_GVG_NOPARTY:
- r = map[m].flag.gvg_noparty;
- break;
case MF_NOZENYPENALTY:
r = map[m].flag.nozenypenalty;
break;
@@ -5330,32 +5140,6 @@ void builtin_pvpoff (ScriptState *st)
}
-void builtin_gvgon (ScriptState *st)
-{
- int m;
- const char *str = conv_str (st, &(st->stack->stack_data[st->start + 2]));
- m = map_mapname2mapid (str);
- if (m >= 0 && !map[m].flag.gvg)
- {
- map[m].flag.gvg = 1;
- clif_send0199 (m, 3);
- }
-
-}
-
-void builtin_gvgoff (ScriptState *st)
-{
- int m;
- const char *str = conv_str (st, &(st->stack->stack_data[st->start + 2]));
- m = map_mapname2mapid (str);
- if (m >= 0 && map[m].flag.gvg)
- {
- map[m].flag.gvg = 0;
- clif_send0199 (m, 0);
- }
-
-}
-
/*==========================================
* NPCエモーション
*------------------------------------------
@@ -5370,368 +5154,6 @@ void builtin_emotion (ScriptState *st)
clif_emotion (map_id2bl (st->oid), type);
}
-static
-void builtin_maprespawnguildid_sub (struct block_list *bl, va_list ap)
-{
- int g_id = va_arg (ap, int);
- int flag = va_arg (ap, int);
- struct map_session_data *sd = NULL;
- struct mob_data *md = NULL;
-
- if (bl->type == BL_PC)
- sd = (struct map_session_data *) bl;
- if (bl->type == BL_MOB)
- md = (struct mob_data *) bl;
-
- if (sd)
- {
- if ((sd->status.guild_id == g_id) && (flag & 1))
- pc_setpos (sd, sd->status.save_point.map, sd->status.save_point.x,
- sd->status.save_point.y, 3);
- else if ((sd->status.guild_id != g_id) && (flag & 2))
- pc_setpos (sd, sd->status.save_point.map, sd->status.save_point.x,
- sd->status.save_point.y, 3);
- else if (sd->status.guild_id == 0) // Warp out players not in guild [Valaris]
- pc_setpos (sd, sd->status.save_point.map, sd->status.save_point.x, sd->status.save_point.y, 3); // end addition [Valaris]
- }
- if (md && flag & 4)
- {
- if (md->mob_class < 1285 || md->mob_class > 1288)
- mob_delete (md);
- }
-}
-
-void builtin_maprespawnguildid (ScriptState *st)
-{
- const char *mapname = conv_str (st, &(st->stack->stack_data[st->start + 2]));
- int g_id = conv_num (st, &(st->stack->stack_data[st->start + 3]));
- int flag = conv_num (st, &(st->stack->stack_data[st->start + 4]));
-
- int m = map_mapname2mapid (mapname);
-
- if (m)
- map_foreachinarea (builtin_maprespawnguildid_sub, m, 0, 0,
- map[m].xs - 1, map[m].ys - 1, BL_NUL, g_id, flag);
-}
-
-void builtin_agitstart (ScriptState *st)
-{
- if (agit_flag == 1)
- return; // Agit already Start.
- agit_flag = 1;
- guild_agit_start ();
-}
-
-void builtin_agitend (ScriptState *st)
-{
- if (agit_flag == 0)
- return; // Agit already End.
- agit_flag = 0;
- guild_agit_end ();
-}
-
-/*==========================================
- * agitcheck 1; // choice script
- * if(@agit_flag == 1) goto agit;
- * if(agitcheck(0) == 1) goto agit;
- *------------------------------------------
- */
-void builtin_agitcheck (ScriptState *st)
-{
- struct map_session_data *sd;
- int cond;
-
- sd = script_rid2sd (st);
- cond = conv_num (st, &(st->stack->stack_data[st->start + 2]));
-
- if (cond == 0)
- {
- if (agit_flag == 1)
- push_val (st->stack, ScriptCode::INT, 1);
- if (agit_flag == 0)
- push_val (st->stack, ScriptCode::INT, 0);
- }
- else
- {
- if (agit_flag == 1)
- pc_setreg (sd, add_str ("@agit_flag"), 1);
- if (agit_flag == 0)
- pc_setreg (sd, add_str ("@agit_flag"), 0);
- }
-}
-
-void builtin_flagemblem (ScriptState *st)
-{
- int g_id = conv_num (st, &(st->stack->stack_data[st->start + 2]));
-
- if (g_id < 0)
- return;
-
-// printf("Script.c: [FlagEmblem] GuildID=%d, Emblem=%d.\n", g->guild_id, g->emblem_id);
- ((struct npc_data *) map_id2bl (st->oid))->u.scr.guild_id = g_id;
-}
-
-void builtin_getcastlename (ScriptState *st)
-{
- const char *mapname = conv_str (st, &(st->stack->stack_data[st->start + 2]));
- struct guild_castle *gc;
- int i;
- char *buf = NULL;
- for (i = 0; i < MAX_GUILDCASTLE; i++)
- {
- if ((gc = guild_castle_search (i)) != NULL)
- {
- if (strcmp (mapname, gc->map_name) == 0)
- {
- buf = (char *) calloc (24, 1);
- strncpy (buf, gc->castle_name, 23);
- break;
- }
- }
- }
- if (buf)
- push_str (st->stack, ScriptCode::STR, buf);
- else
- push_str (st->stack, ScriptCode::CONSTSTR, "");
-}
-
-void builtin_getcastledata (ScriptState *st)
-{
- const char *mapname = conv_str (st, &(st->stack->stack_data[st->start + 2]));
- int index = conv_num (st, &(st->stack->stack_data[st->start + 3]));
- const char *event = NULL;
- struct guild_castle *gc;
- int i, j;
-
- if (st->end > st->start + 4 && index == 0)
- {
- for (i = 0, j = -1; i < MAX_GUILDCASTLE; i++)
- if ((gc = guild_castle_search (i)) != NULL &&
- strcmp (mapname, gc->map_name) == 0)
- j = i;
- if (j >= 0)
- {
- event = conv_str (st, &(st->stack->stack_data[st->start + 4]));
- guild_addcastleinfoevent (j, 17, event);
- }
- }
-
- for (i = 0; i < MAX_GUILDCASTLE; i++)
- {
- if ((gc = guild_castle_search (i)) != NULL)
- {
- if (strcmp (mapname, gc->map_name) == 0)
- {
- switch (index)
- {
- case 0:
- for (j = 1; j < 26; j++)
- guild_castledataload (gc->castle_id, j);
- break; // Initialize[AgitInit]
- case 1:
- push_val (st->stack, ScriptCode::INT, gc->guild_id);
- break;
- case 2:
- push_val (st->stack, ScriptCode::INT, gc->economy);
- break;
- case 3:
- push_val (st->stack, ScriptCode::INT, gc->defense);
- break;
- case 4:
- push_val (st->stack, ScriptCode::INT, gc->triggerE);
- break;
- case 5:
- push_val (st->stack, ScriptCode::INT, gc->triggerD);
- break;
- case 6:
- push_val (st->stack, ScriptCode::INT, gc->nextTime);
- break;
- case 7:
- push_val (st->stack, ScriptCode::INT, gc->payTime);
- break;
- case 8:
- push_val (st->stack, ScriptCode::INT, gc->createTime);
- break;
- case 9:
- push_val (st->stack, ScriptCode::INT, gc->visibleC);
- break;
- case 10:
- push_val (st->stack, ScriptCode::INT, gc->visibleG0);
- break;
- case 11:
- push_val (st->stack, ScriptCode::INT, gc->visibleG1);
- break;
- case 12:
- push_val (st->stack, ScriptCode::INT, gc->visibleG2);
- break;
- case 13:
- push_val (st->stack, ScriptCode::INT, gc->visibleG3);
- break;
- case 14:
- push_val (st->stack, ScriptCode::INT, gc->visibleG4);
- break;
- case 15:
- push_val (st->stack, ScriptCode::INT, gc->visibleG5);
- break;
- case 16:
- push_val (st->stack, ScriptCode::INT, gc->visibleG6);
- break;
- case 17:
- push_val (st->stack, ScriptCode::INT, gc->visibleG7);
- break;
- case 18:
- push_val (st->stack, ScriptCode::INT, gc->Ghp0);
- break;
- case 19:
- push_val (st->stack, ScriptCode::INT, gc->Ghp1);
- break;
- case 20:
- push_val (st->stack, ScriptCode::INT, gc->Ghp2);
- break;
- case 21:
- push_val (st->stack, ScriptCode::INT, gc->Ghp3);
- break;
- case 22:
- push_val (st->stack, ScriptCode::INT, gc->Ghp4);
- break;
- case 23:
- push_val (st->stack, ScriptCode::INT, gc->Ghp5);
- break;
- case 24:
- push_val (st->stack, ScriptCode::INT, gc->Ghp6);
- break;
- case 25:
- push_val (st->stack, ScriptCode::INT, gc->Ghp7);
- break;
- default:
- push_val (st->stack, ScriptCode::INT, 0);
- break;
- }
- return;
- }
- }
- }
- push_val (st->stack, ScriptCode::INT, 0);
-}
-
-void builtin_setcastledata (ScriptState *st)
-{
- const char *mapname = conv_str (st, &(st->stack->stack_data[st->start + 2]));
- int index = conv_num (st, &(st->stack->stack_data[st->start + 3]));
- int value = conv_num (st, &(st->stack->stack_data[st->start + 4]));
- struct guild_castle *gc;
- int i;
-
- for (i = 0; i < MAX_GUILDCASTLE; i++)
- {
- if ((gc = guild_castle_search (i)) != NULL)
- {
- if (strcmp (mapname, gc->map_name) == 0)
- {
- // Save Data byself First
- switch (index)
- {
- case 1:
- gc->guild_id = value;
- break;
- case 2:
- gc->economy = value;
- break;
- case 3:
- gc->defense = value;
- break;
- case 4:
- gc->triggerE = value;
- break;
- case 5:
- gc->triggerD = value;
- break;
- case 6:
- gc->nextTime = value;
- break;
- case 7:
- gc->payTime = value;
- break;
- case 8:
- gc->createTime = value;
- break;
- case 9:
- gc->visibleC = value;
- break;
- case 10:
- gc->visibleG0 = value;
- break;
- case 11:
- gc->visibleG1 = value;
- break;
- case 12:
- gc->visibleG2 = value;
- break;
- case 13:
- gc->visibleG3 = value;
- break;
- case 14:
- gc->visibleG4 = value;
- break;
- case 15:
- gc->visibleG5 = value;
- break;
- case 16:
- gc->visibleG6 = value;
- break;
- case 17:
- gc->visibleG7 = value;
- break;
- case 18:
- gc->Ghp0 = value;
- break;
- case 19:
- gc->Ghp1 = value;
- break;
- case 20:
- gc->Ghp2 = value;
- break;
- case 21:
- gc->Ghp3 = value;
- break;
- case 22:
- gc->Ghp4 = value;
- break;
- case 23:
- gc->Ghp5 = value;
- break;
- case 24:
- gc->Ghp6 = value;
- break;
- case 25:
- gc->Ghp7 = value;
- break;
- default:
- return;
- }
- guild_castledatasave (gc->castle_id, index, value);
- return;
- }
- }
- }
-}
-
-/* =====================================================================
- * ギルド情報を要求する
- * ---------------------------------------------------------------------
- */
-void builtin_requestguildinfo (ScriptState *st)
-{
- int guild_id = conv_num (st, &(st->stack->stack_data[st->start + 2]));
- const char *event = NULL;
-
- if (st->end > st->start + 3)
- event = conv_str (st, &(st->stack->stack_data[st->start + 3]));
-
- if (guild_id > 0)
- guild_npc_request_info (guild_id, event);
-}
-
/* =====================================================================
* カードの数を得る
* ---------------------------------------------------------------------
@@ -6061,61 +5483,6 @@ void builtin_strmobinfo (ScriptState *st)
}
/*==========================================
- * Summon guardians [Valaris]
- *------------------------------------------
- */
-void builtin_guardian (ScriptState *st)
-{
- int mob_class = 0, amount = 1, x = 0, y = 0, guardian = 0;
- const char *event = "";
-
- const char *mapname = conv_str (st, &(st->stack->stack_data[st->start + 2]));
- x = conv_num (st, &(st->stack->stack_data[st->start + 3]));
- y = conv_num (st, &(st->stack->stack_data[st->start + 4]));
- const char *str = conv_str (st, &(st->stack->stack_data[st->start + 5]));
- mob_class = conv_num (st, &(st->stack->stack_data[st->start + 6]));
- amount = conv_num (st, &(st->stack->stack_data[st->start + 7]));
- event = conv_str (st, &(st->stack->stack_data[st->start + 8]));
- if (st->end > st->start + 9)
- guardian = conv_num (st, &(st->stack->stack_data[st->start + 9]));
-
- mob_spawn_guardian (map_id2sd (st->rid), mapname, x, y, str, mob_class, amount,
- event, guardian);
-
-}
-
-/*================================================
- * Script for Displaying Guardian Info [Valaris]
- *------------------------------------------------
- */
-void builtin_guardianinfo (ScriptState *st)
-{
- int guardian = conv_num (st, &(st->stack->stack_data[st->start + 2]));
- struct map_session_data *sd = script_rid2sd (st);
- struct guild_castle *gc = guild_mapname2gc (map[sd->bl.m].name);
-
- if (guardian == 0 && gc->visibleG0 == 1)
- push_val (st->stack, ScriptCode::INT, gc->Ghp0);
- if (guardian == 1 && gc->visibleG1 == 1)
- push_val (st->stack, ScriptCode::INT, gc->Ghp1);
- if (guardian == 2 && gc->visibleG2 == 1)
- push_val (st->stack, ScriptCode::INT, gc->Ghp2);
- if (guardian == 3 && gc->visibleG3 == 1)
- push_val (st->stack, ScriptCode::INT, gc->Ghp3);
- if (guardian == 4 && gc->visibleG4 == 1)
- push_val (st->stack, ScriptCode::INT, gc->Ghp4);
- if (guardian == 5 && gc->visibleG5 == 1)
- push_val (st->stack, ScriptCode::INT, gc->Ghp5);
- if (guardian == 6 && gc->visibleG6 == 1)
- push_val (st->stack, ScriptCode::INT, gc->Ghp6);
- if (guardian == 7 && gc->visibleG7 == 1)
- push_val (st->stack, ScriptCode::INT, gc->Ghp7);
- else
- push_val (st->stack, ScriptCode::INT, -1);
-
-}
-
-/*==========================================
* IDからItem名
*------------------------------------------
*/