Skip to content

[Mod] Create Projectile at Mouse

CloudHopper edited this page Aug 14, 2011 · 2 revisions

What does this do?

You've probably seen the projectile ID list on the wiki before. Ever wanted to use it without making changes every time? Here's some simple code to do that.

Usage:

/fire [projectile id]

Problems:

Changing the damage usually doesn't work server-side, and this also goes for changing the damage of weapons on your client.

Code:

       case "fire":
       Random r1 = new Random();
       Projectile.NewProjectile(Main.mouseState.X + Main.screenPosition.X, Main.mouseState.Y + Main.screenPosition.Y, r1.Next(-5, 5), r1.Next(-5, 5), Convert.ToInt32(parameter), 0, (float)5, Main.myPlayer);
       break;

More info:

       Projectile.NewProjectile(posX, posY, vectorHorizontal, vectorVertical, projectileID, damage, knockback, playerID);

~CloudHopper

Clone this wiki locally