I coded this myself enjoy it or dont idc dont waste my time with useless posts about it being posted before if u dont like it dont post. Modify it to w/e u want. right now it just exchanges vote points for white scrolls drag weps and reverse weps.
I also know about the missing disposes add it yourself it dosent bother me on my server.
If you dont have the methods coded in your server here are the methods. This is for moopledev other sources may be diffrent.
MapleCharacter.java
Under private int gender;
add:
Code:
private int votePoints;
find:
Code:
public static MapleCharacter loadCharFromDB
scroll down to:
Code:
ret.whitechat = ret.gmLevel > 0;
Or w/e your last one is.
add:
Code:
ret.votePoints = rs.getInt("votePoints");
find:
Code:
public void saveToDB(boolean update) {
Connection con = DatabaseConnection.getConnection();
try {
Scroll down to:
Code:
update characters and insert into characters and add
votePoints = ? beside omokties = ? in update characters
Next add votePoints beside omokties in insert into characters. in update characters at the end where values are add 1 ? to it..
Find:
Code:
ps.setInt(47, omokties);
Add:
Code:
ps.setInt(49, votePoints);
Note numbers must be in order
Find:
Code:
public void sendPolice
Add above it:
Code:
public void gainvotePoints(int gain){
this.votePoints += gain;
}
public int getvotePoints(){
return this.votePoints;
}
Theres your method u also have to add in NpcConversationManager.java
Code:
public int getvotePoints(){
return getPlayer().getvotePoints();
}
public void gainvotePoints(int gain){
getPlayer().gainvotePoints(gain);
}
Code:
/*Vote point exchange npc
Exchanges votepoints for white scrolls dragon weapons and reverse weapons.
@@author shadowzzz*/
var status;
function start() {
status = -1;//sets status to -1
action( 1, 0, 0);
}
function action (mode, type , selection) {
if (mode == 1) {
status++;
}else{
status--;
}
if (status == 0) {
cm.sendSimple("Welcome to the vote point exchange npc you have.#r" +cm.getvotePoints() +"#k Votepoints Go to the website and vote to gain votepoints. What would u like to buy with your votepoints? #d\r\n#L0# Buy White scrolls 3-6 votepoints #b\r\n#L1# Buy Dragon weapons 5 votepoints #r\r\n#L2# Buy Reverse Weapons 10 votepoints ");
}else if (status == 1){
if (selection == 0) {
cm.sendSimple("#eHow many whitescrolls would u like? #r\r\n#L100# 1 White scroll for 3 votepoints #b\r\n\#L101# 5 White scrolls for 15 points");
}else if (selection== 1){
cm.sendSimple("#b\r\n#L102# Dragon carabella#b\r\n\#L103# Dragon Axe#b\r\n\#L104# Dragon Mace#b\r\n\#L105# Dragon Wand#b\r\n\#L106# Dragon Staff #b\r\n\#L107# Dragon Kanzir #b\r\n\#L108#Dragon Claymore #b\r\n\#L109# Dragon battleaxe #b\r\n\#L110# Dragon flame #b\r\n\#L111# Dragon faltizan #b\r\n\#L112# Dragon Chelbrid #b\r\n\#L113# Dragon shinerbow #b\r\n\#L114# Dragon ShinerCrossbow #b\r\n\#L115# Dragon Purple Sleeve #b\r\n\#L116# Dragon Slash Claw #b\r\n\#L117# Dragonfire Revolver");
}else if (selection == 2){
cm.sendSimple("#b\r\n\#L118# Reverse Executioners #b\r\n\#L119# Reverse Bardiche #b\r\n\#L120# Reverse Allergando #b\r\n\#L121# Reverse Pescas #b\r\n\#L122# Reverse Killic #b\r\n\#L123# Reverse EnrealTear #b\r\n\#L124# Reverse Aeas Hand #b\r\n\#L125# Reverse Neibelheim #b\r\n\#L126# Reverse Tabarzin #b\r\n\#L127# Reverse Bellocce #b\r\n\#L128# Reverse Alchupiz #b\r\n\#L129# Reverse Diesra #b\r\n\#L130# Reverse Engaw #b\r\n\#L131# Reverse Black Beauty #b\r\n\#L132# Reverse Lampion #b\r\n\#L133# Reverse Equinox #b\r\n\#L134# Reverse Blindness");
}
}else if (status == 2){
if (selection == 100){
if (cm.getvotePoints()>= 3){
cm.gainItem(2340000, 1);
cm.gainvotePoints(-3);
cm.dispose();
}else{
cm.sendOk("you dont have enough vote points!");
cm.dispose();
}
}else if (selection == 101){
if (cm.getvotePoints() >= 6){
cm.gainItem(2340000, 5);
cm.gainvotePoints(-15);
cm.dispose();
}else{
cm.sendOk("you dont have enough vote points!");
cm.dispose();
}
}else if (selection == 102){
if (cm.getvotePoints() >= 5){
cm.gainItem(1302059, 1);
cm.gainvotePoints(-5);
cm.dispose();
}else{
cm.sendOk("you dont have enough vote points!");
cm.dispose();
}
}else if (selection == 103){
if (cm.getvotePoints() >= 5){
cm.gainItem(1312031, 1);
cm.gainvotePoints(-5)
cm.dispose();
}else{
cm.sendOk("you dont have enough vote points!");
cm.dispose();
}
}else if (selection == 104){
if (cm.getvotePoints() >= 5){
cm.gainItem(1322052, 1);
cm.gainvotePoints(-5)
cm.dispose();
}else{
cm.sendOk("you dont have enough vote points!");
cm.dispose();
}
}else if (selection == 105){
if (cm.getvotePoints() >= 5){
cm.gainItem(1372032, 1);
cm.gainvotePoints(-5)
cm.dispose();
}else{
cm.sendOk("you dont have enough vote points!");
cm.dispose();
}
}else if (selection == 106){
if (cm.getvotePoints() >= 5){
cm.gainItem(1382036, 1);
cm.gainvotePoints(-5)
cm.dispose();
}else{
cm.sendOk("you dont have enough vote points!");
cm.dispose();
}
}else if (selection == 107){
if (cm.getvotePoints() >= 5){
cm.gainItem(1332049, 1);
cm.gainvotePoints(-5)
cm.dispose();
}else{
cm.sendOk("you dont have enough vote points!");
cm.dispose();
}
}else if (selection == 108){
if (cm.getvotePoints() >= 5){
cm.gainItem(1402036, 1);
cm.gainvotePoints(-5)
cm.dispose();
}else{
cm.sendOk("you dont have enough vote points!");
cm.dispose();
}
}else if (selection == 109){
if (cm.getvotePoints() >= 5){
cm.gainItem(1412026, 1);
cm.gainvotePoints(-5)
cm.dispose();
}else{
cm.sendOk("you dont have enough vote points!");
cm.dispose();
}
}else if (selection == 110){
if (cm.getvotePoints() >= 5){
cm.gainItem(1422028, 1);
cm.gainvotePoints(-5)
cm.dispose();
}else{
cm.sendOk("you dont have enough vote points!");
cm.dispose();
}
}else if (selection == 111){
if (cm.getvotePoints() >= 5){
cm.gainItem(1432038, 1);
cm.gainvotePoints(-5)
cm.dispose();
}else{
cm.sendOk("you dont have enough vote points!");
cm.dispose();
}
}else if (selection == 112){
if (cm.getvotePoints() >= 5){
cm.gainItem(1442045, 1);
cm.gainvotePoints(-5)
cm.dispose();
}else{
cm.sendOk("you dont have enough vote points!");
cm.dispose();
}
}else if (selection == 113){
if (cm.getvotePoints() >= 5){
cm.gainItem(1452044, 1);
cm.gainvotePoints(-5)
cm.dispose();
}else{
cm.sendOk("you dont have enough vote points!");
cm.dispose();
}
}else if (selection == 114){
if (cm.getvotePoints() >= 5){
cm.gainItem(1462039, 1);
cm.gainvotePoints(-5)
cm.dispose();
}else{
cm.sendOk("you dont have enough vote points!");
cm.dispose();
}
}else if (selection == 115){
if (cm.getvotePoints() >= 5){
cm.gainItem(1472052, 1);
cm.gainvotePoints(-5)
cm.dispose();
}else{
cm.sendOk("you dont have enough vote points!");
cm.dispose();
}
}else if (selection == 116){
if (cm.getvotePoints() >= 5){
cm.gainItem(1482013, 1);
cm.gainvotePoints(-5)
cm.dispose();
}else{
cm.sendOk("you dont have enough vote points!");
cm.dispose();
}
}else if (selection == 117){
if (cm.getvotePoints() >= 5){
cm.gainItem(1492013, 1);
cm.gainvotePoints(-5)
cm.dispose();
}else{
cm.sendOk("you dont have enough vote points!");
cm.dispose();
}
}else if (selection == 118){
if (cm.getvotePoints() >= 10){
cm.gainItem(01302086, 1);
cm.gainvotePoints(-10)
cm.dispose();
}else{
cm.sendOk("you dont have enough vote points!");
cm.dispose();
}
}else if (selection == 119){
if (cm.getvotePoints() >= 10){
cm.gainItem(01312038, 1);
cm.gainvotePoints(-10)
cm.dispose();
}else{
cm.sendOk("you dont have enough vote points!");
cm.dispose();
}
}else if (selection == 120){
if (cm.getvotePoints() >= 10){
cm.gainItem(01322061, 1);
cm.gainvotePoints(-10)
cm.dispose();
}else{
cm.sendOk("you dont have enough vote points!");
cm.dispose();
}
}else if (selection == 121){
if (cm.getvotePoints() >= 10){
cm.gainItem(1332075, 1);
cm.gainvotePoints(-10)
cm.dispose();
}else{
cm.sendOk("you dont have enough vote points!");
cm.dispose();
}
}else if (selection == 122){
if (cm.getvotePoints() >= 10){
cm.gainItem(1332076, 1);
cm.gainvotePoints(-10)
cm.dispose();
}else{
cm.sendOk("you dont have enough vote points!");
cm.dispose();
}
}else if (selection == 123){
if (cm.getvotePoints() >= 10){
cm.gainItem(1372045, 1);
cm.gainvotePoints(-10)
cm.dispose();
}else{
cm.sendOk("you dont have enough vote points!");
cm.dispose();
}
}else if (selection == 124){
if (cm.getvotePoints() >= 10){
cm.gainItem(1382059, 1);
cm.gainvotePoints(-10)
cm.dispose();
}else{
cm.sendOk("you dont have enough vote points!");
cm.dispose();
}
}else if (selection == 125){
if (cm.getvotePoints() >= 10){
cm.gainItem(1402047, 1);
cm.gainvotePoints(-10)
cm.dispose();
}else{
cm.sendOk("you dont have enough vote points!");
cm.dispose();
}
}else if (selection == 126){
if (cm.getvotePoints() >= 10){
cm.gainItem(1412034, 1);
cm.gainvotePoints(-10)
cm.dispose();
}else{
cm.sendOk("you dont have enough vote points!");
cm.dispose();
}
}else if (selection == 127){
if (cm.getvotePoints() >= 10){
cm.gainItem(1422038, 1);
cm.gainvotePoints(-10)
cm.dispose();
}else{
cm.sendOk("you dont have enough vote points!");
cm.dispose();
}
}else if (selection == 128){
if (cm.getvotePoints() >= 10){
cm.gainItem(1432049, 1);
cm.gainvotePoints(-10)
cm.dispose();
}else{
cm.sendOk("you dont have enough vote points!");
cm.dispose();
}
}else if (selection == 129){
if (cm.getvotePoints() >= 10){
cm.gainItem(1442067, 1);
cm.gainvotePoints(-10)
cm.dispose();
}else{
cm.sendOk("you dont have enough vote points!");
cm.dispose();
}
}else if (selection == 130){
if (cm.getvotePoints() >= 10){
cm.gainItem(1452059, 1);
cm.gainvotePoints(-10)
cm.dispose();
}else{
cm.sendOk("you dont have enough vote points!");
cm.dispose();
}
}else if (selection == 131){
if (cm.getvotePoints() >= 10){
cm.gainItem(1462051, 1);
cm.gainvotePoints(-10)
cm.dispose();
}else{
cm.sendOk("you dont have enough vote points!");
cm.dispose();
}
}else if (selection == 132){
if (cm.getvotePoints() >= 10){
cm.gainItem(1472071, 1);
cm.gainvotePoints(-10)
cm.dispose();
}else{
cm.sendOk("you dont have enough vote points!");
cm.dispose();
}
}else if (selection == 133){
if (cm.getvotePoints() >= 10){
cm.gainItem(1482024, 1);
cm.gainvotePoints(-10)
cm.dispose();
}else{
cm.sendOk("you dont have enough vote points!");
cm.dispose();
}
}else if (selection == 134){
if (cm.getvotePoints() >= 10){
cm.gainItem(1492025, 1);
cm.gainvotePoints(-10)
cm.dispose();
}else{
cm.sendOk("you dont have enough vote points!");
cm.dispose();
}
}
}
}
10-04-11
xXSnipeDownOo
Re: [Add On] Vote point exchange npc
Nice release.
Spoiler:
BeenReleasedBefore (:
PHP Code:
/*vote point exchange npc Exchanges votepoints for white scrolls dragon weapons and reverse weapons. @@author shadowzzz*/
function start() { cm.sendSimple("Welcome to the vote point exchange npc you have.#r" +cm.getvotePoints() +"#k votepoints Go to the website and vote to gain votepoints. What would u like to buy with your votepoints? #d\r\n#L0# Buy White scrolls 3-6 votepoints #b\r\n#L1# Buy Dragon weapons 5 votepoints #r\r\n#L2# Buy Reverse Weapons 10 votepoints "); }
function action (m,t,s) { if (m < 1) { cm.dispose(); return; } else { status++; } if (status == 1) { sel = s; if (s == 0) { cm.sendSimple("#eHow many whitescrolls would u like? #r\r\n#L0# 1 White scroll for 3 votepoints #b\r\n\#100# 5 White scrolls for 15 points"); } else if (s == 1){ cm.sendSimple("#b\r\n#L1# Dragon carabella#b\r\n\#L2# Dragon Axe#b\r\n\#L3# Dragon Mace#b\r\n\#L4# Dragon Wand#b\r\n\#L5# Dragon Staff #b\r\n\#L6# Dragon Kanzir #b\r\n\#L7#Dragon Claymore #b\r\n\#L8# Dragon battleaxe #b\r\n\#L9# Dragon flame #b\r\n\#L10# Dragon faltizan #b\r\n\#L11# Dragon Chelbrid #b\r\n\#L12# Dragon shinerbow #b\r\n\#L13# Dragon ShinerCrossbow #b\r\n\#L14# Dragon Purple Sleeve #b\r\n\#L15# Dragon Slash Claw #b\r\n\#L16# Dragonfire Revolver"); } else if (s == 2){ cm.sendSimple("#b\r\n\#L17# Reverse Executioners #b\r\n\#L18# Reverse Bardiche #b\r\n\#L19# Reverse Allergando #b\r\n\#L20# Reverse Pescas #b\r\n\#L21# Reverse Killic #b\r\n\#L22# Reverse EnrealTear #b\r\n\#L23# Reverse Aeas Hand #b\r\n\#L24# Reverse Neibelheim #b\r\n\#L25# Reverse Tabarzin #b\r\n\#L26# Reverse Bellocce #b\r\n\#L27# Reverse Alchupiz #b\r\n\#L28# Reverse Diesra #b\r\n\#L29# Reverse Engaw #b\r\n\#L30# Reverse Black Beauty #b\r\n\#L31# Reverse Lampion #b\r\n\#L32# Reverse Equinox #b\r\n\#L33# Reverse Blindness"); } } else if (status == 2) { if (sel == 100) { if (cm.getvotePoints() >= 6) { cm.gainvotePoints(-6); cm.gainItem(2340000, 5); } else { cm.sendOk(" You don't have 6 vote points. "); } } else { if (cm.getvotePoints() >= points[s]) { cm.gainvotePoints(-points[s]); cm.gainItem(items[s], 1); } else { cm.sendOk(" You don't have " + points[s] + " vote points. "); } } cm.dispose(); } }
10-04-11
Soulfist
Re: [Add On] Vote point exchange npc
Quote:
Originally Posted by xXSnipeDownOo
Nice release.
Spoiler:
BeenReleasedBefore (:
PHP Code:
/*vote point exchange npc
Exchanges votepoints for white scrolls dragon weapons and reverse weapons.
@@author shadowzzz*/
function start() {
cm.sendSimple("Welcome to the vote point exchange npc you have.#r" +cm.getvotePoints() +"#k votepoints Go to the website and vote to gain votepoints. What would u like to buy with your votepoints? #d\r\n#L0# Buy White scrolls 3-6 votepoints #b\r\n#L1# Buy Dragon weapons 5 votepoints #r\r\n#L2# Buy Reverse Weapons 10 votepoints ");
}
function action (m,t,s) {
if (m < 1) {
cm.dispose();
return;
} else {
status++;
}
if (status == 1) {
sel = s;
if (s == 0) {
cm.sendSimple("#eHow many whitescrolls would u like? #r\r\n#L0# 1 White scroll for 3 votepoints #b\r\n\#100# 5 White scrolls for 15 points");
} else if (s == 1){
cm.sendSimple("#b\r\n#L1# Dragon carabella#b\r\n\#L2# Dragon Axe#b\r\n\#L3# Dragon Mace#b\r\n\#L4# Dragon Wand#b\r\n\#L5# Dragon Staff #b\r\n\#L6# Dragon Kanzir #b\r\n\#L7#Dragon Claymore #b\r\n\#L8# Dragon battleaxe #b\r\n\#L9# Dragon flame #b\r\n\#L10# Dragon faltizan #b\r\n\#L11# Dragon Chelbrid #b\r\n\#L12# Dragon shinerbow #b\r\n\#L13# Dragon ShinerCrossbow #b\r\n\#L14# Dragon Purple Sleeve #b\r\n\#L15# Dragon Slash Claw #b\r\n\#L16# Dragonfire Revolver");
} else if (s == 2){
cm.sendSimple("#b\r\n\#L17# Reverse Executioners #b\r\n\#L18# Reverse Bardiche #b\r\n\#L19# Reverse Allergando #b\r\n\#L20# Reverse Pescas #b\r\n\#L21# Reverse Killic #b\r\n\#L22# Reverse EnrealTear #b\r\n\#L23# Reverse Aeas Hand #b\r\n\#L24# Reverse Neibelheim #b\r\n\#L25# Reverse Tabarzin #b\r\n\#L26# Reverse Bellocce #b\r\n\#L27# Reverse Alchupiz #b\r\n\#L28# Reverse Diesra #b\r\n\#L29# Reverse Engaw #b\r\n\#L30# Reverse Black Beauty #b\r\n\#L31# Reverse Lampion #b\r\n\#L32# Reverse Equinox #b\r\n\#L33# Reverse Blindness");
}
} else if (status == 2) {
if (sel == 100) {
if (cm.getvotePoints() >= 6) {
cm.gainvotePoints(-6);
cm.gainItem(2340000, 5);
} else {
cm.sendOk(" You don't have 6 vote points. ");
}
} else {
if (cm.getvotePoints() >= points[s]) {
cm.gainvotePoints(-points[s]);
cm.gainItem(items[s], 1);
} else {
cm.sendOk(" You don't have " + points[s] + " vote points. ");
}
}
cm.dispose();
}
}
I didn't really understand you travis, quit being weird :*:.
@OP: Good job for a beginner, the important thing is it serves its purpose and it works :wink: (am i right?, wait i am right?)
10-04-11
Xuraz
Re: [Add On] Vote point exchange npc
lol, Nice Release! :)
10-04-11
shadowzzz
Re: [Add On] Vote point exchange npc
Quote:
Originally Posted by xXSnipeDownOo
Nice release.
Spoiler:
BeenReleasedBefore (:
PHP Code:
/*vote point exchange npc
Exchanges votepoints for white scrolls dragon weapons and reverse weapons.
@@author shadowzzz*/
function start() {
cm.sendSimple("Welcome to the vote point exchange npc you have.#r" +cm.getvotePoints() +"#k votepoints Go to the website and vote to gain votepoints. What would u like to buy with your votepoints? #d\r\n#L0# Buy White scrolls 3-6 votepoints #b\r\n#L1# Buy Dragon weapons 5 votepoints #r\r\n#L2# Buy Reverse Weapons 10 votepoints ");
}
function action (m,t,s) {
if (m < 1) {
cm.dispose();
return;
} else {
status++;
}
if (status == 1) {
sel = s;
if (s == 0) {
cm.sendSimple("#eHow many whitescrolls would u like? #r\r\n#L0# 1 White scroll for 3 votepoints #b\r\n\#100# 5 White scrolls for 15 points");
} else if (s == 1){
cm.sendSimple("#b\r\n#L1# Dragon carabella#b\r\n\#L2# Dragon Axe#b\r\n\#L3# Dragon Mace#b\r\n\#L4# Dragon Wand#b\r\n\#L5# Dragon Staff #b\r\n\#L6# Dragon Kanzir #b\r\n\#L7#Dragon Claymore #b\r\n\#L8# Dragon battleaxe #b\r\n\#L9# Dragon flame #b\r\n\#L10# Dragon faltizan #b\r\n\#L11# Dragon Chelbrid #b\r\n\#L12# Dragon shinerbow #b\r\n\#L13# Dragon ShinerCrossbow #b\r\n\#L14# Dragon Purple Sleeve #b\r\n\#L15# Dragon Slash Claw #b\r\n\#L16# Dragonfire Revolver");
} else if (s == 2){
cm.sendSimple("#b\r\n\#L17# Reverse Executioners #b\r\n\#L18# Reverse Bardiche #b\r\n\#L19# Reverse Allergando #b\r\n\#L20# Reverse Pescas #b\r\n\#L21# Reverse Killic #b\r\n\#L22# Reverse EnrealTear #b\r\n\#L23# Reverse Aeas Hand #b\r\n\#L24# Reverse Neibelheim #b\r\n\#L25# Reverse Tabarzin #b\r\n\#L26# Reverse Bellocce #b\r\n\#L27# Reverse Alchupiz #b\r\n\#L28# Reverse Diesra #b\r\n\#L29# Reverse Engaw #b\r\n\#L30# Reverse Black Beauty #b\r\n\#L31# Reverse Lampion #b\r\n\#L32# Reverse Equinox #b\r\n\#L33# Reverse Blindness");
}
} else if (status == 2) {
if (sel == 100) {
if (cm.getvotePoints() >= 6) {
cm.gainvotePoints(-6);
cm.gainItem(2340000, 5);
} else {
cm.sendOk(" You don't have 6 vote points. ");
}
} else {
if (cm.getvotePoints() >= points[s]) {
cm.gainvotePoints(-points[s]);
cm.gainItem(items[s], 1);
} else {
cm.sendOk(" You don't have " + points[s] + " vote points. ");
}
}
cm.dispose();
}
}
lol ty snipe u made it more efficent useing varables and arrays im new to it so i dunno how to use those and actually make it work yet im actually reading shawns guide to learn npc scripting.
@soulfist yea it works 99% the way i coded it only problem was if u just click it and dont click one of the options u have to use a @dispose command to talk to other npcs.
@xuraz Thanks
10-04-11
XxОsirisxX
Re: [Add On] Vote point exchange npc
Quote:
Originally Posted by xXSnipeDownOo
Nice release.
Spoiler:
BeenReleasedBefore (:
PHP Code:
/*vote point exchange npc Exchanges votepoints for white scrolls dragon weapons and reverse weapons. @@author shadowzzz*/
function start() { cm.sendSimple("Welcome to the vote point exchange npc you have.#r" +cm.getvotePoints() +"#k votepoints Go to the website and vote to gain votepoints. What would u like to buy with your votepoints? #d\r\n#L0# Buy White scrolls 3-6 votepoints #b\r\n#L1# Buy Dragon weapons 5 votepoints #r\r\n#L2# Buy Reverse Weapons 10 votepoints "); }
function action (m,t,s) { if (m < 1) { cm.dispose(); return; } else { status++; } if (status == 1) { sel = s; if (s == 0) { cm.sendSimple("#eHow many whitescrolls would u like? #r\r\n#L0# 1 White scroll for 3 votepoints #b\r\n\#100# 5 White scrolls for 15 points"); } else if (s == 1){ cm.sendSimple("#b\r\n#L1# Dragon carabella#b\r\n\#L2# Dragon Axe#b\r\n\#L3# Dragon Mace#b\r\n\#L4# Dragon Wand#b\r\n\#L5# Dragon Staff #b\r\n\#L6# Dragon Kanzir #b\r\n\#L7#Dragon Claymore #b\r\n\#L8# Dragon battleaxe #b\r\n\#L9# Dragon flame #b\r\n\#L10# Dragon faltizan #b\r\n\#L11# Dragon Chelbrid #b\r\n\#L12# Dragon shinerbow #b\r\n\#L13# Dragon ShinerCrossbow #b\r\n\#L14# Dragon Purple Sleeve #b\r\n\#L15# Dragon Slash Claw #b\r\n\#L16# Dragonfire Revolver"); } else if (s == 2){ cm.sendSimple("#b\r\n\#L17# Reverse Executioners #b\r\n\#L18# Reverse Bardiche #b\r\n\#L19# Reverse Allergando #b\r\n\#L20# Reverse Pescas #b\r\n\#L21# Reverse Killic #b\r\n\#L22# Reverse EnrealTear #b\r\n\#L23# Reverse Aeas Hand #b\r\n\#L24# Reverse Neibelheim #b\r\n\#L25# Reverse Tabarzin #b\r\n\#L26# Reverse Bellocce #b\r\n\#L27# Reverse Alchupiz #b\r\n\#L28# Reverse Diesra #b\r\n\#L29# Reverse Engaw #b\r\n\#L30# Reverse Black Beauty #b\r\n\#L31# Reverse Lampion #b\r\n\#L32# Reverse Equinox #b\r\n\#L33# Reverse Blindness"); } } else if (status == 2) { if (sel == 100) { if (cm.getvotePoints() >= 6) { cm.gainvotePoints(-6); cm.gainItem(2340000, 5); } else { cm.sendOk(" You don't have 6 vote points. "); } } else { if (cm.getvotePoints() >= points[s]) { cm.gainvotePoints(-points[s]); cm.gainItem(items[s], 1); } else { cm.sendOk(" You don't have " + points[s] + " vote points. "); } } cm.dispose(); } }
This script have some mistakes...
Such as no "L" in selection... wrong vote point values for white scroll... also it will never reach the white scroll part, so you will never get one. Oh, and sel is not defined.
function start() { cm.sendSimple("Welcome to the vote point exchange npc you have.#r" +cm.getvotePoints() +"#k votepoints Go to the website and vote to gain votepoints. What would u like to buy with your votepoints? #d\r\n#L0# Buy White scrolls 3-6 votepoints #b\r\n#L1# Buy Dragon weapons 5 votepoints #r\r\n#L2# Buy Reverse Weapons 10 votepoints "); }
function action (mode, type, selection) { status++; if (mode < 1) { cm.dispose(); return; } if (status == 0) { sel = selection; var text = ""; if (sel == 0) { cm.sendSimple("How many #b#t2340000##k would you like? #b\r\n#L0#1 #t2340000# for 3 vote points.\r\n\#L1#5 #t2340000#s for 15 vote points."); } else { var text = "Pick up your " + (sel == 1 ? "Dragon" : "Reverse") + " weapon.#b\r\n"; for (var i = 0; i < items[sel - 1].length; text += "\r\n#L" + i + "##i" + items[sel - 1][i] + "# #t" + items[sel - 1][i] + "#.", i++); cm.sendSimple(text); } } else if (status == 1) { if (sel == 0) if (cm.getVotePoints() >= (selection << 2 | 1) * 3) { cm.gainVotePoints(-((selection << 2 | 1) * 3)); cm.gainItem(2340000, selection << 2 | 1); } else cm.sendOk("You don't have " + ((selection << 2 | 1) * 3) + " vote points. "); else { if (cm.getvotePoints() >= 5 << sel - 1) { cm.gainvotePoints(-(5 << sel - 1)); cm.gainItem(items[sel - 1][selection], 1); } else cm.sendOk(" You don't have " + (5 << sel - 1) + " vote points. "); } cm.dispose(); } }
:closedeyes:
10-04-11
Soulfist
Re: [Add On] Vote point exchange npc
Quote:
Originally Posted by XxОsirisxX
This script have some mistakes...
Such as no "L" in selection... wrong vote point values for white scroll... also it will never reach the white scroll part, so you will never get one. Oh, and sel is not defined.
function start() {
cm.sendSimple("Welcome to the vote point exchange npc you have.#r" +cm.getvotePoints() +"#k votepoints Go to the website and vote to gain votepoints. What would u like to buy with your votepoints? #d\r\n#L0# Buy White scrolls 3-6 votepoints #b\r\n#L1# Buy Dragon weapons 5 votepoints #r\r\n#L2# Buy Reverse Weapons 10 votepoints ");
}
function action (mode, type, selection) {
status++;
if (mode < 1) {
cm.dispose();
return;
}
if (status == 0) {
sel = selection;
var text = "";
if (sel == 0) {
cm.sendSimple("How many #b#t2340000##k would you like? #b\r\n#L0#1 #t2340000# for 3 vote points.\r\n\#L1#5 #t2340000#s for 15 vote points.");
} else {
var text = "Pick up your " + (sel == 1 ? "Dragon" : "Reverse") + " weapon.#b\r\n";
for (var i = 0; i < items[sel - 1].length; text += "\r\n#L" + i + "##i" + items[sel - 1][i] + "# #t" + items[sel - 1][i] + "#.", i++);
cm.sendSimple(text);
}
} else if (status == 1) {
if (sel == 0)
if (cm.getVotePoints() >= (selection << 2 | 1) * 3) {
cm.gainVotePoints(-((selection << 2 | 1) * 3));
cm.gainItem(2340000, selection << 2 | 1);
} else
cm.sendOk("You don't have " + ((selection << 2 | 1) * 3) + " vote points. ");
else {
if (cm.getvotePoints() >= 5 << sel - 1) {
cm.gainvotePoints(-(5 << sel - 1));
cm.gainItem(items[sel - 1][selection], 1);
} else
cm.sendOk(" You don't have " + (5 << sel - 1) + " vote points. ");
}
cm.dispose();
}
}
:closedeyes:
SHOW OFF :drool:
Why are you using bitwise shift operators! So unncessary you showoff :blushing:
11-04-11
XxОsirisxX
Re: [Add On] Vote point exchange npc
Quote:
Originally Posted by Soulfist
SHOW OFF :drool:
Why are you using bitwise shift operators! So unncessary you showoff :blushing:
Ermmm, for this case, it's necessary. You just talked again without knowing. 2nd check is the only one that it wasn't necessary.
11-04-11
Soulfist
Re: [Add On] Vote point exchange npc
Quote:
Originally Posted by XxОsirisxX
Ermmm, for this case, it's necessary. You just talked again without knowing. 2nd check is the only one that it wasn't necessary.
Explain how it was necessary, it doesn't look like it to me.
11-04-11
shadowzzz
Re: [Add On] Vote point exchange npc
I really have no idea what you guys are talking about lol. But i would love to know what youguys are talking about how about enlightening me :D?
11-04-11
XxОsirisxX
Re: [Add On] Vote point exchange npc
Quote:
Originally Posted by Soulfist
Explain how it was necessary, it doesn't look like it to me.
Tell me the reasons you thinks so.. so I can tell you're not talking out of your ass...
11-04-11
imDiogo
Re: [Add On] Vote point exchange npc
tested on my server doesnt work, says npc doesnt work property
11-04-11
shadowzzz
Re: [Add On] Vote point exchange npc
Quote:
Originally Posted by imDiogo
tested on my server doesnt work, says npc doesnt work property
Which script did u use? the edited one? or mine? if u used mine it works 99% i know for sure cuz i done exstencive testing on it before i posted it. The modified versions that they made i have no idea about those i havent tried them. You may need to add the methods in your source for votepoints if u dont have it coded.
11-04-11
GreekMaple
Re: [Add On] Vote point exchange npc
Quote:
Originally Posted by imDiogo
tested on my server doesnt work, says npc doesnt work property
You still need the functions getvotePoints, and so on.
11-04-11
imDiogo
Re: [Add On] Vote point exchange npc
yeah ik, but the npc doesnt even start.
11-04-11
XxОsirisxX
Re: [Add On] Vote point exchange npc
Quote:
Originally Posted by imDiogo
yeah ik, but the npc doesnt even start.
Oh dear God.. you're really lame... learn Java before just copy pasting without having idea of what you're doing...
It doesn't works because you don't have the method... someone else even told you that... God...
12-04-11
Soulfist
Re: [Add On] Vote point exchange npc
Quote:
Originally Posted by XxОsirisxX
Tell me the reasons you thinks so.. so I can tell you're not talking out of your ass...
That is the part (along with the other check) that didn't really make sense to use it to me, why are you shifting selection 2 | 1 bits to the left? I understand why your multiplying it by 3, its cause of 3 vote points, but there has to be another way to handle it without using that. It just doesn't make sense to use it here, thats all I'm saying, the show-off thing was more of a joke :ott1:
12-04-11
XxОsirisxX
Re: [Add On] Vote point exchange npc
Quote:
Originally Posted by Soulfist
That is the part (along with the other check) that didn't really make sense to use it to me, why are you shifting selection 2 | 1 bits to the left? I understand why your multiplying it by 3, its cause of 3 vote points, but there has to be another way to handle it without using that. It just doesn't make sense to use it here, thats all I'm saying, the show-off thing was more of a joke :ott1:
You tell me an arithmetic way to do this...
I couldn't thinks of a easier way to do so... it wasn't to show off, it's just better.
12-04-11
Soulfist
Re: [Add On] Vote point exchange npc
Quote:
Originally Posted by XxОsirisxX
You tell me an arithmetic way to do this...
I couldn't thinks of a easier way to do so... it wasn't to show off, it's just better.
To be honest im bad at maths, I just know theres another way :D. Your probably right though, its simpler than the way i was thinking of. And like i said. Calling you a show off was a joke :cool:
12-04-11
imDiogo
Re: [Add On] Vote point exchange npc
this npc fucked my server!!!
12-04-11
shadowzzz
Re: [Add On] Vote point exchange npc
Quote:
Originally Posted by imDiogo
this npc fucked my server!!!
And how did it do that? If your getting error nulled exception 51 or something u need to add a ? at the end of the long line of ? marks i forgot to put that up there in the method guide.
13-04-11
aikg2k3
Re: [Add On] Vote point exchange npc
Did your server get pregnant?
sel isn't defined, so idk what people expect this npc to do. I'll try it though, with Osiris' revisions and some of my own.
13-04-11
Costar
Re: [Add On] Vote point exchange npc
Can this be used for v75 :o ?
Noob question soz T.T
13-04-11
shadowzzz
Re: [Add On] Vote point exchange npc
Quote:
Originally Posted by Costar
Can this be used for v75 :o ?
Noob question soz T.T
it can u may have to add the method but v75 source codeing is diffrent.
@aikg2k3 It exchanges vote points for items... obviously and my version works perfectly fine it just isnt as short as the others.
12-05-11
LegitBoss
Re: [Add On] Vote point exchange npc
i get errors when i run my server. It says, it can not find "vote point" collumn. But i have vote point collumn....