[Help]NPC that give profs (20)and str,agi,str,etc

03/27/2009 04:02 spiderfady#1
hello
i need some help
i made NPC that give free items +12
and NPC that give all important Skill (fixed)
so
i need to know how to do NPS that give prof
i tried to make it
i used this code
Quote:
MyChar.Profs.Add(420, 20);
but it's don't work
then i tried that code
Quote:
General.MyPackets.Prof(420, 20, 0);
not work too
so wat i can do
that's first

if some one know how to do NPC give 600 Str,agi ,etc
it will be helpful
i think it's hard work but I trust in this site
03/27/2009 04:29 GoaT pLz#2
seriously typing bigger just hurts my eyes next time make font lower...

umm thats not how you send packets.. lol check out the /prof command
03/27/2009 04:29 GoaT pLz#3
seriously typing bigger just hurts my eyes next time make font lower...

umm thats not how you send packets.. lol check out the /prof command
03/27/2009 16:25 spiderfady#4
Quote:
Originally Posted by GoaT pLz View Post
seriously typing bigger just hurts my eyes next time make font lower...

umm thats not how you send packets.. lol check out the /prof command
not that!!!!!! LoL
03/27/2009 16:41 L1nk1n*P4rK#5
I'm so happy to see again someone who ask a LOTF script!
Becouse you do the "Major Step" I will help you!


Code:
SendPacket(General.MyPackets.Prof.Add([COLOR="Red"]450[/COLOR], [COLOR="DarkOrange"]0[/COLOR]));
MyChar.Save();
or

Code:
SendPacket(General.MyPackets.Prof([COLOR="Red"]450[/COLOR], [COLOR="DarkOrange"]0[/COLOR]));
MyChar.Save();
Depend on your LOTF version.


Legend:
/////-Prof ID
/////-Prof Exp

#UpDate
For All Who Want To Learn!
1.Why I use SendPacket and no MyChar or General?

Becouse you talk to a NPC and the expresions MyChar and General affect you directly, and for a NPC is wrong!.You can use this 2 expresions ONLY when you code a Command or when you are useing (MyChar) to define something.

2.So what is so special at SendPacket?

SendPacket is an expresion which send information to some packet's!
To take for example the Case: 74 (the login case) if you scroll down you will find this:
Code:
 [COLOR="Red"]                                       SendPacket[/COLOR](General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "Welcome to ShadowCo [Ver 3.1]", [COLOR="#0000ff"]2011[/COLOR]));
                                        [COLOR="#ff0000"]SendPacket[/COLOR](General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "Please Reffer Us To Your Friends!", [COLOR="#0000ff"]2000[/COLOR]));
                                        [COLOR="#ff0000"]SendPacket[/COLOR](General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "Exp Rate: " + DataBase.ExpRate + "x.", [COLOR="#0000ff"]2000[/COLOR]));
                                        [COLOR="#ff0000"]SendPacket[/COLOR](General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "Prof Rate: " + DataBase.ProfExpRate + "x.", [COLOR="#0000ff"]2000[/COLOR]));
                                        [COLOR="#ff0000"]SendPacket[/COLOR](General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "Players Online: " + World.AllChars.Count, [COLOR="Blue"]2005[/COLOR]));
Now If you Read carefull you will see at the end of each line the expresion SendPacket is sending a MSG to the ChatPacket's with the specified ID (2000,2005,2011)
Now to end this short tutorial SendPacket is sending the prof ID and Exp to DB and that will save it with the expresion MyChar.Save();
#UpDate
03/27/2009 17:05 L1nk1n*P4rK#6
#Update
03/27/2009 18:37 spiderfady#7
Quote:
Originally Posted by L1nk1n*P4rK View Post
I'm so happy to see again someone who ask a LOTF script!
Becouse you do the "Major Step" I will help you!


Code:
SendPacket(General.MyPackets.Prof.Add([COLOR="Red"]450[/COLOR], [COLOR="DarkOrange"]0[/COLOR]));
MyChar.Save();
or

Code:
SendPacket(General.MyPackets.Prof([COLOR="Red"]450[/COLOR], [COLOR="DarkOrange"]0[/COLOR]));
MyChar.Save();
Depend on your LOTF version.


Legend:
/////-Prof ID
/////-Prof Exp

#UpDate
For All Who Want To Learn!
1.Why I use SendPacket and no MyChar or General?

Becouse you talk to a NPC and the expresions MyChar and General affect you directly, and for a NPC is wrong!.You can use this 2 expresions ONLY when you code a Command or when you are useing (MyChar) to define something.

2.So what is so special at SendPacket?

SendPacket is an expresion which send information to some packet's!
To take for example the Case: 74 (the login case) if you scroll down you will find this:
Code:
 [COLOR="Red"]                                       SendPacket[/COLOR](General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "Welcome to ShadowCo [Ver 3.1]", [COLOR="#0000ff"]2011[/COLOR]));
                                        [COLOR="#ff0000"]SendPacket[/COLOR](General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "Please Reffer Us To Your Friends!", [COLOR="#0000ff"]2000[/COLOR]));
                                        [COLOR="#ff0000"]SendPacket[/COLOR](General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "Exp Rate: " + DataBase.ExpRate + "x.", [COLOR="#0000ff"]2000[/COLOR]));
                                        [COLOR="#ff0000"]SendPacket[/COLOR](General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "Prof Rate: " + DataBase.ProfExpRate + "x.", [COLOR="#0000ff"]2000[/COLOR]));
                                        [COLOR="#ff0000"]SendPacket[/COLOR](General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "Players Online: " + World.AllChars.Count, [COLOR="Blue"]2005[/COLOR]));
Now If you Read carefull you will see at the end of each line the expresion SendPacket is sending a MSG to the ChatPacket's with the specified ID (2000,2005,2011)
Now to end this short tutorial SendPacket is sending the prof ID and Exp to DB and that will save it with the expresion MyChar.Save();
#UpDate
thx man i will try it
thank u very much
03/27/2009 18:38 L1nk1n*P4rK#8
No problem, you are welcome.
You should read my mini tutorial to understand more thing's :P