This is a read only copy without any forum functionality of the old Modcraft forum.
If there is anything that you would like to have removed, message me on Discord via Kaev#5208.
Big thanks to Alastor for making this copy!

Menu

Author Topic: [QUESTIONS] - Objects & Others  (Read 1406 times)

Krang Stonehoof

  • Contributors
  • Wiki Incarnate
  • *****
  • Posts: 164
    • View Profile
[QUESTIONS] - Objects & Others
« on: July 11, 2015, 09:12:17 pm »
Greetings,

I have a few questions:

Is it possible to spawn a permanent object using spells? For example, the default spell Campfire, it spawns the Campfire object but it lasts for a minute or so.

Is it possible to change the Trinity Core command .gob delete to delete a game object you are hovering mouse with? For example, you have your cursor on that campfire and when you type .gob delete to delete the campfire. Sorry for bad english, I'm doing my best.

Thanks.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Milly

  • Contributors
  • Creator of Worlds
  • *****
  • Posts: 503
    • View Profile
Re: [QUESTIONS] - Objects & Others
« Reply #1 on: July 11, 2015, 09:20:36 pm »
Quote from: "Krang Stonehoof"
Is it possible to spawn a permanent object using spells?

No, not permanent, but you can spawn them. Spend time exploring the Spell dbcs a little. Use a Basic Campfire as a template. Find where the DisplayID is defined and the length of the spawn. Then substitute your own data.

When spawning objects with spells, they actually function like map objects. So instead of disappearing at short render distances like gameobjects typically do, they never disapppear and you will never fall through them.

However they will disappear when you restart the server unless you modify the core I think. but Idk how


Quote from: "Krang Stonehoof"
Is it possible to change the Trinity Core command .gob delete to delete a game object you are hovering mouse with?.

Dunno, doubt it.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Skarn

  • Contributors
  • Creator of Worlds
  • *****
  • Posts: 807
    • View Profile
    • http://skarn-project.net
Re: [QUESTIONS] - Objects & Others
« Reply #2 on: July 11, 2015, 09:58:28 pm »
Check WAYWO thread, someone there was explaining how to make them permanent. Would require some spell code editing probably.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Krang Stonehoof

  • Contributors
  • Wiki Incarnate
  • *****
  • Posts: 164
    • View Profile
Re: [QUESTIONS] - Objects & Others
« Reply #3 on: July 12, 2015, 12:25:23 am »
I was thinking to make a Lua / C++ Script which change the DB Query from GameObjects every time. For example, it checks every minute if there are new entries into the Gameobject Table and change the duration to -1 to all, except the ones I don't want to be permanent.

Would that work?

But I cannot figure out which row holds the duration / make them permanent.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Rochet2

  • Contributors
  • Polygonshifter
  • *****
  • Posts: 59
    • View Profile
    • http://rochet2.github.io/
Re: [QUESTIONS] - Objects & Others
« Reply #4 on: July 12, 2015, 12:32:41 am »
Only already saved objects are in the database.

You should make it so that the default action is cancelled for the spell and then use the spell position and spawn a saved object there.
See the way objects are save spawned from .gob add command.
Many spell scripts work as an example for the spell script part.
You need to hook to the effect and call PreventDefaultAction() or similar function that is a member of the SpellScript class.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Krang Stonehoof

  • Contributors
  • Wiki Incarnate
  • *****
  • Posts: 164
    • View Profile
Re: [QUESTIONS] - Objects & Others
« Reply #5 on: July 12, 2015, 12:45:09 am »
Hmm, I'm really confused now.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Rochet2

  • Contributors
  • Polygonshifter
  • *****
  • Posts: 59
    • View Profile
    • http://rochet2.github.io/
Re: [QUESTIONS] - Objects & Others
« Reply #6 on: July 12, 2015, 03:22:16 pm »
Create this small script that works with the spell
http://www.wowhead.com/spell=62743/undercity-banner
as an example to save the spawned object to the database.
https://gist.github.com/Rochet2/d6212b5a2289eeac2d56

What it does?
It stops the default behavior and uses the spell's data to make a permanent spawn.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »