gotcha, yah what i think is better if i make the storm hit the player like you say by using targetUID
i think it will be better hitting the player every 20-30 sec prob like 200 dmg per atk,
i am just having a bit problem how to build the atk system instead of just the effect going on you.
and ty infamous for explaining
It all depends on how your source is written but the 'best' way to handle it would be to send the spell to local clients as a ground targeted X/Y skill. Then pass the skill to your attack handler or some other system which can process the spell ID/X/Y to calculate what targets have been hit and deal appropriate damage to them.
The concern there is that most sources will have an issue with this type of handling due to no attacker entity so you'll have to either re-write your attack handler or have a different one to handle server events dealing damage.
Just as an initial thought I feel the best way would be to write a base attack handler and then inherit from it for any spells that need special handling which can then call more generic targeting methods but I'd have to dig into it a bit more to see if that's actually the most efficient route.
It all depends on how your source is written but the 'best' way to handle it would be to send the spell to local clients as a ground targeted X/Y skill. Then pass the skill to your attack handler or some other system which can process the spell ID/X/Y to calculate what targets have been hit and deal appropriate damage to them.
The concern there is that most sources will have an issue with this type of handling due to no attacker entity so you'll have to either re-write your attack handler or have a different one to handle server events dealing damage.
Just as an initial thought I feel the best way would be to write a base attack handler and then inherit from it for any spells that need special handling which can then call more generic targeting methods but I'd have to dig into it a bit more to see if that's actually the most efficient route.
in that case take a look at this,
for the thunder system i made this inside of the handle.cs which holds my spells
Code:
if (attacker.MapID == 1505)
{
SpellUse suse = new SpellUse(true);
suse.Attacker = attacker.UID;
suse.SpellID = 1000;
suse.SpellLevel = spell.Level;
System.Threading.Thread.Sleep(5000);
if (attacked.Hitpoints <= damage)
attacked.Hitpoints = 200;
}
so far its not working i still need to figure few things out but i think i am close.
- Separate script running on its own thread/timer/etc to control intermittent lightning strikes.
- Code that can take a given location (X/Y of strike) and calculate what targets are hit
- Code that can deal damage to a given target (without a specific attacker)
- A way to display damage dealt (if any targets were hit) as well as spell effect to all users in range
How you handle these tasks and where you place them in your source is really up to you and the source you're using.
- Separate script running on its own thread/timer/etc to control intermittent lightning strikes.
- Code that can take a given location (X/Y of strike) and calculate what targets are hit
- Code that can deal damage to a given target (without a specific attacker)
- A way to display damage dealt (if any targets were hit) as well as spell effect to all users in range
How you handle these tasks and where you place them in your source is really up to you and the source you're using.
- Separate script running on its own thread/timer/etc to control intermittent lightning strikes.
- Code that can take a given location (X/Y of strike) and calculate what targets are hit
- Code that can deal damage to a given target (without a specific attacker)
- A way to display damage dealt (if any targets were hit) as well as spell effect to all users in range
How you handle these tasks and where you place them in your source is really up to you and the source you're using.
I did write him some quick code in notepad to give him a general idea.. all he has to do is make it take damage... rest is already kinda done for him.
(And yes, I know the variable 'lastStrike' does not follow naming conventions.. notepad man )
PHP Code:
///////////////////////////// WRITTEN IN NOTEPAD! WONT WORK! CODE SUCKS! /////////////////////////////
///// NOTE: Try not to use DateTime if you can. :) ////
using System;
namespace COPS { public class Storm { DateTime lastStrike = DateTime.Now;
//Threaded run public void run() { foreach(Client client in Clients.Values.ToArray()) { if (Chance(10)) return; // Let's not bug them all the time, a chance this wont show. if (Chance(5) && DateTime.Now >= lastStrike.AddMinutes(1)) { lastStrike = DateTime.Now;
client.SendScreenShake(5); for (int i = 0;i<10;i++) client.send(GenerateThunderPacket()); }
client.send(GenerateThunderPacket()); } } public byte[] GenerateThunderPacket(Client client) { return new SpellPacket() { SpellID = 1234, Level = 2, UID = client.Id, X = Random(client.X, client.X+10), Y = Random(client.Y, client.Y+10) }.Build()); } } }
I mean.. you could just do something like
if (Map[client.Map].GetCell(pkt.X, pkt.Y).Entity != null)
{
//Send it to the attack processor and let it to the rest.
}
this looks good, code is simple i can understand it, but first i will try the handle.cs option if that works then it should be more clean handling it from there.
if i get stuch or unable to do it then i got this as a backup.
this looks good, code is simple i can understand it, but first i will try the handle.cs option if that works then it should be more clean handling it from there.
if i get stuch or unable to do it then i got this as a backup.
I don't understand why you want to code this entire system in your attack handler... lol
Any implementation which involves a Sleep(x) for this, isn't properly done and is a waste of a single thread. Just throwing that out there. Secondly, DateTime has a lot of over head if you're not using DateTime.UtcNow
Any implementation which involves a Sleep(x) for this, isn't properly done and is a waste of a single thread. Just throwing that out there. Secondly, DateTime has a lot of over head if you're not using DateTime.UtcNow
Quote:
Originally Posted by Smaehtin
Any specific reason you use Clients.Values.ToArray? Just wondering
I was using a simple demonstration that was programmed in notepad. (aka.. dont judge)
If I was doing it for myself, I would use some things that I think would be awesome, such as some sort of action/event system (If I was able to find a use that was sufficient)
New Bypass Idea *IDEA NOT A HACK* 01/19/2009 - Soldier Front - 5 Replies Think about it..xfire to bypass GameGuard.
I dunno about anyone else or why it hasn't been mentioned ..or maybe it has.
But let me give you an example of what i mean.
You would Inject your "wallhack.dll" into the xfire.exe process.
Then Login to xFire.Then login to SF and let your Xfire ingame Load up.
Since xfire layers its chat windows over the SF screen freely without causing the ALT+TAB error
that means its has some kind of control over the D3D.
[Idea] just an idea about having more power.. 11/22/2007 - Kal Online - 5 Replies Hello ..
I know i know ..everyone will replay with (SERVER SIDED) but we all thought the (Job Change) is Server Sided & we also thought (Cooldown Hack) is Server Sided .. bla bla bla but im not talking about adding STR or Agility because i know whatever you add it will just show as a number & wont have any effects ... & you will give the same damage ..
the point of this is .. in (Speed Hack) the normal speed is 0 & with Speed-up its 45 .. right ? .. & the Speed-up is just a potions (buff)...
Good idea or bad idea? 05/22/2007 - Conquer Online 2 - 4 Replies I have a water(110)-Trojan(130) but i dont know if i should go to trojan again for 2nd rb or should i rb to water?
If i am water(110)-trojan(130)-water(130) how much hp would i have if i went melee and had about 2.4k mana?
Idea:Possibly good potential idea! 10/26/2005 - Conquer Online 2 - 3 Replies Well today I was thinking and it was stated that it's impossible to view if you have a +1 item unless you look in your inventory, but it is generated before its picked up.
This could be a big job, could be worth it if it was possible and done correctly though. Turn the items on the floors into items in your inventory images, I should probably explain a bit more. The images that are used in your inventory, put those on the floor. That way if you moused over the image it'd show the +1...