Throwing shoe spell
#1
Posté 30 janvier 2013 - 12:54
I made the item that is able to cast such spell(throwing shoe), but I'm unable to effectively script applying sleep effect upon impact of the shoe.
Tried editing 2da to make it apply custom "sleep" script upon impact, but didn't know how to proceed further - Lilac Soul's generator does not seem to have succh option. It can't be heartbeat, because it will effectively be during the fight with said NPC.
Would you be able to help me?
#2
Posté 30 janvier 2013 - 01:25
Post what you have so far, and I and I am sure others will take a look.
In terms of general strategy for tackling this however I recommend looking at the sleep spell because it appears to me that you are essentially creating a version of an item activated sleep spell.
#3
Posté 30 janvier 2013 - 01:47
void main()
{
object oPC;
if ((GetObjectType(GetItemActivatedTarget())!=OBJECT_TYPE_CREATURE)
){
SendMessageToPC(GetItemActivator(), "Improper use of item!");
return;}
object oTarget;
oTarget = GetItemActivatedTarget();
effect eEffect;
eEffect = EffectSleep();
eEffect = SupernaturalEffect(eEffect);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eEffect, oTarget);
}
and edited spells.2da lines:
1501 Throwing_Shoe_Male 7479 is_ccc_shoe01 V M s **** 0x3e sleep **** **** **** **** **** **** 3 1500 hand **** **** **** **** **** **** up 1000 **** **** **** **** 1 it_thr_shoe01 ballistic hand spr_los path **** 0 **** **** **** **** **** 2 **** 4 **** 0 0 **** 0 **** **** **** 1
1502 Throwing_Shoe_Fem 7476 is_ccc_shoe02 V M s **** 0x3e sleep **** **** **** **** **** **** 3 1500 hand **** **** **** **** **** **** up 1000 **** **** **** **** 1 it_thr_shoe02 ballistic hand spr_los path **** 0 **** **** **** **** **** 2 **** 4 **** 0 0 **** 0 **** **** **** 1
the column with "sleep" is the one I changed from the ccc original 2da
I have an item(Shoe of Throwing) with one-shot spell "Right foot" that corresponds to the 1502 2da line.
Modifié par werelynx, 30 janvier 2013 - 01:56 .
#4
Posté 30 janvier 2013 - 03:02

Try these on and tell me how they fit.
I treated the shoes as grenades, shoe bombs if you will. Two grenade items are in the ERF, with a spell. The 2das are included for your use as is the HAK and a Module to try them out. All the shoe resources are in the HAK. Or you can use the CCC hak. Your choice. But the 2DAs I gave you need to be in a top hak in your module.
Modifié par henesua, 30 janvier 2013 - 03:07 .
#5
Posté 30 janvier 2013 - 05:46
Funky
#6
Posté 30 janvier 2013 - 07:44
THANKS!
#7
Posté 30 janvier 2013 - 08:49
With regards to the little spell script I put together. Feel free to modify. The VFX_IMP_HEAD_SONIC may be a bit much. And notice that I made crits with a shoe particularly difficult to save against. They put you to sleep for 10 rounds as well.
You'll notice that all of that can be adjusted at the top of the main(). Just change the values in the variables nDC and nDuration. If you have questions, ask away.
[edit] I just realized... I might not have put the sleeping VFX on thsoe that got knocked out. That will need to be remedied. Let me know if you need this revised or if you can handle that change.
Modifié par henesua, 30 janvier 2013 - 09:30 .
#8
Posté 31 janvier 2013 - 03:21
The effect is now a stun. The duration VFX is the disabled one that goes with a stun. Targets play various animations at random for the different possibilities: dodges, spasms, taunts, flops etc...
I like this one much better. Very diverting.
Modifié par henesua, 31 janvier 2013 - 03:21 .
#9
Posté 31 janvier 2013 - 09:01
Oh and I added "Boot to the head!" line spoken by PC after each throw.
Of course I will credit Estelinda! Just do not know how to include her alias in the module, yet. (S)he is already in the readme.
#10
Posté 31 janvier 2013 - 09:14
#11
Posté 31 janvier 2013 - 11:38
Estelindis, you are missed here. Those shoes are a fun addition to the game. I hadn't played with them before. I wish you still slummed it with us and churned out your goodies in the CCC.
I wonder if you could be tempted to join us for a module building challenge. Care to join us?
#12
Posté 03 février 2013 - 04:41
#13
Posté 04 février 2013 - 10:13
Well.
Now that my NPCs are sleeping I would like to wake them. I made a script with Lilac and put it on the lever's OnClick (OnUsed was already, well used).
oTarget = GetObjectByTag("Mistress");
effect eEffect;
eEffect = GetFirstEffect(oTarget);
while (GetIsEffectValid(eEffect))
{
if (GetEffectType(eEffect)==EFFECT_TYPE_SLEEP) RemoveEffect(oTarget, eEffect);
eEffect = GetNextEffect(oTarget);
}
The problem is it does not work
I made sleep a supernaturaleffect - could that be the culprit?
Anyway I hope you would try to make some modules with us. Even such a clumsy and nooby scripter/builder as I have tried.
Modifié par werelynx, 04 février 2013 - 10:14 .
#14
Posté 05 février 2013 - 07:04
So:
(GetEffectType(eEffect) == SUBTYPE_SUPERNATURAL)
Modifié par ffbj, 05 février 2013 - 07:08 .
#15
Posté 05 février 2013 - 07:07
in your loop instead of checking for the sleep effect, check which spell applied the effect, and remove every effect created by the spell.
#16
Posté 05 février 2013 - 07:23
#17
Posté 05 février 2013 - 08:26
The code I'm going to test:
oTarget = GetObjectByTag("Mistress");
effect eEffect;
eEffect = GetFirstEffect(oTarget);
while (GetIsEffectValid(eEffect))
{
if (GetEffectType(eEffect) == SUBTYPE_SUPERNATURAL) RemoveEffect(oTarget, eEffect);
eEffect = GetNextEffect(oTarget);
}
I can't understand how to do it Henesua style
GetHasSpellEffect : I do not know how to call the spell in this, the link in the description points only to visual effects.
Off to test it.
Modifié par werelynx, 05 février 2013 - 08:56 .
#18
Posté 05 février 2013 - 09:14
Edit: It makes me wonder though: If effect is normal, then it could be removed by sleeping(at least that's what Lilac says). So the sleep effect can be removed by sleeping.
Lilac should have written "by resting"
Modifié par werelynx, 05 février 2013 - 09:19 .
#19
Posté 05 février 2013 - 09:21
GetEffectSpellId
Use that function to determine whether the shoe spell created the effect within your loop
Modifié par henesua, 05 février 2013 - 09:21 .
#20
Posté 05 février 2013 - 09:38
effect eEffect;
eEffect = GetFirstEffect(oTarget);
while (GetIsEffectValid(eEffect))
{
if (GetEffectSpellId(eEffect)>1500) RemoveEffect(oTarget, eEffect);
eEffect = GetNextEffect(oTarget);
}
Would this do? Boot spells are 1501 and 1502 in my spells.2da
Edit: Nah, it didn't work. What's exactly the Id of a spell?
Modifié par werelynx, 05 février 2013 - 09:51 .
#21
Posté 05 février 2013 - 09:52
werelynx wrote...
oTarget = GetObjectByTag("Tad");
effect eEffect;
eEffect = GetFirstEffect(oTarget);
while (GetIsEffectValid(eEffect))
{
if (GetEffectSpellId(eEffect)>1500) RemoveEffect(oTarget, eEffect);
eEffect = GetNextEffect(oTarget);
}
Would this do? Boot spells are 1501 and 1502 in my spells.2da
That is a bit messy, preventing you from adding more spells. Better practice would be:
oTarget = GetObjectByTag("Tad");
effect eEffect;
eEffect = GetFirstEffect(oTarget);
while (GetIsEffectValid(eEffect))
{
nSpellId = GetEffectSpellId(eEffect);
if (nSpellId==1500 || nSpellId==1501)
RemoveEffect(oTarget, eEffect);
eEffect = GetNextEffect(oTarget);
}
#22
Posté 05 février 2013 - 10:14
Or maybe I didn't copy it anywhere, hopefully this is the solution.
If not then 'my' (ABC very vague hint) NPCs will have to deal with their commas.
#23
Posté 05 février 2013 - 10:17
int nSpellId;
I meant to, but I'm also supposed to be working.
Also... compiling the script shoudl catch that error. Make sure you compile the script. At the least do a module build, and build your scripts.
Modifié par henesua, 05 février 2013 - 10:18 .
#24
Posté 05 février 2013 - 10:41
The code I used is:
object oTarget;
int nSpellId;
effect eEffect;
oTarget = GetObjectByTag("Tad");
eEffect = GetFirstEffect(oTarget);
while (GetIsEffectValid(eEffect))
{
if (GetEffectSpellId(eEffect)>1500) RemoveEffect(oTarget, eEffect);
eEffect = GetNextEffect(oTarget);
}
and so on for every critter's tag
Your code still wouldn't work. Dunno why. Just put two placeables: one with yours and one with above(remains of previous playtest)
Did not know that I can compile those, I was about to complain about not having a compiler that would show the errors.
By the way I hope you won't be angry when you see for what I did use this code. In any case I'm strengthening the security of my lair(by buying a lots of boots).
and last but not least:
THANK YOU FOR HELP :happy:!!!!
Modifié par werelynx, 05 février 2013 - 10:43 .
#25
Posté 05 février 2013 - 11:04
You should really set constants for your spells and put them in a central include. Little istakes like I made are difficult to track down. But if you have all of your custom spell and feat constants etc... in a central include it makes checking that the indexes are correct much easier.
Modifié par henesua, 05 février 2013 - 11:06 .





Retour en haut






