Jump to content
  • 0

Run script (NPC) / or sound when using a skill


Arkwright

Question


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  3
  • Reputation:   2
  • Joined:  06/16/12
  • Last Seen:  

Well, I'm trying to put some voiceovers when using a skill, but do not quite understand the source, then come to you asking for help.

Let me give an example:

When a player uses the skill StormGust, while a sound to play the data folder on the client.

I thought of four ways:

1st - When the player the ability to use a script (NPC) was executed with the command to run the SOM. In the source there is a command that calls a script. Something like this:

struct npc_data* nd;

	nullpo_retr(-1, sd);

	switch(atoi(message)){
			case 1: nd = npc_name2id("CodeBuff"); break;
			case 2: nd = npc_name2id("CodeAnun"); break;
			case 3: nd = npc_name2id("CodeQuest"); break;
			case 4: nd = npc_name2id("CodeSom"); break;
	}

	if (nd == NULL){
			clif_displaymessage(fd,"...");
			return -1;
	}
	run_script(nd->u.scr.script, 0, sd->bl.id, nd->bl.id);
	return 0;
}

(I took this from a custom command, which when used, runs one of the scripts)

I do not know if you can use it in the structure of ability.

2nd - If, in any command that runs directly from a source media file.

3rd - A command similar to "OnPCKillEvent" but instead of running the code to kill, execute a code where when someone used a skill, perform the function. Something like: "OnSkillUsed."

4th - Create a new effect with the sound, but how?

Well I'm sorry my English. I used Google translate.

I'll be super grateful if someone help me. hugs.

Edited by Evanio
Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...