-
Notifications
You must be signed in to change notification settings - Fork 47
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
Script engine improvements #409
Comments
Very timely! Thanks! |
About 1: (Toggle UnitFlags) About 4: (Throw events to all npcs) |
About 4: (Throw events to all npcs) |
Partially implemented in 12659 and 12660. |
Another discussed script improvement is the areatrigger dbscripts support (poke @cala and @Tobschinski about this). Here is my proposal (untested), but this is still an open discussion: diff --git a/doc/script_commands.txt b/doc/script_commands.txt
index c346610..3ccd2de 100644
--- a/doc/script_commands.txt
+++ b/doc/script_commands.txt
@@ -8,6 +8,7 @@ This file is part of the CMaNGOS Project. See AUTHORS file for Copyright informa
## id
-- --------------------------
+dbscripts_on_areatrigger Areatrigger entry
dbscripts_on_creature_death Creature entry
dbscripts_on_creature_movement DB project self defined id
dbscripts_on_event Event id. Several sources: spell effect 61, taxi/transport nodes, gameobject_template data
@@ -84,6 +85,9 @@ Map coordinates for commands that need it.
## origin of script and source/target in scripts
-- --------------------------
+dbscripts_on_areatrigger
+ Areatrigger used
+ Source: player. Target: player
dbscripts_on_creature_death
Creature death
Source: creature. Target: Unit (player/creature)
diff --git a/sql/mangos.sql b/sql/mangos.sql
index 689fe66..4bb27f7 100644
--- a/sql/mangos.sql
+++ b/sql/mangos.sql
@@ -1515,7 +1515,7 @@ UNLOCK TABLES;
--
-- Table structure of `dbscripts_on_event`, `dbscripts_on_go_use`, `dbscripts_on_go_template_use`,
-- `dbscripts_on_gossip`, `dbscripts_on_quest_end`, `dbscripts_on_quest_start`,
--- `dbscripts_on_spell`, `dbscripts_on_creature_death`
+-- `dbscripts_on_spell`, `dbscripts_on_creature_death`, `dbscripts_on_areatrigger`
DROP TABLE IF EXISTS dbscripts_on_event;
CREATE TABLE dbscripts_on_event LIKE dbscripts_on_creature_movement;
DROP TABLE IF EXISTS dbscripts_on_go_use;
@@ -1532,6 +1532,8 @@ DROP TABLE IF EXISTS dbscripts_on_spell;
CREATE TABLE dbscripts_on_spell LIKE dbscripts_on_creature_movement;
DROP TABLE IF EXISTS dbscripts_on_creature_death;
CREATE TABLE dbscripts_on_creature_death LIKE dbscripts_on_creature_movement;
+DROP TABLE IF EXISTS dbscripts_on_areatrigger;
+CREATE TABLE dbscripts_on_areatrigger LIKE dbscripts_on_creature_movement;
--
-- Table structure for table `disenchant_loot_template`
diff --git a/src/game/MiscHandler.cpp b/src/game/MiscHandler.cpp
index ae1f800..5559b88 100644
--- a/src/game/MiscHandler.cpp
+++ b/src/game/MiscHandler.cpp
@@ -42,6 +42,7 @@
#include "Pet.h"
#include "SocialMgr.h"
#include "DBCEnums.h"
+#include "ScriptMgr.h"
void WorldSession::HandleRepopRequestOpcode(WorldPacket& recv_data)
{
@@ -743,6 +744,9 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recv_data)
return;
}
+ // Start Areatrigger script
+ player->GetMap()->ScriptsStart(sAreaTriggerScripts, Trigger_ID, player, player);
+
// NULL if all values default (non teleport trigger)
AreaTrigger const* at = sObjectMgr.GetAreaTrigger(Trigger_ID);
if (!at)
diff --git a/src/game/ScriptMgr.cpp b/src/game/ScriptMgr.cpp
index 049cd72..ba8bfcc 100644
--- a/src/game/ScriptMgr.cpp
+++ b/src/game/ScriptMgr.cpp
@@ -43,6 +43,7 @@ ScriptMapMapName sEventScripts;
ScriptMapMapName sGossipScripts;
ScriptMapMapName sCreatureDeathScripts;
ScriptMapMapName sCreatureMovementScripts;
+ScriptMapMapName sAreaTriggerScripts;
INSTANTIATE_SINGLETON_1(ScriptMgr);
@@ -823,6 +824,18 @@ void ScriptMgr::LoadCreatureDeathScripts()
}
}
+void ScriptMgr::LoadAreaTriggerDBScripts()
+{
+ LoadScripts(sAreaTriggerScripts, "dbscripts_on_areatrigger");
+
+ // check ids
+ for (ScriptMapMap::const_iterator itr = sAreaTriggerScripts.second.begin(); itr != sAreaTriggerScripts.second.end(); ++itr)
+ {
+ if (!sObjectMgr.GetAreaTrigger(itr->first))
+ sLog.outErrorDb("Table `dbscripts_on_areatrigger` has not existing areatrigger (Entry: %u) as script id", itr->first);
+ }
+}
+
void ScriptMgr::LoadDbScriptStrings()
{
sObjectMgr.LoadMangosStrings(WorldDatabase, "db_script_string", MIN_DB_SCRIPT_STRING_ID, MAX_DB_SCRIPT_STRING_ID, true);
@@ -842,6 +855,7 @@ void ScriptMgr::LoadDbScriptStrings()
CheckScriptTexts(sGossipScripts, ids);
CheckScriptTexts(sCreatureDeathScripts, ids);
CheckScriptTexts(sCreatureMovementScripts, ids);
+ CheckScriptTexts(sAreaTriggerScripts, ids);
sWaypointMgr.CheckTextsExistance(ids);
diff --git a/src/game/ScriptMgr.h b/src/game/ScriptMgr.h
index ffae118..37efbb4 100644
--- a/src/game/ScriptMgr.h
+++ b/src/game/ScriptMgr.h
@@ -443,6 +443,7 @@ extern ScriptMapMapName sEventScripts;
extern ScriptMapMapName sGossipScripts;
extern ScriptMapMapName sCreatureDeathScripts;
extern ScriptMapMapName sCreatureMovementScripts;
+extern ScriptMapMapName sAreaTriggerScripts;
enum ScriptLoadResult
{
@@ -467,6 +468,7 @@ class ScriptMgr
void LoadGossipScripts();
void LoadCreatureDeathScripts();
void LoadCreatureMovementScripts();
+ void LoadAreaTriggerDBScripts();
void LoadDbScriptStrings();
diff --git a/src/game/World.cpp b/src/game/World.cpp
index 660c776..f9eab60 100644
--- a/src/game/World.cpp
+++ b/src/game/World.cpp
@@ -1331,6 +1331,7 @@ void World::SetInitialWorldSettings()
sScriptMgr.LoadGameObjectTemplateScripts(); // must be after load Creature/Gameobject(Template/Data)
sScriptMgr.LoadEventScripts(); // must be after load Creature/Gameobject(Template/Data)
sScriptMgr.LoadCreatureDeathScripts(); // must be after load Creature/Gameobject(Template/Data)
+ sScriptMgr.LoadAreaTriggerDBScripts();
sLog.outString(">>> Scripts loaded");
sLog.outString();
|
Last call for the dbscripts_on_areatrigger: |
Of course add. What work disappear, can through them will be easier even script writing. In some cases. |
Did you actually test this, or are you just trolling...? 😟 |
They are a few quests tied it again - for example the Firelord, which I finally finished, but no one before and do not care. Also in the intro Alizabal Baradin Hold. ('5586901','55869','10','0','100','6','0','45','0','0','1','-55','0','0','0','0','0','0','0','0','0','0','Alizabal - Yell Intro'), Will need to replace it) |
You didn't understand how scripts work... In order to trigger a dbscript for area trigger I would need to add a condition system that will only start the script if player has a certain quest, or if the script isn't already completed inside the given instance. From my point of view I consider this patch incomplete, and in the current situation it won't be pushed to master any time soon. |
CONDITION_COMPLETED_ENCOUNTER (Handling is in spell.cpp and unit.cpp) |
I'm not saying it's not possible. But the current patch doesn't support that. |
I already offered a few patches on the forum are and what is the result? Disclaimer. Give an example of why it is needed and then maybe add examples also provided, but it did not help. |
I appreciate that you submitted patches on the forum, but those patches are for DB, mostly for Cata-DB.
There are many examples. You can't do that currently, and since you can't do that we either need to develop a way for this to happen or drop the whole concept of dbscripts_on_at. |
And so why limit the base functionality? Why so serious to rely on SD2? I understand there is a script instance - but it is not done in the database) without serious hacking. |
@xfurry : I tested yesterday your patch for dbscripts_on_areatrigger support (really sorry for the delay). I tested it with a DBscripts version of what was discussed here: http://cmangos.net/thread-6754.html It worked nicely. The current DBscripts commands may need some adjustements for this specific script like SCRIPT_COMMAND_TERMINATE_SCRIPT currently not supporting "creature is dead but not despawned". Script is pasted below. -- Added areatrigger script for spawning 3 Hive'Ashi Drones
-- when entering tower in Southwind Village in Silithus
-- Thanks Xfurry for his core patch
DELETE FROM `dbscripts_on_areatrigger` WHERE `id` = 3146;
INSERT INTO `dbscripts_on_areatrigger` VALUES
(3146, 0, 31, 13136, 35, 0, 0, 0 | 0x08, 0, 0, 0, 0, 0, 0, 0, 0, ''),
(3146, 1, 10, 13136, 180000, 0, 0, 0, 0, 0, 0, 0, -7185.94, 443.29, 26.59, 4.8458, 'Hive\'Ashi Drones spawn 1'),
(3146, 1, 10, 13136, 180000, 0, 0, 0, 0, 0, 0, 0, -7180.59, 441.33, 26.68, 4.1798, 'Hive\'Ashi Drones spawn 2'),
(3146, 1, 10, 13136, 180000, 0, 0, 0, 0, 0, 0, 0, -7176.63, 437.42, 26.84, 3.9348, 'Hive\'Ashi Drones spawn 3'); |
@cala thanks for feedback! One issue that I faced on the design of the dbscripts_on_at is how to ensure the unique script runtime. I'm thinking that we need to add SCRIPT_EXEC_PARAM_UNIQUE_BY_SOURCE as a parameter. |
Respected @xfurry, I hope you will not mind if I'm here, too, is placed. commit 0d707819f10eda4aa191439b74841b66e7f1cea2
Author: FollowerAI <FollowerAI@cataclysm.com>
Date: Fri Jun 12 15:40:12 2015 +0600
diff --git a/commit-8250561 b/commit-8250561
new file mode 100644
index 0000000..4b6ff35
--- /dev/null
+++ b/commit-8250561
@@ -0,0 +1,136 @@
+commit 8250561ac71127fd12bf54eb1e751cbaa5f775f0
+Author: FollowerAI <FollowerAI@cataclysm.com>
+Date: Fri Jun 12 15:32:57 2015 +0600
+
+ Script command for request various issue (Also can used in Cataclysm quests) and expands Send AI Event List for EAI and db_script system (also for require).
+
+diff --git a/src/game/ScriptMgr.cpp b/src/game/ScriptMgr.cpp
+index 622516d..815b369 100644
+--- a/src/game/ScriptMgr.cpp
++++ b/src/game/ScriptMgr.cpp
+@@ -733,6 +733,14 @@ void ScriptMgr::LoadScripts(ScriptMapMapName& scripts, const char* tablename)
+ }
+ break;
+ }
+ case SCRIPT_COMMAND_RESPAWN_SELF: // 39
+ break;
+ case SCRIPT_COMMAND_FOLLOW: // 40
+ break;
+ case SCRIPT_COMMAND_SET_FLY: // 41
+ break;
+ case SCRIPT_COMMAND_SEND_AI_EVENT_TARGET: // 42
+ break;
+ default:
+ {
+ sLog.outErrorDb("Table `%s` unknown command %u, skipping.", tablename, tmp.command);
+@@ -1959,6 +1967,58 @@ bool ScriptAction::HandleScriptStep()
+ MailDraft(m_script->sendMail.mailTemplateId).SendMailTo(static_cast<Player*>(pTarget), sender, MAIL_CHECK_MASK_HAS_BODY, deliverDelay);
+ break;
+ }
+ case SCRIPT_COMMAND_RESPAWN_SELF: // 39
+ {
+ // TODO - Remove this check after a while
+ if (pTarget && pTarget->GetTypeId() != TYPEID_UNIT && pSource && pSource->GetTypeId() == TYPEID_UNIT)
+ {
+ sLog.outErrorDb("DB-SCRIPTS: Process table `%s` id %u, command %u target must be creature, but (only) source is, use data_flags to fix", m_table, m_script->id, m_script->command);
+ pTarget = pSource;
+ }
+
+ if (LogIfNotCreature(pTarget))
+ break;
+
+ ((Creature*)pTarget)->Respawn(m_script->respawn.respawn);
+
+ break;
+ }
+ case SCRIPT_COMMAND_FOLLOW: // 40
+ {
+ if (LogIfNotCreature(pSource))
+ break;
+ if (LogIfNotUnit(pTarget))
+ break;
+
+ Creature* pFollower = static_cast<Creature*>(pSource);
+ Unit* unitTarget = static_cast<Unit*>(pTarget);
+
+ pFollower->GetMotionMaster()->MoveFollow(unitTarget, Distance, Angle);
+
+ break;
+ }
+ case SCRIPT_COMMAND_FLY: // 41
+ {
+ if (LogIfNotCreature(pSource))
+ return false;
+ if (m_script->setFly.setFly)
+ ((Creature*)pSource)->SetByteValue(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_FLY_ANIM);
+ ((Creature*)pSource)->SetLevitate(true);
+ else
+ ((Creature*)pSource)->RemoveByteValue(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_FLY_ANIM);
+ ((Creature*)pSource)->SetLevitate(false);
+ break;
+ }
+ case SCRIPT_COMMAND_SEND_AI_EVENT_TARGET: // 42
+ {
+ if (LogIfNotCreature(pSource))
+ return false;
+ if (LogIfNotUnit(pTarget))
+ break;
+
+ ((Creature*)pSource)->AI()->SendAIEvent(AIEventType(m_script->sendAIEvent.eventType), pActionInvoker,(Unit*)pTarget, miscValue);
+ break;
+ }
+ default:
+ sLog.outErrorDb(" DB-SCRIPTS: Process table `%s` id %u, command %u unknown command used.", m_table, m_script->id, m_script->command);
+ break;
+diff --git a/src/game/ScriptMgr.h b/src/game/ScriptMgr.h
+index 9b5069c..ea66d1c 100644
+--- a/src/game/ScriptMgr.h
++++ b/src/game/ScriptMgr.h
+@@ -117,6 +117,16 @@ enum ScriptCommand // resSource, resTar
+ // datalong: Send mailTemplateId from resSource (if provided) to player resTarget
+ // datalong2: AlternativeSenderEntry. Use as sender-Entry
+ // dataint1: Delay (>= 0) in Seconds
+ SCRIPT_COMMAND_RESPAWN_SELF = 39, // resSource = WorldObject, resTarget = Creature.
+ SCRIPT_COMMAND_FOLLOW = 40, // resSource = Creature, resTarget Player/Creature.
+ // datalong= 0: distance follow 1: angle follow.
+ SCRIPT_COMMAND_FLY = 41, // resSource = Creature.
+ // datalong = 0: remove levitate 1: set levitate.
+ SCRIPT_COMMAND_SEND_AI_EVENT_TARGET = 42, // resSource = Creature, resTarget = Unit. Also allow Send AI Event Creature Guid Target (Likely BUDDY_BY_GUID flag). Not only MAXIMAL_AI_EVENT_EVENTAI.
+ // datalong = AIEventType
+ // datalong2 = empty.
+ // SCRIPT_COMMAND_START_FOLLOW = 43, // resSource = Creature, resTarget = Player.
+ // datalong = 0: set faction for escort 1: QuestId. Start Follow for Player on example quest_start_scripts.
+ };
+
+ #define MAX_TEXT_ID 4 // used for SCRIPT_COMMAND_TALK, SCRIPT_COMMAND_EMOTE, SCRIPT_COMMAND_CAST_SPELL, SCRIPT_COMMAND_TERMINATE_SCRIPT
+@@ -363,6 +373,30 @@ struct ScriptInfo
+ uint32 mailTemplateId; // datalong
+ uint32 altSender; // datalong2;
+ } sendMail;
+
+ struct // SCRIPT_COMMAND_RESPAWN_SELF (39)
+ {
+ uint32 empty; // datalong
+ uint32 empty; // datalong2
+ } respawn;
+
+ struct // SCRIPT_COMMAND_FOLLOW (40)
+ {
+ uint32 Distance; // datalong
+ uint32 Angle; // datalong2
+ } moveFollow;
+
+ struct // SCRIPT_COMMAND_FLY (41)
+ {
+ uint32 setFly; // datalong
+ uint32 empty; // datalong2
+ } setFly;
+
+ struct // SCRIPT_COMMAND_SEND_AI_EVENT_TARGET (42)
+ {
+ uint32 eventType; // datalong
+ uint32 empty; // datalong2
+ } sendAIEvent;
+
+ struct
+ {
diff --git a/src/game/CreatureAI.cpp b/src/game/CreatureAI.cpp
index 2731113..e5b8a4d 100644
--- a/src/game/CreatureAI.cpp
+++ b/src/game/CreatureAI.cpp
@@ -219,7 +219,7 @@ void CreatureAI::SendAIEventAround(AIEventType eventType, Unit* pInvoker, uint32
std::list<Creature*> receiverList;
// Allow sending custom AI events to all units in range
- if (eventType == AI_EVENT_CUSTOM_EVENTAI_A || eventType == AI_EVENT_CUSTOM_EVENTAI_B)
+ if (eventType == AI_EVENT_CUSTOM_EVENTAI_A || eventType == AI_EVENT_CUSTOM_EVENTAI_B || eventType == AI_EVENT_CUSTOM_EVENTAI_C || eventType == AI_EVENT_CUSTOM_EVENTAI_D || eventType == AI_EVENT_CUSTOM_EVENTAI_E || eventType == AI_EVENT_CUSTOM_EVENTAI_F || eventType == AI_EVENT_CUSTOM_EVENTAI_G || eventType == AI_EVENT_CUSTOM_EVENTAI_H || eventType == AI_EVENT_CUSTOM_EVENTAI_I || eventType == AI_EVENT_CUSTOM_EVENTAI_K || eventType == AI_EVENT_CUSTOM_EVENTAI_L || eventType == AI_EVENT_CUSTOM_EVENTAI_M)
{
MaNGOS::AnyUnitInObjectRangeCheck u_check(m_creature, fRadius);
MaNGOS::CreatureListSearcher<MaNGOS::AnyUnitInObjectRangeCheck> searcher(receiverList, u_check);
diff --git a/src/game/CreatureAI.h b/src/game/CreatureAI.h
index 9bbb2df..9f25375 100644
--- a/src/game/CreatureAI.h
+++ b/src/game/CreatureAI.h
@@ -70,10 +70,20 @@ enum AIEventType
AI_EVENT_CUSTOM_EVENTAI_A = 5, // Sender = Npc that throws custom event, Invoker = TARGET_T_ACTION_INVOKER (if exists)
AI_EVENT_CUSTOM_EVENTAI_B = 6, // Sender = Npc that throws custom event, Invoker = TARGET_T_ACTION_INVOKER (if exists)
AI_EVENT_GOT_CCED = 7, // Sender = CCed Npc, Invoker = Caster that CCed
- MAXIMAL_AI_EVENT_EVENTAI = 8,
+ AI_EVENT_CUSTOM_EVENTAI_C = 8, // Sender = Npc that throws custom event, Invoker = TARGET_T_ACTION_INVOKER (if exists)
+ AI_EVENT_CUSTOM_EVENTAI_D = 9, // Sender = Npc that throws custom event, Invoker = TARGET_T_ACTION_INVOKER (if exists)
+ AI_EVENT_CUSTOM_EVENTAI_E = 10, // Sender = Npc that throws custom event, Invoker = TARGET_T_ACTION_INVOKER (if exists)
+ AI_EVENT_CUSTOM_EVENTAI_F = 11, // Sender = Npc that throws custom event, Invoker = TARGET_T_ACTION_INVOKER (if exists)
+ AI_EVENT_CUSTOM_EVENTAI_G = 12, // Sender = Npc that throws custom event, Invoker = TARGET_T_ACTION_INVOKER (if exists)
+ AI_EVENT_CUSTOM_EVENTAI_H = 13, // Sender = Npc that throws custom event, Invoker = TARGET_T_ACTION_INVOKER (if exists)
+ AI_EVENT_CUSTOM_EVENTAI_I = 14, // Sender = Npc that throws custom event, Invoker = TARGET_T_ACTION_INVOKER (if exists)
+ AI_EVENT_CUSTOM_EVENTAI_K = 15, // Sender = Npc that throws custom event, Invoker = TARGET_T_ACTION_INVOKER (if exists)
+ AI_EVENT_CUSTOM_EVENTAI_L = 16, // Sender = Npc that throws custom event, Invoker = TARGET_T_ACTION_INVOKER (if exists)
+ AI_EVENT_CUSTOM_EVENTAI_M = 17, // Sender = Npc that throws custom event, Invoker = TARGET_T_ACTION_INVOKER (if exists)
+ MAXIMAL_AI_EVENT_EVENTAI = 18,
// Internal Use
- AI_EVENT_CALL_ASSISTANCE = 10, // Sender = Attacked Npc, Invoker = Enemy
+ AI_EVENT_CALL_ASSISTANCE = 19, // Sender = Attacked Npc, Invoker = Enemy
// Predefined for SD2
AI_EVENT_START_ESCORT = 100, // Invoker = Escorting Player
|
FollowerAI: you are Ulduar no? |
No, I am a person, not the instance. |
I think he was asking you if you are the same person as the user Ulduar, which just deleted his profile a few weeks ago. 😄 But I think this already answers the question |
So, I see me alone you have left no. @FollowerAI - they will not accept your patch. I've tried, believe me - nothing happened. |
SCRIPT_COMMAND_RESPAWN_SELF: -> this is ok. |
@Ulduar I didn't reject anything. Some of the proposals are good but they are not perfect, so I simply didn't have the time to improve them and to push to master. |
Okay.
With me you never said.
A not required.
Why should?
Send AI Event creature guid target. Using buddy_guid.
five will be enough! Here I agree.
Reqired only in Cataclysm. @Ulduar: |
It's time for me to contribute.
It is high time be added.
In IRC you talking to me, not with FollowerAI.
Aggro / Evade not a hindrance. Add, and I'll show you why.
Dragon Soul intro event - db_script_on_creature_death http://www.wowhead.com/npc=57160/ancient-water-lord
What other changes? SetByteValue there is, SetLevitate there is.
When there is a creature guid, but having the same entry. P.S: I do not like to discuss the IRC, We never once reached a common denominator. |
+ SCRIPT_COMMAND_FLY = 41, // resSource = Creature.
+ // datalong = 0: remove levitate 1: set levitate.
+ SCRIPT_COMMAND_SEND_AI_EVENT_TARGET = 42, // resSource = Creature, resTarget = Unit. Also allow Send AI Event Creature Guid Target (Likely BUDDY_BY_GUID flag). Not only MAXIMAL_AI_EVENT_EVENTAI.
+ // datalong = AIEventType
+ // datalong2 = empty. these 2 ... i would like to see in wotlk ;) |
You do not misunderstand me - I am grateful for your work! Thank you!
db script I use myself.
This question has already been. I'm trying to add features from there because they have their own examples to add.
I know, I've used it many times where this was possible. For example you can see scriptdev2/scriptdev2-cata#4
I myself love this system! Very like. @Schmoozerd Thank you.
Of course not. Throne of the Four Winds for example require full SD2, no EAI, no db_script there to help in any way. Very complex scenarios.
You can read topic http://cmangos.net/thread-590.html
Thanks, regards.
I know I'm trying to help the project than I can. From the outside it seems like something I require on the fact it is not. |
So, after so much time I managed to come up with a reasonable proposal of script commands that were requested and that we need. Kindly let me know your feedback (on the proposed commands only!) and if there are no major drawbacks I can push this to the core this week. |
What it is? Why only GO_JUST_DEACTIVATED. Maybe GAMEOBJECT_BYTES_1_SCRIPT_COMMAND It will be more effective? This will select Go State, Go Loot State and so on.
For Cataclysm useless, need additionally SetByteValue(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_FLY_ANIM);
Why missing?
You to explained that it was not a problem.
Why missing? |
If you read the comment, you'll see that this is a temporary issue. But GO_JUST_DEACTIVATED will do just fine for now.
I'm not 100% sure. Some creatures need this, others don't.
This is complicated. Will investigate later.
This is not missing. I expanded this list with 4 more events. This should be enough for the moment. However I think you missed the whole point of my comment. |
hey @xfurry |
Thanks @xfurry, that sounds very nice ! I'm afar this WE but I will test this the coming week and report back! 👍 |
Ok, so I can see that the buddy system doesn't allow us to use dead buddies. I need to see what we can do about this. The Fly command is wrong on my side. I will come up with an update on this. |
I told you about this a long time ago. |
Sorry for the late reply: I confirm @Grz3s results. |
I think I remember now... |
Here is the updated version: http://paste2.org/b1xfseIB |
hey @xfurry .. i just came back from my 2 weeks holliday..I'll look at this ASAP. |
I'll also look at it ASAP but I'm leaving to holidays next week, so I can't promise full testing. Regarding the flag, I have no clear opinion on the matter since no example comes to my mind. I would say that separated is better.
|
Will open a new topic about that. We might need to add some extra data_flag to target dead creatures. |
hey @xfurry
-- TESTS for new command 40 - DESPAWN OBJECT
DELETE FROM dbscripts_on_creature_movement WHERE id = 2140904;
INSERT INTO dbscripts_on_creature_movement (id, delay, command, datalong, datalong2, buddy_entry, search_radius, data_flags, dataint, dataint2, dataint3, dataint4, x, y, z, o, comments) VALUES
(2140904,1,28,8,0,0,0,0,0,0,0,0,0,0,0,0,'STATE_KNEEL'),
(2140904,6,0,2,0,0,0,0,2000005488,0,0,0,0,0,0,0,''),
(2140904,7,25,0,0,0,0,0,0,0,0,0,0,0,0,0,'RUN OFF'),
-- echo.TEST ON
(2140904,7,40,0,0,184798,50,7,0,0,0,0,0,0,0,0,'despawn object'),
-- echo.TEST OFF
(2140904,8,28,0,0,0,0,0,0,0,0,0,0,0,0,0,'STATE_STAND');
-- TESTS for new command 39 - FLY
DELETE FROM dbscripts_on_creature_movement WHERE id IN (2840602,2840603);
INSERT INTO dbscripts_on_creature_movement (id, delay, command, datalong, datalong2, buddy_entry, search_radius, data_flags, dataint, dataint2, dataint3, dataint4, x, y, z, o, comments) VALUES
(2840602,1,24,26308,0,0,0,0x08,0,0,0,0,0,0,0,0,'mount'),
-- echo.TEST ON -- levitate
(2840602,2,39,1,0,0,0,0,0,0,0,0,0,0,0,0,'fly ON'),
(2840603,2,39,0,0,0,0,0,0,0,0,0,0,0,0,0,'fly OFF'),
-- echo.TEST OFF
-- echo.TEST ON -- fly
-- (2840602,2,39,1,0,0,0,0x08,0,0,0,0,0,0,0,0,'ignore pathfinding ON'),
-- (2840603,2,39,0,0,0,0,0x08,0,0,0,0,0,0,0,0,'ignore pathfinding OFF'),
-- echo.TEST OFF
(2840603,3,24,0,0,0,0,0x08,0,0,0,0,0,0,0,0,'unmount'); 👍 |
So, let me understand: we don't need that ignore pathfinding option? |
if u'll explain what this should do..(or what will not work without it) than i can tell you.. :).. |
Well, technically, that flag should make the creature not use the move maps. Sometimes flying creatures have issues on this. |
@Grz3s here is a proposal for respawn command: http://paste2.org/GFZ9jJOt |
Hi guys :) @xfurry nice patches, please add a little bit more documentation to hte SEND_AI_EVENT command (to be clear to the user about sender, invoker and receiver) For the second patch, i have one concern: be sure the database fields for the data_flags are big enough for 0x80-1 |
Hi @Schmoozerd Since you are here, maybe you would also have some thoughts on #260 😁 |
I thought that i explained all on irc.. BTW: 40 SCRIPT_COMMAND_DESPAWN_GO -- cannot be used on gobjects Type=1 buttons ...(command doesnt work on them - they shouldnt despawn at all - and thats correct ;) 41 SCRIPT_COMMAND_RESPAWN_SELF: (your second patch - not above one)
|
@xfurry : I tested your latest patch this evening. Both FLY and DESPAWN GO commands are working very well (tested on WotLK core), as said Grz3s. Very good job. 👍 |
Why closed? Although already unimportant |
SCRIPT_COMMAND_SET_FLY - enable / disable levitate SCRIPT_COMMAND_DESPAWN_GO - despawn a gameobject SCRIPT_COMMAND_RESPAWN - respawn a dead or despawned creature. Requires SCRIPT_FLAG_BUDDY_IS_DESPAWNED in order to target dead or despawned creatures Also add additional custom events for eventAI Thanks to @Grz3s, @cala, @Ulduar and @Schmoozerd for feedback Close cmangos/issues#409 (based on commits [12899] - c25f772 and [12902] - 16191d4) Signed-off-by: evil-at-wow <evil.at.wow@gmail.com>
SCRIPT_COMMAND_SET_FLY - enable / disable levitate SCRIPT_COMMAND_DESPAWN_GO - despawn a gameobject SCRIPT_COMMAND_RESPAWN - respawn a dead or despawned creature. Requires SCRIPT_FLAG_BUDDY_IS_DESPAWNED in order to target dead or despawned creatures Also add additional custom events for eventAI Thanks to @Grz3s, @cala, @Ulduar and @Schmoozerd for feedback Close cmangos/issues#409 (based on commits [12899] - c25f772 and [12902] - 16191d4) Signed-off-by: evil-at-wow <evil.at.wow@gmail.com> (based on commit [s2321] - 6a77e69) Signed-off-by: Cala <calaftp@free.fr>
Hi,
During the last couple of weeks I received a few requests for improvements on the script engine.
I will post all the requested patches here, so everyone can share the feedback and input before I commit them to master.
1 Script Command Modify Unit Flags
This was requested by @Grz3s and allows changing the unit flag of a creature from DB scripts.
2 Allow DBscripts_on_spell to run for missing triggered missile spells.
Also requested by @Grz3s. The only problem with this one is that the error still appears even if the dbscript runs fine.
3 Add condition Creature_in_range. This was requested by @Schmoozerd in this thread: scriptdev2/scriptdev2#93
4 The last feature allows AI event sending to all units, not only to those which are able to assist. This will make interaction between not friendly units, or not selectable units more easy. Feature requested by @Ulduar
As I said in the beginning, please share your feedback on these improvements.
The text was updated successfully, but these errors were encountered: