|
Notki |
Magia Magiczne zaklęcia, runy, potężni magowie. Tutaj wszystko o magii w Tibii |
|
Opcje tematu |
31-12-2007, 15:28 | #1 |
Użytkownik forum
Data dołączenia: 14 09 2005
Wiek: 37
Posty: 9
Stan: Aktywny Gracz
Imię: Azak'Nah Tal
Profesja: Royal Paladin
Gildia: Eternal Crusade
Świat: Selena
Poziom: 117
Skille: 93/70
Poziom mag.: 20
|
Kalkulator siły czarów
Nudziło mi sie wiec napisalem w c++ prosty programik obliczajacy sile czarow i obliczajacy przyblizone wartosci glownych czarow i run leczacych oraz obrazenia zadawane przez sd po najnowszym update.
Kod zamieszczony ponizej wystarczy skompilowac dowolnym kompilatorem c++ (gcc, dev c++, etc.) Kod:
#include <iostream> using namespace std; float magic_power (int mlv,int lvl) { float m_pow= (0.5*lvl+4*mlv)/100; if(m_pow<1) return 1; else return m_pow; } int main(){ int lvl; int mlv; int voc; char a; cout<<"Prosty kalkulator sily czarow w Tibii by Azak"<<endl<<endl; cout<<"Wybierz swoja klase:"<<endl<<endl; cout<<"1. Knight"<<endl<<"2. Pally"<<endl<<"3. Druid lub Sorc"<<endl<<"//:"; cin>>a; cout<<endl<<"Podaj swoj lvl: "; cin>>lvl; cout<<endl<<"Podaj swoj mlv: "; cin>>mlv; cout<<endl; float mag=magic_power(mlv,lvl); int uh_base=250; int uh_player = mag * uh_base; int sd_min_base=120; int sd_max_base=169; int sd_min_player=sd_min_base*mag; int sd_max_player=sd_max_base*mag; int exura_min_base=10; int exura_max_base=30; int exura_min_player=exura_min_base*mag; int exura_max_player=exura_max_base*mag; int ih_min_base=46; int ih_max_base=93; int ih_min_player=ih_min_base*mag; int ih_max_player=ih_max_base*mag; cout<<"Twoja sila czarow wynosi: "<<mag*100<<"%"<<endl<<endl; switch(a){ case '1': { cout<<"UH/exura vita "<<uh_player<<endl; cout<<"exura od "<<exura_min_player<<" do "<<exura_max_player<<endl;break; }; case '2': { cout<<"UH/exura vita "<<uh_player<<endl; cout<<"exura od "<<exura_min_player<<" do "<<exura_max_player<<endl; cout<<"exura gran/IH od "<<ih_min_player<<" do "<<ih_max_player<<endl; cout<<"SD od "<<sd_min_player<<" do "<<sd_max_player;break; }; case '3': { cout<<"UH/exura vita "<<uh_player<<endl; cout<<"exura od "<<exura_min_player<<" do "<<exura_max_player<<endl; cout<<"exura gran/IH od "<<ih_min_player<<" do "<<ih_max_player<<endl; cout<<"SD od "<<sd_min_player<<" do "<<sd_max_player;break; }; default:cout<<endl<<"Nie ma takiej opcji"<<endl;break; }; cout<<endl<<endl; system("PAUSE"); return 0; } Azak. |
|
31-12-2007, 19:36 | #2 |
Użytkownik Forum
Data dołączenia: 18 06 2006
Lokacja: J-W
Posty: 96
Stan: Aktywny Gracz
Imię: A,b, c... - tajemnica
Świat: Arcania
|
Hmm... wydaję mi się, że coś źle oblicza ;/ Sprawdź to lepiej. Program spoko, jeśli na 100% dobrze oblicza.
|
31-12-2007, 19:38 | #3 |
Użytkownik forum
Data dołączenia: 31 12 2007
Lokacja: Made in Łódź
Posty: 9
Stan: Aktywny Gracz
Imię: Merel Sapshinus
Profesja: Royal Paladin
Gildia: Big Team
Świat: Guardia
Poziom: 70+
Skille: 8+/55
Poziom mag.: 15
|
Kawał dobrej roboty Mam tylko nadzieję, że zamierzasz go w przyszłości ulepszyć o pare dodatkowych funkcji ;]
|
02-01-2008, 18:01 | #4 |
Użytkownik Forum
Data dołączenia: 30 06 2007
Posty: 78
Stan: Niegrający
|
Nie miałem co robić, więc go ulepszyłem w Dev-C++
Jak by ktoś miał inne wzory, niech w tym temacie umieści. Kod:
#include <cstdlib> #include <iostream> using namespace std; float magic_power (int mlvl, int lvl) { float m_pow= (0.5*lvl+4*mlvl)/100; if(m_pow<1) return 1; else return m_pow; } int main(int argc, char *argv[]) { reset: int lvlp; int mlvp; int voc; int rep; char a; cout<<"\n\nProsty kalkulator sily czarow w Tibii by Azak & informat6\n\n"; system("PAUSE"); cout<<"\nPodaj lvl postaci ->: "; cin>>lvlp; cout<<"\nPodaj mlvl postaci ->: "; cin>>mlvp; cout<<"\nWybierz profesje twojej postaci"<<endl<<endl; cout<<"1. Knight\n2. Palladyn\n3. Druid lub Sorccer\n->: "; cin>>a; cout<<endl; float mag=magic_power(mlvp,lvlp); int uh_base=250; float uh_player = mag * uh_base; float sd_min_base=120; float sd_max_base=169; float sd_min_player=sd_min_base*mag; float sd_max_player=sd_max_base*mag; float exura_min_base=10; float exura_max_base=30; float exura_min_player=exura_min_base*mag; float exura_max_player=exura_max_base*mag; float ih_min_base=46; float ih_max_base=93; float ih_min_player=ih_min_base*mag; float ih_max_player=ih_max_base*mag; switch(a){ case '1': { cout<<"UH/exura vita leczy ok. od"<<uh_player<<endl; cout<<"exura lecyz ok. od "<<exura_min_player<<" do "<<exura_max_player<<endl;break; cout<<"Twoja sila czarow wynosi: "<<mag*100<<"%"<<endl<<endl; }; case '2': { cout<<"UH/exura vita leczy ok. "<<uh_player<<endl; cout<<"exura leczy ok. od "<<exura_min_player<<" do "<<exura_max_player<<endl; cout<<"exura gran/IH leczy ok. od "<<ih_min_player<<" do "<<ih_max_player<<endl; cout<<"SD atakuje ok. od "<<sd_min_player<<" do "<<sd_max_player;break; cout<<"Twoja sila czarow wynosi: "<<mag*100<<"%"<<endl<<endl; }; case '3': { cout<<"UH/exura vita leczy ok. "<<uh_player<<endl; cout<<"exura leczy ok. od "<<exura_min_player<<" do "<<exura_max_player<<endl; cout<<"exura gran/IH lecczy ok. od "<<ih_min_player<<" do "<<ih_max_player<<endl; cout<<"SD atakuje ok. od "<<sd_min_player<<" do "<<sd_max_player;break; cout<<"Twoja sila czarow wynosi: "<<mag*100<<"%"<<endl<<endl; }; default: { cout<<"\nERROR - Zly wybor profesji!!!Od poczatku...\n"; goto reset; break; } }; cout << "\nCzy chcesz obliczyc jeszcze moc magiczna innej postaci?(1-Tak,0-Nie): "; cin >> rep; if (rep !=0) { goto reset; } return 0; } Ostatnio edytowany przez informat6 - 02-01-2008 o 18:06. |
02-01-2008, 23:31 | #5 |
Użytkownik Forum
Data dołączenia: 18 06 2006
Lokacja: J-W
Posty: 96
Stan: Aktywny Gracz
Imię: A,b, c... - tajemnica
Świat: Arcania
|
Eeee. wydaje mi się, że on nie powinien zwracac wartości: 0
Kod:
return 0; Hmm... no tak jak myślałem nie kompiluję się, jutro zczaje dokładniej ;] Aaa i jeszcze jedno ;p Użycie struktury "goto" jest przez wielu programistów uważane za "nieeleganckie" ;p Zastąp to np. pętlą do...while. Ostatnio edytowany przez Zyggy - 02-01-2008 o 23:34. |
02-01-2008, 23:48 | #6 |
Użytkownik Forum
Data dołączenia: 18 06 2006
Lokacja: J-W
Posty: 96
Stan: Aktywny Gracz
Imię: A,b, c... - tajemnica
Świat: Arcania
|
O tak:
Kod:
#include <cstdlib> #include <iostream> using namespace std; float magic_power (int mlvl, int lvl) { float m_pow= (0.5*lvl+4*mlvl)/100; if(m_pow<1) return 1; else return m_pow; } int main() { int lvlp; int mlvp; int voc; int rep; char a; cout<<"\n\nProsty kalkulator sily czarow w Tibii by Azak & informat6 & Zyggy\n\n"; system("PAUSE"); do{ cout<<"\nPodaj lvl postaci ->: "; cin>>lvlp; cout<<"\nPodaj mlvl postaci ->: "; cin>>mlvp; cout<<"\nWybierz profesje twojej postaci"<<endl<<endl; cout<<"1. Knight\n2. Palladyn\n3. Druid lub Sorccer\n->: "; cin>>a; cout<<endl; float mag=magic_power(mlvp,lvlp); int uh_base=250; float uh_player = mag * uh_base; float sd_min_base=120; float sd_max_base=169; float sd_min_player=sd_min_base*mag; float sd_max_player=sd_max_base*mag; float exura_min_base=10; float exura_max_base=30; float exura_min_player=exura_min_base*mag; float exura_max_player=exura_max_base*mag; float ih_min_base=46; float ih_max_base=93; float ih_min_player=ih_min_base*mag; float ih_max_player=ih_max_base*mag; switch(a){ case '1': { cout<<"UH/exura vita leczy ok. od"<<uh_player<<endl; cout<<"exura lecyz ok. od "<<exura_min_player<<" do "<<exura_max_player<<endl;break; cout<<"Twoja sila czarow wynosi: "<<mag*100<<"%"<<endl<<endl; }; case '2': { cout<<"UH/exura vita leczy ok. "<<uh_player<<endl; cout<<"exura leczy ok. od "<<exura_min_player<<" do "<<exura_max_player<<endl; cout<<"exura gran/IH leczy ok. od "<<ih_min_player<<" do "<<ih_max_player<<endl; cout<<"SD atakuje ok. od "<<sd_min_player<<" do "<<sd_max_player;break; cout<<"Twoja sila czarow wynosi: "<<mag*100<<"%"<<endl<<endl; }; case '3': { cout<<"UH/exura vita leczy ok. "<<uh_player<<endl; cout<<"exura leczy ok. od "<<exura_min_player<<" do "<<exura_max_player<<endl; cout<<"exura gran/IH lecczy ok. od "<<ih_min_player<<" do "<<ih_max_player<<endl; cout<<"SD atakuje ok. od "<<sd_min_player<<" do "<<sd_max_player;break; cout<<"Twoja sila czarow wynosi: "<<mag*100<<"%"<<endl<<endl; }; default: { cout<<"\nERROR - Zly wybor profesji!!!Od poczatku...\n"; break; } }; cout << "\nCzy chcesz obliczyc jeszcze moc magiczna innej postaci?(1-Tak,0-Nie): "; cin >> rep; }while(rep==1) ; } Ostatnio edytowany przez Zyggy - 03-01-2008 o 14:12. |
03-01-2008, 13:46 | #7 |
Użytkownik Forum
Data dołączenia: 18 06 2006
Lokacja: J-W
Posty: 96
Stan: Aktywny Gracz
Imię: A,b, c... - tajemnica
Świat: Arcania
|
Co myślicie o skompilowaniu któregoś z powyższych programów i podaniu linka do gotowego kalkulatora ? Nie chce bez pytania dawać, bo z doświadczenia wiem, że wszyscy będą myśleć, że to keylogger. Nie mniej jednak postaram się dzisiaj zamieścić gotowy kalkulator na jakimś serwerze: rapidzie, speedy lub innym oraz dla chętnych opiszę sposób jak samemu skompilować podany wyżej kod
Co myślicie o napisaniu kalkulatora obliczającego ile czasu zajmie nam stworzenie wybranej przez nas runy/bp run z promocją, samym jedzeniem, softami, life ringiem lub wszystkim na raz ? Podawajcie pomysły co może jeszcze przydatnego obliczać taki kalkulator. Pozdrawiam... Ostatnio edytowany przez Zyggy - 03-01-2008 o 13:47. |
03-01-2008, 14:01 | #8 |
Użytkownik Forum
Data dołączenia: 03 01 2008
Wiek: 37
Posty: 375
Profesja: Elder Druid
Świat: Premia
|
A wiec... Ja przed chwila podalem moj wielki kalkulator skompilowany, i automatycznie dostalem bana. Wiec tutaj daje kod zrodlowy. Niech sobie admini sprawdza i przyznaja sie do bledu.
Kod:
unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, ComCtrls, TabNotBk, Buttons, shellapi; type TForm1 = class(TForm) ComboBox1: TComboBox; Label1: TLabel; TabbedNotebook1: TTabbedNotebook; Edit1: TEdit; Button1: TButton; GroupBox1: TGroupBox; Label6: TLabel; Label7: TLabel; Label8: TLabel; Label9: TLabel; GroupBox2: TGroupBox; Edit2: TEdit; Label2: TLabel; Button2: TButton; Label3: TLabel; Label4: TLabel; GroupBox3: TGroupBox; Label5: TLabel; Edit3: TEdit; Button3: TButton; Label10: TLabel; Label11: TLabel; Label12: TLabel; Label13: TLabel; Label14: TLabel; Label15: TLabel; GroupBox4: TGroupBox; Edit4: TEdit; Label16: TLabel; Edit5: TEdit; Label17: TLabel; Button4: TButton; Label18: TLabel; Label19: TLabel; GroupBox5: TGroupBox; Edit6: TEdit; Label20: TLabel; Edit7: TEdit; Label21: TLabel; Label22: TLabel; Label23: TLabel; Label24: TLabel; Label25: TLabel; Label26: TLabel; Label27: TLabel; Label28: TLabel; Label29: TLabel; Label30: TLabel; Label31: TLabel; Label32: TLabel; Label33: TLabel; Label34: TLabel; Label35: TLabel; Label36: TLabel; Label37: TLabel; Label38: TLabel; Label39: TLabel; Label40: TLabel; Label41: TLabel; Label42: TLabel; Label43: TLabel; Label44: TLabel; Label45: TLabel; Button5: TButton; Image1: TImage; BitBtn1: TBitBtn; procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); procedure Button3Click(Sender: TObject); procedure Button4Click(Sender: TObject); procedure ComboBox1Change(Sender: TObject); procedure Button5Click(Sender: TObject); procedure BitBtn1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation uses Unit2; {$R *.dfm} function sila_czarow(a,b,c:real):string; begin sila_czarow:=inttostr(trunc(((a/3)+(b/2))*c)); end; procedure TForm1.Button1Click(Sender: TObject); var wynik, x: real; begin if (edit1.text='') or (strtoint(edit1.text)<=0) then edit1.Text:='1'; x:=StrToInt(edit1.Text); wynik:=(((50*(x-1))*(x-1)*(x-1)-150*(x-1)*(x-1)+400*(x-1))/3); label8.caption:=(inttostr(trunc(wynik))) end; procedure TForm1.Button2Click(Sender: TObject); var wynik,profesja:real; i:integer; begin if (edit2.text='') or (strtoint(edit2.text)<=0) then edit2.Text:='1'; if Combobox1.Text='Knight' then profesja:=3; if Combobox1.Text='Paladin' then profesja:=1.4; if Combobox1.Text='Druid' then profesja:=1.1; if Combobox1.Text='Sorcerer' then profesja:=1.1; wynik:=1; for i:=1 to strtoint(edit2.text) do wynik:=wynik+(1600*profesja); label4.caption:=inttostr(trunc(wynik)) end; procedure TForm1.Button3Click(Sender: TObject); var wynik:integer; begin if (edit3.text='') or (strtoint(edit3.text)<=0) then edit3.Text:='1'; if Combobox1.Text='Knight' then wynik:=(StrToInt(edit3.text))*5-5; if Combobox1.Text='Paladin' then wynik:=StrToInt(edit3.text)*15-85; if Combobox1.Text='Druid' then wynik:=StrToInt(edit3.text)*30-205; if Combobox1.Text='Sorcerer' then wynik:=StrToInt(edit3.text)*30-205; label11.Caption:=IntTostr(wynik); if strtoint(edit3.text)<8 then label11.caption:=' Prawidłowy wynik tylko po wyjsciu na main'; if Combobox1.Text='Knight' then wynik:=(StrToInt(edit3.text))*15+65; if Combobox1.Text='Paladin' then wynik:=StrToInt(edit3.text)*10+105; if Combobox1.Text='Druid' then wynik:=StrToInt(edit3.text)*5+145; if Combobox1.Text='Sorcerer' then wynik:=StrToInt(edit3.text)*5+145; label13.Caption:=IntTostr(wynik); if strtoint(edit3.text)<8 then label13.caption:=' Prawidłowy wynik tylko po wyjsciu na main'; if Combobox1.Text='Knight' then wynik:=((StrToInt(edit3.text))-8)*25; if Combobox1.Text='Paladin' then wynik:=(StrToInt(edit3.text)-8)*20; if Combobox1.Text='Druid' then wynik:=(StrToInt(edit3.text)-8)*10; if Combobox1.Text='Sorcerer' then wynik:=(StrToInt(edit3.text)-8)*10; label15.Caption:=IntTostr(wynik); if strtoint(edit3.text)<8 then label15.caption:=' Prawidłowy wynik tylko po wyjsciu na main'; end; procedure TForm1.Button4Click(Sender: TObject); var wynik,a,b,c:integer; begin if (edit4.text='') or (strtoint(edit4.text)<=0) then edit4.Text:='1'; if (edit5.text='') or (strtoint(edit5.text)<=0) then edit5.Text:='1'; a:=trunc(StrToInt(edit4.text)*0.9); b:=StrToInt(edit5.text); c:=trunc(((50*(b-1))*(b-1)*(b-1)-150*(b-1)*(b-1)+400*(b-1))/3); wynik:=trunc((1-(a/b))*0.05*c); if wynik<0 then wynik:=0; label19.caption:=inttostr(wynik)+' expa'; end; procedure TForm1.ComboBox1Change(Sender: TObject); begin if combobox1.text='Knight' then begin label22.caption:='Light Healing'; label23.caption:='Berserk'; label24.caption:=''; label25.caption:=''; label26.caption:=''; label27.caption:=''; label28.caption:=''; label29.caption:=''; label30.caption:=''; label31.caption:=''; label32.caption:=''; label33.caption:=''; label34.caption:=''; label35.caption:=''; label36.caption:=''; label37.caption:=''; label38.caption:=''; label39.caption:=''; label40.caption:=''; label41.caption:=''; label42.caption:=''; label43.caption:=''; label44.caption:=''; label45.caption:=''; end; if combobox1.text='Paladin' then begin label22.caption:='Light Magic Missle'; label23.caption:='Light Healing'; label24.caption:='Heavy Magic Missle'; label25.caption:='Explosion'; label26.caption:='Intense Healing'; label27.caption:='Great Fireball'; label28.caption:='Sudden Death'; label29.caption:='Ultimate Healing'; label30.caption:=''; label31.caption:=''; label32.caption:=''; label33.caption:=''; label34.caption:=''; label35.caption:=''; label36.caption:=''; label37.caption:=''; label38.caption:=''; label39.caption:=''; label40.caption:=''; label41.caption:=''; label42.caption:=''; label43.caption:=''; label44.caption:=''; label45.caption:=''; end; if combobox1.text='Sorcerer' then begin label22.caption:='Light Magic Missle'; label23.caption:='Light Healing'; label24.caption:='Heavy Magic Missle'; label25.caption:='Explosion'; label26.caption:='Intense Healing'; label27.caption:='Great Fireball'; label28.caption:='Sudden Death'; label29.caption:='Ultimate Healing'; label30.caption:='Force Strike'; label31.caption:='Energy Strike'; label32.caption:='Energy Wave'; label33.caption:='Ultimate Explosion'; label34.caption:=''; label35.caption:=''; label36.caption:=''; label37.caption:=''; label38.caption:=''; label39.caption:=''; label40.caption:=''; label41.caption:=''; label42.caption:=''; label43.caption:=''; label44.caption:=''; label45.caption:=''; end; if combobox1.text='Druid' then begin label22.caption:='Light Magic Missle'; label23.caption:='Light Healing'; label24.caption:='Heavy Magic Missle'; label25.caption:='Explosion'; label26.caption:='Intense Healing'; label27.caption:='Great Fireball'; label28.caption:='Sudden Death'; label29.caption:='Ultimate Healing'; label30.caption:='Force Strike'; label31.caption:='Energy Strike'; label32.caption:='Energy Wave'; label33.caption:=''; label34.caption:=''; label35.caption:=''; label36.caption:=''; label37.caption:=''; label38.caption:=''; label39.caption:=''; label40.caption:=''; label41.caption:=''; label42.caption:=''; label43.caption:=''; label44.caption:=''; label45.caption:=''; end; end; procedure TForm1.Button5Click(Sender: TObject); var a,b:integer; begin if (edit6.text='') or (strtoint(edit6.text)<=0) then edit6.Text:='1'; if (edit7.text='') or (strtoint(edit7.text)<0) then edit7.Text:='0'; a:=StrToInt(edit6.Text); b:=strtoint(edit7.Text); if combobox1.Text='Knight' then begin label34.caption:=sila_czarow(a,b,1.5); label35.caption:=sila_czarow(a,b,9.9); end; if combobox1.text='Paladin' then begin label34.caption:=sila_czarow(a,b,0.9); label35.caption:=sila_czarow(a,b,1.5); label36.caption:=sila_czarow(a,b,1.8); label37.caption:=sila_czarow(a,b,3); label38.caption:=sila_czarow(a,b,3); label39.caption:=sila_czarow(a,b,3.3); label40.caption:=sila_czarow(a,b,8.7); label41.caption:=sila_czarow(a,b,15); end; if combobox1.text='Sorcerer'then begin label34.caption:=sila_czarow(a,b,0.9); label35.caption:=sila_czarow(a,b,1.5); label36.caption:=sila_czarow(a,b,1.8); label37.caption:=sila_czarow(a,b,3); label38.caption:=sila_czarow(a,b,3); label39.caption:=sila_czarow(a,b,3.3); label40.caption:=sila_czarow(a,b,8.7); label41.caption:=sila_czarow(a,b,15); label42.caption:=sila_czarow(a,b,1.6); label43.caption:=sila_czarow(a,b,2.7); label44.caption:=sila_czarow(a,b,12); label45.caption:=sila_czarow(a,b,16.8); end; if combobox1.text='Druid'then begin label34.caption:=sila_czarow(a,b,0.9); label35.caption:=sila_czarow(a,b,1.5); label36.caption:=sila_czarow(a,b,1.8); label37.caption:=sila_czarow(a,b,3); label38.caption:=sila_czarow(a,b,3); label39.caption:=sila_czarow(a,b,3.3); label40.caption:=sila_czarow(a,b,8.7); label41.caption:=sila_czarow(a,b,15); label42.caption:=sila_czarow(a,b,1.6); label43.caption:=sila_czarow(a,b,2.7); label44.caption:=sila_czarow(a,b,12); end; end; procedure TForm1.BitBtn1Click(Sender: TObject); begin form2.showmodal; end; end. Wiem ze nikt raczej sobie tego nie skompiluje, ale to jest jedyny mozliwi sposob, na podanie tego programu do publiki, bo jak tylko podalem adres do strony tego programu, to od razu bana dostalem, wiec ja sie pytam za co? jakby co pozniej moz podam strone z tym programem i ze screenami. Pozdro edit: tutaj mozecie przyjrzec sie zdjeciom: http://www.tibiacalc.prv.pl/images/foto1.JPG http://www.tibiacalc.prv.pl/images/foto2.JPG http://www.tibiacalc.prv.pl/images/foto3.JPG Ostatnio edytowany przez Jagred - 03-01-2008 o 14:03. |
03-01-2008, 14:47 | #9 | |
Moderator
Data dołączenia: 10 09 2005
Posty: 2,347
Stan: Na Emeryturze
|
Cytuj:
|
|