Skip to content

Commit

Permalink
[12815] Allow GAMEOBJECT_TYPE_TRAP respawn using SCRIPT_COMMAND_RESPA…
Browse files Browse the repository at this point in the history
…WN_GAMEOBJECT
  • Loading branch information
xfurry committed Jan 13, 2015
1 parent e1ed0fe commit b5e29d3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions src/game/ScriptMgr.cpp
Expand Up @@ -391,8 +391,7 @@ void ScriptMgr::LoadScripts(ScriptMapMapName& scripts, const char* tablename)
if (info->type == GAMEOBJECT_TYPE_FISHINGNODE ||
info->type == GAMEOBJECT_TYPE_FISHINGHOLE ||
info->type == GAMEOBJECT_TYPE_DOOR ||
info->type == GAMEOBJECT_TYPE_BUTTON ||
info->type == GAMEOBJECT_TYPE_TRAP)
info->type == GAMEOBJECT_TYPE_BUTTON)
{
sLog.outErrorDb("Table `%s` have gameobject type (%u) unsupported by command SCRIPT_COMMAND_RESPAWN_GAMEOBJECT for script id %u", tablename, info->type, tmp.id);
continue;
Expand Down Expand Up @@ -1353,8 +1352,7 @@ bool ScriptAction::HandleScriptStep()

if (pGo->GetGoType() == GAMEOBJECT_TYPE_FISHINGNODE ||
pGo->GetGoType() == GAMEOBJECT_TYPE_DOOR ||
pGo->GetGoType() == GAMEOBJECT_TYPE_BUTTON ||
pGo->GetGoType() == GAMEOBJECT_TYPE_TRAP)
pGo->GetGoType() == GAMEOBJECT_TYPE_BUTTON)
{
sLog.outErrorDb(" DB-SCRIPTS: Process table `%s` id %u, command %u can not be used with gameobject of type %u (guid: %u, buddyEntry: %u).", m_table, m_script->id, m_script->command, uint32(pGo->GetGoType()), m_script->respawnGo.goGuid, m_script->buddyEntry);
break;
Expand Down
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "12814"
#define REVISION_NR "12815"
#endif // __REVISION_NR_H__

7 comments on commit b5e29d3

@cala
Copy link
Contributor

@cala cala commented on b5e29d3 Jan 14, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah nice, thank you. I know exactly where to use this! :)

@cala
Copy link
Contributor

@cala cala commented on b5e29d3 Jan 26, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I faced recently a similar quest script involving the spawning of a button GO. May I ask why the core is not allowed to spawn objects GAMEOBJECT_TYPE_BUTTON?

@xfurry
Copy link
Member Author

@xfurry xfurry commented on b5e29d3 Jan 26, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I faced recently a similar quest script involving the spawning of a button GO

Please give the full context. Quest id, Go id, etc...

@cala
Copy link
Contributor

@cala cala commented on b5e29d3 Jan 26, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course. You will find all the relevant data here:
classicdb/database@b5d4eeb
Unfortunately, I was unable to find a reliable video of the event. So if you have any question regarding the right behaviour, feel free to ask. 😄

@Schmoozerd
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technical note:
At the moment SCRIPT_COMMAND_RESPWAN_GO will use

uint32 time_to_despawn = m_script->respawnGo.despawnDelay < 5 ? 5 : m_script->respawnGo.despawnDelay;

as respawn delay.
This might result in despawn-spawned mobs to be spawned only for a short time. Maybe we should change this to preserve 0 if given in the database.

The limitations on excluding Buttons, .... is in my opinion stupid, and i think it is save to only limit doors with this command.

@cala
Copy link
Contributor

@cala cala commented on b5e29d3 Jan 29, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The limitations on excluding Buttons, .... is in my opinion stupid, and i think it is save to only limit doors with this command.

In other words, I can safely push a commit similar to this one to remove the limitation on Buttons?

@cyberium
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In other words, I can safely push a commit similar to this one to remove the limitation on Buttons?

yes ;)

Please sign in to comment.