[Help/Question] How to create a lootable placeable (not container)
#1
Posté 21 novembre 2009 - 07:01
I've search but I have no clue where to begin.
#2
Guest_etfeet_*
Posté 21 novembre 2009 - 07:10
Guest_etfeet_*
#3
Posté 21 novembre 2009 - 07:11
(Note: i didnt test this, but i would assume it works.)
void main()
{
event ev = GetCurrentEvent();
int nEventType = GetEventType(ev);
switch (nEventType)
{
case EVENT_TYPE_USE:
{
MoveAllItems(OBJECT_SELF, GetHero());
Safe_Destroy_Object(OBJECT_SELF);
}
}
}
#4
Posté 21 novembre 2009 - 07:19
Trying now, appreciate it
Worked perfect, thanks
#include "wrappers_h"
void main()
{
event ev = GetCurrentEvent();
int nEventType = GetEventType(ev);
switch (nEventType)
{
case EVENT_TYPE_USE:
{
//MoveAllItems(OBJECT_SELF, GetHero());
AddCreatureMoney (1000000, GetHero(), TRUE);
Safe_Destroy_Object(OBJECT_SELF);
}
}
}
Modifié par NewYears1978, 21 novembre 2009 - 04:08 .
#5
Posté 21 novembre 2009 - 10:06
#6
Posté 21 novembre 2009 - 04:07
Quildra wrote...
I'd suggest you use SetObjectInteractive instead of destroy.
This only changes whether the item is usable though..I want the item to disappear..just like loot piles that are money or elfroots/deathroots...
Why did you suggest this? So I can learn the reasoning and your thoughts. Thanks!
#7
Posté 21 novembre 2009 - 04:49
#8
Posté 21 novembre 2009 - 07:33
Is there a reason not to use the destroy feature? As it seems to work fine and do what I intended? Just like to learn the proper methods
#9
Posté 21 novembre 2009 - 07:56
#10
Posté 21 novembre 2009 - 09:42
#11
Posté 22 novembre 2009 - 04:17
Modifié par Craig Graff, 22 novembre 2009 - 04:18 .
#12
Posté 22 novembre 2009 - 05:09
Craig Graff wrote...
If you wanted to use standard ressources you could achieve the same thing (though not destroying the placeable) simply by adding "_autoloot" to the end of the placeable's tag.
Pro tip! Will remember that one.
#13
Posté 22 novembre 2009 - 05:32
Craig Graff wrote...
If you wanted to use standard ressources you could achieve the same thing (though not destroying the placeable) simply by adding "_autoloot" to the end of the placeable's tag.
idd, simplified and complicated some stuff for my Auto Loot Mod - changing the tag and then reverting it etc... + some scripts check the tag and so on... + that "trick" only works on containers that aren't BodyBags, etc...
#14
Posté 23 novembre 2009 - 05:09
Craig Graff wrote...
If you wanted to use standard ressources you could achieve the same thing (though not destroying the placeable) simply by adding "_autoloot" to the end of the placeable's tag.
Great tip, thanks!





Retour en haut






