[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  SMAUG
. -> [Folder]  SMAUG coding
. . -> [Subject]  Adding custom spell on npc mob?
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Adding custom spell on npc mob?

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Oblisgr   (26 posts)  [Biography] bio
Date Sun 01 May 2016 10:01 PM (UTC)
Message
Is it possible to make the mob learn the same skills I have created for players?

For example i have created a spell named "slam" for warriors. It can be learned from level 1 and does some ammount of damage (with some boosting from player's attributes, mana % and move%).

I would like to add this spell to a warrior npc mob. I m using the "area editor" program but it doesnt support custom spells. (i think)

So i have to make it with code.
Any instructions please?

My first thought is to declare it in mud.h but then what?
Thanks in advance
[Go to top] top

Posted by Meerclar   USA  (733 posts)  [Biography] bio
Date Reply #1 on Tue 03 May 2016 04:24 AM (UTC)
Message
First thought is mobprog.
Second thought is spec_prog (ie, spec_fido or spec_janitor which I believe are both stock code)

Meerclar - Lord of Cats
Coder, Builder, and Tormenter of Mortals
Stormbringer: Rebirth
storm-bringer.org:4500
www.storm-bringer.org
[Go to top] top

Posted by Oblisgr   (26 posts)  [Biography] bio
Date Reply #2 on Tue 03 May 2016 07:25 PM (UTC)
Message
mobprog works.
The mob uses the skill but does not damage at all.
He utters the words but nothing happens.

Maybe because he cannot understand the spell?
Maybe he must know a % of the spell?
Maybe i have to set manually the desired damage in mobprog?
[Go to top] top

Posted by Meerclar   USA  (733 posts)  [Biography] bio
Date Reply #3 on Wed 04 May 2016 01:10 AM (UTC)
Message
Can't really troubleshoot that problem without code.

Meerclar - Lord of Cats
Coder, Builder, and Tormenter of Mortals
Stormbringer: Rebirth
storm-bringer.org:4500
www.storm-bringer.org
[Go to top] top

Posted by Oblisgr   (26 posts)  [Biography] bio
Date Reply #4 on Wed 04 May 2016 07:17 PM (UTC)
Message
mpdamage $n 5 5 fatal

this did the job in fight_prog.

I wander if there is a prog to emote something when the mob hits the player. If mob miss or the player dodges it will appear nothing.
[Go to top] top

Posted by Meerclar   USA  (733 posts)  [Biography] bio
Date Reply #5 on Thu 05 May 2016 03:16 AM (UTC)
Message
You can use mpecho(at/around if you want different messages for the victim and other chars in the room) to send messages with the attacks

While your solution does cause damage to the target, it doesn't actually solve the problem of the skill you were trying to use not damaging players when used by a mob.

Meerclar - Lord of Cats
Coder, Builder, and Tormenter of Mortals
Stormbringer: Rebirth
storm-bringer.org:4500
www.storm-bringer.org
[Go to top] top

Posted by Oblisgr   (26 posts)  [Biography] bio
Date Reply #6 on Thu 05 May 2016 07:20 AM (UTC)
Message
Eh ok i know. But still does the job.
I get skill text, i get a specific damage and ok.
Actually this is more cosmetic.

I used mpecho, with colors too ehehe
But still i want the message to appear when the mob succeeds to hit the player.

I i use fight_prog with 100 possibility it will appear the message i want every line even if the mod fails to hit the player. I read the docs and info from the internet, but i couldnt find anything. Not a prog nor an if statement.
[Go to top] top

Posted by Meerclar   USA  (733 posts)  [Biography] bio
Date Reply #7 on Thu 05 May 2016 04:10 PM (UTC)

Amended on Thu 05 May 2016 05:07 PM (UTC) by Meerclar

Message
The drawback to using mpdamage rather than actually fixing the skill so it works properly for mobs is that:
1) mpdamage never misses
2) mpecho is meant to be cosmetic
3) you didn't actually fix the problem
4) a 100% fight_prog is going off every round and is expected to execute any valid command it contains


As an added bonus, without being able to see either your custom skill code or your mprog we can't help you actually fix either of them to do what you're actually trying to do. That said, the simplest fix for your "slam" skill is probably to add an if check for pcs and an 'else' damage calculation that doesn't rely on pc attributes.

Meerclar - Lord of Cats
Coder, Builder, and Tormenter of Mortals
Stormbringer: Rebirth
storm-bringer.org:4500
www.storm-bringer.org
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


2,593 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]