Jump to content

The problem of realization of effects


Guest virusav

Recommended Posts

There is a spell 50001, which has the effect SPELL_EFFECT_SCRIPT_EFFECT, which lies in the fact that the player must say randomly one of 3 phrases.

To date, this kernel can not be realized because the codes from the database will not be accepted into the kernel (and in which table should be placed texts - the question).

A script SD2 also can not be realized, as not to assign that script.

I asked Laise and VladimirMangos about where should such sales, but they could not answer this question.

Maybe it should allow external scripts, such as SD2, describe the effects of spells, if this can be done in the kernel?

Are there any solutions to this problem?

Link to comment
Share on other sites

the last lines of scriptedEffect:

   // normal DB scripted effect
   if (!unitTarget)
       return;

   DEBUG_FILTER_LOG(LOG_FILTER_SPELL_CAST, "Spell ScriptStart spellid %u in EffectScriptEffect ", m_spellInfo->Id);
   m_caster->GetMap()->ScriptsStart(sSpellScripts, m_spellInfo->Id, m_caster, unitTarget);

So it should be possible to assing a DB script (table spell_scipts)

However, these scripts have no possibility afaik to do a random say..

As some of these spells (like your example) are casted onto players, we cannot use a usual SD2 hook, would be needed something like table Scripted_Spell, and the hook like ProcessScriptedSpellEffect.

I think you should poke NoFantasy about this, because if he wants a SD2 hook, he is the man anyways ;)

Link to comment
Share on other sites

Question is : would a SD2 hook be really useful? For something like 2 or 3 spells...

Why not using the existing spell_scripts / db_script_string tables :

#define SCRIPT_COMMAND_FIELD_SET             2              // source = any, datalong = field_id, datalog2 = value
#define SCRIPT_COMMAND_MOVE_TO               3              // source = Creature, datalog2 = time, x/y/z
#define SCRIPT_COMMAND_FLAG_SET              4              // source = any, datalong = field_id, datalog2 = bitmask
...
#define SCRIPT_COMMAND_CREATE_ITEM          17              // source or target must be player, datalong = item entry, datalong2 = amount
#define SCRIPT_COMMAND_DESPAWN_SELF         18              // source or target must be creature, datalong = despawn delay
#define SCRIPT_COMMAND_PLAY_MOVIE           19              // target can only be a player, datalog = movie id

We could add a "simple"

#define SCRIPT_COMMAND_RANDOM_TALK          20             //source = WorldObject, target = any/none, datalong = type (say, yell, etc),
                                                          //datalong2/3/4/dataint = db_script_string entries (a random one will be chosen)

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use