Would anybody be interested in coding a new script command? It would work sorta like the normal guardian command, but not be tied into any getcastledata. It will spawn a monster with the monsters normal health/strength that supports only the specified guild. The monster moves around freely and won't attack or damage guild members, but is aggressive to anybody else. Basically mod the monster command similar to the summon command to use a guildID instead of a playerID. I looked at the script src files and it didn't seem all that bad, but I don't know enough about how things work together to do this myself. It needs to have: no time limit until mob disappears, able to spawn more than one mob at a time, allow variables within in the command structure, and support event labels, allow -1 to be placed to spawn random monster, do not respawn upon being killed, and possibly show guild name/emblem on the mob (like in WoE guardian monsters).
Basically I'm trying to merge these two commands. There also stuff in the guild src file also you have to adjust. So far every attempt results in a crash of some kind.
BUILDIN_FUNC(monster)
{
const char* mapn = script_getstr(st,2);
int x = script_getnum(st,3);
int y = script_getnum(st,4);
const char* str = script_getstr(st,5);
int class_ = script_getnum(st,6);
int amount = script_getnum(st,7);
const char* event = "";
struct map_session_data* sd;
int m;
if( script_hasdata(st,8) )
{
event = script_getstr(st,8);
check_event(st, event);
}
if (class_ >= 0 && !mobdb_checkid(class_)) {
ShowWarning("buildin_monster: Attempted to spawn non-existing monster class %d\n", class_);
return 1;
}
sd = map_id2sd(st->rid);
if( sd && strcmp(mapn,"this") == 0 )
m = sd->bl.m;
else
{
m = map_mapname2mapid(mapn);
if( map[m].flag.src4instance && st->instance_id )
{ // Try to redirect to the instance map, not the src map
if( (m = instance_mapid2imapid(m, st->instance_id)) < 0 )
{
ShowError("buildin_monster: Trying to spawn monster (%d) on instance map (%s) without instance attached.\n", class_, mapn);
return 1;
}
}
}
mob_once_spawn(sd,m,x,y,str,class_,amount,event);
return 0;
}
BUILDIN_FUNC(guardian)
{
int class_=0,x=0,y=0,guardian=0;
const char *str,*map,*evt="";
struct script_data *data;
bool has_index = false;
map =script_getstr(st,2);
x =script_getnum(st,3);
y =script_getnum(st,4);
str =script_getstr(st,5);
class_=script_getnum(st,6);
if( script_hasdata(st,8) )
{// "<event label>",<guardian index>
evt=script_getstr(st,7);
guardian=script_getnum(st,8);
has_index = true;
} else if( script_hasdata(st,7) ){
data=script_getdata(st,7);
get_val(st,data);
if( data_isstring(data) )
{// "<event label>"
evt=script_getstr(st,7);
} else if( data_isint(data) )
{// <guardian index>
guardian=script_getnum(st,7);
has_index = true;
} else {
ShowError("script:guardian: invalid data type for argument #6 (from 1)\n");
script_reportdata(data);
return 1;
}
}
check_event(st, evt);
script_pushint(st, mob_spawn_guardian(map,x,y,str,class_,evt,guardian,has_index));
return 0;
}
Question
Peopleperson49
Would anybody be interested in coding a new script command? It would work sorta like the normal guardian command, but not be tied into any getcastledata. It will spawn a monster with the monsters normal health/strength that supports only the specified guild. The monster moves around freely and won't attack or damage guild members, but is aggressive to anybody else. Basically mod the monster command similar to the summon command to use a guildID instead of a playerID. I looked at the script src files and it didn't seem all that bad, but I don't know enough about how things work together to do this myself. It needs to have: no time limit until mob disappears, able to spawn more than one mob at a time, allow variables within in the command structure, and support event labels, allow -1 to be placed to spawn random monster, do not respawn upon being killed, and possibly show guild name/emblem on the mob (like in WoE guardian monsters).
guildmonster "<MapName>",<x>,<y>,"<GuildID>","<NameToShow>",<MobID>,<Amount>,"<NPCNAME::OnLabel>";
Basically I'm trying to merge these two commands. There also stuff in the guild src file also you have to adjust. So far every attempt results in a crash of some kind.
Edited by peopleperson49Link 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.