Page 1 of 1

Target Type

Posted: Fri Aug 12, 2016 2:09 pm
by Gangrenous
I noticed we have target types like Self, Caster Pet, Enemy but nothing for caster or caster pet. Or how about Caster, Pet, Group? If I set the spell for Friendly would that fix it? I want players to be able to cast on another player or their pet, but not enemies.

Re: Target Type

Posted: Fri Aug 12, 2016 2:59 pm
by Jabantiz

Code: Select all

#define SPELL_TARGET_SELF			0
#define SPELL_TARGET_ENEMY			1
#define SPELL_TARGET_GROUP_AE		2
#define SPELL_TARGET_CASTER_PET		3
#define SPELL_TARGET_ENEMY_PET		4
#define SPELL_TARGET_ENEMY_CORPSE	5
#define SPELL_TARGET_GROUP_CORPSE	6
#define SPELL_TARGET_NONE			7
#define SPELL_TARGET_RAID_AE		8
#define SPELL_TARGET_OTHER_GROUP_AE	9
Some of these will be different if the friendly flag is set or not but I don't have that exact list, might be partial lists on the forum but I don't think there is a complete breakdown sadly.

Re: Target Type

Posted: Fri Aug 12, 2016 5:22 pm
by Gangrenous
Yes, I knew those from the editor. I am saying that I cannot seem to find a way to be able to spell target either me, or my pet. I can cast the spell on myself by choosing self as target, or target type caster pet. But what if I want the spell to affect me, a group member or just a group members pet. You should be able to target a strangers pet and buff his pet.

Re: Target Type

Posted: Fri Aug 12, 2016 6:44 pm
by Gangrenous
Also, shouldn't there be an "any" target. I see old post referring to it.

Re: Target Type

Posted: Thu Aug 18, 2016 7:09 pm
by Scribble
Searching for knowledge on this. If anyone has any ideas? At a minor roadblock with this.

Re: Target Type

Posted: Thu Aug 18, 2016 7:23 pm
by Gangrenous
Let me try to be more specific on the issue. Lets just say you have a spell something like an HP buff, Damage Shield, AC buff, etc. What do you use for the target? If you pick enemy, you actually will go into attack mode when cast. Also I can seem to force effects on the target, but the icon for the buff will never appear on the target.

Re: Target Type

Posted: Thu Aug 18, 2016 8:53 pm
by Jabantiz
Jabantiz wrote:Some of these will be different if the friendly flag is set or not but I don't have that exact list
Set the buff to enemy and friendly to 1, it should be set to friendly when you examine it. Again I don't have a complete list on how the friendly flag changes the original list.

Re: Target Type

Posted: Fri Aug 19, 2016 7:30 am
by Gangrenous
Xinux helped me with this last night. The issue ended up being the editor throwing a negative number in instead of zero. When a combobox has no selection, it needs to be told to not return a -1. This cost me a lot of time, I was looking in the wrong spot. So basically any spells I edited using the editor was throwing a -1 under det_type. I change my editor for all the spell fields that use a combobox to not return a -1.

I think what was happening in C++ was the typical UINT operator issue where it thinks a negative number is greater than 0, I think we have all seen that at some point.

Code: Select all

private void button_spell_update_Click(object sender, EventArgs e)
        {
            string id = textBox_spell_id.Text;
            string soe_spell_crc = textBox_spell_soespellcrc.Text;
            string type = textBox_spell_type.Text;
            int cast_type = GetCastTypeID((string)comboBox_spell_casttype.SelectedItem) == -1 ? 0 : GetCastTypeID((string)comboBox_spell_casttype.SelectedItem);
            string name = textBox_spell_name.Text;
            string description = db.RemoveEscapeCharacters(textBox_spell_description.Text);
            string icon = textBox_spell_icon.Text;
            string icon_heroic = textBox_spell_iconheroicop.Text;
            string icon_backdrop = textBox_spell_iconbackdrop.Text;
            long class_skill = GetSkillID((string)comboBox_spell_classskill.SelectedItem) == -1 ? 0 : GetSkillID((string)comboBox_spell_classskill.SelectedItem);
            long mastery_skill = GetSkillID((string)comboBox_spell_masteryskill.SelectedItem) == -1 ? 0 : GetSkillID((string)comboBox_spell_masteryskill.SelectedItem);
            string min_class_skill_req = textBox_spell_minclassskillreq.Text;
            int duration_until_cancel = Convert.ToInt32(checkBox_spell_durationuntilcancel.Checked);
            int target_type = GetTargetTypeID((string)comboBox_spell_targettype.SelectedItem) == -1 ? 0 : GetTargetTypeID((string)comboBox_spell_targettype.SelectedItem);
            string success_message = db.RemoveEscapeCharacters(textBox_spell_successmessage.Text);
            string fade_message = db.RemoveEscapeCharacters(textBox_spell_fademessage.Text);
            int interruptable = Convert.ToInt32(checkBox_spell_interruptable.Checked);
            int cast_while_moving = Convert.ToInt32(checkBox_spellcastwhilemoving.Checked);
            string luascript = db.RemoveEscapeCharacters(textBox_spell_luascript.Text);
            string spell_visual = textBox_spell_spellvisual.Text;
            string effect_message = db.RemoveEscapeCharacters(textBox_spell_effectmessage.Text);
            int spell_book_type = GetSpellBookTypeID((string)comboBox_spell_spellbooktype.SelectedItem);
            int can_effect_raid = Convert.ToInt32(checkBox_spell_caneffectraid.Checked);
            int affect_only_group_members = Convert.ToInt32(checkBox_spell_affectonlygroupmembers.Checked);
            int display_spell_tier = Convert.ToInt32(checkBox_spell_displayspelltier.Checked);
            int friendly_spell = Convert.ToInt32(checkBox_spell_friendlyspell.Checked);
            int group_spell = Convert.ToInt32(checkBox_spell_groupspell.Checked);
            int det_type = GetDetTypeID((string)comboBox_spell_dettype.Text) == -1 ? 0 : GetDetTypeID((string)comboBox_spell_dettype.Text);
            int control_effect_type = GetControlEffectTypeID((string)comboBox_spell_controleffecttype.Text) == -1 ? 0 :  GetControlEffectTypeID((string)comboBox_spell_controleffecttype.Text);
            int incurable = Convert.ToInt32(checkBox_spell_incurable.Checked);
            string linked_timer_id = textBox_spell_linkedtimerid.Text;
            int not_maintained = Convert.ToInt32(checkBox_spell_notmaintained.Checked);
            string casting_flags = textBox_spell_castingflags.Text;
            int persist_through_death = Convert.ToInt32(checkBox_spell_persistthroughdeath.Checked);
            string savage_bar = textBox_spell_savagebar.Text;
            string savage_bar_slot = textBox_spell_savagebarslot.Text;
            int is_active = Convert.ToInt32(checkBox_spell_isactive.Checked);
            int is_aa = Convert.ToInt32(checkBox_spell_isaa.Checked);
            int is_deity = Convert.ToInt32(checkBox_spell_isdeity.Checked);
            string deity = textBox_spell_deity.Text;
            string last_auto_update = textBox_spell_lastautoupdate.Text;
            string soe_last_update = textBox_spell_soelastupdate.Text;

            int rows = db.RunQuery("UPDATE spells SET type=" + type + ", cast_type=" + cast_type + ", name='" + name + "', description='" + description + "', icon=" + icon + ", icon_heroic_op=" + icon_heroic + ", icon_backdrop=" + icon_backdrop + ", class_skill= " + class_skill + ", mastery_skill=" + mastery_skill + ", min_class_skill_req=" + min_class_skill_req + ", duration_until_cancel=" + duration_until_cancel + ", target_type=" + target_type + ", success_message='" + success_message + "', fade_message='" + fade_message + "', interruptable=" + interruptable + ", cast_while_moving=" + cast_while_moving + ", lua_script='" + luascript + "', spell_visual=" + spell_visual + ", effect_message='" + effect_message + "', spell_book_type=" + spell_book_type + ", can_effect_raid=" + can_effect_raid + ", affect_only_group_members=" + affect_only_group_members + ", display_spell_tier=" + display_spell_tier + ", friendly_spell=" + friendly_spell + ", group_spell=" + group_spell + ", det_type=" + det_type + ", control_effect_type=" + control_effect_type + ", incurable=" + incurable + ", linked_timer_id=" + linked_timer_id + ", not_maintained=" + not_maintained + ", casting_flags=" + casting_flags + ", persist_through_death=" + persist_through_death + ", savage_bar=" + savage_bar + ", savage_bar_slot=" + savage_bar_slot + ", is_active=" + is_active + ", is_aa=" + is_aa + ", is_deity=" + is_deity + ", deity=" + deity + " WHERE id=" + id);

        }