[Add On] Vote point exchange npc

Page 1 of 2 12 LastLast
Results 1 to 25 of 49
  1. #1
    Sorcerer Supreme shadowzzz is offline
    Member +Rank
    May 2007 Join Date
    SomewhereLocation
    484Posts

    [Add On] Vote point exchange npc

    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();
            }
         }
       }
     }
    Last edited by shadowzzz; 12-04-11 at 08:15 PM.


  2. #2
    -Error- xXSnipeDownOo is offline
    Grand MasterRank
    Jul 2010 Join Date
    885Posts

    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*/

    var status 0;
    var 
    points = [355555555555555551010101010101010101010101010101010];
    var 
    items = [2340000130205913120311322052137203213820361332049140203614120261422028143203814420451452044146203914720521482013149201313020861312038132206113320751332076137204513820591402047141203414220381432049144206714520591462051147207114820241492025];

    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 (
    1) {
            
    cm.dispose();
            return;
        } else {
            
    status++;
        }
        if (
    status == 1) {
        
    sel s;
            if (
    == 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 (
    == 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 (
    == 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(23400005);
                } 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();
        }


  3. #3
    Grand Master Soulfist is offline
    Grand MasterRank
    Dec 2010 Join Date
    a hovelLocation
    1,835Posts

    Re: [Add On] Vote point exchange npc

    Quote Originally Posted by xXSnipeDownOo View Post
    Nice release.

    Spoiler:

    BeenReleasedBefore (:
    PHP Code:
    /*vote point exchange npc
    Exchanges votepoints for white scrolls dragon weapons and reverse weapons.
    @@author shadowzzz*/

    var status 0;
    var 
    points = [355555555555555551010101010101010101010101010101010];
    var 
    items = [2340000130205913120311322052137203213820361332049140203614120261422028143203814420451452044146203914720521482013149201313020861312038132206113320751332076137204513820591402047141203414220381432049144206714520591462051147207114820241492025];

    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 (
    1) {
            
    cm.dispose();
            return;
        } else {
            
    status++;
        }
        if (
    status == 1) {
        
    sel s;
            if (
    == 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 (
    == 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 (
    == 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(23400005);
                } 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 (am i right?, wait i am right?)

  4. #4
    Elite Member Xuraz is offline
    Member +Rank
    Apr 2011 Join Date
    SwedenLocation
    177Posts

    Re: [Add On] Vote point exchange npc

    lol, Nice Release! :)

  5. #5
    Sorcerer Supreme shadowzzz is offline
    Member +Rank
    May 2007 Join Date
    SomewhereLocation
    484Posts

    Re: [Add On] Vote point exchange npc

    Quote Originally Posted by xXSnipeDownOo View Post
    Nice release.

    Spoiler:

    BeenReleasedBefore (:
    PHP Code:
    /*vote point exchange npc
    Exchanges votepoints for white scrolls dragon weapons and reverse weapons.
    @@author shadowzzz*/
     
    var status 0;
    var 
    points = [355555555555555551010101010101010101010101010101010];
    var 
    items = [2340000130205913120311322052137203213820361332049140203614120261422028143203814420451452044146203914720521482013149201313020861312038132206113320751332076137204513820591402047141203414220381432049144206714520591462051147207114820241492025];
     
    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 (
    1) {
            
    cm.dispose();
            return;
        } else {
            
    status++;
        }
        if (
    status == 1) {
        
    sel s;
            if (
    == 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 (
    == 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 (
    == 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(23400005);
                } 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
    Last edited by shadowzzz; 10-04-11 at 05:30 PM.

  6. #6
    Grand Master XxОsirisxX is offline
    Grand MasterRank
    Aug 2009 Join Date
    2,727Posts

    Re: [Add On] Vote point exchange npc

    Quote Originally Posted by xXSnipeDownOo View Post
    Nice release.

    Spoiler:

    BeenReleasedBefore (:
    PHP Code:
    /*vote point exchange npc
    Exchanges votepoints for white scrolls dragon weapons and reverse weapons.
    @@author shadowzzz*/

    var status 0;
    var 
    points = [355555555555555551010101010101010101010101010101010];
    var 
    items = [2340000130205913120311322052137203213820361332049140203614120261422028143203814420451452044146203914720521482013149201313020861312038132206113320751332076137204513820591402047141203414220381432049144206714520591462051147207114820241492025];

    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 (
    1) {
            
    cm.dispose();
            return;
        } else {
            
    status++;
        }
        if (
    status == 1) {
        
    sel s;
            if (
    == 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 (
    == 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 (
    == 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(23400005);
                } 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.

    PHP Code:
    var status = -1;
    var 
    items = [[1302059131203113220521372032138203613320491402036141202614220281432038144204514520441462039147205214820131492013], [13020861312038132206113320751332076137204513820591402047141203414220381432049144206714520591462051147207114820241492025]];
    var 
    sel;

    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 (modetypeselection) {
        
    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 == "Dragon" "Reverse") + " weapon.#b\r\n";
                for (var 
    0items[sel 1].lengthtext += "\r\n#L" "##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 << 1) * 3) {
                    
    cm.gainVotePoints(-((selection << 1) * 3));
                    
    cm.gainItem(2340000selection << 1);
                } else
                    
    cm.sendOk("You don't have " + ((selection << 1) * 3) + " vote points. ");
            else {
                if (
    cm.getvotePoints() >= << sel 1) {
                    
    cm.gainvotePoints(-(<< sel 1));
                    
    cm.gainItem(items[sel 1][selection], 1);
                } else
                    
    cm.sendOk(" You don't have " + (<< sel 1) + " vote points. ");
            }
            
    cm.dispose();
        }

    Last edited by XxОsirisxX; 10-04-11 at 06:22 PM.

  7. #7
    Grand Master Soulfist is offline
    Grand MasterRank
    Dec 2010 Join Date
    a hovelLocation
    1,835Posts

    Re: [Add On] Vote point exchange npc

    Quote Originally Posted by XxОsirisxX View Post
    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.

    PHP Code:
    var status = -1;
    var 
    items = [[1302059131203113220521372032138203613320491402036141202614220281432038144204514520441462039147205214820131492013], [13020861312038132206113320751332076137204513820591402047141203414220381432049144206714520591462051147207114820241492025]];
    var 
    sel;

    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 (modetypeselection) {
        
    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 == "Dragon" "Reverse") + " weapon.#b\r\n";
                for (var 
    0items[sel 1].lengthtext += "\r\n#L" "##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 << 1) * 3) {
                    
    cm.gainVotePoints(-((selection << 1) * 3));
                    
    cm.gainItem(2340000selection << 1);
                } else
                    
    cm.sendOk("You don't have " + ((selection << 1) * 3) + " vote points. ");
            else {
                if (
    cm.getvotePoints() >= << sel 1) {
                    
    cm.gainvotePoints(-(<< sel 1));
                    
    cm.gainItem(items[sel 1][selection], 1);
                } else
                    
    cm.sendOk(" You don't have " + (<< sel 1) + " vote points. ");
            }
            
    cm.dispose();
        }


    SHOW OFF

    Why are you using bitwise shift operators! So unncessary you showoff

  8. #8
    Grand Master XxОsirisxX is offline
    Grand MasterRank
    Aug 2009 Join Date
    2,727Posts

    Re: [Add On] Vote point exchange npc

    Quote Originally Posted by Soulfist View Post
    SHOW OFF

    Why are you using bitwise shift operators! So unncessary you showoff
    Ermmm, for this case, it's necessary. You just talked again without knowing. 2nd check is the only one that it wasn't necessary.

  9. #9
    Grand Master Soulfist is offline
    Grand MasterRank
    Dec 2010 Join Date
    a hovelLocation
    1,835Posts

    Re: [Add On] Vote point exchange npc

    Quote Originally Posted by XxОsirisxX View Post
    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.

  10. #10
    Sorcerer Supreme shadowzzz is offline
    Member +Rank
    May 2007 Join Date
    SomewhereLocation
    484Posts

    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. #11
    Grand Master XxОsirisxX is offline
    Grand MasterRank
    Aug 2009 Join Date
    2,727Posts

    Re: [Add On] Vote point exchange npc

    Quote Originally Posted by Soulfist View Post
    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...

  12. #12
    Banned imDiogo is offline
    BannedRank
    Apr 2011 Join Date
    LA, CALIFORNIA.Location
    216Posts

    Re: [Add On] Vote point exchange npc

    tested on my server doesnt work, says npc doesnt work property

  13. #13
    Sorcerer Supreme shadowzzz is offline
    Member +Rank
    May 2007 Join Date
    SomewhereLocation
    484Posts

    Re: [Add On] Vote point exchange npc

    Quote Originally Posted by imDiogo View Post
    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.

  14. #14
    Elite Member GreekMaple is offline
    Member +Rank
    Feb 2011 Join Date
    226Posts

    Re: [Add On] Vote point exchange npc

    Quote Originally Posted by imDiogo View Post
    tested on my server doesnt work, says npc doesnt work property
    You still need the functions getvotePoints, and so on.

  15. #15
    Banned imDiogo is offline
    BannedRank
    Apr 2011 Join Date
    LA, CALIFORNIA.Location
    216Posts

    Re: [Add On] Vote point exchange npc

    yeah ik, but the npc doesnt even start.

  16. #16
    Grand Master XxОsirisxX is offline
    Grand MasterRank
    Aug 2009 Join Date
    2,727Posts

    Re: [Add On] Vote point exchange npc

    Quote Originally Posted by imDiogo View Post
    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...

  17. #17
    Grand Master Soulfist is offline
    Grand MasterRank
    Dec 2010 Join Date
    a hovelLocation
    1,835Posts

    Re: [Add On] Vote point exchange npc

    Quote Originally Posted by XxОsirisxX View Post
    Tell me the reasons you thinks so.. so I can tell you're not talking out of your ass...

    PHP Code:
    if (cm.getVotePoints() >= (selection << 1) * 3) { 
    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

  18. #18
    Grand Master XxОsirisxX is offline
    Grand MasterRank
    Aug 2009 Join Date
    2,727Posts

    Re: [Add On] Vote point exchange npc

    Quote Originally Posted by Soulfist View Post
    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
    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.

  19. #19
    Grand Master Soulfist is offline
    Grand MasterRank
    Dec 2010 Join Date
    a hovelLocation
    1,835Posts

    Re: [Add On] Vote point exchange npc

    Quote Originally Posted by XxОsirisxX View Post
    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

  20. #20
    Banned imDiogo is offline
    BannedRank
    Apr 2011 Join Date
    LA, CALIFORNIA.Location
    216Posts

    Re: [Add On] Vote point exchange npc

    this npc fucked my server!!!

  21. #21
    Sorcerer Supreme shadowzzz is offline
    Member +Rank
    May 2007 Join Date
    SomewhereLocation
    484Posts

    Re: [Add On] Vote point exchange npc

    Quote Originally Posted by imDiogo View Post
    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.
    Last edited by shadowzzz; 12-04-11 at 08:15 PM.

  22. #22
    Elite Member aikg2k3 is offline
    Member +Rank
    Apr 2011 Join Date
    112Posts

    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.

  23. #23
    Member Costar is offline
    MemberRank
    Feb 2011 Join Date
    31Posts

    Re: [Add On] Vote point exchange npc

    Can this be used for v75 :o ?
    Noob question soz T.T

  24. #24
    Sorcerer Supreme shadowzzz is offline
    Member +Rank
    May 2007 Join Date
    SomewhereLocation
    484Posts

    Re: [Add On] Vote point exchange npc

    Quote Originally Posted by Costar View Post
    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.

  25. #25
    Newbie LegitBoss is offline
    MemberRank
    May 2011 Join Date
    24Posts

    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....



Page 1 of 2 12 LastLast

Advertisement