Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Monsters Summoned by Script Cannot Get boss_monster status #1839

Open
4 tasks done
bWolfie opened this issue Sep 17, 2017 · 6 comments
Open
4 tasks done

Monsters Summoned by Script Cannot Get boss_monster status #1839

bWolfie opened this issue Sep 17, 2017 · 6 comments
Labels
component:core:scriptengine Affecting the script engine or the script commands component:mechanics Affecting the game mechanics in general severity:2-fair Incorrect gaming mechanics, database warnings type:bug Issue is a bug or describes an incorrect behavior that should be fixed

Comments

@bWolfie
Copy link
Contributor

bWolfie commented Sep 17, 2017

Issue Prelude

  • I have not modified the source prior to reproducing this issue.
  • I am using the latest version of Hercules.
  • I am aware that this report will be closed or deleted if it becomes obvious that I am stating the false.

Description

Boss monsters, such as the lhz_dun03/04 ones, that are summoned through scripts can never attain the same setting as monsters spawn through the boss_monster NPC definition.

Why make this change?

It will allow people to take advantage of the Tombstone system for script-spawned monsters.

New Behavior

There should be an optional parameter or a new script command bossmonster for summoning these monsters, with the appropriate respawn delays able to be set for tombstones.

Branch(es):

  • master
@Helianthella
Copy link
Member

Helianthella commented Sep 20, 2017

try this:

.@mobGID = monster("place", 60, 100, "Poring", PORING, 1); // <= change location here
.@mode = getunitdata(.@mobGID, UDT_MODE); // get the mode of the spawned monster
.@mode |= 0x20; // append MD_BOSS to the mode
setunitdata(.@mobGID, UDT_MODE, .@mode); // set the new mode on the spawned monster

In theory you should be able to use this for any mode in enum e_mode

@Helianthella
Copy link
Member

Helianthella commented Sep 20, 2017

@MishimaHaruna imho we should expose those MD_ mode flags constants to the script engine

@bWolfie
Copy link
Contributor Author

bWolfie commented Sep 26, 2017

Thanks for input @mekolat sadly it didn't work, as 0x20 is already appended on my monster. MVP Tombstones are actually spawned using md->spawn->state.boss data rather than md->status.mode&MD_BOSS, because that data is unique to the NPC definition of boss_monster.

I tried creating a plugin which could create custom tombstones, but it didn't work.

BUILDIN(mvptomb)
{
	struct map_session_data *sd = NULL;
	struct mob_data *md;

	if (!script_hasdata(st, 2) && ! script_hasdata(st, 3))
		return false;

	sd = map->id2sd(script_getnum(st, 2));
	md = map->id2md(script_getnum(st, 3));

	if (sd == NULL || md == NULL)
		return false;

	if (map->list[md->bl.m].flag.notomb != 1)
		mob->mvptomb_create(md, sd ? sd->status.name : NULL, time(NULL));
	return true;
}

where you md scriptnum3 will be mobGID.

Also something funny, getunitdata is returning false at end of funciton, so always giving a debug message.

@Helianthella Helianthella added component:core:scriptengine Affecting the script engine or the script commands component:mechanics Affecting the game mechanics in general Hacktoberfest severity:2-fair Incorrect gaming mechanics, database warnings type:bug Issue is a bug or describes an incorrect behavior that should be fixed labels Oct 20, 2017
@MishimaHaruna
Copy link
Member

@EyesOfAHawk do you have a suggestion on how to make those tombstones disappear when the monster is spawned the next time, if we implement this?

@guilherme-gm
Copy link
Member

@MishimaHaruna what if we leave the tomb removal to the script too?
Like:

//...
OnSpawn:
   if (.myTomb)
       delmvptomb(.myTomb);
  monster ... "OnMyMvpDie";
  end;

OnMyMvpDie:
  .myTomb = mvptomb(playerName, mobName);
  end;
//...

but mvptombs stores a md instead of the mob name, so this might need to be changed

@Emistry
Copy link
Member

Emistry commented Jan 8, 2019

I believe the main reason to enable npc script to spawn a monster with boss_monster are because of the usage of convex mirror item, that used to track the location of MVP monster.

Perhaps we could consider a new script command that spawn monster that has md->spawn->state.boss. auto respawn are optional.
Might as well consider a separate script command to handle create/destroy for Tombstone.

Tombstone for LHZ bosses, its possible to be done even at current stage, just the location might differ since we can't get the exact coordinate of the monster when it died. and it is ugly way to do it.
(md data no longer available when the mob died and trigger OnNPCKillEvent, need to find a way to store the md data for this case.)
Image of Yaktocat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:core:scriptengine Affecting the script engine or the script commands component:mechanics Affecting the game mechanics in general severity:2-fair Incorrect gaming mechanics, database warnings type:bug Issue is a bug or describes an incorrect behavior that should be fixed
Projects
None yet
Development

No branches or pull requests

5 participants